text
stringlengths 1
22.8M
|
|---|
Stade Beaucairois Football Club is a football club based in Beaucaire, Languedoc-Roussillon, France. It currently plays in the Championnat National 3.
History
The club was founded in 1908 as Stade Beaucairois.
In 2023, Stade Beaucairois 30 merged with Espoir Football Club Beaucarois to form Stade Beaucarois FC.
References
External links
Association football clubs established in 1908
1908 establishments in France
Sport in Gard
Football clubs in Occitania (administrative region)
Beaucaire, Gard
|
```css
/*!
* # Semantic UI 2.2.7 - Shape
* path_to_url
*
*
* Released under the MIT license
* path_to_url
*
*/.ui.shape{position:relative;vertical-align:top;display:inline-block;-webkit-perspective:2000px;perspective:2000px;-webkit-transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out}.ui.shape .sides{-webkit-transform-style:preserve-3d;transform-style:preserve-3d}.ui.shape .side{opacity:1;width:100%;margin:0!important;-webkit-backface-visibility:hidden;backface-visibility:hidden}.ui.shape .side{display:none}.ui.shape .side *{-webkit-backface-visibility:visible!important;backface-visibility:visible!important}.ui.cube.shape .side{min-width:15em;height:15em;padding:2em;background-color:#e6e6e6;color:rgba(0,0,0,.87);box-shadow:0 0 2px rgba(0,0,0,.3)}.ui.cube.shape .side>.content{width:100%;height:100%;display:table;text-align:center;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ui.cube.shape .side>.content>div{display:table-cell;vertical-align:middle;font-size:2em}.ui.text.shape.animating .sides{position:static}.ui.text.shape .side{white-space:nowrap}.ui.text.shape .side>*{white-space:normal}.ui.loading.shape{position:absolute;top:-9999px;left:-9999px}.ui.shape .animating.side{position:absolute;top:0;left:0;display:block;z-index:100}.ui.shape .hidden.side{opacity:.6}.ui.shape.animating .sides{position:absolute}.ui.shape.animating .sides{-webkit-transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out;transition:transform .6s ease-in-out,left .6s ease-in-out,width .6s ease-in-out,height .6s ease-in-out,-webkit-transform .6s ease-in-out}.ui.shape.animating .side{-webkit-transition:opacity .6s ease-in-out;transition:opacity .6s ease-in-out}.ui.shape .active.side{display:block}
```
|
John Bourke may refer to:
John Bourke (Australian footballer), Australian footballer
John Bourke (Australian politician) (1901–1970), Australian politician
John Bourke (Scottish footballer) (born 1953), Scottish footballer
John Bourke, 1st Earl of Mayo (–1790), Irish politician and peer
John Bourke, 2nd Earl of Mayo (–1792), Irish politician and peer
John Bourke, 4th Earl of Mayo (1766–1849), Irish politician and peer
John Gregory Bourke (1846–1896), American Civil War medal of honor recipient
John Philip Bourke (1860–1914), Australian poet
Sir John Bourke of Brittas, Irish Roman Catholic, hanged for refusing to renounce his faith
See also
John Burke (disambiguation)
|
```javascript
import _Fab from '@material-ui/core/Fab';
import { scrollToTopAnimation } from '../../utils/animateScroll';
import React from 'react';
import styled from 'styled-components';
const Fab = styled(_Fab)`
right: 5rem;
bottom: 5rem;
position: fixed;
z-index: 11;
@media (max-width: 480px) {
right: 0.5rem;
}
`;
const ToTopButton = () => {
return (
<Fab
onClick={() => {
scrollToTopAnimation();
}}
color="primary"
>
<span className="fa fa-chevron-up" />
</Fab>
);
};
export default ToTopButton;
```
|
```java
package com.eventyay.organizer.core.event.copyright;
import com.eventyay.organizer.common.Function;
import com.eventyay.organizer.common.mvp.view.Erroneous;
import com.eventyay.organizer.common.mvp.view.Progressive;
import com.eventyay.organizer.common.mvp.view.Successful;
import com.google.android.material.textfield.TextInputLayout;
void dismiss();
void validate(TextInputLayout textInputLayout, Function<String, Boolean> function, String str);
}
```
|
CNU could stand for:
University
Capital Normal University, Beijing, China
Cebu Normal University, Philippines
Chia Nan University of Pharmacy and Science, Tainan, Taiwan
Chonnam National University, Gwangju, South Korea
Christopher Newport University, Newport News, Virginia, US
Chungnam National University, Daejeon, South Korea
Police
Crisis Negotiation Unit, a special police unit for hostage, barricade, and suicide situations
FBI Crisis Negotiation Unit
Singapore Police Force Crisis Negotiation Unit
Others
Cameroonian National Union, later Cameroon People's Democratic Movement
Congress for the New Urbanism
CNU (singer) (born 1991), Korean
|
```html
<html>
<head>
<title>NVIDIA(R) PhysX(R) SDK 3.4 API Reference: Member List</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK HREF="NVIDIA.css" REL="stylesheet" TYPE="text/css">
</head>
<body bgcolor="#FFFFFF">
<div id="header">
<hr class="first">
<img alt="" src="images/PhysXlogo.png" align="middle"> <br>
<center>
<a class="qindex" href="main.html">Main Page</a>
<a class="qindex" href="hierarchy.html">Class Hierarchy</a>
<a class="qindex" href="annotated.html">Compound List</a>
<a class="qindex" href="functions.html">Compound Members</a>
</center>
<hr class="second">
</div>
<!-- Generated by Doxygen 1.5.8 -->
<div class="contents">
<h1>PxD6JointDriveFlag Member List</h1>This is the complete list of members for <a class="el" href="structPxD6JointDriveFlag.html">PxD6JointDriveFlag</a>, including all inherited members.<p><table>
<tr class="memlist"><td><a class="el" href="structPxD6JointDriveFlag.html#your_sha256_hash>eACCELERATION</a> enum value</td><td><a class="el" href="structPxD6JointDriveFlag.html">PxD6JointDriveFlag</a></td><td></td></tr>
<tr class="memlist"><td><a class="el" href="structPxD6JointDriveFlag.html#0560fd8c87c7004eb8c52a17a549e42e">Enum</a> enum name</td><td><a class="el" href="structPxD6JointDriveFlag.html">PxD6JointDriveFlag</a></td><td></td></tr>
</table></div>
<hr style="width: 100%; height: 2px;"><br>
</body>
</html>
```
|
Palaeosiamoglaris is a genus of fossil psocids in the family Prionoglarididae, found in mesozoic amber.
References
Trogiomorpha
Prehistoric insect genera
|
The Hoosier Plains Conference is an Indiana-based high school athletic conference formed in 2017.
Current Members
Former members
Conference championships
Boys basketball
Girls basketball
Boys Soccer
Girls Soccer
Volleyball
References
Indiana high school athletic conferences
High school sports conferences and leagues in the United States
|
John Gibson may refer to:
Sports
John Gibson (Nottingham cricketer), English cricketer
John Gibson (cricketer, born 1833) (1833–1892), English priest and cricketer
John Gibson (footballer, born 1967), Scottish football player
John Gibson (footballer, born 1989), footballer who plays for Dundee
John Gibson (ice hockey, born 1959) (1959–2020), Canadian and ex-NHL hockey player, winner of the 1979–1980 Governor's Trophy
John Gibson (ice hockey, born 1993), American ice hockey goaltender
John Gibson (motorcycle racer), 1956 Daytona 200 winner
Johnny Gibson (John Anthony Gibson, 1905–2006), American 400 meter hurdles world record holder
Johnny Gibson (footballer) (born 1950), Scottish footballer (Partick Thistle)
Law and politics
John Arthur Gibson (1850–1912), Six Nations Reserve chief of the Haudenosaunee (Iroquois)
John Gibson (Philadelphia), mayor of Philadelphia, 1771–1773
John Gibson (police officer) (1956–1998), U.S. Capitol police officer killed in the line of duty 1998
John Bannister Gibson (1780–1853), Pennsylvania attorney and judge
John C. Gibson (born 1934), American Republican politician from New Jersey
John R. Gibson (1925–2014), American judge
John S. Gibson Jr. (1902–1987), Los Angeles City Councilman, 1981–1982
John S. Gibson (1893–1960), U.S. Representative from Georgia
John George Gibson (1846–1923), Irish lawyer and Conservative politician
John Lambert Gibson (1906–1986), independent member of the Canadian House of Commons
Sir John Morison Gibson (1842–1929), Attorney-General and Lieutenant Governor of Ontario
John Gibson (Australian politician) (1857–1941), member of the Tasmanian House of Assembly
John Gibson (New Zealand lawyer) (1936–2009), cricket selector and Queen's Counsel
Others
John Gibson (architect) (1817–1892), British architect
John Gibson (cartographer) (1750–1792), English cartographer and engraver
Sir John Gibson (editor and journalist) (1841–1915), Anglo-Welsh journalist and proprietor of The Cambrian News
John Gibson (political commentator) (born 1946), American talk radio host for Fox News Radio
John Gibson (sculptor) (1790–1866), British sculptor
John Gibson (American soldier) (1740–1822), American soldier, Territorial Secretary and acting governor of Indiana Territory, namesake of Gibson County, Indiana
John Gibson (RAF officer) (1916–2000), English aviator and WWII air ace
John Douglas Gibson (1924–1984), Australian amateur ornithologist
John H. Gibson, American soldier of the Natchez Expedition and the Creek War, namesake of Gibson County, Tennessee
John H. Gibson (born 1959), American (Texas) businessman and Assistant Secretary of the Air Force
John T. Gibson (1878–1937), American businessman and theatre manager and producer of black artists in Philadelphia
Sir John Gibson (British Army officer) (c. 1637–1717), British soldier and politician
Sir John Watson Gibson (1885–1947), English civil engineer
John Gibson (songwriter) (fl. 1812), English poet and songwriter
John Gibson (priest), English priest
John Gibson, former CEO of Tripwire Interactive
John-Michael Gibson, American rapper known professionally as Cash Out
See also
Jack Gibson (disambiguation)
Jon Gibson (disambiguation)
|
```c
/*
* ARM NEON optimised audio functions
*
* This file is part of FFmpeg.
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
*
* You should have received a copy of the GNU Lesser General Public
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include <stdint.h>
#include "libavutil/attributes.h"
#include "libavcodec/audiodsp.h"
#include "audiodsp_arm.h"
void ff_vector_clipf_neon(float *dst, const float *src, float min, float max,
int len);
void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
int32_t max, unsigned int len);
int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
av_cold void ff_audiodsp_init_neon(AudioDSPContext *c)
{
c->vector_clip_int32 = ff_vector_clip_int32_neon;
c->vector_clipf = ff_vector_clipf_neon;
c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
}
```
|
Pangyo Junction (), also known as Pangyo JC, is a junction located in Bundang-gu and Sujeong-gu, Seongnam, Gyeonggi, South Korea. It serves as the meeting point of Gyeongbu Expressway (No. 1) and Seoul Ring Expressway (No. 100). It is named after the new town in which it is located, Pangyo. The type of junction is Changed Y interchange.
Gyeongbu Expressway
Seoul Ring Expressway
Expressway junctions in South Korea
Seongnam
|
"Salió el Sol" ("The Sun Came Out") is the third single by Don Omar taken from his album King of Kings. The song appears in Grand Theft Auto IV.
Music video
The music video was released on December 24, 2006. Upon release, the video has managed to surpass over 150 million views on YouTube. The video is also featured on the DV of the deluxe r-release am King of Kings: Armageddon Edition.
Chart positions
References
2006 songs
2006 singles
Spanish-language songs
Don Omar songs
Songs written by Don Omar
Universal Music Group singles
|
```python
# encoding: utf8
from __future__ import unicode_literals
import pytest
@pytest.mark.parametrize('text,expected_tokens',
[(' ', ['', '', '', '', ''])])
def test_tokenizer_handles_abbreviation(he_tokenizer, text, expected_tokens):
tokens = he_tokenizer(text)
token_list = [token.text for token in tokens if not token.is_space]
assert expected_tokens == token_list
@pytest.mark.parametrize('text,expected_tokens', [
(' .', ['', '', '', '', '', '.']),
(' ?', ['', '', '', '', '', '?']),
(' !', ['', '', '', '', '', '!']),
(' ..', ['', '', '', '', '', '..']),
(' ...', ['', '', '', '', '', '...'])])
def test_tokenizer_handles_punct(he_tokenizer, text, expected_tokens):
tokens = he_tokenizer(text)
assert expected_tokens == [token.text for token in tokens]
```
|
```c++
//===---- ParseStmtAsm.cpp - Assembly Statement Parser --------------------===//
//
// See path_to_url for license information.
//
//===your_sha256_hash------===//
//
// This file implements parsing for GCC and Microsoft inline assembly.
//
//===your_sha256_hash------===//
#include "clang/AST/ASTContext.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "clang/Parse/Parser.h"
#include "clang/Parse/RAIIObjectsForParser.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/MC/MCAsmInfo.h"
#include "llvm/MC/MCContext.h"
#include "llvm/MC/MCInstPrinter.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCObjectFileInfo.h"
#include "llvm/MC/MCParser/MCAsmParser.h"
#include "llvm/MC/MCParser/MCTargetAsmParser.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MCTargetOptions.h"
#include "llvm/MC/TargetRegistry.h"
#include "llvm/Support/SourceMgr.h"
#include "llvm/Support/TargetSelect.h"
using namespace clang;
namespace {
class ClangAsmParserCallback : public llvm::MCAsmParserSemaCallback {
Parser &TheParser;
SourceLocation AsmLoc;
StringRef AsmString;
/// The tokens we streamed into AsmString and handed off to MC.
ArrayRef<Token> AsmToks;
/// The offset of each token in AsmToks within AsmString.
ArrayRef<unsigned> AsmTokOffsets;
public:
ClangAsmParserCallback(Parser &P, SourceLocation Loc, StringRef AsmString,
ArrayRef<Token> Toks, ArrayRef<unsigned> Offsets)
: TheParser(P), AsmLoc(Loc), AsmString(AsmString), AsmToks(Toks),
AsmTokOffsets(Offsets) {
assert(AsmToks.size() == AsmTokOffsets.size());
}
void LookupInlineAsmIdentifier(StringRef &LineBuf,
llvm::InlineAsmIdentifierInfo &Info,
bool IsUnevaluatedContext) override;
StringRef LookupInlineAsmLabel(StringRef Identifier, llvm::SourceMgr &LSM,
llvm::SMLoc Location,
bool Create) override;
bool LookupInlineAsmField(StringRef Base, StringRef Member,
unsigned &Offset) override {
return TheParser.getActions().LookupInlineAsmField(Base, Member, Offset,
AsmLoc);
}
static void DiagHandlerCallback(const llvm::SMDiagnostic &D, void *Context) {
((ClangAsmParserCallback *)Context)->handleDiagnostic(D);
}
private:
/// Collect the appropriate tokens for the given string.
void findTokensForString(StringRef Str, SmallVectorImpl<Token> &TempToks,
const Token *&FirstOrigToken) const;
SourceLocation translateLocation(const llvm::SourceMgr &LSM,
llvm::SMLoc SMLoc);
void handleDiagnostic(const llvm::SMDiagnostic &D);
};
}
void ClangAsmParserCallback::LookupInlineAsmIdentifier(
StringRef &LineBuf, llvm::InlineAsmIdentifierInfo &Info,
bool IsUnevaluatedContext) {
// Collect the desired tokens.
SmallVector<Token, 16> LineToks;
const Token *FirstOrigToken = nullptr;
findTokensForString(LineBuf, LineToks, FirstOrigToken);
unsigned NumConsumedToks;
ExprResult Result = TheParser.ParseMSAsmIdentifier(LineToks, NumConsumedToks,
IsUnevaluatedContext);
// If we consumed the entire line, tell MC that.
// Also do this if we consumed nothing as a way of reporting failure.
if (NumConsumedToks == 0 || NumConsumedToks == LineToks.size()) {
// By not modifying LineBuf, we're implicitly consuming it all.
// Otherwise, consume up to the original tokens.
} else {
assert(FirstOrigToken && "not using original tokens?");
// Since we're using original tokens, apply that offset.
assert(FirstOrigToken[NumConsumedToks].getLocation() ==
LineToks[NumConsumedToks].getLocation());
unsigned FirstIndex = FirstOrigToken - AsmToks.begin();
unsigned LastIndex = FirstIndex + NumConsumedToks - 1;
// The total length we've consumed is the relative offset
// of the last token we consumed plus its length.
unsigned TotalOffset =
(AsmTokOffsets[LastIndex] + AsmToks[LastIndex].getLength() -
AsmTokOffsets[FirstIndex]);
LineBuf = LineBuf.substr(0, TotalOffset);
}
// Initialize Info with the lookup result.
if (!Result.isUsable())
return;
TheParser.getActions().FillInlineAsmIdentifierInfo(Result.get(), Info);
}
StringRef ClangAsmParserCallback::LookupInlineAsmLabel(StringRef Identifier,
llvm::SourceMgr &LSM,
llvm::SMLoc Location,
bool Create) {
SourceLocation Loc = translateLocation(LSM, Location);
LabelDecl *Label =
TheParser.getActions().GetOrCreateMSAsmLabel(Identifier, Loc, Create);
return Label->getMSAsmLabel();
}
void ClangAsmParserCallback::findTokensForString(
StringRef Str, SmallVectorImpl<Token> &TempToks,
const Token *&FirstOrigToken) const {
// For now, assert that the string we're working with is a substring
// of what we gave to MC. This lets us use the original tokens.
assert(!std::less<const char *>()(Str.begin(), AsmString.begin()) &&
!std::less<const char *>()(AsmString.end(), Str.end()));
// Try to find a token whose offset matches the first token.
unsigned FirstCharOffset = Str.begin() - AsmString.begin();
const unsigned *FirstTokOffset =
llvm::lower_bound(AsmTokOffsets, FirstCharOffset);
// For now, assert that the start of the string exactly
// corresponds to the start of a token.
assert(*FirstTokOffset == FirstCharOffset);
// Use all the original tokens for this line. (We assume the
// end of the line corresponds cleanly to a token break.)
unsigned FirstTokIndex = FirstTokOffset - AsmTokOffsets.begin();
FirstOrigToken = &AsmToks[FirstTokIndex];
unsigned LastCharOffset = Str.end() - AsmString.begin();
for (unsigned i = FirstTokIndex, e = AsmTokOffsets.size(); i != e; ++i) {
if (AsmTokOffsets[i] >= LastCharOffset)
break;
TempToks.push_back(AsmToks[i]);
}
}
SourceLocation
ClangAsmParserCallback::translateLocation(const llvm::SourceMgr &LSM,
llvm::SMLoc SMLoc) {
// Compute an offset into the inline asm buffer.
// FIXME: This isn't right if .macro is involved (but hopefully, no
// real-world code does that).
const llvm::MemoryBuffer *LBuf =
LSM.getMemoryBuffer(LSM.FindBufferContainingLoc(SMLoc));
unsigned Offset = SMLoc.getPointer() - LBuf->getBufferStart();
// Figure out which token that offset points into.
const unsigned *TokOffsetPtr = llvm::lower_bound(AsmTokOffsets, Offset);
unsigned TokIndex = TokOffsetPtr - AsmTokOffsets.begin();
unsigned TokOffset = *TokOffsetPtr;
// If we come up with an answer which seems sane, use it; otherwise,
// just point at the __asm keyword.
// FIXME: Assert the answer is sane once we handle .macro correctly.
SourceLocation Loc = AsmLoc;
if (TokIndex < AsmToks.size()) {
const Token &Tok = AsmToks[TokIndex];
Loc = Tok.getLocation();
Loc = Loc.getLocWithOffset(Offset - TokOffset);
}
return Loc;
}
void ClangAsmParserCallback::handleDiagnostic(const llvm::SMDiagnostic &D) {
const llvm::SourceMgr &LSM = *D.getSourceMgr();
SourceLocation Loc = translateLocation(LSM, D.getLoc());
TheParser.Diag(Loc, diag::err_inline_ms_asm_parsing) << D.getMessage();
}
/// Parse an identifier in an MS-style inline assembly block.
ExprResult Parser::ParseMSAsmIdentifier(llvm::SmallVectorImpl<Token> &LineToks,
unsigned &NumLineToksConsumed,
bool IsUnevaluatedContext) {
// Push a fake token on the end so that we don't overrun the token
// stream. We use ';' because it expression-parsing should never
// overrun it.
const tok::TokenKind EndOfStream = tok::semi;
Token EndOfStreamTok;
EndOfStreamTok.startToken();
EndOfStreamTok.setKind(EndOfStream);
LineToks.push_back(EndOfStreamTok);
// Also copy the current token over.
LineToks.push_back(Tok);
PP.EnterTokenStream(LineToks, /*DisableMacroExpansions*/ true,
/*IsReinject*/ true);
// Clear the current token and advance to the first token in LineToks.
ConsumeAnyToken();
// Parse an optional scope-specifier if we're in C++.
CXXScopeSpec SS;
if (getLangOpts().CPlusPlus)
ParseOptionalCXXScopeSpecifier(SS, /*ObjectType=*/nullptr,
/*ObjectHasErrors=*/false,
/*EnteringContext=*/false);
// Require an identifier here.
SourceLocation TemplateKWLoc;
UnqualifiedId Id;
bool Invalid = true;
ExprResult Result;
if (Tok.is(tok::kw_this)) {
Result = ParseCXXThis();
Invalid = false;
} else {
Invalid =
ParseUnqualifiedId(SS, /*ObjectType=*/nullptr,
/*ObjectHadErrors=*/false,
/*EnteringContext=*/false,
/*AllowDestructorName=*/false,
/*AllowConstructorName=*/false,
/*AllowDeductionGuide=*/false, &TemplateKWLoc, Id);
// Perform the lookup.
Result = Actions.LookupInlineAsmIdentifier(SS, TemplateKWLoc, Id,
IsUnevaluatedContext);
}
// While the next two tokens are 'period' 'identifier', repeatedly parse it as
// a field access. We have to avoid consuming assembler directives that look
// like '.' 'else'.
while (Result.isUsable() && Tok.is(tok::period)) {
Token IdTok = PP.LookAhead(0);
if (IdTok.isNot(tok::identifier))
break;
ConsumeToken(); // Consume the period.
IdentifierInfo *Id = Tok.getIdentifierInfo();
ConsumeToken(); // Consume the identifier.
Result = Actions.LookupInlineAsmVarDeclField(Result.get(), Id->getName(),
Tok.getLocation());
}
// Figure out how many tokens we are into LineToks.
unsigned LineIndex = 0;
if (Tok.is(EndOfStream)) {
LineIndex = LineToks.size() - 2;
} else {
while (LineToks[LineIndex].getLocation() != Tok.getLocation()) {
LineIndex++;
assert(LineIndex < LineToks.size() - 2); // we added two extra tokens
}
}
// If we've run into the poison token we inserted before, or there
// was a parsing error, then claim the entire line.
if (Invalid || Tok.is(EndOfStream)) {
NumLineToksConsumed = LineToks.size() - 2;
} else {
// Otherwise, claim up to the start of the next token.
NumLineToksConsumed = LineIndex;
}
// Finally, restore the old parsing state by consuming all the tokens we
// staged before, implicitly killing off the token-lexer we pushed.
for (unsigned i = 0, e = LineToks.size() - LineIndex - 2; i != e; ++i) {
ConsumeAnyToken();
}
assert(Tok.is(EndOfStream));
ConsumeToken();
// Leave LineToks in its original state.
LineToks.pop_back();
LineToks.pop_back();
return Result;
}
/// Turn a sequence of our tokens back into a string that we can hand
/// to the MC asm parser.
static bool buildMSAsmString(Preprocessor &PP, SourceLocation AsmLoc,
ArrayRef<Token> AsmToks,
SmallVectorImpl<unsigned> &TokOffsets,
SmallString<512> &Asm) {
assert(!AsmToks.empty() && "Didn't expect an empty AsmToks!");
// Is this the start of a new assembly statement?
bool isNewStatement = true;
for (unsigned i = 0, e = AsmToks.size(); i < e; ++i) {
const Token &Tok = AsmToks[i];
// Start each new statement with a newline and a tab.
if (!isNewStatement && (Tok.is(tok::kw_asm) || Tok.isAtStartOfLine())) {
Asm += "\n\t";
isNewStatement = true;
}
// Preserve the existence of leading whitespace except at the
// start of a statement.
if (!isNewStatement && Tok.hasLeadingSpace())
Asm += ' ';
// Remember the offset of this token.
TokOffsets.push_back(Asm.size());
// Don't actually write '__asm' into the assembly stream.
if (Tok.is(tok::kw_asm)) {
// Complain about __asm at the end of the stream.
if (i + 1 == e) {
PP.Diag(AsmLoc, diag::err_asm_empty);
return true;
}
continue;
}
// Append the spelling of the token.
SmallString<32> SpellingBuffer;
bool SpellingInvalid = false;
Asm += PP.getSpelling(Tok, SpellingBuffer, &SpellingInvalid);
assert(!SpellingInvalid && "spelling was invalid after correct parse?");
// We are no longer at the start of a statement.
isNewStatement = false;
}
// Ensure that the buffer is null-terminated.
Asm.push_back('\0');
Asm.pop_back();
assert(TokOffsets.size() == AsmToks.size());
return false;
}
// Determine if this is a GCC-style asm statement.
bool Parser::isGCCAsmStatement(const Token &TokAfterAsm) const {
return TokAfterAsm.is(tok::l_paren) || isGNUAsmQualifier(TokAfterAsm);
}
bool Parser::isGNUAsmQualifier(const Token &TokAfterAsm) const {
return getGNUAsmQualifier(TokAfterAsm) != GNUAsmQualifiers::AQ_unspecified;
}
/// ParseMicrosoftAsmStatement. When -fms-extensions/-fasm-blocks is enabled,
/// this routine is called to collect the tokens for an MS asm statement.
///
/// [MS] ms-asm-statement:
/// ms-asm-block
/// ms-asm-block ms-asm-statement
///
/// [MS] ms-asm-block:
/// '__asm' ms-asm-line '\n'
/// '__asm' '{' ms-asm-instruction-block[opt] '}' ';'[opt]
///
/// [MS] ms-asm-instruction-block
/// ms-asm-line
/// ms-asm-line '\n' ms-asm-instruction-block
///
StmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {
SourceManager &SrcMgr = PP.getSourceManager();
SourceLocation EndLoc = AsmLoc;
SmallVector<Token, 4> AsmToks;
bool SingleLineMode = true;
unsigned BraceNesting = 0;
unsigned short savedBraceCount = BraceCount;
bool InAsmComment = false;
FileID FID;
unsigned LineNo = 0;
unsigned NumTokensRead = 0;
SmallVector<SourceLocation, 4> LBraceLocs;
bool SkippedStartOfLine = false;
if (Tok.is(tok::l_brace)) {
// Braced inline asm: consume the opening brace.
SingleLineMode = false;
BraceNesting = 1;
EndLoc = ConsumeBrace();
LBraceLocs.push_back(EndLoc);
++NumTokensRead;
} else {
// Single-line inline asm; compute which line it is on.
std::pair<FileID, unsigned> ExpAsmLoc =
SrcMgr.getDecomposedExpansionLoc(EndLoc);
FID = ExpAsmLoc.first;
LineNo = SrcMgr.getLineNumber(FID, ExpAsmLoc.second);
LBraceLocs.push_back(SourceLocation());
}
SourceLocation TokLoc = Tok.getLocation();
do {
// If we hit EOF, we're done, period.
if (isEofOrEom())
break;
if (!InAsmComment && Tok.is(tok::l_brace)) {
// Consume the opening brace.
SkippedStartOfLine = Tok.isAtStartOfLine();
AsmToks.push_back(Tok);
EndLoc = ConsumeBrace();
BraceNesting++;
LBraceLocs.push_back(EndLoc);
TokLoc = Tok.getLocation();
++NumTokensRead;
continue;
} else if (!InAsmComment && Tok.is(tok::semi)) {
// A semicolon in an asm is the start of a comment.
InAsmComment = true;
if (!SingleLineMode) {
// Compute which line the comment is on.
std::pair<FileID, unsigned> ExpSemiLoc =
SrcMgr.getDecomposedExpansionLoc(TokLoc);
FID = ExpSemiLoc.first;
LineNo = SrcMgr.getLineNumber(FID, ExpSemiLoc.second);
}
} else if (SingleLineMode || InAsmComment) {
// If end-of-line is significant, check whether this token is on a
// new line.
std::pair<FileID, unsigned> ExpLoc =
SrcMgr.getDecomposedExpansionLoc(TokLoc);
if (ExpLoc.first != FID ||
SrcMgr.getLineNumber(ExpLoc.first, ExpLoc.second) != LineNo) {
// If this is a single-line __asm, we're done, except if the next
// line is MS-style asm too, in which case we finish a comment
// if needed and then keep processing the next line as a single
// line __asm.
bool isAsm = Tok.is(tok::kw_asm);
if (SingleLineMode && (!isAsm || isGCCAsmStatement(NextToken())))
break;
// We're no longer in a comment.
InAsmComment = false;
if (isAsm) {
// If this is a new __asm {} block we want to process it separately
// from the single-line __asm statements
if (PP.LookAhead(0).is(tok::l_brace))
break;
LineNo = SrcMgr.getLineNumber(ExpLoc.first, ExpLoc.second);
SkippedStartOfLine = Tok.isAtStartOfLine();
} else if (Tok.is(tok::semi)) {
// A multi-line asm-statement, where next line is a comment
InAsmComment = true;
FID = ExpLoc.first;
LineNo = SrcMgr.getLineNumber(FID, ExpLoc.second);
}
} else if (!InAsmComment && Tok.is(tok::r_brace)) {
// In MSVC mode, braces only participate in brace matching and
// separating the asm statements. This is an intentional
// departure from the Apple gcc behavior.
if (!BraceNesting)
break;
}
}
if (!InAsmComment && BraceNesting && Tok.is(tok::r_brace) &&
BraceCount == (savedBraceCount + BraceNesting)) {
// Consume the closing brace.
SkippedStartOfLine = Tok.isAtStartOfLine();
// Don't want to add the closing brace of the whole asm block
if (SingleLineMode || BraceNesting > 1) {
Tok.clearFlag(Token::LeadingSpace);
AsmToks.push_back(Tok);
}
EndLoc = ConsumeBrace();
BraceNesting--;
// Finish if all of the opened braces in the inline asm section were
// consumed.
if (BraceNesting == 0 && !SingleLineMode)
break;
else {
LBraceLocs.pop_back();
TokLoc = Tok.getLocation();
++NumTokensRead;
continue;
}
}
// Consume the next token; make sure we don't modify the brace count etc.
// if we are in a comment.
EndLoc = TokLoc;
if (InAsmComment)
PP.Lex(Tok);
else {
// Set the token as the start of line if we skipped the original start
// of line token in case it was a nested brace.
if (SkippedStartOfLine)
Tok.setFlag(Token::StartOfLine);
AsmToks.push_back(Tok);
ConsumeAnyToken();
}
TokLoc = Tok.getLocation();
++NumTokensRead;
SkippedStartOfLine = false;
} while (true);
if (BraceNesting && BraceCount != savedBraceCount) {
// __asm without closing brace (this can happen at EOF).
for (unsigned i = 0; i < BraceNesting; ++i) {
Diag(Tok, diag::err_expected) << tok::r_brace;
Diag(LBraceLocs.back(), diag::note_matching) << tok::l_brace;
LBraceLocs.pop_back();
}
return StmtError();
} else if (NumTokensRead == 0) {
// Empty __asm.
Diag(Tok, diag::err_expected) << tok::l_brace;
return StmtError();
}
// Okay, prepare to use MC to parse the assembly.
SmallVector<StringRef, 4> ConstraintRefs;
SmallVector<Expr *, 4> Exprs;
SmallVector<StringRef, 4> ClobberRefs;
// We need an actual supported target.
const llvm::Triple &TheTriple = Actions.Context.getTargetInfo().getTriple();
const std::string &TT = TheTriple.getTriple();
const llvm::Target *TheTarget = nullptr;
if (!TheTriple.isX86()) {
Diag(AsmLoc, diag::err_msasm_unsupported_arch) << TheTriple.getArchName();
} else {
std::string Error;
TheTarget = llvm::TargetRegistry::lookupTarget(TT, Error);
if (!TheTarget)
Diag(AsmLoc, diag::err_msasm_unable_to_create_target) << Error;
}
assert(!LBraceLocs.empty() && "Should have at least one location here");
SmallString<512> AsmString;
auto EmptyStmt = [&] {
return Actions.ActOnMSAsmStmt(AsmLoc, LBraceLocs[0], AsmToks, AsmString,
/*NumOutputs*/ 0, /*NumInputs*/ 0,
ConstraintRefs, ClobberRefs, Exprs, EndLoc);
};
// If we don't support assembly, or the assembly is empty, we don't
// need to instantiate the AsmParser, etc.
if (!TheTarget || AsmToks.empty()) {
return EmptyStmt();
}
// Expand the tokens into a string buffer.
SmallVector<unsigned, 8> TokOffsets;
if (buildMSAsmString(PP, AsmLoc, AsmToks, TokOffsets, AsmString))
return StmtError();
const TargetOptions &TO = Actions.Context.getTargetInfo().getTargetOpts();
std::string FeaturesStr =
llvm::join(TO.Features.begin(), TO.Features.end(), ",");
std::unique_ptr<llvm::MCRegisterInfo> MRI(TheTarget->createMCRegInfo(TT));
if (!MRI) {
Diag(AsmLoc, diag::err_msasm_unable_to_create_target)
<< "target MC unavailable";
return EmptyStmt();
}
// FIXME: init MCOptions from sanitizer flags here.
llvm::MCTargetOptions MCOptions;
std::unique_ptr<llvm::MCAsmInfo> MAI(
TheTarget->createMCAsmInfo(*MRI, TT, MCOptions));
// Get the instruction descriptor.
std::unique_ptr<llvm::MCInstrInfo> MII(TheTarget->createMCInstrInfo());
std::unique_ptr<llvm::MCSubtargetInfo> STI(
TheTarget->createMCSubtargetInfo(TT, TO.CPU, FeaturesStr));
// Target MCTargetDesc may not be linked in clang-based tools.
if (!MAI || !MII || !STI) {
Diag(AsmLoc, diag::err_msasm_unable_to_create_target)
<< "target MC unavailable";
return EmptyStmt();
}
llvm::SourceMgr TempSrcMgr;
llvm::MCContext Ctx(TheTriple, MAI.get(), MRI.get(), STI.get(), &TempSrcMgr);
std::unique_ptr<llvm::MCObjectFileInfo> MOFI(
TheTarget->createMCObjectFileInfo(Ctx, /*PIC=*/false));
Ctx.setObjectFileInfo(MOFI.get());
std::unique_ptr<llvm::MemoryBuffer> Buffer =
llvm::MemoryBuffer::getMemBuffer(AsmString, "<MS inline asm>");
// Tell SrcMgr about this buffer, which is what the parser will pick up.
TempSrcMgr.AddNewSourceBuffer(std::move(Buffer), llvm::SMLoc());
std::unique_ptr<llvm::MCStreamer> Str(createNullStreamer(Ctx));
std::unique_ptr<llvm::MCAsmParser> Parser(
createMCAsmParser(TempSrcMgr, Ctx, *Str.get(), *MAI));
std::unique_ptr<llvm::MCTargetAsmParser> TargetParser(
TheTarget->createMCAsmParser(*STI, *Parser, *MII, MCOptions));
// Target AsmParser may not be linked in clang-based tools.
if (!TargetParser) {
Diag(AsmLoc, diag::err_msasm_unable_to_create_target)
<< "target ASM parser unavailable";
return EmptyStmt();
}
std::unique_ptr<llvm::MCInstPrinter> IP(
TheTarget->createMCInstPrinter(llvm::Triple(TT), 1, *MAI, *MII, *MRI));
// Change to the Intel dialect.
Parser->setAssemblerDialect(1);
Parser->setTargetParser(*TargetParser.get());
Parser->setParsingMSInlineAsm(true);
TargetParser->setParsingMSInlineAsm(true);
ClangAsmParserCallback Callback(*this, AsmLoc, AsmString, AsmToks,
TokOffsets);
TargetParser->setSemaCallback(&Callback);
TempSrcMgr.setDiagHandler(ClangAsmParserCallback::DiagHandlerCallback,
&Callback);
unsigned NumOutputs;
unsigned NumInputs;
std::string AsmStringIR;
SmallVector<std::pair<void *, bool>, 4> OpExprs;
SmallVector<std::string, 4> Constraints;
SmallVector<std::string, 4> Clobbers;
if (Parser->parseMSInlineAsm(AsmStringIR, NumOutputs, NumInputs, OpExprs,
Constraints, Clobbers, MII.get(), IP.get(),
Callback))
return StmtError();
// Filter out "fpsw" and "mxcsr". They aren't valid GCC asm clobber
// constraints. Clang always adds fpsr to the clobber list anyway.
llvm::erase_if(Clobbers, [](const std::string &C) {
return C == "fpsr" || C == "mxcsr";
});
// Build the vector of clobber StringRefs.
ClobberRefs.insert(ClobberRefs.end(), Clobbers.begin(), Clobbers.end());
// Recast the void pointers and build the vector of constraint StringRefs.
unsigned NumExprs = NumOutputs + NumInputs;
ConstraintRefs.resize(NumExprs);
Exprs.resize(NumExprs);
for (unsigned i = 0, e = NumExprs; i != e; ++i) {
Expr *OpExpr = static_cast<Expr *>(OpExprs[i].first);
if (!OpExpr)
return StmtError();
// Need address of variable.
if (OpExprs[i].second)
OpExpr =
Actions.BuildUnaryOp(getCurScope(), AsmLoc, UO_AddrOf, OpExpr).get();
ConstraintRefs[i] = StringRef(Constraints[i]);
Exprs[i] = OpExpr;
}
// FIXME: We should be passing source locations for better diagnostics.
return Actions.ActOnMSAsmStmt(AsmLoc, LBraceLocs[0], AsmToks, AsmStringIR,
NumOutputs, NumInputs, ConstraintRefs,
ClobberRefs, Exprs, EndLoc);
}
/// parseGNUAsmQualifierListOpt - Parse a GNU extended asm qualifier list.
/// asm-qualifier:
/// volatile
/// inline
/// goto
///
/// asm-qualifier-list:
/// asm-qualifier
/// asm-qualifier-list asm-qualifier
bool Parser::parseGNUAsmQualifierListOpt(GNUAsmQualifiers &AQ) {
while (true) {
const GNUAsmQualifiers::AQ A = getGNUAsmQualifier(Tok);
if (A == GNUAsmQualifiers::AQ_unspecified) {
if (Tok.isNot(tok::l_paren)) {
Diag(Tok.getLocation(), diag::err_asm_qualifier_ignored);
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
return false;
}
if (AQ.setAsmQualifier(A))
Diag(Tok.getLocation(), diag::err_asm_duplicate_qual)
<< GNUAsmQualifiers::getQualifierName(A);
ConsumeToken();
}
return false;
}
/// ParseAsmStatement - Parse a GNU extended asm statement.
/// asm-statement:
/// gnu-asm-statement
/// ms-asm-statement
///
/// [GNU] gnu-asm-statement:
/// 'asm' asm-qualifier-list[opt] '(' asm-argument ')' ';'
///
/// [GNU] asm-argument:
/// asm-string-literal
/// asm-string-literal ':' asm-operands[opt]
/// asm-string-literal ':' asm-operands[opt] ':' asm-operands[opt]
/// asm-string-literal ':' asm-operands[opt] ':' asm-operands[opt]
/// ':' asm-clobbers
///
/// [GNU] asm-clobbers:
/// asm-string-literal
/// asm-clobbers ',' asm-string-literal
///
StmtResult Parser::ParseAsmStatement(bool &msAsm) {
assert(Tok.is(tok::kw_asm) && "Not an asm stmt");
SourceLocation AsmLoc = ConsumeToken();
if (getLangOpts().AsmBlocks && !isGCCAsmStatement(Tok)) {
msAsm = true;
return ParseMicrosoftAsmStatement(AsmLoc);
}
SourceLocation Loc = Tok.getLocation();
GNUAsmQualifiers GAQ;
if (parseGNUAsmQualifierListOpt(GAQ))
return StmtError();
if (GAQ.isGoto() && getLangOpts().SpeculativeLoadHardening)
Diag(Loc, diag::warn_slh_does_not_support_asm_goto);
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
ExprResult AsmString(ParseAsmStringLiteral(/*ForAsmLabel*/ false));
// Check if GNU-style InlineAsm is disabled.
// Error on anything other than empty string.
if (!(getLangOpts().GNUAsm || AsmString.isInvalid())) {
const auto *SL = cast<StringLiteral>(AsmString.get());
if (!SL->getString().trim().empty())
Diag(Loc, diag::err_gnu_inline_asm_disabled);
}
if (AsmString.isInvalid()) {
// Consume up to and including the closing paren.
T.skipToEnd();
return StmtError();
}
SmallVector<IdentifierInfo *, 4> Names;
ExprVector Constraints;
ExprVector Exprs;
ExprVector Clobbers;
if (Tok.is(tok::r_paren)) {
// We have a simple asm expression like 'asm("foo")'.
T.consumeClose();
return Actions.ActOnGCCAsmStmt(
AsmLoc, /*isSimple*/ true, GAQ.isVolatile(),
/*NumOutputs*/ 0, /*NumInputs*/ 0, nullptr, Constraints, Exprs,
AsmString.get(), Clobbers, /*NumLabels*/ 0, T.getCloseLocation());
}
// Parse Outputs, if present.
bool AteExtraColon = false;
if (Tok.is(tok::colon) || Tok.is(tok::coloncolon)) {
// In C++ mode, parse "::" like ": :".
AteExtraColon = Tok.is(tok::coloncolon);
ConsumeToken();
if (!AteExtraColon && ParseAsmOperandsOpt(Names, Constraints, Exprs))
return StmtError();
}
unsigned NumOutputs = Names.size();
// Parse Inputs, if present.
if (AteExtraColon || Tok.is(tok::colon) || Tok.is(tok::coloncolon)) {
// In C++ mode, parse "::" like ": :".
if (AteExtraColon)
AteExtraColon = false;
else {
AteExtraColon = Tok.is(tok::coloncolon);
ConsumeToken();
}
if (!AteExtraColon && ParseAsmOperandsOpt(Names, Constraints, Exprs))
return StmtError();
}
assert(Names.size() == Constraints.size() &&
Constraints.size() == Exprs.size() && "Input operand size mismatch!");
unsigned NumInputs = Names.size() - NumOutputs;
// Parse the clobbers, if present.
if (AteExtraColon || Tok.is(tok::colon) || Tok.is(tok::coloncolon)) {
if (AteExtraColon)
AteExtraColon = false;
else {
AteExtraColon = Tok.is(tok::coloncolon);
ConsumeToken();
}
// Parse the asm-string list for clobbers if present.
if (!AteExtraColon && isTokenStringLiteral()) {
while (true) {
ExprResult Clobber(ParseAsmStringLiteral(/*ForAsmLabel*/ false));
if (Clobber.isInvalid())
break;
Clobbers.push_back(Clobber.get());
if (!TryConsumeToken(tok::comma))
break;
}
}
}
if (!GAQ.isGoto() && (Tok.isNot(tok::r_paren) || AteExtraColon)) {
Diag(Tok, diag::err_expected) << tok::r_paren;
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
}
// Parse the goto label, if present.
unsigned NumLabels = 0;
if (AteExtraColon || Tok.is(tok::colon)) {
if (!AteExtraColon)
ConsumeToken();
while (true) {
if (Tok.isNot(tok::identifier)) {
Diag(Tok, diag::err_expected) << tok::identifier;
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
}
LabelDecl *LD = Actions.LookupOrCreateLabel(Tok.getIdentifierInfo(),
Tok.getLocation());
Names.push_back(Tok.getIdentifierInfo());
if (!LD) {
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
}
ExprResult Res =
Actions.ActOnAddrLabel(Tok.getLocation(), Tok.getLocation(), LD);
Exprs.push_back(Res.get());
NumLabels++;
ConsumeToken();
if (!TryConsumeToken(tok::comma))
break;
}
} else if (GAQ.isGoto()) {
Diag(Tok, diag::err_expected) << tok::colon;
SkipUntil(tok::r_paren, StopAtSemi);
return StmtError();
}
T.consumeClose();
return Actions.ActOnGCCAsmStmt(AsmLoc, false, GAQ.isVolatile(), NumOutputs,
NumInputs, Names.data(), Constraints, Exprs,
AsmString.get(), Clobbers, NumLabels,
T.getCloseLocation());
}
/// ParseAsmOperands - Parse the asm-operands production as used by
/// asm-statement, assuming the leading ':' token was eaten.
///
/// [GNU] asm-operands:
/// asm-operand
/// asm-operands ',' asm-operand
///
/// [GNU] asm-operand:
/// asm-string-literal '(' expression ')'
/// '[' identifier ']' asm-string-literal '(' expression ')'
///
//
// FIXME: Avoid unnecessary std::string trashing.
bool Parser::ParseAsmOperandsOpt(SmallVectorImpl<IdentifierInfo *> &Names,
SmallVectorImpl<Expr *> &Constraints,
SmallVectorImpl<Expr *> &Exprs) {
// 'asm-operands' isn't present?
if (!isTokenStringLiteral() && Tok.isNot(tok::l_square))
return false;
while (true) {
// Read the [id] if present.
if (Tok.is(tok::l_square)) {
BalancedDelimiterTracker T(*this, tok::l_square);
T.consumeOpen();
if (Tok.isNot(tok::identifier)) {
Diag(Tok, diag::err_expected) << tok::identifier;
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
IdentifierInfo *II = Tok.getIdentifierInfo();
ConsumeToken();
Names.push_back(II);
T.consumeClose();
} else
Names.push_back(nullptr);
ExprResult Constraint(ParseAsmStringLiteral(/*ForAsmLabel*/ false));
if (Constraint.isInvalid()) {
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
Constraints.push_back(Constraint.get());
if (Tok.isNot(tok::l_paren)) {
Diag(Tok, diag::err_expected_lparen_after) << "asm operand";
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
// Read the parenthesized expression.
BalancedDelimiterTracker T(*this, tok::l_paren);
T.consumeOpen();
ExprResult Res = Actions.CorrectDelayedTyposInExpr(ParseExpression());
T.consumeClose();
if (Res.isInvalid()) {
SkipUntil(tok::r_paren, StopAtSemi);
return true;
}
Exprs.push_back(Res.get());
// Eat the comma and continue parsing if it exists.
if (!TryConsumeToken(tok::comma))
return false;
}
}
const char *Parser::GNUAsmQualifiers::getQualifierName(AQ Qualifier) {
switch (Qualifier) {
case AQ_volatile: return "volatile";
case AQ_inline: return "inline";
case AQ_goto: return "goto";
case AQ_unspecified: return "unspecified";
}
llvm_unreachable("Unknown GNUAsmQualifier");
}
Parser::GNUAsmQualifiers::AQ
Parser::getGNUAsmQualifier(const Token &Tok) const {
switch (Tok.getKind()) {
case tok::kw_volatile: return GNUAsmQualifiers::AQ_volatile;
case tok::kw_inline: return GNUAsmQualifiers::AQ_inline;
case tok::kw_goto: return GNUAsmQualifiers::AQ_goto;
default: return GNUAsmQualifiers::AQ_unspecified;
}
}
bool Parser::GNUAsmQualifiers::setAsmQualifier(AQ Qualifier) {
bool IsDuplicate = Qualifiers & Qualifier;
Qualifiers |= Qualifier;
return IsDuplicate;
}
```
|
```python
import os
from g import config_dir, templates_dir, DEFAULT_GID, DEFAULT_UID
from utils.misc import prepare_dir
from utils.jinja import render_jinja
log_config_dir = os.path.join(config_dir, "log")
# logrotate config file
logrotate_template_path = os.path.join(templates_dir, "log", "logrotate.conf.jinja")
log_rotate_config = os.path.join(config_dir, "log", "logrotate.conf")
# syslog docker config file
log_syslog_docker_template_path = os.path.join(templates_dir, 'log', 'rsyslog_docker.conf.jinja')
log_syslog_docker_config = os.path.join(config_dir, 'log', 'rsyslog_docker.conf')
def prepare_log_configs(config_dict):
prepare_dir(log_config_dir)
# Render Log config
render_jinja(
logrotate_template_path,
log_rotate_config,
uid=DEFAULT_UID,
gid=DEFAULT_GID,
**config_dict)
# Render syslog docker config
render_jinja(
log_syslog_docker_template_path,
log_syslog_docker_config,
uid=DEFAULT_UID,
gid=DEFAULT_GID,
**config_dict
)
```
|
EBF may refer to:
EBF conference, an electronic procurement conference
Encyclopædia Britannica Films
English Border Front, the Shrewsbury Town hooligan firm.
Epic Battle Fantasy, flash game series
European Balloon Festival
European Banking Federation
European Baptist Federation
European Bioanalysis Forum
European Boxing Federation
|
Kalli is a village in Saaremaa Parish, Saare County, Estonia, on the island of Saaremaa. As of 2011 Census, the settlement's population was 24.
References
Villages in Saare County
|
Psammodius basalis is a species of aphodiine dung beetle in the family Scarabaeidae. It is found in Europe and Northern Asia (excluding China) and North America.
References
Further reading
Arnett, R. H. Jr., M. C. Thomas, P. E. Skelley and J. H. Frank. (eds.). (21 June 2002). American Beetles, Volume II: Polyphaga: Scarabaeoidea through Curculionoidea. CRC Press LLC, Boca Raton, Florida .
Richard E. White. (1983). Peterson Field Guides: Beetles. Houghton Mifflin Company.
Scarabaeidae
Beetles described in 1870
|
Pragatishila ( is a form of literature in Kannada language.
It is one of the five forms of modern Kannada literature, the other four being Navodaya, Navya, Dalita and Bandaya.
Pragatishila which literally means Progressive, is a simplistic form of fiction literature meant for the common man. It gained the popularity for a short period of time.
Prominent writers
Some of the important writers in this form of literature were A.N. Krishna Rao (A.Na.Kru), Basavaraj Kattimani, T.R. Subba Rao (Ta Ra Su) and Chaduranga and Niranjana Kulakanda Shivaraya.
References
Kannada literature
Literary genres
|
```xml
<?xml version="1.0" encoding="utf-8"?>
<!--
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.
-->
<selector xmlns:android="path_to_url">
<item
android:state_enabled="true"
android:state_pressed="true">
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="translationZ"
android:valueTo="@dimen/touch_raise" />
</item>
<item>
<objectAnimator
android:duration="@android:integer/config_shortAnimTime"
android:propertyName="translationZ"
android:valueTo="0dp" />
</item>
</selector>
```
|
The 2023 Copa Verde Finals was the final two-legged tie that decided the 2023 Copa Verde, the 10th season of the Copa Verde, Brazil's regional cup football tournament organised by the Brazilian Football Confederation.
The finals were contested in a two-legged home-and-away format between Paysandu, from Pará, and Goiás, from Goiás.
Goiás defeated Paysandu 4–1 on aggregate to win their first Copa Verde title.
Teams
Road to the final
Note: In all scores below, the score of the home team is given first.
Format
The finals were played on a home-and-away two-legged basis. If tied on aggregate, the penalty shoot-out was used to determine the winner.
Matches
First leg
Second leg
See also
2024 Copa do Brasil
References
Copa Verde Finals
|
Banca Popolare di Sondrio S.C.p.A. (BPSO) is an Italian bank based in Sondrio, Lombardy. The company is included in FTSE Italia Mid Cap Index.
History
Banca Popolare di Sondrio was an urban cooperative bank found in 1871. Along with Credito Valtellinese, they were the major banks inside the Province of Sondrio.
The bank also owned equity interests in several companies that provide services to the bank, such as Banca Italease (4.252% on 30 June 2009), Arca Vita and Istituto Centrale delle Banche Popolari Italiane (2%).
In 2009–11 Banca Italease was dismantled. BPSO acquired 20.95% stake in Alba Leasing as well as 60.5% stake in Factorit.
Due to Decree-Law N°3/2015, the bank would be demutualized. However, it was held due to an appeal to the court.
In September 2017 the bank announced that, they acquired Banca della Nuova Terra.
Equity interests
ARCA SGR
References
External links
Companies based in Sondrio
Banks established in 1871
Italian companies established in 1871
Cooperative banks of Italy
Banks under direct supervision of the European Central Bank
|
```php
<?php
namespace App\Ship\Tests\Unit\Criterias;
use App\Ship\Criterias\ThisEqualThatCriteria;
use App\Ship\Tests\Fakes\TestUserFactory;
use App\Ship\Tests\Fakes\TestUserRepository;
use App\Ship\Tests\ShipTestCase;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\Group;
#[Group('ship')]
#[CoversClass(ThisEqualThatCriteria::class)]
final class ThisEqualThatCriteriaTest extends ShipTestCase
{
public function testCriteria(): void
{
$modelB = TestUserFactory::new()->create(['name' => 'B']);
$modelA = TestUserFactory::new()->create(['name' => 'A']);
$modelC = TestUserFactory::new()->create(['name' => 'C']);
$repository = app(TestUserRepository::class);
$criteria = new ThisEqualThatCriteria('name', 'A');
$repository->pushCriteria($criteria);
$result = $repository->all();
$this->assertSame(1, $result->count());
$this->assertSame($modelA->id, $result->first()->id);
}
}
```
|
```javascript
/**
*/
import ReactTable from '../Styled/Table';
import Channels from './Channels';
jest.useFakeTimers();
const setup = () => {
const props = {
channels: [
{
blocks: 5,
channelname: 'mychannel',
createdat: '2018-05-30T20:56:47.795Z',
id: 3,
transactions: 5,
},
],
};
const wrapper = mount(<Channels {...props} />);
return {
props,
wrapper,
};
};
describe('Channels', () => {
test('Channels component should render', () => {
const { wrapper } = setup();
expect(wrapper.exists()).toBe(true);
});
test('Simulate ID filterMethod should have one result when given a value of 3', () => {
const { wrapper } = setup();
wrapper
.find('ThComponent')
.findWhere(n => n.key() === '0-id')
.find('input')
.simulate('change', { target: { value: '3' } });
expect(wrapper.find(ReactTable).find('TrGroupComponent').length).toBe(1);
});
test('Simulate Channel Name filterMethod should have one result when given a value of my', () => {
const { wrapper } = setup();
wrapper
.find('ThComponent')
.findWhere(n => n.key() === '1-channelname')
.find('input')
.simulate('change', { target: { value: 'my' } });
expect(wrapper.find(ReactTable).find('TrGroupComponent').length).toBe(1);
});
test('Simulate Blocks filterMethod should have one result when given a value of 5', () => {
const { wrapper } = setup();
wrapper
.find('ThComponent')
.findWhere(n => n.key() === '2-blocks')
.find('input')
.simulate('change', { target: { value: '5' } });
expect(wrapper.find(ReactTable).find('TrGroupComponent').length).toBe(1);
});
test('Simulate Transactions filterMethod should have one result when given a value of 5', () => {
const { wrapper } = setup();
wrapper
.find('ThComponent')
.findWhere(n => n.key() === '3-transactions')
.find('input')
.simulate('change', { target: { value: '5' } });
expect(wrapper.find(ReactTable).find('TrGroupComponent').length).toBe(1);
});
test('Simulate Created At filterMethod should have one result when given a value of 2018', () => {
const { wrapper } = setup();
wrapper
.find('ThComponent')
.findWhere(n => n.key() === '4-createdat')
.find('input')
.simulate('change', { target: { value: '2018' } });
expect(wrapper.find(ReactTable).find('TrGroupComponent').length).toBe(1);
});
test('pagination when channels is greater than 4', () => {
const { wrapper, props } = setup();
const { channels } = props;
const channel = channels[0];
const lotsOfChannels = [
channel,
channel,
channel,
channel,
channel,
channel,
];
expect(wrapper.find('.pagination-bottom').exists()).toBe(false);
wrapper.setProps({ channels: lotsOfChannels });
expect(wrapper.find('.pagination-bottom').exists()).toBe(true);
});
});
```
|
"Sono Mirai wa Ima" is a song and single by The Pillows. It was featured in the album Good Dreams. Sawao Yamanaka, The Pillows lead songwriter, wrote "Beehive" for the J-Pop artist Chihiro Yonekura, which is featured on her album "azure".
Track listing
"Beehive"
"Heavy Sun (With Baby Son)"
2004 singles
The Pillows songs
2004 songs
King Records (Japan) singles
|
Algonquin Peak is in the MacIntyre Range in the town of North Elba, in Essex County, New York. It is the second highest mountain in New York, and one of the 46 Adirondack High Peaks in Adirondack Park. Its name comes from its reputedly being on the Algonquian side of a nearby informal boundary between the Algonquian and their Iroquois neighbors.
Algonquin is popular with hikers, accessible from the popular Adirondak Loj trailhead near Heart Lake outside Lake Placid for a day trip. While the climb is shorter than that of nearby Mount Marcy, it is steeper, requiring almost as much vertical ascent in a considerably shorter distance.
The usual route is via the blue-blazed Van Hoevenberg Trail to its junction with the yellow-blazed MacIntyre Range Trail and following that the remaining to the summit, during which the route gets progressively steeper and rockier, going over many steep rock chutes called "slides".
The mountain's summit is an alpine zone above tree line, and views of the surrounding high peaks are available in all directions. However, the large numbers of hikers on the summit have in the past caused damage to the fragile plant life, and strict regulations have been put in place both at the trailhead and on the summit (all hikers must sign in; no dogs are allowed without a leash) to protect it. On busy days a Summit Steward both reminds hikers of these rules and educates them about the ecosystem.
Less frequently, the mountain is approached from the southeast via the steep, narrow, Boundary Trail from Lake Colden. This trail is also dangerous because of the poor markings and steep, slippery slides that streams have formed on.
Climate
Notes
Gallery
External links
Algonquin Peak hike and trip report. September 2015.
Hiking Algonquin Peak. PureAdirondacks.com
Mountains of Essex County, New York
Tourist attractions in Essex County, New York
Mountains of New York (state)
|
```objective-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
===========================================================================
*/
/*****************************************************************************
* name: l_libvar.h
*
* desc: botlib vars
*
* $Archive: /source/code/botlib/l_libvar.h $
*
*****************************************************************************/
//library variable
typedef struct libvar_s
{
char *name;
char *string;
int flags;
qboolean modified; // set each time the cvar is changed
float value;
struct libvar_s *next;
} libvar_t;
//removes all library variables
void LibVarDeAllocAll(void);
//gets the library variable with the given name
libvar_t *LibVarGet(const char *var_name);
//gets the string of the library variable with the given name
char *LibVarGetString(const char *var_name);
//gets the value of the library variable with the given name
float LibVarGetValue(const char *var_name);
//creates the library variable if not existing already and returns it
libvar_t *LibVar(const char *var_name, const char *value);
//creates the library variable if not existing already and returns the value
float LibVarValue(const char *var_name, const char *value);
//creates the library variable if not existing already and returns the value string
char *LibVarString(const char *var_name, const char *value);
//sets the library variable
void LibVarSet(const char *var_name, const char *value);
//returns true if the library variable has been modified
qboolean LibVarChanged(const char *var_name);
//sets the library variable to unmodified
void LibVarSetNotModified(const char *var_name);
```
|
```c++
/*=============================================================================
file LICENSE_1_0.txt or copy at path_to_url
=============================================================================*/
#if !defined(BOOST_SPIRIT_CONJURE_VM_HPP)
#define BOOST_SPIRIT_CONJURE_VM_HPP
#include <vector>
namespace client
{
///////////////////////////////////////////////////////////////////////////
// The Virtual Machine
///////////////////////////////////////////////////////////////////////////
enum byte_code
{
op_neg, // negate the top stack entry
op_add, // add top two stack entries
op_sub, // subtract top two stack entries
op_mul, // multiply top two stack entries
op_div, // divide top two stack entries
op_not, // boolean negate the top stack entry
op_eq, // compare the top two stack entries for ==
op_neq, // compare the top two stack entries for !=
op_lt, // compare the top two stack entries for <
op_lte, // compare the top two stack entries for <=
op_gt, // compare the top two stack entries for >
op_gte, // compare the top two stack entries for >=
op_and, // logical and top two stack entries
op_or, // logical or top two stack entries
op_load, // load a variable
op_store, // store a variable
op_int, // push constant integer into the stack
op_true, // push constant 0 into the stack
op_false, // push constant 1 into the stack
op_jump_if, // jump to a relative position in the code if top stack
// evaluates to false
op_jump, // jump to a relative position in the code
op_stk_adj, // adjust the stack (for args and locals)
op_call, // function call
op_return // return from function
};
class vmachine
{
public:
vmachine(unsigned stackSize = 4096)
: stack(stackSize)
{
}
int execute(std::vector<int> const& code)
{
return execute(code, code.begin(), stack.begin());
}
std::vector<int> const& get_stack() const { return stack; };
std::vector<int>& get_stack() { return stack; };
private:
int execute(
std::vector<int> const& code // the program code
, std::vector<int>::const_iterator pc // program counter
, std::vector<int>::iterator frame_ptr // start of arguments and locals
);
std::vector<int> stack;
};
}
#endif
```
|
```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 com.example.android.sunshine;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.util.Log;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.widget.ProgressBar;
import android.widget.TextView;
import com.example.android.sunshine.ForecastAdapter.ForecastAdapterOnClickHandler;
import com.example.android.sunshine.data.SunshinePreferences;
import com.example.android.sunshine.utilities.NetworkUtils;
import com.example.android.sunshine.utilities.OpenWeatherJsonUtils;
import java.net.URL;
public class MainActivity extends AppCompatActivity implements ForecastAdapterOnClickHandler {
private static final String TAG = MainActivity.class.getSimpleName();
private RecyclerView mRecyclerView;
private ForecastAdapter mForecastAdapter;
private TextView mErrorMessageDisplay;
private ProgressBar mLoadingIndicator;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_forecast);
/*
* Using findViewById, we get a reference to our RecyclerView from xml. This allows us to
* do things like set the adapter of the RecyclerView and toggle the visibility.
*/
mRecyclerView = (RecyclerView) findViewById(R.id.recyclerview_forecast);
/* This TextView is used to display errors and will be hidden if there are no errors */
mErrorMessageDisplay = (TextView) findViewById(R.id.tv_error_message_display);
/*
* LinearLayoutManager can support HORIZONTAL or VERTICAL orientations. The reverse layout
* parameter is useful mostly for HORIZONTAL layouts that should reverse for right to left
* languages.
*/
LinearLayoutManager layoutManager
= new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false);
mRecyclerView.setLayoutManager(layoutManager);
/*
* Use this setting to improve performance if you know that changes in content do not
* change the child layout size in the RecyclerView
*/
mRecyclerView.setHasFixedSize(true);
/*
* The ForecastAdapter is responsible for linking our weather data with the Views that
* will end up displaying our weather data.
*/
mForecastAdapter = new ForecastAdapter(this);
/* Setting the adapter attaches it to the RecyclerView in our layout. */
mRecyclerView.setAdapter(mForecastAdapter);
/*
* The ProgressBar that will indicate to the user that we are loading data. It will be
* hidden when no data is loading.
*
* Please note: This so called "ProgressBar" isn't a bar by default. It is more of a
* circle. We didn't make the rules (or the names of Views), we just follow them.
*/
mLoadingIndicator = (ProgressBar) findViewById(R.id.pb_loading_indicator);
/* Once all of our views are setup, we can load the weather data. */
loadWeatherData();
}
/**
* This method will get the user's preferred location for weather, and then tell some
* background method to get the weather data in the background.
*/
private void loadWeatherData() {
showWeatherDataView();
String location = SunshinePreferences.getPreferredWeatherLocation(this);
new FetchWeatherTask().execute(location);
}
/**
* This method is overridden by our MainActivity class in order to handle RecyclerView item
* clicks.
*
* @param weatherForDay The weather for the day that was clicked
*/
@Override
public void onClick(String weatherForDay) {
Context context = this;
Class destinationClass = DetailActivity.class;
Intent intentToStartDetailActivity = new Intent(context, destinationClass);
intentToStartDetailActivity.putExtra(Intent.EXTRA_TEXT, weatherForDay);
startActivity(intentToStartDetailActivity);
}
/**
* This method will make the View for the weather data visible and
* hide the error message.
* <p>
* Since it is okay to redundantly set the visibility of a View, we don't
* need to check whether each view is currently visible or invisible.
*/
private void showWeatherDataView() {
/* First, make sure the error is invisible */
mErrorMessageDisplay.setVisibility(View.INVISIBLE);
/* Then, make sure the weather data is visible */
mRecyclerView.setVisibility(View.VISIBLE);
}
/**
* This method will make the error message visible and hide the weather
* View.
* <p>
* Since it is okay to redundantly set the visibility of a View, we don't
* need to check whether each view is currently visible or invisible.
*/
private void showErrorMessage() {
/* First, hide the currently visible data */
mRecyclerView.setVisibility(View.INVISIBLE);
/* Then, show the error */
mErrorMessageDisplay.setVisibility(View.VISIBLE);
}
public class FetchWeatherTask extends AsyncTask<String, Void, String[]> {
@Override
protected void onPreExecute() {
super.onPreExecute();
mLoadingIndicator.setVisibility(View.VISIBLE);
}
@Override
protected String[] doInBackground(String... params) {
/* If there's no zip code, there's nothing to look up. */
if (params.length == 0) {
return null;
}
String location = params[0];
URL weatherRequestUrl = NetworkUtils.buildUrl(location);
try {
String jsonWeatherResponse = NetworkUtils
.getResponseFromHttpUrl(weatherRequestUrl);
String[] simpleJsonWeatherData = OpenWeatherJsonUtils
.getSimpleWeatherStringsFromJson(MainActivity.this, jsonWeatherResponse);
return simpleJsonWeatherData;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@Override
protected void onPostExecute(String[] weatherData) {
mLoadingIndicator.setVisibility(View.INVISIBLE);
if (weatherData != null) {
showWeatherDataView();
mForecastAdapter.setWeatherData(weatherData);
} else {
showErrorMessage();
}
}
}
/**
* This method uses the URI scheme for showing a location found on a
* map. This super-handy intent is detailed in the "Common Intents"
* page of Android's developer site:
*
* @see <a"path_to_url#Maps">
*
* Hint: Hold Command on Mac or Control on Windows and click that link
* to automagically open the Common Intents page
*/
private void openLocationInMap() {
String addressString = "1600 Ampitheatre Parkway, CA";
Uri geoLocation = Uri.parse("geo:0,0?q=" + addressString);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(geoLocation);
if (intent.resolveActivity(getPackageManager()) != null) {
startActivity(intent);
} else {
Log.d(TAG, "Couldn't call " + geoLocation.toString()
+ ", no receiving apps installed!");
}
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
/* Use AppCompatActivity's method getMenuInflater to get a handle on the menu inflater */
MenuInflater inflater = getMenuInflater();
/* Use the inflater's inflate method to inflate our menu layout to this menu */
inflater.inflate(R.menu.forecast, menu);
/* Return true so that the menu is displayed in the Toolbar */
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
if (id == R.id.action_refresh) {
mForecastAdapter.setWeatherData(null);
loadWeatherData();
return true;
}
// COMPLETED (2) Launch the map when the map menu item is clicked
if (id == R.id.action_map) {
openLocationInMap();
return true;
}
return super.onOptionsItemSelected(item);
}
}
```
|
RCU may refer to:
Science and technology
Read-copy-update, a computer operating system synchronization mechanism
Remote concentrator unit in telephony
Organocopper complexes (RCu), in reactions of organocopper reagents
Organizations
Radio Club Uruguayo
Rogue Credit Union, a federal credit union in Medford, Oregon
Royal College Union, the alumni association of Royal College Colombo, Sri Lanka
Regional Cadet Units of the Australian Army Cadets
Regional Coordinating Unit in the Northwest Pacific Action Plan
Regional Crime Unit of the Hong Kong Police Force
Other uses
Rocket City United, an American soccer team
RC Unterföhring, a German rugby union club
Las Higueras Airport (IATA code), Argentina
A remote control unit
|
```turing
#require no-eden
set up test repo
$ newclientrepo
$ echo testcontents > testfile.txt
$ mkdir testdir
$ echo dircontents1 > testdir/dirfile1.txt
$ echo dircontents2 > testdir/dirfile2.txt
$ hg add -q
$ hg commit -m "initial commit"
uncopy a single file
$ hg copy testfile.txt copyfile.txt
$ hg status -C copyfile.txt
A copyfile.txt
testfile.txt
$ hg uncopy copyfile.txt
$ hg status -C copyfile.txt
A copyfile.txt
$ rm copyfile.txt
uncopy a directory
$ hg copy -q testdir copydir
$ hg status -C copydir
A copydir/dirfile1.txt
testdir/dirfile1.txt
A copydir/dirfile2.txt
testdir/dirfile2.txt
$ hg uncopy copydir
$ hg status -C copydir
A copydir/dirfile1.txt
A copydir/dirfile2.txt
$ rm -r copydir
uncopy by pattern
$ hg copy -q testfile.txt copyfile1.txt
$ hg copy -q testfile.txt copyfile2.txt
$ hg status -C copyfile1.txt copyfile2.txt
A copyfile1.txt
testfile.txt
A copyfile2.txt
testfile.txt
$ hg uncopy copyfile*
$ hg status -C copyfile1.txt copyfile2.txt
A copyfile1.txt
A copyfile2.txt
$ rm copyfile*
uncopy nonexistent file
$ hg uncopy notfound.txt
notfound.txt: $ENOENT$
[1]
uncopy a file that was not copied
$ echo othercontents > otherfile.txt
$ hg uncopy otherfile.txt
[1]
$ hg status -C otherfile.txt
? otherfile.txt
```
|
```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 com.oracle.svm.test.jfr;
import static org.junit.Assert.assertTrue;
import static org.junit.Assume.assumeTrue;
import java.io.IOException;
import java.net.InetSocketAddress;
import java.nio.ByteBuffer;
import java.nio.channels.ServerSocketChannel;
import java.nio.channels.SocketChannel;
import java.util.List;
import org.junit.BeforeClass;
import org.junit.Test;
import jdk.graal.compiler.serviceprovider.JavaVersionUtil;
import jdk.jfr.Recording;
import jdk.jfr.consumer.RecordedEvent;
public class TestSocketChannelEvents extends JfrRecordingTest {
public static final String MESSAGE = "hello server";
public static final int DEFAULT_SIZE = 1024;
public static int PORT = 9876;
public static String HOST = "127.0.0.1";
@BeforeClass
public static void checkJavaVersion() {
assumeTrue("skipping JFR socket channel test", JavaVersionUtil.JAVA_SPEC >= 22);
}
@Test
public void test() throws Throwable {
String[] events = new String[]{"jdk.SocketRead", "jdk.SocketWrite"};
Recording recording = startRecording(events);
Thread serverThread = new Thread(() -> {
GreetServer server = new GreetServer();
try {
server.start(PORT);
} catch (IOException e) {
throw new RuntimeException(e);
}
});
serverThread.start();
GreetClient client = new GreetClient();
client.startConnection(HOST, PORT);
client.sendMessage(MESSAGE);
serverThread.join();
stopRecording(recording, TestSocketChannelEvents::validateEvents);
}
private static void validateEvents(List<RecordedEvent> events) {
boolean foundSocketRead = false;
boolean foundSocketWrite = false;
for (RecordedEvent e : events) {
String name = e.getEventType().getName();
String host = e.getString("host");
if (host.equals(HOST) && name.equals("jdk.SocketRead") && e.getLong("bytesRead") == MESSAGE.getBytes().length) {
foundSocketRead = true;
} else if (host.equals(HOST) && name.equals("jdk.SocketWrite") && e.getLong("bytesWritten") == MESSAGE.getBytes().length &&
e.getLong("port") == PORT) {
foundSocketWrite = true;
}
}
assertTrue(foundSocketRead);
assertTrue(foundSocketWrite);
}
static class GreetClient {
SocketChannel socketChannel;
public void startConnection(String ip, int port) throws InterruptedException {
while (true) {
try {
socketChannel = SocketChannel.open(new InetSocketAddress(ip, port));
break;
} catch (Exception e) {
// Keep trying until server begins accepting connections.
Thread.sleep(100);
}
}
}
public void sendMessage(String msg) throws IOException {
byte[] bytes = msg.getBytes();
ByteBuffer buf = ByteBuffer.allocate(bytes.length);
buf.put(bytes);
buf.flip();
while (buf.hasRemaining()) {
socketChannel.write(buf);
}
socketChannel.close();
}
}
static class GreetServer {
public void start(int port) throws IOException {
// Prepare server.
ServerSocketChannel server = ServerSocketChannel.open();
server.socket().bind(new InetSocketAddress(port));
// Block waiting for connection from client.
SocketChannel client = server.accept();
// Read data from client.
ByteBuffer readBuf = ByteBuffer.allocate(DEFAULT_SIZE);
client.read(readBuf);
String message = new String(readBuf.array(), 0, readBuf.position());
assertTrue(MESSAGE.equals(message));
client.close();
server.close();
}
}
}
```
|
```yaml
{{- /*
*/}}
{{- if and .Values.metrics.serviceMonitor.enabled .Values.envoy.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ printf "%s-envoy" (include "common.names.fullname" .) | trunc 63 | trimSuffix "-" }}
namespace: {{ default (include "common.names.namespace" .) .Values.metrics.serviceMonitor.namespace | quote }}
{{- $versionLabel := dict "app.kubernetes.io/version" ( include "common.images.version" ( dict "imageRoot" .Values.envoy.image "chart" .Chart ) ) }}
{{- $labels := include "common.tplvalues.merge" ( dict "values" ( list .Values.metrics.serviceMonitor.labels .Values.commonLabels $versionLabel ) "context" . ) }}
labels: {{- include "common.labels.standard" ( dict "customLabels" $labels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: envoy
{{- if .Values.commonAnnotations }}
annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel | quote }}
selector:
matchLabels: {{- include "common.labels.matchLabels" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 6 }}
app.kubernetes.io/component: envoy
{{- if .Values.metrics.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "common.names.namespace" . | quote }}
endpoints:
- port: metrics
path: /stats/prometheus
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings: {{ toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabelings }}
relabelings: {{ toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }}
{{- end }}
{{- end }}
```
|
The radiated tortoise (Astrochelys radiata) is a tortoise species in the family Testudinidae. Although this species is native to and most abundant in southern Madagascar, it can also be found in the rest of this island, and has been introduced to the islands of Réunion and Mauritius. It is a very long-lived species, with recorded lifespans of up to 188 years. These tortoises are classified as critically endangered by the IUCN, mainly because of the destruction of their habitat and because of poaching.
Description
Adults typically have a carapace length of and weigh . The largest individuals tend to be males.
This species has the basic "tortoise" body shape, which consists of the high-domed carapace, a blunt head, and elephantine feet. The legs, feet, and head are yellow except for a variably sized black patch on top of the head.
The carapace of the radiated tortoise is brilliantly marked with yellow lines radiating from the center of each dark plate of the shell, hence its name. This "star" pattern is more finely detailed and intricate than the normal pattern of other star-patterned tortoise species, such as Geochelone elegans of India.
The radiated tortoise is also larger than G. elegans, and the scutes of the carapace are smooth, and not raised up into a bumpy, pyramidal shape as is commonly seen in the latter species. Sexual dimorphism is slight. Compared to females, male radiated tortoises usually have longer tails and the notches beneath their tails are more noticeable.
Lifespan
The species is long-lived. The oldest radiated tortoise ever recorded with certainty was Tu'i Malila, which died at an estimated age of 188.
Range and distribution
Radiated tortoises occur naturally only in the extreme southern and southwestern part of the island of Madagascar. They have also been introduced to the nearby island of Reunion. They prefer dry regions of brush, thorn (Diderae) forests, and woodlands of southern Madagascar.
As the radiated tortoises are herbivores, grazing constitutes 80–90% of their diets, while they also eat fruits and succulent plants. A favorite food in the wild is the Opuntia cactus. They are known to graze regularly in the same area, thus keeping the vegetation in that area closely trimmed. They seem to prefer new growth rather than mature growth because of the high-protein, low-fiber content.
Reproduction
Males first mate upon attaining lengths of about 12 in (31 cm); females may need to be a few inches longer. The male begins this fairly noisy procedure by bobbing his head and smelling the female's hind legs and cloaca. In some cases, the male may lift the female up with the front edge of his shell to keep her from moving away.
The male then proceeds to mount the female from the rear while striking the anal region of his plastron against the female's carapace. Hissing and grunting by the male during mating is common. This is a very dangerous procedure and cases have been recorded where the female's shell has cracked and pierced the vaginal and anal cavities. Females lay from three to twelve eggs in a previously excavated hole 6–8 in (15–20 cm) deep, and then depart.
Incubation is quite long in this species, lasting usually between 5 and 8 months. Juveniles are between 1.2 and 1.6 inches (3.2 and 4 cm) upon hatching. Unlike the yellow coloration of the adults, the juveniles are a white to an off-white shade. Juveniles attain the high-domed carapace soon after hatching.
Conservation
These tortoises are critically endangered due to habitat loss, being poached for food, and being overexploited in the pet trade. It is listed on CITES Appendix I, commercial trade in wild-caught specimens is illegal (permitted only in exceptional licensed circumstances). However, due to the poor economic conditions of Madagascar, many of the laws are largely ignored.
No estimates of wild populations are available, but their numbers are declining, and many authorities see the potential for a rapid decline to extinction in the wild. In the North American studbook, 332 specimens are listed as participating in captive-breeding programs such as the Species Survival Plan. Captive breeding has shown great promise as in the captive-breeding program for the radiated tortoise at the New York Zoological Society's Wildlife Survival Center. In 2005, the Wildlife Survival Center was closed, and the radiated tortoise captive-breeding program was continued with the inception of the Behler Chelonian Center, the Turtle Conservancy's southern California conservation breeding center.
In March 2013, smugglers were arrested after carrying a single bag containing 21 radiated tortoises and 54 angonoka tortoises (Astrochelys yniphora) through Suvarnabhumi International Airport in Thailand.
On 20 March 2016, the customs officials at Mumbai airport seized 146 tortoises from the mishandled baggage of a Nepal citizen. This bag was said to belong to a transit passenger, who arrived from Madagascar and flew to Kathmandu, leaving this bag behind. Of the 146 tortoises, 139 were radiated tortoises (Astrochelys radiata) and seven were Angonoka tortoises (Astrochelys yniphora), both critically endangered tortoise species of Madagascar. Two radiated tortoises were found dead with broken shells.
On 12 June 2016, it was reported that 72 radiated tortoises and six angonoka tortoises had gone missing from a breeding facility in Thailand.
On 20 April 2018, more than 10,000 radiated tortoises were found in a home in Toliara. In total, the house contained 9,888 live radiated tortoises and 180 dead ones. Rescuers transported them to Le Village Des Tortues ("Turtle Village"), a private wildlife rehabilitation facility in Ifaty, 18 miles north of Toliara. A week after their discovery, 574 tortoises had died from either dehydration or infection. Three suspects (two men and a woman, the owner of the house) were arrested. The men were in the process of burying dead tortoises on the property when the team arrived.
References
Further reading
Kirkpatrick, David D. The Radiated Tortoise in Reptile & Amphibian Magazine March/April 1992, pages 18–24.
Radiated Tortoise Fact Sheet. Smithsonian National Zoological Park. Retrieved April 7, 2008.
External links
Radiated Tortoise
Convention on International Trade in Endangered Species of Wild Fauna and Flora
Astrochelys
Turtles of Africa
Endemic fauna of Madagascar
Reptiles of Madagascar
Species endangered by the pet trade
Madagascar spiny thickets
Reptiles described in 1802
Taxa named by George Shaw
|
```python
import logging
import os
from rich.console import Console
from rich.theme import Theme
LOG = logging.getLogger(__name__)
SAFETY_THEME = {
"file_title": "bold default on default",
"dep_name": "bold yellow on default",
"scan_meta_title": "bold default on default",
"vuln_brief": "red on default",
"rem_brief": "bold green on default",
"rem_severity": "bold red on default",
"brief_severity": "bold default on default",
"status.spinner": "green",
"recommended_ver": "bold cyan on default",
"vuln_id": "bold default on default",
"number": "bold cyan on default",
"link": "underline bright_blue on default",
"tip": "bold default on default",
"specifier": "bold cyan on default",
"vulns_found_number": "red on default",
}
non_interactive = os.getenv('NON_INTERACTIVE') == '1'
console_kwargs = {"theme": Theme(SAFETY_THEME, inherit=False)}
if non_interactive:
LOG.info("NON_INTERACTIVE environment variable is set, forcing non-interactive mode")
console_kwargs.update({"force_terminal": True, "force_interactive": False})
main_console = Console(**console_kwargs)
```
|
```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.sql.parser.statement.doris.ddl;
import org.apache.shardingsphere.sql.parser.statement.core.statement.ddl.CreateServerStatement;
import org.apache.shardingsphere.sql.parser.statement.doris.DorisStatement;
/**
* Doris create server statement.
*/
public final class DorisCreateServerStatement extends CreateServerStatement implements DorisStatement {
}
```
|
Amphisbaena anaemariae is a worm lizard species in the family Amphisbaenidae. It is endemic to Brazil.
References
anaemariae
Reptiles described in 1997
Endemic fauna of Brazil
Reptiles of Brazil
Taxa named by Paulo Vanzolini
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <algorithm>
#include <gtest/gtest.h>
#include "extended_key_usage.h"
#include "input.h"
namespace bssl {
namespace {
// Helper method to check if an EKU is present in a std::vector of EKUs.
bool HasEKU(const std::vector<der::Input> &list, der::Input eku) {
for (const auto &oid : list) {
if (oid == eku) {
return true;
}
}
return false;
}
// Check that we can read multiple EKUs from an extension.
TEST(ExtendedKeyUsageTest, ParseEKUExtension) {
// clang-format off
const uint8_t raw_extension_value[] = {
0x30, 0x14, // SEQUENCE (20 bytes)
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, // 1.3.6.1.5.5.7.3.1
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02 // 1.3.6.1.5.5.7.3.2
// end of SEQUENCE
};
// clang-format on
der::Input extension_value(raw_extension_value);
std::vector<der::Input> ekus;
EXPECT_TRUE(ParseEKUExtension(extension_value, &ekus));
EXPECT_EQ(2u, ekus.size());
EXPECT_TRUE(HasEKU(ekus, der::Input(kServerAuth)));
EXPECT_TRUE(HasEKU(ekus, der::Input(kClientAuth)));
}
// Check that an extension with the same OID present multiple times doesn't
// cause an error.
TEST(ExtendedKeyUsageTest, RepeatedOid) {
// clang-format off
const uint8_t extension_bytes[] = {
0x30, 0x14, // SEQUENCE (20 bytes)
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, // 1.3.6.1.5.5.7.3.1
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01 // 1.3.6.1.5.5.7.3.1
};
// clang-format on
der::Input extension(extension_bytes);
std::vector<der::Input> ekus;
EXPECT_TRUE(ParseEKUExtension(extension, &ekus));
EXPECT_EQ(2u, ekus.size());
for (const auto &eku : ekus) {
EXPECT_EQ(der::Input(kServerAuth), eku);
}
}
// Check that parsing an EKU extension which contains a private OID doesn't
// cause an error.
TEST(ExtendedKeyUsageTest, ParseEKUExtensionGracefullyHandlesPrivateOids) {
// clang-format off
const uint8_t extension_bytes[] = {
0x30, 0x13, // SEQUENCE (19 bytes)
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, // 1.3.6.1.5.5.7.3.1
0x06, 0x07, // OBJECT IDENTIFIER (7 bytes)
0x2B, 0x06, 0x01, 0x04, 0x01, 0xD6, 0x79 // 1.3.6.1.4.1.11129
};
// clang-format on
der::Input extension(extension_bytes);
std::vector<der::Input> ekus;
EXPECT_TRUE(ParseEKUExtension(extension, &ekus));
EXPECT_EQ(2u, ekus.size());
EXPECT_TRUE(HasEKU(ekus, der::Input(kServerAuth)));
const uint8_t google_oid[] = {0x2B, 0x06, 0x01, 0x04, 0x01, 0xD6, 0x79};
der::Input google(google_oid);
EXPECT_TRUE(HasEKU(ekus, google));
}
// Test a variety of bad inputs.
// If the extension value has data following the sequence of oids, parsing it
// should fail.
TEST(ExtendedKeyUsageTest, ExtraData) {
// clang-format off
const uint8_t extra_data[] = {
0x30, 0x14, // SEQUENCE (20 bytes)
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, // 1.3.6.1.5.5.7.3.1
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x02, // 1.3.6.1.5.5.7.3.2
// end of SEQUENCE
0x02, 0x01, // INTEGER (1 byte)
0x01 // 1
};
// clang-format on
std::vector<der::Input> ekus;
EXPECT_FALSE(ParseEKUExtension(der::Input(extra_data), &ekus));
}
// Check that ParseEKUExtension only accepts a sequence containing only oids.
// This test case has an integer in the sequence (which should fail). A key
// difference between this test case and ExtendedKeyUsageTest.ExtraData is where
// the sequence ends - in this test case the integer is still part of the
// sequence, while in ExtendedKeyUsageTest.ExtraData the integer is after the
// sequence.
TEST(ExtendedKeyUsageTest, NotAnOid) {
// clang-format off
const uint8_t not_an_oid[] = {
0x30, 0x0d, // SEQUENCE (13 bytes)
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01, // 1.3.6.1.5.5.7.3.1
0x02, 0x01, // INTEGER (1 byte)
0x01 // 1
// end of SEQUENCE
};
// clang-format on
std::vector<der::Input> ekus;
EXPECT_FALSE(ParseEKUExtension(der::Input(not_an_oid), &ekus));
}
// Checks that the list of oids passed to ParseEKUExtension are in a sequence,
// instead of one or more oid tag-length-values concatenated together.
TEST(ExtendedKeyUsageTest, NotASequence) {
// clang-format off
const uint8_t not_a_sequence[] = {
0x06, 0x08, // OBJECT IDENTIFIER (8 bytes)
0x2B, 0x06, 0x01, 0x05, 0x05, 0x07, 0x03, 0x01 // 1.3.6.1.5.5.7.3.1
};
// clang-format on
std::vector<der::Input> ekus;
EXPECT_FALSE(ParseEKUExtension(der::Input(not_a_sequence), &ekus));
}
// A sequence passed into ParseEKUExtension must have at least one oid in it.
TEST(ExtendedKeyUsageTest, EmptySequence) {
const uint8_t empty_sequence[] = {0x30, 0x00}; // SEQUENCE (0 bytes)
std::vector<der::Input> ekus;
EXPECT_FALSE(ParseEKUExtension(der::Input(empty_sequence), &ekus));
}
// The extension value must not be empty.
TEST(ExtendedKeyUsageTest, EmptyExtension) {
std::vector<der::Input> ekus;
EXPECT_FALSE(ParseEKUExtension(der::Input(), &ekus));
}
} // namespace
} // namespace bssl
```
|
```c++
/// Source : path_to_url
/// Author : liuyubobobo
/// Time : 2021-05-21
#include <iostream>
#include <vector>
using namespace std;
/// Mathematics
/// Time Complexity: O(n)
/// Space Complexity: O(1)
class Solution {
public:
bool xorGame(vector<int>& nums) {
if(nums.size() % 2 == 0) return true;
int x = 0;
for(int e: nums) x ^= e;
return x == 0;
}
};
int main() {
return 0;
}
```
|
```objective-c
% downsample the bin files for faster cross-validation and not overfit val set
%
addpath('/rmt/work/deeplabel/code/matlab/my_script');
SetupEnv;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% You do not need to chage values below
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if is_server
mat_folder = fullfile('/rmt/work/deeplabel/exper', dataset, feature_name, model_name, testset, feature_type);
if crf_load_mat
save_folder = mat_folder;
file_name = 'mat';
else
save_folder = fullfile(mat_folder, 'bin');
file_name = 'bin';
end
folder_name = fullfile(mat_folder, file_name);
else
mat_folder = '../feature';
save_folder = '../feature_bin';
end
if down_sample_method == 1
dest_folder = [folder_name, sprintf('_downsampleBy%d', down_sample_rate)];
elseif down_sample_method == 2
dest_folder = [folder_name, sprintf('_numSample%d', num_sample)];
else
error('Wrong down_sample_method\n');
end
if ~exist(dest_folder, 'dir')
mkdir(dest_folder)
end
save_dir = dir(fullfile(save_folder, ['*.' file_name]));
if down_sample_method == 1
save_dir = save_dir(1:down_sample_rate:end);
elseif down_sample_method == 2
ind = randperm(length(save_dir));
ind = ind(1:num_sample);
save_dir = save_dir(ind);
end
for i = 1 : numel(save_dir)
fprintf(1, 'processing %d (%d)...\n', i, numel(save_dir));
copyfile(fullfile(save_folder, save_dir(i).name), fullfile(dest_folder, save_dir(i).name));
end
```
|
The Keep the Clause campaign was a privately funded political campaign organised in 2000 with the aim of resisting the repeal of legislation known as Clause 28 of the Local Government Act 1988 in Scotland and the United Kingdom, which forbade local authorities to "intentionally promote homosexuality". (Clause 28 was known as Section 2A of the relevant Scottish legislation). The campaign involved the first privately funded referendum to take place across Scotland. The campaign was ultimately unsuccessful.
Campaign
Most active between April and December 2000, the campaign coincided with the first legislative attempts to repeal the clause that began in February. A major part of the campaign was a private poll organised in Scotland, funded by Brian Souter
, the Scottish co-founder of the Stagecoach Group, at the time the country's largest privately owned public transport company. Souter supported the poll to the tune of £1million
Amidst the campaign came the 2000 Ayr by-election. The Scottish parliament seat of Ayr shared its boundaries with the Westminster seat, which had until 1997 been held by the Conservatives for almost a hundred years. In the 1999 Scottish parliamentary election the seat had been the most marginal in Scotland, with Labour winning over the Conservatives by a mere 25 votes. The Keep the Clause Campaign sought to influence the outcome of the election, campaigning in the area and buying up billboard space. Souter later claimed to have successfully influenced the by-election, with the by-election being won by the Conservative candidate, who had opposed repeal of Section 28. Labour's George Foulkes attacked the Keep the Clause Campaign, claiming there had been a "distortion of democracy" and that the Keep the Clause Campaign had outspent all the candidates combined.
Poll
The poll was a postal ballot directed at the 3.9 million people registered to vote in Scotland in 1999. The campaign group initially approached the Electoral Reform Society to organise the ballot through its ballot services subsidiary. The society refused the request as it believed the poll "would not be a legitimate democratic exercise to ask people to give an opinion on the repeal of Section 28 without knowing the detail of what would replace it".
From the 3,970,712 papers posted, 31.8% valid votes were returned with all votes counted by May 2000. The results showed that 86.8% of the returned ballots were in favour of keeping Section 28, and 13.2% in favour of repeal. Many groups hostile to the campaign had called for a public boycott of the poll. It was also estimated that the 1999 voters list could be 10-12% inaccurate, due to out of date information.
Response
Mainstream politicians, including the Scottish National Party (which Souter has supported) largely ignored the poll result, and disputed whether it was a true reflection of public opinion. The then Communities Minister, Wendy Alexander MSP, criticised the poll stating "I think what is significant about today's ballot is that two out of three voters rejected, or binned or simply ignored this glorified opinion poll."
References
External links
The campaign website, deactivated in December 2000
Transcript of a BBC interview of Souter in March 2002
LGBT history in the United Kingdom
LGBT rights in Scotland
Homophobia
|
```smalltalk
using Microsoft.MixedReality.Toolkit.UI;
using Microsoft.MixedReality.Toolkit.Utilities.Editor;
using UnityEditor;
using UnityEngine;
namespace Microsoft.MixedReality.Toolkit.Inspectors
{
[CustomEditor(typeof(ButtonConfigHelper)), CanEditMultipleObjects]
public class ButtonConfigHelperInspector : UnityEditor.Editor
{
private const string LabelFoldoutKey = "MRTK.ButtonConfigHelper.Label";
private const string BasicEventsFoldoutKey = "MRTK.ButtonConfigHelper.BasicEvents";
private const string IconFoldoutKey = "MRTK.ButtonConfigHelper.Icon";
private const string ShowComponentsKey = "MRTK.ButtonConfigHelper.ShowComponents";
private const string ShowSpeechCommandKey = "MRTK.ButtonConfigHelper.DisplayInteractableSpeechCommand";
private const string generatedIconSetName = "CustomIconSet";
private const string customIconSetsFolderName = "CustomIconSets";
private const string customIconUpgradeMessage = "This button appears to have a custom icon material. This is no longer required for custom icons.\n\n" +
"We recommend upgrading the buttons in your project by installing the Microsoft.MixedRealityToolkit.Unity.Tools package and using the Migration Tool.";
private const string missingIconWarningMessage = "The icon used by this button was not found in the icon set. You can see the icon currently being used is in the field below:";
private const string missingCharIconWarningMessage = "The icon used by this button was not found in the icon set. It may be part of another char icon font that was previously part of this icon set";
private const string customIconSetCreatedMessage = "A new icon set has been created to hold your button's custom icons. It has been saved to:\n\n{0}";
private const string upgradeDocUrl = "path_to_url#how-to-change-the-icon-and-text";
private SerializedProperty mainLabelTextProp;
private SerializedProperty seeItSayItLabelProp;
private SerializedProperty displayInteractableSpeechCommand;
private SerializedProperty seeItSayItLabelTextProp;
private SerializedProperty interactableProp;
private SerializedProperty iconStyleProp;
private SerializedProperty iconSetProp;
private SerializedProperty iconCharLabelProp;
private SerializedProperty iconCharProp;
private SerializedProperty iconFontProp;
private SerializedProperty iconSpriteRendererProp;
private SerializedProperty iconSpriteProp;
private SerializedProperty iconQuadRendererProp;
private SerializedProperty iconQuadTextureNameIDProp;
private SerializedProperty iconQuadTextureProp;
private ButtonConfigHelper cb = null;
private void OnEnable()
{
mainLabelTextProp = serializedObject.FindProperty("mainLabelText");
seeItSayItLabelProp = serializedObject.FindProperty("seeItSayItLabel");
displayInteractableSpeechCommand = serializedObject.FindProperty("displayInteractableSpeechCommand");
seeItSayItLabelTextProp = serializedObject.FindProperty("seeItSayItLabelText");
interactableProp = serializedObject.FindProperty("interactable");
iconStyleProp = serializedObject.FindProperty("iconStyle");
iconSetProp = serializedObject.FindProperty("iconSet");
iconCharLabelProp = serializedObject.FindProperty("iconCharLabel");
iconCharProp = serializedObject.FindProperty("iconChar");
iconFontProp = serializedObject.FindProperty("iconCharFont");
iconSpriteRendererProp = serializedObject.FindProperty("iconSpriteRenderer");
iconSpriteProp = serializedObject.FindProperty("iconSprite");
iconQuadRendererProp = serializedObject.FindProperty("iconQuadRenderer");
iconQuadTextureNameIDProp = serializedObject.FindProperty("iconQuadTextureNameID");
iconQuadTextureProp = serializedObject.FindProperty("iconQuadTexture");
}
public override void OnInspectorGUI()
{
cb = (ButtonConfigHelper)target;
bool labelFoldout = SessionState.GetBool(LabelFoldoutKey, true);
bool basicEventsFoldout = SessionState.GetBool(BasicEventsFoldoutKey, true);
bool iconFoldout = SessionState.GetBool(IconFoldoutKey, true);
bool showComponents = SessionState.GetBool(ShowComponentsKey, false);
bool showSpeechCommand = SessionState.GetBool(ShowSpeechCommandKey, true);
if (cb.EditorCheckForCustomIcon())
{
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
{
EditorGUILayout.LabelField("Custom Icon Migration", EditorStyles.boldLabel);
EditorGUILayout.HelpBox(customIconUpgradeMessage, MessageType.Error);
using (new EditorGUILayout.HorizontalScope())
{
if (GUILayout.Button("Use migration tool to upgrade buttons"))
{
if (!EditorApplication.ExecuteMenuItem("Mixed Reality/Toolkit/Utilities/Migration Window"))
{
EditorUtility.DisplayDialog("Package Required", "You need to install the MRTK tools (Microsoft.MixedRealityToolkit.Unity.Tools) package to use the Migration Tool", "OK");
}
}
InspectorUIUtility.RenderDocumentationButton(upgradeDocUrl);
}
}
}
showComponents = EditorGUILayout.Toggle("Show Component References", showComponents);
ButtonIconStyle oldStyle = (ButtonIconStyle)iconStyleProp.intValue;
using (new EditorGUI.IndentLevelScope(1))
{
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
{
labelFoldout = EditorGUILayout.Foldout(labelFoldout, "Labels", true);
if (labelFoldout)
{
EditorGUI.BeginChangeCheck();
if (showComponents)
{
EditorGUILayout.PropertyField(mainLabelTextProp);
}
if (mainLabelTextProp.objectReferenceValue != null)
{
Component mainLabelText = (Component)mainLabelTextProp.objectReferenceValue;
bool mainLabelTextActive = EditorGUILayout.Toggle("Enable Main Label", mainLabelText.gameObject.activeSelf);
if (mainLabelText.gameObject.activeSelf != mainLabelTextActive)
{
mainLabelText.gameObject.SetActive(mainLabelTextActive);
EditorUtility.SetDirty(mainLabelText.gameObject);
}
if (mainLabelText.gameObject.activeSelf)
{
SerializedObject labelTextObject = new SerializedObject(mainLabelText);
SerializedProperty textProp = labelTextObject.FindProperty("m_text");
EditorGUILayout.PropertyField(textProp, new GUIContent("Main Label Text"));
EditorGUILayout.Space();
if (EditorGUI.EndChangeCheck())
{
labelTextObject.ApplyModifiedProperties();
}
}
}
if (showComponents)
{
EditorGUILayout.PropertyField(seeItSayItLabelProp);
}
if (seeItSayItLabelProp.objectReferenceValue != null)
{
GameObject seeItSayItLabel = (GameObject)seeItSayItLabelProp.objectReferenceValue;
bool seeItSayItLabelActive = EditorGUILayout.Toggle("Enable See it / Say it Label", seeItSayItLabel.activeSelf);
if (seeItSayItLabel.activeSelf != seeItSayItLabelActive)
{
seeItSayItLabel.SetActive(seeItSayItLabelActive);
EditorUtility.SetDirty(seeItSayItLabel);
}
if (seeItSayItLabel.activeSelf)
{
var sisiChanged = false;
EditorGUI.BeginChangeCheck();
if (showComponents)
{
EditorGUILayout.PropertyField(seeItSayItLabelTextProp);
}
showSpeechCommand = EditorGUILayout.Toggle("Display Speech Command", showSpeechCommand);
SerializedObject sisiLabelTextObject = new SerializedObject(seeItSayItLabelTextProp.objectReferenceValue);
SerializedProperty sisiTextProp = sisiLabelTextObject.FindProperty("m_text");
if (!showSpeechCommand)
{
EditorGUILayout.PropertyField(sisiTextProp, new GUIContent("See it / Say it Label"));
EditorGUILayout.Space();
}
else
{
if (interactableProp.objectReferenceValue != null)
{
SerializedObject interactableObject = new SerializedObject(interactableProp.objectReferenceValue);
SerializedProperty voiceCommandProperty = interactableObject.FindProperty("voiceCommand");
if (string.IsNullOrEmpty(voiceCommandProperty.stringValue))
{
EditorGUILayout.HelpBox("No valid speech command provided to the interactable", MessageType.Warning);
}
else
{
string sisiText = string.Format("Say \"{0}\"", voiceCommandProperty.stringValue);
if (sisiTextProp.stringValue != sisiText)
{
sisiTextProp.stringValue = sisiText;
sisiChanged = true;
}
}
}
else
{
EditorGUILayout.HelpBox("There is no interactable linked to the button config helper. One is needed to display the appropriate speech command", MessageType.Warning);
}
}
sisiChanged |= EditorGUI.EndChangeCheck();
if (sisiChanged)
{
sisiLabelTextObject.ApplyModifiedProperties();
}
}
}
}
}
}
using (new EditorGUI.IndentLevelScope(1))
{
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
{
basicEventsFoldout = EditorGUILayout.Foldout(basicEventsFoldout, "Basic Events", true);
if (basicEventsFoldout)
{
EditorGUI.BeginChangeCheck();
if (showComponents)
{
EditorGUILayout.PropertyField(interactableProp);
}
if (interactableProp.objectReferenceValue != null)
{
SerializedObject interactableObject = new SerializedObject(interactableProp.objectReferenceValue);
SerializedProperty onClickProp = interactableObject.FindProperty("OnClick");
EditorGUILayout.PropertyField(onClickProp);
if (EditorGUI.EndChangeCheck())
{
interactableObject.ApplyModifiedProperties();
}
}
}
}
}
using (new EditorGUI.IndentLevelScope(1))
{
using (new EditorGUILayout.VerticalScope(EditorStyles.helpBox))
{
iconFoldout = EditorGUILayout.Foldout(iconFoldout, "Icon", true);
ButtonIconSet iconSet = (ButtonIconSet)iconSetProp.objectReferenceValue;
if (iconFoldout)
{
EditorGUILayout.PropertyField(iconStyleProp);
switch (cb.IconStyle)
{
case ButtonIconStyle.Char:
DrawIconCharEditor(showComponents, iconSet);
break;
case ButtonIconStyle.Quad:
DrawIconQuadEditor(showComponents, iconSet);
break;
case ButtonIconStyle.Sprite:
DrawIconSpriteEditor(showComponents, iconSet);
break;
}
EditorGUILayout.Space();
}
}
}
SessionState.SetBool(LabelFoldoutKey, labelFoldout);
SessionState.SetBool(BasicEventsFoldoutKey, basicEventsFoldout);
SessionState.SetBool(IconFoldoutKey, iconFoldout);
SessionState.SetBool(ShowComponentsKey, showComponents);
SessionState.SetBool(ShowSpeechCommandKey, showSpeechCommand);
serializedObject.ApplyModifiedProperties();
if (oldStyle != (ButtonIconStyle)iconStyleProp.intValue)
{
cb.ForceRefresh();
}
}
private void DrawIconSpriteEditor(bool showComponents, ButtonIconSet iconSet)
{
if (showComponents)
{
EditorGUILayout.PropertyField(iconSpriteRendererProp);
}
Sprite currentIconSprite = null;
if (iconQuadTextureProp.objectReferenceValue != null)
{
currentIconSprite = iconSpriteProp.objectReferenceValue as Sprite;
}
else
{
if (iconSpriteRendererProp.objectReferenceValue != null)
{
currentIconSprite = ((SpriteRenderer)iconSpriteRendererProp.objectReferenceValue).sprite;
}
else
{
EditorGUILayout.HelpBox("This button has no icon quad renderer assigned.", MessageType.Warning);
return;
}
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(iconSetProp);
EditorGUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (GUILayout.Button(EditorGUIUtility.IconContent("d_Refresh"), EditorStyles.miniButtonRight, GUILayout.Width(24f)))
{
iconSet.UpdateSpriteIconTextures();
}
EditorGUILayout.EndHorizontal();
if (iconSet == null)
{
EditorGUILayout.HelpBox("No icon set assigned. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);
EditorGUILayout.PropertyField(iconQuadTextureProp);
return;
}
if (iconSet.SpriteIcons == null || iconSet.SpriteIcons.Length == 0)
{
EditorGUILayout.HelpBox("No sprite icons assigned to the icon set. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);
EditorGUILayout.PropertyField(iconQuadTextureProp);
return;
}
Sprite newIconSprite;
bool foundSprite;
if (iconSet.EditorDrawSpriteIconSelector(currentIconSprite, out foundSprite, out newIconSprite, 1))
{
iconSpriteProp.objectReferenceValue = newIconSprite;
cb.SetSpriteIcon(newIconSprite);
}
if (!foundSprite)
{
EditorGUILayout.HelpBox(missingIconWarningMessage, MessageType.Warning);
EditorGUILayout.PropertyField(iconSpriteProp);
}
}
private void DrawIconQuadEditor(bool showComponents, ButtonIconSet iconSet)
{
if (showComponents)
{
EditorGUILayout.PropertyField(iconQuadRendererProp);
}
Texture currentIconTexture = null;
if (iconQuadTextureProp.objectReferenceValue != null)
{
currentIconTexture = iconQuadTextureProp.objectReferenceValue as Texture;
}
else
{
if (iconQuadRendererProp.objectReferenceValue != null)
{
currentIconTexture = ((Renderer)iconQuadRendererProp.objectReferenceValue).sharedMaterial.GetTexture(iconQuadTextureNameIDProp.stringValue);
}
else
{
EditorGUILayout.HelpBox("This button has no icon quad renderer assigned.", MessageType.Warning);
return;
}
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(iconSetProp);
EditorGUILayout.Space();
if (iconSet == null)
{
EditorGUILayout.HelpBox("No icon set assigned. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);
EditorGUILayout.PropertyField(iconQuadTextureProp);
return;
}
if (iconSet.QuadIcons == null || iconSet.QuadIcons.Length == 0)
{
EditorGUILayout.HelpBox("No quad icons assigned to the icon set. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);
EditorGUILayout.PropertyField(iconQuadTextureProp);
return;
}
Texture newIconTexture;
bool foundTexture;
if (iconSet.EditorDrawQuadIconSelector(currentIconTexture, out foundTexture, out newIconTexture, 1))
{
iconQuadTextureProp.objectReferenceValue = newIconTexture;
cb.SetQuadIcon(newIconTexture);
}
if (!foundTexture)
{
EditorGUILayout.HelpBox(missingIconWarningMessage, MessageType.Warning);
EditorGUILayout.PropertyField(iconQuadTextureProp);
}
}
private void DrawIconCharEditor(bool showComponents, ButtonIconSet iconSet)
{
if (showComponents)
{
EditorGUILayout.PropertyField(iconCharLabelProp);
}
uint currentIconChar = 0;
if (iconCharProp.longValue > 0)
{
currentIconChar = (uint)iconCharProp.longValue;
}
else
{
if (iconCharLabelProp != null)
{
SerializedObject tmpObject = new SerializedObject(iconCharLabelProp.objectReferenceValue);
SerializedProperty tmpTextProp = tmpObject.FindProperty("m_text");
string iconCharString = tmpTextProp.stringValue;
currentIconChar = ButtonIconSet.ConvertCharStringToUInt32(iconCharString);
}
else
{
EditorGUILayout.HelpBox("This button has no icon char renderer assigned.", MessageType.Warning);
return;
}
}
EditorGUILayout.Space();
EditorGUILayout.PropertyField(iconSetProp);
if (iconSet == null)
{
EditorGUILayout.HelpBox("No icon set assigned. You can specify custom icons manually by assigning them to the field below:", MessageType.Info);
EditorGUILayout.PropertyField(iconQuadTextureProp);
return;
}
uint newIconChar;
bool foundChar;
if (iconSet.EditorDrawCharIconSelector(currentIconChar, out foundChar, out newIconChar, 1))
{
iconCharProp.longValue = newIconChar;
SerializedObject iconSetObject = new SerializedObject(iconSet);
SerializedProperty charIconFontProp = iconSetObject.FindProperty("charIconFont");
iconFontProp.objectReferenceValue = charIconFontProp.objectReferenceValue;
cb.SetCharIcon(newIconChar);
if (!foundChar)
{
EditorGUILayout.HelpBox(missingCharIconWarningMessage, MessageType.Warning);
}
}
}
}
}
```
|
```sqlpl
SET allow_deprecated_snowflake_conversion_functions = 1;
SELECT addMonths(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 1, 'Asia/Kolkata');
SELECT addMonths(toDateTime('2017-11-05 10:37:47', 'Asia/Kolkata'), 1);
SELECT addMonths(toTimeZone(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 'Asia/Kolkata'), 1);
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), 1);
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), 1);
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), materialize(1));
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), materialize(1));
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), -1);
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), -1);
SELECT addMonths(toDateTime('2017-11-05 08:07:47'), materialize(-1));
SELECT addMonths(materialize(toDateTime('2017-11-05 08:07:47')), materialize(-1));
SELECT toUnixTimestamp('2017-11-05 08:07:47', 'Asia/Istanbul');
SELECT toUnixTimestamp(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 'Asia/Istanbul');
SELECT toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul');
SELECT toTimeZone(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 'Asia/Kolkata');
SELECT toString(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'));
SELECT toString(toTimeZone(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 'Asia/Kolkata'));
SELECT toString(toDateTime('2017-11-05 08:07:47', 'Asia/Istanbul'), 'Asia/Kolkata');
SELECT '-- Test const timezone arguments --';
DROP TABLE IF EXISTS tab;
CREATE TABLE tab (val Int64, tz String) engine=Log;
INSERT INTO tab VALUES (42, 'Asia/Singapore') (43, 'Asia/Tokyo');
SELECT val FROM tab WHERE now(tz) != toDateTime('2000-01-01 00:00:00') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE now(tz) != toDateTime('2000-01-01 00:00:00') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE now64(9, tz) != toDateTime64('2000-01-01 00:00:00', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE now64(9, tz) != toDateTime64('2000-01-01 00:00:00', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE nowInBlock(tz) != toDateTime('2000-01-01 00:00:00') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE nowInBlock(tz) != toDateTime('2000-01-01 00:00:00') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE toTimeZone(toDateTime(val), tz) != toDateTime('2023-06-11 14:14:14') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE toTimeZone(toDateTime(val), tz) != toDateTime('2023-06-11 14:14:14') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE fromUnixTimestamp64Milli(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE fromUnixTimestamp64Milli(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE fromUnixTimestamp64Micro(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE fromUnixTimestamp64Micro(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE fromUnixTimestamp64Nano(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE fromUnixTimestamp64Nano(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE snowflakeToDateTime(val, tz) != toDateTime('2023-06-11 14:14:14') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE snowflakeToDateTime(val, tz) != toDateTime('2023-06-11 14:14:14') ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
SELECT val FROM tab WHERE snowflakeToDateTime64(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 0; -- { serverError ILLEGAL_COLUMN }
SELECT val FROM tab WHERE snowflakeToDateTime64(val, tz) != toDateTime64('2023-06-11 14:14:14', 6) ORDER BY val SETTINGS allow_nonconst_timezone_arguments = 1;
-- test for a related bug:
DROP TABLE tab;
SET allow_nonconst_timezone_arguments = 1;
CREATE TABLE tab (`country` LowCardinality(FixedString(7)) DEFAULT 'unknown', `city` LowCardinality(String) DEFAULT 'unknown', `region` LowCardinality(String) DEFAULT 'unknown', `continent` LowCardinality(FixedString(7)) DEFAULT 'unknown', `is_eu_country` Bool, `date` DateTime CODEC(DoubleDelta, LZ4), `viewer_date` DateTime ALIAS toTimezone(date, timezone), `device_browser` LowCardinality(String) DEFAULT 'unknown', `metro_code` LowCardinality(String) DEFAULT 'unknown', `domain` String DEFAULT 'unknown', `device_platform` LowCardinality(String) DEFAULT 'unknown', `device_type` LowCardinality(String) DEFAULT 'unknown', `device_vendor` LowCardinality(String) DEFAULT 'unknown', `ip` FixedString(39) DEFAULT 'unknown', `lat` Decimal(8, 6) CODEC(T64), `lng` Decimal(9, 6) CODEC(T64), `asset_id` String DEFAULT 'unknown', `is_personalized` Bool, `metric` String, `origin` String DEFAULT 'unknown', `product_id` UInt64 CODEC(T64), `referer` String DEFAULT 'unknown', `server_side` Int8 CODEC(T64), `third_party_id` String DEFAULT 'unknown', `partner_slug` LowCardinality(FixedString(10)) DEFAULT 'unknown', `user_agent` String DEFAULT 'unknown', `user_id` UUID, `zip` FixedString(10) DEFAULT 'unknown', `timezone` LowCardinality(String), `as_organization` LowCardinality(String) DEFAULT 'unknown', `content_cat` Array(String), `playback_method` LowCardinality(String) DEFAULT 'unknown', `store_id` LowCardinality(String) DEFAULT 'unknown', `store_url` String DEFAULT 'unknown', `timestamp` Nullable(DateTime), `ad_count` Int8 CODEC(T64), `ad_type` LowCardinality(FixedString(10)) DEFAULT 'unknown', `ad_categories` Array(FixedString(8)), `blocked_ad_categories` Array(FixedString(8)), `break_max_ad_length` Int8 CODEC(T64), `break_max_ads` Int8 CODEC(T64), `break_max_duration` Int8 CODEC(T64), `break_min_ad_length` Int8 CODEC(T64), `break_position` LowCardinality(FixedString(18)) DEFAULT 'unknown', `media_playhead` String DEFAULT 'unknown', `placement_type` Int8 CODEC(T64), `transaction_id` String, `universal_ad_id` Array(String), `client_ua` LowCardinality(String) DEFAULT 'unknown', `device_ip` FixedString(39) DEFAULT 'unknown', `device_ua` LowCardinality(String) DEFAULT 'unknown', `ifa` String, `ifa_type` LowCardinality(String) DEFAULT 'unknown', `vast_lat` Decimal(8, 6) CODEC(T64), `vast_long` Decimal(9, 6) CODEC(T64), `server_ua` String DEFAULT 'unknown', `app_bundle` String DEFAULT 'unknown', `page_url` String DEFAULT 'unknown', `api_framework` Array(UInt8), `click_type` LowCardinality(String), `extensions` Array(String), `media_mime` Array(String), `om_id_partner` LowCardinality(String) DEFAULT 'unknown', `player_capabilities` Array(FixedString(12)), `vast_versions` Array(UInt8), `verification_vendors` Array(String), `ad_play_head` String DEFAULT 'unknown', `ad_serving_id` String DEFAULT 'unknown', `asset_uri` String DEFAULT 'unknown', `content_id` String DEFAULT 'unknown', `content_uri` String DEFAULT 'unknown', `inventory_state` Array(FixedString(14)), `player_size` Array(UInt8), `player_state` Array(FixedString(12)), `pod_sequence` Int8 CODEC(T64), `click_position` Array(UInt32), `error_code` Int16 CODEC(T64), `error_reason` Int8 CODEC(T64), `gdpr_consent` String DEFAULT 'unknown', `limited_tracking` Bool, `regulations` String DEFAULT 'unknown', `content_category` Array(String), PROJECTION projection_TPAG_VAST_date (SELECT * ORDER BY toYYYYMMDD(date), metric, product_id, asset_id)) ENGINE = MergeTree ORDER BY (product_id, metric, asset_id, toYYYYMMDD(date));
DETACH TABLE tab;
SET allow_nonconst_timezone_arguments = 0;
-- ATTACH TABLE doesn't check the default expressions
ATTACH TABLE tab;
DROP TABLE tab;
-- CREATE TABLE does check the default expessions, so the following is expected to fail:
CREATE TABLE tab (`country` LowCardinality(FixedString(7)) DEFAULT 'unknown', `city` LowCardinality(String) DEFAULT 'unknown', `region` LowCardinality(String) DEFAULT 'unknown', `continent` LowCardinality(FixedString(7)) DEFAULT 'unknown', `is_eu_country` Bool, `date` DateTime CODEC(DoubleDelta, LZ4), `viewer_date` DateTime ALIAS toTimezone(date, timezone), `device_browser` LowCardinality(String) DEFAULT 'unknown', `metro_code` LowCardinality(String) DEFAULT 'unknown', `domain` String DEFAULT 'unknown', `device_platform` LowCardinality(String) DEFAULT 'unknown', `device_type` LowCardinality(String) DEFAULT 'unknown', `device_vendor` LowCardinality(String) DEFAULT 'unknown', `ip` FixedString(39) DEFAULT 'unknown', `lat` Decimal(8, 6) CODEC(T64), `lng` Decimal(9, 6) CODEC(T64), `asset_id` String DEFAULT 'unknown', `is_personalized` Bool, `metric` String, `origin` String DEFAULT 'unknown', `product_id` UInt64 CODEC(T64), `referer` String DEFAULT 'unknown', `server_side` Int8 CODEC(T64), `third_party_id` String DEFAULT 'unknown', `partner_slug` LowCardinality(FixedString(10)) DEFAULT 'unknown', `user_agent` String DEFAULT 'unknown', `user_id` UUID, `zip` FixedString(10) DEFAULT 'unknown', `timezone` LowCardinality(String), `as_organization` LowCardinality(String) DEFAULT 'unknown', `content_cat` Array(String), `playback_method` LowCardinality(String) DEFAULT 'unknown', `store_id` LowCardinality(String) DEFAULT 'unknown', `store_url` String DEFAULT 'unknown', `timestamp` Nullable(DateTime), `ad_count` Int8 CODEC(T64), `ad_type` LowCardinality(FixedString(10)) DEFAULT 'unknown', `ad_categories` Array(FixedString(8)), `blocked_ad_categories` Array(FixedString(8)), `break_max_ad_length` Int8 CODEC(T64), `break_max_ads` Int8 CODEC(T64), `break_max_duration` Int8 CODEC(T64), `break_min_ad_length` Int8 CODEC(T64), `break_position` LowCardinality(FixedString(18)) DEFAULT 'unknown', `media_playhead` String DEFAULT 'unknown', `placement_type` Int8 CODEC(T64), `transaction_id` String, `universal_ad_id` Array(String), `client_ua` LowCardinality(String) DEFAULT 'unknown', `device_ip` FixedString(39) DEFAULT 'unknown', `device_ua` LowCardinality(String) DEFAULT 'unknown', `ifa` String, `ifa_type` LowCardinality(String) DEFAULT 'unknown', `vast_lat` Decimal(8, 6) CODEC(T64), `vast_long` Decimal(9, 6) CODEC(T64), `server_ua` String DEFAULT 'unknown', `app_bundle` String DEFAULT 'unknown', `page_url` String DEFAULT 'unknown', `api_framework` Array(UInt8), `click_type` LowCardinality(String), `extensions` Array(String), `media_mime` Array(String), `om_id_partner` LowCardinality(String) DEFAULT 'unknown', `player_capabilities` Array(FixedString(12)), `vast_versions` Array(UInt8), `verification_vendors` Array(String), `ad_play_head` String DEFAULT 'unknown', `ad_serving_id` String DEFAULT 'unknown', `asset_uri` String DEFAULT 'unknown', `content_id` String DEFAULT 'unknown', `content_uri` String DEFAULT 'unknown', `inventory_state` Array(FixedString(14)), `player_size` Array(UInt8), `player_state` Array(FixedString(12)), `pod_sequence` Int8 CODEC(T64), `click_position` Array(UInt32), `error_code` Int16 CODEC(T64), `error_reason` Int8 CODEC(T64), `gdpr_consent` String DEFAULT 'unknown', `limited_tracking` Bool, `regulations` String DEFAULT 'unknown', `content_category` Array(String), PROJECTION projection_TPAG_VAST_date (SELECT * ORDER BY toYYYYMMDD(date), metric, product_id, asset_id)) ENGINE = MergeTree ORDER BY (product_id, metric, asset_id, toYYYYMMDD(date)); -- { serverError ILLEGAL_COLUMN }
```
|
```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.
*/
// modified from original source see README at the top level of this project
#undef LOG_TAG
#define LOG_TAG "CursorWindow"
#define __STDC_FORMAT_MACROS
#include <inttypes.h>
#include <jni.h>
#include <JNIHelp.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "CursorWindow.h"
#include "android_database_SQLiteCommon.h"
namespace android {
static struct {
jfieldID data;
jfieldID sizeCopied;
} gCharArrayBufferClassInfo;
static jstring gEmptyString = NULL;
static void throwExceptionWithRowCol(JNIEnv* env, jint row, jint column) {
char buf[64];
snprintf(buf, sizeof(buf), "Couldn't read row %d column %d", row, column);
jniThrowException(env, "java/lang/IllegalStateException", buf);
}
static void throwUnknownTypeException(JNIEnv * env, jint type) {
char buf[32];
snprintf(buf, sizeof(buf), "UNKNOWN type %d", type);
jniThrowException(env, "java/lang/IllegalStateException", buf);
}
static jlong nativeCreate(JNIEnv* env, jclass clazz, jstring nameObj, jint cursorWindowSize) {
CursorWindow* window;
const char* nameStr = env->GetStringUTFChars(nameObj, NULL);
status_t status = CursorWindow::create(nameStr, cursorWindowSize, &window);
env->ReleaseStringUTFChars(nameObj, nameStr);
if (status || !window) {
ALOGE("Could not allocate CursorWindow of size %d due to error %d.",
cursorWindowSize, status);
return 0;
}
LOG_WINDOW("nativeInitializeEmpty: window = %p", window);
return reinterpret_cast<jlong>(window);
}
static void nativeDispose(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
if (window) {
LOG_WINDOW("Closing window %p", window);
delete window;
}
}
static jstring nativeGetName(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
return env->NewStringUTF(window->name());
}
static void nativeClear(JNIEnv * env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
LOG_WINDOW("Clearing window %p", window);
status_t status = window->clear();
if (status) {
LOG_WINDOW("Could not clear window. error=%d", status);
}
}
static jint nativeGetNumRows(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
return window->getNumRows();
}
static jboolean nativeSetNumColumns(JNIEnv* env, jclass clazz, jlong windowPtr,
jint columnNum) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
status_t status = window->setNumColumns(columnNum);
return status == OK;
}
static jboolean nativeAllocRow(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
status_t status = window->allocRow();
return status == OK;
}
static void nativeFreeLastRow(JNIEnv* env, jclass clazz, jlong windowPtr) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
window->freeLastRow();
}
static jint nativeGetType(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
LOG_WINDOW("returning column type affinity for %d,%d from %p", row, column, window);
CursorWindow::FieldSlot* fieldSlot = window->getFieldSlot(row, column);
if (!fieldSlot) {
return CursorWindow::FIELD_TYPE_NULL;
}
return window->getFieldSlotType(fieldSlot);
}
static jbyteArray nativeGetBlob(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
//LOG_WINDOW("Getting blob for %d,%d from %p", row, column, window);
CursorWindow::FieldSlot* fieldSlot = window->getFieldSlot(row, column);
if (!fieldSlot) {
throwExceptionWithRowCol(env, row, column);
return NULL;
}
int32_t type = window->getFieldSlotType(fieldSlot);
if (type == CursorWindow::FIELD_TYPE_BLOB || type == CursorWindow::FIELD_TYPE_STRING) {
size_t size;
const void* value = window->getFieldSlotValueBlob(fieldSlot, &size);
jbyteArray byteArray = env->NewByteArray(size);
if (!byteArray) {
env->ExceptionClear();
throw_sqlite3_exception(env, "Native could not create new byte[]");
return NULL;
}
env->SetByteArrayRegion(byteArray, 0, size, static_cast<const jbyte*>(value));
return byteArray;
} else if (type == CursorWindow::FIELD_TYPE_INTEGER) {
throw_sqlite3_exception(env, "INTEGER data in nativeGetBlob ");
} else if (type == CursorWindow::FIELD_TYPE_FLOAT) {
throw_sqlite3_exception(env, "FLOAT data in nativeGetBlob ");
} else if (type == CursorWindow::FIELD_TYPE_NULL) {
// do nothing
} else {
throwUnknownTypeException(env, type);
}
return NULL;
}
extern int utf8ToJavaCharArray(const char* d, jchar v[], jint byteCount);
static jstring nativeGetString(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
//LOG_WINDOW("Getting string for %d,%d from %p", row, column, window);
CursorWindow::FieldSlot* fieldSlot = window->getFieldSlot(row, column);
if (!fieldSlot) {
throwExceptionWithRowCol(env, row, column);
return NULL;
}
int32_t type = window->getFieldSlotType(fieldSlot);
if (type == CursorWindow::FIELD_TYPE_STRING) {
size_t sizeIncludingNull;
const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull);
if (sizeIncludingNull <= 1) {
return gEmptyString;
}
const size_t MaxStackStringSize = 65536; // max size for a stack char array
if (sizeIncludingNull > MaxStackStringSize) {
jchar* chars = new jchar[sizeIncludingNull - 1];
jint size = utf8ToJavaCharArray(value, chars, sizeIncludingNull - 1);
jstring string = env->NewString(chars, size);
delete[] chars;
return string;
} else {
jchar chars[sizeIncludingNull - 1];
jint size = utf8ToJavaCharArray(value, chars, sizeIncludingNull - 1);
return env->NewString(chars, size);
}
} else if (type == CursorWindow::FIELD_TYPE_INTEGER) {
int64_t value = window->getFieldSlotValueLong(fieldSlot);
char buf[32];
snprintf(buf, sizeof(buf), "%" PRId64, value);
return env->NewStringUTF(buf);
} else if (type == CursorWindow::FIELD_TYPE_FLOAT) {
double value = window->getFieldSlotValueDouble(fieldSlot);
char buf[32];
snprintf(buf, sizeof(buf), "%g", value);
return env->NewStringUTF(buf);
} else if (type == CursorWindow::FIELD_TYPE_NULL) {
return NULL;
} else if (type == CursorWindow::FIELD_TYPE_BLOB) {
throw_sqlite3_exception(env, "Unable to convert BLOB to string");
return NULL;
} else {
throwUnknownTypeException(env, type);
return NULL;
}
}
static jlong nativeGetLong(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
//LOG_WINDOW("Getting long for %d,%d from %p", row, column, window);
CursorWindow::FieldSlot* fieldSlot = window->getFieldSlot(row, column);
if (!fieldSlot) {
throwExceptionWithRowCol(env, row, column);
return 0;
}
int32_t type = window->getFieldSlotType(fieldSlot);
if (type == CursorWindow::FIELD_TYPE_INTEGER) {
return window->getFieldSlotValueLong(fieldSlot);
} else if (type == CursorWindow::FIELD_TYPE_STRING) {
size_t sizeIncludingNull;
const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull);
return sizeIncludingNull > 1 ? strtoll(value, NULL, 0) : 0L;
} else if (type == CursorWindow::FIELD_TYPE_FLOAT) {
return jlong(window->getFieldSlotValueDouble(fieldSlot));
} else if (type == CursorWindow::FIELD_TYPE_NULL) {
return 0;
} else if (type == CursorWindow::FIELD_TYPE_BLOB) {
throw_sqlite3_exception(env, "Unable to convert BLOB to long");
return 0;
} else {
throwUnknownTypeException(env, type);
return 0;
}
}
static jdouble nativeGetDouble(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
//LOG_WINDOW("Getting double for %d,%d from %p", row, column, window);
CursorWindow::FieldSlot* fieldSlot = window->getFieldSlot(row, column);
if (!fieldSlot) {
throwExceptionWithRowCol(env, row, column);
return 0.0;
}
int32_t type = window->getFieldSlotType(fieldSlot);
if (type == CursorWindow::FIELD_TYPE_FLOAT) {
return window->getFieldSlotValueDouble(fieldSlot);
} else if (type == CursorWindow::FIELD_TYPE_STRING) {
size_t sizeIncludingNull;
const char* value = window->getFieldSlotValueString(fieldSlot, &sizeIncludingNull);
return sizeIncludingNull > 1 ? strtod(value, NULL) : 0.0;
} else if (type == CursorWindow::FIELD_TYPE_INTEGER) {
return jdouble(window->getFieldSlotValueLong(fieldSlot));
} else if (type == CursorWindow::FIELD_TYPE_NULL) {
return 0.0;
} else if (type == CursorWindow::FIELD_TYPE_BLOB) {
throw_sqlite3_exception(env, "Unable to convert BLOB to double");
return 0.0;
} else {
throwUnknownTypeException(env, type);
return 0.0;
}
}
static jboolean nativePutBlob(JNIEnv* env, jclass clazz, jlong windowPtr,
jbyteArray valueObj, jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
jsize len = env->GetArrayLength(valueObj);
void* value = env->GetPrimitiveArrayCritical(valueObj, NULL);
status_t status = window->putBlob(row, column, value, len);
env->ReleasePrimitiveArrayCritical(valueObj, value, JNI_ABORT);
if (status) {
LOG_WINDOW("Failed to put blob. error=%d", status);
return false;
}
LOG_WINDOW("%d,%d is BLOB with %u bytes", row, column, len);
return true;
}
static jboolean nativePutString(JNIEnv* env, jclass clazz, jlong windowPtr,
jstring valueObj, jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
size_t sizeIncludingNull = env->GetStringUTFLength(valueObj) + 1;
const char* valueStr = env->GetStringUTFChars(valueObj, NULL);
if (!valueStr) {
LOG_WINDOW("value can't be transferred to UTFChars");
return false;
}
status_t status = window->putString(row, column, valueStr, sizeIncludingNull);
env->ReleaseStringUTFChars(valueObj, valueStr);
if (status) {
LOG_WINDOW("Failed to put string. error=%d", status);
return false;
}
LOG_WINDOW("%d,%d is TEXT with %u bytes", row, column, sizeIncludingNull);
return true;
}
static jboolean nativePutLong(JNIEnv* env, jclass clazz, jlong windowPtr,
jlong value, jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
status_t status = window->putLong(row, column, value);
if (status) {
LOG_WINDOW("Failed to put long. error=%d", status);
return false;
}
LOG_WINDOW("%d,%d is INTEGER 0x%016llx", row, column, value);
return true;
}
static jboolean nativePutDouble(JNIEnv* env, jclass clazz, jlong windowPtr,
jdouble value, jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
status_t status = window->putDouble(row, column, value);
if (status) {
LOG_WINDOW("Failed to put double. error=%d", status);
return false;
}
LOG_WINDOW("%d,%d is FLOAT %lf", row, column, value);
return true;
}
static jboolean nativePutNull(JNIEnv* env, jclass clazz, jlong windowPtr,
jint row, jint column) {
CursorWindow* window = reinterpret_cast<CursorWindow*>(windowPtr);
status_t status = window->putNull(row, column);
if (status) {
LOG_WINDOW("Failed to put null. error=%d", status);
return false;
}
LOG_WINDOW("%d,%d is NULL", row, column);
return true;
}
static const JNINativeMethod sMethods[] =
{
/* name, signature, funcPtr */
{ "nativeCreate", "(Ljava/lang/String;I)J",
(void*)nativeCreate },
{ "nativeDispose", "(J)V",
(void*)nativeDispose },
{ "nativeGetName", "(J)Ljava/lang/String;",
(void*)nativeGetName },
{ "nativeClear", "(J)V",
(void*)nativeClear },
{ "nativeGetNumRows", "(J)I",
(void*)nativeGetNumRows },
{ "nativeSetNumColumns", "(JI)Z",
(void*)nativeSetNumColumns },
{ "nativeAllocRow", "(J)Z",
(void*)nativeAllocRow },
{ "nativeFreeLastRow", "(J)V",
(void*)nativeFreeLastRow },
{ "nativeGetType", "(JII)I",
(void*)nativeGetType },
{ "nativeGetBlob", "(JII)[B",
(void*)nativeGetBlob },
{ "nativeGetString", "(JII)Ljava/lang/String;",
(void*)nativeGetString },
{ "nativeGetLong", "(JII)J",
(void*)nativeGetLong },
{ "nativeGetDouble", "(JII)D",
(void*)nativeGetDouble },
{ "nativePutBlob", "(J[BII)Z",
(void*)nativePutBlob },
{ "nativePutString", "(JLjava/lang/String;II)Z",
(void*)nativePutString },
{ "nativePutLong", "(JJII)Z",
(void*)nativePutLong },
{ "nativePutDouble", "(JDII)Z",
(void*)nativePutDouble },
{ "nativePutNull", "(JII)Z",
(void*)nativePutNull },
};
int register_android_database_CursorWindow(JNIEnv* env)
{
jclass clazz;
FIND_CLASS(clazz, "android/database/CharArrayBuffer");
GET_FIELD_ID(gCharArrayBufferClassInfo.data, clazz, "data", "[C");
GET_FIELD_ID(gCharArrayBufferClassInfo.sizeCopied, clazz, "sizeCopied", "I");
gEmptyString = static_cast<jstring>(env->NewGlobalRef(env->NewStringUTF("")));
return jniRegisterNativeMethods(env,
"io/requery/android/database/CursorWindow", sMethods, NELEM(sMethods));
}
} // namespace android
```
|
```smalltalk
using Elsa.Extensions;
using Elsa.Workflows;
using Elsa.Workflows.Activities;
using Elsa.Workflows.Contracts;
var services = new ServiceCollection();
services.AddElsa();
var serviceProvider = services.BuildServiceProvider();
var runner = serviceProvider.GetRequiredService<IWorkflowRunner>();
var workflow = new SetNameWorkflow();
var result = await runner.RunAsync(workflow);
public class SetNameWorkflow : WorkflowBase
{
protected override void Build(IWorkflowBuilder builder)
{
builder.Root = new Sequence
{
Activities =
{
new SetName("My Simple Workflow"),
new ShowName()
}
};
}
}
public class ShowName : Activity
{
protected override ValueTask ExecuteAsync(ActivityExecutionContext context)
{
var instanceName = context.WorkflowExecutionContext.GetProperty<string>("WorkflowInstanceName");
Console.WriteLine($"WorkflowInstanceName {instanceName}");
return ValueTask.CompletedTask;
}
}
```
|
```shell
#!/usr/bin/env bash
UNIQUE_TAB_LINES_COUNT=$(sed 's/[^\t]//g' TEST-DATA.tsv | sort -u | wc -l)
if [ $UNIQUE_TAB_LINES_COUNT -eq "1" ]
then
echo "All lines have the same number of tabs. All good!"
else
echo "Not all lines have the same number of tabs."
echo $UNIQUE_TAB_LINES_COUNT
exit 1
fi
```
|
```xml
import * as serverTiming from "server-timing";
import typeDefs from "./graphql/typeDefs";
import resolvers from "./graphql/resolvers";
import * as cookieParser from "cookie-parser";
import { setupMessageConsumers } from "./messageBroker";
import * as permissions from "./permissions";
import { getSubdomain } from "@erxes/api-utils/src/core";
import cpUserMiddleware from "./middlewares/cpUserMiddleware";
import { generateModels } from "./db/models";
import { IContext } from "./graphql";
import cronjobs from "./cronjobs";
import tags from "./tags";
import { generateAllDataLoaders } from "./graphql/dataloaders";
export default {
name: "forum",
permissions,
graphql: async () => {
return {
typeDefs: await typeDefs(),
resolvers: await resolvers()
};
},
hasSubscriptions: false,
meta: {
cronjobs,
tags
},
apolloServerContext: async (context, req, res): Promise<IContext> => {
const subdomain = getSubdomain(req);
context.models = await generateModels(subdomain);
context.subdomain = subdomain;
context.serverTiming = {
startTime: res.startTime,
endTime: res.endTime,
setMetric: res.setMetric
};
if (req.cpUser) {
context.cpUser = req.cpUser;
}
context.dataLoaders = generateAllDataLoaders(context.models, subdomain);
return context;
},
middlewares: [(serverTiming as any)(), cookieParser(), cpUserMiddleware],
onServerInit: async () => {},
setupMessageConsumers
};
```
|
Gulzarwala is a village of Dera Ghazi Khan District in the Punjab province of Pakistan. It is located at 30°20'50N 70°39'45E lying to the north of the district capital Dera Ghazi Khan - with an altitude of 126 metres (416 feet).
References
Populated places in Dera Ghazi Khan District
Villages in Dera Ghazi Khan District
|
The Czech Republic men's national squash team represents Czech Republic in international squash team competitions, and is governed by Czech Squash Association.
Current team
Jan Koukal
Petr Martin
Ondrej Ertl
Ondrej Uherka
Daniel Mekbib
Results
World Team Squash Championships
European Squash Team Championships
See also
Czech Squash Association
World Team Squash Championships
References
Squash teams
Men's national squash teams
Squash
Men's sport in the Czech Republic
|
Linda Lowe is a poet, singer-songwriter producer, recording artist and the founder of Writers in the Round Concert Series, a community sponsored, non-profit performing arts organization dedicated to connecting and mentoring creative writers and musicians. She has recorded seven albums of original music on her Rollin’ Records label including a duet album with Steve Gillette entitled "So Far Apart" produced by her husband, Karl Caillouet. Her songs "Let Her Go Gently" “Amber Eyes" and "Someday I’ll Be a Bluebird" are used in hospices and funerals across the country. She is currently working at The Red Shack studio with Rock Romano in Houston, Texas mixing two new albums of original music entitled "Barbwire Heart" and "Lucid Dreamer". She is the author of the "Little by Little" production, a musical presented at Main Street Theater in 1996 and again in 2017 with Xavier Educational Academy students in the Rice University Village. She and her daughter, Michelle Caillouet began the Music and Drama department for Xavier Educational Academy in West University Place, Texas where they continue to teach. For 10 years Writers in the round presented their concert series at Hamman Hall with Linda hosting and directing each show. Writers in the round will celebrate their 30-year anniversary in the 2019–2020 season at Main Street Theater in Rice University Village where they began in 1990. Linda's archives are currently being collected and preserved for her contribution to Texas Music at Rice University's Woodson Research Center and Texas State University's Texas Music History Department.
Biography
Linda Lowe was born in Hot Springs, Arkansas in 1950. She grew up in San Antonio, Texas and was a baby sitter for several DJ's at KTSA Radio where she was given boxloads of 45 records of all the current hits in the 1960s including Motown artists which helped inspire her to write poetry. Her first radio commercial was on bicycle safety airing on the Ricki Ware show on KTSA at age 9 or 10 years old. At the age of 15 her family moved back to Little Rock, Arkansas, where she graduated from Little Rock Central High School. While in high school she worked for Governor Winthrop Rockefeller and Graphic Communications touring the tiny towns of Arkansas with the Rockefeller campaign where she met Skeeter Davis (she would later reconnect with Skeeter at the Grand Ole Opry). Completing a production art course at MacArthur Park she became a paste up artist for the Air Scoop at Little Rock Air Force Base in Jacksonville, Arkansas. In 1970 she worked at Heritage Publishing Company as a type setter for the American Fishfarmer magazine and met Ringo Jukes who became her mentor and offered to publish her first book of Poetry called "All in Time". Another mentor who worked at the publishing company, John Beegle began writing her biography. Some time during the process of printing the poetry book, Heritage Publishing Company burned to the ground and none of the books were retrieved. Ringo Jukes and John Beegle gave their draft copy to Jimmy Dean and Bill Holland (who later also offered to publish the book) at Holland and Associates. She was hired as a national Time Buyer for the Jimmy Dean Sausage account where she worked from age 19–25. During that time she also appeared in TV commercials for Brut aftershave and a local Ford dealership. She began playing music in 1972 with Mary Gwin in the Little Rock area as "Me and My Friend" performing original music in local clubs and listening rooms. She met Rick Harrington while performing at the Leather Bottle and the Island X in Little Rock. Rick was managing a group called "Wildwood". They soon married and went out on the road with the group. Linda chose to lay down her guitar to work the sound for the popular group, but her marriage only lasted 9 months. Wildwood continues to work with Linda in her Writers in the round Concert Series and the Women in the round on the road touring group.
Lowe started writing when she was in her single digits. She remains a prolific songwriter, penning hundreds of songs. She moved to Houston in 1977 to continue a career in music, playing regularly at clubs and listening rooms in Houston and Austin while often traveling back to Arkansas to perform. Her favorite club to perform was Rockefeller's where she opened up for major acts including Bonnie Raitt, Jessie Collin Young, Donovan, and Loudon Wainwright, III. She was a regular at Morgenstern's in College Station and Anderson Fair. In 1984, Lowe was recognised as a winner of Kerrville Folk Festival’s New Folk Competition. Her song "Let Her Go Gently" on the Little by Little album was published in Sing Out Magazine and her 1977 custom OM cutaway guitar was featured in an ad for Collings guitars in the November 2005 issue of the Acoustic Guitar Magazine.
In 1981 Linda toured with Townes Van Zandt performing in concert at listening rooms in Eureka Springs, Fayetteville and Little Rock Arkansas. She produced a series called October Highlights scheduling concerts, PBS TV shows, and radio spots in conjunction with the UALR coffee house, and UALR Fine Arts Concert Hall to connect Texas and Arkansas songwriters. Townes Van Zandt continued to work with Linda as a regular guest in the round performing with her at Kerrville Folk Festival and Writers in the round at Main Street Theater. In 1982 she published her first album of original music called "Gamblin’ With the wind" on her record label Rollin’ Records featuring a mix of Arkansas and Texas musicians along with Robert Palmer. The Album was published by herself and Jerry Shook called Shooklin Publishing. In 1984 she toured Texas, the east and west coasts with Steve Gillette. Later, Linda toured Arkansas, Texas, Alabama, Florida and Carolina with various songwriters including Steve Young, Carolyn Hester, David Blume and Women in the round on the road. Linda married record producer and owner of Heights Sound Studio, Karl Caillouet in 1984. Working with Tony Rice, Bobby Clark and Linda's Upstairs band they recorded "So Far Apart" (a duet with Steve Gillette) and "Even the Moon" both produced and engineered by Karl Caillouet. Both were released on the Rollin’ Records label. In the late 1980s and early 1990s her producer was Robert Palmer, the author of Deep Blues, staff writer for The Rolling Stone Magazine, and the first New York Times pop music critic. Linda later introduced Townes Van Zandt to Robert Palmer when he was staying at her house while working on a book about the Rolling Stones. He fell in love with the music and she later put together a round at Main Street Theater with the three of them in the early 1990s. It was one of the first rounds of 30 years of WITR productions at Main Street Theater and Hamman Hall at Rice University. In the mid-1990s Linda partnered with Patsy Graham (the owner of Morgenstern's) and Mike Sumler with Rollin’ Records and Western Desert Publishing Company. The group released Mike's album entitled "Rain" and Linda's albums "The Rollin’ Records Collection" and "Little by Little".
In 1990, Lowe formed Writers in the Round Concert Series to help connect singer-songwriters and provide a smoke free family oriented theaterical venue where the focus was on the songs and the artists who wrote them instead of selling alcohol. She was part of a movement among house concert presenters and listening rooms throughout Texas which would
Change the way songwriters were presented in the 21st century providing a more healthy platform for their performances. A Songwriters Paradise written about this movement was published in the Texas Highway Magazine. The group met at Rice Village's Main Street Theater and Rice University’s Hamman Hall. Many artists performed and participated in the group over the years, including Tom Paxton, Selia Qynn, Aura Lee Emsweller, Don Sanders, Vince Bell, Bill Staines, Mike Sumler, Eric Taylor, Still on the hill, Malcolm Smith, Becky Smith, Sean Walters, Kevin Welch, Cheryl Wheeler, Michael Smith (author of The Dutchman), Buddy Mondlock, Kate Campbell, Slaid Cleaves, Catie Curtis, Ann Hill's, Emily Kaitz, Tom Kimmel, Jimmy LeFave, Bill Morrissey, Sisters Morales, Beaver Nelson, Carrie Newcomer, Tim O’Brien, James Gilmer, Steve Earle, Carolyn Hester, Loudon Wainwright III, Arlo Guthrie, Janis Ian, Trout Fishing in America, Patty Larkin, Lucinda Williams, Hans Theessink, the women of Kerrville, Christine Albert and Chris Gage, Lynn Langham and Doug Gill, Steve Young (author of seven bridges road), Gregg Brown, Rock Romano, Mood Indigo, Shake Russell
And Dana Cooper, George Ensle, Wildwood, Bill Haymes, Rod Kennedy's Book Signing, Mary Ann Willis (author of 13 books for Mel Bay Violin instruction), Leah Zeger, Robert Palmer, Ray Wylie Hubbard, David Broza, David Amram
and Townes Van Zandt.
At one of Writers in the Round's concerts, on March 16, 1994, Lowe introduced Townes Van Zandt, David Amram, and David Broza. Van Zandt, Broza, and Lowe began to talk about the possibility of collaborating to publish some of Van Zandt's old poems in song form. There is a video of the entire concert including breaks in the Writers in the round DVD archives which captures their mutual respect, warmth and camaraderie. After Van Zandt died in 1997, Broza began to work on writing music for ten of Van Zandt's never-before-seen pieces. Writers in the round presented the Texas Release of Night Dawn at the Chelsea Market location of Main Street Theater where David Broza performed with GE Smith. Writers in the round students, Abby Boyce and Gabrielle Heal opened the show with "Poncho and Lefty". He released the album in 2010 as Night Dawn: The Unpublished Poetry of Townes Van Zandt.
Another memorable Writers in the round concert was at Hamman Hall Rice University on December 13, 1995. Linda hosted an extraordinary show featuring Lucinda Williams, Ray Wylie Hubbard and Steve Earle. This was Steve's first concert having been released from prison and the concert was initially slated to include Townes Van Zandt. At some Point during the packed concert The Baker Fraternity streaked down the Isles of Hamman Hall which caused a bit of a scene. The comments from all the artists on stage were comical and memorable.
At first, Writers in the Round was only open to adult songwriters. By 2000, however, Lowe had expanded the organization to create a non-competitive, nurturing performance space called The Moody Blue Room, an Eagle Scout project for Southside resident and WITR student Ted Boozalis Now called The George E. Graham Moody Blue Room. The creative space helped to offer an incubator for youth who were interested in learning how to play instruments, perform together and solo, record and pen their own songs. She co wrote and produced "West U Dreams", a collection of original songs by her students. She continues to mentor young songwriters through Music camps and performances with the Writers in the round performing artists in residence program and at Xavier Educational Academy in West University Pace, Texas. Since starting Writers in the Round, she has helped launch similar programs in Florida, North Carolina, Arkansas, and Indiana.
Discography
The Rollin’ Records Collection
Rollin’ Records
1984
1984
So Far Apart
Rollin’ Records
2005
West U Dreams
Rollin’ Records
2019
Barbwire Heart
Rollin’ Records
References
External links
Houston Folk Music Archive (Woodson Research Center, Rice University)
Houston Folk Music Archive Guide (Woodson Research Center, Rice University)
Living people
1951 births
|
```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,
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* specific language governing permissions and limitations
*/
package org.apache.weex.ui.component.list.template;
import android.text.TextUtils;
import org.apache.weex.ui.component.WXComponent;
import org.apache.weex.ui.component.WXVContainer;
import org.apache.weex.ui.component.list.WXCell;
import java.util.List;
/**
* Created by furture on 2018/7/24.
*/
public class Selector {
/**
* @param selector [att=xx]
* query elements match selector, current only support attr selector
* */
public static void queryElementAll(WXComponent component, String selector, List<WXComponent> componentList){
if(TextUtils.isEmpty(selector)){
return;
}
selector = selector.replaceAll("\\[|]", "");
String[] args = selector.split("=");
if(args.length <= 0){
return;
}
String key = args[0];
String value = null;
if(args.length > 1){
value = args[1].trim();
}
if(component instanceof WXVContainer){
WXVContainer container = (WXVContainer) component;
for(int i=0; i<container.getChildCount(); i++){
queryElementAllByAttrs(container.getChild(i), key, value, componentList);
}
}
}
public static void closest(WXComponent component, String selector,List<WXComponent> componentList){
if(TextUtils.isEmpty(selector)){
return;
}
selector = selector.replaceAll("\\[|]", "");
String[] args = selector.split("=");
if(args.length <= 0){
return;
}
String key = args[0];
String value = null;
if(args.length > 1){
value = args[1].trim();
}
closestByAttrs(component, key, value, componentList);
}
private static void closestByAttrs(WXComponent component, String key, String value, List<WXComponent> componentList){
if(matchAttrs(component, key, value)){
componentList.add(component);
}
if(component instanceof WXCell || component instanceof WXRecyclerTemplateList){
return;
}
queryElementAllByAttrs(component.getParent(), key, value, componentList);
}
private static void queryElementAllByAttrs(WXComponent component, String key, String value, List<WXComponent> componentList){
if(matchAttrs(component, key, value)){
componentList.add(component);
}
if(component instanceof WXVContainer){
WXVContainer container = (WXVContainer) component;
for(int i=0; i<container.getChildCount(); i++){
queryElementAllByAttrs(container.getChild(i), key, value, componentList);
}
}
}
private static boolean matchAttrs(WXComponent component, String key, String value){
if(component.isWaste()){
return false;
}
if(!component.getAttrs().containsKey(key)){
return false;
}
if(TextUtils.isEmpty(value)){
return true;
}
Object attrValue = component.getAttrs().get(key);
if(attrValue == null){
return false;
}
return value.equals(attrValue.toString());
}
}
```
|
```c++
// uncaught_exception -- uncaught_exception for Microsoft
#include <eh.h>
#include <exception>
_STD_BEGIN
_CRTIMP2_PURE bool __CLRCALL_PURE_OR_CDECL uncaught_exception() noexcept
{ // report if handling a throw
return (__uncaught_exception());
}
_STD_END
/*
* Consult your license regarding permissions and restrictions.
V6.50:0009 */
```
|
Kasakova is a village in Setomaa Parish, Võru County in Estonia.
References
Villages in Võru County
|
The 1906 municipal election was held December 10, 1906 for the purpose of electing a mayor and five aldermen to sit on the Edmonton City Council, as well as five public school trustees and six separate school trustees. There were eight aldermen on city council, but three of the positions were already filled: Robert Manson, Joseph Henri Picard, and Samuel Smith had been elected to two-year terms in 1905, and were still in office. William Antrobus Griesbach had also been elected to a two-year term, but resigned to run for mayor. Accordingly, the fifth place aldermanic candidate in the 1906 election - Morton MacAuley - was elected only to serve out the remaining year of Griesbach's term.
Voter turnout
There were 1221 ballots cast in the 1906 municipal election. The number of eligible voters is no longer available.
Results
(bold indicates elected, italics indicate incumbent)
Mayor
William Antrobus Griesbach - 717
Thomas Bellamy - 301
H J Dawson - 144
Aldermen
Wilfrid Gariépy - 585
Thomas Daly - 564
James Walker - 559
Cameron Anderson - 480
Morton MacAuley - 417
Gustave Koerman - 399
Wade Stuart - 312
Lucien Dubuc - 305
A H Allen - 276
W S Weeks - 260
J R Hetherington - 91
F M Lannic - 77
Public school trustees
W D Ferris, H A Gray, A E May, Alex Taylor, and Hedley C. Taylor were elected. Detailed results are no longer available.
Separate (Catholic) school trustees
Wilfrid Gariépy, E J Hart, Prosper-Edmond Lessard, Joseph Henri Picard, S Schultz, and O Tessier were elected. Detailed results are no longer available.
References
City of Edmonton: Edmonton Elections
1906
1906 elections in Canada
1906 in Alberta
|
The Osborne, later Osborn Baronetcy, of Chicksands in the County of Bedford, is a title in the Baronetage of England. It was created on 11 February 1662 for John Osborne, subsequently Remembrancer to the Treasury from 1674 to 1698. The baronetcy was in recognition of the sufferings the family had suffered for its support of Charles I.
Osborn was the son of Sir Peter Osborne, Governor of Guernsey, great-grandson of Peter Osborne, who acquired the family seat of Chicksands Priory in 1576 and was Remembrancer of the Treasury to Henry VIII, Keeper of the Privy Purse to Edward VI and Commissioner of Ecclesiastical Affairs to Elizabeth I.
Dorothy Osborne (1627-1695) was the daughter of Sir Peter Osborne and sister of the first Baronet. She was engaged to Henry Cromwell, son of Oliver Cromwell, and also pressured to marry Thomas Osborne, 1st Duke of Leeds, but eventually married Sir William Temple, 1st Baronet, whom she truly loved. The correspondence between Dorothy and William during their lengthy separation is one of the "great monuments of epistolary literature".
The third Baronet was the son of John Osborn, eldest son of the second Baronet, who altered the spelling of the family surname to Osborn to avoid confusion with the Osborne family which had earlier been created Osborne baronets, of Kiveton in 1620, and were elevated to the peerage as the Duke of Leeds.
The third Baronet was Governor of New York and Member of Parliament for Bedfordshire. The fourth Baronet was a General in the British Army and also represented Northampton, Bossiney, Penrhyn and Horsham in the House of Commons. The fifth Baronet was Member of Parliament for four constituencies and served as a Lord of the Admiralty under the Earl of Liverpool.
The current baronet was the second but eldest surviving son of the 8th baronet.
Osborne, later Osborn baronets, of Chicksands (1662)
Sir John Osborne, 1st Baronet (–1699)
Sir John Osborne, 2nd Baronet (c. 1650–1720)
Sir Danvers Osborn, 3rd Baronet (1715–1753)
Sir George Osborn, 4th Baronet (1742–1818)
Sir John Osborn, 5th Baronet (1772–1848)
Sir George Robert Osborn, 6th Baronet (1813–1892)
Sir Algernon Kerr Butler Osborn, 7th Baronet (1870–1948)
Capt. Peter Stanley Howard Osborn (20 August 1912 – 4 February 1944)
Sir Danvers Lionel Rouse Osborn, 8th Baronet (1916–1983)
Peter Robin Danvers Osborn (23 August 1954 – 26 December 1954)
Sir Richard Henry Danvers Osborn, 9th Baronet (born 1958)
There are no heirs to the baronetcy.
Coat of arms
See also
Osborne baronets
References
Baronetcies in the Baronetage of England
1662 establishments in England
|
```c++
//
// detail/non_const_lvalue.hpp
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
//
// file LICENSE_1_0.txt or copy at path_to_url
//
#ifndef ASIO_DETAIL_NON_CONST_LVALUE_HPP
#define ASIO_DETAIL_NON_CONST_LVALUE_HPP
#if defined(_MSC_VER) && (_MSC_VER >= 1200)
# pragma once
#endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
#include "asio/detail/config.hpp"
#include "asio/detail/type_traits.hpp"
#include "asio/detail/push_options.hpp"
namespace asio {
namespace detail {
template <typename T>
struct non_const_lvalue
{
explicit non_const_lvalue(T& t)
: value(static_cast<conditional_t<
is_same<T, decay_t<T>>::value, decay_t<T>&, T&&>>(t))
{
}
conditional_t<is_same<T, decay_t<T>>::value, decay_t<T>&, decay_t<T>> value;
};
} // namespace detail
} // namespace asio
#include "asio/detail/pop_options.hpp"
#endif // ASIO_DETAIL_NON_CONST_LVALUE_HPP
```
|
The 2009 Oceania Nations Cup doubled as the first round of Oceania's qualifying tournament for the 2011 Rugby World Cup. By winning the Oceania Nations Cup, Papua New Guinea advanced to face Samoa in the Oceania qualification final.
Tahiti and New Caledonia were originally slated to participate, but withdrew.
Play-offs
Semi-finals
Final
References
2009
2009 rugby union tournaments for national teams
2009 in Oceanian rugby union
International rugby union competitions hosted by Papua New Guinea
|
is a monorail station operated by the Tokyo Tama Intercity Monorail Company in Higashiyamato, Tokyo, Japan.
Lines
Sakurakaidō Station is a station on the Tama Toshi Monorail Line and is located 0.7 kilometers from the terminus of the line at Kamikitadai Station.
Station layout
Sakurakaidō Station is a raised station with two tracks and two side platforms. It has a standardized station building of the monorail line.
Platforms
Surrounding area
The station is above Tokyo Metropolitan Route 43 (Imokubo-Kaidō). Other points of interest include:
Morinaga Milk Industry, Tokyo Tama Plant / Yamato Plant
Casio Hitachi Mobile Communications, Tokyo Plant
Sakura Kaidō
History
The station opened on 27 November 1998 with the opening of the line.
Station numbering was introduced in February 2018 with Sakurakaidō being assigned TT18.
References
External links
Tama Monorail Sakura-Kaidō Station
Railway stations in Japan opened in 1998
Railway stations in Tokyo
Tama Toshi Monorail
Higashiyamato, Tokyo
|
Unwanted Soldiers is a 1999 made-for-TV documentary film that was written, directed, and narrated by Jari Osborne for the National Film Board of Canada. It won the Canada Award at the 2000 Gemini Awards.
The film tells the story of Osborne's father and other Chinese-Canadian veterans who fought in World War II, documenting a history of discrimination against them and the Chinese-Canadian community in British Columbia. Osborne's father and his compatriots recall their training for clandestine missions behind enemy lines in Southeast Asia, as they fought for a country that had discriminated again them.
See also
Military history of Asian Americans
References
External links
Watch Unwanted Soldiers at NFB.ca
1999 television films
1999 films
1999 documentary films
Canadian documentary television films
Films about Chinese Canadians
National Film Board of Canada documentaries
Documentary films about racism in Canada
Documentary films about World War II
Documentary films about veterans
Canada Award-winning shows
Films shot in British Columbia
Anti-Chinese sentiment in Canada
1990s Canadian films
|
```scala
/*
*/
package akka.stream.alpakka.ftp
import akka.{Done, NotUsed}
import akka.stream.IOResult
import akka.stream.alpakka.testkit.scaladsl.LogCapturing
import akka.stream.scaladsl.{Sink, Source}
import akka.testkit.TestKit
import akka.util.ByteString
import org.scalatest.concurrent.{IntegrationPatience, ScalaFutures}
import org.scalatest.{Args, BeforeAndAfter, BeforeAndAfterAll, Inside, Status, TestSuite, TestSuiteMixin}
import scala.concurrent.Future
import org.scalatest.matchers.should.Matchers
import org.scalatest.wordspec.AnyWordSpecLike
trait BaseSpec
extends TestSuiteMixin
with AnyWordSpecLike
with Matchers
with BeforeAndAfter
with BeforeAndAfterAll
with ScalaFutures
with IntegrationPatience
with Inside
with AkkaSupport
with BaseSupport
with LogCapturing { this: TestSuite =>
protected def listFilesWithWrongCredentials(basePath: String): Source[FtpFile, NotUsed]
protected def listFiles(basePath: String): Source[FtpFile, NotUsed]
protected def listFilesWithFilter(
basePath: String,
branchSelector: FtpFile => Boolean,
emitTraversedDirectories: Boolean = false
): Source[FtpFile, NotUsed]
protected def retrieveFromPath(
path: String,
fromRoot: Boolean = false
): Source[ByteString, Future[IOResult]]
protected def retrieveFromPathWithOffset(
path: String,
offset: Long
): Source[ByteString, Future[IOResult]]
protected def storeToPath(path: String, append: Boolean): Sink[ByteString, Future[IOResult]]
protected def remove(): Sink[FtpFile, Future[IOResult]]
protected def move(destinationPath: FtpFile => String): Sink[FtpFile, Future[IOResult]]
protected def mkdir(basePath: String, name: String): Source[Done, NotUsed]
after {
cleanFiles()
}
override protected def afterAll() = {
TestKit.shutdownActorSystem(getSystem, verifySystemShutdown = true)
super.afterAll()
}
// Allows to run tests n times in a row with a command line argument, useful for debugging sporadic failures
// e.g. ftp/testOnly *.FtpsStageSpec -- -Dtimes=20
// path_to_url
override protected def runTest(testName: String, args: Args): Status = {
def run0(times: Int): Status = {
val status = super.runTest(testName, args)
if (times <= 1) status else status.thenRun(run0(times - 1))
}
run0(args.configMap.getWithDefault("times", "1").toInt)
}
}
```
|
Ulong is a small village located on the Mid North Coast region, neighbouring the Northern Tablelands, of New South Wales, Australia. It has a community hall, public school, cafe-post office and an Ex-services Club.
Facilities
The village is serviced by the Ulong Ex-services Club, cafe with rural transaction centre, and the Eastern Dorrigo Community Hall. The hall has camping facilities available with kitchen, BBQ and shower facilities available
Timms Park is situated on Ulong Creek with a picnic area including tables, bins and a toilet. The land surrounding the park was donated to the community by LEH Timms.
Geography
The village lies inland from Coffs Harbour by . Whilst a short distance, it takes 45 minutes to drive to, through the mountainous rainforest. Ulong is on the Eastern Dorrigo Plateau and sits some . Like the neighbouring village of Lowanna, the climate is markedly different from Coffs Harbour. Ulong is known as the "Village in the Valley".
History
Once larger than Coffs Harbour, it was a centre for the timber industry. Dorrigo pine (Araucaria cunninghamii), tallowwood (Eucalyptus microcorys), blackbutt (Eucalyptus pilularis) and coachwood (Ceratopetalum apetalum) were milled extensively via the Dorrigo railway line. There was gold in the hills too. Georges Gold Mine was open on occasion as a tourist attraction before its closure in 2007
Ulong is on the road to Nymboida River and borders two of its tributaries, the Little Nymbodia and Bobo Rivers.
The Australian National series Enduro motorcycle Championships took place over two days in and around Ulong in 2007. On 9 September 2011 a special stage of the World Rally Championship was held in the area. These events make use of the roads within the extensive array of State and National parks in the area.
Population
At the , Ulong had a population of 131 people. By 2016, the population increased to 233.
Home of iconic actor Jack Thompson.
Climate
The region surrounding Ulong, especially the higher area, has a Subtropical highland climate (Cfb) with warm, humid and wet summers and cool winters with frosty nights.
Notes and references
Mid North Coast
Towns in New South Wales
|
Elections to South Cambridgeshire District Council took place on Thursday 4 May 2006, as part of the 2006 United Kingdom local elections. Twenty seats, making up just over one third of South Cambridgeshire District Council, were up for election, with a by-election being held in one ward (Harston and Hauxton). Seats up for election in 2006 were last contested at the 2004 election, when all seats were up for election due to new ward boundaries, and were next contested at the 2010 election. The Conservative Party remained the largest party with an increased number of seats, but the council remained under no overall control.
Summary
At this election, the Conservative Party and the Liberal Democrats were defending eight seats each. Independent councillors were defending in three wards, while Labour were defending in Sawston. The Liberal Democrats lost three seats to the Conservatives in Balsham, Melbourn and Waterbeach, but gained the Shelfords and Stapleford from the Conservatives. In Milton, the incumbent independent councillor ran for re-election as a Liberal Democrat. Other Conservative gains included from Labour in Sawston as well as from an independent in Cottenham. In Histon and Impington however an independent, who had run as a Conservative in 2004, defeated the incumbent Conservative councillor.
Results
Results by ward
References
2006
2006 English local elections
2000s in Cambridgeshire
|
```c
/*
*
* 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 (including the next
* paragraph) 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.
*
* Authors:
* Eric Anholt <eric@anholt.net>
* Keith Packard <keithp@keithp.com>
* Mika Kuoppala <mika.kuoppala@intel.com>
*
*/
#include <linux/ascii85.h>
#include <linux/highmem.h>
#include <linux/nmi.h>
#include <linux/pagevec.h>
#include <linux/scatterlist.h>
#include <linux/string_helpers.h>
#include <linux/utsname.h>
#include <linux/zlib.h>
#include <drm/drm_cache.h>
#include <drm/drm_print.h>
#include "display/intel_dmc.h"
#include "display/intel_overlay.h"
#include "gem/i915_gem_context.h"
#include "gem/i915_gem_lmem.h"
#include "gt/intel_engine_regs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_mcr.h"
#include "gt/intel_gt_pm.h"
#include "gt/intel_gt_regs.h"
#include "gt/uc/intel_guc_capture.h"
#include "i915_driver.h"
#include "i915_drv.h"
#include "i915_gpu_error.h"
#include "i915_memcpy.h"
#include "i915_reg.h"
#include "i915_scatterlist.h"
#include "i915_utils.h"
#define ALLOW_FAIL (__GFP_KSWAPD_RECLAIM | __GFP_RETRY_MAYFAIL | __GFP_NOWARN)
#define ATOMIC_MAYFAIL (GFP_ATOMIC | __GFP_NOWARN)
static void __sg_set_buf(struct scatterlist *sg,
void *addr, unsigned int len, loff_t it)
{
STUB();
#ifdef notyet
sg->page_link = (unsigned long)virt_to_page(addr);
sg->offset = offset_in_page(addr);
sg->length = len;
sg->dma_address = it;
#endif
}
static bool __i915_error_grow(struct drm_i915_error_state_buf *e, size_t len)
{
STUB();
return false;
#ifdef notyet
if (!len)
return false;
if (e->bytes + len + 1 <= e->size)
return true;
if (e->bytes) {
__sg_set_buf(e->cur++, e->buf, e->bytes, e->iter);
e->iter += e->bytes;
e->buf = NULL;
e->bytes = 0;
}
if (e->cur == e->end) {
struct scatterlist *sgl;
sgl = (typeof(sgl))__get_free_page(ALLOW_FAIL);
if (!sgl) {
e->err = -ENOMEM;
return false;
}
if (e->cur) {
e->cur->offset = 0;
e->cur->length = 0;
e->cur->page_link =
(unsigned long)sgl | SG_CHAIN;
} else {
e->sgl = sgl;
}
e->cur = sgl;
e->end = sgl + SG_MAX_SINGLE_ALLOC - 1;
}
e->size = ALIGN(len + 1, SZ_64K);
e->buf = kmalloc(e->size, ALLOW_FAIL);
if (!e->buf) {
e->size = PAGE_ALIGN(len + 1);
e->buf = kmalloc(e->size, GFP_KERNEL);
}
if (!e->buf) {
e->err = -ENOMEM;
return false;
}
return true;
#endif
}
__printf(2, 0)
static void i915_error_vprintf(struct drm_i915_error_state_buf *e,
const char *fmt, va_list args)
{
va_list ap;
int len;
if (e->err)
return;
va_copy(ap, args);
len = vsnprintf(NULL, 0, fmt, ap);
va_end(ap);
if (len <= 0) {
e->err = len;
return;
}
if (!__i915_error_grow(e, len))
return;
GEM_BUG_ON(e->bytes >= e->size);
len = vscnprintf(e->buf + e->bytes, e->size - e->bytes, fmt, args);
if (len < 0) {
e->err = len;
return;
}
e->bytes += len;
}
static void i915_error_puts(struct drm_i915_error_state_buf *e, const char *str)
{
unsigned len;
if (e->err || !str)
return;
len = strlen(str);
if (!__i915_error_grow(e, len))
return;
GEM_BUG_ON(e->bytes + len > e->size);
memcpy(e->buf + e->bytes, str, len);
e->bytes += len;
}
#define err_printf(e, ...) i915_error_printf(e, __VA_ARGS__)
#define err_puts(e, s) i915_error_puts(e, s)
static void __i915_printfn_error(struct drm_printer *p, struct va_format *vaf)
{
i915_error_vprintf(p->arg, vaf->fmt, *vaf->va);
}
static inline struct drm_printer
i915_error_printer(struct drm_i915_error_state_buf *e)
{
struct drm_printer p = {
.printfn = __i915_printfn_error,
.arg = e,
};
return p;
}
/* single threaded page allocator with a reserved stash for emergencies */
static void pool_fini(struct folio_batch *fbatch)
{
STUB();
#ifdef notyet
folio_batch_release(fbatch);
#endif
}
static int pool_refill(struct folio_batch *fbatch, gfp_t gfp)
{
STUB();
return -ENOSYS;
#ifdef notyet
while (folio_batch_space(fbatch)) {
struct folio *folio;
folio = folio_alloc(gfp, 0);
if (!folio)
return -ENOMEM;
folio_batch_add(fbatch, folio);
}
return 0;
#endif
}
static int intel_pool_init(struct folio_batch *fbatch, gfp_t gfp)
{
int err;
STUB();
return -ENOSYS;
#ifdef notyet
folio_batch_init(fbatch);
err = pool_refill(fbatch, gfp);
if (err)
pool_fini(fbatch);
return err;
#endif
}
static void *pool_alloc(struct folio_batch *fbatch, gfp_t gfp)
{
STUB();
return NULL;
#ifdef notyet
struct folio *folio;
folio = folio_alloc(gfp, 0);
if (!folio && folio_batch_count(fbatch))
folio = fbatch->folios[--fbatch->nr];
return folio ? folio_address(folio) : NULL;
#endif
}
static void pool_free(struct folio_batch *fbatch, void *addr)
{
STUB();
#ifdef notyet
struct folio *folio = virt_to_folio(addr);
if (folio_batch_space(fbatch))
folio_batch_add(fbatch, folio);
else
folio_put(folio);
#endif
}
#ifdef CONFIG_DRM_I915_COMPRESS_ERROR
struct i915_vma_compress {
struct folio_batch pool;
struct z_stream_s zstream;
void *tmp;
};
static bool compress_init(struct i915_vma_compress *c)
{
struct z_stream_s *zstream = &c->zstream;
if (intel_pool_init(&c->pool, ALLOW_FAIL))
return false;
zstream->workspace =
kmalloc(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL),
ALLOW_FAIL);
if (!zstream->workspace) {
pool_fini(&c->pool);
return false;
}
c->tmp = NULL;
if (i915_has_memcpy_from_wc())
c->tmp = pool_alloc(&c->pool, ALLOW_FAIL);
return true;
}
static bool compress_start(struct i915_vma_compress *c)
{
struct z_stream_s *zstream = &c->zstream;
void *workspace = zstream->workspace;
memset(zstream, 0, sizeof(*zstream));
zstream->workspace = workspace;
return zlib_deflateInit(zstream, Z_DEFAULT_COMPRESSION) == Z_OK;
}
static void *compress_next_page(struct i915_vma_compress *c,
struct i915_vma_coredump *dst)
{
void *page_addr;
struct vm_page *page;
page_addr = pool_alloc(&c->pool, ALLOW_FAIL);
if (!page_addr)
return ERR_PTR(-ENOMEM);
page = virt_to_page(page_addr);
list_add_tail(&page->lru, &dst->page_list);
return page_addr;
}
static int compress_page(struct i915_vma_compress *c,
void *src,
struct i915_vma_coredump *dst,
bool wc)
{
struct z_stream_s *zstream = &c->zstream;
zstream->next_in = src;
if (wc && c->tmp && i915_memcpy_from_wc(c->tmp, src, PAGE_SIZE))
zstream->next_in = c->tmp;
zstream->avail_in = PAGE_SIZE;
do {
if (zstream->avail_out == 0) {
zstream->next_out = compress_next_page(c, dst);
if (IS_ERR(zstream->next_out))
return PTR_ERR(zstream->next_out);
zstream->avail_out = PAGE_SIZE;
}
if (zlib_deflate(zstream, Z_NO_FLUSH) != Z_OK)
return -EIO;
cond_resched();
} while (zstream->avail_in);
/* Fallback to uncompressed if we increase size? */
if (0 && zstream->total_out > zstream->total_in)
return -E2BIG;
return 0;
}
static int compress_flush(struct i915_vma_compress *c,
struct i915_vma_coredump *dst)
{
struct z_stream_s *zstream = &c->zstream;
do {
switch (zlib_deflate(zstream, Z_FINISH)) {
case Z_OK: /* more space requested */
zstream->next_out = compress_next_page(c, dst);
if (IS_ERR(zstream->next_out))
return PTR_ERR(zstream->next_out);
zstream->avail_out = PAGE_SIZE;
break;
case Z_STREAM_END:
goto end;
default: /* any error */
return -EIO;
}
} while (1);
end:
memset(zstream->next_out, 0, zstream->avail_out);
dst->unused = zstream->avail_out;
return 0;
}
static void compress_finish(struct i915_vma_compress *c)
{
zlib_deflateEnd(&c->zstream);
}
static void compress_fini(struct i915_vma_compress *c)
{
kfree(c->zstream.workspace);
if (c->tmp)
pool_free(&c->pool, c->tmp);
pool_fini(&c->pool);
}
static void err_compression_marker(struct drm_i915_error_state_buf *m)
{
err_puts(m, ":");
}
#else
struct i915_vma_compress {
struct folio_batch pool;
};
static bool compress_init(struct i915_vma_compress *c)
{
return intel_pool_init(&c->pool, ALLOW_FAIL) == 0;
}
static bool compress_start(struct i915_vma_compress *c)
{
return true;
}
static int compress_page(struct i915_vma_compress *c,
void *src,
struct i915_vma_coredump *dst,
bool wc)
{
STUB();
return -ENOSYS;
#ifdef notyet
void *ptr;
ptr = pool_alloc(&c->pool, ALLOW_FAIL);
if (!ptr)
return -ENOMEM;
if (!(wc && i915_memcpy_from_wc(ptr, src, PAGE_SIZE)))
memcpy(ptr, src, PAGE_SIZE);
list_add_tail(&virt_to_page(ptr)->lru, &dst->page_list);
cond_resched();
return 0;
#endif
}
static int compress_flush(struct i915_vma_compress *c,
struct i915_vma_coredump *dst)
{
return 0;
}
static void compress_finish(struct i915_vma_compress *c)
{
}
static void compress_fini(struct i915_vma_compress *c)
{
pool_fini(&c->pool);
}
static void err_compression_marker(struct drm_i915_error_state_buf *m)
{
err_puts(m, "~");
}
#endif
static void error_print_instdone(struct drm_i915_error_state_buf *m,
const struct intel_engine_coredump *ee)
{
int slice;
int subslice;
int iter;
err_printf(m, " INSTDONE: 0x%08x\n",
ee->instdone.instdone);
if (ee->engine->class != RENDER_CLASS || GRAPHICS_VER(m->i915) <= 3)
return;
err_printf(m, " SC_INSTDONE: 0x%08x\n",
ee->instdone.slice_common);
if (GRAPHICS_VER(m->i915) <= 6)
return;
for_each_ss_steering(iter, ee->engine->gt, slice, subslice)
err_printf(m, " SAMPLER_INSTDONE[%d][%d]: 0x%08x\n",
slice, subslice,
ee->instdone.sampler[slice][subslice]);
for_each_ss_steering(iter, ee->engine->gt, slice, subslice)
err_printf(m, " ROW_INSTDONE[%d][%d]: 0x%08x\n",
slice, subslice,
ee->instdone.row[slice][subslice]);
if (GRAPHICS_VER(m->i915) < 12)
return;
if (GRAPHICS_VER_FULL(m->i915) >= IP_VER(12, 55)) {
for_each_ss_steering(iter, ee->engine->gt, slice, subslice)
err_printf(m, " GEOM_SVGUNIT_INSTDONE[%d][%d]: 0x%08x\n",
slice, subslice,
ee->instdone.geom_svg[slice][subslice]);
}
err_printf(m, " SC_INSTDONE_EXTRA: 0x%08x\n",
ee->instdone.slice_common_extra[0]);
err_printf(m, " SC_INSTDONE_EXTRA2: 0x%08x\n",
ee->instdone.slice_common_extra[1]);
}
static void error_print_request(struct drm_i915_error_state_buf *m,
const char *prefix,
const struct i915_request_coredump *erq)
{
if (!erq->seqno)
return;
err_printf(m, "%s pid %d, seqno %8x:%08x%s%s, prio %d, head %08x, tail %08x\n",
prefix, erq->pid, erq->context, erq->seqno,
test_bit(DMA_FENCE_FLAG_SIGNALED_BIT,
&erq->flags) ? "!" : "",
test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT,
&erq->flags) ? "+" : "",
erq->sched_attr.priority,
erq->head, erq->tail);
}
static void error_print_context(struct drm_i915_error_state_buf *m,
const char *header,
const struct i915_gem_context_coredump *ctx)
{
err_printf(m, "%s%s[%d] prio %d, guilty %d active %d, runtime total %lluns, avg %lluns\n",
header, ctx->comm, ctx->pid, ctx->sched_attr.priority,
ctx->guilty, ctx->active,
ctx->total_runtime, ctx->avg_runtime);
err_printf(m, " context timeline seqno %u\n", ctx->hwsp_seqno);
}
static struct i915_vma_coredump *
__find_vma(struct i915_vma_coredump *vma, const char *name)
{
while (vma) {
if (strcmp(vma->name, name) == 0)
return vma;
vma = vma->next;
}
return NULL;
}
struct i915_vma_coredump *
intel_gpu_error_find_batch(const struct intel_engine_coredump *ee)
{
return __find_vma(ee->vma, "batch");
}
static void error_print_engine(struct drm_i915_error_state_buf *m,
const struct intel_engine_coredump *ee)
{
struct i915_vma_coredump *batch;
int n;
err_printf(m, "%s command stream:\n", ee->engine->name);
err_printf(m, " CCID: 0x%08x\n", ee->ccid);
err_printf(m, " START: 0x%08x\n", ee->start);
err_printf(m, " HEAD: 0x%08x [0x%08x]\n", ee->head, ee->rq_head);
err_printf(m, " TAIL: 0x%08x [0x%08x, 0x%08x]\n",
ee->tail, ee->rq_post, ee->rq_tail);
err_printf(m, " CTL: 0x%08x\n", ee->ctl);
err_printf(m, " MODE: 0x%08x\n", ee->mode);
err_printf(m, " HWS: 0x%08x\n", ee->hws);
err_printf(m, " ACTHD: 0x%08x %08x\n",
(u32)(ee->acthd>>32), (u32)ee->acthd);
err_printf(m, " IPEIR: 0x%08x\n", ee->ipeir);
err_printf(m, " IPEHR: 0x%08x\n", ee->ipehr);
err_printf(m, " ESR: 0x%08x\n", ee->esr);
error_print_instdone(m, ee);
batch = intel_gpu_error_find_batch(ee);
if (batch) {
u64 start = batch->gtt_offset;
u64 end = start + batch->gtt_size;
err_printf(m, " batch: [0x%08x_%08x, 0x%08x_%08x]\n",
upper_32_bits(start), lower_32_bits(start),
upper_32_bits(end), lower_32_bits(end));
}
if (GRAPHICS_VER(m->i915) >= 4) {
err_printf(m, " BBADDR: 0x%08x_%08x\n",
(u32)(ee->bbaddr>>32), (u32)ee->bbaddr);
err_printf(m, " BB_STATE: 0x%08x\n", ee->bbstate);
err_printf(m, " INSTPS: 0x%08x\n", ee->instps);
}
err_printf(m, " INSTPM: 0x%08x\n", ee->instpm);
err_printf(m, " FADDR: 0x%08x %08x\n", upper_32_bits(ee->faddr),
lower_32_bits(ee->faddr));
if (GRAPHICS_VER(m->i915) >= 6) {
err_printf(m, " RC PSMI: 0x%08x\n", ee->rc_psmi);
err_printf(m, " FAULT_REG: 0x%08x\n", ee->fault_reg);
}
if (GRAPHICS_VER(m->i915) >= 11) {
err_printf(m, " NOPID: 0x%08x\n", ee->nopid);
err_printf(m, " EXCC: 0x%08x\n", ee->excc);
err_printf(m, " CMD_CCTL: 0x%08x\n", ee->cmd_cctl);
err_printf(m, " CSCMDOP: 0x%08x\n", ee->cscmdop);
err_printf(m, " CTX_SR_CTL: 0x%08x\n", ee->ctx_sr_ctl);
err_printf(m, " DMA_FADDR_HI: 0x%08x\n", ee->dma_faddr_hi);
err_printf(m, " DMA_FADDR_LO: 0x%08x\n", ee->dma_faddr_lo);
}
if (HAS_PPGTT(m->i915)) {
err_printf(m, " GFX_MODE: 0x%08x\n", ee->vm_info.gfx_mode);
if (GRAPHICS_VER(m->i915) >= 8) {
int i;
for (i = 0; i < 4; i++)
err_printf(m, " PDP%d: 0x%016llx\n",
i, ee->vm_info.pdp[i]);
} else {
err_printf(m, " PP_DIR_BASE: 0x%08x\n",
ee->vm_info.pp_dir_base);
}
}
for (n = 0; n < ee->num_ports; n++) {
err_printf(m, " ELSP[%d]:", n);
error_print_request(m, " ", &ee->execlist[n]);
}
}
void i915_error_printf(struct drm_i915_error_state_buf *e, const char *f, ...)
{
va_list args;
va_start(args, f);
i915_error_vprintf(e, f, args);
va_end(args);
}
void intel_gpu_error_print_vma(struct drm_i915_error_state_buf *m,
const struct intel_engine_cs *engine,
const struct i915_vma_coredump *vma)
{
STUB();
#ifdef notyet
char out[ASCII85_BUFSZ];
struct vm_page *page;
if (!vma)
return;
err_printf(m, "%s --- %s = 0x%08x %08x\n",
engine ? engine->name : "global", vma->name,
upper_32_bits(vma->gtt_offset),
lower_32_bits(vma->gtt_offset));
if (vma->gtt_page_sizes > I915_GTT_PAGE_SIZE_4K)
err_printf(m, "gtt_page_sizes = 0x%08x\n", vma->gtt_page_sizes);
err_compression_marker(m);
list_for_each_entry(page, &vma->page_list, lru) {
int i, len;
const u32 *addr = page_address(page);
len = PAGE_SIZE;
if (page == list_last_entry(&vma->page_list, typeof(*page), lru))
len -= vma->unused;
len = ascii85_encode_len(len);
for (i = 0; i < len; i++)
err_puts(m, ascii85_encode(addr[i], out));
}
err_puts(m, "\n");
#endif
}
static void err_print_capabilities(struct drm_i915_error_state_buf *m,
struct i915_gpu_coredump *error)
{
struct drm_printer p = i915_error_printer(m);
intel_device_info_print(&error->device_info, &error->runtime_info, &p);
intel_display_device_info_print(&error->display_device_info,
&error->display_runtime_info, &p);
intel_driver_caps_print(&error->driver_caps, &p);
}
static void err_print_params(struct drm_i915_error_state_buf *m,
const struct i915_params *params)
{
struct drm_printer p = i915_error_printer(m);
i915_params_dump(params, &p);
}
static void err_print_pciid(struct drm_i915_error_state_buf *m,
struct drm_i915_private *i915)
{
struct pci_dev *pdev = i915->drm.pdev;
err_printf(m, "PCI ID: 0x%04x\n", pdev->device);
err_printf(m, "PCI Revision: 0x%02x\n", pdev->revision);
err_printf(m, "PCI Subsystem: %04x:%04x\n",
pdev->subsystem_vendor,
pdev->subsystem_device);
}
static void err_print_guc_ctb(struct drm_i915_error_state_buf *m,
const char *name,
const struct intel_ctb_coredump *ctb)
{
if (!ctb->size)
return;
err_printf(m, "GuC %s CTB: raw: 0x%08X, 0x%08X/%08X, cached: 0x%08X/%08X, desc = 0x%08X, buf = 0x%08X x 0x%08X\n",
name, ctb->raw_status, ctb->raw_head, ctb->raw_tail,
ctb->head, ctb->tail, ctb->desc_offset, ctb->cmds_offset, ctb->size);
}
static void err_print_uc(struct drm_i915_error_state_buf *m,
const struct intel_uc_coredump *error_uc)
{
struct drm_printer p = i915_error_printer(m);
intel_uc_fw_dump(&error_uc->guc_fw, &p);
intel_uc_fw_dump(&error_uc->huc_fw, &p);
err_printf(m, "GuC timestamp: 0x%08x\n", error_uc->guc.timestamp);
intel_gpu_error_print_vma(m, NULL, error_uc->guc.vma_log);
err_printf(m, "GuC CTB fence: %d\n", error_uc->guc.last_fence);
err_print_guc_ctb(m, "Send", error_uc->guc.ctb + 0);
err_print_guc_ctb(m, "Recv", error_uc->guc.ctb + 1);
intel_gpu_error_print_vma(m, NULL, error_uc->guc.vma_ctb);
}
static void err_free_sgl(struct scatterlist *sgl)
{
STUB();
#ifdef notyet
while (sgl) {
struct scatterlist *sg;
for (sg = sgl; !sg_is_chain(sg); sg++) {
kfree(sg_virt(sg));
if (sg_is_last(sg))
break;
}
sg = sg_is_last(sg) ? NULL : sg_chain_ptr(sg);
free_page((unsigned long)sgl);
sgl = sg;
}
#endif
}
static void err_print_gt_info(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
struct drm_printer p = i915_error_printer(m);
intel_gt_info_print(>->info, &p);
intel_sseu_print_topology(gt->_gt->i915, >->info.sseu, &p);
}
static void err_print_gt_display(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
err_printf(m, "IER: 0x%08x\n", gt->ier);
err_printf(m, "DERRMR: 0x%08x\n", gt->derrmr);
}
static void err_print_gt_global_nonguc(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
int i;
err_printf(m, "GT awake: %s\n", str_yes_no(gt->awake));
err_printf(m, "CS timestamp frequency: %u Hz, %d ns\n",
gt->clock_frequency, gt->clock_period_ns);
err_printf(m, "EIR: 0x%08x\n", gt->eir);
err_printf(m, "PGTBL_ER: 0x%08x\n", gt->pgtbl_er);
for (i = 0; i < gt->ngtier; i++)
err_printf(m, "GTIER[%d]: 0x%08x\n", i, gt->gtier[i]);
}
static void err_print_gt_global(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
err_printf(m, "FORCEWAKE: 0x%08x\n", gt->forcewake);
if (IS_GRAPHICS_VER(m->i915, 6, 11)) {
err_printf(m, "ERROR: 0x%08x\n", gt->error);
err_printf(m, "DONE_REG: 0x%08x\n", gt->done_reg);
}
if (GRAPHICS_VER(m->i915) >= 8)
err_printf(m, "FAULT_TLB_DATA: 0x%08x 0x%08x\n",
gt->fault_data1, gt->fault_data0);
if (GRAPHICS_VER(m->i915) == 7)
err_printf(m, "ERR_INT: 0x%08x\n", gt->err_int);
if (IS_GRAPHICS_VER(m->i915, 8, 11))
err_printf(m, "GTT_CACHE_EN: 0x%08x\n", gt->gtt_cache);
if (GRAPHICS_VER(m->i915) == 12)
err_printf(m, "AUX_ERR_DBG: 0x%08x\n", gt->aux_err);
if (GRAPHICS_VER(m->i915) >= 12) {
int i;
for (i = 0; i < I915_MAX_SFC; i++) {
/*
* SFC_DONE resides in the VD forcewake domain, so it
* only exists if the corresponding VCS engine is
* present.
*/
if ((gt->_gt->info.sfc_mask & BIT(i)) == 0 ||
!HAS_ENGINE(gt->_gt, _VCS(i * 2)))
continue;
err_printf(m, " SFC_DONE[%d]: 0x%08x\n", i,
gt->sfc_done[i]);
}
err_printf(m, " GAM_DONE: 0x%08x\n", gt->gam_done);
}
}
static void err_print_gt_fences(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
int i;
for (i = 0; i < gt->nfence; i++)
err_printf(m, " fence[%d] = %08llx\n", i, gt->fence[i]);
}
static void err_print_gt_engines(struct drm_i915_error_state_buf *m,
struct intel_gt_coredump *gt)
{
const struct intel_engine_coredump *ee;
for (ee = gt->engine; ee; ee = ee->next) {
const struct i915_vma_coredump *vma;
if (gt->uc && gt->uc->guc.is_guc_capture) {
if (ee->guc_capture_node)
intel_guc_capture_print_engine_node(m, ee);
else
err_printf(m, " Missing GuC capture node for %s\n",
ee->engine->name);
} else {
error_print_engine(m, ee);
}
err_printf(m, " hung: %u\n", ee->hung);
err_printf(m, " engine reset count: %u\n", ee->reset_count);
error_print_context(m, " Active context: ", &ee->context);
for (vma = ee->vma; vma; vma = vma->next)
intel_gpu_error_print_vma(m, ee->engine, vma);
}
}
static void __err_print_to_sgl(struct drm_i915_error_state_buf *m,
struct i915_gpu_coredump *error)
{
const struct intel_engine_coredump *ee;
struct timespec64 ts;
if (*error->error_msg)
err_printf(m, "%s\n", error->error_msg);
#ifdef __linux__
err_printf(m, "Kernel: %s %s\n",
init_utsname()->release,
init_utsname()->machine);
#else
extern char machine[];
err_printf(m, "Kernel: %s %s\n",
osrelease,
machine);
#endif
err_printf(m, "Driver: %s\n", DRIVER_DATE);
ts = ktime_to_timespec64(error->time);
err_printf(m, "Time: %lld s %ld us\n",
(s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
ts = ktime_to_timespec64(error->boottime);
err_printf(m, "Boottime: %lld s %ld us\n",
(s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
ts = ktime_to_timespec64(error->uptime);
err_printf(m, "Uptime: %lld s %ld us\n",
(s64)ts.tv_sec, ts.tv_nsec / NSEC_PER_USEC);
err_printf(m, "Capture: %lu jiffies; %d ms ago\n",
error->capture, jiffies_to_msecs(jiffies - error->capture));
for (ee = error->gt ? error->gt->engine : NULL; ee; ee = ee->next)
err_printf(m, "Active process (on ring %s): %s [%d]\n",
ee->engine->name,
ee->context.comm,
ee->context.pid);
err_printf(m, "Reset count: %u\n", error->reset_count);
err_printf(m, "Suspend count: %u\n", error->suspend_count);
err_printf(m, "Platform: %s\n", intel_platform_name(error->device_info.platform));
err_printf(m, "Subplatform: 0x%x\n",
intel_subplatform(&error->runtime_info,
error->device_info.platform));
err_print_pciid(m, m->i915);
err_printf(m, "IOMMU enabled?: %d\n", error->iommu);
intel_dmc_print_error_state(m, m->i915);
err_printf(m, "RPM wakelock: %s\n", str_yes_no(error->wakelock));
err_printf(m, "PM suspended: %s\n", str_yes_no(error->suspended));
if (error->gt) {
bool print_guc_capture = false;
if (error->gt->uc && error->gt->uc->guc.is_guc_capture)
print_guc_capture = true;
err_print_gt_display(m, error->gt);
err_print_gt_global_nonguc(m, error->gt);
err_print_gt_fences(m, error->gt);
/*
* GuC dumped global, eng-class and eng-instance registers together
* as part of engine state dump so we print in err_print_gt_engines
*/
if (!print_guc_capture)
err_print_gt_global(m, error->gt);
err_print_gt_engines(m, error->gt);
if (error->gt->uc)
err_print_uc(m, error->gt->uc);
err_print_gt_info(m, error->gt);
}
if (error->overlay)
intel_overlay_print_error_state(m, error->overlay);
err_print_capabilities(m, error);
err_print_params(m, &error->params);
}
static int err_print_to_sgl(struct i915_gpu_coredump *error)
{
struct drm_i915_error_state_buf m;
if (IS_ERR(error))
return PTR_ERR(error);
if (READ_ONCE(error->sgl))
return 0;
memset(&m, 0, sizeof(m));
m.i915 = error->i915;
__err_print_to_sgl(&m, error);
if (m.buf) {
__sg_set_buf(m.cur++, m.buf, m.bytes, m.iter);
m.bytes = 0;
m.buf = NULL;
}
if (m.cur) {
GEM_BUG_ON(m.end < m.cur);
sg_mark_end(m.cur - 1);
}
GEM_BUG_ON(m.sgl && !m.cur);
if (m.err) {
err_free_sgl(m.sgl);
return m.err;
}
if (cmpxchg(&error->sgl, NULL, m.sgl))
err_free_sgl(m.sgl);
return 0;
}
ssize_t i915_gpu_coredump_copy_to_buffer(struct i915_gpu_coredump *error,
char *buf, loff_t off, size_t rem)
{
STUB();
return -ENOSYS;
#ifdef notyet
struct scatterlist *sg;
size_t count;
loff_t pos;
int err;
if (!error || !rem)
return 0;
err = err_print_to_sgl(error);
if (err)
return err;
sg = READ_ONCE(error->fit);
if (!sg || off < sg->dma_address)
sg = error->sgl;
if (!sg)
return 0;
pos = sg->dma_address;
count = 0;
do {
size_t len, start;
if (sg_is_chain(sg)) {
sg = sg_chain_ptr(sg);
GEM_BUG_ON(sg_is_chain(sg));
}
len = sg->length;
if (pos + len <= off) {
pos += len;
continue;
}
start = sg->offset;
if (pos < off) {
GEM_BUG_ON(off - pos > len);
len -= off - pos;
start += off - pos;
pos = off;
}
len = min(len, rem);
GEM_BUG_ON(!len || len > sg->length);
memcpy(buf, page_address(sg_page(sg)) + start, len);
count += len;
pos += len;
buf += len;
rem -= len;
if (!rem) {
WRITE_ONCE(error->fit, sg);
break;
}
} while (!sg_is_last(sg++));
return count;
#endif
}
static void i915_vma_coredump_free(struct i915_vma_coredump *vma)
{
STUB();
#ifdef notyet
while (vma) {
struct i915_vma_coredump *next = vma->next;
struct vm_page *page, *n;
list_for_each_entry_safe(page, n, &vma->page_list, lru) {
list_del_init(&page->lru);
__free_page(page);
}
kfree(vma);
vma = next;
}
#endif
}
static void cleanup_params(struct i915_gpu_coredump *error)
{
i915_params_free(&error->params);
}
static void cleanup_uc(struct intel_uc_coredump *uc)
{
kfree(uc->guc_fw.file_selected.path);
kfree(uc->huc_fw.file_selected.path);
kfree(uc->guc_fw.file_wanted.path);
kfree(uc->huc_fw.file_wanted.path);
i915_vma_coredump_free(uc->guc.vma_log);
i915_vma_coredump_free(uc->guc.vma_ctb);
kfree(uc);
}
static void cleanup_gt(struct intel_gt_coredump *gt)
{
while (gt->engine) {
struct intel_engine_coredump *ee = gt->engine;
gt->engine = ee->next;
i915_vma_coredump_free(ee->vma);
intel_guc_capture_free_node(ee);
kfree(ee);
}
if (gt->uc)
cleanup_uc(gt->uc);
kfree(gt);
}
void __i915_gpu_coredump_free(struct kref *error_ref)
{
struct i915_gpu_coredump *error =
container_of(error_ref, typeof(*error), ref);
while (error->gt) {
struct intel_gt_coredump *gt = error->gt;
error->gt = gt->next;
cleanup_gt(gt);
}
kfree(error->overlay);
cleanup_params(error);
err_free_sgl(error->sgl);
kfree(error);
}
static struct i915_vma_coredump *
i915_vma_coredump_create(const struct intel_gt *gt,
const struct i915_vma_resource *vma_res,
struct i915_vma_compress *compress,
const char *name)
{
STUB();
return NULL;
#ifdef notyet
struct i915_ggtt *ggtt = gt->ggtt;
const u64 slot = ggtt->error_capture.start;
struct i915_vma_coredump *dst;
struct sgt_iter iter;
int ret;
might_sleep();
if (!vma_res || !vma_res->bi.pages || !compress)
return NULL;
dst = kmalloc(sizeof(*dst), ALLOW_FAIL);
if (!dst)
return NULL;
if (!compress_start(compress)) {
kfree(dst);
return NULL;
}
INIT_LIST_HEAD(&dst->page_list);
strlcpy(dst->name, name, sizeof(dst->name));
dst->next = NULL;
dst->gtt_offset = vma_res->start;
dst->gtt_size = vma_res->node_size;
dst->gtt_page_sizes = vma_res->page_sizes_gtt;
dst->unused = 0;
ret = -EINVAL;
if (drm_mm_node_allocated(&ggtt->error_capture)) {
void __iomem *s;
dma_addr_t dma;
for_each_sgt_daddr(dma, iter, vma_res->bi.pages) {
mutex_lock(&ggtt->error_mutex);
if (ggtt->vm.raw_insert_page)
ggtt->vm.raw_insert_page(&ggtt->vm, dma, slot,
i915_gem_get_pat_index(gt->i915,
I915_CACHE_NONE),
0);
else
ggtt->vm.insert_page(&ggtt->vm, dma, slot,
i915_gem_get_pat_index(gt->i915,
I915_CACHE_NONE),
0);
mb();
s = io_mapping_map_wc(&ggtt->iomap, slot, PAGE_SIZE);
ret = compress_page(compress,
(void __force *)s, dst,
true);
io_mapping_unmap(s);
mb();
ggtt->vm.clear_range(&ggtt->vm, slot, PAGE_SIZE);
mutex_unlock(&ggtt->error_mutex);
if (ret)
break;
}
} else if (vma_res->bi.lmem) {
struct intel_memory_region *mem = vma_res->mr;
dma_addr_t dma;
for_each_sgt_daddr(dma, iter, vma_res->bi.pages) {
dma_addr_t offset = dma - mem->region.start;
void __iomem *s;
if (offset + PAGE_SIZE > resource_size(&mem->io)) {
ret = -EINVAL;
break;
}
s = io_mapping_map_wc(&mem->iomap, offset, PAGE_SIZE);
ret = compress_page(compress,
(void __force *)s, dst,
true);
io_mapping_unmap(s);
if (ret)
break;
}
} else {
struct vm_page *page;
for_each_sgt_page(page, iter, vma_res->bi.pages) {
void *s;
drm_clflush_pages(&page, 1);
s = kmap_local_page(page);
ret = compress_page(compress, s, dst, false);
kunmap_local(s);
drm_clflush_pages(&page, 1);
if (ret)
break;
}
}
if (ret || compress_flush(compress, dst)) {
struct vm_page *page, *n;
list_for_each_entry_safe_reverse(page, n, &dst->page_list, lru) {
list_del_init(&page->lru);
pool_free(&compress->pool, page_address(page));
}
kfree(dst);
dst = NULL;
}
compress_finish(compress);
return dst;
#endif
}
static void gt_record_fences(struct intel_gt_coredump *gt)
{
struct i915_ggtt *ggtt = gt->_gt->ggtt;
struct intel_uncore *uncore = gt->_gt->uncore;
int i;
if (GRAPHICS_VER(uncore->i915) >= 6) {
for (i = 0; i < ggtt->num_fences; i++)
gt->fence[i] =
intel_uncore_read64(uncore,
FENCE_REG_GEN6_LO(i));
} else if (GRAPHICS_VER(uncore->i915) >= 4) {
for (i = 0; i < ggtt->num_fences; i++)
gt->fence[i] =
intel_uncore_read64(uncore,
FENCE_REG_965_LO(i));
} else {
for (i = 0; i < ggtt->num_fences; i++)
gt->fence[i] =
intel_uncore_read(uncore, FENCE_REG(i));
}
gt->nfence = i;
}
static void engine_record_registers(struct intel_engine_coredump *ee)
{
const struct intel_engine_cs *engine = ee->engine;
struct drm_i915_private *i915 = engine->i915;
if (GRAPHICS_VER(i915) >= 6) {
ee->rc_psmi = ENGINE_READ(engine, RING_PSMI_CTL);
if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50))
ee->fault_reg = intel_gt_mcr_read_any(engine->gt,
XEHP_RING_FAULT_REG);
else if (GRAPHICS_VER(i915) >= 12)
ee->fault_reg = intel_uncore_read(engine->uncore,
GEN12_RING_FAULT_REG);
else if (GRAPHICS_VER(i915) >= 8)
ee->fault_reg = intel_uncore_read(engine->uncore,
GEN8_RING_FAULT_REG);
else
ee->fault_reg = GEN6_RING_FAULT_REG_READ(engine);
}
if (GRAPHICS_VER(i915) >= 4) {
ee->esr = ENGINE_READ(engine, RING_ESR);
ee->faddr = ENGINE_READ(engine, RING_DMA_FADD);
ee->ipeir = ENGINE_READ(engine, RING_IPEIR);
ee->ipehr = ENGINE_READ(engine, RING_IPEHR);
ee->instps = ENGINE_READ(engine, RING_INSTPS);
ee->bbaddr = ENGINE_READ(engine, RING_BBADDR);
ee->ccid = ENGINE_READ(engine, CCID);
if (GRAPHICS_VER(i915) >= 8) {
ee->faddr |= (u64)ENGINE_READ(engine, RING_DMA_FADD_UDW) << 32;
ee->bbaddr |= (u64)ENGINE_READ(engine, RING_BBADDR_UDW) << 32;
}
ee->bbstate = ENGINE_READ(engine, RING_BBSTATE);
} else {
ee->faddr = ENGINE_READ(engine, DMA_FADD_I8XX);
ee->ipeir = ENGINE_READ(engine, IPEIR);
ee->ipehr = ENGINE_READ(engine, IPEHR);
}
if (GRAPHICS_VER(i915) >= 11) {
ee->cmd_cctl = ENGINE_READ(engine, RING_CMD_CCTL);
ee->cscmdop = ENGINE_READ(engine, RING_CSCMDOP);
ee->ctx_sr_ctl = ENGINE_READ(engine, RING_CTX_SR_CTL);
ee->dma_faddr_hi = ENGINE_READ(engine, RING_DMA_FADD_UDW);
ee->dma_faddr_lo = ENGINE_READ(engine, RING_DMA_FADD);
ee->nopid = ENGINE_READ(engine, RING_NOPID);
ee->excc = ENGINE_READ(engine, RING_EXCC);
}
intel_engine_get_instdone(engine, &ee->instdone);
ee->instpm = ENGINE_READ(engine, RING_INSTPM);
ee->acthd = intel_engine_get_active_head(engine);
ee->start = ENGINE_READ(engine, RING_START);
ee->head = ENGINE_READ(engine, RING_HEAD);
ee->tail = ENGINE_READ(engine, RING_TAIL);
ee->ctl = ENGINE_READ(engine, RING_CTL);
if (GRAPHICS_VER(i915) > 2)
ee->mode = ENGINE_READ(engine, RING_MI_MODE);
if (!HWS_NEEDS_PHYSICAL(i915)) {
i915_reg_t mmio;
if (GRAPHICS_VER(i915) == 7) {
switch (engine->id) {
default:
MISSING_CASE(engine->id);
fallthrough;
case RCS0:
mmio = RENDER_HWS_PGA_GEN7;
break;
case BCS0:
mmio = BLT_HWS_PGA_GEN7;
break;
case VCS0:
mmio = BSD_HWS_PGA_GEN7;
break;
case VECS0:
mmio = VEBOX_HWS_PGA_GEN7;
break;
}
} else if (GRAPHICS_VER(engine->i915) == 6) {
mmio = RING_HWS_PGA_GEN6(engine->mmio_base);
} else {
/* XXX: gen8 returns to sanity */
mmio = RING_HWS_PGA(engine->mmio_base);
}
ee->hws = intel_uncore_read(engine->uncore, mmio);
}
ee->reset_count = i915_reset_engine_count(&i915->gpu_error, engine);
if (HAS_PPGTT(i915)) {
int i;
ee->vm_info.gfx_mode = ENGINE_READ(engine, RING_MODE_GEN7);
if (GRAPHICS_VER(i915) == 6) {
ee->vm_info.pp_dir_base =
ENGINE_READ(engine, RING_PP_DIR_BASE_READ);
} else if (GRAPHICS_VER(i915) == 7) {
ee->vm_info.pp_dir_base =
ENGINE_READ(engine, RING_PP_DIR_BASE);
} else if (GRAPHICS_VER(i915) >= 8) {
u32 base = engine->mmio_base;
for (i = 0; i < 4; i++) {
ee->vm_info.pdp[i] =
intel_uncore_read(engine->uncore,
GEN8_RING_PDP_UDW(base, i));
ee->vm_info.pdp[i] <<= 32;
ee->vm_info.pdp[i] |=
intel_uncore_read(engine->uncore,
GEN8_RING_PDP_LDW(base, i));
}
}
}
}
static void record_request(const struct i915_request *request,
struct i915_request_coredump *erq)
{
erq->flags = request->fence.flags;
erq->context = request->fence.context;
erq->seqno = request->fence.seqno;
erq->sched_attr = request->sched.attr;
erq->head = request->head;
erq->tail = request->tail;
erq->pid = 0;
rcu_read_lock();
if (!intel_context_is_closed(request->context)) {
const struct i915_gem_context *ctx;
ctx = rcu_dereference(request->context->gem_context);
if (ctx)
#ifdef __linux__
erq->pid = pid_nr(ctx->pid);
#else
erq->pid = ctx->pid;
#endif
}
rcu_read_unlock();
}
static void engine_record_execlists(struct intel_engine_coredump *ee)
{
const struct intel_engine_execlists * const el = &ee->engine->execlists;
struct i915_request * const *port = el->active;
unsigned int n = 0;
while (*port)
record_request(*port++, &ee->execlist[n++]);
ee->num_ports = n;
}
static bool record_context(struct i915_gem_context_coredump *e,
struct intel_context *ce)
{
struct i915_gem_context *ctx;
struct task_struct *task;
bool simulated;
rcu_read_lock();
ctx = rcu_dereference(ce->gem_context);
if (ctx && !kref_get_unless_zero(&ctx->ref))
ctx = NULL;
rcu_read_unlock();
if (!ctx)
return true;
#ifdef __linux__
rcu_read_lock();
task = pid_task(ctx->pid, PIDTYPE_PID);
if (task) {
strcpy(e->comm, task->comm);
e->pid = task->pid;
}
rcu_read_unlock();
#endif
e->sched_attr = ctx->sched;
e->guilty = atomic_read(&ctx->guilty_count);
e->active = atomic_read(&ctx->active_count);
e->hwsp_seqno = (ce->timeline && ce->timeline->hwsp_seqno) ?
*ce->timeline->hwsp_seqno : ~0U;
e->total_runtime = intel_context_get_total_runtime_ns(ce);
e->avg_runtime = intel_context_get_avg_runtime_ns(ce);
simulated = i915_gem_context_no_error_capture(ctx);
i915_gem_context_put(ctx);
return simulated;
}
struct intel_engine_capture_vma {
struct intel_engine_capture_vma *next;
struct i915_vma_resource *vma_res;
char name[16];
bool lockdep_cookie;
};
static struct intel_engine_capture_vma *
capture_vma_snapshot(struct intel_engine_capture_vma *next,
struct i915_vma_resource *vma_res,
gfp_t gfp, const char *name)
{
struct intel_engine_capture_vma *c;
if (!vma_res)
return next;
c = kmalloc(sizeof(*c), gfp);
if (!c)
return next;
if (!i915_vma_resource_hold(vma_res, &c->lockdep_cookie)) {
kfree(c);
return next;
}
strlcpy(c->name, name, sizeof(c->name));
c->vma_res = i915_vma_resource_get(vma_res);
c->next = next;
return c;
}
static struct intel_engine_capture_vma *
capture_vma(struct intel_engine_capture_vma *next,
struct i915_vma *vma,
const char *name,
gfp_t gfp)
{
if (!vma)
return next;
/*
* If the vma isn't pinned, then the vma should be snapshotted
* to a struct i915_vma_snapshot at command submission time.
* Not here.
*/
if (GEM_WARN_ON(!i915_vma_is_pinned(vma)))
return next;
next = capture_vma_snapshot(next, vma->resource, gfp, name);
return next;
}
static struct intel_engine_capture_vma *
capture_user(struct intel_engine_capture_vma *capture,
const struct i915_request *rq,
gfp_t gfp)
{
struct i915_capture_list *c;
for (c = rq->capture_list; c; c = c->next)
capture = capture_vma_snapshot(capture, c->vma_res, gfp,
"user");
return capture;
}
static void add_vma(struct intel_engine_coredump *ee,
struct i915_vma_coredump *vma)
{
if (vma) {
vma->next = ee->vma;
ee->vma = vma;
}
}
static struct i915_vma_coredump *
create_vma_coredump(const struct intel_gt *gt, struct i915_vma *vma,
const char *name, struct i915_vma_compress *compress)
{
struct i915_vma_coredump *ret = NULL;
struct i915_vma_resource *vma_res;
bool lockdep_cookie;
if (!vma)
return NULL;
vma_res = vma->resource;
if (i915_vma_resource_hold(vma_res, &lockdep_cookie)) {
ret = i915_vma_coredump_create(gt, vma_res, compress, name);
i915_vma_resource_unhold(vma_res, lockdep_cookie);
}
return ret;
}
static void add_vma_coredump(struct intel_engine_coredump *ee,
const struct intel_gt *gt,
struct i915_vma *vma,
const char *name,
struct i915_vma_compress *compress)
{
add_vma(ee, create_vma_coredump(gt, vma, name, compress));
}
struct intel_engine_coredump *
intel_engine_coredump_alloc(struct intel_engine_cs *engine, gfp_t gfp, u32 dump_flags)
{
struct intel_engine_coredump *ee;
ee = kzalloc(sizeof(*ee), gfp);
if (!ee)
return NULL;
ee->engine = engine;
if (!(dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE)) {
engine_record_registers(ee);
engine_record_execlists(ee);
}
return ee;
}
static struct intel_engine_capture_vma *
engine_coredump_add_context(struct intel_engine_coredump *ee,
struct intel_context *ce,
gfp_t gfp)
{
struct intel_engine_capture_vma *vma = NULL;
ee->simulated |= record_context(&ee->context, ce);
if (ee->simulated)
return NULL;
/*
* We need to copy these to an anonymous buffer
* as the simplest method to avoid being overwritten
* by userspace.
*/
vma = capture_vma(vma, ce->ring->vma, "ring", gfp);
vma = capture_vma(vma, ce->state, "HW context", gfp);
return vma;
}
struct intel_engine_capture_vma *
intel_engine_coredump_add_request(struct intel_engine_coredump *ee,
struct i915_request *rq,
gfp_t gfp)
{
struct intel_engine_capture_vma *vma;
vma = engine_coredump_add_context(ee, rq->context, gfp);
if (!vma)
return NULL;
/*
* We need to copy these to an anonymous buffer
* as the simplest method to avoid being overwritten
* by userspace.
*/
vma = capture_vma_snapshot(vma, rq->batch_res, gfp, "batch");
vma = capture_user(vma, rq, gfp);
ee->rq_head = rq->head;
ee->rq_post = rq->postfix;
ee->rq_tail = rq->tail;
return vma;
}
void
intel_engine_coredump_add_vma(struct intel_engine_coredump *ee,
struct intel_engine_capture_vma *capture,
struct i915_vma_compress *compress)
{
const struct intel_engine_cs *engine = ee->engine;
while (capture) {
struct intel_engine_capture_vma *this = capture;
struct i915_vma_resource *vma_res = this->vma_res;
add_vma(ee,
i915_vma_coredump_create(engine->gt, vma_res,
compress, this->name));
i915_vma_resource_unhold(vma_res, this->lockdep_cookie);
i915_vma_resource_put(vma_res);
capture = this->next;
kfree(this);
}
add_vma_coredump(ee, engine->gt, engine->status_page.vma,
"HW Status", compress);
add_vma_coredump(ee, engine->gt, engine->wa_ctx.vma,
"WA context", compress);
}
static struct intel_engine_coredump *
capture_engine(struct intel_engine_cs *engine,
struct i915_vma_compress *compress,
u32 dump_flags)
{
struct intel_engine_capture_vma *capture = NULL;
struct intel_engine_coredump *ee;
struct intel_context *ce = NULL;
struct i915_request *rq = NULL;
ee = intel_engine_coredump_alloc(engine, ALLOW_FAIL, dump_flags);
if (!ee)
return NULL;
intel_engine_get_hung_entity(engine, &ce, &rq);
if (rq && !i915_request_started(rq))
drm_info(&engine->gt->i915->drm, "Got hung context on %s with active request %lld:%lld [0x%04X] not yet started\n",
engine->name, rq->fence.context, rq->fence.seqno, ce->guc_id.id);
if (rq) {
capture = intel_engine_coredump_add_request(ee, rq, ATOMIC_MAYFAIL);
i915_request_put(rq);
} else if (ce) {
capture = engine_coredump_add_context(ee, ce, ATOMIC_MAYFAIL);
}
if (capture) {
intel_engine_coredump_add_vma(ee, capture, compress);
if (dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE)
intel_guc_capture_get_matching_node(engine->gt, ee, ce);
} else {
kfree(ee);
ee = NULL;
}
return ee;
}
static void
gt_record_engines(struct intel_gt_coredump *gt,
intel_engine_mask_t engine_mask,
struct i915_vma_compress *compress,
u32 dump_flags)
{
struct intel_engine_cs *engine;
enum intel_engine_id id;
for_each_engine(engine, gt->_gt, id) {
struct intel_engine_coredump *ee;
/* Refill our page pool before entering atomic section */
pool_refill(&compress->pool, ALLOW_FAIL);
ee = capture_engine(engine, compress, dump_flags);
if (!ee)
continue;
ee->hung = engine->mask & engine_mask;
gt->simulated |= ee->simulated;
if (ee->simulated) {
if (dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE)
intel_guc_capture_free_node(ee);
kfree(ee);
continue;
}
ee->next = gt->engine;
gt->engine = ee;
}
}
static void gt_record_guc_ctb(struct intel_ctb_coredump *saved,
const struct intel_guc_ct_buffer *ctb,
const void *blob_ptr, struct intel_guc *guc)
{
if (!ctb || !ctb->desc)
return;
saved->raw_status = ctb->desc->status;
saved->raw_head = ctb->desc->head;
saved->raw_tail = ctb->desc->tail;
saved->head = ctb->head;
saved->tail = ctb->tail;
saved->size = ctb->size;
saved->desc_offset = ((void *)ctb->desc) - blob_ptr;
saved->cmds_offset = ((void *)ctb->cmds) - blob_ptr;
}
static struct intel_uc_coredump *
gt_record_uc(struct intel_gt_coredump *gt,
struct i915_vma_compress *compress)
{
const struct intel_uc *uc = >->_gt->uc;
struct intel_uc_coredump *error_uc;
error_uc = kzalloc(sizeof(*error_uc), ALLOW_FAIL);
if (!error_uc)
return NULL;
memcpy(&error_uc->guc_fw, &uc->guc.fw, sizeof(uc->guc.fw));
memcpy(&error_uc->huc_fw, &uc->huc.fw, sizeof(uc->huc.fw));
error_uc->guc_fw.file_selected.path = kstrdup(uc->guc.fw.file_selected.path, ALLOW_FAIL);
error_uc->huc_fw.file_selected.path = kstrdup(uc->huc.fw.file_selected.path, ALLOW_FAIL);
error_uc->guc_fw.file_wanted.path = kstrdup(uc->guc.fw.file_wanted.path, ALLOW_FAIL);
error_uc->huc_fw.file_wanted.path = kstrdup(uc->huc.fw.file_wanted.path, ALLOW_FAIL);
/*
* Save the GuC log and include a timestamp reference for converting the
* log times to system times (in conjunction with the error->boottime and
* gt->clock_frequency fields saved elsewhere).
*/
error_uc->guc.timestamp = intel_uncore_read(gt->_gt->uncore, GUCPMTIMESTAMP);
error_uc->guc.vma_log = create_vma_coredump(gt->_gt, uc->guc.log.vma,
"GuC log buffer", compress);
error_uc->guc.vma_ctb = create_vma_coredump(gt->_gt, uc->guc.ct.vma,
"GuC CT buffer", compress);
error_uc->guc.last_fence = uc->guc.ct.requests.last_fence;
gt_record_guc_ctb(error_uc->guc.ctb + 0, &uc->guc.ct.ctbs.send,
uc->guc.ct.ctbs.send.desc, (struct intel_guc *)&uc->guc);
gt_record_guc_ctb(error_uc->guc.ctb + 1, &uc->guc.ct.ctbs.recv,
uc->guc.ct.ctbs.send.desc, (struct intel_guc *)&uc->guc);
return error_uc;
}
/* Capture display registers. */
static void gt_record_display_regs(struct intel_gt_coredump *gt)
{
struct intel_uncore *uncore = gt->_gt->uncore;
struct drm_i915_private *i915 = uncore->i915;
if (GRAPHICS_VER(i915) >= 6)
gt->derrmr = intel_uncore_read(uncore, DERRMR);
if (GRAPHICS_VER(i915) >= 8)
gt->ier = intel_uncore_read(uncore, GEN8_DE_MISC_IER);
else if (IS_VALLEYVIEW(i915))
gt->ier = intel_uncore_read(uncore, VLV_IER);
else if (HAS_PCH_SPLIT(i915))
gt->ier = intel_uncore_read(uncore, DEIER);
else if (GRAPHICS_VER(i915) == 2)
gt->ier = intel_uncore_read16(uncore, GEN2_IER);
else
gt->ier = intel_uncore_read(uncore, GEN2_IER);
}
/* Capture all other registers that GuC doesn't capture. */
static void gt_record_global_nonguc_regs(struct intel_gt_coredump *gt)
{
struct intel_uncore *uncore = gt->_gt->uncore;
struct drm_i915_private *i915 = uncore->i915;
int i;
if (IS_VALLEYVIEW(i915)) {
gt->gtier[0] = intel_uncore_read(uncore, GTIER);
gt->ngtier = 1;
} else if (GRAPHICS_VER(i915) >= 11) {
gt->gtier[0] =
intel_uncore_read(uncore,
GEN11_RENDER_COPY_INTR_ENABLE);
gt->gtier[1] =
intel_uncore_read(uncore, GEN11_VCS_VECS_INTR_ENABLE);
gt->gtier[2] =
intel_uncore_read(uncore, GEN11_GUC_SG_INTR_ENABLE);
gt->gtier[3] =
intel_uncore_read(uncore,
GEN11_GPM_WGBOXPERF_INTR_ENABLE);
gt->gtier[4] =
intel_uncore_read(uncore,
GEN11_CRYPTO_RSVD_INTR_ENABLE);
gt->gtier[5] =
intel_uncore_read(uncore,
GEN11_GUNIT_CSME_INTR_ENABLE);
gt->ngtier = 6;
} else if (GRAPHICS_VER(i915) >= 8) {
for (i = 0; i < 4; i++)
gt->gtier[i] =
intel_uncore_read(uncore, GEN8_GT_IER(i));
gt->ngtier = 4;
} else if (HAS_PCH_SPLIT(i915)) {
gt->gtier[0] = intel_uncore_read(uncore, GTIER);
gt->ngtier = 1;
}
gt->eir = intel_uncore_read(uncore, EIR);
gt->pgtbl_er = intel_uncore_read(uncore, PGTBL_ER);
}
/*
* Capture all registers that relate to workload submission.
* NOTE: In GuC submission, when GuC resets an engine, it can dump these for us
*/
static void gt_record_global_regs(struct intel_gt_coredump *gt)
{
struct intel_uncore *uncore = gt->_gt->uncore;
struct drm_i915_private *i915 = uncore->i915;
int i;
/*
* General organization
* 1. Registers specific to a single generation
* 2. Registers which belong to multiple generations
* 3. Feature specific registers.
* 4. Everything else
* Please try to follow the order.
*/
/* 1: Registers specific to a single generation */
if (IS_VALLEYVIEW(i915))
gt->forcewake = intel_uncore_read_fw(uncore, FORCEWAKE_VLV);
if (GRAPHICS_VER(i915) == 7)
gt->err_int = intel_uncore_read(uncore, GEN7_ERR_INT);
if (GRAPHICS_VER_FULL(i915) >= IP_VER(12, 50)) {
gt->fault_data0 = intel_gt_mcr_read_any((struct intel_gt *)gt->_gt,
XEHP_FAULT_TLB_DATA0);
gt->fault_data1 = intel_gt_mcr_read_any((struct intel_gt *)gt->_gt,
XEHP_FAULT_TLB_DATA1);
} else if (GRAPHICS_VER(i915) >= 12) {
gt->fault_data0 = intel_uncore_read(uncore,
GEN12_FAULT_TLB_DATA0);
gt->fault_data1 = intel_uncore_read(uncore,
GEN12_FAULT_TLB_DATA1);
} else if (GRAPHICS_VER(i915) >= 8) {
gt->fault_data0 = intel_uncore_read(uncore,
GEN8_FAULT_TLB_DATA0);
gt->fault_data1 = intel_uncore_read(uncore,
GEN8_FAULT_TLB_DATA1);
}
if (GRAPHICS_VER(i915) == 6) {
gt->forcewake = intel_uncore_read_fw(uncore, FORCEWAKE);
gt->gab_ctl = intel_uncore_read(uncore, GAB_CTL);
gt->gfx_mode = intel_uncore_read(uncore, GFX_MODE);
}
/* 2: Registers which belong to multiple generations */
if (GRAPHICS_VER(i915) >= 7)
gt->forcewake = intel_uncore_read_fw(uncore, FORCEWAKE_MT);
if (GRAPHICS_VER(i915) >= 6) {
if (GRAPHICS_VER(i915) < 12) {
gt->error = intel_uncore_read(uncore, ERROR_GEN6);
gt->done_reg = intel_uncore_read(uncore, DONE_REG);
}
}
/* 3: Feature specific registers */
if (IS_GRAPHICS_VER(i915, 6, 7)) {
gt->gam_ecochk = intel_uncore_read(uncore, GAM_ECOCHK);
gt->gac_eco = intel_uncore_read(uncore, GAC_ECO_BITS);
}
if (IS_GRAPHICS_VER(i915, 8, 11))
gt->gtt_cache = intel_uncore_read(uncore, HSW_GTT_CACHE_EN);
if (GRAPHICS_VER(i915) == 12)
gt->aux_err = intel_uncore_read(uncore, GEN12_AUX_ERR_DBG);
if (GRAPHICS_VER(i915) >= 12) {
for (i = 0; i < I915_MAX_SFC; i++) {
/*
* SFC_DONE resides in the VD forcewake domain, so it
* only exists if the corresponding VCS engine is
* present.
*/
if ((gt->_gt->info.sfc_mask & BIT(i)) == 0 ||
!HAS_ENGINE(gt->_gt, _VCS(i * 2)))
continue;
gt->sfc_done[i] =
intel_uncore_read(uncore, GEN12_SFC_DONE(i));
}
gt->gam_done = intel_uncore_read(uncore, GEN12_GAM_DONE);
}
}
static void gt_record_info(struct intel_gt_coredump *gt)
{
memcpy(>->info, >->_gt->info, sizeof(struct intel_gt_info));
gt->clock_frequency = gt->_gt->clock_frequency;
gt->clock_period_ns = gt->_gt->clock_period_ns;
}
/*
* Generate a semi-unique error code. The code is not meant to have meaning, The
* code's only purpose is to try to prevent false duplicated bug reports by
* grossly estimating a GPU error state.
*
* TODO Ideally, hashing the batchbuffer would be a very nice way to determine
* the hang if we could strip the GTT offset information from it.
*
* It's only a small step better than a random number in its current form.
*/
static u32 generate_ecode(const struct intel_engine_coredump *ee)
{
/*
* IPEHR would be an ideal way to detect errors, as it's the gross
* measure of "the command that hung." However, has some very common
* synchronization commands which almost always appear in the case
* strictly a client bug. Use instdone to differentiate those some.
*/
return ee ? ee->ipehr ^ ee->instdone.instdone : 0;
}
static const char *error_msg(struct i915_gpu_coredump *error)
{
struct intel_engine_coredump *first = NULL;
unsigned int hung_classes = 0;
struct intel_gt_coredump *gt;
int len;
for (gt = error->gt; gt; gt = gt->next) {
struct intel_engine_coredump *cs;
for (cs = gt->engine; cs; cs = cs->next) {
if (cs->hung) {
hung_classes |= BIT(cs->engine->uabi_class);
if (!first)
first = cs;
}
}
}
len = scnprintf(error->error_msg, sizeof(error->error_msg),
"GPU HANG: ecode %d:%x:%08x",
GRAPHICS_VER(error->i915), hung_classes,
generate_ecode(first));
if (first && first->context.pid) {
/* Just show the first executing process, more is confusing */
len += scnprintf(error->error_msg + len,
sizeof(error->error_msg) - len,
", in %s [%d]",
first->context.comm, first->context.pid);
}
return error->error_msg;
}
static void capture_gen(struct i915_gpu_coredump *error)
{
struct drm_i915_private *i915 = error->i915;
error->wakelock = atomic_read(&i915->runtime_pm.wakeref_count);
error->suspended = i915->runtime_pm.suspended;
error->iommu = i915_vtd_active(i915);
error->reset_count = i915_reset_count(&i915->gpu_error);
error->suspend_count = i915->suspend_count;
i915_params_copy(&error->params, &i915->params);
memcpy(&error->device_info,
INTEL_INFO(i915),
sizeof(error->device_info));
memcpy(&error->runtime_info,
RUNTIME_INFO(i915),
sizeof(error->runtime_info));
memcpy(&error->display_device_info, DISPLAY_INFO(i915),
sizeof(error->display_device_info));
memcpy(&error->display_runtime_info, DISPLAY_RUNTIME_INFO(i915),
sizeof(error->display_runtime_info));
error->driver_caps = i915->caps;
}
struct i915_gpu_coredump *
i915_gpu_coredump_alloc(struct drm_i915_private *i915, gfp_t gfp)
{
struct i915_gpu_coredump *error;
if (!i915->params.error_capture)
return NULL;
error = kzalloc(sizeof(*error), gfp);
if (!error)
return NULL;
kref_init(&error->ref);
error->i915 = i915;
error->time = ktime_get_real();
error->boottime = ktime_get_boottime();
error->uptime = ktime_sub(ktime_get(), to_gt(i915)->last_init_time);
error->capture = jiffies;
capture_gen(error);
return error;
}
#define DAY_AS_SECONDS(x) (24 * 60 * 60 * (x))
struct intel_gt_coredump *
intel_gt_coredump_alloc(struct intel_gt *gt, gfp_t gfp, u32 dump_flags)
{
struct intel_gt_coredump *gc;
gc = kzalloc(sizeof(*gc), gfp);
if (!gc)
return NULL;
gc->_gt = gt;
gc->awake = intel_gt_pm_is_awake(gt);
gt_record_display_regs(gc);
gt_record_global_nonguc_regs(gc);
/*
* GuC dumps global, eng-class and eng-instance registers
* (that can change as part of engine state during execution)
* before an engine is reset due to a hung context.
* GuC captures and reports all three groups of registers
* together as a single set before the engine is reset.
* Thus, if GuC triggered the context reset we retrieve
* the register values as part of gt_record_engines.
*/
if (!(dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE))
gt_record_global_regs(gc);
gt_record_fences(gc);
return gc;
}
struct i915_vma_compress *
i915_vma_capture_prepare(struct intel_gt_coredump *gt)
{
struct i915_vma_compress *compress;
compress = kmalloc(sizeof(*compress), ALLOW_FAIL);
if (!compress)
return NULL;
if (!compress_init(compress)) {
kfree(compress);
return NULL;
}
return compress;
}
void i915_vma_capture_finish(struct intel_gt_coredump *gt,
struct i915_vma_compress *compress)
{
if (!compress)
return;
compress_fini(compress);
kfree(compress);
}
static struct i915_gpu_coredump *
__i915_gpu_coredump(struct intel_gt *gt, intel_engine_mask_t engine_mask, u32 dump_flags)
{
struct drm_i915_private *i915 = gt->i915;
struct i915_gpu_coredump *error;
/* Check if GPU capture has been disabled */
error = READ_ONCE(i915->gpu_error.first_error);
if (IS_ERR(error))
return error;
error = i915_gpu_coredump_alloc(i915, ALLOW_FAIL);
if (!error)
return ERR_PTR(-ENOMEM);
error->gt = intel_gt_coredump_alloc(gt, ALLOW_FAIL, dump_flags);
if (error->gt) {
struct i915_vma_compress *compress;
compress = i915_vma_capture_prepare(error->gt);
if (!compress) {
kfree(error->gt);
kfree(error);
return ERR_PTR(-ENOMEM);
}
if (INTEL_INFO(i915)->has_gt_uc) {
error->gt->uc = gt_record_uc(error->gt, compress);
if (error->gt->uc) {
if (dump_flags & CORE_DUMP_FLAG_IS_GUC_CAPTURE)
error->gt->uc->guc.is_guc_capture = true;
else
GEM_BUG_ON(error->gt->uc->guc.is_guc_capture);
}
}
gt_record_info(error->gt);
gt_record_engines(error->gt, engine_mask, compress, dump_flags);
i915_vma_capture_finish(error->gt, compress);
error->simulated |= error->gt->simulated;
}
error->overlay = intel_overlay_capture_error_state(i915);
return error;
}
static DEFINE_MUTEX(capture_mutex);
struct i915_gpu_coredump *
i915_gpu_coredump(struct intel_gt *gt, intel_engine_mask_t engine_mask, u32 dump_flags)
{
int ret = mutex_lock_interruptible(&capture_mutex);
struct i915_gpu_coredump *dump;
if (ret)
return ERR_PTR(ret);
dump = __i915_gpu_coredump(gt, engine_mask, dump_flags);
mutex_unlock(&capture_mutex);
return dump;
}
void i915_error_state_store(struct i915_gpu_coredump *error)
{
struct drm_i915_private *i915;
static bool warned;
if (IS_ERR_OR_NULL(error))
return;
i915 = error->i915;
drm_info(&i915->drm, "%s\n", error_msg(error));
if (error->simulated ||
cmpxchg(&i915->gpu_error.first_error, NULL, error))
return;
i915_gpu_coredump_get(error);
if (!xchg(&warned, true) &&
ktime_get_real_seconds() - DRIVER_TIMESTAMP < DAY_AS_SECONDS(180)) {
pr_info("GPU hangs can indicate a bug anywhere in the entire gfx stack, including userspace.\n");
pr_info("Please file a _new_ bug report at path_to_url");
pr_info("Please see path_to_url for details.\n");
pr_info("drm/i915 developers can then reassign to the right component if it's not a kernel issue.\n");
pr_info("The GPU crash dump is required to analyze GPU hangs, so please always attach it.\n");
pr_info("GPU crash dump saved to /sys/class/drm/card%d/error\n",
i915->drm.primary->index);
}
}
/**
* i915_capture_error_state - capture an error record for later analysis
* @gt: intel_gt which originated the hang
* @engine_mask: hung engines
* @dump_flags: dump flags
*
* Should be called when an error is detected (either a hang or an error
* interrupt) to capture error state from the time of the error. Fills
* out a structure which becomes available in debugfs for user level tools
* to pick up.
*/
void i915_capture_error_state(struct intel_gt *gt,
intel_engine_mask_t engine_mask, u32 dump_flags)
{
struct i915_gpu_coredump *error;
error = i915_gpu_coredump(gt, engine_mask, dump_flags);
if (IS_ERR(error)) {
cmpxchg(>->i915->gpu_error.first_error, NULL, error);
return;
}
i915_error_state_store(error);
i915_gpu_coredump_put(error);
}
struct i915_gpu_coredump *
i915_first_error_state(struct drm_i915_private *i915)
{
struct i915_gpu_coredump *error;
spin_lock_irq(&i915->gpu_error.lock);
error = i915->gpu_error.first_error;
if (!IS_ERR_OR_NULL(error))
i915_gpu_coredump_get(error);
spin_unlock_irq(&i915->gpu_error.lock);
return error;
}
void i915_reset_error_state(struct drm_i915_private *i915)
{
struct i915_gpu_coredump *error;
spin_lock_irq(&i915->gpu_error.lock);
error = i915->gpu_error.first_error;
if (error != ERR_PTR(-ENODEV)) /* if disabled, always disabled */
i915->gpu_error.first_error = NULL;
spin_unlock_irq(&i915->gpu_error.lock);
if (!IS_ERR_OR_NULL(error))
i915_gpu_coredump_put(error);
}
void i915_disable_error_state(struct drm_i915_private *i915, int err)
{
spin_lock_irq(&i915->gpu_error.lock);
if (!i915->gpu_error.first_error)
i915->gpu_error.first_error = ERR_PTR(err);
spin_unlock_irq(&i915->gpu_error.lock);
}
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)
void intel_klog_error_capture(struct intel_gt *gt,
intel_engine_mask_t engine_mask)
{
static int g_count;
struct drm_i915_private *i915 = gt->i915;
struct i915_gpu_coredump *error;
intel_wakeref_t wakeref;
size_t buf_size = PAGE_SIZE * 128;
size_t pos_err;
char *buf, *ptr, *next;
int l_count = g_count++;
int line = 0;
/* Can't allocate memory during a reset */
if (test_bit(I915_RESET_BACKOFF, >->reset.flags)) {
drm_err(>->i915->drm, "[Capture/%d.%d] Inside GT reset, skipping error capture :(\n",
l_count, line++);
return;
}
error = READ_ONCE(i915->gpu_error.first_error);
if (error) {
drm_err(&i915->drm, "[Capture/%d.%d] Clearing existing error capture first...\n",
l_count, line++);
i915_reset_error_state(i915);
}
with_intel_runtime_pm(&i915->runtime_pm, wakeref)
error = i915_gpu_coredump(gt, engine_mask, CORE_DUMP_FLAG_NONE);
if (IS_ERR(error)) {
drm_err(&i915->drm, "[Capture/%d.%d] Failed to capture error capture: %ld!\n",
l_count, line++, PTR_ERR(error));
return;
}
buf = kvmalloc(buf_size, GFP_KERNEL);
if (!buf) {
drm_err(&i915->drm, "[Capture/%d.%d] Failed to allocate buffer for error capture!\n",
l_count, line++);
i915_gpu_coredump_put(error);
return;
}
drm_info(&i915->drm, "[Capture/%d.%d] Dumping i915 error capture for %ps...\n",
l_count, line++, __builtin_return_address(0));
/* Largest string length safe to print via dmesg */
# define MAX_CHUNK 800
pos_err = 0;
while (1) {
ssize_t got = i915_gpu_coredump_copy_to_buffer(error, buf, pos_err, buf_size - 1);
if (got <= 0)
break;
buf[got] = 0;
pos_err += got;
ptr = buf;
while (got > 0) {
size_t count;
char tag[2];
next = strnchr(ptr, got, '\n');
if (next) {
count = next - ptr;
*next = 0;
tag[0] = '>';
tag[1] = '<';
} else {
count = got;
tag[0] = '}';
tag[1] = '{';
}
if (count > MAX_CHUNK) {
size_t pos;
char *ptr2 = ptr;
for (pos = MAX_CHUNK; pos < count; pos += MAX_CHUNK) {
char chr = ptr[pos];
ptr[pos] = 0;
drm_info(&i915->drm, "[Capture/%d.%d] }%s{\n",
l_count, line++, ptr2);
ptr[pos] = chr;
ptr2 = ptr + pos;
/*
* If spewing large amounts of data via a serial console,
* this can be a very slow process. So be friendly and try
* not to cause 'softlockup on CPU' problems.
*/
cond_resched();
}
if (ptr2 < (ptr + count))
drm_info(&i915->drm, "[Capture/%d.%d] %c%s%c\n",
l_count, line++, tag[0], ptr2, tag[1]);
else if (tag[0] == '>')
drm_info(&i915->drm, "[Capture/%d.%d] ><\n",
l_count, line++);
} else {
drm_info(&i915->drm, "[Capture/%d.%d] %c%s%c\n",
l_count, line++, tag[0], ptr, tag[1]);
}
ptr = next;
got -= count;
if (next) {
ptr++;
got--;
}
/* As above. */
cond_resched();
}
if (got)
drm_info(&i915->drm, "[Capture/%d.%d] Got %zd bytes remaining!\n",
l_count, line++, got);
}
kvfree(buf);
drm_info(&i915->drm, "[Capture/%d.%d] Dumped %zd bytes\n", l_count, line++, pos_err);
}
#endif
```
|
```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.data.pipeline.mysql.ingest.incremental.client;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLColumnDefinition41Packet;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.MySQLFieldCountPacket;
import org.apache.shardingsphere.db.protocol.mysql.packet.command.query.text.MySQLTextResultSetRowPacket;
import java.util.ArrayList;
import java.util.List;
/**
* Internal result set.
*/
@RequiredArgsConstructor
@Getter
public final class InternalResultSet {
private final MySQLFieldCountPacket header;
private final List<MySQLColumnDefinition41Packet> fieldDescriptors = new ArrayList<>();
private final List<MySQLTextResultSetRowPacket> fieldValues = new ArrayList<>();
}
```
|
Laguna Lake is a shallow natural lake at the head of the Chileno Valley. It retains some water year round. The lake is wide and long, straddling the Sonoma-Marin county line in northern California, United States. It is the source of Chileno Creek which flows west to Walker Creek.
It was included in the Rancho Laguna de San Antonio Mexican land grant, which was given to Bartolomé Bojorquez in 1845.
Laguna Lake is used extensively for migrating and breeding waterfowl and Agriculture. agr.
See also
List of lakes in California
List of lakes in the San Francisco Bay Area
References
Lakes of Marin County, California
Lakes of the San Francisco Bay Area
Lakes of Sonoma County, California
Lakes of California
Lakes of Northern California
|
Poi Satchi () is a 1982 Indian Tamil-language film, directed by G. Ramakrishnan and K. Bhagyaraj, starring Bhagyaraj, Raadhika and Sumithra. It was released on 3 September 1982. The film failed at the box office.
Plot
Cast
K. Bhagyaraj as Vairavan
Raadhika as Rukku
Sumithra as Sornam, Vairavan's sister
Kovai Sarala as Young Sornam
Senthil as Pandaram
Peeli Sivam as Murugappan, Sornam's husband
Pasi Narayanan as Munusamy
Anuradha
Kallapetti Singaram as Singaram
Master Haja Sheriff as Sornam's son
Veerapan
Soundtrack
The music was composed by Shankar–Ganesh.
Reception
Thiraignani of Kalki wrote a review in the form of a conversation between Bhagyaraj and lawyer.
References
External links
1980s Tamil-language films
Films directed by K. Bhagyaraj
Films scored by Shankar–Ganesh
|
The Admonitions (; ) is a mirror for princesa literary work summarizing the principles of governmentcompleted in the 1010s or 1020s for King Stephen I of Hungary's son and heir, Emeric. About a century later, Bishop Hartvik claimed that Stephen I himself wrote the small book. Modern scholarship has concluded that a foreign cleric who was proficient in rhymed Latin prose compiled the text. The cleric has been associated with a Saxon monk, Thangmar; with the Venetian Bishop Gerard of Csanád; and with Archbishop Astrik of Esztergom.
References
Sources
1010s books
1020s books
Medieval documents of Hungary
Mirrors for princes
|
Karjalan Sissit (Finnish for Karelian Guerrillas) the main musical project of Markus Pesonen. He combines neoclassical orchestral arrangements with elements of noise, power electronics and dark ambient. Common themes on his records are alcoholism, mental health problems and domestic violence. His current location is Eskilstuna, Sweden, and he works with Peter Bjärgö's Erebus Odora label.
Members
Markus Pesonen
Peter Bjargo
D.F. Bragman
Mikael Lindblom
Per Ahlund
Discography
Karjalan Sissit - 2001
Miserere - 2002
Karjalasta Kajahtaa - 2004
Tanssit On Loppu Nyt - 2006
Fucking Whore Society - 2009
...Want You Dead - 2015
External links
http://www.myspace.com/karjalansissit
Swedish electronic music groups
|
The 1975–76 Montreal Canadiens season was the club's 67th season. The Canadiens won their 19th Stanley Cup in club history. In addition to the regular NHL schedule, the Canadiens played an exhibition game against the powerful Soviet Red Army team, recording a 3-3 tie.
Offseason
Regular season
Henri Richard's number 16 was retired December 10, 1975, by the Canadiens in his honour.
Final standings
Record vs. opponents
Schedule and results
Player statistics
Regular season
Scoring
Goaltending
Playoffs
Scoring
Goaltending
Transactions
Playoffs
Stanley Cup Finals
Guy Lafleur scored his first two career goals in the finals, both game-winners.
Reggie Leach scored four time in the finals, and 19 for the play-offs to win the Conn Smythe Trophy despite the Flyers losing to the Canadiens.
Montreal Canadiens vs. Philadelphia Flyers
Montreal wins the series 4–0.
Reggie Leach won the Conn Smythe Trophy as playoff MVP.
Awards and records
Prince of Wales Trophy
Ken Dryden, Vezina Trophy
Guy Lafleur, Art Ross Trophy
Draft picks
Farm teams
See also
1975–76 NHL season
References
Canadiens on Hockey Database
Canadiens on NHL Reference
Stanley Cup championship seasons
Norris Division champion seasons
Montreal Canadiens seasons
Montreal Canadiens season, 1975-76
Eastern Conference (NHL) championship seasons
Mon
|
```smalltalk
namespace Asp.Versioning.Routing;
using Asp.Versioning.ApiExplorer;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features;
using Microsoft.AspNetCore.Routing;
using Microsoft.AspNetCore.Routing.Matching;
using Microsoft.AspNetCore.Routing.Patterns;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Microsoft.Extensions.Primitives;
public class ApiVersionMatcherPolicyTest
{
[Fact]
public void your_sha256_hashnts()
{
// arrange
var policy = NewApiVersionMatcherPolicy();
var items = new object[]
{
new ApiVersionMetadata( ApiVersionModel.Default, ApiVersionModel.Default ),
};
var endpoints = new Endpoint[] { new( Limbo, new( items ), default ) };
// act
var result = policy.AppliesToEndpoints( endpoints );
// assert
result.Should().BeTrue();
}
[Fact]
public void applies_to_endpoints_should_return_false_for_normal_endpoints()
{
// arrange
var policy = NewApiVersionMatcherPolicy();
var endpoints = new Endpoint[] { new( Limbo, new(), default ) };
// act
var result = policy.AppliesToEndpoints( endpoints );
// assert
result.Should().BeFalse();
}
[Fact]
public void apply_should_use_400_endpoint_for_ambiguous_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
feature.SetupProperty( f => f.RawRequestedApiVersions, new[] { "1.0", "2.0" } );
var options = new ApiVersioningOptions()
{
ApiVersionReader = new QueryStringApiVersionReader(),
};
var policy = NewApiVersionMatcherPolicy( options );
var httpContext = NewHttpContext( feature, queryParameters: new() { ["api-version"] = new( new[] { "1.0", "2.0" } ) } );
var model = new ApiVersionModel(
declaredVersions: new ApiVersion[] { new( 1, 0 ), new( 2, 0 ) },
supportedVersions: new ApiVersion[] { new( 1, 0 ), new( 2, 0 ) },
deprecatedVersions: Enumerable.Empty<ApiVersion>(),
advertisedVersions: Enumerable.Empty<ApiVersion>(),
deprecatedAdvertisedVersions: Enumerable.Empty<ApiVersion>() );
var routePattern = RoutePatternFactory.Parse( "api/values" );
var builder = new RouteEndpointBuilder( Limbo, routePattern, 0 )
{
Metadata = { new ApiVersionMetadata( model, model ) },
};
var endpoints = new[] { builder.Build() };
var edges = policy.GetEdges( endpoints );
var tableEdges = new List<PolicyJumpTableEdge>();
for ( var i = 0; i < edges.Count; i++ )
{
tableEdges.Add( new( edges[i].State, i ) );
}
var jumpTable = policy.BuildJumpTable( 42, tableEdges );
// act
var endpoint = edges[jumpTable.GetDestination( httpContext )].Endpoints[0];
// assert
endpoint.DisplayName.Should().Be( "400 Ambiguous API Version" );
}
[Fact]
public async Task apply_should_have_candidate_for_matched_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
var model = new ApiVersionModel( new ApiVersion( 1, 0 ) );
var items = new object[] { new ApiVersionMetadata( model, model ) };
var endpoint = new Endpoint( Limbo, new( items ), default );
var candidates = new CandidateSet( new[] { endpoint }, new[] { new RouteValueDictionary() }, [0] );
var policy = NewApiVersionMatcherPolicy();
feature.SetupProperty( f => f.RequestedApiVersion, new ApiVersion( 1, 0 ) );
var httpContext = NewHttpContext( feature );
// act
await policy.ApplyAsync( httpContext, candidates );
// assert
candidates.IsValidCandidate( 0 ).Should().BeTrue();
}
[Fact]
public async Task apply_should_use_400_endpoint_for_unmatched_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
feature.SetupProperty( f => f.RawRequestedApiVersion, "2.0" );
feature.SetupProperty( f => f.RawRequestedApiVersions, new[] { "2.0" } );
feature.SetupProperty( f => f.RequestedApiVersion, new ApiVersion( 2, 0 ) );
var policy = NewApiVersionMatcherPolicy();
var model = new ApiVersionModel( new ApiVersion( 1, 0 ) );
var items = new object[] { new ApiVersionMetadata( model, model ) };
var endpoint = new Endpoint( Limbo, new( items ), default );
var candidates = new CandidateSet( new[] { endpoint }, new[] { new RouteValueDictionary() }, [0] );
var httpContext = NewHttpContext( feature );
// act
await policy.ApplyAsync( httpContext, candidates );
// assert
httpContext.GetEndpoint().DisplayName.Should().Be( "400 Unsupported API Version" );
}
[Fact]
public void apply_should_use_400_endpoint_for_invalid_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
feature.SetupProperty( f => f.RawRequestedApiVersions, new[] { "blah" } );
var options = new ApiVersioningOptions()
{
ApiVersionReader = new QueryStringApiVersionReader(),
};
var policy = NewApiVersionMatcherPolicy( options );
var httpContext = NewHttpContext( feature, queryParameters: new() { ["api-version"] = new( new[] { "blah" } ) } );
var model = new ApiVersionModel(
declaredVersions: new ApiVersion[] { new( 1, 0 ) },
supportedVersions: new ApiVersion[] { new( 1, 0 ) },
deprecatedVersions: Enumerable.Empty<ApiVersion>(),
advertisedVersions: Enumerable.Empty<ApiVersion>(),
deprecatedAdvertisedVersions: Enumerable.Empty<ApiVersion>() );
var routePattern = RoutePatternFactory.Parse( "api/values" );
var builder = new RouteEndpointBuilder( Limbo, routePattern, 0 )
{
Metadata = { new ApiVersionMetadata( model, model ) },
};
var endpoints = new[] { builder.Build() };
var edges = policy.GetEdges( endpoints );
var tableEdges = new List<PolicyJumpTableEdge>();
for ( var i = 0; i < edges.Count; i++ )
{
tableEdges.Add( new( edges[i].State, i ) );
}
var jumpTable = policy.BuildJumpTable( 42, tableEdges );
// act
var endpoint = edges[jumpTable.GetDestination( httpContext )].Endpoints[0];
// assert
endpoint.DisplayName.Should().Be( "400 Invalid API Version" );
}
[Fact]
public async Task apply_should_use_400_endpoint_for_unspecified_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
feature.SetupProperty( f => f.RawRequestedApiVersion, default );
feature.SetupProperty( f => f.RawRequestedApiVersions, Array.Empty<string>() );
feature.SetupProperty( f => f.RequestedApiVersion, default );
var policy = NewApiVersionMatcherPolicy();
var model = new ApiVersionModel( new ApiVersion( 1, 0 ) );
var items = new object[] { new ApiVersionMetadata( model, model ) };
var endpoint = new Endpoint( Limbo, new( items ), "Test" );
var candidates = new CandidateSet( new[] { endpoint }, new[] { new RouteValueDictionary() }, [0] );
var httpContext = NewHttpContext( feature );
// act
await policy.ApplyAsync( httpContext, candidates );
// assert
httpContext.GetEndpoint().DisplayName.Should().Be( "400 Unspecified API Version" );
}
[Fact]
public async Task apply_should_have_candidate_for_unspecified_api_version()
{
// arrange
var feature = new Mock<IApiVersioningFeature>();
var model = new ApiVersionModel( new ApiVersion( 1, 0 ) );
var items = new object[] { new ApiVersionMetadata( model, model ) };
var endpoint = new Endpoint( Limbo, new( items ), default );
var candidates = new CandidateSet( new[] { endpoint }, new[] { new RouteValueDictionary() }, [0] );
var options = new ApiVersioningOptions() { AssumeDefaultVersionWhenUnspecified = true };
var policy = NewApiVersionMatcherPolicy( options );
feature.SetupProperty( f => f.RawRequestedApiVersion, default );
feature.SetupProperty( f => f.RequestedApiVersion, default );
var httpContext = NewHttpContext( feature );
// act
await policy.ApplyAsync( httpContext, candidates );
// assert
candidates.IsValidCandidate( 0 ).Should().BeTrue();
feature.Object.RequestedApiVersion.Should().Be( new ApiVersion( 1, 0 ) );
}
private static Task Limbo( HttpContext context ) => Task.CompletedTask;
private static ApiVersionMatcherPolicy NewApiVersionMatcherPolicy( ApiVersioningOptions options = default ) =>
new(
ApiVersionParser.Default,
Enumerable.Empty<IApiVersionMetadataCollationProvider>(),
Options.Create( options ?? new() ),
Mock.Of<ILogger<ApiVersionMatcherPolicy>>() );
private static HttpContext NewHttpContext(
Mock<IApiVersioningFeature> apiVersioningFeature,
IServiceProvider services = default,
Dictionary<string, StringValues> queryParameters = default )
{
var features = new FeatureCollection();
var request = new Mock<HttpRequest>();
var response = new Mock<HttpResponse>();
var httpContext = new Mock<HttpContext>();
var routingFeature = new Mock<IRoutingFeature>();
QueryString queryString;
QueryCollection query;
if ( queryParameters is null || queryParameters.Count == 0 )
{
queryString = QueryString.Empty;
query = new QueryCollection();
}
else
{
queryString = QueryString.Create( queryParameters );
query = new QueryCollection( queryParameters );
}
routingFeature.SetupProperty( r => r.RouteData, new RouteData() );
features.Set( apiVersioningFeature.Object );
features.Set( routingFeature.Object );
request.SetupProperty( r => r.Scheme, Uri.UriSchemeHttp );
request.SetupProperty( r => r.Host, new HostString( "tempuri.org" ) );
request.SetupProperty( r => r.Path, PathString.Empty );
request.SetupProperty( r => r.PathBase, PathString.Empty );
request.SetupProperty( r => r.Query, query );
request.SetupProperty( r => r.QueryString, queryString );
request.SetupProperty( r => r.Method, "GET" );
response.SetupGet( r => r.Headers ).Returns( Mock.Of<IHeaderDictionary>() );
httpContext.SetupGet( hc => hc.Features ).Returns( features );
httpContext.SetupGet( hc => hc.Request ).Returns( request.Object );
httpContext.SetupGet( hc => hc.Response ).Returns( response.Object );
if ( services is not null )
{
httpContext.SetupProperty( hc => hc.RequestServices, services );
}
return httpContext.Object;
}
}
```
|
```java
// 2019 and later: Unicode, Inc. and others.
package com.ibm.icu.impl;
import java.text.AttributedCharacterIterator;
import java.text.AttributedString;
import java.text.FieldPosition;
import java.text.Format;
import java.util.List;
import com.ibm.icu.text.ConstrainedFieldPosition;
/**
* Implementation of FormattedValue based on FieldPositionIterator.
*
* In C++, this implements FormattedValue. In Java, it is a stateless
* collection of static functions to avoid having to use nested objects.
*/
public class FormattedValueFieldPositionIteratorImpl {
/** Do not construct instances of this class */
private FormattedValueFieldPositionIteratorImpl() {}
/** Helper class to keep track of fields with values in Java */
private static class FieldWithValue extends Format.Field {
private static final long serialVersionUID = -3850076447157793465L;
public final Format.Field field;
public final int value;
public FieldWithValue(Format.Field field, int value) {
super(field.toString());
this.field = field;
this.value = value;
}
}
public static boolean nextPosition(List<FieldPosition> attributes, ConstrainedFieldPosition cfpos) {
int numFields = attributes.size();
int i = (int) cfpos.getInt64IterationContext();
for (; i < numFields; i++) {
FieldPosition fpos = attributes.get(i);
Format.Field field = fpos.getFieldAttribute();
Object value = null;
if (field instanceof FieldWithValue) {
value = ((FieldWithValue) field).value;
field = ((FieldWithValue) field).field;
}
if (cfpos.matchesField(field, value)) {
int start = fpos.getBeginIndex();
int limit = fpos.getEndIndex();
cfpos.setState(field, value, start, limit);
break;
}
}
cfpos.setInt64IterationContext(i == numFields ? i : i + 1);
return i < numFields;
}
public static AttributedCharacterIterator toCharacterIterator(CharSequence cs, List<FieldPosition> attributes) {
AttributedString as = new AttributedString(cs.toString());
// add attributes to the AttributedString
for (int i = 0; i < attributes.size(); i++) {
FieldPosition fp = attributes.get(i);
Format.Field field = fp.getFieldAttribute();
Object value = field;
if (field instanceof FieldWithValue) {
value = ((FieldWithValue) field).value;
field = ((FieldWithValue) field).field;
}
as.addAttribute(field, value, fp.getBeginIndex(), fp.getEndIndex());
}
// return the CharacterIterator from AttributedString
return as.getIterator();
}
public static void addOverlapSpans(List<FieldPosition> attributes, Format.Field spanField, int firstIndex) {
// In order to avoid fancy data structures, this is an O(N^2) algorithm,
// which should be fine for all real-life applications of this function.
int s1a = Integer.MAX_VALUE;
int s1b = 0;
int s2a = Integer.MAX_VALUE;
int s2b = 0;
int numFields = attributes.size();
for (int i = 0; i<numFields; i++) {
FieldPosition fp1 = attributes.get(i);
for (int j = i + 1; j<numFields; j++) {
FieldPosition fp2 = attributes.get(j);
if (fp1.getFieldAttribute() != fp2.getFieldAttribute()) {
continue;
}
// Found a duplicate
s1a = Math.min(s1a, fp1.getBeginIndex());
s1b = Math.max(s1b, fp1.getEndIndex());
s2a = Math.min(s2a, fp2.getBeginIndex());
s2b = Math.max(s2b, fp2.getEndIndex());
break;
}
}
if (s1a != Integer.MAX_VALUE) {
// Success: add the two span fields
FieldPosition newPos = new FieldPosition(new FieldWithValue(spanField, firstIndex));
newPos.setBeginIndex(s1a);
newPos.setEndIndex(s1b);
attributes.add(newPos);
newPos = new FieldPosition(new FieldWithValue(spanField, 1 - firstIndex));
newPos.setBeginIndex(s2a);
newPos.setEndIndex(s2b);
attributes.add(newPos);
}
}
public static void sort(List<FieldPosition> attributes) {
// Use bubble sort, O(N^2) but easy and no fancy data structures.
int numFields = attributes.size();
while (true) {
boolean isSorted = true;
for (int i=0; i<numFields-1; i++) {
FieldPosition fp1 = attributes.get(i);
FieldPosition fp2 = attributes.get(i + 1);
long comparison = 0;
if (fp1.getBeginIndex() != fp2.getBeginIndex()) {
// Higher start index -> higher rank
comparison = fp2.getBeginIndex() - fp1.getBeginIndex();
} else if (fp1.getEndIndex() != fp2.getEndIndex()) {
// Higher length (end index) -> lower rank
comparison = fp1.getEndIndex() - fp2.getEndIndex();
} else if (fp1.getFieldAttribute() != fp2.getFieldAttribute()) {
// Span category -> lower rank
// Pick other orders arbitrarily
boolean fp1isSpan = fp1.getFieldAttribute() instanceof FieldWithValue;
boolean fp2isSpan = fp2.getFieldAttribute() instanceof FieldWithValue;
if (fp1isSpan && !fp2isSpan) {
comparison = 1;
} else if (fp2isSpan && !fp1isSpan) {
comparison = -1;
} else {
comparison = fp1.hashCode() - fp2.hashCode();
}
}
if (comparison < 0) {
// Perform a swap
isSorted = false;
attributes.set(i, fp2);
attributes.set(i + 1, fp1);
}
}
if (isSorted) {
break;
}
}
}
}
```
|
```html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0.1 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Flyweight Documentation - Tutorial - Technical issues</title>
<link rel="stylesheet" href="../style.css" type="text/css">
<link rel="start" href="../index.html">
<link rel="prev" href="extension.html">
<link rel="up" href="index.html">
<link rel="next" href="lambda_expressions.html">
</head>
<body>
<h1><img src="../../../../boost.png" alt="Boost logo" align=
"middle" width="277" height="86">Boost.Flyweight Tutorial: Technical issues</h1>
<div class="prev_link"><a href="extension.html"><img src="../prev.gif" alt="extending Boost.Flyweight" border="0"><br>
Extending Boost.Flyweight
</a></div>
<div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.Flyweight tutorial" border="0"><br>
Boost.Flyweight tutorial
</a></div>
<div class="next_link"><a href="lambda_expressions.html"><img src="../next.gif" alt="annex: MPL lambda expressions" border="0"><br>
Annex: MPL lambda expressions
</a></div><br clear="all" style="clear: all;">
<hr>
<h2>Contents</h2>
<ul>
<li><a href="#static_init">Static data initialization</a></li>
</ul>
<h2><a name="static_init">Static data initialization</a></h2>
<p>
For any given <code>T</code>, the type <code>flyweight<T></code>
maintains some class-wide or static data that needs to be properly
initialized before the class can be used. The internal machinery of
Boost.Flyweight guarantees that static data initialization
takes place automatically before the first use of the particular
<code>flyweight<T></code> instantiation in the program, and in
any case always during the so-called <i>dynamic initialization phase</i>
of the program startup sequence. Although this is not strictly
required by the C++ standard, in current practice dynamic initialization
is completed before <code>main()</code> begins.
</p>
<p>
So, for all practical purposes, static data initialization is performed
before <code>main()</code> or before the first pre-<code>main()</code>
usage of the class, for instance if we declare a global
<code>static flyweight<T></code> object. This covers the vast
majority of usage cases in a transparent manner, but there are
some scenarios where the automatic static data initialization
policy of Boost.Flyweight can fail:
</p>
<blockquote><pre>
<span class=comment>// global thread pool</span>
<span class=keyword>class</span> <span class=identifier>thread_pool</span>
<span class=special>{</span>
<span class=keyword>public</span><span class=special>:</span>
<span class=identifier>thread_pool</span><span class=special>()</span>
<span class=special>{</span>
<span class=keyword>for</span><span class=special>(</span><span class=keyword>int</span> <span class=identifier>i</span><span class=special>=</span><span class=number>0</span><span class=special>;</span><span class=identifier>i</span><span class=special><</span><span class=number>100</span><span class=special>;++</span><span class=identifier>i</span><span class=special>)</span><span class=identifier>p</span><span class=special>[</span><span class=identifier>i</span><span class=special>]=</span><span class=identifier>shared_ptr</span><span class=special><</span><span class=identifier>thread</span><span class=special>>(</span><span class=keyword>new</span> <span class=identifier>thread</span><span class=special>(</span><span class=identifier>thread_fun</span><span class=special>));</span>
<span class=special>}</span>
<span class=keyword>private</span><span class=special>:</span>
<span class=keyword>static</span> <span class=keyword>void</span> <span class=identifier>thread_fun</span><span class=special>()</span>
<span class=special>{</span>
<span class=comment>// uses flyweight<std::string></span>
<span class=special>}</span>
<span class=identifier>array</span><span class=special><</span><span class=identifier>shared_ptr</span><span class=special><</span><span class=identifier>thread</span><span class=special>>,</span><span class=number>100</span><span class=special>></span> <span class=identifier>p</span><span class=special>;</span>
<span class=special>};</span>
<span class=keyword>static</span> <span class=identifier>thread_pool</span> <span class=identifier>thpool</span><span class=special>;</span>
<span class=keyword>int</span> <span class=identifier>main</span><span class=special>()</span>
<span class=special>{</span>
<span class=special>...</span>
</pre></blockquote>
<p>
The global pool of the example launches several threads, each of which
internally uses <code>flyweight<std::string></code>.
Static data initialization can potentially be executed twice concurrently
if two threads happen to collide on the first usage of
<code>flyweight<std::string></code>: Boost.Flyweight initialization
does not consider thread safety. So, we need to explicitly take care of
static data initialization in a thread safe context before launching
the threads:
</p>
<blockquote><pre>
<span class=keyword>class</span> <span class=identifier>thread_pool</span>
<span class=special>{</span>
<span class=keyword>public</span><span class=special>:</span>
<span class=identifier>thread_pool</span><span class=special>()</span>
<span class=special>{</span>
<b><span class=identifier>flyweight</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>>::</span><span class=identifier>init</span><span class=special>();</span></b>
<span class=keyword>for</span><span class=special>(</span><span class=keyword>int</span> <span class=identifier>i</span><span class=special>=</span><span class=number>0</span><span class=special>;</span><span class=identifier>i</span><span class=special><</span><span class=number>100</span><span class=special>;++</span><span class=identifier>i</span><span class=special>)</span><span class=identifier>p</span><span class=special>[</span><span class=identifier>i</span><span class=special>]=</span><span class=identifier>shared_ptr</span><span class=special><</span><span class=identifier>thread</span><span class=special>>(</span><span class=keyword>new</span> <span class=identifier>thread</span><span class=special>(</span><span class=identifier>thread_fun</span><span class=special>));</span>
<span class=special>}</span>
<span class=special>...</span>
</pre></blockquote>
<p>
The static member function <code>init</code> is not thread safe, either: in our particular
example it just happens to be called in a single threaded environment.
When concurrency can happen, <code>flyweight<T>::init</code> must
be properly synchronized by the programmer by using some mutual exclusion
mechanisms of her own.
</p>
<p>
The following is another example where the default static initialization
provided by Boost.Flyweight can fail:
</p>
<blockquote><pre>
<span class=keyword>static</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>vector</span><span class=special><</span><span class=identifier>flyweight</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>></span> <span class=special>></span> <span class=identifier>v</span><span class=special>;</span>
<span class=keyword>int</span> <span class=identifier>main</span><span class=special>()</span>
<span class=special>{</span>
<span class=comment>// use v</span>
<span class=special>}</span>
</pre></blockquote>
<p>
In some environments, the program above fails when exiting. For instance, if run
from Microsoft Visual C++ environment in debug mode, a breakpoint is triggered
at termination time and the debug output window shows a message along the following:
</p>
<blockquote><pre>
HEAP[test.exe]: HEAP: Free Heap block 3a6488 modified at 3a6650 after it was
freed
Windows has triggered a breakpoint in test.exe.
This may be due to a corruption of the heap, and indicates a bug in test.exe
or any of the DLLs it has loaded.
The output window may have more diagnostic information
</pre></blockquote>
<p>
What is the problem? Although the type of <code>v</code> involves
<code>flyweight<std::string></code>, constructing <code>v</code> as an empty vector
need not create any flyweight object proper; so,
it is perfectly possible that the static initialization of
<code>flyweight<std::string></code> happens <i>after</i> the construction
of <code>v</code>; when this is the case, the static destruction of
the associated factory will occur <i>before</i> <code>v</code>'s
destruction, leaving the vector with dangling flyweights.
Again, the solution consists in explicitly forcing the static instantiation
of <code>flyweight<std::string></code> before <code>v</code> is
created. Here, calling
the function <code>flyweight<std::string>::init</code> is a little
cumbersome, so we can resort to the utility type
<code>flyweight<std::string>::initializer</code> to do that job for us:
</p>
<blockquote><pre>
<span class=comment>// equivalent to calling flyweight<std::string>::init()</span>
<b><span class=keyword>static</span> <span class=identifier>flyweight</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>>::</span><span class=identifier>initializer</span> <span class=identifier>fwinit</span><span class=special>;</span></b>
<span class=keyword>static</span> <span class=identifier>std</span><span class=special>::</span><span class=identifier>vector</span><span class=special><</span><span class=identifier>flyweight</span><span class=special><</span><span class=identifier>std</span><span class=special>::</span><span class=identifier>string</span><span class=special>></span> <span class=special>></span> <span class=identifier>v</span><span class=special>;</span>
<span class=keyword>int</span> <span class=identifier>main</span><span class=special>()</span>
<span class=special>{</span>
<span class=comment>// use v; no dangling flyweights at termination now</span>
<span class=special>}</span>
</pre></blockquote>
<hr>
<div class="prev_link"><a href="extension.html"><img src="../prev.gif" alt="extending Boost.Flyweight" border="0"><br>
Extending Boost.Flyweight
</a></div>
<div class="up_link"><a href="index.html"><img src="../up.gif" alt="Boost.Flyweight tutorial" border="0"><br>
Boost.Flyweight tutorial
</a></div>
<div class="next_link"><a href="lambda_expressions.html"><img src="../next.gif" alt="annex: MPL lambda expressions" border="0"><br>
Annex: MPL lambda expressions
</a></div><br clear="all" style="clear: all;">
<br>
<p>Revised Octber 16th 2010</p>
Distributed under the Boost Software
LICENSE_1_0.txt</a> or copy at <a href="path_to_url">
path_to_url
</p>
</body>
</html>
```
|
Štarnov () is a municipality and village in Olomouc District in the Olomouc Region of the Czech Republic. It has about 900 inhabitants.
Štarnov lies approximately north of Olomouc and east of Prague.
References
Villages in Olomouc District
|
```yaml
identifier: intel_adl_rvp
name: Alder Lake RVP
type: mcu
arch: x86
toolchain:
- zephyr
ram: 2048
supported:
- acpi
- smp
- watchdog
testing:
timeout_multiplier: 4
ignore_tags:
- net
- bluetooth
vendor: intel
```
|
Friedrich Moch (born 12 April 2000) is a German cross-country skier.
He participated in the pursuit event at the FIS Nordic World Ski Championships 2021.
Cross-country skiing results
All results are sourced from the International Ski Federation (FIS).
Olympic Games
Distance reduced to 30 km due to weather conditions.
World Championships
1 medal – (1 bronze)
World Cup
Season standings
Individual podiums
1 podium – (1 )
References
External links
2000 births
Living people
German male cross-country skiers
Cross-country skiers at the 2022 Winter Olympics
Olympic cross-country skiers for Germany
People from Memmingen
Sportspeople from Swabia (Bavaria)
Skiers from Bavaria
FIS Nordic World Ski Championships medalists in cross-country skiing
|
```ruby
# frozen_string_literal: true
class FixReblogsInFeeds < ActiveRecord::Migration[5.1]
def up
redis = RedisConfiguration.pool.checkout
fm = FeedManager.instance
# Old scheme:
# Each user's feed zset had a series of score:value entries,
# where "regular" statuses had the same score and value (their
# ID). Reblogs had a score of the reblogging status' ID, and a
# value of the reblogged status' ID.
# New scheme:
# The feed contains only entries with the same score and value.
# Reblogs result in the reblogging status being added to the
# feed, with an entry in a reblog tracking zset (where the score
# is once again set to the reblogging status' ID, and the value
# is set to the reblogged status' ID). This is safe for Redis'
# float conversion because in this reblog tracking zset, we only
# need the reblogging status' ID to be able to stop tracking
# entries after they have gotten too far down the feed, which
# does not require an exact value.
# This process reads all feeds and writes 3 times for each reblogs.
# So we use Lua script to avoid overhead between Ruby and Redis.
script = <<-LUA
local timeline_key = KEYS[1]
local reblog_key = KEYS[2]
-- So, first, we iterate over the user's feed to find any reblogs.
local items = redis.call('zrange', timeline_key, 0, -1, 'withscores')
for i = 1, #items, 2 do
local reblogged_id = items[i]
local reblogging_id = items[i + 1]
if (reblogged_id ~= reblogging_id) then
-- The score and value don't match, so this is a reblog.
-- (note that we're transitioning from IDs < 53 bits so we
-- don't have to worry about the loss of precision)
-- Remove the old entry
redis.call('zrem', timeline_key, reblogged_id)
-- Add a new one for the reblogging status
redis.call('zadd', timeline_key, reblogging_id, reblogging_id)
-- Track the fact that this was a reblog
redis.call('zadd', reblog_key, reblogging_id, reblogged_id)
end
end
LUA
script_hash = redis.script(:load, script)
# find_each is batched on the database side.
User.includes(:account).find_each do |user|
account = user.account
timeline_key = fm.key(:home, account.id)
reblog_key = fm.key(:home, account.id, 'reblogs')
redis.evalsha(script_hash, [timeline_key, reblog_key])
end
end
def down
# We *deliberately* do nothing here. This means that reverting
# this and the associated changes to the FeedManager code could
# allow one superfluous reblog of any given status, but in the case
# where things have gone wrong and a revert is necessary, this
# appears preferable to requiring a database hit for every status
# in every users' feed simply to revert.
# Note that this is operating under the assumption that entries
# with >53-bit IDs have already been entered. Otherwise, we could
# just use the data in Redis to reverse this transition.
end
end
```
|
Mostafa Salehi Nejad is an Iranian football player who currently plays for Paykan in Iran's Premier Football League.
Club career
Club career statistics
Last Update 19 October 2010
Assist Goals
External links
Persian League Profile
Iranian men's footballers
Men's association football midfielders
Zob Ahan Esfahan F.C. players
Persian Gulf Pro League players
Footballers from Isfahan
Living people
1981 births
|
David Ekerot (born 1 February 1970) is a former professional tennis player from Sweden. He enjoyed most of his tennis success while playing doubles. During his career he won 2 doubles titles. He achieved a career-high doubles ranking of world No. 52 in 1997.
After his tennis career he became a musician. His most known songs are The Full Life and Burning Books.
Career finals
Doubles (2 titles, 1 runner-up)
External links
Swedish male tennis players
Sportspeople from Lund
1970 births
Living people
Swedish male musicians
|
Myra K. Wolfgang (May 1914 – April 1976) was a labor leader and women's rights activist in Detroit from the 1930s through the 1970s. She was most active in the labor movement, advocating for the working poor and for women in the workforce.
Early life and family
Myra (Komaroff) Wolfgang was born in Montreal, Quebec, Canada in May 1914 to Jewish Eastern European Immigrants. Her parents, Abraham and Ida Komaroff, raised her and her two siblings in a politically liberal environment that valued independent thinking and their Jewish culture. Her parents did not emphasize religion, and chose to marry in Montreal's labor temple rather than a synagogue. Wolfgang was often quoted as saying she was "a union-made union maid."
In 1915, the family moved to Detroit, where her father started a business selling real estate. After World War I he opened an office in downtown Detroit and the family moved to a larger home on Westminster Avenue. After making her way through the Detroit school system, Myra went to study commercial art and interior design at the Carnegie Institute of Technology. One year later, the Great Depression hit. This made continuing her education impossible. In the summer of 1932, Wolfgang returned to Detroit to live with her family.
Early career
In 1932, while looking for work, Wolfgang became involved at Detroit's Local 705 of the then Detroit Waiters Union. She was hired the same day, working for Louis Koenig, secretary-treasurer of the Local 705, as a receptionist. Koenig noticed her enthusiasm for the job, began to instruct her in union history and procedures, and called her "my protégée."
In 1934, Wolfgang was elected to Local 705's executive board as its recording secretary. In 1936 Governor Frank Murphy recognized her for her efficient oversight of Local 705 and appointed her to the Domestic and Personal Service Department of the Michigan Employment Security Commission. In 1937, Wolfgang helped organize and participated in a successful sit-down strike at the F.W. Woolworth five-and-dime store in Detroit. This was the first store and public building strike.
Later career
In the 1940s and '50s, Wolfgang ran the Detroit Joint Council and became vice president of the Hotel Employees & Restaurant Employees International Union. After Koenig retired, Wolfgang became the Secretary Treasurer and chief executive officer of Local 705. She was active in the enactment of the 1966 Michigan minimum wage law, which required employers to pay each employee a minimum $1 an hour.
In 1974, Wolfgang chaired and was integral of the organization of the Coalition of Labor Union Women (CLUW). More than 3,000 women came to its first meeting from over 82 labor unions across the United States. The CLUW focused on helping women become leaders in their own unions by instructing them on how to present issues and craft arguments during contract talks. Wolfgang was also a lifelong member of the National Association for the Advancement of Colored People (NAACP) and insisted on racially integrated crews created by her union's hiring hall.
Death and legacy
Just before her 62nd birthday, Wolfgang died in April 1976 from a brain tumor. Nicknamed the "Battling Belle of Detroit" by Detroit's local media and championed as "the most important woman unionist in the country" by the Detroit Free Press, she devoted her entire life to the labor and women's rights movements, continuously pushing for the rights of the working class.
Archival collections
The Myra Wolfgang Papers are held by the Walter P. Reuther Library of Labor and Urban Affairs at Wayne State University. The collection contains .25 linear feet of records relating to her work for the hotel, Motel, and Restaurant Employees Union and her involvement in the women's rights movement.
The Walter P. Reuther Library also holds the Coalition of Labor Union Women Records, which contains 88 linear feet of material documenting the group's activities from 1972 to 2001.
References
Further reading
finding aid for the Myra Wolfgang Papers, Wayne State University, Detroit. Retrieved July 24, 2015.
1914 births
1976 deaths
Labor rights
American women's rights activists
Activists from Detroit
American trade unionists
American trade union leaders
20th-century American Jews
Canadian emigrants to the United States
|
```c++
#include "PythonEditorStyle.h"
#include "EditorStyleSet.h"
#include "SlateCore.h"
#include "Runtime/SlateCore/Public/Styling/SlateStyle.h"
#include "Runtime/Projects/Public/Interfaces/IPluginManager.h"
TSharedPtr< FSlateStyleSet > FPythonEditorStyle::StyleSet = nullptr;
#define IMAGE_BRUSH( RelativePath, ... ) FSlateImageBrush( StyleSet->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define BOX_BRUSH( RelativePath, ... ) FSlateBoxBrush( StyleSet->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define BORDER_BRUSH( RelativePath, ... ) FSlateBorderBrush( StyleSet->RootToContentDir( RelativePath, TEXT(".png") ), __VA_ARGS__ )
#define TTF_FONT( RelativePath, ... ) FSlateFontInfo( StyleSet->RootToContentDir( RelativePath, TEXT(".ttf") ), __VA_ARGS__ )
#define OTF_FONT( RelativePath, ... ) FSlateFontInfo( StyleSet->RootToContentDir( RelativePath, TEXT(".otf") ), __VA_ARGS__ )
// Const icon sizes
static const FVector2D Icon8x8(8.0f, 8.0f);
static const FVector2D Icon9x19(9.0f, 19.0f);
static const FVector2D Icon16x16(16.0f, 16.0f);
static const FVector2D Icon20x20(20.0f, 20.0f);
static const FVector2D Icon22x22(22.0f, 22.0f);
static const FVector2D Icon24x24(24.0f, 24.0f);
static const FVector2D Icon28x28(28.0f, 28.0f);
static const FVector2D Icon27x31(27.0f, 31.0f);
static const FVector2D Icon26x26(26.0f, 26.0f);
static const FVector2D Icon32x32(32.0f, 32.0f);
static const FVector2D Icon40x40(40.0f, 40.0f);
static const FVector2D Icon48x48(48.0f, 48.0f);
static const FVector2D Icon75x82(75.0f, 82.0f);
static const FVector2D Icon360x32(360.0f, 32.0f);
static const FVector2D Icon171x39(171.0f, 39.0f);
static const FVector2D Icon170x50(170.0f, 50.0f);
static const FVector2D Icon267x140(170.0f, 50.0f);
void FPythonEditorStyle::Initialize()
{
// Only register once
if (StyleSet.IsValid())
{
return;
}
StyleSet = MakeShareable(new FSlateStyleSet("PythonEditor"));
StyleSet->SetContentRoot(IPluginManager::Get().FindPlugin("UnrealEnginePython")->GetBaseDir() / TEXT("Resources"));
// Icons
{
StyleSet->Set("PythonEditor.TabIcon", new IMAGE_BRUSH("UI/PythonEditor_16x", Icon16x16));
StyleSet->Set("PythonEditor.New", new IMAGE_BRUSH("UI/GenericFile", Icon40x40));
StyleSet->Set("PythonEditor.NewDirectory", new IMAGE_BRUSH("UI/GenericFile", Icon40x40));
StyleSet->Set("PythonEditor.New.Small", new IMAGE_BRUSH("UI/GenericFile", Icon16x16));
StyleSet->Set("PythonEditor.Delete", new IMAGE_BRUSH("UI/DeleteFile", Icon40x40));
StyleSet->Set("PythonEditor.Delete.Small", new IMAGE_BRUSH("UI/DeleteFile", Icon16x16));
StyleSet->Set("PythonEditor.Save", new IMAGE_BRUSH("UI/Save_40x", Icon40x40));
StyleSet->Set("PythonEditor.Save.Small", new IMAGE_BRUSH("UI/Save_40x", Icon16x16));
StyleSet->Set("PythonEditor.SaveAll", new IMAGE_BRUSH("UI/SaveAll_40x", Icon40x40));
StyleSet->Set("PythonEditor.SaveAll.Small", new IMAGE_BRUSH("UI/SaveAll_40x", Icon16x16));
StyleSet->Set("PythonEditor.Execute", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40));
StyleSet->Set("PythonEditor.Execute.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16));
StyleSet->Set("PythonEditor.ExecuteInMainThread", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40));
StyleSet->Set("PythonEditor.ExecuteInMainThread.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16));
StyleSet->Set("PythonEditor.PEP8ize", new IMAGE_BRUSH("UI/Excute_x40", Icon40x40));
StyleSet->Set("PythonEditor.PEP8ize.Small", new IMAGE_BRUSH("UI/Excute_x40", Icon16x16));
}
const FSlateFontInfo Consolas10 = TTF_FONT("Font/DroidSansMono", 9);
const FTextBlockStyle NormalText = FTextBlockStyle()
.SetFont(Consolas10)
.SetColorAndOpacity(FLinearColor::White)
.SetShadowOffset(FVector2D::ZeroVector)
.SetShadowColorAndOpacity(FLinearColor::Black)
.SetHighlightColor(FLinearColor(0.02f, 0.3f, 0.0f))
.SetHighlightShape(BOX_BRUSH("UI/TextBlockHighlightShape", FMargin(3.f / 8.f)));
// Text editor
{
StyleSet->Set("TextEditor.NormalText", NormalText);
StyleSet->Set("SyntaxHighlight.PY.Normal", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffffffff))));// yellow
StyleSet->Set("SyntaxHighlight.PY.Operator", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xfff92672)))); // light grey
StyleSet->Set("SyntaxHighlight.PY.Keyword", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xfff92672)))); // blue
StyleSet->Set("SyntaxHighlight.PY.String", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffe6db74)))); // pinkish
StyleSet->Set("SyntaxHighlight.PY.Number", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffae81dd)))); // cyan
StyleSet->Set("SyntaxHighlight.PY.Comment", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff75715e)))); // green
StyleSet->Set("SyntaxHighlight.PY.BuiltIn", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xff52d9ef)))); // light grey
StyleSet->Set("SyntaxHighlight.PY.Define", FTextBlockStyle(NormalText).SetColorAndOpacity(FLinearColor(FColor(0xffa6e22a)))); // light grey
StyleSet->Set("TextEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f / 16.0f), FLinearColor(0.02f, 0.02f, 0.02f, 1)));
const FEditableTextBoxStyle EditableTextBoxStyle = FEditableTextBoxStyle()
.SetBackgroundImageNormal(FSlateNoResource())
.SetBackgroundImageHovered(FSlateNoResource())
.SetBackgroundImageFocused(FSlateNoResource())
.SetBackgroundImageReadOnly(FSlateNoResource());
StyleSet->Set("TextEditor.EditableTextBox", EditableTextBoxStyle);
}
// Project editor
{
StyleSet->Set("ProjectEditor.Border", new BOX_BRUSH("UI/TextEditorBorder", FMargin(4.0f / 16.0f), FLinearColor(0.048f, 0.048f, 0.048f, 1)));
StyleSet->Set("ProjectEditor.Icon.Project", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f, 0.25f, 0.25f, 1)));
StyleSet->Set("ProjectEditor.Icon.Folder", new IMAGE_BRUSH("UI/FolderClosed", Icon16x16, FLinearColor(0.25f, 0.25f, 0.25f, 1)));
StyleSet->Set("ProjectEditor.Icon.File", new IMAGE_BRUSH("UI/PythonEditor_16x", Icon16x16));
StyleSet->Set("ProjectEditor.Icon.GenericFile", new IMAGE_BRUSH("UI/GenericFile", Icon16x16));
}
FSlateStyleRegistry::RegisterSlateStyle(*StyleSet.Get());
}
#undef IMAGE_BRUSH
#undef BOX_BRUSH
#undef BORDER_BRUSH
#undef TTF_FONT
#undef OTF_FONT
void FPythonEditorStyle::Shutdown()
{
if (StyleSet.IsValid())
{
FSlateStyleRegistry::UnRegisterSlateStyle(*StyleSet.Get());
ensure(StyleSet.IsUnique());
StyleSet.Reset();
}
}
const ISlateStyle& FPythonEditorStyle::Get()
{
return *(StyleSet.Get());
}
const FName& FPythonEditorStyle::GetStyleSetName()
{
return StyleSet->GetStyleSetName();
}
```
|
```yaml
---
parsed_sample:
- name: "Chassis"
descr: "Nexus9000 C9396PX Chassis"
pid: "N9K-C9396PX"
vid: "V02"
sn: "SAL1819S6LU"
- name: "Slot 1"
descr: "1/10G SFP+ Ethernet Module"
pid: "N9K-C9396PX"
vid: "V02"
sn: "SAL1819S6LU"
- name: "Slot 2"
descr: "40G Ethernet Expansion Module"
pid: "N9K-M12PQ"
vid: "V01"
sn: "SAL1815QCJE"
- name: "Power Supply 1"
descr: "Nexus9000 C9396PX Chassis Power Supply"
pid: "N9K-PAC-650W"
vid: "V01"
sn: "DCB1809X07E"
- name: "Power Supply 2"
descr: "Nexus9000 C9396PX Chassis Power Supply"
pid: "N9K-PAC-650W"
vid: "V01"
sn: "DCB1809X07H"
- name: "Fan 1"
descr: "Nexus9000 C9396PX Chassis Fan Module"
pid: "N9K-C9300-FAN2"
vid: "V01"
sn: "N/A"
- name: "Fan 2"
descr: "Nexus9000 C9396PX Chassis Fan Module"
pid: "N9K-C9300-FAN2"
vid: "V01"
sn: "N/A"
- name: "Fan 3"
descr: "Nexus9000 C9396PX Chassis Fan Module"
pid: "N9K-C9300-FAN2"
vid: "V01"
sn: "N/A"
- name: "Slot 33"
descr: "Nexus7000 C7009 (9 Slot) Chassis Power Supply"
pid: "N7K-AC-6.0KW"
vid: "V01"
sn: "DTM141600XT"
- name: "Slot 34"
descr: "Nexus7000 C7009 (9 Slot) Chassis Power Supply"
pid: "N7K-AC-6.0KW"
vid: "V01"
sn: "DTM1414007T"
- name: "Slot 35"
descr: "Nexus7000 C7009 (9 Slot) Chassis Fan Module"
pid: "N7K-C7009-FAN"
vid: "V00"
sn: "JAF1433DDEJ"
- name: "Ethernet1/46"
descr: "CISCO-AVAGO"
pid: "10Gbase-SR"
vid: "SFBR-709SMZ-CS1"
sn: "AVD42309ABD"
- name: "Ethernet1/47"
descr: "CISCO"
pid: "1000base-LH"
vid: "RTXM191-404-C88"
sn: "ACW315000AD"
- name: "Ethernet1/48"
descr: "CISCO-AVAGO"
pid: "10Gbase-LR"
vid: "SFCT-739SMZ"
sn: "AVD2219K9AO"
```
|
```objective-c
//===--- IncludeStyle.h - Style of C++ #include directives -------*- C++-*-===//
//
// See path_to_url for license information.
//
//===your_sha256_hash------===//
#ifndef LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
#define LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
#include "llvm/Support/YAMLTraits.h"
#include <string>
#include <vector>
namespace clang {
namespace tooling {
/// Style for sorting and grouping C++ #include directives.
struct IncludeStyle {
/// Styles for sorting multiple ``#include`` blocks.
enum IncludeBlocksStyle {
/// Sort each ``#include`` block separately.
/// \code
/// #include "b.h" into #include "b.h"
///
/// #include <lib/main.h> #include "a.h"
/// #include "a.h" #include <lib/main.h>
/// \endcode
IBS_Preserve,
/// Merge multiple ``#include`` blocks together and sort as one.
/// \code
/// #include "b.h" into #include "a.h"
/// #include "b.h"
/// #include <lib/main.h> #include <lib/main.h>
/// #include "a.h"
/// \endcode
IBS_Merge,
/// Merge multiple ``#include`` blocks together and sort as one.
/// Then split into groups based on category priority. See
/// ``IncludeCategories``.
/// \code
/// #include "b.h" into #include "a.h"
/// #include "b.h"
/// #include <lib/main.h>
/// #include "a.h" #include <lib/main.h>
/// \endcode
IBS_Regroup,
};
/// Dependent on the value, multiple ``#include`` blocks can be sorted
/// as one and divided based on category.
/// \version 6
IncludeBlocksStyle IncludeBlocks;
/// See documentation of ``IncludeCategories``.
struct IncludeCategory {
/// The regular expression that this category matches.
std::string Regex;
/// The priority to assign to this category.
int Priority;
/// The custom priority to sort before grouping.
int SortPriority;
/// If the regular expression is case sensitive.
bool RegexIsCaseSensitive;
bool operator==(const IncludeCategory &Other) const {
return Regex == Other.Regex && Priority == Other.Priority &&
RegexIsCaseSensitive == Other.RegexIsCaseSensitive;
}
};
/// Regular expressions denoting the different ``#include`` categories
/// used for ordering ``#includes``.
///
/// `POSIX extended
/// <path_to_url`_
/// regular expressions are supported.
///
/// These regular expressions are matched against the filename of an include
/// (including the <> or "") in order. The value belonging to the first
/// matching regular expression is assigned and ``#includes`` are sorted first
/// according to increasing category number and then alphabetically within
/// each category.
///
/// If none of the regular expressions match, INT_MAX is assigned as
/// category. The main header for a source file automatically gets category 0.
/// so that it is generally kept at the beginning of the ``#includes``
/// (path_to_url#include-style). However, you
/// can also assign negative priorities if you have certain headers that
/// always need to be first.
///
/// There is a third and optional field ``SortPriority`` which can used while
/// ``IncludeBlocks = IBS_Regroup`` to define the priority in which
/// ``#includes`` should be ordered. The value of ``Priority`` defines the
/// order of ``#include blocks`` and also allows the grouping of ``#includes``
/// of different priority. ``SortPriority`` is set to the value of
/// ``Priority`` as default if it is not assigned.
///
/// Each regular expression can be marked as case sensitive with the field
/// ``CaseSensitive``, per default it is not.
///
/// To configure this in the .clang-format file, use:
/// \code{.yaml}
/// IncludeCategories:
/// - Regex: '^"(llvm|llvm-c|clang|clang-c)/'
/// Priority: 2
/// SortPriority: 2
/// CaseSensitive: true
/// - Regex: '^((<|")(gtest|gmock|isl|json)/)'
/// Priority: 3
/// - Regex: '<[[:alnum:].]+>'
/// Priority: 4
/// - Regex: '.*'
/// Priority: 1
/// SortPriority: 0
/// \endcode
/// \version 3.8
std::vector<IncludeCategory> IncludeCategories;
/// Specify a regular expression of suffixes that are allowed in the
/// file-to-main-include mapping.
///
/// When guessing whether a #include is the "main" include (to assign
/// category 0, see above), use this regex of allowed suffixes to the header
/// stem. A partial match is done, so that:
/// - "" means "arbitrary suffix"
/// - "$" means "no suffix"
///
/// For example, if configured to "(_test)?$", then a header a.h would be seen
/// as the "main" include in both a.cc and a_test.cc.
/// \version 3.9
std::string IncludeIsMainRegex;
/// Specify a regular expression for files being formatted
/// that are allowed to be considered "main" in the
/// file-to-main-include mapping.
///
/// By default, clang-format considers files as "main" only when they end
/// with: ``.c``, ``.cc``, ``.cpp``, ``.c++``, ``.cxx``, ``.m`` or ``.mm``
/// extensions.
/// For these files a guessing of "main" include takes place
/// (to assign category 0, see above). This config option allows for
/// additional suffixes and extensions for files to be considered as "main".
///
/// For example, if this option is configured to ``(Impl\.hpp)$``,
/// then a file ``ClassImpl.hpp`` is considered "main" (in addition to
/// ``Class.c``, ``Class.cc``, ``Class.cpp`` and so on) and "main
/// include file" logic will be executed (with *IncludeIsMainRegex* setting
/// also being respected in later phase). Without this option set,
/// ``ClassImpl.hpp`` would not have the main include file put on top
/// before any other include.
/// \version 10
std::string IncludeIsMainSourceRegex;
};
} // namespace tooling
} // namespace clang
LLVM_YAML_IS_SEQUENCE_VECTOR(clang::tooling::IncludeStyle::IncludeCategory)
namespace llvm {
namespace yaml {
template <>
struct MappingTraits<clang::tooling::IncludeStyle::IncludeCategory> {
static void mapping(IO &IO,
clang::tooling::IncludeStyle::IncludeCategory &Category);
};
template <>
struct ScalarEnumerationTraits<
clang::tooling::IncludeStyle::IncludeBlocksStyle> {
static void
enumeration(IO &IO, clang::tooling::IncludeStyle::IncludeBlocksStyle &Value);
};
} // namespace yaml
} // namespace llvm
#endif // LLVM_CLANG_TOOLING_INCLUSIONS_INCLUDESTYLE_H
```
|
```xml
/**
* This Api class lets you define an API endpoint and methods to request
* data and process it.
*
* See the [Backend API Integration](path_to_url
* documentation for more details.
*/
import { ApisauceInstance, create } from "apisauce"
import Config from "../../config"
import type { ApiConfig } from "./api.types"
/**
* Configuring the apisauce instance.
*/
export const DEFAULT_API_CONFIG: ApiConfig = {
url: Config.API_URL,
timeout: 10000,
}
/**
* Manages all requests to the API. You can use this class to build out
* various requests that you need to call from your backend API.
*/
export class Api {
apisauce: ApisauceInstance
config: ApiConfig
/**
* Set up our API instance. Keep this lightweight!
*/
constructor(config: ApiConfig = DEFAULT_API_CONFIG) {
this.config = config
this.apisauce = create({
baseURL: this.config.url,
timeout: this.config.timeout,
headers: {
Accept: "application/json",
},
})
}
}
// Singleton instance of the API for convenience
export const api = new Api()
```
|
Barry Stewart (6 May 1940 – 23 July 1975) was an Australian cricketer. He played one first-class match for Tasmania in 1968/69.
See also
List of Tasmanian representative cricketers
References
External links
1940 births
1975 deaths
Australian cricketers
Tasmania cricketers
Cricketers from Tasmania
People from Wynyard, Tasmania
|
National Highway 60 or NH 60 is a National Highway of India that runs from the junction with NH 5 at Balasore to junction with NH 34 at Morgram. It passes through Jaleswar, Dantan, Belda, Narayangarh, Kharagpur, Medinipur, Salboni, Chandrakona Road Durllabhganj, Bishnupur, Bankura, Gangajalghati, Mejia and Raniganj, Pandaveshwar, Dubrajpur, Suri, Mohammad Bazar, Mallarpur, Rampurhat, Nalhati.
The Sheoraphuli–Kamarkundu–Tarakeswar–Arambagh Road meets NH 60 at Bishnupur. It meets and mixes up with the Bankura–Jhargram Road (State Highway 9) at Dhaldanga up to Bikna. Total length of NH 60 is out of which is in Odisha and is in West Bengal.
See also
List of National Highways in India
List of National Highways in India (by Highway Number)
National Highways Development Project
References
External links
60
60
60
National highways in India (old numbering)
Transport in Birbhum district
Transport in Balasore
|
```ruby
class Nanomsgxx < Formula
desc "Nanomsg binding for C++11"
homepage "path_to_url"
url "path_to_url"
sha256 your_sha256_hash
license "MIT"
revision 3
bottle do
sha256 cellar: :any, arm64_sonoma: your_sha256_hash
sha256 cellar: :any, arm64_ventura: your_sha256_hash
sha256 cellar: :any, arm64_monterey: your_sha256_hash
sha256 cellar: :any, arm64_big_sur: your_sha256_hash
sha256 cellar: :any, sonoma: your_sha256_hash
sha256 cellar: :any, ventura: your_sha256_hash
sha256 cellar: :any, monterey: your_sha256_hash
sha256 cellar: :any, big_sur: your_sha256_hash
sha256 cellar: :any, catalina: your_sha256_hash
sha256 cellar: :any_skip_relocation, x86_64_linux: your_sha256_hash
end
depends_on "pkg-config" => :build
depends_on "nanomsg"
uses_from_macos "python" => :build
# Add python3 support
#
# This patch mimics changes from path_to_url
# but can't be applied as a formula patch since it contains GIT binary patch
#
# Remove this in next release
resource "waf" do
url "path_to_url"
sha256 your_sha256_hash
end
patch do
url "path_to_url"
sha256 your_sha256_hash
end
# Add support for newer version of waf
patch do
url "path_to_url"
sha256 your_sha256_hash
end
def install
resource("waf").stage buildpath
chmod 0755, "waf"
args = %W[
--static
--shared
--prefix=#{prefix}
]
system "python3", "./waf", "configure", *args
system "python3", "./waf", "build"
system "python3", "./waf", "install"
end
test do
(testpath/"test.cpp").write <<~EOS
#include <iostream>
#include <nnxx/message.h>
#include <nnxx/pair.h>
#include <nnxx/socket.h>
int main() {
nnxx::socket s1 { nnxx::SP, nnxx::PAIR };
nnxx::socket s2 { nnxx::SP, nnxx::PAIR };
const char *addr = "inproc://example";
s1.bind(addr);
s2.connect(addr);
s1.send("Hello Nanomsgxx!");
nnxx::message msg = s2.recv();
std::cout << msg << std::endl;
return 0;
}
EOS
system ENV.cxx, "-std=c++11", "test.cpp", "-L#{lib}", "-lnnxx"
assert_equal "Hello Nanomsgxx!\n", shell_output("#{testpath}/a.out")
end
end
```
|
Fernand Lamy (8 April 1881 – 18 September 1966) was a French composer, music teacher, conductor and choral conductor.
Life
Born in Chauvigny, Lamy was a disciple and friend of Guy Ropartz. He has written reference works on this composer. He has notably collaborated in the review L'Harmonie du monde. He started his career working on military music. He was later choir conductor and then conductor of the Théâtre des Champs-Élysées. He conducted Russian ballets and worked with Gabriel Astruc. He then worked at the Valenciennes conservatory, of which he was the director, and founded in particular the Association des concerts symphoniques and the Société de musique de chambre. His students include Robert Lannoy, Jean Bertrand and Roberto Benzi. His son is the pianist and organist Jacques Lamy.
References
External links
1881 births
1966 deaths
People from Vienne
20th-century French composers
French male conductors (music)
French choral conductors
French music educators
French male musicians
20th-century French conductors (music)
20th-century French male musicians
|
Sebastian Feiersinger (5 May 1913, in Kirchbichl – 2 September 1984, in Nuremberg) was an Austrian operatic tenor, particularly associated with the German repertory.
He studied at the Vienna Music Academy with Hans Duhan and Josef von Manowarda. He made his debut in Heilbronn in 1939, and then played in Gablonz (1940–41), Saarbrücken (1941–43), then the war interrupted his career which he resumed in Salzburg (1945–47) and Innsbruck (1947–49), he returned to Saarbrücken (1949–51), then went on to Wiesbaden (1951–53), Graz (1953–54), and finally joined the Nuremberg Opera in 1954, where he remained until 1975.
During the 1958–59 season he made his debut at both the San Francisco Opera in the title role of Tannhäuser, and at the Metropolitan Opera in New York, as Walther in Die Meistersinger von Nürnberg, to considerable acclaim, and in 1963 at the Lyric Opera of Chicago as Tristan in Tristan und Isolde.
He also appeared at La Scala in Milan, the Paris Opéra, the Vienna State Opera, the Zurich Opera, the Monte Carlo Opera, La Monnaie in Brussels, the San Carlo in Naples, etc. Other notable roles included; Florestan, Max, Huon, Siegmund, Aegisth, The Emperor, he was also admired in some Italian roles notably Riccardo, Radames, Otello, Canio, Cavaradossi, and also enjoyed success in French roles such as Faust and Hofffmann.
Feiersinger sang character roles at the Staatstheater am Gärtnerplatz in Munich beginning in 1972 until his retirement in 1976.
Selected recording
1952 – Puccini – Le Villi – Maud Cunitz, Sebastian Feiersinger, Kurt Gester – Frankfurt Radio Chorus and Orchestra, Paul Schmidtz – Walhall (sung in German)
1953 – Janáček – Jenůfa – Trude Eipperle, Aga Joesten, Franz Fehringer, Sebastian Feiersinger – Frankfurt Radio Chorus and Orchestra, Paul Schmidtz – Walhall (sung in German)
1955 – Verdi – Un ballo in maschera – Birgit Nilsson, Sebastian Feiersinger, Josef Metternich, Jean Madeira, Erika Koth – Bavarian Radio Chorus and Orchestra, Alberto Erede – Walhall (sung in German)
Sources
Operissimo.com
1913 births
1984 deaths
People from Kufstein District
Austrian operatic tenors
University of Music and Performing Arts Vienna alumni
20th-century Austrian male opera singers
|
```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 org.flowable.bpmn.model;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
class FlowableListenerTest {
@Test
public void testCloneScriptInfo() {
FlowableListener original = new FlowableListener();
ScriptInfo scriptInfo = new ScriptInfo();
scriptInfo.setLanguage("language");
scriptInfo.setResultVariable("foo");
scriptInfo.setScript("script");
original.setScriptInfo(scriptInfo);
FlowableListener clone = original.clone();
assertThat(clone).isNotSameAs(original);
assertThat(clone.getScriptInfo()).isNotSameAs(scriptInfo);
assertThat(clone).usingRecursiveComparison().isEqualTo(original);
}
}
```
|
```c++
// 2018 and later: Unicode, Inc. and others.
#include "unicode/utypes.h"
#if !UCONFIG_NO_FORMATTING
// Allow implicit conversion from char16_t* to UnicodeString for this file:
// Helpful in toString methods and elsewhere.
#define UNISTR_FROM_STRING_EXPLICIT
#include "number_decnum.h"
#include "number_types.h"
#include "number_multiplier.h"
#include "numparse_validators.h"
#include "number_utils.h"
#include "decNumber.h"
using namespace icu;
using namespace icu::number;
using namespace icu::number::impl;
using namespace icu::numparse::impl;
Scale::Scale(int32_t magnitude, DecNum* arbitraryToAdopt)
: fMagnitude(magnitude), fArbitrary(arbitraryToAdopt), fError(U_ZERO_ERROR) {
if (fArbitrary != nullptr) {
// Attempt to convert the DecNum to a magnitude multiplier.
fArbitrary->normalize();
if (fArbitrary->getRawDecNumber()->digits == 1 && fArbitrary->getRawDecNumber()->lsu[0] == 1 &&
!fArbitrary->isNegative()) {
// Success!
fMagnitude += fArbitrary->getRawDecNumber()->exponent;
delete fArbitrary;
fArbitrary = nullptr;
}
}
}
Scale::Scale(const Scale& other)
: fMagnitude(other.fMagnitude), fArbitrary(nullptr), fError(other.fError) {
if (other.fArbitrary != nullptr) {
UErrorCode localStatus = U_ZERO_ERROR;
fArbitrary = new DecNum(*other.fArbitrary, localStatus);
}
}
Scale& Scale::operator=(const Scale& other) {
if (this == &other) { return *this; } // self-assignment: no-op
fMagnitude = other.fMagnitude;
if (other.fArbitrary != nullptr) {
UErrorCode localStatus = U_ZERO_ERROR;
fArbitrary = new DecNum(*other.fArbitrary, localStatus);
} else {
fArbitrary = nullptr;
}
fError = other.fError;
return *this;
}
Scale::Scale(Scale&& src) noexcept
: fMagnitude(src.fMagnitude), fArbitrary(src.fArbitrary), fError(src.fError) {
// Take ownership away from src if necessary
src.fArbitrary = nullptr;
}
Scale& Scale::operator=(Scale&& src) noexcept {
fMagnitude = src.fMagnitude;
delete fArbitrary;
fArbitrary = src.fArbitrary;
fError = src.fError;
// Take ownership away from src if necessary
src.fArbitrary = nullptr;
return *this;
}
Scale::~Scale() {
delete fArbitrary;
}
Scale Scale::none() {
return {0, nullptr};
}
Scale Scale::powerOfTen(int32_t power) {
return {power, nullptr};
}
Scale Scale::byDecimal(StringPiece multiplicand) {
UErrorCode localError = U_ZERO_ERROR;
LocalPointer<DecNum> decnum(new DecNum(), localError);
if (U_FAILURE(localError)) {
return {localError};
}
decnum->setTo(multiplicand, localError);
if (U_FAILURE(localError)) {
return {localError};
}
return {0, decnum.orphan()};
}
Scale Scale::byDouble(double multiplicand) {
UErrorCode localError = U_ZERO_ERROR;
LocalPointer<DecNum> decnum(new DecNum(), localError);
if (U_FAILURE(localError)) {
return {localError};
}
decnum->setTo(multiplicand, localError);
if (U_FAILURE(localError)) {
return {localError};
}
return {0, decnum.orphan()};
}
Scale Scale::byDoubleAndPowerOfTen(double multiplicand, int32_t power) {
UErrorCode localError = U_ZERO_ERROR;
LocalPointer<DecNum> decnum(new DecNum(), localError);
if (U_FAILURE(localError)) {
return {localError};
}
decnum->setTo(multiplicand, localError);
if (U_FAILURE(localError)) {
return {localError};
}
return {power, decnum.orphan()};
}
void Scale::applyTo(impl::DecimalQuantity& quantity) const {
quantity.adjustMagnitude(fMagnitude);
if (fArbitrary != nullptr) {
UErrorCode localStatus = U_ZERO_ERROR;
quantity.multiplyBy(*fArbitrary, localStatus);
}
}
void Scale::applyReciprocalTo(impl::DecimalQuantity& quantity) const {
quantity.adjustMagnitude(-fMagnitude);
if (fArbitrary != nullptr) {
UErrorCode localStatus = U_ZERO_ERROR;
quantity.divideBy(*fArbitrary, localStatus);
}
}
void
MultiplierFormatHandler::setAndChain(const Scale& multiplier, const MicroPropsGenerator* parent) {
fMultiplier = multiplier;
fParent = parent;
}
void MultiplierFormatHandler::processQuantity(DecimalQuantity& quantity, MicroProps& micros,
UErrorCode& status) const {
fParent->processQuantity(quantity, micros, status);
fMultiplier.applyTo(quantity);
}
#endif /* #if !UCONFIG_NO_FORMATTING */
```
|
Sophie Harmansdochter, also known as Gele Fye (1505 – 3 March 1562), was a Dutch woman who became notorious for informing on religious minorities, resulting in many deaths. She was eventually convicted of perjury, tortured and executed.
Harmansdochter was the daughter of Harman Hoen, an Anabaptist preacher from Zwolle. She followed him on his preaching tours until his execution in 1534. After encountering difficulties in securing her inheritance after her father's death, Harmansdochter became an informer for the mayor of Amsterdam. She married a burgher in Amsterdam in 1537. Harmansdochter's information led the arrest of Volckje Ward. This led to the arrests and executions of numerous Anabaptists, then considered heretics, in Amsterdam, Leiden, Friesland and Antwerp between 1552 and 1553.
After the death of her husband, Harmansdochter experienced financial problems. To make money, she attempted to implicate the mayor as a heretic. However, her scheme failed. She was arrested and convicted of perjury. After having her tongue cut out, she was executed by burning.
Harmansdochter has often been portrayed in Dutch literature.
References
Maarten Hell, Harmansdr., Sophie, in: Digitaal Vrouwenlexicon van Nederland. URL: http://resources.huygens.knaw.nl/vrouwenlexicon/lemmata/data/Harmansdr [13/01/2014]
1505 births
People from the Habsburg Netherlands
1562 deaths
16th-century executions
People executed by the Netherlands by burning
People of the Eighty Years' War
16th-century spies
|
Natalie Louise Blair (born 16 April 1984) is an Australian actress, best known for her role as Carmella Cammeniti on the Australian television soap opera drama series Neighbours.
Personal life
Blair was born to John Blair on 16 April 1984 and raised in Gold Coast, Queensland, Australia.
Career
Back in early 2003, Blair auditioned for Neighbours and impressed casting director Jan Russ, but she was not cast. Russ contacted Blair six months later and asked her to audition for the role of Carmella Cammeniti. She was cast on the spot as producers needed to fill the gap left by Delta Goodrem's sudden departure. Blair started filming just after she graduated from school.
In 2005, Blair won "Most Popular New Female Talent" at the 47th Annual Logie Awards. Blair was also nominated in 2007 for both the Gold and Silver Logie, for "Most Popular Personality on Australian Television". She was again nominated for both awards in 2008. Blair was crowned "Queen of Teen" at the Dolly Teen Choice Awards at Sydney's Luna Park in 2007.
In December 2007, Blair starred in the Spillers Ltd Production of Snow White and the Seven Dwarfs as Snow White at the Music Hall in Shrewsbury. Blair also sang solo and a cappella the first verse of "Once in Royal David's City" at the annual BBC Shropshire Carols in the Square event in Shrewsbury on 19 December 2007.
Blair left Neighbours after five years in 2009. She then moved to Los Angeles, but returned home later that year to play chief villain Connie Burns in the feature film Stage Fright. Upon completion of the film, also starring Clare Bowen and Jason Smith, Natalie left Queensland and returned to Los Angeles.
Blair returned to Neighbours in March 2011 for two episodes. Also in March 2011, Natalie began shooting the feature film The Sleeping Warrior, portraying the character of Safia. The film was set for release in 2012. A story that connects Hindu spirituality and Australian aboriginal spirituality.
In 2012, Blair returned to Melbourne, Australia to play the lead in the romantic comedy The Groomless Bride. The film also stars underworld figure Chopper Reid.
actor Beau Brady. The pair met on the set of Voodoo Lagoon in 2006 and quietly separated in January 2007, with their split being confirmed by a Neighbours spokeswoman. The pair reportedly split due to Brady's decision to move to Los Angeles to pursue his career.
Blair began a relationship with her Neighbours co-star David Hoflin in 2008. The pair currently live together in Los Angeles. On 10 March 2012, Fiona Byrne of the Herald Sun reported the couple were engaged. They were married on 4 January 2013 in Warburton, Victoria. Blair and Hoflin welcomed their first child, a son, on 29 July 2016.
Filmography
References
External links
1984 births
Actresses from Brisbane
Australian soap opera actresses
Living people
Logie Award winners
People educated at Lourdes Hill College
|
Hajia Bola Muinat Shagaya (10 October 1959) is a Nigerian businesswoman and fashion enthusiast. She is one of the richest women in Africa. She is the founder and CEO of Bolmus Group International, a conglomerate with holdings in real estate, oil and gas, banking and photography.
Biography
Hajia Bola Muinat Shagaya was born on 10 October 1959, she is the daughter of Adut Makur, a Sudanese seamstress, and Emenike Mobo, a Nigerian Public Servant. Bola Shagaya is known to have had her secondary school education at Queens School, Ilorin, and her tertiary education at Ahmadu Bello University, Zaria and Armstrong College in California, where she studied economics and accountancy.
She started her career with the audit department of the Central Bank of Nigeria before venturing into commercial activities in 1983. Her business experience started with the importation and distribution of photographic materials. She introduced the Konica brand of photographic materials into the Nigerian market and West Africa.
Hajia Bola Muinat Shagaya is also the managing director of Practoil Limited, one of the largest importers and distributors of base oil in Nigeria, serving local lubricant blending plants. Her business also includes investments in real estate, spanning across major cities in the country with over three hundred employees.
She is currently on the board of Unity Bank plc (formerly Intercity Bank) and has been for over eight years. She is also a member of the recently inaugurated Nepad Business Group – Nigeria. Hajia Bola Shagaya is a patron of the Fashion Designers Association of Nigeria (FADAN).
Money Laundering Investigation
Bola Muinat Shagaya is being investigated by Nigeria's Economic and Financial Crimes Commission, EFCC, for money laundering also involving Patience Jonathan, Nigeria's former firstlady.
Distinctions
July 2010: Member of the Order of the Niger (MON) awarded by the former President of the Federal Republic of Nigeria, Dr. Goodluck Ebele Jonathan (GCFR)
Private life
She is currently married to Alhaji Shagaya, a Kwara State-based transport mogul, and has six children. Sherif Shagaya, Hakeem Shagaya, Deeja Shagaya, Naieema Shagaya, Amaya Roberts Shagaya and Adeena Roberts Shagaya. Her children are dispersed across the world, most reputably growing the Real Estate empire in both Europe and the United States. Also involved in minor business and industry holdings across Asia and Australia.
References
External links
The Official Website of Bola Shagaya
1959 births
Living people
People from Ilorin
Ahmadu Bello University alumni
Members of the Order of the Federal Republic
20th-century Nigerian businesswomen
20th-century Nigerian businesspeople
21st-century Nigerian businesswomen
21st-century Nigerian businesspeople
Members of the Order of the Niger
Nigerian real estate businesspeople
|
The South African Railways Class of 1980 is a diesel-electric locomotive.
Beginning in August 1980, the South African Railways placed 101 Class General Motors Electro-Motive Division type SW1002 diesel-electric locomotives in service. In 1984, one Class locomotive was also built for the Bophuthatswana National Development Corporation for use at the Ga-Rankuwa Industrial Estate. Three more were placed in service by Iscor in Pretoria between 1986 and 1991, and another two by the Ithala Development Finance Corporation in KwaZulu-Natal in 1987.
Manufacturers
The Class type SW1002 diesel-electric locomotive was designed for the South African Railways (SAR) by General Motors Electro-Motive Division (GM-EMD) and all but one were built by General Motors South Africa (GMSA) in Port Elizabeth. The exception was the third type SW1002 locomotive to be built for Iscor in Pretoria which was delivered from in Argentina.
The 101 locomotives for the SAR were built in two batches on two orders. The first 50 were built between 1980 and 1982 and numbered in the range from to . Another 51 were built between 1982 and 1984 and numbered in the range from to . It is unclear why such an odd number of locomotives were ordered.
Apart from the SAR locomotives, several were also built for industry.
A single locomotive was built for the Bophuthatswana National Development Corporation (BNDC) in Ga-Rankuwa and delivered in 1984.
Two locomotives, which had been ordered by Iscor in Pretoria, were delivered in 1986, numbered and .
Two locomotives, which had been ordered by the Ithala Development Finance Corporation (IDFC) in KwaZulu-Natal, were delivered in 1987 and numbered 1 and 2.
The Argentinian-built locomotive was delivered to Iscor by GM-Astarsa in 1991 and numbered .
Class 36 series
The Class 36 locomotive group consists of two series, the General Electric (GE) Class and the GM-EMD Class . Both manufacturers also produced locomotives for the South African Classes 33, 34 and 35.
Service
South African Railways
Class locomotives are general purpose locomotives, equipped with two-station controls for bi-directional operation, which are used mainly for yard shunting and pickup work to service industrial customers. When placed in service, the SAR locomotives were initially distributed for service between the Western and Eastern Cape and the Eastern Transvaal Lowveld, but the Cape locomotives were later relocated to Natal, Gauteng, the North West Province and Limpopo.
On the Natal South Coast they were at one time employed in road work between Durban and Port Shepstone, working in pairs or in trios.
Industry
The three Iscor locomotives were later hired out to African Rail & Traction Services (ARTS), based in a workshop at the Iscor Pretoria works, and renumbered in the range from 21 to 23. ARTS has a fleet of about twenty locomotives which are used on hire contracts. By early 2002, ARTS locomotives were employed at the Rustenburg Platinum Mine in the North West Province, at Iscor in Pretoria where it took over the entire railway operation, and at the Richards Bay Coal Terminal in KwaZulu-Natal.
The BNDC locomotive did not remain in service in Bophuthatwana very long before it went to Columbus Stainless in Middelburg, Transvaal.
The IDFC locomotives were later sold to Sheltam, where they were numbered 24 and 25 and later renumbered to 1003 and 1004.
Works numbers
Apart from on their works plates, the builder’s works number was also stamped on their frames, but instead of the builder’s serial they used the last three digits of the unit’s number. No. 36-209 was therefore stamped 115-209 instead of 115-9. Some of these numbers were reverse stamped, for example as . Units so noted were numbers 234, 235, 240, 241 and 245-115 and numbers 251, 257 and 270-118.
The Class builder’s works numbers, dates or years built and the distribution of the non-SAR industrial locomotives are listed in the table. The dates, as shown, were recorded off the respective locomotive works plates.
Liveries
All the Class 36-200 locomotives were delivered in the SAR Gulf Red livery with signal red buffer beams, yellow side stripes on the long hood sides and a yellow V on each end. In the 1990s many of them began to be repainted in the Spoornet orange livery with a yellow and blue chevron pattern on the buffer beams. Several later received the Spoornet maroon livery. In the 2000s at least one was repainted in the Spoornet blue livery with outline numbers on the sides. After 2008 in the Transnet Freight Rail (TFR) era, some began to appear in the TFR red, green and yellow livery.
Illustration
References
3480
Bo-Bo locomotives
Electro-Motive Division locomotives
GMSA locomotives
Cape gauge railway locomotives
Railway locomotives introduced in 1980
1980 in South Africa
|
```php
<?php
namespace GitScrum\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class ProductBacklogRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'organization_id' => 'required|exists:organizations,id',
'title' => 'required|min:2|max:255',
];
}
/**
* Get the error messages for the defined validation rules.
*
* @return array
*/
public function messages()
{
return [
'title.required' => trans('gitscrum.title-for-backlog-product-cannot-be-blank'),
'title.min' => trans('gitscrum.title-must-be-at-least-2-characters'),
'title.max' => trans('gitscrum.title-must-be-between-2-and-255-characters'),
'organization_id.required' => trans('gitscrum.organization-id-required'),
'organization_id.exists' => trans('gitscrum.organization-id-exists'),
];
}
}
```
|
```python
# init for netCDF4. package
# Docstring comes from extension module _netCDF4.
from ._netCDF4 import *
# Need explicit imports for names beginning with underscores
from ._netCDF4 import __doc__, __pdoc__
from ._netCDF4 import (__version__, __netcdf4libversion__, __hdf5libversion__,
__has_rename_grp__, __has_nc_inq_path__,
__has_nc_inq_format_extended__, __has_nc_open_mem__,
__has_cdf5_format__,__has_nc_par__)
__all__ =\
['Dataset','Variable','Dimension','Group','MFDataset','MFTime','CompoundType','VLType','date2num','num2date','date2index','stringtochar','chartostring','stringtoarr','getlibversion','EnumType']
```
|
Miroslav Giuchici may refer to:
Miroslav Giuchici (footballer, born 1954), Romanian football midfielder
Miroslav Giuchici (footballer, born 1980), Romanian football striker
|
Stibophen is an anthelmintic originally developed by Bayer that is used as a treatment for schistosomiasis by intramuscular injection. It is classified as a trivalent antimony compound. Brand names include Fouadin/Fuadin (named in honor of Fuad I of Egypt, who had enthusiastically supported its research and development).
Mechanism of action
Stibophen inhibits the enzyme phosphofructokinase, which the worms need for glycolysis, at least partly by binding to the sulfhydryl (–SH) group of the enzyme. Inhibiting glycolysis paralyzes the worms, which lose their hold on the wall of mesenteric veins and undergo hepatic shift, die, and are phagocytosed by liver cells.
References
Antiparasitic agents
Sulfonates
Antimony(III) compounds
|
```yaml
key_1: value
key_2: value
key_shared: value
```
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.