text
stringlengths 1
22.8M
|
|---|
```c++
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree. An additional grant
// of patent rights can be found in the PATENTS file in the same directory.
#ifndef ROCKSDB_LITE
#include "db/compacted_db_impl.h"
#include "db/db_impl.h"
#include "db/version_set.h"
#include "table/get_context.h"
namespace rocksdb {
extern void MarkKeyMayExist(void* arg);
extern bool SaveValue(void* arg, const ParsedInternalKey& parsed_key,
const Slice& v, bool hit_and_return);
CompactedDBImpl::CompactedDBImpl(
const DBOptions& options, const std::string& dbname)
: DBImpl(options, dbname) {
}
CompactedDBImpl::~CompactedDBImpl() {
}
size_t CompactedDBImpl::FindFile(const Slice& key) {
size_t left = 0;
size_t right = files_.num_files - 1;
while (left < right) {
size_t mid = (left + right) >> 1;
const FdWithKeyRange& f = files_.files[mid];
if (user_comparator_->Compare(ExtractUserKey(f.largest_key), key) < 0) {
// Key at "mid.largest" is < "target". Therefore all
// files at or before "mid" are uninteresting.
left = mid + 1;
} else {
// Key at "mid.largest" is >= "target". Therefore all files
// after "mid" are uninteresting.
right = mid;
}
}
return right;
}
Status CompactedDBImpl::Get(const ReadOptions& options, ColumnFamilyHandle*,
const Slice& key, PinnableSlice* value) {
GetContext get_context(user_comparator_, nullptr, nullptr, nullptr,
GetContext::kNotFound, key, value, nullptr, nullptr,
nullptr, nullptr);
LookupKey lkey(key, kMaxSequenceNumber);
files_.files[FindFile(key)].fd.table_reader->Get(
options, lkey.internal_key(), &get_context);
if (get_context.State() == GetContext::kFound) {
return Status::OK();
}
return Status::NotFound();
}
std::vector<Status> CompactedDBImpl::MultiGet(const ReadOptions& options,
const std::vector<ColumnFamilyHandle*>&,
const std::vector<Slice>& keys, std::vector<std::string>* values) {
autovector<TableReader*, 16> reader_list;
for (const auto& key : keys) {
const FdWithKeyRange& f = files_.files[FindFile(key)];
if (user_comparator_->Compare(key, ExtractUserKey(f.smallest_key)) < 0) {
reader_list.push_back(nullptr);
} else {
LookupKey lkey(key, kMaxSequenceNumber);
f.fd.table_reader->Prepare(lkey.internal_key());
reader_list.push_back(f.fd.table_reader);
}
}
std::vector<Status> statuses(keys.size(), Status::NotFound());
values->resize(keys.size());
int idx = 0;
for (auto* r : reader_list) {
if (r != nullptr) {
PinnableSlice pinnable_val;
std::string& value = (*values)[idx];
GetContext get_context(user_comparator_, nullptr, nullptr, nullptr,
GetContext::kNotFound, keys[idx], &pinnable_val,
nullptr, nullptr, nullptr, nullptr);
LookupKey lkey(keys[idx], kMaxSequenceNumber);
r->Get(options, lkey.internal_key(), &get_context);
value.assign(pinnable_val.data(), pinnable_val.size());
if (get_context.State() == GetContext::kFound) {
statuses[idx] = Status::OK();
}
}
++idx;
}
return statuses;
}
Status CompactedDBImpl::Init(const Options& options) {
mutex_.Lock();
ColumnFamilyDescriptor cf(kDefaultColumnFamilyName,
ColumnFamilyOptions(options));
Status s = Recover({cf}, true /* read only */, false, true);
if (s.ok()) {
cfd_ = reinterpret_cast<ColumnFamilyHandleImpl*>(
DefaultColumnFamily())->cfd();
delete cfd_->InstallSuperVersion(new SuperVersion(), &mutex_);
}
mutex_.Unlock();
if (!s.ok()) {
return s;
}
NewThreadStatusCfInfo(cfd_);
version_ = cfd_->GetSuperVersion()->current;
user_comparator_ = cfd_->user_comparator();
auto* vstorage = version_->storage_info();
if (vstorage->num_non_empty_levels() == 0) {
return Status::NotSupported("no file exists");
}
const LevelFilesBrief& l0 = vstorage->LevelFilesBrief(0);
// L0 should not have files
if (l0.num_files > 1) {
return Status::NotSupported("L0 contain more than 1 file");
}
if (l0.num_files == 1) {
if (vstorage->num_non_empty_levels() > 1) {
return Status::NotSupported("Both L0 and other level contain files");
}
files_ = l0;
return Status::OK();
}
for (int i = 1; i < vstorage->num_non_empty_levels() - 1; ++i) {
if (vstorage->LevelFilesBrief(i).num_files > 0) {
return Status::NotSupported("Other levels also contain files");
}
}
int level = vstorage->num_non_empty_levels() - 1;
if (vstorage->LevelFilesBrief(level).num_files > 0) {
files_ = vstorage->LevelFilesBrief(level);
return Status::OK();
}
return Status::NotSupported("no file exists");
}
Status CompactedDBImpl::Open(const Options& options,
const std::string& dbname, DB** dbptr) {
*dbptr = nullptr;
if (options.max_open_files != -1) {
return Status::InvalidArgument("require max_open_files = -1");
}
if (options.merge_operator.get() != nullptr) {
return Status::InvalidArgument("merge operator is not supported");
}
DBOptions db_options(options);
std::unique_ptr<CompactedDBImpl> db(new CompactedDBImpl(db_options, dbname));
Status s = db->Init(options);
if (s.ok()) {
ROCKS_LOG_INFO(db->immutable_db_options_.info_log,
"Opened the db as fully compacted mode");
LogFlush(db->immutable_db_options_.info_log);
*dbptr = db.release();
}
return s;
}
} // namespace rocksdb
#endif // ROCKSDB_LITE
```
|
Padraig O'Neill is a Gaelic footballer from County Kildare. He plays for the Kildare senior inter-county football team and for his club St Laurence's.
References
External links
Year of birth missing (living people)
Living people
Kildare inter-county Gaelic footballers
|
```tex
%
%
%
% v 1.9.1
%
% %
% General
% %
\definecolor{white}{RGB}{255, 255, 255}
\definecolor{black}{RGB}{0, 0, 0}
% Gray
% %
\definecolor{gray-0}{RGB}{248, 249, 250}
\definecolor{gray-1}{RGB}{241, 243, 245}
\definecolor{gray-2}{RGB}{233, 236, 239}
\definecolor{gray-3}{RGB}{222, 226, 230}
\definecolor{gray-4}{RGB}{206, 212, 218}
\definecolor{gray-5}{RGB}{173, 181, 189}
\definecolor{gray-6}{RGB}{134, 142, 150}
\definecolor{gray-7}{RGB}{73, 80, 87}
\definecolor{gray-8}{RGB}{52, 58, 64}
\definecolor{gray-9}{RGB}{33, 37, 41}
% Red
% %
\definecolor{red-0}{RGB}{255, 245, 245}
\definecolor{red-1}{RGB}{255, 227, 227}
\definecolor{red-2}{RGB}{255, 201, 201}
\definecolor{red-3}{RGB}{255, 168, 168}
\definecolor{red-4}{RGB}{255, 135, 135}
\definecolor{red-5}{RGB}{255, 107, 107}
\definecolor{red-6}{RGB}{250, 82, 82}
\definecolor{red-7}{RGB}{240, 62, 62}
\definecolor{red-8}{RGB}{224, 49, 49}
\definecolor{red-9}{RGB}{201, 42, 42}
% Pink
% %
\definecolor{pink-0}{RGB}{255, 240, 246}
\definecolor{pink-1}{RGB}{255, 222, 235}
\definecolor{pink-2}{RGB}{252, 194, 215}
\definecolor{pink-3}{RGB}{250, 162, 193}
\definecolor{pink-4}{RGB}{247, 131, 172}
\definecolor{pink-5}{RGB}{240, 101, 149}
\definecolor{pink-6}{RGB}{230, 73, 128}
\definecolor{pink-7}{RGB}{214, 51, 108}
\definecolor{pink-8}{RGB}{194, 37, 92}
\definecolor{pink-9}{RGB}{166, 30, 77}
% Grape
% %
\definecolor{grape-0}{RGB}{248, 240, 252}
\definecolor{grape-1}{RGB}{243, 217, 250}
\definecolor{grape-2}{RGB}{238, 190, 250}
\definecolor{grape-3}{RGB}{229, 153, 247}
\definecolor{grape-4}{RGB}{218, 119, 242}
\definecolor{grape-5}{RGB}{204, 93, 232}
\definecolor{grape-6}{RGB}{190, 75, 219}
\definecolor{grape-7}{RGB}{174, 62, 201}
\definecolor{grape-8}{RGB}{156, 54, 181}
\definecolor{grape-9}{RGB}{134, 46, 156}
% Violet
% %
\definecolor{violet-0}{RGB}{243, 240, 255}
\definecolor{violet-1}{RGB}{229, 219, 255}
\definecolor{violet-2}{RGB}{208, 191, 255}
\definecolor{violet-3}{RGB}{177, 151, 252}
\definecolor{violet-4}{RGB}{151, 117, 250}
\definecolor{violet-5}{RGB}{132, 94, 247}
\definecolor{violet-6}{RGB}{121, 80, 242}
\definecolor{violet-7}{RGB}{112, 72, 232}
\definecolor{violet-8}{RGB}{103, 65, 217}
\definecolor{violet-9}{RGB}{95, 61, 196}
% Indigo
% %
\definecolor{indigo-0}{RGB}{237, 242, 255}
\definecolor{indigo-1}{RGB}{219, 228, 255}
\definecolor{indigo-2}{RGB}{186, 200, 255}
\definecolor{indigo-3}{RGB}{145, 167, 255}
\definecolor{indigo-4}{RGB}{116, 143, 252}
\definecolor{indigo-5}{RGB}{92, 124, 250}
\definecolor{indigo-6}{RGB}{76, 110, 245}
\definecolor{indigo-7}{RGB}{66, 99, 235}
\definecolor{indigo-8}{RGB}{59, 91, 219}
\definecolor{indigo-9}{RGB}{54, 79, 199}
% Blue
% %
\definecolor{blue-0}{RGB}{231, 245, 255}
\definecolor{blue-1}{RGB}{208, 235, 255}
\definecolor{blue-2}{RGB}{165, 216, 255}
\definecolor{blue-3}{RGB}{116, 192, 252}
\definecolor{blue-4}{RGB}{77, 171, 247}
\definecolor{blue-5}{RGB}{51, 154, 240}
\definecolor{blue-6}{RGB}{34, 139, 230}
\definecolor{blue-7}{RGB}{28, 126, 214}
\definecolor{blue-8}{RGB}{25, 113, 194}
\definecolor{blue-9}{RGB}{24, 100, 171}
% Cyan
% %
\definecolor{cyan-0}{RGB}{227, 250, 252}
\definecolor{cyan-1}{RGB}{197, 246, 250}
\definecolor{cyan-2}{RGB}{153, 233, 242}
\definecolor{cyan-3}{RGB}{102, 217, 232}
\definecolor{cyan-4}{RGB}{59, 201, 219}
\definecolor{cyan-5}{RGB}{34, 184, 207}
\definecolor{cyan-6}{RGB}{21, 170, 191}
\definecolor{cyan-7}{RGB}{16, 152, 173}
\definecolor{cyan-8}{RGB}{12, 133, 153}
\definecolor{cyan-9}{RGB}{11, 114, 133}
% Teal
% %
\definecolor{teal-0}{RGB}{230, 252, 245}
\definecolor{teal-1}{RGB}{195, 250, 232}
\definecolor{teal-2}{RGB}{150, 242, 215}
\definecolor{teal-3}{RGB}{99, 230, 190}
\definecolor{teal-4}{RGB}{56, 217, 169}
\definecolor{teal-5}{RGB}{32, 201, 151}
\definecolor{teal-6}{RGB}{18, 184, 134}
\definecolor{teal-7}{RGB}{12, 166, 120}
\definecolor{teal-8}{RGB}{9, 146, 104}
\definecolor{teal-9}{RGB}{8, 127, 91}
% Green
% %
\definecolor{green-0}{RGB}{235, 251, 238}
\definecolor{green-1}{RGB}{211, 249, 216}
\definecolor{green-2}{RGB}{178, 242, 187}
\definecolor{green-3}{RGB}{140, 233, 154}
\definecolor{green-4}{RGB}{105, 219, 124}
\definecolor{green-5}{RGB}{81, 207, 102}
\definecolor{green-6}{RGB}{64, 192, 87}
\definecolor{green-7}{RGB}{55, 178, 77}
\definecolor{green-8}{RGB}{47, 158, 68}
\definecolor{green-9}{RGB}{43, 138, 62}
% Lime
% %
\definecolor{lime-0}{RGB}{244, 252, 227}
\definecolor{lime-1}{RGB}{233, 250, 200}
\definecolor{lime-2}{RGB}{216, 245, 162}
\definecolor{lime-3}{RGB}{192, 235, 117}
\definecolor{lime-4}{RGB}{169, 227, 75}
\definecolor{lime-5}{RGB}{148, 216, 45}
\definecolor{lime-6}{RGB}{130, 201, 30}
\definecolor{lime-7}{RGB}{116, 184, 22}
\definecolor{lime-8}{RGB}{102, 168, 15}
\definecolor{lime-9}{RGB}{92, 148, 13}
% Yellow
% %
\definecolor{yellow-0}{RGB}{255, 249, 219}
\definecolor{yellow-1}{RGB}{255, 243, 191}
\definecolor{yellow-2}{RGB}{255, 236, 153}
\definecolor{yellow-3}{RGB}{255, 224, 102}
\definecolor{yellow-4}{RGB}{255, 212, 59}
\definecolor{yellow-5}{RGB}{252, 196, 25}
\definecolor{yellow-6}{RGB}{250, 176, 5}
\definecolor{yellow-7}{RGB}{245, 159, 0}
\definecolor{yellow-8}{RGB}{240, 140, 0}
\definecolor{yellow-9}{RGB}{230, 119, 0}
% Orange
% %
\definecolor{orange-0}{RGB}{255, 244, 230}
\definecolor{orange-1}{RGB}{255, 232, 204}
\definecolor{orange-2}{RGB}{255, 216, 168}
\definecolor{orange-3}{RGB}{255, 192, 120}
\definecolor{orange-4}{RGB}{255, 169, 77}
\definecolor{orange-5}{RGB}{255, 146, 43}
\definecolor{orange-6}{RGB}{253, 126, 20}
\definecolor{orange-7}{RGB}{247, 103, 7}
\definecolor{orange-8}{RGB}{232, 89, 12}
\definecolor{orange-9}{RGB}{217, 72, 15}
```
|
Haller () is a village in the commune of Waldbillig, in eastern Luxembourg. , the village has a population of 216.
See also
List of villages in Luxembourg
Waldbillig
Villages in Luxembourg
|
There are an unknown number of indigenous deaf sign languages in Laos, which may have historical connections with the languages indigenous to Vietnam and Thailand, though it is not known if they are related to each other. There is no single "Laotian Sign Language". Sign languages in use in Laos include French Sign Language, American Sign Language, Thai Sign Language, Lao Sign Language (derived from FSL), and Home sign.
See also
Thai Sign Language
Vietnamese sign languages
References
Further reading
Woodward, James (2000). Sign languages and sign language families in Thailand and Viet Nam, in Emmorey, Karen, and Harlan Lane, eds., The signs of language revisited : an anthology to honor Ursula Bellugi and Edward Klima. Mahwah, N.J.: Lawrence Erlbaum, p. 23-47
Lao Deaf Unit
Association for the Deaf (AFD)
Sign language isolates
Languages of Laos
|
```c
/*
===========================================================================
This file is part of Quake III Arena source code.
Quake III Arena source code is free software; you can redistribute it
or (at your option) any later version.
Quake III Arena source code is distributed in the hope that it will be
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with Quake III Arena source code; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
===========================================================================
*/
// tr_flares.c
#include "tr_local.h"
/*
=============================================================================
LIGHT FLARES
A light flare is an effect that takes place inside the eye when bright light
sources are visible. The size of the flare reletive to the screen is nearly
constant, irrespective of distance, but the intensity should be proportional to the
projected area of the light source.
A surface that has been flagged as having a light flare will calculate the depth
buffer value that its midpoint should have when the surface is added.
After all opaque surfaces have been rendered, the depth buffer is read back for
each flare in view. If the point has not been obscured by a closer surface, the
flare should be drawn.
Surfaces that have a repeated texture should never be flagged as flaring, because
there will only be a single flare added at the midpoint of the polygon.
To prevent abrupt popping, the intensity of the flare is interpolated up and
down as it changes visibility. This involves scene to scene state, unlike almost
all other aspects of the renderer, and is complicated by the fact that a single
frame may have multiple scenes.
RB_RenderFlares() will be called once per view (twice in a mirrored scene, potentially
up to five or more times in a frame with 3D status bar icons).
=============================================================================
*/
// flare states maintain visibility over multiple frames for fading
// layers: view, mirror, menu
typedef struct flare_s {
struct flare_s *next; // for active chain
int addedFrame;
qboolean inPortal; // true if in a portal view of the scene
int frameSceneNum;
void *surface;
int fogNum;
int fadeTime;
qboolean visible; // state of last test
float drawIntensity; // may be non 0 even if !visible due to fading
int windowX, windowY;
float eyeZ;
vec3_t origin;
vec3_t color;
} flare_t;
#define MAX_FLARES 128
flare_t r_flareStructs[MAX_FLARES];
flare_t *r_activeFlares, *r_inactiveFlares;
int flareCoeff;
/*
==================
R_SetFlareCoeff
==================
*/
static void R_SetFlareCoeff( void ) {
if(r_flareCoeff->value == 0.0f)
flareCoeff = atof(FLARE_STDCOEFF);
else
flareCoeff = r_flareCoeff->value;
}
/*
==================
R_ClearFlares
==================
*/
void R_ClearFlares( void ) {
int i;
Com_Memset( r_flareStructs, 0, sizeof( r_flareStructs ) );
r_activeFlares = NULL;
r_inactiveFlares = NULL;
for ( i = 0 ; i < MAX_FLARES ; i++ ) {
r_flareStructs[i].next = r_inactiveFlares;
r_inactiveFlares = &r_flareStructs[i];
}
R_SetFlareCoeff();
}
/*
==================
RB_AddFlare
This is called at surface tesselation time
==================
*/
void RB_AddFlare( void *surface, int fogNum, vec3_t point, vec3_t color, vec3_t normal ) {
int i;
flare_t *f;
vec3_t local;
float d = 1;
vec4_t eye, clip, normalized, window;
backEnd.pc.c_flareAdds++;
if(normal && (normal[0] || normal[1] || normal[2]))
{
VectorSubtract( backEnd.viewParms.or.origin, point, local );
VectorNormalizeFast(local);
d = DotProduct(local, normal);
// If the viewer is behind the flare don't add it.
if(d < 0)
return;
}
// if the point is off the screen, don't bother adding it
// calculate screen coordinates and depth
R_TransformModelToClip( point, backEnd.or.modelMatrix,
backEnd.viewParms.projectionMatrix, eye, clip );
// check to see if the point is completely off screen
for ( i = 0 ; i < 3 ; i++ ) {
if ( clip[i] >= clip[3] || clip[i] <= -clip[3] ) {
return;
}
}
R_TransformClipToWindow( clip, &backEnd.viewParms, normalized, window );
if ( window[0] < 0 || window[0] >= backEnd.viewParms.viewportWidth
|| window[1] < 0 || window[1] >= backEnd.viewParms.viewportHeight ) {
return; // shouldn't happen, since we check the clip[] above, except for FP rounding
}
// see if a flare with a matching surface, scene, and view exists
for ( f = r_activeFlares ; f ; f = f->next ) {
if ( f->surface == surface && f->frameSceneNum == backEnd.viewParms.frameSceneNum
&& f->inPortal == backEnd.viewParms.isPortal ) {
break;
}
}
// allocate a new one
if (!f ) {
if ( !r_inactiveFlares ) {
// the list is completely full
return;
}
f = r_inactiveFlares;
r_inactiveFlares = r_inactiveFlares->next;
f->next = r_activeFlares;
r_activeFlares = f;
f->surface = surface;
f->frameSceneNum = backEnd.viewParms.frameSceneNum;
f->inPortal = backEnd.viewParms.isPortal;
f->addedFrame = -1;
}
if ( f->addedFrame != backEnd.viewParms.frameCount - 1 ) {
f->visible = qfalse;
f->fadeTime = backEnd.refdef.time - 2000;
}
f->addedFrame = backEnd.viewParms.frameCount;
f->fogNum = fogNum;
VectorCopy(point, f->origin);
VectorCopy( color, f->color );
// fade the intensity of the flare down as the
// light surface turns away from the viewer
VectorScale( f->color, d, f->color );
// save info needed to test
f->windowX = backEnd.viewParms.viewportX + window[0];
f->windowY = backEnd.viewParms.viewportY + window[1];
f->eyeZ = eye[2];
}
/*
==================
RB_AddDlightFlares
==================
*/
void RB_AddDlightFlares( void ) {
dlight_t *l;
int i, j, k;
fog_t *fog = NULL;
if ( !r_flares->integer ) {
return;
}
l = backEnd.refdef.dlights;
if(tr.world)
fog = tr.world->fogs;
for (i=0 ; i<backEnd.refdef.num_dlights ; i++, l++) {
if(fog)
{
// find which fog volume the light is in
for ( j = 1 ; j < tr.world->numfogs ; j++ ) {
fog = &tr.world->fogs[j];
for ( k = 0 ; k < 3 ; k++ ) {
if ( l->origin[k] < fog->bounds[0][k] || l->origin[k] > fog->bounds[1][k] ) {
break;
}
}
if ( k == 3 ) {
break;
}
}
if ( j == tr.world->numfogs ) {
j = 0;
}
}
else
j = 0;
RB_AddFlare( (void *)l, j, l->origin, l->color, NULL );
}
}
/*
===============================================================================
FLARE BACK END
===============================================================================
*/
/*
==================
RB_TestFlare
==================
*/
void RB_TestFlare( flare_t *f ) {
float depth;
qboolean visible;
float fade;
float screenZ;
FBO_t *oldFbo;
backEnd.pc.c_flareTests++;
// doing a readpixels is as good as doing a glFinish(), so
// don't bother with another sync
glState.finishCalled = qfalse;
// if we're doing multisample rendering, read from the correct FBO
oldFbo = glState.currentFBO;
if (tr.msaaResolveFbo)
{
FBO_Bind(tr.msaaResolveFbo);
}
// read back the z buffer contents
qglReadPixels( f->windowX, f->windowY, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth );
// if we're doing multisample rendering, switch to the old FBO
if (tr.msaaResolveFbo)
{
FBO_Bind(oldFbo);
}
screenZ = backEnd.viewParms.projectionMatrix[14] /
( ( 2*depth - 1 ) * backEnd.viewParms.projectionMatrix[11] - backEnd.viewParms.projectionMatrix[10] );
visible = ( -f->eyeZ - -screenZ ) < 24;
if ( visible ) {
if ( !f->visible ) {
f->visible = qtrue;
f->fadeTime = backEnd.refdef.time - 1;
}
fade = ( ( backEnd.refdef.time - f->fadeTime ) /1000.0f ) * r_flareFade->value;
} else {
if ( f->visible ) {
f->visible = qfalse;
f->fadeTime = backEnd.refdef.time - 1;
}
fade = 1.0f - ( ( backEnd.refdef.time - f->fadeTime ) / 1000.0f ) * r_flareFade->value;
}
if ( fade < 0 ) {
fade = 0;
}
if ( fade > 1 ) {
fade = 1;
}
f->drawIntensity = fade;
}
/*
==================
RB_RenderFlare
==================
*/
void RB_RenderFlare( flare_t *f ) {
float size;
vec3_t color;
int iColor[3];
float distance, intensity, factor;
byte fogFactors[3] = {255, 255, 255};
backEnd.pc.c_flareRenders++;
// We don't want too big values anyways when dividing by distance.
if(f->eyeZ > -1.0f)
distance = 1.0f;
else
distance = -f->eyeZ;
// calculate the flare size..
size = backEnd.viewParms.viewportWidth * ( r_flareSize->value/640.0f + 8 / distance );
/*
* This is an alternative to intensity scaling. It changes the size of the flare on screen instead
* with growing distance. See in the description at the top why this is not the way to go.
// size will change ~ 1/r.
size = backEnd.viewParms.viewportWidth * (r_flareSize->value / (distance * -2.0f));
*/
/*
* As flare sizes stay nearly constant with increasing distance we must decrease the intensity
* to achieve a reasonable visual result. The intensity is ~ (size^2 / distance^2) which can be
* got by considering the ratio of
* (flaresurface on screen) : (Surface of sphere defined by flare origin and distance from flare)
* An important requirement is:
* intensity <= 1 for all distances.
*
* The formula used here to compute the intensity is as follows:
* intensity = flareCoeff * size^2 / (distance + size*sqrt(flareCoeff))^2
* As you can see, the intensity will have a max. of 1 when the distance is 0.
* The coefficient flareCoeff will determine the falloff speed with increasing distance.
*/
factor = distance + size * sqrt(flareCoeff);
intensity = flareCoeff * size * size / (factor * factor);
VectorScale(f->color, f->drawIntensity * intensity, color);
// Calculations for fogging
if(tr.world && f->fogNum > 0 && f->fogNum < tr.world->numfogs)
{
tess.numVertexes = 1;
VectorCopy(f->origin, tess.xyz[0]);
tess.fogNum = f->fogNum;
RB_CalcModulateColorsByFog(fogFactors);
// We don't need to render the flare if colors are 0 anyways.
if(!(fogFactors[0] || fogFactors[1] || fogFactors[2]))
return;
}
iColor[0] = color[0] * fogFactors[0] * 257;
iColor[1] = color[1] * fogFactors[1] * 257;
iColor[2] = color[2] * fogFactors[2] * 257;
RB_BeginSurface( tr.flareShader, f->fogNum, 0 );
// FIXME: use quadstamp?
tess.xyz[tess.numVertexes][0] = f->windowX - size;
tess.xyz[tess.numVertexes][1] = f->windowY - size;
tess.texCoords[tess.numVertexes][0] = 0;
tess.texCoords[tess.numVertexes][1] = 0;
tess.color[tess.numVertexes][0] = iColor[0];
tess.color[tess.numVertexes][1] = iColor[1];
tess.color[tess.numVertexes][2] = iColor[2];
tess.color[tess.numVertexes][3] = 65535;
tess.numVertexes++;
tess.xyz[tess.numVertexes][0] = f->windowX - size;
tess.xyz[tess.numVertexes][1] = f->windowY + size;
tess.texCoords[tess.numVertexes][0] = 0;
tess.texCoords[tess.numVertexes][1] = 1;
tess.color[tess.numVertexes][0] = iColor[0];
tess.color[tess.numVertexes][1] = iColor[1];
tess.color[tess.numVertexes][2] = iColor[2];
tess.color[tess.numVertexes][3] = 65535;
tess.numVertexes++;
tess.xyz[tess.numVertexes][0] = f->windowX + size;
tess.xyz[tess.numVertexes][1] = f->windowY + size;
tess.texCoords[tess.numVertexes][0] = 1;
tess.texCoords[tess.numVertexes][1] = 1;
tess.color[tess.numVertexes][0] = iColor[0];
tess.color[tess.numVertexes][1] = iColor[1];
tess.color[tess.numVertexes][2] = iColor[2];
tess.color[tess.numVertexes][3] = 65535;
tess.numVertexes++;
tess.xyz[tess.numVertexes][0] = f->windowX + size;
tess.xyz[tess.numVertexes][1] = f->windowY - size;
tess.texCoords[tess.numVertexes][0] = 1;
tess.texCoords[tess.numVertexes][1] = 0;
tess.color[tess.numVertexes][0] = iColor[0];
tess.color[tess.numVertexes][1] = iColor[1];
tess.color[tess.numVertexes][2] = iColor[2];
tess.color[tess.numVertexes][3] = 65535;
tess.numVertexes++;
tess.indexes[tess.numIndexes++] = 0;
tess.indexes[tess.numIndexes++] = 1;
tess.indexes[tess.numIndexes++] = 2;
tess.indexes[tess.numIndexes++] = 0;
tess.indexes[tess.numIndexes++] = 2;
tess.indexes[tess.numIndexes++] = 3;
RB_EndSurface();
}
/*
==================
RB_RenderFlares
Because flares are simulating an occular effect, they should be drawn after
everything (all views) in the entire frame has been drawn.
Because of the way portals use the depth buffer to mark off areas, the
needed information would be lost after each view, so we are forced to draw
flares after each view.
The resulting artifact is that flares in mirrors or portals don't dim properly
when occluded by something in the main view, and portal flares that should
extend past the portal edge will be overwritten.
==================
*/
void RB_RenderFlares (void) {
flare_t *f;
flare_t **prev;
qboolean draw;
mat4_t oldmodelview, oldprojection, matrix;
if ( !r_flares->integer ) {
return;
}
if(r_flareCoeff->modified)
{
R_SetFlareCoeff();
r_flareCoeff->modified = qfalse;
}
// Reset currentEntity to world so that any previously referenced entities
// don't have influence on the rendering of these flares (i.e. RF_ renderer flags).
backEnd.currentEntity = &tr.worldEntity;
backEnd.or = backEnd.viewParms.world;
// RB_AddDlightFlares();
// perform z buffer readback on each flare in this view
draw = qfalse;
prev = &r_activeFlares;
while ( ( f = *prev ) != NULL ) {
// throw out any flares that weren't added last frame
if ( f->addedFrame < backEnd.viewParms.frameCount - 1 ) {
*prev = f->next;
f->next = r_inactiveFlares;
r_inactiveFlares = f;
continue;
}
// don't draw any here that aren't from this scene / portal
f->drawIntensity = 0;
if ( f->frameSceneNum == backEnd.viewParms.frameSceneNum
&& f->inPortal == backEnd.viewParms.isPortal ) {
RB_TestFlare( f );
if ( f->drawIntensity ) {
draw = qtrue;
} else {
// this flare has completely faded out, so remove it from the chain
*prev = f->next;
f->next = r_inactiveFlares;
r_inactiveFlares = f;
continue;
}
}
prev = &f->next;
}
if ( !draw ) {
return; // none visible
}
Mat4Copy(glState.projection, oldprojection);
Mat4Copy(glState.modelview, oldmodelview);
Mat4Identity(matrix);
GL_SetModelviewMatrix(matrix);
Mat4Ortho( backEnd.viewParms.viewportX, backEnd.viewParms.viewportX + backEnd.viewParms.viewportWidth,
backEnd.viewParms.viewportY, backEnd.viewParms.viewportY + backEnd.viewParms.viewportHeight,
-99999, 99999, matrix );
GL_SetProjectionMatrix(matrix);
for ( f = r_activeFlares ; f ; f = f->next ) {
if ( f->frameSceneNum == backEnd.viewParms.frameSceneNum
&& f->inPortal == backEnd.viewParms.isPortal
&& f->drawIntensity ) {
RB_RenderFlare( f );
}
}
GL_SetProjectionMatrix(oldprojection);
GL_SetModelviewMatrix(oldmodelview);
}
```
|
```makefile
FATE_API_LIBAVCODEC-$(call ENCDEC, FLAC, FLAC) += fate-api-flac
fate-api-flac: $(APITESTSDIR)/api-flac-test$(EXESUF)
fate-api-flac: CMD = run $(APITESTSDIR)/api-flac-test
fate-api-flac: CMP = null
fate-api-flac: REF = /dev/null
FATE_API_SAMPLES_LIBAVFORMAT-$(call DEMDEC, FLV, FLV) += fate-api-band
fate-api-band: $(APITESTSDIR)/api-band-test$(EXESUF)
fate-api-band: CMD = run $(APITESTSDIR)/api-band-test $(TARGET_SAMPLES)/mpeg4/resize_down-up.h263
fate-api-band: CMP = null
fate-api-band: REF = /dev/null
FATE_API_SAMPLES_LIBAVFORMAT-$(call DEMDEC, H264, H264) += fate-api-h264
fate-api-h264: $(APITESTSDIR)/api-h264-test$(EXESUF)
fate-api-h264: CMD = run $(APITESTSDIR)/api-h264-test $(TARGET_SAMPLES)/h264-conformance/SVA_NL2_E.264
FATE_API_LIBAVFORMAT-$(call DEMDEC, FLV, FLV) += fate-api-seek
fate-api-seek: $(APITESTSDIR)/api-seek-test$(EXESUF) fate-lavf
fate-api-seek: CMD = run $(APITESTSDIR)/api-seek-test $(TARGET_PATH)/tests/data/lavf/lavf.flv 0 720
fate-api-seek: CMP = null
fate-api-seek: REF = /dev/null
FATE_API_SAMPLES_LIBAVFORMAT-$(call DEMDEC, IMAGE2, PNG) += fate-api-png-codec-param
fate-api-png-codec-param: $(APITESTSDIR)/api-codec-param-test$(EXESUF)
fate-api-png-codec-param: CMD = run $(APITESTSDIR)/api-codec-param-test $(TARGET_SAMPLES)/png1/lena-rgba.png
FATE_API_SAMPLES_LIBAVFORMAT-$(call DEMDEC, IMAGE2, MJPEG) += fate-api-mjpeg-codec-param
fate-api-mjpeg-codec-param: $(APITESTSDIR)/api-codec-param-test$(EXESUF)
fate-api-mjpeg-codec-param: CMD = run $(APITESTSDIR)/api-codec-param-test $(TARGET_SAMPLES)/exif/image_small.jpg
FATE_API-$(HAVE_THREADS) += fate-api-threadmessage
fate-api-threadmessage: $(APITESTSDIR)/api-threadmessage-test$(EXESUF)
fate-api-threadmessage: CMD = run $(APITESTSDIR)/api-threadmessage-test 3 10 30 50 2 20 40
fate-api-threadmessage: CMP = null
fate-api-threadmessage: REF = /dev/null
FATE_API_SAMPLES-$(CONFIG_AVFORMAT) += $(FATE_API_SAMPLES_LIBAVFORMAT-yes)
ifdef SAMPLES
FATE_API_SAMPLES += $(FATE_API_SAMPLES-yes)
endif
FATE_API-$(CONFIG_AVCODEC) += $(FATE_API_LIBAVCODEC-yes)
FATE_API-$(CONFIG_AVFORMAT) += $(FATE_API_LIBAVFORMAT-yes)
FATE_API = $(FATE_API-yes)
FATE-yes += $(FATE_API) $(FATE_API_SAMPLES)
fate-api: $(FATE_API) $(FATE_API_SAMPLES)
```
|
Fernando José Silva García (born 16 May 1977) is a retired footballer who played as a forward.
Born in Spain, he has represented the Andorra national team internationally.
Early life
Silva was born in Barcelona, Catalonia to Extremaduran parents and raised in Montijo.
International goals
Scores and results list Andorra's goal tally first.
References
External links
National team data
1977 births
Living people
People from Tierra de Mérida - Vegas Bajas
Footballers from the Province of Badajoz
Andorran men's footballers
Andorra men's international footballers
Spanish men's footballers
Spanish emigrants to Andorra
Naturalised citizens of Andorra
Andorran people of Spanish descent
Men's association football forwards
Tercera División players
FC Andorra players
FC Santa Coloma players
CF Villanovense players
CD Badajoz players
|
```java
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package io.camunda.zeebe.model.bpmn.impl.instance;
import io.camunda.zeebe.model.bpmn.instance.BpmnModelElementInstanceTest;
import java.util.Collection;
/**
* @author Sebastian Menski
*/
public class TargetTest extends BpmnModelElementInstanceTest {
@Override
public TypeAssumption getTypeAssumption() {
return new TypeAssumption(false);
}
@Override
public Collection<ChildElementAssumption> getChildElementAssumptions() {
return null;
}
@Override
public Collection<AttributeAssumption> getAttributesAssumptions() {
return null;
}
}
```
|
```go
//go:build darwin && cgo
// +build darwin,cgo
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
// IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
// CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
// TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
// SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
// path_to_url
package osxkeychain
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/versent/saml2aws/v2/helper/credentials"
)
func TestOSXKeychainHelper(t *testing.T) {
creds := &credentials.Credentials{
ServerURL: "path_to_url",
Username: "foobar",
Secret: "foobarbaz",
}
creds1 := &credentials.Credentials{
ServerURL: "path_to_url",
Username: "foobarbaz",
Secret: "foobar",
}
helper := Osxkeychain{}
if err := helper.Add(creds); err != nil {
t.Fatal(err)
}
username, secret, err := helper.Get(creds.ServerURL)
if err != nil {
t.Fatal(err)
}
if username != "foobar" {
t.Fatalf("expected %s, got %s\n", "foobar", username)
}
if secret != "foobarbaz" {
t.Fatalf("expected %s, got %s\n", "foobarbaz", secret)
}
err = helper.Add(creds1)
require.Nil(t, err)
defer func() {
_ = helper.Delete(creds1.ServerURL)
}()
if err := helper.Delete(creds.ServerURL); err != nil {
t.Fatal(err)
}
}
func TestMissingCredentials(t *testing.T) {
helper := Osxkeychain{}
_, _, err := helper.Get("path_to_url")
if !credentials.IsErrCredentialsNotFound(err) {
t.Fatalf("expected ErrCredentialsNotFound, got %v", err)
}
}
```
|
Paul Russell "Russ" Swift (born 24 March 1951) is a British driver who is known for performing stunts and for precision driving.
Career
Starting out as a rally co-driver, and later moving into the sport of Autotesting, Russ Swift has built his career on a sturdy motorsport foundation. After being asked to demonstrate his driving skills locally, Russ realised there could be a demand for precision driving skills to be displayed nationwide.
Swift's driving skills were memorably put to the test in 1987, when he performed stunts in a crowded parking lot in an Austin Montego for a television advertisement. The close-ups were done by an actor, but Swift (uncredited) was responsible for the driving. It was during the filming of the advertisement that Russ came up with the Parallel Park manœuvre, which has remained his "trademark" to this day. Russ previously held the world record for this manœuvre, parking in a space just 33 cm longer than the car. He has since been beaten by Peter Bell, who did it in a space 27 cm longer than the car. The Montego "Car Park" commercial was featured at the Cannes Film Festival and in an American review it was deemed the world's most imaginative car commercial.
Swift is the leader of the Russ Swift Mini Display Team, who perform driving displays for motor shows, commercials, vehicle launches, and other events. Typically they use a completely standard Mini Cooper S and/or a Mitsubishi Lancer Evolution, though Russ has performed in countless other vehicles, including Peugeots, Vauxhalls, Nissans, MGs, Land Rovers, Black Cabs, Subarus, and 13-tonne lorries.
Swift's career has also seen the use of the classic Minis, which he used to capture four British Autotest Championships and a rally win in Sweden in the early 1980s.
Swift has collaborated for TV commercials with Opel, Fiat, Standard Bank, MG, Mini. He has cooperated with the TV shows Top Gear, 5th Gear, Guinness World Records, GMTV, Learner Drivers (title sequence), and others, and as an advisor to many police, military, royal and diplomatic drivers. Swift has held three Guinness World Records and has done more than 8,000 stunt shows in 50 countries.
Russ has collaborated in Jeremy Clarkson's videos and on two episodes of Top Gear, in which he proved that elderly people needn't be slow and poor drivers, by teaching grannies to do donuts and handbrake parking.
Guinness World Records
Parallel parking in tightest space
J-turn in tightest space
Fastest time doing 10 do-nuts. (Driving)
Appearances
Top Gear series 1, episodes 3, 6
Tiff Needell: Burning Rubber (2001)
Clarkson: No Limits (2002)
Clarkson: Heaven and Hell (2005)
Swiftly Does It (2005) (Duke Video) A documentary following the unique career of the world's No.1 display driver, Russ Swift.
Auto Trader's editors have speculated that Swift is the likeliest known identity of The Stig, due to Swift's proximity to the Top Gear franchise, obscurity relative to high-profile drivers, and his skills with cars.
Personal life
Swift currently resides in the village of Finghall, North Yorkshire. His son, Paul Swift, is also an Autotest champion.
References
External links
Russ Swift's website
British stunt performers
Living people
1951 births
Sportspeople from Darlington
|
```objective-c
#ifndef HEADER_CURL_INET_PTON_H
#define HEADER_CURL_INET_PTON_H
/***************************************************************************
* _ _ ____ _
* Project ___| | | | _ \| |
* / __| | | | |_) | |
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at path_to_url
*
* You may opt to use, copy, modify, merge, publish, distribute and/or sell
* copies of the Software, and permit persons to whom the Software is
* furnished to do so, under the terms of the COPYING file.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
***************************************************************************/
#include "curl_setup.h"
int Curl_inet_pton(int, const char *, void *);
#ifdef HAVE_INET_PTON
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#elif defined(HAVE_WS2TCPIP_H)
/* inet_pton() exists in Vista or later */
#include <ws2tcpip.h>
#endif
#define Curl_inet_pton(x,y,z) inet_pton(x,y,z)
#endif
#endif /* HEADER_CURL_INET_PTON_H */
```
|
```python
import json
def processKinesis(event, *args):
print("!processKinesis", json.dumps(event))
```
|
```java
/*
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.shardingsphere.infra.spi.type.typed;
import org.apache.shardingsphere.infra.spi.exception.ServiceProviderNotFoundException;
import org.apache.shardingsphere.infra.spi.type.typed.fixture.TypedSPIFixture;
import org.apache.shardingsphere.infra.spi.type.typed.fixture.impl.TypedSPIFixtureImpl;
import org.apache.shardingsphere.test.util.PropertiesBuilder;
import org.apache.shardingsphere.test.util.PropertiesBuilder.Property;
import org.junit.jupiter.api.Test;
import java.util.Properties;
import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
class TypedSPILoaderTest {
@Test
void assertFindServiceWithoutProperties() {
assertTrue(TypedSPILoader.findService(TypedSPIFixture.class, "TYPED.FIXTURE").isPresent());
}
@Test
void assertFindServiceWithProperties() {
assertTrue(TypedSPILoader.findService(TypedSPIFixture.class, "TYPED.FIXTURE", new Properties()).isPresent());
}
@Test
void assertGetServiceWithoutProperties() {
assertThat(TypedSPILoader.getService(TypedSPIFixture.class, "TYPED.FIXTURE"), instanceOf(TypedSPIFixtureImpl.class));
}
@Test
void assertGetServiceWithProperties() {
assertThat(((TypedSPIFixtureImpl) TypedSPILoader.getService(TypedSPIFixture.class, "TYPED.FIXTURE", PropertiesBuilder.build(new Property("key", "1")))).getValue(), is("1"));
}
@Test
void assertGetServiceWithAlias() {
assertNotNull(TypedSPILoader.getService(TypedSPIFixture.class, "TYPED.ALIAS"));
}
@Test
void assertGetServiceWhenTypeIsNotExist() {
assertThrows(ServiceProviderNotFoundException.class, () -> TypedSPILoader.getService(TypedSPIFixture.class, "NOT_EXISTED"));
}
}
```
|
Cormainville () is a commune in the Eure-et-Loir department in northern France.
Population
Economy
In 2006, the largest wind farm, at that time, was installed by the Volkswind company.
It consists of 30 Vestas V80-2MW wind turbines with a combined nameplate capacity of 60 MW.
See also
Communes of the Eure-et-Loir department
References
Communes of Eure-et-Loir
|
Reynolds Heights is a census-designated place located in Pymatuning Township and in Mercer County in the state of Pennsylvania. The community is located off Pennsylvania Route 18. As of the 2010 census the population was 2,061 residents, which fell to 1,974 inhabitants at the 2020 Census. It is part of the Hermitage micropolitan area.
Demographics
References
Census-designated places in Mercer County, Pennsylvania
Census-designated places in Pennsylvania
|
```c++
/// Source : path_to_url
/// Author : liuyubobobo
/// Updated: 2021-08-09
#include <iostream>
using namespace std;
/// DFS
/// Time Complexity: O(n)
/// Space Complexity: O(h)
/// Definition for a binary tree node.
struct TreeNode {
int val;
TreeNode *left;
TreeNode *right;
TreeNode() : val(0), left(nullptr), right(nullptr) {}
TreeNode(int x) : val(x), left(nullptr), right(nullptr) {}
TreeNode(int x, TreeNode *left, TreeNode *right) : val(x), left(left), right(right) {}
};
class Solution {
private:
int sum = 0;
public:
TreeNode* convertBST(TreeNode* root) {
sum = 0;
return dfs(root);
}
private:
TreeNode* dfs(TreeNode* node){
if(!node) return node;
node->right = dfs(node->right);
sum += node->val;
node->val = sum;
node->left = dfs(node->left);
return node;
}
};
int main() {
return 0;
}
```
|
```php
<?php
namespace Orchid\Tests\Unit\Screen;
use Illuminate\Support\ViewErrorBag;
use Orchid\Screen\Layouts\Listener;
use Orchid\Screen\Screen;
use Orchid\Support\Facades\Layout;
use Orchid\Tests\App\Layouts\DependentSumListener;
use Orchid\Tests\App\Screens\FindBySlugLayoutScreen;
use Orchid\Tests\TestUnitCase;
class AsyncTest extends TestUnitCase
{
/**
* @throws \Throwable
*/
public function testFindBySlug(): void
{
app(\Illuminate\Contracts\View\Factory::class)->share('errors', new ViewErrorBag);
/** @var Screen $screen */
$screen = app(FindBySlugLayoutScreen::class);
collect([
new DependentSumListener('simple'),
new DependentSumListener('columns-1'),
new DependentSumListener('columns-2'),
new DependentSumListener('tab-1'),
new DependentSumListener('tab-2'),
])
->map(fn (Listener $listener) => $listener->getSlug())
->map(fn (string $slug) => $screen->asyncBuild('asyncStub', $slug))
->each(fn ($layout) => $this->assertNotNull($layout));
}
public function testSlugLayout(): void
{
$first = new DependentSumListener('modal-1');
$second = new DependentSumListener('modal-2');
$this->assertNotEquals($first->getSlug(), $second->getSlug());
}
public function testAnonymousClass(): void
{
$first = new DependentSumListener('modal-1');
$second = new DependentSumListener('modal-2');
$modalFirst = Layout::modal('modal-1', $first);
$modalSecond = Layout::modal('modal-2', $second);
// Each modal should have a unique slug
$this->assertNotNull($modalFirst->findBySlug($first->getSlug()));
$this->assertNotNull($modalSecond->findBySlug($second->getSlug()));
// Modal should not have a slug of another modal
$this->assertNull(Layout::modal('modal-1', $first)->findBySlug($second->getSlug()));
}
}
```
|
Luc Anatole Jacques Garnier (December 21, 1928 - May 1, 1999) was fourth bishop of the Episcopal Diocese of Haiti between 1971 and 1994.
Biography
Garnier was born on December 21, 1928, in Maïssade, Haiti. He attended the theological school in Haiti and graduated in 1956. That same year, in April, he was ordained deacon and that same November he was ordained priest by Bishop C. Alfred Voegeli. He became priest-in-charge of Gros Morne and Gonaïves.Then, in 1961 he was appointed rector of the Church of the Epiphany in Port-au-Prince while a year later he became the Dean of Trinity Cathedral. In the absence of a bishop, after C. Alfred Voegeli was deported from Haiti, Garnier was appointed as administrator of the diocese in 1969. He was elected to succeed Voegeli and was consecrated on April 20, 1971, by Presiding Bishop John E. Hines in Trinity Cathedral, the first native to serve the post. He retired in 1994 and died on May 1, 1999, in Port-au-Prince.
References
Obituary -- Luc Anatole Jacques Garnier
Episcopal Church website
1928 births
1999 deaths
People from Centre (department)
Haitian Anglicans
20th-century American Episcopalians
Episcopal bishops of Haiti
Haitian Christian clergy
20th-century American clergy
|
```xml
import { ReactElement } from 'react';
import { FeatureList, HeroGradient, IFeatureListProps } from '@theguild/components';
import flask from '../../public/assets/flask.svg';
import graphql from '../../public/assets/graphql.svg';
import needle from '../../public/assets/needle.svg';
const FEATURE_LIST: IFeatureListProps['items'] = [
{
title: 'GraphQL-First Philosophy',
description:
'Use the GraphQL schema definition language to generate a schema with full support for resolvers, interfaces, unions, and custom scalars.',
image: {
src: graphql,
alt: '',
loading: 'eager',
placeholder: 'empty',
},
link: {
children: 'Learn more',
href: '/docs/introduction#the-graphql-first-philosophy',
},
},
{
title: 'Mock Your GraphQL API',
description:
'With GraphQL Tools, you can mock your GraphQL API with fine-grained per-type mocking for fast prototyping without any datasources.',
image: {
src: flask,
alt: '',
loading: 'eager',
placeholder: 'empty',
},
link: {
children: 'Learn more',
href: '/docs/mocking',
},
},
{
title: 'Stitch Multiple Schemas',
description:
'Automatically stitch multiple schemas together into one larger API in a simple, fast and powerful way.',
image: {
src: needle,
alt: '',
loading: 'eager',
placeholder: 'empty',
},
link: {
children: 'Learn more',
href: 'path_to_url
},
},
];
export function IndexPage(): ReactElement {
return (
<>
<HeroGradient
title="A Set of Utilities for Faster Development of GraphQL Schemas"
description="GraphQL Tools is a set of NPM packages and an opinionated structure for how to build a GraphQL schema and resolvers in JavaScript, following the GraphQL-first development workflow."
link={{
children: 'Get Started',
title: 'Learn more about GraphQL Tools',
href: '/docs/introduction',
}}
colors={['#000246', '#184BE6']}
/>
<FeatureList items={FEATURE_LIST} className="[&_h3]:mt-6" />
</>
);
}
```
|
```go
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
//
// CONTACT: hello@weaviate.io
//
package schema
import (
"context"
"github.com/prometheus/client_golang/prometheus"
"github.com/weaviate/weaviate/entities/models"
"github.com/weaviate/weaviate/usecases/monitoring"
"github.com/weaviate/weaviate/usecases/sharding"
)
// VersionedSchemaReader is utilized to query the schema based on a specific update version. Serving as a thin wrapper around
// the original schema, it segregates waiting logic from the actual operation.
// It waits until it finds an update at least as up-to-date as the specified version.
// Note that updates may take some time to propagate to the follower, hence this process might take time.
type VersionedSchemaReader struct { // TODO TEST
schema *schema
WaitForUpdate func(ctx context.Context, version uint64) error
}
func (s VersionedSchemaReader) ClassInfo(ctx context.Context,
class string,
v uint64,
) (ClassInfo, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("ClassInfo"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
return s.schema.ClassInfo(class), err
}
func (s VersionedSchemaReader) MultiTenancy(ctx context.Context,
class string,
v uint64,
) (models.MultiTenancyConfig, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("MultiTenancy"))
defer t.ObserveDuration()
if info := s.schema.ClassInfo(class); info.Exists {
return info.MultiTenancy, nil
}
err := s.WaitForUpdate(ctx, v)
return s.schema.MultiTenancy(class), err
}
// Read performs a read operation `reader` on the specified class and sharding state
func (s VersionedSchemaReader) Read(ctx context.Context,
class string, v uint64,
reader func(*models.Class, *sharding.State) error,
) error {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("Read"))
defer t.ObserveDuration()
if err := s.WaitForUpdate(ctx, v); err != nil {
return err
}
return s.schema.Read(class, reader)
}
// ReadOnlyClass returns a shallow copy of a class.
// The copy is read-only and should not be modified.
func (s VersionedSchemaReader) ReadOnlyClass(ctx context.Context,
class string,
v uint64,
) (*models.Class, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("ReadOnlyClass"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
cls, _ := s.schema.ReadOnlyClass(class)
return cls, err
}
// ShardOwner returns the node owner of the specified shard
func (s VersionedSchemaReader) ShardOwner(ctx context.Context,
class, shard string,
v uint64,
) (string, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("ShardOwner"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
owner, _, sErr := s.schema.ShardOwner(class, shard)
if sErr != nil && err == nil {
err = sErr
}
return owner, err
}
// ShardFromUUID returns shard name of the provided uuid
func (s VersionedSchemaReader) ShardFromUUID(ctx context.Context,
class string, uuid []byte, v uint64,
) (string, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("ShardFromUUID"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
shard, _ := s.schema.ShardFromUUID(class, uuid)
return shard, err
}
// ShardReplicas returns the replica nodes of a shard
func (s VersionedSchemaReader) ShardReplicas(
ctx context.Context, class, shard string,
v uint64,
) ([]string, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("ShardReplicas"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
nodes, _, sErr := s.schema.ShardReplicas(class, shard)
if sErr != nil && err == nil {
err = sErr
}
return nodes, err
}
// TenantShard returns shard name for the provided tenant and its activity status
func (s VersionedSchemaReader) TenantsShards(ctx context.Context,
v uint64, class string, tenants ...string,
) (map[string]string, uint64, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("TenantsShards"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
status, version := s.schema.TenantsShards(class, tenants...)
return status, version, err
}
func (s VersionedSchemaReader) CopyShardingState(ctx context.Context,
class string, v uint64,
) (*sharding.State, error) {
t := prometheus.NewTimer(monitoring.GetMetrics().SchemaWaitForVersion.WithLabelValues("CopyShardingState"))
defer t.ObserveDuration()
err := s.WaitForUpdate(ctx, v)
ss, _ := s.schema.CopyShardingState(class)
return ss, err
}
func (s VersionedSchemaReader) Len() int { return s.schema.len() }
// ClassEqual returns the name of an existing class with a similar name, and "" otherwise
// strings.EqualFold is used to compare classes
func (s VersionedSchemaReader) ClassEqual(name string) string {
return s.schema.ClassEqual(name)
}
```
|
The men's singles nine-ball competition at the 2022 World Games took place from 13 to 16 July 2022 at the Birmingham Jefferson Convention Complex in Birmingham, United States.
Competition format
A total of 16 players entered the competition. They competed in knock-out system.
Bracket
References
Pool at the World Games
Cue sports at the 2022 World Games
|
Victor de Buck ( de "book"), (21 April 1817, Oudenaarde, Belgium – 23 May 1876, Brussels) was a Belgian Jesuit priest and theologian. He is credited with relaunching the work of the Bollandists in the 19th century, after the restoration of the Society of Jesus.
Life
His family was one of the most distinguished in the city of Oudenaarde (Audenarde). After a course in the humanities, begun at the College of Soignies and the petit seminaire of Roeselare and completed in 1835 at the college of the Society of Jesus at Aalst, he entered the Society of Jesus on 11 October 1835. After two years in the novitiate, then at Nivelles, and a year at Tronchiennes reviewing and finishing his literary studies, he went to Namur in September 1838 to study philosophy and the natural sciences. De Buck wrote with ease in Flemish, French, and Latin.
The work of the Bollandists had just been revived and, in spite of his youth, Victor de Buck was summoned to act as assistant to the hagiographers. He remained at this work in Brussels from September 1840, to September 1845. After devoting four years to theological studies at Louvain where he was ordained priest in 1848, and making his third year of probation in the Society of Jesus, he was permanently assigned to the Bollandist work in 1850. He remained engaged in it until his death, living in a room at St. Michael's College, Brussels, which also served as his study. He had already published in Vol. VII of the October Acta Sanctorum, which appeared in 1845, sixteen commentaries or notices that are easily distinguishable because they are without a signature, unlike those written by the Bollandists. In the early years, he would periodically take a brief respite to preach a country mission in Flemish.
He composed in collaboration with scholastic Antoine Tinnebroek an able refutation of a book published by the professor of canon law at the University of Leuven, in which the rights of the regular clergy were assailed and repudiated. This refutation, which fills an octavo volume of 640 pages, was ready for publication within four months. It was to have been supplemented by a second volume that was almost completed but could not be published because of the political disturbances of the year, the prelude to the revolutions of 1848. The work was never resumed.
Besides the numerous commentaries in Vols. IX, X, XI, XII, and XIII of the October Acta Sanctorum, which won much praise, Father de Buck published in Latin, French and Dutch a large number of little works of piety and dissertations on devotion to the saints, church history, and Christian archaeology. The partial enumeration of these works fills two folio columns of his eulogy, in the forepart of vol. II of the November Acta. Because of his extensive learning and investigating turn of mind he was naturally bent upon probing abstruse and perplexing questions. Thus in 1862 he was led to publish in the form of a letter to his brother Remi, then professor of church history at the theological college of Louvain and soon afterwards his colleague on the Bollandist work, a Latin dissertation, De solemnitate praecipue paupertatis religiosae. This was followed in 1863 and 1864 by two treatises in French, one under the title Solution amiable de la question des couvents and the other De l'état religieux, treating of the religious life in Belgium in the nineteenth century.
De Buck was part of an international scholarly community, researching, studying, and sharing citations with colleagues. He maintained a frequent correspondence with Agostino Morini, O.S.M.
Relics controversy
In order to satisfy the many requests made to Rome by churches and religious communities for relics of saints, it had become customary to take from the catacombs of Rome the bodies of unknown personages believed to have been honored as martyrs in the early Church. The sign by which they were to be recognized was a glass vial sealed up in the plaster outside the loculus that contained the body, and bearing traces of a red substance that had been enclosed and was supposed to have been blood. Doubts had arisen as to the correctness of this interpretation and, after careful study, Victor de Buck felt convinced that it was false and that what had been taken for blood was probably the sediment of consecrated wine. The conclusion, together with its premises, was set forth in a dissertation published in 1855 under the title De phialis rubricatis quibus martyrum romanorum sepulcra dignosci dicuntur. Naturally it raised lively protestations, particularly on the part of those who were responsible for distributing the relics of the saints, the more so, as the cardinal vicar of Rome in 1861 strictly forbade any further transportation of these relics.
De Buck had only a few copies of his work printed, these being intended for the cardinals and prelates particularly interested in the question. As none were put on the market, it was rumored that de Buck's superiors had suppressed the publication of the book and that all the copies printed, save five or six, had been destroyed. This was untrue; no copy had been destroyed and his superiors had laid no blame upon the author. Then, in 1863, a decree was obtained from the Congregation of Rites, renewing an older decree, whereby it was declared that a vial of blood placed outside of a sepulchral niche in the catacombs was an unmistakable sign by which the tomb of a martyr might be known, and it was proclaimed that Victor de Buck's opinion was formally disapproved and condemned by Rome. This too was false, as Father De Buck had never intimated that the placing of the vial of blood did not indicate the resting-place of a martyr, when it could be proved that the vial contained genuine blood, such as was supposed by the decree of the congregation.
Finally, there appeared in Paris a large quarto volume written by the Roman prelate, Monsignor Sconamiglio, Reliquiarum custode. It was filled with caustic criticisms of the author of De phialis rubricatis and relegated him to the rank of notorious heretics who had combated devotion to the saints and the veneration of their relics. Victor de Buck seemed all but insensible to the attacks and contented himself with opposing to Monsignor Sconamiglio's book a protest in which he rectified the more or less unconscious error of his enemies by proving that neither the decree of 1863 nor any other decision emanating from ecclesiastical authority had affected his thesis.
Ecumenism
Opinions were attributed to de Buck which, if not formally heretical, at least openly defied ideas generally accepted by Catholics. What apparently gave rise to these accusations were the amicable relations established, principally through correspondence, between Victor de Buck and such men as the celebrated Edward Pusey in England, and Montalembert, in France. Through contacts with foreign hagiographers and the English Jesuits in Louvain, de Buck developed an interest in a possible reunification of the Churches. During the 1850s he expressed this interest in a number of publications, including the Études Religieuses and The Rambler. De Buck's opinion regarding the views of Pusey were closer to those of Newman than Cardinal Manning.
A shared interest in the lives of the saints brought him in contact with Alexander Forbes, the learned Anglican bishop, with whom he corresponded at length. De Buck was also a friend of Bishop Félix Dupanloup. These relations were brought about by the reputation for deep learning, integrity, and scientific independence that de Buck's works had earned for him, by his readiness to oblige those who addressed questions to him, and by his earnestness and skill in elucidating the most difficult questions. Grave and direct accusations were made against de Buck and reported to the pope.
In a Latin letter addressed to Cardinal Patrizzi, and intended to come to the notice of the pope, Father de Buck repudiated the calumnies in a manner that betrayed how deeply he had been affected. His protest was supported by the testimony of four of his principal superiors, former provincials, and rectors who eagerly vouched for the sincerely of his declarations and the genuineness of his religious spirit. With the consent of his superiors he published this letter in order to communicate with those of his friends who might have been disturbed by these accusations.
De Buck had hoped for an Anglican presence at the First Vatican Council as a step toward rapprochement, but doctrinal differences proved an impediment; the doctrine of infallibility.
Father Peter Jan Beckx, Father General of the Society, summoned him to Rome to act as official theologian at the First Vatican Council. Father de Buck assumed these new duties with his accustomed ardor and, upon his return, showed the first symptoms of arteriosclerosis, which finally ended his life. Toward the end of his life, Father de Buck lost his sight, but dictated from memory, material previously compiled regarding saints of the early Celtic Church in Ireland, to his brother, Fr. Remi de Buck, also a Bollandist.
Works
De phialis rubricatis quibus martyrum romanorum sepulcra dignosci dicuntur (1855)
Les Saints Martyrs Japonais de La Compagnie de Jesus Paul Miki, Jean Soan de Gotto Et Jacques Kisai (1863)
Le Gesù de Rome: Notice Descriptive et Historique (1871)
Notes
Further reading
Jurich, James P. The Ecumenical Relations of Victor de Buck, S.J., with Anglican Leaders on the Eve of Vatican I, Université catholique de Louvain, 1988
1817 births
1876 deaths
19th-century Belgian Jesuits
19th-century Belgian Roman Catholic theologians
KU Leuven alumni
People from Oudenaarde
|
Happy Birthday Oscar Wilde is a 2004 documentary film that celebrates Oscar Wilde's 150th birthday. Over 150 of his well-known quotes are delivered by 150 of stars in stage, screen and music.
Cast
Simon Williams
Jillian Armenante
Edward Asner
Helen Baxendale
Stephanie Beacham
Emma Bolger
Sarah Bolger
Bono
Barry Bostwick
Dawn Bradfield
Barbara Brennan
Roscoe Lee Browne
Melanie Brown
Jean Butler
Gerard Byrne
Jonathan Byrne
Bobby Cannavale
Gary Carter
Anna Chancellor
Rob Clark
James Cromwell
Tyne Daly
Bob Dishy
Alice Dodd
Alison Doody
Roma Downey
Keith Duffy
Adrian Dunbar
Colin Dunne
Hector Elizondo
Michael Emerson
Kathryn Erbe
Kevin Fabian
Gavin Friday
Philip Glass
Ricky Paull Goldin
Mikey Graham
Lee Grant
Tom Hickey
William Hootkins
Ciara Hughes
David Henry Hwang
Allison Janney
Tina Kellegher
Brian Kennedy
Emma Kennedy
Maria Doyle Kennedy
Mimi Kennedy
Pat Kinevane
Mark Lambert
Annie Lennox
Dinah Manoff
Julianna Margulies
Jefferson Mays
Frank McCourt
Frank McGuinness
Tom McGurk
Charlotte Moore
Larry Mullen, Jr.
Bryan Murray
Liam Neeson
Brían F. O'Byrne
Hugh O'Conor
Brian O'Driscoll
Deirdre O'Kane
Milo O'Shea
Kitty O'Sullivan
Nathaniel Parker
Estelle Parsons
Rosie Perez
Sue Perkins
Tonya Pinkins
Anita Reeves
Joan Rivers
Owen Roe
Mitchell Ryan
Richard Schiff
Nick Seymour
Martin Sheen
Michael Sheen
Jim Sheridan
Bill Shipsey
Nina Siemaszko
Alan Stanford
Eric Stoltz
Kim Thomson
Lily Tomlin
Marty Whelan
Olivia Williams
Don Wycherley
Anthony Zerbe
External links
2004 television films
2004 films
2004 documentary films
American documentary films
2000s English-language films
2000s American films
|
```java
/*
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package org.apache.beam.runners.twister2;
import com.fasterxml.jackson.annotation.JsonIgnore;
import edu.iu.dsc.tws.tset.env.TSetEnvironment;
import org.apache.beam.sdk.options.Default;
import org.apache.beam.sdk.options.Description;
import org.apache.beam.sdk.options.FileStagingOptions;
import org.apache.beam.sdk.options.PipelineOptions;
import org.apache.beam.sdk.options.StreamingOptions;
/** Twister2PipelineOptions. */
public interface Twister2PipelineOptions
extends PipelineOptions, StreamingOptions, FileStagingOptions {
@Description("set parallelism for Twister2 processor")
@Default.Integer(1)
int getParallelism();
void setParallelism(int parallelism);
@Description("Twister2 TSetEnvironment")
@JsonIgnore
TSetEnvironment getTSetEnvironment();
void setTSetEnvironment(TSetEnvironment environment);
@Description("Twister2 cluster type, supported types: standalone, nomad, kubernetes, mesos")
@Default.String("standalone")
String getClusterType();
void setClusterType(String name);
@Description("Job file zip")
String getJobFileZip();
void setJobFileZip(String pathToZip);
@Description("Job type, jar or java_zip")
@Default.String("java_zip")
String getJobType();
void setJobType(String jobType);
@Description("Twister2 home directory")
String getTwister2Home();
void setTwister2Home(String twister2Home);
@Description("CPU's per worker")
@Default.Integer(2)
int getWorkerCPUs();
void setWorkerCPUs(int workerCPUs);
@Description("RAM allocated per worker")
@Default.Integer(2048)
int getRamMegaBytes();
void setRamMegaBytes(int ramMegaBytes);
}
```
|
```java
/*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package net.runelite.client.plugins.gpu;
import com.google.common.base.Strings;
import java.io.File;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import net.runelite.client.plugins.gpu.template.Template;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.lwjgl.opengl.GL43C;
public class ShaderTest
{
@Rule
public TemporaryFolder temp = new TemporaryFolder();
@Test
public void testShaders() throws Exception
{
String verifier = System.getProperty("glslang.path");
Assume.assumeFalse("glslang.path is not set", Strings.isNullOrEmpty(verifier));
Template[] templates = {
new Template()
.addInclude(GpuPlugin.class)
.add(key ->
{
if ("version_header".equals(key))
{
return GpuPlugin.WINDOWS_VERSION_HEADER;
}
if ("thread_config".equals(key))
{
int threadCount = 512;
int facesPerThread = 1;
return "#define THREAD_COUNT " + threadCount + "\n" +
"#define FACES_PER_THREAD " + facesPerThread + "\n";
}
return null;
}),
};
Shader[] shaders = {
GpuPlugin.PROGRAM,
GpuPlugin.COMPUTE_PROGRAM,
GpuPlugin.UNORDERED_COMPUTE_PROGRAM,
GpuPlugin.UI_PROGRAM,
};
for (Template t : templates)
{
for (Shader s : shaders)
{
verify(t, s);
}
}
}
private void verify(Template template, Shader shader) throws Exception
{
File folder = temp.newFolder();
List<String> args = new ArrayList<>();
args.add(System.getProperty("glslang.path"));
args.add("-l");
for (Shader.Unit u : shader.units)
{
String contents = template.load(u.getFilename());
String ext;
switch (u.getType())
{
case GL43C.GL_VERTEX_SHADER:
ext = "vert";
break;
case GL43C.GL_TESS_CONTROL_SHADER:
ext = "tesc";
break;
case GL43C.GL_TESS_EVALUATION_SHADER:
ext = "tese";
break;
case GL43C.GL_GEOMETRY_SHADER:
ext = "geom";
break;
case GL43C.GL_FRAGMENT_SHADER:
ext = "frag";
break;
case GL43C.GL_COMPUTE_SHADER:
ext = "comp";
break;
default:
throw new IllegalArgumentException(u.getType() + "");
}
File file = new File(folder, u.getFilename() + "." + ext);
Files.write(file.toPath(), contents.getBytes(StandardCharsets.UTF_8));
args.add(file.getAbsolutePath());
}
ProcessBuilder pb = new ProcessBuilder(args.toArray(new String[0]));
pb.inheritIO();
Process proc = pb.start();
if (proc.waitFor() != 0)
{
Assert.fail();
}
}
}
```
|
The 2005 Norwegian Football Cup final was the final match of the 2005 Norwegian Football Cup, the 100th season of the Norwegian Football Cup, the premier Norwegian football cup competition organized by the Football Association of Norway (NFF). The match was played on 9 November 2003 at the Ullevaal Stadion in Oslo, and opposed two Tippeligaen sides Molde and Lillestrøm. Molde defeated Lillestrøm 4–2 after extra time to claim the Norwegian Cup for a ninth time in their history.
Route to the final
Match
Details
References
2005
Molde FK matches
Lillestrøm SK matches
Football Cup
Sports competitions in Oslo
2000s in Oslo
Norwegian Football Cup Final
Final
|
```go
// All rights reserved.
package pull
import (
"bufio"
"context"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"code.gitea.io/gitea/models"
git_model "code.gitea.io/gitea/models/git"
issues_model "code.gitea.io/gitea/models/issues"
"code.gitea.io/gitea/models/unit"
"code.gitea.io/gitea/modules/container"
"code.gitea.io/gitea/modules/git"
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/graceful"
"code.gitea.io/gitea/modules/log"
"code.gitea.io/gitea/modules/process"
"code.gitea.io/gitea/modules/setting"
"code.gitea.io/gitea/modules/util"
"github.com/gobwas/glob"
)
// DownloadDiffOrPatch will write the patch for the pr to the writer
func DownloadDiffOrPatch(ctx context.Context, pr *issues_model.PullRequest, w io.Writer, patch, binary bool) error {
if err := pr.LoadBaseRepo(ctx); err != nil {
log.Error("Unable to load base repository ID %d for pr #%d [%d]", pr.BaseRepoID, pr.Index, pr.ID)
return err
}
gitRepo, closer, err := gitrepo.RepositoryFromContextOrOpen(ctx, pr.BaseRepo)
if err != nil {
return fmt.Errorf("OpenRepository: %w", err)
}
defer closer.Close()
if err := gitRepo.GetDiffOrPatch(pr.MergeBase, pr.GetGitRefName(), w, patch, binary); err != nil {
log.Error("Unable to get patch file from %s to %s in %s Error: %v", pr.MergeBase, pr.HeadBranch, pr.BaseRepo.FullName(), err)
return fmt.Errorf("Unable to get patch file from %s to %s in %s Error: %w", pr.MergeBase, pr.HeadBranch, pr.BaseRepo.FullName(), err)
}
return nil
}
var patchErrorSuffices = []string{
": already exists in index",
": patch does not apply",
": already exists in working directory",
"unrecognized input",
": No such file or directory",
": does not exist in index",
}
// TestPatch will test whether a simple patch will apply
func TestPatch(pr *issues_model.PullRequest) error {
ctx, _, finished := process.GetManager().AddContext(graceful.GetManager().HammerContext(), fmt.Sprintf("TestPatch: %s", pr))
defer finished()
prCtx, cancel, err := createTemporaryRepoForPR(ctx, pr)
if err != nil {
if !git_model.IsErrBranchNotExist(err) {
log.Error("CreateTemporaryRepoForPR %-v: %v", pr, err)
}
return err
}
defer cancel()
return testPatch(ctx, prCtx, pr)
}
func testPatch(ctx context.Context, prCtx *prContext, pr *issues_model.PullRequest) error {
gitRepo, err := git.OpenRepository(ctx, prCtx.tmpBasePath)
if err != nil {
return fmt.Errorf("OpenRepository: %w", err)
}
defer gitRepo.Close()
// 1. update merge base
pr.MergeBase, _, err = git.NewCommand(ctx, "merge-base", "--", "base", "tracking").RunStdString(&git.RunOpts{Dir: prCtx.tmpBasePath})
if err != nil {
var err2 error
pr.MergeBase, err2 = gitRepo.GetRefCommitID(git.BranchPrefix + "base")
if err2 != nil {
return fmt.Errorf("GetMergeBase: %v and can't find commit ID for base: %w", err, err2)
}
}
pr.MergeBase = strings.TrimSpace(pr.MergeBase)
if pr.HeadCommitID, err = gitRepo.GetRefCommitID(git.BranchPrefix + "tracking"); err != nil {
return fmt.Errorf("GetBranchCommitID: can't find commit ID for head: %w", err)
}
if pr.HeadCommitID == pr.MergeBase {
pr.Status = issues_model.PullRequestStatusAncestor
return nil
}
// 2. Check for conflicts
if conflicts, err := checkConflicts(ctx, pr, gitRepo, prCtx.tmpBasePath); err != nil || conflicts || pr.Status == issues_model.PullRequestStatusEmpty {
return err
}
// 3. Check for protected files changes
if err = checkPullFilesProtection(ctx, pr, gitRepo); err != nil {
return fmt.Errorf("pr.CheckPullFilesProtection(): %v", err)
}
if len(pr.ChangedProtectedFiles) > 0 {
log.Trace("Found %d protected files changed", len(pr.ChangedProtectedFiles))
}
pr.Status = issues_model.PullRequestStatusMergeable
return nil
}
type errMergeConflict struct {
filename string
}
func (e *errMergeConflict) Error() string {
return fmt.Sprintf("conflict detected at: %s", e.filename)
}
func attemptMerge(ctx context.Context, file *unmergedFile, tmpBasePath string, filesToRemove *[]string, filesToAdd *[]git.IndexObjectInfo) error {
log.Trace("Attempt to merge:\n%v", file)
switch {
case file.stage1 != nil && (file.stage2 == nil || file.stage3 == nil):
// 1. Deleted in one or both:
//
// Conflict <==> the stage1 !SameAs to the undeleted one
if (file.stage2 != nil && !file.stage1.SameAs(file.stage2)) || (file.stage3 != nil && !file.stage1.SameAs(file.stage3)) {
// Conflict!
return &errMergeConflict{file.stage1.path}
}
// Not a genuine conflict and we can simply remove the file from the index
*filesToRemove = append(*filesToRemove, file.stage1.path)
return nil
case file.stage1 == nil && file.stage2 != nil && (file.stage3 == nil || file.stage2.SameAs(file.stage3)):
// 2. Added in ours but not in theirs or identical in both
//
// Not a genuine conflict just add to the index
*filesToAdd = append(*filesToAdd, git.IndexObjectInfo{Mode: file.stage2.mode, Object: git.MustIDFromString(file.stage2.sha), Filename: file.stage2.path})
return nil
case file.stage1 == nil && file.stage2 != nil && file.stage3 != nil && file.stage2.sha == file.stage3.sha && file.stage2.mode != file.stage3.mode:
// 3. Added in both with the same sha but the modes are different
//
// Conflict! (Not sure that this can actually happen but we should handle)
return &errMergeConflict{file.stage2.path}
case file.stage1 == nil && file.stage2 == nil && file.stage3 != nil:
// 4. Added in theirs but not ours:
//
// Not a genuine conflict just add to the index
*filesToAdd = append(*filesToAdd, git.IndexObjectInfo{Mode: file.stage3.mode, Object: git.MustIDFromString(file.stage3.sha), Filename: file.stage3.path})
return nil
case file.stage1 == nil:
// 5. Created by new in both
//
// Conflict!
return &errMergeConflict{file.stage2.path}
case file.stage2 != nil && file.stage3 != nil:
// 5. Modified in both - we should try to merge in the changes but first:
//
if file.stage2.mode == "120000" || file.stage3.mode == "120000" {
// 5a. Conflicting symbolic link change
return &errMergeConflict{file.stage2.path}
}
if file.stage2.mode == "160000" || file.stage3.mode == "160000" {
// 5b. Conflicting submodule change
return &errMergeConflict{file.stage2.path}
}
if file.stage2.mode != file.stage3.mode {
// 5c. Conflicting mode change
return &errMergeConflict{file.stage2.path}
}
// Need to get the objects from the object db to attempt to merge
root, _, err := git.NewCommand(ctx, "unpack-file").AddDynamicArguments(file.stage1.sha).RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
return fmt.Errorf("unable to get root object: %s at path: %s for merging. Error: %w", file.stage1.sha, file.stage1.path, err)
}
root = strings.TrimSpace(root)
defer func() {
_ = util.Remove(filepath.Join(tmpBasePath, root))
}()
base, _, err := git.NewCommand(ctx, "unpack-file").AddDynamicArguments(file.stage2.sha).RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
return fmt.Errorf("unable to get base object: %s at path: %s for merging. Error: %w", file.stage2.sha, file.stage2.path, err)
}
base = strings.TrimSpace(filepath.Join(tmpBasePath, base))
defer func() {
_ = util.Remove(base)
}()
head, _, err := git.NewCommand(ctx, "unpack-file").AddDynamicArguments(file.stage3.sha).RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
return fmt.Errorf("unable to get head object:%s at path: %s for merging. Error: %w", file.stage3.sha, file.stage3.path, err)
}
head = strings.TrimSpace(head)
defer func() {
_ = util.Remove(filepath.Join(tmpBasePath, head))
}()
// now git merge-file annoyingly takes a different order to the merge-tree ...
_, _, conflictErr := git.NewCommand(ctx, "merge-file").AddDynamicArguments(base, root, head).RunStdString(&git.RunOpts{Dir: tmpBasePath})
if conflictErr != nil {
return &errMergeConflict{file.stage2.path}
}
// base now contains the merged data
hash, _, err := git.NewCommand(ctx, "hash-object", "-w", "--path").AddDynamicArguments(file.stage2.path, base).RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
return err
}
hash = strings.TrimSpace(hash)
*filesToAdd = append(*filesToAdd, git.IndexObjectInfo{Mode: file.stage2.mode, Object: git.MustIDFromString(hash), Filename: file.stage2.path})
return nil
default:
if file.stage1 != nil {
return &errMergeConflict{file.stage1.path}
} else if file.stage2 != nil {
return &errMergeConflict{file.stage2.path}
} else if file.stage3 != nil {
return &errMergeConflict{file.stage3.path}
}
}
return nil
}
// AttemptThreeWayMerge will attempt to three way merge using git read-tree and then follow the git merge-one-file algorithm to attempt to resolve basic conflicts
func AttemptThreeWayMerge(ctx context.Context, gitPath string, gitRepo *git.Repository, base, ours, theirs, description string) (bool, []string, error) {
ctx, cancel := context.WithCancel(ctx)
defer cancel()
// First we use read-tree to do a simple three-way merge
if _, _, err := git.NewCommand(ctx, "read-tree", "-m").AddDynamicArguments(base, ours, theirs).RunStdString(&git.RunOpts{Dir: gitPath}); err != nil {
log.Error("Unable to run read-tree -m! Error: %v", err)
return false, nil, fmt.Errorf("unable to run read-tree -m! Error: %w", err)
}
var filesToRemove []string
var filesToAdd []git.IndexObjectInfo
// Then we use git ls-files -u to list the unmerged files and collate the triples in unmergedfiles
unmerged := make(chan *unmergedFile)
go unmergedFiles(ctx, gitPath, unmerged)
defer func() {
cancel()
for range unmerged {
// empty the unmerged channel
}
}()
numberOfConflicts := 0
conflict := false
conflictedFiles := make([]string, 0, 5)
for file := range unmerged {
if file == nil {
break
}
if file.err != nil {
cancel()
return false, nil, file.err
}
// OK now we have the unmerged file triplet attempt to merge it
if err := attemptMerge(ctx, file, gitPath, &filesToRemove, &filesToAdd); err != nil {
if conflictErr, ok := err.(*errMergeConflict); ok {
log.Trace("Conflict: %s in %s", conflictErr.filename, description)
conflict = true
if numberOfConflicts < 10 {
conflictedFiles = append(conflictedFiles, conflictErr.filename)
}
numberOfConflicts++
continue
}
return false, nil, err
}
}
// Add and remove files in one command, as this is slow with many files otherwise
if err := gitRepo.RemoveFilesFromIndex(filesToRemove...); err != nil {
return false, nil, err
}
if err := gitRepo.AddObjectsToIndex(filesToAdd...); err != nil {
return false, nil, err
}
return conflict, conflictedFiles, nil
}
func checkConflicts(ctx context.Context, pr *issues_model.PullRequest, gitRepo *git.Repository, tmpBasePath string) (bool, error) {
// 1. checkConflicts resets the conflict status - therefore - reset the conflict status
pr.ConflictedFiles = nil
// 2. AttemptThreeWayMerge first - this is much quicker than plain patch to base
description := fmt.Sprintf("PR[%d] %s/%s#%d", pr.ID, pr.BaseRepo.OwnerName, pr.BaseRepo.Name, pr.Index)
conflict, conflictFiles, err := AttemptThreeWayMerge(ctx,
tmpBasePath, gitRepo, pr.MergeBase, "base", "tracking", description)
if err != nil {
return false, err
}
if !conflict {
// No conflicts detected so we need to check if the patch is empty...
// a. Write the newly merged tree and check the new tree-hash
var treeHash string
treeHash, _, err = git.NewCommand(ctx, "write-tree").RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
lsfiles, _, _ := git.NewCommand(ctx, "ls-files", "-u").RunStdString(&git.RunOpts{Dir: tmpBasePath})
return false, fmt.Errorf("unable to write unconflicted tree: %w\n`git ls-files -u`:\n%s", err, lsfiles)
}
treeHash = strings.TrimSpace(treeHash)
baseTree, err := gitRepo.GetTree("base")
if err != nil {
return false, err
}
// b. compare the new tree-hash with the base tree hash
if treeHash == baseTree.ID.String() {
log.Debug("PullRequest[%d]: Patch is empty - ignoring", pr.ID)
pr.Status = issues_model.PullRequestStatusEmpty
}
return false, nil
}
// 3. OK the three-way merge method has detected conflicts
// 3a. Are still testing with GitApply? If not set the conflict status and move on
if !setting.Repository.PullRequest.TestConflictingPatchesWithGitApply {
pr.Status = issues_model.PullRequestStatusConflict
pr.ConflictedFiles = conflictFiles
log.Trace("Found %d files conflicted: %v", len(pr.ConflictedFiles), pr.ConflictedFiles)
return true, nil
}
// 3b. Create a plain patch from head to base
tmpPatchFile, err := os.CreateTemp("", "patch")
if err != nil {
log.Error("Unable to create temporary patch file! Error: %v", err)
return false, fmt.Errorf("unable to create temporary patch file! Error: %w", err)
}
defer func() {
_ = util.Remove(tmpPatchFile.Name())
}()
if err := gitRepo.GetDiffBinary(pr.MergeBase, "tracking", tmpPatchFile); err != nil {
tmpPatchFile.Close()
log.Error("Unable to get patch file from %s to %s in %s Error: %v", pr.MergeBase, pr.HeadBranch, pr.BaseRepo.FullName(), err)
return false, fmt.Errorf("unable to get patch file from %s to %s in %s Error: %w", pr.MergeBase, pr.HeadBranch, pr.BaseRepo.FullName(), err)
}
stat, err := tmpPatchFile.Stat()
if err != nil {
tmpPatchFile.Close()
return false, fmt.Errorf("unable to stat patch file: %w", err)
}
patchPath := tmpPatchFile.Name()
tmpPatchFile.Close()
// 3c. if the size of that patch is 0 - there can be no conflicts!
if stat.Size() == 0 {
log.Debug("PullRequest[%d]: Patch is empty - ignoring", pr.ID)
pr.Status = issues_model.PullRequestStatusEmpty
return false, nil
}
log.Trace("PullRequest[%d].testPatch (patchPath): %s", pr.ID, patchPath)
// 4. Read the base branch in to the index of the temporary repository
_, _, err = git.NewCommand(gitRepo.Ctx, "read-tree", "base").RunStdString(&git.RunOpts{Dir: tmpBasePath})
if err != nil {
return false, fmt.Errorf("git read-tree %s: %w", pr.BaseBranch, err)
}
// 5. Now get the pull request configuration to check if we need to ignore whitespace
prUnit, err := pr.BaseRepo.GetUnit(ctx, unit.TypePullRequests)
if err != nil {
return false, err
}
prConfig := prUnit.PullRequestsConfig()
// 6. Prepare the arguments to apply the patch against the index
cmdApply := git.NewCommand(gitRepo.Ctx, "apply", "--check", "--cached")
if prConfig.IgnoreWhitespaceConflicts {
cmdApply.AddArguments("--ignore-whitespace")
}
is3way := false
if git.DefaultFeatures().CheckVersionAtLeast("2.32.0") {
cmdApply.AddArguments("--3way")
is3way = true
}
cmdApply.AddDynamicArguments(patchPath)
// 7. Prep the pipe:
// - Here we could do the equivalent of:
// `git apply --check --cached patch_file > conflicts`
// Then iterate through the conflicts. However, that means storing all the conflicts
// in memory - which is very wasteful.
// - alternatively we can do the equivalent of:
// `git apply --check ... | grep ...`
// meaning we don't store all of the conflicts unnecessarily.
stderrReader, stderrWriter, err := os.Pipe()
if err != nil {
log.Error("Unable to open stderr pipe: %v", err)
return false, fmt.Errorf("unable to open stderr pipe: %w", err)
}
defer func() {
_ = stderrReader.Close()
_ = stderrWriter.Close()
}()
// 8. Run the check command
conflict = false
err = cmdApply.Run(&git.RunOpts{
Dir: tmpBasePath,
Stderr: stderrWriter,
PipelineFunc: func(ctx context.Context, cancel context.CancelFunc) error {
// Close the writer end of the pipe to begin processing
_ = stderrWriter.Close()
defer func() {
// Close the reader on return to terminate the git command if necessary
_ = stderrReader.Close()
}()
const prefix = "error: patch failed:"
const errorPrefix = "error: "
const threewayFailed = "Failed to perform three-way merge..."
const appliedPatchPrefix = "Applied patch to '"
const withConflicts = "' with conflicts."
conflicts := make(container.Set[string])
// Now scan the output from the command
scanner := bufio.NewScanner(stderrReader)
for scanner.Scan() {
line := scanner.Text()
log.Trace("PullRequest[%d].testPatch: stderr: %s", pr.ID, line)
if strings.HasPrefix(line, prefix) {
conflict = true
filepath := strings.TrimSpace(strings.Split(line[len(prefix):], ":")[0])
conflicts.Add(filepath)
} else if is3way && line == threewayFailed {
conflict = true
} else if strings.HasPrefix(line, errorPrefix) {
conflict = true
for _, suffix := range patchErrorSuffices {
if strings.HasSuffix(line, suffix) {
filepath := strings.TrimSpace(strings.TrimSuffix(line[len(errorPrefix):], suffix))
if filepath != "" {
conflicts.Add(filepath)
}
break
}
}
} else if is3way && strings.HasPrefix(line, appliedPatchPrefix) && strings.HasSuffix(line, withConflicts) {
conflict = true
filepath := strings.TrimPrefix(strings.TrimSuffix(line, withConflicts), appliedPatchPrefix)
if filepath != "" {
conflicts.Add(filepath)
}
}
// only list 10 conflicted files
if len(conflicts) >= 10 {
break
}
}
if len(conflicts) > 0 {
pr.ConflictedFiles = make([]string, 0, len(conflicts))
for key := range conflicts {
pr.ConflictedFiles = append(pr.ConflictedFiles, key)
}
}
return nil
},
})
// 9. Check if the found conflictedfiles is non-zero, "err" could be non-nil, so we should ignore it if we found conflicts.
// Note: `"err" could be non-nil` is due that if enable 3-way merge, it doesn't return any error on found conflicts.
if len(pr.ConflictedFiles) > 0 {
if conflict {
pr.Status = issues_model.PullRequestStatusConflict
log.Trace("Found %d files conflicted: %v", len(pr.ConflictedFiles), pr.ConflictedFiles)
return true, nil
}
} else if err != nil {
return false, fmt.Errorf("git apply --check: %w", err)
}
return false, nil
}
// CheckFileProtection check file Protection
func CheckFileProtection(repo *git.Repository, branchName, oldCommitID, newCommitID string, patterns []glob.Glob, limit int, env []string) ([]string, error) {
if len(patterns) == 0 {
return nil, nil
}
affectedFiles, err := git.GetAffectedFiles(repo, branchName, oldCommitID, newCommitID, env)
if err != nil {
return nil, err
}
changedProtectedFiles := make([]string, 0, limit)
for _, affectedFile := range affectedFiles {
lpath := strings.ToLower(affectedFile)
for _, pat := range patterns {
if pat.Match(lpath) {
changedProtectedFiles = append(changedProtectedFiles, lpath)
break
}
}
if len(changedProtectedFiles) >= limit {
break
}
}
if len(changedProtectedFiles) > 0 {
err = models.ErrFilePathProtected{
Path: changedProtectedFiles[0],
}
}
return changedProtectedFiles, err
}
// CheckUnprotectedFiles check if the commit only touches unprotected files
func CheckUnprotectedFiles(repo *git.Repository, branchName, oldCommitID, newCommitID string, patterns []glob.Glob, env []string) (bool, error) {
if len(patterns) == 0 {
return false, nil
}
affectedFiles, err := git.GetAffectedFiles(repo, branchName, oldCommitID, newCommitID, env)
if err != nil {
return false, err
}
for _, affectedFile := range affectedFiles {
lpath := strings.ToLower(affectedFile)
unprotected := false
for _, pat := range patterns {
if pat.Match(lpath) {
unprotected = true
break
}
}
if !unprotected {
return false, nil
}
}
return true, nil
}
// checkPullFilesProtection check if pr changed protected files and save results
func checkPullFilesProtection(ctx context.Context, pr *issues_model.PullRequest, gitRepo *git.Repository) error {
if pr.Status == issues_model.PullRequestStatusEmpty {
pr.ChangedProtectedFiles = nil
return nil
}
pb, err := git_model.GetFirstMatchProtectedBranchRule(ctx, pr.BaseRepoID, pr.BaseBranch)
if err != nil {
return err
}
if pb == nil {
pr.ChangedProtectedFiles = nil
return nil
}
pr.ChangedProtectedFiles, err = CheckFileProtection(gitRepo, pr.HeadBranch, pr.MergeBase, "tracking", pb.GetProtectedFilePatterns(), 10, os.Environ())
if err != nil && !models.IsErrFilePathProtected(err) {
return err
}
return nil
}
```
|
```c++
/*
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Model.h"
#include "AnonymousClassMergingPass.h"
#include "ClassMerging.h"
#include "ConfigFiles.h"
#include "ConfigUtils.h"
#include "InterDexGrouping.h"
#include "MergingStrategies.h"
#include "ModelSpecGenerator.h"
#include "PassManager.h"
namespace class_merging {
void AnonymousClassMergingPass::bind_config() {
std::vector<std::string> excl_names;
bind("exclude",
{},
excl_names,
"Do not merge the classes or its implementors");
utils::load_types_and_prefixes(excl_names, m_merging_spec.exclude_types,
m_merging_spec.exclude_prefixes);
bind("include_primary_dex", false, m_merging_spec.include_primary_dex);
bind("global_min_count",
500,
m_global_min_count,
"Ignore interface or class hierarchies with less than "
"global_min_count implementors or subclasses");
bind("min_count",
2,
m_min_count,
"Minimum mergeable class count per merging group");
bind("max_count",
50,
m_max_count,
"Maximum mergeable class count per merging group");
bind("use_stable_shape_names", false, m_merging_spec.use_stable_shape_names);
std::string interdex_grouping;
bind("interdex_grouping", "non-ordered-set", interdex_grouping);
// Inferring_mode is "class-loads" by default.
m_merging_spec.interdex_config.init_type(interdex_grouping);
}
void AnonymousClassMergingPass::run_pass(DexStoresVector& stores,
ConfigFiles& conf,
PassManager& mgr) {
// Fill the merging configurations.
m_merging_spec.name = "Anonymous Classes";
m_merging_spec.class_name_prefix = "Anon";
m_merging_spec.strategy = strategy::BY_REFS;
if (conf.force_single_dex() ||
(!stores.empty() && stores[0].num_dexes() == 1)) {
m_merging_spec.include_primary_dex = true;
}
m_merging_spec.dedup_fill_in_stack_trace = false;
m_merging_spec.min_count = m_min_count;
if (m_max_count > 0) {
m_merging_spec.max_count = m_max_count;
}
auto scope = build_class_scope(stores);
TypeSystem type_system(scope);
find_all_mergeables_and_roots(type_system, scope, m_global_min_count, mgr,
&m_merging_spec);
if (!m_merging_spec.roots.empty()) {
class_merging::merge_model(scope, conf, mgr, stores, m_merging_spec);
post_dexen_changes(scope, stores);
} else {
TRACE(CLMG, 2, "No enough anonymous classes to merge");
}
}
static AnonymousClassMergingPass s_pass;
} // namespace class_merging
```
|
```css
@import url(path_to_url
@import url(path_to_url
@import url(path_to_url
body { font-family: 'Droid Serif', 'Palatino Linotype', 'Book Antiqua', Palatino, 'Microsoft YaHei', 'Songti SC', serif; }
h1, h2, h3 {
font-family: 'Yanone Kaffeesatz';
font-weight: normal;
}
.remark-code, .remark-inline-code { font-family: 'Source Code Pro', 'Lucida Console', Monaco, monospace; }
```
|
```scss
$avatar-base-size: 30;
.initials {
font-weight: bold;
font-size: ceil(calc($avatar-base-size / 2 - 2))+px;
}
$avatarSizes: "xs" .75, "sm" 1.25, "md" 1.5, "lg" 2;
@each $avatarSizeName, $avatarBaseSize in $avatarSizes {
.avatar-#{$avatarSizeName} {
width: ceil(calc($avatar-base-size * $avatarBaseSize))+px;
height: ceil(calc($avatar-base-size * $avatarBaseSize))+px;
.initials {
font-size: ceil(calc($avatar-base-size * $avatarBaseSize / 2 - 2))+px;
}
}
}
.widget-user-image {
border-radius: 50%;
border: 3px solid #fff;
.avatar {
width: ceil(calc($avatar-base-size * 2.75))+px;
height: ceil(calc($avatar-base-size * 2.75))+px;
.initials {
font-size: ceil(calc($avatar-base-size * 2.75 / 2 - 2))+px;
}
}
}
/* Detail tables like my teams (Dashboard) or */
table.dataTable.table > tbody > tr > td {
&.avatars {
.avatar {
margin: 1px;
}
}
}
/* decreases the margin between avatars, see path_to_url */
.avatar-list-stacked .avatar {
margin-right: calc(var(--tblr-avatar-size)*-.2)!important;
}
```
|
Saint-Paulet (; ) is a commune in the Aude department in southern France.
Population
See also
Communes of the Aude department
References
Communes of Aude
Aude communes articles needing translation from French Wikipedia
|
Margaret Ann Putt (born 5 June 1953) is a former Australian politician and parliamentary leader of the Tasmanian Greens.
Early life
Putt was born in Sydney and attended school at Hornsby High School. At the age of 16, she won a scholarship to the Australian International Independent School in Epping. At this time, Putt was also part of organising High School Students against Vietnam. She then travelled to the United Kingdom where she studied a Bachelor of Arts, majoring in international relations, at the University of Sussex, graduating with Honours.
After completing her degree, Putt travelled back to Australia through Asia, and in 1975 got a job developing pollution control programs at Botany, at a time when the NSW Environment Protection Agency had just been set up. In the late 1970s Putt moved up to Nimbin, and camped at a commune. She later moved to the Northern Territory to work with Aboriginal communities on Elcho Island in Arnhem land. She then moved to live on Dangar Island in the Hawkesbury, NSW.
She moved to Tasmania in 1986 with her partner and two daughters, where she became spokesperson for the Huon Protection Group which succeeded in stopping development of a new woodchip mill on the Huon River. She also founded the Tasmanian Threatened Species Network and was director of the Tasmanian Conservation Trust.
Political career
In 1992, Bob Brown asked Peg to be a support candidate for the Green Independents at the impending state election after the first Labor-Green accord collapsed. Putt entered the Tasmanian House of Assembly in 1993 after Bob Brown resigned and votes in the Hobart electorate of Denison were recounted. The 1996 state election gave the Greens the balance of power and Putt was one of four Greens to be in parliament during the period of balance of power. In 1998 the Labor and Liberal parties restructured the Tasmanian Parliament, reducing the number of House of Assembly members from 35 to 25. In the 1998 state election, called one week after the restructure, she was the only one out of four Greens to retain a seat and became leader as a result. Four years later in the 2002 election she recorded the second highest vote of 12,036 (20.0%) after Tasmanian premier Jim Bacon and became one of four Greens elected. In doing so, she outpolled the leader of the Liberal Party, Bob Cheek, in their electorate of Denison. Putt became the Greens parliamentary leader.
Putt was re-elected in the 2006 election, receiving 18.4% of first preferences, a decrease compared to her previous result, but the highest of any Denison candidate. On 7 July 2008, Putt announced her retirement as leader of the Tasmanian Greens, and as a Member of the House of Assembly. She was replaced as Greens leader by the party's deputy leader, Nick McKim.
After politics
After her resignation, Putt left the state and has since returned to focus on international work, representing the Wilderness Society at UN climate change and forest negotiations. In 2012, Putt was appointed CEO of anti-logging group Markets for Change and has since publicly criticised the Wilderness Society.
In 2011, Putt was placed on the Tasmanian Honour Roll of Women for her environmental advocacy.
References
Tasmanian Greens history page
Further reading
Armstrong, Lance J.E. (1997). Good God, He's Green! A History of Tasmanian Politics 1989-1996. Wahroonga, N.S.W., Pacific Law Press.
Lines, William J. (2006) Patriots : defending Australia's natural heritage St. Lucia, Qld. : University of Queensland Press, 2006.
External links
Peg Putt's maiden speech to parliament
Peg Putt's page at Tasmanian Greens website
1953 births
Living people
Australian Greens members of the Parliament of Tasmania
Members of the Tasmanian House of Assembly
Alumni of the University of Sussex
21st-century Australian politicians
21st-century Australian women politicians
Women members of the Tasmanian House of Assembly
|
Chen Mei-ling (born 13 June 1965), better known by her stage name Fang Wen-lin (), is a Taiwanese singer and actress. In the 1980s she was part of the popular girl group Feiying Trio (飛鷹三姝) with Annie Yi and Donna Chiu.
Fang released 10 Mandopop albums from 1987 to 1998. She has since focused on her acting career, and won Golden Bell Award for Best Actress in a Miniseries or Television Film in 2005.
Filmography
Film
TV Dramas
Awards and nominations
References
External links
20th-century Taiwanese actresses
21st-century Taiwanese actresses
Taiwanese film actresses
Taiwanese television actresses
Taiwanese Mandopop singers
1965 births
People from Changhua County
Living people
20th-century Taiwanese women singers
|
Pennywort is a common name given to several different plants around the world. In general they have round leaves and a low-growing habit. Pennywort may refer to:
In Asia: the edible Asiatic pennywort, Centella asiatica, also known as centella, Indian pennywort, or gotukola.
In Europe: Navelwort, Umbilicus rupestris (formerly Cotyledon umbilicus), known as penny-pies, wall pennywort, or kidneywort, a succulent, perennial flowering plant in the stonecrop family Crassulaceae.
Water pennywort, the genus Hydrocotyle, known as floating pennywort, Indian pennywort, marsh penny, thick-leaved pennywort, or even white rot, aquatic or semi-aquatic plants such as the edible dollarweed, Hydrocotyle umbellata.
Liver leaf, Anemone hepatica, also known as liverwort.
Virginian pennywort, Obolaria virginica.
Cymbalaria muralis.
Cymbalaria aequitriloba, tiny ivy-like leaves with copious purple-pink flowers with yellow throats.
References
|
```smalltalk
using System.Collections.Immutable;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Diagnostics;
using Roslynator.CSharp;
namespace Roslynator.CSharp.Analysis;
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public sealed class ConditionalExpressionAnalyzer : BaseDiagnosticAnalyzer
{
private static ImmutableArray<DiagnosticDescriptor> _supportedDiagnostics;
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics
{
get
{
if (_supportedDiagnostics.IsDefault)
Immutable.InterlockedInitialize(ref _supportedDiagnostics, DiagnosticRules.AvoidNestedConditionalOperators);
return _supportedDiagnostics;
}
}
public override void Initialize(AnalysisContext context)
{
base.Initialize(context);
context.RegisterSyntaxNodeAction(f => AnalyzeConditionalExpression(f), SyntaxKind.ConditionalExpression);
}
private static void AnalyzeConditionalExpression(SyntaxNodeAnalysisContext context)
{
var conditionalExpression = (ConditionalExpressionSyntax)context.Node;
if (!conditionalExpression.WalkUpParentheses().IsParentKind(SyntaxKind.ConditionalExpression))
{
if (conditionalExpression.WhenTrue.WalkDownParentheses().IsKind(SyntaxKind.ConditionalExpression)
|| conditionalExpression.WhenFalse.WalkDownParentheses().IsKind(SyntaxKind.ConditionalExpression))
{
DiagnosticHelpers.ReportDiagnostic(context, DiagnosticRules.AvoidNestedConditionalOperators, conditionalExpression);
}
}
}
}
```
|
Stradale (Italian for "road-going") may refer to:
Alfa Romeo 33 Stradale, street-legal derivative of a racecar
Dallara Stradale, first streetcar from racecar maker Dallara
Ferrari SF90 Stradale
Maserati GranTurismo MC Stradale
Lancia 037 Stradale
See also
|
```xml
import React from 'react';
import { Color, PatternItem } from './Common.types';
/**
* GeoJson specific props.
*/
export type GeoJsonProps = {
/**
* JSON string containing GeoJSON
*/
geoJsonString: string;
/**
* Default style for different GeoJSON feature types
*/
defaultStyle?: {
/**
* Default style for `Polygon` GeoJSON feature
*/
polygon?: {
/**
* See {@link PolygonProps}
*/
fillColor?: string | Color;
/**
* See {@link PolygonProps}
*/
strokeColor?: string | Color;
/**
* See {@link PolygonProps}
*/
strokeWidth?: number;
/**
* See {@link PolygonProps}
* Works only on `Android`.
*/
strokeJointType?: 'bevel' | 'miter' | 'round';
/**
* See {@link PolygonProps}
* Works only on `Android`.
*/
strokePattern?: PatternItem[];
};
/**
* Default style for `LineString` GeoJSON feature
*/
polyline?: {
/**
* See {@link PolylineProps}
*/
color?: string | Color;
/**
* See {@link PolylineProps}
* Works only on `Android`.
*/
pattern?: PatternItem[];
/**
* See {@link PolylineProps}
* Works only on `iOS`.
*/
width?: number;
};
/**
* Default style for `Point` GeoJSON feature
* Works only on `Android`.
*/
marker?: {
/**
* See {@link MarkerProps}
* Works only on `Android`.
*/
color?: string;
/**
* See {@link MarkerProps}
* Works only on `Android`.
*/
title?: string;
/**
* See {@link MarkerProps}
* Works only on `Android`.
*/
snippet?: string;
};
};
};
/**
* Internal JSON object for representing GeoJSON in Expo Maps library.
*
* See {@link GeoJsonProps} for more detail.
*/
export type GeoJsonObject = {
type: 'geojson';
defaultStyle?: {
polygon?: {
fillColor?: string;
strokeColor?: string;
strokeWidth?: number;
strokeJointType?: 'bevel' | 'miter' | 'round';
strokePattern?: PatternItem[];
};
polyline?: {
color?: string;
pattern?: PatternItem[];
};
marker?: {
color?: number;
title?: string;
snippet?: string;
};
};
} & Omit<GeoJsonProps, 'defaultStyle'>;
/**
* GeoJSON component of Expo Maps library.
*
* Displays data provided in .json file.
* This component should be ExpoMap component child to work properly.
*
* See {@link GeoJsonProps} for more details.
*
* Please note that GeoJSONs are only supported on Apple Maps for iOS versions >= 13.
*
* On Android you can style your features individually by specifing supported properties for given feature type:
*
* For polygon you can use:
* * fillColor
* * strokeColor
* * strokeWidth
* * strokeJointType
* * strokePattern
* props. Please check documentation for these five here {@link PolygonProps}.
*
* For polyline you can use:
* * color
* * pattern
* props. Please check documentation for these two here {@link PolylineProps}.
*
* For marker you can use:
* * color
* * title
* * snippet
* props. Please check documentation for these three here {@link MarkerProps}.
*
* @example
* {
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"geometry": { "type": "Point", "coordinates": [102.0, 0.5] },
"properties": {
"color": "blue",
"title": "Marker",
"snippet": "This is marker from GeoJSON"
}
},
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[1.75, 47.69],
[21.89, 42.79],
[43.65, 53.22],
[58.58, 48.58]
]
},
"properties": {
"color": "magenta",
"pattern": [
{ "type": "stroke", "length": 10 },
{ "type": "stroke", "length": 0 },
{ "type": "stroke", "length": 10 },
{ "type": "gap", "length": 10 },
{ "type": "stroke", "length": 0 },
{ "type": "gap", "length": 10 }
]
}
},
{
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[15.73, 53.84],
[16.31, 51.11],
[50.14, 22.07],
[53.18, 22.11]
]
]
},
"properties": {
"fillColor": "blue",
"strokeColor": "#000000",
"strokeWidth": 10,
"strokeJointType": "bevel",
"strokePattern": [
{ "type": "stroke", "length": 10 },
{ "type": "stroke", "length": 0 },
{ "type": "stroke", "length": 10 },
{ "type": "gap", "length": 10 },
{ "type": "stroke", "length": 0 },
{ "type": "gap", "length": 10 }
]
}
}
]
}
*/
export declare class GeoJson extends React.Component<GeoJsonProps> {
render(): null;
}
//# sourceMappingURL=GeoJson.d.ts.map
```
|
```rust
use super::*;
#[test]
fn pointy_brace() {
html_opts!(
[render.unsafe_],
concat!(
"URI autolink: <path_to_url",
"\n",
"Email autolink: <bill@microsoft.com>\n",
"\n",
"* Inline <em>tag</em> **ha**.\n",
"* Inline <!-- comment --> **ha**.\n",
"* Inline <? processing instruction ?> **ha**.\n",
"* Inline <!DECLARATION OKAY> **ha**.\n",
"* Inline <![CDATA[ok]ha **ha** ]]> **ha**.\n"
),
concat!(
"<p>URI autolink: <a \
href=\"path_to_url">path_to_url",
"<p>Email autolink: <a \
href=\"mailto:bill@microsoft.com\">bill@microsoft.com</a></p>\n",
"<ul>\n",
"<li>Inline <em>tag</em> <strong>ha</strong>.</li>\n",
"<li>Inline <!-- comment --> <strong>ha</strong>.</li>\n",
"<li>Inline <? processing instruction ?> <strong>ha</strong>.</li>\n",
"<li>Inline <!DECLARATION OKAY> <strong>ha</strong>.</li>\n",
"<li>Inline <![CDATA[ok]ha **ha** ]]> <strong>ha</strong>.</li>\n",
"</ul>\n"
),
);
}
#[test]
fn no_control_characters_in_reference_links() {
html(
"[A]:\u{1b}\n\nX [A] Y\n",
"<p>[A]:\u{1b}</p>\n<p>X [A] Y</p>\n",
)
}
#[test]
fn link_entity_regression() {
html(
"[link](javascript:alert('XSS'))",
"<p><a href=\"&#x6A&#x61&#x76&#x61&#x73&#x63&#x72&#x69&#x70&#x74&#x3A&#x61&#x6C&#x65&#x72&#x74&#x28&#x27&#x58&#x53&#x53&#x27&#x29\">link</a></p>\n",
);
}
#[test]
fn regression_back_to_back_ranges() {
html(
"**bold*****bold+italic***",
"<p><strong>bold</strong><em><strong>bold+italic</strong></em></p>\n",
);
}
#[test]
fn no_panic_on_empty_bookended_atx_headers() {
html("# #", "<h1></h1>\n");
}
#[test]
fn no_stack_smash_html() {
let s: String = ">".repeat(150_000);
let arena = Arena::new();
let root = parse_document(&arena, &s, &Options::default());
let mut output = vec![];
html::format_document(root, &Options::default(), &mut output).unwrap()
}
#[test]
fn no_stack_smash_cm() {
let s: String = ">".repeat(150_000);
let arena = Arena::new();
let root = parse_document(&arena, &s, &Options::default());
let mut output = vec![];
cm::format_document(root, &Options::default(), &mut output).unwrap()
}
#[test]
fn cm_autolink_regression() {
// Testing that the cm renderer handles this case without crashing
html("<a+c:dd>", "<p><a href=\"a+c:dd\">a+c:dd</a></p>\n");
}
#[test]
fn regression_424() {
html(
"*text* [link](#section)",
"<p><em>text</em> <a href=\"#section\">link</a></p>\n",
);
}
#[test]
fn example_61() {
html(
r##"
`Foo
----
`
<a title="a lot
---
of dashes"/>
"##,
r##"<h2>`Foo</h2>
<p>`</p>
<h2><a title="a lot</h2>
<p>of dashes"/></p>
"##,
);
}
#[test]
fn nul_at_eof() {
html("foo\0", "<p>foo\u{fffd}</p>\n");
html("foo\0ba", "<p>foo\u{fffd}ba</p>\n");
html("foo\0ba\0", "<p>foo\u{fffd}ba\u{fffd}</p>\n");
}
#[test]
fn sourcepos_para() {
html_opts!(
[render.sourcepos],
"abc\ndef\n\nghi\n",
"<p data-sourcepos=\"1:1-2:3\">abc\ndef</p>\n<p data-sourcepos=\"4:1-4:3\">ghi</p>\n",
);
}
#[test]
#[cfg(feature = "shortcodes")]
fn gemoji() {
html_opts!([extension.shortcodes], ":x:", "<p></p>\n");
}
```
|
```smalltalk
using System.Text;
using Shouldly;
using Volo.Abp.Localization;
using Xunit;
namespace System;
public class StringExtensions_Tests : IDisposable
{
private readonly IDisposable _cultureScope;
public StringExtensions_Tests()
{
_cultureScope = CultureHelper.Use("en-US");
}
[Fact]
public void EnsureEndsWith_Test()
{
//Expected use-cases
"Test".EnsureEndsWith('!').ShouldBe("Test!");
"Test!".EnsureEndsWith('!').ShouldBe("Test!");
@"C:\test\folderName".EnsureEndsWith('\\').ShouldBe(@"C:\test\folderName\");
@"C:\test\folderName\".EnsureEndsWith('\\').ShouldBe(@"C:\test\folderName\");
"Sar".EnsureEndsWith('').ShouldBe("Sar");
//Case differences
"TurkeY".EnsureEndsWith('y').ShouldBe("TurkeYy");
}
[Fact]
public void EnsureEndsWith_CultureSpecific_Test()
{
using (CultureHelper.Use("tr-TR"))
{
"Krmz".EnsureEndsWith('I', StringComparison.CurrentCultureIgnoreCase).ShouldBe("Krmz");
}
}
[Fact]
public void EnsureStartsWith_Test()
{
//Expected use-cases
"Test".EnsureStartsWith('~').ShouldBe("~Test");
"~Test".EnsureStartsWith('~').ShouldBe("~Test");
//Case differences
"Turkey".EnsureStartsWith('t').ShouldBe("tTurkey");
}
[Fact]
public void ToPascalCase_Test()
{
(null as string).ToPascalCase().ShouldBe(null);
"helloWorld".ToPascalCase().ShouldBe("HelloWorld");
"istanbul".ToPascalCase().ShouldBe("Istanbul");
}
[Fact]
public void ToPascalCase_CurrentCulture_Test()
{
using (CultureHelper.Use("tr-TR"))
{
"istanbul".ToPascalCase(true).ShouldBe("stanbul");
}
}
[Fact]
public void ToCamelCase_Test()
{
(null as string).ToCamelCase().ShouldBe(null);
"HelloWorld".ToCamelCase().ShouldBe("helloWorld");
"Istanbul".ToCamelCase().ShouldBe("istanbul");
}
[Fact]
public void ToKebabCase_Test()
{
(null as string).ToKebabCase().ShouldBe(null);
"helloMoon".ToKebabCase().ShouldBe("hello-moon");
"HelloWorld".ToKebabCase().ShouldBe("hello-world");
"HelloIsparta".ToKebabCase().ShouldBe("hello-isparta");
"ThisIsSampleText".ToKebabCase().ShouldBe("this-is-sample-text");
}
[Fact]
public void ToSnakeCase_Test()
{
(null as string).ToSnakeCase().ShouldBe(null);
"helloMoon".ToSnakeCase().ShouldBe("hello_moon");
"HelloWorld".ToSnakeCase().ShouldBe("hello_world");
"HelloIsparta".ToSnakeCase().ShouldBe("hello_isparta");
"ThisIsSampleText".ToSnakeCase().ShouldBe("this_is_sample_text");
}
[Fact]
public void ToSentenceCase_Test()
{
(null as string).ToSentenceCase().ShouldBe(null);
"HelloWorld".ToSentenceCase().ShouldBe("Hello world");
"HelloIsparta".ToSentenceCase().ShouldBe("Hello isparta");
"ThisIsSampleSentence".ToSentenceCase().ShouldBe("This is sample sentence");
"thisIsSampleSentence".ToSentenceCase().ShouldBe("this is sample sentence");
}
[Fact]
public void Right_Test()
{
const string str = "This is a test string";
str.Right(3).ShouldBe("ing");
str.Right(0).ShouldBe("");
str.Right(str.Length).ShouldBe(str);
}
[Fact]
public void Left_Test()
{
const string str = "This is a test string";
str.Left(3).ShouldBe("Thi");
str.Left(0).ShouldBe("");
str.Left(str.Length).ShouldBe(str);
}
[Fact]
public void NormalizeLineEndings_Test()
{
const string str = "This\r\n is a\r test \n string";
var normalized = str.NormalizeLineEndings();
var lines = normalized.SplitToLines();
lines.Length.ShouldBe(4);
}
[Fact]
public void NthIndexOf_Test()
{
const string str = "This is a test string";
str.NthIndexOf('i', 0).ShouldBe(-1);
str.NthIndexOf('i', 1).ShouldBe(2);
str.NthIndexOf('i', 2).ShouldBe(5);
str.NthIndexOf('i', 3).ShouldBe(18);
str.NthIndexOf('i', 4).ShouldBe(-1);
}
[Fact]
public void Truncate_Test()
{
const string str = "This is a test string";
const string nullValue = null;
str.Truncate(7).ShouldBe("This is");
str.Truncate(0).ShouldBe("");
str.Truncate(100).ShouldBe(str);
nullValue.Truncate(5).ShouldBe(null);
}
[Fact]
public void TruncateWithPostFix_Test()
{
const string str = "This is a test string";
const string nullValue = null;
str.TruncateWithPostfix(3).ShouldBe("...");
str.TruncateWithPostfix(12).ShouldBe("This is a...");
str.TruncateWithPostfix(0).ShouldBe("");
str.TruncateWithPostfix(100).ShouldBe(str);
nullValue.Truncate(5).ShouldBe(null);
str.TruncateWithPostfix(3, "~").ShouldBe("Th~");
str.TruncateWithPostfix(12, "~").ShouldBe("This is a t~");
str.TruncateWithPostfix(0, "~").ShouldBe("");
str.TruncateWithPostfix(100, "~").ShouldBe(str);
nullValue.TruncateWithPostfix(5, "~").ShouldBe(null);
}
[Fact]
public void RemovePostFix_Tests()
{
//null case
(null as string).RemovePostFix("Test").ShouldBeNull();
//empty case
string.Empty.RemovePostFix("Test").ShouldBe(string.Empty);
//Simple case
"MyTestAppService".RemovePostFix("AppService").ShouldBe("MyTest");
"MyTestAppService".RemovePostFix("Service").ShouldBe("MyTestApp");
//Multiple postfix (orders of postfixes are important)
"MyTestAppService".RemovePostFix("AppService", "Service").ShouldBe("MyTest");
"MyTestAppService".RemovePostFix("Service", "AppService").ShouldBe("MyTestApp");
//Ignore case
"TestString".RemovePostFix(StringComparison.OrdinalIgnoreCase, "string").ShouldBe("Test");
//Unmatched case
"MyTestAppService".RemovePostFix("Unmatched").ShouldBe("MyTestAppService");
}
[Fact]
public void RemovePreFix_Tests()
{
//null case
(null as string).RemovePreFix("Test").ShouldBeNull();
//empty case
string.Empty.RemovePreFix("Test").ShouldBe(string.Empty);
"Home.Index".RemovePreFix("NotMatchedPrefix").ShouldBe("Home.Index");
"Home.About".RemovePreFix("Home.").ShouldBe("About");
//Ignore case
"Https://abp.io".RemovePreFix(StringComparison.OrdinalIgnoreCase, "https://").ShouldBe("abp.io");
}
[Fact]
public void ReplaceFirst_Tests()
{
"Test string".ReplaceFirst("s", "X").ShouldBe("TeXt string");
"Test test test".ReplaceFirst("test", "XX").ShouldBe("Test XX test");
"Test test test".ReplaceFirst("test", "XX", StringComparison.OrdinalIgnoreCase).ShouldBe("XX test test");
}
[Fact]
public void ToEnum_Test()
{
"MyValue1".ToEnum<MyEnum>().ShouldBe(MyEnum.MyValue1);
"MyValue2".ToEnum<MyEnum>().ShouldBe(MyEnum.MyValue2);
}
[Theory]
[InlineData("")]
[InlineData("MyString")]
public void GetBytes_Test(string str)
{
var bytes = str.GetBytes();
bytes.ShouldNotBeNull();
bytes.Length.ShouldBeGreaterThanOrEqualTo(str.Length);
Encoding.UTF8.GetString(bytes).ShouldBe(str);
}
[Theory]
[InlineData("")]
[InlineData("MyString")]
public void GetBytes_With_Encoding_Test(string str)
{
var bytes = str.GetBytes(Encoding.ASCII);
bytes.ShouldNotBeNull();
bytes.Length.ShouldBeGreaterThanOrEqualTo(str.Length);
Encoding.ASCII.GetString(bytes).ShouldBe(str);
}
private enum MyEnum
{
MyValue1,
MyValue2
}
public void Dispose()
{
_cultureScope.Dispose();
}
}
```
|
```go
package migrator
import (
portainer "github.com/portainer/portainer/api"
"github.com/rs/zerolog/log"
)
func (m *Migrator) migrateDBVersionToDB60() error {
return m.addGpuInputFieldDB60()
}
func (m *Migrator) addGpuInputFieldDB60() error {
log.Info().Msg("add gpu input field")
endpoints, err := m.endpointService.Endpoints()
if err != nil {
return err
}
for _, endpoint := range endpoints {
if endpoint.Gpus == nil {
endpoint.Gpus = []portainer.Pair{}
err = m.endpointService.UpdateEndpoint(endpoint.ID, &endpoint)
if err != nil {
return err
}
}
}
return nil
}
```
|
```java
/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package jdk.graal.compiler.core.aarch64;
import org.graalvm.collections.EconomicMap;
import org.graalvm.collections.Equivalence;
import jdk.graal.compiler.asm.aarch64.AArch64Assembler;
import jdk.graal.compiler.asm.aarch64.AArch64Assembler.ExtendType;
import jdk.graal.compiler.asm.aarch64.AArch64MacroAssembler;
import jdk.graal.compiler.core.common.LIRKind;
import jdk.graal.compiler.core.common.NumUtil;
import jdk.graal.compiler.core.common.calc.CanonicalCondition;
import jdk.graal.compiler.core.common.calc.FloatConvert;
import jdk.graal.compiler.core.gen.NodeMatchRules;
import jdk.graal.compiler.core.match.ComplexMatchResult;
import jdk.graal.compiler.core.match.MatchRule;
import jdk.graal.compiler.core.match.MatchableNode;
import jdk.graal.compiler.debug.Assertions;
import jdk.graal.compiler.debug.GraalError;
import jdk.graal.compiler.lir.LIRFrameState;
import jdk.graal.compiler.lir.LabelRef;
import jdk.graal.compiler.lir.Variable;
import jdk.graal.compiler.lir.aarch64.AArch64ArithmeticOp;
import jdk.graal.compiler.lir.aarch64.AArch64BitFieldOp;
import jdk.graal.compiler.lir.aarch64.AArch64BitFieldOp.BitFieldOpCode;
import jdk.graal.compiler.lir.aarch64.AArch64ControlFlow;
import jdk.graal.compiler.lir.gen.LIRGeneratorTool;
import jdk.graal.compiler.nodes.ConstantNode;
import jdk.graal.compiler.nodes.DeoptimizingNode;
import jdk.graal.compiler.nodes.FixedNode;
import jdk.graal.compiler.nodes.IfNode;
import jdk.graal.compiler.nodes.NodeView;
import jdk.graal.compiler.nodes.ValueNode;
import jdk.graal.compiler.nodes.calc.AddNode;
import jdk.graal.compiler.nodes.calc.AndNode;
import jdk.graal.compiler.nodes.calc.BinaryNode;
import jdk.graal.compiler.nodes.calc.FloatConvertNode;
import jdk.graal.compiler.nodes.calc.IntegerConvertNode;
import jdk.graal.compiler.nodes.calc.IntegerLessThanNode;
import jdk.graal.compiler.nodes.calc.LeftShiftNode;
import jdk.graal.compiler.nodes.calc.MulNode;
import jdk.graal.compiler.nodes.calc.NotNode;
import jdk.graal.compiler.nodes.calc.OrNode;
import jdk.graal.compiler.nodes.calc.RightShiftNode;
import jdk.graal.compiler.nodes.calc.ShiftNode;
import jdk.graal.compiler.nodes.calc.SignExtendNode;
import jdk.graal.compiler.nodes.calc.SubNode;
import jdk.graal.compiler.nodes.calc.UnaryNode;
import jdk.graal.compiler.nodes.calc.UnsignedRightShiftNode;
import jdk.graal.compiler.nodes.calc.XorNode;
import jdk.graal.compiler.nodes.calc.ZeroExtendNode;
import jdk.graal.compiler.nodes.memory.MemoryAccess;
import jdk.vm.ci.aarch64.AArch64;
import jdk.vm.ci.aarch64.AArch64Kind;
import jdk.vm.ci.code.CodeUtil;
import jdk.vm.ci.meta.AllocatableValue;
import jdk.vm.ci.meta.JavaConstant;
import jdk.vm.ci.meta.JavaKind;
import jdk.vm.ci.meta.Value;
@MatchableNode(nodeClass = AArch64PointerAddNode.class, inputs = {"base", "offset"})
public class AArch64NodeMatchRules extends NodeMatchRules {
private static final EconomicMap<Class<? extends BinaryNode>, AArch64ArithmeticOp> binaryOpMap;
private static final EconomicMap<Class<? extends BinaryNode>, AArch64BitFieldOp.BitFieldOpCode> bitFieldOpMap;
private static final EconomicMap<Class<? extends BinaryNode>, AArch64MacroAssembler.ShiftType> shiftTypeMap;
private static final EconomicMap<Class<? extends BinaryNode>, AArch64ArithmeticOp> logicalNotOpMap;
static {
binaryOpMap = EconomicMap.create(Equivalence.IDENTITY, 9);
binaryOpMap.put(AddNode.class, AArch64ArithmeticOp.ADD);
binaryOpMap.put(SubNode.class, AArch64ArithmeticOp.SUB);
binaryOpMap.put(MulNode.class, AArch64ArithmeticOp.MUL);
binaryOpMap.put(AndNode.class, AArch64ArithmeticOp.AND);
binaryOpMap.put(OrNode.class, AArch64ArithmeticOp.OR);
binaryOpMap.put(XorNode.class, AArch64ArithmeticOp.XOR);
binaryOpMap.put(LeftShiftNode.class, AArch64ArithmeticOp.LSL);
binaryOpMap.put(RightShiftNode.class, AArch64ArithmeticOp.ASR);
binaryOpMap.put(UnsignedRightShiftNode.class, AArch64ArithmeticOp.LSR);
bitFieldOpMap = EconomicMap.create(Equivalence.IDENTITY, 2);
bitFieldOpMap.put(UnsignedRightShiftNode.class, BitFieldOpCode.UBFX);
bitFieldOpMap.put(LeftShiftNode.class, BitFieldOpCode.UBFIZ);
logicalNotOpMap = EconomicMap.create(Equivalence.IDENTITY, 3);
logicalNotOpMap.put(AndNode.class, AArch64ArithmeticOp.BIC);
logicalNotOpMap.put(OrNode.class, AArch64ArithmeticOp.ORN);
logicalNotOpMap.put(XorNode.class, AArch64ArithmeticOp.EON);
shiftTypeMap = EconomicMap.create(Equivalence.IDENTITY, 3);
shiftTypeMap.put(LeftShiftNode.class, AArch64MacroAssembler.ShiftType.LSL);
shiftTypeMap.put(RightShiftNode.class, AArch64MacroAssembler.ShiftType.ASR);
shiftTypeMap.put(UnsignedRightShiftNode.class, AArch64MacroAssembler.ShiftType.LSR);
}
public AArch64NodeMatchRules(LIRGeneratorTool gen) {
super(gen);
}
/**
* Checks whether all arguments are numeric integers.
*/
protected boolean isNumericInteger(ValueNode... values) {
for (ValueNode value : values) {
if (!value.getStackKind().isNumericInteger()) {
return false;
}
}
return true;
}
/**
* Checks whether all arguments are numeric floats.
*/
protected boolean isNumericFloat(ValueNode... values) {
for (ValueNode value : values) {
if (!value.getStackKind().isNumericFloat()) {
return false;
}
}
return true;
}
protected LIRFrameState getState(MemoryAccess access) {
if (access instanceof DeoptimizingNode) {
return state((DeoptimizingNode) access);
}
return null;
}
protected AArch64Kind getMemoryKind(MemoryAccess access) {
return (AArch64Kind) gen.getLIRKind(((ValueNode) access).stamp(NodeView.DEFAULT)).getPlatformKind();
}
private static boolean isSupportedExtendedAddSubShift(IntegerConvertNode<?> node, int clampedShiftAmt) {
assert NumUtil.assertNonNegativeInt(clampedShiftAmt);
if (clampedShiftAmt <= 4) {
switch (node.getInputBits()) {
case Byte.SIZE:
case Short.SIZE:
case Integer.SIZE:
case Long.SIZE:
return true;
}
}
return false;
}
private static ExtendType getZeroExtendType(int fromBits) {
switch (fromBits) {
case Byte.SIZE:
return ExtendType.UXTB;
case Short.SIZE:
return ExtendType.UXTH;
case Integer.SIZE:
return ExtendType.UXTW;
case Long.SIZE:
return ExtendType.UXTX;
default:
GraalError.shouldNotReachHere("extended from " + fromBits + "bits is not supported!"); // ExcludeFromJacocoGeneratedReport
return null;
}
}
private static ExtendType getSignExtendType(int fromBits) {
switch (fromBits) {
case Byte.SIZE:
return ExtendType.SXTB;
case Short.SIZE:
return ExtendType.SXTH;
case Integer.SIZE:
return ExtendType.SXTW;
case Long.SIZE:
return ExtendType.SXTX;
default:
GraalError.shouldNotReachHere("extended from " + fromBits + "bits is not supported!"); // ExcludeFromJacocoGeneratedReport
return null;
}
}
private AllocatableValue moveSp(AllocatableValue value) {
return getLIRGeneratorTool().moveSp(value);
}
/**
* Clamp shift amounts into range 0 <= shiftamt < size according to JLS.
*/
private static int getClampedShiftAmt(ShiftNode<?> op) {
int clampMask = op.getShiftAmountMask();
assert clampMask == 63 || clampMask == 31 : clampMask;
return op.getY().asJavaConstant().asInt() & clampMask;
}
protected ComplexMatchResult emitBinaryShift(AArch64ArithmeticOp op, ValueNode value, ShiftNode<?> shift) {
AArch64MacroAssembler.ShiftType shiftType = shiftTypeMap.get(shift.getClass());
assert shiftType != null;
assert isNumericInteger(value, shift.getX());
return builder -> {
Value a = operand(value);
Value b = operand(shift.getX());
Variable result = gen.newVariable(LIRKind.combine(a, b));
AllocatableValue x = moveSp(gen.asAllocatable(a));
AllocatableValue y = moveSp(gen.asAllocatable(b));
int shiftAmount = getClampedShiftAmt(shift);
gen.append(new AArch64ArithmeticOp.BinaryShiftOp(op, result, x, y, shiftType, shiftAmount));
return result;
};
}
private ComplexMatchResult emitBitTestAndBranch(FixedNode trueSuccessor, FixedNode falseSuccessor,
ValueNode value, double trueProbability, int nbits) {
return builder -> {
LabelRef trueDestination = getLIRBlock(trueSuccessor);
LabelRef falseDestination = getLIRBlock(falseSuccessor);
AllocatableValue src = moveSp(gen.asAllocatable(operand(value)));
gen.append(new AArch64ControlFlow.BitTestAndBranchOp(trueDestination, falseDestination, src,
trueProbability, nbits));
return null;
};
}
/**
* Helper used by emitBitFieldInsert and emitBitFieldExtract.
*/
private ComplexMatchResult emitBitFieldHelper(JavaKind kind, AArch64BitFieldOp.BitFieldOpCode op, ValueNode value, int lsb, int width) {
assert isNumericInteger(value);
assert lsb + width <= kind.getBitCount() : lsb + " " + kind;
return builder -> {
Value a = operand(value);
LIRKind resultKind = LIRKind.fromJavaKind(gen.target().arch, kind);
Variable result = gen.newVariable(resultKind);
AllocatableValue src = moveSp(gen.asAllocatable(a));
gen.append(new AArch64BitFieldOp(op, result, src, lsb, width));
return result;
};
}
/**
* Copy (width) bits from the least significant bits of the source register to bit position lsb
* of the destination register.
*
* @param kind expected final size of the bitfield operation
* @param op The type of bitfield operation
* @param value The value to extract bits from
* @param lsb (least significant bit) the starting index of where the value is moved to
* @param width The number of bits to extract from value.
*/
private ComplexMatchResult emitBitFieldInsert(JavaKind kind, AArch64BitFieldOp.BitFieldOpCode op, ValueNode value, int lsb, int width) {
assert op == BitFieldOpCode.SBFIZ || op == BitFieldOpCode.UBFIZ : op;
return emitBitFieldHelper(kind, op, value, lsb, width);
}
/**
* Copy (width) bits from the lsb bit position of the source register to the bottom of the
* destination register.
*
* @param kind expected final size of the bitfield operation
* @param op The type of bitfield operation
* @param value The value to extract bits from
* @param lsb (least significant bit) the starting index of where the value copied from
* @param width The number of bits to extract from value.
*/
private ComplexMatchResult emitBitFieldExtract(JavaKind kind, AArch64BitFieldOp.BitFieldOpCode op, ValueNode value, int lsb, int width) {
assert op == BitFieldOpCode.SBFX || op == BitFieldOpCode.UBFX : op;
return emitBitFieldHelper(kind, op, value, lsb, width);
}
private ComplexMatchResult emitExtendedAddSubShift(BinaryNode op, ValueNode x, ValueNode y, ExtendType extType, int shiftAmt) {
assert op instanceof AddNode || op instanceof SubNode : op;
return builder -> {
AllocatableValue src1 = gen.asAllocatable(operand(x));
AllocatableValue src2 = moveSp(gen.asAllocatable(operand(y)));
Variable result = gen.newVariable(LIRKind.combine(operand(x), operand(y)));
AArch64ArithmeticOp arithmeticOp = op instanceof AddNode ? AArch64ArithmeticOp.ADD : AArch64ArithmeticOp.SUB;
gen.append(new AArch64ArithmeticOp.ExtendedAddSubShiftOp(arithmeticOp, result, src1, src2, extType, shiftAmt));
return result;
};
}
/**
* Goal: Use AArch64's add/sub (extended register) instructions to fold away extend and shift of
* left operand.
*/
@MatchRule("(Add=op x (LeftShift=lshift (SignExtend=ext y) Constant))")
@MatchRule("(Sub=op x (LeftShift=lshift (SignExtend=ext y) Constant))")
@MatchRule("(Add=op x (LeftShift=lshift (ZeroExtend=ext y) Constant))")
@MatchRule("(Sub=op x (LeftShift=lshift (ZeroExtend=ext y) Constant))")
public ComplexMatchResult mergeSignExtendByShiftIntoAddSub(BinaryNode op, LeftShiftNode lshift, ValueNode ext, ValueNode x, ValueNode y) {
assert isNumericInteger(lshift);
int shiftAmt = getClampedShiftAmt(lshift);
if (!isSupportedExtendedAddSubShift((IntegerConvertNode<?>) ext, shiftAmt)) {
return null;
}
ExtendType extType;
if (ext instanceof SignExtendNode) {
extType = getSignExtendType(((SignExtendNode) ext).getInputBits());
} else {
extType = getZeroExtendType(((ZeroExtendNode) ext).getInputBits());
}
return emitExtendedAddSubShift(op, x, y, extType, shiftAmt);
}
/**
* Goal: Use AArch64's add/sub (extended register) instructions to fold away the and operation
* (into a zero extend) and shift of left operand.
*/
@MatchRule("(Add=op x (LeftShift=lshift (And y Constant=constant) Constant))")
@MatchRule("(Sub=op x (LeftShift=lshift (And y Constant=constant) Constant))")
public ComplexMatchResult mergeShiftDowncastIntoAddSub(BinaryNode op, LeftShiftNode lshift, ConstantNode constant, ValueNode x, ValueNode y) {
assert isNumericInteger(lshift, constant);
int shiftAmt = getClampedShiftAmt(lshift);
if (shiftAmt > 4) {
return null;
}
long mask = constant.asJavaConstant().asLong() & CodeUtil.mask(op.getStackKind().getBitCount());
if (mask != 0xFFL && mask != 0xFFFFL && mask != 0xFFFFFFFFL) {
return null;
}
int numBits = 64 - Long.numberOfLeadingZeros(mask);
return emitExtendedAddSubShift(op, x, y, getZeroExtendType(numBits), shiftAmt);
}
/**
* Goal: Switch ((x << amt) >> amt) into a sign extend and fold into AArch64 add/sub
* (extended register) instruction.
*/
@MatchRule("(Add=op x (RightShift=signExt (LeftShift y Constant=shiftConst) Constant=shiftConst))")
@MatchRule("(Sub=op x (RightShift=signExt (LeftShift y Constant=shiftConst) Constant=shiftConst))")
public ComplexMatchResult mergePairShiftIntoAddSub(BinaryNode op, RightShiftNode signExt, ValueNode x, ValueNode y) {
int signExtendAmt = getClampedShiftAmt(signExt);
int opSize = op.getStackKind().getBitCount();
assert opSize == 32 || opSize == 64 : opSize;
int remainingBits = opSize - signExtendAmt;
if (remainingBits != 8 && remainingBits != 16 && remainingBits != 32) {
return null;
}
return emitExtendedAddSubShift(op, x, y, getSignExtendType(remainingBits), 0);
}
/**
* Goal: Fold ((x << amt) >> amt) << [0,4] into AArch64 add/sub (extended register)
* instruction with a sign extend and a shift.
*/
@MatchRule("(Add=op x (LeftShift=outerShift (RightShift=signExt (LeftShift y Constant=shiftConst) Constant=shiftConst) Constant))")
@MatchRule("(Sub=op x (LeftShift=outerShift (RightShift=signExt (LeftShift y Constant=shiftConst) Constant=shiftConst) Constant))")
public ComplexMatchResult mergeShiftedPairShiftIntoAddSub(BinaryNode op, LeftShiftNode outerShift, RightShiftNode signExt, ValueNode x, ValueNode y) {
int shiftAmt = getClampedShiftAmt(outerShift);
if (shiftAmt > 4) {
return null;
}
int signExtendAmt = getClampedShiftAmt(signExt);
int opSize = op.getStackKind().getBitCount();
assert opSize == 32 || opSize == 64 : opSize;
int remainingBits = opSize - signExtendAmt;
if (remainingBits != 8 && remainingBits != 16 && remainingBits != 32) {
return null;
}
return emitExtendedAddSubShift(op, x, y, getSignExtendType(remainingBits), shiftAmt);
}
/**
* Goal: Fold zero extend and (optional) shift into AArch64 add/sub (extended register)
* instruction.
*/
@MatchRule("(AArch64PointerAdd=addP base ZeroExtend)")
@MatchRule("(AArch64PointerAdd=addP base (LeftShift ZeroExtend Constant))")
public ComplexMatchResult extendedPointerAddShift(AArch64PointerAddNode addP) {
ValueNode offset = addP.getOffset();
ZeroExtendNode zeroExtend;
int shiftAmt;
if (offset instanceof ZeroExtendNode) {
zeroExtend = (ZeroExtendNode) offset;
shiftAmt = 0;
} else {
LeftShiftNode shift = (LeftShiftNode) offset;
zeroExtend = (ZeroExtendNode) shift.getX();
shiftAmt = getClampedShiftAmt(shift);
}
if (!isSupportedExtendedAddSubShift(zeroExtend, shiftAmt)) {
return null;
}
int fromBits = zeroExtend.getInputBits();
int toBits = zeroExtend.getResultBits();
if (toBits != 64) {
return null;
}
assert fromBits <= toBits : fromBits + " " + toBits;
ExtendType extendType = getZeroExtendType(fromBits);
ValueNode base = addP.getBase();
return builder -> {
AllocatableValue x = gen.asAllocatable(operand(base));
AllocatableValue y = moveSp(gen.asAllocatable(operand(zeroExtend.getValue())));
AllocatableValue baseReference = LIRKind.derivedBaseFromValue(x);
LIRKind kind = LIRKind.combineDerived(gen.getLIRKind(addP.stamp(NodeView.DEFAULT)),
baseReference, null);
Variable result = gen.newVariable(kind);
gen.append(new AArch64ArithmeticOp.ExtendedAddSubShiftOp(AArch64ArithmeticOp.ADD, result, x, y,
extendType, shiftAmt));
return result;
};
}
/**
* This method determines, if possible, how to use AArch64's bit unsigned field insert/extract
* (UBFIZ/UBFX) instructions to copy over desired bits in the presence of the pattern [(X >>> #)
* & MASK] or [(X & MASK) << #] (with some zero extensions maybe sprinkled in).
*
* The main idea is that the mask and shift will force many bits to be zeroed and this
* information can be leveraged to extract the meaningful bits.
*/
private ComplexMatchResult unsignedBitFieldHelper(JavaKind finalOpKind, BinaryNode shift, ValueNode value, ConstantNode maskNode, int andOpSize) {
long mask = maskNode.asJavaConstant().asLong() & CodeUtil.mask(andOpSize);
if (!CodeUtil.isPowerOf2(mask + 1)) {
/* MaskNode isn't a mask: initial assumption doesn't hold true */
return null;
}
int maskSize = 64 - Long.numberOfLeadingZeros(mask);
int shiftSize = shift.getStackKind().getBitCount();
int shiftAmt = getClampedShiftAmt((ShiftNode<?>) shift);
/*
* The width of the insert/extract will be the bits which are not shifted out and/or not
* part of the mask.
*/
int width = Math.min(maskSize, shiftSize - shiftAmt);
if (width == finalOpKind.getBitCount()) {
assert maskSize == finalOpKind.getBitCount() && shiftAmt == 0 : maskSize + " " + finalOpKind;
// original value is unaffected
return builder -> operand(value);
} else if (shift instanceof UnsignedRightShiftNode) {
// this is an extract
return emitBitFieldExtract(finalOpKind, BitFieldOpCode.UBFX, value, shiftAmt, width);
} else {
// is a left shift - means this is an insert
return emitBitFieldInsert(finalOpKind, BitFieldOpCode.UBFIZ, value, shiftAmt, width);
}
}
/**
* Goal: Use AArch64's bit unsigned field insert/extract (UBFIZ/UBFX) instructions to copy over
* desired bits.
*/
@MatchRule("(And (UnsignedRightShift=shift value Constant) Constant=a)")
@MatchRule("(LeftShift=shift (And value Constant=a) Constant)")
public ComplexMatchResult unsignedBitField(BinaryNode shift, ValueNode value, ConstantNode a) {
return unsignedBitFieldHelper(shift.getStackKind(), shift, value, a, shift.getStackKind().getBitCount());
}
/**
* Goal: Use AArch64's bit unsigned field insert/extract (UBFIZ/UBFX) instructions to copy over
* desired bits.
*/
@MatchRule("(LeftShift=shift (ZeroExtend=extend (And value Constant=a)) Constant)")
@MatchRule("(ZeroExtend=extend (And (UnsignedRightShift=shift value Constant) Constant=a))")
@MatchRule("(ZeroExtend=extend (LeftShift=shift (And value Constant=a) Constant))")
public ComplexMatchResult unsignedExtBitField(ZeroExtendNode extend, BinaryNode shift, ValueNode value, ConstantNode a) {
return unsignedBitFieldHelper(extend.getStackKind(), shift, value, a, extend.getInputBits());
}
/**
* Goal: Use AArch64's signed bitfield insert in zeros (sbfiz) instruction to extract desired
* bits while folding away sign extend.
*/
@MatchRule("(LeftShift=shift (SignExtend value) Constant)")
public ComplexMatchResult signedBitField(LeftShiftNode shift, ValueNode value) {
assert isNumericInteger(shift);
SignExtendNode extend = (SignExtendNode) shift.getX();
int inputBits = extend.getInputBits();
int resultBits = extend.getResultBits();
JavaKind kind = shift.getStackKind();
assert kind.getBitCount() == resultBits : Assertions.errorMessage(shift, value, kind);
int lsb = getClampedShiftAmt(shift);
/*
* Get the min value of the inputBits and post-shift bits (resultBits - lsb) as the bitfield
* width. Note if (resultBits-lsb) is smaller than inputBits, the in reality no sign
* extension takes place.
*/
int width = Math.min(inputBits, resultBits - lsb);
assert width >= 1 && width <= resultBits - lsb : width + " " + resultBits;
return emitBitFieldInsert(kind, BitFieldOpCode.SBFIZ, value, lsb, width);
}
/**
* Goal: Use AArch64's bit field insert/extract instructions to copy over desired bits.
*/
@MatchRule("(RightShift=rshift (LeftShift=lshift value Constant) Constant)")
@MatchRule("(UnsignedRightShift=rshift (LeftShift=lshift value Constant) Constant)")
public ComplexMatchResult bitFieldMove(BinaryNode rshift, LeftShiftNode lshift, ValueNode value) {
assert isNumericInteger(rshift);
JavaKind opKind = rshift.getStackKind();
int opSize = opKind.getBitCount();
int lshiftAmt = getClampedShiftAmt(lshift);
int rshiftAmt = getClampedShiftAmt((ShiftNode<?>) rshift);
/*
* Get the width of the bitField. It will be in the range 1 to 32(64).
*
* Get the final width of the extract. Because the left and right shift go in opposite
* directions, the number of meaningful bits after performing a (x << #) >>(>) # is
* dependent on the maximum of the two shifts.
*/
int width = opSize - Math.max(lshiftAmt, rshiftAmt);
assert width > 1 || width <= opSize : width + " " + opSize;
if (width == opSize) {
// this means that no shifting was performed: can directly return value
return builder -> operand(value);
}
/*
* Use bitfield insert (SBFIZ/UBFIZ) if left shift number is larger than right shift number,
* otherwise use bitfield extract (SBFX/UBFX).
*
* If lshiftAmt > rshiftAmt, this means that the destination value will have some of its
* bottom bits cleared, whereas if lshiftAmt <= rshiftAmt, then the destination value will
* have bits starting from index 0 copied from the input.
*/
if (lshiftAmt > rshiftAmt) {
int lsb = lshiftAmt - rshiftAmt;
BitFieldOpCode op = rshift instanceof RightShiftNode ? BitFieldOpCode.SBFIZ : BitFieldOpCode.UBFIZ;
return emitBitFieldInsert(opKind, op, value, lsb, width);
} else {
// is a bit field extract
int lsb = rshiftAmt - lshiftAmt;
BitFieldOpCode op = rshift instanceof RightShiftNode ? BitFieldOpCode.SBFX : BitFieldOpCode.UBFX;
return emitBitFieldExtract(opKind, op, value, lsb, width);
}
}
/**
* Goal: Use AArch64's ror instruction for rotations.
*/
@MatchRule("(Or=op (LeftShift=x src Constant) (UnsignedRightShift=y src Constant))")
@MatchRule("(Or=op (UnsignedRightShift=x src Constant) (LeftShift=y src Constant))")
@MatchRule("(Add=op (LeftShift=x src Constant) (UnsignedRightShift=y src Constant))")
@MatchRule("(Add=op (UnsignedRightShift=x src Constant) (LeftShift=y src Constant))")
public ComplexMatchResult rotationConstant(ValueNode op, ValueNode x, ValueNode y, ValueNode src) {
assert isNumericInteger(src);
assert src.getStackKind() == op.getStackKind() && op.getStackKind() == x.getStackKind() : src + " " + op + " " + x;
int shiftAmt1 = getClampedShiftAmt((ShiftNode<?>) x);
int shiftAmt2 = getClampedShiftAmt((ShiftNode<?>) y);
if (shiftAmt1 + shiftAmt2 == 0 && op instanceof OrNode) {
assert shiftAmt1 == 0 && shiftAmt2 == 0 : shiftAmt1 + " " + shiftAmt2;
/* No shift performed: for or operation, this is equivalent to original value */
return builder -> operand(src);
} else if (src.getStackKind().getBitCount() == shiftAmt1 + shiftAmt2) {
/* Shifts are equivalent to a rotate. */
return builder -> {
AllocatableValue a = moveSp(gen.asAllocatable(operand(src)));
/* Extract the right shift amount */
JavaConstant b = JavaConstant.forInt(x instanceof LeftShiftNode ? shiftAmt2 : shiftAmt1);
Variable result = gen.newVariable(LIRKind.combine(a));
getArithmeticLIRGenerator().emitBinaryConst(result, AArch64ArithmeticOp.ROR, a, b);
return result;
};
}
return null;
}
/**
* Goal: Use AArch64's ror instruction for rotations.
*/
@MatchRule("(Or (LeftShift=x src shiftAmount) (UnsignedRightShift src (Sub=y Constant shiftAmount)))")
@MatchRule("(Or (UnsignedRightShift=x src shiftAmount) (LeftShift src (Sub=y Constant shiftAmount)))")
@MatchRule("(Or (LeftShift=x src (Negate shiftAmount)) (UnsignedRightShift src (Add=y Constant shiftAmount)))")
@MatchRule("(Or (UnsignedRightShift=x src (Negate shiftAmount)) (LeftShift src (Add=y Constant shiftAmount)))")
@MatchRule("(Or (LeftShift=x src shiftAmount) (UnsignedRightShift src (Negate=y shiftAmount)))")
@MatchRule("(Or (UnsignedRightShift=x src shiftAmount) (LeftShift src (Negate=y shiftAmount)))")
public ComplexMatchResult rotationExpander(ValueNode src, ValueNode shiftAmount, ValueNode x, ValueNode y) {
assert isNumericInteger(src);
assert shiftAmount.getStackKind().getBitCount() == 32 : Assertions.errorMessage(shiftAmount);
if (y instanceof SubNode || y instanceof AddNode) {
BinaryNode binary = (BinaryNode) y;
ConstantNode delta = (ConstantNode) (binary.getX() != shiftAmount ? binary.getX() : binary.getY());
/*
* For this pattern to match a right rotate, then the "clamped" delta (i.e. the value of
* delta within a shift) must be 0.
*/
int opSize = src.getStackKind().getBitCount();
assert opSize == 32 || opSize == 64 : opSize;
long clampedDelta = delta.asJavaConstant().asInt() & (opSize - 1);
if (clampedDelta != 0) {
return null;
}
}
return builder -> {
Value a = operand(src);
Value b;
if (y instanceof AddNode) {
b = x instanceof LeftShiftNode ? operand(shiftAmount) : getArithmeticLIRGenerator().emitNegate(operand(shiftAmount), false);
} else {
b = x instanceof LeftShiftNode ? getArithmeticLIRGenerator().emitNegate(operand(shiftAmount), false) : operand(shiftAmount);
}
return getArithmeticLIRGenerator().emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.ROR, false, a, b);
};
}
/**
* Goal: Use AArch64 binary shift add/sub ops to fold shift.
*/
@MatchRule("(Add=binary a (LeftShift=shift b Constant))")
@MatchRule("(Add=binary a (RightShift=shift b Constant))")
@MatchRule("(Add=binary a (UnsignedRightShift=shift b Constant))")
@MatchRule("(Sub=binary a (LeftShift=shift b Constant))")
@MatchRule("(Sub=binary a (RightShift=shift b Constant))")
@MatchRule("(Sub=binary a (UnsignedRightShift=shift b Constant))")
public ComplexMatchResult addSubShift(BinaryNode binary, ValueNode a, BinaryNode shift) {
AArch64ArithmeticOp op = binaryOpMap.get(binary.getClass());
assert op != null;
return emitBinaryShift(op, a, (ShiftNode<?>) shift);
}
/**
* Goal: Use AArch64 binary shift logic ops to fold shift.
*/
@MatchRule("(And=binary a (LeftShift=shift b Constant))")
@MatchRule("(And=binary a (RightShift=shift b Constant))")
@MatchRule("(And=binary a (UnsignedRightShift=shift b Constant))")
@MatchRule("(Or=binary a (LeftShift=shift b Constant))")
@MatchRule("(Or=binary a (RightShift=shift b Constant))")
@MatchRule("(Or=binary a (UnsignedRightShift=shift b Constant))")
@MatchRule("(Xor=binary a (LeftShift=shift b Constant))")
@MatchRule("(Xor=binary a (RightShift=shift b Constant))")
@MatchRule("(Xor=binary a (UnsignedRightShift=shift b Constant))")
@MatchRule("(And=binary a (Not (LeftShift=shift b Constant)))")
@MatchRule("(And=binary a (Not (RightShift=shift b Constant)))")
@MatchRule("(And=binary a (Not (UnsignedRightShift=shift b Constant)))")
@MatchRule("(Or=binary a (Not (LeftShift=shift b Constant)))")
@MatchRule("(Or=binary a (Not (RightShift=shift b Constant)))")
@MatchRule("(Or=binary a (Not (UnsignedRightShift=shift b Constant)))")
@MatchRule("(Xor=binary a (Not (LeftShift=shift b Constant)))")
@MatchRule("(Xor=binary a (Not (RightShift=shift b Constant)))")
@MatchRule("(Xor=binary a (Not (UnsignedRightShift=shift b Constant)))")
public ComplexMatchResult logicShift(BinaryNode binary, ValueNode a, BinaryNode shift) {
AArch64ArithmeticOp op;
ValueNode operand = binary.getX() == a ? binary.getY() : binary.getX();
if (operand instanceof NotNode) {
op = logicalNotOpMap.get(binary.getClass());
} else {
op = binaryOpMap.get(binary.getClass());
}
assert op != null;
return emitBinaryShift(op, a, (ShiftNode<?>) shift);
}
/**
* Goal: fold shift into negate operation using AArch64's sub (shifted register) instruction.
*/
@MatchRule("(Negate (UnsignedRightShift=shift a Constant=b))")
@MatchRule("(Negate (RightShift=shift a Constant=b))")
@MatchRule("(Negate (LeftShift=shift a Constant=b))")
public ComplexMatchResult negShift(BinaryNode shift, ValueNode a, ConstantNode b) {
assert isNumericInteger(a, b);
int shiftAmt = getClampedShiftAmt((ShiftNode<?>) shift);
AArch64Assembler.ShiftType shiftType = shiftTypeMap.get(shift.getClass());
return builder -> {
AllocatableValue src = moveSp(gen.asAllocatable(operand(a)));
LIRKind kind = LIRKind.combine(operand(a));
Variable result = gen.newVariable(kind);
gen.append(new AArch64ArithmeticOp.BinaryShiftOp(AArch64ArithmeticOp.SUB, result, AArch64.zr.asValue(kind), src, shiftType, shiftAmt));
return result;
};
}
/**
* Goal: use AArch64's and not (bic) & or not (orn) instructions.
*/
@MatchRule("(And=logic value1 (Not=not value2))")
@MatchRule("(Or=logic value1 (Not=not value2))")
public final ComplexMatchResult bitwiseLogicNot(BinaryNode logic, NotNode not) {
assert isNumericInteger(logic);
AArch64ArithmeticOp op = logicalNotOpMap.get(logic.getClass());
assert op != null;
ValueNode src1 = logic.getX() == not ? logic.getY() : logic.getX();
ValueNode src2 = not.getValue();
return builder -> {
Value a = operand(src1);
Value b = operand(src2);
LIRKind resultKind = LIRKind.combine(a, b);
return getArithmeticLIRGenerator().emitBinary(resultKind, op, false, a, b);
};
}
/**
* Goal: Use AArch64's bitwise exclusive or not (eon) instruction.
*
* Note that !(A^B) == (!A)^B == A^(!B).
*/
@MatchRule("(Not (Xor value1 value2))")
@MatchRule("(Xor value1 (Not value2))")
@MatchRule("(Xor (Not value1) value2)")
public ComplexMatchResult bitwiseNotXor(ValueNode value1, ValueNode value2) {
return builder -> {
Value a = operand(value1);
Value b = operand(value2);
LIRKind resultKind = LIRKind.combine(a, b);
return getArithmeticLIRGenerator().emitBinary(resultKind, AArch64ArithmeticOp.EON, true, a, b);
};
}
/**
* Checks whether this multiply operation which can fold in a sign extend operation . This can
* happen if:
*
* <ul>
* <li>The multiply result is of type long</li>
* <li>Both inputs are sign extended from 32 bits to 64 bits</li>
* </ul>
*/
private static boolean isI2LMultiply(MulNode mul, SignExtendNode x, SignExtendNode y) {
if (mul.getStackKind() == JavaKind.Long) {
assert x.getResultBits() == Long.SIZE && y.getResultBits() == Long.SIZE : x + " " + y;
return x.getInputBits() == Integer.SIZE && y.getInputBits() == Integer.SIZE;
}
return false;
}
/**
* Goal: use AArch64's (i32,i32) -> i64 multiply instructions to fold away sign extensions.
*/
@MatchRule("(Add=binary (Mul=mul (SignExtend a) (SignExtend b)) c)")
@MatchRule("(Sub=binary c (Mul=mul (SignExtend a) (SignExtend b)))")
public ComplexMatchResult signedMultiplyAddSubLong(BinaryNode binary, MulNode mul, ValueNode a, ValueNode b, ValueNode c) {
assert isNumericInteger(binary, mul, a, b, c);
if (isI2LMultiply(mul, (SignExtendNode) mul.getX(), (SignExtendNode) mul.getY())) {
if (binary instanceof AddNode) {
return builder -> getArithmeticLIRGenerator().emitIntegerMAdd(operand(a), operand(b), operand(c), true);
}
return builder -> getArithmeticLIRGenerator().emitIntegerMSub(operand(a), operand(b), operand(c), true);
} else {
return null;
}
}
/**
* Goal: use AArch64's (i32,i32) -> i64 multiply instructions to fold away sign extensions.
*/
@MatchRule("(Negate (Mul=mul (SignExtend=ext1 a) (SignExtend=ext2 b)))")
@MatchRule("(Mul=mul (Negate (SignExtend=ext1 a)) (SignExtend=ext2 b))")
public ComplexMatchResult signedMultiplyNegLong(MulNode mul, SignExtendNode ext1, SignExtendNode ext2, ValueNode a, ValueNode b) {
assert isNumericInteger(mul, ext1, ext2, a, b);
if (isI2LMultiply(mul, ext1, ext2)) {
LIRKind resultKind = LIRKind.fromJavaKind(gen.target().arch, JavaKind.Long);
return builder -> getArithmeticLIRGenerator().emitBinary(
resultKind, AArch64ArithmeticOp.SMNEGL, true, operand(a), operand(b));
} else {
return null;
}
}
/**
* Goal: use AArch64's (i32,i32) -> i64 multiply instructions to fold away sign extensions.
*/
@MatchRule("(Mul=mul (SignExtend a) (SignExtend b))")
public ComplexMatchResult signedMultiplyLong(MulNode mul, ValueNode a, ValueNode b) {
assert isNumericInteger(mul, a, b);
if (isI2LMultiply(mul, (SignExtendNode) mul.getX(), (SignExtendNode) mul.getY())) {
LIRKind resultKind = LIRKind.fromJavaKind(gen.target().arch, JavaKind.Long);
return builder -> getArithmeticLIRGenerator().emitBinary(
resultKind, AArch64ArithmeticOp.SMULL, true, operand(a), operand(b));
} else {
return null;
}
}
/**
* Goal: Use AArch64's add/sub (extended register) instructions to fold in and operand.
*/
@MatchRule("(Add=op x (And y Constant=constant))")
@MatchRule("(Sub=op x (And y Constant=constant))")
public ComplexMatchResult mergeDowncastIntoAddSub(BinaryNode op, ValueNode x, ValueNode y, ConstantNode constant) {
assert isNumericInteger(constant);
long mask = constant.asJavaConstant().asLong() & CodeUtil.mask(op.getStackKind().getBitCount());
if (mask != 0xFFL && mask != 0xFFFFL && mask != 0xFFFFFFFFL) {
return null;
}
int numBits = 64 - Long.numberOfLeadingZeros(mask);
return emitExtendedAddSubShift(op, x, y, getZeroExtendType(numBits), 0);
}
/**
* Goal: Use AArch64's add/sub (extended register) instruction.
*/
@MatchRule("(Add=op x (SignExtend=ext y))")
@MatchRule("(Sub=op x (SignExtend=ext y))")
@MatchRule("(Add=op x (ZeroExtend=ext y))")
@MatchRule("(Sub=op x (ZeroExtend=ext y))")
public ComplexMatchResult mergeSignExtendIntoAddSub(BinaryNode op, UnaryNode ext, ValueNode x, ValueNode y) {
if (!isSupportedExtendedAddSubShift((IntegerConvertNode<?>) ext, 0)) {
return null;
}
ExtendType extType;
if (ext instanceof SignExtendNode) {
extType = getSignExtendType(((SignExtendNode) ext).getInputBits());
} else {
extType = getZeroExtendType(((ZeroExtendNode) ext).getInputBits());
}
return emitExtendedAddSubShift(op, x, y, extType, 0);
}
/**
* Goal: Use AArch64's multiple-negate (mneg) instruction.
*/
@MatchRule("(Mul (Negate a) b)")
@MatchRule("(Negate (Mul a b))")
public final ComplexMatchResult multiplyNegate(ValueNode a, ValueNode b) {
if (isNumericInteger(a, b)) {
return builder -> getArithmeticLIRGenerator().emitMNeg(operand(a), operand(b));
}
return null;
}
/**
* Goal: Use AArch64's multiply-add (madd) and multiply-subtract (msub) instructions.
*/
@MatchRule("(Add=binary (Mul a b) c)")
@MatchRule("(Sub=binary c (Mul a b))")
public final ComplexMatchResult multiplyAddSub(BinaryNode binary, ValueNode a, ValueNode b, ValueNode c) {
if (!(isNumericInteger(a, b, c))) {
return null;
}
if (binary instanceof AddNode) {
return builder -> getArithmeticLIRGenerator().emitIntegerMAdd(operand(a), operand(b), operand(c), false);
}
return builder -> getArithmeticLIRGenerator().emitIntegerMSub(operand(a), operand(b), operand(c), false);
}
/**
* Goal: Transform ((x & (1 << n)) == 0) -> (tbz/tbnz n label).
*/
@MatchRule("(If (IntegerTest value Constant=a))")
public ComplexMatchResult testBitAndBranch(IfNode root, ValueNode value, ConstantNode a) {
if (isNumericInteger(value)) {
long constant = a.asJavaConstant().asLong();
if (Long.bitCount(constant) == 1) {
return emitBitTestAndBranch(root.trueSuccessor(), root.falseSuccessor(), value,
root.getTrueSuccessorProbability(), Long.numberOfTrailingZeros(constant));
}
}
return null;
}
/**
* Goal: Transform (if x < 0) -> (tbz x, sizeOfBits(x) - 1, label).
*/
@MatchRule("(If (IntegerLessThan=lessNode x Constant=y))")
public ComplexMatchResult checkNegativeAndBranch(IfNode root, IntegerLessThanNode lessNode, ValueNode x, ConstantNode y) {
assert isNumericInteger(x);
if (y.isJavaConstant() && (0 == y.asJavaConstant().asLong()) && lessNode.condition().equals(CanonicalCondition.LT)) {
return emitBitTestAndBranch(root.falseSuccessor(), root.trueSuccessor(), x,
1.0 - root.getTrueSuccessorProbability(), x.getStackKind().getBitCount() - 1);
}
return null;
}
/**
* Goal: Use directly AArch64's single-precision fsqrt op.
*/
@MatchRule("(FloatConvert=a (Sqrt (FloatConvert=b c)))")
public final ComplexMatchResult floatSqrt(FloatConvertNode a, FloatConvertNode b, ValueNode c) {
if (isNumericFloat(a, c)) {
if (a.getFloatConvert() == FloatConvert.D2F && b.getFloatConvert() == FloatConvert.F2D) {
return builder -> getArithmeticLIRGenerator().emitMathSqrt(operand(c));
}
}
return null;
}
@MatchRule("(Conditional (IntegerBelow x y) Constant=cm1 (Conditional (IntegerEquals x y) Constant=c0 Constant=c1))")
public ComplexMatchResult normalizedIntegerCompare(ValueNode x, ValueNode y, ConstantNode cm1, ConstantNode c0, ConstantNode c1) {
if (cm1.getStackKind() == JavaKind.Int && cm1.asJavaConstant().asInt() == -1 && c0.getStackKind() == JavaKind.Int && c0.asJavaConstant().asInt() == 0 && c1.getStackKind() == JavaKind.Int &&
c1.asJavaConstant().asInt() == 1) {
LIRKind compareKind = gen.getLIRKind(x.stamp(NodeView.DEFAULT));
return builder -> getArithmeticLIRGenerator().emitNormalizedUnsignedCompare(compareKind, operand(x), operand(y));
}
return null;
}
@Override
public AArch64LIRGenerator getLIRGeneratorTool() {
return (AArch64LIRGenerator) gen;
}
protected AArch64ArithmeticLIRGenerator getArithmeticLIRGenerator() {
return (AArch64ArithmeticLIRGenerator) getLIRGeneratorTool().getArithmetic();
}
}
```
|
```go
/*
path_to_url
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
package cmd
import (
"regexp"
"testing"
"github.com/minishift/minishift/cmd/testing/cli"
"github.com/stretchr/testify/assert"
)
func Test_version_output_has_correct_format(t *testing.T) {
tee := cli.CreateTee(t, false)
runPrintVersion(nil, nil)
tee.Close()
versionString := tee.StdoutBuffer.String()
versionRegExp := "minishift v[0-9]+\\.[0-9]+\\.[0-9]+\\+[a-z0-9]{7,8}\n"
assert.Regexp(t, regexp.MustCompile(versionRegExp), versionString)
}
```
|
The 1979 Jack Kramer Open, also known as the Pacific Southwest Open, was a men's tennis tournament played on indoor carpet courts at the Pauley Pavilion in Los Angeles, California in the United States. The event was part of the Grand Prix tennis circuit. It was the 53rd edition of the Pacific Southwest tournament and was held from September 17 through September 23, 1979.
Tournament director Jack Kramer underwrote the tournament after ARCO ended their sponsorship of the event. Eight-seeded Peter Fleming won the singles title after defeating his doubles partner and first-seed John McEnroe in the final and earned $28,000 first-prize money.
Finals
Singles
Peter Fleming defeated John McEnroe 6–4, 6–4
It was Fleming's 2nd singles title of the year and the 3rd of his career.
Doubles
Marty Riessen / Sherwood Stewart defeated Wojciech Fibak / Frew McMillan 6–4, 6–4
References
External links
ITF tournament edition details
Los Angeles Open (tennis)
Jack Kramer Open
Jack Kramer Open
Jack Kramer Open
Jack Kramer Open
|
```sqlpl
-- Script: Get-TempTableColumns.sql
-- Author: Scott Sutherland
-- Description: Return a list of all temp table types.
-- Include table variables, local temp tables, and global temp tables.
SELECT 'tempdb' as 'Database_Name',
SCHEMA_NAME(t1.schema_id) AS 'Schema_Name',
t1.name AS 'Table_Name',
t2.name AS 'Column_Name',
t3.name AS 'Column_Type',
CASE
WHEN (SELECT CASE WHEN LEN(t1.name) - LEN(REPLACE(t1.name,'#','')) > 1 THEN 1 ELSE 0 END) = 1 THEN 'GlobalTempTable'
WHEN t1.name LIKE '%[_]%' AND (SELECT CASE WHEN LEN(t1.name) - LEN(REPLACE(t1.name,'#','')) = 1 THEN 1 ELSE 0 END) = 1 THEN 'LocalTempTable'
WHEN t1.name NOT LIKE '%[_]%' AND (SELECT CASE WHEN LEN(t1.name) - LEN(REPLACE(t1.name,'#','')) = 1 THEN 1 ELSE 0 END) = 1 THEN 'TableVariable'
ELSE NULL
END AS Table_Type,
t1.is_ms_shipped,
t1.is_published,
t1.is_schema_published,
t1.create_date,
t1.modify_date
FROM [tempdb].[sys].[objects] AS t1
JOIN [tempdb].[sys].[columns] AS t2 ON t1.OBJECT_ID = t2.OBJECT_ID
JOIN sys.types AS t3 ON t2.system_type_id = t3.system_type_id
WHERE t1.name LIKE '#%'
```
|
The 2015 Ecuador Open Quito was an ATP tennis tournament played on outdoor clay courts. It was the 1st edition of the Ecuador Open as part of the ATP World Tour 250 series of the 2015 ATP World Tour. It took place in Quito, Ecuador from February 2 through February 8, 2015.
Singles main-draw entrants
Seeds
Rankings were as of January 19, 2015.
Other entrants
The following players received wildcards into the singles main draw:
Gonzalo Escobar
Márton Fucsovics
Giovanni Lapentti
The following players received entry from the qualifying draw:
André Ghem
Nicolás Jarry
Gerald Melzer
Renzo Olivo
Withdrawals
Before the tournament
Sam Groth → replaced by Evgeny Donskoy
Filip Krajinović → replaced by Adrián Menéndez Maceiras
Pere Riba → replaced by Facundo Argüello
Jimmy Wang → replaced by Luca Vanni
Doubles main-draw entrants
Seeds
Rankings were as of January 19, 2015.
Other entrants
The following pairs received wildcards into the doubles main draw:
Nicolás Jarry / Giovanni Lapentti
Sergio Pérez-Pérez / Fernando Verdasco
The following pair received entry as alternates:
Gero Kretschmer / Alexander Satschko
Withdrawals
Before the tournament
Facundo Argüello (stomach pain)
Champions
Singles
Víctor Estrella Burgos def. Feliciano López, 6–2, 6–7(5–7), 7–6(7–5)
Doubles
Gero Kretschmer / Alexander Satschko def. Víctor Estrella Burgos / João Souza, 7–5, 7–6(7–3)
References
External links
Official website
Ecuador Open Quito
Ecuador Open (tennis)
|
Aardlapalu is a village in Kastre Parish, Tartu County in eastern Estonia.
References
Villages in Tartu County
|
```objective-c
/* btp_mcp.h - Bluetooth tester headers */
/*
*
*/
#include <zephyr/bluetooth/services/ots.h>
/* MCP commands */
#define BTP_MCP_READ_SUPPORTED_COMMANDS 0x01
struct btp_mcp_read_supported_commands_rp {
uint8_t data[0];
} __packed;
#define BTP_MCP_DISCOVER 0x02
struct btp_mcp_discover_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_TRACK_DURATION_READ 0x03
struct btp_mcp_track_duration_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_TRACK_POSITION_READ 0x04
struct btp_mcp_track_position_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_TRACK_POSITION_SET 0x05
struct btp_mcp_track_position_set_cmd {
bt_addr_le_t address;
int32_t pos;
} __packed;
#define BTP_MCP_PLAYBACK_SPEED_READ 0x06
struct btp_mcp_playback_speed_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_PLAYBACK_SPEED_SET 0x07
struct btp_mcp_playback_speed_set {
bt_addr_le_t address;
int8_t speed;
} __packed;
#define BTP_MCP_SEEKING_SPEED_READ 0x08
struct btp_mcp_seeking_speed_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_ICON_OBJ_ID_READ 0x09
struct btp_mcp_icon_obj_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_NEXT_TRACK_OBJ_ID_READ 0x0a
struct btp_mcp_next_track_obj_id_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_NEXT_TRACK_OBJ_ID_SET 0x0b
struct btp_mcp_set_next_track_obj_id_cmd {
bt_addr_le_t address;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_PARENT_GROUP_OBJ_ID_READ 0x0c
struct btp_mcp_parent_group_obj_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_CURRENT_GROUP_OBJ_ID_READ 0x0d
struct btp_mcp_current_group_obj_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_CURRENT_GROUP_OBJ_ID_SET 0x0e
struct btp_mcp_current_group_obj_id_set_cmd {
bt_addr_le_t address;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_PLAYING_ORDER_READ 0x0f
struct btp_mcp_playing_order_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_PLAYING_ORDER_SET 0x10
struct btp_mcp_playing_order_set_cmd {
bt_addr_le_t address;
uint8_t order;
} __packed;
#define BTP_MCP_PLAYING_ORDERS_SUPPORTED_READ 0x11
struct btp_mcp_playing_orders_supported_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_MEDIA_STATE_READ 0x12
struct btp_mcp_media_state_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_OPCODES_SUPPORTED_READ 0x13
struct btp_mcp_opcodes_supported_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_CONTENT_CONTROL_ID_READ 0x14
struct btp_mcp_content_control_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_SEGMENTS_OBJ_ID_READ 0x15
struct btp_mcp_segments_obj_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_CURRENT_TRACK_OBJ_ID_READ 0x16
struct btp_mcp_current_track_obj_id_read_cmd {
bt_addr_le_t address;
} __packed;
#define BTP_MCP_CURRENT_TRACK_OBJ_ID_SET 0x17
struct btp_mcp_current_track_obj_id_set_cmd {
bt_addr_le_t address;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_CMD_SEND 0x18
struct btp_mcp_send_cmd {
bt_addr_le_t address;
uint8_t opcode;
uint8_t use_param;
int32_t param;
} __packed;
#define BTP_MCP_CMD_SEARCH 0x19
struct btp_mcp_search_cmd {
bt_addr_le_t address;
uint8_t type;
uint8_t param_len;
uint8_t param[];
} __packed;
/* MCP events */
#define BTP_MCP_DISCOVERED_EV 0x80
struct btp_mcp_discovered_ev {
bt_addr_le_t address;
uint8_t status;
struct {
uint16_t player_name;
uint16_t icon_obj_id;
uint16_t icon_url;
uint16_t track_changed;
uint16_t track_title;
uint16_t track_duration;
uint16_t track_position;
uint16_t playback_speed;
uint16_t seeking_speed;
uint16_t segments_obj_id;
uint16_t current_track_obj_id;
uint16_t next_track_obj_id;
uint16_t current_group_obj_id;
uint16_t parent_group_obj_id;
uint16_t playing_order;
uint16_t playing_orders_supported;
uint16_t media_state;
uint16_t cp;
uint16_t opcodes_supported;
uint16_t search_results_obj_id;
uint16_t scp;
uint16_t content_control_id;
} gmcs_handles;
struct {
uint16_t feature;
uint16_t obj_name;
uint16_t obj_type;
uint16_t obj_size;
uint16_t obj_id;
uint16_t obj_created;
uint16_t obj_modified;
uint16_t obj_properties;
uint16_t oacp;
uint16_t olcp;
} ots_handles;
} __packed;
#define BTP_MCP_TRACK_DURATION_EV 0x81
struct btp_mcp_track_duration_ev {
bt_addr_le_t address;
uint8_t status;
int32_t dur;
} __packed;
#define BTP_MCP_TRACK_POSITION_EV 0x82
struct btp_mcp_track_position_ev {
bt_addr_le_t address;
uint8_t status;
int32_t pos;
} __packed;
#define BTP_MCP_PLAYBACK_SPEED_EV 0x83
struct btp_mcp_playback_speed_ev {
bt_addr_le_t address;
uint8_t status;
int8_t speed;
} __packed;
#define BTP_MCP_SEEKING_SPEED_EV 0x84
struct btp_mcp_seeking_speed_ev {
bt_addr_le_t address;
uint8_t status;
int8_t speed;
} __packed;
#define BTP_MCP_ICON_OBJ_ID_EV 0x85
struct btp_mcp_icon_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_NEXT_TRACK_OBJ_ID_EV 0x86
struct btp_mcp_next_track_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_PARENT_GROUP_OBJ_ID_EV 0x87
struct btp_mcp_parent_group_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_CURRENT_GROUP_OBJ_ID_EV 0x88
struct btp_mcp_current_group_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_PLAYING_ORDER_EV 0x89
struct btp_mcp_playing_order_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t order;
} __packed;
#define BTP_MCP_PLAYING_ORDERS_SUPPORTED_EV 0x8a
struct btp_mcp_playing_orders_supported_ev {
bt_addr_le_t address;
uint8_t status;
uint16_t orders;
} __packed;
#define BTP_MCP_MEDIA_STATE_EV 0x8b
struct btp_mcp_media_state_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t state;
} __packed;
#define BTP_MCP_OPCODES_SUPPORTED_EV 0x8c
struct btp_mcp_opcodes_supported_ev {
bt_addr_le_t address;
uint8_t status;
uint32_t opcodes;
} __packed;
#define BTP_MCP_CONTENT_CONTROL_ID_EV 0x8d
struct btp_mcp_content_control_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t ccid;
} __packed;
#define BTP_MCP_SEGMENTS_OBJ_ID_EV 0x8e
struct btp_mcp_segments_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_CURRENT_TRACK_OBJ_ID_EV 0x8f
struct btp_mcp_current_track_obj_id_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t id[BT_OTS_OBJ_ID_SIZE];
} __packed;
#define BTP_MCP_MEDIA_CP_EV 0x90
struct btp_mcp_media_cp_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t opcode;
bool use_param;
int32_t param;
} __packed;
#define BTP_MCP_SEARCH_CP_EV 0x91
struct btp_mcp_search_cp_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t param_len;
uint8_t search_type;
uint8_t param[];
} __packed;
#define BTP_MCP_NTF_EV 0x92
struct btp_mcp_cmd_ntf_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t requested_opcode;
uint8_t result_code;
} __packed;
#define BTP_SCP_NTF_EV 0x93
struct btp_scp_cmd_ntf_ev {
bt_addr_le_t address;
uint8_t status;
uint8_t result_code;
} __packed;
```
|
Markku Jalkanen (born 1954) is a scientist, biotech entrepreneur and businessman from Turku, Finland. He is the CEO of Faron Pharmaceuticals, a Finnish biopharmaceutical company listed on London's Alternative Investment Market and Nasdaq's First North Growth Market. Jalkanen was the founding CEO and President of Biotie Therapies, the first publicly traded biotech-company in Finland. He is an advisor for the Finnish life-science fund, Inveni Capital.
Education and career
Jalkanen obtained a master's degree in Medical Biochemistry from the University of Kuopio, a PhD in Medical Biochemistry from the University of Turku and completed his post-doctoral training at Stanford University. He obtained the position of docent in Biochemistry from University of Helsinki and the same qualification in Molecular and Cell Biology from the University of Turku.
Jalkanen has received awards for his scientific research and business achievements: The Anders Jahre Medical Prize for Younger Researchers in 1993, The Developer of Turku Award of 1993, The 1994 Academic Publicity Award, Teacher of the Year 1996 of the University of Turku, The Inno-Suomi Award in 1998 for the entrepreneurial industrialization of academic discoveries (BioTie).
Jalkanen pioneered Finnish biotech development while being the first Director (Professor) of Turku Biotechnology Center within BioCity community in Turku. He has published over 130 peer-reviewed scientific publications in various highly ranked international journals and has a HIRSCH-index of >45.
References
1954 births
Living people
University of Turku alumni
Stanford University alumni
Finnish biochemists
People from Turku
|
Holmes–Dakin Building is a historic commercial building located at Hannibal, Marion County, Missouri. It was built in 1894, and is a two-story brick structure with a coursed rubble foundation and a flat roof. It features a corbelled brick frieze with matching corbelled parapet, capped by a stone molding. It originally housed a cigar factory.
It was added to the National Register of Historic Places in 1986.
References
Commercial buildings on the National Register of Historic Places in Missouri
Commercial buildings completed in 1894
Buildings and structures in Hannibal, Missouri
National Register of Historic Places in Marion County, Missouri
|
```java
package core.webui.server.handlers;
import java.util.Map;
import java.util.logging.Logger;
import core.ipc.IIPCService;
import core.ipc.IPCServiceManager;
import core.userDefinedTask.TaskGroup;
import core.userDefinedTask.UserDefinedAction;
import frontEnd.MainBackEndHolder;
import utilities.NumberUtility;
public class CommonTask {
private static final Logger LOGGER = Logger.getLogger(CommonTask.class.getName());
private CommonTask() {}
public static IIPCService getIPCService(Map<String, String> params) {
String indexString = params.get("ipc");
if (indexString == null || !NumberUtility.isNonNegativeInteger(indexString)) {
LOGGER.warning("IPC index must be non-negative integer. Got " + indexString + ".");
return null;
}
int index = Integer.parseInt(indexString);
if (index >= IPCServiceManager.IPC_SERVICE_COUNT) {
LOGGER.warning("IPC index out of bound: " + index);
return null;
}
return IPCServiceManager.getIPCService(index);
}
public static UserDefinedAction getTaskFromRequest(MainBackEndHolder backEndHolder, Map<String, String> params) {
String taskId = getTaskIdFromRequest(backEndHolder, params);
if (taskId == null || taskId.isEmpty()) {
LOGGER.warning("Cannot find task ID.");
return null;
}
return getTaskFromId(backEndHolder, taskId);
}
public static String getTaskIdFromRequest(MainBackEndHolder backEndHolder, Map<String, String> params) {
String taskValue = params.get("task");
if (taskValue == null || taskValue.isEmpty()) {
LOGGER.warning("Missing task ID.");
return "";
}
return taskValue;
}
public static UserDefinedAction getTaskFromId(MainBackEndHolder backEndHolder, String id) {
UserDefinedAction task = backEndHolder.getTask(id);
if (task == null) {
LOGGER.warning("No such task with ID " + id + ".");
return null;
}
return task;
}
public static String getTaskGroupIdFromRequest(MainBackEndHolder backEndHolder, Map<String, String> params) {
String groupValue = params.get("group");
if (groupValue == null || groupValue.isEmpty()) {
LOGGER.warning("Group ID must not be empty.");
return null;
}
return groupValue;
}
public static TaskGroup getTaskGroupFromRequest(MainBackEndHolder backEndHolder, Map<String, String> params, boolean useCurrentIfNotProvided) {
String groupValue = params.get("group");
if (groupValue == null) {
if (useCurrentIfNotProvided) {
return backEndHolder.getCurrentTaskGroup();
}
return null;
}
String id = getTaskGroupIdFromRequest(backEndHolder, params);
if (id == null) {
LOGGER.warning("No such group with ID " + id + ".");
return null;
}
return backEndHolder.getTaskGroup(id);
}
}
```
|
```go
// +build !solaris
package main
import (
"fmt"
"os"
"path/filepath"
"syscall"
"time"
"github.com/opencontainers/runc/libcontainer"
"github.com/urfave/cli"
"golang.org/x/sys/unix"
)
func killContainer(container libcontainer.Container) error {
_ = container.Signal(unix.SIGKILL, false)
for i := 0; i < 100; i++ {
time.Sleep(100 * time.Millisecond)
if err := container.Signal(syscall.Signal(0), false); err != nil {
destroy(container)
return nil
}
}
return fmt.Errorf("container init still running")
}
var deleteCommand = cli.Command{
Name: "delete",
Usage: "delete any resources held by the container often used with detached container",
ArgsUsage: `<container-id>
Where "<container-id>" is the name for the instance of the container.
EXAMPLE:
For example, if the container id is "ubuntu01" and runc list currently shows the
status of "ubuntu01" as "stopped" the following will delete resources held for
"ubuntu01" removing "ubuntu01" from the runc list of containers:
# runc delete ubuntu01`,
Flags: []cli.Flag{
cli.BoolFlag{
Name: "force, f",
Usage: "Forcibly deletes the container if it is still running (uses SIGKILL)",
},
},
Action: func(context *cli.Context) error {
if err := checkArgs(context, 1, exactArgs); err != nil {
return err
}
id := context.Args().First()
force := context.Bool("force")
container, err := getContainer(context)
if err != nil {
if lerr, ok := err.(libcontainer.Error); ok && lerr.Code() == libcontainer.ContainerNotExists {
// if there was an aborted start or something of the sort then the container's directory could exist but
// libcontainer does not see it because the state.json file inside that directory was never created.
path := filepath.Join(context.GlobalString("root"), id)
if e := os.RemoveAll(path); e != nil {
fmt.Fprintf(os.Stderr, "remove %s: %v\n", path, e)
}
if force {
return nil
}
}
return err
}
s, err := container.Status()
if err != nil {
return err
}
switch s {
case libcontainer.Stopped:
destroy(container)
case libcontainer.Created:
return killContainer(container)
default:
if force {
return killContainer(container)
} else {
return fmt.Errorf("cannot delete container %s that is not stopped: %s\n", id, s)
}
}
return nil
},
}
```
|
```shell
Aliasing ssh connections
Find any Unix / Linux command
Terminal based browser
Useful aliasing in bash
Terminal incognito mode
```
|
```smalltalk
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Xamarin.Forms.Controls
{
public class ActionSheetGallery : ContentPage
{
public ActionSheetGallery()
{
AutomationId = "ActionSheetPage";
var extras = new string[] {
"Extra One",
"Extra Two",
"Extra Three",
"Extra Four",
"Extra Five",
"Extra Six",
"Extra Seven",
"Extra Eight",
"Extra Nine",
"Extra Ten",
"Extra Eleven",
};
Content = new ScrollView
{
Content = new StackLayout
{
Spacing = 0,
Children = {
MakeActionSheetButton (this, "ActionSheet Cancel", null, "Cancel", null),
MakeActionSheetButton (this, "ActionSheet Cancel Extras", null, "Cancel", null, extras),
MakeActionSheetButton (this, "ActionSheet Cancel Destruction", null, "Cancel", "Destruction"),
MakeActionSheetButton (this, "ActionSheet Cancel Destruction Extras", null, "Cancel", "Destruction", extras),
MakeActionSheetButton (this, "ActionSheet Destruction", null, null, "Destruction"),
MakeActionSheetButton (this, "ActionSheet Destruction Extras", null, null, "Destruction", extras),
MakeActionSheetButton (this, "ActionSheet Extras", null, null, null, extras),
MakeActionSheetButton (this, "ActionSheet Title", "Title", null, null),
MakeActionSheetButton (this, "ActionSheet Title Cancel", "Title", "Cancel", null),
MakeActionSheetButton (this, "ActionSheet Title Cancel Extras", "Title", "Cancel", null, extras),
MakeActionSheetButton (this, "ActionSheet Title Cancel Destruction", "Title", "Cancel", "Destruction"),
MakeActionSheetButton (this, "ActionSheet Title Cancel Destruction Extras", "Title", "Cancel", "Destruction", extras),
MakeActionSheetButton (this, "ActionSheet Title Destruction", "Title", null, "Destruction"),
MakeActionSheetButton (this, "ActionSheet Title Destruction Extras", "Title", null, "Destruction", extras),
MakeActionSheetButton (this, "ActionSheet Title Extras", "Title", null, null, extras),
}
}
};
}
static Button MakeActionSheetButton(Page page, string buttonText, string title, string cancel, string destruction, params string[] extras)
{
var actionSheetButton = new Button
{
Text = buttonText
};
actionSheetButton.Clicked += async (sender, e) => await page.DisplayActionSheet(title, cancel, destruction, extras);
return actionSheetButton;
}
}
}
```
|
Gemazocine (R-15,497), also known as cyclogemine, is a non-selective opioid antagonist of the benzomorphan class. It may have partial agonist properties at some of the opioid receptors, such as at the kappa receptor (as it induces dysphoric effects in humans), but seems to be generally antagonistic in its actions.
References
Benzomorphans
Kappa-opioid receptor agonists
Mu-opioid receptor antagonists
|
Rahima Moosa Mother and Child Hospital is a maternity hospital in Coronationville, Johannesburg, South Africa. Prior to 2008, it was known as the Coronation Hospital.
History
The hospital was opened in October 1944 in the suburb of Coronationville. It was a hospital established for people classified as Coloured and Indian. It would serve those local communities of Newclare, Noordgesig and Coronationville. Until 1955, it would also take black patients from Primville, Orlando and Sophiatown.
In 1995, all obstetrics and gynaecology departments were moved from the J.G. Strijdom Hospital to this hospital. On 29 September 2008, Coronation Hospital was renamed the Rahima Moosa Mother and Child Hospital by the Gauteng Provincial Minister of Health, Brian Hlongwa. Rahima Moosa was an anti-apartheid activist and took part in the 1956 Women's March, protesting passes for non-white women.
References
Buildings and structures in Johannesburg
Hospitals in Johannesburg
Maternity in South Africa
|
Edward 'Ted' Fletcher (13 December 1925 - 13 May 2000) was an Australian rules footballer who played with Hawthorn in the VFL.
Fletcher was used in a variety of positions during his career including the ruck and in defence. In 1953 he was appointed club captain and won the Hawthorn 'Best and Fairest' award. He retained the captaincy in the 1954 season.
He left Hawthorn and he became Captain-coach of Sandringham in the VFA for two seasons.
Honours and achievements
Individual
Hawthorn best and fairest: 1953
Hawthorn captain: 1953–1954
Hawthorn life member
References
External links
1925 births
Australian rules footballers from Victoria (state)
Hawthorn Football Club players
Sandringham Football Club coaches
Peter Crimmins Medal winners
2000 deaths
|
```php
<?php
/*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
*/
namespace Google\Service\Aiplatform\Resource;
use Google\Service\Aiplatform\GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsRequest;
use Google\Service\Aiplatform\GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsResponse;
use Google\Service\Aiplatform\GoogleCloudAiplatformV1ListModelEvaluationSlicesResponse;
use Google\Service\Aiplatform\GoogleCloudAiplatformV1ModelEvaluationSlice;
/**
* The "slices" collection of methods.
* Typical usage is:
* <code>
* $aiplatformService = new Google\Service\Aiplatform(...);
* $slices = $aiplatformService->projects_locations_models_evaluations_slices;
* </code>
*/
class ProjectsLocationsModelsEvaluationsSlices extends \Google\Service\Resource
{
/**
* Imports a list of externally generated EvaluatedAnnotations.
* (slices.batchImport)
*
* @param string $parent Required. The name of the parent ModelEvaluationSlice
* resource. Format: `projects/{project}/locations/{location}/models/{model}/eva
* luations/{evaluation}/slices/{slice}`
* @param GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsRequest $postBody
* @param array $optParams Optional parameters.
* @return GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsResponse
* @throws \Google\Service\Exception
*/
public function batchImport($parent, GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsRequest $postBody, $optParams = [])
{
$params = ['parent' => $parent, 'postBody' => $postBody];
$params = array_merge($params, $optParams);
return $this->call('batchImport', [$params], GoogleCloudAiplatformV1BatchImportEvaluatedAnnotationsResponse::class);
}
/**
* Gets a ModelEvaluationSlice. (slices.get)
*
* @param string $name Required. The name of the ModelEvaluationSlice resource.
* Format: `projects/{project}/locations/{location}/models/{model}/evaluations/{
* evaluation}/slices/{slice}`
* @param array $optParams Optional parameters.
* @return GoogleCloudAiplatformV1ModelEvaluationSlice
* @throws \Google\Service\Exception
*/
public function get($name, $optParams = [])
{
$params = ['name' => $name];
$params = array_merge($params, $optParams);
return $this->call('get', [$params], GoogleCloudAiplatformV1ModelEvaluationSlice::class);
}
/**
* Lists ModelEvaluationSlices in a ModelEvaluation.
* (slices.listProjectsLocationsModelsEvaluationsSlices)
*
* @param string $parent Required. The resource name of the ModelEvaluation to
* list the ModelEvaluationSlices from. Format: `projects/{project}/locations/{l
* ocation}/models/{model}/evaluations/{evaluation}`
* @param array $optParams Optional parameters.
*
* @opt_param string filter The standard list filter. * `slice.dimension` - for
* =.
* @opt_param int pageSize The standard list page size.
* @opt_param string pageToken The standard list page token. Typically obtained
* via ListModelEvaluationSlicesResponse.next_page_token of the previous
* ModelService.ListModelEvaluationSlices call.
* @opt_param string readMask Mask specifying which fields to read.
* @return GoogleCloudAiplatformV1ListModelEvaluationSlicesResponse
* @throws \Google\Service\Exception
*/
public function listProjectsLocationsModelsEvaluationsSlices($parent, $optParams = [])
{
$params = ['parent' => $parent];
$params = array_merge($params, $optParams);
return $this->call('list', [$params], GoogleCloudAiplatformV1ListModelEvaluationSlicesResponse::class);
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ProjectsLocationsModelsEvaluationsSlices::class, your_sha256_hashtionsSlices');
```
|
```rust
use crate::atom_table::*;
use crate::forms::*;
use crate::instructions::*;
use crate::iterators::*;
use crate::machine::loader::*;
use crate::machine::machine_errors::CompilationError;
use crate::machine::preprocessor::*;
use crate::parser::ast::*;
use crate::parser::dashu::Rational;
use crate::variable_records::*;
use dashu::Integer;
use indexmap::{IndexMap, IndexSet};
use std::cell::Cell;
use std::cmp::Ordering;
use std::collections::VecDeque;
use std::hash::{Hash, Hasher};
use std::ops::{Deref, DerefMut};
#[derive(Debug, Clone)] //, PartialOrd, PartialEq, Eq, Hash)]
pub struct BranchNumber {
branch_num: Rational,
delta: Rational,
}
impl Default for BranchNumber {
fn default() -> Self {
Self {
branch_num: Rational::from(1u64 << 63),
delta: Rational::from(1),
}
}
}
impl PartialEq<BranchNumber> for BranchNumber {
#[inline]
fn eq(&self, rhs: &BranchNumber) -> bool {
self.branch_num == rhs.branch_num
}
}
impl Eq for BranchNumber {}
impl Hash for BranchNumber {
#[inline(always)]
fn hash<H: Hasher>(&self, hasher: &mut H) {
self.branch_num.hash(hasher)
}
}
impl PartialOrd<BranchNumber> for BranchNumber {
#[inline]
fn partial_cmp(&self, rhs: &BranchNumber) -> Option<Ordering> {
self.branch_num.partial_cmp(&rhs.branch_num)
}
}
impl BranchNumber {
fn split(&self) -> BranchNumber {
BranchNumber {
branch_num: self.branch_num.clone() + &self.delta / Rational::from(2),
delta: &self.delta / Rational::from(4),
}
}
fn incr_by_delta(&self) -> BranchNumber {
BranchNumber {
branch_num: self.branch_num.clone() + &self.delta,
delta: self.delta.clone(),
}
}
fn halve_delta(&self) -> BranchNumber {
BranchNumber {
branch_num: self.branch_num.clone(),
delta: &self.delta / Rational::from(2),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct VarInfo {
var_ptr: VarPtr,
chunk_type: ChunkType,
classify_info: ClassifyInfo,
lvl: Level,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ChunkInfo {
chunk_num: usize,
term_loc: GenContext,
// pointer to incidence, term occurrence arity.
vars: Vec<VarInfo>,
}
#[derive(Debug)]
pub struct BranchArm {
pub arm_terms: Vec<QueryTerm>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct BranchInfo {
branch_num: BranchNumber,
chunks: Vec<ChunkInfo>,
}
impl BranchInfo {
fn new(branch_num: BranchNumber) -> Self {
Self {
branch_num,
chunks: vec![],
}
}
}
type BranchMapInt = IndexMap<VarPtr, Vec<BranchInfo>>;
#[derive(Debug, Clone)]
pub struct BranchMap(BranchMapInt);
impl Deref for BranchMap {
type Target = BranchMapInt;
#[inline(always)]
fn deref(&self) -> &BranchMapInt {
&self.0
}
}
impl DerefMut for BranchMap {
#[inline(always)]
fn deref_mut(&mut self) -> &mut BranchMapInt {
&mut self.0
}
}
type RootSet = IndexSet<BranchNumber>;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub struct ClassifyInfo {
arg_c: usize,
arity: usize,
}
enum TraversalState {
// construct a QueryTerm::Branch with number of disjuncts, reset
// the chunk type to that of the chunk preceding the disjunct and the chunk_num.
BuildDisjunct(usize),
// add the last disjunct to a QueryTerm::Branch, continuing from
// where it leaves off.
BuildFinalDisjunct(usize),
Fail,
GetCutPoint { var_num: usize, prev_b: bool },
Cut { var_num: usize, is_global: bool },
CutPrev(usize),
ResetCallPolicy(CallPolicy),
Term(Term),
OverrideGlobalCutVar(usize),
ResetGlobalCutVarOverride(Option<usize>),
RemoveBranchNum, // pop the current_branch_num and from the root set.
AddBranchNum(BranchNumber), // set current_branch_num, add it to the root set
RepBranchNum(BranchNumber), // replace current_branch_num and the latest in the root set
}
#[derive(Debug)]
pub struct VariableClassifier {
call_policy: CallPolicy,
current_branch_num: BranchNumber,
current_chunk_num: usize,
current_chunk_type: ChunkType,
branch_map: BranchMap,
var_num: usize,
root_set: RootSet,
global_cut_var_num: Option<usize>,
global_cut_var_num_override: Option<usize>,
}
#[derive(Debug, Default)]
pub struct VarData {
pub records: VariableRecords,
pub global_cut_var_num: Option<usize>,
pub allocates: bool,
}
impl VarData {
fn emit_initial_get_level(&mut self, build_stack: &mut ChunkedTermVec) {
let global_cut_var_num = if let &Some(global_cut_var_num) = &self.global_cut_var_num {
match &self.records[global_cut_var_num].allocation {
VarAlloc::Perm(..) => Some(global_cut_var_num),
VarAlloc::Temp { term_loc, .. } if term_loc.chunk_num() > 0 => {
Some(global_cut_var_num)
}
_ => None,
}
} else {
None
};
if let Some(global_cut_var_num) = global_cut_var_num {
let term = QueryTerm::GetLevel(global_cut_var_num);
self.records[global_cut_var_num].allocation =
VarAlloc::Perm(0, PermVarAllocation::Pending);
match build_stack.front_mut() {
Some(ChunkedTerms::Branch(_)) => {
build_stack.push_front(ChunkedTerms::Chunk(VecDeque::from(vec![term])));
}
Some(ChunkedTerms::Chunk(chunk)) => {
chunk.push_front(term);
}
None => {
unreachable!()
}
}
}
}
}
pub type ClassifyFactResult = (Term, VarData);
pub type ClassifyRuleResult = (Term, ChunkedTermVec, VarData);
fn merge_branch_seq(branches: impl Iterator<Item = BranchInfo>) -> BranchInfo {
let mut branch_info = BranchInfo::new(BranchNumber::default());
for mut branch in branches {
branch_info.branch_num = branch.branch_num;
branch_info.chunks.append(&mut branch.chunks);
}
branch_info.branch_num.delta = branch_info.branch_num.delta * Integer::from(2);
branch_info.branch_num.branch_num -= &branch_info.branch_num.delta;
branch_info
}
fn flatten_into_disjunct(build_stack: &mut ChunkedTermVec, preceding_len: usize) {
let branch_vec = build_stack.drain(preceding_len + 1..).collect();
if let ChunkedTerms::Branch(ref mut disjuncts) = &mut build_stack[preceding_len] {
disjuncts.push(branch_vec);
} else {
unreachable!();
}
}
impl VariableClassifier {
pub fn new(call_policy: CallPolicy) -> Self {
Self {
call_policy,
current_branch_num: BranchNumber::default(),
current_chunk_num: 0,
current_chunk_type: ChunkType::Head,
branch_map: BranchMap(BranchMapInt::new()),
root_set: RootSet::new(),
var_num: 0,
global_cut_var_num: None,
global_cut_var_num_override: None,
}
}
pub fn classify_fact(mut self, term: Term) -> Result<ClassifyFactResult, CompilationError> {
self.classify_head_variables(&term)?;
Ok((
term,
self.branch_map.separate_and_classify_variables(
self.var_num,
self.global_cut_var_num,
self.current_chunk_num,
),
))
}
pub fn classify_rule<'a, LS: LoadState<'a>>(
mut self,
loader: &mut Loader<'a, LS>,
head: Term,
body: Term,
) -> Result<ClassifyRuleResult, CompilationError> {
self.classify_head_variables(&head)?;
self.root_set.insert(self.current_branch_num.clone());
let mut query_terms = self.classify_body_variables(loader, body)?;
self.merge_branches();
let mut var_data = self.branch_map.separate_and_classify_variables(
self.var_num,
self.global_cut_var_num,
self.current_chunk_num,
);
var_data.emit_initial_get_level(&mut query_terms);
Ok((head, query_terms, var_data))
}
fn merge_branches(&mut self) {
for branches in self.branch_map.values_mut() {
let mut old_branches = std::mem::take(branches);
while let Some(last_branch_num) = old_branches.last().map(|bi| &bi.branch_num) {
let mut old_branches_len = old_branches.len();
for (rev_idx, bi) in old_branches.iter().rev().enumerate() {
if &bi.branch_num > last_branch_num {
old_branches_len = old_branches.len() - rev_idx;
}
}
let iter = old_branches.drain(old_branches_len - 1..);
branches.push(merge_branch_seq(iter));
}
branches.reverse();
}
}
fn try_set_chunk_at_inlined_boundary(&mut self) -> bool {
if self.current_chunk_type.is_last() {
self.current_chunk_type = ChunkType::Mid;
self.current_chunk_num += 1;
true
} else {
false
}
}
fn try_set_chunk_at_call_boundary(&mut self) -> bool {
if self.current_chunk_type.is_last() {
self.current_chunk_num += 1;
true
} else {
self.current_chunk_type = ChunkType::Last;
false
}
}
fn probe_body_term(&mut self, arg_c: usize, arity: usize, term: &Term) {
let classify_info = ClassifyInfo { arg_c, arity };
// second arg is true to iterate the root, which may be a variable
for term_ref in breadth_first_iter(term, RootIterationPolicy::Iterated) {
if let TermRef::Var(lvl, _, var_ptr) = term_ref {
// root terms are shallow here (since we're iterating a
// body term) so take the child level.
let lvl = lvl.child_level();
self.probe_body_var(VarInfo {
var_ptr,
lvl,
classify_info,
chunk_type: self.current_chunk_type,
});
}
}
}
fn probe_body_var(&mut self, var_info: VarInfo) {
let term_loc = self
.current_chunk_type
.to_gen_context(self.current_chunk_num);
let branch_info_v = self.branch_map.entry(var_info.var_ptr.clone()).or_default();
let needs_new_branch = if let Some(last_bi) = branch_info_v.last() {
!self.root_set.contains(&last_bi.branch_num)
} else {
true
};
if needs_new_branch {
branch_info_v.push(BranchInfo::new(self.current_branch_num.clone()));
}
let branch_info = branch_info_v.last_mut().unwrap();
let needs_new_chunk = if let Some(last_ci) = branch_info.chunks.last() {
last_ci.chunk_num != self.current_chunk_num
} else {
true
};
if needs_new_chunk {
branch_info.chunks.push(ChunkInfo {
chunk_num: self.current_chunk_num,
term_loc,
vars: vec![],
});
}
let chunk_info = branch_info.chunks.last_mut().unwrap();
chunk_info.vars.push(var_info);
}
fn probe_in_situ_var(&mut self, var_num: usize) {
let classify_info = ClassifyInfo { arg_c: 1, arity: 1 };
let var_info = VarInfo {
var_ptr: VarPtr::from(Var::InSitu(var_num)),
classify_info,
chunk_type: self.current_chunk_type,
lvl: Level::Shallow,
};
self.probe_body_var(var_info);
}
fn classify_head_variables(&mut self, term: &Term) -> Result<(), CompilationError> {
match term {
Term::Clause(..) | Term::Literal(_, Literal::Atom(_)) => {}
_ => return Err(CompilationError::InvalidRuleHead),
}
let mut classify_info = ClassifyInfo {
arg_c: 1,
arity: term.arity(),
};
if let Term::Clause(_, _, terms) = term {
for term in terms.iter() {
for term_ref in breadth_first_iter(term, RootIterationPolicy::Iterated) {
if let TermRef::Var(lvl, _, var_ptr) = term_ref {
// a body term, so we need the child level here.
let lvl = lvl.child_level();
// the body of the if let here is an inlined
// "probe_head_var". note the difference between it
// and "probe_body_var".
let branch_info_v = self.branch_map.entry(var_ptr.clone()).or_default();
let needs_new_branch = branch_info_v.is_empty();
if needs_new_branch {
branch_info_v.push(BranchInfo::new(self.current_branch_num.clone()));
}
let branch_info = branch_info_v.last_mut().unwrap();
let needs_new_chunk = branch_info.chunks.is_empty();
if needs_new_chunk {
branch_info.chunks.push(ChunkInfo {
chunk_num: self.current_chunk_num,
term_loc: GenContext::Head,
vars: vec![],
});
}
let chunk_info = branch_info.chunks.last_mut().unwrap();
let var_info = VarInfo {
var_ptr,
classify_info,
chunk_type: self.current_chunk_type,
lvl,
};
chunk_info.vars.push(var_info);
}
}
classify_info.arg_c += 1;
}
}
Ok(())
}
fn classify_body_variables<'a, LS: LoadState<'a>>(
&mut self,
loader: &mut Loader<'a, LS>,
term: Term,
) -> Result<ChunkedTermVec, CompilationError> {
let mut state_stack = vec![TraversalState::Term(term)];
let mut build_stack = ChunkedTermVec::new();
self.current_chunk_type = ChunkType::Mid;
while let Some(traversal_st) = state_stack.pop() {
match traversal_st {
TraversalState::AddBranchNum(branch_num) => {
self.root_set.insert(branch_num.clone());
self.current_branch_num = branch_num;
}
TraversalState::RemoveBranchNum => {
self.root_set.pop();
}
TraversalState::RepBranchNum(branch_num) => {
self.root_set.pop();
self.root_set.insert(branch_num.clone());
self.current_branch_num = branch_num;
}
TraversalState::ResetCallPolicy(call_policy) => {
self.call_policy = call_policy;
}
TraversalState::BuildDisjunct(preceding_len) => {
flatten_into_disjunct(&mut build_stack, preceding_len);
self.current_chunk_type = ChunkType::Mid;
self.current_chunk_num += 1;
}
TraversalState::BuildFinalDisjunct(preceding_len) => {
flatten_into_disjunct(&mut build_stack, preceding_len);
self.current_chunk_type = ChunkType::Mid;
self.current_chunk_num += 1;
}
TraversalState::GetCutPoint { var_num, prev_b } => {
if self.try_set_chunk_at_inlined_boundary() {
build_stack.add_chunk();
}
self.probe_in_situ_var(var_num);
build_stack.push_chunk_term(QueryTerm::GetCutPoint { var_num, prev_b });
}
TraversalState::OverrideGlobalCutVar(var_num) => {
self.global_cut_var_num_override = Some(var_num);
}
TraversalState::ResetGlobalCutVarOverride(old_override) => {
self.global_cut_var_num_override = old_override;
}
TraversalState::Cut { var_num, is_global } => {
if self.try_set_chunk_at_inlined_boundary() {
build_stack.add_chunk();
}
self.probe_in_situ_var(var_num);
build_stack.push_chunk_term(if is_global {
QueryTerm::GlobalCut(var_num)
} else {
QueryTerm::LocalCut {
var_num,
cut_prev: false,
}
});
}
TraversalState::CutPrev(var_num) => {
if self.try_set_chunk_at_inlined_boundary() {
build_stack.add_chunk();
}
self.probe_in_situ_var(var_num);
build_stack.push_chunk_term(QueryTerm::LocalCut {
var_num,
cut_prev: true,
});
}
TraversalState::Fail => {
build_stack.push_chunk_term(QueryTerm::Fail);
}
TraversalState::Term(term) => {
// return true iff new chunk should be added.
let update_chunk_data = |classifier: &mut Self, predicate_name, arity| {
if ClauseType::is_inlined(predicate_name, arity) {
classifier.try_set_chunk_at_inlined_boundary()
} else {
classifier.try_set_chunk_at_call_boundary()
}
};
let mut add_chunk = |classifier: &mut Self, name: Atom, terms: Vec<Term>| {
if update_chunk_data(classifier, name, terms.len()) {
build_stack.add_chunk();
}
for (arg_c, term) in terms.iter().enumerate() {
classifier.probe_body_term(arg_c + 1, terms.len(), term);
}
build_stack.push_chunk_term(clause_to_query_term(
loader,
name,
terms,
classifier.call_policy,
));
};
match term {
Term::Clause(
_,
name @ (atom!("->") | atom!(";") | atom!(",")),
mut terms,
) if terms.len() == 3 => {
if let Some(last_arg) = terms.last() {
if let Term::Literal(_, Literal::CodeIndex(_)) = last_arg {
terms.pop();
state_stack.push(TraversalState::Term(Term::Clause(
Cell::default(),
name,
terms,
)));
} else {
add_chunk(self, name, terms);
}
}
}
Term::Clause(_, atom!(","), mut terms) if terms.len() == 2 => {
let tail = terms.pop().unwrap();
let head = terms.pop().unwrap();
let iter = unfold_by_str(tail, atom!(","))
.into_iter()
.rev()
.chain(std::iter::once(head))
.map(TraversalState::Term);
state_stack.extend(iter);
}
Term::Clause(_, atom!(";"), mut terms) if terms.len() == 2 => {
let tail = terms.pop().unwrap();
let head = terms.pop().unwrap();
let first_branch_num = self.current_branch_num.split();
let branches: Vec<_> = std::iter::once(head)
.chain(unfold_by_str(tail, atom!(";")).into_iter())
.collect();
let mut branch_numbers = vec![first_branch_num];
for idx in 1..branches.len() {
let succ_branch_number = branch_numbers[idx - 1].incr_by_delta();
branch_numbers.push(if idx + 1 < branches.len() {
succ_branch_number.split()
} else {
succ_branch_number
});
}
let build_stack_len = build_stack.len();
build_stack.reserve_branch(branches.len());
state_stack.push(TraversalState::RepBranchNum(
self.current_branch_num.halve_delta(),
));
let iter = branches.into_iter().zip(branch_numbers.into_iter());
let final_disjunct_loc = state_stack.len();
for (term, branch_num) in iter.rev() {
state_stack.push(TraversalState::BuildDisjunct(build_stack_len));
state_stack.push(TraversalState::RemoveBranchNum);
state_stack.push(TraversalState::Term(term));
state_stack.push(TraversalState::AddBranchNum(branch_num));
}
if let TraversalState::BuildDisjunct(build_stack_len) =
state_stack[final_disjunct_loc]
{
state_stack[final_disjunct_loc] =
TraversalState::BuildFinalDisjunct(build_stack_len);
}
self.current_chunk_type = ChunkType::Mid;
self.current_chunk_num += 1;
}
Term::Clause(_, atom!("->"), mut terms) if terms.len() == 2 => {
let then_term = terms.pop().unwrap();
let if_term = terms.pop().unwrap();
let prev_b = if matches!(
state_stack.last(),
Some(TraversalState::RemoveBranchNum)
) {
// check if the second-to-last element
// is a regular BuildDisjunct, as we
// don't want to add GetPrevLevel in
// case of a TrustMe.
match state_stack.iter().rev().nth(1) {
Some(&TraversalState::BuildDisjunct(preceding_len)) => {
preceding_len + 1 == build_stack.len()
}
_ => false,
}
} else {
false
};
state_stack.push(TraversalState::Term(then_term));
state_stack.push(TraversalState::Cut {
var_num: self.var_num,
is_global: false,
});
state_stack.push(TraversalState::Term(if_term));
state_stack.push(TraversalState::GetCutPoint {
var_num: self.var_num,
prev_b,
});
self.var_num += 1;
}
Term::Clause(_, atom!("\\+"), mut terms) if terms.len() == 1 => {
let not_term = terms.pop().unwrap();
let build_stack_len = build_stack.len();
build_stack.reserve_branch(2);
state_stack.push(TraversalState::BuildFinalDisjunct(build_stack_len));
state_stack.push(TraversalState::Term(Term::Clause(
Cell::default(),
atom!("$succeed"),
vec![],
)));
state_stack.push(TraversalState::BuildDisjunct(build_stack_len));
state_stack.push(TraversalState::Fail);
state_stack.push(TraversalState::CutPrev(self.var_num));
state_stack.push(TraversalState::ResetGlobalCutVarOverride(
self.global_cut_var_num_override,
));
state_stack.push(TraversalState::Term(not_term));
state_stack.push(TraversalState::OverrideGlobalCutVar(self.var_num));
state_stack.push(TraversalState::GetCutPoint {
var_num: self.var_num,
prev_b: false,
});
self.current_chunk_type = ChunkType::Mid;
self.current_chunk_num += 1;
self.var_num += 1;
}
Term::Clause(_, atom!(":"), mut terms) if terms.len() == 2 => {
let predicate_name = terms.pop().unwrap();
let module_name = terms.pop().unwrap();
match (module_name, predicate_name) {
(
Term::Literal(_, Literal::Atom(module_name)),
Term::Literal(_, Literal::Atom(predicate_name)),
) => {
if update_chunk_data(self, predicate_name, 0) {
build_stack.add_chunk();
}
build_stack.push_chunk_term(qualified_clause_to_query_term(
loader,
module_name,
predicate_name,
vec![],
self.call_policy,
));
}
(
Term::Literal(_, Literal::Atom(module_name)),
Term::Clause(_, name, terms),
) => {
if update_chunk_data(self, name, terms.len()) {
build_stack.add_chunk();
}
for (arg_c, term) in terms.iter().enumerate() {
self.probe_body_term(arg_c + 1, terms.len(), term);
}
build_stack.push_chunk_term(qualified_clause_to_query_term(
loader,
module_name,
name,
terms,
self.call_policy,
));
}
(module_name, predicate_name) => {
if update_chunk_data(self, atom!("call"), 2) {
build_stack.add_chunk();
}
self.probe_body_term(1, 0, &module_name);
self.probe_body_term(2, 0, &predicate_name);
terms.push(module_name);
terms.push(predicate_name);
build_stack.push_chunk_term(clause_to_query_term(
loader,
atom!("call"),
vec![Term::Clause(Cell::default(), atom!(":"), terms)],
self.call_policy,
));
}
}
}
Term::Clause(_, atom!("$call_with_inference_counting"), mut terms)
if terms.len() == 1 =>
{
state_stack.push(TraversalState::ResetCallPolicy(self.call_policy));
state_stack.push(TraversalState::Term(terms.pop().unwrap()));
self.call_policy = CallPolicy::Counted;
}
Term::Clause(_, name, terms) => {
add_chunk(self, name, terms);
}
var @ Term::Var(..) => {
if update_chunk_data(self, atom!("call"), 1) {
build_stack.add_chunk();
}
self.probe_body_term(1, 1, &var);
build_stack.push_chunk_term(clause_to_query_term(
loader,
atom!("call"),
vec![var],
self.call_policy,
));
}
Term::Literal(_, Literal::Atom(atom!("!")) | Literal::Char('!')) => {
let (var_num, is_global) =
if let Some(var_num) = self.global_cut_var_num_override {
(var_num, false)
} else if let Some(var_num) = self.global_cut_var_num {
(var_num, true)
} else {
let var_num = self.var_num;
self.global_cut_var_num = Some(var_num);
self.var_num += 1;
(var_num, true)
};
self.probe_in_situ_var(var_num);
state_stack.push(TraversalState::Cut { var_num, is_global });
}
Term::Literal(_, Literal::Atom(name)) => {
if update_chunk_data(self, name, 0) {
build_stack.add_chunk();
}
build_stack.push_chunk_term(clause_to_query_term(
loader,
name,
vec![],
self.call_policy,
));
}
_ => {
return Err(CompilationError::InadmissibleQueryTerm);
}
}
}
}
}
Ok(build_stack)
}
}
impl BranchMap {
pub fn separate_and_classify_variables(
&mut self,
var_num: usize,
global_cut_var_num: Option<usize>,
current_chunk_num: usize,
) -> VarData {
let mut var_data = VarData {
records: VariableRecords::new(var_num),
global_cut_var_num,
allocates: current_chunk_num > 0,
};
for (var, branches) in self.iter_mut() {
let (mut var_num, var_num_incr) = if let Var::InSitu(var_num) = *var.borrow() {
(var_num, false)
} else {
(var_data.records.len(), true)
};
for branch in branches.iter_mut() {
if var_num_incr {
var_num = var_data.records.len();
var_data.records.push(VariableRecord::default());
}
if branch.chunks.len() <= 1 {
// true iff var is a temporary variable.
debug_assert_eq!(branch.chunks.len(), 1);
let chunk = &mut branch.chunks[0];
let mut temp_var_data = TempVarData::new();
for var_info in chunk.vars.iter_mut() {
if var_info.lvl == Level::Shallow {
let term_loc = var_info.chunk_type.to_gen_context(chunk.chunk_num);
temp_var_data
.use_set
.insert((term_loc, var_info.classify_info.arg_c));
}
}
var_data.records[var_num].allocation = VarAlloc::Temp {
term_loc: chunk.term_loc,
temp_reg: 0,
temp_var_data,
safety: VarSafetyStatus::Needed,
to_perm_var_num: None,
};
} // else VarAlloc is already a Perm variant, as it's the default.
for chunk in branch.chunks.iter_mut() {
var_data.records[var_num].num_occurrences += chunk.vars.len();
for var_info in chunk.vars.iter_mut() {
var_info.var_ptr.set(Var::Generated(var_num));
}
}
}
}
var_data.records.populate_restricting_sets();
var_data
}
}
```
|
```c++
/*******************************************************************************
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*******************************************************************************/
#include <algorithm>
#include "sc_data_format.hpp"
#include <compiler/ir/graph/graph.hpp>
#include <compiler/ir/graph/utils.hpp>
#include <compiler/ir/transform/constant_fold.hpp>
#include <compiler/ir/transform/simple_licm.hpp>
#include <runtime/dynamic_dispatch/ops/impl_type.hpp>
#include <util/reflection.hpp>
#include <util/utils.hpp>
namespace dnnl {
namespace impl {
namespace graph {
namespace gc {
sc_data_format_kind_t::sc_data_format_kind_t(
const std::vector<int> &storage_args) {
COMPILE_ASSERT(storage_args.size() <= sc_data_format_kind_t::MAX_DIMS,
"storage size should be less than MAX_DIMS");
uint64_t res = set_ith_int(
0xffffffffffffffff, sc_data_format_kind_t::MAX_DIMS, 0);
for (size_t i = 0; i < storage_args.size(); ++i) {
res = set_ith_int(res, i, storage_args[i]);
}
storage_ = res;
}
sc_data_format_kind_t sc_data_format_kind_t::get_plain_by_dims(size_t ndims) {
COMPILE_ASSERT(ndims <= sc_data_format_kind_t::MAX_DIMS,
"storage size should be less than MAX_DIMS");
uint64_t res = set_ith_int(
0xffffffffffffffff, sc_data_format_kind_t::MAX_DIMS, 0);
for (size_t i = 0; i < ndims; ++i) {
res = set_ith_int(res, i, i);
}
return sc_data_format_kind_t(res);
}
sc_data_format_kind_t sc_data_format_kind_t::get_2dblocking_by_dims(
size_t ndims, bool is_weight, bool is_vnni_format) {
COMPILE_ASSERT(ndims <= sc_data_format_kind_t::MAX_DIMS,
"storage size should be less than MAX_DIMS");
uint64_t res = set_ith_int(
0xffffffffffffffff, sc_data_format_kind_t::MAX_DIMS, 0);
for (size_t i = 0; i < ndims; ++i) {
res = set_ith_int(res, i, i);
}
if (ndims == 1) {
res = set_ith_int(res, ndims, ndims - 1);
} else {
// the first blocking
res = set_ith_int(res, ndims, ndims - 2);
// the second blocking
res = set_ith_int(res, ndims + 1, ndims - 1);
if (is_weight) {
res = set_ith_int(res, ndims - 2, ndims - 1);
res = set_ith_int(res, ndims - 1, ndims - 2);
}
}
if (is_vnni_format) {
assert(ndims >= 2);
// the third blocking
res = set_ith_int(res, ndims + 2, ndims - 2);
}
return sc_data_format_kind_t(res);
}
int sc_data_format_kind_t::ndims() const {
for (int i = 0; i < MAX_DIMS; i++) {
if (get(i) == UNDEF_DIM) { return i; }
}
return -1;
}
std::vector<int> sc_data_format_kind_t::collect_blocking_index(int axis) const {
std::vector<int> index;
int cur_idx = 0;
int blocking_count[MAX_DIMS] = {0};
for (int i = 0; i < MAX_DIMS; i++) {
auto cur_axis = get(i);
if (cur_axis == UNDEF_DIM) { return index; }
blocking_count[cur_axis]++;
if (blocking_count[cur_axis] > 1) {
if (cur_axis == axis) { index.push_back(cur_idx); }
cur_idx++;
}
}
return index;
}
std::vector<std::vector<int>>
sc_data_format_kind_t::collect_p2b_mapping() const {
std::vector<std::vector<int>> dist(norig_dims(), std::vector<int> {});
for (int i = 0; i < MAX_DIMS; i++) {
auto orig_axis = get(i);
if (orig_axis == UNDEF_DIM) { return dist; }
dist[orig_axis].emplace_back(i);
}
return dist;
}
void sc_data_format_kind_t::collect_dim_count(
int out[sc_data_format_kind_t::MAX_DIMS]) const {
for (int i = 0; i < MAX_DIMS; i++) {
int orig_idx = get(i);
if (orig_idx != UNDEF_DIM) {
++out[orig_idx];
} else {
break;
}
}
}
int sc_data_format_kind_t::norig_dims() const {
int ret = -1;
for (int i = 0; i < MAX_DIMS; i++) {
int orig_idx = get(i);
if (orig_idx != UNDEF_DIM) {
ret = std::max(orig_idx, ret);
} else {
break;
}
}
return ret + 1;
}
bool sc_data_format_t::is_convertible(const sc_data_format_t &other) const {
if (format_code_ == format_kinds::any
|| other.format_code_ == format_kinds::any) {
return true;
}
return format_code_.norig_dims() == other.format_code_.norig_dims();
}
bool sc_data_format_kind_t::is_channel_last() const {
int i = 0;
for (; i < MAX_DIMS - 1; i++) {
if (get(i + 1) == UNDEF_DIM) {
break;
} else if ((i == 0 && get(i) != 0) || (i != 0 && get(i) != i + 1)) {
return false;
}
}
if (!i) return false;
return get(i) == 1;
}
bool sc_data_format_kind_t::is_plain() const {
int i = 0;
for (; i < MAX_DIMS; i++) {
if (get(i) == UNDEF_DIM) {
break;
} else if (get(i) != i) {
return false;
}
}
if (!i) return false;
return true;
}
bool sc_data_format_kind_t::is_blocking() const {
int out[sc_data_format_kind_t::MAX_DIMS] = {0};
collect_dim_count(out);
for (int i = 0; i < MAX_DIMS; i++) {
if (out[i] > 1) {
return true;
} else if (out[i] == 0) {
return false;
}
}
return false;
}
sc_data_format_kind_t sc_data_format_kind_t::to_plain() const {
std::vector<int> storage(this->norig_dims());
for (int i = 0; i < this->norig_dims(); i++) {
storage[i] = i;
}
return sc_data_format_kind_t(storage);
}
sc_data_format_kind_t sc_data_format_kind_t::to_channel_last() const {
int ndims = this->norig_dims();
std::vector<int> storage(ndims);
for (int i = 1; i < ndims; i++) {
storage[i] = i + 1;
}
storage[0] = 0;
storage[ndims - 1] = 1;
return sc_data_format_kind_t(storage);
}
bool sc_data_format_t::is_blocking() const {
return format_code_.is_blocking();
}
bool sc_data_format_t::is_channel_last() const {
return format_code_.is_channel_last();
}
bool sc_data_format_t::is_plain() const {
return format_code_ != format_kinds::any && format_code_.is_plain();
}
bool sc_data_format_t::is_any() const {
return format_code_ == format_kinds::any;
}
sc_data_format_t sc_data_format_t::to_plain() const {
return sc_data_format_t(format_code_.to_plain());
}
sc_data_format_t sc_data_format_t::to_channel_last() const {
return sc_data_format_t(format_code_.to_channel_last());
}
sc_format_category sc_data_format_t::get_format_category() const {
if (format_code_ == format_kinds::any)
return sc_format_category::any;
else if (format_code_.is_blocking())
return sc_format_category::blocked;
else
return sc_format_category::non_blocking;
}
void sc_data_format_t::to_string(std::ostream &os) const {
os << *this << "\n";
}
runtime::dispatch_key sc_data_format_t::to_runtime() const {
COMPILE_ASSERT(format_code_.ndims() < runtime::dispatch_key::meta::MAX_DIMS,
"Cannot convert this sc_data_format_t to runtime dispatch_key");
COMPILE_ASSERT(blocks_[0] < 256 && blocks_[1] < 256,
"The blocks are too large for runtime dispatch_key");
return runtime::dispatch_key(static_cast<uint64_t>(format_code_),
blocks_[0], blocks_[1], impl_kind_t::normal,
format_code_.is_plain());
}
std::ostream &operator<<(std::ostream &os, const sc_data_format_t &in) {
if (in.is_any()) { return os << "any"; }
int out[sc_data_format_kind_t::MAX_DIMS] = {0};
int num_blocking = 0;
for (int i = 0; i < sc_data_format_kind_t::MAX_DIMS; i++) {
int orig_idx = in.format_code_.get(i);
if (orig_idx != sc_data_format_kind_t::UNDEF_DIM) {
out[orig_idx]++;
char axis_name_base;
// if the axis is blocking
if (out[orig_idx] > 1) {
// get the blocking number from in.blocks_
COMPILE_ASSERT((size_t)num_blocking < in.blocks_.size(),
"Too many blocking dims");
os << in.blocks_[num_blocking];
num_blocking++;
axis_name_base = 'a';
} else {
axis_name_base = 'A';
}
os << char(axis_name_base + orig_idx);
} else {
break;
}
}
return os;
}
static bool is_fixed_blocks(const std::array<int, 4> &blocks, int number) {
for (int i = 0; i < number; i++) {
if (blocks[i] < 0) { return false; }
}
return true;
}
static void get_block_nums_for_axises(const sc_data_format_t &format,
int blocking_num[sc_data_format_kind_t::MAX_DIMS]) {
// index: index in the plain dims, value: number of currently met axies in
// the format
int orig_num_blocking[sc_data_format_kind_t::MAX_DIMS] = {0};
size_t cur_blocking = 0;
for (int i = 0; i < sc_data_format_kind_t::MAX_DIMS; i++) {
int orig_idx = format.format_code_.get(i);
if (orig_idx != sc_data_format_kind_t::UNDEF_DIM) {
orig_num_blocking[orig_idx]++;
if (orig_num_blocking[orig_idx] > 1) {
// get the blocking number from in.blocks_
COMPILE_ASSERT(cur_blocking < format.blocks_.size(),
"Too many blocking dims");
blocking_num[i] = format.blocks_[cur_blocking];
cur_blocking++;
} else {
// blocking_num[i]=0;
}
} else {
break;
}
}
}
std::unordered_map<int, std::vector<int>>
sc_data_format_t::get_blocked_axis() const {
std::unordered_map<int, std::vector<int>> blocked_axis;
int out[sc_data_format_kind_t::MAX_DIMS] = {0};
int block_pos = 0;
for (int i = 0; i < sc_data_format_kind_t::MAX_DIMS; i++) {
int orig_idx = format_code_.get(i);
if (orig_idx != sc_data_format_kind_t::UNDEF_DIM) {
++out[orig_idx];
if (out[orig_idx] > 1) {
blocked_axis[orig_idx].push_back(blocks_[block_pos++]);
}
} else {
break;
}
}
return blocked_axis;
}
void get_blocking_shapes_impl(const sc_dims &plain_shapes,
const sc_data_format_t &format, size_t base_out_dim,
size_t num_format_dims, size_t num_out_dims,
const std::function<void(int, int)> &callback) {
COMPILE_ASSERT(plain_shapes.size() <= sc_data_format_kind_t::MAX_DIMS,
"Too many dims in plain shapes");
// index: index in the format, value: the blocking number collected from
// format.blocks_. e.g. for NCHW16c, blocking_num=[0,0,0,0,16,...]
int blocking_num[sc_data_format_kind_t::MAX_DIMS] = {0};
get_block_nums_for_axises(format, blocking_num);
// calculate the real shapes
// For example, KCRS16c8k4c, format code = [0,1,2,3,1,0,1], where plain dims
// is KCRS=[a,b,c,d]
// 1. for each axis in the target format, get the original axis. e.g. for C
// axis, the original axis is 1.
// 2. get the blocking/original shape of the axis. e.g. for C axis in
// KCRS16c8k4c, it is the first axis of C, so the original shape on the axis
// is b. For the first blocking axis of "16c", its blocking number is 16.
// 3. finalize the shape of the current axis. It should be
// (original_shape/next_blocking_number). e.g. for C axis in KCRS16c8k4c,
// original shape=b, next blocking number=16, so the shape of C axis is
// ceil(b/16). for "16c" axis in KCRS16c8k4c, original shape=16, next
// blocking number=4, so the shape of "16c" axis is ceil(16/4)=4.
for (auto out_idx = base_out_dim; out_idx < num_out_dims; out_idx++) {
auto idx_in_format = out_idx - base_out_dim;
int orig_axis = format.format_code_.get(idx_in_format);
assert((size_t)orig_axis < plain_shapes.size());
// find original shape from plain_shapes or blocking_num
int new_shape;
if (blocking_num[idx_in_format] != 0) {
new_shape = blocking_num[idx_in_format];
} else {
new_shape = plain_shapes.at(orig_axis + base_out_dim);
}
// get next_blocking_number
int next_blocking_number = 1;
for (size_t i = idx_in_format + 1; i < num_format_dims; i++) {
// find next axis in format with same axis name
if (orig_axis == format.format_code_.get(i)) {
next_blocking_number = blocking_num[i];
break;
}
}
callback(new_shape, next_blocking_number);
}
}
sc_dims sc_data_format_t::get_blocking_shapes(
const sc_dims &plain_shapes, const sc_data_format_t &format) {
if (plain_shapes.empty()) { return sc_dims(); }
// todo: should be is_plain()
if (format.format_code_ == format_kinds::any) { return plain_shapes; }
sc_dims ret;
size_t base_out_dim = 0;
size_t num_plain_dims = format.format_code_.norig_dims();
size_t num_format_dims = format.format_code_.ndims();
size_t num_out_dims = num_format_dims;
ret.reserve(num_out_dims);
COMPILE_ASSERT(plain_shapes.size() == num_plain_dims,
"Wrong number of dimensions for format: "
<< format
<< ", plain shape = " << utils::print_vector(plain_shapes));
auto callback = [&](int new_shape, int next_blocking_number) {
if (is_dynamic_dim(new_shape) || is_dynamic_dim(next_blocking_number)) {
ret.push_back(dimensions::dynamic_any);
} else {
ret.push_back(
utils::divide_and_ceil(new_shape, next_blocking_number));
}
};
get_blocking_shapes_impl(plain_shapes, format, base_out_dim,
num_format_dims, num_out_dims, callback);
return ret;
}
static size_t throw_if_negative(int dim) {
if (dim < 0) { throw std::runtime_error("Bad format"); }
return dim;
}
std::vector<expr> get_blocking_shapes_expr(sc_graph_t &g,
const sc_dims &plain_shapes, const sc_data_format_t &format) {
if (plain_shapes.empty()) { return std::vector<expr>(); }
// todo: should be is_plain()
if (format.format_code_ == format_kinds::any) {
return g.dims_to_expr(plain_shapes);
}
std::vector<expr> ret;
size_t base_out_dim = 0;
size_t num_plain_dims = throw_if_negative(format.format_code_.norig_dims());
size_t num_format_dims = throw_if_negative(format.format_code_.ndims());
size_t num_out_dims = num_format_dims;
ret.reserve(num_out_dims);
COMPILE_ASSERT(plain_shapes.size() == num_plain_dims,
"Wrong number of dimensions for format: "
<< format
<< ", plain shape = " << utils::print_vector(plain_shapes));
auto callback = [&](int new_shape, int next_blocking_number) {
auto dim = next_blocking_number == 1
? g.dim_to_expr(new_shape)
: divide_and_ceil(g.dim_to_expr(new_shape),
g.dim_to_expr(next_blocking_number));
dim->attr().set(attr_key::const_attr, true);
ret.push_back(dim);
};
get_blocking_shapes_impl(plain_shapes, format, base_out_dim,
num_format_dims, num_out_dims, callback);
return ret;
}
sc_dims sc_data_format_t::get_padded_plain_shapes(
const sc_dims &real_shapes, const sc_data_format_t &format) {
if (real_shapes.empty()) { return sc_dims(); }
if (format.format_code_ == format_kinds::any) { return real_shapes; }
sc_dims ret;
size_t base_out_dim = 0;
size_t num_plain_dims = format.format_code_.norig_dims();
size_t num_format_dims = format.format_code_.ndims();
size_t num_out_dims = num_plain_dims;
ret.reserve(num_out_dims);
COMPILE_ASSERT(real_shapes.size() == num_format_dims,
"Wrong number of dimensions for format: "
<< format
<< ", real shape = " << utils::print_vector(real_shapes));
if (!is_fixed_blocks(format.blocks_, 4)) {
return sc_dims(num_out_dims, -1);
}
COMPILE_ASSERT(real_shapes.size() <= sc_data_format_kind_t::MAX_DIMS,
"Too many dims in plain shapes");
for (auto out_idx = base_out_dim; out_idx < num_out_dims; out_idx++) {
auto orig_axis = out_idx - base_out_dim;
int shape = 1;
for (size_t i = 0; i < num_format_dims; i++) {
if ((int)orig_axis == format.format_code_.get(i)) {
if (is_dynamic_dim(real_shapes.at(base_out_dim + i))) {
shape = dimensions::dynamic_any;
break;
}
shape *= real_shapes.at(base_out_dim + i);
}
}
// shape is the product of all axises with the same name
ret.push_back(shape);
}
return ret;
}
sc_dims sc_data_format_t::get_reordered_shapes(const sc_dims &input_shapes,
const sc_data_format_t &input_format,
const sc_data_format_t &output_format) {
COMPILE_ASSERT(input_format.is_convertible(output_format),
"Can not convert input format "
<< input_format << " to output format " << output_format);
sc_dims plain_shapes = get_padded_plain_shapes(input_shapes, input_format);
return get_blocking_shapes(plain_shapes, output_format);
}
int sc_data_format_t::get_blocks_size() const {
int i = 0;
for (; i < static_cast<int>(blocks_.size()); i++) {
if (blocks_[i] == 0) { return i; }
}
return i;
}
bool sc_data_format_t::is_same_format_kind(
const sc_data_format_t &input_format) const {
return this->format_code_ == input_format.format_code_;
}
bool sc_data_format_cmper_t::operator()(
const sc_data_format_t &fmt0, const sc_data_format_t &fmt1) const {
if (fmt0.format_code_ != fmt1.format_code_) {
return fmt0.format_code_ < fmt1.format_code_;
}
if (fmt0.blocks_ != fmt1.blocks_) {
for (int i = 0; i < 4; i++) {
if (fmt0.blocks_[i] != fmt1.blocks_[i]) {
return fmt0.blocks_[i] < fmt1.blocks_[i];
}
}
}
// equal
return false;
}
bool is_dynamic_blocking(
const sc_dims &shapes, const sc_data_format_t &format) {
auto &code = format.format_code_;
for (size_t i = 0; i < shapes.size(); i++) {
if (is_dynamic_dim(shapes[i])
&& !code.collect_blocking_index(i).empty()) {
return true;
}
}
return false;
}
// clang-format off
SC_CLASS(sc_data_format_t)
SC_FIELD(format_code_)
SC_FIELD(blocks_)
SC_CLASS_END()
SC_CLASS(sc_data_format_kind_t)
SC_FIELD(storage_)
SC_CLASS_END()
// clang-format on
template struct reflection::type_registry<
std::vector<std::vector<sc_data_format_t>>>;
} // namespace gc
} // namespace graph
} // namespace impl
} // namespace dnnl
namespace std {
std::size_t hash<dnnl::impl::graph::gc::sc_data_format_t>::operator()(
const dnnl::impl::graph::gc::sc_data_format_t &k) const {
namespace gc = dnnl::impl::graph::gc;
size_t hash_ = 0;
gc::hash_combine(hash_, (uint64_t)k.format_code_);
gc::hash_combine(hash_, get<0>(k.blocks_));
gc::hash_combine(hash_, get<1>(k.blocks_));
gc::hash_combine(hash_, get<2>(k.blocks_));
gc::hash_combine(hash_, get<3>(k.blocks_));
return hash_;
}
} // namespace std
```
|
Little Bigfoot is a 1997 American direct-to-video family film, directed by Art Camacho. It was made by the same producers as Bigfoot: The Unforgettable Encounter and it was followed by the sequel Little Bigfoot 2: The Journey Home (1998).
Plot
A boy, Payton Shoemaker and his little sister Maggie engage in an adventure to save (and secretly befriend) a young male bigfoot which they name him Bilbo (after Bilbo Baggins from The Hobbit) and his injured mother (who gets shot in her kneecap prior to the opening of the film by the hunters) from a logging company who is illegally hunting them down while on summer vacation in Cedar Lake, California with their older brother, Peter, their dog, Max, and their widowed mother.
Cast
Ross Malinger as Payton
P.J. Soles as Carolyn
Kenneth Tigar as Largo
Kelly Packard as Lanya
Don Stroud as McKenzie
Release
Reception
American magazine TV Guide gave the film one star out of four, stating:
References
External links
1997 films
1997 direct-to-video films
1990s American films
1990s children's adventure films
1990s English-language films
DHX Media films
American children's adventure films
American direct-to-video films
Bigfoot films
Direct-to-video adventure films
Films directed by Art Camacho
Films scored by Louis Febre
|
Bosome Freho District is one of the forty-three districts in Ashanti Region, Ghana. Originally it was formerly part of the then-larger Amansie East District in 2004; until the eastern part of the district was split off by a decree of president John Agyekum Kufuor on 29 February 2008 to create Bosome Freho District; thus the remaining part has been renamed as Bekwai Municipal District while it was elevated to municipal district assembly status on that same year. The district assembly is located in the southern part of Ashanti Region and has Asiwa as its capital town.
Places of interest
There is one senior high school (Bosome Senior High Technical School), a district magistrate court at Asiwa, Asiwa Health Centre and a police station. There is also a budget hotel, Pakas Lodge with a restaurant.
Sources
GhanaDistricts.com
Ghana Statistical Service
References
Districts of Ashanti Region
|
```php
<?php
/**
* @var \App\View\AppView $this
* @var array $body
*/
use Cake\Core\Configure;
use Passbolt\MultiFactorAuthentication\Utility\MfaSettings;
$title = __('Yubikey One Time Password is enabled!');
$this->assign('title', $title);
$this->assign('pageClass', 'iframe mfa');
$this->Html->script('app/mfa-settings.js?v=' . Configure::read('passbolt.version'), ['block' => 'js', 'fullBase' => true]);
?>
<div class="grid grid-responsive-12">
<div class="row">
<div class="col7 main-column">
<h3><?= $title; ?></h3>
<div class="feedback-card">
<?= $this->element('successMark'); ?>
<div class="additional-information">
<p>
<?= __('When logging in from a new device you will need a unique code generated by your yubikey.'); ?>
</p>
<p class="created date">
<?= __('Since')?>: <?= $body['verified']->nice(); ?>
</p>
<?= $this->element('turnOffProviderButton', ['provider' => MfaSettings::PROVIDER_YUBIKEY]); ?>
</div>
</div>
<?= $this->element('manageProvidersButton'); ?>
</div>
</div>
</div>
```
|
```objective-c
/*
*
* This program is free software; you can redistribute it and/or modify
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __PJSIP_SIP_TRANSPORT_H__
#define __PJSIP_SIP_TRANSPORT_H__
/**
* @file sip_transport.h
* @brief SIP Transport
*/
#include <pjsip/sip_msg.h>
#include <pjsip/sip_parser.h>
#include <pjsip/sip_resolve.h>
#include <pj/sock.h>
#include <pj/list.h>
#include <pj/ioqueue.h>
#include <pj/timer.h>
PJ_BEGIN_DECL
/**
* @defgroup PJSIP_TRANSPORT Transport
* @ingroup PJSIP_CORE
* @brief This is the transport framework.
*
* The transport framework is fully extensible. Please see
* <A HREF="/docs.htm">PJSIP Developer's Guide</A> PDF
* document for more information.
*
* Application MUST register at least one transport to PJSIP before any
* messages can be sent or received. Please see @ref PJSIP_TRANSPORT_UDP
* on how to create/register UDP transport to the transport framework.
*
* @{
*/
/*****************************************************************************
*
* GENERAL TRANSPORT (NAMES, TYPES, ETC.)
*
*****************************************************************************/
/*
* Forward declaration for transport factory (since it is referenced by
* the transport factory itself).
*/
typedef struct pjsip_tpfactory pjsip_tpfactory;
/**
* Flags for SIP transports.
*/
enum pjsip_transport_flags_e
{
PJSIP_TRANSPORT_RELIABLE = 1, /**< Transport is reliable. */
PJSIP_TRANSPORT_SECURE = 2, /**< Transport is secure. */
PJSIP_TRANSPORT_DATAGRAM = 4 /**< Datagram based transport.
(it's also assumed to be
connectionless) */
};
/**
* Check if transport tp is reliable.
*/
#define PJSIP_TRANSPORT_IS_RELIABLE(tp) \
((tp)->flag & PJSIP_TRANSPORT_RELIABLE)
/**
* Check if transport tp is secure.
*/
#define PJSIP_TRANSPORT_IS_SECURE(tp) \
((tp)->flag & PJSIP_TRANSPORT_SECURE)
/**
* Register new transport type to PJSIP. The PJSIP transport framework
* contains the info for some standard transports, as declared by
* #pjsip_transport_type_e. Application may use non-standard transport
* with PJSIP, but before it does so, it must register the information
* about the new transport type to PJSIP by calling this function.
*
* @param tp_flag The flags describing characteristics of this
* transport type.
* @param tp_name Transport type name.
* @param def_port Default port to be used for the transport.
* @param p_tp_type On successful registration, it will be filled with
* the registered type. This argument is optional.
*
* @return PJ_SUCCESS if registration is successful, or
* PJSIP_ETYPEEXISTS if the same transport type has
* already been registered.
*/
PJ_DECL(pj_status_t) pjsip_transport_register_type(unsigned tp_flag,
const char *tp_name,
int def_port,
int *p_tp_type);
/**
* Get the transport type from the transport name.
*
* @param name Transport name, such as "TCP", or "UDP".
*
* @return The transport type, or PJSIP_TRANSPORT_UNSPECIFIED if
* the name is not recognized as the name of supported
* transport.
*/
PJ_DECL(pjsip_transport_type_e)
pjsip_transport_get_type_from_name(const pj_str_t *name);
/**
* Get the first transport type that has the specified flags.
*
* @param flag The transport flag.
*
* @return Transport type.
*/
PJ_DECL(pjsip_transport_type_e)
pjsip_transport_get_type_from_flag(unsigned flag);
/**
* Get the socket address family of a given transport type.
*
* @param type Transport type.
*
* @return Transport type.
*/
PJ_DECL(int) pjsip_transport_type_get_af(pjsip_transport_type_e type);
/**
* Get transport flag from type.
*
* @param type Transport type.
*
* @return Transport flags.
*/
PJ_DECL(unsigned)
pjsip_transport_get_flag_from_type( pjsip_transport_type_e type );
/**
* Get the default SIP port number for the specified type.
*
* @param type Transport type.
*
* @return The port number, which is the default SIP port number for
* the specified type.
*/
PJ_DECL(int)
pjsip_transport_get_default_port_for_type(pjsip_transport_type_e type);
/**
* Get transport type name.
*
* @param t Transport type.
*
* @return Transport name.
*/
PJ_DECL(const char*) pjsip_transport_get_type_name(pjsip_transport_type_e t);
/**
* Get longer description for the specified transport type.
*
* @param t Transport type.
*
* @return Transport description.
*/
PJ_DECL(const char*) pjsip_transport_get_type_desc(pjsip_transport_type_e t);
/*****************************************************************************
*
* TRANSPORT SELECTOR.
*
*****************************************************************************/
/**
* This structure describes the type of data in pjsip_tpselector.
*/
typedef enum pjsip_tpselector_type
{
/** Transport is not specified. */
PJSIP_TPSELECTOR_NONE,
/** Use the specific transport to send request. */
PJSIP_TPSELECTOR_TRANSPORT,
/** Use the specific listener to send request. */
PJSIP_TPSELECTOR_LISTENER,
/** Use the IP version criteria to send request. */
PJSIP_TPSELECTOR_IP_VER,
} pjsip_tpselector_type;
/**
* This enumerator describes the IP version criteria for pjsip_tpselector.
*/
typedef enum pjsip_tpselector_ip_ver
{
/** IPv4 only. */
PJSIP_TPSELECTOR_USE_IPV4_ONLY,
/**
* No preference. IP version used will depend on the order of addresses
* returned by pjsip_resolver.
*/
PJSIP_TPSELECTOR_NO_PREFERENCE,
/** IPv4 is preferred. */
PJSIP_TPSELECTOR_PREFER_IPV4,
/** IPv6 is preferred. */
PJSIP_TPSELECTOR_PREFER_IPV6,
/** IPv6 only. */
PJSIP_TPSELECTOR_USE_IPV6_ONLY
} pjsip_tpselector_ip_ver;
/**
* This structure describes the transport/listener preference to be used
* when sending outgoing requests.
*
* Normally transport will be selected automatically according to rules about
* sending requests. But some applications (such as proxies or B2BUAs) may
* want to explicitly use specific transport to send requests, for example
* when they want to make sure that outgoing request should go from a specific
* network interface.
*
* The pjsip_tpselector structure is used for that purpose, i.e. to allow
* application specificly request that a particular transport/listener
* should be used to send request. This structure is used when calling
* pjsip_tsx_set_transport() and pjsip_dlg_set_transport().
*
* If application disables connection reuse and wants to force creating
* a new transport, it needs to consider the following couple of things:
* - If it still wants to reuse an existing transport (if any), it
* needs to keep a reference to that transport and specifically set
* the transport to be used for sending requests.
* - Delete those existing transports manually when no longer needed.
*/
typedef struct pjsip_tpselector
{
/** The type of data in the union */
pjsip_tpselector_type type;
/**
* Whether to disable reuse of an existing connection.
* This setting will be ignored if (type == PJSIP_TPSELECTOR_TRANSPORT)
* and transport in the union below is set.
*/
pj_bool_t disable_connection_reuse;
/**
* Union representing the transport/listener/IP version criteria
* to be used.
*/
union {
pjsip_transport *transport;
pjsip_tpfactory *listener;
pjsip_tpselector_ip_ver ip_ver;
void *ptr;
} u;
} pjsip_tpselector;
/**
* Add transport/listener reference in the selector to prevent the specified
* transport/listener from being destroyed while application still has
* reference to it.
*
* @param sel The transport selector.
*/
PJ_DECL(void) pjsip_tpselector_add_ref(pjsip_tpselector *sel);
/**
* Decrement transport/listener reference in the selector.
* @param sel The transport selector
*/
PJ_DECL(void) pjsip_tpselector_dec_ref(pjsip_tpselector *sel);
/*****************************************************************************
*
* RECEIVE DATA BUFFER.
*
*****************************************************************************/
/**
* A customized ioqueue async operation key which is used by transport
* to locate rdata when a pending read operation completes.
*/
typedef struct pjsip_rx_data_op_key
{
pj_ioqueue_op_key_t op_key; /**< ioqueue op_key. */
pjsip_rx_data *rdata; /**< rdata associated with this */
} pjsip_rx_data_op_key;
/**
* Incoming message buffer.
* This structure keep all the information regarding the received message. This
* buffer lifetime is only very short, normally after the transaction has been
* called, this buffer will be deleted/recycled. So care must be taken when
* allocating storage from the pool of this buffer.
*/
struct pjsip_rx_data
{
/**
* tp_info is part of rdata that remains static for the duration of the
* buffer. It is initialized when the buffer was created by transport.
*/
struct
{
/** Memory pool for this buffer. */
pj_pool_t *pool;
/** The transport object which received this packet. */
pjsip_transport *transport;
/** Other transport specific data to be attached to this buffer. */
void *tp_data;
/** Ioqueue key. */
pjsip_rx_data_op_key op_key;
} tp_info;
/**
* pkt_info is initialized by transport when it receives an incoming
* packet.
*/
struct
{
/** Time when the message was received. */
pj_time_val timestamp;
/** Pointer to the original packet. */
char packet[PJSIP_MAX_PKT_LEN];
/** Zero termination for the packet. */
pj_uint32_t zero;
/** The length of the packet received. */
pj_ssize_t len;
/** The source address from which the packet was received. */
pj_sockaddr src_addr;
/** The length of the source address. */
int src_addr_len;
/** The IP source address string (NULL terminated). */
char src_name[PJ_INET6_ADDRSTRLEN];
/** The IP source port number. */
int src_port;
} pkt_info;
/**
* msg_info is initialized by transport mgr (tpmgr) before this buffer
* is passed to endpoint.
*/
struct
{
/** Start of msg buffer. */
char *msg_buf;
/** Length fo message. */
int len;
/** The parsed message, if any. */
pjsip_msg *msg;
/** Short description about the message.
* Application should use #pjsip_rx_data_get_info() instead.
*/
char *info;
/** The Call-ID header as found in the message. */
pjsip_cid_hdr *cid;
/** The From header as found in the message. */
pjsip_from_hdr *from;
/** The To header as found in the message. */
pjsip_to_hdr *to;
/** The topmost Via header as found in the message. */
pjsip_via_hdr *via;
/** The CSeq header as found in the message. */
pjsip_cseq_hdr *cseq;
/** Max forwards header. */
pjsip_max_fwd_hdr *max_fwd;
/** The first route header. */
pjsip_route_hdr *route;
/** The first record-route header. */
pjsip_rr_hdr *record_route;
/** Content-type header. */
pjsip_ctype_hdr *ctype;
/** Content-length header. */
pjsip_clen_hdr *clen;
/** "Require" header containing aggregates of all Require
* headers found in the message, or NULL.
*/
pjsip_require_hdr *require;
/** "Supported" header containing aggregates of all Supported
* headers found in the message, or NULL.
*/
pjsip_supported_hdr *supported;
/** The list of error generated by the parser when parsing
this message.
*/
pjsip_parser_err_report parse_err;
} msg_info;
/**
* endpt_info is initialized by endpoint after this buffer reaches
* endpoint.
*/
struct
{
/**
* Data attached by modules to this message.
*/
void *mod_data[PJSIP_MAX_MODULE];
} endpt_info;
};
/**
* Get printable information about the message in the rdata.
*
* @param rdata The receive data buffer.
*
* @return Printable information.
*/
PJ_DECL(char*) pjsip_rx_data_get_info(pjsip_rx_data *rdata);
/**
* Clone pjsip_rx_data. This will duplicate the contents of
* pjsip_rx_data and add reference count to the transport.
* Once application has finished using the cloned pjsip_rx_data,
* it must release it by calling #pjsip_rx_data_free_cloned().
*
* By default (if flags is set to zero), this function copies the
* transport pointer in \a tp_info, duplicates the \a pkt_info,
* perform deep clone of the \a msg_info parts of the rdata, and
* fills the \a endpt_info (i.e. the \a mod_data) with zeros.
*
* @param src The source to be cloned.
* @param flags Optional flags. Must be zero for now.
* @param p_rdata Pointer to receive the cloned rdata.
*
* @return PJ_SUCCESS on success or the appropriate error.
*/
PJ_DECL(pj_status_t) pjsip_rx_data_clone(const pjsip_rx_data *src,
unsigned flags,
pjsip_rx_data **p_rdata);
/**
* Free cloned pjsip_rx_data. This function must be and must only
* be called for a cloned pjsip_rx_data. Specifically, it must NOT
* be called for the original pjsip_rx_data that is returned by
* transports.
*
* This function will free the memory used by the pjsip_rx_data and
* decrement the transport reference counter.
*
* @param rdata The receive data buffer.
*
* @return PJ_SUCCESS on success or the appropriate error.
*/
PJ_DECL(pj_status_t) pjsip_rx_data_free_cloned(pjsip_rx_data *rdata);
/*****************************************************************************
*
* TRANSMIT DATA BUFFER MANIPULATION.
*
*****************************************************************************/
/** Customized ioqueue async operation key, used by transport to keep
* callback parameters.
*/
typedef struct pjsip_tx_data_op_key
{
/** ioqueue pending operation key. */
pj_ioqueue_op_key_t key;
/** Transmit data associated with this key. */
pjsip_tx_data *tdata;
/** Arbitrary token (attached by transport) */
void *token;
/** Callback to be called when pending transmit operation has
completed.
*/
void (*callback)(pjsip_transport*,void*,pj_ssize_t);
} pjsip_tx_data_op_key;
/**
* Data structure for sending outgoing message. Application normally creates
* this buffer by calling #pjsip_endpt_create_tdata.
*
* The lifetime of this buffer is controlled by the reference counter in this
* structure, which is manipulated by calling #pjsip_tx_data_add_ref and
* #pjsip_tx_data_dec_ref. When the reference counter has reached zero, then
* this buffer will be destroyed.
*
* A transaction object normally will add reference counter to this buffer
* when application calls #pjsip_tsx_send_msg, because it needs to keep the
* message for retransmission. The transaction will release the reference
* counter once its state has reached final state.
*/
struct pjsip_tx_data
{
/** This is for transmission queue; it's managed by transports. */
PJ_DECL_LIST_MEMBER(struct pjsip_tx_data);
/** Memory pool for this buffer. */
pj_pool_t *pool;
/** A name to identify this buffer. */
char obj_name[PJ_MAX_OBJ_NAME];
/** Short information describing this buffer and the message in it.
* Application should use #pjsip_tx_data_get_info() instead of
* directly accessing this member.
*/
char *info;
/** For response message, this contains the reference to timestamp when
* the original request message was received. The value of this field
* is set when application creates response message to a request by
* calling #pjsip_endpt_create_response.
*/
pj_time_val rx_timestamp;
/** The transport manager for this buffer. */
pjsip_tpmgr *mgr;
/** Ioqueue asynchronous operation key. */
pjsip_tx_data_op_key op_key;
/** Lock object. */
pj_lock_t *lock;
/** The message in this buffer. */
pjsip_msg *msg;
/** Strict route header saved by #pjsip_process_route_set(), to be
* restored by #pjsip_restore_strict_route_set().
*/
pjsip_route_hdr *saved_strict_route;
/** Buffer to the printed text representation of the message. When the
* content of this buffer is set, then the transport will send the content
* of this buffer instead of re-printing the message structure. If the
* message structure has changed, then application must invalidate this
* buffer by calling #pjsip_tx_data_invalidate_msg.
*/
pjsip_buffer buf;
/** Reference counter. */
pj_atomic_t *ref_cnt;
/** Being processed by transport? */
int is_pending;
/** Transport manager internal. */
void *token;
/** Callback to be called when this tx_data has been transmitted. */
void (*cb)(void*, pjsip_tx_data*, pj_ssize_t);
/** Destination information, to be used to determine the network address
* of the message. For a request, this information is initialized when
* the request is sent with #pjsip_endpt_send_request_stateless() and
* network address is resolved. For CANCEL request, this information
* will be copied from the original INVITE to make sure that the CANCEL
* request goes to the same physical network address as the INVITE
* request.
*/
struct
{
/** Server name.
*/
pj_str_t name;
/** Server addresses resolved.
*/
pjsip_server_addresses addr;
/** Current server address being tried.
*/
unsigned cur_addr;
} dest_info;
/** Transport information, only valid during on_tx_request() and
* on_tx_response() callback.
*/
struct
{
pjsip_transport *transport; /**< Transport being used. */
pj_sockaddr dst_addr; /**< Destination address. */
int dst_addr_len; /**< Length of address. */
char dst_name[PJ_INET6_ADDRSTRLEN]; /**< Destination address. */
int dst_port; /**< Destination port. */
} tp_info;
/**
* Transport selector, to specify which transport to be used.
* The value here must be set with pjsip_tx_data_set_transport(),
* to allow reference counter to be set properly.
*/
pjsip_tpselector tp_sel;
/**
* Special flag to indicate that this transmit data is a request that has
* been updated with proper authentication response and is ready to be
* sent for retry.
*/
pj_bool_t auth_retry;
/**
* Arbitrary data attached by PJSIP modules.
*/
void *mod_data[PJSIP_MAX_MODULE];
/**
* If via_addr is set, it will be used as the "sent-by" field of the
* Via header for outgoing requests as long as the request uses via_tp
* transport. Normally application should not use or access these fields.
*/
pjsip_host_port via_addr; /**< Via address. */
const void *via_tp; /**< Via transport. */
};
/**
* Create a new, blank transmit buffer. The reference count is initialized
* to zero.
*
* @param mgr The transport manager.
* @param tdata Pointer to receive transmit data.
*
* @return PJ_SUCCESS, or the appropriate error code.
*
* @see pjsip_endpt_create_tdata
*/
PJ_DECL(pj_status_t) pjsip_tx_data_create( pjsip_tpmgr *mgr,
pjsip_tx_data **tdata );
/**
* Add reference counter to the transmit buffer. The reference counter controls
* the life time of the buffer, ie. when the counter reaches zero, then it
* will be destroyed.
*
* @param tdata The transmit buffer.
*/
PJ_DECL(void) pjsip_tx_data_add_ref( pjsip_tx_data *tdata );
/**
* Decrement reference counter of the transmit buffer.
* When the transmit buffer is no longer used, it will be destroyed and
* caller is informed with PJSIP_EBUFDESTROYED return status.
*
* @param tdata The transmit buffer data.
* @return This function will always succeeded eventhough the return
* status is non-zero. A status PJSIP_EBUFDESTROYED will be
* returned to inform that buffer is destroyed.
*/
PJ_DECL(pj_status_t) pjsip_tx_data_dec_ref( pjsip_tx_data *tdata );
/**
* Print the SIP message to transmit data buffer's internal buffer. This
* may allocate memory for the buffer, if the buffer has not been allocated
* yet, and encode the SIP message to that buffer.
*
* @param tdata The transmit buffer.
*
* @return PJ_SUCCESS on success of the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tx_data_encode(pjsip_tx_data *tdata);
/**
* Check if transmit data buffer contains a valid message.
*
* @param tdata The transmit buffer.
* @return Non-zero (PJ_TRUE) if buffer contains a valid message.
*/
PJ_DECL(pj_bool_t) pjsip_tx_data_is_valid( pjsip_tx_data *tdata );
/**
* Invalidate the print buffer to force message to be re-printed. Call
* when the message has changed after it has been printed to buffer. The
* message is printed to buffer normally by transport when it is about to be
* sent to the wire. Subsequent sending of the message will not cause
* the message to be re-printed, unless application invalidates the buffer
* by calling this function.
*
* @param tdata The transmit buffer.
*/
PJ_DECL(void) pjsip_tx_data_invalidate_msg( pjsip_tx_data *tdata );
/**
* Get short printable info about the transmit data. This will normally return
* short information about the message.
*
* @param tdata The transmit buffer.
*
* @return Null terminated info string.
*/
PJ_DECL(char*) pjsip_tx_data_get_info( pjsip_tx_data *tdata );
/**
* Set the explicit transport to be used when sending this transmit data.
* Application should not need to call this function, but rather use
* pjsip_tsx_set_transport() and pjsip_dlg_set_transport() instead (which
* will call this function).
*
* @param tdata The transmit buffer.
* @param sel Transport selector.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_tx_data_set_transport(pjsip_tx_data *tdata,
const pjsip_tpselector *sel);
/**
* Clone pjsip_tx_data. This will duplicate the message contents of
* pjsip_tx_data (pjsip_tx_data.msg) and add reference count to the tdata.
* Once application has finished using the cloned pjsip_tx_data,
* it must release it by calling #pjsip_tx_data_dec_ref().
* Currently, this will only clone response message.
*
* @param src The source to be cloned.
* @param flags Optional flags. Must be zero for now.
* @param p_rdata Pointer to receive the cloned tdata.
*
* @return PJ_SUCCESS on success or the appropriate error.
*/
PJ_DECL(pj_status_t) pjsip_tx_data_clone(const pjsip_tx_data *src,
unsigned flags,
pjsip_tx_data **p_rdata);
/*****************************************************************************
*
* TRANSPORT
*
*****************************************************************************/
/**
* Type of callback to receive transport operation status.
*/
typedef void (*pjsip_transport_callback)(pjsip_transport *tp, void *token,
pj_ssize_t sent_bytes);
/**
* This structure describes transport key to be registered to hash table.
*/
typedef struct pjsip_transport_key
{
/**
* Transport type.
*/
long type;
/**
* Destination address.
*/
pj_sockaddr rem_addr;
} pjsip_transport_key;
/**
* Enumeration of transport direction types.
*/
typedef enum pjsip_transport_dir
{
PJSIP_TP_DIR_NONE, /**< Direction not set, normally used by
connectionless transports such as
UDP transport. */
PJSIP_TP_DIR_OUTGOING, /**< Outgoing connection or client mode,
this is only for connection-oriented
transports. */
PJSIP_TP_DIR_INCOMING, /**< Incoming connection or server mode,
this is only for connection-oriented
transports. */
} pjsip_transport_dir;
/**
* This structure represent the "public" interface of a SIP transport.
* Applications normally extend this structure to include transport
* specific members.
*/
struct pjsip_transport
{
char obj_name[PJ_MAX_OBJ_NAME]; /**< Name. */
pj_pool_t *pool; /**< Pool used by transport. */
pj_atomic_t *ref_cnt; /**< Reference counter. */
pj_lock_t *lock; /**< Lock object. */
pj_grp_lock_t *grp_lock; /**< Group lock for sync with
ioqueue and timer. */
pj_bool_t tracing; /**< Tracing enabled? */
pj_bool_t is_shutdown; /**< Being shutdown? */
pj_bool_t is_destroying; /**< Destroy in progress? */
/** Key for indexing this transport in hash table. */
pjsip_transport_key key;
char *type_name; /**< Type name. */
unsigned flag; /**< #pjsip_transport_flags_e */
char *info; /**< Transport info/description.*/
int addr_len; /**< Length of addresses. */
pj_sockaddr local_addr; /**< Bound address. */
pjsip_host_port local_name; /**< Published name (eg. STUN). */
pjsip_host_port remote_name; /**< Remote address name. */
pjsip_transport_dir dir; /**< Connection direction. */
pjsip_endpoint *endpt; /**< Endpoint instance. */
pjsip_tpmgr *tpmgr; /**< Transport manager. */
pjsip_tpfactory *factory; /**< Factory instance. Note: it
may be invalid/shutdown. */
pj_timer_entry idle_timer; /**< Timer when ref cnt is zero.*/
pj_timestamp last_recv_ts; /**< Last time receiving data. */
pj_size_t last_recv_len; /**< Last received data length. */
void *data; /**< Internal transport data. */
unsigned initial_timeout;/**< Initial timeout interval
to be applied to incoming
TCP/TLS transports when no
valid data received after
a successful connection. */
/**
* Function to be called by transport manager to send SIP message.
*
* @param transport The transport to send the message.
* @param packet The buffer to send.
* @param length The length of the buffer to send.
* @param op_key Completion token, which will be supplied to
* caller when pending send operation completes.
* @param rem_addr The remote destination address.
* @param addr_len Size of remote address.
* @param callback If supplied, the callback will be called
* once a pending transmission has completed. If
* the function completes immediately (i.e. return
* code is not PJ_EPENDING), the callback will not
* be called.
*
* @return Should return PJ_SUCCESS only if data has been
* succesfully queued to operating system for
* transmission. Otherwise it may return PJ_EPENDING
* if the underlying transport can not send the
* data immediately and will send it later, which in
* this case caller doesn't have to do anything
* except wait the calback to be called, if it
* supplies one.
* Other return values indicate the error code.
*/
pj_status_t (*send_msg)(pjsip_transport *transport,
pjsip_tx_data *tdata,
const pj_sockaddr_t *rem_addr,
int addr_len,
void *token,
pjsip_transport_callback callback);
/**
* Instruct the transport to initiate graceful shutdown procedure.
* After all objects release their reference to this transport,
* the transport will be deleted.
*
* Note that application MUST use #pjsip_transport_shutdown() instead.
*
* @param transport The transport.
*
* @return PJ_SUCCESS on success.
*/
pj_status_t (*do_shutdown)(pjsip_transport *transport);
/**
* Forcefully destroy this transport regardless whether there are
* objects that currently use this transport. This function should only
* be called by transport manager or other internal objects (such as the
* transport itself) who know what they're doing. Application should use
* #pjsip_transport_shutdown() instead.
*
* @param transport The transport.
*
* @return PJ_SUCCESS on success.
*/
pj_status_t (*destroy)(pjsip_transport *transport);
/*
* Application may extend this structure..
*/
};
/**
* Register a transport instance to the transport manager. This function
* is normally called by the transport instance when it is created
* by application.
*
* @param mgr The transport manager.
* @param tp The new transport to be registered.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_transport_register( pjsip_tpmgr *mgr,
pjsip_transport *tp );
/**
* Start graceful shutdown procedure for this transport. After graceful
* shutdown has been initiated, no new reference can be obtained for
* the transport. However, existing objects that currently uses the
* transport may still use this transport to send and receive packets.
*
* After all objects release their reference to this transport,
* the transport will be destroyed immediately.
*
* @param tp The transport.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_transport_shutdown(pjsip_transport *tp);
/**
* Start shutdown procedure for this transport. If \a force is false,
* the API is the same as #pjsip_transport_shutdown(), while
* if \a force is true, existing transport users will immediately
* receive PJSIP_TP_STATE_DISCONNECTED notification and should not
* use the transport anymore. In either case, transport will
* only be destroyed after all objects release their references.
*
* @param tp The transport.
* @param force Force transport to immediately send
* disconnection state notification.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_transport_shutdown2(pjsip_transport *tp,
pj_bool_t force);
/**
* Destroy a transport when there is no object currently uses the transport.
* This function is normally called internally by transport manager or the
* transport itself. Application should use #pjsip_transport_shutdown()
* instead.
*
* @param tp The transport instance.
*
* @return PJ_SUCCESS on success or the appropriate error code.
* Some of possible errors are PJSIP_EBUSY if the
* transport's reference counter is not zero.
*/
PJ_DECL(pj_status_t) pjsip_transport_destroy( pjsip_transport *tp);
/**
* Add reference counter to the specified transport. Any objects that wishes
* to keep the reference of the transport MUST increment the transport's
* reference counter to prevent it from being destroyed.
*
* @param tp The transport instance.
*
* @return PJ_SUCCESS on success or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_transport_add_ref( pjsip_transport *tp );
/**
* Decrement reference counter of the specified transport. When an object no
* longer want to keep the reference to the transport, it must decrement the
* reference counter. When the reference counter of the transport reaches
* zero, the transport manager will start the idle timer to destroy the
* transport if no objects acquire the reference counter during the idle
* interval.
*
* @param tp The transport instance.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_transport_dec_ref( pjsip_transport *tp );
/**
* This function is called by transport instances to report an incoming
* packet to the transport manager. The transport manager then would try to
* parse all SIP messages in the packet, and for each parsed SIP message, it
* would report the message to the SIP endpoint (#pjsip_endpoint).
*
* @param mgr The transport manager instance.
* @param rdata The receive data buffer containing the packet. The
* transport MUST fully initialize tp_info and pkt_info
* member of the rdata.
*
* @return The number of bytes successfully processed from the
* packet. If the transport is datagram oriented, the
* value will be equal to the size of the packet. For
* stream oriented transport (e.g. TCP, TLS), the value
* returned may be less than the packet size, if
* partial message is received. The transport then MUST
* keep the remainder part and report it again to
* this function once more data/packet is received.
*/
PJ_DECL(pj_ssize_t) pjsip_tpmgr_receive_packet(pjsip_tpmgr *mgr,
pjsip_rx_data *rdata);
/*****************************************************************************
*
* TRANSPORT FACTORY
*
*****************************************************************************/
/**
* A transport factory is normally used for connection oriented transports
* (such as TCP or TLS) to create instances of transports. It registers
* a new transport type to the transport manager, and the transport manager
* would ask the factory to create a transport instance when it received
* command from application to send a SIP message using the specified
* transport type.
*/
struct pjsip_tpfactory
{
/** This list is managed by transport manager. */
PJ_DECL_LIST_MEMBER(struct pjsip_tpfactory);
char obj_name[PJ_MAX_OBJ_NAME]; /**< Name. */
pj_pool_t *pool; /**< Owned memory pool. */
pj_lock_t *lock; /**< Lock object. */
pjsip_transport_type_e type; /**< Transport type. */
char *type_name; /**< Type string name. */
unsigned flag; /**< Transport flag. */
char *info; /**< Transport info/description.*/
pj_sockaddr local_addr; /**< Bound address. */
pjsip_host_port addr_name; /**< Published name. */
/**
* Create new outbound connection suitable for sending SIP message
* to specified remote address.
* Note that the factory is responsible for both creating the
* transport and registering it to the transport manager.
*/
pj_status_t (*create_transport)(pjsip_tpfactory *factory,
pjsip_tpmgr *mgr,
pjsip_endpoint *endpt,
const pj_sockaddr *rem_addr,
int addr_len,
pjsip_transport **transport);
/**
* Create new outbound connection suitable for sending SIP message
* to specified remote address by also considering outgoing SIP
* message data.
* Note that the factory is responsible for both creating the
* transport and registering it to the transport manager.
*/
pj_status_t (*create_transport2)(pjsip_tpfactory *factory,
pjsip_tpmgr *mgr,
pjsip_endpoint *endpt,
const pj_sockaddr *rem_addr,
int addr_len,
pjsip_tx_data *tdata,
pjsip_transport **transport);
/**
* Destroy the listener.
*/
pj_status_t (*destroy)(pjsip_tpfactory *factory);
/*
* Application may extend this structure..
*/
};
/**
* Register a transport factory.
*
* @param mgr The transport manager.
* @param tpf Transport factory.
*
* @return PJ_SUCCESS if listener was successfully created.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_register_tpfactory(pjsip_tpmgr *mgr,
pjsip_tpfactory *tpf);
/**
* Unregister factory.
*
* @param mgr The transport manager.
* @param tpf Transport factory.
*
* @return PJ_SUCCESS is sucessfully unregistered.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_unregister_tpfactory(pjsip_tpmgr *mgr,
pjsip_tpfactory *tpf);
/*****************************************************************************
*
* TRANSPORT MANAGER
*
*****************************************************************************/
/**
* Type of callback to be called when transport manager receives incoming
* SIP message.
*
* @param ep Endpoint.
* @param status Receiption status.
* @param rd Received packet.
*/
typedef void (*pjsip_rx_callback)(pjsip_endpoint *ep, pj_status_t status,
pjsip_rx_data *rd);
/**
* Type of callback to be called before transport manager is about
* to transmit SIP message.
*
* @param ep Endpoint.
* @param td Transmit data.
*/
typedef pj_status_t (*pjsip_tx_callback)(pjsip_endpoint *ep, pjsip_tx_data*td);
/**
* Create a transport manager. Normally application doesn't need to call
* this function directly, since a transport manager will be created and
* destroyed automatically by the SIP endpoint.
*
* @param pool Pool.
* @param endpt Endpoint instance.
* @param rx_cb Callback to receive incoming message.
* @param tx_cb Callback to be called before transport manager is sending
* outgoing message.
* @param p_mgr Pointer to receive the new transport manager.
*
* @return PJ_SUCCESS or the appropriate error code on error.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_create( pj_pool_t *pool,
pjsip_endpoint * endpt,
pjsip_rx_callback rx_cb,
pjsip_tx_callback tx_cb,
pjsip_tpmgr **p_mgr);
/**
* Find out the appropriate local address info (IP address and port) to
* advertise in Contact header based on the remote address to be
* contacted. The local address info would be the address name of the
* transport or listener which will be used to send the request.
*
* In this implementation, it will only select the transport based on
* the transport type in the request.
*
* @see pjsip_tpmgr_find_local_addr2()
*
* @param tpmgr The transport manager.
* @param pool Pool to allocate memory for the IP address.
* @param type Destination address to contact.
* @param sel Optional pointer to prefered transport, if any.
* @param ip_addr Pointer to receive the IP address.
* @param port Pointer to receive the port number.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_find_local_addr( pjsip_tpmgr *tpmgr,
pj_pool_t *pool,
pjsip_transport_type_e type,
const pjsip_tpselector *sel,
pj_str_t *ip_addr,
int *port);
/**
* Parameter for pjsip_tpmgr_find_local_addr2() function.
*/
typedef struct pjsip_tpmgr_fla2_param
{
/**
* Specify transport type to use. This must be set.
*/
pjsip_transport_type_e tp_type;
/**
* Optional pointer to preferred transport, if any.
*/
const pjsip_tpselector *tp_sel;
/**
* Destination host, if known. The destination host is needed
* if \a local_if field below is set.
*/
pj_str_t dst_host;
/**
* Specify if the function should return which local interface
* to use for the specified destination in \a dst_host. By definition,
* the returned address will always be local interface address.
*/
pj_bool_t local_if;
/**
* The returned address.
*/
pj_str_t ret_addr;
/**
* The returned port.
*/
pj_uint16_t ret_port;
/**
* Returned pointer to the transport. Only set if local_if is set.
*/
const void *ret_tp;
} pjsip_tpmgr_fla2_param;
/**
* Initialize with default values.
*
* @param prm The parameter to be initialized.
*/
PJ_DECL(void) pjsip_tpmgr_fla2_param_default(pjsip_tpmgr_fla2_param *prm);
/**
* Find out the appropriate local address info (IP address and port) to
* advertise in Contact or Via header header based on the remote address
* to be contacted. The local address info would be the address name of the
* transport or listener which will be used to send the request.
*
* @see pjsip_tpmgr_find_local_addr()
*
* @param tpmgr The transport manager.
* @param pool Pool to allocate memory for the IP address.
* @param prm Function input and output parameters.
*
* @return PJ_SUCCESS, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_find_local_addr2(pjsip_tpmgr *tpmgr,
pj_pool_t *pool,
pjsip_tpmgr_fla2_param *prm);
/**
* Return number of transports currently registered to the transport
* manager.
*
* @param mgr The transport manager.
*
* @return Number of transports.
*/
PJ_DECL(unsigned) pjsip_tpmgr_get_transport_count(pjsip_tpmgr *mgr);
/**
* Destroy a transport manager. Normally application doesn't need to call
* this function directly, since a transport manager will be created and
* destroyed automatically by the SIP endpoint.
*
* @param mgr The transport manager.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_destroy(pjsip_tpmgr *mgr);
/**
* Dump transport info and status to log.
*
* @param mgr The transport manager.
*/
PJ_DECL(void) pjsip_tpmgr_dump_transports(pjsip_tpmgr *mgr);
/**
* Parameter for pjsip_tpmgr_shutdown_all() function.
*/
typedef struct pjsip_tpmgr_shutdown_param
{
/**
* Specify whether disconnection state notification should be sent
* immediately, see pjsip_transport_shutdown2() for more info.
*
* Default: PJ_TRUE.
*/
pj_bool_t force;
/**
* Specify whether UDP transports should also be shutdown.
*
* Default: PJ_TRUE.
*/
pj_bool_t include_udp;
} pjsip_tpmgr_shutdown_param;
/**
* Initialize transports shutdown parameter with default values.
*
* @param prm The parameter to be initialized.
*/
PJ_DECL(void) pjsip_tpmgr_shutdown_param_default(
pjsip_tpmgr_shutdown_param *prm);
/**
* Shutdown all transports. This basically invokes pjsip_transport_shutdown2()
* on all transports.
*
* @param mgr The transport manager.
* @param param The function parameters.
*
* @return PJ_SUCCESS on success.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_shutdown_all(
pjsip_tpmgr *mgr,
const pjsip_tpmgr_shutdown_param *param);
/*****************************************************************************
*
* PUBLIC API
*
*****************************************************************************/
/**
* Find transport to be used to send message to remote destination. If no
* suitable transport is found, a new one will be created.
*
* This is an internal function since normally application doesn't have access
* to transport manager. Application should use pjsip_endpt_acquire_transport()
* instead.
*
* @param mgr The transport manager instance.
* @param type The type of transport to be acquired.
* @param remote The remote address to send message to.
* @param addr_len Length of the remote address.
* @param sel Optional pointer to transport selector instance which is
* used to find explicit transport, if required.
* @param tp Pointer to receive the transport instance, if one is found.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport(pjsip_tpmgr *mgr,
pjsip_transport_type_e type,
const pj_sockaddr_t *remote,
int addr_len,
const pjsip_tpselector *sel,
pjsip_transport **tp);
/**
* Find suitable transport for sending SIP message to specified remote
* destination by also considering the outgoing SIP message. If no suitable
* transport is found, a new one will be created.
*
* This is an internal function since normally application doesn't have access
* to transport manager. Application should use pjsip_endpt_acquire_transport2()
* instead.
*
* @param mgr The transport manager instance.
* @param type The type of transport to be acquired.
* @param remote The remote address to send message to.
* @param addr_len Length of the remote address.
* @param sel Optional pointer to transport selector instance which is
* used to find explicit transport, if required.
* @param tdata Optional pointer to data to be sent.
* @param tp Pointer to receive the transport instance, if one is found.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_acquire_transport2(pjsip_tpmgr *mgr,
pjsip_transport_type_e type,
const pj_sockaddr_t *remote,
int addr_len,
const pjsip_tpselector *sel,
pjsip_tx_data *tdata,
pjsip_transport **tp);
/**
* Type of callback to receive notification when message or raw data
* has been sent.
*
* @param token The token that was given when calling the function
* to send message or raw data.
* @param tdata The transmit buffer used to send the message.
* @param bytes_sent Number of bytes sent. On success, the value will be
* positive number indicating the number of bytes sent.
* On failure, the value will be a negative number of
* the error code (i.e. bytes_sent = -status).
*/
typedef void (*pjsip_tp_send_callback)(void *token, pjsip_tx_data *tdata,
pj_ssize_t bytes_sent);
/**
* This is a low-level function to send a SIP message using the specified
* transport to the specified destination.
*
* @param tr The SIP transport to be used.
* @param tdata Transmit data buffer containing SIP message.
* @param addr Destination address.
* @param addr_len Length of destination address.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/
PJ_DECL(pj_status_t) pjsip_transport_send( pjsip_transport *tr,
pjsip_tx_data *tdata,
const pj_sockaddr_t *addr,
int addr_len,
void *token,
pjsip_tp_send_callback cb);
/**
* This is a low-level function to send raw data to a destination.
*
* See also #pjsip_endpt_send_raw() and #pjsip_endpt_send_raw_to_uri().
*
* @param mgr Transport manager.
* @param tp_type Transport type.
* @param sel Optional pointer to transport selector instance if
* application wants to use a specific transport instance
* rather then letting transport manager finds the suitable
* transport.
* @param tdata Optional transmit data buffer to be used. If this value
* is NULL, this function will create one internally. If
* tdata is specified, this function will decrement the
* reference counter upon completion.
* @param raw_data The data to be sent.
* @param data_len The length of the data.
* @param addr Destination address.
* @param addr_len Length of destination address.
* @param token Arbitrary token to be returned back to callback.
* @param cb Optional callback to be called to notify caller about
* the completion status of the pending send operation.
*
* @return If the message has been sent successfully, this function
* will return PJ_SUCCESS and the callback will not be
* called. If message cannot be sent immediately, this
* function will return PJ_EPENDING, and application will
* be notified later about the completion via the callback.
* Any statuses other than PJ_SUCCESS or PJ_EPENDING
* indicates immediate failure, and in this case the
* callback will not be called.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_send_raw(pjsip_tpmgr *mgr,
pjsip_transport_type_e tp_type,
const pjsip_tpselector *sel,
pjsip_tx_data *tdata,
const void *raw_data,
pj_size_t data_len,
const pj_sockaddr_t *addr,
int addr_len,
void *token,
pjsip_tp_send_callback cb);
/**
* Enumeration of transport state types.
*/
typedef enum pjsip_transport_state
{
PJSIP_TP_STATE_CONNECTED, /**< Transport connected, applicable only
to connection-oriented transports
such as TCP and TLS. */
PJSIP_TP_STATE_DISCONNECTED, /**< Transport disconnected, applicable
only to connection-oriented
transports such as TCP and TLS. */
PJSIP_TP_STATE_SHUTDOWN, /**< Transport shutdown, either
due to TCP/TLS disconnect error
from the network, or when shutdown
is initiated by PJSIP itself. */
PJSIP_TP_STATE_DESTROY, /**< Transport destroy, when transport
is about to be destroyed. */
} pjsip_transport_state;
/**
* Definition of transport state listener key.
*/
typedef void pjsip_tp_state_listener_key;
/**
* Structure of transport state info passed by #pjsip_tp_state_callback.
*/
typedef struct pjsip_transport_state_info {
/**
* The last error code related to the transport state.
*/
pj_status_t status;
/**
* Optional extended info, the content is specific for each transport type.
*/
void *ext_info;
/**
* Optional user data. In global transport state notification, this will
* always be NULL.
*/
void *user_data;
} pjsip_transport_state_info;
/**
* Type of callback to receive transport state notifications, such as
* transport connected/disconnected. Application may shutdown the transport
* in this callback.
*
* @param tp The transport instance.
* @param state The transport state.
* @param info The transport state info.
*/
typedef void (*pjsip_tp_state_callback)(
pjsip_transport *tp,
pjsip_transport_state state,
const pjsip_transport_state_info *info);
/**
* Set callback of global transport state notification. The caller will be
* notified whenever the state of any transport is changed. The type of events
* are defined in #pjsip_transport_state.
*
* Note that this function will override the existing callback, if any, so
* application is recommended to keep the old callback and manually forward
* the notification to the old callback, otherwise other component that
* concerns about the transport state will no longer receive transport state
* events.
*
* @param mgr Transport manager.
* @param cb Callback to be called to notify caller about transport
* state changing.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_set_state_cb(pjsip_tpmgr *mgr,
pjsip_tp_state_callback cb);
/**
* Get the callback of global transport state notification.
*
* @param mgr Transport manager.
*
* @return The transport state callback or NULL if it is not set.
*/
PJ_DECL(pjsip_tp_state_callback) pjsip_tpmgr_get_state_cb(
const pjsip_tpmgr *mgr);
/**
* Add a listener to the specified transport for transport state notification.
*
* @param tp The transport.
* @param cb Callback to be called to notify listener about transport
* state changing.
* @param user_data The user data.
* @param key Output key, used to remove this listener.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_transport_add_state_listener (
pjsip_transport *tp,
pjsip_tp_state_callback cb,
void *user_data,
pjsip_tp_state_listener_key **key);
/**
* Remove a listener from the specified transport for transport state
* notification.
*
* @param tp The transport.
* @param key The listener key.
* @param user_data The user data, for validation purpose.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_transport_remove_state_listener (
pjsip_transport *tp,
pjsip_tp_state_listener_key *key,
const void *user_data);
/**
* Structure of dropped received data.
*/
typedef struct pjsip_tp_dropped_data
{
/**
* The transport receiving the data.
*/
pjsip_transport *tp;
/**
* The data.
*/
void *data;
/**
* The data length.
* If the status field below indicates an invalid SIP message
* (PJSIP_EINVALIDMSG) and application detects a SIP message
* at position p, it can pass the data back to PJSIP to be processed
* by setting the len to p. This can be useful for apps which
* wishes to use the same transport for SIP signalling and non-SIP
* purposes (such as SIP outbound using STUN message).
*/
pj_size_t len;
/**
* The status or reason of drop. For example, a leading newlines (common
* keep-alive packet) will be dropped with status PJ_EIGNORED, an invalid
* SIP message will have status PJSIP_EINVALIDMSG, a SIP message overflow
* will have status PJSIP_ERXOVERFLOW.
*/
pj_status_t status;
} pjsip_tp_dropped_data;
/**
* Type of callback to data dropping notifications.
*
* @param data The dropped data.
*/
typedef void (*pjsip_tp_on_rx_dropped_cb)(pjsip_tp_dropped_data *data);
/**
* Set callback of data dropping. The caller will be notified whenever any
* received data is dropped (due to leading newlines or keep-alive packet or
* invalid SIP message). This callback can be useful for application,
* for example, to implement custom keep-alive mechanism or connection
* availability detection.
*
* @param mgr Transport manager.
* @param cb The callback function, set to NULL to reset the callback.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_set_drop_data_cb(pjsip_tpmgr *mgr,
pjsip_tp_on_rx_dropped_cb cb);
/**
* Structure of received data that will be passed to data received
* notification callback.
*/
typedef struct pjsip_tp_rx_data
{
/**
* The transport receiving the data.
*/
pjsip_transport *tp;
/**
* The data.
*/
void *data;
/**
* The data length.
* If application wishes to discard some data of len p, it can pass
* the remaining data back to PJSIP to be processed by setting the len
* to (len - p).
* If application wants to shutdown the transport from within the
* callback (for example after if finds out that the data is
* suspicious/garbage), app must set the len to zero to prevent
* further processing of the data.
*/
pj_size_t len;
} pjsip_tp_rx_data;
/**
* Type of callback to data received notifications.
*
* @param data The received data.
*/
typedef pj_status_t (*pjsip_tp_on_rx_data_cb)(pjsip_tp_rx_data *data);
/**
* Set callback to be called whenever any data is received by a stream
* oriented transport. This can be useful for application to do its own
* verification, filtering, or logging of potential malicious activities.
*
* @param mgr Transport manager.
* @param cb The callback function, set to NULL to reset the callback.
*
* @return PJ_SUCCESS on success, or the appropriate error code.
*/
PJ_DECL(pj_status_t) pjsip_tpmgr_set_recv_data_cb(pjsip_tpmgr *mgr,
pjsip_tp_on_rx_data_cb cb);
/**
* @}
*/
PJ_END_DECL
#endif /* __PJSIP_SIP_TRANSPORT_H__ */
```
|
```javascript
/**
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
'use strict';
// MODULES //
var sqrt = require( '@stdlib/math/base/special/sqrt' );
// MAIN //
/**
* Computes the Euclidean distance between two vectors.
*
* @private
* @param {NonNegativeInteger} N - number of elements
* @param {NumericArray} X - strided array
* @param {PositiveInteger} strideX - stride
* @param {NonNegativeInteger} offsetX - index offset
* @param {NumericArray} Y - strided array
* @param {PositiveInteger} strideY - stride
* @param {NonNegativeInteger} offsetY - index offset
* @returns {number} Euclidean distance
*/
function euclidean( N, X, strideX, offsetX, Y, strideY, offsetY ) { // TODO: remove and use BLAS implementation
var xi;
var yi;
var d;
var s;
var i;
xi = offsetX;
yi = offsetY;
s = 0.0;
for ( i = 0; i < N; i++ ) {
d = X[ xi ] - Y[ yi ];
s += d * d;
xi += strideX;
yi += strideY;
}
return sqrt( s );
}
// EXPORTS //
module.exports = euclidean;
```
|
is a Japanese smartphone game developed by Line Games and Marvelous Entertainment, where players collect and fight with various anthropomorphized guns. It was released on Android and iOS devices in March 2018. An anime television series adaptation by TMS Entertainment and Double Eagle aired from July 3 to September 25, 2018. The game's official support ended on October 31, 2019.
Characters
Aleksandr
Ekaterina
Hall
Karl
Leopold
Margarita
Kiseru
Cane
Cutlery
Furusato
Kinbee
Media
Manga
A manga adaptation illustrated by Miki Daichi launched in June 2018 on Kadokawa Shoten's Young Ace magazine. In October 2019, it was announced that the manga would end on December 4. As of December 2019, two tankōbon volumes has been released.
Anime
Kenichi Kasai directed the anime at TMS Entertainment and Double Eagle. Takashi Aoshima is the series supervisor, Majiro is the character designer, and Hiroshi Takaki composed the music. The opening theme is "antique memory" by Taku Yashiro and Yoshiki Nakajima, and the ending theme is "BLACK MATRIX" by vistlip. Sentai Filmworks have licensed the anime and streamed it on Hidive. The series ran for 12 episodes. An OVA episode was released on March 6, 2019.
Notes
References
External links
2018 video games
Android (operating system) games
Anime television series based on video games
Fictional firearms
IOS games
Japan-exclusive video games
Kadokawa Shoten manga
Manga based on video games
Marvelous Entertainment
Seinen manga
Sentai Filmworks
TMS Entertainment
Video games developed in Japan
|
The Black Tavern is a 1972 Hong Kong wuxia film directed by Teddy Yip and produced by the Shaw Brothers Studio, starring Shih Szu.
Cast
Shih Szu as Zhang Caibing
Tung Li as Zha Xiaoyu
Ku Feng as Zheng Shoushan
Kong Ling as Jinglu
Kwok Chuk-hing as Jinghong
Barry Chan as Jinghu
Yeung Chi-hing as Hai Gangfeng
Dean Shek as wandering monk
Wang Hsieh as Gao Sanfeng
Yue Fung as Sanniang, a robber and daughter of the inn owner
Situ Lin as Doggie
Law Hon as tavern cook
Lee Ho as Iron Arm Liu Tong
Wu Ma as leader of Xiangxi Five Ghosts
Yau Ming as Three-headed Cobra
Chiang Nan as skilled robber
Liu Wai as Hu
Chan Chan-kong as Hu's partner
Yeung Chak-lam as robber
Chu Gam as Tai'an
Unicorn Chan as Three-headed Cobra
Yuen Wah as Xiangxi Ghost
Sa Au as Xiangxi Ghost / constable
Ho Kei-cheong as constable
Mars as Official Hai's servant
Jackie Chan as Official Hai's servant
Ling Hon as restaurant book keeper
Yi Fung as waiter
Cheung Hei as restaurant guest
Wong Yuet-ting as restaurant guest
Gam Tin-chue as restaurant guest
References
External links
The Black Tavern on Hong Kong Cinemagic
1972 films
Hong Kong martial arts films
1970s action films
1970s Mandarin-language films
Shaw Brothers Studio films
Wuxia films
1970s Hong Kong films
|
The Denley Limestone is a geologic formation in New York. It preserves fossils dating back to the Ordovician period.
See also
List of fossiliferous stratigraphic units in New York
References
Ordovician geology of New York (state)
|
```smalltalk
using System.Reflection;
namespace UnityEditor.ShaderGraph
{
[Title("Math", "Trigonometry", "Arcsine")]
public class ArcsineNode : CodeFunctionNode
{
public ArcsineNode()
{
name = "Arcsine";
}
public override string documentationURL
{
get { return "path_to_url"; }
}
protected override MethodInfo GetFunctionToConvert()
{
return GetType().GetMethod("Unity_Arcsine", BindingFlags.Static | BindingFlags.NonPublic);
}
static string Unity_Arcsine(
[Slot(0, Binding.None)] DynamicDimensionVector In,
[Slot(1, Binding.None)] out DynamicDimensionVector Out)
{
return
@"
{
Out = asin(In);
}
";
}
}
}
```
|
```smalltalk
// Xavalon. All rights reserved.
using System;
namespace Xavalon.XamlStyler.Extension.Windows.Extensions
{
public static class StringExtensions
{
public static bool IsNullOrEmpty(this string self)
{
return String.IsNullOrEmpty(self);
}
public static bool IsNullOrWhiteSpace(this string self)
{
return String.IsNullOrWhiteSpace(self);
}
}
}
```
|
```ruby
# frozen_string_literal: true
require_relative "../base"
require_relative "../events/event"
module Fusuma
module Plugin
module Detectors
# Inherite this base
class Detector < Base
def initialize(*args)
super
@tag = self.class.tag
@type = self.class.type
end
attr_reader :tag
attr_reader :type
# @return [Array<String>]
def sources
@sources ||= self.class.const_get(:SOURCES)
end
# Always watch buffers and detect them or not
# @return [TrueClass,FalseClass]
def watch?
false
end
# @param _buffers [Array<Buffer>]
# @return [Event] if event is detected
# @return [NilClass] if event is NOT detected
def detect(_buffers)
raise NotImplementedError, "override #{self.class.name}##{__method__}"
# create_event(record:)
end
# @param record [Events::Records::Record]
# @return [Events::Event]
def create_event(record:)
@last_time = Time.now
Events::Event.new(time: @last_time, tag: tag, record: record)
end
def last_time
@last_time ||= Time.now
end
def first_time?
@last_time.nil?
end
class << self
def tag
name.split("Detectors::").last.underscore
end
def type(tag_name = tag)
tag_name.gsub("_detector", "")
end
end
end
end
end
end
```
|
```html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>windows::overlapped_handle::assign (1 of 2 overloads)</title>
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../boost_asio.html" title="Boost.Asio">
<link rel="up" href="../assign.html" title="windows::overlapped_handle::assign">
<link rel="prev" href="../assign.html" title="windows::overlapped_handle::assign">
<link rel="next" href="overload2.html" title="windows::overlapped_handle::assign (2 of 2 overloads)">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="path_to_url">People</a></td>
<td align="center"><a href="path_to_url">FAQ</a></td>
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="boost_asio.reference.windows__overlapped_handle.assign.overload1"></a><a class="link" href="overload1.html" title="windows::overlapped_handle::assign (1 of 2 overloads)">windows::overlapped_handle::assign
(1 of 2 overloads)</a>
</h5></div></div></div>
<p>
Assign an existing native handle to the handle.
</p>
<pre class="programlisting">void assign(
const native_handle_type & handle);
</pre>
</div>
<table xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
file LICENSE_1_0.txt or copy at <a href="path_to_url" target="_top">path_to_url
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="../assign.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../assign.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../boost_asio.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="overload2.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
```
|
```xml
declare const _default: import("react").ComponentType<any>;
export default _default;
//# sourceMappingURL=NativeVideoView.d.ts.map
```
|
Melochia corchorifolia, the chocolateweed, is a weedy tropical plant that is typically seen in the wastelands. It has been most frequently observed to grow in open areas, such as highways. Although Melochia corchorifolia does not have any common usage, it has been utilized as a homeopathic remedy. Its weedy and invasive characteristic inhibits its wider cultivation.
Distribution
Melochia corchorifolia is common in the Southeastern regions of the United States. It has been observed to grow from North Carolina to all the way south into Mississippi. In addition, it is prevalent in tropical areas of Africa, Asia and Australia. Sunny or dimly shaded humid regions of riversides, lakesides are its familiar natural habitats. This plant also grows typically as weed in cotton, soybean and rice plants.
Morphology
Melochia corchorifolia has ovate leaves; the petioles are generally 5 cm long with linear stipules of 6 mm long. The veins extend to be from 7 cm long to 5 cm long.
This plant is an annual or perennial type of herb. It usually develops to be up to 1.3–2.0 m tall; stem with line of stellate hairs. It’s simple, ovate leaves are normally arranged spirally with the margins very intensely serrated. The blade of the leaves range from narrow to broad to the tip, measures up to 7.5 cm × 5.5 cm.
Flowers and fruit
The inflorescence of Melochia corchorifolia comprises crowded cymes with linear bracts. This plant species has flowers of 5 green sepals. The flower of Melochia corchorifolia is purple, with 5 petals, 5–7 mm long. Flowers are bisexual, regular with calyx campanulate of 3 mm long. It is also short-teethed and consists of petals of 8 mm long, white with yellow base inside. The stamens are fused close to the top of the filaments. This purple flower has superior ovary with 5 styles joint at the base. The flowering occurs from July to October.
The fruit contains a 5-valved capsule which measures up to 5 mm in diameter. It holds very few seed, approximately 1 seed per locule. The seeds are wrinkled and brown, about 2.0 – 2.5 mm long in length. Fruits usually develop from September to December.
Reproduction
The proliferation is completed via seed. It is often thought that germination can be better significantly by scarification. With scarified seed, germination is done at temperatures of 35–40 °C. Additionally, Melochia corchorifolia L is observed to be a host of fungal diseases, such as Rhizoctonia solani.
Usage
Melochia corchorifolia was used as a source of fibre for making dillybags and other objects in the north-central Arnhem Land region. It was noted as a source of very strong fibre. is not utilized for decoration or food purposes. However, it contains several phytochemical features. For example, its leaves have been analyzed to have triterpenes (friedelin, friedelinol and β-amyrin), flavonol glycosides (hibifolin, triflin and melocorin), aliphatic compounds, flavonoids (vitexin and robunin), β-D-sitosterol β-D-glucoside and alkaloids. These naturally occurring alkaloids help in plant growth and contains nitrogen.
Food
The leaves of Melochia corchorifolia are consumed as a potherb in West Africa and southern Africa. The cooked leaves present a popular, slimy side-dish in Malawi. Such utilization of the leaves are also quite common in Indo-China and India. Additionally, the stems are used for tying bundles and are used in the construction of roofs of houses.
The dried leaves of Melochia corchorifolia L have been shown to have high crude amount of protein, as well as small amounts of lipids. It also contains critical dietary minerals such as potassium, calcium and magnesium.
Medicinal
The leaves have traditionally been utilized for several remedies. For example, it was used to reduce ulcers, abdominal swelling, and headache and chest pain. Among other benefits of the plants, its roots and leaves can help with snakebites, sores and the sap can be treated on wounds due to Antaris.
References
External links
Byttnerioideae
Plants described in 1753
Taxa named by Carl Linnaeus
|
```php
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Console\Formatter;
use Symfony\Component\Console\Exception\InvalidArgumentException;
use Symfony\Contracts\Service\ResetInterface;
/**
* @author Jean-Franois Simon <contact@jfsimon.fr>
*/
class OutputFormatterStyleStack implements ResetInterface
{
/**
* @var OutputFormatterStyleInterface[]
*/
private $styles;
private $emptyStyle;
public function __construct(?OutputFormatterStyleInterface $emptyStyle = null)
{
$this->emptyStyle = $emptyStyle ?? new OutputFormatterStyle();
$this->reset();
}
/**
* Resets stack (ie. empty internal arrays).
*/
public function reset()
{
$this->styles = [];
}
/**
* Pushes a style in the stack.
*/
public function push(OutputFormatterStyleInterface $style)
{
$this->styles[] = $style;
}
/**
* Pops a style from the stack.
*
* @return OutputFormatterStyleInterface
*
* @throws InvalidArgumentException When style tags incorrectly nested
*/
public function pop(?OutputFormatterStyleInterface $style = null)
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
if (null === $style) {
return array_pop($this->styles);
}
foreach (array_reverse($this->styles, true) as $index => $stackedStyle) {
if ($style->apply('') === $stackedStyle->apply('')) {
$this->styles = \array_slice($this->styles, 0, $index);
return $stackedStyle;
}
}
throw new InvalidArgumentException('Incorrectly nested style tag found.');
}
/**
* Computes current style with stacks top codes.
*
* @return OutputFormatterStyle
*/
public function getCurrent()
{
if (empty($this->styles)) {
return $this->emptyStyle;
}
return $this->styles[\count($this->styles) - 1];
}
/**
* @return $this
*/
public function setEmptyStyle(OutputFormatterStyleInterface $emptyStyle)
{
$this->emptyStyle = $emptyStyle;
return $this;
}
/**
* @return OutputFormatterStyleInterface
*/
public function getEmptyStyle()
{
return $this->emptyStyle;
}
}
```
|
"And the Sun Will Shine" is a song by the British rock band Bee Gees, it was written by Barry Gibb, Robin Gibb and Maurice Gibb and released in February 1968 on the album Horizontal. The song's opening chord was D7, consisting of the notes D, F, A, and C.
It was released as a single in France backed with "Really and Sincerely" and reached #66 there.
Background and recording
The earliest session for Horizontal was really just a demo date to tape rough versions of the brothers' new songs. Venturing to Denmark Street (known as London's Tin Pan Alley), the Bee Gees booked Central Sound for July 17, quickly cutting several tracks.
Barry Gibb recalls about the recording of this track:
Robin Gibb said:
This song was the second track they recorded for the album after "Ring My Bell" (which was only released on the 2006 deluxe edition of Horizontal). This song was recorded on July 17 and 30, continued on August 1 and 10 and finally finished on October 28, The second version of this song was recorded on July 25 but it was rejected. This song has a solo vocal that Robin famously did in one take, inventing some of the lyrics on the spot.
Personnel
Robin Gibb – vocal
Barry Gibb – guitar
Maurice Gibb – bass, piano
Vince Melouney – guitar
Colin Petersen – drums
Live performances
The first live performances of this song were in 1968 most notably on 4 February 1968 on the US TV show The Smothers Brothers, their first American performance. Other notable recorded performances were at Melbourne, Australia in 1974 on their Mr. Natural tour and a short excerpt on the 1998 live album One Night Only.
Chart performance
Paul Jones version
In the same year, former Manfred Mann frontman Paul Jones recorded the song and released his version as a single, backed with his own song "The Dog Presides".
With Paul McCartney on drums, Jeff Beck on guitar, Paul Samwell-Smith of The Yardbirds on bass and Nicky Hopkins on keyboards, it was produced by Peter Asher, formerly of Peter and Gordon. McCartney's contribution was not credited on Columbia release of the song. Recorded at Abbey Road Studios' Studio 2. Asher had asked McCartney to attend the session and he ended up playing drums on the song.
On the liner notes of The Paul Jones Collection (CD), Jones claimed that "Paul McCartney was on drums on that session, It was during the time I used
to hang out with Peter Asher and Paul wanted to play drums because he could".
Personnel
Paul Jones – lead vocal/harmonica
Jeff Beck – guitar
Paul Samwell-Smith – bass
Nicky Hopkins – keyboards
Paul McCartney – drums
Jose Feliciano version
Puerto Rican singer Jose Feliciano released a cover of the song as a single in August 1969 on RCA Records backed with his own composition "Rain". The Feliciano version ranked 25th in UK Hit Parade. This version peaked at #25 in the UK but notably features Feliciano singing "The thought to me is back and how near" as opposed to "'Cause love to me is life and I live you", an example of a Mondegreen.
References
1968 songs
Bee Gees songs
Songs written by Barry Gibb
Songs written by Robin Gibb
Songs written by Maurice Gibb
Demis Roussos songs
Song recordings produced by Robert Stigwood
Song recordings produced by Barry Gibb
Song recordings produced by Robin Gibb
Song recordings produced by Maurice Gibb
Songs about loneliness
Rock ballads
|
The 2009 Fergana Challenger was a professional tennis tournament played on outdoor hard courts. It was part of the 2009 ATP Challenger Tour. It took place in Fergana, Uzbekistan between May 18 and May 23, 2009.
Singles entrants
Seeds
Rankings are as of May 11, 2009.
Other entrants
The following players received wildcards into the singles main draw:
Rifat Biktyakov
Murad Inoyatov
Sergei Shipilov
Vaja Uzakov
The following players received entry from the qualifying draw:
Evgeny Kirillov
Purav Raja
Artem Sitak
Kittipong Wachiramanowong
Champions
Singles
Lukáš Lacko vs Samuel Groth, 4–6, 7–5, 7–6(4)
Doubles
Pavel Chekhov / Alexey Kedryuk vs Pierre-Ludovic Duclos / Aisam-ul-Haq Qureshi, 4–6, 6–3, [10–5]
References
External links
Official website
ITF search
Fergana Challenger
Fergana Challenger
|
Smilovtsi is a village in Gabrovo Municipality, in Gabrovo Province, in northern central Bulgaria.
References
Villages in Gabrovo Province
|
Rose Hall is a community in the East Berbice-Corentyne Region of Guyana. Rose Hall is 14 miles east of New Amsterdam.
History
Rose Hall was once owned by Dutch planters and later purchased by former slaves. In 1908, it acquired village status; and it wasn't until 1970 that it became a town. Rose Hall has an area of 13 km2 and a population of about 8,000.
Rose Hall is divided into three wards: Middle Rose Hall, East Rose Hall and Williamsburg.
Points of interest
Rose Hall is a hub for the surrounding areas where people buy raw materials for clothing and grocery in the Berbice region. Two banks and stores lined the main public roads. Most of the stores are clothing stores and grocery stores. The Welfare Centre Ground is a cricket ground that formerly held first-class cricket matches.
Notable people
Nezam Hafiz (1969–2001), Guyanese-American cricketer, killed in the September 11, 2001 attacks on New York City.
Godfrey Edwards (born 1959), Dutch cricketer of Guyanese origin.
Assad Fudadin Guyanese West Indies cricket player
References
Populated places in East Berbice-Corentyne
|
Gall (; 550 646) according to hagiographic tradition was a disciple and one of the traditional twelve companions of Columbanus on his mission from Ireland to the continent. However, he may have originally come from the border region between Lorraine and Alemannia and only met Columbanus at the monastery of Luxeuil in the Vosges. Gall is known as a representative of the Irish monastic tradition. The Abbey of Saint Gall in the city of Saint Gallen, Switzerland was built upon his original hermitage. Deicolus was the elder brother of Gall.
Biography
The fragmentary oldest Life was recast in the 9th century by two monks of Reichenau, enlarged in 816–824 by Wettinus, and about 833–884 by Walafrid Strabo, who also revised a book of the miracles of the saint. Other works ascribed to Walafrid tell of Saint Gall in prose and verse.
Gall's origin is a matter of dispute. According to his 9th-century biographers in Reichenau, he was from Ireland and entered Europe as a companion of Columbanus. The Irish origin of the historical Gallus was called into question by Hilty (2001), who proposed it as more likely that he was from the Vosges or Alsace region. Schär (2010) proposed that Gall may have been of Irish descent but born and raised in the Alsace.
According to the 9th-century hagiographies, Gall as a young man went to study under Comgall of Bangor Abbey. The monastery at Bangor had become renowned throughout Europe as a great centre of Christian learning. Studying in Bangor at the same time as Gall was Columbanus, who with twelve companions, set out about the year 589.
Gall and his companions established themselves with Columbanus at first at Luxeuil in Gaul. In 610, Columbanus was exiled by leaders opposed to Christianity and fled with Gall to Alemannia. He accompanied Columbanus on his voyage up the Rhine River to Bregenz but when in 612 Columbanus travelled on to Italy from Bregenz, Gall had to remain behind due to illness and was nursed at Arbon. He remained in Alemannia, where, with several companions, he led the life of a hermit in the forests southwest of Lake Constance, near the source of the river Steinach. Cells were soon added for twelve monks whom Gall carefully instructed. Gall was soon known in Switzerland as a powerful preacher.
When the See of Constance became vacant, the clergy who assembled to elect a new bishop were unanimously in favour of Gall. He, however, refused, pleading that the election of a stranger would be contrary to church law. Some time later, in the year 625, on the death of Eustasius, abbott of Luxeuil, a monastery founded by Columbanus, members of that community were sent by the monks to request Gall to undertake the government of the monastery. He refused to quit his life of solitude, and undertake any office of rank which might involve him in the cares of the world. He was then an old man.
He died at the age of ninety-five around 646–650 in Arbon.
Legends
From as early as the 9th century a series of fantastically embroidered Lives of Saint Gall were circulated. Prominent was the story in which Gall delivered Fridiburga from the demon by which she was possessed. Fridiburga was the betrothed of Sigebert II, King of the Franks, who had granted an estate at Arbon (which belonged to the royal treasury) to Gall so that he might found a monastery there.
Another popular story has it that as Gall was travelling in the woods of what is now Switzerland he was sitting one evening warming his hands at a fire. A bear emerged from the woods and charged. The holy man rebuked the bear, so awed by his presence it stopped its attack and slunk off to the trees. There it gathered firewood before returning to share the heat of the fire with Gall. The legend says that for the rest of his days Gall was followed around by his companion the bear.
Veneration
His feast is celebrated on 16 October.
Iconography
Images of Saint Gall typically represent him standing with a bear.
Legacy
When Columbanus, Gall and their companions left Ireland for mainland Europe, they took with them learning and the written word.
Their effect on the historical record was significant as the books were painstakingly reproduced on vellum by monks across Europe. Many of the Irish texts destroyed in Ireland during Viking raids were preserved in Abbeys across the channel.
Abbey of St. Gall
For several decades after his death, Gall's hermit cell remained; his disciples remained together in the cell he had built and followed the rule of St. Columban, combining prayer with work of the hands and reading with teaching. In 719, St. Otmar, the brotherhood's first abbot, extended Gall's cell into the Abbey of St. Gall, which became the nucleus of the Canton of St. Gallen in eastern Switzerland. The abbey followed the rule of St. Benedict of Nursia beginning in 747. As many as 53 monks joined the order under St. Otmar and the community grew to acquire land in Thurgau, the region of Zurich and Alemannia, up to the River Neckar. In the second half of the 8th century, the community continued to grow but became legally dependent on the Bishop of Constance. After an extended conflict with the see of Constance, the Abbey of St. Gallen regained its independence in the 9th century when Emperor Louis the Pious made it a royal monastery. The Abbey's monastery and especially its celebrated scriptorium (evidenced from 760 onwards) played an illustrious part in Catholic and intellectual history until it was secularised in 1798. It is very likely that Gall kept a small library of books for himself and his disciples for their liturgical worship. Following his death and the establishment of his tomb, the brotherhood of priests gathered there likely added to this small collection of books. These books would become the basis for the Abbey Library of Saint Gall.
In popular culture
St Gall is the name of a wheel shaped hard cheese made from the milk of Friesian cows, which won a Gold Medal at the World Cheese Awards held in Dublin 2008.
Robertson Davies, in his book, The Manticore, interprets the legend in Jungian psychological terms. In the final scene of the novel where David Staunton is celebrating Christmas with Lizelloti Fitziputli, Magnus Eisengrim, and Dunstan Ramsay he is given a gingerbread bear. Ramsay explains that Gall made a pact of peace with a bear who was terrorizing the citizens of the nearby village. They would feed him gingerbread and he would refrain from eating them. The parable is presented as a Jungian exhortation to make peace with one's dark side. This Jungian interpretation is however incompatible with Catholic Orthodoxy which Gall promoted.
See also
List of Orthodox saints
List of Roman Catholic saints
Notes
Bibliography
Joynt, Maud, tr. and ed., The Life of St Gall, Llanerch Press, Burnham-on-Sea, 1927.
Schär, Max, Gallus. Der Heikiger in seiner Zeit, Schwabe Verlag, Basle, 2011.
Schmid, Christian, Gallusland. Auf den Spuren des heiligen Gallus, Paulus Verlag, Fribourg, 2011.
Music and musicians in medieval Irish society, Ann Buckley, pp. 165–190, Early Music xxviii, no.2, May 2000
Music in Prehistoric and Medieval Ireland, Ann Buckley, pp. 744–813, in A New History of Ireland, volume one, Oxford, 2005
External links
The Origins of Traditional Irish Music
Orthodox Icons of St Gall
St. Gall, Abbot at the Christian Iconography web site.
550 births
640s deaths
7th-century Frankish saints
Abbey of Saint Gall
Medieval Irish musicians
6th-century Irish priests
Medieval Irish saints
Medieval Irish saints on the Continent
Irish expatriates in France
Irish expatriates in Germany
Irish expatriates in Italy
Colombanian saints
6th-century Irish writers
7th-century Irish writers
People from Arbon
Year of birth uncertain
Year of death uncertain
|
```php
<?php
namespace classes\exceptions_002;
class A extends \Exception
{}
class B extends \Exception
{}
try
{
throw new B;
}
catch (A|B|C $ex)
{
echo "A|B|C hit\n";
}
finally
{
echo "finally\n";
}
echo "Done.";
```
|
```prolog
# !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
# This file is machine-generated by lib/unicore/mktables from the Unicode
# database, Version 15.0.0. Any changes made here will be lost!
# !!!!!!! INTERNAL PERL USE ONLY !!!!!!!
# This file is for internal use by core Perl only. The format and even the
# name or existence of this file are subject to change without notice. Don't
# use it directly. Use Unicode::UCD to access the Unicode character data
# base.
return <<'END';
V12
46
47
8216
8218
8228
8229
65106
65107
65287
65288
65294
65295
END
```
|
Robert Ross Johnstone (April 7, 1926 – December 31, 2009) was a Canadian professional ice hockey player who played 42 games in the National Hockey League with the Toronto Maple Leafs during the 1943–44 and 1944–45 seasons. In 1945 his name was put on the Stanley Cup. He was born in Montreal, Quebec.
Career statistics
Regular season and playoffs
External links
1926 births
2009 deaths
Atlantic City Sea Gulls (EHL) players
Canadian ice hockey defencemen
Detroit Hettche players
Ice hockey people from Montreal
New Haven Ramblers players
Oshawa Generals players
Pittsburgh Hornets players
Providence Reds players
Springfield Indians players
Stanley Cup champions
Toronto Maple Leafs players
Toronto Marlboros players
|
This is a list of people from Barnsley, a town in South Yorkshire, England. This list is arranged alphabetically by surname:
A
John Arden (1930–2012), playwright
Maggie Atkinson, the Children's Commissioner for England
B
Alan Barton (1953–1995), singer
Josh Bates (1996–), professional speedway rider
Mark Beevers (1989–), footballer, Peterborough United, formerly Sheffield Wednesday, Millwall, Bolton Wanderers
Mike Betts (1956–), retired professional footballer
Dickie Bird (1933–), international cricket umpire
Dai Bradley, actor, Billy Casper in Ken Loach's film Kes
Joseph Bramah (1748–1814), inventor of flushing water closet, Bramah lock and the beer pump
Pete Brown (1968–), beer writer and columnist
Stan Burton (1912–1977), former Wolverhampton Wanderers player, played in 1939 FA Cup Final
C
John Casken (1949-), composer
Ed Clancy (1985–), professional cyclist
Tom Clare (1999–), a footballer and television contestant on 2023 Love Island series nine.
Jay Clayton (1990-), Musician and songwriter in the band Crywank
Wilf Copping (1909–1980), footballer, played for England 20 times
Mark Crossley (1969–), former Nottingham Forest, Fulham and Sheffield Wednesday and Chesterfield goalkeeper.
Nick Crowe (1968–), artist
D
Shaun Dooley, actor
Alan Doonican II, comedy folk-musician - accordionist/keyboardist in The Bar-Steward Sons of Val Doonican
Scott Doonican, comedy folk-musician - lead vocalist/guitarist with The Bar-Steward Sons of Val Doonican
Björn Doonicansson, comedy folk-musician - banjo/mandolin/fiddle player with The Bar-Steward Sons of Val Doonican
Kenny Doughty, actor
John Duttine (1949–), actor
E
Leonard Knight Elmhirst (1893–1974), philanthropist
Air Marshal Sir Thomas Elmhirst (1895–1982), Commander-in-Chief Royal Indian Air Force, Lieutenant-Governor and Commander-in-Chief of Guernsey
Bethany England, (1994-), English footballer, 2019/2020 Player of the Year, plays for Chelsea in the FA WSL and England
F
Joann Fletcher, Egyptologist
Toby Foster, Radio Sheffield presenter, comedian and actor
G
Brian Glover (1934–1997), actor
Darren Gough (1970–), cricketer
Brian Greenhoff (1953–2013), footballer, Manchester United and Leeds United
Jimmy Greenhoff (1946–), footballer, Manchester United and Leeds United
H
Alan Hill (footballer, born 1943) (1943-), footballer
Charlie Hardcastle (1894–1960), boxer
Joanne Harris (1964–), novelist, Chocolat
Paul Heckingbottom (1977–), born in Barnsley, an English former footballer, played for Barnsley 2006–2008, and was the team manager from 2016–2018.
Barry Hines (1939 - 2016), author of A Kestrel for a Knave, among other works.
David Hirst (1967–), England international footballer, played for Barnsley before joining Sheffield Wednesday
Stephanie Hirst (1976–), radio presenter, former host of hit40uk on commercial radio throughout the UK
Geoff Horsfield (1973–), professional footballer turned coach
Alan Hydes (1947-), International table tennis player and 4 times Commonwealth gold medal winner
Dorothy Hyman (1941–), sprinter
I
Graham Ibbeson, sculptor, artist, responsible for statue outside NUM Head Offices, Barnsley, and Eric Morecambe statue in Morecambe
J
Ashley Jackson, artist
Admiral of the Fleet, Sir Henry Bradwardine Jackson (1855–1929), GCB, FRS, first Sea Lord, 1915–1916; pioneer of ship to ship wireless technology
Milly Johnson (1964–), author
Mark Jones (1933–1958), one of the eight Manchester United players killed in the Munich air disaster
K
Katherine Kelly (1980–present), actress, played Becky Granger in ITV soap opera Coronation Street
James Kitchenman (1825-1909), carpet manufacturer
L
Ethel Lang (1900–2015), supercentenarian
Davey Lawrence (1985–), ice hockey netminder playing for the Sheffield Steelers
Joseph Locke (1805–1860), civil engineer
Stephen Lodge (1952–), former Premier League referee; retired from top-flight officiating at the end of the 2000–01 season
M
Danny Malin, (1980–), Internet celebrity and food reviewer
Baron Mason of Barnsley (1924–2015), former Northern Ireland Secretary
John Mayock (1970–), former 1500m runner, member of Team GB, 3000m gold medallist at the 1998 European Athletics Indoor Championships
Mick McCarthy (1959–), footballer, manager of Ipswich Town F.C. and Republic of Ireland national football team (1996–2002, 2018–)
Paul McCue (1958–), author and military historian
David McLintock (1930–2003), philologist and German translator
Ian McMillan (1956–), the Bard of Barnsley
CJ de Mooi, former panellist on quiz show Eggheads
Chris Morgan (1977–), ex-professional football player; formerly played for the town's football club; now a coach at Sheffield United
Martyn Moxon (1960–), cricketer who played for Yorkshire and played in 10 test matches for England
Jenni Murray (1950–), journalist and broadcaster, current presenter of Woman's Hour on BBC Radio 4
N
Sam Nixon (1986–), came 3rd on Pop Idol 2003; singer and television co-host
Victoria Nixon, model and writer
O
Richard O'Dwyer, university student, creator of TV Shack; in the process of extradition to the US on charges of conspiracy to commit copyright infringement and criminal infringement of copyright
Craig Oldham (born 1985), designer
Julie O'Neill, novelist. Born in Staincross in 1971.
P
Jon Parkin (1981–), professional footballer, playing for York City F.C.; nicknamed 'The Beast'
Michael Parkinson (1935–2023), talk show host, journalist and television presenter
R
William Rayner (1929-2006), novelist
Stan Richards (1930–2005), actor
Danny Rose (1993–), football player for Northampton Town, previously played for Barnsley, Bury and Mansfield Town.
Kate Rusby (1973–), folk singer
Oliver Rowland (1992-), racecar driver
S
Mary Sadler, Lady Sadler (1852–1931), heiress and hostess
Arthur Scargill (1938–), leader of the National Union of Mineworkers, 1981-2000; founded the Socialist Labour Party in 1996, currently the party's leader
Harry Leslie Smith (1923–2018), author of Harry's Last Stand (2014), and autobiographical works.
Danielle Steers (1991–) English stage actress and singer-songwriter
John Stones, (1994–), English footballer, currently plays for Manchester City and England national football team.
T
James Hudson Taylor (1832–1905), Protestant Christian missionary to China; founder of the China Inland Mission (now OMF International)
Tommy Taylor (1932–1958), professional footballer, one of the 'Busby Babes' (or Manchester United under the management of Matt Busby) who was killed in the Munich air disaster
W
Obadiah Walker (1616–1699), academic and Master of University College, Oxford from 1676 to 1688
Charlie Williams (1928–2006), ex-professional footballer and stand-up comedian
David Williams (born 1948), cricketer
Harry Worth (1917–1989), actor, comedian and ventriloquist
Celia Wray (1872-1954), architect and suffragette
Sarah Walker (born 1965/66), music broadcaster, musician and writer
References
Barnsley
People from Barnsley
|
```python
#
#
# path_to_url
#
# Unless required by applicable law or agreed to in writing, software
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
"""Test Transformer model."""
from absl import logging
from absl.testing import parameterized
import numpy as np
import tensorflow as tf, tf_keras
from tensorflow.python.distribute import combinations
from tensorflow.python.distribute import strategy_combinations
from official.nlp.modeling.layers import attention
from official.nlp.modeling.models import seq2seq_transformer
class Seq2SeqTransformerTest(tf.test.TestCase, parameterized.TestCase):
def _build_model(
self,
padded_decode,
decode_max_length,
embedding_width,
self_attention_cls=None,
cross_attention_cls=None,
):
num_layers = 1
num_attention_heads = 2
intermediate_size = 32
vocab_size = 100
encdec_kwargs = dict(
num_layers=num_layers,
num_attention_heads=num_attention_heads,
intermediate_size=intermediate_size,
activation="relu",
dropout_rate=0.01,
attention_dropout_rate=0.01,
use_bias=False,
norm_first=True,
norm_epsilon=1e-6,
intermediate_dropout=0.01)
encoder_layer = seq2seq_transformer.TransformerEncoder(**encdec_kwargs)
decoder_layer = seq2seq_transformer.TransformerDecoder(
**encdec_kwargs,
self_attention_cls=self_attention_cls,
cross_attention_cls=cross_attention_cls
)
return seq2seq_transformer.Seq2SeqTransformer(
vocab_size=vocab_size,
embedding_width=embedding_width,
dropout_rate=0.01,
padded_decode=padded_decode,
decode_max_length=decode_max_length,
beam_size=4,
alpha=0.6,
encoder_layer=encoder_layer,
decoder_layer=decoder_layer)
@combinations.generate(
combinations.combine(
distribution=[
strategy_combinations.default_strategy,
strategy_combinations.cloud_tpu_strategy,
],
embed=[True, False],
is_training=[True, False],
custom_self_attention=[False, True],
custom_cross_attention=[False, True],
mode="eager"))
def test_create_model_with_ds(
self,
distribution,
embed,
is_training,
custom_self_attention,
custom_cross_attention,
):
self_attention_called = False
cross_attention_called = False
class SelfAttention(attention.CachedAttention):
"""Dummy implementation of custom attention."""
def __call__(
self, *args, **kwargs
):
nonlocal self_attention_called
self_attention_called = True
return super().__call__(*args, **kwargs)
class CrossAttention:
"""Dummy implementation of custom attention."""
def __init__(self, *args, **kwargs):
pass
def __call__(self, query, value, attention_mask, **kwargs):
nonlocal cross_attention_called
cross_attention_called = True
return query
with distribution.scope():
padded_decode = isinstance(
distribution,
(tf.distribute.TPUStrategy, tf.distribute.experimental.TPUStrategy))
decode_max_length = 10
batch_size = 4
embedding_width = 16
model = self._build_model(
padded_decode,
decode_max_length,
embedding_width,
self_attention_cls=SelfAttention if custom_self_attention else None,
cross_attention_cls=CrossAttention
if custom_cross_attention
else None,
)
@tf.function
def step(inputs):
def _step_fn(inputs):
return model(inputs)
outputs = distribution.run(_step_fn, args=(inputs,))
return tf.nest.map_structure(distribution.experimental_local_results,
outputs)
if embed:
fake_inputs = dict(
embedded_inputs=np.zeros(
(batch_size, decode_max_length, embedding_width),
dtype=np.float32),
input_masks=np.ones((batch_size, decode_max_length), dtype=bool))
else:
fake_inputs = dict(
inputs=np.zeros((batch_size, decode_max_length), dtype=np.int32))
if is_training:
fake_inputs["targets"] = np.zeros((batch_size, 8), dtype=np.int32)
local_outputs = step(fake_inputs)
logging.info("local_outputs=%s", local_outputs)
self.assertEqual(local_outputs[0].shape, (4, 8, 100))
else:
local_outputs = step(fake_inputs)
logging.info("local_outputs=%s", local_outputs)
self.assertEqual(local_outputs["outputs"][0].shape, (4, 10))
self.assertEqual(self_attention_called, custom_self_attention)
self.assertEqual(cross_attention_called, custom_cross_attention)
@parameterized.parameters(True, False)
def test_create_savedmodel(self, padded_decode):
decode_max_length = 10
embedding_width = 16
model = self._build_model(
padded_decode, decode_max_length, embedding_width)
class SaveModule(tf.Module):
def __init__(self, model):
super(SaveModule, self).__init__()
self.model = model
@tf.function
def serve(self, inputs):
return self.model.call(dict(inputs=inputs))
@tf.function
def embedded_serve(self, embedded_inputs, input_masks):
return self.model.call(
dict(embedded_inputs=embedded_inputs, input_masks=input_masks))
save_module = SaveModule(model)
if padded_decode:
tensor_shape = (4, decode_max_length)
embedded_tensor_shape = (4, decode_max_length, embedding_width)
else:
tensor_shape = (None, None)
embedded_tensor_shape = (None, None, embedding_width)
signatures = dict(
serving_default=save_module.serve.get_concrete_function(
tf.TensorSpec(shape=tensor_shape, dtype=tf.int32, name="inputs")),
embedded_serving=save_module.embedded_serve.get_concrete_function(
tf.TensorSpec(
shape=embedded_tensor_shape, dtype=tf.float32,
name="embedded_inputs"),
tf.TensorSpec(
shape=tensor_shape, dtype=tf.bool, name="input_masks"),
))
tf.saved_model.save(save_module, self.get_temp_dir(), signatures=signatures)
if __name__ == "__main__":
tf.test.main()
```
|
```c++
#include "disk_index_stats.h"
#include "idiskindex.h"
namespace searchcorespi::index {
DiskIndexStats::DiskIndexStats()
: IndexSearchableStats(),
_indexDir()
{
}
DiskIndexStats::DiskIndexStats(const IDiskIndex &index)
: IndexSearchableStats(index),
_indexDir(index.getIndexDir())
{
}
DiskIndexStats::~DiskIndexStats()
{
}
}
```
|
```html
<div ng-controller='StoreController as store'>
<div class="siteHeading">
<h1>Welcome to our {{store.store}}, {{store.username}} </h1>
<div class="logoutLink">
<a href="/#/logout">Logout</a>
</div>
</div>
<div class="storeMain">
<section>
<h2> Our Products </h2>
Search: <input ng-model='query'>
<table style="width: 500px;">
<tr><th style="width: 260px;">Name</th><th style="width: 100px;">Price</th><th>Quantity</th><th> </th></tr>
<tr ng-repeat='nextProduct in store.products | filter:query' ng-class-odd="'oddRow'" ng-class-even="'evenRow'">
<td class="storeProductName">{{nextProduct.name}}</td>
<td class="storePriceCell">${{nextProduct.cost}}</td>
<td style="text-align: center;"><input type="number" style="width: 20px;" ng-model="nextProduct.quantity"/></td>
<td class="buttonCell"><button style="background-color: {{store.buttonColor}}; color: {{store.textColor}}" ng-click="store.addToCart(nextProduct)">Buy</button></td></tr>
</tr>
</table>
</section>
<br/>
<div class="newProductModal" ng-controller='ProductController as product' ng-init="product.setStore(store)">
<form class="productForm">
<label>Product Name: </label> <input ng-model='product.name'> <br />
<label>Cost : </label> <input ng-model='product.cost'> <br />
</form>
<button ng-click='product.submit()'>Submit</button>
<p ng-show='product.errorMessage != ""'>Error: {{product.errorMessage}} </p>
</div>
<br/>
<section>
<h2>Cart</h2>
<span ng-if="store.cart.length === 0">Your cart is empty</span>
<table ng-if="store.cart.length > 0" style="width: 500px;">
<tr><th style="width: 260px;">Name</th><th style="width: 100px;">Price</th><th>Quantity</th><th> </th></tr>
<tr ng-repeat='nextProduct in store.cart' ng-class-odd="'oddRow'" ng-class-even="'evenRow'">
<td class="storeProductName">{{nextProduct.name}}</td><td class="storePriceCell">${{nextProduct.cost}}</td><td style="text-align: center;">{{nextProduct.quantity}}</td><td class="buttonCell"><button ng-click="store.removeFromCart(nextProduct)">Remove</button></td></tr>
</tr>
</table>
</section>
</div>
</div>
```
|
```makefile
################################################################################
#
# sg3_utils
#
################################################################################
SG3_UTILS_VERSION = 1.40
SG3_UTILS_SOURCE = sg3_utils-$(SG3_UTILS_VERSION).tar.xz
SG3_UTILS_SITE = path_to_url
SG3_UTILS_LICENSE = BSD-3c
# utils progs are GPLv2+ licenced
ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),y)
SG3_UTILS_LICENSE += GPLv2+
endif
SG3_UTILS_LICENSE_FILES = COPYING BSD_LICENSE
# install the libsgutils2 library
SG3_UTILS_INSTALL_STAGING = YES
ifeq ($(BR2_PACKAGE_SG3_UTILS_PROGS),)
define SG3_UTILS_REMOVE_PROGS
for prog in \
compare_and_write copy_results dd decode_sense \
emc_trespass format get_config \
get_lba_status ident inq logs luns map26 \
map sgm_dd modes opcodes sgp_dd persist prevent \
raw rbuf rdac read readcap read_block_limits \
read_buffer read_long reassign referrals \
rep_zones requests reset reset_wp rmsn rtpg safte sanitize \
sat_identify sat_phy_event sat_read_gplog sat_set_features \
scan senddiag ses ses_microcode start stpg sync test_rwbuf \
turs unmap verify vpd write_buffer write_long \
write_same write_verify wr_mode xcopy; do \
$(RM) $(TARGET_DIR)/usr/bin/sg_$${prog} ; \
done
for prog in \
logging_level mandat readcap ready satl start stop \
temperature; do \
$(RM) $(TARGET_DIR)/usr/bin/scsi_$${prog} ; \
done
for prog in \
sginfo sgm_dd sgp_dd; do \
$(RM) $(TARGET_DIR)/usr/bin/$${prog}; \
done
endef
SG3_UTILS_POST_INSTALL_TARGET_HOOKS += SG3_UTILS_REMOVE_PROGS
endif
$(eval $(autotools-package))
```
|
Carrosserie Clément-Rothschild produced a series of Clément-Rothschild bodied automobiles in 1902, based on the Panhard-Levassor 7 hp chassis.
History
Carrosserie Clément-Rothschild were based at 33 Quai Michelet, Levallois-Perret, either adjacent to or in Adolphe Clément-Bayard's Levallois-Perret factory.
By 1903 a Clément-Talbot Type CT4K 18hp four cylinder was described as 'Coachwork by J.Rothschild et Fils, Paris'.
See also
Adolphe Clément-Bayard
Notes
References
External links
Image of 1903 Clement-Talbot Type CT4K at Bonhams auction. 18HP Four cylinder, 'Roi-D'Italie Tonneau. Coachwork by J.Rothschild et Fils, Paris Registration no. AP 107. Sold for £606,300
Defunct motor vehicle manufacturers of France
Vehicle manufacturing companies established in 1902
Manufacturing companies based in Paris
Vintage vehicles
Brass Era vehicles
|
Miraflores (Catamarca) is a village and municipality in Catamarca Province in northwestern Argentina.
References
Populated places in Catamarca Province
|
```c++
/*
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "Purity.h"
#include <algorithm>
#include <iterator>
#include <sstream>
#include <vector>
#include <sparta/WeakTopologicalOrdering.h>
#include "ConfigFiles.h"
#include "ControlFlow.h"
#include "DexClass.h"
#include "EditableCfgAdapter.h"
#include "IRInstruction.h"
#include "Resolver.h"
#include "Show.h"
#include "StlUtil.h"
#include "Timer.h"
#include "Trace.h"
#include "Walkers.h"
#include "WorkQueue.h"
namespace {
constexpr double kWtoOrderingThreshold = 50.0;
} // namespace
std::ostream& operator<<(std::ostream& o, const CseLocation& l) {
switch (l.special_location) {
case CseSpecialLocations::GENERAL_MEMORY_BARRIER:
o << "*";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_INT:
o << "(int[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_BYTE:
o << "(byte[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_CHAR:
o << "(char[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_WIDE:
o << "(long|double[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_SHORT:
o << "(short[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_OBJECT:
o << "(Object[])[.]";
break;
case CseSpecialLocations::ARRAY_COMPONENT_TYPE_BOOLEAN:
o << "(boolean[])[.]";
break;
default:
o << SHOW(l.field);
break;
}
return o;
}
std::ostream& operator<<(std::ostream& o, const CseUnorderedLocationSet& ls) {
o << "{";
bool first = true;
for (const auto& l : ls) {
if (first) {
first = false;
} else {
o << ", ";
}
o << l;
}
o << "}";
return o;
}
CseLocation get_field_location(IROpcode opcode, const DexField* field) {
always_assert(opcode::is_an_ifield_op(opcode) ||
opcode::is_an_sfield_op(opcode));
if (field != nullptr && !is_volatile(field)) {
return CseLocation(field);
}
return CseLocation(CseSpecialLocations::GENERAL_MEMORY_BARRIER);
}
CseLocation get_field_location(IROpcode opcode, const DexFieldRef* field_ref) {
always_assert(opcode::is_an_ifield_op(opcode) ||
opcode::is_an_sfield_op(opcode));
DexField* field = resolve_field(field_ref, opcode::is_an_sfield_op(opcode)
? FieldSearch::Static
: FieldSearch::Instance);
return get_field_location(opcode, field);
}
CseLocation get_read_array_location(IROpcode opcode) {
switch (opcode) {
case OPCODE_AGET:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_INT);
case OPCODE_AGET_BYTE:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_BYTE);
case OPCODE_AGET_CHAR:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_CHAR);
case OPCODE_AGET_WIDE:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_WIDE);
case OPCODE_AGET_SHORT:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_SHORT);
case OPCODE_AGET_OBJECT:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_OBJECT);
case OPCODE_AGET_BOOLEAN:
return CseLocation(CseSpecialLocations::ARRAY_COMPONENT_TYPE_BOOLEAN);
default:
not_reached();
}
}
CseLocation get_read_location(const IRInstruction* insn) {
if (opcode::is_an_aget(insn->opcode())) {
return get_read_array_location(insn->opcode());
} else if (opcode::is_an_iget(insn->opcode()) ||
opcode::is_an_sget(insn->opcode())) {
return get_field_location(insn->opcode(), insn->get_field());
} else {
return CseLocation(CseSpecialLocations::GENERAL_MEMORY_BARRIER);
}
}
static const std::string_view pure_method_names[] = {
"Ljava/lang/Boolean;.booleanValue:()Z",
"Ljava/lang/Boolean;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Boolean;.getBoolean:(Ljava/lang/String;)Z",
"Ljava/lang/Boolean;.hashCode:()I",
"Ljava/lang/Boolean;.toString:()Ljava/lang/String;",
"Ljava/lang/Boolean;.toString:(Z)Ljava/lang/String;",
"Ljava/lang/Boolean;.valueOf:(Z)Ljava/lang/Boolean;",
"Ljava/lang/Boolean;.valueOf:(Ljava/lang/String;)Ljava/lang/Boolean;",
"Ljava/lang/Byte;.byteValue:()B",
"Ljava/lang/Byte;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Byte;.toString:()Ljava/lang/String;",
"Ljava/lang/Byte;.toString:(B)Ljava/lang/String;",
"Ljava/lang/Byte;.valueOf:(B)Ljava/lang/Byte;",
"Ljava/lang/Character;.valueOf:(C)Ljava/lang/Character;",
"Ljava/lang/Character;.charValue:()C",
"Ljava/lang/Class;.getName:()Ljava/lang/String;",
"Ljava/lang/Class;.getSimpleName:()Ljava/lang/String;",
"Ljava/lang/Double;.compare:(DD)I",
"Ljava/lang/Double;.doubleValue:()D",
"Ljava/lang/Double;.doubleToLongBits:(D)J",
"Ljava/lang/Double;.doubleToRawLongBits:(D)J",
"Ljava/lang/Double;.floatValue:()F",
"Ljava/lang/Double;.hashCode:()I",
"Ljava/lang/Double;.intValue:()I",
"Ljava/lang/Double;.isInfinite:(D)Z",
"Ljava/lang/Double;.isNaN:(D)Z",
"Ljava/lang/Double;.longBitsToDouble:(J)D",
"Ljava/lang/Double;.longValue:()J",
"Ljava/lang/Double;.toString:(D)Ljava/lang/String;",
"Ljava/lang/Double;.valueOf:(D)Ljava/lang/Double;",
"Ljava/lang/Enum;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Enum;.name:()Ljava/lang/String;",
"Ljava/lang/Enum;.ordinal:()I",
"Ljava/lang/Enum;.toString:()Ljava/lang/String;",
"Ljava/lang/Float;.doubleValue:()D",
"Ljava/lang/Float;.floatToRawIntBits:(F)I",
"Ljava/lang/Float;.floatValue:()F",
"Ljava/lang/Float;.compare:(FF)I",
"Ljava/lang/Float;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Float;.hashCode:()I",
"Ljava/lang/Float;.intBitsToFloat:(I)F",
"Ljava/lang/Float;.intValue:()I",
"Ljava/lang/Float;.floatToIntBits:(F)I",
"Ljava/lang/Float;.isInfinite:(F)Z",
"Ljava/lang/Float;.isNaN:(F)Z",
"Ljava/lang/Float;.valueOf:(F)Ljava/lang/Float;",
"Ljava/lang/Float;.toString:(F)Ljava/lang/String;",
"Ljava/lang/Integer;.bitCount:(I)I",
"Ljava/lang/Integer;.byteValue:()B",
"Ljava/lang/Integer;.compareTo:(Ljava/lang/Integer;)I",
"Ljava/lang/Integer;.doubleValue:()D",
"Ljava/lang/Integer;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Integer;.hashCode:()I",
"Ljava/lang/Integer;.highestOneBit:(I)I",
"Ljava/lang/Integer;.intValue:()I",
"Ljava/lang/Integer;.longValue:()J",
"Ljava/lang/Integer;.lowestOneBit:(I)I",
"Ljava/lang/Integer;.numberOfLeadingZeros:(I)I",
"Ljava/lang/Integer;.numberOfTrailingZeros:(I)I",
"Ljava/lang/Integer;.shortValue:()S",
"Ljava/lang/Integer;.signum:(I)I",
"Ljava/lang/Integer;.toBinaryString:(I)Ljava/lang/String;",
"Ljava/lang/Integer;.toHexString:(I)Ljava/lang/String;",
"Ljava/lang/Integer;.toString:()Ljava/lang/String;",
"Ljava/lang/Integer;.toString:(I)Ljava/lang/String;",
"Ljava/lang/Integer;.toString:(II)Ljava/lang/String;",
"Ljava/lang/Integer;.valueOf:(I)Ljava/lang/Integer;",
"Ljava/lang/Long;.bitCount:(J)I",
"Ljava/lang/Long;.compareTo:(Ljava/lang/Long;)I",
"Ljava/lang/Long;.doubleValue:()D",
"Ljava/lang/Long;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Long;.hashCode:()I",
"Ljava/lang/Long;.intValue:()I",
"Ljava/lang/Long;.highestOneBit:(J)J",
"Ljava/lang/Long;.longValue:()J",
"Ljava/lang/Long;.numberOfTrailingZeros:(J)I",
"Ljava/lang/Long;.signum:(J)I",
"Ljava/lang/Long;.toBinaryString:(J)Ljava/lang/String;",
"Ljava/lang/Long;.toHexString:(J)Ljava/lang/String;",
"Ljava/lang/Long;.toString:()Ljava/lang/String;",
"Ljava/lang/Long;.toString:(J)Ljava/lang/String;",
"Ljava/lang/Long;.valueOf:(J)Ljava/lang/Long;",
"Ljava/lang/Math;.IEEEremainder:(DD)D",
"Ljava/lang/Math;.abs:(J)J",
"Ljava/lang/Math;.abs:(I)I",
"Ljava/lang/Math;.abs:(F)F",
"Ljava/lang/Math;.abs:(D)D",
"Ljava/lang/Math;.acos:(D)D",
"Ljava/lang/Math;.asin:(D)D",
"Ljava/lang/Math;.atan:(D)D",
"Ljava/lang/Math;.atan2:(DD)D",
"Ljava/lang/Math;.cbrt:(D)D",
"Ljava/lang/Math;.ceil:(D)D",
"Ljava/lang/Math;.copySign:(FF)F",
"Ljava/lang/Math;.copySign:(DD)D",
"Ljava/lang/Math;.cos:(D)D",
"Ljava/lang/Math;.cosh:(D)D",
"Ljava/lang/Math;.exp:(D)D",
"Ljava/lang/Math;.expm1:(D)D",
"Ljava/lang/Math;.floor:(D)D",
"Ljava/lang/Math;.floorDiv:(II)I",
"Ljava/lang/Math;.floorDiv:(JJ)J",
"Ljava/lang/Math;.floorMod:(JJ)J",
"Ljava/lang/Math;.floorMod:(II)I",
"Ljava/lang/Math;.getExponent:(D)I",
"Ljava/lang/Math;.getExponent:(F)I",
"Ljava/lang/Math;.hypot:(DD)D",
"Ljava/lang/Math;.log:(D)D",
"Ljava/lang/Math;.log10:(D)D",
"Ljava/lang/Math;.log1p:(D)D",
"Ljava/lang/Math;.max:(II)I",
"Ljava/lang/Math;.max:(JJ)J",
"Ljava/lang/Math;.max:(FF)F",
"Ljava/lang/Math;.max:(DD)D",
"Ljava/lang/Math;.min:(FF)F",
"Ljava/lang/Math;.min:(DD)D",
"Ljava/lang/Math;.min:(II)I",
"Ljava/lang/Math;.min:(JJ)J",
"Ljava/lang/Math;.nextAfter:(DD)D",
"Ljava/lang/Math;.nextAfter:(FD)F",
"Ljava/lang/Math;.nextDown:(D)D",
"Ljava/lang/Math;.nextDown:(F)F",
"Ljava/lang/Math;.nextUp:(F)F",
"Ljava/lang/Math;.nextUp:(D)D",
"Ljava/lang/Math;.pow:(DD)D",
"Ljava/lang/Math;.random:()D",
"Ljava/lang/Math;.rint:(D)D",
"Ljava/lang/Math;.round:(D)J",
"Ljava/lang/Math;.round:(F)I",
"Ljava/lang/Math;.scalb:(FI)F",
"Ljava/lang/Math;.scalb:(DI)D",
"Ljava/lang/Math;.signum:(D)D",
"Ljava/lang/Math;.signum:(F)F",
"Ljava/lang/Math;.sin:(D)D",
"Ljava/lang/Math;.sinh:(D)D",
"Ljava/lang/Math;.sqrt:(D)D",
"Ljava/lang/Math;.tan:(D)D",
"Ljava/lang/Math;.tanh:(D)D",
"Ljava/lang/Math;.toDegrees:(D)D",
"Ljava/lang/Math;.toRadians:(D)D",
"Ljava/lang/Math;.ulp:(D)D",
"Ljava/lang/Math;.ulp:(F)F",
"Ljava/lang/Object;.getClass:()Ljava/lang/Class;",
"Ljava/lang/Short;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/Short;.shortValue:()S",
"Ljava/lang/Short;.toString:(S)Ljava/lang/String;",
"Ljava/lang/Short;.valueOf:(S)Ljava/lang/Short;",
"Ljava/lang/String;.compareTo:(Ljava/lang/String;)I",
"Ljava/lang/String;.compareToIgnoreCase:(Ljava/lang/String;)I",
"Ljava/lang/String;.concat:(Ljava/lang/String;)Ljava/lang/String;",
"Ljava/lang/String;.endsWith:(Ljava/lang/String;)Z",
"Ljava/lang/String;.equals:(Ljava/lang/Object;)Z",
"Ljava/lang/String;.equalsIgnoreCase:(Ljava/lang/String;)Z",
"Ljava/lang/String;.hashCode:()I",
"Ljava/lang/String;.indexOf:(I)I",
"Ljava/lang/String;.isEmpty:()Z",
"Ljava/lang/String;.indexOf:(Ljava/lang/String;)I",
"Ljava/lang/String;.indexOf:(II)I",
"Ljava/lang/String;.indexOf:(Ljava/lang/String;I)I",
"Ljava/lang/String;.lastIndexOf:(I)I",
"Ljava/lang/String;.lastIndexOf:(II)I",
"Ljava/lang/String;.lastIndexOf:(Ljava/lang/String;)I",
"Ljava/lang/String;.lastIndexOf:(Ljava/lang/String;I)I",
"Ljava/lang/String;.length:()I",
"Ljava/lang/String;.replace:(CC)Ljava/lang/String;",
"Ljava/lang/String;.startsWith:(Ljava/lang/String;)Z",
"Ljava/lang/String;.startsWith:(Ljava/lang/String;I)Z",
"Ljava/lang/String;.toLowerCase:()Ljava/lang/String;",
"Ljava/lang/String;.toLowerCase:(Ljava/util/Locale;)Ljava/lang/String;",
"Ljava/lang/String;.toString:()Ljava/lang/String;",
"Ljava/lang/String;.toUpperCase:()Ljava/lang/String;",
"Ljava/lang/String;.toUpperCase:(Ljava/util/Locale;)Ljava/lang/String;",
"Ljava/lang/String;.trim:()Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(C)Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(D)Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(F)Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(I)Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(J)Ljava/lang/String;",
"Ljava/lang/String;.valueOf:(Z)Ljava/lang/String;",
"Ljava/lang/System;.identityHashCode:(Ljava/lang/Object;)I",
"Ljava/lang/Thread;.currentThread:()Ljava/lang/Thread;",
};
std::unordered_set<DexMethodRef*> get_pure_methods() {
std::unordered_set<DexMethodRef*> pure_methods;
for (auto const pure_method_name : pure_method_names) {
auto method_ref = DexMethod::get_method(pure_method_name);
if (method_ref == nullptr) {
TRACE(CSE, 1, "[get_pure_methods]: Could not find pure method %s",
str_copy(pure_method_name).c_str());
continue;
}
pure_methods.insert(method_ref);
}
return pure_methods;
}
std::unordered_set<DexMethod*> get_immutable_getters(const Scope& scope) {
std::unordered_set<DexMethod*> pure_methods;
walk::methods(scope, [&](DexMethod* method) {
if (method->rstate.immutable_getter()) {
pure_methods.insert(method);
}
});
return pure_methods;
}
namespace {
MethodOverrideAction get_base_or_overriding_method_action_impl(
const DexMethod* method,
const std::unordered_set<const DexMethod*>* methods_to_ignore,
bool ignore_methods_with_assumenosideeffects) {
if (method == nullptr || method::is_clinit(method) ||
method->rstate.no_optimizations()) {
return MethodOverrideAction::UNKNOWN;
}
if ((method->is_virtual() && is_interface(type_class(method->get_class()))) &&
(root(method) || !can_rename(method))) {
// We cannot rule out that there are dynamically added classes, created via
// Proxy.newProxyInstance, that override this method.
// So we assume the worst.
return MethodOverrideAction::UNKNOWN;
}
if (methods_to_ignore && methods_to_ignore->count(method)) {
return MethodOverrideAction::EXCLUDE;
}
if (ignore_methods_with_assumenosideeffects && assumenosideeffects(method)) {
return MethodOverrideAction::EXCLUDE;
}
if (method->is_external() || is_native(method)) {
return MethodOverrideAction::UNKNOWN;
}
if (is_abstract(method)) {
return MethodOverrideAction::EXCLUDE;
}
return MethodOverrideAction::INCLUDE;
}
} // namespace
MethodOverrideAction get_base_or_overriding_method_action(
const DexMethod* method,
const std::unordered_set<const DexMethod*>* methods_to_ignore,
bool ignore_methods_with_assumenosideeffects) {
return get_base_or_overriding_method_action_impl(
method, methods_to_ignore, ignore_methods_with_assumenosideeffects);
}
namespace {
template <typename HandlerFunc>
bool process_base_and_overriding_methods_impl(
const method_override_graph::Graph* method_override_graph,
const DexMethod* method,
const std::unordered_set<const DexMethod*>* methods_to_ignore,
bool ignore_methods_with_assumenosideeffects,
const HandlerFunc& handler_func) {
auto action = get_base_or_overriding_method_action_impl(
method, methods_to_ignore, ignore_methods_with_assumenosideeffects);
if (action == MethodOverrideAction::UNKNOWN ||
(action == MethodOverrideAction::INCLUDE &&
!handler_func(const_cast<DexMethod*>(method)))) {
return false;
}
// When the method isn't virtual, there are no overriden methods to consider.
if (!method->is_virtual()) {
return true;
}
// But even if there are overriden methods, don't look further when the
// method is to be ignored.
if (methods_to_ignore && methods_to_ignore->count(method)) {
return true;
}
if (ignore_methods_with_assumenosideeffects && assumenosideeffects(method)) {
return true;
}
// When we don't have a method-override graph, let's be conservative and give
// up.
if (!method_override_graph) {
return false;
}
// Okay, let's process all overridden methods just like the base method.
return method_override_graph::all_overriding_methods(
*method_override_graph, method, [&](const DexMethod* overriding_method) {
action = get_base_or_overriding_method_action(
overriding_method, methods_to_ignore,
ignore_methods_with_assumenosideeffects);
if (action == MethodOverrideAction::UNKNOWN ||
(action == MethodOverrideAction::INCLUDE &&
!handler_func(const_cast<DexMethod*>(overriding_method)))) {
return false;
}
return true;
});
return true;
}
} // namespace
bool process_base_and_overriding_methods(
const method_override_graph::Graph* method_override_graph,
const DexMethod* method,
const std::unordered_set<const DexMethod*>* methods_to_ignore,
bool ignore_methods_with_assumenosideeffects,
const std::function<bool(DexMethod*)>& handler_func) {
return process_base_and_overriding_methods_impl(
method_override_graph,
method,
methods_to_ignore,
ignore_methods_with_assumenosideeffects,
handler_func);
}
namespace {
AccumulatingTimer s_wto_timer("compute_locations_closure_wto");
class WtoOrdering {
static constexpr const DexMethod* WTO_ROOT = nullptr;
struct FirstIterationData {
std::vector<const DexMethod*> root_cache;
std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies;
const std::vector<const DexMethod*> empty{};
const std::vector<const DexMethod*>& get(const DexMethod* m) {
if (m == WTO_ROOT) {
// Pre-initialized and pre-sorted
return root_cache;
}
auto it = inverse_dependencies.find(m);
if (it != inverse_dependencies.end()) {
// Pre-sorted
return it->second;
}
return empty;
}
};
static FirstIterationData create_first_iteration_data(
std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies,
const std::unordered_set<const DexMethod*>& impacted_methods) {
std::vector<const DexMethod*> wto_nodes{WTO_ROOT};
wto_nodes.reserve(wto_nodes.size() + impacted_methods.size());
wto_nodes.insert(wto_nodes.end(), impacted_methods.begin(),
impacted_methods.end());
// In the first iteration, besides computing the sorted root successors, we
// also sort all inverse_dependencies entries in-place. They represent the
// full successor vectors.
std::vector<const DexMethod*> root_cache;
workqueue_run<const DexMethod*>(
[&inverse_dependencies, &root_cache,
&impacted_methods](const DexMethod* m) {
if (m == WTO_ROOT) {
root_cache = get_sorted_impacted_methods(impacted_methods);
return;
}
auto it = inverse_dependencies.find(m);
if (it != inverse_dependencies.end()) {
auto& entries = it->second;
entries.shrink_to_fit();
std::sort(entries.begin(), entries.end(), compare_dexmethods);
}
},
wto_nodes);
return {std::move(root_cache), inverse_dependencies};
}
struct OtherIterationData {
InsertOnlyConcurrentMap<const DexMethod*, std::vector<const DexMethod*>>
concurrent_cache;
const std::vector<const DexMethod*>& get(const DexMethod* const& m) {
return concurrent_cache.at_unsafe(m);
}
};
static OtherIterationData create_other_iteration_data(
std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies,
const std::unordered_set<const DexMethod*>& impacted_methods) {
std::vector<const DexMethod*> wto_nodes{WTO_ROOT};
wto_nodes.reserve(wto_nodes.size() + impacted_methods.size());
wto_nodes.insert(wto_nodes.end(), impacted_methods.begin(),
impacted_methods.end());
// In subsequent iteration, besides computing the sorted root successors
// again, we also filter all previously sorted inverse_dependencies entries.
InsertOnlyConcurrentMap<const DexMethod*, std::vector<const DexMethod*>>
concurrent_cache;
workqueue_run<const DexMethod*>(
[&impacted_methods, &concurrent_cache,
&inverse_dependencies](const DexMethod* m) {
std::vector<const DexMethod*> successors;
if (m == WTO_ROOT) {
// Re-initialize and re-sort
successors = get_sorted_impacted_methods(impacted_methods);
}
auto it = inverse_dependencies.find(m);
if (it != inverse_dependencies.end()) {
// Note that we are filtering on an already pre-sorted vector
for (auto n : it->second) {
if (impacted_methods.count(n)) {
successors.push_back(n);
}
}
}
auto [_, emplaced] =
concurrent_cache.emplace(m, std::move(successors));
always_assert(emplaced);
},
wto_nodes);
return {std::move(concurrent_cache)};
}
static std::vector<const DexMethod*> get_sorted_impacted_methods(
const std::unordered_set<const DexMethod*>& impacted_methods) {
std::vector<const DexMethod*> successors;
successors.reserve(impacted_methods.size());
successors.insert(successors.end(), impacted_methods.begin(),
impacted_methods.end());
std::sort(successors.begin(), successors.end(), compare_dexmethods);
return successors;
}
static std::vector<const DexMethod*> sort_by_inverse_deps(
const std::unordered_set<const DexMethod*>& impacted_methods,
const std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies) {
// First translate to pair to avoid repeated map lookups.
std::vector<std::pair<const DexMethod*, size_t>> sorted_by_inv_deps;
sorted_by_inv_deps.reserve(impacted_methods.size());
std::transform(impacted_methods.begin(), impacted_methods.end(),
std::back_inserter(sorted_by_inv_deps),
[&inverse_dependencies](auto* m) {
auto it = inverse_dependencies.find(m);
return std::make_pair(m, it != inverse_dependencies.end()
? it->second.size()
: 0);
});
std::sort(sorted_by_inv_deps.begin(), sorted_by_inv_deps.end(),
[](const std::pair<const DexMethod*, size_t>& lhs,
const std::pair<const DexMethod*, size_t>& rhs) {
if (lhs.second != rhs.second) {
return lhs.second > rhs.second;
}
return compare_dexmethods(lhs.first, rhs.first);
});
std::vector<const DexMethod*> res;
res.reserve(impacted_methods.size());
std::transform(sorted_by_inv_deps.begin(), sorted_by_inv_deps.end(),
std::back_inserter(res),
[](const auto& p) { return p.first; });
return res;
}
// We saw big slowdowns when there are too many components, possibly
// driven by the fact there is a lot of dependencies.
template <typename SuccFn>
static void run_wto(const SuccFn& succ_fn,
std::vector<const DexMethod*>& ordered_impacted_methods) {
sparta::WeakTopologicalOrdering<const DexMethod*> wto(WTO_ROOT, succ_fn);
wto.visit_depth_first([&ordered_impacted_methods](const DexMethod* m) {
if (m) {
ordered_impacted_methods.push_back(m);
}
});
}
static bool should_use_wto(
const std::unordered_set<const DexMethod*>& impacted_methods,
const std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies) {
size_t impacted_methods_size = impacted_methods.size();
size_t inv_dep_sum{0}, inv_dep_max{0};
for (auto& entry : inverse_dependencies) {
inv_dep_sum += entry.second.size();
inv_dep_max = std::max(inv_dep_max, entry.second.size());
}
auto inv_dep_avg = ((double)inv_dep_sum) / inverse_dependencies.size();
// Purity is too low-level for nice configuration switches. Think
// about it.
TRACE(CSE, 4,
"UseWto: impacted methods = %zu inverse_deps_max = %zu "
"inverse_deps avg = %.2f",
impacted_methods_size, inv_dep_max, inv_dep_avg);
return inv_dep_avg < kWtoOrderingThreshold;
}
public:
static std::vector<const DexMethod*> order_impacted_methods(
const std::unordered_set<const DexMethod*>& impacted_methods,
std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>&
inverse_dependencies,
size_t iterations) {
Timer prepare_wto{"Prepare Ordering"};
auto wto_timer_scope = s_wto_timer.scope();
std::vector<const DexMethod*> ordered_impacted_methods;
// To avoid std::function overhead we have to split here.
if (iterations == 1 &&
should_use_wto(impacted_methods, inverse_dependencies)) {
auto first_data =
create_first_iteration_data(inverse_dependencies, impacted_methods);
run_wto(
[&first_data](
const DexMethod* m) -> const std::vector<const DexMethod*>& {
return first_data.get(m);
},
ordered_impacted_methods);
} else if (iterations == 1) {
// Simple sorting for determinism.
ordered_impacted_methods =
sort_by_inverse_deps(impacted_methods, inverse_dependencies);
} else {
auto other_data =
create_other_iteration_data(inverse_dependencies, impacted_methods);
run_wto(
[&other_data](
const DexMethod* m) -> const std::vector<const DexMethod*>& {
return other_data.get(m);
},
ordered_impacted_methods);
}
return ordered_impacted_methods;
}
};
template <typename InitFuncT>
size_t compute_locations_closure_impl(
const Scope& scope,
const method_override_graph::Graph* method_override_graph,
const InitFuncT& init_func,
std::unordered_map<const DexMethod*, CseUnorderedLocationSet>* result) {
// 1. Let's initialize known method read locations and dependencies by
// scanning method bodies
InsertOnlyConcurrentMap<const DexMethod*, LocationsAndDependencies>
method_lads;
{
Timer t{"Initialize LADS"};
walk::parallel::methods(scope, [&](DexMethod* method) {
auto lads = init_func(method);
if (lads) {
method_lads.emplace(method, std::move(*lads));
}
});
}
// 2. Compute inverse dependencies so that we know what needs to be recomputed
// during the fixpoint computation, and determine set of methods that are
// initially "impacted" in the sense that they have dependencies.
std::unordered_map<const DexMethod*, std::vector<const DexMethod*>>
inverse_dependencies;
std::unordered_set<const DexMethod*> impacted_methods;
{
Timer t{"Compute inverse dependencies"};
for (auto&& [method, lads] : method_lads) {
if (!lads.dependencies.empty()) {
for (auto d : lads.dependencies) {
inverse_dependencies[d].push_back(method);
}
impacted_methods.insert(method);
}
}
}
// 3. Let's try to (semantically) inline locations, computing a fixed
// point. Methods for which information is directly or indirectly absent
// are equivalent to a general memory barrier, and are systematically
// pruned.
// TODO: Instead of custom fixpoint computation using WTO, consider using the
// MonotonicFixpointIterator, operating on a callgraph, capture the
// dependencies, and have the Locations as the abstract domain.
size_t iterations = 0;
while (!impacted_methods.empty()) {
iterations++;
Timer t{std::string("Iteration ") + std::to_string(iterations)};
// We order the impacted methods in a deterministic way that's likely
// helping to reduce the number of needed iterations.
auto ordered_impacted_methods = WtoOrdering::order_impacted_methods(
impacted_methods, inverse_dependencies, iterations);
impacted_methods.clear();
std::vector<const DexMethod*> changed_methods;
for (const DexMethod* method : ordered_impacted_methods) {
auto& lads = method_lads.at_unsafe(method);
bool unknown = false;
size_t lads_locations_size = lads.locations.size();
for (const DexMethod* d : lads.dependencies) {
if (d == method) {
continue;
}
auto it = method_lads.find(d);
if (it == method_lads.end()) {
unknown = true;
break;
}
const auto& other_locations = it->second.locations;
lads.locations.insert(other_locations.begin(), other_locations.end());
}
if (unknown || lads_locations_size < lads.locations.size()) {
// something changed
changed_methods.push_back(method);
if (unknown) {
method_lads.erase_unsafe(method);
}
}
}
// Given set of changed methods, determine set of dependents for which
// we need to re-run the analysis in another iteration.
for (auto changed_method : changed_methods) {
auto it = inverse_dependencies.find(changed_method);
if (it == inverse_dependencies.end()) {
continue;
}
// remove inverse dependency entries as appropriate
auto& entries = it->second;
std20::erase_if(entries,
[&](auto* m) { return !method_lads.count_unsafe(m); });
if (entries.empty()) {
// remove inverse dependency
inverse_dependencies.erase(changed_method);
} else {
// add inverse dependencies entries to impacted methods
impacted_methods.insert(entries.begin(), entries.end());
}
}
}
// For all methods which have a known set of locations at this point,
// persist that information
for (auto&& [method, lads] : method_lads) {
result->emplace(method, std::move(lads.locations));
}
return iterations;
}
} // namespace
size_t compute_locations_closure(
const Scope& scope,
const method_override_graph::Graph* method_override_graph,
const std::function<boost::optional<LocationsAndDependencies>(DexMethod*)>&
init_func,
std::unordered_map<const DexMethod*, CseUnorderedLocationSet>* result) {
return compute_locations_closure_impl(scope, method_override_graph, init_func,
result);
}
// Helper function that invokes compute_locations_closure, providing initial
// set of locations indicating whether a function only reads locations (and
// doesn't write). Via additional flags it can be selected whether...
// - [ignore_methods_with_assumenosideeffects] to ignore invoked methods that
// are marked with assumenosideeffects
// - [for_conditional_purity] instructions that rule out conditional purity
// should cause methods to be treated like methods with unknown behavior; in
// particular, this rules out instructions that create new object instances,
// as those may leak, and thus multiple invocations of such a method could
// never be reduced by CSE.
// - [compute_locations] the actual locations that are being read are computed
// and returned; if false, then an empty set indicates that a particular
// function only reads (some unknown set of) locations.
static size_t analyze_read_locations(
const Scope& scope,
const method_override_graph::Graph* method_override_graph,
const method::ClInitHasNoSideEffectsPredicate& clinit_has_no_side_effects,
const std::unordered_set<DexMethodRef*>& pure_methods,
bool ignore_methods_with_assumenosideeffects,
bool for_conditional_purity,
bool compute_locations,
std::unordered_map<const DexMethod*, CseUnorderedLocationSet>* result) {
std::unordered_set<const DexMethod*> pure_methods_closure;
{
Timer t{"Pure methods closure"};
for (auto pure_method_ref : pure_methods) {
auto pure_method = pure_method_ref->as_def();
if (pure_method == nullptr) {
continue;
}
pure_methods_closure.insert(pure_method);
if (pure_method->is_virtual() && method_override_graph) {
const auto overriding_methods =
method_override_graph::get_overriding_methods(
*method_override_graph, pure_method);
pure_methods_closure.insert(overriding_methods.begin(),
overriding_methods.end());
}
}
}
return compute_locations_closure_impl(
scope, method_override_graph,
[&](DexMethod* method) -> boost::optional<LocationsAndDependencies> {
auto action = get_base_or_overriding_method_action_impl(
method, &pure_methods_closure,
ignore_methods_with_assumenosideeffects);
if (action == MethodOverrideAction::UNKNOWN) {
return boost::none;
}
LocationsAndDependencies lads;
if (!process_base_and_overriding_methods_impl(
method_override_graph, method, &pure_methods_closure,
ignore_methods_with_assumenosideeffects,
[&](DexMethod* other_method) {
if (other_method != method) {
lads.dependencies.insert(other_method);
}
return true;
})) {
return boost::none;
}
if (action == MethodOverrideAction::EXCLUDE) {
return lads;
}
bool unknown = false;
editable_cfg_adapter::iterate_with_iterator(
method->get_code(), [&](const IRList::iterator& it) {
auto insn = it->insn;
auto opcode = insn->opcode();
switch (opcode) {
case OPCODE_MONITOR_ENTER:
case OPCODE_MONITOR_EXIT:
case OPCODE_FILL_ARRAY_DATA:
case OPCODE_THROW:
unknown = true;
break;
case IOPCODE_INIT_CLASS:
unknown = true;
break;
case OPCODE_NEW_INSTANCE:
if (for_conditional_purity ||
!clinit_has_no_side_effects(insn->get_type())) {
unknown = true;
}
break;
case OPCODE_NEW_ARRAY:
case OPCODE_FILLED_NEW_ARRAY:
if (for_conditional_purity) {
unknown = true;
}
break;
case OPCODE_INVOKE_SUPER:
// TODO: Support properly.
unknown = true;
break;
default:
if (opcode::is_an_aput(opcode) || opcode::is_an_iput(opcode) ||
opcode::is_an_sput(opcode)) {
unknown = true;
} else if (opcode::is_an_aget(opcode) ||
opcode::is_an_iget(opcode) ||
opcode::is_an_sget(opcode)) {
auto location = get_read_location(insn);
if (location ==
CseLocation(
CseSpecialLocations::GENERAL_MEMORY_BARRIER)) {
unknown = true;
} else {
if (opcode::is_an_sget(opcode) &&
(!clinit_has_no_side_effects(
location.get_field()->get_class()))) {
unknown = true;
} else if (compute_locations) {
lads.locations.insert(location);
}
}
} else if (opcode::is_an_invoke(opcode)) {
auto invoke_method = resolve_method(
insn->get_method(), opcode_to_search(opcode), method);
if ((invoke_method && opcode::is_invoke_static(opcode) &&
(!clinit_has_no_side_effects(
invoke_method->get_class()))) ||
!process_base_and_overriding_methods_impl(
method_override_graph, invoke_method,
&pure_methods_closure,
ignore_methods_with_assumenosideeffects,
[&](DexMethod* other_method) {
if (other_method != method) {
lads.dependencies.insert(other_method);
}
return true;
})) {
unknown = true;
}
}
break;
}
return unknown ? editable_cfg_adapter::LOOP_BREAK
: editable_cfg_adapter::LOOP_CONTINUE;
});
if (unknown) {
return boost::none;
}
return lads;
},
result);
}
size_t compute_conditionally_pure_methods(
const Scope& scope,
const method_override_graph::Graph* method_override_graph,
const method::ClInitHasNoSideEffectsPredicate& clinit_has_no_side_effects,
const std::unordered_set<DexMethodRef*>& pure_methods,
std::unordered_map<const DexMethod*, CseUnorderedLocationSet>* result) {
Timer t("compute_conditionally_pure_methods");
auto iterations = analyze_read_locations(
scope, method_override_graph, clinit_has_no_side_effects, pure_methods,
/* ignore_methods_with_assumenosideeffects */ false,
/* for_conditional_purity */ true,
/* compute_locations */ true, result);
for (auto& p : *result) {
TRACE(CSE, 4, "[CSE] conditionally pure method %s: %s", SHOW(p.first),
SHOW(&p.second));
}
return iterations;
}
size_t compute_no_side_effects_methods(
const Scope& scope,
const method_override_graph::Graph* method_override_graph,
const method::ClInitHasNoSideEffectsPredicate& clinit_has_no_side_effects,
const std::unordered_set<DexMethodRef*>& pure_methods,
std::unordered_set<const DexMethod*>* result) {
Timer t("compute_no_side_effects_methods");
std::unordered_map<const DexMethod*, CseUnorderedLocationSet>
method_locations;
auto iterations = analyze_read_locations(
scope, method_override_graph, clinit_has_no_side_effects, pure_methods,
/* ignore_methods_with_assumenosideeffects */ true,
/* for_conditional_purity */ false,
/* compute_locations */ false, &method_locations);
for (auto& p : method_locations) {
TRACE(CSE, 4, "[CSE] no side effects method %s", SHOW(p.first));
result->insert(p.first);
}
return iterations;
}
bool has_implementor(const method_override_graph::Graph* method_override_graph,
const DexMethod* method) {
// For methods of an annotation interface, a synthetic trivial implementation
// is generated by the runtime.
if (is_annotation(type_class(method->get_class()))) {
return true;
}
bool found_implementor = false;
auto res = process_base_and_overriding_methods_impl(
method_override_graph, method, /* methods_to_ignore */ nullptr,
/* ignore_methods_with_assumenosideeffects */ false, [&](DexMethod*) {
found_implementor = true;
return true;
});
return !res || found_implementor;
}
```
|
Melhania angustifolia is a plant in the family Malvaceae. It is endemic to Zanzibar.
Description
Melhania angustifolia grows as a suffrutex (subshrub) or shrub up to tall. The ovate to oblong leaves measure up to long. Inflorescences are two or three-flowered, on a stalk measuring up to long. The flowers have bright yellow petals.
Distribution and habitat
Melhania angustifolia is native to the Zanzibar Archipelago where only seven specimens are known and the species is threatened by tourism-linked development. Its habitat is in bushland or on sand, near sea level.
References
angustifolia
Endemic flora of Tanzania
Plants described in 1900
Taxa named by Karl Moritz Schumann
|
```smalltalk
using System.Collections.Generic;
using Volo.Abp;
namespace Volo.CmsKit.Web.Icons;
public static class IconDictionaryHelper
{
public static string GetLocalizedIcon(
Dictionary<string, LocalizableIconDictionary> dictionary,
string name,
string cultureName = null)
{
var icon = dictionary.GetOrDefault(name);
if (icon == null)
{
throw new AbpException($"No icon defined for the item with name '{name}'");
}
return icon.GetLocalizedIconOrDefault(cultureName);
}
}
```
|
Madeline Jane "Maddy" Price (born 11 September 1995) is a Canadian athlete. A specialist in the 400 metres distance, she competes as part of the Canadian relay team. In her inaugural World Championships appearance at the 2019 World Athletics Championships in Doha, she was a participant in the mixed 4 × 400 metres relay. As a part of the women's 4x400 m relay team in the same championships, the Canadian team was disqualified in the final. She went on to compete as part of the Canadian Olympic team at the 2020 Summer Olympics in Tokyo. The 4x400 m relay team finished in fourth place.
References
External links
1995 births
Living people
Canadian female sprinters
World Athletics Championships athletes for Canada
Athletes (track and field) at the 2020 Summer Olympics
Olympic track and field athletes for Canada
Sportspeople from Palo Alto, California
Duke Blue Devils women's track and field athletes
|
The Georgian Badminton Federation (, GBF) is the governing body for badminton in Georgia. It aims to govern, encourage and develop the sport for all throughout the country.
History
The GBF was established on 19 July 1991. Its first president was Pavle Nonikashvili. In 1992 The GBF was accepted by International Badminton Federation as the member. Continentally, it is a member of the Badminton Europe confederation.
Presidents of Georgian Badminton Federation
See also
Georgian National Badminton Championships
External links
Georgian Badminton Federation official site (Georgian)
National members of the Badminton World Federation
Federation
Badminton
Sports organizations established in 1991
1991 establishments in Georgia (country)
|
```objective-c
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_AST_AST_LITERAL_REINDEXER
#define V8_AST_AST_LITERAL_REINDEXER
#include "src/ast/ast.h"
#include "src/ast/scopes.h"
namespace v8 {
namespace internal {
class AstLiteralReindexer final : public AstVisitor {
public:
AstLiteralReindexer() : AstVisitor(), next_index_(0) {}
int count() const { return next_index_; }
void Reindex(Expression* pattern);
private:
#define DEFINE_VISIT(type) void Visit##type(type* node) override;
AST_NODE_LIST(DEFINE_VISIT)
#undef DEFINE_VISIT
void VisitStatements(ZoneList<Statement*>* statements) override;
void VisitDeclarations(ZoneList<Declaration*>* declarations) override;
void VisitArguments(ZoneList<Expression*>* arguments);
void VisitObjectLiteralProperty(ObjectLiteralProperty* property);
void UpdateIndex(MaterializedLiteral* literal) {
literal->literal_index_ = next_index_++;
}
void Visit(AstNode* node) override { node->Accept(this); }
int next_index_;
DISALLOW_COPY_AND_ASSIGN(AstLiteralReindexer);
};
} // namespace internal
} // namespace v8
#endif // V8_AST_AST_LITERAL_REINDEXER
```
|
```objective-c
#ifndef _DYNAMIC_NEEDLEMANWUNSCH_
#define _DYNAMIC_NEEDLEMANWUNSCH_
#include "Eigen/Core"
#include <vector>
#include <iostream>
#include "basics.h"
#ifdef _MSC_VER
#include <float.h> // for _isnan() on VC++
#define isnan(x) _isnan(x) // VC++ uses _isnan() instead of isnan()
//#else
//#include <math.h> // for isnan() everywhere else
#endif
namespace DynamicProg{
/*!
Global alignment
cmp: must define an eval function
*/
template <typename Scalar, class DataType, template <typename, class> class Cmp >
class NeedlemanWunsch{
private:
Cmp<Scalar, DataType> _cmp;
Scalar _gapPenalty;
Scalar _confidence;
public:
typedef typename Eigen::Matrix<DynamicStep<Scalar>, Eigen::Dynamic, Eigen::Dynamic> StepMatrix;
public:
inline NeedlemanWunsch(): _gapPenalty(-1), _confidence(0) {}
inline DynamicStep<Scalar> eval (const DataType& v1,
const DataType& v2,
unsigned int x,
unsigned int y,
const StepMatrix& matrix, double multiplier) const;
inline Scalar eval_couples (const DataType& v1,
const DataType& v2,
unsigned int x,
unsigned int y,
const StepMatrix& matrix, double multiplier) const;
inline void setConfidence(double conf);
inline void setGapPenalty(Scalar gapPenalty) {_gapPenalty = gapPenalty;}
inline Scalar confidence() const { return _confidence;}
}; //class NeedlemanWunsch
template <typename Scalar, class DataType, template <typename, class> class Cmp >
DynamicStep<Scalar>
NeedlemanWunsch<Scalar, DataType, Cmp >::eval( const DataType& v1,
const DataType& v2,
unsigned int x,
unsigned int y,
const StepMatrix& matrix, double multiplier) const{
//std::cout << "here" << std::endl;
DynamicStep<Scalar>nei[3]; // will contain top, left and topleft
nei[2] = DynamicStep<Scalar> (matrix(x-1, y-1).value + _cmp.eval(v1, v2),
DynamicRelation::TopLeft);
return nei[2];
}
template <typename Scalar, class DataType, template <typename, class> class Cmp >
Scalar
NeedlemanWunsch<Scalar, DataType, Cmp >::eval_couples( const DataType& v1,
const DataType& v2,
unsigned int x,
unsigned int y,
const StepMatrix& /*matrix*/, double multiplier) const{
return _cmp.eval(v1, v2);
}
template <typename Scalar, class DataType, template <typename, class> class Cmp >
void
NeedlemanWunsch<Scalar, DataType, Cmp >::setConfidence(double conf)
{
_confidence = conf;
}
} // namespace DynamicProg
#endif // _DYNAMIC_PATH
```
|
Nowa Karczma is a village in the administrative district of Gmina Górowo Iławeckie, within Bartoszyce County, Warmian-Masurian Voivodeship, in northern Poland, close to the border with the Kaliningrad Oblast of Russia.
References
Nowa Karczma
|
Bryan Stevenson (born November 14, 1959) is an American lawyer, social justice activist, law professor at New York University School of Law, and the founder and executive director of the Equal Justice Initiative. Based in Montgomery, Alabama, he has challenged bias against the poor and minorities in the criminal justice system, especially children. He has helped achieve United States Supreme Court decisions that prohibit sentencing children under 18 to death or to life imprisonment without parole. He has assisted in cases that have saved dozens of prisoners from the death penalty, advocated for the poor, and developed community-based reform litigation aimed at improving the administration of criminal justice.
He was depicted in the 2019 legal drama film Just Mercy, based on his 2014 memoir Just Mercy: A Story of Justice and Redemption. In the memoir, Stevenson recounted his work with Walter McMillian, who had been unjustly convicted and sentenced to death.
Stevenson initiated the National Memorial for Peace and Justice in Montgomery, which honors the names of each of more than 4,000 African Americans lynched in the twelve states of the South from 1877 to 1950. He argues that the history of slavery and lynchings has influenced the subsequent high rate of death sentences in the South, where it has been disproportionately applied to minorities. A related museum, The Legacy Museum: From Enslavement to Mass Incarceration, offers interpretations to show the connection between the post-Reconstruction period of lynchings to the high rate of incarceration and executions of people of color in the United States.
In November 2018, Stevenson received the Benjamin Franklin Award from the American Philosophical Society as a "Drum major for justice and mercy." In 2020, he shared the Right Livelihood Award with Nasrin Sotoudeh, Ales Bialiatski and Lottie Cunningham Wren.
Early life
Born on November 14, 1959, Stevenson grew up in Milton, Delaware, a small rural town located in southern Delaware. His father, Howard Carlton Stevenson Sr., had grown up in Milton, and his mother, Alice Gertrude (Golden) Stevenson, was born and grew up in Philadelphia. Her family had moved to the city from Virginia in the Great Migration of the early 20th century. Stevenson has two siblings: an older brother, Howard Jr. and a sister, Christy.
Both parents commuted to the northern part of the state for work, with Howard Sr., working at a General Foods processing plant as a laboratory technician and Alice as an equal opportunity officer at Dover Air Force Base. She particularly emphasized the importance of education to her children.
Stevenson's family attended the Prospect African Methodist Episcopal Church, where as a child, Stevenson played piano and sang in the choir. His later views were influenced by the strong faith of the African Methodist Episcopal Church, where churchgoers were celebrated for "standing up after having fallen down". These experiences informed his belief that "each person in our society is more than the worst thing they've ever done."
When Stevenson was 16, his maternal grandfather, Clarence L. Golden, was stabbed to death in his Philadelphia home during a robbery. The killers received life sentences, an outcome Stevenson thought fair. Stevenson said of the murder: "Because my grandfather was older, his murder seemed particularly cruel. But I came from a world where we valued redemption over revenge."
As a child, Stevenson dealt with segregation and its legacy. He spent his first classroom years at a "colored" elementary school. By the time he entered the second grade, his school was formally desegregated, but the old rules from segregation still applied. Black kids played separately from white kids, and at the doctor's or dentist's office, black kids and their parents continued to use the back door, while whites entered through the front. Pools and other community facilities were informally segregated. Stevenson's father, having grown up in the area, took the ingrained racism in his stride, but his mother openly opposed the de facto segregation. In an interview in 2017, Stevenson recalled how his mother protested the day the black children from town lined up at the back door of the polio vaccination station to receive their shots, waiting hours while the white children went in first.
Education
Stevenson attended Cape Henlopen High School and graduated in 1978. He played on the soccer and baseball teams. He also served as president of the student body and won American Legion public speaking contests. His brother, Howard, takes some credit for helping hone Stevenson's rhetorical skills: "We argued the way brothers argue, but these were serious arguments, inspired I guess by our mother and the circumstances of our family growing up."
Stevenson earned straight As and won a scholarship to Eastern University in St. Davids, Pennsylvania. On campus, he directed the campus gospel choir. Stevenson graduated with a B.A. degree in philosophy from Eastern in 1981. In 1985, Stevenson earned both a J.D. degree from Harvard Law School and an M.A. degree in Public Policy (MPP) from the John F. Kennedy School of Government, also at Harvard University. During law school, as part of a class on race and poverty litigation with Elizabeth Bartholet, he worked for Stephen Bright's Southern Center for Human Rights, an organization that represents death-row inmates throughout the South. During this work, Stevenson found his career calling.
On May 7, 2023, he received an honorary Doctor of Public Service degree from Ohio State University.
On October 5, 2023, he received an honorary Doctor of Humane Letters degree from Whitworth University.
Career
Southern Center for Human Rights
After graduating from Harvard in 1985, Stevenson moved to Atlanta, and joined the Southern Center for Human Rights full-time. The center divided work by region and Stevenson was assigned to Alabama. In 1989 he was appointed to run the Alabama operation, a resource center and death-penalty defense organization that was funded by Congress. He had a center in Montgomery, the state capital.
Equal Justice Initiative
When the United States Congress eliminated funding for death-penalty defense, Stevenson converted the center and founded the non-profit Equal Justice Initiative (EJI) in Montgomery. In 1995, he was awarded a MacArthur Grant and put all the money toward supporting the center. He guaranteed a defense of anyone in Alabama sentenced to the death penalty, as it was the only state that did not provide legal assistance to people on death row. It also has the highest per capita rate of death penalty sentencing.
One of EJI's first cases was the post-conviction appeal of Walter McMillian, who had been confined to death row before being convicted of murder and sentenced to death. Stevenson was able to discredit every element of the prosecution's initial case, which led to McMillian being exonerated and released from jail in 1993.
Stevenson has been particularly concerned about overly harsh sentencing of persons convicted of crimes committed as children, under the age of 18. In 2005, the U.S. Supreme Court ruled in Roper v. Simmons that the death penalty was unconstitutional for persons convicted of crimes committed under the age of 18. Stevenson worked to have the court's thinking about appropriate punishment broadened to related cases applying to children convicted under the age of 17.
EJI mounted a litigation campaign to gain review of cases in which convicted children were sentenced to life-without-parole, including cases without homicide. In Miller v. Alabama (2012), the US Supreme Court ruled in a landmark decision that mandatory sentences of life-without-parole for children 17 and under were unconstitutional; their decision has affected statutes in 29 states. In 2016, the court ruled in Montgomery v. Louisiana that this decision had to be applied retroactively, potentially affecting the sentences of 2300 people nationwide who had been sentenced to life while still children.
As of 2022, the EJI has saved over 130 people from the death penalty. In addition, it has represented poor people, defended people on appeal, overturned wrongful convictions, and worked to alleviate bias in the criminal justice system.
Acknowledging slavery
The EJI offices are near the landing at the Alabama River where slaves were unloaded in the domestic slave trade; an equal distance away is Court Square, "one of the largest slave auction sites in the country." Stevenson has noted that in downtown Montgomery, there were "dozens" of historic markers and numerous monuments related to Confederate history, but nothing acknowledging the history of slavery, on which the wealth of the South was based and for which it fought the Civil War. He proposed to the state and provided documentation to three slavery sites with historic markers; the Alabama Department of Archives and History told him that it did not want to "sponsor the markers given the potential for controversy." Stevenson worked with an African-American history group to gain sponsorship for this project; the group gained state approval for the three markers in 2013, and these have been installed in Montgomery.
National Memorial for Peace and Justice
Stevenson acquired six acres of former public housing land in Montgomery for the development of a new project, the National Memorial for Peace and Justice, to commemorate the nearly 4,000 persons who were lynched in the South from 1877 to 1950. Numerous lynchings were conducted openly in front of mobs and crowds in county courthouse squares. Stevenson has argued that this history of extrajudicial lynchings by white mobs is closely associated with the subsequent high rate of death sentences imposed in Alabama and other southern states, and to their disproportionate application to minority people. He further argues that this history influences the bias against minorities as expressed in disproportionately high mass incarceration rates for them across the country. The memorial opened in April 2018.
Associated with the Memorial is the Legacy Museum: From Enslavement to Mass Incarceration, which also opened on April 26, 2018. Exhibits in the former slave warehouse include materials on lynching, racial segregation, and mass incarceration since the late 20th century. Stevenson articulates how the treatment of people of color under the criminal justice system is related to the history of slavery and later treatment of minorities in the South.
Author
Stevenson wrote the critically acclaimed memoir Just Mercy: A Story of Justice and Redemption, published in 2014 by Spiegel & Grau. It was selected by Time magazine as one of the "10 Best Books of Nonfiction" for 2014, and was among The New York Times "100 Notable Books" for the year. It won the 2015 Andrew Carnegie Medal for Excellence in Nonfiction and the 2015 Dayton Literary Peace Prize for Nonfiction. A film based on the book, called Just Mercy, starring Michael B. Jordan as Stevenson with Stevenson himself executive-producing, premiered on September 6, 2019, at the Toronto International Film Festival and was released in theatres on December 25, 2019.
Speaker
Stevenson maintains an active public speaking schedule, in large part for fundraising for the work of EJI. His speech at TED2012 in Long Beach, California, brought him a wide audience on the Internet. Following his presentation, attendees at the conference contributed more than $1 million to fund a campaign run by Stevenson to end the practice of placing convicted children to serve sentences in adult jails and prisons. His talk is available on the TED website; by April 2020, it had been viewed more than 6.5 million times.
Stevenson has been a commencement speaker and received numerous honorary degrees, including from the following institutions: University of Delaware, 2016, honorary Doctor of Laws degree; Williams College, 2016, honorary doctorate; Loyola University Chicago, Stritch School of Medicine, 2011, Doctor of Humane Letters, honoris causa; College of the Holy Cross, 2015; Wesleyan University, 2016, honorary degree; University of Mississippi, 2017s fall convocation; Northeastern University, fall 2017 convocation; Emory University, spring 2020 commencement and honorary doctor of laws degree.
In June 2017, Stevenson delivered the 93rd Ware Lecture at the General Assembly of the Unitarian Universalist Association in New Orleans, Louisiana.
Stevenson is featured in episode 45 of the podcast Criminal by Radiotopia from PRX. Host Phoebe Judge talked with Stevenson about his experiences during his 30 years spent working to get people off death row, and about his take on the deserving of mercy.
On May 24, 2018, Stevenson delivered the Commencement address for The Johns Hopkins University Class of 2018.
On May 20, 2019, Stevenson delivered the Commencement address at the University of Pennsylvania.
On May 21, 2021, Freedom, Justice, and Hope with Bryan Stevenson premiered on Jazz at Lincoln Center where he provided reflections on the American narrative of racism and performed pieces on the piano such as "Honeysuckle Rose".
On May 8, 2022, Stevenson delivered the Commencement address at Eastern Mennonite University in Harrisonburg, Virginia. He became the second person to receive an honorary doctorate from the university, the other being Nobel Peace Prize winner Leymah Gbowee.
On May 7, 2023, Stevenson delivered the Commencement address for The Ohio State University Class of 2023.
On October 5, 2023, Stevenson spoke at the President's Leadership Forum held by Whitworth University in Spokane, Washington, where he received an honorary doctorate.
Awards and honors
1991 ACLU National Medal of Liberty
1995 MacArthur Fellow
2000 Olof Palme Prize
2009 Gruber Prize for Justice
2011 Four Freedoms Award in Freedom From Fear
2012 Smithsonian magazine's American Ingenuity Award in Social Progress
2015 Andrew Carnegie Medal for Excellence in Fiction and Nonfiction
2015 Dayton Literary Peace Prize for Nonfiction
2015 Time 100: The 100 Most Influential People
2016 Honorary Doctor of Laws degree conferred by Princeton University
2017 Honorary Doctor of Civil Law degree, conferred honoris causa by the University of Oxford
2017 The Stowe Prize for Writing to Advance Social Justice
2018 People's Champion Award from the 44th People's Choice Awards
2018 The Benjamin Franklin Award for distinguished public service from the American Philosophical Society
2019 Golden Plate Award of the American Academy of Achievement
2019 Honorary Doctor of Laws degree conferred by the University of Pennsylvania
2020 Right Livelihood Award
2020 National Association of Criminal Defense Lawyers Lifetime Achievement Award
2020 Global Citizen Prize for Global Citizen of the Year
2021 The Fitzgerald Prize for Literary Excellence
2021 National Humanities Medal
2023 Honorary Doctor of Humane Letters degree conferred by Whitworth University
Personal life
Stevenson is a lifelong bachelor and has stated that his career is incompatible with married life. He has resided in Montgomery, Alabama since 1985.
Publications
By Bryan Stevenson:
By EJI:
Adaptations
Just Mercy (2019), film directed by Destin Daniel Cretton, based on book Just Mercy: A Story of Justice and Redemption
References
External links
1959 births
Living people
20th-century African-American academics
20th-century African-American lawyers
20th-century American academics
20th-century American lawyers
21st-century African-American academics
21st-century African-American lawyers
21st-century American academics
21st-century American lawyers
Academics from Delaware
Activists for African-American civil rights
African-American activists
African-American Christians
African-American legal scholars
African-American writers
Alabama lawyers
American anti–death penalty activists
American anti-racism activists
American civil rights lawyers
American legal scholars
American social justice activists
Childfree
Children's rights activists
Criminal defense lawyers
Eastern University (United States) alumni
Harvard Kennedy School alumni
Harvard Law School alumni
MacArthur Fellows
New York University School of Law faculty
Olof Palme Prize laureates
People from Milton, Delaware
Prison reformers
Writers from Montgomery, Alabama
|
```xml
import { NodeTransforms } from '../interfaces/transforms/node'
import { Editor } from '../interfaces/editor'
import { Element } from '../interfaces/element'
import { Range } from '../interfaces/range'
import { Path } from '../interfaces/path'
import { PointRef } from '../interfaces/point-ref'
import { Transforms } from '../interfaces/transforms'
import { Node } from '../interfaces/node'
import { Point } from '../interfaces/point'
/**
* Convert a range into a point by deleting it's content.
*/
const deleteRange = (editor: Editor, range: Range): Point | null => {
if (Range.isCollapsed(range)) {
return range.anchor
} else {
const [, end] = Range.edges(range)
const pointRef = Editor.pointRef(editor, end)
Transforms.delete(editor, { at: range })
return pointRef.unref()
}
}
export const splitNodes: NodeTransforms['splitNodes'] = (
editor,
options = {}
) => {
Editor.withoutNormalizing(editor, () => {
const { mode = 'lowest', voids = false } = options
let { match, at = editor.selection, height = 0, always = false } = options
if (match == null) {
match = n => Element.isElement(n) && Editor.isBlock(editor, n)
}
if (Range.isRange(at)) {
at = deleteRange(editor, at)
}
// If the target is a path, the default height-skipping and position
// counters need to account for us potentially splitting at a non-leaf.
if (Path.isPath(at)) {
const path = at
const point = Editor.point(editor, path)
const [parent] = Editor.parent(editor, path)
match = n => n === parent
height = point.path.length - path.length + 1
at = point
always = true
}
if (!at) {
return
}
const beforeRef = Editor.pointRef(editor, at, {
affinity: 'backward',
})
let afterRef: PointRef | undefined
try {
const [highest] = Editor.nodes(editor, { at, match, mode, voids })
if (!highest) {
return
}
const voidMatch = Editor.void(editor, { at, mode: 'highest' })
const nudge = 0
if (!voids && voidMatch) {
const [voidNode, voidPath] = voidMatch
if (Element.isElement(voidNode) && editor.isInline(voidNode)) {
let after = Editor.after(editor, voidPath)
if (!after) {
const text = { text: '' }
const afterPath = Path.next(voidPath)
Transforms.insertNodes(editor, text, { at: afterPath, voids })
after = Editor.point(editor, afterPath)!
}
at = after
always = true
}
const siblingHeight = at.path.length - voidPath.length
height = siblingHeight + 1
always = true
}
afterRef = Editor.pointRef(editor, at)
const depth = at.path.length - height
const [, highestPath] = highest
const lowestPath = at.path.slice(0, depth)
let position = height === 0 ? at.offset : at.path[depth] + nudge
for (const [node, path] of Editor.levels(editor, {
at: lowestPath,
reverse: true,
voids,
})) {
let split = false
if (
path.length < highestPath.length ||
path.length === 0 ||
(!voids && Element.isElement(node) && Editor.isVoid(editor, node))
) {
break
}
const point = beforeRef.current!
const isEnd = Editor.isEnd(editor, point, path)
if (always || !beforeRef || !Editor.isEdge(editor, point, path)) {
split = true
const properties = Node.extractProps(node)
editor.apply({
type: 'split_node',
path,
position,
properties,
})
}
position = path[path.length - 1] + (split || isEnd ? 1 : 0)
}
if (options.at == null) {
const point = afterRef.current || Editor.end(editor, [])
Transforms.select(editor, point)
}
} finally {
beforeRef.unref()
afterRef?.unref()
}
})
}
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.