text
stringlengths 1
22.8M
|
|---|
```objective-c
/* src/interfaces/ecpg/include/datetime.h */
#ifndef _ECPG_DATETIME_H
#define _ECPG_DATETIME_H
#include <ecpg_informix.h>
/* source created by ecpg which defines these symbols */
#ifndef _ECPGLIB_H
typedef timestamp dtime_t;
typedef interval intrvl_t;
#endif /* ndef _ECPGLIB_H */
#endif /* ndef _ECPG_DATETIME_H */
```
|
Swing is the seventeenth studio album released by The Manhattan Transfer in 1997 on the Atlantic Records label. This album is a collection of 1930s and 1940s swing music with The Manhattan Transfer's jazz twist. The album also features a guest appearance by Stéphane Grappelli, one of his last recordings before his death.
Track listing
Guest artists
Sing Moten's Swing, A-Tisket, A-Tasket, and Java Jive were recorded with Asleep at the Wheel.
Sing a Study in Brown, Topsy, and Nuages were recorded with The Rosenberg Trio. Nuages also features Stephane Grappelli.
Ricky Skaggs is featured on Skyliner and It's Good Enough to Keep.
Mark O'Connor is featured on I Know Why, It's Good Enough to Keep, and Choo Choo Ch' Boogie.
Many of the tracks feature lyrics by Jon Hendricks. The re-mix engineer was Ed Cherney and the album was produced by Tim Hauser.
Cover Art
The cover art for Swing comes from a matchbook cover advertising "Hollywood's Jitterbug House" which was located at 875 North Vine Street in Hollywood. This venue featured Louis Prima and his band.
Personnel
Adapted from AllMusic:
The Manhattan Transfer
Cheryl Bentyne – vocals, vocal arrangements (7)
Tim Hauser – vocals, vocal arrangements (2, 7)
Alan Paul – vocals, vocal arrangements (5, 7, 12)
Janis Siegel – vocals, vocal arrangements (1, 3, 4, 6–9, 13)
Additional personnel
Yaron Gershovsky – acoustic piano (1-9, 11, 12), musical arrangements, musical director, vocal arrangements (2, 11)
Gary Smith – acoustic piano (13)
John Pisano – rhythm guitar (1)
Nous'che Rosenberg – rhythm guitar (2, 9, 10)
Stochelo Rosenberg – lead guitar (2, 9, 10)
Ray Benson – guitar (3, 4, 7)
Cindy Cashdollar – steel guitar (3, 4, 7)
David Hungate – rhythm guitar (5, 6, 8, 11, 12), bass (13)
Buddy Emmons – pedal steel guitar (5, 11)
Ricky Skaggs – rhythm guitar (8, 11, 13), mandolin (11, 12)
Jack Wilkins – electric guitar (11)
Brent Rowan – electric guitar (13)
Steve Hinson – pedal steel guitar (13)
Tony Dumas – bass (1)
Ray Brown – bass (2, 9, 11, 12)
Tony Garnier – bass (3, 4, 7)
Robert Burns – bass (5, 6, 8)
Nonnie Rosenberg – bass (10)
Ralph Humphrey – drums (1), washboard (1)
Duffy Jackson – drums (2, 8-12)
David Sanger – drums (3, 4, 7)
Paul Leim – drums (5, 6)
John Freeman – vibraphone (11)
Michael Francis – alto saxophone (3, 4, 7)
Chris Booher – fiddle (3, 4, 7)
Jason Roberts – fiddle (3, 4, 7)
Mark O'Connor – violin solo (5), violin (12, 13)
Conni Ellisor – violin (5)
Carl Gorodetzky – violin (5)
Lee Larrison – violin (5)
Pamela Sixfin – violin (5)
Stéphane Grappelli – violin (10)
Fletcher Henderson – original arrangements (1, 2, 6, 8)
Carl Marsh – string arrangements (5)
Kurt Elling – vocal arrangements (6)
Gene Puerling – vocal arrangements (10)
Jack White and His All-Stars – chorus choir (4)
Production
Tim Hauser – producer
Ray Benson – associate producer (3, 4, 7)
Jeff Levine – tracking engineer
Emmanuel Payet – tracking engineer
Alan Schuman – tracking engineer
Larry Seyer – tracking engineer
Michael Eric Hutchinson – vocal tracking
Terry Becker – additional recording, mixing (13)
Tom McCauley – additional recording
Kent Bruce – assistant engineer
Paul Dicato – assistant engineer
Steve Lowery – assistant engineer
Tony Rambo – assistant engineer
Brent Reilly – assistant engineer
Ed Cherney – mixing (1-12)
Doug Sax – mastering
Thomas Bricker – art direction, design
Michael Tighe – photography
Jack White –project coordinator, management
Studios
Tracks 1-12 recorded at Red Zone Studios (Burbank, California); Goldmine Studio (Tarzana, California); Moving Hands Studios (Los Angeles, California); Sound Emporium (Nashville, Tennessee); Bismeaux Studios (Austin, Texas); Unique Recording Studios (New York City, New York); Studio Acousti (Paris, France).
Track 13 recorded live at The Ryman Auditorium (Nashville, Tennessee).
Mixed at Record Plant (Los Angeles, California) and Andora Studios (Hollywood, California).
Mastered at The Mastering Lab (Hollywood, California).
References / Sources
The Manhattan Transfer Official Website
Specific
The Manhattan Transfer albums
1997 albums
Atlantic Records albums
|
Dustin Long may refer to:
Dustin Long (American football) (born 1981), American footballer
Dustin Long (writer), American novelist
|
```glsl
module Build.Quicktest.Core
open Build.FableLibrary
open SimpleExec
open BlackFox.CommandLine
open Build.Utils
type RunMode =
| RunScript
| RunCommand of string
type QuicktestConfig =
{
Language: string
FableLibBuilder: BuildFableLibrary
ProjectDir: string
Extension: string
RunMode: RunMode
}
let genericQuicktest (config: QuicktestConfig) (args: string list) =
let skipFableLibrary = args |> List.contains "--skip-fable-library"
config.FableLibBuilder.Run(skipFableLibrary)
let appendRunMode (cmdLine: CmdLine) =
match config.RunMode with
| RunScript -> cmdLine |> CmdLine.appendRaw "--runScript"
| RunCommand command ->
cmdLine
// Use appendRaw to avoid quoting the command
|> CmdLine.appendRaw "--run"
|> CmdLine.appendRaw command
let projectDir = Path.Resolve config.ProjectDir
Command.Fable(
CmdLine.empty
|> CmdLine.appendRaw "clean"
|> CmdLine.appendRaw projectDir
|> CmdLine.appendPrefix "--lang" config.Language
|> CmdLine.appendPrefix "--extension" config.Extension
|> CmdLine.appendRaw "--yes",
workingDirectory = projectDir
)
Command.WatchFableAsync(
CmdLine.empty
|> CmdLine.appendRaw projectDir
|> CmdLine.appendPrefix "--lang" config.Language
|> CmdLine.appendPrefix "--extension" config.Extension
|> CmdLine.appendPrefix "--exclude" "Fable.Core"
|> CmdLine.appendRaw "--noCache"
|> CmdLine.appendRaw "--watch"
|> appendRunMode,
workingDirectory = projectDir
)
|> Async.AwaitTask
|> Async.RunSynchronously
```
|
John Grimshaw Wilkinson (6 January 1856 – 28 February 1937) was a British botanist from Leeds. He was visually impaired and was able to recognise individual plants by using his tongue to detect shape and texture. He assisted Leeds Parks Service in choosing suitable plants, and was President of the Leeds Naturalists' Club. In 1935 he was awarded an Honorary Degree by the University of Leeds. His extensive herbarium collection, compiled by his mother, is held by Leeds Museums & Galleries.
Biography
Wilkinson was born on 6 January 1856 in Leeds. His father died when John was young and his mother, who was a cousin of John Atkinson Grimshaw, brought him up. As a young man, he worked as a grocer and lived in Burley, Leeds; his hobby was painting. He became visually impaired, due to neuralgia, at the age of 22.
After he lost his sight, he took up the study of botany, using his sense of touch and taste, rather than sight to recognise species. One of the places where he learned to distinguish between different plants was at Temple Newsam in Leeds. He referred to the tip of his tongue as a microscope, as he could detect minute difference between plants with it. His sense of hearing also became more pronounced, and he said he could "hear the musical notes of bats in flight". He could also tell insects apart by the sounds they made. In order to learn to identify them, his mother read descriptions from botanical guides to him, which he then used to familiarise himself with the physical characteristics of specimens. He created his own field notebooks using braille. He also had his own herbarium collection, where the specimens were mounted by his mother.
By 1920 he could tell over 800 species apart. With his cousin Elaine Phillips, he collected a rare specimen of Potentilla verna from Ledston Park, Leeds. Since his knowledge of trees and other species in Yorkshire was so extensive, he advised the Leeds Corporation on the planting and labelling of trees in its parks. Wilkinson was President of the Leeds Naturalist Club and Scientific Association. In recognition of the support that his mother provided for him, she was made an honorary member of the society.
Wilkinson also claimed to be able to judge someone's character from their handshake stating that: "If I could go to Armley Gaol and shake hands with the prisoners I could at once tell which were habitual criminals and which were not."
He died on 28 February 1937 in Leeds and was buried in an unconsecrated grave in Beckett Street Cemetery.
Recognition
In 1915 the University of Leeds conferred on him an Honorary Degree of Master of Science. At his degree conferral it was said that it was "largely due to him that our [Leeds'] parks and gardens are adorned with so many beautiful trees and plants".
Legacy
Wilkinson built up an extensive herbarium collection, which includes many extinct or rare specimens. In 1982 it was transferred to Leeds Museums & Galleries. Much of the collection is held at Leeds Discovery Centre.
Newspaper cuttings relating to his life are part of the Helen Keller Archive.
References
1856 births
1937 deaths
English blind people
People from Burley, Leeds
English botanists
19th-century British botanists
20th-century British botanists
British scientists with disabilities
Blind scholars and academics
|
Jimmy Carter incident may refer to:
Jimmy Carter UFO incident
Jimmy Carter rabbit incident
|
```java
package org.locationtech.jts.algorithm;
import junit.framework.TestCase;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.io.WKTReader;
public class CentroidTest extends TestCase {
private static final double TOLERANCE = 1e-10;
public CentroidTest(String name) {
super(name);
}
/** Compute the centroid of a geometry as an area-weighted average of the centroids
* of its components.
*
* @param g a polygonal geometry
* @return Coordinate of the geometry's centroid
*/
private static Coordinate areaWeightedCentroid(Geometry g) {
double totalArea = g.getArea();
double cx = 0;
double cy = 0;
for(int i = 0; i < g.getNumGeometries(); i++) {
Geometry component = g.getGeometryN(i);
double areaFraction = component.getArea() / totalArea;
Coordinate componentCentroid = component.getCentroid().getCoordinate();
cx += areaFraction * componentCentroid.x;
cy += areaFraction * componentCentroid.y;
}
return new Coordinate(cx, cy);
}
public void testCentroidMultiPolygon() throws Exception {
// Verify that the computed centroid of a MultiPolygon is equivalent to the
// area-weighted average of its components.
Geometry g = new WKTReader().read(
"MULTIPOLYGON ((( -92.661322 36.58994900000003, -92.66132199999993 36.58994900000005, -92.66132199999993 36.589949000000004, -92.661322 36.589949, -92.661322 36.58994900000003)), (( -92.65560500000008 36.58708800000005, -92.65560499999992 36.58708800000005, -92.65560499998745 36.587087999992576, -92.655605 36.587088, -92.65560500000008 36.58708800000005 )), (( -92.65512450000065 36.586800000000466, -92.65512449999994 36.58680000000004, -92.65512449998666 36.5867999999905, -92.65512450000065 36.586800000000466 )))"
);
assertTrue(areaWeightedCentroid(g).equals2D(g.getCentroid().getCoordinate(), TOLERANCE));
}
}
```
|
```go
package client // import "github.com/docker/docker/client"
import (
"context"
"net/url"
"github.com/docker/docker/api/types"
)
// ContainerRemove kills and removes a container from the docker host.
func (cli *Client) ContainerRemove(ctx context.Context, containerID string, options types.ContainerRemoveOptions) error {
query := url.Values{}
if options.RemoveVolumes {
query.Set("v", "1")
}
if options.RemoveLinks {
query.Set("link", "1")
}
if options.Force {
query.Set("force", "1")
}
resp, err := cli.delete(ctx, "/containers/"+containerID, query, nil)
defer ensureReaderClosed(resp)
return wrapResponseError(err, resp, "container", containerID)
}
```
|
Qazi Mohib (15 August 1963 – 29 December 1996) was a Pakistani field hockey player . He played 123 matches and scored 41 goals for his country . He competed in the men's tournament at the 1988 Summer Olympics.
References
External links
1963 births
1996 deaths
Pakistani male field hockey players
Olympic field hockey players for Pakistan
Field hockey players at the 1988 Summer Olympics
People from Bannu District
Pashtun sportspeople
Banuchi people
Sportspeople from Khyber Pakhtunkhwa
Asian Games medalists in field hockey
Asian Games gold medalists for Pakistan
Asian Games silver medalists for Pakistan
Medalists at the 1986 Asian Games
Medalists at the 1990 Asian Games
Field hockey players at the 1986 Asian Games
Field hockey players at the 1990 Asian Games
20th-century Pakistani people
|
A point man is a soldier in the front of a military advance.
Point man may also refer to:
Point Man, a 2019 Vietnam War film
Point Man, a character in the video game F.E.A.R.
Pointman, a television series
Pointman (user interface), device used to control one's avatar
|
Hegasulla is a village in Sri Lanka. It is located within Central Province.
See also
List of towns in Central Province, Sri Lanka
External links
Populated places in Central Province, Sri Lanka
|
```javascript
import { LangEn } from "./lang-en.js";
export const wordlists = {
en: LangEn.wordlist(),
};
//# sourceMappingURL=wordlists-browser.js.map
```
|
```html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "path_to_url">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_121) on Mon Mar 27 10:01:25 CEST 2017 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ActivitiEntityEvent (Flowable - Engine 5.23.0 API)</title>
<meta name="date" content="2017-03-27">
<link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="ActivitiEntityEvent (Flowable - Engine 5.23.0 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ActivitiEntityEvent.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/activiti/engine/delegate/event/ActivitiCancelledEvent.html" title="interface in org.activiti.engine.delegate.event"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEntityWithVariablesEvent.html" title="interface in org.activiti.engine.delegate.event"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/activiti/engine/delegate/event/ActivitiEntityEvent.html" target="_top">Frames</a></li>
<li><a href="ActivitiEntityEvent.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.activiti.engine.delegate.event</div>
<h2 title="Interface ActivitiEntityEvent" class="title">Interface ActivitiEntityEvent</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html" title="interface in org.activiti.engine.delegate.event">ActivitiEvent</a></dd>
</dl>
<dl>
<dt>All Known Subinterfaces:</dt>
<dd><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEntityWithVariablesEvent.html" title="interface in org.activiti.engine.delegate.event">ActivitiEntityWithVariablesEvent</a>, <a href="../../../../../org/activiti/engine/delegate/event/ActivitiProcessStartedEvent.html" title="interface in org.activiti.engine.delegate.event">ActivitiProcessStartedEvent</a></dd>
</dl>
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../../org/activiti/engine/delegate/event/impl/ActivitiEntityEventImpl.html" title="class in org.activiti.engine.delegate.event.impl">ActivitiEntityEventImpl</a>, <a href="../../../../../org/activiti/engine/delegate/event/impl/ActivitiEntityExceptionEventImpl.html" title="class in org.activiti.engine.delegate.event.impl">ActivitiEntityExceptionEventImpl</a>, <a href="../../../../../org/activiti/engine/delegate/event/impl/ActivitiEntityWithVariablesEventImpl.html" title="class in org.activiti.engine.delegate.event.impl">ActivitiEntityWithVariablesEventImpl</a>, <a href="../../../../../org/activiti/engine/delegate/event/impl/ActivitiProcessStartedEventImpl.html" title="class in org.activiti.engine.delegate.event.impl">ActivitiProcessStartedEventImpl</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">ActivitiEntityEvent</span>
extends <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html" title="interface in org.activiti.engine.delegate.event">ActivitiEvent</a></pre>
<div class="block">An <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html" title="interface in org.activiti.engine.delegate.event"><code>ActivitiEvent</code></a> related to a single entity.</div>
<dl>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>Frederik Heremans</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="path_to_url" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEntityEvent.html#getEntity--">getEntity</a></span>()</code> </td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.org.activiti.engine.delegate.event.ActivitiEvent">
<!-- -->
</a>
<h3>Methods inherited from interface org.activiti.engine.delegate.event.<a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html" title="interface in org.activiti.engine.delegate.event">ActivitiEvent</a></h3>
<code><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html#getEngineServices--">getEngineServices</a>, <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html#getExecutionId--">getExecutionId</a>, <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html#getProcessDefinitionId--">getProcessDefinitionId</a>, <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html#getProcessInstanceId--">getProcessInstanceId</a>, <a href="../../../../../org/activiti/engine/delegate/event/ActivitiEvent.html#getType--">getType</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getEntity--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getEntity</h4>
<pre><a href="path_to_url" title="class or interface in java.lang">Object</a> getEntity()</pre>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the entity that is targeted by this event.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/ActivitiEntityEvent.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../org/activiti/engine/delegate/event/ActivitiCancelledEvent.html" title="interface in org.activiti.engine.delegate.event"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../../../../org/activiti/engine/delegate/event/ActivitiEntityWithVariablesEvent.html" title="interface in org.activiti.engine.delegate.event"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../index.html?org/activiti/engine/delegate/event/ActivitiEntityEvent.html" target="_top">Frames</a></li>
<li><a href="ActivitiEntityEvent.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
```
|
```kotlin
package mega.privacy.android.app.fragments.homepage
import androidx.core.view.isVisible
import androidx.databinding.ViewDataBinding
import androidx.recyclerview.widget.RecyclerView
import mega.privacy.android.app.R
import mega.privacy.android.app.databinding.ItemNodeGridBinding
import mega.privacy.android.app.databinding.ItemNodeListBinding
import mega.privacy.android.app.databinding.SortByHeaderBinding
import mega.privacy.android.data.qualifier.MegaApi
import nz.mega.sdk.MegaApiAndroid
import javax.inject.Inject
class NodeViewHolder(private val binding: ViewDataBinding) :
RecyclerView.ViewHolder(binding.root) {
@MegaApi
@Inject
lateinit var megaApi: MegaApiAndroid
fun bind(
actionModeViewModel: ActionModeViewModel,
itemOperationViewModel: ItemOperationViewModel,
sortByHeaderViewModel: SortByHeaderViewModel,
item: NodeItem,
) {
binding.apply {
when (this) {
is ItemNodeGridBinding -> {
this.itemOperationViewModel = itemOperationViewModel
this.actionModeViewModel = actionModeViewModel
this.item = item
this.megaApi = megaApi
thumbnail.isVisible = true
}
is ItemNodeListBinding -> {
this.itemOperationViewModel = itemOperationViewModel
this.actionModeViewModel = actionModeViewModel
this.item = item
this.megaApi = megaApi
thumbnail.isVisible = true
}
is SortByHeaderBinding -> {
this.orderNameStringId =
SortByHeaderViewModel.orderNameMap[sortByHeaderViewModel.order.cloudSortOrder]
?: R.string.sortby_name
this.sortByHeaderViewModel = sortByHeaderViewModel
}
}
}
item.uiDirty = false
}
}
```
|
```xml
import {
type StyleObject,
type FontFaceObject,
type KeyframesObject,
} from "styletron-standard";
import stringify from "json-stable-stringify";
/**
@see: path_to_url
*/
import prettier from "prettier/standalone";
import babelParser from "prettier/parser-babel";
/*
This adds a "deterministic" engine that simply returns a `JSON.stringify`-ed
version of the style object (with aplha-sorted keys).
*/
export default function createRender(kind: string) {
return function render(
obj: StyleObject | FontFaceObject | KeyframesObject | undefined | null,
): string {
if (!obj) {
return "";
}
const prettySortedJSON = prettier.format(stringify(obj), {
/**
even though we are using the json5 parser, it is actually packaged inside the
babel parser in source
@see: path_to_url#L28
*/
parser: "json5",
plugins: [babelParser],
// don't add a semicolon at the end of the declaration
semi: false,
// default/prefer use of `'` for strings when needed
singleQuote: true,
// force newline insertions more often
printWidth: 40,
});
return `${kind}=${prettySortedJSON}`;
};
}
```
|
San Pablito is a small town located on the side of the Guajalote Mountain in the Sierra Norte de Puebla mountain region in central east Mexico. It belongs to the Pahuatlán municipality of the state of Puebla. Culturally it is dominated by the Otomi although it is part of the La Huasteca region.
San Pablito is best known for the commercial production of a bark paper called amate as a handcraft. This paper is mostly sold to Nahua painters in Guerrero, but it is also sold nationally and internationally on its own. The paper is made much the way it was before the arrival of the Spanish. Originally, it was made only by the area's shamans for ritual purpose but today commercial production is mostly done by the town's women and children as many men have left to work in the United States.
The town
San Pablito is one of the towns belonging to the Pahuatlán municipality, located in the Sierra Norte region of the state of Puebla in eastern Mexico. The area is rugged mountain terrain which was relatively inaccessible until recent decades. Before the current vehicular road was built in 1978 (paved in the mid-1990s), the only way to reach the community was a steep path by foot or horse.
While the valley area is in a cultural region called La Huasteca, San Pablito and the other villages on its side of the San Marcos River are Otomi territory. These Otomi are related to those in the Mezquital Valley in Hidalgo and among a number of indigenous ethnicities which migrated here from other parts of Mexico. The Otomi name for the town is Bité or Nvite, which means “at the bottom of the hill.”
Traditional dress for women consists of a skirt decorated with stripes and a cotton blouse with short sleeves and a square neckline which is embroidered in bright colors. This embroidery often has images of humans and animals done in cross-stitch or with beads. A poncho-like garment called a quezquémetl is worn over the blouse, which is usually white with a wide purple or red trim. If it is sunny, this garment is then usually folded to be worn on the head. Traditional dress for men consists of pants and a shirt in plain cotton with a white cotton belt, with a macramé fringe and bright colored embroidery. A heavier shirt in black or blue with white stripes may be worn over this along with an ixtle fiber bag and huarache sandals. A local type of basket which is still in use is called a tancolote, which has a frame of tree branches.
Much of the natural vegetation of the valley is lost, but the town is surrounded by orange groves and coffee plantations. These grow in the area's hot, wet climate, strongly affected by warm air masses coming in from the Gulf of Mexico. These air masses produce many days with fog along with rain.
Traditionally subsistence consisted of farming with hunting and gathering. The first external commerce was the growing of coffee beans, with this and latter selling of various handcrafts done through intermediaries to the outside world. One reason for this was that few in the town spoke Spanish. Today, amate paper production is the main economic activity. On days when the townspeople, mostly women, are making it, the rhythmic pounding of stones fills the air. Another important craft is called “chaquira,” intricate beadwork based on what has been done on the traditional blouses of women. It has been adapted to decorate purses and to create jewelry. Women also embroider cotton skirts with figures of horses, people and eagles, not for their own use but rather for sale to tourists.
The production of amate paper has been commercially successful, with sales mostly outside the Sierra Norte region, which has given the town economic and political clout up to the state and federal levels. It is the only town in the municipality, aside from the seat, to have private telephone service, a high school and computers. Much of this was negotiated with federal and state agencies rather than municipal authorities.
Despite the commercial success of the town's crafts, many men, mostly of the younger generations, migrate out of the area, generally to North Carolina in the United States at least temporarily to work. This has left the town mostly populated by women and children, who produce the amate paper and other crafts.
History
San Pablito is one of a number of Otomi-dominated towns in the Pahuatlán Valley in the north of Puebla. These Otomi are one of two main groups of the ethnicity in Mexico, with the other concentrated in the Mezquital Valley in Hidalgo. The Otomi are thought to have migrated here from the Toluca Valley starting around 800 CE, pushed out by other groups, including the Nahuas, over the centuries. The Aztecs conquered the area in the late 15th century, but the Otomi here managed to keep much of their political and economic independence.
The isolation of the rugged mountains also proved to protect much of the Otomi culture here after the Spanish conquest of the Aztec Empire. The Otomi originally allied with the Spanish against the Aztecs but soon rebelled against Spanish rule. The harsh terrain made enforcement of Spanish law and imposition of Spanish culture and economics difficult. As the valley did not hold much mineral wealth, most Spanish did not settle there. The establishment of formal control and parish churches came relatively late. The Otomi of the area resisted evangelization strongly and have kept a large number of indigenous beliefs to this day, especially the use of paper for ceremonies. However, most Otomi of the area have religious beliefs which are a blend of the indigenous and Catholicism.
Life in San Pablito traditionally revolved around agriculture and the gathering of products from the mountains. The first change to this was the introduction of coffee plantations. However, the largest change to the town's economy came in the 20th century with the commercialization of amate paper. It is not known whether the Otomi began commercializing the paper on their own with connections with the Nahua painters made later, or whether the commercialization came as a result of Nahua interest in it. Paper cutouts were sold in tourist markets in Mexico City along with other Otomi crafts. It is known that Otomi and Nahua craftsmen connected in these markets in Mexico City. The area's religious practices attracted researchers around the same time, and the first Otomi bark paper sold to foreigners were in the form of cutouts by the shamans, sold to researchers such as Frederick Starr and Bodil Christensen who wrote about the manufacture and use of the paper. However, by this time the use of amate paper for ritual had been on the decline, replaced in part by the use of industrial paper. Its disappearance was likely halted by the commercialization with most of the demand coming from outside the Puebla area.
The selling of amate paper outside of the municipality has given the town political and economic clout in the municipality of Pahuatlán. Because of the community's economic and political skills, it is the only community (aside from the seat) with a high school, computers, and private telephone service. Much of the town's political clout is with state and federal authorities.
In 1999, a storm knocked out the only then-dirt road connecting the community with the municipal seat of Pahuatlán. The municipality offered help in the way of supplies delivered by helicopter but then only tried to deliver half of what was promised. San Pablito refused the delivery and instead communicated with outside contacts which then delivered the needed food and supplies. In this way, the community indicated its independence from municipal authorities.
The Otomi through San Pablito have gained political power locally as well. The first attempt by an Otomi to gain a municipal political seat was in 1998, but the ruling mestizo class managed to have this candidate lose by only twenty votes. In 1999, authorities in indigenous communities in the municipality banded together to oppose municipal authorities by supporting certain candidates in mass. They also work to pressure the municipality internally and externally through contacts at the state and federal level. In 2001, an Otomi leader of San Pablito won elections for municipal president, a first in the Sierra Norte.
Despite the success of amate paper for San Pablito, many of the men here migrate to find work at least temporarily, a trend that began in the 1980s. Most head to North Carolina in the United States.
Religious tradition
In part because of its isolation, the Otomi of San Pablito and the surrounding areas have managed to keep a large part of their indigenous cultural heritage, especially religious beliefs. While they venerate Catholic figures such as Saint Paul and the Virgin of Guadalupe, they also pay homage to deities of the mountains, sun, moon, water, fire and earth. They also believe in evil spirits. There is significant animism in the sense that entities such as mountains, seeds, fresh water springs and other objects of nature have life force.
One central component of religious life here revolves around shamans, locally called badi. These act as mediators between humans and higher beings. Rituals performed by shamans are meant to create communication with these beings and can be for the benefit of the community as a whole or for an individual. This shamanism has given the Otomi, especially in San Pablito, a reputation for magic and sorcery among their neighbors. These rituals have traditionally been related to agriculture among other things, but as the economy has shifted, most rituals relate to health as well as protection and cleansing, especially of those heading to and from the United States. Traditional medicine consists of two types of sicknesses, “good” and “bad,” with the first being cured with herbs or modern medicine. The second is considered to be spiritual in nature and cured by shamanic rituals to get rid of bad spirits and/or create harmony between the sick person and the universe. San Pablito's best known shaman is Alfonso Garcia.
One hallmark of Otomi magical practices is the use of paper cut into forms, along with more common elements such as offerings of food and tobacco. The origins of using the paper cutouts is not known as there are no pre-Hispanic or colonial sources that document the practice, except for a mention around the 1600s of the use of paper strips for ceremonies. The act of cutting the paper gives the shaman a connection with the entity and includes images of various gods, “super humans,” seeds and more. Figures representing evil are generally cut wearing shoes, as the Europeans and mestizos do. Those representing good are barefoot, like most indigenous peoples.
The paper is mostly seen as neutral, gaining power as it is cut. However, in general white paper is considered to have positive connotations and dark to have negative. While amate paper is the most traditional, commercially made paper is also used. Shamans from other Otomi villages preferred to use San Pablito-produced paper because it was believed to be more powerful. The ability to use industrial paper meant that the making of amate was on the decline in the mid-20th century. Otomi rituals have made a comeback, and, as a consequence, so has interest in amate as a commercial product, which has helped to save it.
Paper cutting rituals may be part of community observances. One of the main celebrations is the new year, now celebrated on January 1, as it represents renewal of the cosmos. On this day, ceremonies often take place in caves with cutouts as offerings along with food items. Day of the Dead is important in the town, like the rest of Mexico. It is celebrated here from October 31 to November 2 with a day dedicated to children, adults and saints respectively. October 31, which is for children, is then subdivided into those who died without eating corn and those who had eaten corn but not had sexual relations. The Fiesta del Pueblo (Town Festival) begins a week after Holy Week ends and lasts for fifteen days. The event honors twelve saints with each having its own day. The most important day is the first Thursday which honors the Holy Trinity, followed by that of Saint Paul, the patron of the town.
Amate paper production
While amate is produced in small quantities elsewhere in Mexico, San Pablito is the only commercial producer of the paper and its manufacture is now the main economic activity. About 6,000 Otomis in and around San Pablito manufacture the paper full- or part-time.
As in other parts of Mexico, the manufacture of this paper was originally for ceremonial use, and restricted to shamans. For this reason, the paper is also locally known as “papel de brujos” (witches’ paper). Manufacture of the paper is no longer restricted to shamans because of commercialization, but ritualistic use of it in San Pablito and other Otomi communities continues and is still in the purview of the shamans. Particularly large ficus trees used for paper are marked as sacred with candles and cutouts.
The commercialization of the paper began in the mid-20th century. The Otomi began selling handcrafts in Mexico City in the late 1950s. Sale of the paper as a handcraft is traced as far back as the 1960s, but its exact introduction to the market is not clear. However, its recognition as an important craft came when it became tied to paintings done by the Nahuas from the state of Guerrero, who adopted styles from their ceramics to the new medium. At first, nearly all of the San Pablito amate production was bought by the Nahuas, leading to a standard 40 by 60 cm paper sheet. Then the federal government intervened, mostly through FONART, at first to promote the craft internationally at the 1968 Olympic Games and later as the main buyer of the paper to keep Nahua painters supplied.
While the production of 40 by 60 cm paper remains economically important, the amate production of the San Pablito has since diversified. New products include envelopes, bookmarks, cutout figures, and booklets, as well as sheets in a variety of colors, textures and sizes up to 1.20 by 2.40 meters. There are also varieties decorated with dried flowers and leaves. In addition to traditional Nahua customers, amate paper is now sold to industries who use it to produce other end products such as lampshades, furniture covers, wallpaper and parquet flooring. The success of amate paper commercialization has caused the population here to forego most other economic activities such as agriculture and even other handcrafts such as pottery and weaving.
Because most working-age men have left San Pablito, most of the manufacture of the paper is done by women and children. The town's craftsmen are dependent upon the bark supply provided by those in surrounding towns; this is mostly done by men, who cover an area of about 1,500km2 in the Sierra Norte to find the appropriate bark. The manufacturing process varies slightly from artisan to artisan, but its basic steps are to soak the bark to soften it, pound the fibers together into a sheet and then lay the sheets out in the sun to dry.
Most paper has been manufactured at the household level but this has changed somewhat. There are two types of production units in the town. The first consists of households of up to five members, with production varying greatly during the year depending on other economic activities and/or means to produce the paper. The other type is primarily devoted to producing paper, with family members often involved in bark collection and commercialization of end products along with producing the paper itself. In most cases, the work goes on in the home. The appearance of workshops for paper-making first started to appear in the 1990s. Paper manufacture is dependent on the weather, with May through July being the driest months of the region and therefore the most suitable. Less paper is produced December through February because of the weather. Another factor is religious festivals such as Holy Week and Day of the Dead in which paper demand peaks. On days that are appropriate for paper-making, work goes from sunrise to sunset to take advantage of the weather.
Most amate work is done in standard sizes with few recognized artisans, mostly because it has mostly been commercialized as the base for Nahua paintings. This has been changing with bark paper pieces winning awards such as the National Popular Art Prize and the UNESCO Handicraft Prize. This has led to more innovations being made in amate production. Some artisans have experimented with sizes, shapes, and elaborate designs, and there have been amate exhibits in the Smithsonian Institution and the London Museum of Archeology. One of these innovations is large, poster-sized cutouts, usually rich in decoration with figures such as suns, flowers and birds framed by friezes. In some, different types of bark are used. The booklets are made from a meter-long sheet of paper which are folded to resemble Aztec codices. Shamans no longer sell individual cutouts but rather small books with the cutouts of gods glued inside. Cutouts with no religious theme have been explored as well.(binn105) These designs include those made for Valentine's Day and those imitating the designs of Otomi embroidery and beadwork.
About seventy percent of amate makers sell to wholesalers, with only the biggest manufactures having their own outside contracts. These larger concerns also produce nearly all of the output outside of the standard 60 by 40 cm sheet. Each standard sheet costs about four pesos to make. High-quality paper by known artisans can sell for as high as USD $500 on the international market. The dependence on local wholesalers led to socio-economic stratification in the town, with the wholesalers receiving more profit off the paper than the producers. It is estimated that today about fifty percent of production ultimately goes to Nahua painters, with about seventy percent of the resulting paintings sold in Mexico. Amate paper sold internationally is generally used for arts, crafts, stationery and home décor.
The sale of amate paper has connected this small town to the outside world. Although the craftspeople are not supported by the local government, they have strong contacts with state and federal authorities. The paper manufacture affects the economy of the villages around San Pablito, which supply it with bark and fuel wood. The paper production has attracted some tourism as well as purchasers from various states in Mexico and from abroad. However, the town carefully guards the details about how the paper is made, from other inhabitants of the Sierra Norte and from foreigners.
Vendors seen to be trying to learn how to make the paper have been kicked out of town, and attempts by Japanese researchers looking to document the process have been rejected.
The success of amate paper commercialization has led to environmental issues in the San Pablito area and farther away. It is getting harder to find bark due to the over-stripping of trees and the loss of forests to agriculture and development. There have been attempts to cultivate the tree species currently used for paper-making, but without success. Currently, there are attempts to reforest the area with a similar species which grows to maturity faster. The use of caustic soda and industrial dyes in the process of making amate has caused problems with pollution, especially of the San Marcos River, whose waters then pollute the Cazones River.
References
Bibliography
Populated places in Puebla
|
```c++
// 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
#include <boost/scoped_ptr.hpp>
#include "exprs/slot-ref.h"
#include "runtime/mem-pool.h"
#include "runtime/mem-tracker.h"
#include "runtime/test-env.h"
#include "runtime/timestamp-value.inline.h"
#include "runtime/tuple-row.h"
#include "runtime/types.h"
#include "testutil/gtest-util.h"
#include "util/tuple-row-compare.h"
#include "common/names.h"
namespace impala {
class TupleRowCompareTest : public testing::Test {
public:
TupleRowCompareTest() : expr_perm_pool_(&tracker_), expr_results_pool_(&tracker_) {}
protected:
typedef __uint128_t uint128_t;
/// Temporary runtime environment for the TupleRowComperator.
scoped_ptr<TestEnv> test_env_;
RuntimeState* runtime_state_;
RowDescriptor desc_;
ObjectPool pool_;
/// A dummy MemTracker used for exprs and other things we don't need to have limits on.
MemTracker tracker_;
MemPool expr_perm_pool_;
MemPool expr_results_pool_;
scoped_ptr<TupleRowZOrderComparator> comperator_;
vector<ScalarExpr*> ordering_exprs_;
virtual void SetUp() {
test_env_.reset(new TestEnv());
ASSERT_OK(test_env_->Init());
}
virtual void TearDown() {
comperator_->Close(runtime_state_);
ScalarExpr::Close(ordering_exprs_);
runtime_state_ = nullptr;
test_env_.reset();
expr_perm_pool_.FreeAll();
expr_results_pool_.FreeAll();
pool_.Clear();
}
void LoadComperator(int offset) {
TSortInfo* tsort_info = pool_.Add(new TSortInfo);
tsort_info->sorting_order = TSortingOrder::ZORDER;
TupleRowComparatorConfig* config =
pool_.Add(new TupleRowComparatorConfig(*tsort_info, ordering_exprs_));
comperator_.reset(new TupleRowZOrderComparator(*config));
ASSERT_OK(comperator_->Open(&pool_, runtime_state_, &expr_perm_pool_,
&expr_results_pool_));
}
// Only ColumnType should be passed as template parameter.
template <typename... Types>
void LoadComperator(int offset, ColumnType type, Types... types) {
//We are trying to fit into one slot, so the offset has to be < sizeof(int)*8.
DCHECK_LT(offset, sizeof(int) * 8) << "Too many columns added.";
SlotRef* build_expr = pool_.Add(new SlotRef(type, offset, true /* nullable */));
ASSERT_OK(build_expr->Init(desc_, true, nullptr));
ordering_exprs_.push_back(build_expr);
LoadComperator(offset + type.GetSlotSize(), types...);
}
template <typename... Types>
void CreateComperator(Types... types) {
ordering_exprs_.clear();
LoadComperator(1, types...);
}
template <bool IS_FIRST_SLOT_NULL = false, typename... Args>
TupleRow* CreateTupleRow(Args... args) {
// Only one null byte is allocated, so the joint slot size has to be < sizeof(int)*8.
DCHECK_LE(sizeof...(args), 8);
uint8_t* tuple_row_mem = expr_perm_pool_.Allocate(
sizeof(char*) + sizeof(int32_t*) * sizeof...(args));
Tuple* tuple_mem = Tuple::Create(sizeof(char) + GetSize(args...), &expr_perm_pool_);
if (IS_FIRST_SLOT_NULL) tuple_mem->SetNull(NullIndicatorOffset(0, 1));
FillMem(tuple_mem, 1, args...);
TupleRow* row = reinterpret_cast<TupleRow*>(tuple_row_mem);
row->SetTuple(0, tuple_mem);
return row;
}
unsigned GetSize() { return 0; }
template <typename T, typename... Args>
unsigned GetSize(const T & head, const Args &... tail) {
return sizeof(T) + GetSize(tail...);
}
template <typename T>
void FillMem(Tuple* tuple_mem, int idx, T val) {
memcpy(tuple_mem->GetSlot(idx), &val, sizeof(T));
}
template <typename T, typename... Args>
void FillMem(Tuple* tuple_mem, int idx, T val, Args... args) {
// Use memcpy to avoid gcc generating unaligned instructions like movaps
// for int128_t. They will raise SegmentFault when addresses are not
// aligned to 16 bytes.
memcpy(tuple_mem->GetSlot(idx), &val, sizeof(T));
FillMem(tuple_mem, idx + sizeof(T), args...);
}
template <typename T, bool IS_FIRST_SLOT_NULL = false>
int CompareTest(T lval1, T lval2, T rval1, T rval2) {
TupleRow* lhs = CreateTupleRow<IS_FIRST_SLOT_NULL>(lval1, lval2);
TupleRow* rhs = CreateTupleRow(rval1, rval2);
int result = comperator_->Compare(lhs, rhs);
comperator_->Close(runtime_state_);
return result;
}
// With this function, nullable entries can also be tested, by setting the
// template parameter to true. This means that the first slot of the
// left hand side is set to null, which should be equal to the
// smallest possible value when comparing.
template <bool IS_FIRST_SLOT_NULL = false>
int IntIntTest(int32_t lval1, int32_t lval2, int32_t rval1, int32_t rval2) {
CreateComperator(ColumnType(TYPE_INT), ColumnType(TYPE_INT));
return CompareTest<int32_t, IS_FIRST_SLOT_NULL>(lval1, lval2, rval1, rval2);
}
int Int64Int64Test(int64_t lval1, int64_t lval2, int64_t rval1, int64_t rval2) {
CreateComperator(ColumnType(TYPE_BIGINT), ColumnType(TYPE_BIGINT));
return CompareTest<int64_t>(lval1, lval2, rval1, rval2);
}
int Int16Int16Test(int16_t lval1, int16_t lval2, int16_t rval1, int16_t rval2) {
CreateComperator(ColumnType(TYPE_SMALLINT), ColumnType(TYPE_SMALLINT));
return CompareTest<int16_t>(lval1, lval2, rval1, rval2);
}
int Int8Int8Test(int8_t lval1, int8_t lval2, int8_t rval1, int8_t rval2) {
CreateComperator(ColumnType(TYPE_TINYINT), ColumnType(TYPE_TINYINT));
return CompareTest<int8_t>(lval1, lval2, rval1, rval2);
}
int FloatFloatTest(float lval1, float lval2, float rval1, float rval2) {
CreateComperator(ColumnType(TYPE_FLOAT), ColumnType(TYPE_FLOAT));
return CompareTest<float>(lval1, lval2, rval1, rval2);
}
int DoubleDoubleTest(double lval1, double lval2, double rval1, double rval2) {
CreateComperator(ColumnType(TYPE_DOUBLE), ColumnType(TYPE_DOUBLE));
return CompareTest<double>(lval1, lval2, rval1, rval2);
}
int BoolBoolTest(bool lval1, bool lval2, bool rval1, bool rval2) {
CreateComperator(ColumnType(TYPE_BOOLEAN), ColumnType(TYPE_BOOLEAN));
return CompareTest<bool>(lval1, lval2, rval1, rval2);
}
// Char is a special case, so its tuples have to be created differently.
// This function is responsible for only the char test below, therefore
// the tuple will have a fix size of two slots.
TupleRow* CreateCharArrayTupleRow(const char* ptr1, const char* ptr2) {
uint8_t* tuple_row_mem = expr_perm_pool_.Allocate(
sizeof(char*) + sizeof(int32_t*) * 2);
Tuple* tuple_mem =
Tuple::Create(sizeof(char) + strlen(ptr1) + strlen(ptr2), &expr_perm_pool_);
memcpy(tuple_mem->GetSlot(1), ptr1, strlen(ptr1));
memcpy(tuple_mem->GetSlot(1 + strlen(ptr1)), ptr2, strlen(ptr2));
TupleRow* row = reinterpret_cast<TupleRow*>(tuple_row_mem);
row->SetTuple(0, tuple_mem);
return row;
}
int CharCharTest(const char *lval1, const char *lval2, const char *rval1,
const char *rval2) {
DCHECK_EQ(strlen(lval1), strlen(rval1));
DCHECK_EQ(strlen(lval2), strlen(rval2));
CreateComperator(ColumnType::CreateCharType(strlen(lval1)),
ColumnType::CreateCharType(strlen(lval2)));
TupleRow* lhs = CreateCharArrayTupleRow(lval1, lval2);
TupleRow* rhs = CreateCharArrayTupleRow(rval1, rval2);
int result = comperator_->Compare(lhs, rhs);
comperator_->Close(runtime_state_);
return result;
}
int DateDateTest(DateValue lval1, DateValue lval2, DateValue rval1, DateValue rval2) {
CreateComperator(ColumnType(TYPE_DATE), ColumnType(TYPE_DATE));
return CompareTest<DateValue>(lval1, lval2, rval1, rval2);
}
int TimestampTimestampTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
return TimestampTimestampTest(
TimestampValue::ParseSimpleDateFormat(lval1),
TimestampValue::ParseSimpleDateFormat(lval2),
TimestampValue::ParseSimpleDateFormat(rval1),
TimestampValue::ParseSimpleDateFormat(rval2));
}
int TimestampTimestampTest(int64_t lval1, int64_t lval2, int64_t rval1, int64_t rval2) {
return TimestampTimestampTest(TimestampValue::FromDaysSinceUnixEpoch(lval1),
TimestampValue::FromDaysSinceUnixEpoch(lval2),
TimestampValue::FromDaysSinceUnixEpoch(rval1),
TimestampValue::FromDaysSinceUnixEpoch(rval2));
}
int TimestampTimestampTest(TimestampValue lval1, TimestampValue lval2,
TimestampValue rval1, TimestampValue rval2) {
CreateComperator(ColumnType(TYPE_TIMESTAMP), ColumnType(TYPE_TIMESTAMP));
return CompareTest<TimestampValue>(lval1, lval2, rval1, rval2);
}
template<typename DECIMAL_T>
int DecimalDecimalTest(int64_t lval1, int64_t lval2, int64_t rval1, int64_t rval2,
int precision, int scale) {
ColumnType decimal_column = ColumnType::CreateDecimalType(precision, scale);
CreateComperator(decimal_column, decimal_column);
bool overflow = false;
DECIMAL_T l1 = DECIMAL_T::FromInt(precision, scale, lval1, &overflow);
DECIMAL_T l2 = DECIMAL_T::FromInt(precision, scale, lval2, &overflow);
DECIMAL_T r1 = DECIMAL_T::FromInt(precision, scale, rval1, &overflow);
DECIMAL_T r2 = DECIMAL_T::FromInt(precision, scale, rval2, &overflow);
TupleRow* lhs = CreateTupleRow(l1, l2);
TupleRow* rhs = CreateTupleRow(r1, r2);
int result = comperator_->Compare(lhs, rhs);
comperator_->Close(runtime_state_);
return result;
}
// The number of bytes to compare in a string depends on the size of the types present
// in a row. If there are only strings present, only the first 4 bytes will be
// considered. This is decided in TupleRowZOrderComparator::CompareInterpreted, where
// the GetByteSize returns 0 for strings.
int StringString4ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
CreateComperator(ColumnType(TYPE_STRING), ColumnType(TYPE_STRING));
return CompareTest<StringValue>(StringValue(lval1), StringValue(lval2),
StringValue(rval1), StringValue(rval2));
}
// Requires that the comparator has already been created with the two String/Varchar
// columns and a column corresponding to T.
template<typename T>
int GenericStringTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2, T dummyValue) {
TupleRow* lhs = CreateTupleRow(StringValue(lval1), StringValue(lval2), dummyValue);
TupleRow* rhs = CreateTupleRow(StringValue(rval1), StringValue(rval2), dummyValue);
int result = comperator_->Compare(lhs, rhs);
comperator_->Close(runtime_state_);
return result;
}
int StringString8ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
// TYPE_BIGINT will enforce checking the first 8 bytes of the strings.
CreateComperator(
ColumnType(TYPE_STRING), ColumnType(TYPE_STRING), ColumnType(TYPE_BIGINT));
int64_t dummyValue = 0;
return GenericStringTest<int64_t>(lval1, lval2, rval1, rval2, dummyValue);
}
int StringString16ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
// The Decimal16Value column will enforce checking the first 16 bytes of the strings.
int precision = ColumnType::MAX_PRECISION;
int scale = 0;
bool overflow = false;
Decimal16Value dummyValue = Decimal16Value::FromInt(precision, scale, 0, &overflow);
CreateComperator(ColumnType(TYPE_STRING), ColumnType(TYPE_STRING),
ColumnType::CreateDecimalType(precision, scale));
return GenericStringTest<Decimal16Value>(lval1, lval2, rval1, rval2, dummyValue);
}
int VarcharVarchar4ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
CreateComperator(ColumnType::CreateVarcharType(32),
ColumnType::CreateVarcharType(32));
return CompareTest<StringValue>(StringValue(lval1), StringValue(lval2),
StringValue(rval1), StringValue(rval2));
}
int VarcharVarchar8ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
// TYPE_BIGINT will enforce checking the first 8 bytes of the strings.
CreateComperator(ColumnType::CreateVarcharType(32),
ColumnType::CreateVarcharType(32), ColumnType(TYPE_BIGINT));
int64_t dummyValue = 0;
return GenericStringTest<Decimal16Value>(lval1, lval2, rval1, rval2, dummyValue);
}
int VarcharVarchar16ByteTest(const std::string& lval1, const std::string& lval2,
const std::string& rval1, const std::string& rval2) {
// The Decimal16Value column will enforce checking the first 16 bytes of the strings.
int precision = ColumnType::MAX_PRECISION;
int scale = 0;
bool overflow = false;
Decimal16Value dummyValue = Decimal16Value::FromInt(precision, scale, 0, &overflow);
CreateComperator(ColumnType::CreateVarcharType(32),
ColumnType::CreateVarcharType(32),
ColumnType::CreateDecimalType(precision, scale));
return GenericStringTest<Decimal16Value>(lval1, lval2, rval1, rval2, dummyValue);
}
};
// The Z-values used and their order are visualized in the following image:
// path_to_url
TEST_F(TupleRowCompareTest, Int32Test) {
EXPECT_EQ(IntIntTest(0, 0, 0, 0), 0);
EXPECT_EQ(IntIntTest(-5, 3, -5, 3), 0);
EXPECT_EQ(IntIntTest(1, 0, 0, 1), 1);
EXPECT_EQ(IntIntTest(0, 1, 1, 0), -1);
EXPECT_EQ(IntIntTest(1, 0, 0, 1), 1);
EXPECT_EQ(IntIntTest(2, 4, 1, 7), 1);
EXPECT_EQ(IntIntTest(3, 7, 4, 0), -1);
EXPECT_EQ(IntIntTest(6, 4, 5, 7), 1);
EXPECT_EQ(IntIntTest(5, 5, 6, 4), -1);
EXPECT_EQ(IntIntTest(6, 1, 3, 7), 1);
EXPECT_EQ(IntIntTest(INT32_MAX / 2 + 2, 1, 1, INT32_MAX), 1);
EXPECT_EQ(IntIntTest(INT32_MAX / 2, 1, 1, INT32_MAX), -1);
// Some null tests (see details at IntIntTest)
EXPECT_EQ(IntIntTest<true>(1, 1, 1, 1), -1);
EXPECT_EQ(IntIntTest<true>(4242, 1, 1, 1), -1);
EXPECT_EQ(IntIntTest<true>(1, 0, 0, 1), -1);
EXPECT_EQ(IntIntTest<true>(1, 0, INT32_MIN, 0), 0);
}
TEST_F(TupleRowCompareTest, Int64Test) {
EXPECT_EQ(Int64Int64Test(0, 0, 0, 0), 0);
EXPECT_EQ(Int64Int64Test(-5, 3, -5, 3), 0);
EXPECT_EQ(Int64Int64Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int64Int64Test(0, 1, 1, 0), -1);
EXPECT_EQ(Int64Int64Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int64Int64Test(2, 4, 1, 7), 1);
EXPECT_EQ(Int64Int64Test(3, 7, 4, 0), -1);
EXPECT_EQ(Int64Int64Test(6, 4, 5, 7), 1);
EXPECT_EQ(Int64Int64Test(5, 5, 6, 4), -1);
EXPECT_EQ(Int64Int64Test(6, 1, 3, 7), 1);
EXPECT_EQ(Int64Int64Test(INT64_MAX / 2 + 2, 1, 1, INT64_MAX), 1);
EXPECT_EQ(Int64Int64Test(INT64_MAX / 2, 1, 1, INT64_MAX), -1);
}
TEST_F(TupleRowCompareTest, Int16Test) {
EXPECT_EQ(Int16Int16Test(0, 0, 0, 0), 0);
EXPECT_EQ(Int16Int16Test(-5, 3, -5, 3), 0);
EXPECT_EQ(Int16Int16Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int64Int64Test(0, 1, 1, 0), -1);
EXPECT_EQ(Int16Int16Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int16Int16Test(2, 4, 1, 7), 1);
EXPECT_EQ(Int16Int16Test(3, 7, 4, 0), -1);
EXPECT_EQ(Int16Int16Test(6, 4, 5, 7), 1);
EXPECT_EQ(Int16Int16Test(5, 5, 6, 4), -1);
EXPECT_EQ(Int16Int16Test(6, 1, 3, 7), 1);
EXPECT_EQ(Int16Int16Test(INT16_MAX / 2 + 2, 1, 1, INT16_MAX), 1);
EXPECT_EQ(Int16Int16Test(INT16_MAX / 2, 1, 1, INT16_MAX), -1);
}
TEST_F(TupleRowCompareTest, Int8Test) {
EXPECT_EQ(Int8Int8Test(0, 0, 0, 0), 0);
EXPECT_EQ(Int8Int8Test(-5, 3, -5, 3), 0);
EXPECT_EQ(Int8Int8Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int8Int8Test(0, 1, 1, 0), -1);
EXPECT_EQ(Int8Int8Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int8Int8Test(2, 4, 1, 7), 1);
EXPECT_EQ(Int8Int8Test(3, 7, 4, 0), -1);
EXPECT_EQ(Int8Int8Test(6, 4, 5, 7), 1);
EXPECT_EQ(Int8Int8Test(5, 5, 6, 4), -1);
EXPECT_EQ(Int8Int8Test(6, 1, 3, 7), 1);
EXPECT_EQ(Int8Int8Test(INT8_MAX / 2 + 2, 1, 1, INT8_MAX), 1);
EXPECT_EQ(Int8Int8Test(INT8_MAX / 2, 1, 1, INT8_MAX), -1);
}
TEST_F(TupleRowCompareTest, FloatTest) {
EXPECT_EQ(FloatFloatTest(1.0f, 0.0f, 0.0f, 1.0f), 1);
EXPECT_EQ(FloatFloatTest(0.0f, 1.0f, 1.0f, 0.0f), -1);
EXPECT_EQ(FloatFloatTest(4.0f, 3.0f, 3.0f, 4.0f), 1);
EXPECT_EQ(FloatFloatTest(5.0f, 7.0f, 4.0f, 10.0f), -1);
EXPECT_EQ(FloatFloatTest(6.0f, 10.0f, 7.0f, 3.0f), 1);
EXPECT_EQ(FloatFloatTest(9.0f, 7.0f, 8.0f, 10.0f), -1);
EXPECT_EQ(FloatFloatTest(8.0f , 8.0f, 9.0f, 7.0f), 1);
EXPECT_EQ(FloatFloatTest(9.0f, 4.0f, 6.0f, 10.0f), 1);
EXPECT_EQ(FloatFloatTest(-4.0f, -3.0f, -3.0f, -4.0f), -1);
EXPECT_EQ(FloatFloatTest(-5.0f, -7.0f, -4.0f, -10.0f), 1);
EXPECT_EQ(FloatFloatTest(-6.0f, -10.0f, -7.0f, -3.0f), -1);
EXPECT_EQ(FloatFloatTest(-9.0f, -7.0f, -8.0f, -10.0f), 1);
EXPECT_EQ(FloatFloatTest(-8.0f, -8.0f, -9.0f, -7.0f), -1);
EXPECT_EQ(FloatFloatTest(-9.0f, -4.0f, -6.0f, -10.0f), -1);
EXPECT_EQ(FloatFloatTest(FLT_MAX / 2.0f + 2.0f, 1.0f, 1.0f, FLT_MAX), 1);
}
TEST_F(TupleRowCompareTest, DoubleTest) {
EXPECT_EQ(DoubleDoubleTest(1.0, 0.0, 0.0, 1.0f), 1);
EXPECT_EQ(DoubleDoubleTest(0.0, 1.0, 1.0, 0.0f), -1);
EXPECT_EQ(DoubleDoubleTest(4.0, 3.0, 3.0, 4.0), 1);
EXPECT_EQ(DoubleDoubleTest(5.0, 7.0, 4.0, 10.0), -1);
EXPECT_EQ(DoubleDoubleTest(6.0, 10.0, 7.0, 3.0), 1);
EXPECT_EQ(DoubleDoubleTest(9.0, 7.0, 8.0, 10.0), -1);
EXPECT_EQ(DoubleDoubleTest(8.0, 8.0, 9.0, 7.0), 1);
EXPECT_EQ(DoubleDoubleTest(9.0, 4.0, 6.0, 10.0), 1);
EXPECT_EQ(DoubleDoubleTest(-4.0, -3.0, -3.0, -4.0), -1);
EXPECT_EQ(DoubleDoubleTest(-5.0, -7.0, -4.0, -10.0), 1);
EXPECT_EQ(DoubleDoubleTest(-6.0, -10.0, -7.0, -3.0), -1);
EXPECT_EQ(DoubleDoubleTest(-9.0, -7.0, -8.0, -10.0), 1);
EXPECT_EQ(DoubleDoubleTest(-8.0, -8.0, -9.0, -7.0), -1);
EXPECT_EQ(DoubleDoubleTest(-9.0, -4.0, -6.0, -10.0), -1);
EXPECT_EQ(DoubleDoubleTest(DBL_MAX / 2.0 + 2.0, 1.0, 1.0, DBL_MAX), 1);
}
TEST_F(TupleRowCompareTest, BoolTest) {
EXPECT_EQ(BoolBoolTest(true, false, true, false), 0);
EXPECT_EQ(BoolBoolTest(false, true, false, true), 0);
EXPECT_EQ(BoolBoolTest(true, true, true, false), 1);
EXPECT_EQ(BoolBoolTest(false, true, true, true), -1);
EXPECT_EQ(BoolBoolTest(false, true, false, false), 1);
EXPECT_EQ(BoolBoolTest(false, false, false, true), -1);
EXPECT_EQ(BoolBoolTest(true, false, false, false), 1);
}
TEST_F(TupleRowCompareTest, CharTest) {
EXPECT_EQ(CharCharTest("a", "b", "a", "b"), 0);
EXPECT_EQ(CharCharTest("a", "b", "a", "b"), 0);
EXPECT_EQ(CharCharTest("h", "0", "h", "0"), 0);
EXPECT_EQ(CharCharTest("h", "z", "z", "h"), -1);
EXPECT_EQ(CharCharTest("a", "0", "h", "0"), -1);
EXPECT_EQ(CharCharTest("!", "{", "0", "K"), 1);
EXPECT_EQ(CharCharTest("A", "~", "B", "Z"), 1);
EXPECT_EQ(CharCharTest("aaa", "bbb", "aaa", "bbb"), 0);
EXPECT_EQ(CharCharTest("abc", "bbc", "abc", "bbc"), 0);
EXPECT_EQ(CharCharTest("aah", "aa0", "aah", "aa0"), 0);
EXPECT_EQ(CharCharTest("aaa", "aa0", "aah", "aa0"), -1);
EXPECT_EQ(CharCharTest("aah", "aaz", "aaz", "aah"), -1);
EXPECT_EQ(CharCharTest("aa!", "aa{", "aa0", "aaK"), 1);
EXPECT_EQ(CharCharTest("aaA", "aa~", "aaB", "aaZ"), 1);
}
TEST_F(TupleRowCompareTest, DateTest) {
EXPECT_EQ(Int8Int8Test(0, 0, 0, 0), 0);
EXPECT_EQ(Int8Int8Test(-5, 3, -5, 3), 0);
EXPECT_EQ(Int8Int8Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int8Int8Test(0, 1, 1, 0), -1);
EXPECT_EQ(Int8Int8Test(1, 0, 0, 1), 1);
EXPECT_EQ(Int8Int8Test(2, 4, 1, 7), 1);
EXPECT_EQ(Int8Int8Test(3, 7, 4, 0), -1);
EXPECT_EQ(Int8Int8Test(6, 4, 5, 7), 1);
EXPECT_EQ(Int8Int8Test(5, 5, 6, 4), -1);
EXPECT_EQ(Int8Int8Test(6, 1, 3, 7), 1);
EXPECT_EQ(Int8Int8Test(INT8_MAX / 2 + 2, 1, 1, INT8_MAX), 1);
EXPECT_EQ(Int8Int8Test(INT8_MAX / 2, 1, 1, INT8_MAX), -1);
}
TEST_F(TupleRowCompareTest, TimestampTest) {
EXPECT_EQ(TimestampTimestampTest(
"2015-04-09 14:07:46.580465000", "2015-04-09 14:07:46.580465000",
"2015-04-09 14:07:46.580465000", "2015-04-09 14:07:46.580465000"), 0);
EXPECT_EQ(TimestampTimestampTest(
"1415-12-09 10:07:44.314159265", "2015-04-09 14:07:46.580465000",
"1415-12-09 10:07:44.314159265", "2015-04-09 14:07:46.580465000"), 0);
EXPECT_EQ(TimestampTimestampTest(1, 0, 0, 1), 1);
EXPECT_EQ(TimestampTimestampTest(0, 1, 1, 0), -1);
EXPECT_EQ(TimestampTimestampTest(1, 0, 0, 1), 1);
EXPECT_EQ(TimestampTimestampTest(2, 4, 1, 7), 1);
EXPECT_EQ(TimestampTimestampTest(3, 7, 4, 0), -1);
EXPECT_EQ(TimestampTimestampTest(6, 4, 5, 7), 1);
EXPECT_EQ(TimestampTimestampTest(5, 5, 6, 4), -1);
EXPECT_EQ(TimestampTimestampTest(6, 1, 3, 7), 1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 00:00:00.000000000", "9999-12-31 14:07:46.580465000",
"8000-12-09 10:07:44.314159265", "2015-04-09 14:07:46.580465000"), -1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 00:00:00.000000001", "1400-01-01 00:00:00.000000000",
"1400-01-01 00:00:00.000000000", "1400-01-01 00:00:00.000000001"), 1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 00:00:00.000000003", "1400-01-01 00:00:00.000000007",
"1400-01-01 00:00:00.000000004", "1400-01-01 00:00:00.000000000"), -1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 00:00:00.000000006", "1400-01-01 00:00:00.000000004",
"1400-01-01 00:00:00.000000005", "1400-01-01 00:00:00.000000007"), 1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 00:00:00.000000005", "1400-01-01 00:00:00.000000005",
"1400-01-01 00:00:00.000000006", "1400-01-01 00:00:00.000000004"), -1);
EXPECT_EQ(TimestampTimestampTest(
"1400-01-01 23:59:59.999999999", "1400-01-01 00:00:00.000000000",
"1400-01-02 00:00:00.000000000", "1400-01-01 00:00:00.000000000"), -1);
EXPECT_EQ(TimestampTimestampTest(
"3541-11-03 23:59:59.999999999", "3541-11-03 00:00:00.000000000",
"3541-11-04 00:00:00.000000000", "3541-11-03 00:00:00.000000000"), -1);
}
TEST_F(TupleRowCompareTest, DecimalTest) {
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(1, 1, 1, 1, 4, 2), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(-5, 3, -5, 3, 2, 1), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(1, 0, 0, 1, 1, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(0, 1, 1, 0, 1, 0), -1);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(256, 10, 255, 100, 4, 2), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(3, 1024, 128, 1023, 9, 1), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(1024, 511, 1023, 0, 5, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal4Value>(5550, 0, 5000, 4097, 9, 3), -1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(1, 1, 1, 1, 4, 2), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(-5, 3, -5, 3, 2, 1), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(1, 0, 0, 1, 1, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(0, 1, 1, 0, 1, 0), -1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(256, 10, 255, 100, 18, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(3, 1024, 128, 1023, 18, 1), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(1024, 511, 1023, 0, 18, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal8Value>(5550, 0, 5000, 4097, 18, 3), -1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(1, 1, 1, 1, 4, 2), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(-5, 3, -5, 3, 2, 1), 0);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(1, 0, 0, 1, 1, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(0, 1, 1, 0, 1, 0), -1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(256, 10, 255, 100,
ColumnType::MAX_PRECISION, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(3, 1024, 128, 1023,
ColumnType::MAX_PRECISION, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(1024, 511, 1023, 0,
ColumnType::MAX_PRECISION, 0), 1);
EXPECT_EQ(DecimalDecimalTest<Decimal16Value>(5550, 0, 5000, 4097,
ColumnType::MAX_PRECISION, 0), -1);
}
TEST_F(TupleRowCompareTest, AllTypeTest) {
int precision = 9, scale = 0;
bool overflow = false;
CreateComperator(ColumnType(TYPE_TIMESTAMP), ColumnType(TYPE_BOOLEAN),
ColumnType(TYPE_TINYINT), ColumnType(TYPE_BIGINT), ColumnType::CreateCharType(1),
ColumnType(ColumnType::CreateDecimalType(precision, scale)));
TupleRow* lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
false, static_cast<int8_t>(0), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
TupleRow* rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
false, static_cast<int8_t>(0), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 0);
lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000002"),
false, static_cast<int8_t>(1), static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000001"),
false, static_cast<int8_t>(1), static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 1);
lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000002"),
false, static_cast<int8_t>(1), static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000001"),
false, static_cast<int8_t>(42), static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), -1);
// Checking the dominance of types (bigger types should not dominate smaller ones)
lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
true, static_cast<int8_t>(0), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 23:59:59.999999999"),
false, static_cast<int8_t>(0), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 1);
lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
false, static_cast<int8_t>(0), static_cast<int64_t>(1) << 5, '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 23:59:59.999999999"),
false, static_cast<int8_t>(0), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 1);
lhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
false, static_cast<int8_t>(0), static_cast<int64_t>(1) << 5, '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
rhs = CreateTupleRow(
TimestampValue::ParseSimpleDateFormat("1400-01-01 00:00:00.000000000"),
false, static_cast<int8_t>(1), static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), -1);
comperator_->Close(runtime_state_);
}
// Without converting into 128-bit representation, only 64-bit comparison
TEST_F(TupleRowCompareTest, All64TypeTest) {
int precision = 9, scale = 0;
bool overflow = false;
CreateComperator(ColumnType(TYPE_BOOLEAN), ColumnType(TYPE_TINYINT),
ColumnType(TYPE_SMALLINT), ColumnType(TYPE_INT),
ColumnType(TYPE_BIGINT), ColumnType::CreateCharType(1),
ColumnType(ColumnType::CreateDecimalType(precision, scale)));
TupleRow* lhs = CreateTupleRow(
false, static_cast<int8_t>(0), static_cast<int16_t>(0), static_cast<int32_t>(0),
static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
TupleRow* rhs = CreateTupleRow(
false, static_cast<int8_t>(0), static_cast<int16_t>(0), static_cast<int32_t>(0),
static_cast<int64_t>(0), '~',
Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 0);
lhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
static_cast<int64_t>(1), 'z',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
rhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
static_cast<int64_t>(1), 'a',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 1);
lhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
rhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(56), static_cast<int32_t>(1),
static_cast<int64_t>(1), '~',
Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), -1);
comperator_->Close(runtime_state_);
}
// Without converting into 64-bit representation, only 32-bit comparison
TEST_F(TupleRowCompareTest, All32TypeTest) {
int precision = 9, scale = 0;
bool overflow = false;
CreateComperator(ColumnType(TYPE_BOOLEAN), ColumnType(TYPE_TINYINT),
ColumnType(TYPE_SMALLINT), ColumnType(TYPE_INT), ColumnType::CreateCharType(1),
ColumnType(ColumnType::CreateDecimalType(precision, scale)));
TupleRow* lhs = CreateTupleRow(
false, static_cast<int8_t>(0), static_cast<int16_t>(0), static_cast<int32_t>(0),
'~', Decimal4Value::FromInt(precision, scale, 0, &overflow));
TupleRow* rhs = CreateTupleRow(
false, static_cast<int8_t>(0), static_cast<int16_t>(0), static_cast<int32_t>(0),
'~', Decimal4Value::FromInt(precision, scale, 0, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 0);
lhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
'~', Decimal4Value::FromInt(precision, scale, 312, &overflow));
rhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
'~', Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), 1);
lhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(1),
'~', Decimal4Value::FromInt(precision, scale, 1, &overflow));
rhs = CreateTupleRow(
false, static_cast<int8_t>(1), static_cast<int16_t>(1), static_cast<int32_t>(56),
'~', Decimal4Value::FromInt(precision, scale, 1, &overflow));
EXPECT_EQ(comperator_->Compare(lhs, rhs), -1);
comperator_->Close(runtime_state_);
}
TEST_F(TupleRowCompareTest, StringTest) {
EXPECT_EQ(StringString4ByteTest("hello", "hello", "hello", "hello"), 0);
EXPECT_EQ(StringString4ByteTest(std::string(255, 'a'), std::string(255, 'a'),
std::string(255, 'a'), std::string(255, 'a')), 0);
EXPECT_EQ(StringString4ByteTest(std::string(2550, 'a'), std::string(2550, 'a'),
std::string(2550, 'a'), std::string(2550, 'a')), 0);
EXPECT_EQ(StringString4ByteTest("hello1", "hello2", "hello3", "hello4"), 0);
EXPECT_EQ(StringString4ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(StringString4ByteTest("", "h", "", ""), 1);
EXPECT_EQ(StringString4ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(StringString4ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(StringString4ByteTest("zz", "ydz", "a", "caaa"), 1);
EXPECT_EQ(StringString8ByteTest("hello1", "hello2", "hello3", "hello4"), -1);
EXPECT_EQ(StringString8ByteTest("12345678a", "12345678b",
"12345678c", "12345678d"), 0);
EXPECT_EQ(StringString8ByteTest("aa", "bbbbbbbb", "aa", "bbbbbbba"), 1);
EXPECT_EQ(StringString8ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(StringString8ByteTest("", "h", "", ""), 1);
EXPECT_EQ(StringString8ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(StringString8ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(StringString8ByteTest("zz", "ydz", "a", "caaa"), 1);
EXPECT_EQ(StringString16ByteTest("12345678a", "12345678b",
"12345678c", "12345678d"), -1);
EXPECT_EQ(StringString16ByteTest("1234567812345678a", "1234567812345678b",
"1234567812345678c", "1234567812345678d"), 0);
EXPECT_EQ(StringString16ByteTest("aa", "bbbbbbbb", "aa", "bbbbbbba"), 1);
EXPECT_EQ(StringString16ByteTest("aa", "1234567812345678",
"aa", "1234567812345679"), -1);
EXPECT_EQ(StringString16ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(StringString16ByteTest("", "h", "", ""), 1);
EXPECT_EQ(StringString16ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(StringString16ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(StringString16ByteTest("zz", "ydz", "a", "caaa"), 1);
}
TEST_F(TupleRowCompareTest, VarcharTest) {
EXPECT_EQ(VarcharVarchar4ByteTest("hello", "hello", "hello", "hello"), 0);
EXPECT_EQ(VarcharVarchar4ByteTest("hello", "hello", "hello", "hello"), 0);
EXPECT_EQ(VarcharVarchar4ByteTest(std::string(255, 'a'), std::string(255, 'a'),
std::string(255, 'a'), std::string(255, 'a')), 0);
EXPECT_EQ(VarcharVarchar4ByteTest(std::string(2550, 'a'), std::string(2550, 'a'),
std::string(2550, 'a'), std::string(2550, 'a')), 0);
EXPECT_EQ(VarcharVarchar4ByteTest("hello1", "hello2", "hello3", "hello4"), 0);
EXPECT_EQ(VarcharVarchar4ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(VarcharVarchar4ByteTest("", "h", "", ""), 1);
EXPECT_EQ(VarcharVarchar4ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(VarcharVarchar4ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(VarcharVarchar4ByteTest("zz", "ydz", "a", "caaa"), 1);
EXPECT_EQ(VarcharVarchar8ByteTest("hello1", "hello2", "hello3", "hello4"), -1);
EXPECT_EQ(VarcharVarchar8ByteTest("12345678a", "12345678b",
"12345678c", "12345678d"), 0);
EXPECT_EQ(VarcharVarchar8ByteTest("aa", "bbbbbbbb", "aa", "bbbbbbba"), 1);
EXPECT_EQ(VarcharVarchar8ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(VarcharVarchar8ByteTest("", "h", "", ""), 1);
EXPECT_EQ(VarcharVarchar8ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(VarcharVarchar8ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(VarcharVarchar8ByteTest("zz", "ydz", "a", "caaa"), 1);
EXPECT_EQ(VarcharVarchar16ByteTest("12345678a", "12345678b",
"12345678c", "12345678d"), -1);
EXPECT_EQ(VarcharVarchar16ByteTest("1234567812345678a", "1234567812345678b",
"1234567812345678c", "1234567812345678d"), 0);
EXPECT_EQ(VarcharVarchar16ByteTest("aa", "bbbbbbbb", "aa", "bbbbbbba"), 1);
EXPECT_EQ(VarcharVarchar16ByteTest("aa", "1234567812345678",
"aa", "1234567812345679"), -1);
EXPECT_EQ(VarcharVarchar16ByteTest("2", "h", "2", "h2"), -1);
EXPECT_EQ(VarcharVarchar16ByteTest("", "h", "", ""), 1);
EXPECT_EQ(VarcharVarchar16ByteTest("ab", "cd", "aw", "ca"), -1);
EXPECT_EQ(VarcharVarchar16ByteTest("ab", "yd", "ac", "ca"), 1);
EXPECT_EQ(VarcharVarchar16ByteTest("zz", "ydz", "a", "caaa"), 1);
}
} //namespace impala
```
|
```java
package chapter5.section5;
import edu.princeton.cs.algs4.BinaryStdIn;
import edu.princeton.cs.algs4.BinaryStdOut;
/**
* Created by Rene Argento on 13/04/18.
*/
public class RunLengthEncoding {
private static final int LG_R = 8;
public static void compress() {
char count = 0;
boolean old = false;
while (!BinaryStdIn.isEmpty()) {
boolean bit = BinaryStdIn.readBoolean();
if (bit != old) {
BinaryStdOut.write(count, LG_R);
count = 0;
old = !old;
} else {
if (count == 255) {
BinaryStdOut.write(count, LG_R);
count = 0;
BinaryStdOut.write(count, LG_R);
}
}
count++;
}
BinaryStdOut.write(count);
BinaryStdOut.close();
}
public static void expand() {
boolean bit = false;
while (!BinaryStdIn.isEmpty()) {
char count = BinaryStdIn.readChar();
for (int i = 0; i < count; i++) {
BinaryStdOut.write(bit);
}
bit = !bit;
}
BinaryStdOut.close();
}
public static void main(String[] args) {
if (args[0].equals("-")) {
compress();
} else if (args[0].equals("+")) {
expand();
}
}
}
```
|
```c++
// (See accompanying file LICENSE.md or copy at path_to_url
#include <boost/hana/equal.hpp>
#include <boost/hana/then.hpp>
#include <boost/hana/tuple.hpp>
namespace hana = boost::hana;
struct undefined { };
static_assert(
hana::then(hana::make_tuple(undefined{}, undefined{}), hana::make_tuple(1, 2, 3))
==
hana::make_tuple(
1, 2, 3,
1, 2, 3
)
, "");
int main() { }
```
|
```c#
@{
Layout = null;
}
<!DOCTYPE html>
<!--[if IE 8]> <html lang="zh" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="zh" class="ie9"> <![endif]-->
<!--[if !IE]><!-->
<html lang="zh">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
<meta charset="utf-8" />
<meta content="width=device-width, initial-scale=1.0" name="viewport" />
@Html.Partial("_Title")
@Html.Raw(ViewBag.CssFile)
</head>
<body class="fixed-top">
<div class="row-fluid" style="border: 1px solid #DDDDDD;">
/:<input id="txtLocal" name="txtLocal" type="text" class="searchinfo" />
<select id="ddlLocalType" name="ddlLocalType" class="searchselect">@Html.Raw(ViewBag.LocalType)</select>
<a id="gritter-remove-all" class="btn btn-info" href="javascript:void(0)" onclick="Local_Common.PageClick(1)"></a>
</div>
<table class="table table-striped table-bordered table-hover" id="dialog_tabInfo" style="margin-bottom: 0px;">
<thead>
<tr class="widget-title">
<th style="width: 8px;"><input type="checkbox" class="group-checkable" /></th>
<th class="hidden-480"></th>
<th class="hidden-480"></th>
<th class="hidden-480"></th>
<th class="hidden-480"></th>
<th class="hidden-480"></th>
</tr>
</thead>
<tbody>
</tbody>
</table>
<div id="dialog_mypager" class="row-fluid">
</div>
<script type="text/ecmascript">
var Local_Common = {
PageClick: function (pageIndex, pageSize) {
pageSize = pageSize == undefined ? 7 : pageSize;
var LocalName = $("#txtLocal").val();
var LocalType = $("#ddlLocalType").val();
var param = {};
param["PageIndex"] = pageIndex;
param["PageSize"] = pageSize;
param["LocalName"] = LocalName;
param["LocalType"] = LocalType;
$.gitAjax({
url: "/Storage/LocationAjax/GetList",
data: param,
type: "post",
dataType: "json",
success: function (result) {
var json = result;
var Html = "";
if (json.Data != undefined && json.Data.List != undefined && json.Data.List.length > 0) {
$(json.Data.List).each(function (i, item) {
Html += "<tr>";
Html += "<td><input type=\"checkbox\" name=\"local_item\" class=\"checkboxes\" data-value=\"" + escape(JSON.stringify(item)) + "\" value=\"" + item.LocalNum + "\"/></td>";
Html += "<td>" + item.LocalBarCode + "</td>";
Html += "<td>" + git.GetStrSub(item.LocalName, 14) + "</td>";
Html += "<td>" + item.LocalType + "</td>";
Html += "<td>" + item.IsForbid + "</td>";
Html += "<td>" + item.IsDefault + "</td>";
Html += "</tr>";
});
}
$("#dialog_tabInfo tbody").html(Html);
$("#dialog_mypager").minpager({ pagenumber: pageIndex, recordCount: json.RowCount, pageSize: pageSize, buttonClickCallback: Local_Common.PageClick });
$("#dialog_tabInfo").find("input[type='checkbox']").attr("checked", false);
}
});
}
}
Local_Common.PageClick(1, 7);
</script>
</body>
</html>
```
|
```lua
--Enter a specifiec directory/path/drive
local args = {...} --Get the arguments passed to this program
if #args < 1 or args[1] == "-?" then
printUsage(
"cd <directory>", "Change Directory",
"cd ..", "Go back one directory",
"cd <drive>:", "Change active drive"
)
return
end
local tar = table.concat(args," ") --The path may include whitespaces
local term = require("terminal")
tar = term.resolve(tar)
local ok, err = pcall(term.setpath,tar)
if not ok then
return 1, tostring(err)
end
```
|
```html
<html><head><title>Epydoc Redirect Page</title>
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<script type="text/javascript" src="epydoc.js"></script>
</head>
<body>
<script type="text/javascript">
<!--
var pages = ["pypattyrn.structural.decorator.DecoratorComplex-c", "pypattyrn.structural.decorator.DecoratorSimple-c", "pypattyrn.creational.factory.AbstractFactory-c", "pypattyrn.structural.flyweight.FlyweightMeta-c", "pypattyrn.structural.decorator.CallWrapper-c", "pypattyrn.behavioral.observer.Observable-c", "pypattyrn.creational.prototype.Prototype-c", "pypattyrn.creational.singleton.Singleton-c", "pypattyrn.structural.composite.Composite-c", "pypattyrn.structural.decorator.Decorator-c", "pypattyrn.behavioral.memento.Originator-c", "pypattyrn.behavioral.iterator.Iterable-c", "pypattyrn.behavioral.iterator.Iterator-c", "pypattyrn.behavioral.mediator.Mediator-c", "pypattyrn.behavioral.observer.Observer-c", "pypattyrn.behavioral.command.Receiver-c", "pypattyrn.creational.builder.Director-c", "pypattyrn.behavioral.chain.ChainLink-c", "pypattyrn.behavioral.command.Command-c", "pypattyrn.behavioral.command.Invoker-c", "pypattyrn.behavioral.memento.Memento-c", "pypattyrn.behavioral.visitor.Visitee-c", "pypattyrn.behavioral.visitor.Visitor-c", "pypattyrn.creational.builder.Builder-c", "pypattyrn.creational.factory.Factory-c", "pypattyrn.structural.adapter.Adapter-c", "pypattyrn.creational.pool.Reusable-c", "pypattyrn.behavioral.chain.Chain-c", "pypattyrn.creational.prototype-m", "pypattyrn.creational.singleton-m", "pypattyrn.structural.composite-m", "pypattyrn.structural.decorator-m", "pypattyrn.structural.flyweight-m", "pypattyrn.behavioral.null.Null-c", "pypattyrn.creational.pool.Pool-c", "pypattyrn.behavioral.iterator-m", "pypattyrn.behavioral.mediator-m", "pypattyrn.behavioral.observer-m", "pypattyrn.behavioral.command-m", "pypattyrn.behavioral.memento-m", "pypattyrn.behavioral.visitor-m", "pypattyrn.creational.builder-m", "pypattyrn.creational.factory-m", "pypattyrn.structural.adapter-m", "pypattyrn.behavioral.chain-m", "pypattyrn.behavioral.null-m", "pypattyrn.creational.pool-m", "pypattyrn.behavioral-m", "pypattyrn.creational-m", "pypattyrn.structural-m", "pypattyrn-m"];
var dottedName = get_anchor();
if (dottedName) {
var target = redirect_url(dottedName);
if (target) window.location.replace(target);
}
// -->
</script>
<h3>Epydoc Auto-redirect page</h3>
<p>When javascript is enabled, this page will redirect URLs of
the form <tt>redirect.html#<i>dotted.name</i></tt> to the
documentation for the object with the given fully-qualified
dotted name.</p>
<p><a id="message"> </a></p>
<script type="text/javascript">
<!--
if (dottedName) {
var msg = document.getElementById("message");
msg.innerHTML = "No documentation found for <tt>"+
dottedName+"</tt>";
}
// -->
</script>
</body>
</html>
```
|
```objective-c
#ifndef SELECT_FROM_LIST_DIALOG_H
#define SELECT_FROM_LIST_DIALOG_H
#include <QDialog>
#include <deque>
#include "ui_selectlistdialog.h"
namespace Ui
{
class SelectFromListDialog;
}
class SelectFromListDialog : public QDialog
{
Q_OBJECT
public:
explicit SelectFromListDialog(const std::deque<std::string>& fields,
bool single_selection = true, QWidget* parent = 0);
~SelectFromListDialog();
std::vector<int> getSelectedRowNumber() const;
private slots:
void on_buttonBox_accepted();
void on_listFieldsWidget_currentRowChanged(int currentRow);
void on_listFieldsWidget_doubleClicked(const QModelIndex& index);
void on_pushButtonSelectAll_pressed();
void on_listFieldsWidget_clicked(const QModelIndex& index);
private:
Ui::SelectXAxisDialog* ui;
std::vector<int> _selected_row_number;
bool _single_selection;
};
//-----------------------------------------------
inline SelectFromListDialog::SelectFromListDialog(const std::deque<std::string>& fields,
bool single_selection, QWidget* parent)
: QDialog(parent), ui(new Ui::SelectXAxisDialog), _single_selection(single_selection)
{
auto flags = this->windowFlags();
this->setWindowFlags(flags | Qt::WindowStaysOnTopHint);
ui->setupUi(this);
if (!_single_selection)
{
ui->listFieldsWidget->setSelectionMode(QAbstractItemView::ExtendedSelection);
}
else
{
ui->pushButtonSelectAll->hide();
}
// if there is only one item in the list, select it by default
for (int i = 0; i < fields.size(); i++)
{
auto item = new QListWidgetItem(QString::fromStdString(fields[i]));
ui->listFieldsWidget->addItem(item);
if (fields.size() == 1)
{
item->setSelected(true);
}
}
}
inline SelectFromListDialog::~SelectFromListDialog()
{
delete ui;
}
inline std::vector<int> SelectFromListDialog::getSelectedRowNumber() const
{
return _selected_row_number;
}
inline void SelectFromListDialog::on_listFieldsWidget_clicked(const QModelIndex& index)
{
QModelIndexList indexes = ui->listFieldsWidget->selectionModel()->selectedIndexes();
ui->buttonBox->setEnabled(indexes.empty() == false);
}
inline void SelectFromListDialog::on_buttonBox_accepted()
{
QModelIndexList indexes = ui->listFieldsWidget->selectionModel()->selectedIndexes();
foreach (QModelIndex index, indexes)
{
_selected_row_number.push_back(index.row());
}
}
inline void SelectFromListDialog::on_listFieldsWidget_currentRowChanged(int)
{
QModelIndexList indexes = ui->listFieldsWidget->selectionModel()->selectedIndexes();
ui->buttonBox->setEnabled(indexes.empty() == false);
}
inline void SelectFromListDialog::on_listFieldsWidget_doubleClicked(const QModelIndex&)
{
if (_single_selection)
{
_selected_row_number.push_back(ui->listFieldsWidget->currentRow());
this->accept();
}
}
inline void SelectFromListDialog::on_pushButtonSelectAll_pressed()
{
for (int i = 0; i < ui->listFieldsWidget->count(); i++)
{
_selected_row_number.push_back(i);
}
this->accept();
}
#endif // SELECTXAXISDIALOG_H
```
|
Rozanne Gold is an American chef, journalist, cookbook author, and international restaurant consultant. A four-time winner of the James Beard Award, she is a graduate of Tufts University in psychology and education, and holds an MFA in poetry from the New School for Social Research in New York City.
Career
Rozanne was first chef to New York Mayor Ed Koch at the age of 23 and has cooked for Presidents and Prime Ministers. She is best known for the trends she has inspired, including "The Minimalist" column in The New York Times (which was based on her cookbook Recipes 1-2-3), Little Meals, which began the grazing craze; Cafe Greco, New York's first Med-Rim restaurant; Hudson River Cuisine for the 3-star Hudson River Club, and much more. Gold is Chef-Director of the restaurant consulting firm, Baum+Whiteman, best known for creating Windows on the World; the Rainbow Room, where Gold was consulting chef and an owner from 1987 to 2000, and three of New York's three-star restaurants.
She is the author of twelve cookbooks, including the award-winning 1-2-3 cookbook series. Her latest cookbook, Radically Simple: Brilliant Flavors with Breathtaking Ease, was hailed as one of the year's "best" by The New York Times, People, and Good Morning America. Rozanne Gold is a well-known food writer and journalist who has written more than 600 articles for national magazines, newspapers, and blogs. These publications include
Bon Appetit, Gourmet, Cooking Light, The New York Times, The Wall Street Journal, and The Huffington Post. In order to save it from its demise, Ms. Gold purchased the Gourmet cookbook library and donated it to New York University. Ms. Gold is a contributor to Savoring Gotham (Oxford University Press, 2015), 1001 Restaurants to Experience Before You Die (Barrons, 2014), and wrote the foreword to Fresh Cooking by Shelley Boris (Monkfish Publishing, 2014.) A well-respected moderator, she appeared at the New School's Gotham on a Plate (2015) and Les Dames d'Escoffier's The Next Big Bite (2015) public forums. Her poetry has been published by Blue Lake Review, The Loom, and Villanness Press. She is a featured contributor to Cooking Light magazine and a blogger for the Huffington Post. Her career has been featured in Business Week, More, Mirabella, Gourmet, Cooking Light, Bon Appetit, Savoring Gotham, among many other publications. She is a frequent guest on National Public Radio and was among the first chefs on the Food Network.
Rozanne is past President of Les Dames d'Escoffier, New York and is a trustee of The New York Zen Center for Contemplative Care. She graduated from Tufts University cum laude, did graduate work at New York University, and has an MFA in poetry from the New School. She works as an end-of-life care doula at various New York City hospices. Her poetry can be found in several on-line and print publications.
Personal life
Rozanne grew up in Queens, New York with her parents, Marion and Bernard Gold, and her brother, Leon Gold. Her father, Bill (Bernard) Gold scored the winning touchdown for the 1943 Sugar Bowl (as a fullback for the Tennessee Vols), and was later drafted by the Washington Redskins. Bill, who grew up in Brockton, Massachusetts was Rocky Marciano's sparring partner. Rozanne's mother, Marion Gold, grew up in Pahokee, Florida, attended the University of Miami, and was a medical secretary and teacher. Gold now lives in Brooklyn, New York. Her husband, Michael Whiteman, is an international restaurant consultant, and president of Baum + Whiteman, the company that created five of New York's three-star restaurants, including the Rainbow Room and Windows on the World. [www.baumwhiteman.com] Their son, Jeremy Whiteman, is a computer consultant and photographer in San Bruno, California, and their daughter, Shayna DePersia, is a graduate student at the Bank Street College of Education.
Books
Articles
Gold, Rozanne. "The Giulianis' Front Burner." The New York Times, January 29, 1994, Op-Ed
Gold, Rozanne. "A Fool for Food? Try Some of These.” The New York Times, March 20, 1994, The Living Section; C1, C8.
Gold, Rozanne. “A Region’s Tastes Commingle in Israel.” The New York Times, July 20, 1994, The Living Section; C1, C 6.
Gold, Rozanne. “Letter To The Editor: Inventive Chefs Are Cooking From History,” The New York Times, July 22, 1999.
Gold, Rozanne. “Subtle Variations Lift an Already Sublime Dessert.” The New York Times, June 21, 2000.
Gold, Rozanne. “A Real Italian Import Puts Imitators to Shame.” The New York Times, July 5, 2000, F2.
Gold, Rozanne. “A Chill in the Air for Free-Range Chickens.” The New York Times, July 26, 2000, F5.
Gold, Rozanne. “Letters.” The New York Times Magazine. February 23, 2003. [In response to: Dominus, Susan. Everybody Has a Mother, The New York
Times, February 9, 2003.]
Reynolds, Jonathan. Produced by Rozanne Gold. “Have It Their Way.” The New York Times, May 4, 2003, Section 6, 78–82.
Burros, Marian and Rozanne Gold. “American Made: New White House Pastry Chef.” The New York Times, September 1, 2004.
Gold, Rozanne. “Vinaigrettes Switch Courses, Going Savory and Sweet.” The New York Times, November 17, 2004, F5.
Gold, Rozanne. “Jazzing Up the Bird.” The Wall Street Journal, November 12–13, 2011.
Gold, Rozanne. “The Rules of Recipe Attraction.” The Wall Street Journal, January 14–15, 2012, D7.
Gold, Rozanne. “Books to Make You Hungry.” Huffington Post, August 21, 2014.
Gold, Rozanne. “Chocolate to Live For.” Huffington Post, August 14, 1014.
Gold, Rozanne. “Olives, Lemons & Za’atar.” Huffington Post, June 15, 2014.
Gold, Rozanne. “Farm-to-Tray: Fighting Hunger.” Huffington Post, April 1, 2014.
Gold, Rozanne. “Techno-Gastronomy in the Big Apple.” Huffington Post, March 16, 2014.
Gold, Rozanne. “Dessert-on-a-Sheet Pan.” Huffington Post, February 6, 2014.
Gold, Rozanne. “Dinner-on-a-Sheet Pan.” Huffington Post, February 5, 2014.
Gold, Rozanne. “Super Bowl Recipe Roundup.” Huffington Post, February 1, 2014.
Gold, Rozanne. “12 Hottest Food Trends for 2014.” Huffington Post, November 9, 2013.
Gold, Rozanne. “One Year Later: 100,000 Meals.” Huffington Post, October 30, 2013.
Gold, Rozanne. “Read All About It: Israel’s emerging Food Scene.” Huffington Post, October 8, 2013.
Gold, Rozanne. “Chop Chop: Making Healthy Kids.” Huffington Post, July 20, 2013.
Gold, Rozanne. “Are blonds Having More Fun?” Huffington Post, June 8, 2013.
Gold, Rozanne. “The Gaza Kitchen.” Huffington Post, April 29, 2013.
Gold, Rozanne. “Thinking About Fast Food and Flavor.” Huffington Post, April 23, 2013.
Gold, Rozanne. “The Power of Packaging.” Huffington Post, April 8, 2013.
Gold, Rozanne. “Purple Cupcake Day.” Huffington Post, March 24, 2013.
Gold, Rozanne. “The Most Sensual Diet.” Huffington Post, February 27, 2013.
Gold, Rozanne. “Mixed-up Menu Trends.” Huffington Post, February 22, 2013.
Gold, Rozanne. “Ed Koch’s First Chef.” Huffington Post, February 8, 2013.
Gold, Rozanne. “Eating Your Way Through 2013.” Huffington Post, December 28, 2012.
Gold, Rozanne. “Who Needs Quinoa More Than You Do?” Huffington Post, November 30, 2012.
Gold, Rozanne. “Seeing Stars and What They Mean: Michelin Magic.” Huffington Post, October 4, 2012.
Gold, Rozanne. “How I Bought 3,500 Cookbooks and Got 6,317.” Huffington Post, February 8, 2012.
Gold, Rozanne. “Food Trend: POP Goes Peru.” Huffington Post, September 27, 2011.
Gold, Rozanne. “French Meal as National Treasure.” Huffington Post, September 19, 2011.
Gold, Rozanne. “The Enlightened Cook, Radically Simple Cooking:Vinaigrettes Get Saucy.” Cooking Light 26, no. 4 (May 2012): 136–140.
Gold, Rozanne. “The Enlightened Cook, Simple Cooking: Radically Simple Hannukah.”Cooking Light 26, no. 11 (December 2012): 158–162.
Gold, Rozanne. “The Way to a Mayor’s Heart.” The Jewish Week, February 12, 2013.
Awards and honors
James Beard Award
Little Meals—winner, best cookbook, general category (1994)
Recipes 1-2-3--winner, best cookbook, general category (1996)
Recipes 1-2-3 Menu Cookbook—nominated for best cookbook, general category (1998)
Entertaining 1-2-3--winner, best cookbook, entertaining category (1999)
Healthy 1-2-3--nominated for best cookbook, general category (2002)
Leonard Lopate Show with Rozanne Gold, winner, best radio show segment (2009)
IACP/Julia Child Award
Healthy 1-2-3--winner, best cookbook, healthy category (2002)
Entertaining 1-2-3--nominated, best cookbook, entertaining category (1999)
Additional Awards and Honors
Olive Tree Award, Jewish National Fund, (1996)
Hospitality Professional of the Year, Food and Beverage Association of America, (1997)
Drexel Visiting Professor, (2000)
International Association of Audio Information Service, Program of the Year, (2007). For From the Kitchen: “Interview with Rozanne Gold,” InTouch Networks, New York
References
External links
Rozanne Gold's Website
Rozanne Gold's Radically Simple blog
Rozanne on the Leonard Lopate Show
New York Times Best Cookbooks of 2010
American chefs
Living people
American cookbook writers
Women cookbook writers
American women chefs
James Beard Foundation Award winners
Year of birth missing (living people)
21st-century American women
|
```xml
/**
* @file Automatically generated by @tsed/barrels.
*/
export * from "./decorators/injectContext.js";
export * from "./domain/ContextLogger.js";
export * from "./domain/DIContext.js";
export * from "./interfaces/AlterRunInContext.js";
export * from "./services/DILogger.js";
export * from "./services/DITest.js";
export * from "./utils/asyncHookContext.js";
export * from "./utils/attachLogger.js";
export * from "./utils/setLoggerConfiguration.js";
export * from "./utils/setLoggerFormat.js";
export * from "./utils/setLoggerLevel.js";
```
|
```objective-c
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef V8_AST_SCOPES_H_
#define V8_AST_SCOPES_H_
#include "src/ast/ast.h"
#include "src/base/compiler-specific.h"
#include "src/base/hashmap.h"
#include "src/globals.h"
#include "src/objects.h"
#include "src/zone/zone.h"
namespace v8 {
namespace internal {
class AstNodeFactory;
class AstValueFactory;
class AstRawString;
class Declaration;
class ParseInfo;
class PreParsedScopeData;
class ProducedPreParsedScopeData;
class SloppyBlockFunctionStatement;
class Statement;
class StringSet;
class VariableProxy;
// A hash map to support fast variable declaration and lookup.
class VariableMap: public ZoneHashMap {
public:
explicit VariableMap(Zone* zone);
Variable* Declare(
Zone* zone, Scope* scope, const AstRawString* name, VariableMode mode,
VariableKind kind = NORMAL_VARIABLE,
InitializationFlag initialization_flag = kCreatedInitialized,
MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
bool* added = nullptr);
// Records that "name" exists (if not recorded yet) but doesn't create a
// Variable. Useful for preparsing.
Variable* DeclareName(Zone* zone, const AstRawString* name,
VariableMode mode);
Variable* Lookup(const AstRawString* name);
void Remove(Variable* var);
void Add(Zone* zone, Variable* var);
};
// Sloppy block-scoped function declarations to var-bind
class SloppyBlockFunctionMap : public ZoneHashMap {
public:
class Delegate : public ZoneObject {
public:
Delegate(Scope* scope, SloppyBlockFunctionStatement* statement, int index)
: scope_(scope), statement_(statement), next_(nullptr), index_(index) {}
void set_statement(Statement* statement);
void set_next(Delegate* next) { next_ = next; }
Delegate* next() const { return next_; }
Scope* scope() const { return scope_; }
int index() const { return index_; }
private:
Scope* scope_;
SloppyBlockFunctionStatement* statement_;
Delegate* next_;
int index_;
};
explicit SloppyBlockFunctionMap(Zone* zone);
void Declare(Zone* zone, const AstRawString* name, Scope* scope,
SloppyBlockFunctionStatement* statement);
private:
int count_;
};
enum class AnalyzeMode { kRegular, kDebugger };
// Global invariants after AST construction: Each reference (i.e. identifier)
// to a JavaScript variable (including global properties) is represented by a
// VariableProxy node. Immediately after AST construction and before variable
// allocation, most VariableProxy nodes are "unresolved", i.e. not bound to a
// corresponding variable (though some are bound during parse time). Variable
// allocation binds each unresolved VariableProxy to one Variable and assigns
// a location. Note that many VariableProxy nodes may refer to the same Java-
// Script variable.
// JS environments are represented in the parser using Scope, DeclarationScope
// and ModuleScope. DeclarationScope is used for any scope that hosts 'var'
// declarations. This includes script, module, eval, varblock, and function
// scope. ModuleScope further specializes DeclarationScope.
class V8_EXPORT_PRIVATE Scope : public NON_EXPORTED_BASE(ZoneObject) {
public:
// your_sha256_hash-----------
// Construction
Scope(Zone* zone, Scope* outer_scope, ScopeType scope_type);
#ifdef DEBUG
// The scope name is only used for printing/debugging.
void SetScopeName(const AstRawString* scope_name) {
scope_name_ = scope_name;
}
void set_needs_migration() { needs_migration_ = true; }
#endif
// TODO(verwaest): Is this needed on Scope?
int num_parameters() const;
DeclarationScope* AsDeclarationScope();
const DeclarationScope* AsDeclarationScope() const;
ModuleScope* AsModuleScope();
const ModuleScope* AsModuleScope() const;
class Snapshot final BASE_EMBEDDED {
public:
explicit Snapshot(Scope* scope);
~Snapshot();
void Reparent(DeclarationScope* new_parent) const;
private:
Scope* outer_scope_;
Scope* top_inner_scope_;
VariableProxy* top_unresolved_;
ThreadedList<Variable>::Iterator top_local_;
ThreadedList<Declaration>::Iterator top_decl_;
const bool outer_scope_calls_eval_;
};
enum class DeserializationMode { kIncludingVariables, kScopesOnly };
static Scope* DeserializeScopeChain(Zone* zone, ScopeInfo* scope_info,
DeclarationScope* script_scope,
AstValueFactory* ast_value_factory,
DeserializationMode deserialization_mode);
// Checks if the block scope is redundant, i.e. it does not contain any
// block scoped declarations. In that case it is removed from the scope
// tree and its children are reparented.
Scope* FinalizeBlockScope();
bool HasBeenRemoved() const;
// Find the first scope that hasn't been removed.
Scope* GetUnremovedScope();
// Inserts outer_scope into this scope's scope chain (and removes this
// from the current outer_scope_'s inner scope list).
// Assumes outer_scope_ is non-null.
void ReplaceOuterScope(Scope* outer_scope);
Zone* zone() const { return zone_; }
void SetMustUsePreParsedScopeData() {
if (must_use_preparsed_scope_data_) {
return;
}
must_use_preparsed_scope_data_ = true;
if (outer_scope_) {
outer_scope_->SetMustUsePreParsedScopeData();
}
}
bool must_use_preparsed_scope_data() const {
return must_use_preparsed_scope_data_;
}
// your_sha256_hash-----------
// Declarations
// Lookup a variable in this scope. Returns the variable or nullptr if not
// found.
Variable* LookupLocal(const AstRawString* name) {
Variable* result = variables_.Lookup(name);
if (result != nullptr || scope_info_.is_null()) return result;
return LookupInScopeInfo(name);
}
Variable* LookupInScopeInfo(const AstRawString* name);
// Lookup a variable in this scope or outer scopes.
// Returns the variable or nullptr if not found.
Variable* Lookup(const AstRawString* name);
// Declare a local variable in this scope. If the variable has been
// declared before, the previously declared variable is returned.
Variable* DeclareLocal(const AstRawString* name, VariableMode mode,
InitializationFlag init_flag = kCreatedInitialized,
VariableKind kind = NORMAL_VARIABLE,
MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
Variable* DeclareVariable(Declaration* declaration, VariableMode mode,
InitializationFlag init,
bool* sloppy_mode_block_scope_function_redefinition,
bool* ok);
// The return value is meaningful only if FLAG_preparser_scope_analysis is on.
Variable* DeclareVariableName(const AstRawString* name, VariableMode mode);
void DeclareCatchVariableName(const AstRawString* name);
// Declarations list.
ThreadedList<Declaration>* declarations() { return &decls_; }
ThreadedList<Variable>* locals() { return &locals_; }
// Create a new unresolved variable.
VariableProxy* NewUnresolved(AstNodeFactory* factory,
const AstRawString* name,
int start_pos = kNoSourcePosition,
VariableKind kind = NORMAL_VARIABLE) {
// Note that we must not share the unresolved variables with
// the same name because they may be removed selectively via
// RemoveUnresolved().
DCHECK(!already_resolved_);
DCHECK_EQ(factory->zone(), zone());
VariableProxy* proxy = factory->NewVariableProxy(name, kind, start_pos);
proxy->set_next_unresolved(unresolved_);
unresolved_ = proxy;
return proxy;
}
void AddUnresolved(VariableProxy* proxy);
// Remove a unresolved variable. During parsing, an unresolved variable
// may have been added optimistically, but then only the variable name
// was used (typically for labels). If the variable was not declared, the
// addition introduced a new unresolved variable which may end up being
// allocated globally as a "ghost" variable. RemoveUnresolved removes
// such a variable again if it was added; otherwise this is a no-op.
bool RemoveUnresolved(VariableProxy* var);
// Creates a new temporary variable in this scope's TemporaryScope. The
// name is only used for printing and cannot be used to find the variable.
// In particular, the only way to get hold of the temporary is by keeping the
// Variable* around. The name should not clash with a legitimate variable
// names.
// TODO(verwaest): Move to DeclarationScope?
Variable* NewTemporary(const AstRawString* name);
// your_sha256_hash-----------
// Illegal redeclaration support.
// Check if the scope has conflicting var
// declarations, i.e. a var declaration that has been hoisted from a nested
// scope over a let binding of the same name.
Declaration* CheckConflictingVarDeclarations();
// Check if the scope has a conflicting lexical declaration that has a name in
// the given list. This is used to catch patterns like
// `try{}catch(e){let e;}`,
// which is an error even though the two 'e's are declared in different
// scopes.
Declaration* CheckLexDeclarationsConflictingWith(
const ZoneList<const AstRawString*>& names);
// your_sha256_hash-----------
// Scope-specific info.
// Inform the scope and outer scopes that the corresponding code contains an
// eval call.
void RecordEvalCall() {
scope_calls_eval_ = true;
}
void RecordInnerScopeEvalCall() {
inner_scope_calls_eval_ = true;
for (Scope* scope = outer_scope(); scope != nullptr;
scope = scope->outer_scope()) {
if (scope->inner_scope_calls_eval_) {
return;
}
scope->inner_scope_calls_eval_ = true;
}
}
// Set the language mode flag (unless disabled by a global flag).
void SetLanguageMode(LanguageMode language_mode) {
DCHECK(!is_module_scope() || is_strict(language_mode));
set_language_mode(language_mode);
}
// Inform the scope that the scope may execute declarations nonlinearly.
// Currently, the only nonlinear scope is a switch statement. The name is
// more general in case something else comes up with similar control flow,
// for example the ability to break out of something which does not have
// its own lexical scope.
// The bit does not need to be stored on the ScopeInfo because none of
// the three compilers will perform hole check elimination on a variable
// located in VariableLocation::CONTEXT. So, direct eval and closures
// will not expose holes.
void SetNonlinear() { scope_nonlinear_ = true; }
// Position in the source where this scope begins and ends.
//
// * For the scope of a with statement
// with (obj) stmt
// start position: start position of first token of 'stmt'
// end position: end position of last token of 'stmt'
// * For the scope of a block
// { stmts }
// start position: start position of '{'
// end position: end position of '}'
// * For the scope of a function literal or decalaration
// function fun(a,b) { stmts }
// start position: start position of '('
// end position: end position of '}'
// * For the scope of a catch block
// try { stms } catch(e) { stmts }
// start position: start position of '('
// end position: end position of ')'
// * For the scope of a for-statement
// for (let x ...) stmt
// start position: start position of '('
// end position: end position of last token of 'stmt'
// * For the scope of a switch statement
// switch (tag) { cases }
// start position: start position of '{'
// end position: end position of '}'
int start_position() const { return start_position_; }
void set_start_position(int statement_pos) {
start_position_ = statement_pos;
}
int end_position() const { return end_position_; }
void set_end_position(int statement_pos) {
end_position_ = statement_pos;
}
// Scopes created for desugaring are hidden. I.e. not visible to the debugger.
bool is_hidden() const { return is_hidden_; }
void set_is_hidden() { is_hidden_ = true; }
void ForceContextAllocationForParameters() {
DCHECK(!already_resolved_);
force_context_allocation_for_parameters_ = true;
}
bool has_forced_context_allocation_for_parameters() const {
return force_context_allocation_for_parameters_;
}
// your_sha256_hash-----------
// Predicates.
// Specific scope types.
bool is_eval_scope() const { return scope_type_ == EVAL_SCOPE; }
bool is_function_scope() const { return scope_type_ == FUNCTION_SCOPE; }
bool is_module_scope() const { return scope_type_ == MODULE_SCOPE; }
bool is_script_scope() const { return scope_type_ == SCRIPT_SCOPE; }
bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; }
bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; }
bool is_with_scope() const { return scope_type_ == WITH_SCOPE; }
bool is_declaration_scope() const { return is_declaration_scope_; }
bool inner_scope_calls_eval() const { return inner_scope_calls_eval_; }
bool IsAsmModule() const;
// Returns true if this scope or any inner scopes that might be eagerly
// compiled are asm modules.
bool ContainsAsmModule() const;
// Does this scope have the potential to execute declarations non-linearly?
bool is_nonlinear() const { return scope_nonlinear_; }
// Whether this needs to be represented by a runtime context.
bool NeedsContext() const {
// Catch scopes always have heap slots.
DCHECK(!is_catch_scope() || num_heap_slots() > 0);
return num_heap_slots() > 0;
}
// your_sha256_hash-----------
// Accessors.
// The type of this scope.
ScopeType scope_type() const { return scope_type_; }
// The language mode of this scope.
LanguageMode language_mode() const {
return is_strict_ ? LanguageMode::kStrict : LanguageMode::kSloppy;
}
// inner_scope() and sibling() together implement the inner scope list of a
// scope. Inner scope points to the an inner scope of the function, and
// "sibling" points to a next inner scope of the outer scope of this scope.
Scope* inner_scope() const { return inner_scope_; }
Scope* sibling() const { return sibling_; }
// The scope immediately surrounding this scope, or nullptr.
Scope* outer_scope() const { return outer_scope_; }
Variable* catch_variable() const {
DCHECK(is_catch_scope());
DCHECK_EQ(1, num_var());
return static_cast<Variable*>(variables_.Start()->value);
}
bool ShouldBanArguments();
// your_sha256_hash-----------
// Variable allocation.
// Result of variable allocation.
int num_stack_slots() const { return num_stack_slots_; }
int num_heap_slots() const { return num_heap_slots_; }
int StackLocalCount() const;
int ContextLocalCount() const;
// Determine if we can parse a function literal in this scope lazily without
// caring about the unresolved variables within.
bool AllowsLazyParsingWithoutUnresolvedVariables(const Scope* outer) const;
// The number of contexts between this and scope; zero if this == scope.
int ContextChainLength(Scope* scope) const;
// The number of contexts between this and the outermost context that has a
// sloppy eval call. One if this->calls_sloppy_eval().
int ContextChainLengthUntilOutermostSloppyEval() const;
// Find the first function, script, eval or (declaration) block scope. This is
// the scope where var declarations will be hoisted to in the implementation.
DeclarationScope* GetDeclarationScope();
// Find the first non-block declaration scope. This should be either a script,
// function, or eval scope. Same as DeclarationScope(), but skips declaration
// "block" scopes. Used for differentiating associated function objects (i.e.,
// the scope for which a function prologue allocates a context) or declaring
// temporaries.
DeclarationScope* GetClosureScope();
const DeclarationScope* GetClosureScope() const;
// Find the first (non-arrow) function or script scope. This is where
// 'this' is bound, and what determines the function kind.
DeclarationScope* GetReceiverScope();
// Find the innermost outer scope that needs a context.
Scope* GetOuterScopeWithContext();
// Analyze() must have been called once to create the ScopeInfo.
Handle<ScopeInfo> scope_info() const {
DCHECK(!scope_info_.is_null());
return scope_info_;
}
int num_var() const { return variables_.occupancy(); }
// your_sha256_hash-----------
// Debugging.
#ifdef DEBUG
void Print(int n = 0); // n = indentation; n < 0 => don't print recursively
// Check that the scope has positions assigned.
void CheckScopePositions();
// Check that all Scopes in the scope tree use the same Zone.
void CheckZones();
#endif
// Retrieve `IsSimpleParameterList` of current or outer function.
bool HasSimpleParameters();
void set_is_debug_evaluate_scope() { is_debug_evaluate_scope_ = true; }
bool is_debug_evaluate_scope() const { return is_debug_evaluate_scope_; }
bool RemoveInnerScope(Scope* inner_scope) {
DCHECK_NOT_NULL(inner_scope);
if (inner_scope == inner_scope_) {
inner_scope_ = inner_scope_->sibling_;
return true;
}
for (Scope* scope = inner_scope_; scope != nullptr;
scope = scope->sibling_) {
if (scope->sibling_ == inner_scope) {
scope->sibling_ = scope->sibling_->sibling_;
return true;
}
}
return false;
}
protected:
explicit Scope(Zone* zone);
void set_language_mode(LanguageMode language_mode) {
is_strict_ = is_strict(language_mode);
}
private:
Variable* Declare(
Zone* zone, const AstRawString* name, VariableMode mode,
VariableKind kind = NORMAL_VARIABLE,
InitializationFlag initialization_flag = kCreatedInitialized,
MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
// This method should only be invoked on scopes created during parsing (i.e.,
// not deserialized from a context). Also, since NeedsContext() is only
// returning a valid result after variables are resolved, NeedsScopeInfo()
// should also be invoked after resolution.
bool NeedsScopeInfo() const;
Variable* NewTemporary(const AstRawString* name,
MaybeAssignedFlag maybe_assigned);
// Walk the scope chain to find DeclarationScopes; call
// SavePreParsedScopeDataForDeclarationScope for each.
void SavePreParsedScopeData();
Zone* zone_;
// Scope tree.
Scope* outer_scope_; // the immediately enclosing outer scope, or nullptr
Scope* inner_scope_; // an inner scope of this scope
Scope* sibling_; // a sibling inner scope of the outer scope of this scope.
// The variables declared in this scope:
//
// All user-declared variables (incl. parameters). For script scopes
// variables may be implicitly 'declared' by being used (possibly in
// an inner scope) with no intervening with statements or eval calls.
VariableMap variables_;
// In case of non-scopeinfo-backed scopes, this contains the variables of the
// map above in order of addition.
ThreadedList<Variable> locals_;
// Unresolved variables referred to from this scope. The proxies themselves
// form a linked list of all unresolved proxies.
VariableProxy* unresolved_;
// Declarations.
ThreadedList<Declaration> decls_;
// Serialized scope info support.
Handle<ScopeInfo> scope_info_;
// Debugging support.
#ifdef DEBUG
const AstRawString* scope_name_;
// True if it doesn't need scope resolution (e.g., if the scope was
// constructed based on a serialized scope info or a catch context).
bool already_resolved_;
// True if this scope may contain objects from a temp zone that needs to be
// fixed up.
bool needs_migration_;
#endif
// Source positions.
int start_position_;
int end_position_;
// Computed via AllocateVariables.
int num_stack_slots_;
int num_heap_slots_;
// The scope type.
const ScopeType scope_type_;
// Scope-specific information computed during parsing.
//
// The language mode of this scope.
STATIC_ASSERT(LanguageModeSize == 2);
bool is_strict_ : 1;
// This scope or a nested catch scope or with scope contain an 'eval' call. At
// the 'eval' call site this scope is the declaration scope.
bool scope_calls_eval_ : 1;
// This scope's declarations might not be executed in order (e.g., switch).
bool scope_nonlinear_ : 1;
bool is_hidden_ : 1;
// Temporary workaround that allows masking of 'this' in debug-evalute scopes.
bool is_debug_evaluate_scope_ : 1;
// True if one of the inner scopes or the scope itself calls eval.
bool inner_scope_calls_eval_ : 1;
bool force_context_allocation_ : 1;
bool force_context_allocation_for_parameters_ : 1;
// True if it holds 'var' declarations.
bool is_declaration_scope_ : 1;
bool must_use_preparsed_scope_data_ : 1;
// Create a non-local variable with a given name.
// These variables are looked up dynamically at runtime.
Variable* NonLocal(const AstRawString* name, VariableMode mode);
// Variable resolution.
// Lookup a variable reference given by name recursively starting with this
// scope, and stopping when reaching the outer_scope_end scope. If the code is
// executed because of a call to 'eval', the context parameter should be set
// to the calling context of 'eval'.
Variable* LookupRecursive(ParseInfo* info, VariableProxy* proxy,
Scope* outer_scope_end);
void ResolveTo(ParseInfo* info, VariableProxy* proxy, Variable* var);
V8_WARN_UNUSED_RESULT bool ResolveVariable(ParseInfo* info,
VariableProxy* proxy);
V8_WARN_UNUSED_RESULT bool ResolveVariablesRecursively(ParseInfo* info);
// Finds free variables of this scope. This mutates the unresolved variables
// list along the way, so full resolution cannot be done afterwards.
// If a ParseInfo* is passed, non-free variables will be resolved.
VariableProxy* FetchFreeVariables(DeclarationScope* max_outer_scope,
ParseInfo* info = nullptr,
VariableProxy* stack = nullptr);
// Predicates.
bool MustAllocate(Variable* var);
bool MustAllocateInContext(Variable* var);
// Variable allocation.
void AllocateStackSlot(Variable* var);
void AllocateHeapSlot(Variable* var);
void AllocateNonParameterLocal(Variable* var);
void AllocateDeclaredGlobal(Variable* var);
void AllocateNonParameterLocalsAndDeclaredGlobals();
void AllocateVariablesRecursively();
void AllocateScopeInfosRecursively(Isolate* isolate,
MaybeHandle<ScopeInfo> outer_scope);
void AllocateDebuggerScopeInfos(Isolate* isolate,
MaybeHandle<ScopeInfo> outer_scope);
// Construct a scope based on the scope info.
Scope(Zone* zone, ScopeType type, Handle<ScopeInfo> scope_info);
// Construct a catch scope with a binding for the name.
Scope(Zone* zone, const AstRawString* catch_variable_name,
MaybeAssignedFlag maybe_assigned, Handle<ScopeInfo> scope_info);
void AddInnerScope(Scope* inner_scope) {
inner_scope->sibling_ = inner_scope_;
inner_scope_ = inner_scope;
inner_scope->outer_scope_ = this;
}
void SetDefaults();
friend class DeclarationScope;
friend class ScopeTestHelper;
};
class V8_EXPORT_PRIVATE DeclarationScope : public Scope {
public:
DeclarationScope(Zone* zone, Scope* outer_scope, ScopeType scope_type,
FunctionKind function_kind = kNormalFunction);
DeclarationScope(Zone* zone, ScopeType scope_type,
Handle<ScopeInfo> scope_info);
// Creates a script scope.
DeclarationScope(Zone* zone, AstValueFactory* ast_value_factory);
bool IsDeclaredParameter(const AstRawString* name) {
// If IsSimpleParameterList is false, duplicate parameters are not allowed,
// however `arguments` may be allowed if function is not strict code. Thus,
// the assumptions explained above do not hold.
return params_.Contains(variables_.Lookup(name));
}
FunctionKind function_kind() const { return function_kind_; }
bool is_arrow_scope() const {
return is_function_scope() && IsArrowFunction(function_kind_);
}
// Inform the scope that the corresponding code uses "super".
void RecordSuperPropertyUsage() {
DCHECK(IsConciseMethod(function_kind()) ||
IsAccessorFunction(function_kind()) ||
IsClassConstructor(function_kind()));
scope_uses_super_property_ = true;
}
// Does this scope access "super" property (super.foo).
bool NeedsHomeObject() const {
return scope_uses_super_property_ ||
(inner_scope_calls_eval_ && (IsConciseMethod(function_kind()) ||
IsAccessorFunction(function_kind()) ||
IsClassConstructor(function_kind())));
}
bool calls_sloppy_eval() const {
return scope_calls_eval_ && is_sloppy(language_mode());
}
bool was_lazily_parsed() const { return was_lazily_parsed_; }
#ifdef DEBUG
void set_is_being_lazily_parsed(bool is_being_lazily_parsed) {
is_being_lazily_parsed_ = is_being_lazily_parsed;
}
bool is_being_lazily_parsed() const { return is_being_lazily_parsed_; }
#endif
bool ShouldEagerCompile() const;
void set_should_eager_compile();
void SetScriptScopeInfo(Handle<ScopeInfo> scope_info) {
DCHECK(is_script_scope());
DCHECK(scope_info_.is_null());
scope_info_ = scope_info;
}
bool asm_module() const { return asm_module_; }
void set_asm_module();
bool should_ban_arguments() const {
return IsClassFieldsInitializerFunction(function_kind());
}
void DeclareThis(AstValueFactory* ast_value_factory);
void DeclareArguments(AstValueFactory* ast_value_factory);
void DeclareDefaultFunctionVariables(AstValueFactory* ast_value_factory);
// Declare the function variable for a function literal. This variable
// is in an intermediate scope between this function scope and the the
// outer scope. Only possible for function scopes; at most one variable.
//
// This function needs to be called after all other variables have been
// declared in the scope. It will add a variable for {name} to {variables_};
// either the function variable itself, or a non-local in case the function
// calls sloppy eval.
Variable* DeclareFunctionVar(const AstRawString* name);
// Declare some special internal variables which must be accessible to
// Ignition without ScopeInfo.
Variable* DeclareGeneratorObjectVar(const AstRawString* name);
Variable* DeclarePromiseVar(const AstRawString* name);
// Declare a parameter in this scope. When there are duplicated
// parameters the rightmost one 'wins'. However, the implementation
// expects all parameters to be declared and from left to right.
Variable* DeclareParameter(const AstRawString* name, VariableMode mode,
bool is_optional, bool is_rest, bool* is_duplicate,
AstValueFactory* ast_value_factory, int position);
// Declares that a parameter with the name exists. Creates a Variable and
// returns it if FLAG_preparser_scope_analysis is on.
Variable* DeclareParameterName(const AstRawString* name, bool is_rest,
AstValueFactory* ast_value_factory,
bool declare_local, bool add_parameter);
// Declare an implicit global variable in this scope which must be a
// script scope. The variable was introduced (possibly from an inner
// scope) by a reference to an unresolved variable with no intervening
// with statements or eval calls.
Variable* DeclareDynamicGlobal(const AstRawString* name,
VariableKind variable_kind);
// The variable corresponding to the 'this' value.
Variable* receiver() {
DCHECK(has_this_declaration());
DCHECK_NOT_NULL(receiver_);
return receiver_;
}
// TODO(wingo): Add a GLOBAL_SCOPE scope type which will lexically allocate
// "this" (and no other variable) on the native context. Script scopes then
// will not have a "this" declaration.
bool has_this_declaration() const {
return (is_function_scope() && !is_arrow_scope()) || is_module_scope();
}
// The variable corresponding to the 'new.target' value.
Variable* new_target_var() { return new_target_; }
// The variable holding the function literal for named function
// literals, or nullptr. Only valid for function scopes.
Variable* function_var() const { return function_; }
Variable* generator_object_var() const {
DCHECK(is_function_scope() || is_module_scope());
return GetRareVariable(RareVariable::kGeneratorObject);
}
Variable* promise_var() const {
DCHECK(is_function_scope());
DCHECK(IsAsyncFunction(function_kind_));
if (IsAsyncGeneratorFunction(function_kind_)) return nullptr;
return GetRareVariable(RareVariable::kPromise);
}
// Parameters. The left-most parameter has index 0.
// Only valid for function and module scopes.
Variable* parameter(int index) const {
DCHECK(is_function_scope() || is_module_scope());
return params_[index];
}
// Returns the number of formal parameters, excluding a possible rest
// parameter. Examples:
// function foo(a, b) {} ==> 2
// function foo(a, b, ...c) {} ==> 2
// function foo(a, b, c = 1) {} ==> 3
int num_parameters() const {
return has_rest_ ? params_.length() - 1 : params_.length();
}
// The function's rest parameter (nullptr if there is none).
Variable* rest_parameter() const {
return has_rest_ ? params_[params_.length() - 1] : nullptr;
}
bool has_simple_parameters() const { return has_simple_parameters_; }
// TODO(caitp): manage this state in a better way. PreParser must be able to
// communicate that the scope is non-simple, without allocating any parameters
// as the Parser does. This is necessary to ensure that TC39's proposed early
// error can be reported consistently regardless of whether lazily parsed or
// not.
void SetHasNonSimpleParameters() {
DCHECK(is_function_scope());
has_simple_parameters_ = false;
}
// The local variable 'arguments' if we need to allocate it; nullptr
// otherwise.
Variable* arguments() const {
DCHECK(!is_arrow_scope() || arguments_ == nullptr);
return arguments_;
}
Variable* this_function_var() const {
Variable* this_function = GetRareVariable(RareVariable::kThisFunction);
// This is only used in derived constructors atm.
DCHECK(this_function == nullptr ||
(is_function_scope() && (IsClassConstructor(function_kind()) ||
IsConciseMethod(function_kind()) ||
IsAccessorFunction(function_kind()))));
return this_function;
}
// Adds a local variable in this scope's locals list. This is for adjusting
// the scope of temporaries and do-expression vars when desugaring parameter
// initializers.
void AddLocal(Variable* var);
void DeclareSloppyBlockFunction(
const AstRawString* name, Scope* scope,
SloppyBlockFunctionStatement* statement = nullptr);
// Go through sloppy_block_function_map_ and hoist those (into this scope)
// which should be hoisted.
void HoistSloppyBlockFunctions(AstNodeFactory* factory);
SloppyBlockFunctionMap* sloppy_block_function_map() {
return sloppy_block_function_map_;
}
// Replaces the outer scope with the outer_scope_info in |info| if there is
// one.
void AttachOuterScopeInfo(ParseInfo* info, Isolate* isolate);
// Compute top scope and allocate variables. For lazy compilation the top
// scope only contains the single lazily compiled function, so this
// doesn't re-allocate variables repeatedly.
//
// Returns false if private fields can not be resolved and
// ParseInfo's pending_error_handler will be populated with an
// error. Otherwise, returns true.
V8_WARN_UNUSED_RESULT
static bool Analyze(ParseInfo* info);
// To be called during parsing. Do just enough scope analysis that we can
// discard the Scope contents for lazily compiled functions. In particular,
// this records variables which cannot be resolved inside the Scope (we don't
// yet know what they will resolve to since the outer Scopes are incomplete)
// and recreates them with the correct Zone with ast_node_factory.
void AnalyzePartially(AstNodeFactory* ast_node_factory);
// Allocate ScopeInfos for top scope and any inner scopes that need them.
// Does nothing if ScopeInfo is already allocated.
static void AllocateScopeInfos(ParseInfo* info, Isolate* isolate,
AnalyzeMode mode);
Handle<StringSet> CollectNonLocals(ParseInfo* info,
Handle<StringSet> non_locals);
// Determine if we can use lazy compilation for this scope.
bool AllowsLazyCompilation() const;
// Make sure this closure and all outer closures are eagerly compiled.
void ForceEagerCompilation() {
DCHECK_EQ(this, GetClosureScope());
DeclarationScope* s;
for (s = this; !s->is_script_scope();
s = s->outer_scope()->GetClosureScope()) {
s->force_eager_compilation_ = true;
}
s->force_eager_compilation_ = true;
}
#ifdef DEBUG
void PrintParameters();
#endif
void AllocateLocals();
void AllocateParameterLocals();
void AllocateReceiver();
void ResetAfterPreparsing(AstValueFactory* ast_value_factory, bool aborted);
bool is_skipped_function() const { return is_skipped_function_; }
void set_is_skipped_function(bool is_skipped_function) {
is_skipped_function_ = is_skipped_function;
}
bool has_inferred_function_name() const {
return has_inferred_function_name_;
}
void set_has_inferred_function_name(bool value) {
DCHECK(is_function_scope());
has_inferred_function_name_ = value;
}
// Save data describing the context allocation of the variables in this scope
// and its subscopes (except scopes at the laziness boundary). The data is
// saved in produced_preparsed_scope_data_.
void SavePreParsedScopeDataForDeclarationScope();
void set_produced_preparsed_scope_data(
ProducedPreParsedScopeData* produced_preparsed_scope_data) {
produced_preparsed_scope_data_ = produced_preparsed_scope_data;
}
ProducedPreParsedScopeData* produced_preparsed_scope_data() const {
return produced_preparsed_scope_data_;
}
private:
void AllocateParameter(Variable* var, int index);
// Resolve and fill in the allocation information for all variables
// in this scopes. Must be called *after* all scopes have been
// processed (parsed) to ensure that unresolved variables can be
// resolved properly.
//
// In the case of code compiled and run using 'eval', the context
// parameter is the context in which eval was called. In all other
// cases the context parameter is an empty handle.
//
// Returns false if private fields can not be resolved.
bool AllocateVariables(ParseInfo* info);
void SetDefaults();
// If the scope is a function scope, this is the function kind.
const FunctionKind function_kind_;
bool has_simple_parameters_ : 1;
// This scope contains an "use asm" annotation.
bool asm_module_ : 1;
bool force_eager_compilation_ : 1;
// This function scope has a rest parameter.
bool has_rest_ : 1;
// This scope has a parameter called "arguments".
bool has_arguments_parameter_ : 1;
// This scope uses "super" property ('super.foo').
bool scope_uses_super_property_ : 1;
bool should_eager_compile_ : 1;
// Set to true after we have finished lazy parsing the scope.
bool was_lazily_parsed_ : 1;
#if DEBUG
bool is_being_lazily_parsed_ : 1;
#endif
bool is_skipped_function_ : 1;
bool has_inferred_function_name_ : 1;
// Parameter list in source order.
ZoneList<Variable*> params_;
// Map of function names to lists of functions defined in sloppy blocks
SloppyBlockFunctionMap* sloppy_block_function_map_;
// Convenience variable.
Variable* receiver_;
// Function variable, if any; function scopes only.
Variable* function_;
// new.target variable, function scopes only.
Variable* new_target_;
// Convenience variable; function scopes only.
Variable* arguments_;
// For producing the scope allocation data during preparsing.
ProducedPreParsedScopeData* produced_preparsed_scope_data_;
struct RareData : public ZoneObject {
// Convenience variable; Subclass constructor only
Variable* this_function = nullptr;
// Generator object, if any; generator function scopes and module scopes
// only.
Variable* generator_object = nullptr;
// Promise, if any; async function scopes only.
Variable* promise = nullptr;
};
enum class RareVariable {
kThisFunction = offsetof(RareData, this_function),
kGeneratorObject = offsetof(RareData, generator_object),
kPromise = offsetof(RareData, promise)
};
V8_INLINE RareData* EnsureRareData() {
if (rare_data_ == nullptr) {
rare_data_ = new (zone_) RareData;
}
return rare_data_;
}
V8_INLINE Variable* GetRareVariable(RareVariable id) const {
if (rare_data_ == nullptr) return nullptr;
return *reinterpret_cast<Variable**>(
reinterpret_cast<uint8_t*>(rare_data_) + static_cast<ptrdiff_t>(id));
}
// Set `var` to null if it's non-null and Predicate (Variable*) -> bool
// returns true.
template <typename Predicate>
V8_INLINE void NullifyRareVariableIf(RareVariable id, Predicate predicate) {
if (V8_LIKELY(rare_data_ == nullptr)) return;
Variable** var = reinterpret_cast<Variable**>(
reinterpret_cast<uint8_t*>(rare_data_) + static_cast<ptrdiff_t>(id));
if (*var && predicate(*var)) *var = nullptr;
}
RareData* rare_data_ = nullptr;
};
class ModuleScope final : public DeclarationScope {
public:
ModuleScope(DeclarationScope* script_scope,
AstValueFactory* ast_value_factory);
// Deserialization.
// The generated ModuleDescriptor does not preserve all information. In
// particular, its module_requests map will be empty because we no longer need
// the map after parsing.
ModuleScope(Handle<ScopeInfo> scope_info, AstValueFactory* ast_value_factory);
ModuleDescriptor* module() const {
DCHECK_NOT_NULL(module_descriptor_);
return module_descriptor_;
}
// Set MODULE as VariableLocation for all variables that will live in a
// module's export table.
void AllocateModuleVariables();
private:
ModuleDescriptor* module_descriptor_;
};
} // namespace internal
} // namespace v8
#endif // V8_AST_SCOPES_H_
```
|
Joseph Mifsud (born 1960) is a British/Maltese academic, who had dual citizenship in the United Kingdom and Malta. In 2016, he became involved with George Papadopoulos, an advisor to the Donald Trump presidential campaign, and was later accused of being a link between that campaign and Russia. In 2018, he was described as missing, and an Italian court listed his location as "residence unknown". According to media reports, he was in Rome as of April 2019.
Education
Mifsud holds a bachelor's degree in education from the University of Malta (1982) and a master's degree in education from the University of Padua (1989). He was awarded a PhD in 1995 from Queen's University Belfast; his thesis was titled Managing Educational Reform: A Comparative Approach from Malta (and Northern Ireland); a Headteachers' Perspective.
Career
Mifsud assisted in the 1999 founding of Link Campus University (a subsidiary of the University of Malta with links to Italian intelligence), who was then the head of the university's education department. Mifsud acted as its "director of international relations".
From 2006 to 2008, Mifsud served as the chef de cabinet of the Ministry of Foreign Affairs of Malta. He later became a principal in the London Centre of International Law Practice (LCILP). In 2008, he was named President of the Euro-Mediterranean University of Slovenia (EMUNI). At least as early as 2010, he began making numerous trips to Russia. He was a professorial teaching fellow at the University of Stirling in Scotland, as well as director of the London Academy of Diplomacy, where he served as director from 2012 until it closed in 2016. The academy was partnered with the University of Stirling. He has also served as president of the University Consortium of the Province of Agrigento in Sicily; in September 2018, an Italian court ordered him to repay the Consortium 49,000 euros ($56,700) in overpayments.
As of 2017, Mifsud was a member of the European Council on Foreign Relations (ECFR). He regularly attended meetings of the Valdai Discussion Club, an annual conference held in Russia, backed by the Kremlin and attended by Vladimir Putin. In April 2016, Mifsud spoke at a Valdai Club panel in Moscow alongside Switzerland-based lawyer Stephan Roh. Roh, who has been associated with Russian oligarchs and who owns a 5% stake in Link Campus University, has been described by George Papadopoulos's wife as Mifsud's partner, best friend, and funder.
According to the Mueller Report, released in 2019 after Mifsud's disappearance, Mifsud "maintained various Russian contacts while living in London", including an unnamed person (name redacted), who was a former staff member of the Internet Research Agency, the Russian troll farm based in Saint Petersburg. Mifsud had previously denied having any contact with the Russian government, saying "I am an academic, I do not even speak Russian."
Connection to George Papadopoulos
In March 2016, shortly after George Papadopoulos was named as a foreign policy advisor to the Trump campaign, Mifsud met Papadopoulos in Rome. They later met again in London, where – according to Papadopoulos – Mifsud claimed "substantial connections to Russian officials" and introduced Papadopoulos to a Russian woman that he falsely claimed was Putin's niece. At a meeting in April, Mifsud told Papadopoulos that he had learned that the Russian government had "dirt" on Hillary Clinton. Mifsud has acknowledged meeting Papadopoulos, but denied Papadopoulos's specific allegations. On 10 May 2016, Papadopoulos repeated the information to the Australian High Commissioner in London, Alexander Downer, who was accompanied by Australian diplomat Erika Thompson, that "the Trump team had received some kind of suggestion from Russia that it could assist this process with the anonymous release of information during the campaign that would be damaging to Mrs Clinton (and President Obama)." Downer later reported to American authorities that Papadopoulos had apparently known about Russia's theft of Democratic National Committee emails before it was publicly reported. Papadopoulos denies having told Downer this. The FBI then launched an investigation into possible connections between Russia and the Trump campaign. Mifsud was interviewed by the FBI in February 2017 while visiting the United States to speak at a conference. Mifsud left the United States on 11 February 2017.
Mifsud has been claimed to be an intelligence agent by various sources. Former FBI Director James Comey has described Mifsud as a "Russian agent". Papadopoulos and other critics of the investigation of Russian interference in the 2016 campaign, such as Republicans Jim Jordan and Devin Nunes, have suggested Mifsud might be a Western intelligence agent instructed to entrap Papadopoulos in order to justify an investigation. A December 2019 Justice Department Inspector General report found no evidence Mifsud was an FBI informant, or that his involvement with Papadopoulos was related to any FBI operation. U.S. Attorney General William Barr and U.S. prosecutor John Durham met with Italian intelligence officials in Rome in late September 2019 to learn more about Mifsud and his contacts. Italian officials denied that Italian intelligence services were involved.
Disappearance October 2017
Mifsud's passport and wallet were found on 5 August 2017, in Câmara de Lobos, Portugal, although the Maltese government was not informed until in October 2019. He spoke to his girlfriend on 31 October 2017, the day before an Italian newspaper revealed that the "professor" referred to in news reports about Papadopoulos was Mifsud; as of 27 February 2018, she had not heard from him again. Photographic evidence showed that Mifsud was in Switzerland on 21 May 2018; he lived in Link Campus University housing until the summer of that year. In September 2018, an Italian court described his location as "residence unknown". According to a filing in a U.S. federal court in the case Democratic National Committee v. Russian Federation in September 2018, Mifsud was "missing and may be deceased". Mifsud's whereabouts were unknown and he could not be served with the complaint.
According to media reports, Mifsud was in Rome as of April 2019. Corriere della Sera, Italy's newspaper of record, said on 11 November 2019 that it received a recording of someone who claimed to be Mifsud. Voice recognition experts with the U.K.-based investigative journalism group Bellingcat said that, based on tone and pronunciation, the recording matched verified recordings of Mifsud.
As of 18 May 2023 the Italian newspaper La Notizia reported Mifsud's whereabouts were still unknown following his disappearance into thin air on 31 October 2017. With his disappearance, a huge number of mysteries remained unsolved. Mifsud appeared in an October 2017 photo with then British Foreign Secretary, Boris Johnson, when attending a Brexit event at the London School of Diplomacy. Mifsud has a history of disappearances related to employment and debts. It's not clear who Mifsud was: a Russian spy or a professor who worked for some intelligence service of a NATO country.
See also
List of people who disappeared
Russian interference in the 2016 United States elections
References
External links
1960 births
2010s missing person cases
Academics of the University of Stirling
University of Malta alumni
Date of birth missing (living people)
Living people
Maltese academics
Missing people
Missing person cases in Italy
People associated with Russian interference in the 2016 United States elections
University of Padua alumni
|
Vennati is a village in Saaremaa Parish, Saare County in western Estonia.
Before the administrative reform in 2017, the village was in Lääne-Saare Parish.
Mullutu Bay, the western part of Estonian fourth largest lake Mullutu-Suurlaht is located in the southeastern side of Vennati village.
References
Villages in Saare County
|
Radovan Světlík (born 12 April 1974) is a Czech former professional tennis player.
Světlík, who reached a best ranking of 230 in the world, qualified for his only ATP Tour main draw at the 1999 Prague Open. He had qualifying wins over Petr Pála, Radomír Vašek and Tuomas Ketola, then fell to Australian Open semi-finalist Nicolás Lapentti in the first round.
During his career he also featured in the qualifying draws for the French Open, Wimbledon and US Open.
Most of the time he competed on the Challenger and ITF circuits. He won a Challenger tournament at Bressanone in 1999, partnering David Miketa in the doubles.
Challenger titles
Doubles: (1)
References
External links
1974 births
Living people
Czech male tennis players
|
Pedro Hernández Calderón (born 21 June 1981) is a former football goalkeeper who last played for Irapuato FC on loan from Club Atlas.
Club career
After several seasons as a back-up goalkeeper, Hernandez began the Clausura 2009 as the first choice goalkeeper for Atlas.
Atlas loaned Hernández to Club Necaxa in 2009, and he returned to the club on another six-month loan in December 2010.
Hernandez played the 2010 Bicentenario Final with Necaxa in which they defeated Leon 4–2 in the global score.
References
External links
1981 births
Living people
Mexican men's footballers
Santos Laguna footballers
Atlas F.C. footballers
C.D. Irapuato footballers
Club Necaxa footballers
Men's association football goalkeepers
|
```smalltalk
using UnityEngine;
namespace BezierSolution
{
[AddComponentMenu( "Bezier Solution/Bezier Line Renderer" )]
[HelpURL( "path_to_url" )]
[RequireComponent( typeof( LineRenderer ) )]
[ExecuteInEditMode]
public class BezierLineRenderer : MonoBehaviour
{
#pragma warning disable 0649
[SerializeField]
private BezierSpline m_spline;
public BezierSpline spline
{
get { return m_spline; }
set
{
if( m_spline != value )
{
if( m_spline )
m_spline.onSplineChanged -= OnSplineChanged;
m_spline = value;
if( m_spline && isActiveAndEnabled )
{
m_spline.onSplineChanged -= OnSplineChanged;
m_spline.onSplineChanged += OnSplineChanged;
OnSplineChanged( m_spline, DirtyFlags.All );
}
}
}
}
[SerializeField]
[MinMaxRange( 0f, 1f )]
private Vector2 m_splineSampleRange = new Vector2( 0f, 1f );
public Vector2 SplineSampleRange
{
get { return m_splineSampleRange; }
set
{
value.x = Mathf.Clamp01( value.x );
value.y = Mathf.Clamp01( value.y );
if( m_splineSampleRange != value )
{
m_splineSampleRange = value;
if( isActiveAndEnabled )
OnSplineChanged( m_spline, DirtyFlags.All );
}
}
}
[Header( "Line Options" )]
[SerializeField]
[Range( 0, 30 )]
private int m_smoothness = 5;
public int smoothness
{
get { return m_smoothness; }
set
{
if( m_smoothness != value )
{
m_smoothness = value;
if( isActiveAndEnabled )
OnSplineChanged( m_spline, DirtyFlags.All );
}
}
}
#if UNITY_EDITOR
[Header( "Other Settings" )]
[SerializeField]
private bool executeInEditMode = false;
[SerializeField, HideInInspector]
private BezierSpline prevSpline;
#endif
#pragma warning restore 0649
private LineRenderer lineRenderer;
private Vector3[] lineRendererPoints;
#if UNITY_EDITOR
private bool lineRendererUseWorldSpace = true;
#endif
private void OnEnable()
{
if( m_spline )
{
m_spline.onSplineChanged -= OnSplineChanged;
m_spline.onSplineChanged += OnSplineChanged;
OnSplineChanged( m_spline, DirtyFlags.All );
}
}
private void OnDisable()
{
if( m_spline )
m_spline.onSplineChanged -= OnSplineChanged;
}
#if UNITY_EDITOR
private void Update()
{
if( lineRenderer && lineRenderer.useWorldSpace != lineRendererUseWorldSpace )
{
lineRendererUseWorldSpace = !lineRendererUseWorldSpace;
if( isActiveAndEnabled )
OnSplineChanged( m_spline, DirtyFlags.All );
}
}
private void OnValidate()
{
BezierSpline _spline = m_spline;
m_spline = prevSpline;
spline = prevSpline = _spline;
if( isActiveAndEnabled )
OnSplineChanged( m_spline, DirtyFlags.All );
}
#endif
private void OnSplineChanged( BezierSpline spline, DirtyFlags dirtyFlags )
{
#if UNITY_EDITOR
if( !executeInEditMode && !UnityEditor.EditorApplication.isPlaying )
return;
#endif
if( ( dirtyFlags & DirtyFlags.SplineShapeChanged ) == DirtyFlags.SplineShapeChanged )
Refresh( m_smoothness );
}
public void Refresh( int smoothness )
{
if( !m_spline || m_spline.Count < 2 )
return;
if( !lineRenderer )
lineRenderer = GetComponent<LineRenderer>();
smoothness = Mathf.Clamp( smoothness, 1, 30 );
int numberOfPoints = ( m_spline.Count - 1 ) * smoothness;
if( !m_spline.loop )
numberOfPoints++; // spline.GetPoint( 1f )
else
numberOfPoints += smoothness; // Final point is connected to the first point via lineRenderer.loop, so no "numberOfPoints++" here
if( lineRendererPoints == null || lineRendererPoints.Length != numberOfPoints )
lineRendererPoints = new Vector3[numberOfPoints];
if( m_splineSampleRange.x <= 0f && m_splineSampleRange.y >= 1f )
{
int pointIndex = 0;
float smoothnessStep = 1f / smoothness;
for( int i = 0; i < m_spline.Count - 1; i++ )
{
BezierSpline.Segment segment = new BezierSpline.Segment( m_spline[i], m_spline[i + 1], 0f );
for( int j = 0; j < smoothness; j++, pointIndex++ )
lineRendererPoints[pointIndex] = segment.GetPoint( j * smoothnessStep );
}
if( !m_spline.loop )
lineRendererPoints[numberOfPoints - 1] = m_spline.GetPoint( 1f );
else
{
BezierSpline.Segment segment = new BezierSpline.Segment( m_spline[m_spline.Count - 1], m_spline[0], 0f );
for( int j = 0; j < smoothness; j++, pointIndex++ )
lineRendererPoints[pointIndex] = segment.GetPoint( j * smoothnessStep );
}
}
else
{
float smoothnessStep = ( m_splineSampleRange.y - m_splineSampleRange.x ) / ( numberOfPoints - 1 );
for( int i = 0; i < numberOfPoints; i++ )
lineRendererPoints[i] = spline.GetPoint( m_splineSampleRange.x + i * smoothnessStep );
}
#if UNITY_EDITOR
lineRendererUseWorldSpace = lineRenderer.useWorldSpace;
#endif
if( !lineRenderer.useWorldSpace )
{
Vector3 initialPoint = m_spline.GetPoint( 0f );
for( int i = 0; i < numberOfPoints; i++ )
lineRendererPoints[i] -= initialPoint;
}
lineRenderer.positionCount = lineRendererPoints.Length;
lineRenderer.SetPositions( lineRendererPoints );
lineRenderer.loop = m_spline.loop && m_splineSampleRange.x <= 0f && m_splineSampleRange.y >= 1f;
}
}
}
```
|
```python
from rx import Observable
from rx.internal import extensionmethod
@extensionmethod(Observable)
def count(self, predicate=None):
"""Returns an observable sequence containing a value that represents
how many elements in the specified observable sequence satisfy a
condition if provided, else the count of items.
1 - res = source.count()
2 - res = source.count(lambda x: x > 3)
Keyword arguments:
:param types.FunctionType predicate: A function to test each element for a
condition.
:returns: An observable sequence containing a single element with a
number that represents how many elements in the input sequence satisfy
the condition in the predicate function if provided, else the count of
items in the sequence.
:rtype: Observable
"""
if predicate:
return self.filter(predicate).count()
else:
return self.reduce(lambda count, _: count + 1, seed=0)
```
|
WMOG may refer to:
WMOG (AM), a radio station (910 AM) licensed to serve Meridian, Mississippi, United States
WSSI, a radio station (92.7 FM) licensed to serve St. Simons Island, Georgia, United States, which held the call sign WMOG-FM from 1991 to 1995 and WMOG from 2014 to 2016
WBGA, a radio station (1490 AM) licensed to serve Brunswick, Georgia, which held the call sign WMOG from 1939 to 2014
|
```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.javadeobfuscator.deobfuscator.matcher;
import org.objectweb.asm.tree.AbstractInsnNode;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Function;
public class OpcodeStep implements Step {
private final List<Integer> wantOpcodes;
private Function<AbstractInsnNode, Boolean> function;
public OpcodeStep(Function<AbstractInsnNode, Boolean> function, int... opcodes) {
this.function = function;
this.wantOpcodes = new ArrayList<>();
for (int opcode : opcodes) {
this.wantOpcodes.add(opcode);
}
}
public OpcodeStep(int... opcodes) {
this.wantOpcodes = new ArrayList<>();
for (int opcode : opcodes) {
this.wantOpcodes.add(opcode);
}
}
@Override
public AbstractInsnNode tryMatch(InstructionMatcher matcher, AbstractInsnNode now) {
if (this.wantOpcodes.contains(now.getOpcode()) && (function == null || function.apply(now))) {
return now.getNext();
}
return null;
}
@Override
public String toString() {
return "OpcodeStep{" +
"wantOpcodes=" + wantOpcodes +
'}';
}
}
```
|
Wasilewski (femine: Wasilewska) is a Polish surname, it may refer to:
(born 1949)
Audrey Wasilewski (born 1967), American actress and voice actress
Carolyn Wasilewski (1940–1954), victim of an unsolved 1954 murder in Baltimore, Maryland
Edward Wasilewski (1923–1968), Polish anti-communist fighter
Erika Lauren Wasilewski, an American radio personality, singer-songwriter, and former reality television personality
Ewa Wasilewska (born 1967), Polish speed skater
Henryk Wasilewski (1953–2012), Polish middle distance runner
Leon Wasilewski (1870–1936), Polish politician
Małgorzata Wasilewska (born 1960), Polish human rights activist and diplomat
Marcin Wasilewski (born 1980), Polish footballer
Mieczysław Wasilewski (born 1942), Polish graphic designer
Nicholas Wasilewski, video-game developer
Paul Wasilewski (born 1982), Polish-American actor
Peter "JR" Wasilewski (born 1976), American saxophonist
Regina Wasilewska-Kita (born 1951), Polish politician
Tomasz Wasilewski (born 1980), Polish film director and screenwriter
Wanda Wasilewska (1905–1964), Polish communist writer
, Polish politician
See also
Mount Wasilewski
Vasilevsky (disambiguation)
Polish-language surnames
|
```python
import tensorflow as tf
import tensorflow.contrib.layers as layers
from rlattack.common.tf_util import noisy_dense
def model(img_in, num_actions, scope, noisy=False, reuse=False, concat_softmax=False):
with tf.variable_scope(scope, reuse=reuse):
out = img_in
with tf.variable_scope("convnet"):
# original architecture
out = layers.convolution2d(
out, num_outputs=32, kernel_size=8, stride=4, activation_fn=tf.nn.relu
)
out = layers.convolution2d(
out, num_outputs=64, kernel_size=4, stride=2, activation_fn=tf.nn.relu
)
out = layers.convolution2d(
out, num_outputs=64, kernel_size=3, stride=1, activation_fn=tf.nn.relu
)
out = layers.flatten(out)
with tf.variable_scope("action_value"):
if noisy:
# Apply noisy network on fully connected layers
# ref: path_to_url
out = noisy_dense(
out, name="noisy_fc1", size=512, activation_fn=tf.nn.relu
)
out = noisy_dense(out, name="noisy_fc2", size=num_actions)
else:
out = layers.fully_connected(
out, num_outputs=512, activation_fn=tf.nn.relu
)
out = layers.fully_connected(
out, num_outputs=num_actions, activation_fn=None
)
# V: Softmax - inspired by deep-rl-attack #
if concat_softmax:
out = tf.nn.softmax(out)
return out
def dueling_model(
img_in, num_actions, scope, noisy=False, reuse=False, concat_softmax=False
):
"""As described in path_to_url"""
with tf.variable_scope(scope, reuse=reuse):
out = img_in
with tf.variable_scope("convnet"):
# original architecture
out = layers.convolution2d(
out, num_outputs=32, kernel_size=8, stride=4, activation_fn=tf.nn.relu
)
out = layers.convolution2d(
out, num_outputs=64, kernel_size=4, stride=2, activation_fn=tf.nn.relu
)
out = layers.convolution2d(
out, num_outputs=64, kernel_size=3, stride=1, activation_fn=tf.nn.relu
)
out = layers.flatten(out)
with tf.variable_scope("state_value"):
if noisy:
# Apply noisy network on fully connected layers
# ref: path_to_url
state_hidden = noisy_dense(
out, name="noisy_fc1", size=512, activation_fn=tf.nn.relu
)
state_score = noisy_dense(state_hidden, name="noisy_fc2", size=1)
else:
state_hidden = layers.fully_connected(
out, num_outputs=512, activation_fn=tf.nn.relu
)
state_score = layers.fully_connected(
state_hidden, num_outputs=1, activation_fn=None
)
with tf.variable_scope("action_value"):
if noisy:
# Apply noisy network on fully connected layers
# ref: path_to_url
actions_hidden = noisy_dense(
out, name="noisy_fc1", size=512, activation_fn=tf.nn.relu
)
action_scores = noisy_dense(
actions_hidden, name="noisy_fc2", size=num_actions
)
else:
actions_hidden = layers.fully_connected(
out, num_outputs=512, activation_fn=tf.nn.relu
)
action_scores = layers.fully_connected(
actions_hidden, num_outputs=num_actions, activation_fn=None
)
action_scores_mean = tf.reduce_mean(action_scores, 1)
action_scores = action_scores - tf.expand_dims(action_scores_mean, 1)
return state_score + action_scores
```
|
Qiu Jun (; born August 24, 1982) is a Chinese professional Go player.
Biography
Jun started learning Go at the age of 6. He became a professional in 1994. Over the next 3 years, he gained 3 consecutive promotions. He was promoted to 7 dan in 2005 and then reached 8 dan in 2006. In 2009, Jun reached the Samsung Cup Final with a chance to win his first world championship. He lost the Final 0–2 to Kong Jie, and during August 2011 Jun again reached a world championship Final, this time the 23rd Fujitsu Cup Final. By Chinese Special Promotion rules, Jun was raised to the rank of 9-dan, being China's 31st 9-dan player. He subsequently lost the final to Korean rising star Park Junghwan. Jun joins a selection of players who have reached multiple World Championship Finals without victories in any.
Titles & Runners-Up
References
1982 births
Living people
Go players from Shanghai
|
Charles Yang (born 1973) is a linguist and cognitive scientist. He is currently Professor in the Department of Linguistics at the University of Pennsylvania. His research focuses on language acquisition, variation and change, and is carried out from a broadly Chomskyan perspective.
Yang is a graduate of MIT's AI Lab. His first book, Knowledge and Learning in Natural Language (2002), proposes a model of syntactic acquisition couched within the Principles and Parameters framework. In this model, different grammatical options are associated with different probabilities, which change over time. The model is applied to a number of case studies in language acquisition and historical linguistics. His second book, The Infinite Gift: How Children Learn and Unlearn the Languages of the World (2006), is written for a popular audience, and explores acquisition and knowledge of language. Yang's third book, The Price of Productivity: How Children Learn to Break the Rules of Language (2016), won the Linguistic Society of America's Leonard Bloomfield Award. This book deals with the acquisition of linguistic rules with exceptions, and proposes a quantifiable upper bound on the number of lexical exceptions that a grammatical rule can tolerate.
In 2018, Yang was awarded a Guggenheim Fellowship.
References
Books
Knowledge and Learning in Natural Language, London: Oxford University Press 2002
The Infinite Gift: How Children Learn and Unlearn the Languages of the World, New York: Scribner's 2006
The Price of Productivity: How Children Learn to Break the Rules of Language, Cambridge, MA: MIT Press 2016
External links
Personal webpage
1973 births
Living people
21st-century linguists
Linguists from the United States
American cognitive scientists
MIT School of Engineering alumni
University of Pennsylvania faculty
|
```php
<?php declare(strict_types=1);
namespace Tests\Utils\ModelsSecondary;
use Illuminate\Database\Eloquent\Model;
/**
* This class is named the same as a model in the primary namespace,
* so it will only be used if the namespace is explicitly given.
*/
final class Category extends Model {}
```
|
```c++
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "config.h"
#include "web/ExternalPopupMenu.h"
#include "core/HTMLNames.h"
#include "core/frame/FrameHost.h"
#include "core/frame/PinchViewport.h"
#include "core/html/HTMLSelectElement.h"
#include "core/html/forms/PopupMenuClient.h"
#include "core/layout/LayoutMenuList.h"
#include "core/page/Page.h"
#include "core/testing/DummyPageHolder.h"
#include "platform/PopupMenu.h"
#include "platform/testing/URLTestHelpers.h"
#include "public/platform/Platform.h"
#include "public/platform/WebUnitTestSupport.h"
#include "public/web/WebExternalPopupMenu.h"
#include "public/web/WebPopupMenuInfo.h"
#include "public/web/WebSettings.h"
#include "web/WebLocalFrameImpl.h"
#include "web/tests/FrameTestHelpers.h"
#include <gtest/gtest.h>
namespace blink {
const size_t kListSize = 7;
class TestPopupMenuClient : public PopupMenuClient {
public:
TestPopupMenuClient() : m_listSize(0) { }
~TestPopupMenuClient() override { }
void valueChanged(unsigned listIndex, bool fireEvents = true) override { }
void selectionChanged(unsigned listIndex, bool fireEvents = true) override { }
void selectionCleared() override { }
String itemText(unsigned listIndex) const override { return emptyString(); }
String itemToolTip(unsigned listIndex) const override { return emptyString(); }
String itemAccessibilityText(unsigned listIndex) const override { return emptyString(); }
bool itemIsEnabled(unsigned listIndex) const override { return true; }
PopupMenuStyle itemStyle(unsigned listIndex) const override
{
FontDescription fontDescription;
fontDescription.setComputedSize(12.0);
Font font(fontDescription);
font.update(nullptr);
bool displayNone = m_displayNoneIndexSet.find(listIndex) != m_displayNoneIndexSet.end();
return PopupMenuStyle(Color::black, Color::white, font, true, displayNone, Length(), TextDirection(), false);
}
PopupMenuStyle menuStyle() const override { return itemStyle(0); }
LayoutUnit clientPaddingLeft() const override { return 0; }
LayoutUnit clientPaddingRight() const override { return 0; }
int listSize() const override { return m_listSize; }
int selectedIndex() const override { return 0; }
void popupDidHide() override { }
void popupDidCancel() override { }
bool itemIsSeparator(unsigned listIndex) const override { return false;}
bool itemIsLabel(unsigned listIndex) const override { return false; }
bool itemIsSelected(unsigned listIndex) const override { return listIndex == 0;}
void provisionalSelectionChanged(unsigned listIndex) override { }
bool multiple() const override { return false; }
IntRect elementRectRelativeToViewport() const override { return IntRect(); }
Element& ownerElement() const override { return *m_ownerElement; }
const ComputedStyle* computedStyleForItem(Element& element) const override { return nullptr; }
void setListSize(size_t size) { m_listSize = size; }
void setDisplayNoneIndex(unsigned index) { m_displayNoneIndexSet.insert(index); }
void setOwnerElement(PassRefPtrWillBeRawPtr<Element> element) { m_ownerElement = element; }
private:
size_t m_listSize;
std::set<unsigned> m_displayNoneIndexSet;
RefPtrWillBePersistent<Element> m_ownerElement;
};
class ExternalPopupMenuDisplayNoneItemsTest : public testing::Test {
public:
ExternalPopupMenuDisplayNoneItemsTest() { }
protected:
void SetUp() override
{
m_popupMenuClient.setListSize(kListSize);
// Set the 4th an 5th items to have "display: none" property
m_popupMenuClient.setDisplayNoneIndex(3);
m_popupMenuClient.setDisplayNoneIndex(4);
OwnPtr<DummyPageHolder> dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
m_popupMenuClient.setOwnerElement(HTMLSelectElement::create(dummyPageHolder->document()));
}
TestPopupMenuClient m_popupMenuClient;
};
TEST_F(ExternalPopupMenuDisplayNoneItemsTest, PopupMenuInfoSizeTest)
{
WebPopupMenuInfo info;
ExternalPopupMenu::getPopupMenuInfo(info, m_popupMenuClient);
EXPECT_EQ(5U, info.items.size());
}
TEST_F(ExternalPopupMenuDisplayNoneItemsTest, IndexMappingTest)
{
// 6th indexed item in popupmenu would be the 4th item in ExternalPopupMenu,
// and vice-versa.
EXPECT_EQ(4, ExternalPopupMenu::toExternalPopupMenuItemIndex(6, m_popupMenuClient));
EXPECT_EQ(6, ExternalPopupMenu::toPopupMenuItemIndex(4, m_popupMenuClient));
// Invalid index, methods should return -1.
EXPECT_EQ(-1, ExternalPopupMenu::toExternalPopupMenuItemIndex(8, m_popupMenuClient));
EXPECT_EQ(-1, ExternalPopupMenu::toPopupMenuItemIndex(8, m_popupMenuClient));
}
class ExternalPopupMenuWebFrameClient : public FrameTestHelpers::TestWebFrameClient {
public:
WebExternalPopupMenu* createExternalPopupMenu(const WebPopupMenuInfo&, WebExternalPopupMenuClient*) override
{
return &m_mockWebExternalPopupMenu;
}
WebRect shownBounds() const
{
return m_mockWebExternalPopupMenu.shownBounds();
}
private:
class MockWebExternalPopupMenu : public WebExternalPopupMenu {
void show(const WebRect& bounds) override
{
m_shownBounds = bounds;
}
void close() override { }
public:
WebRect shownBounds() const
{
return m_shownBounds;
}
private:
WebRect m_shownBounds;
};
WebRect m_shownBounds;
MockWebExternalPopupMenu m_mockWebExternalPopupMenu;
};
class ExternalPopupMenuTest : public testing::Test {
public:
ExternalPopupMenuTest() : m_baseURL("path_to_url") { }
protected:
void SetUp() override
{
m_helper.initialize(false, &m_webFrameClient, &m_webViewClient);
webView()->setUseExternalPopupMenus(true);
}
void TearDown() override
{
Platform::current()->unitTestSupport()->unregisterAllMockedURLs();
}
void registerMockedURLLoad(const std::string& fileName)
{
URLTestHelpers::registerMockedURLLoad(URLTestHelpers::toKURL(m_baseURL + fileName), WebString::fromUTF8(fileName.c_str()), WebString::fromUTF8("popup/"), WebString::fromUTF8("text/html"));
}
void loadFrame(const std::string& fileName)
{
FrameTestHelpers::loadFrame(mainFrame(), m_baseURL + fileName);
}
WebViewImpl* webView() const { return m_helper.webViewImpl(); }
const ExternalPopupMenuWebFrameClient& client() const { return m_webFrameClient; }
WebLocalFrameImpl* mainFrame() const { return m_helper.webViewImpl()->mainFrameImpl(); }
private:
std::string m_baseURL;
FrameTestHelpers::TestWebViewClient m_webViewClient;
ExternalPopupMenuWebFrameClient m_webFrameClient;
FrameTestHelpers::WebViewHelper m_helper;
};
TEST_F(ExternalPopupMenuTest, PopupAccountsForPinchViewportOffset)
{
registerMockedURLLoad("select_mid_screen.html");
loadFrame("select_mid_screen.html");
webView()->resize(WebSize(100, 100));
webView()->layout();
HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->document()->getElementById("select"));
LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject());
ASSERT_TRUE(menuList);
PinchViewport& pinchViewport = webView()->page()->frameHost().pinchViewport();
IntRect rectInDocument = menuList->absoluteBoundingBoxRect();
webView()->setPageScaleFactor(2);
IntPoint scrollDelta(20, 30);
pinchViewport.move(scrollDelta);
menuList->showPopup();
EXPECT_EQ(rectInDocument.x() - scrollDelta.x(), client().shownBounds().x);
EXPECT_EQ(rectInDocument.y() - scrollDelta.y(), client().shownBounds().y);
}
TEST_F(ExternalPopupMenuTest, DidAcceptIndex)
{
registerMockedURLLoad("select.html");
loadFrame("select.html");
HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->document()->getElementById("select"));
LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject());
ASSERT_TRUE(menuList);
menuList->showPopup();
ASSERT_TRUE(menuList->popupIsVisible());
WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(menuList->popup());
client->didAcceptIndex(2);
EXPECT_FALSE(menuList->popupIsVisible());
ASSERT_STREQ("2", menuList->text().utf8().data());
EXPECT_EQ(2, select->selectedIndex());
}
TEST_F(ExternalPopupMenuTest, DidAcceptIndices)
{
registerMockedURLLoad("select.html");
loadFrame("select.html");
HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->document()->getElementById("select"));
LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject());
ASSERT_TRUE(menuList);
menuList->showPopup();
ASSERT_TRUE(menuList->popupIsVisible());
WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(menuList->popup());
int indices[] = { 2 };
WebVector<int> indicesVector(indices, 1);
client->didAcceptIndices(indicesVector);
EXPECT_FALSE(menuList->popupIsVisible());
EXPECT_STREQ("2", menuList->text().utf8().data());
EXPECT_EQ(2, select->selectedIndex());
}
TEST_F(ExternalPopupMenuTest, DidAcceptIndicesClearSelect)
{
registerMockedURLLoad("select.html");
loadFrame("select.html");
HTMLSelectElement* select = toHTMLSelectElement(mainFrame()->frame()->document()->getElementById("select"));
LayoutMenuList* menuList = toLayoutMenuList(select->layoutObject());
ASSERT_TRUE(menuList);
menuList->showPopup();
ASSERT_TRUE(menuList->popupIsVisible());
WebExternalPopupMenuClient* client = static_cast<ExternalPopupMenu*>(menuList->popup());
WebVector<int> indices;
client->didAcceptIndices(indices);
EXPECT_FALSE(menuList->popupIsVisible());
EXPECT_EQ(-1, select->selectedIndex());
}
} // namespace blink
```
|
```go
package ledger
import (
"errors"
"fmt"
"math/big"
"os"
secp "github.com/decred/dcrd/dcrec/secp256k1/v4"
"github.com/decred/dcrd/dcrec/secp256k1/v4/ecdsa"
"gitlab.com/yawning/secp256k1-voi/secec"
"github.com/cosmos/cosmos-sdk/crypto/hd"
"github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1"
"github.com/cosmos/cosmos-sdk/crypto/types"
)
// options stores the Ledger Options that can be used to customize Ledger usage
var options Options
type (
// discoverLedgerFn defines a Ledger discovery function that returns a
// connected device or an error upon failure. Its allows a method to avoid CGO
// dependencies when Ledger support is potentially not enabled.
discoverLedgerFn func() (SECP256K1, error)
// createPubkeyFn supports returning different public key types that implement
// types.PubKey
createPubkeyFn func([]byte) types.PubKey
// SECP256K1 reflects an interface a Ledger API must implement for SECP256K1
SECP256K1 interface {
Close() error
// GetPublicKeySECP256K1 returns an uncompressed pubkey
GetPublicKeySECP256K1([]uint32) ([]byte, error)
// GetAddressPubKeySECP256K1 returns a compressed pubkey and bech32 address (requires user confirmation)
GetAddressPubKeySECP256K1([]uint32, string) ([]byte, string, error)
// SignSECP256K1 signs a message (requires user confirmation)
// The last byte denotes the SIGN_MODE to be used by Ledger: 0 for
// LEGACY_AMINO_JSON, 1 for TEXTUAL. It corresponds to the P2 value
// in path_to_url
SignSECP256K1([]uint32, []byte, byte) ([]byte, error)
}
// Options hosts customization options to account for differences in Ledger
// signing and usage across chains.
Options struct {
discoverLedger discoverLedgerFn
createPubkey createPubkeyFn
appName string
skipDERConversion bool
}
// PrivKeyLedgerSecp256k1 implements PrivKey, calling the ledger nano we
// cache the PubKey from the first call to use it later.
PrivKeyLedgerSecp256k1 struct {
// CachedPubKey should be private, but we want to encode it via
// go-amino so we can view the address later, even without having the
// ledger attached.
CachedPubKey types.PubKey
Path hd.BIP44Params
}
)
// Initialize the default options values for the Cosmos Ledger
func initOptionsDefault() {
options.createPubkey = func(key []byte) types.PubKey {
return &secp256k1.PubKey{Key: key}
}
options.appName = "Cosmos"
options.skipDERConversion = false
}
// SetDiscoverLedger set the discoverLedger function to use a different Ledger derivation
func SetDiscoverLedger(fn discoverLedgerFn) {
options.discoverLedger = fn
}
// SetCreatePubkey set the createPubkey function to use a different public key
func SetCreatePubkey(fn createPubkeyFn) {
options.createPubkey = fn
}
// SetAppName set the Ledger app name to use a different app name
func SetAppName(appName string) {
options.appName = appName
}
// SetSkipDERConversion set the DER Conversion requirement to true (false by default)
func SetSkipDERConversion() {
options.skipDERConversion = true
}
// NewPrivKeySecp256k1Unsafe will generate a new key and store the public key for later use.
//
// This function is marked as unsafe as it will retrieve a pubkey without user verification.
// It can only be used to verify a pubkey but never to create new accounts/keys. In that case,
// please refer to NewPrivKeySecp256k1
func NewPrivKeySecp256k1Unsafe(path hd.BIP44Params) (types.LedgerPrivKeyAminoJSON, error) {
device, err := getDevice()
if err != nil {
return nil, err
}
defer warnIfErrors(device.Close)
pubKey, err := getPubKeyUnsafe(device, path)
if err != nil {
return nil, err
}
return PrivKeyLedgerSecp256k1{pubKey, path}, nil
}
// NewPrivKeySecp256k1 will generate a new key and store the public key for later use.
// The request will require user confirmation and will show account and index in the device
func NewPrivKeySecp256k1(path hd.BIP44Params, hrp string) (types.LedgerPrivKey, string, error) {
device, err := getDevice()
if err != nil {
return nil, "", fmt.Errorf("failed to retrieve device: %w", err)
}
defer warnIfErrors(device.Close)
pubKey, addr, err := getPubKeyAddrSafe(device, path, hrp)
if err != nil {
return nil, "", fmt.Errorf("failed to recover pubkey: %w", err)
}
return PrivKeyLedgerSecp256k1{pubKey, path}, addr, nil
}
// PubKey returns the cached public key.
func (pkl PrivKeyLedgerSecp256k1) PubKey() types.PubKey {
return pkl.CachedPubKey
}
// Sign returns a secp256k1 signature for the corresponding message using
// SIGN_MODE_TEXTUAL.
func (pkl PrivKeyLedgerSecp256k1) Sign(message []byte) ([]byte, error) {
device, err := getDevice()
if err != nil {
return nil, err
}
defer warnIfErrors(device.Close)
return sign(device, pkl, message, 1)
}
// SignLedgerAminoJSON returns a secp256k1 signature for the corresponding message using
// SIGN_MODE_LEGACY_AMINO_JSON.
func (pkl PrivKeyLedgerSecp256k1) SignLedgerAminoJSON(message []byte) ([]byte, error) {
device, err := getDevice()
if err != nil {
return nil, err
}
defer warnIfErrors(device.Close)
return sign(device, pkl, message, 0)
}
// ShowAddress triggers a ledger device to show the corresponding address.
func ShowAddress(path hd.BIP44Params, expectedPubKey types.PubKey, accountAddressPrefix string) error {
device, err := getDevice()
if err != nil {
return err
}
defer warnIfErrors(device.Close)
pubKey, err := getPubKeyUnsafe(device, path)
if err != nil {
return err
}
if !pubKey.Equals(expectedPubKey) {
return errors.New("the key's pubkey does not match with the one retrieved from Ledger. Check that the HD path and device are the correct ones")
}
pubKey2, _, err := getPubKeyAddrSafe(device, path, accountAddressPrefix)
if err != nil {
return err
}
if !pubKey2.Equals(expectedPubKey) {
return errors.New("the key's pubkey does not match with the one retrieved from Ledger. Check that the HD path and device are the correct ones")
}
return nil
}
// ValidateKey allows us to verify the sanity of a public key after loading it
// from disk.
func (pkl PrivKeyLedgerSecp256k1) ValidateKey() error {
device, err := getDevice()
if err != nil {
return err
}
defer warnIfErrors(device.Close)
return validateKey(device, pkl)
}
// AssertIsPrivKeyInner implements the PrivKey interface. It performs a no-op.
func (pkl *PrivKeyLedgerSecp256k1) AssertIsPrivKeyInner() {}
// Bytes implements the PrivKey interface. It stores the cached public key so
// we can verify the same key when we reconnect to a ledger.
func (pkl PrivKeyLedgerSecp256k1) Bytes() []byte {
return cdc.MustMarshal(pkl)
}
// Equals implements the PrivKey interface. It makes sure two private keys
// refer to the same public key.
func (pkl PrivKeyLedgerSecp256k1) Equals(other types.LedgerPrivKey) bool {
if otherKey, ok := other.(PrivKeyLedgerSecp256k1); ok {
return pkl.CachedPubKey.Equals(otherKey.CachedPubKey)
}
return false
}
func (pkl PrivKeyLedgerSecp256k1) Type() string { return "PrivKeyLedgerSecp256k1" }
// warnIfErrors wraps a function and writes a warning to stderr. This is required
// to avoid ignoring errors when defer is used. Using defer may result in linter warnings.
func warnIfErrors(f func() error) {
if err := f(); err != nil {
_, _ = fmt.Fprint(os.Stderr, "received error when closing ledger connection", err)
}
}
func convertDERtoBER(signatureDER []byte) ([]byte, error) {
sigDER, err := ecdsa.ParseDERSignature(signatureDER)
if err != nil {
return nil, err
}
sigStr := sigDER.Serialize()
// The format of a DER encoded signature is as follows:
// 0x30 <total length> 0x02 <length of R> <R> 0x02 <length of S> <S>
r, s := new(big.Int), new(big.Int)
r.SetBytes(sigStr[4 : 4+sigStr[3]])
s.SetBytes(sigStr[4+sigStr[3]+2:])
sModNScalar := new(secp.ModNScalar)
sModNScalar.SetByteSlice(s.Bytes())
// based on path_to_url#L33-L50
if sModNScalar.IsOverHalfOrder() {
s = new(big.Int).Sub(secp.S256().N, s)
}
sigBytes := make([]byte, 64)
// 0 pad the byte arrays from the left if they aren't big enough.
copy(sigBytes[32-len(r.Bytes()):32], r.Bytes())
copy(sigBytes[64-len(s.Bytes()):64], s.Bytes())
return sigBytes, nil
}
func getDevice() (SECP256K1, error) {
if options.discoverLedger == nil {
return nil, errors.New("no Ledger discovery function defined")
}
device, err := options.discoverLedger()
if err != nil {
return nil, fmt.Errorf("ledger nano S: %w", err)
}
return device, nil
}
func validateKey(device SECP256K1, pkl PrivKeyLedgerSecp256k1) error {
pub, err := getPubKeyUnsafe(device, pkl.Path)
if err != nil {
return err
}
// verify this matches cached address
if !pub.Equals(pkl.CachedPubKey) {
return errors.New("cached key does not match retrieved key")
}
return nil
}
// Sign calls the ledger and stores the PubKey for future use.
//
// Communication is checked on NewPrivKeyLedger and PrivKeyFromBytes, returning
// an error, so this should only trigger if the private key is held in memory
// for a while before use.
//
// Last byte P2 is 0 for LEGACY_AMINO_JSON, and 1 for TEXTUAL.
func sign(device SECP256K1, pkl PrivKeyLedgerSecp256k1, msg []byte, p2 byte) ([]byte, error) {
err := validateKey(device, pkl)
if err != nil {
return nil, err
}
sig, err := device.SignSECP256K1(pkl.Path.DerivationPath(), msg, p2)
if err != nil {
return nil, err
}
if options.skipDERConversion {
return sig, nil
}
return convertDERtoBER(sig)
}
// getPubKeyUnsafe reads the pubkey from a ledger device
//
// This function is marked as unsafe as it will retrieve a pubkey without user verification
// It can only be used to verify a pubkey but never to create new accounts/keys. In that case,
// please refer to getPubKeyAddrSafe
//
// since this involves IO, it may return an error, which is not exposed
// in the PubKey interface, so this function allows better error handling
func getPubKeyUnsafe(device SECP256K1, path hd.BIP44Params) (types.PubKey, error) {
publicKey, err := device.GetPublicKeySECP256K1(path.DerivationPath())
if err != nil {
return nil, fmt.Errorf("please open the %v app on the Ledger device - error: %w", options.appName, err)
}
// re-serialize in the 33-byte compressed format
cmp, err := secec.NewPublicKey(publicKey)
if err != nil {
return nil, fmt.Errorf("error parsing public key: %w", err)
}
compressedPublicKey := make([]byte, secp256k1.PubKeySize)
copy(compressedPublicKey, cmp.CompressedBytes())
return options.createPubkey(compressedPublicKey), nil
}
// getPubKeyAddr reads the pubkey and the address from a ledger device.
// This function is marked as Safe as it will require user confirmation and
// account and index will be shown in the device.
//
// Since this involves IO, it may return an error, which is not exposed
// in the PubKey interface, so this function allows better error handling.
func getPubKeyAddrSafe(device SECP256K1, path hd.BIP44Params, hrp string) (types.PubKey, string, error) {
publicKey, addr, err := device.GetAddressPubKeySECP256K1(path.DerivationPath(), hrp)
if err != nil {
return nil, "", fmt.Errorf("%w: address rejected for path %s", err, path)
}
// re-serialize in the 33-byte compressed format
cmp, err := secec.NewPublicKey(publicKey)
if err != nil {
return nil, "", fmt.Errorf("error parsing public key: %w", err)
}
compressedPublicKey := make([]byte, secp256k1.PubKeySize)
copy(compressedPublicKey, cmp.CompressedBytes())
return options.createPubkey(compressedPublicKey), addr, nil
}
```
|
```php
<?php
use DBA\AccessGroupAgent;
use DBA\Agent;
use DBA\Assignment;
use DBA\Chunk;
use DBA\CrackerBinary;
use DBA\File;
use DBA\FileTask;
use DBA\JoinFilter;
use DBA\OrderFilter;
use DBA\Preprocessor;
use DBA\QueryFilter;
use DBA\Factory;
require_once(dirname(__FILE__) . "/inc/load.php");
if (!Login::getInstance()->isLoggedin()) {
header("Location: index.php?err=4" . time() . "&fw=" . urlencode($_SERVER['PHP_SELF'] . "?" . $_SERVER['QUERY_STRING']));
die();
}
AccessControl::getInstance()->checkPermission(array_merge(DViewControl::TASKS_VIEW_PERM, DAccessControl::RUN_TASK_ACCESS));
Template::loadInstance("tasks/index");
Menu::get()->setActive("tasks_list");
//catch actions here...
if (isset($_POST['action']) && CSRF::check($_POST['csrf'])) {
$taskHandler = new TaskHandler();
$taskHandler->handle($_POST['action']);
if (UI::getNumMessages() == 0) {
Util::refresh();
}
}
//test if auto-reload is enabled
$autorefresh = 0;
if (isset($_COOKIE['autorefresh']) && $_COOKIE['autorefresh'] == '1') {
$autorefresh = 10;
}
if (isset($_POST['toggleautorefresh'])) {
if ($autorefresh != 0) {
$autorefresh = 0;
setcookie("autorefresh", "0", time() - 600);
}
else {
$autorefresh = 10;
setcookie("autorefresh", "1", time() + 3600 * 24);
}
Util::refresh();
}
if ($autorefresh > 0) { //renew cookie
setcookie("autorefresh", "1", time() + 3600 * 24);
}
UI::add('autorefresh', 0);
if (isset($_GET['id']) || !isset($_GET['new'])) {
UI::add('autorefresh', $autorefresh);
UI::add('autorefreshUrl', "");
}
if (isset($_GET['id'])) {
AccessControl::getInstance()->checkPermission(DViewControl::TASKS_VIEW_PERM);
Template::loadInstance("tasks/detail");
$task = Factory::getTaskFactory()->get($_GET['id']);
if ($task == null) {
UI::printError("ERROR", "Invalid task ID!");
}
UI::add('task', $task);
$taskWrapper = Factory::getTaskWrapperFactory()->get($task->getTaskWrapperId());
UI::add('taskWrapper', $taskWrapper);
$fileInfo = Util::getFileInfo($task, AccessUtils::getAccessGroupsOfUser(Login::getInstance()->getUser()));
if ($fileInfo[4]) {
UI::printError("ERROR", "No access to this task!");
}
$hashlist = Factory::getHashlistFactory()->get($taskWrapper->getHashlistId());
if (!AccessUtils::userCanAccessHashlists($hashlist, Login::getInstance()->getUser())) {
UI::printError("ERROR", "No access to this task!");
}
UI::add('hashlist', $hashlist);
$hashtype = Factory::getHashTypeFactory()->get($hashlist->getHashtypeId());
UI::add('hashtype', $hashtype);
$isActive = 0;
$activeChunks = [];
$activeChunksIds = new DataSet();
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=");
$chunks = Factory::getChunkFactory()->filter([Factory::FILTER => $qF]);
$activeAgents = new DataSet();
$agentsSpeed = new DataSet();
$currentSpeed = 0;
foreach ($chunks as $chunk) {
if (time() - max($chunk->getSolveTime(), $chunk->getDispatchTime()) < SConfig::getInstance()->getVal(DConfig::CHUNK_TIMEOUT) && $chunk->getProgress() < 10000) {
$isActive = 1;
$activeChunks[] = $chunk;
$activeChunksIds->addValue($chunk->getId(), true);
$activeAgents->addValue($chunk->getAgentId(), true);
$agentsSpeed->addValue($chunk->getAgentId(), $chunk->getSpeed());
$currentSpeed += $chunk->getSpeed();
}
else {
$activeChunksIds->addValue($chunk->getId(), false);
}
}
UI::add('isActive', $isActive);
UI::add('currentSpeed', $currentSpeed);
$agentsBench = new DataSet();
$qF = new QueryFilter(Assignment::TASK_ID, $task->getId(), "=");
$assignments = Factory::getAssignmentFactory()->filter([Factory::FILTER => $qF]);
foreach ($assignments as $assignment) {
$agentsBench->addValue($assignment->getAgentId(), $assignment->getBenchmark());
}
$cProgress = 0;
$chunkIntervals = [];
$agentsProgress = new DataSet();
$agentsSpent = new DataSet();
$agentsCracked = new DataSet();
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=");
$chunks = Factory::getChunkFactory()->filter([Factory::FILTER => $qF]);
foreach ($chunks as $chunk) {
if ($chunk->getDispatchTime() > 0 && $chunk->getSolveTime() > 0) {
$chunkIntervals[] = ["start" => $chunk->getDispatchTime(), "stop" => $chunk->getSolveTime()];
}
$cProgress += $chunk->getCheckpoint() - $chunk->getSkip();
if (!$agentsProgress->getVal($chunk->getAgentId())) {
$agentsProgress->addValue($chunk->getAgentId(), $chunk->getCheckpoint() - $chunk->getSkip());
$agentsCracked->addValue($chunk->getAgentId(), $chunk->getCracked());
$agentsSpent->addValue($chunk->getAgentId(), max($chunk->getSolveTime() - $chunk->getDispatchTime(), 0));
}
else {
$agentsProgress->addValue($chunk->getAgentId(), $agentsProgress->getVal($chunk->getAgentId()) + $chunk->getCheckpoint() - $chunk->getSkip());
$agentsCracked->addValue($chunk->getAgentId(), $agentsCracked->getVal($chunk->getAgentId()) + $chunk->getCracked());
$agentsSpent->addValue($chunk->getAgentId(), $agentsSpent->getVal($chunk->getAgentId()) + max($chunk->getSolveTime() - $chunk->getDispatchTime(), 0));
}
}
UI::add('agentsProgress', $agentsProgress);
UI::add('agentsSpent', $agentsSpent);
UI::add('agentsCracked', $agentsCracked);
UI::add('cProgress', $cProgress);
$timeChunks = $chunks;
usort($timeChunks, "Util::compareChunksTime");
$timeSpent = 0;
$current = 0;
foreach ($timeChunks as $c) {
if ($c->getDispatchTime() > $current) {
$timeSpent += $c->getSolveTime() - $c->getDispatchTime();
$current = $c->getSolveTime();
}
else if ($c->getSolveTime() > $current) {
$timeSpent += $c->getSolveTime() - $current;
$current = $c->getSolveTime();
}
}
UI::add('timeSpent', $timeSpent);
if ($task->getKeyspace() != 0 && ($cProgress / $task->getKeyspace()) != 0) {
UI::add('timeLeft', round($timeSpent / ($cProgress / $task->getKeyspace()) - $timeSpent));
}
else {
UI::add('timeLeft', -1);
}
$qF = new QueryFilter(FileTask::TASK_ID, $task->getId(), "=", Factory::getFileTaskFactory());
$jF = new JoinFilter(Factory::getFileTaskFactory(), FileTask::FILE_ID, File::FILE_ID);
$joinedFiles = Factory::getFileFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF]);
UI::add('attachedFiles', $joinedFiles[Factory::getFileFactory()->getModelName()]);
$jF = new JoinFilter(Factory::getAssignmentFactory(), Assignment::AGENT_ID, Agent::AGENT_ID);
$qF = new QueryFilter(Assignment::TASK_ID, $task->getId(), "=", Factory::getAssignmentFactory());
$joinedAgents = Factory::getAgentFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF]);
$assignedAgents = array();
foreach ($joinedAgents[Factory::getAgentFactory()->getModelName()] as $agent) {
/** @var $agent Agent */
$assignedAgents[] = $agent->getId();
}
UI::add('agents', $joinedAgents[Factory::getAgentFactory()->getModelName()]);
UI::add('activeAgents', $activeAgents);
UI::add('agentsBench', $agentsBench);
UI::add('agentsSpeed', $agentsSpeed);
$assignAgents = array();
$qF = new QueryFilter(AccessGroupAgent::ACCESS_GROUP_ID, $hashlist->getAccessGroupId(), "=");
$jF = new JoinFilter(Factory::getAccessGroupAgentFactory(), AccessGroupAgent::AGENT_ID, Agent::AGENT_ID);
$allAgents = Factory::getAgentFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF])[Factory::getAgentFactory()->getModelName()];
foreach ($allAgents as $agent) {
if (!in_array($agent->getId(), $assignedAgents)) {
$assignAgents[] = $agent;
}
}
UI::add('assignAgents', $assignAgents);
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=");
UI::add('numChunks', Factory::getChunkFactory()->countFilter([Factory::FILTER => $qF]));
UI::add('showAllAgents', false);
if (isset($_GET['allagents'])) {
UI::add('showAllAgents', true);
$allAgentsSpent = new DataSet();
$allAgents = new DataSet();
$agentObjects = array();
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=", Factory::getChunkFactory());
$jF = new JoinFilter(Factory::getChunkFactory(), Chunk::AGENT_ID, Agent::AGENT_ID);
$joinedAgents = Factory::getAgentFactory()->filter([Factory::FILTER => $qF, Factory::JOIN => $jF]);
/** @var $agents Agent[] */
$agents = $joinedAgents[Factory::getAgentFactory()->getModelName()];
for ($i = 0; $i < sizeof($agents); $i++) {
/** @var $chunk Chunk */
$chunk = $joinedAgents[Factory::getChunkFactory()->getModelName()][$i];
$agent = $agents[$i];
if ($allAgents->getVal($agent->getId()) == null) {
$allAgents->addValue($agent->getId(), $agent);
$agentObjects[] = $agent;
}
if ($chunk->getSolveTime() > $chunk->getDispatchTime()) {
if ($allAgentsSpent->getVal($agent->getId()) == null) {
$allAgentsSpent->addValue($agent->getId(), $chunk->getSolveTime() - $chunk->getDispatchTime());
}
else {
$allAgentsSpent->addValue($agent->getId(), $allAgentsSpent->getVal($agent->getId()) + $chunk->getSolveTime() - $chunk->getDispatchTime());
}
}
}
UI::add('agentObjects', $agentObjects);
UI::add('allAgentsSpent', $allAgentsSpent);
}
UI::add('activeChunks', $activeChunksIds);
if (isset($_GET['all'])) {
if ($_GET['all'] == 1) {
// show last 100
UI::add('chunkFilter', 1);
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=");
$oF = new OrderFilter(Chunk::SOLVE_TIME, "DESC LIMIT 100");
UI::add('chunks', Factory::getChunkFactory()->filter([Factory::FILTER => $qF, Factory::ORDER => $oF]));
}
else if ($_GET['all'] == 2) {
UI::add('chunkFilter', 2);
// show all, page by page
if (!isset($_GET['pagesize'])) {
$chunkPageSize = 100;
}
else {
$chunkPageSize = intval($_GET['pagesize']);
}
if (!isset($_GET['page'])) {
$page = 0;
}
else {
$page = intval($_GET['page']);
}
UI::add('page', $page);
$limit = $page * $chunkPageSize;
$oFp = new OrderFilter(Chunk::SOLVE_TIME, "DESC LIMIT $limit, $chunkPageSize", Factory::getChunkFactory());
UI::add('chunksPageTitle', "All chunks (page " . ($page + 1) . ")");
$qF = new QueryFilter(Chunk::TASK_ID, $task->getId(), "=");
$oF = new OrderFilter(Chunk::SOLVE_TIME, "DESC");
$numEntries = Factory::getChunkFactory()->countFilter([Factory::FILTER => $qF]);
UI::add('maxpage', floor($numEntries / $chunkPageSize));
UI::add('chunks', Factory::getChunkFactory()->filter([Factory::FILTER => $qF, Factory::ORDER => [$oF, $oFp]]));
UI::add('activeChunks', $activeChunksIds);
}
else {
// show active only
UI::add('chunkFilter', 0);
UI::add('chunks', $activeChunks);
}
}
else {
// show active only by default
UI::add('chunkFilter', 0);
UI::add('chunks', $activeChunks);
}
if ($task->getUsePreprocessor()) {
try {
UI::add('preprocessor', PreprocessorUtils::getPreprocessor($task->getUsePreprocessor()));
}
catch (HTException $e) {
UI::printError("ERROR", "Failed to load preprocessor!");
}
}
$agents = Factory::getAgentFactory()->filter([]);
$fullAgents = new DataSet();
foreach ($agents as $agent) {
$fullAgents->addValue($agent->getId(), $agent);
}
UI::add('fullAgents', $fullAgents);
UI::add('pageTitle', "Task details for " . $task->getTaskName());
// load graph data
$data = Util::getSpeedDataSet($task->getId(), 50, 0, $task->getStatusTimer());
if (sizeof($data) > 0) {
$xlabels = [];
$rawData = [];
foreach ($data as $key => $val) {
$xlabels[] = date(SConfig::getInstance()->getVal(DConfig::TIME_FORMAT), $key);
$rawData[] = $val;
}
$datasets[0] = [
"label" => "H/s",
"fill" => false,
"lineTension" => 0.2,
"borderColor" => "#008000",
"backgroundColor" => "#008000",
"data" => $rawData
];
UI::add("taskSpeedXLabels", json_encode($xlabels));
UI::add("taskSpeed", json_encode($datasets));
}
UI::add('taskGraph', (sizeof($data) > 0) ? 1 : 0);
}
else if (isset($_GET['new'])) {
AccessControl::getInstance()->checkPermission(array_merge(DAccessControl::RUN_TASK_ACCESS, DAccessControl::CREATE_TASK_ACCESS));
Template::loadInstance("tasks/new");
Menu::get()->setActive("tasks_new");
$orig = 0;
$origTask = null;
$origType = 0;
$hashlistId = 0;
$copy = null;
if (isset($_GET["copy"])) {
AccessControl::getInstance()->checkPermission(DAccessControl::CREATE_TASK_ACCESS); // enforce additional permission for this
//copied from a task
$copy = Factory::getTaskFactory()->get($_GET['copy']);
if ($copy != null) {
$orig = $copy->getId();
$origTask = clone $copy;
$origType = 1;
$hashlistId = Factory::getTaskWrapperFactory()->get($copy->getTaskWrapperId())->getHashlistId();
$copy->setId(0);
$match = array();
if (preg_match('/\(copy([0-9]+)\)/i', $copy->getTaskName(), $match)) {
$name = $copy->getTaskName();
$name = str_replace($match[0], "(copy" . (++$match[1]) . ")", $name);
$copy->setTaskName($name);
}
else {
$copy->setTaskName($copy->getTaskName() . " (copy1)");
}
}
}
else if (isset($_GET["copyPre"])) {
//copied from a task
$copy = Factory::getPretaskFactory()->get($_GET['copyPre']);
if ($copy != null) {
$orig = $copy->getId();
$origTask = $copy;
$origType = 2;
$copy = TaskUtils::getFromPretask($copy);
}
}
if ($copy === null) {
$copy = TaskUtils::getDefault();
}
if (strpos($copy->getAttackCmd(), SConfig::getInstance()->getVal(DConfig::HASHLIST_ALIAS)) === false) {
$copy->setAttackCmd(SConfig::getInstance()->getVal(DConfig::HASHLIST_ALIAS) . " " . $copy->getAttackCmd());
}
UI::add('accessGroups', AccessUtils::getAccessGroupsOfUser(Login::getInstance()->getUser()));
$accessGroupIds = Util::arrayOfIds(UI::get('accessGroups'));
UI::add('orig', $orig);
UI::add('copy', $copy);
UI::add('origType', $origType);
UI::add('hashlistId', $hashlistId);
$lists = array();
$res = HashlistUtils::getHashlists(Login::getInstance()->getUser());
foreach ($res as $list) {
$set = new DataSet();
$set->addValue('id', $list->getId());
$set->addValue('name', $list->getHashlistName());
$lists[] = $set;
}
$res = HashlistUtils::getSuperhashlists(Login::getInstance()->getUser());
foreach ($res as $list) {
$set = new DataSet();
$set->addValue('id', $list->getId());
$set->addValue('name', $list->getHashlistName());
$lists[] = $set;
}
UI::add('lists', $lists);
$oF = new OrderFilter(Preprocessor::NAME, "ASC");
$preprocessors = Factory::getPreprocessorFactory()->filter([Factory::ORDER => $oF]);
UI::add('preprocessors', $preprocessors);
$origFiles = array();
if ($origType == 1) {
$origFiles = Util::arrayOfIds(TaskUtils::getFilesOfTask($origTask));
}
else if ($origType == 2) {
$origFiles = Util::arrayOfIds(TaskUtils::getFilesOfPretask($origTask));
}
$arr = FileUtils::loadFilesByCategory(Login::getInstance()->getUser(), $origFiles);
UI::add('wordlists', $arr[1]);
UI::add('rules', $arr[0]);
UI::add('other', $arr[2]);
$oF = new OrderFilter(CrackerBinary::CRACKER_BINARY_ID, "DESC");
UI::add('binaries', Factory::getCrackerBinaryTypeFactory()->filter([]));
$versions = Factory::getCrackerBinaryFactory()->filter([Factory::ORDER => $oF]);
usort($versions, ["Util", "versionComparisonBinary"]);
UI::add('versions', $versions);
UI::add('pageTitle', "Create Task");
}
else {
AccessControl::getInstance()->checkPermission(DViewControl::TASKS_VIEW_PERM);
UI::add('showArchived', false);
UI::add('pageTitle', "Tasks");
if (isset($_GET['archived']) && $_GET['archived'] == 'true') {
Util::loadTasks(true);
UI::add('showArchived', true);
UI::add('pageTitle', "Archived Tasks");
}
else {
Util::loadTasks(false);
}
}
echo Template::getInstance()->render(UI::getObjects());
```
|
```smalltalk
using UIKit;
namespace SkiaSharp.Tests
{
public class Program
{
static void Main(string[] args)
{
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
}
```
|
```c
/*your_sha256_hash---------
*
* pg_constraint.c
* routines to support manipulation of the pg_constraint relation
*
*
*
* IDENTIFICATION
* src/backend/catalog/pg_constraint.c
*
*your_sha256_hash---------
*/
#include "postgres.h"
#include "access/genam.h"
#include "access/htup_details.h"
#include "access/sysattr.h"
#include "access/table.h"
#include "access/xact.h"
#include "catalog/catalog.h"
#include "catalog/dependency.h"
#include "catalog/indexing.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_constraint.h"
#include "catalog/pg_operator.h"
#include "catalog/pg_type.h"
#include "commands/defrem.h"
#include "commands/tablecmds.h"
#include "utils/array.h"
#include "utils/builtins.h"
#include "utils/fmgroids.h"
#include "utils/lsyscache.h"
#include "utils/rel.h"
#include "utils/syscache.h"
/*
* CreateConstraintEntry
* Create a constraint table entry.
*
* Subsidiary records (such as triggers or indexes to implement the
* constraint) are *not* created here. But we do make dependency links
* from the constraint to the things it depends on.
*
* The new constraint's OID is returned.
*/
Oid
CreateConstraintEntry(const char *constraintName,
Oid constraintNamespace,
char constraintType,
bool isDeferrable,
bool isDeferred,
bool isValidated,
Oid parentConstrId,
Oid relId,
const int16 *constraintKey,
int constraintNKeys,
int constraintNTotalKeys,
Oid domainId,
Oid indexRelId,
Oid foreignRelId,
const int16 *foreignKey,
const Oid *pfEqOp,
const Oid *ppEqOp,
const Oid *ffEqOp,
int foreignNKeys,
char foreignUpdateType,
char foreignDeleteType,
char foreignMatchType,
const Oid *exclOp,
Node *conExpr,
const char *conBin,
bool conIsLocal,
int conInhCount,
bool conNoInherit,
bool is_internal)
{
Relation conDesc;
Oid conOid;
HeapTuple tup;
bool nulls[Natts_pg_constraint];
Datum values[Natts_pg_constraint];
ArrayType *conkeyArray;
ArrayType *confkeyArray;
ArrayType *conpfeqopArray;
ArrayType *conppeqopArray;
ArrayType *conffeqopArray;
ArrayType *conexclopArray;
NameData cname;
int i;
ObjectAddress conobject;
ObjectAddresses *addrs_auto;
ObjectAddresses *addrs_normal;
conDesc = table_open(ConstraintRelationId, RowExclusiveLock);
Assert(constraintName);
namestrcpy(&cname, constraintName);
/*
* Convert C arrays into Postgres arrays.
*/
if (constraintNKeys > 0)
{
Datum *conkey;
conkey = (Datum *) palloc(constraintNKeys * sizeof(Datum));
for (i = 0; i < constraintNKeys; i++)
conkey[i] = Int16GetDatum(constraintKey[i]);
conkeyArray = construct_array(conkey, constraintNKeys,
INT2OID, 2, true, TYPALIGN_SHORT);
}
else
conkeyArray = NULL;
if (foreignNKeys > 0)
{
Datum *fkdatums;
fkdatums = (Datum *) palloc(foreignNKeys * sizeof(Datum));
for (i = 0; i < foreignNKeys; i++)
fkdatums[i] = Int16GetDatum(foreignKey[i]);
confkeyArray = construct_array(fkdatums, foreignNKeys,
INT2OID, 2, true, TYPALIGN_SHORT);
for (i = 0; i < foreignNKeys; i++)
fkdatums[i] = ObjectIdGetDatum(pfEqOp[i]);
conpfeqopArray = construct_array(fkdatums, foreignNKeys,
OIDOID, sizeof(Oid), true, TYPALIGN_INT);
for (i = 0; i < foreignNKeys; i++)
fkdatums[i] = ObjectIdGetDatum(ppEqOp[i]);
conppeqopArray = construct_array(fkdatums, foreignNKeys,
OIDOID, sizeof(Oid), true, TYPALIGN_INT);
for (i = 0; i < foreignNKeys; i++)
fkdatums[i] = ObjectIdGetDatum(ffEqOp[i]);
conffeqopArray = construct_array(fkdatums, foreignNKeys,
OIDOID, sizeof(Oid), true, TYPALIGN_INT);
}
else
{
confkeyArray = NULL;
conpfeqopArray = NULL;
conppeqopArray = NULL;
conffeqopArray = NULL;
}
if (exclOp != NULL)
{
Datum *opdatums;
opdatums = (Datum *) palloc(constraintNKeys * sizeof(Datum));
for (i = 0; i < constraintNKeys; i++)
opdatums[i] = ObjectIdGetDatum(exclOp[i]);
conexclopArray = construct_array(opdatums, constraintNKeys,
OIDOID, sizeof(Oid), true, TYPALIGN_INT);
}
else
conexclopArray = NULL;
/* initialize nulls and values */
for (i = 0; i < Natts_pg_constraint; i++)
{
nulls[i] = false;
values[i] = (Datum) NULL;
}
conOid = GetNewOidWithIndex(conDesc, ConstraintOidIndexId,
Anum_pg_constraint_oid);
values[Anum_pg_constraint_oid - 1] = ObjectIdGetDatum(conOid);
values[Anum_pg_constraint_conname - 1] = NameGetDatum(&cname);
values[Anum_pg_constraint_connamespace - 1] = ObjectIdGetDatum(constraintNamespace);
values[Anum_pg_constraint_contype - 1] = CharGetDatum(constraintType);
values[Anum_pg_constraint_condeferrable - 1] = BoolGetDatum(isDeferrable);
values[Anum_pg_constraint_condeferred - 1] = BoolGetDatum(isDeferred);
values[Anum_pg_constraint_convalidated - 1] = BoolGetDatum(isValidated);
values[Anum_pg_constraint_conrelid - 1] = ObjectIdGetDatum(relId);
values[Anum_pg_constraint_contypid - 1] = ObjectIdGetDatum(domainId);
values[Anum_pg_constraint_conindid - 1] = ObjectIdGetDatum(indexRelId);
values[Anum_pg_constraint_conparentid - 1] = ObjectIdGetDatum(parentConstrId);
values[Anum_pg_constraint_confrelid - 1] = ObjectIdGetDatum(foreignRelId);
values[Anum_pg_constraint_confupdtype - 1] = CharGetDatum(foreignUpdateType);
values[Anum_pg_constraint_confdeltype - 1] = CharGetDatum(foreignDeleteType);
values[Anum_pg_constraint_confmatchtype - 1] = CharGetDatum(foreignMatchType);
values[Anum_pg_constraint_conislocal - 1] = BoolGetDatum(conIsLocal);
values[Anum_pg_constraint_coninhcount - 1] = Int32GetDatum(conInhCount);
values[Anum_pg_constraint_connoinherit - 1] = BoolGetDatum(conNoInherit);
if (conkeyArray)
values[Anum_pg_constraint_conkey - 1] = PointerGetDatum(conkeyArray);
else
nulls[Anum_pg_constraint_conkey - 1] = true;
if (confkeyArray)
values[Anum_pg_constraint_confkey - 1] = PointerGetDatum(confkeyArray);
else
nulls[Anum_pg_constraint_confkey - 1] = true;
if (conpfeqopArray)
values[Anum_pg_constraint_conpfeqop - 1] = PointerGetDatum(conpfeqopArray);
else
nulls[Anum_pg_constraint_conpfeqop - 1] = true;
if (conppeqopArray)
values[Anum_pg_constraint_conppeqop - 1] = PointerGetDatum(conppeqopArray);
else
nulls[Anum_pg_constraint_conppeqop - 1] = true;
if (conffeqopArray)
values[Anum_pg_constraint_conffeqop - 1] = PointerGetDatum(conffeqopArray);
else
nulls[Anum_pg_constraint_conffeqop - 1] = true;
if (conexclopArray)
values[Anum_pg_constraint_conexclop - 1] = PointerGetDatum(conexclopArray);
else
nulls[Anum_pg_constraint_conexclop - 1] = true;
if (conBin)
values[Anum_pg_constraint_conbin - 1] = CStringGetTextDatum(conBin);
else
nulls[Anum_pg_constraint_conbin - 1] = true;
tup = heap_form_tuple(RelationGetDescr(conDesc), values, nulls);
CatalogTupleInsert(conDesc, tup);
ObjectAddressSet(conobject, ConstraintRelationId, conOid);
table_close(conDesc, RowExclusiveLock);
/* Handle set of auto dependencies */
addrs_auto = new_object_addresses();
if (OidIsValid(relId))
{
/*
* Register auto dependency from constraint to owning relation, or to
* specific column(s) if any are mentioned.
*/
ObjectAddress relobject;
if (constraintNTotalKeys > 0)
{
for (i = 0; i < constraintNTotalKeys; i++)
{
ObjectAddressSubSet(relobject, RelationRelationId, relId,
constraintKey[i]);
add_exact_object_address(&relobject, addrs_auto);
}
}
else
{
ObjectAddressSet(relobject, RelationRelationId, relId);
add_exact_object_address(&relobject, addrs_auto);
}
}
if (OidIsValid(domainId))
{
/*
* Register auto dependency from constraint to owning domain
*/
ObjectAddress domobject;
ObjectAddressSet(domobject, TypeRelationId, domainId);
add_exact_object_address(&domobject, addrs_auto);
}
record_object_address_dependencies(&conobject, addrs_auto,
DEPENDENCY_AUTO);
free_object_addresses(addrs_auto);
/* Handle set of normal dependencies */
addrs_normal = new_object_addresses();
if (OidIsValid(foreignRelId))
{
/*
* Register normal dependency from constraint to foreign relation, or
* to specific column(s) if any are mentioned.
*/
ObjectAddress relobject;
if (foreignNKeys > 0)
{
for (i = 0; i < foreignNKeys; i++)
{
ObjectAddressSubSet(relobject, RelationRelationId,
foreignRelId, foreignKey[i]);
add_exact_object_address(&relobject, addrs_normal);
}
}
else
{
ObjectAddressSet(relobject, RelationRelationId, foreignRelId);
add_exact_object_address(&relobject, addrs_normal);
}
}
if (OidIsValid(indexRelId) && constraintType == CONSTRAINT_FOREIGN)
{
/*
* Register normal dependency on the unique index that supports a
* foreign-key constraint. (Note: for indexes associated with unique
* or primary-key constraints, the dependency runs the other way, and
* is not made here.)
*/
ObjectAddress relobject;
ObjectAddressSet(relobject, RelationRelationId, indexRelId);
add_exact_object_address(&relobject, addrs_normal);
}
if (foreignNKeys > 0)
{
/*
* Register normal dependencies on the equality operators that support
* a foreign-key constraint. If the PK and FK types are the same then
* all three operators for a column are the same; otherwise they are
* different.
*/
ObjectAddress oprobject;
oprobject.classId = OperatorRelationId;
oprobject.objectSubId = 0;
for (i = 0; i < foreignNKeys; i++)
{
oprobject.objectId = pfEqOp[i];
add_exact_object_address(&oprobject, addrs_normal);
if (ppEqOp[i] != pfEqOp[i])
{
oprobject.objectId = ppEqOp[i];
add_exact_object_address(&oprobject, addrs_normal);
}
if (ffEqOp[i] != pfEqOp[i])
{
oprobject.objectId = ffEqOp[i];
add_exact_object_address(&oprobject, addrs_normal);
}
}
}
record_object_address_dependencies(&conobject, addrs_normal,
DEPENDENCY_NORMAL);
free_object_addresses(addrs_normal);
/*
* We don't bother to register dependencies on the exclusion operators of
* an exclusion constraint. We assume they are members of the opclass
* supporting the index, so there's an indirect dependency via that. (This
* would be pretty dicey for cross-type operators, but exclusion operators
* can never be cross-type.)
*/
if (conExpr != NULL)
{
/*
* Register dependencies from constraint to objects mentioned in CHECK
* expression.
*/
recordDependencyOnSingleRelExpr(&conobject, conExpr, relId,
DEPENDENCY_NORMAL,
DEPENDENCY_NORMAL, false);
}
/* Post creation hook for new constraint */
InvokeObjectPostCreateHookArg(ConstraintRelationId, conOid, 0,
is_internal);
return conOid;
}
/*
* Test whether given name is currently used as a constraint name
* for the given object (relation or domain).
*
* This is used to decide whether to accept a user-specified constraint name.
* It is deliberately not the same test as ChooseConstraintName uses to decide
* whether an auto-generated name is OK: here, we will allow it unless there
* is an identical constraint name in use *on the same object*.
*
* NB: Caller should hold exclusive lock on the given object, else
* this test can be fooled by concurrent additions.
*/
bool
ConstraintNameIsUsed(ConstraintCategory conCat, Oid objId,
const char *conname)
{
bool found;
Relation conDesc;
SysScanDesc conscan;
ScanKeyData skey[3];
conDesc = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum((conCat == CONSTRAINT_RELATION)
? objId : InvalidOid));
ScanKeyInit(&skey[1],
Anum_pg_constraint_contypid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum((conCat == CONSTRAINT_DOMAIN)
? objId : InvalidOid));
ScanKeyInit(&skey[2],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
conscan = systable_beginscan(conDesc, ConstraintRelidTypidNameIndexId,
true, NULL, 3, skey);
/* There can be at most one matching row */
found = (HeapTupleIsValid(systable_getnext(conscan)));
systable_endscan(conscan);
table_close(conDesc, AccessShareLock);
return found;
}
/*
* Does any constraint of the given name exist in the given namespace?
*
* This is used for code that wants to match ChooseConstraintName's rule
* that we should avoid autogenerating duplicate constraint names within a
* namespace.
*/
bool
ConstraintNameExists(const char *conname, Oid namespaceid)
{
bool found;
Relation conDesc;
SysScanDesc conscan;
ScanKeyData skey[2];
conDesc = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
ScanKeyInit(&skey[1],
Anum_pg_constraint_connamespace,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(namespaceid));
conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true,
NULL, 2, skey);
found = (HeapTupleIsValid(systable_getnext(conscan)));
systable_endscan(conscan);
table_close(conDesc, AccessShareLock);
return found;
}
/*
* Select a nonconflicting name for a new constraint.
*
* The objective here is to choose a name that is unique within the
* specified namespace. Postgres does not require this, but the SQL
* spec does, and some apps depend on it. Therefore we avoid choosing
* default names that so conflict.
*
* name1, name2, and label are used the same way as for makeObjectName(),
* except that the label can't be NULL; digits will be appended to the label
* if needed to create a name that is unique within the specified namespace.
*
* 'others' can be a list of string names already chosen within the current
* command (but not yet reflected into the catalogs); we will not choose
* a duplicate of one of these either.
*
* Note: it is theoretically possible to get a collision anyway, if someone
* else chooses the same name concurrently. This is fairly unlikely to be
* a problem in practice, especially if one is holding an exclusive lock on
* the relation identified by name1.
*
* Returns a palloc'd string.
*/
char *
ChooseConstraintName(const char *name1, const char *name2,
const char *label, Oid namespaceid,
List *others)
{
int pass = 0;
char *conname = NULL;
char modlabel[NAMEDATALEN];
Relation conDesc;
SysScanDesc conscan;
ScanKeyData skey[2];
bool found;
ListCell *l;
conDesc = table_open(ConstraintRelationId, AccessShareLock);
/* try the unmodified label first */
strlcpy(modlabel, label, sizeof(modlabel));
for (;;)
{
conname = makeObjectName(name1, name2, modlabel);
found = false;
foreach(l, others)
{
if (strcmp((char *) lfirst(l), conname) == 0)
{
found = true;
break;
}
}
if (!found)
{
ScanKeyInit(&skey[0],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
ScanKeyInit(&skey[1],
Anum_pg_constraint_connamespace,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(namespaceid));
conscan = systable_beginscan(conDesc, ConstraintNameNspIndexId, true,
NULL, 2, skey);
found = (HeapTupleIsValid(systable_getnext(conscan)));
systable_endscan(conscan);
}
if (!found)
break;
/* found a conflict, so try a new name component */
pfree(conname);
snprintf(modlabel, sizeof(modlabel), "%s%d", label, ++pass);
}
table_close(conDesc, AccessShareLock);
return conname;
}
/*
* Delete a single constraint record.
*/
void
RemoveConstraintById(Oid conId)
{
Relation conDesc;
HeapTuple tup;
Form_pg_constraint con;
conDesc = table_open(ConstraintRelationId, RowExclusiveLock);
tup = SearchSysCache1(CONSTROID, ObjectIdGetDatum(conId));
if (!HeapTupleIsValid(tup)) /* should not happen */
elog(ERROR, "cache lookup failed for constraint %u", conId);
con = (Form_pg_constraint) GETSTRUCT(tup);
/*
* Special processing depending on what the constraint is for.
*/
if (OidIsValid(con->conrelid))
{
Relation rel;
/*
* If the constraint is for a relation, open and exclusive-lock the
* relation it's for.
*/
rel = table_open(con->conrelid, AccessExclusiveLock);
/*
* We need to update the relchecks count if it is a check constraint
* being dropped. This update will force backends to rebuild relcache
* entries when we commit.
*/
if (con->contype == CONSTRAINT_CHECK)
{
Relation pgrel;
HeapTuple relTup;
Form_pg_class classForm;
pgrel = table_open(RelationRelationId, RowExclusiveLock);
relTup = SearchSysCacheCopy1(RELOID,
ObjectIdGetDatum(con->conrelid));
if (!HeapTupleIsValid(relTup))
elog(ERROR, "cache lookup failed for relation %u",
con->conrelid);
classForm = (Form_pg_class) GETSTRUCT(relTup);
if (classForm->relchecks == 0) /* should not happen */
elog(ERROR, "relation \"%s\" has relchecks = 0",
RelationGetRelationName(rel));
classForm->relchecks--;
CatalogTupleUpdate(pgrel, &relTup->t_self, relTup);
heap_freetuple(relTup);
table_close(pgrel, RowExclusiveLock);
}
/* Keep lock on constraint's rel until end of xact */
table_close(rel, NoLock);
}
else if (OidIsValid(con->contypid))
{
/*
* XXX for now, do nothing special when dropping a domain constraint
*
* Probably there should be some form of locking on the domain type,
* but we have no such concept at the moment.
*/
}
else
elog(ERROR, "constraint %u is not of a known type", conId);
/* Fry the constraint itself */
CatalogTupleDelete(conDesc, &tup->t_self);
/* Clean up */
ReleaseSysCache(tup);
table_close(conDesc, RowExclusiveLock);
}
/*
* RenameConstraintById
* Rename a constraint.
*
* Note: this isn't intended to be a user-exposed function; it doesn't check
* permissions etc. Currently this is only invoked when renaming an index
* that is associated with a constraint, but it's made a little more general
* than that with the expectation of someday having ALTER TABLE RENAME
* CONSTRAINT.
*/
void
RenameConstraintById(Oid conId, const char *newname)
{
Relation conDesc;
HeapTuple tuple;
Form_pg_constraint con;
conDesc = table_open(ConstraintRelationId, RowExclusiveLock);
tuple = SearchSysCacheCopy1(CONSTROID, ObjectIdGetDatum(conId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for constraint %u", conId);
con = (Form_pg_constraint) GETSTRUCT(tuple);
/*
* For user-friendliness, check whether the name is already in use.
*/
if (OidIsValid(con->conrelid) &&
ConstraintNameIsUsed(CONSTRAINT_RELATION,
con->conrelid,
newname))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("constraint \"%s\" for relation \"%s\" already exists",
newname, get_rel_name(con->conrelid))));
if (OidIsValid(con->contypid) &&
ConstraintNameIsUsed(CONSTRAINT_DOMAIN,
con->contypid,
newname))
ereport(ERROR,
(errcode(ERRCODE_DUPLICATE_OBJECT),
errmsg("constraint \"%s\" for domain %s already exists",
newname, format_type_be(con->contypid))));
/* OK, do the rename --- tuple is a copy, so OK to scribble on it */
namestrcpy(&(con->conname), newname);
CatalogTupleUpdate(conDesc, &tuple->t_self, tuple);
InvokeObjectPostAlterHook(ConstraintRelationId, conId, 0);
heap_freetuple(tuple);
table_close(conDesc, RowExclusiveLock);
}
/*
* AlterConstraintNamespaces
* Find any constraints belonging to the specified object,
* and move them to the specified new namespace.
*
* isType indicates whether the owning object is a type or a relation.
*/
void
AlterConstraintNamespaces(Oid ownerId, Oid oldNspId,
Oid newNspId, bool isType, ObjectAddresses *objsMoved)
{
Relation conRel;
ScanKeyData key[2];
SysScanDesc scan;
HeapTuple tup;
conRel = table_open(ConstraintRelationId, RowExclusiveLock);
ScanKeyInit(&key[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(isType ? InvalidOid : ownerId));
ScanKeyInit(&key[1],
Anum_pg_constraint_contypid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(isType ? ownerId : InvalidOid));
scan = systable_beginscan(conRel, ConstraintRelidTypidNameIndexId, true,
NULL, 2, key);
while (HeapTupleIsValid((tup = systable_getnext(scan))))
{
Form_pg_constraint conform = (Form_pg_constraint) GETSTRUCT(tup);
ObjectAddress thisobj;
ObjectAddressSet(thisobj, ConstraintRelationId, conform->oid);
if (object_address_present(&thisobj, objsMoved))
continue;
/* Don't update if the object is already part of the namespace */
if (conform->connamespace == oldNspId && oldNspId != newNspId)
{
tup = heap_copytuple(tup);
conform = (Form_pg_constraint) GETSTRUCT(tup);
conform->connamespace = newNspId;
CatalogTupleUpdate(conRel, &tup->t_self, tup);
/*
* Note: currently, the constraint will not have its own
* dependency on the namespace, so we don't need to do
* changeDependencyFor().
*/
}
InvokeObjectPostAlterHook(ConstraintRelationId, thisobj.objectId, 0);
add_exact_object_address(&thisobj, objsMoved);
}
systable_endscan(scan);
table_close(conRel, RowExclusiveLock);
}
/*
* ConstraintSetParentConstraint
* Set a partition's constraint as child of its parent constraint,
* or remove the linkage if parentConstrId is InvalidOid.
*
* This updates the constraint's pg_constraint row to show it as inherited, and
* adds PARTITION dependencies to prevent the constraint from being deleted
* on its own. Alternatively, reverse that.
*/
void
ConstraintSetParentConstraint(Oid childConstrId,
Oid parentConstrId,
Oid childTableId)
{
Relation constrRel;
Form_pg_constraint constrForm;
HeapTuple tuple,
newtup;
ObjectAddress depender;
ObjectAddress referenced;
constrRel = table_open(ConstraintRelationId, RowExclusiveLock);
tuple = SearchSysCache1(CONSTROID, ObjectIdGetDatum(childConstrId));
if (!HeapTupleIsValid(tuple))
elog(ERROR, "cache lookup failed for constraint %u", childConstrId);
newtup = heap_copytuple(tuple);
constrForm = (Form_pg_constraint) GETSTRUCT(newtup);
if (OidIsValid(parentConstrId))
{
/* don't allow setting parent for a constraint that already has one */
Assert(constrForm->coninhcount == 0);
if (constrForm->conparentid != InvalidOid)
elog(ERROR, "constraint %u already has a parent constraint",
childConstrId);
constrForm->conislocal = false;
constrForm->coninhcount++;
constrForm->conparentid = parentConstrId;
CatalogTupleUpdate(constrRel, &tuple->t_self, newtup);
ObjectAddressSet(depender, ConstraintRelationId, childConstrId);
ObjectAddressSet(referenced, ConstraintRelationId, parentConstrId);
recordDependencyOn(&depender, &referenced, DEPENDENCY_PARTITION_PRI);
ObjectAddressSet(referenced, RelationRelationId, childTableId);
recordDependencyOn(&depender, &referenced, DEPENDENCY_PARTITION_SEC);
}
else
{
constrForm->coninhcount--;
constrForm->conislocal = true;
constrForm->conparentid = InvalidOid;
/* Make sure there's no further inheritance. */
Assert(constrForm->coninhcount == 0);
CatalogTupleUpdate(constrRel, &tuple->t_self, newtup);
deleteDependencyRecordsForClass(ConstraintRelationId, childConstrId,
ConstraintRelationId,
DEPENDENCY_PARTITION_PRI);
deleteDependencyRecordsForClass(ConstraintRelationId, childConstrId,
RelationRelationId,
DEPENDENCY_PARTITION_SEC);
}
ReleaseSysCache(tuple);
table_close(constrRel, RowExclusiveLock);
}
/*
* get_relation_constraint_oid
* Find a constraint on the specified relation with the specified name.
* Returns constraint's OID.
*/
Oid
get_relation_constraint_oid(Oid relid, const char *conname, bool missing_ok)
{
Relation pg_constraint;
HeapTuple tuple;
SysScanDesc scan;
ScanKeyData skey[3];
Oid conOid = InvalidOid;
pg_constraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(relid));
ScanKeyInit(&skey[1],
Anum_pg_constraint_contypid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(InvalidOid));
ScanKeyInit(&skey[2],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
scan = systable_beginscan(pg_constraint, ConstraintRelidTypidNameIndexId, true,
NULL, 3, skey);
/* There can be at most one matching row */
if (HeapTupleIsValid(tuple = systable_getnext(scan)))
conOid = ((Form_pg_constraint) GETSTRUCT(tuple))->oid;
systable_endscan(scan);
/* If no such constraint exists, complain */
if (!OidIsValid(conOid) && !missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("constraint \"%s\" for table \"%s\" does not exist",
conname, get_rel_name(relid))));
table_close(pg_constraint, AccessShareLock);
return conOid;
}
/*
* get_relation_constraint_attnos
* Find a constraint on the specified relation with the specified name
* and return the constrained columns.
*
* Returns a Bitmapset of the column attnos of the constrained columns, with
* attnos being offset by FirstLowInvalidHeapAttributeNumber so that system
* columns can be represented.
*
* *constraintOid is set to the OID of the constraint, or InvalidOid on
* failure.
*/
Bitmapset *
get_relation_constraint_attnos(Oid relid, const char *conname,
bool missing_ok, Oid *constraintOid)
{
Bitmapset *conattnos = NULL;
Relation pg_constraint;
HeapTuple tuple;
SysScanDesc scan;
ScanKeyData skey[3];
/* Set *constraintOid, to avoid complaints about uninitialized vars */
*constraintOid = InvalidOid;
pg_constraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(relid));
ScanKeyInit(&skey[1],
Anum_pg_constraint_contypid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(InvalidOid));
ScanKeyInit(&skey[2],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
scan = systable_beginscan(pg_constraint, ConstraintRelidTypidNameIndexId, true,
NULL, 3, skey);
/* There can be at most one matching row */
if (HeapTupleIsValid(tuple = systable_getnext(scan)))
{
Datum adatum;
bool isNull;
*constraintOid = ((Form_pg_constraint) GETSTRUCT(tuple))->oid;
/* Extract the conkey array, ie, attnums of constrained columns */
adatum = heap_getattr(tuple, Anum_pg_constraint_conkey,
RelationGetDescr(pg_constraint), &isNull);
if (!isNull)
{
ArrayType *arr;
int numcols;
int16 *attnums;
int i;
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
numcols = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
numcols < 0 ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != INT2OID)
elog(ERROR, "conkey is not a 1-D smallint array");
attnums = (int16 *) ARR_DATA_PTR(arr);
/* Construct the result value */
for (i = 0; i < numcols; i++)
{
conattnos = bms_add_member(conattnos,
attnums[i] - FirstLowInvalidHeapAttributeNumber);
}
}
}
systable_endscan(scan);
/* If no such constraint exists, complain */
if (!OidIsValid(*constraintOid) && !missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("constraint \"%s\" for table \"%s\" does not exist",
conname, get_rel_name(relid))));
table_close(pg_constraint, AccessShareLock);
return conattnos;
}
/*
* Return the OID of the constraint enforced by the given index in the
* given relation; or InvalidOid if no such index is catalogued.
*
* Much like get_constraint_index, this function is concerned only with the
* one constraint that "owns" the given index. Therefore, constraints of
* types other than unique, primary-key, and exclusion are ignored.
*/
Oid
get_relation_idx_constraint_oid(Oid relationId, Oid indexId)
{
Relation pg_constraint;
SysScanDesc scan;
ScanKeyData key;
HeapTuple tuple;
Oid constraintId = InvalidOid;
pg_constraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&key,
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber,
F_OIDEQ,
ObjectIdGetDatum(relationId));
scan = systable_beginscan(pg_constraint, ConstraintRelidTypidNameIndexId,
true, NULL, 1, &key);
while ((tuple = systable_getnext(scan)) != NULL)
{
Form_pg_constraint constrForm;
constrForm = (Form_pg_constraint) GETSTRUCT(tuple);
/* See above */
if (constrForm->contype != CONSTRAINT_PRIMARY &&
constrForm->contype != CONSTRAINT_UNIQUE &&
constrForm->contype != CONSTRAINT_EXCLUSION)
continue;
if (constrForm->conindid == indexId)
{
constraintId = constrForm->oid;
break;
}
}
systable_endscan(scan);
table_close(pg_constraint, AccessShareLock);
return constraintId;
}
/*
* get_domain_constraint_oid
* Find a constraint on the specified domain with the specified name.
* Returns constraint's OID.
*/
Oid
get_domain_constraint_oid(Oid typid, const char *conname, bool missing_ok)
{
Relation pg_constraint;
HeapTuple tuple;
SysScanDesc scan;
ScanKeyData skey[3];
Oid conOid = InvalidOid;
pg_constraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(InvalidOid));
ScanKeyInit(&skey[1],
Anum_pg_constraint_contypid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(typid));
ScanKeyInit(&skey[2],
Anum_pg_constraint_conname,
BTEqualStrategyNumber, F_NAMEEQ,
CStringGetDatum(conname));
scan = systable_beginscan(pg_constraint, ConstraintRelidTypidNameIndexId, true,
NULL, 3, skey);
/* There can be at most one matching row */
if (HeapTupleIsValid(tuple = systable_getnext(scan)))
conOid = ((Form_pg_constraint) GETSTRUCT(tuple))->oid;
systable_endscan(scan);
/* If no such constraint exists, complain */
if (!OidIsValid(conOid) && !missing_ok)
ereport(ERROR,
(errcode(ERRCODE_UNDEFINED_OBJECT),
errmsg("constraint \"%s\" for domain %s does not exist",
conname, format_type_be(typid))));
table_close(pg_constraint, AccessShareLock);
return conOid;
}
/*
* get_primary_key_attnos
* Identify the columns in a relation's primary key, if any.
*
* Returns a Bitmapset of the column attnos of the primary key's columns,
* with attnos being offset by FirstLowInvalidHeapAttributeNumber so that
* system columns can be represented.
*
* If there is no primary key, return NULL. We also return NULL if the pkey
* constraint is deferrable and deferrableOk is false.
*
* *constraintOid is set to the OID of the pkey constraint, or InvalidOid
* on failure.
*/
Bitmapset *
get_primary_key_attnos(Oid relid, bool deferrableOk, Oid *constraintOid)
{
Bitmapset *pkattnos = NULL;
Relation pg_constraint;
HeapTuple tuple;
SysScanDesc scan;
ScanKeyData skey[1];
/* Set *constraintOid, to avoid complaints about uninitialized vars */
*constraintOid = InvalidOid;
/* Scan pg_constraint for constraints of the target rel */
pg_constraint = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_constraint_conrelid,
BTEqualStrategyNumber, F_OIDEQ,
ObjectIdGetDatum(relid));
scan = systable_beginscan(pg_constraint, ConstraintRelidTypidNameIndexId, true,
NULL, 1, skey);
while (HeapTupleIsValid(tuple = systable_getnext(scan)))
{
Form_pg_constraint con = (Form_pg_constraint) GETSTRUCT(tuple);
Datum adatum;
bool isNull;
ArrayType *arr;
int16 *attnums;
int numkeys;
int i;
/* Skip constraints that are not PRIMARY KEYs */
if (con->contype != CONSTRAINT_PRIMARY)
continue;
/*
* If the primary key is deferrable, but we've been instructed to
* ignore deferrable constraints, then we might as well give up
* searching, since there can only be a single primary key on a table.
*/
if (con->condeferrable && !deferrableOk)
break;
/* Extract the conkey array, ie, attnums of PK's columns */
adatum = heap_getattr(tuple, Anum_pg_constraint_conkey,
RelationGetDescr(pg_constraint), &isNull);
if (isNull)
elog(ERROR, "null conkey for constraint %u",
((Form_pg_constraint) GETSTRUCT(tuple))->oid);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
numkeys = ARR_DIMS(arr)[0];
if (ARR_NDIM(arr) != 1 ||
numkeys < 0 ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != INT2OID)
elog(ERROR, "conkey is not a 1-D smallint array");
attnums = (int16 *) ARR_DATA_PTR(arr);
/* Construct the result value */
for (i = 0; i < numkeys; i++)
{
pkattnos = bms_add_member(pkattnos,
attnums[i] - FirstLowInvalidHeapAttributeNumber);
}
*constraintOid = ((Form_pg_constraint) GETSTRUCT(tuple))->oid;
/* No need to search further */
break;
}
systable_endscan(scan);
table_close(pg_constraint, AccessShareLock);
return pkattnos;
}
/*
* Extract data from the pg_constraint tuple of a foreign-key constraint.
*
* All arguments save the first are output arguments; the last three of them
* can be passed as NULL if caller doesn't need them.
*/
void
DeconstructFkConstraintRow(HeapTuple tuple, int *numfks,
AttrNumber *conkey, AttrNumber *confkey,
Oid *pf_eq_oprs, Oid *pp_eq_oprs, Oid *ff_eq_oprs)
{
Oid constrId;
Datum adatum;
bool isNull;
ArrayType *arr;
int numkeys;
constrId = ((Form_pg_constraint) GETSTRUCT(tuple))->oid;
/*
* We expect the arrays to be 1-D arrays of the right types; verify that.
* We don't need to use deconstruct_array() since the array data is just
* going to look like a C array of values.
*/
adatum = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_conkey, &isNull);
if (isNull)
elog(ERROR, "null conkey for constraint %u", constrId);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != INT2OID)
elog(ERROR, "conkey is not a 1-D smallint array");
numkeys = ARR_DIMS(arr)[0];
if (numkeys <= 0 || numkeys > INDEX_MAX_KEYS)
elog(ERROR, "foreign key constraint cannot have %d columns", numkeys);
memcpy(conkey, ARR_DATA_PTR(arr), numkeys * sizeof(int16));
if ((Pointer) arr != DatumGetPointer(adatum))
pfree(arr); /* free de-toasted copy, if any */
adatum = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_confkey, &isNull);
if (isNull)
elog(ERROR, "null confkey for constraint %u", constrId);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_DIMS(arr)[0] != numkeys ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != INT2OID)
elog(ERROR, "confkey is not a 1-D smallint array");
memcpy(confkey, ARR_DATA_PTR(arr), numkeys * sizeof(int16));
if ((Pointer) arr != DatumGetPointer(adatum))
pfree(arr); /* free de-toasted copy, if any */
if (pf_eq_oprs)
{
adatum = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_conpfeqop, &isNull);
if (isNull)
elog(ERROR, "null conpfeqop for constraint %u", constrId);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
/* see TryReuseForeignKey if you change the test below */
if (ARR_NDIM(arr) != 1 ||
ARR_DIMS(arr)[0] != numkeys ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != OIDOID)
elog(ERROR, "conpfeqop is not a 1-D Oid array");
memcpy(pf_eq_oprs, ARR_DATA_PTR(arr), numkeys * sizeof(Oid));
if ((Pointer) arr != DatumGetPointer(adatum))
pfree(arr); /* free de-toasted copy, if any */
}
if (pp_eq_oprs)
{
adatum = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_conppeqop, &isNull);
if (isNull)
elog(ERROR, "null conppeqop for constraint %u", constrId);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_DIMS(arr)[0] != numkeys ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != OIDOID)
elog(ERROR, "conppeqop is not a 1-D Oid array");
memcpy(pp_eq_oprs, ARR_DATA_PTR(arr), numkeys * sizeof(Oid));
if ((Pointer) arr != DatumGetPointer(adatum))
pfree(arr); /* free de-toasted copy, if any */
}
if (ff_eq_oprs)
{
adatum = SysCacheGetAttr(CONSTROID, tuple,
Anum_pg_constraint_conffeqop, &isNull);
if (isNull)
elog(ERROR, "null conffeqop for constraint %u", constrId);
arr = DatumGetArrayTypeP(adatum); /* ensure not toasted */
if (ARR_NDIM(arr) != 1 ||
ARR_DIMS(arr)[0] != numkeys ||
ARR_HASNULL(arr) ||
ARR_ELEMTYPE(arr) != OIDOID)
elog(ERROR, "conffeqop is not a 1-D Oid array");
memcpy(ff_eq_oprs, ARR_DATA_PTR(arr), numkeys * sizeof(Oid));
if ((Pointer) arr != DatumGetPointer(adatum))
pfree(arr); /* free de-toasted copy, if any */
}
*numfks = numkeys;
}
/*
* Determine whether a relation can be proven functionally dependent on
* a set of grouping columns. If so, return true and add the pg_constraint
* OIDs of the constraints needed for the proof to the *constraintDeps list.
*
* grouping_columns is a list of grouping expressions, in which columns of
* the rel of interest are Vars with the indicated varno/varlevelsup.
*
* Currently we only check to see if the rel has a primary key that is a
* subset of the grouping_columns. We could also use plain unique constraints
* if all their columns are known not null, but there's a problem: we need
* to be able to represent the not-null-ness as part of the constraints added
* to *constraintDeps. FIXME whenever not-null constraints get represented
* in pg_constraint.
*/
bool
check_functional_grouping(Oid relid,
Index varno, Index varlevelsup,
List *grouping_columns,
List **constraintDeps)
{
Bitmapset *pkattnos;
Bitmapset *groupbyattnos;
Oid constraintOid;
ListCell *gl;
/* If the rel has no PK, then we can't prove functional dependency */
pkattnos = get_primary_key_attnos(relid, false, &constraintOid);
if (pkattnos == NULL)
return false;
/* Identify all the rel's columns that appear in grouping_columns */
groupbyattnos = NULL;
foreach(gl, grouping_columns)
{
Var *gvar = (Var *) lfirst(gl);
if (IsA(gvar, Var) &&
gvar->varno == varno &&
gvar->varlevelsup == varlevelsup)
groupbyattnos = bms_add_member(groupbyattnos,
gvar->varattno - FirstLowInvalidHeapAttributeNumber);
}
if (bms_is_subset(pkattnos, groupbyattnos))
{
/* The PK is a subset of grouping_columns, so we win */
*constraintDeps = lappend_oid(*constraintDeps, constraintOid);
return true;
}
return false;
}
```
|
```xml
/* !
*/
import * as React from "react";
import { Tag, Text } from "@blueprintjs/core";
interface IMultiSelectCustomTargetProps {
count: number;
}
export const MultiSelectCustomTarget: React.FC<IMultiSelectCustomTargetProps> = ({ count }) => {
return (
<Tag
large={true}
round={true}
minimal={true}
interactive={true}
intent={"primary"}
className="docs-custom-target"
>
<div className="docs-custom-target-content">
<Text className={"docs-custom-target-text"}>Custom Target</Text>
<Tag intent={"primary"} round={true}>
{count}
</Tag>
</div>
</Tag>
);
};
```
|
```javascript
'use strict';
const common = require('../common');
const assert = require('assert');
const cp = require('child_process');
const fixtures = require('../common/fixtures');
const fixture = fixtures.path('empty.js');
const child = cp.fork(fixture);
child.on('close', common.mustCall((code, signal) => {
assert.strictEqual(code, 0);
assert.strictEqual(signal, null);
const testError = common.expectsError({
name: 'Error',
message: 'Channel closed',
code: 'ERR_IPC_CHANNEL_CLOSED'
}, 2);
child.on('error', testError);
{
const result = child.send('ping');
assert.strictEqual(result, false);
}
{
const result = child.send('pong', testError);
assert.strictEqual(result, false);
}
}));
```
|
Exoplanet is the debut studio album by American progressive metal band The Contortionist, released through Good Fight Entertainment on August 31, 2010. A remastered edition of the album was released on January 22, 2016.
A live music video for the song "Primal Directive" was released on July 1, 2022. The video was filmed during the band's Reimagined Tour from 2018. The video was released to coincide with the band's 2022 tour where Exoplanet and Language were performed in their entirety.
Concept
Guitarist Robby Baca explained:
The lyrics on the album focus on space, interstellar travel, and the journey to reach and colonize another habitable planet, hence the title of the album. Four tracks on the album are re-worked and renamed versions of material from their 2009 EP Apparition; the song "Eyes: Closed" was re-worked as "Flourish", "Infection" was re-worked as "Expire", "Realms" was re-worked as "Advent", and "Oscillator" was re-worked while keeping the original title. The lyrics of the re-worked songs were also re-written entirely in order to fit the overall concept of the album. The remaining 7 tracks, including the three title tracks, are all new material.
Track listing
Personnel
The Contortionist
Jonathan Carpenter – vocals, keyboards, lyrics
Robby Baca – guitar, keyboards, programming
Cameron Maynard – guitar, keyboards
Joey Baca – drums
Christopher Tilley – bass
Production
Produced, engineered & mixed by Ken Susi (Unearth)
Mastered by Alan Douches, @ West West Side Music, New York
Additional production & keyboards by Jordan King
Additional keyboards by Alex Ruger
Management by Ben Lionetti & Jason Rudolph
Design & layout by Sons of Nero
References
2010 debut albums
The Contortionist albums
Albums with cover art by Sons of Nero
|
Brigadier General Sir Herbert Ernest Hart, (13 October 1882 – 5 March 1968) was an officer in the New Zealand Military Forces who served during the Second Boer War and the First World War. He later served as the Administrator of Western Samoa and worked for the Imperial War Graves Commission.
Hart volunteered for the Ninth New Zealand South African Contingent, which was raised for service in South Africa during the Second Boer War. By the time the contingent arrived in South Africa, the war was largely over. He saw extensive action during the First World War as a volunteer with the New Zealand Expeditionary Force, first at Gallipoli and then on the Western Front. By the end of the war, he had advanced in rank to brigadier general, commanding a number of brigades in the New Zealand Division.
Trained as a lawyer before the war, Hart returned to New Zealand to resume his legal practice after his discharge from the New Zealand Expeditionary Force. He later served as Administrator of Western Samoa from 1931 to 1935 and was knighted for his services in this role. From 1936 to 1943, he worked in the Middle East for the Imperial War Graves Commission, a task made difficult by the outbreak of the Second World War and the subsequent fighting in the region. Following his retirement in late 1943, he became involved in Rotary International. He died at his home in Masterton on 5 March 1968.
Early life
Hart was born at Taratahi, a small community near Carterton in the Wairarapa region. His father, William, was a farm labourer and the grandson of John Hart, a three-time Premier of South Australia. One of four children, he was educated firstly at Dalefield School, and then Carterton School. After finishing his formal education he worked for his uncle, an auctioneer and land broker, while also studying bookkeeping.
In 1900, Hart's brother Walter travelled to South Africa for service with the Fourth Contingent in the Second Boer War. This inspired Hart to volunteer for the Eighth New Zealand South African Contingent, but his application was declined. However, he, along with another brother, George, successfully enlisted for the Ninth Contingent. The minimum age for volunteers was 20 and he falsified his age to enlist. By the time he reached South Africa in April 1902, the war was effectively over. He was discharged in July 1902 with the rank of lance sergeant but travelled to England instead of returning to New Zealand with the rest of the contingent.
Hart eventually returned to New Zealand in early 1903. Shortly after his return he married Minnie Renall, the daughter of a farmer. The couple would have four children, one of whom died in infancy. He resumed working at his uncle's business and eventually became a director of the company. However, rather than pursue bookkeeping as a career, he commenced legal studies. He qualified as a solicitor in 1907, becoming a partner in a Carterton practice which he had joined the previous year.
Hart was also active in the Volunteer Force. It was common practice in the Volunteer Force for the men of a unit to elect their officers although they were sometimes directed by their superiors to vote for certain candidates. Hart was duly elected a lieutenant in the Carterton Rifle Volunteers. When the Volunteer Force was abolished in 1910 and replaced with the Territorial Force, which was organised more like a conventional military, he chose to continue his service. He was well regarded by his superiors and was promoted to captain in 1911. When he was promoted to major the following year, he was the youngest officer with that rank in his battalion. He was serving with the 1st Battalion of the 17th (Ruahine) Regiment when the First World War broke out.
First World War
Following the outbreak of the First World War, Hart immediately volunteered for the New Zealand Expeditionary Force (NZEF), which was being raised for service in the war on Britain's behalf. He was appointed second in command of the Wellington Infantry Battalion, under Lieutenant Colonel William Malone. The battalion embarked from Wellington in October 1914 for Egypt, and upon arrival, was primarily engaged in training before it was deployed along the Suez Canal late in January 1915 to support Indian troops stationed to guard against a rumoured Turkish attack. Three weeks of sentry duty ensued for the battalion before returning to Cairo.
Gallipoli
At this stage of the war, the Allied forces were preparing for the Gallipoli Campaign, which was part of a plan conceived by the First Lord of the Admiralty, Winston Churchill, to seize control of the Dardanelles. This would leave the Turkish capital, Constantinople, vulnerable to attack. The New Zealand and Australian Division, under the command of Major General Alexander Godley (also commander of the NZEF), was being formed for the campaign, and Hart's battalion was attached to the New Zealand Infantry Brigade, one of the two infantry brigades (the other was the Australian 4th Brigade) that formed the bulk of the division. In April, the division embarked for Gallipoli and the Wellington Battalion was landed at Anzac Cove on the afternoon of 25 April, and made its way up to Plugge's Plateau.
The battalion was involved in defending against Turkish attacks on Walker's Ridge on 27 April. Hart was wounded in the thigh while supervising the establishment of defensive positions. His wounds necessitated his evacuation to Alexandria the following day. He was later awarded a Distinguished Service Order for his leadership of the battalion during this action.
Hart was promoted to lieutenant colonel while recovering from his wounds in England. He returned to the Dardanelles in September 1915 as commander of the Wellington Battalion, Malone having been killed in action in early August during the Battle of Chunuk Bair. The battalion had been decimated during the battle but remained in the line manning positions at 'The Apex', a knoll near Chunuk Bair. Along with the rest of the New Zealand Infantry Brigade, the battalion was transferred to the Greek island of Lemnos on 14 September for a period of rest and recuperation while it was also being built up with reinforcements from New Zealand. While on Lemnos, Hart commanded the brigade for a 12-day period when its nominal commander, Brigadier General Francis Earl Johnston, was hospitalised.
Hart led the battalion back to Gallipoli in early November, where it returned to its former positions at "The Apex". With no major offensive operations conducted since its return, he and his battalion eventually evacuated the peninsula in December, with Hart amongst the last of his unit to leave on 19 December.
Western Front
Returning to Egypt, Hart was heavily involved with the training of his command, which included a substantial number of replacements. He was also required to divest a number of his more experienced officers and non-commissioned officers to help with the formation of the 2nd Battalion of the Wellington Regiment. His battalion was subsequently re-designated as the 1st Battalion, Wellington Regiment, while the New Zealand Infantry Brigade was reformed as the 1st Infantry Brigade. The brigade was one of the three infantry brigades to make up the newly formed New Zealand Division, intended for service on the Western Front and it was duly shipped to France in April 1916.
The division was initially based near Armentières and Hart's battalion was among those manning the trenches in the sector. The battalion had to contend with artillery and repelling localised attacks and raids by the opposing Germans. Hart organised a counter-raid to be conducted by his battalion, and this was successfully executed on 1 July. The division would remain in the Armentières sector until August 1916, at which stage it was withdrawn for use in the forthcoming Somme Offensive in September. Hart led his battalion during the Battle of Flers-Courcelette and the subsequent period in the trenches, and was mentioned in despatches for his work during this time. He also had spells as temporary commander of the brigade while Johnston was on leave, and from December 1916 to January 1917 was in command of 3rd New Zealand (Rifle) Brigade.
In March 1917, Hart was promoted to brigadier general and appointed commander of the newly formed 4th Infantry Brigade. The new brigade was intended for service with the New Zealand Division. After a brief training period in England, the brigade was transferred to France for further training and a period in the front line. In October, it saw service during the successful attack on the Abraham Heights on the Gravenstafel Spur in what was known as the Battle of Broodseinde and was commended for its services by both Godley, still commanding the NZEF, and the commander of the New Zealand Division, Major General Andrew Russell. The brigade was in reserve for the subsequent First Battle of Passchendaele, and, apart from a brief period in training, would remain in the Ypres sector until January. He was mentioned in despatches for his work with the 4th Infantry Brigade while it was on the front line.
Hart was made commander of the 2nd Infantry Brigade when the 4th Brigade was disbanded in February 1918. He was mentioned in despatches for his work with the 4th Infantry Brigade while it was on the front line. His new brigade absorbed many of the soldiers of his previous command. However, on 18 February, just two weeks after taking command, he was badly gassed during an artillery barrage on his headquarters. The barrage, using a mixture of high explosive and mustard gas shells, also incapacitated most of his staff. Temporarily blinded, he was evacuated to a hospital in the rear and then to Étaples. After recovering his sight, which took about a week, he was dispatched to the south of France to convalesce.
Upon recovery from the effects of his gassing, and aided by the temporary presence of his wife Minnie, Hart returned to England and was placed in command of the New Zealand reserves at Sling Camp in Bulford. Here he was responsible for the training of reinforcements and casualties who were regaining fitness. On 3 June, his leadership of the 4th Brigade was honoured with an appointment as a Companion of the Order of St Michael and St George, although he took little personal satisfaction in the recognition.
Hart's duties at Sling Camp ended in July, when he was recalled to France to take over command of the 3rd New Zealand (Rifle) Brigade. He led the brigade through the Hundred Days Offensive, which included an action during the Second Battle of Bapaume that impressed his commanding officer, Russell. During the battle, Hart's headquarters was again shelled with mustard gas. After his previous experience of being gassed, Hart found the shelling 'annoying'. The brigade also participated in the capture of Le Quesnoy in November 1918. This was a difficult assignment for the presence of civilians in the walled town meant that artillery could not support the attack. Instead a small party was able to scale the walls and put flight to the Germans defending that section. This allowed the remainder of the attacking force to enter the town, which quickly surrendered. A few days later, the mayor of Le Quesnoy presented Hart with the French flag that was raised over the town on the day it was captured from the Germans.
After the armistice that ended the war, Hart led the brigade into Germany for occupation duties with the remainder of the New Zealand Division. His headquarters was near Cologne and in January 1919, played host to the Prince of Wales. The division itself was in the process of demobilising, with around 1,000 men returning to New Zealand via England every week, and the Rifle Brigade was disbanded in early February. Hart was twice mentioned in despatches during his period in command of the Rifle Brigade. In mid-February he received his orders to return to New Zealand and he duly left England on 12 March 1919.
Hart arrived in his home town of Carterton to a hero's welcome on 25 April 1919, five years to the day after being landed at Gallipoli. The guest of honour at several receptions held around the Wairarapa over the next several days, he made a point of acknowledging the role played by the ordinary soldier in the eventual victory over the Germans while downplaying his own contributions. He was eventually discharged from the NZEF in late May 1919. His services in the war were subsequently recognised with his appointment as a Companion of the Order of the Bath in the 1919 King's Birthday Honours. The French government also awarded him with the Croix de guerre.
Post-war career
Upon discharge from the NZEF, Hart resumed legal work in his Carterton practice. However, within a few months, he moved his family to Masterton and established a new law firm. He became involved with the charity organisation Rotary International and set up the Masterton chapter of Rotary in 1925. He maintained an association with the military; after an initial spell in the reserve of officers, he resumed his involvement with the Territorial Force and served as commander of the 2nd (Wellington) Infantry Brigade for several years. He was eventually returned to the reserve of officers in 1925. To acknowledge his long military career, he was awarded the Colonial Auxiliary Forces Officers' Decoration (VD) and appointed honorary colonel of his old Territorial Force unit, the Hawkes' Bay Regiment (formerly 17th (Ruahine) Regiment). He retired from the military in 1930.
Hart was a longtime advocate for the welfare of former soldiers and was active in the Returned Services Association (RSA). The organisation later awarded Hart the Gold Badge, its highest honour, for his advocacy on the behalf of former servicemen.
Western Samoa
In 1930, Hart applied for and was appointed to the position of Administrator of Western Samoa, which was controlled by New Zealand under a mandate from the League of Nations. This was a difficult period for the colony as many of its citizens wanted independence. The Mau movement in particular was agitating for self-determination and employed tactics of civil disobedience as a means of opposing the New Zealand administration. After some heavy-handed management of protestors by his predecessor had resulted in several deaths amongst the movement, Hart made progress in improving relationships with the Mau when he took up his position in 1931; although he demanded that Olaf Frederick Nelson a leader of the Mau who had returned from exile in New Zealand, be excluded from meetings he had with the leadership of the Mau. He also returned some financial stability to the colony which had struggled during the Great Depression. Hart was knighted as a Knight Commander of the Order of the British Empire in the 1935 King's Birthday Honours for his services in Samoa, shortly before completing his term as administrator and returning to New Zealand in July 1935.
Imperial War Graves Commission
In 1936, Hart accepted a position in the Middle East with the Imperial War Graves Commission (now the Commonwealth War Graves Commission). This position was usually the preserve of an Australian or New Zealander due to the number of dead from these two countries buried in the area. Although his new position of Deputy Controller of the Eastern District was nominally based in Jerusalem, he and his wife initially moved to Cairo because of the Arab revolt against the British Mandate in Palestine. It was not until March 1937, after the conditions in Palestine had sufficiently improved, that the couple moved to Jerusalem. They were later joined by their daughter, Bettina, who was married to a British Army officer also based in Jerusalem.
Hart's new role involved overseeing the upkeep of the cemeteries and memorials established by the Commission in the Middle East, Turkey and Greece. Ensuring the maintenance of these places required extensive travel, and his duties also became more difficult when Italy joined in the Second World War in June 1940 and conflict broke out in the Middle East. This required the creation of an organisation responsible for the graves of Allied personnel killed in the region. Consequently, Hart became Assistant Director, Graves Registration and Inquiry Section for the Middle East, in addition to his existing Commission duties. His new position entailed him becoming a serving officer in the British Army as a lieutenant, but with the acting rank of brigadier. He set up grave registration units, new cemeteries and organised the relocation of existing graves in remote areas to the new cemeteries. This work struck a personal note when his nephew was killed during the Second Battle of El Alamein in late 1942. Early the following year Hart visited the El Alamein battlefield and the nearby cemetery, the establishment of which was partly due to the infrastructure he helped put in place, to lay flowers at his nephew's grave.
Although he found the work satisfying, Hart retired from the Commission in September 1943. His wife, daughter, and Merrilyn, his granddaughter who had been born in Jerusalem, had left for New Zealand earlier that month. He followed a few weeks later once his successor at the Commission arrived. His work with the Graves Registration section had finished a year earlier.
Later life
Settling back in the Wairarapa, Hart resumed his involvement with Rotary. He served a spell as president of the North Island district of Rotary, and attended overseas conventions. During the 1960s, there was a growing argument that the First World War was an unnecessary conflict. In speeches that he made during his community and RSA duties, he continued to advocate the importance of the war in countering Imperial German aggression. He attended reunions of his former units, including the Wellington Infantry Regiment and the Rifle Brigade. He had assisted the authors of the histories of both formations in the years after the First World War. In 1955, in honour of the 40th anniversary of the formation of the Rifle Brigade, Hart presented the flag which he had been given by the mayor of Le Quesnoy following its capture from the Germans in 1918 to Wellington Cathedral.
With age, Hart's involvement in community affairs decreased but he remained physically active, regularly playing golf and bowls. He died at his home in Masterton on 5 March 1968, his wife having predeceased him by nearly 18 months, and was buried with full military honours. The last surviving senior officer of the NZEF at the time of his death, he was well regarded by both the men he had commanded during the war and his superior officers.
Notes
References
New Zealand generals
New Zealand public servants
1882 births
1968 deaths
New Zealand Army personnel
New Zealand military personnel of the Second Boer War
New Zealand military personnel of World War I
Administrators of the Western Samoa Trust Territory
1930s in Western Samoa Trust Territory
New Zealand Companions of the Distinguished Service Order
New Zealand Knights Commander of the Order of the British Empire
New Zealand Companions of the Order of the Bath
New Zealand Companions of the Order of St Michael and St George
20th-century New Zealand military personnel
People from Carterton, New Zealand
|
```objective-c
// 2016 and later: Unicode, Inc. and others.
/*
*******************************************************************************
*
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
* file name: ucol_swp.h
* encoding: UTF-8
* tab size: 8 (not used)
* indentation:4
*
* created on: 2003sep10
* created by: Markus W. Scherer
*
* Swap collation binaries.
*/
#ifndef __UCOL_SWP_H__
#define __UCOL_SWP_H__
#include "unicode/utypes.h"
#if !UCONFIG_NO_COLLATION
#include "udataswp.h"
/*
* Does the data look like a collation binary?
* @internal
*/
U_INTERNAL UBool U_EXPORT2
ucol_looksLikeCollationBinary(const UDataSwapper *ds,
const void *inData, int32_t length);
/**
* Swap ICU collation data like ucadata.icu. See udataswp.h.
* @internal
*/
U_CAPI int32_t U_EXPORT2
ucol_swap(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
/**
* Swap inverse UCA collation data (invuca.icu). See udataswp.h.
* @internal
*/
U_CAPI int32_t U_EXPORT2
ucol_swapInverseUCA(const UDataSwapper *ds,
const void *inData, int32_t length, void *outData,
UErrorCode *pErrorCode);
#endif /* #if !UCONFIG_NO_COLLATION */
#endif
```
|
The Tool for Influenza Pandemic Risk Assessment (TIPRA), is a tool developed by the World Health Organization’s Global Influenza Program. It was created with the purpose to obtain and improved approach to support the risk assessment of influenza viruses with potential to result in pandemics. TIPRA was modelled after the Influenza Risk Assessment Tool (IRAT), an evaluation tool developed by the U.S. Centers for Disease Control and Prevention.
See also
Global Influenza Surveillance and Response System
References
Influenza
World Health Organization
|
Damiana Ligon Eugenio (September 27, 1921 – October 10, 2014) was a Filipino female author and professor who was known as the Mother of Philippine Folklore, a title she received in 1986. Apart from teaching at the University of the Philippines, she has several publications in the field of Philippine folklore, among them a series of seven books which she compiled and edited.
Biography
Education
Eugenio was a BSE degree holder and a cum laude graduate from the University of the Philippines. She obtained her M.A. degree in English Literature and folklore. She was a professor at the Department of English and Comparative Literature for the College of Arts in Diliman: Vol. III, The Legends, Philippine Folk Literature, University of the Philippines Press.
Authorship
Description
Eugenio's works were described as volumes that are thorough and professional in presentation and as being valuable resources for scholars studying the
Philippines and comparative folklore. Written in the English-language, her Philippine Folk Literature: The Myths (1993) served as a compendium that promotes "national and international access to Filipino folklore," were gathered from written sources rather than collected oral variants, and was intended to foster interest in the subject matter. In this work, Eugenio also presented the collected narratives in a proper scholarly context that also justified the inclusion of the legends of saints, as opposed to being a pure collection of myths. This particular volume was also described as a recommended work for "any individual interested
in issues of Filipino worldviews and value systems, to any scholar investigating myths across cultures, and to anyone who enjoys the insights that a culture's narratives provide."
Awards and recognitions
Eugenio was the recipient of a lifetime achievement award from the Philippine Board on Books for Young People (PPBY Awards) for her significant contributions to the growth of literacy for children in 1991.<ref name=NCCA>"Damiana L. Eugenio" , Alba, Reinero A. Philippine Board on Books for Young People Awards (PPBY Awards), Nurthuring Children's Literature in the Philippines, InFocub Folklor ng Pilipinas) by the U.P. Folklorists, Inc. and the U.P. Folklore Studies Program in 1986</ref> She also garnered the following recognitions: Most Outstanding Novo Ecijano in the Field of Arts for Literature (Nueva Ecija High School Alumni Association, 1983), Professional Achievement Award in the Humanities for folklore studies (U.P. Alumni Association, 1987), Catholic Mass Media Award: Best Book in English (a finalist, 1987), National Book Award for Literary History (Manila Critic Circle, 1987), Achievement Award in the Humanities (Philippine National Science Society/NCRP, 1989), Cultural Center of the Philippines Award for the Arts for cultural research (Gawad CCP para sa Sining, 1992), Golden Jubilarian Achievement Award (U.P. Education Alumni Association, 1992), National Follower of Balagtas Award (Gawad Pambansang Alagad ni Balagtas, from the Unyon ng mga Manunulat sa Pilipinas or the Philippine Writers Union, UMPIL, 1993), Manila Critics Circle Citation (1995), Centennial Award for Cultural Research (Parangal Sentenyal sa Sining at Kultura'' (Cultural Center of the Philippines, 1999), Most Distinguished Alumna of the Nueva Ecija High School (1999), and the Silver Torch Award (U.P. Educational Alumni Association, 2000).
Death
Eugenio died on October 10, 2014. She had a bad fall in December 2013 and became bed ridden since.
Works:
Philippine Proverb Lore (1975)
Awit and Korido: A Study of Fifty Philippine Metrical Romances in Relation to Their Sources and Analogues (1965)
Philippine Folk Literature: An Anthology (1981)
Philippine Folk Literature, (May 31, 2008)
See also
Philippine mythology
Philippine folk literature
Philippine proverbs
E. Arsenio Manuel
References
1921 births
2014 deaths
People from San Miguel, Bulacan
Writers from Bulacan
Filipino women writers
English-language writers from the Philippines
People from Nueva Ecija
|
```xml
import { MutatorClientInterface, SyncServiceInterface } from '@standardnotes/services'
import { ClientDisplayableError } from '@standardnotes/responses'
import { DecryptedItemInterface, FileItem, VaultListingInterface } from '@standardnotes/models'
import { FilesClientInterface } from '@standardnotes/files'
import { ContentType } from '@standardnotes/domain-core'
export class MoveItemsToVault {
constructor(
private mutator: MutatorClientInterface,
private sync: SyncServiceInterface,
private files: FilesClientInterface,
) {}
async execute(dto: {
items: DecryptedItemInterface[]
vault: VaultListingInterface
}): Promise<ClientDisplayableError | void> {
for (const item of dto.items) {
await this.mutator.changeItem(item, (mutator) => {
mutator.key_system_identifier = dto.vault.systemIdentifier
mutator.shared_vault_uuid = dto.vault.isSharedVaultListing() ? dto.vault.sharing.sharedVaultUuid : undefined
})
}
await this.sync.sync()
for (const item of dto.items) {
if (item.content_type !== ContentType.TYPES.File) {
continue
}
if (dto.vault.isSharedVaultListing()) {
await this.files.moveFileToSharedVault(item as FileItem, dto.vault)
} else {
const itemPreviouslyBelongedToSharedVault = item.shared_vault_uuid
if (itemPreviouslyBelongedToSharedVault) {
await this.files.moveFileOutOfSharedVault(item as FileItem)
}
}
}
}
}
```
|
Nabil Maâloul (; born 25 December 1962) is a Tunisian professional football manager and former player.
Maâloul was capped 74 times for his country, and participated in 1988 Summer Olympics in Seoul. He spent most of his playing career with his home club, Espérance de Tunis and won it a historic treble as a coach in 2011 (league, cup and CAF Champions League).
During his managerial career, he was in charge of three national teams: Tunisia, Kuwait, and Syria, but he also managed clubs in Tunisia and Qatar.
Club career
Maâloul began playing football at the age of 6 or 7, following the example of his father. He began his professional career at the Espérance de Tunis at the age of 18 and then dropped his studies.
He then wore the colors of Club Bizertin during the return phase of the 1994–1995 season and then of Club Africain between 1995 and 1996, marking the end of his career, due to a disagreement with the president of the club Slim Chiboub, who does not want to sign a contract with him again after a short period in Saudi Arabia.
International career
With the National team he started in 1985, collecting 74 appearances in 10 years and scored 11 goals. He participated in the 1988 Summer Olympics in Seoul. He was one of the youngest captains in the national team's history at 23 years old.
Managerial career
He finished his playing career and became coach of Olympique du Kef in 1997. In 2002, he became assistant coach of Roger Lemerre when Tunisia won 2004 African Cup of Nations. He decided to leave his post as assistant for coaching Club Africain and in September 2006 he returned to the staff of the team. Meanwhile, he made a brief pass as coach of Club Bizertin at the start of the 2005–2006 season with unconvincing results.
The real start was in December 2010, he took command of Espérance de Tunis, following the dismissal of Maher Kanzari, and won with it a historic treble in 2011 (League, Cup and CAF Champions League) before being replaced by Michel Decastel in January 2012; He replaced it a few months later. On 14 February 2013, he officially became the coach of the Tunisia. On 23 March, he coached his first match with Sierra Leone and Tunisia wins by the score of (2–1). On 7 September, after a home defeat (0–2) with Cape Verde that eliminates Tunisia from qualifying for the 2014 World Cup, Maâloul announces his resignation. Cape Verde was later expunged from the qualification after the players' eligibility controversies.
On 29 November 2013, he agreed with Raja CA to become coach of the team in 2013 FIFA Club World Cup, replacing Mohamed Fakhir, before refusing.
On 20 January 2014, he became the coach of the Qatari team El Jaish SC, and won 2014 Qatar Crown Prince Cup on 26 April 2014. He also took the team from 5th to 2nd place in half a season therefore qualifying for the AFC Champions League.
On 20 December 2014, he became the coach of Kuwait, and coached them in 2015 AFC Asian Cup and the 2018 FIFA World Cup qualification – AFC second round|second round of 2018 FIFA World Cup qualification]] before that FIFA suspend Kuwait Football Association on 16 October 2015.
On 27 April 2017, Maâloul became the coach of Tunisia again and succeeded in bringing his team back to the 2018 FIFA World Cup for the first time since 2006 and becoming the second Tunisian coach to qualify for the World Cup after Abdelmajid Chetali in 1978. After the team's elimination from the group stage despite its honorable performance and winning Tunisia's second game ever in a World Cup against Panama, he resigned to coach Al-Duhail SC. He parted ways after six months of coaching due to multiple disagreements with the club.
On 11 March 2020, Maâloul was officially appointed as the new head coach of Syria on a one-year contract, to become the first Tunisian to coach Syria. Despite reaching the third round of the World Cup qualification, Maâloul resigned on 16 June 2021 due to unpaid salaries, after losing 3–1 to China.
On 27 October 2021, Maâloul became the coach of Kuwait SC. He has won the Emir Cup on 21 December 2021 and the Kuwait Premier League in April 2022.
On 9 June 2022, Maaloul returned to Espérance de Tunis nearly 10 years after his departure. He left the club on 13 May 2023.
Career statistics
Managerial
Honours
Player
Espérance de Tunis
Tunisian Ligue Professionnelle 1: 1982, 1985, 1988, 1989, 1993, 1994
Tunisian Cup: 1986, 1989
Tunisian Super Cup: 1993
Arab Club Championship: 1993
Club Africain
Tunisian Ligue Professionnelle 1: 1996
Arab Cup Winners' Cup: 1995
Manager
Espérance de Tunis
Tunisian Ligue Professionnelle 1: 2011, 2012, 2022
Tunisian Cup: 2011
CAF Champions League: 2011
El Jaish
Qatar Cup: 2014
Kuwait SC
Kuwait Premier League: 2022
Kuwait Emir Cup: 2021
References
External links
1962 births
Living people
Tunisian Muslims
Tunisian men's footballers
Tunisian expatriate men's footballers
Footballers from Tunis
Espérance Sportive de Tunis players
Hannover 96 players
CA Bizertin players
Club Africain players
Al-Ahli Saudi FC players
2. Bundesliga players
Tunisian Ligue Professionnelle 1 players
Saudi Pro League players
Tunisia national football team managers
Club Africain football managers
CA Bizertin managers
Espérance Sportive de Tunis managers
El Jaish SC managers
Kuwait national football team managers
Expatriate football managers in Germany
Expatriate football managers in Kuwait
Expatriate football managers in Qatar
Expatriate football managers in Syria
Tunisian expatriate sportspeople in Saudi Arabia
Tunisian expatriate sportspeople in Germany
Tunisian expatriate sportspeople in Kuwait
Tunisian expatriate sportspeople in Qatar
2015 AFC Asian Cup managers
2018 FIFA World Cup managers
Al-Duhail SC managers
Men's association football midfielders
Tunisian football managers
Syria national football team managers
Tunisia men's international footballers
Tunisian expatriate football managers
Kuwait SC managers
Kuwait Premier League managers
Tunisian expatriate sportspeople in Syria
|
Augusta Bay (Norwegian: Augustabukta) is a bay of Nordaustlandet, Svalbard archipelago, Norway.
Its mouth is open to the Hinlopen Strait. It is located in the southwestern part of the island, southern part of its Scaniahalvøya (Scania Peninsula).
External links
Detailed map of Nordaustlandet
Bays of Svalbard
Nordaustlandet
|
Jean Mode (born 1922) is an American former burlesque star and erotic dancer.
Night club dancer
In August 1942 Mode was part of a 10 hitliner, 2:30 a.m. bill, at Leon and Eddie's night club at 33 West 52nd Street. Other entertainers featured were Johnny Morgan, Wacky Wayne, Leo Fuld, and Cesar and Rosita. The cafe owners were Leon Enken and Eddie Davis. Mode was in a cast of performers at the same 52nd Street establishment, in February 1944. A new Ruth Lane revue and former lightweight champion Tony Canzoneri were also there. In June 1945 she was again at Leon and Eddie's. Mode took an ice cold shower prior to each performance to give her skin a pinky glow. She made a return to striptease in April 1952 under the management of Miles Ingalls.
Mode was among the cast of the carnival comedy, Bigger Than Barnum (1946), staged by Fred Rath and Lee Sands. The show opened in Boston and closed in a short time, in the spring of 1946. Patricia Neal was one of the production's performers.
Suicide attempt
Mode attempted suicide in her Beekman Tower Hotel apartment, 3 Mitchell Place, New York City, on December 30, 1952. She swallowed an overdose of sleeping pills. The hotel manager knocked on her door around 3:15 a.m., after the switchboard light indicated that the telephone in her room was off the hook. He called the police when he found Mode on the bathroom floor. An emergency squad policeman worked on her for an hour and twenty minutes before she was revived sufficiently to be taken to Metropolitan Hospital. Her condition was listed as serious. She was 30 years old.
References
1922 births
Possibly living people
American burlesque performers
American erotic dancers
American female erotic dancers
American musical theatre actresses
American stage actresses
|
```html
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Define a Custom Attribute Mapping for a Generator</title>
<link rel="stylesheet" href="../../../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../../../../index.html" title="Spirit 2.5.4">
<link rel="up" href="../auto.html" title="Create Components from Attributes (Qi and Karma)">
<link rel="prev" href="create_parser.html" title="Define a Custom Attribute Mapping for a Parser">
<link rel="next" href="../../../support.html" title="Supporting Libraries">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="path_to_url">People</a></td>
<td align="center"><a href="path_to_url">FAQ</a></td>
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="create_parser.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../auto.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../support.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="section">
<div class="titlepage"><div><div><h5 class="title">
<a name="spirit.advanced.customize.auto.create_generator"></a><a class="link" href="create_generator.html" title="Define a Custom Attribute Mapping for a Generator">Define
a Custom Attribute Mapping for a Generator</a>
</h5></div></div></div>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h0"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.create_generator"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.create_generator">create_generator</a>
</h6>
<p>
The template <code class="computeroutput"><span class="identifier">create_generator</span></code>
is a type used as an customization point. It is invoked by the <span class="emphasis"><em>Karma</em></span>
<a class="link" href="../../../karma/reference/generate_api/create_generator.html" title="API for Automatic Generator Creation"><code class="computeroutput"><span class="identifier">create_generator</span></code></a> API function
in order to create a custom mapping of the given data type to a generator
expression. This generator expression will be returned from <a class="link" href="../../../karma/reference/generate_api/create_generator.html" title="API for Automatic Generator Creation"><code class="computeroutput"><span class="identifier">create_generator</span></code></a> whenever the
given data type is encountered.
</p>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h1"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.module_headers"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.module_headers">Module
Headers</a>
</h6>
<pre class="programlisting"><span class="comment">// forwards to <boost/spirit/home/karma/auto.hpp></span>
<span class="preprocessor">#include</span> <span class="special"><</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">spirit</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">karma_auto</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">></span>
</pre>
<p>
Also, see <a class="link" href="../../../structure/include.html" title="Include">Include Structure</a>.
</p>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h2"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.namespace"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.namespace">Namespace</a>
</h6>
<div class="informaltable"><table class="table">
<colgroup><col></colgroup>
<thead><tr><th>
<p>
Name
</p>
</th></tr></thead>
<tbody><tr><td>
<p>
<code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">spirit</span><span class="special">::</span><span class="identifier">traits</span></code>
</p>
</td></tr></tbody>
</table></div>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h3"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.synopsis"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.synopsis">Synopsis</a>
</h6>
<pre class="programlisting"><span class="keyword">template</span> <span class="special"><</span><span class="keyword">typename</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">Enable</span><span class="special">></span>
<span class="keyword">struct</span> <span class="identifier">create_generator</span>
<span class="special">{</span>
<span class="keyword">typedef</span> <span class="special"><</span><span class="identifier">unspecified</span><span class="special">></span> <span class="identifier">type</span><span class="special">;</span>
<span class="keyword">static</span> <span class="identifier">type</span> <span class="keyword">const</span><span class="special">&</span> <span class="identifier">call</span><span class="special">();</span>
<span class="special">};</span>
</pre>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h4"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.template_parameters"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.template_parameters">Template
parameters</a>
</h6>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Parameter
</p>
</th>
<th>
<p>
Description
</p>
</th>
<th>
<p>
Default
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">T</span></code>
</p>
</td>
<td>
<p>
The type, <code class="computeroutput"><span class="identifier">T</span></code>
for which a custom mapping to a generator should be established.
</p>
</td>
<td>
<p>
none
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">Enable</span></code>
</p>
</td>
<td>
<p>
Helper template parameter usable to selectively enable or disable
certain specializations of <code class="computeroutput"><span class="identifier">create_generator</span></code>
utilizing SFINAE (i.e. <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">enable_if</span></code>
or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">disable_if</span></code>).
</p>
</td>
<td>
<p>
<code class="computeroutput"><span class="keyword">void</span></code>
</p>
</td>
</tr>
</tbody>
</table></div>
<div class="variablelist">
<p class="title"><b>Notation</b></p>
<dl class="variablelist">
<dt><span class="term"><code class="computeroutput"><span class="identifier">T</span></code></span></dt>
<dd><p>
An arbitrary type.
</p></dd>
</dl>
</div>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h5"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.expression_semantics"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.expression_semantics">Expression
Semantics</a>
</h6>
<div class="informaltable"><table class="table">
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
<p>
Expression
</p>
</th>
<th>
<p>
Semantics
</p>
</th>
</tr></thead>
<tbody>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">create_generator</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
<p>
Defines the type of the generator expression returned from
<code class="computeroutput"><span class="identifier">call</span></code>.
</p>
</td>
</tr>
<tr>
<td>
<p>
<code class="computeroutput"><span class="identifier">create_generator</span><span class="special"><</span><span class="identifier">T</span><span class="special">>::</span><span class="identifier">call</span><span class="special">()</span></code>
</p>
</td>
<td>
<p>
Returns a generator expression (usually this is a proto::expression)
to be used as the default generator for the given type, <code class="computeroutput"><span class="identifier">T</span></code>.
</p>
</td>
</tr>
</tbody>
</table></div>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h6"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.predefined_specializations"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.predefined_specializations">Predefined
Specializations</a>
</h6>
<p>
<a href="path_to_url" target="_top">Spirit</a> predefines specializations
of this customization point for several types. All predefined mappings
are listed here: <a class="link" href="../../../karma/reference/auto.html#spirit.karma.reference.auto.additional_requirements">Additional
Attribute Requirements for Generators</a>.
</p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>
It is possible to overload the predefined mappings for the listed types
by providing your own specialization of the <code class="computeroutput"><span class="identifier">create_generator</span></code>
customization point for the type to modify.
</p></td></tr>
</table></div>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h7"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.when_to_implement"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.when_to_implement">When
to implement</a>
</h6>
<p>
The customization point <code class="computeroutput"><span class="identifier">create_generator</span></code>
needs to be implemented for a specific type whenever this type should
be usable with the API function <a class="link" href="../../../karma/reference/generate_api/create_generator.html" title="API for Automatic Generator Creation"><code class="computeroutput"><span class="identifier">create_generator</span></code></a> (which includes
using the <code class="computeroutput"><span class="identifier">karma</span><span class="special">::</span><span class="identifier">auto_</span></code> generator and the special API
functions based on the automatic creation of the matching generator type).
</p>
<h6>
<a name="spirit.advanced.customize.auto.create_generator.h8"></a>
<span class="phrase"><a name="spirit.advanced.customize.auto.create_generator.example"></a></span><a class="link" href="create_generator.html#spirit.advanced.customize.auto.create_generator.example">Example</a>
</h6>
<p>
For an example of how to use the customization point <code class="computeroutput"><span class="identifier">create_generator</span></code>
please see here: <a class="link" href="../../../karma/reference/auto.html#spirit.karma.reference.auto.example">Example
for Using the <code class="computeroutput"><span class="identifier">karma</span><span class="special">::</span><span class="identifier">auto_</span></code> Generator</a>.
</p>
</div>
<table xmlns:rev="path_to_url~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
file LICENSE_1_0.txt or copy at <a href="path_to_url" target="_top">path_to_url
</p>
</div></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="create_parser.html"><img src="../../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../auto.html"><img src="../../../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="../../../support.html"><img src="../../../../../../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
```
|
```ruby
# frozen_string_literal: true
class AddConferenceRegistrationTypes < ActiveRecord::Migration[5.2]
def change
create_table :decidim_conferences_registration_types do |t|
t.references :decidim_conference, index: { name: "idx_registration_types_on_decidim_conference_id" }
t.jsonb :title, null: false
t.jsonb :description, null: false
t.decimal :price, null: false, default: 0, precision: 8, scale: 2
t.integer :weight, null: false, default: 0
t.datetime :published_at, index: true
t.timestamps
end
create_table :decidim_conferences_conference_meeting_registration_types do |t|
t.belongs_to :registration_type, null: false, index: { name: "index_meetings_on_decidim_registration_type_id" }
t.belongs_to :conference_meeting, null: false, index: { name: "index_registrations_on_decidim_conference_meeting_id" }
end
end
end
```
|
Hilary Majewski, (Polish pronunciation: , born 15 January 1838, Radom – died 21 July 1892, Łódź) was a Polish architect, a representative of the 19th-century historicism. Between 1872–1892, he served as the city architect of Łódź, Central Poland, and is regarded as one of the most prominent architects in the city's history.
Life and career
He was born on 15 January 1838 in Radom to father Wincenty and mother Teofilia née Piątkowska. In the years 1859–1861 he studied at the Imperial Academy of Arts in Saint Petersburg and received his diploma in 1864. After completing his studies, he was granted a scholarship which allowed him to travel across Europe to countries like Italy, France, England and Bavaria where he acquired his aesthetic taste in architecture which he later used in his professional career as an architect.
He served as the chief architect in the Radom District and then established his own architecture studio in Warsaw. In 1872, he accepted the position of the City Architect of Łódź and fulfilled this role until his death.
Majewski was a very prolific architect and is considered the most renowned architect of the city of Łódź. He was the author of 546 projects which he signed with his name, though a few of them were created in collaboration with other architects. He designed villas, private residences, palaces, tenement houses and supervised the construction of factories, bridges and roads. He designed many townhouses along the city's longest thoroughfare, the Piotrkowska Street. He also designed his own house along the Kamienna Street 11 (currently Włókiennicza Street).
In 1889, he was awarded the Order of Saint Stanislaus (Class II) and in 1890, he received the Order of Saint Anna (Class II).
Selected projects
Izrael Poznański Textile Factory, currently Andel's Hotel Łódź, which is a part of Manufaktura Arts and Shopping Centre, (1872–1892)
Grand Hotel, Piotrkowska Street 72, the building previously served as Ludwik Meyer's factory, it was re-adapted as a hotel in 1912–1913 according to a project by Majewski and Dawid Lande, (1872–1887)
Franciszek Fischer House, Piotrowska Street 54, (1872–1876)
Matylda and Edward Herbst Villa, Przędzialniana Street 72, (1875–1877)
Adolf Manteufel Hotel, Zachodnia Street 45, currently Medical University of Łódź, (1979)
City Credit Union Building (Towarzystwo Kredytowe Miejskie), Pomorska Street 21, (1878–1881)
Ludwik Grohmann's Villa, Średnia Street 17 (currently Pomorska Street 21), (1880–1882)
Alexander Nevsky Orthodox Church, Widzewska Street 46, (currently Jan Kiliński Street 56), (1880–1884)
Scheiblers' Townhouse, Piotrkowska Street 11, (1882)
Juliusz Heinzl Palace, currently the building houses the Łódź Town Hall, Piotrkowska Street 104, (1882)
Ludwik Geyer Bank, (Dom Towarzystwa Akcyjnego Ludwika Geyera), Piotrkowska Street 74, (1882–1886)
School Building at Nowy Rynek, currently the Archeological Museum of Łódź, Liberty Square 14, (1883–1886)
Trianon and Mignon Villas, Stanisław Moniuszko Street, (1884–1887)
Leonia and Izrael Poznański Hospital, Sterling Street 1/3, (1885–1890)
Maksymilian Goldfeder Palace, co-authored with Bronisław Żochowski, Piotrkowska Street 77, (1889–1892)
Henryk Grohmann's Villa, currently the Museum of Artistic Books in Łódź, (1889)
Rudolf Keller Palace, Długa Street, (currently Gdańska Street 49/53), (1890)
Fire Station, Bishop Tymieniecki Street 30, (1891)
Arnold Stiller Villa, Stefan Jaracz Street 45, (1891–1893)
Jakub Hertz Palace, Tadeusz Kościuszko Avenue 4, (1892–1893)
Izrael Poznański's Palace, known as the "Louvre of Łódź", one of the most recognizable landmarks of the city, co-authored with Adolf Zeligson, it currently houses the Museum of the City of Łódź, Ogrodowa Street 15, (1898)
Gallery
See also
History of Łódź
References
1838 births
1892 deaths
19th-century Polish architects
People from Radom
Architects from Łódź
Imperial Academy of Arts alumni
|
An oblique icebreaker is a special type of icebreaker designed to operate not only ahead and astern, but also obliquely (sideways) with a large angle of attack. In this way, a relatively small icebreaker is capable of opening a wide channel in ice for large merchant ships.
The oblique icebreaker concept was developed in the late 1990s by Kværner Masa-Yards Arctic Technology Centre (MARC), the Finnish engineering company also responsible for the development of the double acting ships. The first vessel of this kind was ordered by the Russian Ministry of Transport on 8 December 2011 and was completed in 2014.
Development
The development of the oblique icebreaker concept began in 1997, when Kværner Masa-Yards Arctic Technology Centre (MARC) established a project to develop new ways of assisting large tankers in ice conditions. Traditionally, escorting large ships up to wide required two conventional icebreakers with a beam of , a practice that was not very efficient and economical. Analysis of Finnish harbour statistics and icebreaker logbooks showed that with a beam of , the icebreaker would be wide enough to provide assistance to most merchant ships in need of towing. The larger ships, fewer in number, could then be assisted with an unconventional method. The result was an asymmetrical, triangle-shaped vessel with three azimuth thrusters in the "corners" pushing the icebreaker with a 50-degree angle of attack—almost sideways—in ice. Model tests in an ice tank showed that the proposed concept was viable and that the resistance of a large cargo ship was considerably reduced in both level ice as well as frozen brash ice when operating behind the oblique icebreaker. The concept has been patented.
Over the years, the concept was further developed by MARC and its successor, Aker Arctic, together with ABB and the Finnish Funding Agency for Technology and Innovation (Tekes). In addition to icebreaking, the oblique vessel could also be utilized for oil spill response operations in both open and ice-infested waters by using the flat side to guide the oil to a recovery unit. However, there have also been doubts about the ability of the relatively small vessel to break a wide channel in ice without the much greater displacement and shaft power of a traditional icebreaker.
Construction
On 8 December 2011, the Russian Ministry of Transport ordered an icebreaking multipurpose emergency and rescue vessel from Arctech Helsinki Shipyard (AHS), then a joint venture between the Finnish STX Finland Cruise Oy and the Russian United Shipbuilding Corporation. The 76 million euro vessel, based on Aker Arctic's Aker ARC 100 oblique icebreaker concept developed for AHS, was designed to be capable of breaking level ice up to thick both ahead and astern, and generate a channel in ice when moving sideways using three Z-drive thrusters with a combined output of 7,500kW. Initially, the hull of the vessel referred to as "NB508" was to be built by Shipyard Yantar JSC in Yantar, Kaliningrad, where production began on 24 April 2012 and keel was laid on 6 July. However, instead of launching the unfinished hull in Kaliningrad and towing it to Helsinki for outfitting, the blocks were transported to Helsinki and the hull was assembled in Finland. The first blocks arrived on a barge on 9 April 2013 and the vessel, which was given the name Baltika, was completed in 2014. In 2015, the oblique icebreaker carried out ice trials in the Gulf of Ob where the sideways icebreaking was successfully demonstrated for the first time.
See also
References
Ship types
Icebreakers
|
The Voise is a river in Eure-et-Loir which flows into the right bank of Eure, which is a tributary of the Seine. It is long.
Gallery
References
Rivers of Eure-et-Loir
Rivers of Centre-Val de Loire
Rivers of France
|
was a Japanese artist. He is famous for his wanderings throughout Japan, during which he often wore a sleeveless undershirt, garnering the nickname "The Naked General."
Early life
Yamashita was born in Asakusa, Tokyo. At the age of three, he had an acute abdominal disorder which, although not life-threatening, left him with a mild speech impediment and some neurological damage.
At elementary school, Yamashita was the victim of bullying and on one occasion wounded a classmate with a knife. Because of this, his parents decided to move him to the Yahata institution for the mentally handicapped in Ichikawa, Chiba. His IQ was measured at 68. It was here he started to experiment using torn pieces of paper to create pictures. His talent was recognised by mental health expert Ryuzaburo Shikiba, who organised an exhibition of Yamashita's work in Osaka which received wide praise.
Tiring of life at the institution, and in order to avoid the mandatory physical examination for recruitment into the Imperial Japanese Army, Yamashita ran away in 1940 to start his wandering around Japan, which would last until 1954.
At the age of 21, staff from the institution found him helping in a restaurant and forced him to take the recruitment exam. Eventually he was considered exempt from service. The events from this time were recorded in his “Wandering Diary” of 1956, and the most popular image of Yamashita travelling alone through the country with his rucksack comes from this period.
Works
Yamashita used the chigiri-e method of sticking torn pieces of coloured paper together to depict the scenery he saw on his travels, and some of his most famous works such as "Nagaoka no hanabi" and "Sakurajima" were made in this way. Possessing eidetic memory, Yamashita usually recreated the entire scene from memory when he returned to the institution or his home. Because of this, Yamashita is often considered an autistic savant.
In the post-war period, he became widely known as the “Japanese Van Gogh” or the “Naked General” (due to his habit of wearing a sleeveless undershirt in his travels). In 1956, the Kiyoshi Yamashita Exhibition opened at the Daimaru store in Tokyo, and toured the country, stopping at 130 places in Japan and attracting over 500,000 visitors. In June 1961, Yamashita and Shikiba embarked on a 40-day tour of Europe. Here he recorded the many famous places and monuments he saw.
Death
Yamashita died from a cerebral hemorrhage aged 49.
Legacy
His work is still highly regarded throughout Japan, and is the subject of frequent exhibitions. His life was portrayed in a long-running Japanese television drama, , which ran from 1980 to 1997.
A retrospective of Yamashita’s works honoring his 100th anniversary is currently being exhibited at the Sompo Museum of Art in Nishishinjuku (June 24-September 10, 2023).
References
External links
Official Website (Japanese)
(This article is an attempted translation of the Japanese Wikipedia article of the same name, and is ongoing.)
1922 births
1971 deaths
Japanese people with disabilities
Outsider artists
Artists from Tokyo
People from Taitō
20th-century Japanese male artists
20th-century Japanese painters
|
```c++
// (See accompanying file LICENSE_1_0.txt or copy at
// path_to_url
// See path_to_url for the library home page.
//
// File : $RCSfile$
//
// Version : $Revision$
//
// Description : this is an abridged version of an excelent BOOST_FOREACH facility
// presented by Eric Niebler. I am so fond of it so I can't wait till it
// going to be accepted into Boost. Also I need version with less number of dependencies
// and more portable. This version doesn't support rvalues and will reeveluate it's
// parameters, but should be good enough for my purposes.
// ***************************************************************************
#ifndef BOOST_TEST_UTILS_FOREACH_HPP
#define BOOST_TEST_UTILS_FOREACH_HPP
// Boost.Test
#include <boost/test/detail/config.hpp>
// Boost
#include <boost/type.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/type_traits/is_const.hpp>
#include <boost/test/detail/suppress_warnings.hpp>
//your_sha256_hash____________//
namespace boost {
namespace unit_test {
namespace for_each {
// ************************************************************************** //
// ************** static_any ************** //
// ************************************************************************** //
struct static_any_base
{
operator bool() const { return false; }
};
//your_sha256_hash____________//
template<typename Iter>
struct static_any : static_any_base
{
static_any( Iter const& t ) : m_it( t ) {}
mutable Iter m_it;
};
//your_sha256_hash____________//
typedef static_any_base const& static_any_t;
//your_sha256_hash____________//
template<typename Iter>
inline Iter&
static_any_cast( static_any_t a, Iter* = 0 )
{
return static_cast<Iter&>( static_cast<static_any<Iter> const&>( a ).m_it );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** is_const ************** //
// ************************************************************************** //
template<typename C>
inline is_const<C>
is_const_coll( C& )
{
return is_const<C>();
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** begin ************** //
// ************************************************************************** //
template<typename C>
inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
begin( C& t, mpl::false_ )
{
return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.begin() );
}
//your_sha256_hash____________//
template<typename C>
inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
begin( C const& t, mpl::true_ )
{
return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.begin() );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** end ************** //
// ************************************************************************** //
template<typename C>
inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
end( C& t, mpl::false_ )
{
return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.end() );
}
//your_sha256_hash____________//
template<typename C>
inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
end( C const& t, mpl::true_ )
{
return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.end() );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** done ************** //
// ************************************************************************** //
template<typename C>
inline bool
done( static_any_t cur, static_any_t end, C&, mpl::false_ )
{
return static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur ) ==
static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( end );
}
//your_sha256_hash____________//
template<typename C>
inline bool
done( static_any_t cur, static_any_t end, C const&, mpl::true_ )
{
return static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur ) ==
static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( end );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** next ************** //
// ************************************************************************** //
template<typename C>
inline void
next( static_any_t cur, C&, mpl::false_ )
{
++static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
}
//your_sha256_hash____________//
template<typename C>
inline void
next( static_any_t cur, C const&, mpl::true_ )
{
++static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** prev ************** //
// ************************************************************************** //
template<typename C>
inline void
prev( static_any_t cur, C&, mpl::false_ )
{
--static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
}
//your_sha256_hash____________//
template<typename C>
inline void
prev( static_any_t cur, C const&, mpl::true_ )
{
--static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** deref ************** //
// ************************************************************************** //
template<class RefType,typename C>
inline RefType
deref( static_any_t cur, C&, ::boost::type<RefType>, mpl::false_ )
{
return *static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
}
//your_sha256_hash____________//
template<class RefType,typename C>
inline RefType
deref( static_any_t cur, C const&, ::boost::type<RefType>, mpl::true_ )
{
return *static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
}
//your_sha256_hash____________//
// ************************************************************************** //
// ************** BOOST_TEST_FOREACH ************** //
// ************************************************************************** //
#define BOOST_TEST_FE_ANY ::boost::unit_test::for_each::static_any_t
#define BOOST_TEST_FE_IS_CONST( COL ) ::boost::unit_test::for_each::is_const_coll( COL )
#define BOOST_TEST_FE_BEG( COL ) \
::boost::unit_test::for_each::begin( \
COL, \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#define BOOST_TEST_FE_END( COL ) \
::boost::unit_test::for_each::end( \
COL, \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#define BOOST_TEST_FE_DONE( COL ) \
::boost::unit_test::for_each::done( \
BOOST_TEST_FE_CUR_VAR, \
BOOST_TEST_FE_END_VAR, \
COL, \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#define BOOST_TEST_FE_NEXT( COL ) \
::boost::unit_test::for_each::next( \
BOOST_TEST_FE_CUR_VAR, \
COL, \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#define BOOST_TEST_FE_PREV( COL ) \
::boost::unit_test::for_each::prev( \
BOOST_TEST_FE_CUR_VAR, \
COL, \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#define BOOST_FOREACH_NOOP(COL) \
((void)&(COL))
#define BOOST_TEST_FE_DEREF( COL, RefType ) \
::boost::unit_test::for_each::deref( \
BOOST_TEST_FE_CUR_VAR, \
COL, \
::boost::type<RefType >(), \
BOOST_TEST_FE_IS_CONST( COL ) ) \
/**/
#if BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
#define BOOST_TEST_LINE_NUM
#else
#define BOOST_TEST_LINE_NUM __LINE__
#endif
#define BOOST_TEST_FE_CUR_VAR BOOST_JOIN( _fe_cur_, BOOST_TEST_LINE_NUM )
#define BOOST_TEST_FE_END_VAR BOOST_JOIN( _fe_end_, BOOST_TEST_LINE_NUM )
#define BOOST_TEST_FE_CON_VAR BOOST_JOIN( _fe_con_, BOOST_TEST_LINE_NUM )
#define BOOST_TEST_FOREACH( RefType, var, COL ) \
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ) ) {} else \
for( bool BOOST_TEST_FE_CON_VAR = true; \
BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); \
BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL )) \
\
if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \
for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \
!BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \
/**/
#define BOOST_TEST_REVERSE_FOREACH( RefType, var, COL ) \
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_END( COL ) ) {} else \
if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \
for( bool BOOST_TEST_FE_CON_VAR = true; \
BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); ) \
\
if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \
if( (BOOST_TEST_FE_PREV( COL ), false) ) {} else \
for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \
!BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \
/**/
//your_sha256_hash____________//
} // namespace for_each
} // namespace unit_test
} // namespace boost
#include <boost/test/detail/enable_warnings.hpp>
#endif // BOOST_TEST_UTILS_FOREACH_HPP
```
|
Jules Gros (3 March 1829 – 30 July 1891) was a French journalist and Secretary of the Société de géographie. He became the President of the unrecognised Republic of Independent Guyana in South America in May 1887, but was deposed in September 1887.
Biography
Gros was born Jean Jules Gros on 16 March 1829 in Montluel, France. Gros became a journalist who specialized in geographical subjects. He wrote for the newspaper Le Petit Journal, and the magazines Le Tour du Monde and Le Journal des Voyages among others. He was a member of the Société de géographie and had served as the Secretary for the organisation.
Republic of Independent Guiana
The borders between French Guiana and Brazil were not clear, and it was decided that the area between the Amazon and the Oyapock River was a neutral territory. Paul Quartier who had visited the territory in 1883, returned in 1885 and had a meeting with the village chiefs of Cunani and Carsewenne (nowadays: Calçoene). In 1886, the Republic of Independent Guiana was founded by a group of French adventurers and two village chiefs with Cunani as the Capital.
Quartier and his men knew Gros who had written about their Republic in Le Journal des Voyages. In May 1887, Gros was informed by telegram in Paris that he had been elected president. Gros immediately started to write articles for the press, and temporarily administered the country from Paris. He accused an official of the new republic of smuggling. The smuggler accused Gros of alcoholism, and Gros retaliated by firing all officials. On 17 September 1887, Gros was deposed as president. Gros refused to accept the dismissal, appointed himself President for life, and boarded a British ship to French Guiana. The British government was informed of his presence by France, and in British Guiana, he was removed from the ship, and returned to France.
Gros died on 30 July 1891 in Vanves, France at the age of 62.
See also
Adolphe Brezet
References
1829 births
1891 deaths
People from Montluel
Heads of state of states with limited recognition
French politicians
French journalists
French geographers
19th-century French people
19th century in Brazil
19th century in French Guiana
|
Semion Goldin (born 1967) is an Israeli historian. He is a senior research fellow at the Leonid Nevzlin Research Center for Russian and Eastern European Jewry in Israel.
Career
Goldin is responsible for the programmatic development and administrative aspects of the Nevzlin Center. He received his PhD cum laude from the Hebrew University of Jerusalem. His dissertation, published as monograph, focuses on the Russian Army policy towards the Jews during WWI, from 1914 to 1917.
Goldin now teaches at the Hebrew University of Jerusalem. He has published several articles on various topics of East European Jewish history in the twentieth century.
Research
Goldin's historical research is mostly focused on the last years of the Russian Empire, and its military's highly destructive and ultimately disastrous persecution of the Jews during WWI.
The specific aspects he researches are:
The "Jewish Question" and the political situation in the Russian Empire
Jews as the Other in Polish and Russian nationalist ideology
The Russian Army and the Jews at the start of the twentieth century
Russian Army authority and activity in civilian administration during WWI
Russian Army Command and the negative stereotype of the Jew
Russian Army's libelous persecution of the Jewish population in WWI
Soldiers, officers, and the Jewish population of the frontal zone in WWI
Deportations of the Jewish population and hostage taking during WWI
Antisemitism and pogroms in the military of the Russian Empire
Goldin's research papers are published in professional publications:
Semion Goldin in Google Scholar
Semion Goldin in JSTOR
Semion Goldin in Google Books
Semion Goldin in Hebrew University
Books
The Russian Army and the Jewish Population, 1914–1917: Libel, Persecution, Reaction.
Jewish Migration in Modern Times: The Case of Eastern Europe.
References
Living people
1967 births
Israeli historians
Hebrew University of Jerusalem alumni
Academic staff of the Hebrew University of Jerusalem
|
Colegio La República () is a Chilean high school located in Rancagua, Cachapoal Province, Chile.
As of 2012, the principal of Colegio La República is Juan Antonio Gutiérrez Espinoza. In that school year, La República had 713 students. The president of the parents' center (centro de padres y apoderados) is Roberto Torres, and in its 2010–2011 term, the president of the students' center (centro de alumnos) is Javiera Garrido Mella.
References
External links
Colegio La República website
Educational institutions with year of establishment missing
Secondary schools in Chile
Schools in Cachapoal Province
|
```xml
import * as React from 'react';
import { Divider, FluentProvider, makeStyles, mergeClasses, tokens, Text, Caption1 } from '@fluentui/react-components';
import { Demo } from '../Demo/Demo';
import { Palette } from '../Palette/Palette';
import { ColorTokens } from '../ColorTokens/ColorTokens';
import { useThemeDesigner } from '../../Context/ThemeDesignerContext';
import { ExportPanel } from '../Export/ExportPanel';
export interface ContentProps {
className?: string;
}
const useStyles = makeStyles({
root: {
display: 'flex',
alignItems: 'stretch',
flexDirection: 'column',
minWidth: '750px',
padding: '40px 10%',
margin: '0 auto',
gridRowGap: tokens.spacingVerticalXXXL,
},
sickerSheet: {
display: 'flex',
flexDirection: 'column',
gridRowGap: tokens.spacingVerticalM,
},
});
export const Content: React.FC<ContentProps> = props => {
const styles = useStyles();
const {
state: { themeWithOverrides },
} = useThemeDesigner();
return (
<FluentProvider theme={themeWithOverrides}>
<ExportPanel />
<div className={mergeClasses(styles.root, props.className)}>
<h1 style={{ marginBottom: 0 }}>Fluent Theme Designer</h1>
<Text>
Welcome to the Fluent Theme Designer tool. This tool offers a step-by-step process to help you implement your
organizations brand colors within Microsoft products using Fluent 2. Inputting your organizations key color
value will output a 16-color ramp that passes contrast checks when used in tokens and implemented with Fluent
2 components.
</Text>
<Palette />
<div className={styles.sickerSheet}>
<Divider />
<Caption1>Sticker sheet</Caption1>
</div>
<Demo />
<Divider />
<ColorTokens />
</div>
</FluentProvider>
);
};
```
|
```kotlin
/*
*/
package splitties.views.appcompat
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.Configuration
import android.util.AttributeSet
import androidx.appcompat.R
import splitties.resources.styledDimenPxSize
import kotlin.LazyThreadSafetyMode.NONE
import androidx.appcompat.widget.Toolbar as AndroidXToolbar
/**
* An [AndroidXToolbar] that handles configuration changes and changes its size accordingly.
*/
class Toolbar @JvmOverloads constructor(
context: Context, attrs: AttributeSet?, defStyleAttr: Int = R.attr.toolbarStyle
) : AndroidXToolbar(context, attrs, defStyleAttr) {
constructor(context: Context) : this(context, null)
private val maxBtHeightField by lazy(NONE) {
AndroidXToolbar::class.java.getDeclaredField("mMaxButtonHeight").apply {
isAccessible = true
}
}
@SuppressLint("PrivateResource")
override fun onConfigurationChanged(newConfig: Configuration?) {
super.onConfigurationChanged(newConfig)
setTitleTextAppearance(context, R.style.TextAppearance_Widget_AppCompat_Toolbar_Title)
setSubtitleTextAppearance(context, R.style.TextAppearance_Widget_AppCompat_Toolbar_Subtitle)
val actionBarSize = styledDimenPxSize(R.attr.actionBarSize)
minimumHeight = actionBarSize
maxBtHeightField.set(this, actionBarSize)
}
}
```
|
```rust
#![allow(dead_code, non_snake_case, non_camel_case_types, non_upper_case_globals)]
impl Foo {
pub const Dupe: Foo = Foo::Bar;
}
#[repr(u32)]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum Foo {
Bar = 1,
}
```
|
```hcl
variable "instance_type" {}
variable "enable" {
default = false
}
resource "aws_instance" "dependent" {
// The attribute depends on `enable` and `instance_type`
instance_type = var.enable ? var.instance_type : "t2.micro"
}
resource "aws_instance" "independent" {
// instance_type is invalid, but the attribute does not depend on the parent module aruguments
instance_type = "t1.2xlarge"
}
```
|
Shirhatti (Kh) is a village in Belgaum district of Karnataka, India.
References
Villages in Belagavi district
|
```c
/**
* @license Apache-2.0
*
*
*
* path_to_url
*
* Unless required by applicable law or agreed to in writing, software
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*/
/*
* The following is auto-generated. Do not manually edit. See scripts/loops.js.
*/
#include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
#include "stdlib/ndarray/base/unary/typedefs.h"
#include "stdlib/ndarray/base/unary/macros.h"
#include "stdlib/ndarray/base/unary/dispatch_object.h"
#include "stdlib/ndarray/base/unary/dispatch.h"
#include "stdlib/ndarray/ctor.h"
#include <stdint.h>
/**
* Applies a unary callback to a zero-dimensional input ndarray and assigns results to elements in a zero-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0 };
* uint8_t ybuf[] = { 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 0;
*
* // Define the array shapes:
* int64_t shape[] = {};
*
* // Define the strides:
* int64_t sx[] = { 0 };
* int64_t sy[] = { 0 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_0d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_0d( struct ndarray *arrays[], void *fcn ) {
int8_t v;
int8_t status = stdlib_ndarray_iget_int8( arrays[ 0 ], 0, &v );
if ( status != 0 ) {
return -1;
}
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
status = stdlib_ndarray_iset_uint16( arrays[ 1 ], 0, (uint16_t)f( (int32_t)v ) );
if ( status != 0 ) {
return -1;
}
return 0;
}
/**
* Applies a unary callback to a one-dimensional input ndarray and assigns results to elements in a one-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 1;
*
* // Define the array shapes:
* int64_t shape[] = { 3 };
*
* // Define the strides:
* int64_t sx[] = { 1 };
* int64_t sy[] = { 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_1d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_1d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_1D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a two-dimensional input ndarray and assigns results to elements in a two-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 2;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 2, 1 };
* int64_t sy[] = { 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_2d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_2d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_2D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a two-dimensional input ndarray and assigns results to elements in a two-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 2;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 2, 1 };
* int64_t sy[] = { 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_2d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_2d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_2D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a three-dimensional input ndarray and assigns results to elements in a three-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 3;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 4, 2, 1 };
* int64_t sy[] = { 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_3d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_3d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_3D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a three-dimensional input ndarray and assigns results to elements in a three-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 3;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 4, 2, 1 };
* int64_t sy[] = { 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_3d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_3d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_3D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a four-dimensional input ndarray and assigns results to elements in a four-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 4;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 4, 2, 1 };
* int64_t sy[] = { 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_4d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_4d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_4D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a four-dimensional input ndarray and assigns results to elements in a four-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 4;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 4, 2, 1 };
* int64_t sy[] = { 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_4d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_4d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_4D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a five-dimensional input ndarray and assigns results to elements in a five-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 5;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_5d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_5d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_5D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a five-dimensional input ndarray and assigns results to elements in a five-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 5;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_5d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_5d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_5D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a six-dimensional input ndarray and assigns results to elements in a six-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 6;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_6d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_6d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_6D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a six-dimensional input ndarray and assigns results to elements in a six-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 6;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_6d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_6d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_6D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a seven-dimensional input ndarray and assigns results to elements in a seven-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 7;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_7d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_7d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_7D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a seven-dimensional input ndarray and assigns results to elements in a seven-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 7;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_7d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_7d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_7D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to an eight-dimensional input ndarray and assigns results to elements in an eight-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 8;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_8d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_8d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_8D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to an eight-dimensional input ndarray and assigns results to elements in an eight-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 8;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_8d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_8d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_8D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a nine-dimensional input ndarray and assigns results to elements in a nine-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 9;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_9d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_9d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_9D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a nine-dimensional input ndarray and assigns results to elements in a nine-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 9;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_9d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_9d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_9D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a ten-dimensional input ndarray and assigns results to elements in a ten-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 10;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_10d( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_10d( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_10D_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to a ten-dimensional input ndarray and assigns results to elements in a ten-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 10;
*
* // Define the array shapes:
* int64_t shape[] = { 1, 1, 1, 1, 1, 1, 1, 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 8, 8, 8, 8, 8, 8, 8, 4, 2, 1 };
* int64_t sy[] = { 16, 16, 16, 16, 16, 16, 16, 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_10d_blocked( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_10d_blocked( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_10D_BLOCKED_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
/**
* Applies a unary callback to an n-dimensional input ndarray and assigns results to elements in an n-dimensional output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 3;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 4, 2, 1 };
* int64_t sy[] = { 8, 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i_nd( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i_nd( struct ndarray *arrays[], void *fcn ) {
typedef int32_t func_type( const int32_t x );
func_type *f = (func_type *)fcn;
STDLIB_NDARRAY_UNARY_ND_LOOP_CLBK_ARG_CAST( int8_t, uint16_t, int32_t )
return 0;
}
// Define a list of unary ndarray functions:
static ndarrayUnaryFcn functions[] = {
stdlib_ndarray_s_t_as_i_i_0d,
stdlib_ndarray_s_t_as_i_i_1d,
stdlib_ndarray_s_t_as_i_i_2d,
stdlib_ndarray_s_t_as_i_i_3d,
stdlib_ndarray_s_t_as_i_i_4d,
stdlib_ndarray_s_t_as_i_i_5d,
stdlib_ndarray_s_t_as_i_i_6d,
stdlib_ndarray_s_t_as_i_i_7d,
stdlib_ndarray_s_t_as_i_i_8d,
stdlib_ndarray_s_t_as_i_i_9d,
stdlib_ndarray_s_t_as_i_i_10d,
stdlib_ndarray_s_t_as_i_i_nd
};
// Define a list of unary ndarray functions implementing loop blocking...
static ndarrayUnaryFcn blocked_functions[] = {
stdlib_ndarray_s_t_as_i_i_2d_blocked,
stdlib_ndarray_s_t_as_i_i_3d_blocked,
stdlib_ndarray_s_t_as_i_i_4d_blocked,
stdlib_ndarray_s_t_as_i_i_5d_blocked,
stdlib_ndarray_s_t_as_i_i_6d_blocked,
stdlib_ndarray_s_t_as_i_i_7d_blocked,
stdlib_ndarray_s_t_as_i_i_8d_blocked,
stdlib_ndarray_s_t_as_i_i_9d_blocked,
stdlib_ndarray_s_t_as_i_i_10d_blocked
};
// Create a unary function dispatch object:
static const struct ndarrayUnaryDispatchObject obj = {
// Array containing unary ndarray functions:
functions,
// Number of unary ndarray functions:
12,
// Array containing unary ndarray functions using loop blocking:
blocked_functions,
// Number of unary ndarray functions using loop blocking:
9
};
/**
* Applies a unary callback to an input ndarray and assigns results to elements in an output ndarray.
*
* ## Notes
*
* - If successful, the functions returns `0`; otherwise, the function returns an error code.
*
* @param arrays array whose first element is a pointer to an input ndarray and whose last element is a pointer to an output ndarray
* @param fcn callback
* @return status code
*
* @example
* #include "stdlib/ndarray/base/unary/s_t_as_i_i.h"
* #include "stdlib/ndarray/dtypes.h"
* #include "stdlib/ndarray/index_modes.h"
* #include "stdlib/ndarray/orders.h"
* #include "stdlib/ndarray/ctor.h"
* #include <stdint.h>
* #include <stdlib.h>
* #include <stdio.h>
*
* // Define the ndarray data types:
* enum STDLIB_NDARRAY_DTYPE xdtype = STDLIB_NDARRAY_INT8;
* enum STDLIB_NDARRAY_DTYPE ydtype = STDLIB_NDARRAY_UINT16;
*
* // Create underlying byte arrays:
* uint8_t xbuf[] = { 0, 0, 0, 0 };
* uint8_t ybuf[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
*
* // Define the number of dimensions:
* int64_t ndims = 2;
*
* // Define the array shapes:
* int64_t shape[] = { 2, 2 };
*
* // Define the strides:
* int64_t sx[] = { 2, 1 };
* int64_t sy[] = { 4, 2 };
*
* // Define the offsets:
* int64_t ox = 0;
* int64_t oy = 0;
*
* // Define the array order:
* enum STDLIB_NDARRAY_ORDER order = STDLIB_NDARRAY_ROW_MAJOR;
*
* // Specify the index mode:
* enum STDLIB_NDARRAY_INDEX_MODE imode = STDLIB_NDARRAY_INDEX_ERROR;
*
* // Specify the subscript index modes:
* int8_t submodes[] = { imode };
* int64_t nsubmodes = 1;
*
* // Create an input ndarray:
* struct ndarray *x = stdlib_ndarray_allocate( xdtype, xbuf, ndims, shape, sx, ox, order, imode, nsubmodes, submodes );
* if ( x == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an output ndarray:
* struct ndarray *y = stdlib_ndarray_allocate( ydtype, ybuf, ndims, shape, sy, oy, order, imode, nsubmodes, submodes );
* if ( y == NULL ) {
* fprintf( stderr, "Error allocating memory.\n" );
* exit( EXIT_FAILURE );
* }
*
* // Create an array containing the ndarrays:
* struct ndarray *arrays[] = { x, y };
*
* // Define a callback:
* static int32_t fcn( const int32_t x ) {
* return x;
* }
*
* // Apply the callback:
* int8_t status = stdlib_ndarray_s_t_as_i_i( arrays, (void *)fcn );
* if ( status != 0 ) {
* fprintf( stderr, "Error during computation.\n" );
* exit( EXIT_FAILURE );
* }
*
* // ...
*
* // Free allocated memory:
* stdlib_ndarray_free( x );
* stdlib_ndarray_free( y );
*/
int8_t stdlib_ndarray_s_t_as_i_i( struct ndarray *arrays[], void *fcn ) {
return stdlib_ndarray_unary_dispatch( &obj, arrays, fcn );
}
```
|
```xml
import React from 'react';
import { render } from '@testing-library/react-native';
import RadioButton from '../../RadioButton';
import { RadioButtonContext } from '../../RadioButton/RadioButtonGroup';
describe('RadioButton', () => {
describe('on default platform', () => {
beforeAll(() => {
jest.mock('react-native', () => {
const RN = jest.requireActual('react-native');
RN.Platform = () => ({
select: (objs: { default: object }) => objs.default,
});
return RN;
});
});
it('renders properly', () => {
const tree = render(<RadioButton value="first" />).toJSON();
expect(tree).toMatchSnapshot();
});
});
describe('on ios platform', () => {
beforeAll(() => {
jest.mock('react-native', () => {
const RN = jest.requireActual('react-native');
RN.Platform = () => ({
select: (objs: { ios: object }) => objs.ios,
});
return RN;
});
});
it('renders properly', () => {
const tree = render(<RadioButton value="first" />).toJSON();
expect(tree).toMatchSnapshot();
});
});
describe('when RadioButton is wrapped by RadioButtonContext.Provider', () => {
it('renders properly', () => {
const tree = render(
<RadioButtonContext.Provider
value={{ value: 'first', onValueChange: () => {} }}
>
<RadioButton value="first" />
</RadioButtonContext.Provider>
).toJSON();
expect(tree).toMatchSnapshot();
});
});
describe('RadioButton with custom testID', () => {
it('renders properly', () => {
const tree = render(
<RadioButton value="first" testID={'custom:testID'} />
).toJSON();
expect(tree).toMatchSnapshot();
});
});
});
```
|
```objective-c
////////////////////////////////////////////////////////////////////////////////////////////////////
//
// Project: Embedded Learning Library (ELL)
// File: TransformationTest.h (model/optimizer_test)
// Authors: Chuck Jacobs
//
////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
//
// Transformation class tests
//
void TestTransformations();
void TestTrivialTransformation();
void TestAddMetadataToOutputTransformation();
void TestCombineNodesTransformation();
```
|
Nirmla Wadhwani is a politician from Gujarat and was minister for Women and Child Development in Vijay Rupani's cabinet. She represented Naroda in the Gujarat Legislative Assembly.
Biography
Wadhwani is of Sindhi heritage. She was previously a physician with specialization in Obstetrics and Gynaecology. She had done a diploma in sonography from Croatia and has been the President of Ahmedabad Medical Association's Ladies Wing. She is affiliated to the Bharatiya Janata Party (BJP) and is a member of its executive committee in Gujarat. As a member of the Gujarat Legislative Assembly, she has served on the committees on ICDS, PC-PNDT, Shala Arogya and MLA Quarters. She won the 2012 Gujarat Legislative Assembly election from Naroda. In August 2016, she was appointed Gujarat's Minister for Women and Child Development, the only female member in the cabinet of chief minister Vijay Rupani.
In February 2017 session of the Gujarat Legislative Assembly, a debate on the issue of farmer's suicide turned into a scuffle and Wadhwani was injured. She accused a few MLA's of the Indian National Congress for injuring her arm. The BJP has not included her name in its official list of candidates for 2017 Gujarat Legislative Assembly election.
References
Living people
Indian gynaecologists
Indian obstetricians
Bharatiya Janata Party politicians from Gujarat
Gujarat MLAs 2012–2017
Medical doctors from Gujarat
Women in Gujarat politics
Indian women gynaecologists
1964 births
Sindhi politicians
21st-century Indian women politicians
Sindhi women politicians
|
```c
/* packet-sbc-ap.c
* Routines for SBc Application Part (SBc-AP) packet dissection
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
*
* This program is free software; you can redistribute it and/or
* as published by the Free Software Foundation; either version 2
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Ref 3GPP TS 29.168
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/strutil.h>
#include <epan/asn1.h>
#include <epan/sctpppids.h>
#include "packet-ber.h"
#include "packet-per.h"
#include "packet-e212.h"
#define PNAME "SBc Application Part"
#define PSNAME "SBCAP"
#define PFNAME "sbcap"
void proto_register_sbc_ap(void);
void proto_reg_handoff_sbc_ap(void);
/* The registered port number for SBc-AP is 29168.
* The registered payload protocol identifier for SBc-AP is 24.
*/
#define SBC_AP_PORT 29168
static dissector_handle_t sbc_ap_handle=NULL;
#include "packet-sbc-ap-val.h"
/* Initialize the protocol and registered fields */
static int proto_sbc_ap = -1;
#include "packet-sbc-ap-hf.c"
/* Initialize the subtree pointers */
static int ett_sbc_ap = -1;
#include "packet-sbc-ap-ett.c"
enum{
INITIATING_MESSAGE,
SUCCESSFUL_OUTCOME,
UNSUCCESSFUL_OUTCOME
};
/* Global variables */
static guint32 ProcedureCode;
static guint32 ProtocolIE_ID;
static guint32 ProtocolExtensionID;
static int global_sbc_ap_port = SBC_AP_PORT;
/* Dissector tables */
static dissector_table_t sbc_ap_ies_dissector_table;
static dissector_table_t sbc_ap_extension_dissector_table;
static dissector_table_t sbc_ap_proc_imsg_dissector_table;
static dissector_table_t sbc_ap_proc_sout_dissector_table;
static dissector_table_t sbc_ap_proc_uout_dissector_table;
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *);
#include "packet-sbc-ap-fn.c"
static int dissect_ProtocolIEFieldValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_ies_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
/* Currently not used
static int dissect_ProtocolIEFieldPairFirstValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_ies_p1_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_ProtocolIEFieldPairSecondValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_ies_p2_dissector_table, ProtocolIE_ID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
*/
static int dissect_ProtocolExtensionFieldExtensionValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_extension_dissector_table, ProtocolExtensionID, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_InitiatingMessageValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_proc_imsg_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_SuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_proc_sout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int dissect_UnsuccessfulOutcomeValue(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
return (dissector_try_uint(sbc_ap_proc_uout_dissector_table, ProcedureCode, tvb, pinfo, tree)) ? tvb_captured_length(tvb) : 0;
}
static int
dissect_sbc_ap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_item *sbc_ap_item = NULL;
proto_tree *sbc_ap_tree = NULL;
/* make entry in the Protocol column on summary display */
col_set_str(pinfo->cinfo, COL_PROTOCOL, PNAME);
/* create the sbc_ap protocol tree */
if (tree) {
sbc_ap_item = proto_tree_add_item(tree, proto_sbc_ap, tvb, 0, -1, ENC_NA);
sbc_ap_tree = proto_item_add_subtree(sbc_ap_item, ett_sbc_ap);
dissect_SBC_AP_PDU_PDU(tvb, pinfo, sbc_ap_tree, NULL);
}
return tvb_captured_length(tvb);
}
/*--- proto_register_sbc_ap -------------------------------------------*/
void proto_register_sbc_ap(void) {
/* List of fields */
static hf_register_info hf[] = {
#include "packet-sbc-ap-hfarr.c"
};
/* List of subtrees */
static gint *ett[] = {
&ett_sbc_ap,
#include "packet-sbc-ap-ettarr.c"
};
/* Register protocol */
proto_sbc_ap = proto_register_protocol(PNAME, PSNAME, PFNAME);
/* Register fields and subtrees */
proto_register_field_array(proto_sbc_ap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
/* Register dissector tables */
sbc_ap_ies_dissector_table = register_dissector_table("sbc_ap.ies", "SBC-AP-PROTOCOL-IES", proto_sbc_ap, FT_UINT32, BASE_DEC);
sbc_ap_extension_dissector_table = register_dissector_table("sbc_ap.extension", "SBC-AP-PROTOCOL-EXTENSION", proto_sbc_ap, FT_UINT32, BASE_DEC);
sbc_ap_proc_imsg_dissector_table = register_dissector_table("sbc_ap.proc.imsg", "SBC-AP-ELEMENTARY-PROCEDURE InitiatingMessage", proto_sbc_ap, FT_UINT32, BASE_DEC);
sbc_ap_proc_sout_dissector_table = register_dissector_table("sbc_ap.proc.sout", "SBC-AP-ELEMENTARY-PROCEDURE SuccessfulOutcome", proto_sbc_ap, FT_UINT32, BASE_DEC);
sbc_ap_proc_uout_dissector_table = register_dissector_table("sbc_ap.proc.uout", "SBC-AP-ELEMENTARY-PROCEDURE UnsuccessfulOutcome", proto_sbc_ap, FT_UINT32, BASE_DEC);
}
/*--- proto_reg_handoff_sbc_ap ---------------------------------------*/
void
proto_reg_handoff_sbc_ap(void)
{
static gboolean inited = FALSE;
static guint SctpPort;
if( !inited ) {
sbc_ap_handle = create_dissector_handle(dissect_sbc_ap, proto_sbc_ap);
dissector_add_uint("sctp.ppi", SBC_AP_PAYLOAD_PROTOCOL_ID, sbc_ap_handle);
inited = TRUE;
#include "packet-sbc-ap-dis-tab.c"
} else {
if (SctpPort != 0) {
dissector_delete_uint("sctp.port", SctpPort, sbc_ap_handle);
}
}
SctpPort = global_sbc_ap_port;
if (SctpPort != 0) {
dissector_add_uint("sctp.port", SctpPort, sbc_ap_handle);
}
}
```
|
```java
package com.fishercoder.solutions.secondthousand;
public class _1034 {
public static class Solution1 {
/**
* My completely original solution.
*/
int[] dirs = new int[]{0, 1, 0, -1, 0};
public int[][] colorBorder(int[][] grid, int row, int col, int color) {
int m = grid.length;
int n = grid[0].length;
boolean[][] visited = new boolean[m][n];
visited[row][col] = true;
//copy the input as the final output so that we keep the input intact during dfs, otherwise, it'll lead to incorrect result like in test case 3
int[][] result = new int[m][n];
for (int i = 0; i < m; i++) {
for (int j = 0; j < n; j++) {
result[i][j] = grid[i][j];
}
}
return dfs(grid, row, col, color, m, n, grid[row][col], visited, result);
}
private int[][] dfs(int[][] grid, int row, int col, int color, int m, int n, int originalColor, boolean[][] visited, int[][] result) {
if (row == 0 || col == 0 || row == m - 1 || col == n - 1 || neighborDiffColor(row, col, grid, originalColor, m, n)) {
result[row][col] = color;
}
for (int i = 0; i < dirs.length - 1; i++) {
int nextRow = dirs[i] + row;
int nextCol = dirs[i + 1] + col;
if (nextRow >= 0 && nextRow < m && nextCol >= 0 && nextCol < n && grid[nextRow][nextCol] == originalColor && !visited[nextRow][nextCol]) {
visited[nextRow][nextCol] = true;
dfs(grid, nextRow, nextCol, color, m, n, originalColor, visited, result);
}
}
return result;
}
private boolean neighborDiffColor(int row, int col, int[][] grid, int originalColor, int m, int n) {
//if any of the four neighbors has a different color, we consider this cell as a boarding cell as well as it's a boarder to this connected component
for (int i = 0; i < dirs.length - 1; i++) {
int nextRow = row + dirs[i];
int nextCol = col + dirs[i + 1];
if (nextRow >= 0 && nextCol >= 0 && nextRow < m && nextCol < n && grid[nextRow][nextCol] != originalColor) {
return true;
}
}
return false;
}
}
}
```
|
```javascript
/*!
jQuery UI integration for DataTables' Buttons
2016 SpryMedia Ltd - datatables.net/license
*/
(function(c){"function"===typeof define&&define.amd?define(["jquery","datatables.net-jqui","datatables.net-buttons"],function(a){return c(a,window,document)}):"object"===typeof exports?module.exports=function(a,b){a||(a=window);if(!b||!b.fn.dataTable)b=require("datatables.net-jqui")(a,b).$;b.fn.dataTable.Buttons||require("datatables.net-buttons")(a,b);return c(b,a,a.document)}:c(jQuery,window,document)})(function(c){var a=c.fn.dataTable;c.extend(!0,a.Buttons.defaults,{dom:{container:{className:"dt-buttons ui-buttonset"},
button:{className:"dt-button ui-button ui-state-default ui-button-text-only",disabled:"ui-state-disabled",active:"ui-state-active"},buttonLiner:{tag:"span",className:"ui-button-text"}}});a.ext.buttons.collection.text=function(a){return a.i18n("buttons.collection",'Collection <span class="ui-button-icon-primary ui-icon ui-icon-triangle-1-s"/>')};return a.Buttons});
```
|
Jalan Gajah Mada and Jalan Hayam Wuruk (Gajah Mada and Hayam Wuruk Streets), formerly Molenvliet West and Molenvliet Oost respectively, is a major thoroughfare located in Jakarta, Indonesia. The two streets with its canal, the Batang Hari (formerly the Molenvliet), connect Glodok and Kota Tua Jakarta to the north with Harmoni Junction to the south. Completed in late 1640s, the canal-street Gajah Mada and Hayam Wuruk is Jakarta's oldest major thoroughfare.
Description
At its northernmost point, Jalan Gajah Mada and Jalan Hayam Wuruk began at a junction where Jalan Pancoran, Jalan Pintu Besar Selatan, and Jalan Pinangsia Raya met (directly below the Glodok pedestrian link). The road ran toward the south parallel with the Batang Hari canal (official but not a very well-known name of the historic Molenvliet) until Harmoni Junction, a point where the roads stop. The Molenvliet however continued toward the east to reach Ciliwung. Jalan Gajah Mada and Jalan Hayam Wuruk is the oldest thoroughfare in Jakarta. The canal road traverses through the oldest China Town in Batavia. The road contains a mix of 18th-century Dutch colonial buildings, Chinese architecture, and newer modern buildings. Some of the oldest neighborhood of Batavia, e.g. Kebon Jeruk and Mangga Besar, was located along Jalan Gajah Mada and Jalan Hayam Wuruk.
The northern portion of the canal-road is within the administrative city of West Jakarta, while the southern portion is within Central Jakarta. The boundary of the two administrative cities is located at the junction of Jalan Sukarjo Wiryopranoto.
The first tramway of Jakarta (now defunct) pass through Molenvliet West (Jalan Gajah Mada), whilst the first corridor of TransJakarta bus rapid system pass through Jalan Gajah Mada and Jalan Hayam Wuruk. Jakarta MRT first line will pass below Jalan Gajah Mada and Jalan Hayam Wuruk toward Kota Tua.
History
Early colonial period
Construction of canal-road Gajah Mada and Hayam Wuruk began in the 1648 when a channel was dug from the river Ciliwung toward the south to meet with the portion of Ciliwung at the south. The canal was built to drain water from the surrounding swamps south of Batavia as well as providing easier means of transporting goods. Construction was led by Phoa Beng Gan, Kapitein der Chinezen, the government-appointed Chinese headman of Batavia from 1645 to 1663. When the canal was completed, it was named Bingamvaart after Kapitan Beng Gan himself. In 1661, the canal was named Molenvliet, so called because of the existence of a number of mills (Dutch molen) near the canal. The point where the Molenvliet starts at north was the result of the extension of the Nieuwepoortstraat (now Jalan Pintu Besar Selatan). This new road, initially named Bingams gracht, became known as the Molenvliet West, the precursor of Jalan Gajah Mada. going toward south parallel with the Molenvliet was named Molenvliet West. The road Molenvliet West was largely complete c. 1650. The street extends far south until a point where Molenvliet makes a turn toward the east to feed on the southern portion of the Ciliwung.
In the 18th-century, when the fortified city of Batavia became infested with malaria epidemics, people gradually began to move to the healthier southern hinterland starting with those who could afford to move. Rich people such as government officials or influential people began to build villas along Molenvliet West. Drawings from the second half of the 18th-century show many summer houses with elaborate gardens were built along the Molenvliet West, e.g. the grand residence of Reynier de Klerck which is now the old National Archives Building and Candra Naya, residence of Khouw Tian Sek, later Luitenant der Chinezen ('Lieutenant of the Chinese'). In the early 18th-century, the street Prinselaan (now Jalan Mangga Besar Raya) was constructed from Ciliwung westward toward Molenvliet West, crossing the Molenvliet via a bridge. Around 1850, a new road was constructed toward the south from the point where the Prinselaan meets the canal. This new road, running along the eastern side of Molenvliet, was named Molenvliet Oost (now Jalan Hayam Wuruk). Unlike Molenvliet West, at this period the Molenvliet Oost had not go all the way toward the Nieuwpoortstraat nor toward the Noordwijk (now Jalan Ir. H. Juanda).
In the late eighteenth and the early nineteenth century, the Chinese-born merchant Khouw Tjoen and his son, Lieutenant Khouw Tian Sek, began to acquire a great deal of land along the Molenvliet, then still a semi-rural suburb of Batavia. Fortunately for the Lieutenant, the southwards urban expansion of Batavia in the early nineteenth century meant that '[t]his [area]...increased so enormously in value that without further effort on...[his] part he was changed from a comparatively well-to-do into an exceedingly wealthy man.' His descendants - the Khouw family of Tamboen, headed in the late colonial era by Khouw Kim An, last Majoor der Chinezen of Batavia - remained among the largest landowners in the Molenvliet area until the mid-twentieth century.
Modern colonial period
On April 20, 1869, the Batavia Tramway Company (Bataviasche Tramweg-Maatschappij) and the Firm Dummler & Co. started the horse-carried tram line number 1 in Molenvliet West, starting from Amsterdam Gate in Kota Tua to Harmonie. This line is the first and the main line of Jakarta tramline, which would be extended up until Meester Cornelis and would end in 1962.
At the beginning of the 20th-century, the northern end of the Molenvliet retains its Old Town characteristic with its 18th-century China Town Glodok, while the newer southern portion of Molenvliet has a more European influence. Grand hotels and pleasure places were established at the south end of the canal-road e.g. Hotel des Indes, the Marine Hotel and the Harmony Society. In the early 1920s, the road Molenvliet Oost is extended north to finally reach the Nieuwpoortstraat (Jalan Pintu Besar Selatan) and converged with the Molenvliet West around Glodokplein. At the same period, the Molenvliet Oost was also extended south to Noordwijk (now Jalan Ir. H. Juanda).
Post-independence of Indonesia
Following the nationalization of names in Indonesia, Molenvliet West became Jalan Gajah Mada, while Molenvliet Oost was renamed Jalan Hayam Wuruk. Both were named after Majapahit rulers.
Jalan Gajah Mada and Jalan Hayam Wuruk were the sites of many festivals, such as the anniversary of Jakarta or the Independence Declaration festivities. Chinese celebrations were held on a boat over the Molenvliet up until the 1970s.
In the 1980s, Jakarta experienced an economic boom period with the increase in private investment. Despite the boom in the economy, the environment of Jakarta became increasingly neglected. In the Molenvliet Canal, the water frequently sediments and garbage accumulate. With the shift of the financial economy toward Jalan Jenderal Sudirman, Kota was abandoned and businesses along Jalan Hayam Wuruk and Jalan Gajah Mada suffered.
In 2004, the first line of the TransJakarta busway, corridor 1, was inaugurated. The corridor passes through Jalan Gajah Mada and Jalan Hayam Wuruk. The structure for the TransJakarta's Harmoni interchange is built over the Molenvliet obstructing the view of the canal.
See also
History of Jakarta
References
Cited works
Roads of Jakarta
Central Jakarta
|
```css
* {
box-sizing: border-box;
}
body {
font-family: 'Work Sans', sans-serif;
font-display: swap;
font-size: 18px;
color: #212121;
background-color: #fff;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
h1,
h2 {
font-family: 'Varela Round';
}
h1 {
font-size: 4rem;
margin-bottom: 2rem;
}
h2 {
font-size: 2rem;
margin: 2rem 0 1rem 0;
}
a {
text-decoration: none;
}
em {
font-style: italic;
}
.placeholder {
font-family: sans-serif;
text-align: justify;
pointer-events: none;
user-select: none;
max-width: 740px;
margin: 24px auto;
}
.placeholder__word {
color: #eee;
background: #eee;
border-radius: 3px;
letter-spacing: 0.2rem;
font-size: 0.9rem;
}
.header,
.footer {
overflow: hidden;
position: relative;
display: flex;
flex-direction: column;
padding: 92px 24px;
text-align: center;
color: #fff;
background: #00ab6c;
background: linear-gradient(to bottom, #00ab6c 0%, #13cc69 100%);
align-items: center;
justify-content: center;
}
.header::before {
content: '';
position: absolute;
top: calc(100% - 16px);
left: 0;
right: 0;
background-color: rgba(255, 255, 255, 0.3);
height: 92px;
transform: skewY(2deg);
}
.header::after {
content: '';
position: absolute;
top: calc(100% - 16px);
width: 100%;
background-color: rgba(255, 255, 255, 0.5);
height: 92px;
transform: skewY(-4deg);
}
.header__title {
font-size: 4rem;
margin-bottom: 2rem;
}
.header__subtitle {
font-size: 1.4rem;
line-height: 1.5rem;
letter-spacing: -0.02rem;
color: rgba(255, 255, 255, 0.95);
}
.header__info {
font-size: 1rem;
margin: 2rem;
}
.footer__copyright {
margin: 2rem 0;
color: rgba(255, 255, 255, 0.95);
}
.footer a {
color: #fff;
}
.container {
width: 100%;
max-width: 1000px;
margin: 48px auto;
padding: 16px;
}
.container p {
line-height: 1.6;
}
.text-center {
text-align: center;
}
button.button,
.button {
display: inline-block;
margin: 4px;
padding: 16px 32px;
transition: all 0.16s;
font: inherit;
cursor: pointer;
outline: none;
font-weight: bold;
border: none;
border-radius: 32px;
font-size: 1rem;
color: #fff;
background: #00ab6c;
background: linear-gradient(#13cc69 0%, #00ab6c 100%);
box-shadow: 0 2px 6px 0 rgba(0, 171, 108, 0.32);
transition: all 300ms;
}
.button:hover,
button.button:hover {
box-shadow: 0 2px 8px 0 rgba(0, 171, 108, 0.64);
}
.button.button--action {
background: #7c4dff;
background: linear-gradient(#7c4dff 0%, #6200ea 100%);
box-shadow: 0 2px 6px 0 rgba(98, 0, 234, 0.32);
}
.button.button--action:hover {
box-shadow: 0 2px 8px 0 rgba(98, 0, 234, 0.64);
}
.header .button,
.footer .button {
color: #fff;
border: 2px solid #fff;
background: transparent;
}
.header .button:hover,
.footer .button:hover {
color: #00ab6c;
background-color: #fff;
}
img {
max-width: 100%;
height: auto;
}
figure {
margin: 3rem -16px;
text-align: center;
}
figcaption {
font-size: 1rem;
font-weight: 300;
margin: 1rem;
text-align: center;
line-height: 1.5rem;
color: #666;
}
blockquote {
display: block;
padding: 24px;
color: #666;
border-radius: 4px;
background-color: #f7f7f7;
}
blockquote li {
padding-top: 16px;
}
blockquote li::before {
content: ' ';
}
pre {
font-family: Monaco, Consolas, Menlo, monospace;
font-size: 1rem;
padding: 24px;
margin: 2rem 0;
color: #fff;
border-radius: 4px;
background-color: #222;
}
@media (min-width: 1000px) {
.pull-left,
.pull-right {
width: 400px;
margin: 3rem;
}
.pull-right {
float: right;
margin-right: -16px;
}
.pull-left {
float: left;
margin-left: -16px;
}
}
```
|
```javascript
'use strict';
const { EMPTY_BUFFER } = require('./constants');
/**
* Merges an array of buffers into a new buffer.
*
* @param {Buffer[]} list The array of buffers to concat
* @param {Number} totalLength The total length of buffers in the list
* @return {Buffer} The resulting buffer
* @public
*/
function concat(list, totalLength) {
if (list.length === 0) return EMPTY_BUFFER;
if (list.length === 1) return list[0];
const target = Buffer.allocUnsafe(totalLength);
var offset = 0;
for (var i = 0; i < list.length; i++) {
const buf = list[i];
buf.copy(target, offset);
offset += buf.length;
}
return target;
}
/**
* Masks a buffer using the given mask.
*
* @param {Buffer} source The buffer to mask
* @param {Buffer} mask The mask to use
* @param {Buffer} output The buffer where to store the result
* @param {Number} offset The offset at which to start writing
* @param {Number} length The number of bytes to mask.
* @public
*/
function _mask(source, mask, output, offset, length) {
for (var i = 0; i < length; i++) {
output[offset + i] = source[i] ^ mask[i & 3];
}
}
/**
* Unmasks a buffer using the given mask.
*
* @param {Buffer} buffer The buffer to unmask
* @param {Buffer} mask The mask to use
* @public
*/
function _unmask(buffer, mask) {
// Required until path_to_url is resolved.
const length = buffer.length;
for (var i = 0; i < length; i++) {
buffer[i] ^= mask[i & 3];
}
}
/**
* Converts a buffer to an `ArrayBuffer`.
*
* @param {Buffer} buf The buffer to convert
* @return {ArrayBuffer} Converted buffer
* @public
*/
function toArrayBuffer(buf) {
if (buf.byteLength === buf.buffer.byteLength) {
return buf.buffer;
}
return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
}
/**
* Converts `data` to a `Buffer`.
*
* @param {*} data The data to convert
* @return {Buffer} The buffer
* @throws {TypeError}
* @public
*/
function toBuffer(data) {
toBuffer.readOnly = true;
if (Buffer.isBuffer(data)) return data;
var buf;
if (data instanceof ArrayBuffer) {
buf = Buffer.from(data);
} else if (ArrayBuffer.isView(data)) {
buf = viewToBuffer(data);
} else {
buf = Buffer.from(data);
toBuffer.readOnly = false;
}
return buf;
}
/**
* Converts an `ArrayBuffer` view into a buffer.
*
* @param {(DataView|TypedArray)} view The view to convert
* @return {Buffer} Converted view
* @private
*/
function viewToBuffer(view) {
const buf = Buffer.from(view.buffer);
if (view.byteLength !== view.buffer.byteLength) {
return buf.slice(view.byteOffset, view.byteOffset + view.byteLength);
}
return buf;
}
try {
const bufferUtil = require('bufferutil');
const bu = bufferUtil.BufferUtil || bufferUtil;
module.exports = {
concat,
mask(source, mask, output, offset, length) {
if (length < 48) _mask(source, mask, output, offset, length);
else bu.mask(source, mask, output, offset, length);
},
toArrayBuffer,
toBuffer,
unmask(buffer, mask) {
if (buffer.length < 32) _unmask(buffer, mask);
else bu.unmask(buffer, mask);
}
};
} catch (e) /* istanbul ignore next */ {
module.exports = {
concat,
mask: _mask,
toArrayBuffer,
toBuffer,
unmask: _unmask
};
}
```
|
```c++
#include <vespa/vespalib/testkit/test_kit.h>
#include <vespa/searchlib/common/indexmetainfo.h>
using search::IndexMetaInfo;
using Snap = IndexMetaInfo::Snapshot;
TEST("indexmetainfo_test") {
{ // load pregenerated file
IndexMetaInfo info(TEST_PATH(""));
EXPECT_TRUE(info.load());
ASSERT_TRUE(info.snapshots().size() == 4);
EXPECT_TRUE(info.snapshots()[0].valid);
EXPECT_TRUE(info.snapshots()[0].syncToken == 50);
EXPECT_TRUE(info.snapshots()[0].dirName == "foo");
EXPECT_TRUE(!info.snapshots()[1].valid);
EXPECT_TRUE(info.snapshots()[1].syncToken == 100);
EXPECT_TRUE(info.snapshots()[1].dirName == "bar");
EXPECT_TRUE(info.snapshots()[2].valid);
EXPECT_TRUE(info.snapshots()[2].syncToken == 200);
EXPECT_TRUE(info.snapshots()[2].dirName == "baz");
EXPECT_TRUE(!info.snapshots()[3].valid);
EXPECT_TRUE(info.snapshots()[3].syncToken == 500);
EXPECT_TRUE(info.snapshots()[3].dirName == "last");
{
Snap s = info.getBestSnapshot();
EXPECT_TRUE(s.valid);
EXPECT_TRUE(s.syncToken == 200);
EXPECT_TRUE(s.dirName == "baz");
}
{
Snap s = info.getSnapshot(100);
EXPECT_TRUE(!s.valid);
EXPECT_TRUE(s.syncToken == 100);
EXPECT_TRUE(s.dirName == "bar");
}
{
Snap s = info.getSnapshot(666);
EXPECT_TRUE(!s.valid);
EXPECT_TRUE(s.syncToken == 0);
EXPECT_TRUE(s.dirName == "");
}
{
EXPECT_TRUE(info.invalidateSnapshot(200));
Snap s = info.getBestSnapshot();
EXPECT_TRUE(s.valid);
EXPECT_TRUE(s.syncToken == 50);
EXPECT_TRUE(s.dirName == "foo");
}
{
EXPECT_TRUE(info.invalidateSnapshot(50));
Snap s = info.getBestSnapshot();
EXPECT_TRUE(!s.valid);
EXPECT_TRUE(s.syncToken == 0);
EXPECT_TRUE(s.dirName == "");
}
{
EXPECT_TRUE(info.validateSnapshot(500));
Snap s = info.getBestSnapshot();
EXPECT_TRUE(s.valid);
EXPECT_TRUE(s.syncToken == 500);
EXPECT_TRUE(s.dirName == "last");
}
{
EXPECT_TRUE(!info.invalidateSnapshot(666));
EXPECT_TRUE(!info.validateSnapshot(666));
}
{
info.clear();
EXPECT_TRUE(info.snapshots().size() == 0);
Snap s = info.getBestSnapshot();
EXPECT_TRUE(!s.valid);
EXPECT_TRUE(s.syncToken == 0);
EXPECT_TRUE(s.dirName == "");
}
}
{ // load file that does not exist
IndexMetaInfo info(".");
EXPECT_TRUE(!info.load("file-not-present.txt"));
}
{ // load files with errors should fail
IndexMetaInfo info(TEST_PATH(""));
EXPECT_TRUE(!info.load("bogus1.txt"));
EXPECT_TRUE(!info.load("bogus2.txt"));
EXPECT_TRUE(!info.load("bogus3.txt"));
EXPECT_TRUE(!info.load("bogus4.txt"));
EXPECT_TRUE(!info.load("bogus5.txt"));
EXPECT_TRUE(!info.load("bogus6.txt"));
EXPECT_TRUE(!info.load("bogus7.txt"));
EXPECT_TRUE(!info.load("bogus8.txt"));
EXPECT_TRUE(!info.load("bogus9.txt"));
EXPECT_TRUE(!info.load("bogus10.txt"));
}
{ // save/load/save/load/save/load test
std::string file("test-save.txt");
IndexMetaInfo a(".");
IndexMetaInfo b(".");
EXPECT_TRUE(a.addSnapshot(Snap(true, 50, "foo")));
EXPECT_TRUE(a.addSnapshot(Snap(false, 100, "bar")));
EXPECT_TRUE(!a.addSnapshot(Snap(false, 100, "bar")));
EXPECT_TRUE(a.save(file));
EXPECT_TRUE(b.load(file));
ASSERT_TRUE(b.snapshots().size() == 2);
EXPECT_TRUE(b.snapshots()[0] == Snap(true, 50, "foo"));
EXPECT_TRUE(b.snapshots()[1] == Snap(false, 100, "bar"));
EXPECT_TRUE(a.save(file));
EXPECT_TRUE(b.load(file));
ASSERT_TRUE(b.snapshots().size() == 2);
EXPECT_TRUE(b.snapshots()[0] == Snap(true, 50, "foo"));
EXPECT_TRUE(b.snapshots()[1] == Snap(false, 100, "bar"));
a.removeSnapshot(100);
EXPECT_TRUE(a.save(file));
EXPECT_TRUE(b.load(file));
ASSERT_TRUE(b.snapshots().size() == 1);
EXPECT_TRUE(b.snapshots()[0] == Snap(true, 50, "foo"));
}
}
TEST_MAIN() { TEST_RUN_ALL(); }
```
|
"Easy to Love" is a song recorded by Leo Sayer for the album Thunder in My Heart, and originally released as a single in 1977. It was co-written by Sayer with Albert Hammond. It was the second single from the LP, the follow-up to the title track.
"Easy to Love" reached number 36 in the United States and number 35 in Canada. It did best in New Zealand, where it spent 10 weeks in the Top 40 and peaked at number 19.
Reception
Cash Box magazine said "The second single from the Thunder in My Heart LP has a strong R&B/disco flavour to it and features the Sayer falsetto that has been so popular on his last two or three hits".
Personnel
Leo Sayer – vocals
Jeff Porcaro – drums
Ben Adkins – bass
Lee Ritenour – guitars
Ray Parker – guitars
Michael Omartian – piano
Bobbye Hall – percussion
David Paich – string section arranger and conductor
Chart history
Cover versions
The song was re-recorded in Spanish by singer Lani Hall as "Es Fácil Amar," and appeared as the title track of her 1985 Latin Grammy-winning album of the same name, produced by Hammond.
A French language version recorded in 1978 by Georges Thurston would later gain success in the early 1990s when 800,000 copies were sold in Europe.
Dutch musician Peter Hollestelle wrote new words to the composition of the song, and his band "Cashmere" had a Dutch Top Ten hit single in 1979 with its resulting song, "Love's What I Want".
An untranslated (English) version was recorded by Ukrainian vocal-instrumental group "Чарівні Гітари" ("Magic Guitars") and released in 1980.
References
External links
Leo Sayer songs
1977 songs
1977 singles
Warner Records singles
Songs written by Albert Hammond
Songs written by Leo Sayer
Song recordings produced by Richard Perry
|
Hylodes fredi is a species of frog in the family Hylodidae, endemic to the island of Ilha Grande, Brazil.
Description and biology
The tadpoles of Hylodes fredi whose limb buds have not yet formed reach a maximum size of 75.3 millimeters. Their color ranges between gray and brown; additionally, brown splotches can be seen on the body. The abdomen is slightly transparent, and the caudal fins are opaque. Adult males have been observed in calling activity throughout almost the whole year.
Original description
References
Hylodes
Endemic fauna of Brazil
Amphibians of Brazil
Amphibians described in 2007
|
```java
/*
This file is part of the iText (R) project.
Authors: Apryse Software.
This program is offered under a commercial and under the AGPL license.
For commercial licensing, contact us at path_to_url For AGPL licensing, see below.
AGPL licensing:
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
along with this program. If not, see <path_to_url
*/
package com.itextpdf.layout.renderer;
import com.itextpdf.kernel.colors.ColorConstants;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.utils.CompareTool;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.borders.SolidBorder;
import com.itextpdf.layout.element.Paragraph;
import com.itextpdf.layout.element.Text;
import com.itextpdf.layout.properties.Property;
import com.itextpdf.layout.properties.UnitValue;
import com.itextpdf.test.ExtendedITextTest;
import java.io.IOException;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.Tag;
@Tag("IntegrationTest")
public class TextRendererPositioningTest extends ExtendedITextTest {
public static final String DESTINATION_FOLDER = "./target/test/com/itextpdf/layout/TextRendererPositioningTest/";
public static final String SOURCE_FOLDER = "./src/test/resources/com/itextpdf/layout/TextRendererPositioningTest/";
@BeforeAll
public static void beforeClass() {
createDestinationFolder(DESTINATION_FOLDER);
}
@Test
public void marginTopTest() throws IOException, InterruptedException {
String outFileName = DESTINATION_FOLDER + "marginTopTest.pdf";
String cmpFileName = SOURCE_FOLDER + "cmp_marginTopTest.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document doc = new Document(pdfDocument);
Text text1 = new Text("Text1");
text1.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text1.setProperty(Property.MARGIN_TOP, UnitValue.createPointValue(20));
Text text2 = new Text("Text2");
text2.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
Paragraph paragraph = new Paragraph().setBorder(new SolidBorder(1));
paragraph.add(text1);
paragraph.add(text2);
doc.add(paragraph);
doc.close();
Assertions.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, DESTINATION_FOLDER, "diff"));
}
@Test
public void marginBottomTest() throws IOException, InterruptedException {
String outFileName = DESTINATION_FOLDER + "marginBottomTest.pdf";
String cmpFileName = SOURCE_FOLDER + "cmp_marginBottomTest.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document doc = new Document(pdfDocument);
Text text1 = new Text("Text1");
text1.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text1.setProperty(Property.MARGIN_BOTTOM, UnitValue.createPointValue(40));
Text text2 = new Text("Text2");
text2.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
Paragraph paragraph = new Paragraph().setBorder(new SolidBorder(1));
paragraph.add(text1);
paragraph.add(text2);
doc.add(paragraph);
doc.close();
Assertions.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, DESTINATION_FOLDER, "diff"));
}
@Test
public void marginTopBottomTest() throws IOException, InterruptedException {
String outFileName = DESTINATION_FOLDER + "marginTopBottomTest.pdf";
String cmpFileName = SOURCE_FOLDER + "cmp_marginTopBottomTest.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document doc = new Document(pdfDocument);
Text text1 = new Text("Text1");
text1.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text1.setProperty(Property.MARGIN_TOP, UnitValue.createPointValue(20));
text1.setProperty(Property.MARGIN_BOTTOM, UnitValue.createPointValue(40));
Text text2 = new Text("Text2");
text2.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
Paragraph paragraph = new Paragraph().setBorder(new SolidBorder(1));
paragraph.add(text1);
paragraph.add(text2);
doc.add(paragraph);
doc.close();
Assertions.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, DESTINATION_FOLDER, "diff"));
}
@Test
public void diffFontSizeTest() throws IOException, InterruptedException {
String outFileName = DESTINATION_FOLDER + "diffFontSizeTest.pdf";
String cmpFileName = SOURCE_FOLDER + "cmp_diffFontSizeTest.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document doc = new Document(pdfDocument);
Text text1 = new Text("Text1");
text1.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text1.setFontSize(50);
Text text2 = new Text("Text2");
text2.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text2.setFontSize(80);
Paragraph paragraph = new Paragraph().setBorder(new SolidBorder(1));
paragraph.add(text1);
paragraph.add(text2);
doc.add(paragraph);
doc.close();
Assertions.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, DESTINATION_FOLDER, "diff"));
}
@Test
public void marginAndPaddingTest() throws IOException, InterruptedException {
String outFileName = DESTINATION_FOLDER + "marginAndPaddingTest.pdf";
String cmpFileName = SOURCE_FOLDER + "cmp_marginAndPaddingTest.pdf";
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
Document doc = new Document(pdfDocument);
Text text1 = new Text("Text1");
text1.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
text1.setProperty(Property.MARGIN_TOP, UnitValue.createPointValue(10));
text1.setProperty(Property.MARGIN_BOTTOM, UnitValue.createPointValue(10));
text1.setProperty(Property.PADDING_BOTTOM, UnitValue.createPointValue(20));
text1.setProperty(Property.PADDING_TOP, UnitValue.createPointValue(20));
Text text2 = new Text("Text2");
text2.setBorder(new SolidBorder(ColorConstants.BLUE, 1));
Paragraph paragraph = new Paragraph().setBorder(new SolidBorder(1));
paragraph.add(text1);
paragraph.add(text2);
doc.add(paragraph);
doc.close();
Assertions.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, DESTINATION_FOLDER, "diff"));
}
}
```
|
```yaml
name: DropPoint
description:
Make drag-and-drop easier using DropPoint. Drag content without having to open
side-by-side windows.
website: 'path_to_url
repository: 'path_to_url
keywords:
- productivity
- utilities
- dropover alternative
- dropover for windows
- dropover for linux
- open source
category: 'Productivity'
```
|
Dendropsophus luteoocellatus is a species of frog in the family Hylidae.
It is endemic to Venezuela.
Its natural habitats are subtropical or tropical moist lowland forests, subtropical or tropical moist montane forests, freshwater marshes, pastureland, rural gardens, heavily degraded former forest, urban sewer systems and ponds.
References
luteoocellatus
Frogs of South America
Amphibians of Venezuela
Endemic fauna of Venezuela
Amphibians described in 1927
Taxa named by Jean Roux
Taxonomy articles created by Polbot
|
The 2019 AFL Women's season was the third season of the AFL Women's competition, the highest-level senior Australian rules football competition in Australia.
The season featured ten clubs, with and joining the competition. It ran from 2 February until 31 March, and comprised a 7-game home-and-away season followed by a finals series featuring four clubs.
The premiership was won by for the second time, after it defeated by 45 points in the AFL Women's Grand Final.
Reforms
New teams
Two new teams, and , joined the competition, bringing the total number of teams to ten. The North Melbourne team has a strong Tasmanian focus; some players are based in Tasmania and some home games were held in the state. The introduction of the new teams is the first stage of a two-year expansion that will take the league to fourteen teams for the 2020 season.
Conferences
Despite the introduction of new teams, the league retained a seven-round home-and-away season. This was achieved by splitting the competition into two conferences. Each team play four games against their fellow conference members and three "cross-over" matches against teams from the other conference. Conference membership was based on the final ladder positions of the 2018 season.
The finals series was expanded to include preliminary finals for the first time; the two teams who finish the highest in each conference at the end of the home-and-away season qualified for the preliminary finals. The winners of these games played in the AFL Women's Grand Final. The make-up of the conferences, along with the fixture, was released in October 2018.
The conference system proved controversial as the teams in Conference A consistently outplayed the teams on Conference B, resulting in the first, second, fifth and sixth best overall teams making the finals.
Rule changes
There were 11 rule changes brought in for the 2019 AFLW season (three AFLW specific).
Boundary throw ins brought in by 10m (AFLW only)
Last touch rule only applies outside of the 50s (AFLW only)
Runners allowed on the field during live play (AFLW only)
5-6-5 formation mandated at centre bounces
The woman on the mark must stand further back after kick ins after a behind (from 5m to 10m), and the player doesn't need to kick to herself before playing on
After defenders have a free kick within nine metres of their goal, the woman on the mark stands in line with the top of the goal square
Players can't set up behind the umpire at centre bounces
Play on is allowed for 50m penalties
Players can kick across their body after taking a mark after the siren.
A player can place her hands on the back of her opponent to protect marking space (see Push in the back)
A ruck who takes direct possession of the ball from a bounce, throw-up or boundary throw-in will no longer be regarded as having had prior opportunity.
Premiership season
The full fixture and make-up of the conferences was released on 26 October 2018.
All starting times are local.
Round 1
Round 2
Round 3
Round 4
Round 5
Round 6
Round 7
Ladders
Ladder progression
Numbers highlighted in green indicates the team finished the round inside the top 2.
Conference A
Conference B
Win/Loss table
Bold – Home game
X – Bye
Opponent for round listed above margin
This table can be sorted by margin, winners are represented in the first half of each column, and losers are represented in the second half of each column once sorted
Finals series
Preliminary finals
Grand final
Attendances
By club
By ground
Awards
The league best and fairest was awarded to Erin Phillips.
The leading goalkicker was awarded to Stevie-Lee Thompson of , who kicked thirteen goals during the home and away season.
The Rising Star was awarded to Madison Prespakis.
The best on ground in the AFL Women's Grand Final was awarded to Erin Phillips.
The goal of the year was awarded to Ashley Sharp.
The mark of the year was awarded to Tayla Harris.
AFLW Players Association awards
The most valuable player was awarded to Erin Phillips.
The most courageous player was awarded to Chelsea Randall.
The best captain was awarded to Brianna Davey.
The best first year player was awarded to Madison Prespakis.
The AFLW Coaches Association champion player of the year was awarded to Erin Phillips.
Erin Phillips was named the captain of the 2019 AFL Women's All-Australian team. The premiers had five players selected, with nine of the league's 10 clubs represented in the final team by at least one player.
were the lowest ranked team overall, and thus could be said to have "won" the wooden spoon, though this is a contestable claim given the use of conferences.
Best and fairest
AFLW leading goalkicker
Numbers highlighted in blue indicates the player led the season's goal kicking tally at the end of that round.
Source: https://www.afl.com.au/womens/matches/stats
Coach changes
Club leadership
See also
2018 AFL Women's draft
References
External links
Official AFL Women's website
AFL Women's seasons
2019 in Australian rules football
|
```javascript
Using the double tilde `~~`
Infinity
Avoid using `with`
Detect an error type
Detect **DO NOT TRACK** status
```
|
```objective-c
//===- MsgPackReader.h - Simple MsgPack reader ------------------*- C++ -*-===//
//
// See path_to_url for license information.
//
//===your_sha256_hash------===//
///
/// \file
/// This is a MessagePack reader.
///
/// See path_to_url for the full
/// standard.
///
/// Typical usage:
/// \code
/// StringRef input = GetInput();
/// msgpack::Reader MPReader(input);
/// msgpack::Object Obj;
///
/// while (MPReader.read(Obj)) {
/// switch (Obj.Kind) {
/// case msgpack::Type::Int:
// // Use Obj.Int
/// break;
/// // ...
/// }
/// }
/// \endcode
///
//===your_sha256_hash------===//
#ifndef LLVM_BINARYFORMAT_MSGPACKREADER_H
#define LLVM_BINARYFORMAT_MSGPACKREADER_H
#include "llvm/Support/Error.h"
#include "llvm/Support/MemoryBufferRef.h"
#include <cstdint>
namespace llvm {
namespace msgpack {
/// MessagePack types as defined in the standard, with the exception of Integer
/// being divided into a signed Int and unsigned UInt variant in order to map
/// directly to C++ types.
///
/// The types map onto corresponding union members of the \c Object struct.
enum class Type : uint8_t {
Int,
UInt,
Nil,
Boolean,
Float,
String,
Binary,
Array,
Map,
Extension,
Empty, // Used by MsgPackDocument to represent an empty node
};
/// Extension types are composed of a user-defined type ID and an uninterpreted
/// sequence of bytes.
struct ExtensionType {
/// User-defined extension type.
int8_t Type;
/// Raw bytes of the extension object.
StringRef Bytes;
};
/// MessagePack object, represented as a tagged union of C++ types.
///
/// All types except \c Type::Nil (which has only one value, and so is
/// completely represented by the \c Kind itself) map to a exactly one union
/// member.
struct Object {
Type Kind;
union {
/// Value for \c Type::Int.
int64_t Int;
/// Value for \c Type::Uint.
uint64_t UInt;
/// Value for \c Type::Boolean.
bool Bool;
/// Value for \c Type::Float.
double Float;
/// Value for \c Type::String and \c Type::Binary.
StringRef Raw;
/// Value for \c Type::Array and \c Type::Map.
size_t Length;
/// Value for \c Type::Extension.
ExtensionType Extension;
};
Object() : Kind(Type::Int), Int(0) {}
};
/// Reads MessagePack objects from memory, one at a time.
class Reader {
public:
/// Construct a reader, keeping a reference to the \p InputBuffer.
Reader(MemoryBufferRef InputBuffer);
/// Construct a reader, keeping a reference to the \p Input.
Reader(StringRef Input);
Reader(const Reader &) = delete;
Reader &operator=(const Reader &) = delete;
/// Read one object from the input buffer, advancing past it.
///
/// The \p Obj is updated with the kind of the object read, and the
/// corresponding union member is updated.
///
/// For the collection objects (Array and Map), only the length is read, and
/// the caller must make and additional \c N calls (in the case of Array) or
/// \c N*2 calls (in the case of Map) to \c Read to retrieve the collection
/// elements.
///
/// \param [out] Obj filled with next object on success.
///
/// \returns true when object successfully read, false when at end of
/// input (and so \p Obj was not updated), otherwise an error.
Expected<bool> read(Object &Obj);
private:
MemoryBufferRef InputBuffer;
StringRef::iterator Current;
StringRef::iterator End;
size_t remainingSpace() {
// The rest of the code maintains the invariant that End >= Current, so
// that this cast is always defined behavior.
return static_cast<size_t>(End - Current);
}
template <class T> Expected<bool> readRaw(Object &Obj);
template <class T> Expected<bool> readInt(Object &Obj);
template <class T> Expected<bool> readUInt(Object &Obj);
template <class T> Expected<bool> readLength(Object &Obj);
template <class T> Expected<bool> readExt(Object &Obj);
Expected<bool> createRaw(Object &Obj, uint32_t Size);
Expected<bool> createExt(Object &Obj, uint32_t Size);
};
} // end namespace msgpack
} // end namespace llvm
#endif // LLVM_BINARYFORMAT_MSGPACKREADER_H
```
|
```smalltalk
using System;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Linq;
using System.Net;
using System.Text;
namespace LaserGRBL
{
public class Telegram
{
public static void NotifyEvent(string message)
{
if (Settings.GetObject("TelegramNotification.Enabled", false))
NotifyEvent(Tools.Protector.Decrypt(Settings.GetObject("TelegramNotification.Code", ""), ""), message);
}
public static void NotifyEvent(string usercode, string message)
{
if (UrlManager.TelegramHandler is null)
return;
if (UrlManager.TelegramServiceKey is null)
return;
if (string.IsNullOrEmpty(usercode) || usercode.Trim().Length != 10)
return;
usercode = usercode.Trim();
NameValueCollection postData = new NameValueCollection()
{
{ "servicekey", UrlManager.TelegramServiceKey },
{ "id", usercode },
{ "message", message },
{ "guid", UsageStats.GetID() },
};
System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(InternalNotifyEvent), postData);
}
private static void InternalNotifyEvent(object data)
{
try
{
NameValueCollection postData = data as NameValueCollection;
using (MyWebClient client = new MyWebClient())
{
// client.UploadValues returns page's source as byte array (byte[]) so it must be transformed into a string
string json = System.Text.Encoding.UTF8.GetString(client.UploadValues(UrlManager.TelegramHandler, postData));
//UsageStatsRV RV = Tools.JSONParser.FromJson<UsageStatsRV>(json);
//mManager.SetMessages(RV.Messages);
//return (RV.Success);
}
}
catch (Exception ex) { }
}
private class MyWebClient : WebClient
{
protected override WebRequest GetWebRequest(Uri uri)
{
WebRequest w = base.GetWebRequest(uri);
w.Timeout = 5000; //milliseconds
return w;
}
}
}
}
```
|
```python
# flake8: noqa: F401
r"""Quantized Reference Modules.
This module is in the process of migration to
`torch/ao/nn/quantized/reference`, and is kept here for
compatibility while the migration process is ongoing.
If you are adding a new entry/functionality, please, add it to the
appropriate file under the `torch/ao/nn/quantized/reference`,
while adding an import statement here.
"""
from torch.ao.nn.quantized.reference.modules.utils import (
_get_weight_qparam_keys,
_quantize_and_dequantize_weight,
_quantize_weight,
_save_weight_qparams,
ReferenceQuantizedModule,
)
```
|
```python
# coding: utf-8
"""`OSFS` opener definition.
"""
from __future__ import absolute_import, print_function, unicode_literals
import typing
from .base import Opener
from .registry import registry
if typing.TYPE_CHECKING:
from typing import Text
from ..osfs import OSFS # noqa: F401
from .parse import ParseResult
@registry.install
class OSFSOpener(Opener):
"""`OSFS` opener."""
protocols = ["file", "osfs"]
def open_fs(
self,
fs_url, # type: Text
parse_result, # type: ParseResult
writeable, # type: bool
create, # type: bool
cwd, # type: Text
):
# type: (...) -> OSFS
from os.path import abspath, expanduser, join, normpath
from ..osfs import OSFS
_path = abspath(join(cwd, expanduser(parse_result.resource)))
path = normpath(_path)
osfs = OSFS(path, create=create)
return osfs
```
|
```html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta http-equiv="origin-trial"
content="AhQB+uNRI7lww30oPK+0ZcGotIvuoHJL+NkkWOhqDdooY6+xnuiYmZli2SwlH1vkrKdB5WxMpsv5KRc/your_sha256_hashyour_sha256_hashIjoxNzA5ODU1OTk5LCJpc1N1YmRvbWFpbiI6dHJ1ZX0=">
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Jessica demo</title>
<link rel="stylesheet" href="./demo.css">
<script src="./vconsole.js"></script>
<script src="./js/jessibuca-pro-demo.js"></script>
<style>
.container-shell:before {
content: "jessibuca pro demo player";
}
</style>
</head>
<body class="page">
<div class="root">
<div class="container-shell">
<div id="container"></div>
<div class="input">
<div>
<span id="mseSupport264" style="color: green;display: none">MSE H264</span>
<span id="mseSupport" style="color: green;display: none">MSE H265</span>
<span id="mseNotSupport264" style="color: red;display: none">MSE H264</span>
<span id="mseNotSupport"
style="color: red;display: none">MSE H265,wasm</span>
</div>
</div>
<div class="input">
<div>
<span id="wcsSupport264" style="color: green;display: none">Webcodecs H264</span>
<span id="wcsSupport" style="color: green;display: none">Webcodecs H265</span>
<span id="wcsNotSupport264"
style="color: red;display: none">Webcodecs H264(https/localhost)</span>
<span id="wcsNotSupport" style="color: red;display: none">Webcodecs H265(https/localhost),wasm</span>
</div>
</div>
<div class="input">
<div>
<span id="wasmSupport" style="color: green;display: none">WASM</span>
<span id="simdSupport" style="color: green;display: none">WASM SIMD</span>
<span id="simdMtSupport" style="color: green;display: none">WASM WASM(SIMD) </span>
<span id="wasmNotSupport" style="color: red;display: none">WASM</span>
<span id="simdNotSupport"
style="color: red;display: none">WASM SIMD,wasm</span>
<span id="simdMtNotSupport" style="color: red;display: none">WASM WASM(SIMD) </span>
</div>
</div>
<div class="input">
<div><input
disabled
type="checkbox"
checked
id="useMSE"
/><span>MediaSource</span>
<input
disabled
type="checkbox"
id="useWCS"
/><span>Webcodec</span>
<input
disabled
type="checkbox"
id="useWASM"
/><span>WASM</span>
<input
disabled
type="checkbox"
id="useSIMD"
/><span>WASM(SIMD)</span>
<input
disabled
type="checkbox"
id="useSIMDMThreading"
onclick="replay()"
/><span>WASM,WASM(SIMD)</span>
</div>
</div>
<div class="input">
<span></span>
<select id="renderDom" onchange="replay()">
<option value="video" selected>video</option>
<option value="canvas">canvas</option>
</select>
<span>canvas</span>
<select disabled id="isUseWebGPU" onchange="replay()">
<option value="webgl" selected>webgl</option>
<option value="webgpu">webgpu</option>
</select>
<span id="supportWebgpu"></span>
</div>
<div class="input">
<div>
<span></span>
<input placeholder="" type="text" id="videoBuffer" style="width: 50px" value="0.2">
<span>()</span>
<input placeholder="" type="text" id="videoBufferDelay" style="width: 50px" value="1">
<button id="replay"></button>
</div>
</div>
<div class="input">
<div>
<input
disabled
onclick="replay()"
type="checkbox"
id="demuxUseWorker"
/><span>(MediaSourceWebcodec)worker</span>
<input
disabled
onclick="replay()"
type="checkbox"
id="mseDecoderUseWorker"
/><span>(MediaSource)worker</span>
</div>
</div>
<div class="input">
<div>
<input
checked
onclick="replay()"
type="checkbox"
id="replayUseLastFrameShow"
/><span>-></span>
<input
onclick="replay()"
type="checkbox"
id="replayShowLoadingIcon"
/><span>->loading</span>
</div>
</div>
<div class="input">
<div>URL</div>
<input
autocomplete="on"
id="playUrl"
value=""
/>
<button id="play"></button>
<button id="pause" style="display: none"></button>
</div>
<div class="input" style="line-height: 30px">
<button id="destroy"></button>
<span class="fps-inner"></span>
</div>
</div>
</div>
<script src="./demo.js"></script>
<script>
var $player = document.getElementById('play');
var $pause = document.getElementById('pause');
var $playHref = document.getElementById('playUrl');
var $container = document.getElementById('container');
var $destroy = document.getElementById('destroy');
var $fps = document.querySelector('.fps-inner');
var $useMSE = document.getElementById('useMSE');
var $useSIMD = document.getElementById('useSIMD');
var $useWASM = document.getElementById('useWASM');
var $useWCS = document.getElementById('useWCS');
var $videoBuffer = document.getElementById('videoBuffer');
var $videoBufferDelay = document.getElementById('videoBufferDelay');
var $replay = document.getElementById('replay');
var $renderDom = document.getElementById('renderDom');
var $isUseWebGPU = document.getElementById('isUseWebGPU');
var $demuxUseWorker = document.getElementById('demuxUseWorker');
var $useSIMDMThreading = document.getElementById('useSIMDMThreading');
var $replayUseLastFrameShow = document.getElementById('replayUseLastFrameShow');
var $replayShowLoadingIcon = document.getElementById('replayShowLoadingIcon');
var $mseDecoderUseWorker = document.getElementById('mseDecoderUseWorker');
var showOperateBtns = true; //
var forceNoOffscreen = true; //
var jessibuca = null;
function create(options) {
options = options || {}
jessibuca = new JessibucaPro({
container: $container,
videoBuffer: Number($videoBuffer.value), //
videoBufferDelay: Number($videoBufferDelay.value), // 1000s
decoder: './js/decoder-pro.js',
isResize: false,
text: "",
loadingText: "",
debug: true,
debugLevel: "debug",
useMSE: $useMSE.checked === true,
decoderErrorAutoWasm: false,
useSIMD: $useSIMD.checked === true,
useWCS: $useWCS.checked === true,
useMThreading: $useSIMDMThreading.checked === true,
showBandwidth: showOperateBtns, //
showPerformance: showOperateBtns, //
operateBtns: {
fullscreen: showOperateBtns,
screenshot: showOperateBtns,
play: showOperateBtns,
audio: showOperateBtns,
ptz: showOperateBtns,
quality: showOperateBtns,
performance: showOperateBtns,
},
timeout: 10,
audioEngine: "worklet",
qualityConfig: ['', '', '', '4K', '8K'],
forceNoOffscreen: forceNoOffscreen,
isNotMute: false,
heartTimeout: 10,
ptzClickType: 'mouseDownAndUp',
ptzZoomShow: true,
ptzMoreArrowShow: true,
ptzApertureShow: true,
ptzFocusShow: true,
useCanvasRender: $renderDom.value === 'canvas',
useWebGPU: $isUseWebGPU.value === 'webgpu',
demuxUseWorker: $demuxUseWorker.checked === true,
controlHtml: '<div> <span style="color: red">test</span></div>',
// audioEngine:"worklet",
// isFlv: true
pauseAndNextPlayUseLastFrameShow: $replayUseLastFrameShow.checked === true,
heartTimeoutReplayUseLastFrameShow: $replayUseLastFrameShow.checked === true,
replayUseLastFrameShow: $replayUseLastFrameShow.checked === true, //
replayShowLoadingIcon: $replayShowLoadingIcon.checked === true,// loading
mseDecoderUseWorker:$mseDecoderUseWorker.checked === true,
},);
jessibuca.on('stats', (stats) => {
// console.log('stats', stats);
$fps.textContent = `FPS: ${stats.fps} DFPS: ${stats.dfps}`
})
jessibuca.on(JessibucaPro.EVENTS.playFailedAndPaused, (error) => {
jessibuca.showErrorMessageTips('' + error);
})
jessibuca.on(JessibucaPro.EVENTS.crashLog,(log)=>{
console.error('crashLog',log)
})
$player.style.display = 'inline-block';
$pause.style.display = 'none';
$destroy.style.display = 'none';
$fps.textContent = '';
}
create();
function play() {
var href = $playHref.value;
if (href) {
jessibuca.play(href);
$player.style.display = 'none';
$pause.style.display = 'inline-block';
$destroy.style.display = 'inline-block';
} else {
jessibuca.showErrorMessageTips('');
}
}
function replay(options) {
if (jessibuca) {
jessibuca.destroy().then(() => {
create(options);
play();
});
} else {
create();
play();
}
}
$replay.addEventListener('click', function () {
replay();
})
$player.addEventListener('click', function () {
play();
}, false)
$pause.addEventListener('click', function () {
$player.style.display = 'inline-block';
$pause.style.display = 'none';
$fps.textContent = '';
jessibuca.pause();
})
$destroy.addEventListener('click', function () {
if (jessibuca) {
jessibuca.destroy().then(() => {
create();
});
} else {
create();
}
})
$useMSE.addEventListener('click', function () {
const checked = $useMSE.checked;
if (checked) {
$useSIMD.checked = false
$useWCS.checked = false
$useWASM.checked = false
}
replay();
})
$useSIMD.addEventListener('click', function () {
const checked = $useSIMD.checked;
if (checked) {
$useMSE.checked = false
$useWCS.checked = false
$useWASM.checked = false
}
replay();
})
$useWCS.addEventListener('click', function () {
const checked = $useWCS.checked;
if (checked) {
$useMSE.checked = false
$useSIMD.checked = false
$useWASM.checked = false
}
replay();
})
$useWASM.addEventListener('click', function () {
const checked = $useWASM.checked;
if (checked) {
$useMSE.checked = false
$useSIMD.checked = false
$useWCS.checked = false
}
replay();
})
</script>
</body>
</html>
```
|
Alsónána () is a village in Tolna County, Hungary. Residents are Magyars, with minority of Serbs.
References
Populated places in Tolna County
Serb communities in Hungary
|
```go
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated by generate-protos. DO NOT EDIT.
package fieldnum
// Field numbers for google.protobuf.Timestamp.
const (
Timestamp_Seconds = 1 // optional int64
Timestamp_Nanos = 2 // optional int32
)
```
|
```java
package tech.tablesaw.columns.times;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static tech.tablesaw.api.TimeColumn.create;
import static tech.tablesaw.columns.temporal.fillers.TemporalRangeIterable.range;
import java.time.LocalTime;
import java.time.temporal.ChronoUnit;
import org.junit.jupiter.api.Test;
public class TimeFillersTest {
private void assertContentEquals(Iterable<LocalTime> times, LocalTime... expected) {
int num = 0;
for (LocalTime value : times) {
assertEquals(expected[num], value);
num++;
}
assertEquals(expected.length, num);
}
@Test
public void testFromToBy() {
assertContentEquals(
create("times", new LocalTime[5])
.fillWith(
range(
LocalTime.of(12, 30), // hour, minute
LocalTime.of(21, 30),
2,
ChronoUnit.HOURS)),
LocalTime.of(12, 30), // year, month, day, hour, minute
LocalTime.of(14, 30),
LocalTime.of(16, 30),
LocalTime.of(18, 30),
LocalTime.of(20, 30));
}
}
```
|
```html
(See accompanying file LICENSE_1_0.txt or copy at
path_to_url
-->
<!--
or a copy at path_to_url
Some files are held under additional license.
Please see "path_to_url" for more information.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"path_to_url">
<html xmlns="path_to_url" lang="en" xml:lang="en">
<head>
<TITLE>Generic Image Library: bit_aligned_pixel_reference</TITLE>
<META HTTP-EQUIV="content-type" CONTENT="text/html;charset=ISO-8859-1"/>
<LINK TYPE="text/css" REL="stylesheet" HREF="adobe_source.css"/>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="0" style='width: 100%; margin: 0; padding: 0'><tr>
<td width="100%" valign="top" style='padding-left: 10px; padding-right: 10px; padding-bottom: 10px'>
<div class="qindex"><a class="qindex" href="index.html">Modules</a>
| <a class="qindex" href="classes.html">Alphabetical List</a>
| <a class="qindex" href="annotated.html">Class List</a>
| <a class="qindex" href="dirs.html">Directories</a>
| <a class="qindex" href="files.html">File List</a>
| <a class="qindex" href="../index.html">GIL Home Page</a>
</div>
<!-- End Header -->
<!-- Generated by Doxygen 1.5.6 -->
<div class="contents">
<h1>bit_aligned_pixel_reference<br>
<small>
[<a class="el" href="g_i_l_0206.html">Models</a>]</small>
</h1><hr><a name="_details"></a><h2>Detailed Description</h2>
A heterogeneous <a class="el" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a> reference used to represent non-byte-aligned pixels. Models <a class="el" href="g_i_l_0346.html" title="Pixel concept - A color base whose elements are channels.">PixelConcept</a>.
<p>
Example: <div class="fragment"><pre class="fragment"><span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> data=0;
<span class="comment">// A mutable reference to a 6-bit BGR pixel in "123" format (1 bit for red, 2 bits for green, 3 bits for blue)</span>
<span class="keyword">typedef</span> <span class="keyword">const</span> bit_aligned_pixel_reference<unsigned char, mpl::vector3_c<int,1,2,3>, rgb_layout_t, <span class="keyword">true</span>> rgb123_ref_t;
<span class="comment">// create the pixel reference at bit offset 2</span>
<span class="comment">// (i.e. red = [2], green = [3,4], blue = [5,6,7] bits)</span>
rgb123_ref_t ref(&data, 2);
<a class="code" href="g_i_l_0106.html#gab1205781ba628ca806c47a51f40f5f6" title="Mutable accessor to the element associated with a given color name.">get_color</a>(ref, red_t()) = 1;
assert(data == 0x04);
<a class="code" href="g_i_l_0106.html#gab1205781ba628ca806c47a51f40f5f6" title="Mutable accessor to the element associated with a given color name.">get_color</a>(ref, green_t()) = 3;
assert(data == 0x1C);
<a class="code" href="g_i_l_0106.html#gab1205781ba628ca806c47a51f40f5f6" title="Mutable accessor to the element associated with a given color name.">get_color</a>(ref, blue_t()) = 7;
assert(data == 0xFC);
</pre></div>
<p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct </td><td class="memItemRight" valign="bottom"><a class="el" href="g_i_l_0403.html">bit_aligned_pixel_reference</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Heterogeneous <a class="el" href="g_i_l_0599.html" title="Represents a pixel value (a container of channels). Models: HomogeneousColorBaseValueConcept...">pixel</a> reference corresponding to non-byte-aligned bit range. Models <a class="el" href="g_i_l_0274.html" title="A color base is a container of color elements (such as channels, channel references...">ColorBaseConcept</a>, <a class="el" href="g_i_l_0346.html" title="Pixel concept - A color base whose elements are channels.">PixelConcept</a>, <a class="el" href="g_i_l_0344.html" title="Concept for all pixel-based GIL constructs, such as pixels, iterators, locators,...">PixelBasedConcept</a>. <a href="g_i_l_0403.html#_details">More...</a><br></td></tr>
</table>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Sat May 2 13:50:16 2009 for Generic Image Library by
<a href="path_to_url">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.6 </small></address>
</body>
</html>
```
|
```c++
#include "asfbx_skin_context.h"
#include "asfbx_context.h"
AsFbxSkinContext::AsFbxSkinContext(AsFbxContext* pContext, FbxNode* pFrameNode)
: pSkin(nullptr)
{
if (pContext != nullptr && pContext->pScene != nullptr)
{
pSkin = FbxSkin::Create(pContext->pScene, "");
}
if (pFrameNode != nullptr)
{
lMeshMatrix = pFrameNode->EvaluateGlobalTransform();
}
}
```
|
```yaml
#
# 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.
#
name: pg_statio_sys_sequences
columns:
relid:
caseSensitive: true
dataType: -5
generated: false
name: relid
primaryKey: false
unsigned: false
visible: true
schemaname:
caseSensitive: true
dataType: 12
generated: false
name: schemaname
primaryKey: false
unsigned: false
visible: true
relname:
caseSensitive: true
dataType: 12
generated: false
name: relname
primaryKey: false
unsigned: false
visible: true
blks_read:
caseSensitive: true
dataType: -5
generated: false
name: blks_read
primaryKey: false
unsigned: false
visible: true
blks_hit:
caseSensitive: true
dataType: -5
generated: false
name: blks_hit
primaryKey: false
unsigned: false
visible: true
```
|
Ryan Hampton may refer to:
Ryan Hampton (racing driver)
Ryan Hampton (writer)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.