text
stringlengths
1
22.8M
```objective-c /* * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef DistributedNodes_h #define DistributedNodes_h #include "core/dom/Node.h" #include "wtf/HashMap.h" #include "wtf/Vector.h" namespace blink { class DistributedNodes final { DISALLOW_ALLOCATION(); public: DistributedNodes() { m_nodes.reserveInitialCapacity(32); } PassRefPtrWillBeRawPtr<Node> first() const { return m_nodes.first(); } PassRefPtrWillBeRawPtr<Node> last() const { return m_nodes.last(); } PassRefPtrWillBeRawPtr<Node> at(size_t index) const { return m_nodes.at(index); } size_t size() const { return m_nodes.size(); } bool isEmpty() const { return m_nodes.isEmpty(); } void append(PassRefPtrWillBeRawPtr<Node>); void clear() { m_nodes.clear(); m_indices.clear(); } void shrinkToFit() { m_nodes.shrinkToFit(); } bool contains(const Node* node) const { return m_indices.contains(node); } size_t find(const Node*) const; Node* nextTo(const Node*) const; Node* previousTo(const Node*) const; void swap(DistributedNodes& other); const WillBeHeapVector<RefPtrWillBeMember<Node>>& nodes() const { return m_nodes; } DECLARE_TRACE(); private: WillBeHeapVector<RefPtrWillBeMember<Node>> m_nodes; WillBeHeapHashMap<RawPtrWillBeMember<const Node>, size_t> m_indices; }; } #endif ```
Hoseynabad-e Latabad (, also Romanized as Ḩoseynābād-e Lātābād) is a village in Rigan Rural District, in the Central District of Rigan County, Kerman Province, Iran. At the 2006 census, its population was 67, in 13 families. References Populated places in Rigan County
```java package com.fishercoder.thirdthousand; import com.fishercoder.solutions.thirdthousand._2716; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.assertEquals; public class _2716Test { private _2716.Solution1 solution1; @BeforeEach public void setup() { solution1 = new _2716.Solution1(); } @Test public void test1() { assertEquals(2, solution1.minimizedStringLength("ipi")); } } ```
```java /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.visualizer.hierarchicallayout; import org.graalvm.visualizer.layout.Link; import org.graalvm.visualizer.layout.Port; import java.awt.Point; import java.util.List; public class ClusterEdge implements Link { private final ClusterNode from; private final ClusterNode to; private List<Point> points; public ClusterEdge(ClusterNode from, ClusterNode to) { assert from != null; assert to != null; this.from = from; this.to = to; } @Override public Port getTo() { return to.getInputSlot(); } @Override public Port getFrom() { return from.getOutputSlot(); } @Override public void setControlPoints(List<Point> p) { this.points = p; } @Override public List<Point> getControlPoints() { return points; } @Override public boolean isVIP() { return false; } } ```
```yaml cloud_id: {{env["ANYSCALE_CLOUD_ID"]}} region: us-west-2 max_workers: 49 head_node_type: name: head_node instance_type: m4.16xlarge resources: custom_resources: node: 1 worker_node_types: - name: worker_node instance_type: m4.2xlarge min_workers: 49 max_workers: 49 use_spot: false resources: custom_resources: node: 1 ```
```java /* * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package org.graalvm.visualvm.heapviewer.truffle; import org.graalvm.visualvm.heapviewer.model.DataType; import org.graalvm.visualvm.lib.jfluid.heap.Instance; /** * * @author Jiri Sedlacek */ public abstract class TruffleObject { public static final DataType<TruffleObject> DATA_TYPE = new DataType<>(TruffleObject.class, null, null); public abstract long getSize(); public abstract long getRetainedSize(); public abstract String getType(); public abstract long getTypeId(); public static abstract class InstanceBased extends TruffleObject { public abstract Instance getInstance(); @Override public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof InstanceBased)) { return false; } return getInstance().equals(((InstanceBased) o).getInstance()); } @Override public int hashCode() { return getInstance().hashCode(); } } } ```
Amalia Georgievna von Mengden (; 1799-1864), was a Russian entrepreneur. She was one of the first female money industrialists in Russia. She was married to General baron Mikhail von Mengden. She managed the Mengden tablecloth factory in Saint Nicholas in the Kostroma Governorate in 1830-1864. References Отрывки семейной хроники (из воспоминаний баронессы Софии Менгден), в журнале «Русская старина», 1908, апрель, стр. 99. Фабрика в 1843 году в Исследованиях о состоянии льняной промышленности в России. СПб, 1847 1799 births 1864 deaths 19th-century businesspeople from the Russian Empire Russian women in business People from Vichuga People from the Russian Empire of German descent Amalia von Mengden
Gaius Julius Avitus Alexianus (died 217) was a Syrian nobleman who had an impressive Roman military and political career. Background and career Although Alexianus was a Roman citizen who was born and raised in Emesa (modern Homs, Syria), little is known on his origins. It has been assumed that Alexianus was born in c. 155. What is known about him is from surviving inscriptional and Roman historical evidence. Through marriage he was a relation to the Royal family of Emesa and the ruling Severan dynasty of the Roman Empire. He was an Equestrian officer serving as a praefectus and tribune in the Roman military, and then as a procurator of the food supply in Rome, being stationed in Ostia. Later he was promoted to the Senate by the Emperor Septimius Severus, his brother-in-law. Having entered the Senate with the rank of Praetor in 194, Alexianus was made Legatus in the Legio IV Flavia Felix and later served as governor of Raetia, which may be dated to 196/197. During his proconsulship of Raetia, he dedicated an altar to the Emesene God Elagabalus. The altar and its inscription, still intact, mentions him as a priest of the deified Emperor Titus. Alexianus served as consul in 200, even perhaps as early as 198 or 199. After his consulship, Alexianus was not appointed to further military or political positions, probably due to the enmity of the Praetorian prefect Gaius Fulvius Plautianus. After the death of Plautianus in 205, Alexianus took part in Septimius Severus’ expedition in Britain where he acted as a Comes (Companion) to the emperor from 208 until 211. Under Septimius Severus’ successor Caracalla, for two years Alexianus served as a Prefect of the Italian orphanages. He served as a Legatus in Dalmatia in c. 214 and later as a Proconsul in Asia and in Mesopotamia. In 216–217, Alexianus became a comes to Caracalla on his campaign against the Parthian Empire. He died from old age on his way to Cyprus, sent there by Caracalla in early 217 to act as an advisor to the Governor. Marriage and issue Alexianus married the powerful, influential and rich Syrian noblewoman Julia Maesa, the first daughter of Julius Bassianus, a high priest of the Temple of the Sun. The temple was dedicated to the Syrian Aramaic Sun God El-Gebal (counterpart to the Phoenician Baal) in Emesa. The younger sister of Maesa was Septimius Severus' empress Julia Domna, who was the mother of the emperors Caracalla and Geta. Maesa bore two distinguished daughters to Alexianus who were born and raised in Syria: Julia Soaemias Bassiana (c. 180–222) Julia Avita Mamaea (after 180–235) Among his grandchildren were the emperors Elagabalus and Severus Alexander. Severan dynasty family tree References Sources A.R. Birley, Septimius Severus: The African Emperor, Routledge, 2002 J. Hazel, Who's who in the Roman World, Psychology Press, 2002 Julius Avitus’ article at ancient library Gaius Julius Avitus Alexianus’ article at Livius.org Julia Maesa’s article at Livius.org 217 deaths 2nd-century people 2nd-century Romans 3rd-century Romans Emesene dynasty Avitus Alexianus, Gaius Roman governors of Asia Roman governors of Cyprus Roman governors of Raetia Suffect consuls of Imperial Rome Year of birth unknown
```smalltalk // // // file LICENSE or copy at path_to_url // using System; using Telegram.Common; using Telegram.Converters; using Telegram.Navigation; using Telegram.Services; using Telegram.Td.Api; using Telegram.ViewModels; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; namespace Telegram.Controls.Messages.Content { // TODO: turn the whole control into a Button public sealed class AudioContent : ControlEx, IContent { private MessageViewModel _message; public MessageViewModel Message => _message; private long _fileToken; private long _thumbnailToken; public AudioContent(MessageViewModel message) { _message = message; DefaultStyleKey = typeof(AudioContent); Disconnected += OnUnloaded; } public AudioContent() { DefaultStyleKey = typeof(AudioContent); } #region InitializeComponent private AutomaticDragHelper ButtonDrag; private Border Texture; private FileButton Button; private Grid DownloadPanel; private FileButton Download; private TextBlock Title; private TextBlock Subtitle; private bool _templateApplied; protected override void OnApplyTemplate() { Texture = GetTemplateChild(nameof(Texture)) as Border; Button = GetTemplateChild(nameof(Button)) as FileButton; DownloadPanel = GetTemplateChild(nameof(DownloadPanel)) as Grid; Download = GetTemplateChild(nameof(Download)) as FileButton; Title = GetTemplateChild(nameof(Title)) as TextBlock; Subtitle = GetTemplateChild(nameof(Subtitle)) as TextBlock; ButtonDrag = new AutomaticDragHelper(Button, true); ButtonDrag.StartDetectingDrag(); Button.Click += Button_Click; Button.DragStarting += Button_DragStarting; Download.Click += Download_Click; _templateApplied = true; if (_message != null) { UpdateMessage(_message); } } #endregion private void OnUnloaded(object sender, RoutedEventArgs e) { if (_message != null) { _message.PlaybackService.SourceChanged -= OnPlaybackStateChanged; _message.PlaybackService.StateChanged -= OnPlaybackStateChanged; _message.PlaybackService.PositionChanged -= OnPositionChanged; } } public void UpdateMessage(MessageViewModel message) { _message = message; message.PlaybackService.SourceChanged -= OnPlaybackStateChanged; var audio = GetContent(message); if (audio == null || !_templateApplied) { return; } message.PlaybackService.SourceChanged += OnPlaybackStateChanged; Title.Text = audio.GetTitle(); if (audio.AlbumCoverThumbnail != null) { UpdateManager.Subscribe(this, message, audio.AlbumCoverThumbnail.File, ref _thumbnailToken, UpdateThumbnail, true); UpdateThumbnail(message, audio.AlbumCoverThumbnail, audio.AlbumCoverThumbnail.File); } else { Texture.Background = null; Button.Style = BootStrapper.Current.Resources["InlineFileButtonStyle"] as Style; } UpdateManager.Subscribe(this, message, audio.AudioValue, ref _fileToken, UpdateFile); UpdateFile(message, audio.AudioValue); } public void Mockup(MessageAudio audio) { Title.Text = audio.Audio.GetTitle(); Subtitle.Text = audio.Audio.GetDuration() + ", " + FileSizeConverter.Convert(4190000); Button.SetGlyph(0, MessageContentState.Play); Download.SetGlyph(0, MessageContentState.Download); } #region Playback private void OnPlaybackStateChanged(IPlaybackService sender, object args) { this.BeginOnUIThread(() => { var audio = GetContent(_message); if (audio == null) { Recycle(sender); return; } UpdateFile(_message, audio.AudioValue); }); } private void OnPositionChanged(IPlaybackService sender, PlaybackPositionChangedEventArgs args) { var position = args.Position; var duration = args.Duration; this.BeginOnUIThread(() => UpdatePosition(position, duration)); } private void UpdatePosition(TimeSpan position, TimeSpan duration) { var message = _message; if (message == null) { return; } if (message.AreTheSame(message.PlaybackService.CurrentItem) /*&& !_pressed*/) { Subtitle.Text = FormatTime(position) + " / " + FormatTime(duration); } } private string FormatTime(TimeSpan span) { if (span.TotalHours >= 1) { return span.ToString("h\\:mm\\:ss"); } else { return span.ToString("mm\\:ss"); } } #endregion private void UpdateFile(object target, File file) { UpdateFile(_message, file); } private void UpdateFile(MessageViewModel message, File file) { var audio = GetContent(message); if (audio == null || !_templateApplied) { return; } message.PlaybackService.StateChanged -= OnPlaybackStateChanged; message.PlaybackService.PositionChanged -= OnPositionChanged; if (audio.AudioValue.Id != file.Id) { return; } var canBeDownloaded = file.Local.CanBeDownloaded && !file.Local.IsDownloadingCompleted && !file.Local.IsDownloadingActive; var size = Math.Max(file.Size, file.ExpectedSize); if (file.Local.IsDownloadingActive || (canBeDownloaded && message.Delegate.CanBeDownloaded(audio, file))) { if (canBeDownloaded) { _message.ClientService.DownloadFile(file.Id, 32); } FileButton target; if (SettingsService.Current.IsStreamingEnabled) { target = Download; DownloadPanel.Visibility = Visibility.Visible; } else { target = Button; DownloadPanel.Visibility = Visibility.Collapsed; } target.SetGlyph(file.Id, MessageContentState.Downloading); target.Progress = (double)file.Local.DownloadedSize / size; Subtitle.Text = string.Format("{0} / {1}", FileSizeConverter.Convert(file.Local.DownloadedSize, size), FileSizeConverter.Convert(size)); } else if (file.Remote.IsUploadingActive || message.SendingState is MessageSendingStateFailed) { DownloadPanel.Visibility = Visibility.Collapsed; Button.SetGlyph(file.Id, MessageContentState.Uploading); Button.Progress = (double)file.Remote.UploadedSize / size; Subtitle.Text = string.Format("{0} / {1}", FileSizeConverter.Convert(file.Remote.UploadedSize, size), FileSizeConverter.Convert(size)); } else if (canBeDownloaded) { FileButton target; if (SettingsService.Current.IsStreamingEnabled) { target = Download; DownloadPanel.Visibility = Visibility.Visible; } else { target = Button; DownloadPanel.Visibility = Visibility.Collapsed; } target.SetGlyph(file.Id, MessageContentState.Download); target.Progress = 0; Subtitle.Text = audio.GetDuration() + " - " + FileSizeConverter.Convert(size); } else { DownloadPanel.Visibility = Visibility.Collapsed; if (!SettingsService.Current.IsStreamingEnabled) { UpdatePlayback(message, audio, file); } } if (SettingsService.Current.IsStreamingEnabled && !file.Remote.IsUploadingActive) { UpdatePlayback(message, audio, file); } } private void UpdatePlayback(MessageViewModel message, Audio audio, File file) { if (message.AreTheSame(message.PlaybackService.CurrentItem)) { if (message.PlaybackService.PlaybackState == PlaybackState.Paused) { Button.SetGlyph(file.Id, MessageContentState.Play); } else { Button.SetGlyph(file.Id, MessageContentState.Pause); } UpdatePosition(message.PlaybackService.Position, message.PlaybackService.Duration); message.PlaybackService.StateChanged += OnPlaybackStateChanged; message.PlaybackService.PositionChanged += OnPositionChanged; } else { Button.SetGlyph(file.Id, MessageContentState.Play); Button.Progress = 1; if (file.Local.CanBeDownloaded && !file.Local.IsDownloadingCompleted && !file.Local.IsDownloadingActive && !file.Remote.IsUploadingActive) { Subtitle.Text = audio.GetDuration() + " - " + FileSizeConverter.Convert(Math.Max(file.Size, file.ExpectedSize)); } else { Subtitle.Text = audio.GetDuration(); } } Button.Progress = 1; } private void UpdateThumbnail(object target, File file) { var audio = GetContent(_message); if (audio == null || !_templateApplied) { return; } UpdateThumbnail(_message, audio.AlbumCoverThumbnail, file); } private void UpdateThumbnail(MessageViewModel message, Thumbnail thumbnail, File file) { if (thumbnail.File.Id != file.Id) { return; } if (file.Local.IsDownloadingCompleted) { double ratioX = (double)48 / thumbnail.Width; double ratioY = (double)48 / thumbnail.Height; double ratio = Math.Max(ratioX, ratioY); var width = (int)(thumbnail.Width * ratio); var height = (int)(thumbnail.Height * ratio); try { Texture.Background = new ImageBrush { ImageSource = UriEx.ToBitmap(file.Local.Path, width, height), Stretch = Stretch.UniformToFill, AlignmentX = AlignmentX.Center, AlignmentY = AlignmentY.Center }; Button.Style = BootStrapper.Current.Resources["ImmersiveFileButtonStyle"] as Style; } catch { Texture.Background = null; Button.Style = BootStrapper.Current.Resources["InlineFileButtonStyle"] as Style; } } else if (file.Local.CanBeDownloaded && !file.Local.IsDownloadingActive) { message.ClientService.DownloadFile(file.Id, 1); Texture.Background = null; Button.Style = BootStrapper.Current.Resources["InlineFileButtonStyle"] as Style; } } public void Recycle() { Recycle(_message?.PlaybackService); } private void Recycle(object sender) { if (sender is IPlaybackService playback) { playback.SourceChanged -= OnPlaybackStateChanged; playback.StateChanged -= OnPlaybackStateChanged; playback.PositionChanged -= OnPositionChanged; } _message = null; UpdateManager.Unsubscribe(this, ref _fileToken); UpdateManager.Unsubscribe(this, ref _thumbnailToken, true); } public bool IsValid(MessageContent content, bool primary) { if (content is MessageAudio) { return true; } else if (content is MessageText text && text.LinkPreview != null && !primary) { return text.LinkPreview.Type is LinkPreviewTypeAudio; } return false; } private Audio GetContent(MessageViewModel message) { if (message?.Delegate == null) { return null; } var content = message.Content; if (content is MessageAudio audio) { return audio.Audio; } else if (content is MessageText text && text.LinkPreview?.Type is LinkPreviewTypeAudio previewAudio) { return previewAudio.Audio; } return null; } private void Button_Click(object sender, RoutedEventArgs e) { if (SettingsService.Current.IsStreamingEnabled) { } else { Download_Click(null, null); return; } var audio = GetContent(_message); if (audio == null) { return; } var file = audio.AudioValue; if (file.Remote.IsUploadingActive || _message.SendingState is MessageSendingStateFailed) { if (_message.SendingState is MessageSendingStateFailed or MessageSendingStatePending) { _message.ClientService.Send(new DeleteMessages(_message.ChatId, new[] { _message.Id }, true)); } else { _message.ClientService.Send(new CancelPreliminaryUploadFile(file.Id)); } } else if (_message.AreTheSame(_message.PlaybackService.CurrentItem)) { if (_message.PlaybackService.PlaybackState == PlaybackState.Paused) { _message.PlaybackService.Play(); } else { _message.PlaybackService.Pause(); } } else { _message.Delegate.PlayMessage(_message); } } private void Button_DragStarting(UIElement sender, DragStartingEventArgs args) { MessageHelper.DragStarting(_message, args); } private void Download_Click(object sender, RoutedEventArgs e) { var audio = GetContent(_message); if (audio == null) { return; } var file = audio.AudioValue; if (file.Local.IsDownloadingActive) { _message.ClientService.CancelDownloadFile(file); } else if (file.Remote.IsUploadingActive || _message.SendingState is MessageSendingStateFailed) { if (_message.SendingState is MessageSendingStateFailed or MessageSendingStatePending) { _message.ClientService.Send(new DeleteMessages(_message.ChatId, new[] { _message.Id }, true)); } else { _message.ClientService.Send(new CancelPreliminaryUploadFile(file.Id)); } } else if (file.Local.CanBeDownloaded && !file.Local.IsDownloadingActive && !file.Local.IsDownloadingCompleted) { if (_message.CanBeAddedToDownloads) { _message.ClientService.AddFileToDownloads(file, _message.ChatId, _message.Id); } else { _message.ClientService.DownloadFile(file.Id, 30); } } else { if (_message.AreTheSame(_message.PlaybackService.CurrentItem)) { if (_message.PlaybackService.PlaybackState == PlaybackState.Paused) { _message.PlaybackService.Play(); } else { _message.PlaybackService.Pause(); } } else { _message.Delegate.PlayMessage(_message); } } } } } ```
```javascript Don't assume that HTML script tags are always run sequentially Handling click events High Resolution Time API Geolocation Drag and Drop API ```
```c /*your_sha256_hash-------------- // CLING - the C++ LLVM-based InterpreterG :) // // This file is dual-licensed: you can choose to license it under the University // LICENSE.TXT for details. //your_sha256_hash------------*/ // RUN: true // Used as library source by callale_lib_L_AB.C, etc. extern int cling_testlibrary_function_A(); extern int cling_testlibrary_function_B(); CLING_EXPORT int cling_testlibrary_function() { return cling_testlibrary_function_A() + cling_testlibrary_function_B(); } ```
Ángel Gorordo (6 March 1904 – 12 June 1974) was an Argentine fencer. He competed in the individual and team foil events at the 1932 and 1936 Summer Olympics. References 1904 births 1974 deaths Argentine male fencers Olympic fencers for Argentina Fencers at the 1932 Summer Olympics Fencers at the 1936 Summer Olympics Fencers from Buenos Aires 20th-century Argentine people
```javascript Async File Write in Node.js Custom Node REPL Server Wrapping errors in Node.js using _node-verror_ `try-catch` only for **sync** code Middleware/pipeline design pattern ```
The England national cricket team toured New Zealand in February and March 1984 and played a three-match Test series against the New Zealand national cricket team. New Zealand won the Test series 1–0, with two matches drawn. Test series summary First Test Second Test Third Test One Day Internationals (ODIs) England won the Rothmans Cup 2-1. 1st ODI 2nd ODI 3rd ODI References 1984 in English cricket 1984 in New Zealand cricket New Zealand cricket seasons from 1970–71 to 1999–2000 1983-84 International cricket competitions from 1980–81 to 1985
Julia is a 2014 American neo-noir horror film and the feature film directorial debut of Matthew A. Brown. The film stars Ashley C. Williams as a woman who seeks revenge for her brutal rape. It had its world release on 19 July 2014 at the Puchon International Fantastic Film Festival. Synopsis Julia (Ashley C. Williams) is a young woman that was drugged and raped by Pierce (Ryan Cooper) and three friends, who then left her for dead. She manages to make her way home, where the viewer discovers that Julia has spent most of her life being abused by various tormentors and has turned to self-harm as a result. Later Julia overhears someone discussing a therapy that has rape victims taking back power from their attackers. She's introduced to Dr. Sgundud (Jack Noseworthy) through the mysterious Sadie (Tahyna Tozzi). Under her guidance, Julia seduces a man (implied to be a rapist of one of the past patients of Sgrundud) and lures him to her apartment. Stripping naked, she seduces him and engages in sexual intercourse, but halfway through the rest of the sisterhood restrain him, make Julia castrate him (taking genitals as a trophy), impale him numerous times and dispose of the body. After several more hunts, Julia one day sees one of her rapists, Adam, in the clinic where she works, and decides to seek revenge on them all using Sgrundud's methods. She convinces Adam to assemble a meeting (claiming that "in a way, it [what happened] was the best thing to ever happen to me") but leaving Pierce, the rapists "boss", as last. The night of the meeting, Julia drugs Adam and the other two friends who raped her, surgically removes Adam's eyes (as he did not actually rape her, only watched) and the other men's genitalia, then leaves for the last one, Pierce. However, she finds him killed and evirated by the sisterhood, while Julia herself is knocked unconscious and taken back to Dr. Sgrundud after Sadie snitches on her. Sgrundud tells Julia that she has violated the rules of "taking medicine" and therefore, drugged again, is about to be vivisected. He also reveals that the idea of emasculating victims came to him after he himself went through such a procedure performed by his father after he discovered his son's homosexuality, as he liked to dress in his sister's clothes. However, before he starts to operate on Julia, Sadie saves her, entering the building, and kills Sgrundud's associates. The doctor confronts Sadie and points his gun at her, but Julia manages to get off the operating table and decapitates Sgrundud from behind. Before Sadie can thank her friend, Julia shoots her in the head and leaves towards an unknown future. Cast Ashley C. Williams as Julia Tahyna Tozzi as Sadie Jack Noseworthy as Dr. Sgundud Joel de la Fuente as Dr. Lin Cary Woodworth as Scott Darren Lipari as Matt Ryan Cooper as Piers Brad Koed as Adam Sean Kleier as Tim Bridget Megan Clark as Yael Frankel Chris Cardona as Macho Corp. Executive Kumiko Konishi as Female Bartender James Henry B. as Pig F*ucker - Man Reception Nerdly praised Julia, writing "Julia is an evocative and engaging watch more from its uniquely cinematic stylings than through anything given in the narrative. While certainly not perfect, overall it is a decent entry in a genre which is troubling at the best of times and I certainly will be remembering writer/director Brown’s name for the future." Grolsch Film Works also recommended the movie, comparing it favorably to American Mary. Flickering Myth gave a mixed review for Julia, commenting that the movie was "a lot better than the I Spit on Your Grave remakes and it’s a lot smarter than the original on which they were based, but it’s also fairly forgettable." References External links 2014 films 2010s English-language films 2014 horror thriller films 2014 independent films 2014 LGBT-related films American horror thriller films American independent films American LGBT-related films American rape and revenge films Films shot in New York City LGBT-related horror thriller films 2010s American films
```kotlin plugins { id("module") } dependencies { compileOnly(projects.detektApi) compileOnly(projects.detektPsiUtils) testImplementation(projects.detektTest) testImplementation(libs.assertj.core) testImplementation(testFixtures(projects.detektApi)) } ```
This is a timeline of events in the history of Scottish nationalism. 843 1603 1707 1820 1979 1997 1999 2014 References Scottish nationalism Chronology
```objective-c //===-- asan_mapping.h ------------------------------------------*- C++ -*-===// // // See path_to_url for license information. // //===your_sha256_hash------===// // // This file is a part of AddressSanitizer, an address sanity checker. // // Defines ASan memory mapping. //===your_sha256_hash------===// #ifndef ASAN_MAPPING_H #define ASAN_MAPPING_H #include "sanitizer_common/sanitizer_platform.h" // The full explanation of the memory mapping could be found here: // path_to_url // // Typical shadow mapping on Linux/x86_64 with SHADOW_OFFSET == 0x00007fff8000: // || `[0x10007fff8000, 0x7fffffffffff]` || HighMem || // || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow || // || `[0x00008fff7000, 0x02008fff6fff]` || ShadowGap || // || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow || // || `[0x000000000000, 0x00007fff7fff]` || LowMem || // // When SHADOW_OFFSET is zero (-pie): // || `[0x100000000000, 0x7fffffffffff]` || HighMem || // || `[0x020000000000, 0x0fffffffffff]` || HighShadow || // || `[0x000000040000, 0x01ffffffffff]` || ShadowGap || // // Special case when something is already mapped between // 0x003000000000 and 0x005000000000 (e.g. when prelink is installed): // || `[0x10007fff8000, 0x7fffffffffff]` || HighMem || // || `[0x02008fff7000, 0x10007fff7fff]` || HighShadow || // || `[0x005000000000, 0x02008fff6fff]` || ShadowGap3 || // || `[0x003000000000, 0x004fffffffff]` || MidMem || // || `[0x000a7fff8000, 0x002fffffffff]` || ShadowGap2 || // || `[0x00067fff8000, 0x000a7fff7fff]` || MidShadow || // || `[0x00008fff7000, 0x00067fff7fff]` || ShadowGap || // || `[0x00007fff8000, 0x00008fff6fff]` || LowShadow || // || `[0x000000000000, 0x00007fff7fff]` || LowMem || // // Default Linux/i386 mapping on x86_64 machine: // || `[0x40000000, 0xffffffff]` || HighMem || // || `[0x28000000, 0x3fffffff]` || HighShadow || // || `[0x24000000, 0x27ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/i386 mapping on i386 machine // (addresses starting with 0xc0000000 are reserved // for kernel and thus not sanitized): // || `[0x38000000, 0xbfffffff]` || HighMem || // || `[0x27000000, 0x37ffffff]` || HighShadow || // || `[0x24000000, 0x26ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/MIPS32 mapping: // || `[0x2aaa0000, 0xffffffff]` || HighMem || // || `[0x0fff4000, 0x2aa9ffff]` || HighShadow || // || `[0x0bff4000, 0x0fff3fff]` || ShadowGap || // || `[0x0aaa0000, 0x0bff3fff]` || LowShadow || // || `[0x00000000, 0x0aa9ffff]` || LowMem || // // Default Linux/MIPS64 mapping: // || `[0x4000000000, 0xffffffffff]` || HighMem || // || `[0x2800000000, 0x3fffffffff]` || HighShadow || // || `[0x2400000000, 0x27ffffffff]` || ShadowGap || // || `[0x2000000000, 0x23ffffffff]` || LowShadow || // || `[0x0000000000, 0x1fffffffff]` || LowMem || // // Default Linux/RISCV64 Sv39 mapping: // || `[0x1555550000, 0x3fffffffff]` || HighMem || // || `[0x0fffffa000, 0x1555555fff]` || HighShadow || // || `[0x0effffa000, 0x0fffff9fff]` || ShadowGap || // || `[0x0d55550000, 0x0effff9fff]` || LowShadow || // || `[0x0000000000, 0x0d5554ffff]` || LowMem || // // Default Linux/AArch64 (39-bit VMA) mapping: // || `[0x2000000000, 0x7fffffffff]` || highmem || // || `[0x1400000000, 0x1fffffffff]` || highshadow || // || `[0x1200000000, 0x13ffffffff]` || shadowgap || // || `[0x1000000000, 0x11ffffffff]` || lowshadow || // || `[0x0000000000, 0x0fffffffff]` || lowmem || // // Default Linux/AArch64 (42-bit VMA) mapping: // || `[0x10000000000, 0x3ffffffffff]` || highmem || // || `[0x0a000000000, 0x0ffffffffff]` || highshadow || // || `[0x09000000000, 0x09fffffffff]` || shadowgap || // || `[0x08000000000, 0x08fffffffff]` || lowshadow || // || `[0x00000000000, 0x07fffffffff]` || lowmem || // // Default Linux/S390 mapping: // || `[0x30000000, 0x7fffffff]` || HighMem || // || `[0x26000000, 0x2fffffff]` || HighShadow || // || `[0x24000000, 0x25ffffff]` || ShadowGap || // || `[0x20000000, 0x23ffffff]` || LowShadow || // || `[0x00000000, 0x1fffffff]` || LowMem || // // Default Linux/SystemZ mapping: // || `[0x14000000000000, 0x1fffffffffffff]` || HighMem || // || `[0x12800000000000, 0x13ffffffffffff]` || HighShadow || // || `[0x12000000000000, 0x127fffffffffff]` || ShadowGap || // || `[0x10000000000000, 0x11ffffffffffff]` || LowShadow || // || `[0x00000000000000, 0x0fffffffffffff]` || LowMem || // // Default Linux/SPARC64 (52-bit VMA) mapping: // || `[0x8000000000000, 0xfffffffffffff]` || HighMem || // || `[0x1080000000000, 0x207ffffffffff]` || HighShadow || // || `[0x0090000000000, 0x107ffffffffff]` || ShadowGap || // || `[0x0080000000000, 0x008ffffffffff]` || LowShadow || // || `[0x0000000000000, 0x007ffffffffff]` || LowMem || // // Default Linux/LoongArch64 (47-bit VMA) mapping: // || `[0x500000000000, 0x7fffffffffff]` || HighMem || // || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow || // || `[0x480000000000, 0x49ffffffffff]` || ShadowGap || // || `[0x400000000000, 0x47ffffffffff]` || LowShadow || // || `[0x000000000000, 0x3fffffffffff]` || LowMem || // // Shadow mapping on FreeBSD/x86-64 with SHADOW_OFFSET == 0x400000000000: // || `[0x500000000000, 0x7fffffffffff]` || HighMem || // || `[0x4a0000000000, 0x4fffffffffff]` || HighShadow || // || `[0x480000000000, 0x49ffffffffff]` || ShadowGap || // || `[0x400000000000, 0x47ffffffffff]` || LowShadow || // || `[0x000000000000, 0x3fffffffffff]` || LowMem || // // Shadow mapping on FreeBSD/i386 with SHADOW_OFFSET == 0x40000000: // || `[0x60000000, 0xffffffff]` || HighMem || // || `[0x4c000000, 0x5fffffff]` || HighShadow || // || `[0x48000000, 0x4bffffff]` || ShadowGap || // || `[0x40000000, 0x47ffffff]` || LowShadow || // || `[0x00000000, 0x3fffffff]` || LowMem || // // Shadow mapping on NetBSD/x86-64 with SHADOW_OFFSET == 0x400000000000: // || `[0x4feffffffe01, 0x7f7ffffff000]` || HighMem || // || `[0x49fdffffffc0, 0x4feffffffe00]` || HighShadow || // || `[0x480000000000, 0x49fdffffffbf]` || ShadowGap || // || `[0x400000000000, 0x47ffffffffff]` || LowShadow || // || `[0x000000000000, 0x3fffffffffff]` || LowMem || // // Shadow mapping on NetBSD/i386 with SHADOW_OFFSET == 0x40000000: // || `[0x60000000, 0xfffff000]` || HighMem || // || `[0x4c000000, 0x5fffffff]` || HighShadow || // || `[0x48000000, 0x4bffffff]` || ShadowGap || // || `[0x40000000, 0x47ffffff]` || LowShadow || // || `[0x00000000, 0x3fffffff]` || LowMem || // // Default Windows/i386 mapping: // (the exact location of HighShadow/HighMem may vary depending // on WoW64, /LARGEADDRESSAWARE, etc). // || `[0x50000000, 0xffffffff]` || HighMem || // || `[0x3a000000, 0x4fffffff]` || HighShadow || // || `[0x36000000, 0x39ffffff]` || ShadowGap || // || `[0x30000000, 0x35ffffff]` || LowShadow || // || `[0x00000000, 0x2fffffff]` || LowMem || #define ASAN_SHADOW_SCALE 3 #if SANITIZER_FUCHSIA # define ASAN_SHADOW_OFFSET_CONST (0) #elif SANITIZER_WORDSIZE == 32 # if SANITIZER_ANDROID # define ASAN_SHADOW_OFFSET_DYNAMIC # elif defined(__mips__) # define ASAN_SHADOW_OFFSET_CONST 0x0aaa0000 # elif SANITIZER_FREEBSD # define ASAN_SHADOW_OFFSET_CONST 0x40000000 # elif SANITIZER_NETBSD # define ASAN_SHADOW_OFFSET_CONST 0x40000000 # elif SANITIZER_WINDOWS # define ASAN_SHADOW_OFFSET_CONST 0x30000000 # elif SANITIZER_IOS # define ASAN_SHADOW_OFFSET_DYNAMIC # else # define ASAN_SHADOW_OFFSET_CONST 0x20000000 # endif #else # if SANITIZER_IOS # define ASAN_SHADOW_OFFSET_DYNAMIC # elif SANITIZER_APPLE && defined(__aarch64__) # define ASAN_SHADOW_OFFSET_DYNAMIC # elif SANITIZER_FREEBSD && defined(__aarch64__) # define ASAN_SHADOW_OFFSET_CONST 0x0000800000000000 # elif SANITIZER_RISCV64 # define ASAN_SHADOW_OFFSET_CONST 0x0000000d55550000 # elif defined(__aarch64__) # define ASAN_SHADOW_OFFSET_CONST 0x0000001000000000 # elif defined(__powerpc64__) # define ASAN_SHADOW_OFFSET_CONST 0x0000100000000000 # elif defined(__s390x__) # define ASAN_SHADOW_OFFSET_CONST 0x0010000000000000 # elif SANITIZER_FREEBSD # define ASAN_SHADOW_OFFSET_CONST 0x0000400000000000 # elif SANITIZER_NETBSD # define ASAN_SHADOW_OFFSET_CONST 0x0000400000000000 # elif SANITIZER_APPLE # define ASAN_SHADOW_OFFSET_CONST 0x0000100000000000 # elif defined(__mips64) # define ASAN_SHADOW_OFFSET_CONST 0x0000002000000000 # elif defined(__sparc__) # define ASAN_SHADOW_OFFSET_CONST 0x0000080000000000 # elif SANITIZER_LOONGARCH64 # define ASAN_SHADOW_OFFSET_CONST 0x0000400000000000 # elif SANITIZER_WINDOWS64 # define ASAN_SHADOW_OFFSET_DYNAMIC # else # if ASAN_SHADOW_SCALE != 3 # error "Value below is based on shadow scale = 3." # error "Original formula was: 0x7FFFFFFF & (~0xFFFULL << SHADOW_SCALE)." # endif # define ASAN_SHADOW_OFFSET_CONST 0x000000007fff8000 # endif #endif #if defined(__cplusplus) # include "asan_internal.h" static const u64 kDefaultShadowSentinel = ~(uptr)0; # if defined(ASAN_SHADOW_OFFSET_CONST) static const u64 kConstShadowOffset = ASAN_SHADOW_OFFSET_CONST; # define ASAN_SHADOW_OFFSET kConstShadowOffset # elif defined(ASAN_SHADOW_OFFSET_DYNAMIC) # define ASAN_SHADOW_OFFSET __asan_shadow_memory_dynamic_address # else # error "ASAN_SHADOW_OFFSET can't be determined." # endif # if SANITIZER_ANDROID && defined(__arm__) # define ASAN_PREMAP_SHADOW 1 # else # define ASAN_PREMAP_SHADOW 0 # endif # define ASAN_SHADOW_GRANULARITY (1ULL << ASAN_SHADOW_SCALE) # define DO_ASAN_MAPPING_PROFILE 0 // Set to 1 to profile the functions below. # if DO_ASAN_MAPPING_PROFILE # define PROFILE_ASAN_MAPPING() AsanMappingProfile[__LINE__]++; # else # define PROFILE_ASAN_MAPPING() # endif // If 1, all shadow boundaries are constants. // Don't set to 1 other than for testing. # define ASAN_FIXED_MAPPING 0 namespace __asan { extern uptr AsanMappingProfile[]; # if ASAN_FIXED_MAPPING // Fixed mapping for 64-bit Linux. Mostly used for performance comparison // with non-fixed mapping. As of r175253 (Feb 2013) the performance // difference between fixed and non-fixed mapping is below the noise level. static uptr kHighMemEnd = 0x7fffffffffffULL; static uptr kMidMemBeg = 0x3000000000ULL; static uptr kMidMemEnd = 0x4fffffffffULL; # else extern uptr kHighMemEnd, kMidMemBeg, kMidMemEnd; // Initialized in __asan_init. # endif } // namespace __asan # if defined(__sparc__) && SANITIZER_WORDSIZE == 64 # include "asan_mapping_sparc64.h" # else # define MEM_TO_SHADOW(mem) \ (((mem) >> ASAN_SHADOW_SCALE) + (ASAN_SHADOW_OFFSET)) # define SHADOW_TO_MEM(mem) \ (((mem) - (ASAN_SHADOW_OFFSET)) << (ASAN_SHADOW_SCALE)) # define kLowMemBeg 0 # define kLowMemEnd (ASAN_SHADOW_OFFSET ? ASAN_SHADOW_OFFSET - 1 : 0) # define kLowShadowBeg ASAN_SHADOW_OFFSET # define kLowShadowEnd MEM_TO_SHADOW(kLowMemEnd) # define kHighMemBeg (MEM_TO_SHADOW(kHighMemEnd) + 1) # define kHighShadowBeg MEM_TO_SHADOW(kHighMemBeg) # define kHighShadowEnd MEM_TO_SHADOW(kHighMemEnd) # define kMidShadowBeg MEM_TO_SHADOW(kMidMemBeg) # define kMidShadowEnd MEM_TO_SHADOW(kMidMemEnd) // With the zero shadow base we can not actually map pages starting from 0. // This constant is somewhat arbitrary. # define kZeroBaseShadowStart 0 # define kZeroBaseMaxShadowStart (1 << 18) # define kShadowGapBeg \ (kLowShadowEnd ? kLowShadowEnd + 1 : kZeroBaseShadowStart) # define kShadowGapEnd ((kMidMemBeg ? kMidShadowBeg : kHighShadowBeg) - 1) # define kShadowGap2Beg (kMidMemBeg ? kMidShadowEnd + 1 : 0) # define kShadowGap2End (kMidMemBeg ? kMidMemBeg - 1 : 0) # define kShadowGap3Beg (kMidMemBeg ? kMidMemEnd + 1 : 0) # define kShadowGap3End (kMidMemBeg ? kHighShadowBeg - 1 : 0) namespace __asan { static inline bool AddrIsInLowMem(uptr a) { PROFILE_ASAN_MAPPING(); return a <= kLowMemEnd; } static inline bool AddrIsInLowShadow(uptr a) { PROFILE_ASAN_MAPPING(); return a >= kLowShadowBeg && a <= kLowShadowEnd; } static inline bool AddrIsInMidMem(uptr a) { PROFILE_ASAN_MAPPING(); return kMidMemBeg && a >= kMidMemBeg && a <= kMidMemEnd; } static inline bool AddrIsInMidShadow(uptr a) { PROFILE_ASAN_MAPPING(); return kMidMemBeg && a >= kMidShadowBeg && a <= kMidShadowEnd; } static inline bool AddrIsInHighMem(uptr a) { PROFILE_ASAN_MAPPING(); return kHighMemBeg && a >= kHighMemBeg && a <= kHighMemEnd; } static inline bool AddrIsInHighShadow(uptr a) { PROFILE_ASAN_MAPPING(); return kHighMemBeg && a >= kHighShadowBeg && a <= kHighShadowEnd; } static inline bool AddrIsInShadowGap(uptr a) { PROFILE_ASAN_MAPPING(); if (kMidMemBeg) { if (a <= kShadowGapEnd) return ASAN_SHADOW_OFFSET == 0 || a >= kShadowGapBeg; return (a >= kShadowGap2Beg && a <= kShadowGap2End) || (a >= kShadowGap3Beg && a <= kShadowGap3End); } // In zero-based shadow mode we treat addresses near zero as addresses // in shadow gap as well. if (ASAN_SHADOW_OFFSET == 0) return a <= kShadowGapEnd; return a >= kShadowGapBeg && a <= kShadowGapEnd; } } // namespace __asan # endif namespace __asan { static inline uptr MemToShadowSize(uptr size) { return size >> ASAN_SHADOW_SCALE; } static inline bool AddrIsInMem(uptr a) { PROFILE_ASAN_MAPPING(); return AddrIsInLowMem(a) || AddrIsInMidMem(a) || AddrIsInHighMem(a) || (flags()->protect_shadow_gap == 0 && AddrIsInShadowGap(a)); } static inline uptr MemToShadow(uptr p) { PROFILE_ASAN_MAPPING(); CHECK(AddrIsInMem(p)); return MEM_TO_SHADOW(p); } static inline bool AddrIsInShadow(uptr a) { PROFILE_ASAN_MAPPING(); return AddrIsInLowShadow(a) || AddrIsInMidShadow(a) || AddrIsInHighShadow(a); } static inline uptr ShadowToMem(uptr p) { PROFILE_ASAN_MAPPING(); CHECK(AddrIsInShadow(p)); return SHADOW_TO_MEM(p); } static inline bool AddrIsAlignedByGranularity(uptr a) { PROFILE_ASAN_MAPPING(); return (a & (ASAN_SHADOW_GRANULARITY - 1)) == 0; } static inline bool AddressIsPoisoned(uptr a) { PROFILE_ASAN_MAPPING(); const uptr kAccessSize = 1; u8 *shadow_address = (u8 *)MEM_TO_SHADOW(a); s8 shadow_value = *shadow_address; if (shadow_value) { u8 last_accessed_byte = (a & (ASAN_SHADOW_GRANULARITY - 1)) + kAccessSize - 1; return (last_accessed_byte >= shadow_value); } return false; } // Must be after all calls to PROFILE_ASAN_MAPPING(). static const uptr kAsanMappingProfileSize = __LINE__; } // namespace __asan #endif // __cplusplus #endif // ASAN_MAPPING_H ```
```c++ /* * * John Maddock * * Use, modification and distribution are subject to the * LICENSE_1_0.txt or copy at path_to_url * */ // // This program extends config_info to print out regex library // configuration information. We do this by redfining the main // provided by config_info, our real main will call it later: // #ifndef OLD_MAIN # define OLD_MAIN info_main #endif #define main OLD_MAIN #include <libs/config/test/config_info.cpp> #undef main #ifndef NEW_MAIN # define NEW_MAIN main #endif #include <boost/regex.hpp> int NEW_MAIN() { OLD_MAIN(); print_separator(); PRINT_MACRO(BOOST_REGEX_USER_CONFIG); PRINT_MACRO(BOOST_REGEX_USE_C_LOCALE); PRINT_MACRO(BOOST_REGEX_USE_CPP_LOCALE); PRINT_MACRO(BOOST_REGEX_HAS_DLL_RUNTIME); PRINT_MACRO(BOOST_REGEX_DYN_LINK); PRINT_MACRO(BOOST_REGEX_NO_LIB); PRINT_MACRO(BOOST_REGEX_NO_TEMPLATE_SWITCH_MERGE); PRINT_MACRO(BOOST_REGEX_NO_W32); PRINT_MACRO(BOOST_REGEX_NO_BOOL); PRINT_MACRO(BOOST_REGEX_NO_EXTERNAL_TEMPLATES); PRINT_MACRO(BOOST_REGEX_NO_FWD); PRINT_MACRO(BOOST_REGEX_V3); PRINT_MACRO(BOOST_REGEX_HAS_MS_STACK_GUARD); PRINT_MACRO(BOOST_REGEX_RECURSIVE); PRINT_MACRO(BOOST_REGEX_NON_RECURSIVE); PRINT_MACRO(BOOST_REGEX_BLOCKSIZE); PRINT_MACRO(BOOST_REGEX_MAX_BLOCKS); PRINT_MACRO(BOOST_REGEX_MAX_CACHE_BLOCKS); PRINT_MACRO(BOOST_NO_WREGEX); PRINT_MACRO(BOOST_REGEX_NO_FILEITER); PRINT_MACRO(BOOST_REGEX_STATIC_LINK); PRINT_MACRO(BOOST_REGEX_DYN_LINK); PRINT_MACRO(BOOST_REGEX_DECL); PRINT_MACRO(BOOST_REGEX_CALL); PRINT_MACRO(BOOST_REGEX_CCALL); PRINT_MACRO(BOOST_REGEX_MAX_STATE_COUNT); PRINT_MACRO(BOOST_REGEX_BUGGY_CTYPE_FACET); PRINT_MACRO(BOOST_REGEX_MATCH_EXTRA); PRINT_MACRO(BOOST_HAS_ICU); PRINT_MACRO(BOOST_REGEX_HAS_OTHER_WCHAR_T); #if defined(BOOST_REGEX_CONFIG_INFO) && !defined(NO_RECURSE) print_regex_library_info(); #endif return 0; } ```
```python import ast import copy import functools import json import timeit from collections import namedtuple import benchmark_utils import numpy as np import torch # needs to be imported after torch import torch.utils.cpp_extension as cpp_extension # noqa: F401 """Performance microbenchmarks. This module contains core functionalities for performance microbenchmark tests. """ """ This is used to store configs of tests An example input is: TestConfig(test_name='add_M8_N2_K1', input_config='M: 8, N: 2, K: 1', tag='long', run_backward=False) """ TestConfig = namedtuple("TestConfig", "test_name input_config tag run_backward") BENCHMARK_TESTER = [] def _register_test(*test_metainfo): """save the metainfo needed to create a test. Currently test_metainfo takes two different inputs: 1) This input when adds single op to the benchmark _register_test(configs, pt_bench_op, create_pytorch_op_test_case, run_backward=True) 2) This input when adds a list of ops to the benchmark _register_test(configs, pt_bench_op, create_pytorch_op_test_case, run_backward=False, op_name_function=op) """ BENCHMARK_TESTER.append(test_metainfo) def _create_test( bench_op_obj, orig_test_attrs, tags, OperatorTestCase, run_backward, bwd_input ): """Create tests with the benchmark backend. Args: bench_op_obj: an object which instantiated from a subclass of TorchBenchmarkBase which includes tensor creation and operator execution. orig_test_attrs: a dictionary includes test configs. tags: a attribute in test config to filter inputs OperatorTestCase: a named tuple to save the metadata of an test run_backward: a bool parameter indicating backward path """ test_attrs = copy.deepcopy(orig_test_attrs) test_attrs = {k: str(v) for k, v in test_attrs.items()} ascii_test_attrs = ast.literal_eval(json.dumps(test_attrs)) input_config = str(ascii_test_attrs)[1:-1].replace("'", "") if bwd_input: # When auto_set is used, the test name needs to include input. test_attrs.update({"bwd": bwd_input}) test_name = bench_op_obj.test_name(**test_attrs) test_config = TestConfig(test_name, input_config, tags, run_backward) return OperatorTestCase(bench_op_obj, test_config) def _build_test( configs, bench_op, OperatorTestCase, run_backward, op_name_function=None ): """Generate PyTorch/Caffe2 tests of operators with different inputs. Args: configs: a dictionary that has the input shapes bench_op: a subclass of TorchBenchmarkBase which includes tensor creation and operator execution OperatorTestCase: a named tuple to save the metadata of an test run_backward: a bool parameter indicating backward path op_name_function: a dictionary includes operator name and function """ for config in configs: test_attrs = {} tags = None keep_config = True for attr in config: # tags is only used in our benchmark backend to filter tests and # it will be removed from config which is then passed to the init function # an example of config and atrr is: # config: [{'M': 16}, {'N': 16}, {'K': 64}, {'tags': 'short'}] # attr: {'tags': 'short'} if "tags" in attr: tags = attr["tags"] continue # if 'cuda' is specified in input shape but the testing machines doesn't # support, we will skip this input if "cuda" in attr.values(): if not torch.cuda.is_available(): keep_config = False break test_attrs.update(attr) if not keep_config: continue if tags is None: raise ValueError("Missing tags in configs") input_config = str(test_attrs)[1:-1].replace("'", "") op = bench_op() assert op is not None, "Can't create test" tensor_error_info = None # op_name_function is a dictionary which has op_name and op_function. # an example of op_name_function is: # {'op_name' : 'abs', 'op_function' : torch.abs} # op_function is concatenated with the input dict then passed to the init function # op_name is passed to the set_module_name function init_dict = copy.deepcopy(test_attrs) if op_name_function is not None: op_name = op_name_function["op_name"] init_dict.update({"op_func": op_name_function["op_func"]}) op.set_module_name(op_name) op._set_backward_test(run_backward) op.init(**init_dict) op.extract_inputs_tuple() if not run_backward: for attr in vars(op).values(): if isinstance(attr, torch.nn.Module): for param in attr.parameters(): param.requires_grad = False input_name = None # _num_inputs_require_grads is used to track the number of tensors # which use auto_set(). if op._num_inputs_require_grads > 0: input_name = "all" yield _create_test( op, test_attrs, tags, OperatorTestCase, run_backward, input_name ) # This for loop is only used when auto_set is used. # _pass_count counts how many times init has been called. # _auto_set_counter is reset after init is called. for i in range(op._num_inputs_require_grads): op._pass_count += 1 op._auto_set_counter = 0 # TODO(mingzhe09088): remove this deepcopy when we encounter # performance issue. new_op = copy.deepcopy(op) new_op.init(**init_dict) # Input name index will start from input1 input_name = i + 1 yield _create_test( new_op, test_attrs, tags, OperatorTestCase, run_backward, input_name ) class BenchmarkRunner: """BenchmarkRunner is responsible for benchmarking all the registered benchmark test groups. Attributes: tag_filter (str): control the benchmarks which matches the tag. operator (str): only run benchmark test cases that contains this filter string in the test case's id. test_name (str): only run benchmark test cases that matches this filter, this is a case-sensitive substring match and it happens in the _keep_test method. """ def __init__(self, args): # TODO: consider time-bound constraints as well. self.args = args self.iters = 100 self.has_explicit_iteration_count = False self.multiplier = 2 self.predefined_minimum_secs = 1 self.max_iters = 1e6 self.use_jit = args.use_jit self.num_runs = args.num_runs self.print_per_iter = False self.operator_range = benchmark_utils.get_operator_range(args.operator_range) # 100 is the default warmup iterations if self.args.warmup_iterations == -1: self.args.warmup_iterations = 100 if self.args.iterations and self.args.iterations != -1: self.has_explicit_iteration_count = True self.iters = self.args.iterations # when a specific test is selected by a user, we don't need # to match the tag anymore if self.args.test_name is not None: self.args.tag_filter = None def _print_header(self): DASH_LINE = "-" * 40 print( f"# {DASH_LINE}\n" "# PyTorch/Caffe2 Operator Micro-benchmarks\n" f"# {DASH_LINE}\n" f"# Tag : {self.args.tag_filter}\n" ) if self.args.list_tests: print("# List of tests:") elif self.args.list_ops: print("# List of Operators to run:") self.printed_ops_list = set() if self.args.operators: print(f"# {self.args.operators}") def _print_perf_result(self, reported_run_time_us, test_case): if self.args.report_aibench: # Output for AIBench # Print out per iteration execution time instead of avg time return test_name = "_".join([test_case.framework, test_case.test_config.test_name]) for run in range(self.num_runs): print( f"{test_case.framework}Observer " + json.dumps( { "type": test_name, "metric": "latency", "unit": "us", "value": str(reported_run_time_us[run]), } ) ) else: print(f"# Mode: {'JIT' if self.use_jit else 'Eager'}") print( f"# Name: {test_case.test_config.test_name}\n# Input: {test_case.test_config.input_config}" ) mode = "Backward" if test_case.test_config.run_backward else "Forward" if self.num_runs > 1: for run in range(self.num_runs): print( f"Run: {run}, {mode} Execution Time (us) : {reported_run_time_us[run]:.3f}" ) print() else: print(f"{mode} Execution Time (us) : {reported_run_time_us[0]:.3f}\n") def _predict_num_iter_needed(self, i): return i * self.multiplier def _iteration_result_is_significant( self, iters, run_time_sec, curr_test_total_time, has_explicit_iteration_count ): """This function decides whether the measured time can be reported based on the following conditions: 1) the number of iterations is larger than the max_iters. 2) the execution time is larger than the predefined minimum_time 3) the execution time is larger than user defined minimum_time """ return ( iters > self.max_iters or run_time_sec > self.predefined_minimum_secs or has_explicit_iteration_count ) and curr_test_total_time > self.args.min_time_per_test def _launch_forward(self, test_case, iters, print_per_iter): """Use Python's timeit module to measure execution time (unit: second).""" cuda_sync = "cuda" in test_case.test_config.test_name func = test_case.run_forward if self.use_jit: func = test_case.run_jit_forward forward_time = timeit.timeit( functools.partial(func, iters, print_per_iter, cuda_sync), number=1 ) return forward_time def _launch_backward(self, test_case, iters, print_per_iter=False): """This function runs forward path of an op to get an output. Then the backward path is executed and the execution time is reported """ test_case.run_forward(num_runs=1, print_per_iter=False, cuda_sync=False) test_case._output_mean() backward_time = timeit.timeit( functools.partial(test_case.run_backward, iters, print_per_iter), number=1 ) return backward_time def _measure_time(self, launch_test, test_case, iters, print_per_iter): """ This function execute the operator for <iters> iterations then look at the time. If it's not significant, the number of iterations will be increased before rerun. The execution stops when the time becomes significant. """ curr_test_total_time = 0 time_trace = [] while True: run_time_sec = launch_test(test_case, iters, print_per_iter) curr_test_total_time += run_time_sec # Analyze time after each run to decide if the result is stable results_are_significant = self._iteration_result_is_significant( iters, run_time_sec, curr_test_total_time, self.has_explicit_iteration_count, ) report_run_time = 1e6 * run_time_sec / iters time_trace.append(report_run_time) # Print out the time spent in each epoch in ms if self.args.report_aibench: mode = "JIT" if self.use_jit else "Eager" test_name = "_".join( [test_case.framework, test_case.test_config.test_name, mode] ) print( "PyTorchObserver " + json.dumps( { "type": test_name, "metric": "latency", "unit": "ms", "value": str(report_run_time / 1e3), } ) ) if results_are_significant: break # Re-estimate the hopefully-sufficient # iteration count, and run the benchmark again... iters = self._predict_num_iter_needed(iters) reported_run_time_us = np.percentile(np.array(time_trace), 50) return reported_run_time_us def _check_keep(self, test_flag, cmd_flag): return cmd_flag is None or test_flag == cmd_flag def _check_operator_first_char(self, test_flag, cmd_flag): return cmd_flag is None or test_flag[:1].lower() in cmd_flag def _check_keep_list(self, test_flag, cmd_flag_list): return cmd_flag_list is None or any( test_flag == cmd_flag for cmd_flag in cmd_flag_list ) def _keep_test(self, test_case): # TODO: consider regex matching for test filtering. # Currently, this is a sub-string matching. op_test_config = test_case.test_config operators = ( benchmark_utils.process_arg_list(self.args.operators) if self.args.operators else None ) # Filter framework, operator, test_name, tag, forward_only return ( self._check_keep(op_test_config.test_name, self.args.test_name) and self._check_keep_list(test_case.op_bench.module_name(), operators) and self._check_operator_first_char( test_case.op_bench.module_name(), self.operator_range ) and ( self.args.tag_filter == "all" or self._check_keep(op_test_config.tag, self.args.tag_filter) ) and ( not self.args.forward_only or op_test_config.run_backward != self.args.forward_only ) and ( self.args.device == "None" or "device" not in test_case.test_config.input_config or self.args.device in op_test_config.test_name ) ) def _print_test_case_info(self, test_case): # Print out the test name and skip the real execution if self.args.list_tests: print(f"# {test_case.test_config.test_name}") return True elif self.args.list_ops: if self.args.operators is None: op_name = test_case.op_bench.module_name() if op_name not in self.printed_ops_list: print(f"# {op_name}") self.printed_ops_list.add(op_name) return True return False def run(self): self._print_header() for test_metainfo in BENCHMARK_TESTER: for test in _build_test(*test_metainfo): full_test_id, test_case = test op_test_config = test_case.test_config if self._print_test_case_info(test_case): continue if not self._keep_test(test_case): continue # To reduce variance, fix a numpy randseed to the test case, # so that the randomly generated input tensors remain the # same for each test case. # The random seed is limited to 32-bit because of numpy # requirement. np.random.seed(seed=hash(full_test_id) & ((1 << 32) - 1)) print( f"# Benchmarking {test_case.framework}: {test_case.op_bench.module_name()}" ) if op_test_config.run_backward: launch_func = self._launch_backward else: launch_func = self._launch_forward # Warmup launch_func( test_case, self.args.warmup_iterations, print_per_iter=False ) # Actual Execution reported_time = [ self._measure_time( launch_func, test_case, self.iters, self.print_per_iter ) for _ in range(self.num_runs) ] self._print_perf_result(reported_time, test_case) ```
John Langford Pritchard (1799 – 5 August 1850) was an English actor, known as ‘Gentleman Pritchard’. Biography Pritchard was the son of a captain in the navy, was born, it is said, at sea, in 1799, and, adopting his father's profession, became a midshipman. After some practice as an amateur he joined a small company in Wales, and on 24 May 1820, as 'Pritchard from Cheltenham,' made his first appearance in Bath, playing Captain Absolute in the 'Rivals.' In August he played under Bunn, at the New Theatre, Birmingham, Lord Trinket, Sir Benjamin Backbite, and other parts, reappearing in Bath on 30 October as Irwin in Mrs. Inchbald's 'Every one has his Fault.' On 23 May 1821 he played Dumain (First Lord) in 'All's well that ends well.' In the summer of 1821 Pritchard joined the York circuit under Mansell, making his first appearance as Romeo. Parts such as Jaffrer, Pythias, Iago, Edmund in King Lear, Richmond, Jeremy Diddler, and Duke of Mirandola, were assigned him. He then joined Murray's company in Edinburgh, appearing on 16 January 1823 as Durimel in Charles Kemble's adaptation Point of Honour. Here, playing leading business, he remained eleven years. On 6 February he was the original Nigel in 'George Heriot,' an anonymous adaptation of the 'Fortunes of Nigel.' On 22 May 1824 he was Edward Waverley in a new version of 'Waverley,' and on 5 June Francies Tyrrell in James Planché's 'St. Ronan's Well.' On 21 January 1825 he played Rob Roy, a difficult feat in Edinburgh for an Englishman. He played on 23 May the Stranger in the 'Rose of Ettrick Vale,' on the 28th Redgauntlet. Soon afterwards he was Richard I in the 'Talisman,' and on 4 July George Douglas in 'Mary Stuart' (the Abbot); Harry Stanley in 'Paul Pry' followed. On 18 June 1826 he was Oliver Cromwell in Woodstock, or the Cavalier. Charles Edward, or the last of the Stuarts, adapted from the French by a son of Flora Macdonald, was given for the first time on 21 April 1829, with Pritchard as Charles Edward. In 1830-1 Pritchard went with Murray to the Adelphi Theatre (Edinburgh), where he appeared on 6 July 1831 as Abdar Khan in Mazeppa. In the Renegade by Maturin, Pritchard was Guiscard, and on 16 April 1832, in a week at Holyrood, was the first Wemyss of Logie. He was also seen as Joseph Surface. Pritchard appeared a few times at the Adelphi in the summer season, and then quitted Edinburgh. During his stay, he won very favourable recognition, artistic and social. He took a prominent part in establishing the Edinburgh Theatrical Fund (becoming the Honorary Secretary), and was a steward at the Fund dinner on 23 February 1827 when Walter Scott announced himself to be the author of Waverley. During his vacations he had played in Glasgow, Perth, Aberdeen, and other leading Scottish towns. On 5 October 1833 Pritchard made his first appearance in Dublin, playing Bassanio, and Petruchio; Wellborn to the Sir Giles Overreach of Charles Kean followed on the 7th. In Ireland, where he was hospitably entertained, he also played Jeremy Diddler. Mark Antony, and Meg Merrilies. His first appearance in London was made on 16 November 1835 at Covent Garden as Alonzo in Pizarro. He played Macduff, and was popular as Lindsay, an original part in Fitzball's 'Inheritance.' During William Macready's tenure of Covent Garden in 1838 he acted as his stage manager. During this time he reappeared as Don Pedro in the Wonder by Susanna Centlivre, Macready himself playing Don Felix, which was held to be Pritchard's great part. He took a secondary part in the performance of the 'Lady of Lyons,' and was the original Felton in Sheridan Knowles's Woman's Wit. Macready, with some apparent reason, was charged with keeping him back. Pritchard retired ultimately to the country, and became the manager and sole lessee of the York circuit for his final nine years of his life, where he continued to act. He died on 5 August 1850 and is buried in Leeds Cemetery. His best parts appear to have been Don Felix and Mercutio. Images External links John Langford Pritchard as Macduff in Macbeth. Richard James Lane, printed by Jérémie Graf, published by John Mitchell, after Alfred Edward Chalon. National Portrait Gallery, London. John Langford Pritchard (1799–1850), as Duke Aranza in The Honeymoon by John Tobin. Alexander Keith (active 1808–1874). ART UK - V&A References 1799 births 1850 deaths 19th-century English male actors English male stage actors
```java package com.beloo.widget.chipslayoutmanager.layouter.breaker; import com.beloo.widget.chipslayoutmanager.layouter.AbstractLayouter; /** this is basis row breaker for {@link com.beloo.widget.chipslayoutmanager.layouter.RTLUpLayouter} */ class RTLBackwardRowBreaker implements ILayoutRowBreaker { @Override public boolean isRowBroke(AbstractLayouter al) { return al.getViewLeft() + al.getCurrentViewWidth() > al.getCanvasRightBorder() && al.getViewLeft() > al.getCanvasLeftBorder(); } } ```
The 2014 Indian Super League Final was an association football match between the Kerala Blasters and ATK played on 20 December 2014, at the DY Patil Stadium in Navi Mumbai. The match was the final match to determine the inaugural champion of the Indian Super League for the 2014 season. The Kerala Blasters had qualified for the final through defeating the first-place regular season side, Chennaiyin, 4–3 on aggregate. ATK qualified after defeating Goa in a penalty shoot-out 4–2. Prior to the final, during the regular season, both sides played to a 1–1 draw at the Salt Lake Stadium while Kerala Blasters won the return match 2–1 in Kochi. ATK won the final to win the inaugural title of the league, with late substitute Mohammed Rafique scoring the only goal in added time. Road to the final The Indian Super League is a franchise league started between IMG-Reliance and STAR Sports with the objective of making football one of the main sports in India, as well as make it a known name in the world of football. The 2014 edition was the inaugural season of the Indian Super League. The Indian Super League, which started its inaugural season with eight franchises, acted in a round-robin format, with each team facing each other twice, home and away. The top four teams at the end of the 14-game regular season would qualify for the play-offs. The play-offs would feature a two-legged semi-final which would pit the first place team against the fourth place team, while second and third would face off against each other. The final would then be a one-legged affair at a neutral venue. Kerala Blasters The Kerala Blasters played their first ever game in the Indian Super League on 13 October 2014 against NorthEast United at the Indira Gandhi Athletic Stadium. They lost the match 0–1 after Koke found the net in the 45th minute. It took till 26 October 2014, the Blasters' third game, before they gained their first ever point in the Indian Super League. It was against their future final opponents, ATK, at the Salt Lake Stadium. Iain Hume scored the equalizer for the Blasters after Baljit Sahni gave the Kolkata side the lead. In the next game, four days later, the Blasters recorded their first ever victory against Pune City at the Balewadi Sports Complex. David Trezeguet gave Pune City the lead in the 15th minute before Chinadorai Sabeeth scored a 41st-minute equalizer. Penn Orji scored the winner for the Blasters in the 65th minute as they ran out with a 2–1 scoreline. The team played their first home match of the season on 6 November 2014 against Goa. A goal from Milagres Gonsalves helped the Kerala Blasters win 1–0 in front of over 55,000 fans. In the end, the Kerala Blasters managed to just qualify for the finals of the Indian Super League when they defeated Pune City 1–0 at home with Iain Hume scoring his fourth goal of the season. In the semi-finals, the Kerala Blasters were set to take on the regular season winners, Chennaiyin. The first leg took place at home for the Kerala Blasters, the Jawaharlal Nehru Stadium in Kochi, on 13 December 2014. The match could not have been any better for the Kerala Blasters as goals from Ishfaq Ahmed, Iain Hume, and Sushanth Mathew gave the Kerala Blasters a 3–0 advantage heading to Chennai. The second leg took place three days later at the Jawaharlal Nehru Stadium in Chennai. Despite heading into the game leading 3–0 on aggregate, the Blasters managed to concede three goals to Chennaiyin in the second leg and thus bring the game into extra-time. Just as it looked like the game was going to be settled in a penalty shoot-out, the Blasters managed to steal the tie when Stephen Pearson scored in the 117th minute and thus help the Kerala Blasters win 4–3 on aggregate. Atlético de Kolkata Atlético de Kolkata played in the first ever Indian Super League match on 12 October 2014 against Mumbai City at the Salt Lake Stadium. Goals from Fikru Teferra, Borja Fernández, and Arnal helped Kolkata win the inaugural match 3–0. They played their first road match four days later against NorthEast United at the Indira Gandhi Athletic Stadium. Kolkata won the match 2–0 with goals coming from Fikru Teferra and Jakub Podaný. ATK qualified for the play-offs after they drew Goa at the Salt Lake Stadium 1–1 on 10 December 2014. Edgar Marcelino scored first to give Goa the lead before Fikru scored the equalizer for Kolkata. In the semi-finals, Atlético de Kolkata once again took on Goa. The first leg at the Salt Lake Stadium ended in a 0–0 draw. The second leg at the Fatorda Stadium also ended 0–0 and after the tie could not be settled in extra-time that meant the game went into penalty-kicks. Atlético de Kolkata won the shoot-out 4–2 after André Santos and Zohib Islam Amiri missed their penalties for Goa and Kolkata converted all four of theirs. Pre-match Officials Uzbekistani referee, Ravshan Irmatov, was selected as the referee for the final. He had previously officiated the match between the Kerala Blasters and Atlético de Kolkata almost a month before the final on 21 November. He booked seven players that night as the Kerala Blasters won 2–1. Venue In early December 2014 it was announced that the DY Patil Stadium in Navi Mumbai would host the final of the Indian Super League. It was also announced that tickets for the final would be available online from 8 December 2014. On 18 December 2014, one day after the semi-finals had concluded, it was reported that a packed crowd was expected for the final. According to the owner of the DY Patil Stadium, Vijay Patil, the stands during the Indian Super League final will be just as full as they were during the 2008 Indian Premier League final. Due to the strong celebrity influence expected at the Indian Super League final it was reported that over 250 police officers would be in attendance at the stadium to maintain order of the crowd. It was also reported that over 150 personnel would be brought in to man the streets outside the stadium. Analysis Going into the final, former India national team captain, Baichung Bhutia, predicted Atlético de Kolkata to go on and win the final. Before this match, the Kerala Blasters and Atlético de Kolkata had played each other twice during the regular season. Their first match against each other, on 26 October 2014, ended in a 1–1 draw at the Salt Lake Stadium. Baljit Sahni scored the opening goal in the 22nd minute before Iain Hume equalized for the Blasters to earn the Blasters their first point of the season. In the second game, on 21 November 2014, it was the Kerala Blasters who came out on top as 2–1 winners. Iain Hume and Pedro Gusmão gave the Blasters the 2–0 lead before Fikru Teferra scored the consolation for Kolkata. Match Team selection Coming into the match, the Kerala Blasters made a couple necessary defensive changes from the squad that faced Chennaiyin in the semi-finals. David James replaced the injured Sandip Nandy in goal, while Saumik Dey and Nirmal Chettri replaced the suspended pair of Jamie McAllister and Gurwinder Singh in the middle of defense. Atlético de Kolkata head coach, Antonio Lopez Habas, meanwhile decided to bench the team's marquee player, Luis García, and instead started Arnal in central midfield. Habas also decided to switch to playing four defenders instead of three, which meant that Kingshuk Debnath started the match while Lester Fernandez moved to the bench. Summary The first opportunity of the match came in the fifth minute when Kerala Blasters midfielder, Iain Hume, put Michael Chopra through on goal only for Josemi to deny Chopra with a last-minute tackle. The Blasters then had the second realistic chance of the match five minutes later when Pulga received the ball in the box from Saumik Dey but his shot went out for a corner after a deflection off Atlético's Borja Fernández. The pressure continued to mount on Atlético de Kolkata as their goalkeeper Apoula Edel was forced into action; first he had to punch away a direct free-kick from Stephen Pearson before Ishfaq Ahmed's shot moments later was caught by the keeper. Atlético de Kolkata had their first major chance of the match in the 26th minute when Arnal put Mohammed Rafi through on goal, only for Nirmal Chettri to make a last-ditch tackle to keep the score level. The score would remain 0–0 going into half time. Atlético de Kolkata had the first major opportunity of the second half when Jakub Podaný crossed the ball into the box with both Baljit Sahni and Arnal looking to head it in before David James came out to catch the ball. The Kerala Blasters soon had three chances in three minutes but could not convert any of those into goals. Just after the 60th minute, Kerala Blasters defender Sandesh Jhingan almost headed the ball into his own net while trying to clear it. The Kerala Blasters continued to have the most chances throughout the match, which was compounded in the last minute of regulation time when Michael Chopra had his point blank range shot saved by Apoula Edel. Four minutes later, in the final minute of stoppage time, Atlético de Kolkata substitute Mohammed Rafique headed home a corner from Podaný to win the match and the championship. Details Post-match Atlético de Kolkata head coach Habas lauded his players after the final: "I must thank my players for they have been magnificent. I cannot ask them for anything more, for they have given me the ultimate gift." He also praised his backroom staff: "I must thank my entire support staff, for without them, I would not have been able to function. The owners have been fantastic and have supported us through thick and thin. This title is for the fans as they have been our strength." Habas was also delighted that the match was won from a goal scored by an Indian player, saying, "I think it is marvellous that Rafique got the winning goal. It is fantastic that an Indian player settled the contest." Despite the defeat, David James expressed his opinions over them match while also suggesting that the match would most likely be his last in the Indian Super League. After scoring the winning goal for his side, Mohammed Rafique was very happy while also singing the praises of his coach, saying, "I cannot describe what I am feeling in words," said the midfielder. "I would like to thank my coach, who had faith in me. It was he who decided to bring me on and what happened next was surreal. People dream of scoring in a final and I am very fortunate that I got to experience that in the flesh." References 1 Indian Super League finals Kerala Blasters FC matches ATK (football club) matches 2014 in Maharashtra
```toml [build-system] build-backend = "hatchling.build" requires = ["hatchling"] [project] authors = [{ name = "Geoff Boeing", email = "boeing@usc.edu" }] classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: GIS", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Scientific/Engineering :: Mathematics", "Topic :: Scientific/Engineering :: Physics", "Topic :: Scientific/Engineering :: Visualization", ] dependencies = [ "geopandas>=1.0", "networkx>=2.5", "numpy>=1.22", "pandas>=1.4", "requests>=2.27", "shapely>=2.0", ] description = "Download, model, analyze, and visualize street networks and other geospatial features from OpenStreetMap" dynamic = ["version"] keywords = ["GIS", "Networks", "OpenStreetMap", "Routing"] maintainers = [{ name = "OSMnx contributors" }] name = "osmnx" readme = "README.md" requires-python = ">=3.9" # match classifiers above and ruff/mypy versions below [project.optional-dependencies] entropy = ["scipy>=1.5"] neighbors = ["scikit-learn>=0.23", "scipy>=1.5"] raster = ["rasterio>=1.3", "rio-vrt>=0.3"] visualization = ["matplotlib>=3.5"] [project.urls] Documentation = "path_to_url" "Code Repository" = "path_to_url" "Examples Gallery" = "path_to_url" [tool.coverage.report] exclude_also = ["@overload", "if TYPE_CHECKING:"] [tool.hatch.build] packages = ["osmnx"] [tool.hatch.version] path = "osmnx/_version.py" [tool.mypy] cache_dir = "~/.cache/mypy" ignore_missing_imports = true python_version = "3.9" strict = true warn_no_return = true warn_unreachable = true [tool.ruff] cache-dir = "~/.cache/ruff" exclude = ["build/*"] line-length = 100 [tool.ruff.lint] extend-ignore = ["N803", "N806", "SLF001"] extend-select = ["ALL"] [tool.ruff.lint.isort] force-single-line = true [tool.ruff.lint.mccabe] max-complexity = 14 [tool.ruff.lint.pycodestyle] max-line-length = 110 # line length + 10% since it isn't a hard upper bound [tool.ruff.lint.pydocstyle] convention = "numpy" [tool.ruff.lint.pylint] max-args = 8 ```
```css [data-md-color-primary="rook-blue"] { --md-primary-fg-color: #2ac6ea; } ```
```html <!DOCTYPE html> <html xmlns="path_to_url"><head><title>Operator (owl-base.Owl_computation_engine.Make_Graph.Optimiser.Operator)</title><meta charset="utf-8"/><link rel="stylesheet" href="../../../../../odoc.support/odoc.css"/><meta name="generator" content="odoc 2.4.2"/><meta name="viewport" content="width=device-width,initial-scale=1.0"/><script src="../../../../../odoc.support/highlight.pack.js"></script><script>hljs.initHighlightingOnLoad();</script></head><body class="odoc"><nav class="odoc-nav"><a href="../index.html">Up</a> <a href="../../../../index.html">owl-base</a> &#x00BB; <a href="../../../index.html">Owl_computation_engine</a> &#x00BB; <a href="../../index.html">Make_Graph</a> &#x00BB; <a href="../index.html">Optimiser</a> &#x00BB; Operator</nav><header class="odoc-preamble"><h1>Module <code><span>Optimiser.Operator</span></code></h1></header><div class="odoc-content"><div class="odoc-spec"><div class="spec module anchored" id="module-Symbol"><a href="#module-Symbol" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Symbol/index.html">Symbol</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-noop"><a href="#val-noop" class="anchor"></a><code><span><span class="keyword">val</span> noop : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-empty"><a href="#val-empty" class="anchor"></a><code><span><span class="keyword">val</span> empty : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-zeros"><a href="#val-zeros" class="anchor"></a><code><span><span class="keyword">val</span> zeros : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ones"><a href="#val-ones" class="anchor"></a><code><span><span class="keyword">val</span> ones : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-create"><a href="#val-create" class="anchor"></a><code><span><span class="keyword">val</span> create : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sequential"><a href="#val-sequential" class="anchor"></a><code><span><span class="keyword">val</span> sequential : <span><span class="optlabel">?a</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?step</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-uniform"><a href="#val-uniform" class="anchor"></a><code><span><span class="keyword">val</span> uniform : <span><span class="optlabel">?a</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?b</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-gaussian"><a href="#val-gaussian" class="anchor"></a><code><span><span class="keyword">val</span> gaussian : <span><span class="optlabel">?mu</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?sigma</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-bernoulli"><a href="#val-bernoulli" class="anchor"></a><code><span><span class="keyword">val</span> bernoulli : <span><span class="optlabel">?p</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-init"><a href="#val-init" class="anchor"></a><code><span><span class="keyword">val</span> init : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span>int <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a>)</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-init_nd"><a href="#val-init_nd" class="anchor"></a><code><span><span class="keyword">val</span> init_nd : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a>)</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-shape"><a href="#val-shape" class="anchor"></a><code><span><span class="keyword">val</span> shape : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span>int array</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-numel"><a href="#val-numel" class="anchor"></a><code><span><span class="keyword">val</span> numel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get"><a href="#val-get" class="anchor"></a><code><span><span class="keyword">val</span> get : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set"><a href="#val-set" class="anchor"></a><code><span><span class="keyword">val</span> set : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_slice"><a href="#val-get_slice" class="anchor"></a><code><span><span class="keyword">val</span> get_slice : <span><span><span>int list</span> list</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_slice"><a href="#val-set_slice" class="anchor"></a><code><span><span class="keyword">val</span> set_slice : <span><span><span>int list</span> list</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-get_fancy"><a href="#val-get_fancy" class="anchor"></a><code><span><span class="keyword">val</span> get_fancy : <span><span><a href="../../../../Owl_types/index.html#type-index">Owl_types.index</a> list</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-set_fancy"><a href="#val-set_fancy" class="anchor"></a><code><span><span class="keyword">val</span> set_fancy : <span><span><a href="../../../../Owl_types/index.html#type-index">Owl_types.index</a> list</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-copy"><a href="#val-copy" class="anchor"></a><code><span><span class="keyword">val</span> copy : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-copy_"><a href="#val-copy_" class="anchor"></a><code><span><span class="keyword">val</span> copy_ : <span><span class="label">out</span>:<span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-reset"><a href="#val-reset" class="anchor"></a><code><span><span class="keyword">val</span> reset : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-reshape"><a href="#val-reshape" class="anchor"></a><code><span><span class="keyword">val</span> reshape : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-reverse"><a href="#val-reverse" class="anchor"></a><code><span><span class="keyword">val</span> reverse : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tile"><a href="#val-tile" class="anchor"></a><code><span><span class="keyword">val</span> tile : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-repeat"><a href="#val-repeat" class="anchor"></a><code><span><span class="keyword">val</span> repeat : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pad"><a href="#val-pad" class="anchor"></a><code><span><span class="keyword">val</span> pad : <span><span class="optlabel">?v</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span><span>int list</span> list</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-expand"><a href="#val-expand" class="anchor"></a><code><span><span class="keyword">val</span> expand : <span><span class="optlabel">?hi</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-squeeze"><a href="#val-squeeze" class="anchor"></a><code><span><span class="keyword">val</span> squeeze : <span><span class="optlabel">?axis</span>:<span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-concatenate"><a href="#val-concatenate" class="anchor"></a><code><span><span class="keyword">val</span> concatenate : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-stack"><a href="#val-stack" class="anchor"></a><code><span><span class="keyword">val</span> stack : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-concat"><a href="#val-concat" class="anchor"></a><code><span><span class="keyword">val</span> concat : <span><span class="label">axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-split"><a href="#val-split" class="anchor"></a><code><span><span class="keyword">val</span> split : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span class="type-var">'c</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-draw"><a href="#val-draw" class="anchor"></a><code><span><span class="keyword">val</span> draw : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span>int <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> * <span><span class="type-var">'a</span> array</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-map"><a href="#val-map" class="anchor"></a><code><span><span class="keyword">val</span> map : <span><span>(<span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-fold"><a href="#val-fold" class="anchor"></a><code><span><span class="keyword">val</span> fold : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scan"><a href="#val-scan" class="anchor"></a><code><span><span class="keyword">val</span> scan : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-one_hot"><a href="#val-one_hot" class="anchor"></a><code><span><span class="keyword">val</span> one_hot : <span>int <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-delay"><a href="#val-delay" class="anchor"></a><code><span><span class="keyword">val</span> delay : <span><span>(<span><a href="Symbol/Shape/Type/Device/A/index.html#type-arr">Symbol.Shape.Type.Device.A.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/Device/A/index.html#type-arr">Symbol.Shape.Type.Device.A.arr</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-delay_array"><a href="#val-delay_array" class="anchor"></a><code><span><span class="keyword">val</span> delay_array : <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>(<span><span><a href="Symbol/Shape/Type/Device/A/index.html#type-arr">Symbol.Shape.Type.Device.A.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/Device/A/index.html#type-arr">Symbol.Shape.Type.Device.A.arr</a>)</span> <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-lazy_print"><a href="#val-lazy_print" class="anchor"></a><code><span><span class="keyword">val</span> lazy_print : <span><span class="optlabel">?max_row</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?max_col</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?header</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?fmt</span>:<span>(<span><a href="Symbol/Shape/Type/Device/A/index.html#type-elt">Symbol.Shape.Type.Device.A.elt</a> <span class="arrow">&#45;&gt;</span></span> string)</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-print"><a href="#val-print" class="anchor"></a><code><span><span class="keyword">val</span> print : <span><span class="optlabel">?max_row</span>:<span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?max_col</span>:<span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?header</span>:<span class="type-var">'c</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?fmt</span>:<span class="type-var">'d</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'e</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-abs"><a href="#val-abs" class="anchor"></a><code><span><span class="keyword">val</span> abs : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-neg"><a href="#val-neg" class="anchor"></a><code><span><span class="keyword">val</span> neg : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-floor"><a href="#val-floor" class="anchor"></a><code><span><span class="keyword">val</span> floor : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-ceil"><a href="#val-ceil" class="anchor"></a><code><span><span class="keyword">val</span> ceil : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-round"><a href="#val-round" class="anchor"></a><code><span><span class="keyword">val</span> round : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sqr"><a href="#val-sqr" class="anchor"></a><code><span><span class="keyword">val</span> sqr : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sqrt"><a href="#val-sqrt" class="anchor"></a><code><span><span class="keyword">val</span> sqrt : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log"><a href="#val-log" class="anchor"></a><code><span><span class="keyword">val</span> log : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log2"><a href="#val-log2" class="anchor"></a><code><span><span class="keyword">val</span> log2 : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log10"><a href="#val-log10" class="anchor"></a><code><span><span class="keyword">val</span> log10 : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-exp"><a href="#val-exp" class="anchor"></a><code><span><span class="keyword">val</span> exp : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sin"><a href="#val-sin" class="anchor"></a><code><span><span class="keyword">val</span> sin : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-cos"><a href="#val-cos" class="anchor"></a><code><span><span class="keyword">val</span> cos : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tan"><a href="#val-tan" class="anchor"></a><code><span><span class="keyword">val</span> tan : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sinh"><a href="#val-sinh" class="anchor"></a><code><span><span class="keyword">val</span> sinh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-cosh"><a href="#val-cosh" class="anchor"></a><code><span><span class="keyword">val</span> cosh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-tanh"><a href="#val-tanh" class="anchor"></a><code><span><span class="keyword">val</span> tanh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-asin"><a href="#val-asin" class="anchor"></a><code><span><span class="keyword">val</span> asin : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-acos"><a href="#val-acos" class="anchor"></a><code><span><span class="keyword">val</span> acos : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-atan"><a href="#val-atan" class="anchor"></a><code><span><span class="keyword">val</span> atan : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-asinh"><a href="#val-asinh" class="anchor"></a><code><span><span class="keyword">val</span> asinh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-acosh"><a href="#val-acosh" class="anchor"></a><code><span><span class="keyword">val</span> acosh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-atanh"><a href="#val-atanh" class="anchor"></a><code><span><span class="keyword">val</span> atanh : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-min"><a href="#val-min" class="anchor"></a><code><span><span class="keyword">val</span> min : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?keep_dims</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max"><a href="#val-max" class="anchor"></a><code><span><span class="keyword">val</span> max : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?keep_dims</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sum"><a href="#val-sum" class="anchor"></a><code><span><span class="keyword">val</span> sum : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?keep_dims</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sum_reduce"><a href="#val-sum_reduce" class="anchor"></a><code><span><span class="keyword">val</span> sum_reduce : <span><span class="optlabel">?axis</span>:<span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-signum"><a href="#val-signum" class="anchor"></a><code><span><span class="keyword">val</span> signum : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sigmoid"><a href="#val-sigmoid" class="anchor"></a><code><span><span class="keyword">val</span> sigmoid : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-relu"><a href="#val-relu" class="anchor"></a><code><span><span class="keyword">val</span> relu : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dawsn"><a href="#val-dawsn" class="anchor"></a><code><span><span class="keyword">val</span> dawsn : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-min'"><a href="#val-min'" class="anchor"></a><code><span><span class="keyword">val</span> min' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max'"><a href="#val-max'" class="anchor"></a><code><span><span class="keyword">val</span> max' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sum'"><a href="#val-sum'" class="anchor"></a><code><span><span class="keyword">val</span> sum' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log_sum_exp'"><a href="#val-log_sum_exp'" class="anchor"></a><code><span><span class="keyword">val</span> log_sum_exp' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-log_sum_exp"><a href="#val-log_sum_exp" class="anchor"></a><code><span><span class="keyword">val</span> log_sum_exp : <span><span class="optlabel">?axis</span>:int <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?keep_dims</span>:bool <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-l1norm'"><a href="#val-l1norm'" class="anchor"></a><code><span><span class="keyword">val</span> l1norm' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-l2norm'"><a href="#val-l2norm'" class="anchor"></a><code><span><span class="keyword">val</span> l2norm' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-l2norm_sqr'"><a href="#val-l2norm_sqr'" class="anchor"></a><code><span><span class="keyword">val</span> l2norm_sqr' : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-clip_by_value"><a href="#val-clip_by_value" class="anchor"></a><code><span><span class="keyword">val</span> clip_by_value : <span><span class="optlabel">?amin</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="optlabel">?amax</span>:<a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-clip_by_l2norm"><a href="#val-clip_by_l2norm" class="anchor"></a><code><span><span class="keyword">val</span> clip_by_l2norm : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pow"><a href="#val-pow" class="anchor"></a><code><span><span class="keyword">val</span> pow : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_pow"><a href="#val-scalar_pow" class="anchor"></a><code><span><span class="keyword">val</span> scalar_pow : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-pow_scalar"><a href="#val-pow_scalar" class="anchor"></a><code><span><span class="keyword">val</span> pow_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-atan2"><a href="#val-atan2" class="anchor"></a><code><span><span class="keyword">val</span> atan2 : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_atan2"><a href="#val-scalar_atan2" class="anchor"></a><code><span><span class="keyword">val</span> scalar_atan2 : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-atan2_scalar"><a href="#val-atan2_scalar" class="anchor"></a><code><span><span class="keyword">val</span> atan2_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-hypot"><a href="#val-hypot" class="anchor"></a><code><span><span class="keyword">val</span> hypot : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-min2"><a href="#val-min2" class="anchor"></a><code><span><span class="keyword">val</span> min2 : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max2"><a href="#val-max2" class="anchor"></a><code><span><span class="keyword">val</span> max2 : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add"><a href="#val-add" class="anchor"></a><code><span><span class="keyword">val</span> add : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sub"><a href="#val-sub" class="anchor"></a><code><span><span class="keyword">val</span> sub : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-mul"><a href="#val-mul" class="anchor"></a><code><span><span class="keyword">val</span> mul : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-div"><a href="#val-div" class="anchor"></a><code><span><span class="keyword">val</span> div : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-add_scalar"><a href="#val-add_scalar" class="anchor"></a><code><span><span class="keyword">val</span> add_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-sub_scalar"><a href="#val-sub_scalar" class="anchor"></a><code><span><span class="keyword">val</span> sub_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-mul_scalar"><a href="#val-mul_scalar" class="anchor"></a><code><span><span class="keyword">val</span> mul_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-div_scalar"><a href="#val-div_scalar" class="anchor"></a><code><span><span class="keyword">val</span> div_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_add"><a href="#val-scalar_add" class="anchor"></a><code><span><span class="keyword">val</span> scalar_add : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_sub"><a href="#val-scalar_sub" class="anchor"></a><code><span><span class="keyword">val</span> scalar_sub : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_mul"><a href="#val-scalar_mul" class="anchor"></a><code><span><span class="keyword">val</span> scalar_mul : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-scalar_div"><a href="#val-scalar_div" class="anchor"></a><code><span><span class="keyword">val</span> scalar_div : <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-fma"><a href="#val-fma" class="anchor"></a><code><span><span class="keyword">val</span> fma : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_equal"><a href="#val-elt_equal" class="anchor"></a><code><span><span class="keyword">val</span> elt_equal : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_not_equal"><a href="#val-elt_not_equal" class="anchor"></a><code><span><span class="keyword">val</span> elt_not_equal : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_less"><a href="#val-elt_less" class="anchor"></a><code><span><span class="keyword">val</span> elt_less : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_greater"><a href="#val-elt_greater" class="anchor"></a><code><span><span class="keyword">val</span> elt_greater : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_less_equal"><a href="#val-elt_less_equal" class="anchor"></a><code><span><span class="keyword">val</span> elt_less_equal : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_greater_equal"><a href="#val-elt_greater_equal" class="anchor"></a><code><span><span class="keyword">val</span> elt_greater_equal : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_equal_scalar"><a href="#val-elt_equal_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_equal_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_not_equal_scalar"><a href="#val-elt_not_equal_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_not_equal_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_less_scalar"><a href="#val-elt_less_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_less_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_greater_scalar"><a href="#val-elt_greater_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_greater_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_less_equal_scalar"><a href="#val-elt_less_equal_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_less_equal_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-elt_greater_equal_scalar"><a href="#val-elt_greater_equal_scalar" class="anchor"></a><code><span><span class="keyword">val</span> elt_greater_equal_scalar : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv1d"><a href="#val-conv1d" class="anchor"></a><code><span><span class="keyword">val</span> conv1d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv2d"><a href="#val-conv2d" class="anchor"></a><code><span><span class="keyword">val</span> conv2d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv3d"><a href="#val-conv3d" class="anchor"></a><code><span><span class="keyword">val</span> conv3d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv1d"><a href="#val-transpose_conv1d" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv1d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv2d"><a href="#val-transpose_conv2d" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv2d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv3d"><a href="#val-transpose_conv3d" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv3d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv1d"><a href="#val-dilated_conv1d" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv1d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv2d"><a href="#val-dilated_conv2d" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv2d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv3d"><a href="#val-dilated_conv3d" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv3d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool1d"><a href="#val-max_pool1d" class="anchor"></a><code><span><span class="keyword">val</span> max_pool1d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool2d"><a href="#val-max_pool2d" class="anchor"></a><code><span><span class="keyword">val</span> max_pool2d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool3d"><a href="#val-max_pool3d" class="anchor"></a><code><span><span class="keyword">val</span> max_pool3d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool1d"><a href="#val-avg_pool1d" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool1d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool2d"><a href="#val-avg_pool2d" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool2d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool3d"><a href="#val-avg_pool3d" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool3d : <span><span class="optlabel">?padding</span>:<a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-upsampling2d"><a href="#val-upsampling2d" class="anchor"></a><code><span><span class="keyword">val</span> upsampling2d : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv1d_backward_input"><a href="#val-conv1d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> conv1d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv1d_backward_kernel"><a href="#val-conv1d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> conv1d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv2d_backward_input"><a href="#val-conv2d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> conv2d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv2d_backward_kernel"><a href="#val-conv2d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> conv2d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv3d_backward_input"><a href="#val-conv3d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> conv3d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-conv3d_backward_kernel"><a href="#val-conv3d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> conv3d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv1d_backward_input"><a href="#val-transpose_conv1d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv1d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv1d_backward_kernel"><a href="#val-transpose_conv1d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv1d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv2d_backward_input"><a href="#val-transpose_conv2d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv2d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv2d_backward_kernel"><a href="#val-transpose_conv2d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv2d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv3d_backward_input"><a href="#val-transpose_conv3d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv3d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose_conv3d_backward_kernel"><a href="#val-transpose_conv3d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> transpose_conv3d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv1d_backward_input"><a href="#val-dilated_conv1d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv1d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv1d_backward_kernel"><a href="#val-dilated_conv1d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv1d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv2d_backward_input"><a href="#val-dilated_conv2d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv2d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv2d_backward_kernel"><a href="#val-dilated_conv2d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv2d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv3d_backward_input"><a href="#val-dilated_conv3d_backward_input" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv3d_backward_input : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dilated_conv3d_backward_kernel"><a href="#val-dilated_conv3d_backward_kernel" class="anchor"></a><code><span><span class="keyword">val</span> dilated_conv3d_backward_kernel : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool1d_backward"><a href="#val-max_pool1d_backward" class="anchor"></a><code><span><span class="keyword">val</span> max_pool1d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool2d_backward"><a href="#val-max_pool2d_backward" class="anchor"></a><code><span><span class="keyword">val</span> max_pool2d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-max_pool3d_backward"><a href="#val-max_pool3d_backward" class="anchor"></a><code><span><span class="keyword">val</span> max_pool3d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool1d_backward"><a href="#val-avg_pool1d_backward" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool1d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool2d_backward"><a href="#val-avg_pool2d_backward" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool2d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-avg_pool3d_backward"><a href="#val-avg_pool3d_backward" class="anchor"></a><code><span><span class="keyword">val</span> avg_pool3d_backward : <span><a href="../../../../Owl_types/index.html#type-padding">Owl_types.padding</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-upsampling2d_backward"><a href="#val-upsampling2d_backward" class="anchor"></a><code><span><span class="keyword">val</span> upsampling2d_backward : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-row_num"><a href="#val-row_num" class="anchor"></a><code><span><span class="keyword">val</span> row_num : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-col_num"><a href="#val-col_num" class="anchor"></a><code><span><span class="keyword">val</span> col_num : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> int</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-row"><a href="#val-row" class="anchor"></a><code><span><span class="keyword">val</span> row : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-rows"><a href="#val-rows" class="anchor"></a><code><span><span class="keyword">val</span> rows : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-copy_row_to"><a href="#val-copy_row_to" class="anchor"></a><code><span><span class="keyword">val</span> copy_row_to : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-copy_col_to"><a href="#val-copy_col_to" class="anchor"></a><code><span><span class="keyword">val</span> copy_col_to : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'b</span> <span class="arrow">&#45;&gt;</span></span> unit</span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-diag"><a href="#val-diag" class="anchor"></a><code><span><span class="keyword">val</span> diag : <span><span class="optlabel">?k</span>:int <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-trace"><a href="#val-trace" class="anchor"></a><code><span><span class="keyword">val</span> trace : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-dot"><a href="#val-dot" class="anchor"></a><code><span><span class="keyword">val</span> dot : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-transpose"><a href="#val-transpose" class="anchor"></a><code><span><span class="keyword">val</span> transpose : <span><span class="optlabel">?axis</span>:<span>int array</span> <span class="arrow">&#45;&gt;</span></span> <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_rows"><a href="#val-to_rows" class="anchor"></a><code><span><span class="keyword">val</span> to_rows : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> array</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-of_rows"><a href="#val-of_rows" class="anchor"></a><code><span><span class="keyword">val</span> of_rows : <span><span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_cols"><a href="#val-to_cols" class="anchor"></a><code><span><span class="keyword">val</span> to_cols : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span class="type-var">'a</span> array</span></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-of_cols"><a href="#val-of_cols" class="anchor"></a><code><span><span class="keyword">val</span> of_cols : <span><span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-of_array"><a href="#val-of_array" class="anchor"></a><code><span><span class="keyword">val</span> of_array : <span><span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> array</span> <span class="arrow">&#45;&gt;</span></span> <span><span>int array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-of_arrays"><a href="#val-of_arrays" class="anchor"></a><code><span><span class="keyword">val</span> of_arrays : <span><span><span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> array</span> array</span> <span class="arrow">&#45;&gt;</span></span> <a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a></span></code></div></div><div class="odoc-spec"><div class="spec value anchored" id="val-to_arrays"><a href="#val-to_arrays" class="anchor"></a><code><span><span class="keyword">val</span> to_arrays : <span><a href="Symbol/Shape/Type/index.html#type-arr">Symbol.Shape.Type.arr</a> <span class="arrow">&#45;&gt;</span></span> <span><span><a href="Symbol/Shape/Type/index.html#type-elt">Symbol.Shape.Type.elt</a> array</span> array</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Scalar"><a href="#module-Scalar" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Scalar/index.html">Scalar</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Mat"><a href="#module-Mat" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Mat/index.html">Mat</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div><div class="odoc-spec"><div class="spec module anchored" id="module-Linalg"><a href="#module-Linalg" class="anchor"></a><code><span><span class="keyword">module</span> <a href="Linalg/index.html">Linalg</a></span><span> : <span class="keyword">sig</span> ... <span class="keyword">end</span></span></code></div></div></div></body></html> ```
```objective-c // // AppLockConfigurationViewController.h // Strongbox // // Created by Strongbox on 18/02/2022. // #import "StaticDataTableViewController.h" NS_ASSUME_NONNULL_BEGIN @interface AppLockConfigurationViewController : StaticDataTableViewController @end NS_ASSUME_NONNULL_END ```
Stiphilus quadripunctatus is a species of beetle in the family Cerambycidae, the only species in the genus Stiphilus. References Trachyderini Monotypic beetle genera
```go /* path_to_url Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ // Package lru implements an LRU cache. package lru import "container/list" // Cache is an LRU cache. It is not safe for concurrent access. type Cache struct { // MaxEntries is the maximum number of cache entries before // an item is evicted. Zero means no limit. MaxEntries int // OnEvicted optionally specificies a callback function to be // executed when an entry is purged from the cache. OnEvicted func(key Key, value interface{}) ll *list.List cache map[interface{}]*list.Element } // A Key may be any value that is comparable. See path_to_url#Comparison_operators type Key interface{} type entry struct { key Key value interface{} } // New creates a new Cache. // If maxEntries is zero, the cache has no limit and it's assumed // that eviction is done by the caller. func New(maxEntries int) *Cache { return &Cache{ MaxEntries: maxEntries, ll: list.New(), cache: make(map[interface{}]*list.Element), } } // Add adds a value to the cache. func (c *Cache) Add(key Key, value interface{}) { if c.cache == nil { c.cache = make(map[interface{}]*list.Element) c.ll = list.New() } if ee, ok := c.cache[key]; ok { c.ll.MoveToFront(ee) ee.Value.(*entry).value = value return } ele := c.ll.PushFront(&entry{key, value}) c.cache[key] = ele if c.MaxEntries != 0 && c.ll.Len() > c.MaxEntries { c.RemoveOldest() } } // Get looks up a key's value from the cache. func (c *Cache) Get(key Key) (value interface{}, ok bool) { if c.cache == nil { return } if ele, hit := c.cache[key]; hit { c.ll.MoveToFront(ele) return ele.Value.(*entry).value, true } return } // Remove removes the provided key from the cache. func (c *Cache) Remove(key Key) { if c.cache == nil { return } if ele, hit := c.cache[key]; hit { c.removeElement(ele) } } // RemoveOldest removes the oldest item from the cache. func (c *Cache) RemoveOldest() { if c.cache == nil { return } ele := c.ll.Back() if ele != nil { c.removeElement(ele) } } func (c *Cache) removeElement(e *list.Element) { c.ll.Remove(e) kv := e.Value.(*entry) delete(c.cache, kv.key) if c.OnEvicted != nil { c.OnEvicted(kv.key, kv.value) } } // Len returns the number of items in the cache. func (c *Cache) Len() int { if c.cache == nil { return 0 } return c.ll.Len() } // Clear purges all stored items from the cache. func (c *Cache) Clear() { if c.OnEvicted != nil { for _, e := range c.cache { kv := e.Value.(*entry) c.OnEvicted(kv.key, kv.value) } } c.ll = nil c.cache = nil } ```
Yu-Gi-Oh! Dark Duel Stories, known in Japan as Yu-Gi-Oh! Duel Monsters III: Tri-Holygod Advent (遊戯王デュエルモンスターズ3 三聖戦神光臨), is a 2000 digital collectible card game of the Yu-Gi-Oh! universe for the Game Boy Color developed and published by Konami. The game was Konami's first attempt at a Yu-Gi-Oh! game released in English and the third game in the Japanese Duel Monsters series. This game uses the rules of the previous Duel Monsters games, as opposed to the rules for the Yu-Gi-Oh! Trading Card Game. Players of the game can trade and battle with other players using a link cable. Gameplay Players must beat each available player in a stage at least five times in order to get to the next stage. However, he or she may keep on dueling them for more points. A usual game consists of players using their assembled decks of cards to reduce their opponent's 8000 life points to zero, but a duel can also be won by forcing the player's opponent to run out of cards in their deck and having them unable to draw a card at the start of their turn, or by having all five pieces of Exodia in their hand. To defeat the opposing monster, the player must have a monster with higher ATK (attack) points than that opposing card's ATK or DEF (defense) points, depending on whether the opponent's monster is in its Attack or Defense Position. Yu-Gi-Oh! Dark Duel Stories also allows them to defeat monsters based on card type or element weaknesses; here, the different between ATK or DEF points is not taken into account and the card with the weakness is instantly destroyed. In addition, cards in the Element List do not have an advantage over cards in the Special List and vice versa. In order to duel, a player's Deck must contain 40 cards and be under their current deck cost limit, which is increased by winning duels. If the deck is over/under 40 cards or over the cost limit, the player will not be able to duel until the error is fixed. Certain cards may also not be included in their Deck unless they have the appropriate Duelist Level, which is also increased by winning duels. The deck cost limit and the Duelist Level do not decrease by losing. Passwords Players can input the 8-digit passwords found at the bottom of Yu-Gi-Oh! trading cards to receive that card in the in-game card trunk, provided that the password is compatible with the game (only the older expansion sets can be used, and certain cards will not work) As with cards obtained in-game, players can add saved cards from their chest to their deck, depending on how high a Duelist Level they have; the higher DL, the stronger the card allowed. Note that when using such a password, the card's effects will most likely change from the actual TCG card, due to the way Dark Duel Stories plays (using the standard Duel Monsters ruleset). If a special password is typed in, Solomon Mutou will appear after matches and will give an additional card upon winning a match (including the one Teá gives the player). Solomon will also give them one extra Monster Card Part for each win as well. There are also hidden passwords that unlock the hidden bosses in Stage 5, with the default being Yami Yugi. Whenever a password is inputted, the previous boss in that stage is replaced, but not deleted as inputting that boss' password again will re-enable him for battle. Furthermore, a boss' Record is never deleted; whenever the player switch between bosses, the old Records are hidden when another boss is "active" (to be replaced by the new boss' records), and the old records reappear whenever that boss becomes "active" again, hiding away the new boss' records. Card creation Dark Duel Stories allows the player to "create" cards using a top-half and a bottom-half Monster Card Part, which are earned by winning duels. Different card parts will produce different ATK and DEF results. After creation, these cards go to their in-game card trunk and can be put into their Deck later, provided they have made room for the card and their deck cost limit or Duelist Level meets the required level. Development The game was originally scheduled to release in North America in November 2001. Release Dark Duel Stories came bundled with three cards for the Yu-Gi-Oh! TCG that can be used in the real card game. Dark Duel Stories was packaged with two different sets of cards: Set 1 consists of Exodia the Forbidden One, Dark Magician and Blue Eyes White Dragon and Set 2 had Acid Trap Hole, Seiyaryu, and Salamandra. All 6 cards can be used in-game by collecting them after a won duel, or by using the password printed on the card. Reception GameSpot gave the game a score of 6.2 out of 10 stating, "Dark Duel Stories comes recommended to avid enthusiasts of the Duel Monsters card game, as well as players who are interested in trying out a new card game with plenty of replay value." Sales The game is the fourth best selling Game Boy Color game in Japan, with 726,518 copies sold. References 2000 video games Game Boy Color games Game Boy Color-only games Multiplayer and single-player video games Yu-Gi-Oh! video games
Ubasi Khong Tayiji () was a 17th-century Mongol prince. He was the first Altan Khan of the Khalkha who ruled Khotgoids in northwestern Khalkha. He was defeated by the Oirats in 1623. References 17th-century Mongol khans 1623 deaths Year of birth unknown
```go package configs type HugepageLimit struct { // which type of hugepage to limit. Pagesize string `json:"page_size"` // usage limit for hugepage. Limit uint64 `json:"limit"` } ```
Karl-Heinz Marbach (5 July 1917 – 27 September 1995) was a German officer who served in the Kriegsmarine, the navy of Nazi Germany, during World War II, and later in the West German Navy. From 1950 to 1959 he was Principal Agent of the U.S. Central Intelligence Agency-funded network with the codename LCCASSOCK, which was one of CIA's Psychological warfare efforts directed against Eastern Germany. Awards Iron Cross (1939) 2nd Class (14 April 1940) & 1st Class (21 November 1943) Knight's Cross of the Iron Cross on 22 July 1944 as Oberleutnant zur See and commander of U-953 References Citations Bibliography 1917 births 1995 deaths German Navy personnel People from Kołobrzeg Military personnel from the Province of Pomerania Recipients of the Knight's Cross of the Iron Cross U-boat commanders (Kriegsmarine)
```python """ Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. """ from heapq import heappop, heapreplace, heapify from queue import PriorityQueue # Definition for singly-linked list. class ListNode(object): """ ListNode Class""" def __init__(self, val): self.val = val self.next = None def merge_k_lists(lists): """ Merge Lists """ dummy = node = ListNode(0) list_h = [(n.val, n) for n in lists if n] heapify(list_h) while list_h: _, n_val = list_h[0] if n_val.next is None: heappop(list_h) # only change heap size when necessary else: heapreplace(list_h, (n_val.next.val, n_val.next)) node.next = n_val node = node.next return dummy.next def merge_k_lists(lists): """ Merge List """ dummy = ListNode(None) curr = dummy q = PriorityQueue() for node in lists: if node: q.put((node.val, node)) while not q.empty(): curr.next = q.get()[1] # These two lines seem to curr = curr.next # be equivalent to :- curr = q.get()[1] if curr.next: q.put((curr.next.val, curr.next)) return dummy.next """ I think my code's complexity is also O(nlogk) and not using heap or priority queue, n means the total elements and k means the size of list. The mergeTwoLists function in my code comes from the problem Merge Two Sorted Lists whose complexity obviously is O(n), n is the sum of length of l1 and l2. To put it simpler, assume the k is 2^x, So the progress of combination is like a full binary tree, from bottom to top. So on every level of tree, the combination complexity is n, because every level have all n numbers without repetition. The level of tree is x, ie log k. So the complexity is O(n log k). for example, 8 ListNode, and the length of every ListNode is x1, x2, x3, x4, x5, x6, x7, x8, total is n. on level 3: x1+x2, x3+x4, x5+x6, x7+x8 sum: n on level 2: x1+x2+x3+x4, x5+x6+x7+x8 sum: n on level 1: x1+x2+x3+x4+x5+x6+x7+x8 sum: n """ ```
MS Augustus was a combined ocean liner and cruise ship built in 1926 for the Navigazione Generale Italiana (NGI). Augustus operated mostly on the Europe to South and North America routes, on the former being one of, if not the largest and fastest liner to sail on regular crossings. At the time of its construction, the Augustus was the largest motor ship in the world, and remains to this day the largest quadruple-screw, diesel-powered ocean liner ever built. The ship was later transferred, together with her steam turbine-powered sister ship SS Roma to the new Italian Line after the merger of the Navigazione Generale Italiana with the Lloyd Sabaudo and the Cosulich Line. During World War 2 the Augustus was converted into an aircraft carrier by the Regia Marina and first renamed Falco, and at a later time, Sparviero, while the Roma became the aircraft carrier Aquila. Neither of them ever entered combat service under these new roles. In 1944, both ships were taken over by the occupying German troops, but on 25 September of that same year Augustus was scuttled as a blockship at the entrance to the port of Genoa. After the war, she was raised in 1947 and ultimately scrapped in 1951. History Ocean Liner career Following the end of World War I, many shipping companies were planning to build new liners once they had enough money. Navigazione Generale Italiana decided to build two new liners of over 30,000 gross registered tons for post war service. The first ship was Roma which was launched in 1926. The second ship was launched in December 1926 at the Ansaldo Shipyard and was christened Augustus by Edda Mussolini (daughter of dictator Benito Mussolini). She was fitted out and made her maiden voyage on 10 November 1927. Her interior was decorated in the Baroque style. She was the largest diesel-engined passenger ship of her time, whereas her sister was equipped with geared steam turbines. The Augustus was c. 215 meters long and was designed to carry 1,675 passengers. She operated on the South American service, one of the fastest and largest liners to do so, while her sister ran the North Atlantic service. The Augustus could reportedly reach South America from Italy in five days at an average speed of 22 knots. In 1932, Navigazione Generale Italiana was forced by Mussolini to merge with other Italian shipping companies to form the Italia Line. Because of this, the funnels of the Augustus were repainted in Italia Line colours. In 1933, she began to carry out 129-day world cruises after the Wall Street Crash of 1929. She carried many passengers from New York to a number of ports around the world and back to New York in 129 days. The Augustus continued passenger service until 1940. Conversion to aircraft carrier At the outbreak of World War II the Augustus and the Roma were laid up but both ships were subsequently taken over by the Italian Navy. Like her sister, the Augustus was converted into an aircraft carrier and renamed Falco and later Sparviero. Before work could be completed, the Kingdom of Italy signed an armistice in 1943, and both ships were shortly thereafter captured by the neoestablished National Republican Navy of the Italian Social Republic, a German puppet state. In 1944, both ships were taken over by the German troops, but on 5 October of that year Augustus was scuttled in order to blockade Genoa's harbour from the Allies. After the war, she was raised in 1947 and scrapped in 1951. References Page at List of Italian Steamships Passenger ships of Italy Ocean liners Cruise ships 1926 ships Ships built in Genoa Ships built by Gio. Ansaldo & C. Cultural depictions of Augustus
```c++ #ifndef BOOST_ARCHIVE_POLYMORPHIC_XML_WIARCHIVE_HPP #define BOOST_ARCHIVE_POLYMORPHIC_XML_WIARCHIVE_HPP // MS compatible compilers support #pragma once #if defined(_MSC_VER) # pragma once #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 // polymorphic_xml_wiarchive.hpp // Use, modification and distribution is subject to the Boost Software // path_to_url // See path_to_url for updates, documentation, and revision history. #include <boost/config.hpp> #ifdef BOOST_NO_STD_WSTREAMBUF #error "wide char i/o not supported on this platform" #else #include <boost/archive/xml_wiarchive.hpp> #include <boost/archive/detail/polymorphic_iarchive_route.hpp> namespace boost { namespace archive { class polymorphic_xml_wiarchive : public detail::polymorphic_iarchive_route<xml_wiarchive> { public: polymorphic_xml_wiarchive(std::wistream & is, unsigned int flags = 0) : detail::polymorphic_iarchive_route<xml_wiarchive>(is, flags) {} ~polymorphic_xml_wiarchive(){} }; } // namespace archive } // namespace boost // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE( boost::archive::polymorphic_xml_wiarchive ) #endif // BOOST_NO_STD_WSTREAMBUF #endif // BOOST_ARCHIVE_POLYMORPHIC_XML_WIARCHIVE_HPP ```
```java /* * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * * path_to_url * * Unless required by applicable law or agreed to in writing, * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * specific language governing permissions and limitations */ package org.apache.pulsar.broker.loadbalance.impl; import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; import com.google.common.hash.Hashing; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Random; import java.util.Set; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.mutable.MutableDouble; import org.apache.commons.lang3.mutable.MutableInt; import org.apache.commons.lang3.tuple.Pair; import org.apache.pulsar.broker.ServiceConfiguration; import org.apache.pulsar.broker.loadbalance.LoadData; import org.apache.pulsar.broker.loadbalance.LoadSheddingStrategy; import org.apache.pulsar.broker.loadbalance.ModularLoadManagerStrategy; import org.apache.pulsar.policies.data.loadbalancer.BrokerData; import org.apache.pulsar.policies.data.loadbalancer.BundleData; import org.apache.pulsar.policies.data.loadbalancer.LocalBrokerData; import org.apache.pulsar.policies.data.loadbalancer.TimeAverageMessageData; @Slf4j public class AvgShedder implements LoadSheddingStrategy, ModularLoadManagerStrategy { // map bundle to broker. private final Map<BundleData, String> bundleBrokerMap = new HashMap<>(); // map broker to Scores. scores:0-100 private final Map<String, Double> brokerScoreMap = new HashMap<>(); // map broker hit count for high threshold/low threshold private final Map<String, MutableInt> brokerHitCountForHigh = new HashMap<>(); private final Map<String, MutableInt> brokerHitCountForLow = new HashMap<>(); private static final double MB = 1024 * 1024; @Override public Multimap<String, String> findBundlesForUnloading(LoadData loadData, ServiceConfiguration conf) { // result returned by shedding, map broker to bundles. Multimap<String, String> selectedBundlesCache = ArrayListMultimap.create(); // configuration for shedding. final double minThroughputThreshold = conf.getMinUnloadMessageThroughput(); final double minMsgThreshold = conf.getMinUnloadMessage(); final double maxUnloadPercentage = conf.getMaxUnloadPercentage(); final double lowThreshold = conf.getLoadBalancerAvgShedderLowThreshold(); final double highThreshold = conf.getLoadBalancerAvgShedderHighThreshold(); final int hitCountHighThreshold = conf.getLoadBalancerAvgShedderHitCountHighThreshold(); final int hitCountLowThreshold = conf.getLoadBalancerAvgShedderHitCountLowThreshold(); if (log.isDebugEnabled()) { log.debug("highThreshold:{}, lowThreshold:{}, hitCountHighThreshold:{}, hitCountLowThreshold:{}, " + "minMsgThreshold:{}, minThroughputThreshold:{}", highThreshold, lowThreshold, hitCountHighThreshold, hitCountLowThreshold, minMsgThreshold, minThroughputThreshold); } List<String> brokers = calculateScoresAndSort(loadData, conf); log.info("sorted broker list:{}", brokers); // find broker pairs for shedding. List<Pair<String, String>> pairs = findBrokerPairs(brokers, lowThreshold, highThreshold); log.info("brokerHitCountForHigh:{}, brokerHitCountForLow:{}", brokerHitCountForHigh, brokerHitCountForLow); if (pairs.isEmpty()) { if (log.isDebugEnabled()) { log.debug("there is no any overload broker, no need to shedding bundles."); } brokerHitCountForHigh.clear(); brokerHitCountForLow.clear(); return selectedBundlesCache; } // choosing bundles to unload. for (Pair<String, String> pair : pairs) { String overloadedBroker = pair.getRight(); String underloadedBroker = pair.getLeft(); // check hit count for high threshold and low threshold. if (!(brokerHitCountForHigh.computeIfAbsent(underloadedBroker, __ -> new MutableInt(0)) .intValue() >= hitCountHighThreshold) && !(brokerHitCountForHigh.computeIfAbsent(overloadedBroker, __ -> new MutableInt(0)) .intValue() >= hitCountHighThreshold) && !(brokerHitCountForLow.computeIfAbsent(underloadedBroker, __ -> new MutableInt(0)) .intValue() >= hitCountLowThreshold) && !(brokerHitCountForLow.computeIfAbsent(overloadedBroker, __ -> new MutableInt(0)) .intValue() >= hitCountLowThreshold)) { continue; } // if hit, remove entry. brokerHitCountForHigh.remove(underloadedBroker); brokerHitCountForHigh.remove(overloadedBroker); brokerHitCountForLow.remove(underloadedBroker); brokerHitCountForLow.remove(overloadedBroker); // select bundle for unloading. selectBundleForUnloading(loadData, overloadedBroker, underloadedBroker, minThroughputThreshold, minMsgThreshold, maxUnloadPercentage, selectedBundlesCache); } return selectedBundlesCache; } private void selectBundleForUnloading(LoadData loadData, String overloadedBroker, String underloadedBroker, double minThroughputThreshold, double minMsgThreshold, double maxUnloadPercentage, Multimap<String, String> selectedBundlesCache) { // calculate how much throughput to unload. LocalBrokerData minLocalBrokerData = loadData.getBrokerData().get(underloadedBroker).getLocalData(); LocalBrokerData maxLocalBrokerData = loadData.getBrokerData().get(overloadedBroker).getLocalData(); double minMsgRate = minLocalBrokerData.getMsgRateIn() + minLocalBrokerData.getMsgRateOut(); double maxMsgRate = maxLocalBrokerData.getMsgRateIn() + maxLocalBrokerData.getMsgRateOut(); double minThroughput = minLocalBrokerData.getMsgThroughputIn() + minLocalBrokerData.getMsgThroughputOut(); double maxThroughput = maxLocalBrokerData.getMsgThroughputIn() + maxLocalBrokerData.getMsgThroughputOut(); double msgRequiredFromUnloadedBundles = (maxMsgRate - minMsgRate) * maxUnloadPercentage; double throughputRequiredFromUnloadedBundles = (maxThroughput - minThroughput) * maxUnloadPercentage; boolean isMsgRateToOffload; MutableDouble trafficMarkedToOffload = new MutableDouble(0); if (msgRequiredFromUnloadedBundles > minMsgThreshold) { isMsgRateToOffload = true; trafficMarkedToOffload.setValue(msgRequiredFromUnloadedBundles); } else if (throughputRequiredFromUnloadedBundles > minThroughputThreshold) { isMsgRateToOffload = false; trafficMarkedToOffload.setValue(throughputRequiredFromUnloadedBundles); } else { log.info( "broker:[{}] is planning to shed bundles to broker:[{}],but the throughput {} MByte/s is " + "less than minimumThroughputThreshold {} MByte/s, and the msgRate {} rate/s" + " is also less than minimumMsgRateThreshold {} rate/s, skipping bundle unload.", overloadedBroker, underloadedBroker, throughputRequiredFromUnloadedBundles / MB, minThroughputThreshold / MB, msgRequiredFromUnloadedBundles, minMsgThreshold); return; } if (maxLocalBrokerData.getBundles().size() == 1) { log.warn("HIGH USAGE WARNING : Sole namespace bundle {} is overloading broker {}. " + "No Load Shedding will be done on this broker", maxLocalBrokerData.getBundles().iterator().next(), overloadedBroker); } else if (maxLocalBrokerData.getBundles().isEmpty()) { log.warn("Broker {} is overloaded despite having no bundles", overloadedBroker); } // do shedding log.info( "broker:[{}] is planning to shed bundles to broker:[{}]. " + "maxBroker stat:scores:{}, throughput:{}, msgRate:{}. " + "minBroker stat:scores:{}, throughput:{}, msgRate:{}. " + "isMsgRateToOffload:{}, trafficMarkedToOffload:{}", overloadedBroker, underloadedBroker, brokerScoreMap.get(overloadedBroker), maxThroughput, maxMsgRate, brokerScoreMap.get(underloadedBroker), minThroughput, minMsgRate, isMsgRateToOffload, trafficMarkedToOffload); loadData.getBundleDataForLoadShedding().entrySet().stream().filter(e -> maxLocalBrokerData.getBundles().contains(e.getKey()) ).filter(e -> !loadData.getRecentlyUnloadedBundles().containsKey(e.getKey()) ).map((e) -> { BundleData bundleData = e.getValue(); TimeAverageMessageData shortTermData = bundleData.getShortTermData(); double traffic = isMsgRateToOffload ? shortTermData.getMsgRateIn() + shortTermData.getMsgRateOut() : shortTermData.getMsgThroughputIn() + shortTermData.getMsgThroughputOut(); return Pair.of(e, traffic); }).sorted((e1, e2) -> Double.compare(e2.getRight(), e1.getRight()) ).forEach(e -> { Map.Entry<String, BundleData> bundle = e.getLeft(); double traffic = e.getRight(); if (traffic > 0 && traffic <= trafficMarkedToOffload.getValue()) { selectedBundlesCache.put(overloadedBroker, bundle.getKey()); bundleBrokerMap.put(bundle.getValue(), underloadedBroker); trafficMarkedToOffload.add(-traffic); if (log.isDebugEnabled()) { log.debug("Found bundle to unload:{}, isMsgRateToOffload:{}, traffic:{}", bundle, isMsgRateToOffload, traffic); } } }); } @Override public void onActiveBrokersChange(Set<String> activeBrokers) { LoadSheddingStrategy.super.onActiveBrokersChange(activeBrokers); } private List<String> calculateScoresAndSort(LoadData loadData, ServiceConfiguration conf) { brokerScoreMap.clear(); // calculate scores of brokers. for (Map.Entry<String, BrokerData> entry : loadData.getBrokerData().entrySet()) { LocalBrokerData localBrokerData = entry.getValue().getLocalData(); String broker = entry.getKey(); Double score = calculateScores(localBrokerData, conf); brokerScoreMap.put(broker, score); if (log.isDebugEnabled()) { log.info("broker:{}, scores:{}, throughput:{}, messageRate:{}", broker, score, localBrokerData.getMsgThroughputIn() + localBrokerData.getMsgThroughputOut(), localBrokerData.getMsgRateIn() + localBrokerData.getMsgRateOut()); } } // sort brokers by scores. return brokerScoreMap.entrySet().stream().sorted((o1, o2) -> (int) (o1.getValue() - o2.getValue())) .map(Map.Entry::getKey).toList(); } private Double calculateScores(LocalBrokerData localBrokerData, final ServiceConfiguration conf) { return localBrokerData.getMaxResourceUsageWithWeight( conf.getLoadBalancerCPUResourceWeight(), conf.getLoadBalancerDirectMemoryResourceWeight(), conf.getLoadBalancerBandwidthInResourceWeight(), conf.getLoadBalancerBandwidthOutResourceWeight()) * 100; } private List<Pair<String, String>> findBrokerPairs(List<String> brokers, double lowThreshold, double highThreshold) { List<Pair<String, String>> pairs = new LinkedList<>(); int i = 0, j = brokers.size() - 1; while (i <= j) { String maxBroker = brokers.get(j); String minBroker = brokers.get(i); if (brokerScoreMap.get(maxBroker) - brokerScoreMap.get(minBroker) < lowThreshold) { brokerHitCountForHigh.remove(maxBroker); brokerHitCountForHigh.remove(minBroker); brokerHitCountForLow.remove(maxBroker); brokerHitCountForLow.remove(minBroker); } else { pairs.add(Pair.of(minBroker, maxBroker)); if (brokerScoreMap.get(maxBroker) - brokerScoreMap.get(minBroker) < highThreshold) { brokerHitCountForLow.computeIfAbsent(minBroker, k -> new MutableInt(0)).increment(); brokerHitCountForLow.computeIfAbsent(maxBroker, k -> new MutableInt(0)).increment(); brokerHitCountForHigh.remove(maxBroker); brokerHitCountForHigh.remove(minBroker); } else { brokerHitCountForLow.computeIfAbsent(minBroker, k -> new MutableInt(0)).increment(); brokerHitCountForLow.computeIfAbsent(maxBroker, k -> new MutableInt(0)).increment(); brokerHitCountForHigh.computeIfAbsent(minBroker, k -> new MutableInt(0)).increment(); brokerHitCountForHigh.computeIfAbsent(maxBroker, k -> new MutableInt(0)).increment(); } } i++; j--; } return pairs; } @Override public Optional<String> selectBroker(Set<String> candidates, BundleData bundleToAssign, LoadData loadData, ServiceConfiguration conf) { final var brokerToUnload = bundleBrokerMap.getOrDefault(bundleToAssign, null); if (brokerToUnload == null || !candidates.contains(bundleBrokerMap.get(bundleToAssign))) { // cluster initializing or broker is shutdown if (log.isDebugEnabled()) { if (!bundleBrokerMap.containsKey(bundleToAssign)) { log.debug("cluster is initializing"); } else { log.debug("expected broker:{} is shutdown, candidates:{}", bundleBrokerMap.get(bundleToAssign), candidates); } } String broker = getExpectedBroker(candidates, bundleToAssign); bundleBrokerMap.put(bundleToAssign, broker); return Optional.of(broker); } else { return Optional.of(brokerToUnload); } } private static String getExpectedBroker(Collection<String> brokers, BundleData bundle) { List<String> sortedBrokers = new ArrayList<>(brokers); Collections.sort(sortedBrokers); try { // use random number as input of hashing function to avoid special case that, // if there is 4 brokers running in the cluster,and add broker5,and shutdown broker3, // then all bundles belonging to broker3 will be loaded on the same broker. final long hashcode = Hashing.crc32().hashString(String.valueOf(new Random().nextInt()), StandardCharsets.UTF_8).padToLong(); final int index = (int) (Math.abs(hashcode) % sortedBrokers.size()); if (log.isDebugEnabled()) { log.debug("Assignment details: brokers={}, bundle={}, hashcode={}, index={}", sortedBrokers, bundle, hashcode, index); } return sortedBrokers.get(index); } catch (Throwable e) { // theoretically this logic branch should not be executed log.error("Bundle format of {} is invalid", bundle, e); return sortedBrokers.get(Math.abs(bundle.hashCode()) % sortedBrokers.size()); } } } ```
```objective-c // UpdatePair.h #ifndef __UPDATE_PAIR_H #define __UPDATE_PAIR_H #include "DirItem.h" #include "UpdateAction.h" #include "../../Archive/IArchive.h" struct CUpdatePair { NUpdateArchive::NPairState::EEnum State; int ArcIndex; int DirIndex; int HostIndex; // >= 0 for alt streams only, contains index of host pair CUpdatePair(): ArcIndex(-1), DirIndex(-1), HostIndex(-1) {} }; void GetUpdatePairInfoList( const CDirItems &dirItems, const CObjectVector<CArcItem> &arcItems, NFileTimeType::EEnum fileTimeType, CRecordVector<CUpdatePair> &updatePairs); #endif ```
```javascript var {propName: localVar = defaultValue} = obj ```
Ediriweera Weerawardena (), is a Sri Lankan politician and former Member of Parliament. He served as a Deputy Minister in the Central Government for some time, later withdrew from national politics and entered provincial council politics. Political career In 2000, he was appointed as the Deputy Minister of Development, Rehabilitation and Reconstruction of the East and Rural Housing Development under Kumaratunga cabinet. In 2014, he assumed the duties as the Central Provincial Minister of Road Development, Transport, Power, Energy, Housing and Construction. In June 2016, Weerawardena was appointed as the acting Chief Minister in Central Province. In 2019, he was appointed as the New seat organizer for Harispattuwa seat in Kandy district. In 2021 under the presidency of Maithripala Sirisena, he was appointed as one of the 10 Vice Presidents of The Sri Lanka Freedom Party's (SLFP) Executive Committee. References Living people 1951 births Members of the 10th Parliament of Sri Lanka Sri Lanka Freedom Party politicians United People's Freedom Alliance politicians
```groff .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14 .\" .\" Standard preamble: .\" ======================================================================== .de Sh \" Subsection heading .br .if t .Sp .ne 5 .PP \fB\\$1\fR .PP .. .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. | will give a .\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to .\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C' .\" expand to `' in nroff, nothing in troff, for use with C<>. .tr \(*W-|\(bv\*(Tr .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .\" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .hy 0 .if n .na .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "JV-SCAN 1" .TH JV-SCAN 1 "2007-07-19" "gcc-4.2.1" "GNU" .SH "NAME" jv\-scan \- print information about Java source file .SH "SYNOPSIS" .IX Header "SYNOPSIS" jv-scan [\fB\-\-no\-assert\fR] [\fB\-\-complexity\fR] [\fB\-\-encoding\fR=\fIname\fR] [\fB\-\-print\-main\fR] [\fB\-\-list\-class\fR] [\fB\-\-list\-filename\fR] [\fB\-\-version\fR] [\fB\-\-help\fR] [\fB\-o\fR \fIfile\fR] \fIinputfile\fR... .SH "DESCRIPTION" .IX Header "DESCRIPTION" The \f(CW\*(C`jv\-scan\*(C'\fR program can be used to print information about a Java source file (\fI.java\fR file). .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-\-no\-assert\fR" 4 .IX Item "--no-assert" Don't recognize the \f(CW\*(C`assert\*(C'\fR keyword, for backwards compatibility with older versions of the language specification. .IP "\fB\-\-complexity\fR" 4 .IX Item "--complexity" This prints a complexity measure, related to cyclomatic complexity, for each input file. .IP "\fB\-\-encoding=\fR\fIname\fR" 4 .IX Item "--encoding=name" This works like the corresponding \fBgcj\fR option. .IP "\fB\-\-print\-main\fR" 4 .IX Item "--print-main" This prints the name of the class in this file containing a \f(CW\*(C`main\*(C'\fR method. .IP "\fB\-\-list\-class\fR" 4 .IX Item "--list-class" This lists the names of all classes defined in the input files. .IP "\fB\-\-list\-filename\fR" 4 .IX Item "--list-filename" If \f(CW\*(C`\-\-list\-class\*(C'\fR is given, this option causes \f(CW\*(C`jv\-scan\*(C'\fR to also print the name of the file in which each class was found. .IP "\fB\-o\fR \fIfile\fR" 4 .IX Item "-o file" Print output to the named file. .IP "\fB\-\-help\fR" 4 .IX Item "--help" Print help, then exit. .IP "\fB\-\-version\fR" 4 .IX Item "--version" Print version number, then exit. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIgcc\fR\|(1), \fIgcj\fR\|(1), \fIgcjh\fR\|(1), \fIgij\fR\|(1), \fIjcf\-dump\fR\|(1), \fIgfdl\fR\|(7), and the Info entries for \fIgcj\fR and \fIgcc\fR. .SH "COPYRIGHT" .IX Header "COPYRIGHT" .PP Permission is granted to copy, distribute and/or modify this document any later version published by the Free Software Foundation; with the texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the man page \fIgfdl\fR\|(7). .PP (a) The \s-1FSF\s0's Front-Cover Text is: .PP .Vb 1 \& A GNU Manual .Ve .PP (b) The \s-1FSF\s0's Back-Cover Text is: .PP .Vb 3 \& You have freedom to copy and modify this GNU Manual, like GNU \& software. Copies published by the Free Software Foundation raise \& funds for GNU development. .Ve ```
```java /** * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ package org.thingsboard.server.queue.provider; import org.thingsboard.server.gen.js.JsInvokeProtos; import org.thingsboard.server.gen.transport.TransportProtos.ToCoreMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToCoreNotificationMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToHousekeeperServiceMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToOtaPackageStateServiceMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToRuleEngineMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToRuleEngineNotificationMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToTransportMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToUsageStatsServiceMsg; import org.thingsboard.server.gen.transport.TransportProtos.ToVersionControlServiceMsg; import org.thingsboard.server.gen.transport.TransportProtos.TransportApiRequestMsg; import org.thingsboard.server.gen.transport.TransportProtos.TransportApiResponseMsg; import org.thingsboard.server.queue.TbQueueConsumer; import org.thingsboard.server.queue.TbQueueProducer; import org.thingsboard.server.queue.TbQueueRequestTemplate; import org.thingsboard.server.queue.common.TbProtoJsQueueMsg; import org.thingsboard.server.queue.common.TbProtoQueueMsg; /** * Responsible for initialization of various Producers and Consumers used by TB Core Node. * Implementation Depends on the queue queue.type from yml or TB_QUEUE_TYPE environment variable */ public interface TbCoreQueueFactory extends TbUsageStatsClientQueueFactory, HousekeeperClientQueueFactory { /** * Used to push messages to instances of TB Transport Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToTransportMsg>> createTransportNotificationsMsgProducer(); /** * Used to push messages to instances of TB RuleEngine Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToRuleEngineMsg>> createRuleEngineMsgProducer(); /** * Used to push notifications to instances of TB RuleEngine Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToRuleEngineNotificationMsg>> createRuleEngineNotificationsMsgProducer(); /** * Used to push messages to other instances of TB Core Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToCoreMsg>> createTbCoreMsgProducer(); /** * Used to push notifications to other instances of TB Core Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToCoreNotificationMsg>> createTbCoreNotificationsMsgProducer(); /** * Used to consume messages by TB Core Service * * @return */ TbQueueConsumer<TbProtoQueueMsg<ToCoreMsg>> createToCoreMsgConsumer(); /** * Used to consume messages about usage statistics by TB Core Service * * @return */ TbQueueConsumer<TbProtoQueueMsg<ToUsageStatsServiceMsg>> createToUsageStatsServiceMsgConsumer(); /** * Used to consume messages about firmware update notifications by TB Core Service * * @return */ TbQueueConsumer<TbProtoQueueMsg<ToOtaPackageStateServiceMsg>> createToOtaPackageStateServiceMsgConsumer(); /** * Used to consume messages about firmware update notifications by TB Core Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToOtaPackageStateServiceMsg>> createToOtaPackageStateServiceMsgProducer(); /** * Used to consume high priority messages by TB Core Service * * @return */ TbQueueConsumer<TbProtoQueueMsg<ToCoreNotificationMsg>> createToCoreNotificationsMsgConsumer(); /** * Used to consume Transport API Calls * * @return */ TbQueueConsumer<TbProtoQueueMsg<TransportApiRequestMsg>> createTransportApiRequestConsumer(); /** * Used to push replies to Transport API Calls * * @return */ TbQueueProducer<TbProtoQueueMsg<TransportApiResponseMsg>> createTransportApiResponseProducer(); TbQueueRequestTemplate<TbProtoJsQueueMsg<JsInvokeProtos.RemoteJsRequest>, TbProtoQueueMsg<JsInvokeProtos.RemoteJsResponse>> createRemoteJsRequestTemplate(); /** * Used to push messages to instances of TB Version Control Service * * @return */ TbQueueProducer<TbProtoQueueMsg<ToVersionControlServiceMsg>> createVersionControlMsgProducer(); TbQueueConsumer<TbProtoQueueMsg<ToHousekeeperServiceMsg>> createHousekeeperMsgConsumer(); TbQueueProducer<TbProtoQueueMsg<ToHousekeeperServiceMsg>> createHousekeeperReprocessingMsgProducer(); TbQueueConsumer<TbProtoQueueMsg<ToHousekeeperServiceMsg>> createHousekeeperReprocessingMsgConsumer(); } ```
```php <?php /* * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the */ namespace Google\Service\CloudDataplex; class GoogleCloudDataplexV1ListDataAttributeBindingsResponse extends \Google\Collection { protected $collection_key = 'unreachableLocations'; protected $dataAttributeBindingsType = GoogleCloudDataplexV1DataAttributeBinding::class; protected $dataAttributeBindingsDataType = 'array'; /** * @var string */ public $nextPageToken; /** * @var string[] */ public $unreachableLocations; /** * @param GoogleCloudDataplexV1DataAttributeBinding[] */ public function setDataAttributeBindings($dataAttributeBindings) { $this->dataAttributeBindings = $dataAttributeBindings; } /** * @return GoogleCloudDataplexV1DataAttributeBinding[] */ public function getDataAttributeBindings() { return $this->dataAttributeBindings; } /** * @param string */ public function setNextPageToken($nextPageToken) { $this->nextPageToken = $nextPageToken; } /** * @return string */ public function getNextPageToken() { return $this->nextPageToken; } /** * @param string[] */ public function setUnreachableLocations($unreachableLocations) { $this->unreachableLocations = $unreachableLocations; } /** * @return string[] */ public function getUnreachableLocations() { return $this->unreachableLocations; } } // Adding a class alias for backwards compatibility with the previous class name. class_alias(GoogleCloudDataplexV1ListDataAttributeBindingsResponse::class, your_sha256_hashuteBindingsResponse'); ```
Photios () is a Greek name, latinized as Photius. It commonly refers to Saint Photios I of Constantinople (c. 810/820 – 893), an Eastern Orthodox scholar and Patriarch of Constantinople. A modern diminutive variant is Fotis (). People with the name Photios or variants Saint Photius the Martyr, a Christian martyr under Emperor Diocletian (died 305) Photios (Emirate of Crete) (fl. 870s), Byzantine renegade and admiral of the Emirate of Crete Photius, Metropolitan of Moscow (died 1431) Photius Fisk, a chaplain in the U.S. Navy (1807–1890) Charles-Marie-Photius Maurras, a French author, politician, poet, and critic who was a founder of Action Française (1868-1952) Patriarch Photius II of Constantinople (1874–1935) Patriarch Photius of Alexandria (died 1925) Photios of Korytsa (1862–1906), Greek Orthodox metropolitan bishop of Korçë Photis Kontoglou (1895–1965), Greek writer and iconographer People with the name Fotis Fotis Kafatos (1940–2017), Greek biologist Fotis Kouvelis (born 1948), Greek lawyer and politician Fotios Vasilopoulos (born 1986), Greek basketball player
```javascript import { fileURLToPath } from "url"; // snippet-start:[sqs.JavaScript.longPoll.createQueueV3] import { CreateQueueCommand, SQSClient } from "@aws-sdk/client-sqs"; const client = new SQSClient({}); const SQS_QUEUE_NAME = "queue_name"; export const main = async (queueName = SQS_QUEUE_NAME) => { const response = await client.send( new CreateQueueCommand({ QueueName: queueName, Attributes: { // When the wait time for the ReceiveMessage API action is greater than 0, // long polling is in effect. The maximum long polling wait time is 20 // seconds. Long polling helps reduce the cost of using Amazon SQS by, // eliminating the number of empty responses and false empty responses. // path_to_url ReceiveMessageWaitTimeSeconds: "20", }, }), ); console.log(response); return response; }; // snippet-end:[sqs.JavaScript.longPoll.createQueueV3] // Invoke main function if this file was run directly. if (process.argv[1] === fileURLToPath(import.meta.url)) { main(); } ```
```objective-c /* ============================================================================== CommandDefinition.h Created: 19 Dec 2016 3:53:43pm Author: Ben ============================================================================== */ #pragma once class Multiplex; class BaseCommand; typedef std::function<BaseCommand*(ControllableContainer *, CommandContext, var params, Multiplex * multiplex)> CreateCommandFunc; class CommandDefinition { public: CommandDefinition(); virtual ~CommandDefinition(); CommandContext context; String menuPath; String commandType; ControllableContainer * container; var params; CreateCommandFunc createFunc; void setup(ControllableContainer * container, const String &menuPath, const String &type, CommandContext context, CreateCommandFunc createFunc); BaseCommand * create(CommandContext context, Multiplex * multiplex = nullptr); static CommandDefinition * createDef(ControllableContainer * container, const String &menuPath, const String &type, CreateCommandFunc createFunc, CommandContext context = CommandContext::BOTH); CommandDefinition * addParam(const String &paramName, var value); WeakReference<CommandDefinition>::Master masterReference; }; ```
```php <?php declare(strict_types=1); namespace Nuwave\Lighthouse\Testing; use Nuwave\Lighthouse\Schema\Source\SchemaSourceProvider; class TestSchemaProvider implements SchemaSourceProvider { protected string $schema = ''; /** @param string $schema May be changed after instantiation, so it is passed as a reference */ public function __construct(string &$schema) { $this->schema = &$schema; } public function getSchemaString(): string { return $this->schema; } } ```
RBT may refer to: Computing Red–black tree, in computer science Residual block termination, in cryptography Risk-based testing, in software testing Other uses Random breath test or sobriety checkpoints RBT (TV series), an Australian docuseries Residence-based taxation Ringback tone, in telephony
```xml import { TFabricPlatformPageProps } from '../../../interfaces/Platforms'; import { LegendsPageProps as ExternalProps } from '@fluentui/react-examples/lib/react-charting/Legends/Legends.doc'; export const LegendsPageProps: TFabricPlatformPageProps = { web: { ...(ExternalProps as any), }, }; ```
```stylus /* Name: Kimbie (dark) Author: Jan T. Sott URL: path_to_url */ .highlight color: #d3af86 background: #221a0f .code /* Kimbie Comment */ .comment, .quote color: #d6baad /* Kimbie Red */ .variable, .template-variable, .tag, .name, .selector-id, .selector-class, .regexp, .meta color: #dc3958 /* Kimbie Orange */ .number, .built_in, .builtin-name, .literal, .type, .params, .deletion, .link color: #f79a32 /* Kimbie Yellow */ .title, .section, .attribute color: #f06431 /* Kimbie Green */ .string, .symbol, .bullet, .addition color: #889b4a /* Kimbie Purple */ .keyword, .selector-tag, .function color: #98676a .emphasis font-style: italic .strong font-weight: bold ```
```xml <?xml version="1.0" encoding="utf-8"?> <layout xmlns:android="path_to_url" xmlns:app="path_to_url" xmlns:tools="path_to_url"> <data> <import type="android.view.View" /> <import type="mega.privacy.android.app.utils.Util" /> <import type="mega.privacy.android.app.utils.TimeUtils" /> <import type="mega.privacy.android.app.utils.OfflineUtils" /> <import type="mega.privacy.android.app.MimeTypeList" /> <import type="nz.mega.sdk.MegaNode" /> <import type="mega.privacy.android.app.utils.MegaNodeUtil" /> <variable name="itemOperationViewModel" type="mega.privacy.android.app.fragments.homepage.ItemOperationViewModel" /> <variable name="actionModeViewModel" type="mega.privacy.android.app.fragments.homepage.ActionModeViewModel" /> <variable name="item" type="mega.privacy.android.app.fragments.homepage.NodeItem" /> <variable name="megaApi" type="nz.mega.sdk.MegaApiJava" /> </data> <androidx.constraintlayout.widget.ConstraintLayout android:layout_width="match_parent" android:layout_height="72dp" android:layout_marginTop="1dp" android:onClick="@{()->actionModeViewModel.selectedNodes.empty ? itemOperationViewModel.onItemClick(item) : actionModeViewModel.onNodeClick(item)}" android:onLongClick="@{()->actionModeViewModel.onNodeLongClick(item)}"> <com.facebook.drawee.view.SimpleDraweeView android:id="@+id/thumbnail" android:layout_width="48dp" android:layout_height="48dp" android:scaleType="fitCenter" android:layout_marginStart="16dp" app:defaultThumbnail="@{MimeTypeList.typeForName(item.node.name).iconResourceId}" app:item_selected="@{item.selected}" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:roundedCornerRadius="2dp" app:thumbnail="@{item.thumbnail}" /> <TextView android:id="@+id/name" style="@style/textAppearanceSubtitle1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="12dp" android:layout_marginTop="16dp" android:ellipsize="middle" android:singleLine="true" android:text="@{item.node.name}" android:textColor="@{item.node.isTakenDown() ? @color/red_800_red_400 : @color/grey_087_white_087}" app:layout_constrainedWidth="true" app:layout_constraintEnd_toStartOf="@id/guideline" app:layout_constraintHorizontal_bias="0" app:layout_constraintStart_toEndOf="@+id/thumbnail" app:layout_constraintTop_toTopOf="parent" tools:text="2020-05-25 22.30.21.jpg" /> <ImageView android:id="@+id/img_label" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="4dp" android:src="@{MegaNodeUtil.getNodeLabelDrawable(item.node.getLabel(), context.getResources())}" app:layout_constraintBottom_toBottomOf="@id/name" app:layout_constraintStart_toEndOf="@id/name" app:layout_constraintTop_toTopOf="@id/name" app:visibleGone="@{item.node.getLabel() != MegaNode.NODE_LBL_UNKNOWN}" tools:visibility="visible" /> <ImageView android:id="@+id/img_favourite" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_margin="4dp" android:src="@drawable/ic_favorite" app:layout_constraintBottom_toBottomOf="@id/name" app:layout_constraintStart_toEndOf="@id/img_label" app:layout_constraintTop_toTopOf="@id/name" app:visibleGone="@{item.node.isFavourite()}" tools:visibility="visible" /> <ImageView android:id="@+id/public_link" android:layout_width="16dp" android:layout_height="16dp" android:layout_marginStart="3dp" android:layout_marginEnd="4dp" android:background="@null" android:src="@drawable/ic_link01_medium_regular_outline" android:visibility="@{item.node.exported ? View.VISIBLE : View.INVISIBLE}" app:layout_constraintBottom_toBottomOf="@id/name" app:layout_constraintStart_toEndOf="@id/img_favourite" app:layout_constraintTop_toTopOf="@id/name" app:tint="?android:attr/textColorSecondary" /> <ImageView android:id="@+id/taken_down" style="@style/taken_down_icon" android:layout_marginStart="3dp" android:layout_marginEnd="6dp" android:src="@drawable/ic_alert_triangle_medium_regular_outline" app:layout_constraintBottom_toBottomOf="@id/public_link" app:layout_constraintStart_toEndOf="@id/public_link" app:layout_constraintTop_toTopOf="@id/public_link" app:visibleGone="@{item.node.takenDown}" app:tint="@color/color_button_brand" tools:visibility="visible" /> <ImageView android:id="@+id/saved_offline" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="45dp" android:background="@null" android:src="@drawable/ic_offline_indicator" android:visibility="@{OfflineUtils.availableOffline(context, item.node) ? View.VISIBLE : View.INVISIBLE}" app:layout_constraintBottom_toBottomOf="@+id/item_file_info_layout" app:layout_constraintEnd_toEndOf="parent" app:tint="?android:attr/textColorSecondary" /> <androidx.constraintlayout.widget.ConstraintLayout android:id="@+id/item_file_info_layout" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginStart="1dp" app:layout_constraintStart_toStartOf="@id/name" app:layout_constraintTop_toBottomOf="@id/name"> <ImageView android:id="@+id/versions_icon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginEnd="8dp" android:src="@drawable/ic_versions_small" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toTopOf="parent" app:tint="@color/black_white" app:visibleGone="@{megaApi.hasVersions(item.node)}" /> <TextView android:id="@+id/node_info" android:layout_width="wrap_content" android:layout_height="wrap_content" android:ellipsize="end" android:singleLine="true" android:text='@{String.format("%s %s", Util.getSizeString(item.node.size, context), TimeUtils.formatLongDateTime(item.node.modificationTime))}' android:textAppearance="@style/TextAppearance.Mega.Body2.Secondary" app:layout_constraintStart_toEndOf="@id/versions_icon" app:layout_constraintTop_toTopOf="parent" tools:text="8.27 MB . June 2020 10:39:12" /> </androidx.constraintlayout.widget.ConstraintLayout> <ImageView android:id="@+id/three_dots" android:layout_width="wrap_content" android:layout_height="match_parent" android:background="@null" android:onClick="@{()->actionModeViewModel.selectedNodes.empty ? itemOperationViewModel.showNodeItemOptions(item) : actionModeViewModel.onNodeClick(item)}" android:paddingStart="10dp" android:paddingEnd="10dp" android:src="@drawable/ic_dots_vertical_grey" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintEnd_toEndOf="parent" app:layout_constraintTop_toTopOf="parent" app:tint="?android:attr/textColorSecondary" android:visibility="@{actionModeViewModel.selectedNodes.empty ? View.VISIBLE : View.GONE}"/> <androidx.constraintlayout.widget.Guideline android:id="@+id/guideline" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" app:layout_constraintGuide_end="100dp" /> </androidx.constraintlayout.widget.ConstraintLayout> </layout> ```
```objective-c * * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ #ifndef __Hacl_Frodo1344_H #define __Hacl_Frodo1344_H #if defined(__cplusplus) extern "C" { #endif #include <string.h> #include "krml/internal/types.h" #include "krml/lowstar_endianness.h" #include "krml/internal/target.h" #include "Hacl_Hash_SHA3.h" extern uint32_t Hacl_Frodo1344_crypto_bytes; extern uint32_t Hacl_Frodo1344_crypto_publickeybytes; extern uint32_t Hacl_Frodo1344_crypto_secretkeybytes; extern uint32_t Hacl_Frodo1344_crypto_ciphertextbytes; uint32_t Hacl_Frodo1344_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); uint32_t Hacl_Frodo1344_crypto_kem_enc(uint8_t *ct, uint8_t *ss, uint8_t *pk); uint32_t Hacl_Frodo1344_crypto_kem_dec(uint8_t *ss, uint8_t *ct, uint8_t *sk); #if defined(__cplusplus) } #endif #define __Hacl_Frodo1344_H_DEFINED #endif ```
```php <div class="content-wrapper"> <section class="content-header"> <h1>Laporan Hasil Analisis</h1> <ol class="breadcrumb"> <li><a href="<?= site_url('beranda') ?>"><i class="fa fa-home"></i> Beranda</a></li> <li><a href="<?= site_url('analisis_master/clear') ?>"> Master Analisis</a></li> <li><a href="<?= site_url('analisis_laporan/leave') ?>"><?= $analisis_master['nama']?></a></li> <li class="active">Laporan Hasil Klasifikasi</li> </ol> </section> </section> <section class="content" id="maincontent"> <form id="mainform" name="mainform" method="post"> <div class="row"> <div class="col-md-4 col-lg-3"> <?php $this->load->view('analisis_master/left', $data); ?> </div> <div class="col-md-8 col-lg-9"> <div class="box box-info"> <div class="box-header with-border"> <a href="<?= site_url("analisis_laporan/dialog_kuisioner/{$p}/{$o}/{$id}/cetak")?>" class="btn btn-social btn-flat bg-purple btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block" data-remote="false" data-toggle="modal" data-target="#modalBox" data-title="Cetak Laporan Hasil Analisis <?= $asubjek?> <?= $subjek['nama']?> "><i class="fa fa-print "></i> Cetak</a> <a href="<?= site_url("analisis_laporan/dialog_kuisioner/{$p}/{$o}/{$id}/unduh")?>" class="btn btn-social btn-flat bg-navy btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block" data-remote="false" data-toggle="modal" data-target="#modalBox" data-title="Unduh Laporan Hasil Analisis <?= $asubjek?> <?= $subjek['nama']?> "><i class="fa fa-download "></i> Unduh</a> <a href="<?=site_url('analisis_laporan/clear') . '/' . $analisis_master['id']?>" class="btn btn-social btn-flat btn-info btn-sm btn-sm visible-xs-block visible-sm-inline-block visible-md-inline-block visible-lg-inline-block" title="Kembali Ke Laporan Hasil Klasifikasi"> <i class="fa fa-arrow-circle-left "></i>Kembali Ke Laporan Hasil Klasifikasi</a> </div> <div class="box-header with-border"> <div class="table-responsive"> <table class="table table-bordered table-striped table-hover" > <tr> <td nowrap width="150">Hasil Pendataan</td> <td width="1">:</td> <td><a href="<?= site_url("analisis_master/menu/{$_SESSION['analisis_master']}") ?>"><?= $analisis_master['nama']?></a></td> </tr> <tr> <td>Nomor Identitas</td> <td>:</td> <td><?= $subjek['nid']?></td> </tr> <tr> <td>Nama Subjek</td> <td>:</td> <td><?= $subjek['nama']?></td> </tr> </table> </div> </div> <div class="box-body"> <div class="row"> <div class="col-sm-12"> <h5 class="box-title">DAFTAR ANGGOTA</h5> <div class="table-responsive"> <table class="table table-bordered table-striped table-hover "> <thead class="bg-gray color-palette"> <tr> <th>NO</th> <th>NIK</th> <th>NAMA</th> <th>TANGGAL LAHIR</th> <th>JENIS KELAMIN</th> </tr> </thead> <tbody> <?php $i = 1; foreach ($list_anggota as $ang): ?> <tr> <td><?= $i?></td> <td><?= $ang['nik']?></td> <td width="45%"><?= $ang['nama']?></td> <td><?= tgl_indo($ang['tanggallahir']) ?></td> <td><?php if ($ang['sex'] == 1): ?>LAKI-LAKI<?php endif; ?><?php if ($ang['sex'] == 2): ?>PEREMPUAN<?php endif; ?></td> </tr> <?php $i++; endforeach; ?> </tbody> </table> </div> </div> </div> <div class="row"> <div class="col-sm-12"> <div class="table-responsive"> <table class="table table-bordered table-striped table-hover "> <thead class="bg-gray color-palette"> <tr> <th>No</th> <th width="45%">Pertanyaan / Indikator</th> <th>Bobot</td> <th>Jawaban</th> <th>Nilai</th> <th>Poin</th> </tr> </thead> <tbody> <?php foreach ($list_jawab as $data): ?> <?php $bg = $data['cek'] >= 1 ? "class='bg'" : ''; ?> <tr> <td><?= $data['no']?></td> <td><?= $data['pertanyaan']?></td> <td><?= $data['bobot']?></td> <td><?= $data['jawaban']?></td> <td><?= $data['nilai']?></td> <td><?= $data['poin']?></td> </tr> <?php endforeach; ?> </tbody> <tfoot class="bg-info olor-palette"> <tr class="total"> <td colspan='5'><strong>TOTAL</strong></td> <td><?= $total?></td> </tr> </tfoot> </table> </div> </div> </div> </div> </div> </div> </div> </form> </section> </div> ```
WIGM (1490 AM) is a radio station, licensed to Medford, Wisconsin, United States, that broadcasts a sports format. The station is currently owned by WIGM, Incorporated, and features programming from CBS Sports Radio. In February 2019 WIGM changed their format from sports to country, branded as "Kickin' Country" (simulcast on FM translator W296DL Medford). Previous logo (WIGM's logo under previous ESPN Radio affiliation) References External links IGM Country radio stations in the United States
The South Keeling Islands are a group of islands of the Cocos (Keeling) Islands, next to North Keeling, about to the north. The Australian atoll is located in the Indian Ocean about northwest of Perth, west of Darwin, southwest of Christmas Island and more than southwest of Java and Sumatra. The atoll consists of West, Home, South, Direction, and Horsburgh islands. West Island is the largest in the territory, with a length of 10 km (6 mi). The South Keeling Islands have two inhabited islands with a combined population of 550, West Island and Home Island. The other islands are not permanently inhabited. A Malay ethnic group of just over 400 people live on the islands, the Cocos Malays, who live mainly in Bantam on Home Island. There are also about 150 Australians, most of whom live on West Island. Notes Landforms of the Cocos (Keeling) Islands Archipelagoes of Australia Archipelagoes of the Indian Ocean
Heather Jean Robson (née Redwood, 6 May 1928 – 11 October 2019) was a New Zealand badminton and tennis player. Early life and family Born on 6 May 1928 in Auckland, to Effie Redwood (née McLachlan) and John Addis Redwood, Robson was educated at St Cuthbert's College. In 1953 she married Jeffrey Ellis Robson, who also played international badminton for New Zealand. The couple went on to have one child. Sporting career Tennis In tennis Robson won both the New Zealand women's doubles and mixed doubles titles. She competed at Wimbledon twice, in 1954 and 1957. In 1954 she reached the third round of the singles, third round of the doubles (playing with Judy Burke), and third round of the mixed doubles (with her husband Jeff). Three years later she progressed to the second round of the singles, quarter-finals of the doubles (with Ruia Morrison), and fourth round of the mixed doubles (again with husband Jeff). Badminton As a badminton player Robson won seven New Zealand singles championships, and also won nine national women's doubles and three mixed doubles titles, playing with her husband. In 1954 she reached the semi-finals of the singles at All England Badminton Championships and won the Irish singles title. Administration At various times, Robson served as president of Auckland Tennis, Auckland Badminton, Badminton New Zealand. and Badminton Oceania. Honours and awards In 1988 Robson received a meritorious service award from the Badminton World Federation. She was appointed a Member of the New Zealand Order of Merit, for services to racquet sports, in the 2001 New Year Honours. In 2013 the Badminton World Federation presented Robson with its lifetime achievement award. Death Robson died in Auckland on 11 October 2019. References 1928 births 2019 deaths New Zealand female badminton players New Zealand female tennis players Sportspeople from Auckland People educated at St Cuthbert's College, Auckland New Zealand sports executives and administrators Members of the New Zealand Order of Merit Tennis players from Auckland 20th-century New Zealand women
```xml import { DisplayMode } from "@microsoft/sp-core-library"; export interface ICAccordionProps { tabs: any[]; displayMode: DisplayMode; guid: string; title: string; accordion:boolean; } ```
```go // // // // path_to_url // // Unless required by applicable law or agreed to in writing, software // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. package signature import ( "bytes" "crypto" "crypto/ed25519" "crypto/rand" "errors" "fmt" "io" ) var ed25519SupportedHashFuncs = []crypto.Hash{ crypto.Hash(0), } // ED25519Signer is a signature.Signer that uses the Ed25519 public-key signature system type ED25519Signer struct { priv ed25519.PrivateKey } // LoadED25519Signer calculates signatures using the specified private key. func LoadED25519Signer(priv ed25519.PrivateKey) (*ED25519Signer, error) { if priv == nil { return nil, errors.New("invalid ED25519 private key specified") } // check this to avoid panic and throw error gracefully if len(priv) != ed25519.PrivateKeySize { return nil, errors.New("invalid size for ED25519 key") } return &ED25519Signer{ priv: priv, }, nil } // SignMessage signs the provided message. Passing the WithDigest option is not // supported as ED25519 performs a two pass hash over the message during the // signing process. // // All options are ignored. func (e ED25519Signer) SignMessage(message io.Reader, _ ...SignOption) ([]byte, error) { messageBytes, _, err := ComputeDigestForSigning(message, crypto.Hash(0), ed25519SupportedHashFuncs) if err != nil { return nil, err } return ed25519.Sign(e.priv, messageBytes), nil } // Public returns the public key that can be used to verify signatures created by // this signer. func (e ED25519Signer) Public() crypto.PublicKey { if e.priv == nil { return nil } return e.priv.Public() } // PublicKey returns the public key that can be used to verify signatures created by // this signer. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519Signer) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.Public(), nil } // Sign computes the signature for the specified message; the first and third arguments to this // function are ignored as they are not used by the ED25519 algorithm. func (e ED25519Signer) Sign(_ io.Reader, message []byte, _ crypto.SignerOpts) ([]byte, error) { if message == nil { return nil, errors.New("message must not be nil") } return e.SignMessage(bytes.NewReader(message)) } // ED25519Verifier is a signature.Verifier that uses the Ed25519 public-key signature system type ED25519Verifier struct { publicKey ed25519.PublicKey } // LoadED25519Verifier returns a Verifier that verifies signatures using the specified ED25519 public key. func LoadED25519Verifier(pub ed25519.PublicKey) (*ED25519Verifier, error) { if pub == nil { return nil, errors.New("invalid ED25519 public key specified") } return &ED25519Verifier{ publicKey: pub, }, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e *ED25519Verifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } // VerifySignature verifies the signature for the given message. // // This function returns nil if the verification succeeded, and an error message otherwise. // // All options are ignored if specified. func (e *ED25519Verifier) VerifySignature(signature, message io.Reader, _ ...VerifyOption) error { messageBytes, _, err := ComputeDigestForVerifying(message, crypto.Hash(0), ed25519SupportedHashFuncs) if err != nil { return err } if signature == nil { return errors.New("nil signature passed to VerifySignature") } sigBytes, err := io.ReadAll(signature) if err != nil { return fmt.Errorf("reading signature: %w", err) } if !ed25519.Verify(e.publicKey, messageBytes, sigBytes) { return errors.New("failed to verify signature") } return nil } // ED25519SignerVerifier is a signature.SignerVerifier that uses the Ed25519 public-key signature system type ED25519SignerVerifier struct { *ED25519Signer *ED25519Verifier } // LoadED25519SignerVerifier creates a combined signer and verifier. This is // a convenience object that simply wraps an instance of ED25519Signer and ED25519Verifier. func LoadED25519SignerVerifier(priv ed25519.PrivateKey) (*ED25519SignerVerifier, error) { signer, err := LoadED25519Signer(priv) if err != nil { return nil, fmt.Errorf("initializing signer: %w", err) } pub, ok := priv.Public().(ed25519.PublicKey) if !ok { return nil, fmt.Errorf("given key is not ed25519.PublicKey") } verifier, err := LoadED25519Verifier(pub) if err != nil { return nil, fmt.Errorf("initializing verifier: %w", err) } return &ED25519SignerVerifier{ ED25519Signer: signer, ED25519Verifier: verifier, }, nil } // NewDefaultED25519SignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using crypto/rand as an entropy source. func NewDefaultED25519SignerVerifier() (*ED25519SignerVerifier, ed25519.PrivateKey, error) { return NewED25519SignerVerifier(rand.Reader) } // NewED25519SignerVerifier creates a combined signer and verifier using ED25519. // This creates a new ED25519 key using the specified entropy source. func NewED25519SignerVerifier(rand io.Reader) (*ED25519SignerVerifier, ed25519.PrivateKey, error) { _, priv, err := ed25519.GenerateKey(rand) if err != nil { return nil, nil, err } sv, err := LoadED25519SignerVerifier(priv) if err != nil { return nil, nil, err } return sv, priv, nil } // PublicKey returns the public key that is used to verify signatures by // this verifier. As this value is held in memory, all options provided in arguments // to this method are ignored. func (e ED25519SignerVerifier) PublicKey(_ ...PublicKeyOption) (crypto.PublicKey, error) { return e.publicKey, nil } ```
Liquid nitrogen—LN2—is nitrogen in a liquid state at low temperature. Liquid nitrogen has a boiling point of about . It is produced industrially by fractional distillation of liquid air. It is a colorless, mobile liquid whose viscosity is about one tenth that of acetone. Liquid nitrogen is widely used as a coolant. Physical properties The diatomic character of the N2 molecule is retained after liquefaction. The weak van der Waals interaction between the N2 molecules results in little interatomic attraction. This is the cause of nitrogen's unusually low boiling point. The temperature of liquid nitrogen can readily be reduced to its freezing point by placing it in a vacuum chamber pumped by a vacuum pump. Liquid nitrogen's efficiency as a coolant is limited by the fact that it boils immediately on contact with a warmer object, enveloping the object in an insulating layer of nitrogen gas bubbles. This effect, known as the Leidenfrost effect, occurs when any liquid comes in contact with a surface which is significantly hotter than its boiling point. Faster cooling may be obtained by plunging an object into a slush of liquid and solid nitrogen rather than liquid nitrogen alone. Handling As a cryogenic fluid that rapidly freezes living tissue, its handling and storage require thermal insulation. It can be stored and transported in vacuum flasks, the temperature being held constant at 77 K by slow boiling of the liquid. Depending on the size and design, the holding time of vacuum flasks ranges from a few hours to a few weeks. The development of pressurised super-insulated vacuum vessels has enabled liquid nitrogen to be stored and transported over longer time periods with losses reduced to 2% per day or less. Uses Liquid nitrogen is a compact and readily transported source of dry nitrogen gas, as it does not require pressurization. Further, its ability to maintain temperatures far below the freezing point of water makes it extremely useful in a wide range of applications, primarily as an open-cycle refrigerant, including: in cryotherapy for removing unsightly or potentially malignant skin lesions such as warts and actinic keratosis to store cells at low temperature for laboratory work in cryogenics in a cryophorus to demonstrate rapid freezing by evaporation as a backup nitrogen source in hypoxic air fire prevention systems as a source of very dry nitrogen gas for the immersion, freezing, and transportation of food products for the cryopreservation of blood, reproductive cells (sperm and egg), and other biological samples and materials to preserve tissue samples from surgical excisions for future studies to facilitate cryoconservation of animal genetic resources to freeze water and oil pipes in order to work on them in situations where a valve is not available to block fluid flow to the work area; this method is known as a cryogenic isolation for cryonic preservation in hopes of future reanimation for shrink-fitting machinery parts together as a coolant for CCD cameras in astronomy for a high-temperature superconductor to a temperature sufficient to achieve superconductivity to maintain a low temperature around the primary liquid helium cooling system of high-field superconducting magnets used in e.g. nuclear magnetic resonance spectrometers and magnetic resonance imaging systems for vacuum pump traps and in controlled-evaporation processes in chemistry as a component of cooling baths used for very low temperature reactions in chemistry to increase the sensitivity of infrared homing seeker heads of missiles such as the Strela 3 to temporarily shrink mechanical components during machine assembly and allow improved interference fits for computers and extreme overclocking for simulation of space background in vacuum chamber during spacecraft thermal testing to control the temperature of mass concrete, injected to precool concrete mixes during delivery in food preparation, such as for making ultra-smooth ice cream. See also molecular gastronomy. in container inerting and pressurisation by injecting a controlled amount of liquid nitrogen just prior to sealing or capping as a cosmetic novelty giving a smoky, bubbling "cauldron effect" to drinks. See liquid nitrogen cocktail. as an energy storage medium in freeze branding cattle In tunnel construction to stabilize unstable and loose terrains, liquid nitrogen injected into soil to froze the water present in the soil. With increased bearing capacity and impermeability, the improved ground will not collapse during excavation and subsequent works. Culinary The culinary use of liquid nitrogen is mentioned in an 1890 recipe book titled Fancy Ices authored by Agnes Marshall, but has been employed in more recent times by restaurants in the preparation of frozen desserts, such as ice cream, which can be created within moments at the table because of the speed at which it cools food. The rapidity of chilling also leads to the formation of smaller ice crystals, which provides the dessert with a smoother texture. The technique is employed by chef Heston Blumenthal who has used it at his restaurant, The Fat Duck, to create frozen dishes such as egg and bacon ice cream. Liquid nitrogen has also become popular in the preparation of cocktails because it can be used to quickly chill glasses or freeze ingredients. It is also added to drinks to create a smoky effect, which occurs as tiny droplets of the liquid nitrogen come into contact with the surrounding air, condensing the vapour that is naturally present. Origin Nitrogen was first liquefied at the Jagiellonian University on 15 April 1883 by Polish physicists Zygmunt Wróblewski and Karol Olszewski. Safety Because the liquid-to-gas expansion ratio of nitrogen is 1:694 at , a tremendous amount of force can be generated if liquid nitrogen is vaporized in an enclosed space. In an incident on January 12, 2006 at Texas A&M University, the pressure-relief devices of a tank of liquid nitrogen were malfunctioning and later sealed. As a result of the subsequent pressure buildup, the tank failed catastrophically. The force of the explosion was sufficient to propel the tank through the ceiling immediately above it, shatter a reinforced concrete beam immediately below it, and blow the walls of the laboratory 0.1–0.2 m off their foundations. Because of its extremely low temperature, careless handling of liquid nitrogen and any objects cooled by it may result in cold burns. In that case, special gloves should be used while handling. However, a small splash or even pouring down skin will not burn immediately because of the Leidenfrost effect, the evaporating gas thermally insulates to some extent, like touching a hot element very briefly with a wet finger. If the liquid nitrogen manages to pool anywhere, it will burn severely. As liquid nitrogen evaporates it reduces the oxygen concentration in the air and can act as an asphyxiant, especially in confined spaces. Nitrogen is odorless, colorless, and tasteless and may produce asphyxia without any sensation or prior warning. Oxygen sensors are sometimes used as a safety precaution when working with liquid nitrogen to alert workers of gas spills into a confined space. Vessels containing liquid nitrogen can condense oxygen from air. The liquid in such a vessel becomes increasingly enriched in oxygen (boiling point ) as the nitrogen evaporates, and can cause violent oxidation of organic material. Ingestion of liquid nitrogen can cause severe internal damage, due to freezing of the tissues which come in contact with it and to the volume of gaseous nitrogen evolved as the liquid is warmed by body heat. In 1997, a physics student demonstrating the Leidenfrost effect by holding liquid nitrogen in his mouth accidentally swallowed the substance, resulting in near-fatal injuries. This was apparently the first case in medical literature of liquid nitrogen ingestion. In 2012, a young woman in England had her stomach removed after ingesting a cocktail made with liquid nitrogen. In January 2021, a line carrying liquid nitrogen ruptured at a poultry processing plant in the U.S. state of Georgia, killing six people and injuring 11 others. Production Liquid nitrogen is produced commercially from the cryogenic distillation of liquified air or from the liquefaction of pure nitrogen derived from air using pressure swing adsorption. An air compressor is used to compress filtered air to high pressure; the high-pressure gas is cooled back to ambient temperature, and allowed to expand to a low pressure. The expanding air cools greatly (the Joule–Thomson effect), and oxygen, nitrogen, and argon are separated by further stages of expansion and distillation. Small-scale production of liquid nitrogen is easily achieved using this principle. Liquid nitrogen may be produced for direct sale, or as a byproduct of manufacture of liquid oxygen used for industrial processes such as steelmaking. Liquid-air plants producing on the order of tons per day of product started to be built in the 1930s but became very common after the Second World War; a large modern plant may produce 3000 tons/day of liquid air products. See also Liquefaction of gases Industrial gas Computer cooling Cryogenic nitrogen plant Liquid nitrogen engine References Nitrogen Coolants Medical equipment Industrial gases Liquids Food and drink preparation Articles containing video clips
```python #!/usr/bin/env python # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Make the format of a vcproj really pretty. This script normalize and sort an xml. It also fetches all the properties inside linked vsprops and include them explicitly in the vcproj. It outputs the resulting xml to stdout. """ from __future__ import print_function import os import sys from xml.dom.minidom import parse from xml.dom.minidom import Node __author__ = 'nsylvain (Nicolas Sylvain)' try: cmp except NameError: def cmp(x, y): return (x > y) - (x < y) REPLACEMENTS = dict() ARGUMENTS = None class CmpTuple(object): """Compare function between 2 tuple.""" def __call__(self, x, y): return cmp(x[0], y[0]) class CmpNode(object): """Compare function between 2 xml nodes.""" def __call__(self, x, y): def get_string(node): node_string = "node" node_string += node.nodeName if node.nodeValue: node_string += node.nodeValue if node.attributes: # We first sort by name, if present. node_string += node.getAttribute("Name") all_nodes = [] for (name, value) in node.attributes.items(): all_nodes.append((name, value)) all_nodes.sort(CmpTuple()) for (name, value) in all_nodes: node_string += name node_string += value return node_string return cmp(get_string(x), get_string(y)) def PrettyPrintNode(node, indent=0): if node.nodeType == Node.TEXT_NODE: if node.data.strip(): print('%s%s' % (' '*indent, node.data.strip())) return if node.childNodes: node.normalize() # Get the number of attributes attr_count = 0 if node.attributes: attr_count = node.attributes.length # Print the main tag if attr_count == 0: print('%s<%s>' % (' '*indent, node.nodeName)) else: print('%s<%s' % (' '*indent, node.nodeName)) all_attributes = [] for (name, value) in node.attributes.items(): all_attributes.append((name, value)) all_attributes.sort(CmpTuple()) for (name, value) in all_attributes: print('%s %s="%s"' % (' '*indent, name, value)) print('%s>' % (' '*indent)) if node.nodeValue: print('%s %s' % (' '*indent, node.nodeValue)) for sub_node in node.childNodes: PrettyPrintNode(sub_node, indent=indent+2) print('%s</%s>' % (' '*indent, node.nodeName)) def FlattenFilter(node): """Returns a list of all the node and sub nodes.""" node_list = [] if (node.attributes and node.getAttribute('Name') == '_excluded_files'): # We don't add the "_excluded_files" filter. return [] for current in node.childNodes: if current.nodeName == 'Filter': node_list.extend(FlattenFilter(current)) else: node_list.append(current) return node_list def FixFilenames(filenames, current_directory): new_list = [] for filename in filenames: if filename: for key in REPLACEMENTS: filename = filename.replace(key, REPLACEMENTS[key]) os.chdir(current_directory) filename = filename.strip('"\' ') if filename.startswith('$'): new_list.append(filename) else: new_list.append(os.path.abspath(filename)) return new_list def AbsoluteNode(node): """Makes all the properties we know about in this node absolute.""" if node.attributes: for (name, value) in node.attributes.items(): if name in ['InheritedPropertySheets', 'RelativePath', 'AdditionalIncludeDirectories', 'IntermediateDirectory', 'OutputDirectory', 'AdditionalLibraryDirectories']: # We want to fix up these paths path_list = value.split(';') new_list = FixFilenames(path_list, os.path.dirname(ARGUMENTS[1])) node.setAttribute(name, ';'.join(new_list)) if not value: node.removeAttribute(name) def CleanupVcproj(node): """For each sub node, we call recursively this function.""" for sub_node in node.childNodes: AbsoluteNode(sub_node) CleanupVcproj(sub_node) # Normalize the node, and remove all extranous whitespaces. for sub_node in node.childNodes: if sub_node.nodeType == Node.TEXT_NODE: sub_node.data = sub_node.data.replace("\r", "") sub_node.data = sub_node.data.replace("\n", "") sub_node.data = sub_node.data.rstrip() # Fix all the semicolon separated attributes to be sorted, and we also # remove the dups. if node.attributes: for (name, value) in node.attributes.items(): sorted_list = sorted(value.split(';')) unique_list = [] for i in sorted_list: if not unique_list.count(i): unique_list.append(i) node.setAttribute(name, ';'.join(unique_list)) if not value: node.removeAttribute(name) if node.childNodes: node.normalize() # For each node, take a copy, and remove it from the list. node_array = [] while node.childNodes and node.childNodes[0]: # Take a copy of the node and remove it from the list. current = node.childNodes[0] node.removeChild(current) # If the child is a filter, we want to append all its children # to this same list. if current.nodeName == 'Filter': node_array.extend(FlattenFilter(current)) else: node_array.append(current) # Sort the list. node_array.sort(CmpNode()) # Insert the nodes in the correct order. for new_node in node_array: # But don't append empty tool node. if new_node.nodeName == 'Tool': if new_node.attributes and new_node.attributes.length == 1: # This one was empty. continue if new_node.nodeName == 'UserMacro': continue node.appendChild(new_node) def GetConfiguationNodes(vcproj): #TODO(nsylvain): Find a better way to navigate the xml. nodes = [] for node in vcproj.childNodes: if node.nodeName == "Configurations": for sub_node in node.childNodes: if sub_node.nodeName == "Configuration": nodes.append(sub_node) return nodes def GetChildrenVsprops(filename): dom = parse(filename) if dom.documentElement.attributes: vsprops = dom.documentElement.getAttribute('InheritedPropertySheets') return FixFilenames(vsprops.split(';'), os.path.dirname(filename)) return [] def SeekToNode(node1, child2): # A text node does not have properties. if child2.nodeType == Node.TEXT_NODE: return None # Get the name of the current node. current_name = child2.getAttribute("Name") if not current_name: # There is no name. We don't know how to merge. return None # Look through all the nodes to find a match. for sub_node in node1.childNodes: if sub_node.nodeName == child2.nodeName: name = sub_node.getAttribute("Name") if name == current_name: return sub_node # No match. We give up. return None def MergeAttributes(node1, node2): # No attributes to merge? if not node2.attributes: return for (name, value2) in node2.attributes.items(): # Don't merge the 'Name' attribute. if name == 'Name': continue value1 = node1.getAttribute(name) if value1: # The attribute exist in the main node. If it's equal, we leave it # untouched, otherwise we concatenate it. if value1 != value2: node1.setAttribute(name, ';'.join([value1, value2])) else: # The attribute does not exist in the main node. We append this one. node1.setAttribute(name, value2) # If the attribute was a property sheet attributes, we remove it, since # they are useless. if name == 'InheritedPropertySheets': node1.removeAttribute(name) def MergeProperties(node1, node2): MergeAttributes(node1, node2) for child2 in node2.childNodes: child1 = SeekToNode(node1, child2) if child1: MergeProperties(child1, child2) else: node1.appendChild(child2.cloneNode(True)) def main(argv): """Main function of this vcproj prettifier.""" global ARGUMENTS ARGUMENTS = argv # check if we have exactly 1 parameter. if len(argv) < 2: print('Usage: %s "c:\\path\\to\\vcproj.vcproj" [key1=value1] ' '[key2=value2]' % argv[0]) return 1 # Parse the keys for i in range(2, len(argv)): (key, value) = argv[i].split('=') REPLACEMENTS[key] = value # Open the vcproj and parse the xml. dom = parse(argv[1]) # First thing we need to do is find the Configuration Node and merge them # with the vsprops they include. for configuration_node in GetConfiguationNodes(dom.documentElement): # Get the property sheets associated with this configuration. vsprops = configuration_node.getAttribute('InheritedPropertySheets') # Fix the filenames to be absolute. vsprops_list = FixFilenames(vsprops.strip().split(';'), os.path.dirname(argv[1])) # Extend the list of vsprops with all vsprops contained in the current # vsprops. for current_vsprops in vsprops_list: vsprops_list.extend(GetChildrenVsprops(current_vsprops)) # Now that we have all the vsprops, we need to merge them. for current_vsprops in vsprops_list: MergeProperties(configuration_node, parse(current_vsprops).documentElement) # Now that everything is merged, we need to cleanup the xml. CleanupVcproj(dom.documentElement) # Finally, we use the prett xml function to print the vcproj back to the # user. #print dom.toprettyxml(newl="\n") PrettyPrintNode(dom.documentElement) return 0 if __name__ == '__main__': sys.exit(main(sys.argv)) ```
Delron Felix (born 20 October 2000) is a Grenadian swimmer. He competed in the men's 100 metre freestyle at the 2020 Summer Olympics. References External links 2000 births Living people Grenadian male swimmers Grenadian male freestyle swimmers Olympic swimmers for Grenada Swimmers at the 2020 Summer Olympics Place of birth missing (living people) Pan American Games competitors for Grenada Swimmers at the 2019 Pan American Games Swimmers at the 2018 Summer Youth Olympics
Township and Village Enterprises (TVEs, ) are market-oriented public enterprises under the purview of local governments based in townships and villages in China. History Before the Reform and Opening Although Chinese leader Deng Xiaoping was reported to have said that TVEs "appear(ed) out of nowhere" in 1987, the industrial development in rural China could be traced back to as early as 1950s. During this period, rural enterprises, often with names "commune and brigade enterprises" and of neglectable size, served as a supplement to those state-owned enterprises (SOE), which mainly focused on heavy industrial sectors, and were established by the people's communes and bridges to support agricultural production and to produce rural social products for local and domestic needs. The political turmoil between late 1950s and early 1960s, like the Great Leap Forward, at one time halted the development of rural enterprises and some were suspended. Nevertheless, encouraged by the Chinese government to produce rural social goods, the enthusiasm of rural enterprises increased again in 1965. According to official records, the number of rural enterprise was about 122,000 in 1965, and quickly increased to 447,000 in 1970. During this period, however, rural enterprises were restricted to certain industrial and agricultural sections, including the production of iron, steel, cement, chemical fertilizer, hydroelectric power, and farm tools. After 1978 Most TVEs emerged during the Reform period in the 1980s (Huang, 2008). There were only 1.5 million in 1978, at the start of the Reform period, and after the State Council of the People's Republic of China first officially used the term "Township and Village Enterprises" in March, 1984, number of TVEs had been over 12 millions by 1985. The reforms of 1978 changed TVEs, which became the most vibrant part of the Chinese economy as they experienced significant expansion in the 1980s and early 1990s. TVE employment grew from 28 million in 1978 to a peak of 135 million in 1996. Likewise, production of TVEs increased to 1.8 trillion yuan in 1992 from 49 billion yuan in 1978. More than half of TVE production in the 1980s occurred in the east coastal and central provinces like Guangdong, Fujian, Zhejiang, Jiangsu, Shandong, and Hunan provinces. In Jiangsu and Shandong TVEs employed some 30 percent of the rural workforce. However, it should be noticed that many TVEs are specialized in the production of labor-intensive commodities without higher technological requirement. In a strategy which came to be known by the slogan "wearing a red hat," some private entrepreneurs obtained permission from townships and villages to register their private enterprises as TVEs in order to avoid restrictions on the number of employees a small private business could have. As private ownership became less politically-controversial after the mid-1990s, the TVEs' proportionate share of the national economy declined. Many were either privatized or turned into shareholding companies. Notable characteristics Locations and Ownership Many of these firms were “collectively owned” in the sense that theoretical ownership rested with the collectives, either as a legacy of earlier sponsorship, or because township and village governments took the lead in establishing new TVEs after the breakup of the agricultural collectives. Ultimate “ownership rights” stayed with the collective, while “use rights” were delegated to managers in collective TVEs. The complexity of this arrangement led to the labeling of collective (township and village) TVE property rights as “fuzzy.” This lack of a true system of property rights collapsed in a short amount of time, as townships and villages expropriated the use rights using their ownership rights. TVEs referred to the location of the enterprises, as opposed to the ownership structure. That is, TVE never referred to only companies owned by township and villages; rather, TVE refers to companies located in townships and villages. Huang (2008) quotes a Chinese Ministry of Agriculture document from 1984 in support of this: TVEs include enterprises sponsored by townships and villages, the alliance enterprises [private stock companies] formed by peasants, other alliance enterprises, and individual enterprises." Some collective TVEs were notable for their unique ownership and corporate governance setup. TVEs were very flexible in terms of organizational and ownership structure. While some were run by local governments, others were more genuinely independent in nature. Wong has shown that through the 1980s most of the supposedly collective TVEs operated as private enterprises in practice. In this sense, the use of the term collective masked the privatization of rural enterprise at a time when it was ideologically subversive to some. TVEs developed most rapidly in locations where central planning had produced poor results, either through shortages or non-useful surpluses. Source: China Statistical Yearbook 1999 Comparable Advantages The hybrid status of TVEs as neither state-owned nor privately-owned provided significant advantages within the reforming economy of China. Because they were not state-owned, TVEs were not restrained by state planning policies or price control. And because they were not private, they were not politically controversial. TVEs also provided local levels of government with revenue opportunities after the reform-era introduced fiscal contracting, a system in which each level of government remitted a specified amount of tax upward to the higher level of government and retained the excess. TVE profits, however, could be kept entirely at the local level. TVEs are solely responsible for profits and losses, obtain all production factors (capital, raw materials, technology, personnel, and so on) from the market, use independent distribution and supply channels and operated under flexible management with little interference of government, etc. Socioeconomic Background TVEs thrived from 1978 to 1989, and were largely dismantled between 1989 and 1996. Scholars have given a number of reasons for their success. The political institutional environment favored these “public” enterprises during the early years of reform, since private businesses faced severe restrictions and discrimination in terms of resources and regulations. Also, the fiscal decentralization of the early 1980s gave greater decision-making power to local governments and linked fiscal revenue to the career potential of local officials, creating strong incentives for them to promote these enterprises. The TVEs moved in to take advantage of the gaps left in the market by the State-Owned Enterprises to produce colorful elastic bands, ID card holders, etc. The TVEs benefited from first mover advantage as there was no competition in the early stages from private firms due to restrictions on the markets. The pent-up demand in China for a host of products provided ample profit-making opportunities for enterprises operating at this early juncture. Moreover, TVEs were helped by massive loans from the state banking system. The TVE sector experienced dramatic changes in 1995-1996 (Huang, 2008). Official hostility toward Chinese entrepreneurship during the period of Jiang Zemin's administration caused many to go out of business, with some estimates suggesting that about 30 percent have gone bankrupt. In addition, there has been a massive trend toward privatization. After the mid-1990s, TVEs were forced to restructure substantially. With increased market integration and competition, official discrimination against TVEs, and official preference for foreign-owned enterprises, TVEs lost their competitive position. Further, the end of directional liberalism in China encouraged local officials to expropriate the TVEs. As competition intensified and credit became harder to obtain, the collectively owned TVE sector grew in comparison to the privately owned TVEs. Rural industries today are more tied to their local government and community and have taken on new forms and roles (Huang, 2008). One of the most striking developments has been the rise of “industrial clusters” of small firms both competing with one another and cooperating to form a relatively complete industrial chain. Industrial clusters have also emerged in places such as Brazil and Italy. Environmental issue Damages According to the World Health Organization (WHO) and United Nations Development Programme (UNDP), TVEs in China is responsible for more than 10 billion metric tons of industrial waste water, which is more than half of the total. Worse still, this industrial wastewater directly discharges into the water resource without any treatment and control. Polluted water damaged the environment, causing 10 to 20 million hectares of polluted land by 2001. Furthermore, reports showed that artisanal mines, which mostly are TVEs, leak hundreds of tonnes of mercury annually. In the meantime, as many TVEs were built near the population density areas, these pollutions not only cost damaged the environment but also threatened the population's health nearby. In general, the analysis found that TVEs' area residents have a more significant rate of diseases and a shorter lifetime; the unregulated activities made Chinese rural areas pay a huge price for environmental damage. Controls In response to the climate crisis brought by the TVEs, the government passed a regulation in 1979 that "The transfer of products and production involving toxic and hazardous substances to rural areas is prohibited unless accompanied by the transfer of effective pollution control equipment." The result was unsatisfactory: many harmful activities still existed and ignored the regulation. Moreover, TVEs were based on old and polluted types of equipment that were different from urban spaces, so it was hard to control the pollution due to their locations and large numbers. During the 8th five-year plan, the Chinese government enhanced the policy to deal with the worsening climate crisis. Although the changes focused more on urban cities, TVEs pollution was impacted, especially wastewater. See also Province (China) (for a discussion of townships and villages). Production team (China) Village-owned enterprise References External links First book on rural enterprises published - Xinhuanet. 6 Dec. 2005. State-Owned versus Township and Village Enterprises in China Economic history of the People's Republic of China Rural development in China
```go // Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. //go:build go1.16 // +build go1.16 package bedrockagentruntime import ( "bytes" "context" "io/ioutil" "net/http" "reflect" "strings" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamtest" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) var _ time.Time var _ awserr.Error var _ context.Context var _ sync.WaitGroup var _ strings.Reader func TestInvokeAgent_Read(t *testing.T) { expectEvents, eventMsgs := mockInvokeAgentReadEvents() sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, eventstreamtest.ServeEventStream{ T: t, Events: eventMsgs, }, true, ) if err != nil { t.Fatalf("expect no error, %v", err) } defer cleanupFn() svc := New(sess) resp, err := svc.InvokeAgent(nil) if err != nil { t.Fatalf("expect no error got, %v", err) } defer resp.GetStream().Close() var i int for event := range resp.GetStream().Events() { if event == nil { t.Errorf("%d, expect event, got nil", i) } if e, a := expectEvents[i], event; !reflect.DeepEqual(e, a) { t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a) } i++ } if err := resp.GetStream().Err(); err != nil { t.Errorf("expect no error, %v", err) } } func TestInvokeAgent_ReadClose(t *testing.T) { _, eventMsgs := mockInvokeAgentReadEvents() sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, eventstreamtest.ServeEventStream{ T: t, Events: eventMsgs, }, true, ) if err != nil { t.Fatalf("expect no error, %v", err) } defer cleanupFn() svc := New(sess) resp, err := svc.InvokeAgent(nil) if err != nil { t.Fatalf("expect no error got, %v", err) } // Assert calling Err before close does not close the stream. resp.GetStream().Err() select { case _, ok := <-resp.GetStream().Events(): if !ok { t.Fatalf("expect stream not to be closed, but was") } default: } resp.GetStream().Close() <-resp.GetStream().Events() if err := resp.GetStream().Err(); err != nil { t.Errorf("expect no error, %v", err) } } func TestInvokeAgent_ReadUnknownEvent(t *testing.T) { expectEvents, eventMsgs := mockInvokeAgentReadEvents() var eventOffset int unknownEvent := eventstream.Message{ Headers: eventstream.Headers{ eventstreamtest.EventMessageTypeHeader, { Name: eventstreamapi.EventTypeHeader, Value: eventstream.StringValue("UnknownEventName"), }, }, Payload: []byte("some unknown event"), } eventMsgs = append(eventMsgs[:eventOffset], append([]eventstream.Message{unknownEvent}, eventMsgs[eventOffset:]...)...) expectEvents = append(expectEvents[:eventOffset], append([]ResponseStreamEvent{ &ResponseStreamUnknownEvent{ Type: "UnknownEventName", Message: unknownEvent, }, }, expectEvents[eventOffset:]...)...) sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, eventstreamtest.ServeEventStream{ T: t, Events: eventMsgs, }, true, ) if err != nil { t.Fatalf("expect no error, %v", err) } defer cleanupFn() svc := New(sess) resp, err := svc.InvokeAgent(nil) if err != nil { t.Fatalf("expect no error got, %v", err) } defer resp.GetStream().Close() var i int for event := range resp.GetStream().Events() { if event == nil { t.Errorf("%d, expect event, got nil", i) } if e, a := expectEvents[i], event; !reflect.DeepEqual(e, a) { t.Errorf("%d, expect %T %v, got %T %v", i, e, e, a, a) } i++ } if err := resp.GetStream().Err(); err != nil { t.Errorf("expect no error, %v", err) } } func BenchmarkInvokeAgent_Read(b *testing.B) { _, eventMsgs := mockInvokeAgentReadEvents() var buf bytes.Buffer encoder := eventstream.NewEncoder(&buf) for _, msg := range eventMsgs { if err := encoder.Encode(msg); err != nil { b.Fatalf("failed to encode message, %v", err) } } stream := &loopReader{source: bytes.NewReader(buf.Bytes())} sess := unit.Session svc := New(sess, &aws.Config{ Endpoint: aws.String("path_to_url"), DisableParamValidation: aws.Bool(true), }) svc.Handlers.Send.Swap(corehandlers.SendHandler.Name, request.NamedHandler{Name: "mockSend", Fn: func(r *request.Request) { r.HTTPResponse = &http.Response{ Status: "200 OK", StatusCode: 200, Header: http.Header{}, Body: ioutil.NopCloser(stream), } }, }, ) resp, err := svc.InvokeAgent(nil) if err != nil { b.Fatalf("failed to create request, %v", err) } defer resp.GetStream().Close() b.ResetTimer() for i := 0; i < b.N; i++ { if err = resp.GetStream().Err(); err != nil { b.Fatalf("expect no error, got %v", err) } event := <-resp.GetStream().Events() if event == nil { b.Fatalf("expect event, got nil, %v, %d", resp.GetStream().Err(), i) } } } func mockInvokeAgentReadEvents() ( []ResponseStreamEvent, []eventstream.Message, ) { expectEvents := []ResponseStreamEvent{ &PayloadPart{ Attribution: &Attribution{ Citations: []*Citation{ { GeneratedResponsePart: &GeneratedResponsePart{ TextResponsePart: &TextResponsePart{ Span: &Span{ End: aws.Int64(123), Start: aws.Int64(123), }, Text: aws.String("string value goes here"), }, }, RetrievedReferences: []*RetrievedReference{ { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, }, }, { GeneratedResponsePart: &GeneratedResponsePart{ TextResponsePart: &TextResponsePart{ Span: &Span{ End: aws.Int64(123), Start: aws.Int64(123), }, Text: aws.String("string value goes here"), }, }, RetrievedReferences: []*RetrievedReference{ { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, }, }, { GeneratedResponsePart: &GeneratedResponsePart{ TextResponsePart: &TextResponsePart{ Span: &Span{ End: aws.Int64(123), Start: aws.Int64(123), }, Text: aws.String("string value goes here"), }, }, RetrievedReferences: []*RetrievedReference{ { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, }, }, }, }, Bytes: []byte("blob value goes here"), }, &TracePart{ AgentAliasId: aws.String("string value goes here"), AgentId: aws.String("string value goes here"), SessionId: aws.String("string value goes here"), Trace: &Trace{ FailureTrace: &FailureTrace{ FailureReason: aws.String("string value goes here"), TraceId: aws.String("string value goes here"), }, OrchestrationTrace: &OrchestrationTrace{ InvocationInput: &InvocationInput_{ ActionGroupInvocationInput: &ActionGroupInvocationInput_{ ActionGroupName: aws.String("string value goes here"), ApiPath: aws.String("string value goes here"), Parameters: []*Parameter{ { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, }, RequestBody: &RequestBody{ Content: map[string][]*Parameter{ "a": { { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, }, "b": { { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, }, "c": { { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, { Name: aws.String("string value goes here"), Type: aws.String("string value goes here"), Value: aws.String("string value goes here"), }, }, }, }, Verb: aws.String("string value goes here"), }, InvocationType: aws.String("string value goes here"), KnowledgeBaseLookupInput: &KnowledgeBaseLookupInput_{ KnowledgeBaseId: aws.String("string value goes here"), Text: aws.String("string value goes here"), }, TraceId: aws.String("string value goes here"), }, ModelInvocationInput: &ModelInvocationInput_{ InferenceConfiguration: &InferenceConfiguration{ MaximumLength: aws.Int64(123), StopSequences: []*string{ aws.String("string value goes here"), aws.String("string value goes here"), aws.String("string value goes here"), }, Temperature: aws.Float64(123.4), TopK: aws.Int64(123), TopP: aws.Float64(123.4), }, OverrideLambda: aws.String("string value goes here"), ParserMode: aws.String("string value goes here"), PromptCreationMode: aws.String("string value goes here"), Text: aws.String("string value goes here"), TraceId: aws.String("string value goes here"), Type: aws.String("string value goes here"), }, Observation: &Observation{ ActionGroupInvocationOutput: &ActionGroupInvocationOutput_{ Text: aws.String("string value goes here"), }, FinalResponse: &FinalResponse{ Text: aws.String("string value goes here"), }, KnowledgeBaseLookupOutput: &KnowledgeBaseLookupOutput_{ RetrievedReferences: []*RetrievedReference{ { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, { Content: &RetrievalResultContent{ Text: aws.String("string value goes here"), }, Location: &RetrievalResultLocation{ S3Location: &RetrievalResultS3Location{ Uri: aws.String("string value goes here"), }, Type: aws.String("string value goes here"), }, }, }, }, RepromptResponse: &RepromptResponse{ Source: aws.String("string value goes here"), Text: aws.String("string value goes here"), }, TraceId: aws.String("string value goes here"), Type: aws.String("string value goes here"), }, Rationale: &Rationale{ Text: aws.String("string value goes here"), TraceId: aws.String("string value goes here"), }, }, PostProcessingTrace: &PostProcessingTrace{ ModelInvocationInput: &ModelInvocationInput_{ InferenceConfiguration: &InferenceConfiguration{ MaximumLength: aws.Int64(123), StopSequences: []*string{ aws.String("string value goes here"), aws.String("string value goes here"), aws.String("string value goes here"), }, Temperature: aws.Float64(123.4), TopK: aws.Int64(123), TopP: aws.Float64(123.4), }, OverrideLambda: aws.String("string value goes here"), ParserMode: aws.String("string value goes here"), PromptCreationMode: aws.String("string value goes here"), Text: aws.String("string value goes here"), TraceId: aws.String("string value goes here"), Type: aws.String("string value goes here"), }, ModelInvocationOutput: &PostProcessingModelInvocationOutput_{ ParsedResponse: &PostProcessingParsedResponse{ Text: aws.String("string value goes here"), }, TraceId: aws.String("string value goes here"), }, }, PreProcessingTrace: &PreProcessingTrace{ ModelInvocationInput: &ModelInvocationInput_{ InferenceConfiguration: &InferenceConfiguration{ MaximumLength: aws.Int64(123), StopSequences: []*string{ aws.String("string value goes here"), aws.String("string value goes here"), aws.String("string value goes here"), }, Temperature: aws.Float64(123.4), TopK: aws.Int64(123), TopP: aws.Float64(123.4), }, OverrideLambda: aws.String("string value goes here"), ParserMode: aws.String("string value goes here"), PromptCreationMode: aws.String("string value goes here"), Text: aws.String("string value goes here"), TraceId: aws.String("string value goes here"), Type: aws.String("string value goes here"), }, ModelInvocationOutput: &PreProcessingModelInvocationOutput_{ ParsedResponse: &PreProcessingParsedResponse{ IsValid: aws.Bool(true), Rationale: aws.String("string value goes here"), }, TraceId: aws.String("string value goes here"), }, }, }, }, } var marshalers request.HandlerList marshalers.PushBackNamed(restjson.BuildHandler) payloadMarshaler := protocol.HandlerPayloadMarshal{ Marshalers: marshalers, } _ = payloadMarshaler eventMsgs := []eventstream.Message{ { Headers: eventstream.Headers{ eventstreamtest.EventMessageTypeHeader, { Name: eventstreamapi.EventTypeHeader, Value: eventstream.StringValue("chunk"), }, }, Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[0]), }, { Headers: eventstream.Headers{ eventstreamtest.EventMessageTypeHeader, { Name: eventstreamapi.EventTypeHeader, Value: eventstream.StringValue("trace"), }, }, Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[1]), }, } return expectEvents, eventMsgs } func TestInvokeAgent_ReadException(t *testing.T) { expectEvents := []ResponseStreamEvent{ &AccessDeniedException{ RespMetadata: protocol.ResponseMetadata{ StatusCode: 200, }, Message_: aws.String("string value goes here"), }, } var marshalers request.HandlerList marshalers.PushBackNamed(restjson.BuildHandler) payloadMarshaler := protocol.HandlerPayloadMarshal{ Marshalers: marshalers, } eventMsgs := []eventstream.Message{ { Headers: eventstream.Headers{ eventstreamtest.EventExceptionTypeHeader, { Name: eventstreamapi.ExceptionTypeHeader, Value: eventstream.StringValue("accessDeniedException"), }, }, Payload: eventstreamtest.MarshalEventPayload(payloadMarshaler, expectEvents[0]), }, } sess, cleanupFn, err := eventstreamtest.SetupEventStreamSession(t, eventstreamtest.ServeEventStream{ T: t, Events: eventMsgs, }, true, ) if err != nil { t.Fatalf("expect no error, %v", err) } defer cleanupFn() svc := New(sess) resp, err := svc.InvokeAgent(nil) if err != nil { t.Fatalf("expect no error got, %v", err) } defer resp.GetStream().Close() <-resp.GetStream().Events() err = resp.GetStream().Err() if err == nil { t.Fatalf("expect err, got none") } expectErr := &AccessDeniedException{ RespMetadata: protocol.ResponseMetadata{ StatusCode: 200, }, Message_: aws.String("string value goes here"), } aerr, ok := err.(awserr.Error) if !ok { t.Errorf("expect exception, got %T, %#v", err, err) } if e, a := expectErr.Code(), aerr.Code(); e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := expectErr.Message(), aerr.Message(); e != a { t.Errorf("expect %v, got %v", e, a) } if e, a := expectErr, aerr; !reflect.DeepEqual(e, a) { t.Errorf("expect error %+#v, got %+#v", e, a) } } var _ awserr.Error = (*AccessDeniedException)(nil) var _ awserr.Error = (*BadGatewayException)(nil) var _ awserr.Error = (*ConflictException)(nil) var _ awserr.Error = (*DependencyFailedException)(nil) var _ awserr.Error = (*InternalServerException)(nil) var _ awserr.Error = (*ResourceNotFoundException)(nil) var _ awserr.Error = (*ServiceQuotaExceededException)(nil) var _ awserr.Error = (*ThrottlingException)(nil) var _ awserr.Error = (*ValidationException)(nil) type loopReader struct { source *bytes.Reader } func (c *loopReader) Read(p []byte) (int, error) { if c.source.Len() == 0 { c.source.Seek(0, 0) } return c.source.Read(p) } ```
Elijah Moshinsky (8 January 1946 – 14 January 2021) was an Australian opera director, theatre director and television director who worked for the Royal Opera House, the Metropolitan Opera, the Royal National Theatre, and BBC Television, among other organisations. Early years Moshinsky's Russian Jewish parents had fled from Vladivostok to the French Concession of Shanghai, where Elijah was born. When he was five years old, the family moved to Melbourne. He attended Camberwell High School and then was an under-graduate resident at Ormond College, where in 1965 he was the set designer of a stage adaptation of Kafka's The Trial. Moshinsky supported himself as an undergraduate by playing the third flute at the Melbourne Symphony Orchestra. In 1969, he directed Beckett's Krapp's Last Tape with Max Gillies at the Alexander Theatre at Monash University. He graduated from the University of Melbourne and in 1973 won a scholarship to St Antony's College, Oxford, where he specialised in the study of Alexander Herzen. While still at St Antony's, Moshinsky directed a production of As You Like It for the Oxford and Cambridge Shakespeare Company. When Sir John Tooley, the General Director at Covent Garden, saw the play, he offered Moshinsky a post as a staff producer for The Royal Opera. Opera director In 1975, Moshinsky made his operatic debut at the Royal Opera House with "a stripped-down, low-budget production of Peter Grimes [with Jon Vickers] which won enormous popular and critical success." That production was reproduced at the Paris Opera introducing the piece to the French public. It was also presented at La Scala, Tokyo and Los Angeles. Subsequent productions at Covent Garden include Lohengrin, Tannhäuser, The Rake's Progress, Macbeth, Samson and Delilah, Samson, Die Entführung aus dem Serail, Aida (with Cheryl Studer and Sir Edward Downes), Otello (with Plácido Domingo and Carlos Kleiber), Attila, Simon Boccanegra and Stiffelio. At the Metropolitan Opera, he directed Otello, Samson et Dalila and Samson, Un ballo in maschera, Ariadne auf Naxos, The Queen of Spades, The Makropulos Affair, Nabucco and Luisa Miller. For the Lyric Opera of Chicago he directed Samson, The Bartered Bride, Nabucco, Lohengrin, The Pirates of Penzance, Cavalleria rusticana and Pagliacci, Samuel Barber's Antony and Cleopatra. For Welsh Opera he directed Berlioz's Béatrice et Bénédict, Cavalleria rusticanna. For Scottish Opera he directed La bohème and La forza del destino. At English National Opera in 1982, he directed the British premiere of Le Grand Macabre as well as Die Meistersinger von Nürnberg and The Bartered Bride. Other engagements have included Wozzeck for the Adelaide Festival, A Midsummer Night's Dream, Boris Godunov, Il trovatore, The Barber of Seville, Rigoletto, La traviata, Don Carlo with Opera Australia, I vespri siciliani in Geneva and Benvenuto Cellini at the Maggio Musicale in Florence, Stiffelio at La Scala and Vienna. At the Mariinsky Theatre in St Petersburg he directed the original version of La forza del destino. At the Novaya Opera in Moscow he produced The Barber of Seville. Later, he directed Plácido Domingo in Simon Boccanegra at Covent Garden, Los Angeles and at the National Centre for the Performing Arts (NCPA) in Beijing. For the Korea National Opera he created new productions of Don Carlo and Roméo et Juliette. In 2015, he directed Giovanna d'Arco for the Buxton Festival. Theatre director For the theatre stage, his credits included Troilus and Cressida and Thomas Bernhard's The Force of Habit at the Royal National Theatre in 1976, and, elsewhere in London: Three Sisters and Robert Storey's Light Up the Sky in 1987, Ivanov, Much Ado About Nothing and Ronald Harwood's Another Time with Albert Finney (all in 1989), Matador (1991), Becket (1991), Ronald Harwood's Reflected Glory (1992), Cyrano de Bergerac (1992–1993), Richard III (1999), plus Shadowlands with Nigel Hawthorne in the UK and on Broadway (1990–1991). He also directed the first production of Nigel Williams' adaptation of Lord of the Flies for the RSC. Television director Moshinsky made a number of television films, mostly of operas. Non-operatic works, mainly for the BBC, include a number of Shakespeare's plays, televised between 1980 and 1985: All's Well That Ends Well, A Midsummer Night's Dream, Cymbeline with Helen Mirren, Coriolanus with Alan Howard and Irene Worth, and Love's Labour's Lost. He also directed Judi Dench and Kenneth Branagh in Ibsen's Ghosts (1986) and Richard Brinsley Sheridan's The Rivals (1987). He also directed a three-part serial version of Kingsley Amis' novel The Green Man (1990). He also directed two documentaries for the BBC: Mozart in Turkey, which was filmed in the Topkapi Palace and Divas for Arena. He also directed a film of Tippet's The Midsummer Marriage for Channel 4. Personal life Moshinsky married Ruth Dyttman in 1970. They had two sons and lived in London. In January 2021, Moshinsky had a fall at his London home, and was taken to hospital where he contracted COVID-19 during the COVID-19 pandemic in the United Kingdom. He died on 14 January 2021. References External links Radio program, BBC Radio 4 – Desert Island Discs, Elijah Moshinsky, 28 February 1993 1946 births 2021 deaths Australian theatre directors Australian opera directors Australian television directors Australian people of Russian-Jewish descent Musicians from Melbourne University of Melbourne alumni Alumni of St Antony's College, Oxford Australian expatriates in the United Kingdom Australian Jews White Russian emigrants to Australia Deaths from the COVID-19 pandemic in England
```xml <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <VersionPrefix>0.0.0-dev</VersionPrefix> <TargetFrameworks>net6.0;net7.0;net8.0</TargetFrameworks> <ImplicitUsings>enable</ImplicitUsings> <Nullable>enable</Nullable> </PropertyGroup> <ItemGroup> <ProjectReference Include="..\..\src\Ocelot\Ocelot.csproj" /> </ItemGroup> </Project> ```
```c++ // Boost.Geometry (aka GGL, Generic Geometry Library) // // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // path_to_url #include <algorithms/test_convert.hpp> template <typename Point1, typename Point2> void test_mixed_point_types() { test_mixed_identical_result < bg::model::multi_point<Point1>, bg::model::multi_point<Point2> > ("MULTIPOINT((1 1),(2 2),(3 3))"); test_mixed_identical_result < bg::model::multi_linestring<bg::model::linestring<Point1> >, bg::model::multi_linestring<bg::model::linestring<Point2> > > ("MULTILINESTRING((1 1,2 2),(3 3,4 4))"); // Single -> multi (always possible) test_mixed < Point1, bg::model::multi_point<Point2> > ( "POINT(1 1)", "MULTIPOINT((1 1))", 1 ); test_mixed < bg::model::linestring<Point1>, bg::model::multi_linestring<bg::model::linestring<Point2> > > ( "LINESTRING(1 1,2 2)", "MULTILINESTRING((1 1,2 2))", 2 ); test_mixed < bg::model::segment<Point1>, bg::model::multi_linestring<bg::model::linestring<Point2> > > ( "LINESTRING(1 1,2 2)", "MULTILINESTRING((1 1,2 2))", 2 ); test_mixed < bg::model::box<Point1>, bg::model::multi_polygon<bg::model::polygon<Point2> > > ( "BOX(0 0,1 1)", "MULTIPOLYGON(((0 0,0 1,1 1,1 0,0 0)))", 5 ); test_mixed < bg::model::ring<Point1, true>, bg::model::multi_polygon<bg::model::polygon<Point2, false> > > ( "POLYGON((0 0,0 1,1 1,1 0,0 0))", "MULTIPOLYGON(((0 0,1 0,1 1,0 1,0 0)))", 5 ); // Multi -> single: should not compile (because multi often have 0 or >1 elements) } template <typename Point1, typename Point2> void test_mixed_types() { test_mixed_point_types<Point1, Point2>(); test_mixed_point_types<Point2, Point1>(); } int test_main( int , char* [] ) { test_mixed_types < bg::model::point<int, 2, bg::cs::cartesian>, bg::model::point<double, 2, bg::cs::cartesian> >(); return 0; } ```
Zalingei Airport is an airport serving the city of Zalingei in Central Darfur, Sudan. Accidents and incidents On 11 November 2010, an Antonov An-24 of Tarco Airlines on a flight from Khartoum crashed and caught fire on the runway on landing. Two of the 44 people on board were killed. References Airports in Sudan Central Darfur
Mary Ann MacLean (20 November 1931 – 14 November 2005) was a Scottish occultist who was co-founder of The Process Church of the Final Judgment. Early life MacLean, who was born in Glasgow, Scotland, grew up under poor conditions with a single mother who often left her daughter with relatives. Career In the early 1960s, MacLean moved to the United States where she lived an immersive life with the boxer Sugar Ray Robinson. After one year, she returned to the UK and London, working as a call girl after getting involved in a prostitution-ring scandal, and then joining the Church of Scientology. Among Scientologists, she met Robert Moor, later renamed by MacLean as Robert de Grimston. They married in 1964, created their version of Scientology auditing called Compulsions Analysis. The next year they introduced the cult, The Process Church of The Final Judgment, to a small group of friends and like-minded people. De Grimston named himself "The Teacher" and MacLean "The Oracle" in the cult that slowly grew in the numbers. MacLean took care of the ideology as well as the strategy, while de Grimston's face became the trademark of the business activity. In 1974, MacLean overpowered her husband by excluding him from his own church. Robert de Grimston disappeared into the United States while Mary Ann MacLean tried to further develop a cult organisation, relocating the group to Arizona and renaming it The Foundation - Church of the Millennium. The church group relocated in 1984, with animals they had at their Arizona ranch, to property it purchased in Kanab. Then, in 1991, The Process Church of The Final Judgment was dissolved and the church renamed Best Friends Animal Society, on the group's Kanab, Utah, property. MacLean continued to engage, with a low profile, in spiritual and political life in Utah. In 2005, MacLean died, and the management of her charity was left to her second husband, Gabriel De Peyer, a former Foundation Faith of God Church member and co-founder of Best Friends Animal Society. References 1931 births 2005 deaths People from Glasgow American occultists Founders of new religious movements American former Scientologists Scottish occultists Scottish emigrants to the United States
```smalltalk global using Xunit; global using Xunit.Extensions.Ordering; // Optional. [assembly: CollectionBehavior(DisableTestParallelization = true)] // Optional. [assembly: TestCaseOrderer("Xunit.Extensions.Ordering.TestCaseOrderer", "Xunit.Extensions.Ordering")] // Optional. [assembly: TestCollectionOrderer("Xunit.Extensions.Ordering.CollectionOrderer", "Xunit.Extensions.Ordering")] ```
The Church of All Saints is an Anglican parish church serving the town of Helmsley in North Yorkshire, England. It is located between the north-west corner of the market square, and Castlegate, on the B1257 road north of Helmsley Castle. Dedicated to All Saints, it has been part of the Church of England since the Reformation. It is one of four churches in the same benefice: Sproxton, Rievaulx, and East Moors. The church was granted Grade II* listed building status on 4 January 1955. History There has been a church in Helmsley since before the Norman conquest, and the churchyard was used as a market place in Anglo-Saxon times. Another measure of the church's antiquity is the hogback gravestone in the porch. A church was recorded in the Domesday Book in 1086. An organ by Mr. Whitehead of York was installed in 1852–53. The opening service was on 27 January 1853 when the choir of York Minster were in attendance. There was much rebuilding in the 19th century, between 1866 and 1869 funded by the Earl of Feversham by the architects Banks and Barry and the contractors Barton and Smith of Helmsley, at a cost of £16,000 (). Many changes were made in the rebuilding, and Norman and later features were lost, including the font, which was replaced in 1868; the original medieval font is now in the church at Pockley. However, the church gained some fine stained glass by Hardman & Co. of Birmingham. In 1931 a Harrison and Harrison pipe organ was installed on a platform immediately west of the chancel. This organ replaced an existing instrument installed in 1868 by the Walker organ company. Mr Arthur Harrison retained some of the existing pipework and incorporated this in the new instrument. Architecture In the 12th century the church was built in the Norman style and two arches, one over the entrance doorway, the other over the chancel, remain in place. They are rounded arches in the Norman style, as opposed to the Early English in which pointed arches were used in later developments. The church has a three-stage west tower, a four-bay nave, a two-bay chancel, transepts, vestry and south porch. Its 19th-century restoration was in the Gothic Revival style but incorporates work from the old church. It is constructed of sandstone ashlar with a steeply sloping stone slate roof. The tower has 13th-century lancet windows to its west and north faces at the second stage. Its other lancet windows, round-headed belfry windows and octagonal turrets date from the 19th-century restoration. The south porch is entered by a round arch accessing a 12th-century doorway. Windows installed in the 19th century in the north aisle and at the west end have reticulated tracery. The chancel has round-headed and lancet windows. Photographs reveal that the roof was altered in the restoration of 1866–69 and the church had a parapet with battlements on the southern side. The north chapel is dedicated to Aelred, third abbot of the Cistercian monastery at Rievaulx Abbey. It contains a statue of the Virgin Mary, and votive candles. The south chapel is dedicated to Columba, a missionary from Ireland who brought Christianity to much of northern England. The chapel contains wall paintings of contemporary events, including depictions of Saint Oswald and a knight slaying a dragon emblazoned with the pagan gods. Modern usage There is a congregation of around 70 people, and services use the Harrison and Harrison pipe organ, which is above and behind the pulpit. Gallery References Church of England church buildings in North Yorkshire Grade II* listed churches in North Yorkshire Church of All Saints
Interferon production regulator is a protein that in humans is encoded by the IFNR gene. References
```xml <?xml version="1.0" encoding="utf-8"?> <resources> <!----> <attr name="gallery_toolbar_bg" format="color" /> <!----> <attr name="gallery_toolbar_close_image" format="reference" /> <!----> <attr name="gallery_toolbar_close_color" format="color" /> <!----> <attr name="gallery_toolbar_widget_color" format="color" /> <!----> <attr name="gallery_toolbar_text_color" format="color" /> <!----> <attr name="gallery_toolbar_text_size" format="dimension" /> <!----> <attr name="gallery_toolbar_divider_height" format="dimension" /> <!----> <attr name="gallery_toolbar_divider_bg" format="reference|color" /> <!--bottomMargin--> <attr name="gallery_toolbar_bottom_margin" format="reference|dimension" /> <!----> <attr name="gallery_toolbar_text_gravity"> <!-- Push object to the top of its container, not changing its size. --> <flag name="top" value="0x30" /> <!-- Push object to the bottom of its container, not changing its size. --> <flag name="bottom" value="0x50" /> <!-- Push object to the left of its container, not changing its size. --> <flag name="left" value="0x03" /> <!-- Push object to the right of its container, not changing its size. --> <flag name="right" value="0x05" /> <!-- Place object in the vertical center of its container, not changing its size. --> <flag name="center_vertical" value="0x10" /> <!-- Grow the vertical size of the object if needed so it completely fills its container. --> <flag name="fill_vertical" value="0x70" /> <!-- Place object in the horizontal center of its container, not changing its size. --> <flag name="center_horizontal" value="0x01" /> <!-- Grow the horizontal size of the object if needed so it completely fills its container. --> <flag name="fill_horizontal" value="0x07" /> <!-- Place the object in the center of its container in both the vertical and horizontal axis, not changing its size. --> <flag name="center" value="0x11" /> <!-- Grow the horizontal and vertical size of the object if needed so it completely fills its container. --> <flag name="fill" value="0x77" /> <!-- Additional option that can be set to have the top and/or bottom edges of the child clipped to its container's bounds. The clip will be based on the vertical gravity: a top gravity will clip the bottom edge, a bottom gravity will clip the top edge, and neither will clip both edges. --> <flag name="clip_vertical" value="0x80" /> <!-- Additional option that can be set to have the left and/or right edges of the child clipped to its container's bounds. The clip will be based on the horizontal gravity: a left gravity will clip the right edge, a right gravity will clip the left edge, and neither will clip both edges. --> <flag name="clip_horizontal" value="0x08" /> <!-- Push object to the beginning of its container, not changing its size. --> <flag name="start" value="0x00800003" /> <!-- Push object to the end of its container, not changing its size. --> <flag name="end" value="0x00800005" /> </attr> <!----> <attr name="gallery_toolbar_height" format="dimension" /> <!----> <attr name="gallery_toolbar_over_button_bg" format="reference" /> <!----> <attr name="gallery_toolbar_over_button_text_size" format="dimension" /> <!----> <attr name="gallery_toolbar_over_button_text_color" format="color" /> <!----> <attr name="gallery_toolbar_over_button_pressed_color" format="color" /> <!----> <attr name="gallery_toolbar_over_button_normal_color" format="color" /> <!----> <attr name="gallery_color_statusbar" format="color" /> <!--,--> <attr name="gallery_color_active_widget" format="color" /> <!--checkbox,radiobutton buttonTint--> <attr name="gallery_checkbox_button_tint_color" format="color" /> <!--checkbox--> <attr name="gallery_checkbox_text_color" format="color" /> <!----> <attr name="gallery_page_bg" format="color" /> <!----> <attr name="gallery_default_image" format="dimension" /> <!----> <attr name="gallery_imageview_bg" format="dimension|color" /> <!----> <attr name="gallery_camera_image" format="dimension" /> <!----> <attr name="gallery_camera_bg" format="color" /> <!----> <attr name="gallery_take_image_text_color" format="color" /> <!----> <attr name="gallery_request_storage_access_permission_tips" format="dimension|string" /> <!----> <attr name="gallery_request_camera_permission_tips" format="dimension|string" /> <!----> <attr name="gallery_request_storage_write_permission_tips" format="dimension|string" /> <!----> <attr name="gallery_media_empty_tips" format="dimension|string" /> <!---uCrop--> <attr name="gallery_ucrop_status_bar_color" format="color" /> <attr name="gallery_ucrop_toolbar_color" format="color" /> <attr name="gallery_ucrop_toolbar_title" format="string" /> <attr name="gallery_ucrop_toolbar_widget_color" format="color" /> <attr name="gallery_ucrop_activity_widget_color" format="color" /> <!----> <attr name="gallery_ucrop_color_crop_background" format="color" /> <!----> <attr name="gallery_ucrop_image_outer_frame_bg" format="color" /> <!----> <attr name="gallery_ucrop_crop_frame_color" format="color" /> <!----> <attr name="gallery_ucrop_crop_frame_stroke_width" format="dimension" /> <!----> <attr name="gallery_ucrop_image_grid_color" format="color" /> <!----> <attr name="gallery_ucrop_image_grid_stroke_size" format="dimension" /> <attr name="gallery_ucrop_vector_ic_crop" format="dimension" /> <!----> <attr name="gallery_ucrop_title_text" format="string" /> <!--frame--> <attr name="gallery_ucrop_show_crop_frame" format="boolean" /> <!----> <attr name="gallery_ucrop_show_crop_grid" format="boolean" /> <!----> <attr name="gallery_ucrop_show_crop_grid_row_count" format="integer" /> <!----> <attr name="gallery_ucrop_show_crop_grid_column_count" format="integer" /> </resources> ```
Doddabele Lakshmi Narasimhachar (27 October 1906 – 7 May 1971) was a Kannada linguist, grammarian, lexicographer, writer, literary critic and editor who taught at the Department of Kannada Language Studies, University of Mysore between 1932 - 1962. His knowledge of Halegannada (Old Kannada Language) helped him in reading ancient epigraphic records. He authored four books in Kannada, edited about nine volumes, penned eleven prefaces, wrote nearly hundred articles (both in Kannada and English) across three decades, seven monographs in English and outlined introductions to four Kannada works. He presided over the forty first Kannada Sahitya Sammelan (Annual Kannada Language Conference) held at Bidar in 1960. He was the recipient of the Kannada Rajyotsava Award from the Mysore State. In 1969, his alma mater - University of Mysore bestowed on him an Honorary Doctorate (D. Litt) in recognition of a lifetime contribution to the world of Kannada studies. Early life and education D. L. Narasimhachar's younger years were spread out across the district of Tumkur in the southern state of Karnataka - in towns like Pavagada, Madhugiri and Sira. Hailing from a Brahminical family, D. L. N. was trained in chaste Sanskrit from a Pandit. Narasimhachar's writing began at an early stage with recurrent contributions to the local school magazine "School Folk". For his Bachelor's degree (1927), he sought admission to the Central College at Bangalore. There he had taken Kannada as an optional subject (in addition to his primary subjects - Physics and Chemistry). Incidentally, his score in the optional subject was his highest, this eventually steered him to complete his Master's degree in Kannada at the Maharaja College, Mysore (1929). His contemporaries at Maharaja College, Mysore were future literary names like K. V. Puttappa, K. V. Raghavachar, Anantharangachar and K. Venkataramappa. The faculty at Maharaja College, Mysore included B. M. Srikantaiah, Rallapalli Anantha Krishna Sharma, V. Seetharamaiah, C. R. Narasimha Sastry, T. S. Venkannaiah and A. R. Krishna Shastry. During his free time, he would frequent Oriental Research Library to peruse old Kannada manuscripts. The H. V. Nanjundaiah Gold Medal set aside for outstanding Master's student was awarded to D. L. Narasimhachar in 1929. Academician D. L. Narasimhachar began his career as a research assistant at the Oriental Research Library, Mysore. He simultaneously held the position of a part-time lecturer in Kannada at the Maharaja College Kannada Department. An ongoing research project dedicated to the 'timing' of the earliest Veerashaiva literature caught his attention. He became the first recipient of the research grant set aside for this scholarly endeavour. After his departure from the Oriental Research Library, he was appointed a full time lecturer at the college in 1932 and continued in the same post till 1939. For a brief tenure of two years, he taught at present-day Yuvaraja College, Mysore before coming back to his parent department, where he taught till the end of the Second World War. In late 1945, he received a promotion to the post of Assistant Professor and was transferred to Central College, Bangalore. By the end of the decade, he was back in Mysore as Associate Professor in the department where he started his career. In 1954, he was appointed Chief Editor of the ‘Kannada-Kannada’ Dictionary Project . D. L. Narasimhachar spent the remainder of his years till retirement in 1962 serving at Mysore in the capacity of Professor of Kannada Language Studies. His career spanned thirty years from 1932 - 1962. The University Grants Commission (U. G. C.) extended a Post-Doctoral Fellowship to D. L. N. from 1962 onwards for the next six years. Literary contributions D. L. Narasimhachar's scholarship was along two lines - "Textual Criticism" and "Independent Research". His involvement in the "Kannada - Kannada' Dictionary project saw him bring out the first edition of the dictionary during those years. He succeeded T. N. Srikantaiah in this project after his demise. D. L. N.'s guide to Editorship titled "Kannada Grantha Sampadane" is among his remembered works. Between 1959 - 63, he was the Editor of the University of Mysore's Journal "Prabuddha Karnataka". His introductions to K. S. Narasimha Swamy's "Shilalathe", "Vaddaradhane", "Pampa Ramayana Sangraha" and "Sukumara Charitam" brought him much note. Narasimhachar was involved in Epigraphical Studies across the state. His knowledge of Halegannada helped him decipher much of these inscriptions. He delivered numerous lectures on the Mysore Akashvani (later All India Radio). His publication titled "Pīṭhikegaḷu, lēkhanagaḷu" was a compendium of his earlier essays and lectures spanning three decades. Selected works Books Narasimhachar, D. L.: "Hampeya Harihara" (1939) Narasimhachar, D. L.: "Shabda Vihara" (1956) Narasimhachar, D. L.: "Śivakōtyācārya viracita Vaḍḍārādhane" (1959) Narasimhachar, D. L.: "Kannada Grantha Sampadane" (1964) Narasimhachar, D. L.: "Gōvina hāḍu" (1967) Narasimhachar, D. L.: "Peetekagalu-Lekhanagalu" (1971) Narasimhachar, D. L.: "Pampa Bharata Dipike" (1971) Editorship Narasimhachar, D. L.: "Bhīṣmaparva saṅgraha" (1930) Narasimhachar, D. L.: "Pampa Ramayana Sangraha" Narasimhachar, D. L.: "Siddarama Charithra" (1941) Narasimhachar, D. L.: "Karnāṭaka Mahābhārata. Bhīṣma parva" (1950) Narasimhachar, D. L.: "Siddarama Charitheya Sangraha" (1962) Narasimhachar, D. L.: "Rāghavāṅka kaviya Siddharāma cāritra" (1975) Narasimhachar, D. L.: "Sukumara Charitam" (1954) Narasimhachar, D. L.: "Shabdamanidarpanam" (1964) Narasimhachar, D. L.: "Kēśirāja viracita Śabdamaṇidarpaṇaṃ" (1964) Narasimhachar, D. L.: "Kannaḍa Sāhitya Pariṣattina Kannaḍa nighaṇṭu" (1971 - 1990) Forewords Narasimhachar, D. L.: "Kannadadalli Vidambana Sahitya" (1947)Narasimhachar, D. L.: "Kannadadalli Vidambana Sahitya" (1947)Narasimhachar, D. L.: "Toogudevege" (1963)Narasimhachar, D. L.: "Basava Sthothra Geethe" (1954)Narasimhachar, D. L.: "Vyavahara Kannada" (1956)Narasimhachar, D. L.: "Shilalathe" (1958) Essays Narasimhachar, D. L.: "Indina Kannada Kavithe" (1943) Narasimhachar, D. L.: "Kumaravyasana Karna" (1958) Narasimhachar, D. L.: "Ranna Kaviya Sahashra Varshikothsava" Narasimhachar, D. L.: "Vijayanagara Kalada Sahitya" Narasimhachar, D. L.: "Gadayuddha: Ondu Padyada Arthavichara" (1967) Narasimhachar, D. L.: "Nighantu Rachane" Narasimhachar, D. L.: "Granthasampadane" (1971) English works Narasimhachar, D. L.: “Social & Religious life in Karnataka under the Satavahanas” Narasimhachar, D. L.: “The Genealogy of Arikesarin II–Vol 7” Narasimhachar, D. L.'': “Four Etymos from Old Kannada” (Emeneau Presentation) Recognition D. L. Narasimhachar authored number of books and essays across three decades. Some of his notable students include - G. Venkatasubbiah and T. V. Venkatachala Sastry. The Kannada Sahitya Parishat conferred on him Sahitya Akademi Award. He presided over the forty first instalment of their annual congregation held at Bidar in 1960. Two Festschrift Volumes were dedicated by contemporary scholars titled “Jnanopasaka” (1960) and “Upayana” (1967). A commemoration volume was brought forth in 2005 by Hampi University titled "ಡಿ. ಎಲ್. ನರಸಿಂಹಾಚಾರ್ ಶತಮಾನ ಸ್ಮರಣೆ". His student and Kannada litterateur T. V. Venkatachala Sastry authored a memoir on his former teacher and mentor titled "ಪ್ರೊಫೆಸರ್ ಡಿ. ಎಲ್. ನರಸಿಂಹಾಚಾರ್ಯರ ಹೆಚ್ಚಿನ ಬರಹಗಳು" in 2008. The Government of Mysore awarded the Kannada Rajyotsava Award. In recognition of a lifetime dedicated to the world of Kannada studies, his alma mater - University of Mysore bestowed on him an honorary D. Litt in 1969. Following his retirement in 1962, he was appointed (University Grants Commission) U. G. C. Research Fellow for the next six years. He died on 7 May 1971 at the age of 65 years. Bibliography "The Jaina Ramayana" - Indian Historical Quarterly (1939) "Śabda-Vihāra: Kannaḍakavi-kāvyamāle 36." by Upadhye, A. N. (1957): 317-318. "Kharatara-Bṛhadgurvāvali: Singhi Jaina Granthamālā, No. 42." by Upadhye, A. N. (1957): 317-317. "Reviewed Work: History of Jaina Monachism : (from Inscriptions and Literature)" by A. N. Upadhye (1957); Annals of the Bhandarkar Oriental Research Institute Vol. 38, No. 3/4 (July-October 1957), pp. 315-317 "A Middle Indo-Aryan Reader" Review by A. N. Upadhye (1957); Annals of the Bhandarkar Oriental Research Institute "Sukumāra-Caritaṁ: of Śāntinātha Kavi" Review by T. S. Shama Rao (1957); Annals of the Bhandarkar Oriental Research Institute "Kannada Verb Morphology: Vaḍḍa:ra:dhane" by D. N. Shankara Bhat (1963); Bulletin of the Deccan College Research Institute "Epigraphical Notes: Katavapra and Nayanadeva" by B. R. Gopal (1973); Proceedings of the Indian History Congress "Vaddaradhane: A Study; Research Publications Series: 38." (1980) by Laddu, S. D.; pp 304-305, JSTOR "Religion and society in Southern Karnataka in the early medieval period." by Bhat, Malini U. (1995); ir.inflibnet.ac.in Ripepi, Tiziana. "On Maritohtadarya and other Tohtadaryas: Who is the author of Kaivalyasara ? An attribution problem concerning a Virasaiava text in Sanskrit." Rivista degli studi orientali 71.Fasc. 1/4 (1997): 169-183. "From Norm-bound Practice to Practice-bound Norm in Kannada Intellectual History." South-Indian Horizons: Felicitation Volume for Francois Gros on the Occasion of His 70th Birthday by Pollock, Sheldon. (2004): 389. Dehuri, Rajendra. "Narrative Art on Dhobi Math Mandir Wall at Nabratnagarh, Sesai, Distt-Gumla, Jharkhand." (2013) "Agraharas in Dharwad District KEYWORDS: Agraharas-Meaning" by K. C. Santhosh Kumar (2014); History 3.9 "Bijholi Rock Inscription of Cahamana Somadeva." Women and Society in Early Medieval India: Re-interpreting Epigraphs. by Verma, Anjali, et al. (2019); Vol. 3. No. 1st. New Delhi: Orient Books reprint Corporation. ix-xii. References External links NARASIMHACHAR D.L., 1906-71 Academic staff of the University of Mysore Indian Indologists Kannada people Maharaja's College, Mysore alumni People from Mysore district Writers from Karnataka Indian male writers 1906 births 1971 deaths Indian religious writers Scholars from Karnataka
```c++ /* * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above * copyright notice, this list of conditions and the following disclaimer * in the documentation and/or other materials provided with the * distribution. * * Neither the name of Google Inc. nor the names of its * contributors may be used to endorse or promote products derived from * this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" #include "core/animation/AnimationEffect.h" #include "core/animation/Animation.h" #include "core/animation/AnimationEffectTiming.h" #include "core/animation/ComputedTimingProperties.h" #include "core/animation/TimingCalculations.h" namespace blink { namespace { Timing::FillMode resolvedFillMode(Timing::FillMode fillMode, bool isAnimation) { if (fillMode != Timing::FillModeAuto) return fillMode; if (isAnimation) return Timing::FillModeNone; return Timing::FillModeBoth; } } // namespace AnimationEffect::AnimationEffect(const Timing& timing, PassOwnPtrWillBeRawPtr<EventDelegate> eventDelegate) : m_parent(nullptr) , m_startTime(0) , m_animation(nullptr) , m_timing(timing) , m_eventDelegate(eventDelegate) , m_calculated() , m_needsUpdate(true) , m_lastUpdateTime(nullValue()) { m_timing.assertValid(); } double AnimationEffect::iterationDuration() const { double result = std::isnan(m_timing.iterationDuration) ? intrinsicIterationDuration() : m_timing.iterationDuration; ASSERT(result >= 0); return result; } double AnimationEffect::repeatedDuration() const { const double result = multiplyZeroAlwaysGivesZero(iterationDuration(), m_timing.iterationCount); ASSERT(result >= 0); return result; } double AnimationEffect::activeDurationInternal() const { const double result = m_timing.playbackRate ? repeatedDuration() / std::abs(m_timing.playbackRate) : std::numeric_limits<double>::infinity(); ASSERT(result >= 0); return result; } void AnimationEffect::updateSpecifiedTiming(const Timing& timing) { // FIXME: Test whether the timing is actually different? m_timing = timing; invalidate(); if (m_animation) m_animation->setOutdated(); specifiedTimingChanged(); } void AnimationEffect::computedTiming(ComputedTimingProperties& computedTiming) { // ComputedTimingProperties members. computedTiming.setStartTime(startTimeInternal() * 1000); computedTiming.setEndTime(endTimeInternal() * 1000); computedTiming.setActiveDuration(activeDurationInternal() * 1000); // FIXME: These should be null if not in effect, but current dictionary API // will treat these as undefined. if (ensureCalculated().isInEffect) { computedTiming.setLocalTime(ensureCalculated().localTime * 1000); computedTiming.setTimeFraction(ensureCalculated().timeFraction); computedTiming.setCurrentIteration(ensureCalculated().currentIteration); } // KeyframeEffectOptions members. computedTiming.setDelay(specifiedTiming().startDelay * 1000); computedTiming.setEndDelay(specifiedTiming().endDelay * 1000); computedTiming.setFill(Timing::fillModeString(resolvedFillMode(specifiedTiming().fillMode, isAnimation()))); computedTiming.setIterationStart(specifiedTiming().iterationStart); computedTiming.setIterations(specifiedTiming().iterationCount); UnrestrictedDoubleOrString duration; duration.setUnrestrictedDouble(iterationDuration() * 1000); computedTiming.setDuration(duration); computedTiming.setPlaybackRate(specifiedTiming().playbackRate); computedTiming.setDirection(Timing::playbackDirectionString(specifiedTiming().direction)); computedTiming.setEasing(specifiedTiming().timingFunction->toString()); } ComputedTimingProperties AnimationEffect::computedTiming() { ComputedTimingProperties result; computedTiming(result); return result; } void AnimationEffect::updateInheritedTime(double inheritedTime, TimingUpdateReason reason) const { bool needsUpdate = m_needsUpdate || (m_lastUpdateTime != inheritedTime && !(isNull(m_lastUpdateTime) && isNull(inheritedTime))); m_needsUpdate = false; m_lastUpdateTime = inheritedTime; const double localTime = inheritedTime - m_startTime; double timeToNextIteration = std::numeric_limits<double>::infinity(); if (needsUpdate) { const double activeDuration = this->activeDurationInternal(); const Phase currentPhase = calculatePhase(activeDuration, localTime, m_timing); // FIXME: parentPhase depends on groups being implemented. const AnimationEffect::Phase parentPhase = AnimationEffect::PhaseActive; const double activeTime = calculateActiveTime(activeDuration, resolvedFillMode(m_timing.fillMode, isAnimation()), localTime, parentPhase, currentPhase, m_timing); double currentIteration; double timeFraction; if (const double iterationDuration = this->iterationDuration()) { const double startOffset = multiplyZeroAlwaysGivesZero(m_timing.iterationStart, iterationDuration); ASSERT(startOffset >= 0); const double scaledActiveTime = calculateScaledActiveTime(activeDuration, activeTime, startOffset, m_timing); const double iterationTime = calculateIterationTime(iterationDuration, repeatedDuration(), scaledActiveTime, startOffset, m_timing); currentIteration = calculateCurrentIteration(iterationDuration, iterationTime, scaledActiveTime, m_timing); timeFraction = calculateTransformedTime(currentIteration, iterationDuration, iterationTime, m_timing) / iterationDuration; if (!isNull(iterationTime)) { timeToNextIteration = (iterationDuration - iterationTime) / std::abs(m_timing.playbackRate); if (activeDuration - activeTime < timeToNextIteration) timeToNextIteration = std::numeric_limits<double>::infinity(); } } else { const double localIterationDuration = 1; const double localRepeatedDuration = localIterationDuration * m_timing.iterationCount; ASSERT(localRepeatedDuration >= 0); const double localActiveDuration = m_timing.playbackRate ? localRepeatedDuration / std::abs(m_timing.playbackRate) : std::numeric_limits<double>::infinity(); ASSERT(localActiveDuration >= 0); const double localLocalTime = localTime < m_timing.startDelay ? localTime : localActiveDuration + m_timing.startDelay; const AnimationEffect::Phase localCurrentPhase = calculatePhase(localActiveDuration, localLocalTime, m_timing); const double localActiveTime = calculateActiveTime(localActiveDuration, resolvedFillMode(m_timing.fillMode, isAnimation()), localLocalTime, parentPhase, localCurrentPhase, m_timing); const double startOffset = m_timing.iterationStart * localIterationDuration; ASSERT(startOffset >= 0); const double scaledActiveTime = calculateScaledActiveTime(localActiveDuration, localActiveTime, startOffset, m_timing); const double iterationTime = calculateIterationTime(localIterationDuration, localRepeatedDuration, scaledActiveTime, startOffset, m_timing); currentIteration = calculateCurrentIteration(localIterationDuration, iterationTime, scaledActiveTime, m_timing); timeFraction = calculateTransformedTime(currentIteration, localIterationDuration, iterationTime, m_timing); } m_calculated.currentIteration = currentIteration; m_calculated.timeFraction = timeFraction; m_calculated.phase = currentPhase; m_calculated.isInEffect = !isNull(activeTime); m_calculated.isInPlay = phase() == PhaseActive && (!m_parent || m_parent->isInPlay()); m_calculated.isCurrent = phase() == PhaseBefore || isInPlay() || (m_parent && m_parent->isCurrent()); m_calculated.localTime = m_lastUpdateTime - m_startTime; } // Test for events even if timing didn't need an update as the animation may have gained a start time. // FIXME: Refactor so that we can ASSERT(m_animation) here, this is currently required to be nullable for testing. if (reason == TimingUpdateForAnimationFrame && (!m_animation || m_animation->hasStartTime() || m_animation->paused())) { if (m_eventDelegate) m_eventDelegate->onEventCondition(*this); } if (needsUpdate) { // FIXME: This probably shouldn't be recursive. updateChildrenAndEffects(); m_calculated.timeToForwardsEffectChange = calculateTimeToEffectChange(true, localTime, timeToNextIteration); m_calculated.timeToReverseEffectChange = calculateTimeToEffectChange(false, localTime, timeToNextIteration); } } const AnimationEffect::CalculatedTiming& AnimationEffect::ensureCalculated() const { if (!m_animation) return m_calculated; if (m_animation->outdated()) m_animation->update(TimingUpdateOnDemand); ASSERT(!m_animation->outdated()); return m_calculated; } PassRefPtrWillBeRawPtr<AnimationEffectTiming> AnimationEffect::timing() { return AnimationEffectTiming::create(this); } DEFINE_TRACE(AnimationEffect) { visitor->trace(m_parent); visitor->trace(m_animation); visitor->trace(m_eventDelegate); } } // namespace blink ```
```javascript /* ABOUT THIS NODE.JS EXAMPLE: This example works with the AWS SDK for JavaScript version 3 (v3), which is available at path_to_url Purpose: This file handles the transcription of speech to text using AWS Transcribe */ // snippet-start:[transcribeClient.JavaScript.streaming.createclientv3] import { CognitoIdentityClient } from "@aws-sdk/client-cognito-identity"; import { fromCognitoIdentityPool } from "@aws-sdk/credential-provider-cognito-identity"; import { TranscribeStreamingClient } from "@aws-sdk/client-transcribe-streaming"; import MicrophoneStream from "microphone-stream"; import { StartStreamTranscriptionCommand } from "@aws-sdk/client-transcribe-streaming"; import * as awsID from "./awsID.js"; /** @type {MicrophoneStream} */ const MicrophoneStreamImpl = MicrophoneStream.default; const SAMPLE_RATE = 44100; /** @type {MicrophoneStream | undefined} */ let microphoneStream = undefined; /** @type {TranscribeStreamingClient | undefined} */ let transcribeClient = undefined; export const startRecording = async (language, callback) => { if (!language) { return false; } if (microphoneStream || transcribeClient) { stopRecording(); } createTranscribeClient(); createMicrophoneStream(); await startStreaming(language, callback); }; export const stopRecording = function () { if (microphoneStream) { microphoneStream.stop(); microphoneStream.destroy(); microphoneStream = undefined; } if (transcribeClient) { transcribeClient.destroy(); transcribeClient = undefined; } }; const createTranscribeClient = () => { transcribeClient = new TranscribeStreamingClient({ region: awsID.REGION, credentials: fromCognitoIdentityPool({ client: new CognitoIdentityClient({ region: awsID.REGION }), identityPoolId: awsID.IDENTITY_POOL_ID, }), }); }; const createMicrophoneStream = async () => { microphoneStream = new MicrophoneStreamImpl(); microphoneStream.setStream( await window.navigator.mediaDevices.getUserMedia({ video: false, audio: true, }), ); }; const startStreaming = async (language, callback) => { const command = new StartStreamTranscriptionCommand({ LanguageCode: language, MediaEncoding: "pcm", MediaSampleRateHertz: SAMPLE_RATE, AudioStream: getAudioStream(), }); const data = await transcribeClient.send(command); for await (const event of data.TranscriptResultStream) { for (const result of event.TranscriptEvent.Transcript.Results || []) { if (result.IsPartial === false) { const noOfResults = result.Alternatives[0].Items.length; for (let i = 0; i < noOfResults; i++) { console.log(result.Alternatives[0].Items[i].Content); callback(result.Alternatives[0].Items[i].Content + " "); } } } } }; const getAudioStream = async function* () { if (!microphoneStream) { throw new Error( "Cannot get audio stream. microphoneStream is not initialized.", ); } for await (const chunk of /** @type {[][]} */ (microphoneStream)) { if (chunk.length <= SAMPLE_RATE) { yield { AudioEvent: { AudioChunk: encodePCMChunk(chunk), }, }; } } }; const encodePCMChunk = (chunk) => { /** @type {Float32Array} */ const input = MicrophoneStreamImpl.toRaw(chunk); let offset = 0; const buffer = new ArrayBuffer(input.length * 2); const view = new DataView(buffer); for (let i = 0; i < input.length; i++, offset += 2) { let s = Math.max(-1, Math.min(1, input[i])); view.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7fff, true); } return Buffer.from(buffer); }; // snippet-end:[transcribeClient.JavaScript.streaming.createclientv3] ```
```go // Protocol Buffers for Go with Gadgets // // path_to_url // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: // // * Redistributions of source code must retain the above copyright // notice, this list of conditions and the following disclaimer. // * Redistributions in binary form must reproduce the above // copyright notice, this list of conditions and the following disclaimer // in the documentation and/or other materials provided with the // distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. /* The populate plugin generates a NewPopulated function. This function returns a newly populated structure. It is enabled by the following extensions: - populate - populate_all Let us look at: github.com/gogo/protobuf/test/example/example.proto Btw all the output can be seen at: github.com/gogo/protobuf/test/example/* The following message: option (gogoproto.populate_all) = true; message B { optional A A = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; repeated bytes G = 2 [(gogoproto.customtype) = "github.com/gogo/protobuf/test/custom.Uint128", (gogoproto.nullable) = false]; } given to the populate plugin, will generate code the following code: func NewPopulatedB(r randyExample, easy bool) *B { this := &B{} v2 := NewPopulatedA(r, easy) this.A = *v2 if r.Intn(10) != 0 { v3 := r.Intn(10) this.G = make([]github_com_gogo_protobuf_test_custom.Uint128, v3) for i := 0; i < v3; i++ { v4 := github_com_gogo_protobuf_test_custom.NewPopulatedUint128(r) this.G[i] = *v4 } } if !easy && r.Intn(10) != 0 { this.XXX_unrecognized = randUnrecognizedExample(r, 3) } return this } The idea that is useful for testing. Most of the other plugins' generated test code uses it. You will still be able to use the generated test code of other packages if you turn off the popluate plugin and write your own custom NewPopulated function. If the easy flag is not set the XXX_unrecognized and XXX_extensions fields are also populated. These have caused problems with JSON marshalling and unmarshalling tests. */ package populate import ( "fmt" "math" "strconv" "strings" "github.com/gogo/protobuf/gogoproto" "github.com/gogo/protobuf/proto" descriptor "github.com/gogo/protobuf/protoc-gen-gogo/descriptor" "github.com/gogo/protobuf/protoc-gen-gogo/generator" "github.com/gogo/protobuf/vanity" ) type VarGen interface { Next() string Current() string } type varGen struct { index int64 } func NewVarGen() VarGen { return &varGen{0} } func (this *varGen) Next() string { this.index++ return fmt.Sprintf("v%d", this.index) } func (this *varGen) Current() string { return fmt.Sprintf("v%d", this.index) } type plugin struct { *generator.Generator generator.PluginImports varGen VarGen atleastOne bool localName string typesPkg generator.Single } func NewPlugin() *plugin { return &plugin{} } func (p *plugin) Name() string { return "populate" } func (p *plugin) Init(g *generator.Generator) { p.Generator = g } func value(typeName string, fieldType descriptor.FieldDescriptorProto_Type) string { switch fieldType { case descriptor.FieldDescriptorProto_TYPE_DOUBLE: return typeName + "(r.Float64())" case descriptor.FieldDescriptorProto_TYPE_FLOAT: return typeName + "(r.Float32())" case descriptor.FieldDescriptorProto_TYPE_INT64, descriptor.FieldDescriptorProto_TYPE_SFIXED64, descriptor.FieldDescriptorProto_TYPE_SINT64: return typeName + "(r.Int63())" case descriptor.FieldDescriptorProto_TYPE_UINT64, descriptor.FieldDescriptorProto_TYPE_FIXED64: return typeName + "(uint64(r.Uint32()))" case descriptor.FieldDescriptorProto_TYPE_INT32, descriptor.FieldDescriptorProto_TYPE_SINT32, descriptor.FieldDescriptorProto_TYPE_SFIXED32, descriptor.FieldDescriptorProto_TYPE_ENUM: return typeName + "(r.Int31())" case descriptor.FieldDescriptorProto_TYPE_UINT32, descriptor.FieldDescriptorProto_TYPE_FIXED32: return typeName + "(r.Uint32())" case descriptor.FieldDescriptorProto_TYPE_BOOL: return typeName + `(bool(r.Intn(2) == 0))` case descriptor.FieldDescriptorProto_TYPE_STRING, descriptor.FieldDescriptorProto_TYPE_GROUP, descriptor.FieldDescriptorProto_TYPE_MESSAGE, descriptor.FieldDescriptorProto_TYPE_BYTES: } panic(fmt.Errorf("unexpected type %v", typeName)) } func negative(fieldType descriptor.FieldDescriptorProto_Type) bool { switch fieldType { case descriptor.FieldDescriptorProto_TYPE_UINT64, descriptor.FieldDescriptorProto_TYPE_FIXED64, descriptor.FieldDescriptorProto_TYPE_UINT32, descriptor.FieldDescriptorProto_TYPE_FIXED32, descriptor.FieldDescriptorProto_TYPE_BOOL: return false } return true } func (p *plugin) getFuncName(goTypName string) string { funcName := "NewPopulated" + goTypName goTypNames := strings.Split(goTypName, ".") if len(goTypNames) == 2 { funcName = goTypNames[0] + ".NewPopulated" + goTypNames[1] } else if len(goTypNames) != 1 { panic(fmt.Errorf("unreachable: too many dots in %v", goTypName)) } switch funcName { case "time.NewPopulatedTime": funcName = p.typesPkg.Use() + ".NewPopulatedStdTime" case "time.NewPopulatedDuration": funcName = p.typesPkg.Use() + ".NewPopulatedStdDuration" } return funcName } func (p *plugin) getFuncCall(goTypName string) string { funcName := p.getFuncName(goTypName) funcCall := funcName + "(r, easy)" return funcCall } func (p *plugin) getCustomFuncCall(goTypName string) string { funcName := p.getFuncName(goTypName) funcCall := funcName + "(r)" return funcCall } func (p *plugin) getEnumVal(field *descriptor.FieldDescriptorProto, goTyp string) string { enum := p.ObjectNamed(field.GetTypeName()).(*generator.EnumDescriptor) l := len(enum.Value) values := make([]string, l) for i := range enum.Value { values[i] = strconv.Itoa(int(*enum.Value[i].Number)) } arr := "[]int32{" + strings.Join(values, ",") + "}" val := strings.Join([]string{generator.GoTypeToName(goTyp), `(`, arr, `[r.Intn(`, fmt.Sprintf("%d", l), `)])`}, "") return val } func (p *plugin) GenerateField(file *generator.FileDescriptor, message *generator.Descriptor, field *descriptor.FieldDescriptorProto) { proto3 := gogoproto.IsProto3(file.FileDescriptorProto) goTyp, _ := p.GoType(message, field) fieldname := p.GetOneOfFieldName(message, field) goTypName := generator.GoTypeToName(goTyp) if p.IsMap(field) { m := p.GoMapType(nil, field) keygoTyp, _ := p.GoType(nil, m.KeyField) keygoTyp = strings.Replace(keygoTyp, "*", "", 1) keygoAliasTyp, _ := p.GoType(nil, m.KeyAliasField) keygoAliasTyp = strings.Replace(keygoAliasTyp, "*", "", 1) valuegoTyp, _ := p.GoType(nil, m.ValueField) valuegoAliasTyp, _ := p.GoType(nil, m.ValueAliasField) keytypName := generator.GoTypeToName(keygoTyp) keygoAliasTyp = generator.GoTypeToName(keygoAliasTyp) valuetypAliasName := generator.GoTypeToName(valuegoAliasTyp) nullable, valuegoTyp, valuegoAliasTyp := generator.GoMapValueTypes(field, m.ValueField, valuegoTyp, valuegoAliasTyp) p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, m.GoType, `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() keyval := "" if m.KeyField.IsString() { keyval = fmt.Sprintf("randString%v(r)", p.localName) } else { keyval = value(keytypName, m.KeyField.GetType()) } if keygoAliasTyp != keygoTyp { keyval = keygoAliasTyp + `(` + keyval + `)` } if m.ValueField.IsMessage() || p.IsGroup(field) || (m.ValueField.IsBytes() && gogoproto.IsCustomType(field)) { s := `this.` + fieldname + `[` + keyval + `] = ` if gogoproto.IsStdTime(field) || gogoproto.IsStdDuration(field) { valuegoTyp = valuegoAliasTyp } funcCall := p.getCustomFuncCall(goTypName) if !gogoproto.IsCustomType(field) { goTypName = generator.GoTypeToName(valuegoTyp) funcCall = p.getFuncCall(goTypName) } if !nullable { funcCall = `*` + funcCall } if valuegoTyp != valuegoAliasTyp { funcCall = `(` + valuegoAliasTyp + `)(` + funcCall + `)` } s += funcCall p.P(s) } else if m.ValueField.IsEnum() { s := `this.` + fieldname + `[` + keyval + `]` + ` = ` + p.getEnumVal(m.ValueField, valuegoTyp) p.P(s) } else if m.ValueField.IsBytes() { count := p.varGen.Next() p.P(count, ` := r.Intn(100)`) p.P(p.varGen.Next(), ` := `, keyval) p.P(`this.`, fieldname, `[`, p.varGen.Current(), `] = make(`, valuegoTyp, `, `, count, `)`) p.P(`for i := 0; i < `, count, `; i++ {`) p.In() p.P(`this.`, fieldname, `[`, p.varGen.Current(), `][i] = byte(r.Intn(256))`) p.Out() p.P(`}`) } else if m.ValueField.IsString() { s := `this.` + fieldname + `[` + keyval + `]` + ` = ` + fmt.Sprintf("randString%v(r)", p.localName) p.P(s) } else { p.P(p.varGen.Next(), ` := `, keyval) p.P(`this.`, fieldname, `[`, p.varGen.Current(), `] = `, value(valuetypAliasName, m.ValueField.GetType())) if negative(m.ValueField.GetType()) { p.P(`if r.Intn(2) == 0 {`) p.In() p.P(`this.`, fieldname, `[`, p.varGen.Current(), `] *= -1`) p.Out() p.P(`}`) } } p.Out() p.P(`}`) } else if gogoproto.IsCustomType(field) { funcCall := p.getCustomFuncCall(goTypName) if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(p.varGen.Next(), `:= `, funcCall) p.P(`this.`, fieldname, `[i] = *`, p.varGen.Current()) p.Out() p.P(`}`) } else if gogoproto.IsNullable(field) { p.P(`this.`, fieldname, ` = `, funcCall) } else { p.P(p.varGen.Next(), `:= `, funcCall) p.P(`this.`, fieldname, ` = *`, p.varGen.Current()) } } else if field.IsMessage() || p.IsGroup(field) { funcCall := p.getFuncCall(goTypName) if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(5)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() if gogoproto.IsNullable(field) { p.P(`this.`, fieldname, `[i] = `, funcCall) } else { p.P(p.varGen.Next(), `:= `, funcCall) p.P(`this.`, fieldname, `[i] = *`, p.varGen.Current()) } p.Out() p.P(`}`) } else { if gogoproto.IsNullable(field) { p.P(`this.`, fieldname, ` = `, funcCall) } else { p.P(p.varGen.Next(), `:= `, funcCall) p.P(`this.`, fieldname, ` = *`, p.varGen.Current()) } } } else { if field.IsEnum() { val := p.getEnumVal(field, goTyp) if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(`this.`, fieldname, `[i] = `, val) p.Out() p.P(`}`) } else if !gogoproto.IsNullable(field) || proto3 { p.P(`this.`, fieldname, ` = `, val) } else { p.P(p.varGen.Next(), ` := `, val) p.P(`this.`, fieldname, ` = &`, p.varGen.Current()) } } else if field.IsBytes() { if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(p.varGen.Next(), ` := r.Intn(100)`) p.P(`this.`, fieldname, `[i] = make([]byte,`, p.varGen.Current(), `)`) p.P(`for j := 0; j < `, p.varGen.Current(), `; j++ {`) p.In() p.P(`this.`, fieldname, `[i][j] = byte(r.Intn(256))`) p.Out() p.P(`}`) p.Out() p.P(`}`) } else { p.P(p.varGen.Next(), ` := r.Intn(100)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(`this.`, fieldname, `[i] = byte(r.Intn(256))`) p.Out() p.P(`}`) } } else if field.IsString() { typName := generator.GoTypeToName(goTyp) val := fmt.Sprintf("%s(randString%v(r))", typName, p.localName) if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(`this.`, fieldname, `[i] = `, val) p.Out() p.P(`}`) } else if !gogoproto.IsNullable(field) || proto3 { p.P(`this.`, fieldname, ` = `, val) } else { p.P(p.varGen.Next(), `:= `, val) p.P(`this.`, fieldname, ` = &`, p.varGen.Current()) } } else { typName := generator.GoTypeToName(goTyp) if field.IsRepeated() { p.P(p.varGen.Next(), ` := r.Intn(10)`) p.P(`this.`, fieldname, ` = make(`, goTyp, `, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(`this.`, fieldname, `[i] = `, value(typName, field.GetType())) if negative(field.GetType()) { p.P(`if r.Intn(2) == 0 {`) p.In() p.P(`this.`, fieldname, `[i] *= -1`) p.Out() p.P(`}`) } p.Out() p.P(`}`) } else if !gogoproto.IsNullable(field) || proto3 { p.P(`this.`, fieldname, ` = `, value(typName, field.GetType())) if negative(field.GetType()) { p.P(`if r.Intn(2) == 0 {`) p.In() p.P(`this.`, fieldname, ` *= -1`) p.Out() p.P(`}`) } } else { p.P(p.varGen.Next(), ` := `, value(typName, field.GetType())) if negative(field.GetType()) { p.P(`if r.Intn(2) == 0 {`) p.In() p.P(p.varGen.Current(), ` *= -1`) p.Out() p.P(`}`) } p.P(`this.`, fieldname, ` = &`, p.varGen.Current()) } } } } func (p *plugin) hasLoop(field *descriptor.FieldDescriptorProto, visited []*generator.Descriptor, excludes []*generator.Descriptor) *generator.Descriptor { if field.IsMessage() || p.IsGroup(field) || p.IsMap(field) { var fieldMessage *generator.Descriptor if p.IsMap(field) { m := p.GoMapType(nil, field) if !m.ValueField.IsMessage() { return nil } fieldMessage = p.ObjectNamed(m.ValueField.GetTypeName()).(*generator.Descriptor) } else { fieldMessage = p.ObjectNamed(field.GetTypeName()).(*generator.Descriptor) } fieldTypeName := generator.CamelCaseSlice(fieldMessage.TypeName()) for _, message := range visited { messageTypeName := generator.CamelCaseSlice(message.TypeName()) if fieldTypeName == messageTypeName { for _, e := range excludes { if fieldTypeName == generator.CamelCaseSlice(e.TypeName()) { return nil } } return fieldMessage } } pkg := strings.Split(field.GetTypeName(), ".")[1] for _, f := range fieldMessage.Field { if strings.HasPrefix(f.GetTypeName(), "."+pkg+".") { visited = append(visited, fieldMessage) loopTo := p.hasLoop(f, visited, excludes) if loopTo != nil { return loopTo } } } } return nil } func (p *plugin) loops(field *descriptor.FieldDescriptorProto, message *generator.Descriptor) int { //fmt.Fprintf(os.Stderr, "loops %v %v\n", field.GetTypeName(), generator.CamelCaseSlice(message.TypeName())) excludes := []*generator.Descriptor{} loops := 0 for { visited := []*generator.Descriptor{} loopTo := p.hasLoop(field, visited, excludes) if loopTo == nil { break } //fmt.Fprintf(os.Stderr, "loopTo %v\n", generator.CamelCaseSlice(loopTo.TypeName())) excludes = append(excludes, loopTo) loops++ } return loops } func (p *plugin) Generate(file *generator.FileDescriptor) { p.atleastOne = false p.PluginImports = generator.NewPluginImports(p.Generator) p.varGen = NewVarGen() proto3 := gogoproto.IsProto3(file.FileDescriptorProto) p.typesPkg = p.NewImport("github.com/gogo/protobuf/types") p.localName = generator.FileName(file) protoPkg := p.NewImport("github.com/gogo/protobuf/proto") if !gogoproto.ImportsGoGoProto(file.FileDescriptorProto) { protoPkg = p.NewImport("github.com/golang/protobuf/proto") } for _, message := range file.Messages() { if !gogoproto.HasPopulate(file.FileDescriptorProto, message.DescriptorProto) { continue } if message.DescriptorProto.GetOptions().GetMapEntry() { continue } p.atleastOne = true ccTypeName := generator.CamelCaseSlice(message.TypeName()) loopLevels := make([]int, len(message.Field)) maxLoopLevel := 0 for i, field := range message.Field { loopLevels[i] = p.loops(field, message) if loopLevels[i] > maxLoopLevel { maxLoopLevel = loopLevels[i] } } ranTotal := 0 for i := range loopLevels { ranTotal += int(math.Pow10(maxLoopLevel - loopLevels[i])) } p.P(`func NewPopulated`, ccTypeName, `(r randy`, p.localName, `, easy bool) *`, ccTypeName, ` {`) p.In() p.P(`this := &`, ccTypeName, `{}`) if gogoproto.IsUnion(message.File(), message.DescriptorProto) && len(message.Field) > 0 { p.P(`fieldNum := r.Intn(`, fmt.Sprintf("%d", ranTotal), `)`) p.P(`switch fieldNum {`) k := 0 for i, field := range message.Field { is := []string{} ran := int(math.Pow10(maxLoopLevel - loopLevels[i])) for j := 0; j < ran; j++ { is = append(is, fmt.Sprintf("%d", j+k)) } k += ran p.P(`case `, strings.Join(is, ","), `:`) p.In() p.GenerateField(file, message, field) p.Out() } p.P(`}`) } else { var maxFieldNumber int32 oneofs := make(map[string]struct{}) for fieldIndex, field := range message.Field { if field.GetNumber() > maxFieldNumber { maxFieldNumber = field.GetNumber() } oneof := field.OneofIndex != nil if !oneof { if field.IsRequired() || (!gogoproto.IsNullable(field) && !field.IsRepeated()) || (proto3 && !field.IsMessage()) { p.GenerateField(file, message, field) } else { if loopLevels[fieldIndex] > 0 { p.P(`if r.Intn(10) == 0 {`) } else { p.P(`if r.Intn(10) != 0 {`) } p.In() p.GenerateField(file, message, field) p.Out() p.P(`}`) } } else { fieldname := p.GetFieldName(message, field) if _, ok := oneofs[fieldname]; ok { continue } else { oneofs[fieldname] = struct{}{} } fieldNumbers := []int32{} for _, f := range message.Field { fname := p.GetFieldName(message, f) if fname == fieldname { fieldNumbers = append(fieldNumbers, f.GetNumber()) } } p.P(`oneofNumber_`, fieldname, ` := `, fmt.Sprintf("%#v", fieldNumbers), `[r.Intn(`, strconv.Itoa(len(fieldNumbers)), `)]`) p.P(`switch oneofNumber_`, fieldname, ` {`) for _, f := range message.Field { fname := p.GetFieldName(message, f) if fname != fieldname { continue } p.P(`case `, strconv.Itoa(int(f.GetNumber())), `:`) p.In() ccTypeName := p.OneOfTypeName(message, f) p.P(`this.`, fname, ` = NewPopulated`, ccTypeName, `(r, easy)`) p.Out() } p.P(`}`) } } if message.DescriptorProto.HasExtension() { p.P(`if !easy && r.Intn(10) != 0 {`) p.In() p.P(`l := r.Intn(5)`) p.P(`for i := 0; i < l; i++ {`) p.In() if len(message.DescriptorProto.GetExtensionRange()) > 1 { p.P(`eIndex := r.Intn(`, strconv.Itoa(len(message.DescriptorProto.GetExtensionRange())), `)`) p.P(`fieldNumber := 0`) p.P(`switch eIndex {`) for i, e := range message.DescriptorProto.GetExtensionRange() { p.P(`case `, strconv.Itoa(i), `:`) p.In() p.P(`fieldNumber = r.Intn(`, strconv.Itoa(int(e.GetEnd()-e.GetStart())), `) + `, strconv.Itoa(int(e.GetStart()))) p.Out() if e.GetEnd() > maxFieldNumber { maxFieldNumber = e.GetEnd() } } p.P(`}`) } else { e := message.DescriptorProto.GetExtensionRange()[0] p.P(`fieldNumber := r.Intn(`, strconv.Itoa(int(e.GetEnd()-e.GetStart())), `) + `, strconv.Itoa(int(e.GetStart()))) if e.GetEnd() > maxFieldNumber { maxFieldNumber = e.GetEnd() } } p.P(`wire := r.Intn(4)`) p.P(`if wire == 3 { wire = 5 }`) p.P(`dAtA := randField`, p.localName, `(nil, r, fieldNumber, wire)`) p.P(protoPkg.Use(), `.SetRawExtension(this, int32(fieldNumber), dAtA)`) p.Out() p.P(`}`) p.Out() p.P(`}`) } if maxFieldNumber < (1 << 10) { p.P(`if !easy && r.Intn(10) != 0 {`) p.In() if gogoproto.HasUnrecognized(file.FileDescriptorProto, message.DescriptorProto) { p.P(`this.XXX_unrecognized = randUnrecognized`, p.localName, `(r, `, strconv.Itoa(int(maxFieldNumber+1)), `)`) } p.Out() p.P(`}`) } } p.P(`return this`) p.Out() p.P(`}`) p.P(``) //Generate NewPopulated functions for oneof fields m := proto.Clone(message.DescriptorProto).(*descriptor.DescriptorProto) for _, f := range m.Field { oneof := f.OneofIndex != nil if !oneof { continue } ccTypeName := p.OneOfTypeName(message, f) p.P(`func NewPopulated`, ccTypeName, `(r randy`, p.localName, `, easy bool) *`, ccTypeName, ` {`) p.In() p.P(`this := &`, ccTypeName, `{}`) vanity.TurnOffNullableForNativeTypes(f) p.GenerateField(file, message, f) p.P(`return this`) p.Out() p.P(`}`) } } if !p.atleastOne { return } p.P(`type randy`, p.localName, ` interface {`) p.In() p.P(`Float32() float32`) p.P(`Float64() float64`) p.P(`Int63() int64`) p.P(`Int31() int32`) p.P(`Uint32() uint32`) p.P(`Intn(n int) int`) p.Out() p.P(`}`) p.P(`func randUTF8Rune`, p.localName, `(r randy`, p.localName, `) rune {`) p.In() p.P(`ru := r.Intn(62)`) p.P(`if ru < 10 {`) p.In() p.P(`return rune(ru+48)`) p.Out() p.P(`} else if ru < 36 {`) p.In() p.P(`return rune(ru+55)`) p.Out() p.P(`}`) p.P(`return rune(ru+61)`) p.Out() p.P(`}`) p.P(`func randString`, p.localName, `(r randy`, p.localName, `) string {`) p.In() p.P(p.varGen.Next(), ` := r.Intn(100)`) p.P(`tmps := make([]rune, `, p.varGen.Current(), `)`) p.P(`for i := 0; i < `, p.varGen.Current(), `; i++ {`) p.In() p.P(`tmps[i] = randUTF8Rune`, p.localName, `(r)`) p.Out() p.P(`}`) p.P(`return string(tmps)`) p.Out() p.P(`}`) p.P(`func randUnrecognized`, p.localName, `(r randy`, p.localName, `, maxFieldNumber int) (dAtA []byte) {`) p.In() p.P(`l := r.Intn(5)`) p.P(`for i := 0; i < l; i++ {`) p.In() p.P(`wire := r.Intn(4)`) p.P(`if wire == 3 { wire = 5 }`) p.P(`fieldNumber := maxFieldNumber + r.Intn(100)`) p.P(`dAtA = randField`, p.localName, `(dAtA, r, fieldNumber, wire)`) p.Out() p.P(`}`) p.P(`return dAtA`) p.Out() p.P(`}`) p.P(`func randField`, p.localName, `(dAtA []byte, r randy`, p.localName, `, fieldNumber int, wire int) []byte {`) p.In() p.P(`key := uint32(fieldNumber)<<3 | uint32(wire)`) p.P(`switch wire {`) p.P(`case 0:`) p.In() p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(key))`) p.P(p.varGen.Next(), ` := r.Int63()`) p.P(`if r.Intn(2) == 0 {`) p.In() p.P(p.varGen.Current(), ` *= -1`) p.Out() p.P(`}`) p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(`, p.varGen.Current(), `))`) p.Out() p.P(`case 1:`) p.In() p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(key))`) p.P(`dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))`) p.Out() p.P(`case 2:`) p.In() p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(key))`) p.P(`ll := r.Intn(100)`) p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(ll))`) p.P(`for j := 0; j < ll; j++ {`) p.In() p.P(`dAtA = append(dAtA, byte(r.Intn(256)))`) p.Out() p.P(`}`) p.Out() p.P(`default:`) p.In() p.P(`dAtA = encodeVarintPopulate`, p.localName, `(dAtA, uint64(key))`) p.P(`dAtA = append(dAtA, byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)), byte(r.Intn(256)))`) p.Out() p.P(`}`) p.P(`return dAtA`) p.Out() p.P(`}`) p.P(`func encodeVarintPopulate`, p.localName, `(dAtA []byte, v uint64) []byte {`) p.In() p.P(`for v >= 1<<7 {`) p.In() p.P(`dAtA = append(dAtA, uint8(uint64(v)&0x7f|0x80))`) p.P(`v >>= 7`) p.Out() p.P(`}`) p.P(`dAtA = append(dAtA, uint8(v))`) p.P(`return dAtA`) p.Out() p.P(`}`) } func init() { generator.RegisterPlugin(NewPlugin()) } ```
```xml import * as React from 'react'; import { DefaultButton } from '@fluentui/react/lib/Button'; import type { IPageNumberProps } from './PageNumber.types'; export class PageNumber extends React.Component<IPageNumberProps, {}> { constructor(props: IPageNumberProps) { super(props); } public render(): JSX.Element { const { ariaLabel, page, selected, className } = this.props; return ( <DefaultButton key={page} onClick={this._onClick} aria-checked={selected} aria-label={ariaLabel} styles={{ root: className }} role="radio" > {page} </DefaultButton> ); } private _onClick = () => { this.props.onClick(this.props.page - 1); }; } ```
Telethrio (, , ) is a small mountain range in the northwestern part of the island of Euboea, Greece. Its maximum elevation is 970 m. It stretches along the west coast of the island, on the North Euboean Gulf, from Aidipsos in the west to Rovies in the east. Its length is about 16 km from east to west. The mountain is forested. There are few villages on the steep southern slope, including Ilia. Villages on the northern slope are Taxiarchis, Kastaniotissa, Galatsades, Kamatriades and Simia. References Euboea Mountain ranges of Greece Landforms of Central Greece Landforms of Euboea (regional unit)
Nokhtalu (, also Romanized as Nokhţalū, Nokhtalū, and Nokhtālū) is a village in Ajorluy-ye Sharqi Rural District of Nokhtalu District of Baruq County, West Azerbaijan province, Iran, and is the capital of the district. At the 2006 National Census, its population was 189 in 38 households, when it was in Baruq Rural District of the former Baruq District of Miandoab County. The following census in 2011 counted 151 people in 36 households. The latest census in 2016 showed a population of 127 people in 38 households. After the census, Baruq District was separated from Miandoab County, elevated to the status of a county, and divided into two districts. References Populated places in West Azerbaijan Province
Conflict Kitchen was a take-out restaurant in Pittsburgh that served only cuisine from countries with which the United States was in conflict. The menu focused on one nation at a time, rotating every three to five months, and featured related educational programming, such as lunch hour with scholars, film screenings, and trivia nights. After opening in 2010, the restaurant introduced the cuisines of Iran, Afghanistan, Cuba, North Korea, Venezuela, Palestine, and most recently, Iroquois. Referring to the informational brochures distributed with meals, NPR described the restaurant as "an experimental public art project—and the medium is the sandwich wrap." History Conflict Kitchen was opened in 2010 at a small take-out window at 124 South Highland Avenue, in East Liberty. The concept originated with Carnegie Mellon University art professor Jon Rubin and Dawn Weleski. The first iteration, Iranian cuisine, was called "Kubideh Kitchen" and featured Iranian kubideh sandwiches; during the Afghan phase, the restaurant was called "Bolani Pazi" and served bolani. The kitchen was supported by profits from the sale of food, Waffle Shop: A Reality Show, the Benter Foundation, the Center for the Arts in Society, and the Studio for Creative Inquiry at Carnegie Mellon University. The early stage was supported with a $7,000 seed grant from the Pittsburgh-based Sprout Fund. Each re-design is assisted by members of the local ethnic community in Pittsburgh and Carnegie Mellon University. The restaurant also conducted extensive research. During a reach trip to Cuba, Rubin visited the North Korean embassy in Vedado. He rang the doorbell, unannounced, and was given helpful advice on North Korean cuisine from a diplomat who answered the door. Over the years Rubin and Weleski have given numerous interviews, providing insights into their interests and goals. According to Rubin, "Conflict Kitchen reformats the preexisting social relations of food and economic exchange to engage the general public in discussions about countries, cultures and people that they might know little about outside of the polarizing rhetoric of U.S. politics and the narrow lens of media headlines." Relocation The East Liberty location was closed in 2012, with plans to turn the restaurant into a sit-down eatery in Downtown Pittsburgh. With the help of a $25,000 Root Award from the Sprout Fund, in April 2013 the restaurant relocated to Schenley Plaza, a parklet located on the Oakland campus of the University of Pittsburgh. The first menu was Iranian, in honor of the June 2013 Iranian presidential election. New menus followed: "La Cocina Arepas" (Venezuelan cuisine, featuring the titular arepas); and the "Cocina Cubana" (Cuban cuisine, with lechon asado and yuca con mojo). Public reception In May 2012, it was reported that on a good day, the restaurant served between 30 and 50 customers. By 2013, it was serving 100 to 300 daily at the Schenley Plaza location. The project has been covered extensively in the American and international press, and was nominated for a 2015 International Award for Public Art by The Institute for Public Art in Hong Kong. It was also featured on the cover of the September 2012 issue of American Journal of Public Health focused on "Hunger and Health." Controversy Controversy erupted in 2014 when Conflict Kitchen began serving Palestinian cuisine. The affair was set off by a public event, hosted by Conflict Kitchen with Nael Aldweib, a local doctor and Israeli-Arab from West Bank, and Ken Boas, chair of the board of the Israeli Committee Against House Demolitions-USA and professor of literature at the University of Pittsburgh. As reported by The Jewish Chronicle, Gregg Roman, director of the Federation's Community Relations Council asked to be included in the panel, but Conflict Kitchen declined the offer. As The Jewish Chronicle described the restaurant serving Palestinian food as "The discussion Tuesday afternoon billed as focusing on 'current events in Palestine,' ... quickly shifting to wholesale condemnation of Israel." The controversy went national when B'nai B'rith International condemned the restaurant in a letter addressed to the Heinz Endowments. The foundation had supported Conflict Kitchen's move and programming with a $50,000 grant. At the time, the Heinz Endowments was chaired by Teresa Heinz Kerry, wife of US Secretary of State John Kerry. The link to national political figures prompted a media frenzy, with headlines that one commentator described as "sensationalist in tone" ("Anti-Israel restaurant receives funding from John Kerry's wife's foundation"). On November 8 the restaurant was closed for 4 days following a death threat. During the closure the restaurant exterior was covered with hand-written notes of support by the public. Conflict Kitchen reopened November 12 as the police continued to investigate. In a video report by the BBC, Gregg Roman again criticized the restaurant for passing off opinion as fact, citing as evidence the restaurant's informational brochures, which included interviews with Palestinians. He also rejected the project's claim to artistic status, saying, "representing the Palestinian people through their so-called art is not art in and of itself, but it is hate speech." Jon Rubin, one of the restaurant's co-directors, and who is himself Jewish, replied, "We're interested in promoting understanding of the Palestinian perspective." The widespread media attention increased the restaurant's profile and drew new customers, including Jezebel's writer at The Kitchenette, who announced that he would visit for the first time as a show of support. References External links Official website Restaurants in Pittsburgh 2010 establishments in Pennsylvania 2017 disestablishments in Pennsylvania Carnegie Mellon University Culture of Pittsburgh Foreign relations of the United States
```python # # APIs for interpreting and creating protobuf packets for Wi-Fi State Controlling import proto from utils import str_to_bytes def print_verbose(security_ctx, data): if (security_ctx.verbose): print(f'\x1b[32;20m++++ {data} ++++\x1b[0m') def ctrl_reset_request(security_ctx): # Form protobuf request packet for CtrlReset command cmd = proto.wifi_ctrl_pb2.WiFiCtrlPayload() cmd.msg = proto.wifi_ctrl_pb2.TypeCmdCtrlReset enc_cmd = security_ctx.encrypt_data(cmd.SerializeToString()) print_verbose(security_ctx, f'Client -> Device (Encrypted CmdCtrlReset): 0x{enc_cmd.hex()}') return enc_cmd.decode('latin-1') def ctrl_reset_response(security_ctx, response_data): # Interpret protobuf response packet from CtrlReset command dec_resp = security_ctx.decrypt_data(str_to_bytes(response_data)) resp = proto.wifi_ctrl_pb2.WiFiCtrlPayload() resp.ParseFromString(dec_resp) print_verbose(security_ctx, f'CtrlReset status: 0x{str(resp.status)}') if resp.status != 0: raise RuntimeError def ctrl_reprov_request(security_ctx): # Form protobuf request packet for CtrlReprov command cmd = proto.wifi_ctrl_pb2.WiFiCtrlPayload() cmd.msg = proto.wifi_ctrl_pb2.TypeCmdCtrlReprov enc_cmd = security_ctx.encrypt_data(cmd.SerializeToString()) print_verbose(security_ctx, f'Client -> Device (Encrypted CmdCtrlReset): 0x{enc_cmd.hex()}') return enc_cmd.decode('latin-1') def ctrl_reprov_response(security_ctx, response_data): # Interpret protobuf response packet from CtrlReprov command dec_resp = security_ctx.decrypt_data(str_to_bytes(response_data)) resp = proto.wifi_ctrl_pb2.WiFiCtrlPayload() resp.ParseFromString(dec_resp) print_verbose(security_ctx, f'CtrlReset status: 0x{str(resp.status)}') if resp.status != 0: raise RuntimeError ```
This is a list of Time Team episodes from series 14. Episode Series 14 Episode # refers to the air date order. The Time Team Specials are aired in between regular episodes, but are omitted from this list. Regular contributors on Time Team include: Tony Robinson (presenter); archaeologists Mick Aston, Phil Harding, Helen Geake, Brigid Gallagher, Raksha Dave, Matt Williams; Francis Pryor (historian); Jackie McKinley (osteoarchaeologist); Victor Ambrus (illustrator); Stewart Ainsworth (landscape investigator); John Gater (geophysicist); Henry Chapman (surveyor); Paul Blinkhorn (pottery); Mark Corney (Roman expert); Raysan Al-Kubaisi (computer graphics). References External links Time Team at Channel4.com The Unofficial Time Team site Fan site Time Team (Series 14) 2007 British television seasons
```javascript export const staticFunc = () => { console.log('hi, my name is staticFunc'); } ```
```php <?php /** * FecShop file. * * @link path_to_url * @license path_to_url */ namespace fecshop\app\appadmin\modules\Catalog\controllers; use fecshop\app\appadmin\modules\Catalog\CatalogController; /** * @author Terry Zhao <2358269014@qq.com> * @since 1.0 */ class ProductreviewController extends CatalogController { public $enableCsrfValidation = true; public function actionIndex() { $data = $this->getBlock()->getLastData(); return $this->render($this->action->id, $data); } public function actionManageredit() { $data = $this->getBlock()->getLastData(); return $this->render($this->action->id, $data); } public function actionManagereditsave() { $data = $this->getBlock('manageredit')->save(); } public function actionManagerdelete() { $this->getBlock('manageredit')->delete(); } public function actionManageraudit() { $this->getBlock('manageredit')->audit(); } public function actionManagerauditrejected() { $this->getBlock('manageredit')->auditRejected(); } } ```
Navia umbratilis is a plant species in the genus Navia. This species is endemic to Venezuela. References umbratilis Flora of Venezuela
Lytorhynchus kennedyi or (also known as Kennedy's leafnose snake) is a non-venomous snake found in Middle East. Description Lytorhynchus kennedyi or (Lytorhynchus diadema kennedyi), adults range from 30-51 cm in length. Bright orange to reddish, with dark transverse on the body and the tail. Distribution Syria, Jordan, probably in SW Iraq (Type locality: Syria, between Horns and Palmyra). This species is found in sandy desert, semi-desert, sandy coastal areas, areas of high grassland plateaus (especially those close to rocky areas), and clay plateaus with rocks. This species digs, but is not considered fossorial In Arabia it appears to occur in a wide range of dry habitats. Feed Feeds mainly on lizards but will eat large arthropods and insects and young rodents. Reproduction Oviparous, The female lays clutches of three to five eggs. References Lytorhynchus Reptiles of the Middle East Reptiles described in 1939 Taxa named by Karl Patterson Schmidt
```java /* * $Id: ImgWMF.java 4065 2009-09-16 23:09:11Z psoares33 $ * $Name$ * * * * * The Original Code is 'iText, a free JAVA-PDF library'. * * The Initial Developer of the Original Code is Bruno Lowagie. Portions created by * All Rights Reserved. * Co-Developer of the code is Paulo Soares. Portions created by the Co-Developer * * Contributor(s): all the names of the contributors are added in the source code * where applicable. * * Alternatively, the contents of this file may be used under the terms of the * LGPL license (the "GNU LIBRARY GENERAL PUBLIC LICENSE"), in which case the * provisions of LGPL are applicable instead of those above. If you wish to * allow use of your version of this file only under the terms of the LGPL * the MPL, indicate your decision by deleting the provisions above and * replace them with the notice and other provisions required by the LGPL. * If you do not delete the provisions above, a recipient may use your version * of this file under either the MPL or the GNU LIBRARY GENERAL PUBLIC LICENSE. * * This library is free software; you can redistribute it and/or modify it * under the terms of the MPL as stated above or under the terms of the GNU * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * details. * * If you didn't download this code from the following link, you should check if * you aren't using an obsolete version: * path_to_url */ package com.lowagie.text; import com.lowagie.text.error_messages.MessageLocalization; import com.lowagie.text.pdf.PdfTemplate; import com.lowagie.text.pdf.codec.wmf.InputMeta; import com.lowagie.text.pdf.codec.wmf.MetaDo; import java.io.IOException; import java.io.InputStream; import java.net.MalformedURLException; import java.net.URL; /** * An <CODE>ImgWMF</CODE> is the representation of a windows metafile that has to be inserted into the document * * @see Element * @see Image */ public class ImgWMF extends Image { // Constructors ImgWMF(Image image) { super(image); } /** * Constructs an <CODE>ImgWMF</CODE>-object, using an <VAR>url</VAR>. * * @param url the <CODE>URL</CODE> where the image can be found * @throws BadElementException on error * @throws IOException on error */ public ImgWMF(URL url) throws BadElementException, IOException { super(url); processParameters(); } /** * Constructs an <CODE>ImgWMF</CODE>-object, using a <VAR>filename</VAR>. * * @param filename a <CODE>String</CODE>-representation of the file that contains the image. * @throws BadElementException on error * @throws MalformedURLException on error * @throws IOException on error */ public ImgWMF(String filename) throws BadElementException, IOException { this(Utilities.toURL(filename)); } /** * Constructs an <CODE>ImgWMF</CODE>-object from memory. * * @param img the memory image * @throws BadElementException on error * @throws IOException on error */ public ImgWMF(byte[] img) throws BadElementException, IOException { super((URL) null); rawData = img; originalData = img; processParameters(); } /** * This method checks if the image is a valid WMF and processes some parameters. * * @throws BadElementException * @throws IOException */ private void processParameters() throws BadElementException, IOException { type = IMGTEMPLATE; originalType = ORIGINAL_WMF; InputStream is = null; try { String errorID; if (rawData == null) { is = url.openStream(); errorID = url.toString(); } else { is = new java.io.ByteArrayInputStream(rawData); errorID = "Byte array"; } InputMeta in = new InputMeta(is); if (in.readInt() != 0x9AC6CDD7) { throw new BadElementException( MessageLocalization.getComposedMessage("1.is.not.a.valid.placeable.windows.metafile", errorID)); } in.readWord(); int left = in.readShort(); int top = in.readShort(); int right = in.readShort(); int bottom = in.readShort(); int inch = in.readWord(); dpiX = 72; dpiY = 72; scaledHeight = (float) (bottom - top) / inch * 72f; setTop(scaledHeight); scaledWidth = (float) (right - left) / inch * 72f; setRight(scaledWidth); } finally { if (is != null) { is.close(); } plainWidth = getWidth(); plainHeight = getHeight(); } } /** * Reads the WMF into a template. * * @param template the template to read to * @throws IOException on error * @throws DocumentException on error */ public void readWMF(PdfTemplate template) throws IOException, DocumentException { setTemplateData(template); template.setWidth(getWidth()); template.setHeight(getHeight()); InputStream is = null; try { if (rawData == null) { is = url.openStream(); } else { is = new java.io.ByteArrayInputStream(rawData); } MetaDo meta = new MetaDo(is, template); meta.readAll(); } finally { if (is != null) { is.close(); } } } } ```
El Cóporo is a prehispanic archaeological site at the northern frontiers of the Mesoamerican cultural area, located at an elevation of 150 meters on the western slopes of the Santa Bárbara range (Sierra de Santa Bárbara), near the San José del Torreón community, and lies some due south of its municipal seat and largest township, on the northwestern corner of Guanajuato state, Mexico. The site is considered as one of the four most important archaeological sites in the state. Cóporo is a Purépecha word meaning 'over the big road'. The site is named after the Cóporo hill, where it is located and the site is located at its peak, 156 meters high. The ceremonial and government center has been completed about 80 percent; around the center 29 smaller settlements were established on the slopes, the main occupation period occurred between 500-900 CE. The site's main occupation dates to the Late Classic and Early Postclassic eras of Mesoamerican chronology, and shows affinities with the Tunal Grande culture. El Cóporo covers an area of approximately spread across the slopes and summit of Cerro del Cóporo, the hill after which the site is named. an estimated five percent of this area has been archaeologically excavated or investigated. The ethnic groups that lived in this region are associated with cultures that developed in the San Luís Potosí, Jalisco, Zacatecas and Guanajuato States, and that a point in time, migrated to central México, where they joined other groups and participated in the development of the multi-ethnic Toltec society.” Background For a long time Guanajuato is considered a region inhabited since times prehispanic times, only by native hunter-gatherers of the chichimeca with a semi nomadic culture way of life. During the late postclassical the chichimeca lived in the region, these lands were previously occupied by sedentary peoples integrated high Mesoamerican culture. Records of this civilization are scattered throughout the territory along the rivers, valleys, slopes and top of the hills. It is common for local historians to associate these vestiges of semi nomadic peoples, reinforcing old assumptions that Guanajuato was only inhabited by chichimecas; it is evident that in Guanajuato inhabited from remote times, various ethnic groups that maintained complex forms of partnerships. The prehispanic period extends from the origin of the first settlers on the continent. During this long time men who inhabited Ocampo forged a culture with own identity and characteristics. The municipality of Ocampo was seat of men who bequeathed cultures and ways of life that were conditioned by geographical elements as well as influence form the great Mesoamerican cultures, particularly Teotihuacan and Toltec. These cultural samples had common characteristics to the cultures established in the Highlands, but the desert conditions barely allowed the development of groups semi nomadic hunters-gatherers. El Cóporo is recognized as a site with Chupícuaro cultural influences which flourished in the Bajío in parallel with the Teotihuacan culture. It can be stated that the in Guanajuato State existed among other Nations; the Otomíes ("Chichimeca" ancestors) and Nahuatlacas. The Chichimeca It is estimated that they reached central Mexico in the 12th century CE, causing natural displacement of several groups, including the Otomies and Tecuexe. It is commonly thought that the chichimecas were uncultivated, simple nomadic people without organization, and occasionally made raids in the Otomi and Purépecha regions. The Spanish invaders, after the conquest of Tenochtitlan, never imagined that it would take them more than two centuries to conquer northern Mexico, a region known as Aridoamerica. Several Chichimeca (uncivil and dirty dog) groups inhabited the regions. This name was given because of the thought that they had a lower cultural level, compared to other native cultures of Mesoamerica. Four major Chichimeca Nations were Pames, Guamare, Zacateco and Guachichiles, these last two unlike the Tecuexe, Caxcans and the other two groups had a lower cultural level, because others had altars and knew agriculture. However, the chichimecas managed to build temples-fortress, ballgame courts, developed pottery, painting (petroglyphs), etc. all this in harsh conditions, in an arid area where rainfall is scarce and the climate is variable. In this region the predominant Chichimeca nation were the Guachichiles, the most warrior group. Their operations center was “Tunal el Grande”, served as refuge shelter and food source. The Guachichiles were known to paint their bodies, hair, and faces in red dye. For this reason they were called "guachichile" by the Mexica, meaning "heads painted red". Religion Religion was practiced in civic-religious centers, performed by priests, witches or sorcerers who were called “madai cojoo”, which means big sorcerer; usually these ceremonial centers or worship places (cues), were on the slopes of mountains or high places. Apart from the Sun and the Moon, had no fixed gods, these could be stone one day and the next a different figure or symbol. The Chichimeca Name "Chichimeca" was generically, equivalent to barbarian or savage. However, the term has different interpretations: for example, Alva Ixtlilxóchitl mentions that in their language it meant Eagles, for others it means sucking, the chichi verb mean to breastfeed, and according to Torquemada this name were given because they sucked blood from animals which they hunted. As well as these, there are other meanings; chichic (bitter), chichi (dog), etc.; others propose that chichimeca means people who live in chichiman and chichiman is understood as a place of dogs. Also, Chichimeca was the name that the Nahua peoples of Mexico generically applied to a wide range of semi-nomadic peoples who inhabited the north of modern-day Mexico and southwestern United States, and carried the same sense as the European term "barbarian". The silver route Roads have personality, because of the sites and conditions found in its path, as well as by destinations and their functions. As it is known, there were trade routes across the Mesoamerican region, and is also known that there were mines with minerals and semi-precious stones, with a trade area which probably began in the United States South, passed through the center of Mexico and reached venues as remote as Nicaragua and Costa Rica in Central America. It is very possible that these routes passed through this site. Investigations This archaeological area includes several areas that suggest, based on archaeological evidence (ceramic objects and stone tools), an affinity with the Tunal Grande region (San Luis Potosí) and strong links with prehispanic settlements in Zacatecas, Jalisco and the Guanajuato Bajio. Beatriz Braniff made the first archaeological research in 1962. Establish the first ceramic sequence, knowledge of some architectural elements (the presence of columns that linked it with sites like La Quemada and Altavista (Zacatecas)) as well as an occupation that started in the Preclassical and ended in the early Postclassical. In 1965, Mr. Jesús Aguirre, local researcher, conducted other research, found several pieces that from its quality, artistic and religious implications, inferred a high level of social development on the site during its occupation. In 2002, after nearly 40 years, archeological explorations in the site are restarted. Armando Nicolau Romero, continued archaeological research of the site, made topographical surveys and excavations. The site This prehispanic settlement was formed by a number of villages around the Hill. It is estimated that early settlement stages possibly took place towards 200 CE. According to evidence found, estimated that the city was abandoned between 1000 and 1100 CE, possibly due to climate change in the region that prevented further agricultural activities. Researchers have identified three archaeological spaces, called neighborhoods: area considered ceremonial; in the bottom The Gotas and Montes neighborhoods, with platforms, and along the Valley housing units. Within the site distinct assemblages () and structural complexes have been identified, grouped into zones indicating a functional differentiation between ceremonial, civic administration, residential and other spaces. Archaeologists have identified over 150 structures distributed across these groups. Conjuntos Four pyramid structures, possibly an exclusive area for rulers and priests have been identified at the top of the Hill. These architectural groups are called Gotas, Montés, Cóporo, Caracol, were built at the end of the classical and epiclassical period, between 500 and 900 CE. A number of large squares whose functions could have been administrative and religious have also been identified on the north and west slopes of the complex. So far six groups (conjuntos) of this prehispanic site, related to the Tunal Grande culture (200-1100 CE) have been excavated: Gotas, Llano, Aire, Cóporo, Montés and Caracol. Cóporo Conjunto Cóporo is located at the top of the Hill, is a ceremonial zone, Acropolis style. In this group and Gotas, human burials were found. Most outstanding of these findings has been the pigmentation with several black layers found in the skeletons, presupposes the existence of worship rituals of their dead. Gotas This Conjunto is located on the skirts of the hill, it is a civic-administrative space. Recent excavations have identified the building as a housing residential unit, from wood remains found, used as columns to support a roof. Carbon-14 dating analysis of these remains provided a date of 500 to 900 CE. Montés This Conjunto, is a residential zone. Caracol This Conjunto appear to also be a residential area, has defensive elements as dirt-stone fences. Llano The Conjunto is located in the lower part, there are various public and domestic areas as well as workshops. Aire It is likely that the gravel road at this conjunto was access for pilgrims to the sacred places at the site. Structures Plaza 1 This plaza will remain in its original conditions with some excavations and boreholes to demonstrate how it was found. Plaza 2 It is part of Conjunto Gotas, has been released and consolidated one 100 percent. Has a 5,000 square meters extension, consists of four platforms, the east and north have the most important structures. Eastern Platform It is surrounded by a slope made from stone and adobe, covered with masonry; It has a stairway that leads to a corridor that heads to a hall, with 20 wooden columns arranged in three rows, feature that makes the site unique throughout the region. These 20 columns probably refer to Mesoamerican calendars, that have equal number of days. Accesses and facades are oriented towards the west, probably its inhabitants made astronomical observations, and linked the ceremonies with the solar cycle. At the back of the hall is another stairway to a second level, where there is a small corridor with a small lounge and 10 columns around a central atrium. Northern Platform It has a long and wide base stone made with three structures, the center is known as the Palace, has a stairway and a room with four columns oriented towards the south, which reminds a pitched (gabled) roof. To the sides of the Palace, are access stairs to another level with their respective lounge and columns, the room probably was a civic or administrative space. Southern and Western Platforms These completely surround Plaza 2, have much smaller dimensions, and comprise rooms divided by adobe walls and some stoves that suggest that it would be the kitchen for great ceremonies. Site conditions There is destruction of ceramic utensils, hunting pieces, molcajetes and remnants of houses that are not more than 20 centimeters deep. Some pieces remain on the surface, mixed with manure from livestock grazing on the area. Negligence in preserving the site is reported on the part of INAH, Government of Guanajuato and Municipal. References Bibliography External links Arqueología Mexicana Vol. XVI, número 92, marzo de 1996 sitio oficial Municipio de Ocampo Guanajuato Viva Ocampo Guanajuato San José del Torreón (El Torreón) Redescubren el Cóporo Gobierno del estado de Guanajuato Mesoamerican sites Former populated places in Mexico Archaeological sites in Guanajuato
```javascript /** * @license Apache-2.0 * * * * path_to_url * * Unless required by applicable law or agreed to in writing, software * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */ 'use strict'; // MODULES // var tape = require( 'tape' ); var dmediansorted = require( './../lib' ); // TESTS // tape( 'main export is a function', function test( t ) { t.ok( true, __filename ); t.strictEqual( typeof dmediansorted, 'function', 'main export is a function' ); t.end(); }); tape( 'attached to the main export is a method providing an ndarray interface', function test( t ) { t.strictEqual( typeof dmediansorted.ndarray, 'function', 'method is a function' ); t.end(); }); ```
Ruth Faison Shaw (1889–1969) was an American artist, educator who is credited with introducing finger painting into the USA as an art education medium. She developed her techniques while working in Rome, Italy, patenting a safe non-toxic paint in 1931. Early life Shaw was born in Kenansville, North Carolina, on October 15, 1889. Her father was a Presbyterian minister and she had four brothers. She attended elementary school in Cabarrus County, North Carolina. She graduated from a Presbyterian girls school, the James Sprunt Institute, in 1906. She also attended the Peabody Conservatory in Baltimore. After graduation she gained some experience as (an untrained) school teacher in the Appalachian Mountains in Transylvania County, North Carolina. In 1918 Shaw travelled to France and Italy with the Young Women's Christian Association (YWCA), before setting up a school in Rome. Finger painting Shaw is credited with developing the art of finger painting and later introducing it into the American education system. She later claimed she had been inspired when she saw a child smearing iodine onto a wall, realising children liked to 'smear'. This event took place in 1926, when Shaw had already founded an experimental school, the Shaw School, for English-speaking children. Shaw developed the techniques and materials required for finger painting. In 1931 she patented a gelatinous paint medium that would be safe for children. Shaw returned to the USA in 1932. She took a job in the progressive Dalton School in New York City, where she introduced finger painting to the curriculum. An exhibition of finger painting art took place in Manhattan in 1933. She published several books on finger painting. Later career Shaw came to be seen as a pioneer in progressive education. She was invited to lecture about finger painting and organize exhibitions. She started a factory in New York to produce her paint. Finger painting workshops were started for adults. In 1942 she became a lecturer at Teachers College, Columbia University. Shaw died in Fayetteville, North Carolina in 1969. A collection of her papers are held at the Southern Historical Collection at the University of North Carolina. Selected works References External links 1880s births 1969 deaths 20th-century American painters 20th-century American women artists American art educators American women painters People from Kenansville, North Carolina Teachers College, Columbia University faculty American women academics
```php <?php /* * This file is part of the PHP_CodeCoverage package. * * (c) Sebastian Bergmann <sebastian@phpunit.de> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * @since Class available since Release 2.0.0 */ class PHP_CodeCoverage_Report_XML_File_Coverage { /** * @var XMLWriter */ private $writer; /** * @var DOMElement */ private $contextNode; /** * @var bool */ private $finalized = false; public function __construct(DOMElement $context, $line) { $this->contextNode = $context; $this->writer = new XMLWriter(); $this->writer->openMemory(); $this->writer->startElementNs(null, $context->nodeName, 'path_to_url $this->writer->writeAttribute('nr', $line); } public function addTest($test) { if ($this->finalized) { throw new PHP_CodeCoverage_Exception('Coverage Report already finalized'); } $this->writer->startElement('covered'); $this->writer->writeAttribute('by', $test); $this->writer->endElement(); } public function finalize() { $this->writer->endElement(); $fragment = $this->contextNode->ownerDocument->createDocumentFragment(); $fragment->appendXML($this->writer->outputMemory()); $this->contextNode->parentNode->replaceChild( $fragment, $this->contextNode ); $this->finalized = true; } } ```
```go package assert import ( "fmt" "reflect" ) type CompareType int const ( compareLess CompareType = iota - 1 compareEqual compareGreater ) var ( intType = reflect.TypeOf(int(1)) int8Type = reflect.TypeOf(int8(1)) int16Type = reflect.TypeOf(int16(1)) int32Type = reflect.TypeOf(int32(1)) int64Type = reflect.TypeOf(int64(1)) uintType = reflect.TypeOf(uint(1)) uint8Type = reflect.TypeOf(uint8(1)) uint16Type = reflect.TypeOf(uint16(1)) uint32Type = reflect.TypeOf(uint32(1)) uint64Type = reflect.TypeOf(uint64(1)) float32Type = reflect.TypeOf(float32(1)) float64Type = reflect.TypeOf(float64(1)) stringType = reflect.TypeOf("") ) func compare(obj1, obj2 interface{}, kind reflect.Kind) (CompareType, bool) { obj1Value := reflect.ValueOf(obj1) obj2Value := reflect.ValueOf(obj2) // throughout this switch we try and avoid calling .Convert() if possible, // as this has a pretty big performance impact switch kind { case reflect.Int: { intobj1, ok := obj1.(int) if !ok { intobj1 = obj1Value.Convert(intType).Interface().(int) } intobj2, ok := obj2.(int) if !ok { intobj2 = obj2Value.Convert(intType).Interface().(int) } if intobj1 > intobj2 { return compareGreater, true } if intobj1 == intobj2 { return compareEqual, true } if intobj1 < intobj2 { return compareLess, true } } case reflect.Int8: { int8obj1, ok := obj1.(int8) if !ok { int8obj1 = obj1Value.Convert(int8Type).Interface().(int8) } int8obj2, ok := obj2.(int8) if !ok { int8obj2 = obj2Value.Convert(int8Type).Interface().(int8) } if int8obj1 > int8obj2 { return compareGreater, true } if int8obj1 == int8obj2 { return compareEqual, true } if int8obj1 < int8obj2 { return compareLess, true } } case reflect.Int16: { int16obj1, ok := obj1.(int16) if !ok { int16obj1 = obj1Value.Convert(int16Type).Interface().(int16) } int16obj2, ok := obj2.(int16) if !ok { int16obj2 = obj2Value.Convert(int16Type).Interface().(int16) } if int16obj1 > int16obj2 { return compareGreater, true } if int16obj1 == int16obj2 { return compareEqual, true } if int16obj1 < int16obj2 { return compareLess, true } } case reflect.Int32: { int32obj1, ok := obj1.(int32) if !ok { int32obj1 = obj1Value.Convert(int32Type).Interface().(int32) } int32obj2, ok := obj2.(int32) if !ok { int32obj2 = obj2Value.Convert(int32Type).Interface().(int32) } if int32obj1 > int32obj2 { return compareGreater, true } if int32obj1 == int32obj2 { return compareEqual, true } if int32obj1 < int32obj2 { return compareLess, true } } case reflect.Int64: { int64obj1, ok := obj1.(int64) if !ok { int64obj1 = obj1Value.Convert(int64Type).Interface().(int64) } int64obj2, ok := obj2.(int64) if !ok { int64obj2 = obj2Value.Convert(int64Type).Interface().(int64) } if int64obj1 > int64obj2 { return compareGreater, true } if int64obj1 == int64obj2 { return compareEqual, true } if int64obj1 < int64obj2 { return compareLess, true } } case reflect.Uint: { uintobj1, ok := obj1.(uint) if !ok { uintobj1 = obj1Value.Convert(uintType).Interface().(uint) } uintobj2, ok := obj2.(uint) if !ok { uintobj2 = obj2Value.Convert(uintType).Interface().(uint) } if uintobj1 > uintobj2 { return compareGreater, true } if uintobj1 == uintobj2 { return compareEqual, true } if uintobj1 < uintobj2 { return compareLess, true } } case reflect.Uint8: { uint8obj1, ok := obj1.(uint8) if !ok { uint8obj1 = obj1Value.Convert(uint8Type).Interface().(uint8) } uint8obj2, ok := obj2.(uint8) if !ok { uint8obj2 = obj2Value.Convert(uint8Type).Interface().(uint8) } if uint8obj1 > uint8obj2 { return compareGreater, true } if uint8obj1 == uint8obj2 { return compareEqual, true } if uint8obj1 < uint8obj2 { return compareLess, true } } case reflect.Uint16: { uint16obj1, ok := obj1.(uint16) if !ok { uint16obj1 = obj1Value.Convert(uint16Type).Interface().(uint16) } uint16obj2, ok := obj2.(uint16) if !ok { uint16obj2 = obj2Value.Convert(uint16Type).Interface().(uint16) } if uint16obj1 > uint16obj2 { return compareGreater, true } if uint16obj1 == uint16obj2 { return compareEqual, true } if uint16obj1 < uint16obj2 { return compareLess, true } } case reflect.Uint32: { uint32obj1, ok := obj1.(uint32) if !ok { uint32obj1 = obj1Value.Convert(uint32Type).Interface().(uint32) } uint32obj2, ok := obj2.(uint32) if !ok { uint32obj2 = obj2Value.Convert(uint32Type).Interface().(uint32) } if uint32obj1 > uint32obj2 { return compareGreater, true } if uint32obj1 == uint32obj2 { return compareEqual, true } if uint32obj1 < uint32obj2 { return compareLess, true } } case reflect.Uint64: { uint64obj1, ok := obj1.(uint64) if !ok { uint64obj1 = obj1Value.Convert(uint64Type).Interface().(uint64) } uint64obj2, ok := obj2.(uint64) if !ok { uint64obj2 = obj2Value.Convert(uint64Type).Interface().(uint64) } if uint64obj1 > uint64obj2 { return compareGreater, true } if uint64obj1 == uint64obj2 { return compareEqual, true } if uint64obj1 < uint64obj2 { return compareLess, true } } case reflect.Float32: { float32obj1, ok := obj1.(float32) if !ok { float32obj1 = obj1Value.Convert(float32Type).Interface().(float32) } float32obj2, ok := obj2.(float32) if !ok { float32obj2 = obj2Value.Convert(float32Type).Interface().(float32) } if float32obj1 > float32obj2 { return compareGreater, true } if float32obj1 == float32obj2 { return compareEqual, true } if float32obj1 < float32obj2 { return compareLess, true } } case reflect.Float64: { float64obj1, ok := obj1.(float64) if !ok { float64obj1 = obj1Value.Convert(float64Type).Interface().(float64) } float64obj2, ok := obj2.(float64) if !ok { float64obj2 = obj2Value.Convert(float64Type).Interface().(float64) } if float64obj1 > float64obj2 { return compareGreater, true } if float64obj1 == float64obj2 { return compareEqual, true } if float64obj1 < float64obj2 { return compareLess, true } } case reflect.String: { stringobj1, ok := obj1.(string) if !ok { stringobj1 = obj1Value.Convert(stringType).Interface().(string) } stringobj2, ok := obj2.(string) if !ok { stringobj2 = obj2Value.Convert(stringType).Interface().(string) } if stringobj1 > stringobj2 { return compareGreater, true } if stringobj1 == stringobj2 { return compareEqual, true } if stringobj1 < stringobj2 { return compareLess, true } } } return compareEqual, false } // Greater asserts that the first element is greater than the second // // assert.Greater(t, 2, 1) // assert.Greater(t, float64(2), float64(1)) // assert.Greater(t, "b", "a") func Greater(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { return compareTwoValues(t, e1, e2, []CompareType{compareGreater}, "\"%v\" is not greater than \"%v\"", msgAndArgs) } // GreaterOrEqual asserts that the first element is greater than or equal to the second // // assert.GreaterOrEqual(t, 2, 1) // assert.GreaterOrEqual(t, 2, 2) // assert.GreaterOrEqual(t, "b", "a") // assert.GreaterOrEqual(t, "b", "b") func GreaterOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { return compareTwoValues(t, e1, e2, []CompareType{compareGreater, compareEqual}, "\"%v\" is not greater than or equal to \"%v\"", msgAndArgs) } // Less asserts that the first element is less than the second // // assert.Less(t, 1, 2) // assert.Less(t, float64(1), float64(2)) // assert.Less(t, "a", "b") func Less(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { return compareTwoValues(t, e1, e2, []CompareType{compareLess}, "\"%v\" is not less than \"%v\"", msgAndArgs) } // LessOrEqual asserts that the first element is less than or equal to the second // // assert.LessOrEqual(t, 1, 2) // assert.LessOrEqual(t, 2, 2) // assert.LessOrEqual(t, "a", "b") // assert.LessOrEqual(t, "b", "b") func LessOrEqual(t TestingT, e1 interface{}, e2 interface{}, msgAndArgs ...interface{}) bool { return compareTwoValues(t, e1, e2, []CompareType{compareLess, compareEqual}, "\"%v\" is not less than or equal to \"%v\"", msgAndArgs) } // Positive asserts that the specified element is positive // // assert.Positive(t, 1) // assert.Positive(t, 1.23) func Positive(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { zero := reflect.Zero(reflect.TypeOf(e)) return compareTwoValues(t, e, zero.Interface(), []CompareType{compareGreater}, "\"%v\" is not positive", msgAndArgs) } // Negative asserts that the specified element is negative // // assert.Negative(t, -1) // assert.Negative(t, -1.23) func Negative(t TestingT, e interface{}, msgAndArgs ...interface{}) bool { zero := reflect.Zero(reflect.TypeOf(e)) return compareTwoValues(t, e, zero.Interface(), []CompareType{compareLess}, "\"%v\" is not negative", msgAndArgs) } func compareTwoValues(t TestingT, e1 interface{}, e2 interface{}, allowedComparesResults []CompareType, failMessage string, msgAndArgs ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() } e1Kind := reflect.ValueOf(e1).Kind() e2Kind := reflect.ValueOf(e2).Kind() if e1Kind != e2Kind { return Fail(t, "Elements should be the same type", msgAndArgs...) } compareResult, isComparable := compare(e1, e2, e1Kind) if !isComparable { return Fail(t, fmt.Sprintf("Can not compare type \"%s\"", reflect.TypeOf(e1)), msgAndArgs...) } if !containsValue(allowedComparesResults, compareResult) { return Fail(t, fmt.Sprintf(failMessage, e1, e2), msgAndArgs...) } return true } func containsValue(values []CompareType, value CompareType) bool { for _, v := range values { if v == value { return true } } return false } ```
Beginning in the 2010s, various media personalities promoted conspiracy theories claiming that exposure to endocrine disrupting chemical pollutants in the water supply are responsible for an alleged increase in the gay or transgender population. These claims are not supported by scientific evidence, and have been described as anti-LGBT rhetoric. Research in the 2000s suggested that the herbicide atrazine, an endocrine disruptor, may have a feminizing effect on male frogs causing them to become hermaphrodites. Other research failed to reproduce these results. Reviewing 19 studies in total, the United States Environmental Protection Agency concluded in 2013 that atrazine has no consistent effects on development in amphibians. Regardless, American conspiracy theorist and radio personality Alex Jones claimed that atrazine had caused a majority of frogs in the US to become homosexual, and that the US government was waging a "chemical warfare operation" to increase rates of homosexuality and decrease birth rates. A viral 2015 rant from Jones about "chemicals in the water that turn the friggin' frogs gay," was widely mocked online and became an internet meme. This idea was later revived by attorney and anti-vaccine activist Robert F. Kennedy Jr., who claimed that gender dysphoria in children might be linked to atrazine contamination of water. Kennedy's theory was criticized in various media outlets. Scientific consensus, as summarized in a 2016 review in Psychological Science in the Public Interest, is that there is "no persuasive evidence that the rate of same-sex attraction has varied much across time or place". In contrast to claims about chemicals in the water, the effects of hormones on sexual orientation appear to occur at the prenatal stage, during organization of the brain. Endocrine disruptor exposure during fetal development has been shown to affect sexual differentiation of the brain in animals, however any effect on human sexual orientation or gender identity requires further research. See also 2020s anti-LGBT movement in the United States Acquired homosexuality Anti-gender movement Anti-LGBT rhetoric Far-right politics in the United States Frogs in culture Gay agenda Gay bomb Health effects of Atrazine Homophobia List of conspiracy theories List of topics characterized as pseudoscience Post-truth politics Transphobia References External links "'They're Turning the Frogs Gay': the Psychology Behind Internet Conspiracy Theories – New Statesman 2015 controversies in the United States 2016 controversies in the United States 2017 controversies in the United States 2018 controversies in the United States 2019 controversies in the United States 2020 controversies in the United States 2021 controversies in the United States 2022 controversies in the United States 2023 controversies in the United States 2015 in LGBT history 2016 in LGBT history 2017 in LGBT history 2018 in LGBT history 2019 in LGBT history 2020 in LGBT history 2021 in LGBT history 2022 in LGBT history 2023 in LGBT history 2010s in LGBT history 2020s in LGBT history 2020s anti-LGBT movement in the United States Alex Jones Alt-right Animals in politics Conspiracy theories in the United States Conservatism in the United States Far-right politics in the United States Frogs in culture Homophobia LGBT-related conspiracy theories Political Internet memes Pseudoscience Robert F. Kennedy Jr. Transphobia
```asciidoc // // Common Valid Usage // Common to dynamic state commands introduced by VK_EXT_extended_dynamic_state * [[VUID-{refpage}-None-08971]] At least one of the following must: be true: ifdef::VK_EXT_extended_dynamic_state[] ** the <<features-extendedDynamicState, pname:extendedDynamicState>> feature is enabled endif::VK_EXT_extended_dynamic_state[] ifdef::VK_EXT_shader_object[] ** the <<features-shaderObject, pname:shaderObject>> feature is enabled endif::VK_EXT_shader_object[] ifdef::VK_VERSION_1_3[] ** the value of slink:VkApplicationInfo::pname:apiVersion used to create the slink:VkInstance parent of pname:commandBuffer is greater than or equal to Version 1.3 endif::VK_VERSION_1_3[] * [[VUID-{refpage}-multisampledRenderToSingleSampled-07284]] If rasterization is not disabled in the bound graphics pipeline, ifdef::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] and none of the following is enabled: ifdef::VK_AMD_mixed_attachment_samples[] ** the `apiext:VK_AMD_mixed_attachment_samples` extension endif::VK_AMD_mixed_attachment_samples[] ifdef::VK_NV_framebuffer_mixed_samples[] ** the `apiext:VK_NV_framebuffer_mixed_samples` extension endif::VK_NV_framebuffer_mixed_samples[] ifdef::VK_EXT_multisampled_render_to_single_sampled[] ** the <<features-multisampledRenderToSingleSampled, pname:multisampledRenderToSingleSampled>> feature endif::VK_EXT_multisampled_render_to_single_sampled[] endif::VK_AMD_mixed_attachment_samples,VK_NV_framebuffer_mixed_samples,VK_EXT_multisampled_render_to_single_sampled[] + then pname:rasterizationSamples for the currently bound graphics pipeline must: be the same as the current subpass color and/or depth/stencil attachments * Some VU that follows // Common Valid Usage ```
```ruby require 'spec_helper' module PyCall module LibPython ::RSpec.describe Helpers do describe '.import_module' do it 'is a wrapper method of PyImport_ImportModule' end describe '.getattr' do it 'is a wrapper method of PyObject_GetAttrString' do builtins_ptr = LibPython::API.builtins_module_ptr expect(Helpers.getattr(builtins_ptr, :object)).to be_a(PyCall::PyTypeObjectWrapper) expect { Helpers.getattr(builtins_ptr, :non_existing_name) }.to raise_error(PyCall::PyError) default_value = Object.new expect(Helpers.getattr(builtins_ptr, :non_existing_name, default_value)).to eq(default_value) end end describe '.hasattr?' do it 'is a wrapper method of PyObject_HasAttrString' do builtins_ptr = LibPython::API.builtins_module_ptr expect(Helpers.hasattr?(builtins_ptr, :object)).to eq(true) expect(Helpers.hasattr?(builtins_ptr, :non_existing_name)).to eq(false) end end describe '.define_wrapper_method' do it 'defines a wrapper method of a instance method of a Python object' end end end end ```
```javascript // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: path_to_url (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); else if (typeof define == "function" && define.amd) // AMD define(["../../lib/codemirror"], mod); else // Plain browser env mod(CodeMirror); })(function(CodeMirror) { "use strict"; CodeMirror.defineMode("haxe", function(config, parserConfig) { var indentUnit = config.indentUnit; // Tokenizer function kw(type) {return {type: type, style: "keyword"};} var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); var operator = kw("operator"), atom = {type: "atom", style: "atom"}, attribute = {type:"attribute", style: "attribute"}; var type = kw("typedef"); var keywords = { "if": A, "while": A, "else": B, "do": B, "try": B, "return": C, "break": C, "continue": C, "new": C, "throw": C, "var": kw("var"), "inline":attribute, "static": attribute, "using":kw("import"), "public": attribute, "private": attribute, "cast": kw("cast"), "import": kw("import"), "macro": kw("macro"), "function": kw("function"), "catch": kw("catch"), "untyped": kw("untyped"), "callback": kw("cb"), "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), "in": operator, "never": kw("property_access"), "trace":kw("trace"), "class": type, "abstract":type, "enum":type, "interface":type, "typedef":type, "extends":type, "implements":type, "dynamic":type, "true": atom, "false": atom, "null": atom }; var isOperatorChar = /[+\-*&%=<>!?|]/; function chain(stream, state, f) { state.tokenize = f; return f(stream, state); } function toUnescaped(stream, end) { var escaped = false, next; while ((next = stream.next()) != null) { if (next == end && !escaped) return true; escaped = !escaped && next == "\\"; } } // Used as scratch variables to communicate multiple values without // consing up tons of objects. var type, content; function ret(tp, style, cont) { type = tp; content = cont; return style; } function haxeTokenBase(stream, state) { var ch = stream.next(); if (ch == '"' || ch == "'") { return chain(stream, state, haxeTokenString(ch)); } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { return ret(ch); } else if (ch == "0" && stream.eat(/x/i)) { stream.eatWhile(/[\da-f]/i); return ret("number", "number"); } else if (/\d/.test(ch) || ch == "-" && stream.eat(/\d/)) { stream.match(/^\d*(?:\.\d*(?!\.))?(?:[eE][+\-]?\d+)?/); return ret("number", "number"); } else if (state.reAllowed && (ch == "~" && stream.eat(/\//))) { toUnescaped(stream, "/"); stream.eatWhile(/[gimsu]/); return ret("regexp", "string-2"); } else if (ch == "/") { if (stream.eat("*")) { return chain(stream, state, haxeTokenComment); } else if (stream.eat("/")) { stream.skipToEnd(); return ret("comment", "comment"); } else { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); } } else if (ch == "#") { stream.skipToEnd(); return ret("conditional", "meta"); } else if (ch == "@") { stream.eat(/:/); stream.eatWhile(/[\w_]/); return ret ("metadata", "meta"); } else if (isOperatorChar.test(ch)) { stream.eatWhile(isOperatorChar); return ret("operator", null, stream.current()); } else { var word; if(/[A-Z]/.test(ch)) { stream.eatWhile(/[\w_<>]/); word = stream.current(); return ret("type", "variable-3", word); } else { stream.eatWhile(/[\w_]/); var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; return (known && state.kwAllowed) ? ret(known.type, known.style, word) : ret("variable", "variable", word); } } } function haxeTokenString(quote) { return function(stream, state) { if (toUnescaped(stream, quote)) state.tokenize = haxeTokenBase; return ret("string", "string"); }; } function haxeTokenComment(stream, state) { var maybeEnd = false, ch; while (ch = stream.next()) { if (ch == "/" && maybeEnd) { state.tokenize = haxeTokenBase; break; } maybeEnd = (ch == "*"); } return ret("comment", "comment"); } // Parser var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true}; function HaxeLexical(indented, column, type, align, prev, info) { this.indented = indented; this.column = column; this.type = type; this.prev = prev; this.info = info; if (align != null) this.align = align; } function inScope(state, varname) { for (var v = state.localVars; v; v = v.next) if (v.name == varname) return true; } function parseHaxe(state, style, type, content, stream) { var cc = state.cc; // Communicate our context to the combinators. // (Less wasteful than consing up a hundred closures on every call.) cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; if (!state.lexical.hasOwnProperty("align")) state.lexical.align = true; while(true) { var combinator = cc.length ? cc.pop() : statement; if (combinator(type, content)) { while(cc.length && cc[cc.length - 1].lex) cc.pop()(); if (cx.marked) return cx.marked; if (type == "variable" && inScope(state, content)) return "variable-2"; if (type == "variable" && imported(state, content)) return "variable-3"; return style; } } } function imported(state, typename) { if (/[a-z]/.test(typename.charAt(0))) return false; var len = state.importedtypes.length; for (var i = 0; i<len; i++) if(state.importedtypes[i]==typename) return true; } function registerimport(importname) { var state = cx.state; for (var t = state.importedtypes; t; t = t.next) if(t.name == importname) return; state.importedtypes = { name: importname, next: state.importedtypes }; } // Combinator utils var cx = {state: null, column: null, marked: null, cc: null}; function pass() { for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); } function cont() { pass.apply(null, arguments); return true; } function inList(name, list) { for (var v = list; v; v = v.next) if (v.name == name) return true; return false; } function register(varname) { var state = cx.state; if (state.context) { cx.marked = "def"; if (inList(varname, state.localVars)) return; state.localVars = {name: varname, next: state.localVars}; } else if (state.globalVars) { if (inList(varname, state.globalVars)) return; state.globalVars = {name: varname, next: state.globalVars}; } } // Combinators var defaultVars = {name: "this", next: null}; function pushcontext() { if (!cx.state.context) cx.state.localVars = defaultVars; cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; } function popcontext() { cx.state.localVars = cx.state.context.vars; cx.state.context = cx.state.context.prev; } popcontext.lex = true; function pushlex(type, info) { var result = function() { var state = cx.state; state.lexical = new HaxeLexical(state.indented, cx.stream.column(), type, null, state.lexical, info); }; result.lex = true; return result; } function poplex() { var state = cx.state; if (state.lexical.prev) { if (state.lexical.type == ")") state.indented = state.lexical.indented; state.lexical = state.lexical.prev; } } poplex.lex = true; function expect(wanted) { function f(type) { if (type == wanted) return cont(); else if (wanted == ";") return pass(); else return cont(f); } return f; } function statement(type) { if (type == "@") return cont(metadef); if (type == "var") return cont(pushlex("vardef"), vardef1, expect(";"), poplex); if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); if (type == "keyword b") return cont(pushlex("form"), statement, poplex); if (type == "{") return cont(pushlex("}"), pushcontext, block, poplex, popcontext); if (type == ";") return cont(); if (type == "attribute") return cont(maybeattribute); if (type == "function") return cont(functiondef); if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"), poplex, statement, poplex); if (type == "variable") return cont(pushlex("stat"), maybelabel); if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), block, poplex, poplex); if (type == "case") return cont(expression, expect(":")); if (type == "default") return cont(expect(":")); if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), statement, poplex, popcontext); if (type == "import") return cont(importdef, expect(";")); if (type == "typedef") return cont(typedef); return pass(pushlex("stat"), expression, expect(";"), poplex); } function expression(type) { if (atomicTypes.hasOwnProperty(type)) return cont(maybeoperator); if (type == "type" ) return cont(maybeoperator); if (type == "function") return cont(functiondef); if (type == "keyword c") return cont(maybeexpression); if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeoperator); if (type == "operator") return cont(expression); if (type == "[") return cont(pushlex("]"), commasep(maybeexpression, "]"), poplex, maybeoperator); if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator); return cont(); } function maybeexpression(type) { if (type.match(/[;\}\)\],]/)) return pass(); return pass(expression); } function maybeoperator(type, value) { if (type == "operator" && /\+\+|--/.test(value)) return cont(maybeoperator); if (type == "operator" || type == ":") return cont(expression); if (type == ";") return; if (type == "(") return cont(pushlex(")"), commasep(expression, ")"), poplex, maybeoperator); if (type == ".") return cont(property, maybeoperator); if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator); } function maybeattribute(type) { if (type == "attribute") return cont(maybeattribute); if (type == "function") return cont(functiondef); if (type == "var") return cont(vardef1); } function metadef(type) { if(type == ":") return cont(metadef); if(type == "variable") return cont(metadef); if(type == "(") return cont(pushlex(")"), commasep(metaargs, ")"), poplex, statement); } function metaargs(type) { if(type == "variable") return cont(); } function importdef (type, value) { if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } else if(type == "variable" || type == "property" || type == "." || value == "*") return cont(importdef); } function typedef (type, value) { if(type == "variable" && /[A-Z]/.test(value.charAt(0))) { registerimport(value); return cont(); } else if (type == "type" && /[A-Z]/.test(value.charAt(0))) { return cont(); } } function maybelabel(type) { if (type == ":") return cont(poplex, statement); return pass(maybeoperator, expect(";"), poplex); } function property(type) { if (type == "variable") {cx.marked = "property"; return cont();} } function objprop(type) { if (type == "variable") cx.marked = "property"; if (atomicTypes.hasOwnProperty(type)) return cont(expect(":"), expression); } function commasep(what, end) { function proceed(type) { if (type == ",") return cont(what, proceed); if (type == end) return cont(); return cont(expect(end)); } return function(type) { if (type == end) return cont(); else return pass(what, proceed); }; } function block(type) { if (type == "}") return cont(); return pass(statement, block); } function vardef1(type, value) { if (type == "variable"){register(value); return cont(typeuse, vardef2);} return cont(); } function vardef2(type, value) { if (value == "=") return cont(expression, vardef2); if (type == ",") return cont(vardef1); } function forspec1(type, value) { if (type == "variable") { register(value); return cont(forin, expression) } else { return pass() } } function forin(_type, value) { if (value == "in") return cont(); } function functiondef(type, value) { //function names starting with upper-case letters are recognised as types, so cludging them together here. if (type == "variable" || type == "type") {register(value); return cont(functiondef);} if (value == "new") return cont(functiondef); if (type == "(") return cont(pushlex(")"), pushcontext, commasep(funarg, ")"), poplex, typeuse, statement, popcontext); } function typeuse(type) { if(type == ":") return cont(typestring); } function typestring(type) { if(type == "type") return cont(); if(type == "variable") return cont(); if(type == "{") return cont(pushlex("}"), commasep(typeprop, "}"), poplex); } function typeprop(type) { if(type == "variable") return cont(typeuse); } function funarg(type, value) { if (type == "variable") {register(value); return cont(typeuse);} } // Interface return { startState: function(basecolumn) { var defaulttypes = ["Int", "Float", "String", "Void", "Std", "Bool", "Dynamic", "Array"]; var state = { tokenize: haxeTokenBase, reAllowed: true, kwAllowed: true, cc: [], lexical: new HaxeLexical((basecolumn || 0) - indentUnit, 0, "block", false), localVars: parserConfig.localVars, importedtypes: defaulttypes, context: parserConfig.localVars && {vars: parserConfig.localVars}, indented: 0 }; if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") state.globalVars = parserConfig.globalVars; return state; }, token: function(stream, state) { if (stream.sol()) { if (!state.lexical.hasOwnProperty("align")) state.lexical.align = false; state.indented = stream.indentation(); } if (stream.eatSpace()) return null; var style = state.tokenize(stream, state); if (type == "comment") return style; state.reAllowed = !!(type == "operator" || type == "keyword c" || type.match(/^[\[{}\(,;:]$/)); state.kwAllowed = type != '.'; return parseHaxe(state, style, type, content, stream); }, indent: function(state, textAfter) { if (state.tokenize != haxeTokenBase) return 0; var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; var type = lexical.type, closing = firstChar == type; if (type == "vardef") return lexical.indented + 4; else if (type == "form" && firstChar == "{") return lexical.indented; else if (type == "stat" || type == "form") return lexical.indented + indentUnit; else if (lexical.info == "switch" && !closing) return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); else if (lexical.align) return lexical.column + (closing ? 0 : 1); else return lexical.indented + (closing ? 0 : indentUnit); }, electricChars: "{}", blockCommentStart: "/*", blockCommentEnd: "*/", lineComment: "//" }; }); CodeMirror.defineMIME("text/x-haxe", "haxe"); CodeMirror.defineMode("hxml", function () { return { startState: function () { return { define: false, inString: false }; }, token: function (stream, state) { var ch = stream.peek(); var sol = stream.sol(); ///* comments */ if (ch == "#") { stream.skipToEnd(); return "comment"; } if (sol && ch == "-") { var style = "variable-2"; stream.eat(/-/); if (stream.peek() == "-") { stream.eat(/-/); style = "keyword a"; } if (stream.peek() == "D") { stream.eat(/[D]/); style = "keyword c"; state.define = true; } stream.eatWhile(/[A-Z]/i); return style; } var ch = stream.peek(); if (state.inString == false && ch == "'") { state.inString = true; ch = stream.next(); } if (state.inString == true) { if (stream.skipTo("'")) { } else { stream.skipToEnd(); } if (stream.peek() == "'") { stream.next(); state.inString = false; } return "string"; } stream.next(); return null; }, lineComment: "#" }; }); CodeMirror.defineMIME("text/x-hxml", "hxml"); }); ```
```go // Package adder implements functionality to add content to IPFS daemons // managed by the Cluster. package adder import ( "context" "errors" "fmt" "io" "mime/multipart" "strings" "github.com/ipfs-cluster/ipfs-cluster/adder/ipfsadd" "github.com/ipfs-cluster/ipfs-cluster/api" "github.com/ipfs/boxo/ipld/unixfs" "github.com/ipld/go-car" peer "github.com/libp2p/go-libp2p/core/peer" files "github.com/ipfs/boxo/files" merkledag "github.com/ipfs/boxo/ipld/merkledag" cid "github.com/ipfs/go-cid" ipld "github.com/ipfs/go-ipld-format" ipldlegacy "github.com/ipfs/go-ipld-legacy" logging "github.com/ipfs/go-log/v2" dagpb "github.com/ipld/go-codec-dagpb" "github.com/ipld/go-ipld-prime/codec/dagcbor" "github.com/ipld/go-ipld-prime/codec/raw" cidlink "github.com/ipld/go-ipld-prime/linking/cid" "github.com/ipld/go-ipld-prime/multicodec" "github.com/ipld/go-ipld-prime/node/basicnode" multihash "github.com/multiformats/go-multihash" ) var logger = logging.Logger("adder") var ipldDecoder *ipldlegacy.Decoder // create an ipld registry specific to this package func init() { mcReg := multicodec.Registry{} mcReg.RegisterDecoder(cid.DagProtobuf, dagpb.Decode) mcReg.RegisterDecoder(cid.Raw, raw.Decode) mcReg.RegisterDecoder(cid.DagCBOR, dagcbor.Decode) ls := cidlink.LinkSystemUsingMulticodecRegistry(mcReg) ipldDecoder = ipldlegacy.NewDecoderWithLS(ls) ipldDecoder.RegisterCodec(cid.DagProtobuf, dagpb.Type.PBNode, merkledag.ProtoNodeConverter) ipldDecoder.RegisterCodec(cid.Raw, basicnode.Prototype.Bytes, merkledag.RawNodeConverter) } // ClusterDAGService is an implementation of ipld.DAGService plus a Finalize // method. ClusterDAGServices can be used to provide Adders with a different // add implementation. type ClusterDAGService interface { ipld.DAGService // Finalize receives the IPFS content root CID as // returned by the ipfs adder. Finalize(ctx context.Context, ipfsRoot api.Cid) (api.Cid, error) // Close performs any necessary cleanups and should be called // whenever the DAGService is not going to be used anymore. Close() error // Allocations returns the allocations made by the cluster DAG service // for the added content. Allocations() []peer.ID } // A dagFormatter can create dags from files.Node. It can keep state // to add several files to the same dag. type dagFormatter interface { Add(name string, f files.Node) (api.Cid, error) } // Adder is used to add content to IPFS Cluster using an implementation of // ClusterDAGService. type Adder struct { ctx context.Context cancel context.CancelFunc dgs ClusterDAGService params api.AddParams // AddedOutput updates are placed on this channel // whenever a block is processed. They contain information // about the block, the CID, the Name etc. and are mostly // meant to be streamed back to the user. output chan api.AddedOutput } // New returns a new Adder with the given ClusterDAGService, add options and a // channel to send updates during the adding process. // // An Adder may only be used once. func New(ds ClusterDAGService, p api.AddParams, out chan api.AddedOutput) *Adder { // Discard all progress update output as the caller has not provided // a channel for them to listen on. if out == nil { out = make(chan api.AddedOutput, 100) go func() { for range out { } }() } return &Adder{ dgs: ds, params: p, output: out, } } func (a *Adder) setContext(ctx context.Context) { if a.ctx == nil { // only allows first context ctxc, cancel := context.WithCancel(ctx) a.ctx = ctxc a.cancel = cancel } } // FromMultipart adds content from a multipart.Reader. The adder will // no longer be usable after calling this method. func (a *Adder) FromMultipart(ctx context.Context, r *multipart.Reader) (api.Cid, error) { logger.Debugf("adding from multipart with params: %+v", a.params) f, err := files.NewFileFromPartReader(r, "multipart/form-data") if err != nil { return api.CidUndef, err } defer f.Close() return a.FromFiles(ctx, f) } // FromFiles adds content from a files.Directory. The adder will no longer // be usable after calling this method. func (a *Adder) FromFiles(ctx context.Context, f files.Directory) (api.Cid, error) { logger.Debug("adding from files") a.setContext(ctx) if a.ctx.Err() != nil { // don't allow running twice return api.CidUndef, a.ctx.Err() } defer a.cancel() defer close(a.output) var dagFmtr dagFormatter var err error switch a.params.Format { case "", "unixfs": dagFmtr, err = newIpfsAdder(ctx, a.dgs, a.params, a.output) case "car": dagFmtr, err = newCarAdder(ctx, a.dgs, a.params, a.output) default: err = errors.New("bad dag formatter option") } if err != nil { return api.CidUndef, err } // setup wrapping if a.params.Wrap { f = files.NewSliceDirectory( []files.DirEntry{files.FileEntry("", f)}, ) } it := f.Entries() var adderRoot api.Cid for it.Next() { select { case <-a.ctx.Done(): return api.CidUndef, a.ctx.Err() default: logger.Debugf("ipfsAdder AddFile(%s)", it.Name()) adderRoot, err = dagFmtr.Add(it.Name(), it.Node()) if err != nil { logger.Error("error adding to cluster: ", err) return api.CidUndef, err } } // TODO (hector): We can only add a single CAR file for the // moment. if a.params.Format == "car" { break } } if it.Err() != nil { return api.CidUndef, it.Err() } clusterRoot, err := a.dgs.Finalize(a.ctx, adderRoot) if err != nil { logger.Error("error finalizing adder:", err) return api.CidUndef, err } logger.Infof("%s successfully added to cluster", clusterRoot) return clusterRoot, nil } // A wrapper around the ipfsadd.Adder to satisfy the dagFormatter interface. type ipfsAdder struct { *ipfsadd.Adder } func newIpfsAdder(ctx context.Context, dgs ClusterDAGService, params api.AddParams, out chan api.AddedOutput) (*ipfsAdder, error) { iadder, err := ipfsadd.NewAdder(ctx, dgs, dgs.Allocations) if err != nil { logger.Error(err) return nil, err } iadder.Trickle = params.Layout == "trickle" iadder.RawLeaves = params.RawLeaves iadder.Chunker = params.Chunker iadder.Out = out iadder.Progress = params.Progress iadder.NoCopy = params.NoCopy // Set up prefi prefix, err := merkledag.PrefixForCidVersion(params.CidVersion) if err != nil { return nil, fmt.Errorf("bad CID Version: %s", err) } hashFunCode, ok := multihash.Names[strings.ToLower(params.HashFun)] if !ok { return nil, errors.New("hash function name not known") } prefix.MhType = hashFunCode prefix.MhLength = -1 iadder.CidBuilder = &prefix return &ipfsAdder{ Adder: iadder, }, nil } func (ia *ipfsAdder) Add(name string, f files.Node) (api.Cid, error) { // In order to set the AddedOutput names right, we use // OutputPrefix: // // When adding a folder, this is the root folder name which is // prepended to the addedpaths. When adding a single file, // this is the name of the file which overrides the empty // AddedOutput name. // // After coreunix/add.go was refactored in go-ipfs and we // followed suit, it no longer receives the name of the // file/folder being added and does not emit AddedOutput // events with the right names. We addressed this by adding // OutputPrefix to our version. go-ipfs modifies emitted // events before sending to user). ia.OutputPrefix = name nd, err := ia.AddAllAndPin(f) if err != nil { return api.CidUndef, err } return api.NewCid(nd.Cid()), nil } // An adder to add CAR files. It is at the moment very basic, and can // add a single CAR file with a single root. Ideally, it should be able to // add more complex, or several CARs by wrapping them with a single root. // But for that we would need to keep state and track an MFS root similarly to // what the ipfsadder does. type carAdder struct { ctx context.Context dgs ClusterDAGService params api.AddParams output chan api.AddedOutput } func newCarAdder(ctx context.Context, dgs ClusterDAGService, params api.AddParams, out chan api.AddedOutput) (*carAdder, error) { return &carAdder{ ctx: ctx, dgs: dgs, params: params, output: out, }, nil } // Add takes a node which should be a CAR file and nothing else and // adds its blocks using the ClusterDAGService. func (ca *carAdder) Add(name string, fn files.Node) (api.Cid, error) { if ca.params.Wrap { return api.CidUndef, errors.New("cannot wrap a CAR file upload") } f, ok := fn.(files.File) if !ok { return api.CidUndef, errors.New("expected CAR file is not of type file") } carReader, err := car.NewCarReader(f) if err != nil { return api.CidUndef, err } if len(carReader.Header.Roots) != 1 { return api.CidUndef, errors.New("only CAR files with a single root are supported") } root := carReader.Header.Roots[0] bytes := uint64(0) size := uint64(0) for { block, err := carReader.Next() if err != nil && err != io.EOF { return api.CidUndef, err } else if block == nil { break } bytes += uint64(len(block.RawData())) nd, err := ipldDecoder.DecodeNode(context.TODO(), block) if err != nil { return api.CidUndef, err } // If the root is in the CAR and the root is a UnixFS // node, then set the size in the output object. if nd.Cid().Equals(root) { ufs, err := unixfs.ExtractFSNode(nd) if err == nil { size = ufs.FileSize() } } err = ca.dgs.Add(ca.ctx, nd) if err != nil { return api.CidUndef, err } } ca.output <- api.AddedOutput{ Name: name, Cid: api.NewCid(root), Bytes: bytes, Size: size, Allocations: ca.dgs.Allocations(), } return api.NewCid(root), nil } ```
```objective-c /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: set ts=8 sts=4 et sw=4 tw=99: * This Source Code Form is subject to the terms of the Mozilla Public * file, You can obtain one at path_to_url */ #ifndef prmjtime_h #define prmjtime_h #include <stddef.h> #include <stdint.h> /* * Broken down form of 64 bit time value. */ struct PRMJTime { int32_t tm_usec; /* microseconds of second (0-999999) */ int8_t tm_sec; /* seconds of minute (0-59) */ int8_t tm_min; /* minutes of hour (0-59) */ int8_t tm_hour; /* hour of day (0-23) */ int8_t tm_mday; /* day of month (1-31) */ int8_t tm_mon; /* month of year (0-11) */ int8_t tm_wday; /* 0=sunday, 1=monday, ... */ int32_t tm_year; /* absolute year, AD */ int16_t tm_yday; /* day of year (0 to 365) */ int8_t tm_isdst; /* non-zero if DST in effect */ }; /* Some handy constants */ #define PRMJ_USEC_PER_SEC 1000000L #define PRMJ_USEC_PER_MSEC 1000L /* Return the current local time in micro-seconds */ extern int64_t PRMJ_Now(); /* Initialize the resources associated with PRMJ_Now. */ #if defined(XP_WIN) extern void PRMJ_NowInit(); #else inline void PRMJ_NowInit() {} #endif /* Release the resources associated with PRMJ_Now; don't call PRMJ_Now again */ #ifdef XP_WIN extern void PRMJ_NowShutdown(); #else inline void PRMJ_NowShutdown() {} #endif /* Format a time value into a buffer. Same semantics as strftime() */ extern size_t PRMJ_FormatTime(char* buf, int buflen, const char* fmt, PRMJTime* tm); #endif /* prmjtime_h */ ```
```c /* * * This file is part of FFmpeg. * * FFmpeg is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * * FFmpeg is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * * You should have received a copy of the GNU Lesser General Public * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ /** * @file * simple media player based on the FFmpeg libraries */ #include "config.h" #include <inttypes.h> #include <math.h> #include <limits.h> #include <signal.h> #include <stdint.h> #include "libavutil/avstring.h" #include "libavutil/eval.h" #include "libavutil/mathematics.h" #include "libavutil/pixdesc.h" #include "libavutil/imgutils.h" #include "libavutil/dict.h" #include "libavutil/parseutils.h" #include "libavutil/samplefmt.h" #include "libavutil/avassert.h" #include "libavutil/time.h" #include "libavformat/avformat.h" #include "libavdevice/avdevice.h" #include "libswscale/swscale.h" #include "libavutil/opt.h" #include "libavcodec/avfft.h" #include "libswresample/swresample.h" #if CONFIG_AVFILTER # include "libavfilter/avfilter.h" # include "libavfilter/buffersink.h" # include "libavfilter/buffersrc.h" #endif #include <SDL.h> #include <SDL_thread.h> #include "cmdutils.h" #include <assert.h> const char program_name[] = "ffplay"; const int program_birth_year = 2003; #define MAX_QUEUE_SIZE (15 * 1024 * 1024) #define MIN_FRAMES 25 #define EXTERNAL_CLOCK_MIN_FRAMES 2 #define EXTERNAL_CLOCK_MAX_FRAMES 10 /* Minimum SDL audio buffer size, in samples. */ #define SDL_AUDIO_MIN_BUFFER_SIZE 512 /* Calculate actual buffer size keeping in mind not cause too frequent audio callbacks */ #define SDL_AUDIO_MAX_CALLBACKS_PER_SEC 30 /* Step size for volume control */ #define SDL_VOLUME_STEP (SDL_MIX_MAXVOLUME / 50) /* no AV sync correction is done if below the minimum AV sync threshold */ #define AV_SYNC_THRESHOLD_MIN 0.04 /* AV sync correction is done if above the maximum AV sync threshold */ #define AV_SYNC_THRESHOLD_MAX 0.1 /* If a frame duration is longer than this, it will not be duplicated to compensate AV sync */ #define AV_SYNC_FRAMEDUP_THRESHOLD 0.1 /* no AV correction is done if too big error */ #define AV_NOSYNC_THRESHOLD 10.0 /* maximum audio speed change to get correct sync */ #define SAMPLE_CORRECTION_PERCENT_MAX 10 /* external clock speed adjustment constants for realtime sources based on buffer fullness */ #define EXTERNAL_CLOCK_SPEED_MIN 0.900 #define EXTERNAL_CLOCK_SPEED_MAX 1.010 #define EXTERNAL_CLOCK_SPEED_STEP 0.001 /* we use about AUDIO_DIFF_AVG_NB A-V differences to make the average */ #define AUDIO_DIFF_AVG_NB 20 /* polls for possible required screen refresh at least this often, should be less than 1/fps */ #define REFRESH_RATE 0.01 /* NOTE: the size must be big enough to compensate the hardware audio buffersize size */ /* TODO: We assume that a decoded and resampled frame fits into this buffer */ #define SAMPLE_ARRAY_SIZE (8 * 65536) #define CURSOR_HIDE_DELAY 1000000 #define USE_ONEPASS_SUBTITLE_RENDER 1 static unsigned sws_flags = SWS_BICUBIC; typedef struct MyAVPacketList { AVPacket pkt; struct MyAVPacketList *next; int serial; } MyAVPacketList; typedef struct PacketQueue { MyAVPacketList *first_pkt, *last_pkt; int nb_packets; int size; int64_t duration; int abort_request; int serial; SDL_mutex *mutex; SDL_cond *cond; } PacketQueue; #define VIDEO_PICTURE_QUEUE_SIZE 3 #define SUBPICTURE_QUEUE_SIZE 16 #define SAMPLE_QUEUE_SIZE 9 #define FRAME_QUEUE_SIZE FFMAX(SAMPLE_QUEUE_SIZE, FFMAX(VIDEO_PICTURE_QUEUE_SIZE, SUBPICTURE_QUEUE_SIZE)) typedef struct AudioParams { int freq; int channels; int64_t channel_layout; enum AVSampleFormat fmt; int frame_size; int bytes_per_sec; } AudioParams; typedef struct Clock { double pts; /* clock base */ double pts_drift; /* clock base minus time at which we updated the clock */ double last_updated; double speed; int serial; /* clock is based on a packet with this serial */ int paused; int *queue_serial; /* pointer to the current packet queue serial, used for obsolete clock detection */ } Clock; /* Common struct for handling all types of decoded data and allocated render buffers. */ typedef struct Frame { AVFrame *frame; AVSubtitle sub; int serial; double pts; /* presentation timestamp for the frame */ double duration; /* estimated duration of the frame */ int64_t pos; /* byte position of the frame in the input file */ SDL_Texture *bmp; int allocated; int width; int height; int format; AVRational sar; int uploaded; } Frame; typedef struct FrameQueue { Frame queue[FRAME_QUEUE_SIZE]; int rindex; int windex; int size; int max_size; int keep_last; int rindex_shown; SDL_mutex *mutex; SDL_cond *cond; PacketQueue *pktq; } FrameQueue; enum { AV_SYNC_AUDIO_MASTER, /* default choice */ AV_SYNC_VIDEO_MASTER, AV_SYNC_EXTERNAL_CLOCK, /* synchronize to an external clock */ }; typedef struct Decoder { AVPacket pkt; AVPacket pkt_temp; PacketQueue *queue; AVCodecContext *avctx; int pkt_serial; int finished; int packet_pending; SDL_cond *empty_queue_cond; int64_t start_pts; AVRational start_pts_tb; int64_t next_pts; AVRational next_pts_tb; SDL_Thread *decoder_tid; } Decoder; typedef struct VideoState { SDL_Thread *read_tid; AVInputFormat *iformat; int abort_request; int force_refresh; int paused; int last_paused; int queue_attachments_req; int seek_req; int seek_flags; int64_t seek_pos; int64_t seek_rel; int read_pause_return; AVFormatContext *ic; int realtime; Clock audclk; Clock vidclk; Clock extclk; FrameQueue pictq; FrameQueue subpq; FrameQueue sampq; Decoder auddec; Decoder viddec; Decoder subdec; int audio_stream; int av_sync_type; double audio_clock; int audio_clock_serial; double audio_diff_cum; /* used for AV difference average computation */ double audio_diff_avg_coef; double audio_diff_threshold; int audio_diff_avg_count; AVStream *audio_st; PacketQueue audioq; int audio_hw_buf_size; uint8_t *audio_buf; uint8_t *audio_buf1; unsigned int audio_buf_size; /* in bytes */ unsigned int audio_buf1_size; int audio_buf_index; /* in bytes */ int audio_write_buf_size; int audio_volume; int muted; struct AudioParams audio_src; #if CONFIG_AVFILTER struct AudioParams audio_filter_src; #endif struct AudioParams audio_tgt; struct SwrContext *swr_ctx; int frame_drops_early; int frame_drops_late; enum ShowMode { SHOW_MODE_NONE = -1, SHOW_MODE_VIDEO = 0, SHOW_MODE_WAVES, SHOW_MODE_RDFT, SHOW_MODE_NB } show_mode; int16_t sample_array[SAMPLE_ARRAY_SIZE]; int sample_array_index; int last_i_start; RDFTContext *rdft; int rdft_bits; FFTSample *rdft_data; int xpos; double last_vis_time; SDL_Texture *vis_texture; SDL_Texture *sub_texture; int subtitle_stream; AVStream *subtitle_st; PacketQueue subtitleq; double frame_timer; double frame_last_returned_time; double frame_last_filter_delay; int video_stream; AVStream *video_st; PacketQueue videoq; double max_frame_duration; // maximum duration of a frame - above this, we consider the jump a timestamp discontinuity struct SwsContext *img_convert_ctx; struct SwsContext *sub_convert_ctx; int eof; char *filename; int width, height, xleft, ytop; int step; #if CONFIG_AVFILTER int vfilter_idx; AVFilterContext *in_video_filter; // the first filter in the video chain AVFilterContext *out_video_filter; // the last filter in the video chain AVFilterContext *in_audio_filter; // the first filter in the audio chain AVFilterContext *out_audio_filter; // the last filter in the audio chain AVFilterGraph *agraph; // audio filter graph #endif int last_video_stream, last_audio_stream, last_subtitle_stream; SDL_cond *continue_read_thread; } VideoState; /* options specified by the user */ static AVInputFormat *file_iformat; static const char *input_filename; static const char *window_title; static int default_width = 640; static int default_height = 480; static int screen_width = 0; static int screen_height = 0; static int audio_disable; static int video_disable; static int subtitle_disable; static const char* wanted_stream_spec[AVMEDIA_TYPE_NB] = {0}; static int seek_by_bytes = -1; static int display_disable; static int show_status = 1; static int av_sync_type = AV_SYNC_AUDIO_MASTER; static int64_t start_time = AV_NOPTS_VALUE; static int64_t duration = AV_NOPTS_VALUE; static int fast = 0; static int genpts = 0; static int lowres = 0; static int decoder_reorder_pts = -1; static int autoexit; static int exit_on_keydown; static int exit_on_mousedown; static int loop = 1; static int framedrop = -1; static int infinite_buffer = -1; static enum ShowMode show_mode = SHOW_MODE_NONE; static const char *audio_codec_name; static const char *subtitle_codec_name; static const char *video_codec_name; double rdftspeed = 0.02; static int64_t cursor_last_shown; static int cursor_hidden = 0; #if CONFIG_AVFILTER static const char **vfilters_list = NULL; static int nb_vfilters = 0; static char *afilters = NULL; #endif static int autorotate = 1; /* current context */ static int is_full_screen; static int64_t audio_callback_time; static AVPacket flush_pkt; #define FF_ALLOC_EVENT (SDL_USEREVENT) #define FF_QUIT_EVENT (SDL_USEREVENT + 2) static SDL_Window *window; static SDL_Renderer *renderer; #if CONFIG_AVFILTER static int opt_add_vfilter(void *optctx, const char *opt, const char *arg) { GROW_ARRAY(vfilters_list, nb_vfilters); vfilters_list[nb_vfilters - 1] = arg; return 0; } #endif static inline int cmp_audio_fmts(enum AVSampleFormat fmt1, int64_t channel_count1, enum AVSampleFormat fmt2, int64_t channel_count2) { /* If channel count == 1, planar and non-planar formats are the same */ if (channel_count1 == 1 && channel_count2 == 1) return av_get_packed_sample_fmt(fmt1) != av_get_packed_sample_fmt(fmt2); else return channel_count1 != channel_count2 || fmt1 != fmt2; } static inline int64_t get_valid_channel_layout(int64_t channel_layout, int channels) { if (channel_layout && av_get_channel_layout_nb_channels(channel_layout) == channels) return channel_layout; else return 0; } static void free_picture(Frame *vp); static int packet_queue_put_private(PacketQueue *q, AVPacket *pkt) { MyAVPacketList *pkt1; if (q->abort_request) return -1; pkt1 = av_malloc(sizeof(MyAVPacketList)); if (!pkt1) return -1; pkt1->pkt = *pkt; pkt1->next = NULL; if (pkt == &flush_pkt) q->serial++; pkt1->serial = q->serial; if (!q->last_pkt) q->first_pkt = pkt1; else q->last_pkt->next = pkt1; q->last_pkt = pkt1; q->nb_packets++; q->size += pkt1->pkt.size + sizeof(*pkt1); q->duration += pkt1->pkt.duration; /* XXX: should duplicate packet data in DV case */ SDL_CondSignal(q->cond); return 0; } static int packet_queue_put(PacketQueue *q, AVPacket *pkt) { int ret; SDL_LockMutex(q->mutex); ret = packet_queue_put_private(q, pkt); SDL_UnlockMutex(q->mutex); if (pkt != &flush_pkt && ret < 0) av_packet_unref(pkt); return ret; } static int packet_queue_put_nullpacket(PacketQueue *q, int stream_index) { AVPacket pkt1, *pkt = &pkt1; av_init_packet(pkt); pkt->data = NULL; pkt->size = 0; pkt->stream_index = stream_index; return packet_queue_put(q, pkt); } /* packet queue handling */ static int packet_queue_init(PacketQueue *q) { memset(q, 0, sizeof(PacketQueue)); q->mutex = SDL_CreateMutex(); if (!q->mutex) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } q->cond = SDL_CreateCond(); if (!q->cond) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } q->abort_request = 1; return 0; } static void packet_queue_flush(PacketQueue *q) { MyAVPacketList *pkt, *pkt1; SDL_LockMutex(q->mutex); for (pkt = q->first_pkt; pkt; pkt = pkt1) { pkt1 = pkt->next; av_packet_unref(&pkt->pkt); av_freep(&pkt); } q->last_pkt = NULL; q->first_pkt = NULL; q->nb_packets = 0; q->size = 0; q->duration = 0; SDL_UnlockMutex(q->mutex); } static void packet_queue_destroy(PacketQueue *q) { packet_queue_flush(q); SDL_DestroyMutex(q->mutex); SDL_DestroyCond(q->cond); } static void packet_queue_abort(PacketQueue *q) { SDL_LockMutex(q->mutex); q->abort_request = 1; SDL_CondSignal(q->cond); SDL_UnlockMutex(q->mutex); } static void packet_queue_start(PacketQueue *q) { SDL_LockMutex(q->mutex); q->abort_request = 0; packet_queue_put_private(q, &flush_pkt); SDL_UnlockMutex(q->mutex); } /* return < 0 if aborted, 0 if no packet and > 0 if packet. */ static int packet_queue_get(PacketQueue *q, AVPacket *pkt, int block, int *serial) { MyAVPacketList *pkt1; int ret; SDL_LockMutex(q->mutex); for (;;) { if (q->abort_request) { ret = -1; break; } pkt1 = q->first_pkt; if (pkt1) { q->first_pkt = pkt1->next; if (!q->first_pkt) q->last_pkt = NULL; q->nb_packets--; q->size -= pkt1->pkt.size + sizeof(*pkt1); q->duration -= pkt1->pkt.duration; *pkt = pkt1->pkt; if (serial) *serial = pkt1->serial; av_free(pkt1); ret = 1; break; } else if (!block) { ret = 0; break; } else { SDL_CondWait(q->cond, q->mutex); } } SDL_UnlockMutex(q->mutex); return ret; } static void decoder_init(Decoder *d, AVCodecContext *avctx, PacketQueue *queue, SDL_cond *empty_queue_cond) { memset(d, 0, sizeof(Decoder)); d->avctx = avctx; d->queue = queue; d->empty_queue_cond = empty_queue_cond; d->start_pts = AV_NOPTS_VALUE; } static int decoder_decode_frame(Decoder *d, AVFrame *frame, AVSubtitle *sub) { int got_frame = 0; do { int ret = -1; if (d->queue->abort_request) return -1; if (!d->packet_pending || d->queue->serial != d->pkt_serial) { AVPacket pkt; do { if (d->queue->nb_packets == 0) SDL_CondSignal(d->empty_queue_cond); if (packet_queue_get(d->queue, &pkt, 1, &d->pkt_serial) < 0) return -1; if (pkt.data == flush_pkt.data) { avcodec_flush_buffers(d->avctx); d->finished = 0; d->next_pts = d->start_pts; d->next_pts_tb = d->start_pts_tb; } } while (pkt.data == flush_pkt.data || d->queue->serial != d->pkt_serial); av_packet_unref(&d->pkt); d->pkt_temp = d->pkt = pkt; d->packet_pending = 1; } switch (d->avctx->codec_type) { case AVMEDIA_TYPE_VIDEO: ret = avcodec_decode_video2(d->avctx, frame, &got_frame, &d->pkt_temp); if (got_frame) { if (decoder_reorder_pts == -1) { frame->pts = av_frame_get_best_effort_timestamp(frame); } else if (!decoder_reorder_pts) { frame->pts = frame->pkt_dts; } } break; case AVMEDIA_TYPE_AUDIO: ret = avcodec_decode_audio4(d->avctx, frame, &got_frame, &d->pkt_temp); if (got_frame) { AVRational tb = (AVRational){1, frame->sample_rate}; if (frame->pts != AV_NOPTS_VALUE) frame->pts = av_rescale_q(frame->pts, av_codec_get_pkt_timebase(d->avctx), tb); else if (d->next_pts != AV_NOPTS_VALUE) frame->pts = av_rescale_q(d->next_pts, d->next_pts_tb, tb); if (frame->pts != AV_NOPTS_VALUE) { d->next_pts = frame->pts + frame->nb_samples; d->next_pts_tb = tb; } } break; case AVMEDIA_TYPE_SUBTITLE: ret = avcodec_decode_subtitle2(d->avctx, sub, &got_frame, &d->pkt_temp); break; } if (ret < 0) { d->packet_pending = 0; } else { d->pkt_temp.dts = d->pkt_temp.pts = AV_NOPTS_VALUE; if (d->pkt_temp.data) { if (d->avctx->codec_type != AVMEDIA_TYPE_AUDIO) ret = d->pkt_temp.size; d->pkt_temp.data += ret; d->pkt_temp.size -= ret; if (d->pkt_temp.size <= 0) d->packet_pending = 0; } else { if (!got_frame) { d->packet_pending = 0; d->finished = d->pkt_serial; } } } } while (!got_frame && !d->finished); return got_frame; } static void decoder_destroy(Decoder *d) { av_packet_unref(&d->pkt); avcodec_free_context(&d->avctx); } static void frame_queue_unref_item(Frame *vp) { av_frame_unref(vp->frame); avsubtitle_free(&vp->sub); } static int frame_queue_init(FrameQueue *f, PacketQueue *pktq, int max_size, int keep_last) { int i; memset(f, 0, sizeof(FrameQueue)); if (!(f->mutex = SDL_CreateMutex())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } if (!(f->cond = SDL_CreateCond())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } f->pktq = pktq; f->max_size = FFMIN(max_size, FRAME_QUEUE_SIZE); f->keep_last = !!keep_last; for (i = 0; i < f->max_size; i++) if (!(f->queue[i].frame = av_frame_alloc())) return AVERROR(ENOMEM); return 0; } static void frame_queue_destory(FrameQueue *f) { int i; for (i = 0; i < f->max_size; i++) { Frame *vp = &f->queue[i]; frame_queue_unref_item(vp); av_frame_free(&vp->frame); free_picture(vp); } SDL_DestroyMutex(f->mutex); SDL_DestroyCond(f->cond); } static void frame_queue_signal(FrameQueue *f) { SDL_LockMutex(f->mutex); SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } static Frame *frame_queue_peek(FrameQueue *f) { return &f->queue[(f->rindex + f->rindex_shown) % f->max_size]; } static Frame *frame_queue_peek_next(FrameQueue *f) { return &f->queue[(f->rindex + f->rindex_shown + 1) % f->max_size]; } static Frame *frame_queue_peek_last(FrameQueue *f) { return &f->queue[f->rindex]; } static Frame *frame_queue_peek_writable(FrameQueue *f) { /* wait until we have space to put a new frame */ SDL_LockMutex(f->mutex); while (f->size >= f->max_size && !f->pktq->abort_request) { SDL_CondWait(f->cond, f->mutex); } SDL_UnlockMutex(f->mutex); if (f->pktq->abort_request) return NULL; return &f->queue[f->windex]; } static Frame *frame_queue_peek_readable(FrameQueue *f) { /* wait until we have a readable a new frame */ SDL_LockMutex(f->mutex); while (f->size - f->rindex_shown <= 0 && !f->pktq->abort_request) { SDL_CondWait(f->cond, f->mutex); } SDL_UnlockMutex(f->mutex); if (f->pktq->abort_request) return NULL; return &f->queue[(f->rindex + f->rindex_shown) % f->max_size]; } static void frame_queue_push(FrameQueue *f) { if (++f->windex == f->max_size) f->windex = 0; SDL_LockMutex(f->mutex); f->size++; SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } static void frame_queue_next(FrameQueue *f) { if (f->keep_last && !f->rindex_shown) { f->rindex_shown = 1; return; } frame_queue_unref_item(&f->queue[f->rindex]); if (++f->rindex == f->max_size) f->rindex = 0; SDL_LockMutex(f->mutex); f->size--; SDL_CondSignal(f->cond); SDL_UnlockMutex(f->mutex); } /* return the number of undisplayed frames in the queue */ static int frame_queue_nb_remaining(FrameQueue *f) { return f->size - f->rindex_shown; } /* return last shown position */ static int64_t frame_queue_last_pos(FrameQueue *f) { Frame *fp = &f->queue[f->rindex]; if (f->rindex_shown && fp->serial == f->pktq->serial) return fp->pos; else return -1; } static void decoder_abort(Decoder *d, FrameQueue *fq) { packet_queue_abort(d->queue); frame_queue_signal(fq); SDL_WaitThread(d->decoder_tid, NULL); d->decoder_tid = NULL; packet_queue_flush(d->queue); } static inline void fill_rectangle(int x, int y, int w, int h) { SDL_Rect rect; rect.x = x; rect.y = y; rect.w = w; rect.h = h; if (w && h) SDL_RenderFillRect(renderer, &rect); } static void free_picture(Frame *vp) { if (vp->bmp) { SDL_DestroyTexture(vp->bmp); vp->bmp = NULL; } } static int realloc_texture(SDL_Texture **texture, Uint32 new_format, int new_width, int new_height, SDL_BlendMode blendmode, int init_texture) { Uint32 format; int access, w, h; if (SDL_QueryTexture(*texture, &format, &access, &w, &h) < 0 || new_width != w || new_height != h || new_format != format) { void *pixels; int pitch; SDL_DestroyTexture(*texture); if (!(*texture = SDL_CreateTexture(renderer, new_format, SDL_TEXTUREACCESS_STREAMING, new_width, new_height))) return -1; if (SDL_SetTextureBlendMode(*texture, blendmode) < 0) return -1; if (init_texture) { if (SDL_LockTexture(*texture, NULL, &pixels, &pitch) < 0) return -1; memset(pixels, 0, pitch * new_height); SDL_UnlockTexture(*texture); } } return 0; } static void calculate_display_rect(SDL_Rect *rect, int scr_xleft, int scr_ytop, int scr_width, int scr_height, int pic_width, int pic_height, AVRational pic_sar) { float aspect_ratio; int width, height, x, y; if (pic_sar.num == 0) aspect_ratio = 0; else aspect_ratio = av_q2d(pic_sar); if (aspect_ratio <= 0.0) aspect_ratio = 1.0; aspect_ratio *= (float)pic_width / (float)pic_height; /* XXX: we suppose the screen has a 1.0 pixel ratio */ height = scr_height; width = lrint(height * aspect_ratio) & ~1; if (width > scr_width) { width = scr_width; height = lrint(width / aspect_ratio) & ~1; } x = (scr_width - width) / 2; y = (scr_height - height) / 2; rect->x = scr_xleft + x; rect->y = scr_ytop + y; rect->w = FFMAX(width, 1); rect->h = FFMAX(height, 1); } static int upload_texture(SDL_Texture *tex, AVFrame *frame, struct SwsContext **img_convert_ctx) { int ret = 0; switch (frame->format) { case AV_PIX_FMT_YUV420P: ret = SDL_UpdateYUVTexture(tex, NULL, frame->data[0], frame->linesize[0], frame->data[1], frame->linesize[1], frame->data[2], frame->linesize[2]); break; case AV_PIX_FMT_BGRA: ret = SDL_UpdateTexture(tex, NULL, frame->data[0], frame->linesize[0]); break; default: /* This should only happen if we are not using avfilter... */ *img_convert_ctx = sws_getCachedContext(*img_convert_ctx, frame->width, frame->height, frame->format, frame->width, frame->height, AV_PIX_FMT_BGRA, sws_flags, NULL, NULL, NULL); if (*img_convert_ctx != NULL) { uint8_t *pixels[4]; int pitch[4]; if (!SDL_LockTexture(tex, NULL, (void **)pixels, pitch)) { sws_scale(*img_convert_ctx, (const uint8_t * const *)frame->data, frame->linesize, 0, frame->height, pixels, pitch); SDL_UnlockTexture(tex); } } else { av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n"); ret = -1; } break; } return ret; } static void video_image_display(VideoState *is) { Frame *vp; Frame *sp = NULL; SDL_Rect rect; vp = frame_queue_peek_last(&is->pictq); if (vp->bmp) { if (is->subtitle_st) { if (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); if (vp->pts >= sp->pts + ((float) sp->sub.start_display_time / 1000)) { if (!sp->uploaded) { uint8_t* pixels[4]; int pitch[4]; int i; if (!sp->width || !sp->height) { sp->width = vp->width; sp->height = vp->height; } if (realloc_texture(&is->sub_texture, SDL_PIXELFORMAT_ARGB8888, sp->width, sp->height, SDL_BLENDMODE_BLEND, 1) < 0) return; for (i = 0; i < sp->sub.num_rects; i++) { AVSubtitleRect *sub_rect = sp->sub.rects[i]; sub_rect->x = av_clip(sub_rect->x, 0, sp->width ); sub_rect->y = av_clip(sub_rect->y, 0, sp->height); sub_rect->w = av_clip(sub_rect->w, 0, sp->width - sub_rect->x); sub_rect->h = av_clip(sub_rect->h, 0, sp->height - sub_rect->y); is->sub_convert_ctx = sws_getCachedContext(is->sub_convert_ctx, sub_rect->w, sub_rect->h, AV_PIX_FMT_PAL8, sub_rect->w, sub_rect->h, AV_PIX_FMT_BGRA, 0, NULL, NULL, NULL); if (!is->sub_convert_ctx) { av_log(NULL, AV_LOG_FATAL, "Cannot initialize the conversion context\n"); return; } if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)pixels, pitch)) { sws_scale(is->sub_convert_ctx, (const uint8_t * const *)sub_rect->data, sub_rect->linesize, 0, sub_rect->h, pixels, pitch); SDL_UnlockTexture(is->sub_texture); } } sp->uploaded = 1; } } else sp = NULL; } } calculate_display_rect(&rect, is->xleft, is->ytop, is->width, is->height, vp->width, vp->height, vp->sar); if (!vp->uploaded) { if (upload_texture(vp->bmp, vp->frame, &is->img_convert_ctx) < 0) return; vp->uploaded = 1; } SDL_RenderCopy(renderer, vp->bmp, NULL, &rect); if (sp) { #if USE_ONEPASS_SUBTITLE_RENDER SDL_RenderCopy(renderer, is->sub_texture, NULL, &rect); #else int i; double xratio = (double)rect.w / (double)sp->width; double yratio = (double)rect.h / (double)sp->height; for (i = 0; i < sp->sub.num_rects; i++) { SDL_Rect *sub_rect = (SDL_Rect*)sp->sub.rects[i]; SDL_Rect target = {.x = rect.x + sub_rect->x * xratio, .y = rect.y + sub_rect->y * yratio, .w = sub_rect->w * xratio, .h = sub_rect->h * yratio}; SDL_RenderCopy(renderer, is->sub_texture, sub_rect, &target); } #endif } } } static inline int compute_mod(int a, int b) { return a < 0 ? a%b + b : a%b; } static void video_audio_display(VideoState *s) { int i, i_start, x, y1, y, ys, delay, n, nb_display_channels; int ch, channels, h, h2; int64_t time_diff; int rdft_bits, nb_freq; for (rdft_bits = 1; (1 << rdft_bits) < 2 * s->height; rdft_bits++) ; nb_freq = 1 << (rdft_bits - 1); /* compute display index : center on currently output samples */ channels = s->audio_tgt.channels; nb_display_channels = channels; if (!s->paused) { int data_used= s->show_mode == SHOW_MODE_WAVES ? s->width : (2*nb_freq); n = 2 * channels; delay = s->audio_write_buf_size; delay /= n; /* to be more precise, we take into account the time spent since the last buffer computation */ if (audio_callback_time) { time_diff = av_gettime_relative() - audio_callback_time; delay -= (time_diff * s->audio_tgt.freq) / 1000000; } delay += 2 * data_used; if (delay < data_used) delay = data_used; i_start= x = compute_mod(s->sample_array_index - delay * channels, SAMPLE_ARRAY_SIZE); if (s->show_mode == SHOW_MODE_WAVES) { h = INT_MIN; for (i = 0; i < 1000; i += channels) { int idx = (SAMPLE_ARRAY_SIZE + x - i) % SAMPLE_ARRAY_SIZE; int a = s->sample_array[idx]; int b = s->sample_array[(idx + 4 * channels) % SAMPLE_ARRAY_SIZE]; int c = s->sample_array[(idx + 5 * channels) % SAMPLE_ARRAY_SIZE]; int d = s->sample_array[(idx + 9 * channels) % SAMPLE_ARRAY_SIZE]; int score = a - d; if (h < score && (b ^ c) < 0) { h = score; i_start = idx; } } } s->last_i_start = i_start; } else { i_start = s->last_i_start; } if (s->show_mode == SHOW_MODE_WAVES) { SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255); /* total height for one channel */ h = s->height / nb_display_channels; /* graph height / 2 */ h2 = (h * 9) / 20; for (ch = 0; ch < nb_display_channels; ch++) { i = i_start + ch; y1 = s->ytop + ch * h + (h / 2); /* position of center line */ for (x = 0; x < s->width; x++) { y = (s->sample_array[i] * h2) >> 15; if (y < 0) { y = -y; ys = y1 - y; } else { ys = y1; } fill_rectangle(s->xleft + x, ys, 1, y); i += channels; if (i >= SAMPLE_ARRAY_SIZE) i -= SAMPLE_ARRAY_SIZE; } } SDL_SetRenderDrawColor(renderer, 0, 0, 255, 255); for (ch = 1; ch < nb_display_channels; ch++) { y = s->ytop + ch * h; fill_rectangle(s->xleft, y, s->width, 1); } } else { if (realloc_texture(&s->vis_texture, SDL_PIXELFORMAT_ARGB8888, s->width, s->height, SDL_BLENDMODE_NONE, 1) < 0) return; nb_display_channels= FFMIN(nb_display_channels, 2); if (rdft_bits != s->rdft_bits) { av_rdft_end(s->rdft); av_free(s->rdft_data); s->rdft = av_rdft_init(rdft_bits, DFT_R2C); s->rdft_bits = rdft_bits; s->rdft_data = av_malloc_array(nb_freq, 4 *sizeof(*s->rdft_data)); } if (!s->rdft || !s->rdft_data){ av_log(NULL, AV_LOG_ERROR, "Failed to allocate buffers for RDFT, switching to waves display\n"); s->show_mode = SHOW_MODE_WAVES; } else { FFTSample *data[2]; SDL_Rect rect = {.x = s->xpos, .y = 0, .w = 1, .h = s->height}; uint32_t *pixels; int pitch; for (ch = 0; ch < nb_display_channels; ch++) { data[ch] = s->rdft_data + 2 * nb_freq * ch; i = i_start + ch; for (x = 0; x < 2 * nb_freq; x++) { double w = (x-nb_freq) * (1.0 / nb_freq); data[ch][x] = s->sample_array[i] * (1.0 - w * w); i += channels; if (i >= SAMPLE_ARRAY_SIZE) i -= SAMPLE_ARRAY_SIZE; } av_rdft_calc(s->rdft, data[ch]); } /* Least efficient way to do this, we should of course * directly access it but it is more than fast enough. */ if (!SDL_LockTexture(s->vis_texture, &rect, (void **)&pixels, &pitch)) { pitch >>= 2; pixels += pitch * s->height; for (y = 0; y < s->height; y++) { double w = 1 / sqrt(nb_freq); int a = sqrt(w * sqrt(data[0][2 * y + 0] * data[0][2 * y + 0] + data[0][2 * y + 1] * data[0][2 * y + 1])); int b = (nb_display_channels == 2 ) ? sqrt(w * hypot(data[1][2 * y + 0], data[1][2 * y + 1])) : a; a = FFMIN(a, 255); b = FFMIN(b, 255); pixels -= pitch; *pixels = (a << 16) + (b << 8) + ((a+b) >> 1); } SDL_UnlockTexture(s->vis_texture); } SDL_RenderCopy(renderer, s->vis_texture, NULL, NULL); } if (!s->paused) s->xpos++; if (s->xpos >= s->width) s->xpos= s->xleft; } } static void stream_component_close(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; AVCodecParameters *codecpar; if (stream_index < 0 || stream_index >= ic->nb_streams) return; codecpar = ic->streams[stream_index]->codecpar; switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: decoder_abort(&is->auddec, &is->sampq); SDL_CloseAudio(); decoder_destroy(&is->auddec); swr_free(&is->swr_ctx); av_freep(&is->audio_buf1); is->audio_buf1_size = 0; is->audio_buf = NULL; if (is->rdft) { av_rdft_end(is->rdft); av_freep(&is->rdft_data); is->rdft = NULL; is->rdft_bits = 0; } break; case AVMEDIA_TYPE_VIDEO: decoder_abort(&is->viddec, &is->pictq); decoder_destroy(&is->viddec); break; case AVMEDIA_TYPE_SUBTITLE: decoder_abort(&is->subdec, &is->subpq); decoder_destroy(&is->subdec); break; default: break; } ic->streams[stream_index]->discard = AVDISCARD_ALL; switch (codecpar->codec_type) { case AVMEDIA_TYPE_AUDIO: is->audio_st = NULL; is->audio_stream = -1; break; case AVMEDIA_TYPE_VIDEO: is->video_st = NULL; is->video_stream = -1; break; case AVMEDIA_TYPE_SUBTITLE: is->subtitle_st = NULL; is->subtitle_stream = -1; break; default: break; } } static void stream_close(VideoState *is) { /* XXX: use a special url_shutdown call to abort parse cleanly */ is->abort_request = 1; SDL_WaitThread(is->read_tid, NULL); /* close each stream */ if (is->audio_stream >= 0) stream_component_close(is, is->audio_stream); if (is->video_stream >= 0) stream_component_close(is, is->video_stream); if (is->subtitle_stream >= 0) stream_component_close(is, is->subtitle_stream); avformat_close_input(&is->ic); packet_queue_destroy(&is->videoq); packet_queue_destroy(&is->audioq); packet_queue_destroy(&is->subtitleq); /* free all pictures */ frame_queue_destory(&is->pictq); frame_queue_destory(&is->sampq); frame_queue_destory(&is->subpq); SDL_DestroyCond(is->continue_read_thread); sws_freeContext(is->img_convert_ctx); sws_freeContext(is->sub_convert_ctx); av_free(is->filename); if (is->vis_texture) SDL_DestroyTexture(is->vis_texture); if (is->sub_texture) SDL_DestroyTexture(is->sub_texture); av_free(is); } static void do_exit(VideoState *is) { if (is) { stream_close(is); } if (renderer) SDL_DestroyRenderer(renderer); if (window) SDL_DestroyWindow(window); av_lockmgr_register(NULL); uninit_opts(); #if CONFIG_AVFILTER av_freep(&vfilters_list); #endif avformat_network_deinit(); if (show_status) printf("\n"); SDL_Quit(); av_log(NULL, AV_LOG_QUIET, "%s", ""); exit(0); } static void sigterm_handler(int sig) { exit(123); } static void set_default_window_size(int width, int height, AVRational sar) { SDL_Rect rect; calculate_display_rect(&rect, 0, 0, INT_MAX, height, width, height, sar); default_width = rect.w; default_height = rect.h; } static int video_open(VideoState *is, Frame *vp) { int w,h; if (vp && vp->width) set_default_window_size(vp->width, vp->height, vp->sar); if (screen_width) { w = screen_width; h = screen_height; } else { w = default_width; h = default_height; } if (!window) { int flags = SDL_WINDOW_SHOWN | SDL_WINDOW_RESIZABLE; if (!window_title) window_title = input_filename; if (is_full_screen) flags |= SDL_WINDOW_FULLSCREEN_DESKTOP; window = SDL_CreateWindow(window_title, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, w, h, flags); SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear"); if (window) { SDL_RendererInfo info; renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); if (renderer) { if (!SDL_GetRendererInfo(renderer, &info)) av_log(NULL, AV_LOG_VERBOSE, "Initialized %s renderer.\n", info.name); } } } else { SDL_SetWindowSize(window, w, h); } if (!window || !renderer) { av_log(NULL, AV_LOG_FATAL, "SDL: could not set video mode - exiting\n"); do_exit(is); } is->width = w; is->height = h; return 0; } /* display the current picture, if any */ static void video_display(VideoState *is) { if (!window) video_open(is, NULL); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); SDL_RenderClear(renderer); if (is->audio_st && is->show_mode != SHOW_MODE_VIDEO) video_audio_display(is); else if (is->video_st) video_image_display(is); SDL_RenderPresent(renderer); } static double get_clock(Clock *c) { if (*c->queue_serial != c->serial) return NAN; if (c->paused) { return c->pts; } else { double time = av_gettime_relative() / 1000000.0; return c->pts_drift + time - (time - c->last_updated) * (1.0 - c->speed); } } static void set_clock_at(Clock *c, double pts, int serial, double time) { c->pts = pts; c->last_updated = time; c->pts_drift = c->pts - time; c->serial = serial; } static void set_clock(Clock *c, double pts, int serial) { double time = av_gettime_relative() / 1000000.0; set_clock_at(c, pts, serial, time); } static void set_clock_speed(Clock *c, double speed) { set_clock(c, get_clock(c), c->serial); c->speed = speed; } static void init_clock(Clock *c, int *queue_serial) { c->speed = 1.0; c->paused = 0; c->queue_serial = queue_serial; set_clock(c, NAN, -1); } static void sync_clock_to_slave(Clock *c, Clock *slave) { double clock = get_clock(c); double slave_clock = get_clock(slave); if (!isnan(slave_clock) && (isnan(clock) || fabs(clock - slave_clock) > AV_NOSYNC_THRESHOLD)) set_clock(c, slave_clock, slave->serial); } static int get_master_sync_type(VideoState *is) { if (is->av_sync_type == AV_SYNC_VIDEO_MASTER) { if (is->video_st) return AV_SYNC_VIDEO_MASTER; else return AV_SYNC_AUDIO_MASTER; } else if (is->av_sync_type == AV_SYNC_AUDIO_MASTER) { if (is->audio_st) return AV_SYNC_AUDIO_MASTER; else return AV_SYNC_EXTERNAL_CLOCK; } else { return AV_SYNC_EXTERNAL_CLOCK; } } /* get the current master clock value */ static double get_master_clock(VideoState *is) { double val; switch (get_master_sync_type(is)) { case AV_SYNC_VIDEO_MASTER: val = get_clock(&is->vidclk); break; case AV_SYNC_AUDIO_MASTER: val = get_clock(&is->audclk); break; default: val = get_clock(&is->extclk); break; } return val; } static void check_external_clock_speed(VideoState *is) { if (is->video_stream >= 0 && is->videoq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES || is->audio_stream >= 0 && is->audioq.nb_packets <= EXTERNAL_CLOCK_MIN_FRAMES) { set_clock_speed(&is->extclk, FFMAX(EXTERNAL_CLOCK_SPEED_MIN, is->extclk.speed - EXTERNAL_CLOCK_SPEED_STEP)); } else if ((is->video_stream < 0 || is->videoq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES) && (is->audio_stream < 0 || is->audioq.nb_packets > EXTERNAL_CLOCK_MAX_FRAMES)) { set_clock_speed(&is->extclk, FFMIN(EXTERNAL_CLOCK_SPEED_MAX, is->extclk.speed + EXTERNAL_CLOCK_SPEED_STEP)); } else { double speed = is->extclk.speed; if (speed != 1.0) set_clock_speed(&is->extclk, speed + EXTERNAL_CLOCK_SPEED_STEP * (1.0 - speed) / fabs(1.0 - speed)); } } /* seek in the stream */ static void stream_seek(VideoState *is, int64_t pos, int64_t rel, int seek_by_bytes) { if (!is->seek_req) { is->seek_pos = pos; is->seek_rel = rel; is->seek_flags &= ~AVSEEK_FLAG_BYTE; if (seek_by_bytes) is->seek_flags |= AVSEEK_FLAG_BYTE; is->seek_req = 1; SDL_CondSignal(is->continue_read_thread); } } /* pause or resume the video */ static void stream_toggle_pause(VideoState *is) { if (is->paused) { is->frame_timer += av_gettime_relative() / 1000000.0 - is->vidclk.last_updated; if (is->read_pause_return != AVERROR(ENOSYS)) { is->vidclk.paused = 0; } set_clock(&is->vidclk, get_clock(&is->vidclk), is->vidclk.serial); } set_clock(&is->extclk, get_clock(&is->extclk), is->extclk.serial); is->paused = is->audclk.paused = is->vidclk.paused = is->extclk.paused = !is->paused; } static void toggle_pause(VideoState *is) { stream_toggle_pause(is); is->step = 0; } static void toggle_mute(VideoState *is) { is->muted = !is->muted; } static void update_volume(VideoState *is, int sign, int step) { is->audio_volume = av_clip(is->audio_volume + sign * step, 0, SDL_MIX_MAXVOLUME); } static void step_to_next_frame(VideoState *is) { /* if the stream is paused unpause it, then step */ if (is->paused) stream_toggle_pause(is); is->step = 1; } static double compute_target_delay(double delay, VideoState *is) { double sync_threshold, diff = 0; /* update delay to follow master synchronisation source */ if (get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER) { /* if video is slave, we try to correct big delays by duplicating or deleting a frame */ diff = get_clock(&is->vidclk) - get_master_clock(is); /* skip or repeat frame. We take into account the delay to compute the threshold. I still don't know if it is the best guess */ sync_threshold = FFMAX(AV_SYNC_THRESHOLD_MIN, FFMIN(AV_SYNC_THRESHOLD_MAX, delay)); if (!isnan(diff) && fabs(diff) < is->max_frame_duration) { if (diff <= -sync_threshold) delay = FFMAX(0, delay + diff); else if (diff >= sync_threshold && delay > AV_SYNC_FRAMEDUP_THRESHOLD) delay = delay + diff; else if (diff >= sync_threshold) delay = 2 * delay; } } av_log(NULL, AV_LOG_TRACE, "video: delay=%0.3f A-V=%f\n", delay, -diff); return delay; } static double vp_duration(VideoState *is, Frame *vp, Frame *nextvp) { if (vp->serial == nextvp->serial) { double duration = nextvp->pts - vp->pts; if (isnan(duration) || duration <= 0 || duration > is->max_frame_duration) return vp->duration; else return duration; } else { return 0.0; } } static void update_video_pts(VideoState *is, double pts, int64_t pos, int serial) { /* update current video pts */ set_clock(&is->vidclk, pts, serial); sync_clock_to_slave(&is->extclk, &is->vidclk); } /* called to display each frame */ static void video_refresh(void *opaque, double *remaining_time) { VideoState *is = opaque; double time; Frame *sp, *sp2; if (!is->paused && get_master_sync_type(is) == AV_SYNC_EXTERNAL_CLOCK && is->realtime) check_external_clock_speed(is); if (!display_disable && is->show_mode != SHOW_MODE_VIDEO && is->audio_st) { time = av_gettime_relative() / 1000000.0; if (is->force_refresh || is->last_vis_time + rdftspeed < time) { video_display(is); is->last_vis_time = time; } *remaining_time = FFMIN(*remaining_time, is->last_vis_time + rdftspeed - time); } if (is->video_st) { retry: if (frame_queue_nb_remaining(&is->pictq) == 0) { // nothing to do, no picture to display in the queue } else { double last_duration, duration, delay; Frame *vp, *lastvp; /* dequeue the picture */ lastvp = frame_queue_peek_last(&is->pictq); vp = frame_queue_peek(&is->pictq); if (vp->serial != is->videoq.serial) { frame_queue_next(&is->pictq); goto retry; } if (lastvp->serial != vp->serial) is->frame_timer = av_gettime_relative() / 1000000.0; if (is->paused) goto display; /* compute nominal last_duration */ last_duration = vp_duration(is, lastvp, vp); delay = compute_target_delay(last_duration, is); time= av_gettime_relative()/1000000.0; if (time < is->frame_timer + delay) { *remaining_time = FFMIN(is->frame_timer + delay - time, *remaining_time); goto display; } is->frame_timer += delay; if (delay > 0 && time - is->frame_timer > AV_SYNC_THRESHOLD_MAX) is->frame_timer = time; SDL_LockMutex(is->pictq.mutex); if (!isnan(vp->pts)) update_video_pts(is, vp->pts, vp->pos, vp->serial); SDL_UnlockMutex(is->pictq.mutex); if (frame_queue_nb_remaining(&is->pictq) > 1) { Frame *nextvp = frame_queue_peek_next(&is->pictq); duration = vp_duration(is, vp, nextvp); if(!is->step && (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) && time > is->frame_timer + duration){ is->frame_drops_late++; frame_queue_next(&is->pictq); goto retry; } } if (is->subtitle_st) { while (frame_queue_nb_remaining(&is->subpq) > 0) { sp = frame_queue_peek(&is->subpq); if (frame_queue_nb_remaining(&is->subpq) > 1) sp2 = frame_queue_peek_next(&is->subpq); else sp2 = NULL; if (sp->serial != is->subtitleq.serial || (is->vidclk.pts > (sp->pts + ((float) sp->sub.end_display_time / 1000))) || (sp2 && is->vidclk.pts > (sp2->pts + ((float) sp2->sub.start_display_time / 1000)))) { if (sp->uploaded) { int i; for (i = 0; i < sp->sub.num_rects; i++) { AVSubtitleRect *sub_rect = sp->sub.rects[i]; uint8_t *pixels; int pitch, j; if (!SDL_LockTexture(is->sub_texture, (SDL_Rect *)sub_rect, (void **)&pixels, &pitch)) { for (j = 0; j < sub_rect->h; j++, pixels += pitch) memset(pixels, 0, sub_rect->w << 2); SDL_UnlockTexture(is->sub_texture); } } } frame_queue_next(&is->subpq); } else { break; } } } frame_queue_next(&is->pictq); is->force_refresh = 1; if (is->step && !is->paused) stream_toggle_pause(is); } display: /* display picture */ if (!display_disable && is->force_refresh && is->show_mode == SHOW_MODE_VIDEO && is->pictq.rindex_shown) video_display(is); } is->force_refresh = 0; if (show_status) { static int64_t last_time; int64_t cur_time; int aqsize, vqsize, sqsize; double av_diff; cur_time = av_gettime_relative(); if (!last_time || (cur_time - last_time) >= 30000) { aqsize = 0; vqsize = 0; sqsize = 0; if (is->audio_st) aqsize = is->audioq.size; if (is->video_st) vqsize = is->videoq.size; if (is->subtitle_st) sqsize = is->subtitleq.size; av_diff = 0; if (is->audio_st && is->video_st) av_diff = get_clock(&is->audclk) - get_clock(&is->vidclk); else if (is->video_st) av_diff = get_master_clock(is) - get_clock(&is->vidclk); else if (is->audio_st) av_diff = get_master_clock(is) - get_clock(&is->audclk); av_log(NULL, AV_LOG_INFO, "%7.2f %s:%7.3f fd=%4d aq=%5dKB vq=%5dKB sq=%5dB f=%"PRId64"/%"PRId64" \r", get_master_clock(is), (is->audio_st && is->video_st) ? "A-V" : (is->video_st ? "M-V" : (is->audio_st ? "M-A" : " ")), av_diff, is->frame_drops_early + is->frame_drops_late, aqsize / 1024, vqsize / 1024, sqsize, is->video_st ? is->viddec.avctx->pts_correction_num_faulty_dts : 0, is->video_st ? is->viddec.avctx->pts_correction_num_faulty_pts : 0); fflush(stdout); last_time = cur_time; } } } /* allocate a picture (needs to do that in main thread to avoid potential locking problems */ static void alloc_picture(VideoState *is) { Frame *vp; int sdl_format; vp = &is->pictq.queue[is->pictq.windex]; video_open(is, vp); if (vp->format == AV_PIX_FMT_YUV420P) sdl_format = SDL_PIXELFORMAT_YV12; else sdl_format = SDL_PIXELFORMAT_ARGB8888; if (realloc_texture(&vp->bmp, sdl_format, vp->width, vp->height, SDL_BLENDMODE_NONE, 0) < 0) { /* SDL allocates a buffer smaller than requested if the video * overlay hardware is unable to support the requested size. */ av_log(NULL, AV_LOG_FATAL, "Error: the video system does not support an image\n" "size of %dx%d pixels. Try using -lowres or -vf \"scale=w:h\"\n" "to reduce the image size.\n", vp->width, vp->height ); do_exit(is); } SDL_LockMutex(is->pictq.mutex); vp->allocated = 1; SDL_CondSignal(is->pictq.cond); SDL_UnlockMutex(is->pictq.mutex); } static int queue_picture(VideoState *is, AVFrame *src_frame, double pts, double duration, int64_t pos, int serial) { Frame *vp; #if defined(DEBUG_SYNC) printf("frame_type=%c pts=%0.3f\n", av_get_picture_type_char(src_frame->pict_type), pts); #endif if (!(vp = frame_queue_peek_writable(&is->pictq))) return -1; vp->sar = src_frame->sample_aspect_ratio; vp->uploaded = 0; /* alloc or resize hardware picture buffer */ if (!vp->bmp || !vp->allocated || vp->width != src_frame->width || vp->height != src_frame->height || vp->format != src_frame->format) { SDL_Event event; vp->allocated = 0; vp->width = src_frame->width; vp->height = src_frame->height; vp->format = src_frame->format; /* the allocation must be done in the main thread to avoid locking problems. */ event.type = FF_ALLOC_EVENT; event.user.data1 = is; SDL_PushEvent(&event); /* wait until the picture is allocated */ SDL_LockMutex(is->pictq.mutex); while (!vp->allocated && !is->videoq.abort_request) { SDL_CondWait(is->pictq.cond, is->pictq.mutex); } /* if the queue is aborted, we have to pop the pending ALLOC event or wait for the allocation to complete */ if (is->videoq.abort_request && SDL_PeepEvents(&event, 1, SDL_GETEVENT, FF_ALLOC_EVENT, FF_ALLOC_EVENT) != 1) { while (!vp->allocated && !is->abort_request) { SDL_CondWait(is->pictq.cond, is->pictq.mutex); } } SDL_UnlockMutex(is->pictq.mutex); if (is->videoq.abort_request) return -1; } /* if the frame is not skipped, then display it */ if (vp->bmp) { vp->pts = pts; vp->duration = duration; vp->pos = pos; vp->serial = serial; av_frame_move_ref(vp->frame, src_frame); frame_queue_push(&is->pictq); } return 0; } static int get_video_frame(VideoState *is, AVFrame *frame) { int got_picture; if ((got_picture = decoder_decode_frame(&is->viddec, frame, NULL)) < 0) return -1; if (got_picture) { double dpts = NAN; if (frame->pts != AV_NOPTS_VALUE) dpts = av_q2d(is->video_st->time_base) * frame->pts; frame->sample_aspect_ratio = av_guess_sample_aspect_ratio(is->ic, is->video_st, frame); if (framedrop>0 || (framedrop && get_master_sync_type(is) != AV_SYNC_VIDEO_MASTER)) { if (frame->pts != AV_NOPTS_VALUE) { double diff = dpts - get_master_clock(is); if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD && diff - is->frame_last_filter_delay < 0 && is->viddec.pkt_serial == is->vidclk.serial && is->videoq.nb_packets) { is->frame_drops_early++; av_frame_unref(frame); got_picture = 0; } } } } return got_picture; } #if CONFIG_AVFILTER static int configure_filtergraph(AVFilterGraph *graph, const char *filtergraph, AVFilterContext *source_ctx, AVFilterContext *sink_ctx) { int ret, i; int nb_filters = graph->nb_filters; AVFilterInOut *outputs = NULL, *inputs = NULL; if (filtergraph) { outputs = avfilter_inout_alloc(); inputs = avfilter_inout_alloc(); if (!outputs || !inputs) { ret = AVERROR(ENOMEM); goto fail; } outputs->name = av_strdup("in"); outputs->filter_ctx = source_ctx; outputs->pad_idx = 0; outputs->next = NULL; inputs->name = av_strdup("out"); inputs->filter_ctx = sink_ctx; inputs->pad_idx = 0; inputs->next = NULL; if ((ret = avfilter_graph_parse_ptr(graph, filtergraph, &inputs, &outputs, NULL)) < 0) goto fail; } else { if ((ret = avfilter_link(source_ctx, 0, sink_ctx, 0)) < 0) goto fail; } /* Reorder the filters to ensure that inputs of the custom filters are merged first */ for (i = 0; i < graph->nb_filters - nb_filters; i++) FFSWAP(AVFilterContext*, graph->filters[i], graph->filters[i + nb_filters]); ret = avfilter_graph_config(graph, NULL); fail: avfilter_inout_free(&outputs); avfilter_inout_free(&inputs); return ret; } static int configure_video_filters(AVFilterGraph *graph, VideoState *is, const char *vfilters, AVFrame *frame) { static const enum AVPixelFormat pix_fmts[] = { AV_PIX_FMT_YUV420P, AV_PIX_FMT_BGRA, AV_PIX_FMT_NONE }; char sws_flags_str[512] = ""; char buffersrc_args[256]; int ret; AVFilterContext *filt_src = NULL, *filt_out = NULL, *last_filter = NULL; AVCodecParameters *codecpar = is->video_st->codecpar; AVRational fr = av_guess_frame_rate(is->ic, is->video_st, NULL); AVDictionaryEntry *e = NULL; while ((e = av_dict_get(sws_dict, "", e, AV_DICT_IGNORE_SUFFIX))) { if (!strcmp(e->key, "sws_flags")) { av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", "flags", e->value); } else av_strlcatf(sws_flags_str, sizeof(sws_flags_str), "%s=%s:", e->key, e->value); } if (strlen(sws_flags_str)) sws_flags_str[strlen(sws_flags_str)-1] = '\0'; graph->scale_sws_opts = av_strdup(sws_flags_str); snprintf(buffersrc_args, sizeof(buffersrc_args), "video_size=%dx%d:pix_fmt=%d:time_base=%d/%d:pixel_aspect=%d/%d", frame->width, frame->height, frame->format, is->video_st->time_base.num, is->video_st->time_base.den, codecpar->sample_aspect_ratio.num, FFMAX(codecpar->sample_aspect_ratio.den, 1)); if (fr.num && fr.den) av_strlcatf(buffersrc_args, sizeof(buffersrc_args), ":frame_rate=%d/%d", fr.num, fr.den); if ((ret = avfilter_graph_create_filter(&filt_src, avfilter_get_by_name("buffer"), "ffplay_buffer", buffersrc_args, NULL, graph)) < 0) goto fail; ret = avfilter_graph_create_filter(&filt_out, avfilter_get_by_name("buffersink"), "ffplay_buffersink", NULL, NULL, graph); if (ret < 0) goto fail; if ((ret = av_opt_set_int_list(filt_out, "pix_fmts", pix_fmts, AV_PIX_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0) goto fail; last_filter = filt_out; /* Note: this macro adds a filter before the lastly added filter, so the * processing order of the filters is in reverse */ #define INSERT_FILT(name, arg) do { \ AVFilterContext *filt_ctx; \ \ ret = avfilter_graph_create_filter(&filt_ctx, \ avfilter_get_by_name(name), \ "ffplay_" name, arg, NULL, graph); \ if (ret < 0) \ goto fail; \ \ ret = avfilter_link(filt_ctx, 0, last_filter, 0); \ if (ret < 0) \ goto fail; \ \ last_filter = filt_ctx; \ } while (0) if (autorotate) { double theta = get_rotation(is->video_st); if (fabs(theta - 90) < 1.0) { INSERT_FILT("transpose", "clock"); } else if (fabs(theta - 180) < 1.0) { INSERT_FILT("hflip", NULL); INSERT_FILT("vflip", NULL); } else if (fabs(theta - 270) < 1.0) { INSERT_FILT("transpose", "cclock"); } else if (fabs(theta) > 1.0) { char rotate_buf[64]; snprintf(rotate_buf, sizeof(rotate_buf), "%f*PI/180", theta); INSERT_FILT("rotate", rotate_buf); } } if ((ret = configure_filtergraph(graph, vfilters, filt_src, last_filter)) < 0) goto fail; is->in_video_filter = filt_src; is->out_video_filter = filt_out; fail: return ret; } static int configure_audio_filters(VideoState *is, const char *afilters, int force_output_format) { static const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; int sample_rates[2] = { 0, -1 }; int64_t channel_layouts[2] = { 0, -1 }; int channels[2] = { 0, -1 }; AVFilterContext *filt_asrc = NULL, *filt_asink = NULL; char aresample_swr_opts[512] = ""; AVDictionaryEntry *e = NULL; char asrc_args[256]; int ret; avfilter_graph_free(&is->agraph); if (!(is->agraph = avfilter_graph_alloc())) return AVERROR(ENOMEM); while ((e = av_dict_get(swr_opts, "", e, AV_DICT_IGNORE_SUFFIX))) av_strlcatf(aresample_swr_opts, sizeof(aresample_swr_opts), "%s=%s:", e->key, e->value); if (strlen(aresample_swr_opts)) aresample_swr_opts[strlen(aresample_swr_opts)-1] = '\0'; av_opt_set(is->agraph, "aresample_swr_opts", aresample_swr_opts, 0); ret = snprintf(asrc_args, sizeof(asrc_args), "sample_rate=%d:sample_fmt=%s:channels=%d:time_base=%d/%d", is->audio_filter_src.freq, av_get_sample_fmt_name(is->audio_filter_src.fmt), is->audio_filter_src.channels, 1, is->audio_filter_src.freq); if (is->audio_filter_src.channel_layout) snprintf(asrc_args + ret, sizeof(asrc_args) - ret, ":channel_layout=0x%"PRIx64, is->audio_filter_src.channel_layout); ret = avfilter_graph_create_filter(&filt_asrc, avfilter_get_by_name("abuffer"), "ffplay_abuffer", asrc_args, NULL, is->agraph); if (ret < 0) goto end; ret = avfilter_graph_create_filter(&filt_asink, avfilter_get_by_name("abuffersink"), "ffplay_abuffersink", NULL, NULL, is->agraph); if (ret < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "sample_fmts", sample_fmts, AV_SAMPLE_FMT_NONE, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int(filt_asink, "all_channel_counts", 1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if (force_output_format) { channel_layouts[0] = is->audio_tgt.channel_layout; channels [0] = is->audio_tgt.channels; sample_rates [0] = is->audio_tgt.freq; if ((ret = av_opt_set_int(filt_asink, "all_channel_counts", 0, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "channel_layouts", channel_layouts, -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "channel_counts" , channels , -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; if ((ret = av_opt_set_int_list(filt_asink, "sample_rates" , sample_rates , -1, AV_OPT_SEARCH_CHILDREN)) < 0) goto end; } if ((ret = configure_filtergraph(is->agraph, afilters, filt_asrc, filt_asink)) < 0) goto end; is->in_audio_filter = filt_asrc; is->out_audio_filter = filt_asink; end: if (ret < 0) avfilter_graph_free(&is->agraph); return ret; } #endif /* CONFIG_AVFILTER */ static int audio_thread(void *arg) { VideoState *is = arg; AVFrame *frame = av_frame_alloc(); Frame *af; #if CONFIG_AVFILTER int last_serial = -1; int64_t dec_channel_layout; int reconfigure; #endif int got_frame = 0; AVRational tb; int ret = 0; if (!frame) return AVERROR(ENOMEM); do { if ((got_frame = decoder_decode_frame(&is->auddec, frame, NULL)) < 0) goto the_end; if (got_frame) { tb = (AVRational){1, frame->sample_rate}; #if CONFIG_AVFILTER dec_channel_layout = get_valid_channel_layout(frame->channel_layout, av_frame_get_channels(frame)); reconfigure = cmp_audio_fmts(is->audio_filter_src.fmt, is->audio_filter_src.channels, frame->format, av_frame_get_channels(frame)) || is->audio_filter_src.channel_layout != dec_channel_layout || is->audio_filter_src.freq != frame->sample_rate || is->auddec.pkt_serial != last_serial; if (reconfigure) { char buf1[1024], buf2[1024]; av_get_channel_layout_string(buf1, sizeof(buf1), -1, is->audio_filter_src.channel_layout); av_get_channel_layout_string(buf2, sizeof(buf2), -1, dec_channel_layout); av_log(NULL, AV_LOG_DEBUG, "Audio frame changed from rate:%d ch:%d fmt:%s layout:%s serial:%d to rate:%d ch:%d fmt:%s layout:%s serial:%d\n", is->audio_filter_src.freq, is->audio_filter_src.channels, av_get_sample_fmt_name(is->audio_filter_src.fmt), buf1, last_serial, frame->sample_rate, av_frame_get_channels(frame), av_get_sample_fmt_name(frame->format), buf2, is->auddec.pkt_serial); is->audio_filter_src.fmt = frame->format; is->audio_filter_src.channels = av_frame_get_channels(frame); is->audio_filter_src.channel_layout = dec_channel_layout; is->audio_filter_src.freq = frame->sample_rate; last_serial = is->auddec.pkt_serial; if ((ret = configure_audio_filters(is, afilters, 1)) < 0) goto the_end; } if ((ret = av_buffersrc_add_frame(is->in_audio_filter, frame)) < 0) goto the_end; while ((ret = av_buffersink_get_frame_flags(is->out_audio_filter, frame, 0)) >= 0) { tb = is->out_audio_filter->inputs[0]->time_base; #endif if (!(af = frame_queue_peek_writable(&is->sampq))) goto the_end; af->pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb); af->pos = av_frame_get_pkt_pos(frame); af->serial = is->auddec.pkt_serial; af->duration = av_q2d((AVRational){frame->nb_samples, frame->sample_rate}); av_frame_move_ref(af->frame, frame); frame_queue_push(&is->sampq); #if CONFIG_AVFILTER if (is->audioq.serial != is->auddec.pkt_serial) break; } if (ret == AVERROR_EOF) is->auddec.finished = is->auddec.pkt_serial; #endif } } while (ret >= 0 || ret == AVERROR(EAGAIN) || ret == AVERROR_EOF); the_end: #if CONFIG_AVFILTER avfilter_graph_free(&is->agraph); #endif av_frame_free(&frame); return ret; } static int decoder_start(Decoder *d, int (*fn)(void *), void *arg) { packet_queue_start(d->queue); d->decoder_tid = SDL_CreateThread(fn, "decoder", arg); if (!d->decoder_tid) { av_log(NULL, AV_LOG_ERROR, "SDL_CreateThread(): %s\n", SDL_GetError()); return AVERROR(ENOMEM); } return 0; } static int video_thread(void *arg) { VideoState *is = arg; AVFrame *frame = av_frame_alloc(); double pts; double duration; int ret; AVRational tb = is->video_st->time_base; AVRational frame_rate = av_guess_frame_rate(is->ic, is->video_st, NULL); #if CONFIG_AVFILTER AVFilterGraph *graph = avfilter_graph_alloc(); AVFilterContext *filt_out = NULL, *filt_in = NULL; int last_w = 0; int last_h = 0; enum AVPixelFormat last_format = -2; int last_serial = -1; int last_vfilter_idx = 0; if (!graph) { av_frame_free(&frame); return AVERROR(ENOMEM); } #endif if (!frame) { #if CONFIG_AVFILTER avfilter_graph_free(&graph); #endif return AVERROR(ENOMEM); } for (;;) { ret = get_video_frame(is, frame); if (ret < 0) goto the_end; if (!ret) continue; #if CONFIG_AVFILTER if ( last_w != frame->width || last_h != frame->height || last_format != frame->format || last_serial != is->viddec.pkt_serial || last_vfilter_idx != is->vfilter_idx) { av_log(NULL, AV_LOG_DEBUG, "Video frame changed from size:%dx%d format:%s serial:%d to size:%dx%d format:%s serial:%d\n", last_w, last_h, (const char *)av_x_if_null(av_get_pix_fmt_name(last_format), "none"), last_serial, frame->width, frame->height, (const char *)av_x_if_null(av_get_pix_fmt_name(frame->format), "none"), is->viddec.pkt_serial); avfilter_graph_free(&graph); graph = avfilter_graph_alloc(); if ((ret = configure_video_filters(graph, is, vfilters_list ? vfilters_list[is->vfilter_idx] : NULL, frame)) < 0) { SDL_Event event; event.type = FF_QUIT_EVENT; event.user.data1 = is; SDL_PushEvent(&event); goto the_end; } filt_in = is->in_video_filter; filt_out = is->out_video_filter; last_w = frame->width; last_h = frame->height; last_format = frame->format; last_serial = is->viddec.pkt_serial; last_vfilter_idx = is->vfilter_idx; frame_rate = filt_out->inputs[0]->frame_rate; } ret = av_buffersrc_add_frame(filt_in, frame); if (ret < 0) goto the_end; while (ret >= 0) { is->frame_last_returned_time = av_gettime_relative() / 1000000.0; ret = av_buffersink_get_frame_flags(filt_out, frame, 0); if (ret < 0) { if (ret == AVERROR_EOF) is->viddec.finished = is->viddec.pkt_serial; ret = 0; break; } is->frame_last_filter_delay = av_gettime_relative() / 1000000.0 - is->frame_last_returned_time; if (fabs(is->frame_last_filter_delay) > AV_NOSYNC_THRESHOLD / 10.0) is->frame_last_filter_delay = 0; tb = filt_out->inputs[0]->time_base; #endif duration = (frame_rate.num && frame_rate.den ? av_q2d((AVRational){frame_rate.den, frame_rate.num}) : 0); pts = (frame->pts == AV_NOPTS_VALUE) ? NAN : frame->pts * av_q2d(tb); ret = queue_picture(is, frame, pts, duration, av_frame_get_pkt_pos(frame), is->viddec.pkt_serial); av_frame_unref(frame); #if CONFIG_AVFILTER } #endif if (ret < 0) goto the_end; } the_end: #if CONFIG_AVFILTER avfilter_graph_free(&graph); #endif av_frame_free(&frame); return 0; } static int subtitle_thread(void *arg) { VideoState *is = arg; Frame *sp; int got_subtitle; double pts; for (;;) { if (!(sp = frame_queue_peek_writable(&is->subpq))) return 0; if ((got_subtitle = decoder_decode_frame(&is->subdec, NULL, &sp->sub)) < 0) break; pts = 0; if (got_subtitle && sp->sub.format == 0) { if (sp->sub.pts != AV_NOPTS_VALUE) pts = sp->sub.pts / (double)AV_TIME_BASE; sp->pts = pts; sp->serial = is->subdec.pkt_serial; sp->width = is->subdec.avctx->width; sp->height = is->subdec.avctx->height; sp->uploaded = 0; /* now we can update the picture count */ frame_queue_push(&is->subpq); } else if (got_subtitle) { avsubtitle_free(&sp->sub); } } return 0; } /* copy samples for viewing in editor window */ static void update_sample_display(VideoState *is, short *samples, int samples_size) { int size, len; size = samples_size / sizeof(short); while (size > 0) { len = SAMPLE_ARRAY_SIZE - is->sample_array_index; if (len > size) len = size; memcpy(is->sample_array + is->sample_array_index, samples, len * sizeof(short)); samples += len; is->sample_array_index += len; if (is->sample_array_index >= SAMPLE_ARRAY_SIZE) is->sample_array_index = 0; size -= len; } } /* return the wanted number of samples to get better sync if sync_type is video * or external master clock */ static int synchronize_audio(VideoState *is, int nb_samples) { int wanted_nb_samples = nb_samples; /* if not master, then we try to remove or add samples to correct the clock */ if (get_master_sync_type(is) != AV_SYNC_AUDIO_MASTER) { double diff, avg_diff; int min_nb_samples, max_nb_samples; diff = get_clock(&is->audclk) - get_master_clock(is); if (!isnan(diff) && fabs(diff) < AV_NOSYNC_THRESHOLD) { is->audio_diff_cum = diff + is->audio_diff_avg_coef * is->audio_diff_cum; if (is->audio_diff_avg_count < AUDIO_DIFF_AVG_NB) { /* not enough measures to have a correct estimate */ is->audio_diff_avg_count++; } else { /* estimate the A-V difference */ avg_diff = is->audio_diff_cum * (1.0 - is->audio_diff_avg_coef); if (fabs(avg_diff) >= is->audio_diff_threshold) { wanted_nb_samples = nb_samples + (int)(diff * is->audio_src.freq); min_nb_samples = ((nb_samples * (100 - SAMPLE_CORRECTION_PERCENT_MAX) / 100)); max_nb_samples = ((nb_samples * (100 + SAMPLE_CORRECTION_PERCENT_MAX) / 100)); wanted_nb_samples = av_clip(wanted_nb_samples, min_nb_samples, max_nb_samples); } av_log(NULL, AV_LOG_TRACE, "diff=%f adiff=%f sample_diff=%d apts=%0.3f %f\n", diff, avg_diff, wanted_nb_samples - nb_samples, is->audio_clock, is->audio_diff_threshold); } } else { /* too big difference : may be initial PTS errors, so reset A-V filter */ is->audio_diff_avg_count = 0; is->audio_diff_cum = 0; } } return wanted_nb_samples; } /** * Decode one audio frame and return its uncompressed size. * * The processed audio frame is decoded, converted if required, and * stored in is->audio_buf, with size in bytes given by the return * value. */ static int audio_decode_frame(VideoState *is) { int data_size, resampled_data_size; int64_t dec_channel_layout; av_unused double audio_clock0; int wanted_nb_samples; Frame *af; if (is->paused) return -1; do { #if defined(_WIN32) while (frame_queue_nb_remaining(&is->sampq) == 0) { if ((av_gettime_relative() - audio_callback_time) > 1000000LL * is->audio_hw_buf_size / is->audio_tgt.bytes_per_sec / 2) return -1; av_usleep (1000); } #endif if (!(af = frame_queue_peek_readable(&is->sampq))) return -1; frame_queue_next(&is->sampq); } while (af->serial != is->audioq.serial); data_size = av_samples_get_buffer_size(NULL, av_frame_get_channels(af->frame), af->frame->nb_samples, af->frame->format, 1); dec_channel_layout = (af->frame->channel_layout && av_frame_get_channels(af->frame) == av_get_channel_layout_nb_channels(af->frame->channel_layout)) ? af->frame->channel_layout : av_get_default_channel_layout(av_frame_get_channels(af->frame)); wanted_nb_samples = synchronize_audio(is, af->frame->nb_samples); if (af->frame->format != is->audio_src.fmt || dec_channel_layout != is->audio_src.channel_layout || af->frame->sample_rate != is->audio_src.freq || (wanted_nb_samples != af->frame->nb_samples && !is->swr_ctx)) { swr_free(&is->swr_ctx); is->swr_ctx = swr_alloc_set_opts(NULL, is->audio_tgt.channel_layout, is->audio_tgt.fmt, is->audio_tgt.freq, dec_channel_layout, af->frame->format, af->frame->sample_rate, 0, NULL); if (!is->swr_ctx || swr_init(is->swr_ctx) < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot create sample rate converter for conversion of %d Hz %s %d channels to %d Hz %s %d channels!\n", af->frame->sample_rate, av_get_sample_fmt_name(af->frame->format), av_frame_get_channels(af->frame), is->audio_tgt.freq, av_get_sample_fmt_name(is->audio_tgt.fmt), is->audio_tgt.channels); swr_free(&is->swr_ctx); return -1; } is->audio_src.channel_layout = dec_channel_layout; is->audio_src.channels = av_frame_get_channels(af->frame); is->audio_src.freq = af->frame->sample_rate; is->audio_src.fmt = af->frame->format; } if (is->swr_ctx) { const uint8_t **in = (const uint8_t **)af->frame->extended_data; uint8_t **out = &is->audio_buf1; int out_count = (int64_t)wanted_nb_samples * is->audio_tgt.freq / af->frame->sample_rate + 256; int out_size = av_samples_get_buffer_size(NULL, is->audio_tgt.channels, out_count, is->audio_tgt.fmt, 0); int len2; if (out_size < 0) { av_log(NULL, AV_LOG_ERROR, "av_samples_get_buffer_size() failed\n"); return -1; } if (wanted_nb_samples != af->frame->nb_samples) { if (swr_set_compensation(is->swr_ctx, (wanted_nb_samples - af->frame->nb_samples) * is->audio_tgt.freq / af->frame->sample_rate, wanted_nb_samples * is->audio_tgt.freq / af->frame->sample_rate) < 0) { av_log(NULL, AV_LOG_ERROR, "swr_set_compensation() failed\n"); return -1; } } av_fast_malloc(&is->audio_buf1, &is->audio_buf1_size, out_size); if (!is->audio_buf1) return AVERROR(ENOMEM); len2 = swr_convert(is->swr_ctx, out, out_count, in, af->frame->nb_samples); if (len2 < 0) { av_log(NULL, AV_LOG_ERROR, "swr_convert() failed\n"); return -1; } if (len2 == out_count) { av_log(NULL, AV_LOG_WARNING, "audio buffer is probably too small\n"); if (swr_init(is->swr_ctx) < 0) swr_free(&is->swr_ctx); } is->audio_buf = is->audio_buf1; resampled_data_size = len2 * is->audio_tgt.channels * av_get_bytes_per_sample(is->audio_tgt.fmt); } else { is->audio_buf = af->frame->data[0]; resampled_data_size = data_size; } audio_clock0 = is->audio_clock; /* update the audio clock with the pts */ if (!isnan(af->pts)) is->audio_clock = af->pts + (double) af->frame->nb_samples / af->frame->sample_rate; else is->audio_clock = NAN; is->audio_clock_serial = af->serial; #ifdef DEBUG { static double last_clock; printf("audio: delay=%0.3f clock=%0.3f clock0=%0.3f\n", is->audio_clock - last_clock, is->audio_clock, audio_clock0); last_clock = is->audio_clock; } #endif return resampled_data_size; } /* prepare a new audio buffer */ static void sdl_audio_callback(void *opaque, Uint8 *stream, int len) { VideoState *is = opaque; int audio_size, len1; audio_callback_time = av_gettime_relative(); while (len > 0) { if (is->audio_buf_index >= is->audio_buf_size) { audio_size = audio_decode_frame(is); if (audio_size < 0) { /* if error, just output silence */ is->audio_buf = NULL; is->audio_buf_size = SDL_AUDIO_MIN_BUFFER_SIZE / is->audio_tgt.frame_size * is->audio_tgt.frame_size; } else { if (is->show_mode != SHOW_MODE_VIDEO) update_sample_display(is, (int16_t *)is->audio_buf, audio_size); is->audio_buf_size = audio_size; } is->audio_buf_index = 0; } len1 = is->audio_buf_size - is->audio_buf_index; if (len1 > len) len1 = len; if (!is->muted && is->audio_buf && is->audio_volume == SDL_MIX_MAXVOLUME) memcpy(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1); else { memset(stream, 0, len1); if (!is->muted && is->audio_buf) SDL_MixAudio(stream, (uint8_t *)is->audio_buf + is->audio_buf_index, len1, is->audio_volume); } len -= len1; stream += len1; is->audio_buf_index += len1; } is->audio_write_buf_size = is->audio_buf_size - is->audio_buf_index; /* Let's assume the audio driver that is used by SDL has two periods. */ if (!isnan(is->audio_clock)) { set_clock_at(&is->audclk, is->audio_clock - (double)(2 * is->audio_hw_buf_size + is->audio_write_buf_size) / is->audio_tgt.bytes_per_sec, is->audio_clock_serial, audio_callback_time / 1000000.0); sync_clock_to_slave(&is->extclk, &is->audclk); } } static int audio_open(void *opaque, int64_t wanted_channel_layout, int wanted_nb_channels, int wanted_sample_rate, struct AudioParams *audio_hw_params) { SDL_AudioSpec wanted_spec, spec; const char *env; static const int next_nb_channels[] = {0, 0, 1, 6, 2, 6, 4, 6}; static const int next_sample_rates[] = {0, 44100, 48000, 96000, 192000}; int next_sample_rate_idx = FF_ARRAY_ELEMS(next_sample_rates) - 1; env = SDL_getenv("SDL_AUDIO_CHANNELS"); if (env) { wanted_nb_channels = atoi(env); wanted_channel_layout = av_get_default_channel_layout(wanted_nb_channels); } if (!wanted_channel_layout || wanted_nb_channels != av_get_channel_layout_nb_channels(wanted_channel_layout)) { wanted_channel_layout = av_get_default_channel_layout(wanted_nb_channels); wanted_channel_layout &= ~AV_CH_LAYOUT_STEREO_DOWNMIX; } wanted_nb_channels = av_get_channel_layout_nb_channels(wanted_channel_layout); wanted_spec.channels = wanted_nb_channels; wanted_spec.freq = wanted_sample_rate; if (wanted_spec.freq <= 0 || wanted_spec.channels <= 0) { av_log(NULL, AV_LOG_ERROR, "Invalid sample rate or channel count!\n"); return -1; } while (next_sample_rate_idx && next_sample_rates[next_sample_rate_idx] >= wanted_spec.freq) next_sample_rate_idx--; wanted_spec.format = AUDIO_S16SYS; wanted_spec.silence = 0; wanted_spec.samples = FFMAX(SDL_AUDIO_MIN_BUFFER_SIZE, 2 << av_log2(wanted_spec.freq / SDL_AUDIO_MAX_CALLBACKS_PER_SEC)); wanted_spec.callback = sdl_audio_callback; wanted_spec.userdata = opaque; while (SDL_OpenAudio(&wanted_spec, &spec) < 0) { av_log(NULL, AV_LOG_WARNING, "SDL_OpenAudio (%d channels, %d Hz): %s\n", wanted_spec.channels, wanted_spec.freq, SDL_GetError()); wanted_spec.channels = next_nb_channels[FFMIN(7, wanted_spec.channels)]; if (!wanted_spec.channels) { wanted_spec.freq = next_sample_rates[next_sample_rate_idx--]; wanted_spec.channels = wanted_nb_channels; if (!wanted_spec.freq) { av_log(NULL, AV_LOG_ERROR, "No more combinations to try, audio open failed\n"); return -1; } } wanted_channel_layout = av_get_default_channel_layout(wanted_spec.channels); } if (spec.format != AUDIO_S16SYS) { av_log(NULL, AV_LOG_ERROR, "SDL advised audio format %d is not supported!\n", spec.format); return -1; } if (spec.channels != wanted_spec.channels) { wanted_channel_layout = av_get_default_channel_layout(spec.channels); if (!wanted_channel_layout) { av_log(NULL, AV_LOG_ERROR, "SDL advised channel count %d is not supported!\n", spec.channels); return -1; } } audio_hw_params->fmt = AV_SAMPLE_FMT_S16; audio_hw_params->freq = spec.freq; audio_hw_params->channel_layout = wanted_channel_layout; audio_hw_params->channels = spec.channels; audio_hw_params->frame_size = av_samples_get_buffer_size(NULL, audio_hw_params->channels, 1, audio_hw_params->fmt, 1); audio_hw_params->bytes_per_sec = av_samples_get_buffer_size(NULL, audio_hw_params->channels, audio_hw_params->freq, audio_hw_params->fmt, 1); if (audio_hw_params->bytes_per_sec <= 0 || audio_hw_params->frame_size <= 0) { av_log(NULL, AV_LOG_ERROR, "av_samples_get_buffer_size failed\n"); return -1; } return spec.size; } /* open a given stream. Return 0 if OK */ static int stream_component_open(VideoState *is, int stream_index) { AVFormatContext *ic = is->ic; AVCodecContext *avctx; AVCodec *codec; const char *forced_codec_name = NULL; AVDictionary *opts = NULL; AVDictionaryEntry *t = NULL; int sample_rate, nb_channels; int64_t channel_layout; int ret = 0; int stream_lowres = lowres; if (stream_index < 0 || stream_index >= ic->nb_streams) return -1; avctx = avcodec_alloc_context3(NULL); if (!avctx) return AVERROR(ENOMEM); ret = avcodec_parameters_to_context(avctx, ic->streams[stream_index]->codecpar); if (ret < 0) goto fail; av_codec_set_pkt_timebase(avctx, ic->streams[stream_index]->time_base); codec = avcodec_find_decoder(avctx->codec_id); switch(avctx->codec_type){ case AVMEDIA_TYPE_AUDIO : is->last_audio_stream = stream_index; forced_codec_name = audio_codec_name; break; case AVMEDIA_TYPE_SUBTITLE: is->last_subtitle_stream = stream_index; forced_codec_name = subtitle_codec_name; break; case AVMEDIA_TYPE_VIDEO : is->last_video_stream = stream_index; forced_codec_name = video_codec_name; break; } if (forced_codec_name) codec = avcodec_find_decoder_by_name(forced_codec_name); if (!codec) { if (forced_codec_name) av_log(NULL, AV_LOG_WARNING, "No codec could be found with name '%s'\n", forced_codec_name); else av_log(NULL, AV_LOG_WARNING, "No codec could be found with id %d\n", avctx->codec_id); ret = AVERROR(EINVAL); goto fail; } avctx->codec_id = codec->id; if(stream_lowres > av_codec_get_max_lowres(codec)){ av_log(avctx, AV_LOG_WARNING, "The maximum value for lowres supported by the decoder is %d\n", av_codec_get_max_lowres(codec)); stream_lowres = av_codec_get_max_lowres(codec); } av_codec_set_lowres(avctx, stream_lowres); #if FF_API_EMU_EDGE if(stream_lowres) avctx->flags |= CODEC_FLAG_EMU_EDGE; #endif if (fast) avctx->flags2 |= AV_CODEC_FLAG2_FAST; #if FF_API_EMU_EDGE if(codec->capabilities & AV_CODEC_CAP_DR1) avctx->flags |= CODEC_FLAG_EMU_EDGE; #endif opts = filter_codec_opts(codec_opts, avctx->codec_id, ic, ic->streams[stream_index], codec); if (!av_dict_get(opts, "threads", NULL, 0)) av_dict_set(&opts, "threads", "auto", 0); if (stream_lowres) av_dict_set_int(&opts, "lowres", stream_lowres, 0); if (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) av_dict_set(&opts, "refcounted_frames", "1", 0); if ((ret = avcodec_open2(avctx, codec, &opts)) < 0) { goto fail; } if ((t = av_dict_get(opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); ret = AVERROR_OPTION_NOT_FOUND; goto fail; } is->eof = 0; ic->streams[stream_index]->discard = AVDISCARD_DEFAULT; switch (avctx->codec_type) { case AVMEDIA_TYPE_AUDIO: #if CONFIG_AVFILTER { AVFilterLink *link; is->audio_filter_src.freq = avctx->sample_rate; is->audio_filter_src.channels = avctx->channels; is->audio_filter_src.channel_layout = get_valid_channel_layout(avctx->channel_layout, avctx->channels); is->audio_filter_src.fmt = avctx->sample_fmt; if ((ret = configure_audio_filters(is, afilters, 0)) < 0) goto fail; link = is->out_audio_filter->inputs[0]; sample_rate = link->sample_rate; nb_channels = avfilter_link_get_channels(link); channel_layout = link->channel_layout; } #else sample_rate = avctx->sample_rate; nb_channels = avctx->channels; channel_layout = avctx->channel_layout; #endif /* prepare audio output */ if ((ret = audio_open(is, channel_layout, nb_channels, sample_rate, &is->audio_tgt)) < 0) goto fail; is->audio_hw_buf_size = ret; is->audio_src = is->audio_tgt; is->audio_buf_size = 0; is->audio_buf_index = 0; /* init averaging filter */ is->audio_diff_avg_coef = exp(log(0.01) / AUDIO_DIFF_AVG_NB); is->audio_diff_avg_count = 0; /* since we do not have a precise anough audio FIFO fullness, we correct audio sync only if larger than this threshold */ is->audio_diff_threshold = (double)(is->audio_hw_buf_size) / is->audio_tgt.bytes_per_sec; is->audio_stream = stream_index; is->audio_st = ic->streams[stream_index]; decoder_init(&is->auddec, avctx, &is->audioq, is->continue_read_thread); if ((is->ic->iformat->flags & (AVFMT_NOBINSEARCH | AVFMT_NOGENSEARCH | AVFMT_NO_BYTE_SEEK)) && !is->ic->iformat->read_seek) { is->auddec.start_pts = is->audio_st->start_time; is->auddec.start_pts_tb = is->audio_st->time_base; } if ((ret = decoder_start(&is->auddec, audio_thread, is)) < 0) goto out; SDL_PauseAudio(0); break; case AVMEDIA_TYPE_VIDEO: is->video_stream = stream_index; is->video_st = ic->streams[stream_index]; decoder_init(&is->viddec, avctx, &is->videoq, is->continue_read_thread); if ((ret = decoder_start(&is->viddec, video_thread, is)) < 0) goto out; is->queue_attachments_req = 1; break; case AVMEDIA_TYPE_SUBTITLE: is->subtitle_stream = stream_index; is->subtitle_st = ic->streams[stream_index]; decoder_init(&is->subdec, avctx, &is->subtitleq, is->continue_read_thread); if ((ret = decoder_start(&is->subdec, subtitle_thread, is)) < 0) goto out; break; default: break; } goto out; fail: avcodec_free_context(&avctx); out: av_dict_free(&opts); return ret; } static int decode_interrupt_cb(void *ctx) { VideoState *is = ctx; return is->abort_request; } static int stream_has_enough_packets(AVStream *st, int stream_id, PacketQueue *queue) { return stream_id < 0 || queue->abort_request || (st->disposition & AV_DISPOSITION_ATTACHED_PIC) || queue->nb_packets > MIN_FRAMES && (!queue->duration || av_q2d(st->time_base) * queue->duration > 1.0); } static int is_realtime(AVFormatContext *s) { if( !strcmp(s->iformat->name, "rtp") || !strcmp(s->iformat->name, "rtsp") || !strcmp(s->iformat->name, "sdp") ) return 1; if(s->pb && ( !strncmp(s->filename, "rtp:", 4) || !strncmp(s->filename, "udp:", 4) ) ) return 1; return 0; } /* this thread gets the stream from the disk or the network */ static int read_thread(void *arg) { VideoState *is = arg; AVFormatContext *ic = NULL; int err, i, ret; int st_index[AVMEDIA_TYPE_NB]; AVPacket pkt1, *pkt = &pkt1; int64_t stream_start_time; int pkt_in_play_range = 0; AVDictionaryEntry *t; AVDictionary **opts; int orig_nb_streams; SDL_mutex *wait_mutex = SDL_CreateMutex(); int scan_all_pmts_set = 0; int64_t pkt_ts; if (!wait_mutex) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); ret = AVERROR(ENOMEM); goto fail; } memset(st_index, -1, sizeof(st_index)); is->last_video_stream = is->video_stream = -1; is->last_audio_stream = is->audio_stream = -1; is->last_subtitle_stream = is->subtitle_stream = -1; is->eof = 0; ic = avformat_alloc_context(); if (!ic) { av_log(NULL, AV_LOG_FATAL, "Could not allocate context.\n"); ret = AVERROR(ENOMEM); goto fail; } ic->interrupt_callback.callback = decode_interrupt_cb; ic->interrupt_callback.opaque = is; if (!av_dict_get(format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE)) { av_dict_set(&format_opts, "scan_all_pmts", "1", AV_DICT_DONT_OVERWRITE); scan_all_pmts_set = 1; } err = avformat_open_input(&ic, is->filename, is->iformat, &format_opts); if (err < 0) { print_error(is->filename, err); ret = -1; goto fail; } if (scan_all_pmts_set) av_dict_set(&format_opts, "scan_all_pmts", NULL, AV_DICT_MATCH_CASE); if ((t = av_dict_get(format_opts, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_ERROR, "Option %s not found.\n", t->key); ret = AVERROR_OPTION_NOT_FOUND; goto fail; } is->ic = ic; if (genpts) ic->flags |= AVFMT_FLAG_GENPTS; av_format_inject_global_side_data(ic); opts = setup_find_stream_info_opts(ic, codec_opts); orig_nb_streams = ic->nb_streams; err = avformat_find_stream_info(ic, opts); for (i = 0; i < orig_nb_streams; i++) av_dict_free(&opts[i]); av_freep(&opts); if (err < 0) { av_log(NULL, AV_LOG_WARNING, "%s: could not find codec parameters\n", is->filename); ret = -1; goto fail; } if (ic->pb) ic->pb->eof_reached = 0; // FIXME hack, ffplay maybe should not use avio_feof() to test for the end if (seek_by_bytes < 0) seek_by_bytes = !!(ic->iformat->flags & AVFMT_TS_DISCONT) && strcmp("ogg", ic->iformat->name); is->max_frame_duration = (ic->iformat->flags & AVFMT_TS_DISCONT) ? 10.0 : 3600.0; if (!window_title && (t = av_dict_get(ic->metadata, "title", NULL, 0))) window_title = av_asprintf("%s - %s", t->value, input_filename); /* if seeking requested, we execute it */ if (start_time != AV_NOPTS_VALUE) { int64_t timestamp; timestamp = start_time; /* add the stream start time */ if (ic->start_time != AV_NOPTS_VALUE) timestamp += ic->start_time; ret = avformat_seek_file(ic, -1, INT64_MIN, timestamp, INT64_MAX, 0); if (ret < 0) { av_log(NULL, AV_LOG_WARNING, "%s: could not seek to position %0.3f\n", is->filename, (double)timestamp / AV_TIME_BASE); } } is->realtime = is_realtime(ic); if (show_status) av_dump_format(ic, 0, is->filename, 0); for (i = 0; i < ic->nb_streams; i++) { AVStream *st = ic->streams[i]; enum AVMediaType type = st->codecpar->codec_type; st->discard = AVDISCARD_ALL; if (type >= 0 && wanted_stream_spec[type] && st_index[type] == -1) if (avformat_match_stream_specifier(ic, st, wanted_stream_spec[type]) > 0) st_index[type] = i; } for (i = 0; i < AVMEDIA_TYPE_NB; i++) { if (wanted_stream_spec[i] && st_index[i] == -1) { av_log(NULL, AV_LOG_ERROR, "Stream specifier %s does not match any %s stream\n", wanted_stream_spec[i], av_get_media_type_string(i)); st_index[i] = INT_MAX; } } if (!video_disable) st_index[AVMEDIA_TYPE_VIDEO] = av_find_best_stream(ic, AVMEDIA_TYPE_VIDEO, st_index[AVMEDIA_TYPE_VIDEO], -1, NULL, 0); if (!audio_disable) st_index[AVMEDIA_TYPE_AUDIO] = av_find_best_stream(ic, AVMEDIA_TYPE_AUDIO, st_index[AVMEDIA_TYPE_AUDIO], st_index[AVMEDIA_TYPE_VIDEO], NULL, 0); if (!video_disable && !subtitle_disable) st_index[AVMEDIA_TYPE_SUBTITLE] = av_find_best_stream(ic, AVMEDIA_TYPE_SUBTITLE, st_index[AVMEDIA_TYPE_SUBTITLE], (st_index[AVMEDIA_TYPE_AUDIO] >= 0 ? st_index[AVMEDIA_TYPE_AUDIO] : st_index[AVMEDIA_TYPE_VIDEO]), NULL, 0); is->show_mode = show_mode; if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { AVStream *st = ic->streams[st_index[AVMEDIA_TYPE_VIDEO]]; AVCodecParameters *codecpar = st->codecpar; AVRational sar = av_guess_sample_aspect_ratio(ic, st, NULL); if (codecpar->width) set_default_window_size(codecpar->width, codecpar->height, sar); } /* open the streams */ if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) { stream_component_open(is, st_index[AVMEDIA_TYPE_AUDIO]); } ret = -1; if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { ret = stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]); } if (is->show_mode == SHOW_MODE_NONE) is->show_mode = ret >= 0 ? SHOW_MODE_VIDEO : SHOW_MODE_RDFT; if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) { stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]); } if (is->video_stream < 0 && is->audio_stream < 0) { av_log(NULL, AV_LOG_FATAL, "Failed to open file '%s' or configure filtergraph\n", is->filename); ret = -1; goto fail; } if (infinite_buffer < 0 && is->realtime) infinite_buffer = 1; for (;;) { if (is->abort_request) break; if (is->paused != is->last_paused) { is->last_paused = is->paused; if (is->paused) is->read_pause_return = av_read_pause(ic); else av_read_play(ic); } #if CONFIG_RTSP_DEMUXER || CONFIG_MMSH_PROTOCOL if (is->paused && (!strcmp(ic->iformat->name, "rtsp") || (ic->pb && !strncmp(input_filename, "mmsh:", 5)))) { /* wait 10 ms to avoid trying to get another packet */ /* XXX: horrible */ SDL_Delay(10); continue; } #endif if (is->seek_req) { int64_t seek_target = is->seek_pos; int64_t seek_min = is->seek_rel > 0 ? seek_target - is->seek_rel + 2: INT64_MIN; int64_t seek_max = is->seek_rel < 0 ? seek_target - is->seek_rel - 2: INT64_MAX; // FIXME the +-2 is due to rounding being not done in the correct direction in generation // of the seek_pos/seek_rel variables ret = avformat_seek_file(is->ic, -1, seek_min, seek_target, seek_max, is->seek_flags); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "%s: error while seeking\n", is->ic->filename); } else { if (is->audio_stream >= 0) { packet_queue_flush(&is->audioq); packet_queue_put(&is->audioq, &flush_pkt); } if (is->subtitle_stream >= 0) { packet_queue_flush(&is->subtitleq); packet_queue_put(&is->subtitleq, &flush_pkt); } if (is->video_stream >= 0) { packet_queue_flush(&is->videoq); packet_queue_put(&is->videoq, &flush_pkt); } if (is->seek_flags & AVSEEK_FLAG_BYTE) { set_clock(&is->extclk, NAN, 0); } else { set_clock(&is->extclk, seek_target / (double)AV_TIME_BASE, 0); } } is->seek_req = 0; is->queue_attachments_req = 1; is->eof = 0; if (is->paused) step_to_next_frame(is); } if (is->queue_attachments_req) { if (is->video_st && is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC) { AVPacket copy; if ((ret = av_copy_packet(&copy, &is->video_st->attached_pic)) < 0) goto fail; packet_queue_put(&is->videoq, &copy); packet_queue_put_nullpacket(&is->videoq, is->video_stream); } is->queue_attachments_req = 0; } /* if the queue are full, no need to read more */ if (infinite_buffer<1 && (is->audioq.size + is->videoq.size + is->subtitleq.size > MAX_QUEUE_SIZE || (stream_has_enough_packets(is->audio_st, is->audio_stream, &is->audioq) && stream_has_enough_packets(is->video_st, is->video_stream, &is->videoq) && stream_has_enough_packets(is->subtitle_st, is->subtitle_stream, &is->subtitleq)))) { /* wait 10 ms */ SDL_LockMutex(wait_mutex); SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10); SDL_UnlockMutex(wait_mutex); continue; } if (!is->paused && (!is->audio_st || (is->auddec.finished == is->audioq.serial && frame_queue_nb_remaining(&is->sampq) == 0)) && (!is->video_st || (is->viddec.finished == is->videoq.serial && frame_queue_nb_remaining(&is->pictq) == 0))) { if (loop != 1 && (!loop || --loop)) { stream_seek(is, start_time != AV_NOPTS_VALUE ? start_time : 0, 0, 0); } else if (autoexit) { ret = AVERROR_EOF; goto fail; } } ret = av_read_frame(ic, pkt); if (ret < 0) { if ((ret == AVERROR_EOF || avio_feof(ic->pb)) && !is->eof) { if (is->video_stream >= 0) packet_queue_put_nullpacket(&is->videoq, is->video_stream); if (is->audio_stream >= 0) packet_queue_put_nullpacket(&is->audioq, is->audio_stream); if (is->subtitle_stream >= 0) packet_queue_put_nullpacket(&is->subtitleq, is->subtitle_stream); is->eof = 1; } if (ic->pb && ic->pb->error) break; SDL_LockMutex(wait_mutex); SDL_CondWaitTimeout(is->continue_read_thread, wait_mutex, 10); SDL_UnlockMutex(wait_mutex); continue; } else { is->eof = 0; } /* check if packet is in play range specified by user, then queue, otherwise discard */ stream_start_time = ic->streams[pkt->stream_index]->start_time; pkt_ts = pkt->pts == AV_NOPTS_VALUE ? pkt->dts : pkt->pts; pkt_in_play_range = duration == AV_NOPTS_VALUE || (pkt_ts - (stream_start_time != AV_NOPTS_VALUE ? stream_start_time : 0)) * av_q2d(ic->streams[pkt->stream_index]->time_base) - (double)(start_time != AV_NOPTS_VALUE ? start_time : 0) / 1000000 <= ((double)duration / 1000000); if (pkt->stream_index == is->audio_stream && pkt_in_play_range) { packet_queue_put(&is->audioq, pkt); } else if (pkt->stream_index == is->video_stream && pkt_in_play_range && !(is->video_st->disposition & AV_DISPOSITION_ATTACHED_PIC)) { packet_queue_put(&is->videoq, pkt); } else if (pkt->stream_index == is->subtitle_stream && pkt_in_play_range) { packet_queue_put(&is->subtitleq, pkt); } else { av_packet_unref(pkt); } } ret = 0; fail: if (ic && !is->ic) avformat_close_input(&ic); if (ret != 0) { SDL_Event event; event.type = FF_QUIT_EVENT; event.user.data1 = is; SDL_PushEvent(&event); } SDL_DestroyMutex(wait_mutex); return 0; } static VideoState *stream_open(const char *filename, AVInputFormat *iformat) { VideoState *is; is = av_mallocz(sizeof(VideoState)); if (!is) return NULL; is->filename = av_strdup(filename); if (!is->filename) goto fail; is->iformat = iformat; is->ytop = 0; is->xleft = 0; /* start video display */ if (frame_queue_init(&is->pictq, &is->videoq, VIDEO_PICTURE_QUEUE_SIZE, 1) < 0) goto fail; if (frame_queue_init(&is->subpq, &is->subtitleq, SUBPICTURE_QUEUE_SIZE, 0) < 0) goto fail; if (frame_queue_init(&is->sampq, &is->audioq, SAMPLE_QUEUE_SIZE, 1) < 0) goto fail; if (packet_queue_init(&is->videoq) < 0 || packet_queue_init(&is->audioq) < 0 || packet_queue_init(&is->subtitleq) < 0) goto fail; if (!(is->continue_read_thread = SDL_CreateCond())) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateCond(): %s\n", SDL_GetError()); goto fail; } init_clock(&is->vidclk, &is->videoq.serial); init_clock(&is->audclk, &is->audioq.serial); init_clock(&is->extclk, &is->extclk.serial); is->audio_clock_serial = -1; is->audio_volume = SDL_MIX_MAXVOLUME; is->muted = 0; is->av_sync_type = av_sync_type; is->read_tid = SDL_CreateThread(read_thread, "read_thread", is); if (!is->read_tid) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateThread(): %s\n", SDL_GetError()); fail: stream_close(is); return NULL; } return is; } static void stream_cycle_channel(VideoState *is, int codec_type) { AVFormatContext *ic = is->ic; int start_index, stream_index; int old_index; AVStream *st; AVProgram *p = NULL; int nb_streams = is->ic->nb_streams; if (codec_type == AVMEDIA_TYPE_VIDEO) { start_index = is->last_video_stream; old_index = is->video_stream; } else if (codec_type == AVMEDIA_TYPE_AUDIO) { start_index = is->last_audio_stream; old_index = is->audio_stream; } else { start_index = is->last_subtitle_stream; old_index = is->subtitle_stream; } stream_index = start_index; if (codec_type != AVMEDIA_TYPE_VIDEO && is->video_stream != -1) { p = av_find_program_from_stream(ic, NULL, is->video_stream); if (p) { nb_streams = p->nb_stream_indexes; for (start_index = 0; start_index < nb_streams; start_index++) if (p->stream_index[start_index] == stream_index) break; if (start_index == nb_streams) start_index = -1; stream_index = start_index; } } for (;;) { if (++stream_index >= nb_streams) { if (codec_type == AVMEDIA_TYPE_SUBTITLE) { stream_index = -1; is->last_subtitle_stream = -1; goto the_end; } if (start_index == -1) return; stream_index = 0; } if (stream_index == start_index) return; st = is->ic->streams[p ? p->stream_index[stream_index] : stream_index]; if (st->codecpar->codec_type == codec_type) { /* check that parameters are OK */ switch (codec_type) { case AVMEDIA_TYPE_AUDIO: if (st->codecpar->sample_rate != 0 && st->codecpar->channels != 0) goto the_end; break; case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_SUBTITLE: goto the_end; default: break; } } } the_end: if (p && stream_index != -1) stream_index = p->stream_index[stream_index]; av_log(NULL, AV_LOG_INFO, "Switch %s stream from #%d to #%d\n", av_get_media_type_string(codec_type), old_index, stream_index); stream_component_close(is, old_index); stream_component_open(is, stream_index); } static void toggle_full_screen(VideoState *is) { is_full_screen = !is_full_screen; SDL_SetWindowFullscreen(window, is_full_screen ? SDL_WINDOW_FULLSCREEN_DESKTOP : 0); } static void toggle_audio_display(VideoState *is) { int next = is->show_mode; do { next = (next + 1) % SHOW_MODE_NB; } while (next != is->show_mode && (next == SHOW_MODE_VIDEO && !is->video_st || next != SHOW_MODE_VIDEO && !is->audio_st)); if (is->show_mode != next) { is->force_refresh = 1; is->show_mode = next; } } static void refresh_loop_wait_event(VideoState *is, SDL_Event *event) { double remaining_time = 0.0; SDL_PumpEvents(); while (!SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_FIRSTEVENT, SDL_LASTEVENT)) { if (!cursor_hidden && av_gettime_relative() - cursor_last_shown > CURSOR_HIDE_DELAY) { SDL_ShowCursor(0); cursor_hidden = 1; } if (remaining_time > 0.0) av_usleep((int64_t)(remaining_time * 1000000.0)); remaining_time = REFRESH_RATE; if (is->show_mode != SHOW_MODE_NONE && (!is->paused || is->force_refresh)) video_refresh(is, &remaining_time); SDL_PumpEvents(); } } static void seek_chapter(VideoState *is, int incr) { int64_t pos = get_master_clock(is) * AV_TIME_BASE; int i; if (!is->ic->nb_chapters) return; /* find the current chapter */ for (i = 0; i < is->ic->nb_chapters; i++) { AVChapter *ch = is->ic->chapters[i]; if (av_compare_ts(pos, AV_TIME_BASE_Q, ch->start, ch->time_base) < 0) { i--; break; } } i += incr; i = FFMAX(i, 0); if (i >= is->ic->nb_chapters) return; av_log(NULL, AV_LOG_VERBOSE, "Seeking to chapter %d.\n", i); stream_seek(is, av_rescale_q(is->ic->chapters[i]->start, is->ic->chapters[i]->time_base, AV_TIME_BASE_Q), 0, 0); } /* handle an event sent by the GUI */ static void event_loop(VideoState *cur_stream) { SDL_Event event; double incr, pos, frac; for (;;) { double x; refresh_loop_wait_event(cur_stream, &event); switch (event.type) { case SDL_KEYDOWN: if (exit_on_keydown) { do_exit(cur_stream); break; } switch (event.key.keysym.sym) { case SDLK_ESCAPE: case SDLK_q: do_exit(cur_stream); break; case SDLK_f: toggle_full_screen(cur_stream); cur_stream->force_refresh = 1; break; case SDLK_p: case SDLK_SPACE: toggle_pause(cur_stream); break; case SDLK_m: toggle_mute(cur_stream); break; case SDLK_KP_MULTIPLY: case SDLK_0: update_volume(cur_stream, 1, SDL_VOLUME_STEP); break; case SDLK_KP_DIVIDE: case SDLK_9: update_volume(cur_stream, -1, SDL_VOLUME_STEP); break; case SDLK_s: // S: Step to next frame step_to_next_frame(cur_stream); break; case SDLK_a: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO); break; case SDLK_v: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO); break; case SDLK_c: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO); stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO); stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE); break; case SDLK_t: stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE); break; case SDLK_w: #if CONFIG_AVFILTER if (cur_stream->show_mode == SHOW_MODE_VIDEO && cur_stream->vfilter_idx < nb_vfilters - 1) { if (++cur_stream->vfilter_idx >= nb_vfilters) cur_stream->vfilter_idx = 0; } else { cur_stream->vfilter_idx = 0; toggle_audio_display(cur_stream); } #else toggle_audio_display(cur_stream); #endif break; case SDLK_PAGEUP: if (cur_stream->ic->nb_chapters <= 1) { incr = 600.0; goto do_seek; } seek_chapter(cur_stream, 1); break; case SDLK_PAGEDOWN: if (cur_stream->ic->nb_chapters <= 1) { incr = -600.0; goto do_seek; } seek_chapter(cur_stream, -1); break; case SDLK_LEFT: incr = -10.0; goto do_seek; case SDLK_RIGHT: incr = 10.0; goto do_seek; case SDLK_UP: incr = 60.0; goto do_seek; case SDLK_DOWN: incr = -60.0; do_seek: if (seek_by_bytes) { pos = -1; if (pos < 0 && cur_stream->video_stream >= 0) pos = frame_queue_last_pos(&cur_stream->pictq); if (pos < 0 && cur_stream->audio_stream >= 0) pos = frame_queue_last_pos(&cur_stream->sampq); if (pos < 0) pos = avio_tell(cur_stream->ic->pb); if (cur_stream->ic->bit_rate) incr *= cur_stream->ic->bit_rate / 8.0; else incr *= 180000.0; pos += incr; stream_seek(cur_stream, pos, incr, 1); } else { pos = get_master_clock(cur_stream); if (isnan(pos)) pos = (double)cur_stream->seek_pos / AV_TIME_BASE; pos += incr; if (cur_stream->ic->start_time != AV_NOPTS_VALUE && pos < cur_stream->ic->start_time / (double)AV_TIME_BASE) pos = cur_stream->ic->start_time / (double)AV_TIME_BASE; stream_seek(cur_stream, (int64_t)(pos * AV_TIME_BASE), (int64_t)(incr * AV_TIME_BASE), 0); } break; default: break; } break; case SDL_MOUSEBUTTONDOWN: if (exit_on_mousedown) { do_exit(cur_stream); break; } if (event.button.button == SDL_BUTTON_LEFT) { static int64_t last_mouse_left_click = 0; if (av_gettime_relative() - last_mouse_left_click <= 500000) { toggle_full_screen(cur_stream); cur_stream->force_refresh = 1; last_mouse_left_click = 0; } else { last_mouse_left_click = av_gettime_relative(); } } case SDL_MOUSEMOTION: if (cursor_hidden) { SDL_ShowCursor(1); cursor_hidden = 0; } cursor_last_shown = av_gettime_relative(); if (event.type == SDL_MOUSEBUTTONDOWN) { if (event.button.button != SDL_BUTTON_RIGHT) break; x = event.button.x; } else { if (!(event.motion.state & SDL_BUTTON_RMASK)) break; x = event.motion.x; } if (seek_by_bytes || cur_stream->ic->duration <= 0) { uint64_t size = avio_size(cur_stream->ic->pb); stream_seek(cur_stream, size*x/cur_stream->width, 0, 1); } else { int64_t ts; int ns, hh, mm, ss; int tns, thh, tmm, tss; tns = cur_stream->ic->duration / 1000000LL; thh = tns / 3600; tmm = (tns % 3600) / 60; tss = (tns % 60); frac = x / cur_stream->width; ns = frac * tns; hh = ns / 3600; mm = (ns % 3600) / 60; ss = (ns % 60); av_log(NULL, AV_LOG_INFO, "Seek to %2.0f%% (%2d:%02d:%02d) of total duration (%2d:%02d:%02d) \n", frac*100, hh, mm, ss, thh, tmm, tss); ts = frac * cur_stream->ic->duration; if (cur_stream->ic->start_time != AV_NOPTS_VALUE) ts += cur_stream->ic->start_time; stream_seek(cur_stream, ts, 0, 0); } break; case SDL_WINDOWEVENT: switch (event.window.event) { case SDL_WINDOWEVENT_RESIZED: screen_width = cur_stream->width = event.window.data1; screen_height = cur_stream->height = event.window.data2; if (cur_stream->vis_texture) { SDL_DestroyTexture(cur_stream->vis_texture); cur_stream->vis_texture = NULL; } case SDL_WINDOWEVENT_EXPOSED: cur_stream->force_refresh = 1; } break; case SDL_QUIT: case FF_QUIT_EVENT: do_exit(cur_stream); break; case FF_ALLOC_EVENT: alloc_picture(event.user.data1); break; default: break; } } } static int opt_frame_size(void *optctx, const char *opt, const char *arg) { av_log(NULL, AV_LOG_WARNING, "Option -s is deprecated, use -video_size.\n"); return opt_default(NULL, "video_size", arg); } static int opt_width(void *optctx, const char *opt, const char *arg) { screen_width = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX); return 0; } static int opt_height(void *optctx, const char *opt, const char *arg) { screen_height = parse_number_or_die(opt, arg, OPT_INT64, 1, INT_MAX); return 0; } static int opt_format(void *optctx, const char *opt, const char *arg) { file_iformat = av_find_input_format(arg); if (!file_iformat) { av_log(NULL, AV_LOG_FATAL, "Unknown input format: %s\n", arg); return AVERROR(EINVAL); } return 0; } static int opt_frame_pix_fmt(void *optctx, const char *opt, const char *arg) { av_log(NULL, AV_LOG_WARNING, "Option -pix_fmt is deprecated, use -pixel_format.\n"); return opt_default(NULL, "pixel_format", arg); } static int opt_sync(void *optctx, const char *opt, const char *arg) { if (!strcmp(arg, "audio")) av_sync_type = AV_SYNC_AUDIO_MASTER; else if (!strcmp(arg, "video")) av_sync_type = AV_SYNC_VIDEO_MASTER; else if (!strcmp(arg, "ext")) av_sync_type = AV_SYNC_EXTERNAL_CLOCK; else { av_log(NULL, AV_LOG_ERROR, "Unknown value for %s: %s\n", opt, arg); exit(1); } return 0; } static int opt_seek(void *optctx, const char *opt, const char *arg) { start_time = parse_time_or_die(opt, arg, 1); return 0; } static int opt_duration(void *optctx, const char *opt, const char *arg) { duration = parse_time_or_die(opt, arg, 1); return 0; } static int opt_show_mode(void *optctx, const char *opt, const char *arg) { show_mode = !strcmp(arg, "video") ? SHOW_MODE_VIDEO : !strcmp(arg, "waves") ? SHOW_MODE_WAVES : !strcmp(arg, "rdft" ) ? SHOW_MODE_RDFT : parse_number_or_die(opt, arg, OPT_INT, 0, SHOW_MODE_NB-1); return 0; } static void opt_input_file(void *optctx, const char *filename) { if (input_filename) { av_log(NULL, AV_LOG_FATAL, "Argument '%s' provided as input filename, but '%s' was already specified.\n", filename, input_filename); exit(1); } if (!strcmp(filename, "-")) filename = "pipe:"; input_filename = filename; } static int opt_codec(void *optctx, const char *opt, const char *arg) { const char *spec = strchr(opt, ':'); if (!spec) { av_log(NULL, AV_LOG_ERROR, "No media specifier was specified in '%s' in option '%s'\n", arg, opt); return AVERROR(EINVAL); } spec++; switch (spec[0]) { case 'a' : audio_codec_name = arg; break; case 's' : subtitle_codec_name = arg; break; case 'v' : video_codec_name = arg; break; default: av_log(NULL, AV_LOG_ERROR, "Invalid media specifier '%s' in option '%s'\n", spec, opt); return AVERROR(EINVAL); } return 0; } static int dummy; static const OptionDef options[] = { #include "cmdutils_common_opts.h" { "x", HAS_ARG, { .func_arg = opt_width }, "force displayed width", "width" }, { "y", HAS_ARG, { .func_arg = opt_height }, "force displayed height", "height" }, { "s", HAS_ARG | OPT_VIDEO, { .func_arg = opt_frame_size }, "set frame size (WxH or abbreviation)", "size" }, { "fs", OPT_BOOL, { &is_full_screen }, "force full screen" }, { "an", OPT_BOOL, { &audio_disable }, "disable audio" }, { "vn", OPT_BOOL, { &video_disable }, "disable video" }, { "sn", OPT_BOOL, { &subtitle_disable }, "disable subtitling" }, { "ast", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_AUDIO] }, "select desired audio stream", "stream_specifier" }, { "vst", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_VIDEO] }, "select desired video stream", "stream_specifier" }, { "sst", OPT_STRING | HAS_ARG | OPT_EXPERT, { &wanted_stream_spec[AVMEDIA_TYPE_SUBTITLE] }, "select desired subtitle stream", "stream_specifier" }, { "ss", HAS_ARG, { .func_arg = opt_seek }, "seek to a given position in seconds", "pos" }, { "t", HAS_ARG, { .func_arg = opt_duration }, "play \"duration\" seconds of audio/video", "duration" }, { "bytes", OPT_INT | HAS_ARG, { &seek_by_bytes }, "seek by bytes 0=off 1=on -1=auto", "val" }, { "nodisp", OPT_BOOL, { &display_disable }, "disable graphical display" }, { "f", HAS_ARG, { .func_arg = opt_format }, "force format", "fmt" }, { "pix_fmt", HAS_ARG | OPT_EXPERT | OPT_VIDEO, { .func_arg = opt_frame_pix_fmt }, "set pixel format", "format" }, { "stats", OPT_BOOL | OPT_EXPERT, { &show_status }, "show status", "" }, { "fast", OPT_BOOL | OPT_EXPERT, { &fast }, "non spec compliant optimizations", "" }, { "genpts", OPT_BOOL | OPT_EXPERT, { &genpts }, "generate pts", "" }, { "drp", OPT_INT | HAS_ARG | OPT_EXPERT, { &decoder_reorder_pts }, "let decoder reorder pts 0=off 1=on -1=auto", ""}, { "lowres", OPT_INT | HAS_ARG | OPT_EXPERT, { &lowres }, "", "" }, { "sync", HAS_ARG | OPT_EXPERT, { .func_arg = opt_sync }, "set audio-video sync. type (type=audio/video/ext)", "type" }, { "autoexit", OPT_BOOL | OPT_EXPERT, { &autoexit }, "exit at the end", "" }, { "exitonkeydown", OPT_BOOL | OPT_EXPERT, { &exit_on_keydown }, "exit on key down", "" }, { "exitonmousedown", OPT_BOOL | OPT_EXPERT, { &exit_on_mousedown }, "exit on mouse down", "" }, { "loop", OPT_INT | HAS_ARG | OPT_EXPERT, { &loop }, "set number of times the playback shall be looped", "loop count" }, { "framedrop", OPT_BOOL | OPT_EXPERT, { &framedrop }, "drop frames when cpu is too slow", "" }, { "infbuf", OPT_BOOL | OPT_EXPERT, { &infinite_buffer }, "don't limit the input buffer size (useful with realtime streams)", "" }, { "window_title", OPT_STRING | HAS_ARG, { &window_title }, "set window title", "window title" }, #if CONFIG_AVFILTER { "vf", OPT_EXPERT | HAS_ARG, { .func_arg = opt_add_vfilter }, "set video filters", "filter_graph" }, { "af", OPT_STRING | HAS_ARG, { &afilters }, "set audio filters", "filter_graph" }, #endif { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" }, { "showmode", HAS_ARG, { .func_arg = opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" }, { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, { .func_arg = opt_default }, "generic catch all option", "" }, { "i", OPT_BOOL, { &dummy}, "read specified file", "input_file"}, { "codec", HAS_ARG, { .func_arg = opt_codec}, "force decoder", "decoder_name" }, { "acodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &audio_codec_name }, "force audio decoder", "decoder_name" }, { "scodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &subtitle_codec_name }, "force subtitle decoder", "decoder_name" }, { "vcodec", HAS_ARG | OPT_STRING | OPT_EXPERT, { &video_codec_name }, "force video decoder", "decoder_name" }, { "autorotate", OPT_BOOL, { &autorotate }, "automatically rotate video", "" }, { NULL, }, }; static void show_usage(void) { av_log(NULL, AV_LOG_INFO, "Simple media player\n"); av_log(NULL, AV_LOG_INFO, "usage: %s [options] input_file\n", program_name); av_log(NULL, AV_LOG_INFO, "\n"); } void show_help_default(const char *opt, const char *arg) { av_log_set_callback(log_callback_help); show_usage(); show_help_options(options, "Main options:", 0, OPT_EXPERT, 0); show_help_options(options, "Advanced options:", OPT_EXPERT, 0, 0); printf("\n"); show_help_children(avcodec_get_class(), AV_OPT_FLAG_DECODING_PARAM); show_help_children(avformat_get_class(), AV_OPT_FLAG_DECODING_PARAM); #if !CONFIG_AVFILTER show_help_children(sws_get_class(), AV_OPT_FLAG_ENCODING_PARAM); #else show_help_children(avfilter_get_class(), AV_OPT_FLAG_FILTERING_PARAM); #endif printf("\nWhile playing:\n" "q, ESC quit\n" "f toggle full screen\n" "p, SPC pause\n" "m toggle mute\n" "9, 0 decrease and increase volume respectively\n" "/, * decrease and increase volume respectively\n" "a cycle audio channel in the current program\n" "v cycle video channel\n" "t cycle subtitle channel in the current program\n" "c cycle program\n" "w cycle video filters or show modes\n" "s activate frame-step mode\n" "left/right seek backward/forward 10 seconds\n" "down/up seek backward/forward 1 minute\n" "page down/page up seek backward/forward 10 minutes\n" "right mouse click seek to percentage in file corresponding to fraction of width\n" "left double-click toggle full screen\n" ); } static int lockmgr(void **mtx, enum AVLockOp op) { switch(op) { case AV_LOCK_CREATE: *mtx = SDL_CreateMutex(); if(!*mtx) { av_log(NULL, AV_LOG_FATAL, "SDL_CreateMutex(): %s\n", SDL_GetError()); return 1; } return 0; case AV_LOCK_OBTAIN: return !!SDL_LockMutex(*mtx); case AV_LOCK_RELEASE: return !!SDL_UnlockMutex(*mtx); case AV_LOCK_DESTROY: SDL_DestroyMutex(*mtx); return 0; } return 1; } /* Called from the main */ int main(int argc, char **argv) { int flags; VideoState *is; init_dynload(); av_log_set_flags(AV_LOG_SKIP_REPEATED); parse_loglevel(argc, argv, options); /* register all codecs, demux and protocols */ #if CONFIG_AVDEVICE avdevice_register_all(); #endif #if CONFIG_AVFILTER avfilter_register_all(); #endif av_register_all(); avformat_network_init(); init_opts(); signal(SIGINT , sigterm_handler); /* Interrupt (ANSI). */ signal(SIGTERM, sigterm_handler); /* Termination (ANSI). */ show_banner(argc, argv, options); parse_options(NULL, argc, argv, options, opt_input_file); if (!input_filename) { show_usage(); av_log(NULL, AV_LOG_FATAL, "An input file must be specified\n"); av_log(NULL, AV_LOG_FATAL, "Use -h to get full help or, even better, run 'man %s'\n", program_name); exit(1); } if (display_disable) { video_disable = 1; } flags = SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER; if (audio_disable) flags &= ~SDL_INIT_AUDIO; else { /* Try to work around an occasional ALSA buffer underflow issue when the * period size is NPOT due to ALSA resampling by forcing the buffer size. */ if (!SDL_getenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE")) SDL_setenv("SDL_AUDIO_ALSA_SET_BUFFER_SIZE","1", 1); } if (display_disable) flags &= ~SDL_INIT_VIDEO; if (SDL_Init (flags)) { av_log(NULL, AV_LOG_FATAL, "Could not initialize SDL - %s\n", SDL_GetError()); av_log(NULL, AV_LOG_FATAL, "(Did you set the DISPLAY variable?)\n"); exit(1); } SDL_EventState(SDL_SYSWMEVENT, SDL_IGNORE); SDL_EventState(SDL_USEREVENT, SDL_IGNORE); if (av_lockmgr_register(lockmgr)) { av_log(NULL, AV_LOG_FATAL, "Could not initialize lock manager!\n"); do_exit(NULL); } av_init_packet(&flush_pkt); flush_pkt.data = (uint8_t *)&flush_pkt; is = stream_open(input_filename, file_iformat); if (!is) { av_log(NULL, AV_LOG_FATAL, "Failed to initialize VideoState!\n"); do_exit(NULL); } event_loop(is); /* never returns */ return 0; } ```
The 1846 East Suffolk by-election was held on 19 February 1846 after the resignation of the incumbent Peelite MP, John Henniker-Major. He was succeeded by the unopposed Protectionist Conservative candidate, Edward Sherlock Gooch who was backed by the other Suffolk MP, Lord Rendlesham. References Unopposed by-elections to the Parliament of the United Kingdom in English constituencies 1846 elections in the United Kingdom 1846 in England East February 1846 events