/*
* Copyright (c) 2021, GPGTools GmbH <team@gpgtools.org>
* All rights reserved.
* 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 GPGTools nor the names of GPGMail
*       contributors may be used to endorse or promote products
*       derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY GPGTools ``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 GPGTools 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.
*/

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@interface MUIWKWebViewController_GPGMail : NSObject

- (id)representedObject;
- (id)baseURL;

@end

NS_ASSUME_NONNULL_END


.getfield ("Character"), false);
                  emit gh_callback_event (m_handle, "keyreleasefcn", keyData);
                }
            }
            break;

          default:
            break;
          }
      }
    else if (qobject_cast<QComboBox *> (watched))
      {
        switch (xevent->type ())
          {
          case QEvent::MouseButtonPress:
            {
              octave::autolock guard (gh_mgr.graphics_lock ());

              QMouseEvent *m = dynamic_cast<QMouseEvent *> (xevent);
              graphics_object go = object ();
              const uitable::properties& tp = Utils::properties<uitable> (go);
              graphics_object fig = go.get_ancestor ("figure");

              if (m->button () != Qt::LeftButton || ! tp.is_enable ())
                {
                  emit gh_set_event (fig.get_handle (), "selectiontype",
                                     Utils::figureSelectionType (m), false);
                  emit gh_set_event (fig.get_handle (), "currentpoint",
                                     Utils::figureCurrentPoint (fig, m),
                                     false);
                  emit gh_callback_event (fig.get_handle (),
                                          "windowbuttondownfcn");
                  emit gh_callback_event (m_handle, "buttondownfcn");

                  if (m->button () == Qt::RightButton)
                    ContextMenu::executeAt (m_interpreter, tp, m->globalPos ());
                }
              else
                {
                  emit gh_set_event (fig.get_handle (), "selectiontype",
                                     Utils::figureSelectionType (m), false);

                  QComboBox *comboBox_0 = qobject_cast<QComboBox *> (watched);
                  for (int row = 0; row < m_tableWidget->rowCount (); row++)
                    {
                      for (int col = 0; col < m_tableWidget->columnCount (); col++)
                        {
                          QComboBox *comboBox_1
                            = qobject_cast<QComboBox *> (m_tableWidget->cellWidget (row, col));

                          if (comboBox_0 == comboBox_1)
                            m_tableWidget->setCurrentCell (row, col);
                        }
                    }
                }
            }
            break;

          default:
            break;
          }
      }
    return false;
  }

#undef AUTO_HEIGHT
}
////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2020 The Octave Project Developers
//
// See the file COPYRIGHT.md in the top-level directory of this
// distribution or <https://octave.org/copyright/>.
//
// This file is part of Octave.
//
// Octave is free software: you can redistribute it and/or modify it
// under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Octave is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Octave; see the file COPYING.  If not, see
// <https://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////

#if define


# -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""List autoscaling policies command."""

from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals

from apitools.base.py import list_pager

from googlecloudsdk.api_lib.dataproc import constants
from googlecloudsdk.api_lib.dataproc import dataproc as dp
from googlecloudsdk.api_lib.dataproc import util
from googlecloudsdk.calliope import base
from googlecloudsdk.command_lib.dataproc import flags

class List(base.ListCommand):
  """List autoscaling policies.

  ## EXAMPLES

  The following command lists all autoscaling policies in Dataproc's
  'us-central1' region:

    $ {command} --region=us-central1
  """

  @staticmethod
  def Args(parser):
    flags.AddRegionFlag(parser)
    base.PAGE_SIZE_FLAG.SetDefault(parser, constants.DEFAULT_PAGE_SIZE)
    parser.display_info.AddFormat("""
          table(
            id:label=ID
          )
    """)
    # Implementation of --uri prints out "name" field for each entry
    parser.display_info.AddUriFunc(lambda resource: resource.name)

  def Run(self, args):
    dataproc = dp.Dataproc(self.ReleaseTrack())
    messages = dataproc.messages

    region = util.ParseRegion(dataproc)

    request = messages.DataprocProjectsRegionsAutoscalingPoliciesListRequest(
        parent=region.RelativeName())

    return list_pager.YieldFromList(
        dataproc.client.projects_regions_autoscalingPolicies,
        request,
        limit=args.limit,
        field='policies',
        batch_size=args.page_size,
        batch_size_attribute='pageSize')


namespace PlumbBuddy.Services;

class GlobalExceptionCatcher :
    IGlobalExceptionCatcher
{
    public GlobalExceptionCatcher(ILogger<IGlobalExceptionCatcher> logger, IAppLifecycleManager appLifecycleManager, ISuperSnacks superSnacks)
    {
        ArgumentNullException.ThrowIfNull(logger);
        ArgumentNullException.ThrowIfNull(appLifecycleManager);
        ArgumentNullException.ThrowIfNull(superSnacks);
        this.logger = logger;
        this.appLifecycleManager = appLifecycleManager;
        this.superSnacks = superSnacks;
        AppDomain.CurrentDomain.UnhandledException += HandleCurrentDomainUnhandledException;
        TaskScheduler.UnobservedTaskException += HandleTaskSchedulerUnobservedTaskException;
        appLifecycleManager.UnhandledException += HandleAppLifecycleManagerUnhandledException;
    }

    ~GlobalExceptionCatcher() =>
        Dispose(false);

    readonly IAppLifecycleManager appLifecycleManager;
    readonly ILogger<IGlobalExceptionCatcher> logger;
    readonly ISuperSnacks superSnacks;

    public void Dispose()
    {
        Dispose(true);
        GC.SuppressFinalize(this);
    }

    void Dispose(bool disposing)
    {
        if (disposing)
        {
            AppDomain.CurrentDomain.UnhandledException -= HandleCurrentDomainUnhandledException;
            TaskScheduler.UnobservedTaskException -= HandleTaskSchedulerUnobservedTaskException;
        }
    }

    void HandleAppLifecycleManagerUnhandledException(object? sender, AppLifecycleUnhandledExceptionEventArgs e) =>
        ProcessException(e.Exception, false);

    void HandleCurrentDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
    {
        if (e.ExceptionObject is Exception ex)
            ProcessException(ex, e.IsTerminating);
    }

    void HandleTaskSchedulerUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
    {
        e.


训的人员颁发培训结业证书。

## 第四章 国际道路运输

第四十七条 国务院交通主管部门应当及时向社会公布中国政府与有关国家政府签署的双边或者多边道路运输协定确定的国际道路运输线路。

第四十八条 申请从事国际道路运输经营的，应当具备下列条件：

(一)依照本条例第十条、第二十四条规定取得道路运输经营许可证的企业法人；

(二)在国内从事道路运输经营满3年，且未发生重大以上道路交通责任事故。

第四十九条 申请从事国际道路运输的，应当向省、自治区、直辖市道路运输管理机构提出申请并提交符合本条例第四十八条规定条件的相关材料。省、自治区、直辖市道路运输管理机构应当自受理申请之日起20日内审查完毕，作出批准或者不予批准的决定。予以批准的，应当向国务院交通主管部门备案；不予批准的，应当向当事人说明理由。

国际道路运输经营者应当持批准文件依法向有关部门办理相关手续。

第五十条 中国国际道路运输经营者应当在其投入运输车辆的显著位置，标明中国国籍识别标志。

外国国际道路运输经营者的车辆在中国境内运输，应当标明本国国籍识别标志，并按照规定的运输线路行驶；不得擅自改变运输线路，不得从事起止地都在中国境内的道路运输经营。

第五十一条 在口岸设立的国际道路运输管理机构应当加强对出入口岸的国际道路运输的监督管理。

第五十二条 外国国际道路运输经营者依法在中国境内设立的常驻代表机构不得从事经营活动。

## 第五章 执法监督

第五十三条 县级以上人民政府交通主管部门应当加强对道路运输管理机构实施道路运输管理工作的指导监督。

第五十四条 道路运输管理机构应当加强执法队伍建设，提高其工作人员的法制、业务素质。

道路运输管


shop=mrreplica", responseText);
      assertThat("currentReplicaStoreYear", isSetTo(2007));
    }
  }

  @Test
  void canFilterItemsByYear() {
    var cleanups =
        new Cleanups(
            withProperty("currentReplicaStoreYear", 2016),
            withItem(ItemPool.REPLICA_MR_ACCESSORY, 1));
    try (cleanups) {
      CoinmasterData data = ReplicaMrStoreRequest.REPLICA_MR_STORE;
      // All items from 2016 are available
      assertThat(data.canBuyItem(ItemPool.REPLICA_WITCHESS_SET), is(true));
      assertThat(data.canBuyItem(ItemPool.REPLICA_INTERGNAT), is(true));
      assertThat(data.canBuyItem(ItemPool.REPLICA_SOURCE_TERMINAL), is(true));
      // Items from 2023 are available
      assertThat(data.canBuyItem(ItemPool.REPLICA_CINCHO_DE_MAYO), is(true));
      assertThat(data.canBuyItem(ItemPool.REPLICA_MR_STORE_2002_CATALOG), is(true));
      // Items from other years are not available
      /* 2004 */ assertThat(data.canBuyItem(ItemPool.REPLICA_DARK_JILL), is(false));
      /* 2005 */ assertThat(data.canBuyItem(ItemPool.REPLICA_WAX_LIPS), is(false));
      /* 2006 */ assertThat(data.canBuyItem(ItemPool.REPLICA_SNOWCONE_BOOK), is(false));
      /* 2007 */ assertThat(data.canBuyItem(ItemPool.REPLICA_NAVEL_RING), is(false));
      /* 2008 */ assertThat(data.canBuyItem(ItemPool.REPLICA_HAIKU_KATANA), is(false));
      /* 2009 */ assertThat(data.canBuyItem(ItemPool.REPLICA_BANDERSNATCH), is(false));
      /* 2010 */ assertThat(data.canBuyItem(ItemPool.REPLICA_GREAT_PANTS), is(false));
      /* 2011 */ assertThat(data.canBuyItem(ItemPool.REPLICA_CUTE_ANGEL), is(false));
      /* 2012 */ assertThat(data.canBuyItem(ItemPool.REPLICA_RESOLUTION_BOOK), is(false));
      /* 2013 */ assertThat(data.canBuyItem(ItemPool.REPLICA_SMITH_BOOK), is(false));
      /* 2014 */ assertThat(data.canBuyItem(ItemPool.REPLICA_GENE_SPLICING_LAB), is(false));
      /* 2015 */ assertThat(data.canBuyItem(ItemPool.REPLICA_DECK_OF_EVERY_CARD), is(false));
      /* 2017 */ assertThat(data.canBuyItem(ItemPool.REPLICA_GENIE_BOTTLE), is(false));
      /* 2018 */ assertThat(data.canBuyItem(ItemPool.REPLICA_GARBAGE_TOTE), is(false));
      /* 2019 */ assertThat(data.canBuyItem(ItemPool.REPLICA_FOURTH_SABER), is(false));
      /* 2020 */ assertThat(data.canBuyItem(ItemPool.REPLICA_CAMELCALF), is(false));
      /* 2021 */ assertThat(data.canBuyItem(ItemPool.REPLICA_EMOTION_CHIP), is(false));
      /* 2022 */ assertThat(data.canBuyItem(ItemPool.REPLICA_JURASSIC_PARKA), is(false));
    }
  }

  @CartesianTest
  public void canOnlyBuyCurrentYearItemOnce(
      @Values(ints = {ItemPool.REPLICA_CINCHO_DE_MAYO, ItemPool.REPLICA_MR_STORE_2002_CATALOG})
          final int itemId,
      @Values(booleans = {false, true}) final boolean haveItem) {
    var cleanups =
        new Cleanups(
            withProperty("currentReplicaStoreYear", 2016), withItem(itemId, haveItem ? 1 : 0));
    try (cleanups) {
      CoinmasterData data = ReplicaMrStoreRequest.REPLICA_


var popup_cd86bae22b4d4ea2a490b78fda8685ff = L.popup({maxWidth: '300'});

                var html_6d27b9959a7541f491d12dc732523b1c = $('
Droneable Customer 86.  Weight: 2.0.
')[0];
                popup_cd86bae22b4d4ea2a490b78fda8685ff.setContent(html_6d27b9959a7541f491d12dc732523b1c);

            marker_127ec3f25af14c3f9465df3023ce50c0.bindPopup(popup_cd86bae22b4d4ea2a490b78fda8685ff);

            var marker_b682112348da453a825b816e6166329e = L.marker(
                [47.508103026,-122.330336197],
                {
                    icon: new L.Icon.Default()
                    }
                )
                .addTo(map_7265417d299b4dcf8de4dc0c231e8eff);

                var icon_ddb208619d3e47e4a190ea5f58a4044b = L.AwesomeMarkers.icon({
                    icon: 'info-sign',
                    iconColor: 'white',
                    markerColor: 'lightgreen',
                    prefix: 'glyphicon',
                    extraClasses: 'fa-rotate-0'
                    });
                marker_b682112348da453a825b816e6166329e.setIcon(icon_ddb208619d3e47e4a190ea5f58a4044b);

            var popup_14a66641c74c4b1c9b4528aa8757f8c4 = L.popup({maxWidth: '300'});

                var html_92bee36e3c8f4bf2aad6e7e9d5345bcf = $('
Droneable Customer 87.  Weight: 4.0.
')[0];
                popup_14a66641c74c4b1c9b4528aa8757f8c4.setContent(html_92bee36e3c8f4bf2aad6e7e9d5345bcf);

            marker_b682112348da453a825b816e6166329e.bindPopup(popup_14a66641c74c4b1c9b4528aa8757f8c4);

            var marker_26b4a98ee55d47e3844f6956a30e6965 = L.marker(
                [47.6319673536,-122.215617834],
                {
                    icon: new L.Icon.Default()
                    }
                )
                .addTo(map_7265417d299b4dcf8de4dc0c231e8eff);

                var icon_3c1135dde7c6472a9c2e7b84ad6f59a6 = L.AwesomeMarkers.icon({
                    icon: 'info-sign',
                    iconColor: 'white',
                    markerColor: 'lightgreen',
                    prefix: 'glyphicon',
                    extraClasses: 'fa-rotate-0'
                    });
                marker_26b4a98ee55d47e3844f6956a30e6965.setIcon(icon_3c1135dde7c6472a9c2e7b84ad6f59a6);

            var popup_5c2240cdfd1d42ad8515a236415fc4b5 = L.popup({maxWidth: '300'});

                var html_41ae8b39


Basic implementation of a Guacamole connection group.

Author:

James Muehlner

Nested Class Summary

Nested classes/interfaces inherited from interface org.glyptodon.guacamole.net.auth.ConnectionGroup

ConnectionGroup.Type

Constructor Summary

Constructors

Constructor and Description

AbstractConnectionGroup()

Method Summary

Methods

Modifier and Type
Method and Description

boolean
equals(Object obj)

String
getIdentifier()

Returns the unique identifier assigned to this ConnectionGroup.

<a


/* 00814 80881A64 3066007F */  andi    $a2, $v1, 0x007F           ## $a2 = 00000000
/* 00818 80881A68 8FA8004C */  lw      $t0, 0x004C($sp)
/* 0081C 80881A6C 3C09DA38 */  lui     $t1, 0xDA38                ## $t1 = DA380000
/* 00820 80881A70 35290003 */  ori     $t1, $t1, 0x0003           ## $t1 = DA380003
/* 00824 80881A74 AD020004 */  sw      $v0, 0x0004($t0)           ## 00000004
/* 00828 80881A78 8E0202D0 */  lw      $v0, 0x02D0($s0)           ## 000002D0
/* 0082C 80881A7C 3C058088 */  lui     $a1, %hi(D_80881BE4)       ## $a1 = 80880000
/* 00830 80881A80 24A51BE4 */  addiu   $a1, $a1, %lo(D_80881BE4)  ## $a1 = 80881BE4
/* 00834 80881A84 24590008 */  addiu   $t9, $v0, 0x0008           ## $t9 = 00000008
/* 00838 80881A88 AE1902D0 */  sw      $t9, 0x02D0($s0)           ## 000002D0
/* 0083C 80881A8C AC490000 */  sw      $t1, 0x0000($v0)           ## 00000000
/* 00840 80881A90 8FAA0074 */  lw      $t2, 0x0074($sp)
/* 00844 80881A94 240601F1 */  addiu   $a2, $zero, 0x01F1         ## $a2 = 000001F1
/* 00848 80881A98 8D440000 */  lw      $a0, 0x0000($t2)           ## 00000000
/* 0084C 80881A9C 0C0346A2 */  jal     Matrix_NewMtx
/* 00850 80881AA0 AFA20048 */  sw      $v0, 0x0048($sp)
/* 00854 80881AA4 8FA30048 */  lw      $v1, 0x0048($sp)
/* 00858 80881AA8 3C0D0402 */  lui     $t5, 0x0402                ## $t5 = 04020000
/* 0085C 80881AAC 25AD84B0 */  addiu   $t5, $t5, 0x84B0           ## $t5 = 040184B0
/* 00860 80881AB0 AC620004 */  sw      $v0, 0x0004($v1)           ## 00000004
/* 00864 80881AB4 8E0202D0 */  lw      $v0, 0x02D0($s0)           ## 000002D0
/* 00868 80881AB8 3C0CDE00 */  lui     $t4, 0xDE00                ## $t4 = DE000000
/* 0086C 80881ABC 3C068088 */  lui     $a2, %hi(D_80881BF8)       ## $a2 = 80880000
/* 00870 80881AC0 244B0008 */  addiu   $t3, $v0, 0x0008           ## $t3 = 00000008
/* 00874 80881AC4 AE0B02D0 */  sw      $t3, 0x02D0($s0)           ## 000002D0
/* 00878 80881AC8 AC4D0004 */  sw      $t5, 0x0004($v0)           ## 00000004
/* 0087C 80881ACC AC4C0000 */  sw      $t4, 0x0000($v0)           ## 00000000
/* 00880 80881AD0 8FAE0074 */  lw      $t6, 0x0074($sp)
/* 00884 80881AD4 24C61BF8 */  addiu   $a2, $a2, %lo(D_80881BF8)  ## $a2 = 80


   0.0       fmadd	d0, d1, d2, d0
# CHECK-NEXT: 5.     2     22.5   0.0    0.0       fmadd	d0, d0, d1, d2
# CHECK-NEXT:        2     15.7   0.1    0.0       <total>

# CHECK:      [3] Code Region - saba

# CHECK:      Iterations:        100
# CHECK-NEXT: Instructions:      400
# CHECK-NEXT: Total Cycles:      1303
# CHECK-NEXT: Total uOps:        400

# CHECK:      Dispatch Width:    16
# CHECK-NEXT: uOps Per Cycle:    0.31
# CHECK-NEXT: IPC:               0.31
# CHECK-NEXT: Block RThroughput: 1.5

# CHECK:      Timeline view:
# CHECK-NEXT:                     0123456789
# CHECK-NEXT: Index     0123456789          012345678

# CHECK:      [0,0]     DeeeeER   .    .    .    .  .   mul	v0.4s, v0.4s, v0.4s
# CHECK-NEXT: [0,1]     D====eeeeER    .    .    .  .   saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: [0,2]     D=====eeeeER   .    .    .  .   saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: [0,3]     D=========eeeeER    .    .  .   saba	v0.4s, v0.4s, v1.4s
# CHECK-NEXT: [1,0]     D=============eeeeER.    .  .   mul	v0.4s, v0.4s, v0.4s
# CHECK-NEXT: [1,1]     D=================eeeeER .  .   saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: [1,2]     D==================eeeeER.  .   saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: [1,3]     D======================eeeeER   saba	v0.4s, v0.4s, v1.4s

# CHECK:      Average Wait times (based on the timeline view):
# CHECK-NEXT: [0]: Executions
# CHECK-NEXT: [1]: Average time spent waiting in a scheduler's queue
# CHECK-NEXT: [2]: Average time spent waiting in a scheduler's queue while ready
# CHECK-NEXT: [3]: Average time elapsed from WB until retire stage

# CHECK:            [0]    [1]    [2]    [3]
# CHECK-NEXT: 0.     2     7.5    0.5    0.0       mul	v0.4s, v0.4s, v0.4s
# CHECK-NEXT: 1.     2     11.5   0.0    0.0       saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: 2.     2     12.5   0.0    0.0       saba	v0.4s, v1.4s, v2.4s
# CHECK-NEXT: 3.     2     16.5   0.0    0.0       saba	v0.4s, v0.4s, v1.4s
# CHECK-NEXT:        2     12.0   0.1    0.0       <total>

# CHECK:      [4] Code Region - sdot

# CHECK:      Iterations:        100
# CHECK-NEXT: Instructions:      400
# CHECK-NEXT: Total Cycles:      1103
# CHECK-NEXT: Total uOps:        400

# CHECK:      Dispatch Width:    16
# CHECK-NEXT: uOps Per Cycle:    0.36
# CHECK-NEXT: IPC:               0.36
# CHECK-NEXT: Block RThroughput: 0.8

# CHECK:      Timeline view:
# CHECK-NEXT:                     0123456789
# CHECK-NEXT: Index     012345


id-python27/python-build/PyQt-x11-gpl-4.8/sip/QtCore/qglobal.sip"
        sipRes = (sipCpp->operator int() == a0->operator int());
#line 129 "sipQtGuiQPainterPixmapFragmentHints.cpp"
            sipReleaseType(const_cast<QPainter::PixmapFragmentHints *>(a0),sipType_QPainter_PixmapFragmentHints,a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_QtGui,eq_slot,sipType_QPainter_PixmapFragmentHints,sipSelf,sipArg);
}

extern "C" {static PyObject *slot_QPainter_PixmapFragmentHints___invert__(PyObject *);}
static PyObject *slot_QPainter_PixmapFragmentHints___invert__(PyObject *sipSelf)
{
    QPainter::PixmapFragmentHints *sipCpp = reinterpret_cast<QPainter::PixmapFragmentHints *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QPainter_PixmapFragmentHints));

    if (!sipCpp)
        return 0;

    {
        {
            QPainter::PixmapFragmentHints *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QPainter::PixmapFragmentHints(~(*sipCpp));
            Py_END_ALLOW_THREADS

            return sipConvertFromNewType(sipRes,sipType_QPainter_PixmapFragmentHints,NULL);
        }
    }
}

extern "C" {static PyObject *slot_QPainter_PixmapFragmentHints___and__(PyObject *,PyObject *);}
static PyObject *slot_QPainter_PixmapFragmentHints___and__(PyObject *sipArg0,PyObject *sipArg1)
{
    PyObject *sipParseErr = NULL;

    {
        QPainter::PixmapFragmentHints * a0;
        int a0State = 0;
        int a1;

        if (sipParsePair(&sipParseErr, sipArg0, sipArg1, "J1i", sipType_QPainter_PixmapFragmentHints, &a0, &a0State, &a1))
        {
            QPainter::PixmapFragmentHints *sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QPainter::PixmapFragmentHints((*a0 & a1));
            Py_END_ALLOW_THREADS
            sipReleaseType(a0,sipType_QPainter_PixmapFragmentHints,a0State);

            return sipConvertFromNewType(sipRes,sipType_QPainter_PixmapFragmentHints,NULL);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return NULL;

    return sipPySlotExtend(&sipModuleAPI_QtGui,and_slot,NULL,sipArg0,sipArg1);
}

extern "C" {static PyObject *slot_QPainter_PixmapFragmentHints___xor__(PyObject *,PyObject *);}
static PyObject *slot_QPainter_PixmapFragmentHints___xor__(PyObject *sipArg0,PyObject *sipArg1)
{
    PyObject *sipParseErr = NULL;

    {
        QPainter::PixmapFragmentHints * a0;
        int a0State = 0;
        QPainter::PixmapFragmentHints * a1;
        int a1State = 0;

        if (sipParsePair(&sipParseErr, sipArg0, sipArg1, "J1J1", sipType_QPainter_PixmapFragmentHints


 the notification object. User
/// activity may include input events or a presence sensor, but is
/// compositor-specific. If an idle inhibitor is active (e.g. another client
/// has created a zwp_idle_inhibitor_v1 on a visible surface), the compositor
/// must not make the notification object idle.
///
/// When the notification object becomes idle, an idled event is sent. When
/// user activity starts again, the notification object stops being idle,
/// a resumed event is sent and the timeout is restarted.
///
class ExtIdleNotificationV1 extends Proxy implements Dispatcher{
  final Context innerContext;
  final version = 1;

  ExtIdleNotificationV1(this.innerContext) : super(innerContext.allocateClientId()){
    innerContext.register(this);
  }

@override
toString(){
return "ExtIdleNotificationV1 {name: 'ext_idle_notification_v1', id: '$objectId', version: '1',}";
}

/// destroy the notification object
///
/// Destroy the notification object.
///
  Result<void,Object> destroy() {
innerContext.unRegister(this);
    logLn("ExtIdleNotificationV1::destroy ");
var arguments = [];var argTypes = <WaylandType>[];
var calclulatedSize  = calculateSize(argTypes, arguments);
final bytesBuilder = BytesBuilder();
bytesBuilder.add(Uint32List.fromList([objectId, (calclulatedSize << 16) | 0]).buffer.asUint8List());
    try{
    innerContext.sendMessage(bytesBuilder.toBytes(), );
    }catch (e) {
      logLn("Exception in ExtIdleNotificationV1::destroy: $e");
   return Failure(e);
    }
    return Success(Object());
  }

/// notification object is idle
///
/// This event is sent when the notification object becomes idle.
///
/// It's a compositor protocol error to send this event twice without a
/// resumed event in-between.
///
/// Event handler for Idled
 void onIdled(ExtIdleNotificationV1IdledEventHandler handler) {
   _idledHandler = handler;
 }

 ExtIdleNotificationV1IdledEventHandler? _idledHandler;

/// notification object is no longer idle
///
/// This event is sent when the notification object stops being idle.
///
/// It's a compositor protocol error to send this event twice without an
/// idled event in-between. It's a compositor protocol error to send this
/// event prior to any idled event.
///
/// Event handler for Resumed
 void onResumed(ExtIdleNotificationV1ResumedEventHandler handler) {
   _resumedHandler = handler;
 }

 ExtIdleNotificationV1ResumedEventHandler? _resumedHandler;

 @override
 void dispatch(int opcode, int fd, Uint8List data) {
logLn("ExtIdleNotificationV1.dispatch($opcode, $fd, $data)");
   switch (opcode) {     case 0:

       if (_idledHandler != null) {
         _idledHandler!(ExtIdleNotificationV1IdledEvent());
       }
       break;
     case 1:

       if (_resumedHandler != null) {
         _resumedHandler!(ExtIdleNotificationV1ResumedEvent());
       }
       break;
   }
 }
}

// Generated by dart-wayland-scanner
// https://github.com/your-repo/dart-wayland-scanner
// XML file : https://gitlab.freedesktop.org/wayland/wayland-protocols/-/raw/main/staging/security-context/security-context-v1.xml
//
// security_context_v1 Protocol Copyright:
///
/// Copyright © 2021 Simon Ser
///
/// Permission is hereby granted, free of charge, to any person obtaining a
/// copy of this software and associated documentation files (the "Software"),
/// to deal in the Software without restriction, including without limitation
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
/// and/or sell copies of the Software, and to permit persons to whom the
/// Software is furnished to do so, subject to the following conditions:
///
/// The above copyright notice and this permission notice (including the next
/// paragraph) shall be included


 !== undefined) {
        customDimensionsMetrics[`${config.type}${config.index}`] = value;
      }
    });

    return customDimensionsMetrics;
  }
}
import { Vector } from 'quark2d';
import { ParticlePair } from '../collision/ParticlePair';
import { Fluid } from '../Fluid';

export class FluidSolver {
    fluid: Fluid;

    private static temp = [new Vector(), new Vector(), new Vector(), new Vector()];

    constructor (fluid: Fluid) {
        this.fluid = fluid;
    }

    update (pairs: Iterable<ParticlePair>) {

        this.solveVisc(pairs);
        this.computeDensityAndPressure();
        this.solve(pairs);

    }

    computeDensityAndPressure () {
        for (const particle of this.fluid.particles) {
            particle.density = 0;

            for (const pair of particle.pairs) {
                pair.q = pair.dist/this.fluid.maxDist

                particle.density += Math.pow(1 - pair.q, 2);
            }
        }
        for (const particle of this.fluid.particles) {
            particle.pressure = this.fluid.k * (particle.density - this.fluid.restDensity);
        }
    }

    solve (pairs: Iterable<ParticlePair>) {

        const impulse = FluidSolver.temp[0];
        for (const pair of pairs) {

            const p = (pair.particleA.pressure + pair.particleB.pressure) * (1 - pair.q);

            pair.normal.scale(p * 0.5, impulse);

            pair.particleA.velocity.add(impulse);
            pair.particleB.velocity.subtract(impulse);
        }
    }

    solveVisc (pairs: Iterable<ParticlePair>) {
        const visc = this.fluid.visc;
        const visc_quad = this.fluid.visc_quad;

        const v = FluidSolver.temp[0];
        const impulse = FluidSolver.temp[1];

        for (const pair of pairs) {
            Vector.subtract(pair.particleA.velocity, pair.particleB.velocity, v);
            const u = Vector.dot(pair.normal, v);

            if (u < 0) continue;

            pair.normal.scale((1 - pair.q) * (visc * u + visc_quad * u * u) * 0.5, impulse);

            pair.particleA.velocity.subtract(impulse);
            pair.particleB.velocity.add(impulse);
        }
    }

}console.log('time to get started')

// function add(
//   n1: number,
//   n2: number,
//   showResult?: boolean,
//   resultPhrase: string = ''
// ) {
//   const result = n1 + n2
//   if (showResult && resultPhrase.length > 0) {
//     console.log(resultPhrase + result)
//   } else if (showResult) {
//     console.log(result)
//   } else {
//     return result
//   }
// }

const number1 = 5
const number2 = 5
// const printResult = true
const resultPhrase = 'Result is: '

// add(number1, number2, true, resultPhrase)
import { partOne } from "./partOne/mod.ts";
import { partTwo } from "./partTwo/mod.ts";
import { Decks } from "./types.d.ts";

export function preprocess(text: string): Decks {
  const decksLines = text.split("\n\n", 2);
  const [playerOne, playerTwo] = decksLines.map((deckLines) =>
    deckLines.split("\n").slice(1).map((line) => line.trim()).filter((line) =>
      line.length > 0
    ).map((line) => +line)
  );
  return { playerOne, playerTwo };
}

export function main(text: string, isPart2: boolean) {
  const input = preprocess(text);
  if (isPart2) {
    return partTwo(input);
  }
  return partOne(input);
}

export { partOne, partTwo };
/**
 * Gets the next order value 1 based for the provided collection
 *
 * @param collection Collecti


UMENTATION AND CLASS.
/**
 * Service Description: OS Config API
 *
 *
The OS Config service is a server-side component that you can use to manage package
 * installations and patch jobs for virtual machine instances.
 *
 *
This class provides the ability to make remote calls to the backing service through method
 * calls that map to API methods. Sample code to get started:
 *
 *
{@code
 * // This snippet has been automatically generated and should be regarded as a code template only.
 * // It will require modifications to work:
 * // - It may require correct/in-range values for request initialization.
 * // - It may require specifying regional endpoints when creating the service client as shown in
 * // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 * try (OsConfigServiceClient osConfigServiceClient = OsConfigServiceClient.create()) {
 *   PatchJobs.ExecutePatchJobRequest request =
 *       PatchJobs.ExecutePatchJobRequest.newBuilder()
 *           .setParent(ProjectName.of("[PROJECT]").toString())
 *           .setDescription("description-1724546052")
 *           .setInstanceFilter(PatchJobs.PatchInstanceFilter.newBuilder().build())
 *           .setPatchConfig(PatchJobs.PatchConfig.newBuilder().build())
 *           .setDuration(Duration.newBuilder().build())
 *           .setDryRun(true)
 *           .setDisplayName("displayName1714148973")
 *           .setRollout(PatchJobs.PatchRollout.newBuilder().build())
 *           .build();
 *   PatchJobs.PatchJob response = osConfigServiceClient.executePatchJob(request);
 * }
 * }

 *
 *
Note: close() needs to be called on the OsConfigServiceClient object to clean up resources
 * such as threads. In the example above, try-with-resources is used, which automatically calls
 * close().
 *
 *

 *
Methods

 *

 *      Method
 *      Description
 *      Method Variants
 *

 *

 *
 ExecutePatchJob
 *
 Patch VM instances by creating and running a patch job.
 *
 *
Request object method variants only take one parameter, a request object, which must be constructed before the call.

 *

 *

 executePatchJob(PatchJobs.ExecutePatchJobRequest request)
 *

 *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

 *

 *

 executePatchJobCallable()
 *

 *
 *

 *

 *
 GetPatchJob
 *
 Get the patch job. This can be used to track the progress of an ongoing patch job or review the details of completed jobs.
 *
 *
Request object method variants only take one parameter, a request object, which must be constructed before the call.

 *

 *

 getPatchJob(PatchJobs.GetPatchJobRequest request)
 *

 *
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.

 *

 *

 getPatchJob(PatchJobName name)
 *

 getPatchJob(String name)
 *

 *
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.

 *

 *

 getPatchJobCallable()
 *

 *
 *


.putArg(g.getDetectorWidth())
		.putArg(g.getDetectorHeight())
		.putArg(0.5f)
		.putArg(cl_VolumeTexture3D)
		.putArg(cl_VoxelElementSize)
		.putArg(cl_VolumeEdgeMinPoint)
		.putArg(cl_VolumeEdgeMaxPoint)
		.putArg(fwd?cl_SrcPointFwd:cl_SrcPointBwd)
		.putArg(fwd?cl_InvARmatrixFwd:cl_InvARmatrixBwd)
		.putArg(projectionID);

		int[] realLocalSize = new int[2];
		realLocalSize[0] = Math.min(cl_device.getMaxWorkGroupSize(),bpBlockSize[0]);
		realLocalSize[1] = Math.max(1, Math.min(cl_device.getMaxWorkGroupSize()/realLocalSize[0], bpBlockSize[1]));

		// rounded up to the nearest multiple of localWorkSize
		int[] globalWorkSize = {g.getDetectorWidth(), g.getDetectorHeight()};
		if ((globalWorkSize[0] % realLocalSize[0] ) != 0){
			globalWorkSize[0] = ((globalWorkSize[0] / realLocalSize[0]) + 1) * realLocalSize[0];
		}
		if ((globalWorkSize[1] % realLocalSize[1] ) != 0){
			globalWorkSize[1] = ((globalWorkSize[1] / realLocalSize[1]) + 1) * realLocalSize[1];
		}

		// add kernel function to the queue
		cl_commandQueue
		.put2DRangeKernel(cl_kernelFunction, 0, 0, globalWorkSize[0], globalWorkSize[1], realLocalSize[0], realLocalSize[1])
		.finish()
		.putReadBuffer(cl_Projection, true)
		.finish();

		// copy result from device to host
		cl_Projection.getBuffer().rewind();
		cl_Projection.getBuffer().get(projection_out);
		cl_Projection.getBuffer().rewind();
	}

	/**
	 *
	 *
	 *  Method: computeCanonicalProjectionMatrix

	 *  Author: Sungwon Yoon

	 *  Description:

	 *

	 *         W -> W projection matrix = [ AR   t ]
	 *         C -> C projection matrix = T0 * [AR  t] * T4
	 *
	 *                                 [ [ du(0)  dv(0) ]^-1   -0.5 ]
	 *                where      T0 =  [ [ du(1)  dv(1) ]      -0.5 ]
	 *                                 [     0      0            1  ]      ,
	 *
	 *                                 [  dx   0    0   -(L-1)/2*dx  ]
	 *                           T4 =  [  0   dy    0   -(M-1)/2*dy  ]
	 *                                 [  0    0   dz   -(N-1)/2*dz  ]
	 *                                 [  0    0    0         1      ]
	 *

	 *
	 *  C -> C projection matrix can be written as
	 *

	 *        C -> C projection matrix = [ T0 * AR * T4(1:3,1:3)    T0 * (AR * T4(1:3,4) + t) ]
	 *
	 *  Therefore, the new invARmatrix = T4(1:3,1:3)^-1 * (AR)^-1 * T0^-1
	 *                                   [ 1/dx    0      0   ]             [du(0)  dv(0)  0]
	 *                                 = [  0     1/dy    0   ] * (AR)^-1 * [du(1)  dv(1)  0]
	 *                                   [  0      0     1/dz ]             [  0      0    1]
	 *
	 *            and the new srcPoint = -T4(1:3,1:3)^-1 * T4(1:3,4) - T4(1:3,1:3)^-1 * (AR)^-1 * t
	 *                                     [[ -0.5 * (L-1) ]     [ 1/dx    0      0   ]                 ]
	 *                                 = - [[ -0.5


 struct stat *stbuf) {
	uint16_t attrmode;
	uint8_t attrtype;
	uint32_t attruid,attrgid,attratime,attrmtime,attrctime,attrnlink,attrrdev;
	uint64_t attrlength;
	const uint8_t *ptr;
	ptr = attr.data();
	attrtype = get8bit(&ptr);
	attrmode = get16bit(&ptr);
	attruid = get32bit(&ptr);
	attrgid = get32bit(&ptr);
	attratime = get32bit(&ptr);
	attrmtime = get32bit(&ptr);
	attrctime = get32bit(&ptr);
	attrnlink = get32bit(&ptr);
	memset(stbuf, 0, sizeof(*stbuf));
	stbuf->st_ino = inode;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLKSIZE
	stbuf->st_blksize = MFSBLOCKSIZE;
#endif
	switch (attrtype) {
	case TYPE_DIRECTORY:
		stbuf->st_mode = S_IFDIR | (attrmode & 07777);
		attrlength = get64bit(&ptr);
		stbuf->st_size = attrlength;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = (attrlength+511)/512;
#endif
		break;
	case TYPE_SYMLINK:
		stbuf->st_mode = S_IFLNK | (attrmode & 07777);
		attrlength = get64bit(&ptr);
		stbuf->st_size = attrlength;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = (attrlength+511)/512;
#endif
		break;
	case TYPE_FILE:
		stbuf->st_mode = S_IFREG | (attrmode & 07777);
		attrlength = get64bit(&ptr);
		stbuf->st_size = attrlength;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = (attrlength+511)/512;
#endif
		break;
	case TYPE_FIFO:
		stbuf->st_mode = S_IFIFO | (attrmode & 07777);
		stbuf->st_size = 0;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = 0;
#endif
		break;
	case TYPE_SOCKET:
		stbuf->st_mode = S_IFSOCK | (attrmode & 07777);
		stbuf->st_size = 0;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = 0;
#endif
		break;
	case TYPE_BLOCKDEV:
		stbuf->st_mode = S_IFBLK | (attrmode & 07777);
		attrrdev = get32bit(&ptr);
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_RDEV
		stbuf->st_rdev = attrrdev;
#endif
		stbuf->st_size = 0;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = 0;
#endif
		break;
	case TYPE_CHARDEV:
		stbuf->st_mode = S_IFCHR | (attrmode & 07777);
		attrrdev = get32bit(&ptr);
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_RDEV
		stbuf->st_rdev = attrrdev;
#endif
		stbuf->st_size = 0;
#ifdef LIZARDFS_HAVE_STRUCT_STAT_ST_BLOCKS
		stbuf->st_blocks = 0;
#endif
		break;
	default:
		stbu


,1.0)*      2.701587e-05*       39.6175083461*Math.sin( 1.88124996531 +        39.6175083461 * t);
        neptune_r_1+=Math.pow(t,0.0)*1.0*      8.621779e-05*Math.cos( 6.21626927537 +        35.1640902212*t)-Math.pow(t,1.0)*      8.621779e-05*       35.1640902212*Math.sin( 6.21626927537 +        35.1640902212 * t);
        neptune_r_1+=Math.pow(t,0.0)*1.0*     0.00013220034*Math.cos(  3.3201438793 +         1.4844727083*t)-Math.pow(t,1.0)*     0.00013220034*        1.4844727083*Math.sin(  3.3201438793 +         1.4844727083 * t);
        neptune_r_1+=Math.pow(t,0.0)*1.0*     0.00236338618*Math.cos( 0.70497954792 +        38.1330356378*t)-Math.pow(t,1.0)*     0.00236338618*       38.1330356378*Math.sin( 0.70497954792 +        38.1330356378 * t);

        var neptune_r_2 = 0.0;
        neptune_r_2+=Math.pow(t,1.0)*2.0*      4.247776e-05*Math.cos( 5.89911844921 +        38.1330356378*t)-Math.pow(t,2.0)*      4.247776e-05*       38.1330356378*Math.sin( 5.89911844921 +        38.1330356378 * t);

        return neptune_r_2+neptune_r_1+neptune_r_0;
    }

    @JvmStatic private fun saturn_b(t: Double): Double {
        var saturn_b_0 = 0.0;
        saturn_b_0+=-Math.pow(t,0.0)*      1.060298e-05*      529.6909650946*Math.sin(  5.6309929646 +       529.6909650946 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      1.506129e-05*      103.0927742186*Math.sin( 6.01304519391 +       103.0927742186 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      3.432125e-05*      433.7117378768*Math.sin(   2.732557466 +       433.7117378768 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      4.788392e-05*      110.2063212194*Math.sin( 4.96512926584 +       110.2063212194 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      4.807588e-05*      316.3918696566*Math.sin( 5.43305312061 +       316.3918696566 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      6.993564e-05*        7.1135470008*Math.sin(  4.7360468972 +         7.1135470008 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      9.916667e-05*      419.4846438752*Math.sin( 5.79003188904 +       419.4846438752 * t);
        saturn_b_0+=-Math.pow(t,0.0)*      0.0001473407*       639.897286314*Math.sin( 2.118


r.BackendStatusNotReady,
			Detail: "Forced failure",
		}, ErrForcedFailure
	}
	return r.Status, nil
}

func (r *fakeRouter) Reset() {
	r.mutex.Lock()
	defer r.mutex.Unlock()
	r.BackendOpts = make(map[string]router.EnsureBackendOpts)
	r.cnames = make(map[string]string)
	r.Info = make(map[string]string)
	r.Status = router.RouterBackendStatus{
		Status: router.BackendStatusReady,
	}
	r.FailuresByHost = map[string]bool{}
}

func (r *fakeRouter) EnsureBackend(ctx context.Context, app *appTypes.App, opts router.EnsureBackendOpts) error {
	name := app.Name
	if name == "myapp-with-error" {
		return errors.New("Ensure backend error")
	}

	r.mutex.Lock()
	defer r.mutex.Unlock()

	for _, cname := range opts.CNames {
		if r.cnames[cname] != "" && r.cnames[cname] != name {
			return ErrForcedFailure
		}

		if r.FailuresByHost[cname] {
			return ErrForcedFailure
		}
	}

	r.BackendOpts[name] = opts

	currentAppCNames := map[string]bool{}

	for _, cname := range opts.CNames {
		r.cnames[cname] = name
		currentAppCNames[cname] = true
	}

	for cname, app := range r.cnames {
		if app != name {
			continue
		}

		if !currentAppCNames[cname] {
			delete(r.cnames, cname)
		}

	}

	currentAppCertIssuers := map[string]bool{}

	for cname, issuer := range opts.CertIssuers {
		r.certIssuers[cname+":"+issuer] = name
		currentAppCertIssuers[cname+":"+issuer] = true
	}

	for key, app := range r.certIssuers {
		if app != name {
			continue
		}

		if !currentAppCertIssuers[key] {
			delete(r.certIssuers, key)
		}
	}

	return nil
}

func (r *fakeRouter) Addresses(ctx context.Context, app *appTypes.App) ([]string, error) {
	backendName := app.Name
	r.mutex.Lock()
	defer r.mutex.Unlock()

	if r.FailuresByHost[r.GetName()+":"+backendName] || r.FailuresByHost[backendName] {
		return nil, ErrForcedFailure
	}

	opts := r.BackendOpts[backendName]

	addrs := map[string]bool{
		fmt.Sprintf("%s.fakerouter.com", backendName): true,
	}
	for _, data := range opts.Prefixes {
		name := backendName
		if data.Prefix != "" {
			name = data.Prefix + "." + backendName
		}
		addrs[fmt.Sprintf("%s.fakerouter.com", name)] = true
	}

	sortedAddrs := []string{}
	for addr := range addrs {
		sortedAddrs = append(sortedAddrs, addr)
	}
	sort.Strings(sortedAddrs)

	return sortedAddrs, nil
}

type tlsRouter struct {
	fakeRouter
	Certs map[string]string
	Keys  map[string]string
}

var _ router.TLSRouter = &tlsRouter{}

func (r *tlsRouter) AddCertificate(ctx context.Context, app *appTypes.App, cname, certificate, key string) error {
	r.Certs[cname] = certificate
	r.Keys[cname] = key
	return nil
}

func (r *tlsRouter) RemoveCertificate(ctx context.Context, app *appTypes.App, cname string) error {
	delete(r.Certs, cname)
	delete(r.Keys, cname)


client_plugin_Plugin_2(){
  return new org_xwiki_gwt_wysiwyg_client_plugin_history_HistoryPlugin_HistoryPlugin__V;
}
;
var org_xwiki_gwt_wysiwyg_client_plugin_history_HistoryPluginFactory_instance = null;
com_google_gwt_lang_SeedUtil_defineSeed__IILcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2(929, 1, {});
_.org_xwiki_gwt_wysiwyg_client_plugin_history_exec_AbstractHistoryExecutable_history = null;
function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_RedoExecutable__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_History_2V(history){
  this.org_xwiki_gwt_wysiwyg_client_plugin_history_exec_AbstractHistoryExecutable_history = history;
}

com_google_gwt_lang_SeedUtil_defineSeed__IILcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2(930, 929, {}, org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_RedoExecutable__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_History_2V);
_.execute__Ljava_lang_String_2Z = function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_execute__Ljava_lang_String_2Z(param){
  if (org_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_$canRedo__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_2Z(this.org_xwiki_gwt_wysiwyg_client_plugin_history_exec_AbstractHistoryExecutable_history)) {
    org_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_$redo__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_2V(this.org_xwiki_gwt_wysiwyg_client_plugin_history_exec_AbstractHistoryExecutable_history);
    return true;
  }
   else {
    return false;
  }
}
;
_.getParameter__Ljava_lang_String_2 = function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_getParameter__Ljava_lang_String_2(){
  return null;
}
;
_.isEnabled__Z = function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_isEnabled__Z(){
  return org_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_$canRedo__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_internal_DefaultHistory_2Z(this.org_xwiki_gwt_wysiwyg_client_plugin_history_exec_AbstractHistoryExecutable_history);
}
;
_.isExecuted__Z = function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_isExecuted__Z(){
  return true;
}
;
_.isSupported__Z = function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_RedoExecutable_isSupported__Z(){
  return true;
}
;
function org_xwiki_gwt_wysiwyg_client_plugin_history_exec_UndoExecutable_UndoExecutable__Lorg_xwiki_gwt_wysiwyg_client_plugin_history_History_2V(history){
  this.org_xwiki_gwt_w


}

inline fun Int.forLoop(func: (Int) -> Unit) {
    for (i in 0 until this)
        func(i)
}

fun <T> Array<T>.rotateInto(@Out out: Array<T>, rotator: Int = 1): Array<T> {
    if (isEmpty()) throw NoSuchElementException("Array is empty.")
    for (i in 0 until this.size) {
        out[(i + rotator) % this.size] = this[i]
    }
    return out
}
/**
 * Rotate current array 1 step.
 * @param forward whether every index will increase 1
 */
fun <T> Array<T>.rotateOnce(forward: Boolean = true): Array<T> {
    if (isEmpty() || size == 1) return this
    if (forward) {
        // the last one will be the first one
        val last = this.last()
        for (i in size - 1 downTo 1) {// stop before the last one
            this[i] = this[i - 1]
        }
        this[0] = last
    } else {
        // the first one will be the last one
        val first = first()
        for (i in 0 until size - 1) {// stop at the last one
            this[i] = this[i + 1]
        }
        this[lastIndex] = first
    }
    return this
}

fun IntArray.copyFrom(other: IntArray) {
    System.arraycopy(other, 0, this, 0, this.size)
}

fun <T> MutableCollection<T>.swap(other: MutableCollection<T>, temp: MutableCollection<T>) {
    temp.clear()
    temp.addAll(this)
    this.clear()
    this.addAll(other)
    other.clear()
    other.addAll(temp)
}

inline fun <T> MutableList<T>.shrinkTo(
    targetSize: Int,
    removing: MutableList<T>.() -> Unit = { this.removeLast() },
) {
    if (size <= targetSize) return
    for (i in 0 until targetSize - size) {
        this.removing()
    }
}

inline fun <T> coherentApply(
    o1: T, o2: T, func: T.() -> Unit,
) {
    o1.func()
    o2.func()
}package net.liplum.ui

import arc.Core
import arc.Events
import arc.scene.Group
import arc.scene.event.Touchable
import arc.scene.ui.ImageButton
import arc.scene.ui.Label
import arc.scene.ui.ScrollPane
import arc.scene.ui.TextField
import arc.scene.ui.layout.Table
import arc.scene.ui.layout.WidgetGroup
import arc.struct.Seq
import arc.util.Interval
import mindustry.Vars
import mindustry.game.EventType
import mindustry.gen.*
import mindustry.graphics.Pal
import net.liplum.CLog
import net.liplum.Var
import net.liplum.annotations.Only
import net.liplum.annotations.SubscribeEvent
import plumy.core.arc.tinted
import net.liplum.event.CioInitEvent
import net.liplum.common.util.allFieldsIncludeParents
import net.liplum.common.util.directSuperClass
import net.liplum.utils.Screen
import net.liplum.render.Shape
import net.liplum.ui.attach.Dragger.Companion.dragToMove
import java.lang.reflect.Field

object DebugUI {
    @JvmStatic
    @SubscribeEvent(CioInitEvent::class, Only.client or Only.debug)
    fun appendUI() {
        addMousePosition()
        val debug = WidgetGroup().apply {
            setFillParent(true)
            touchable = Touchable.childrenOnly
        }
        Core.scene.add(debug)
        addEntityInspector(debug)
    }

    fun addMousePosition() {
        val hudGroup = Vars.ui.hudGroup
        val minimap = hudGroup.find<Table>("minimap/position")
        minimap?.apply {
            row()
            label {
                val build = Screen.tileOnMouse()?.build
                if (build != null)
                    "Build:${build.tile.x},${build.tile.y}"
                else
                    "Build:X,X"
            }.touchable(Touchable.disabled).name("mouse-position-build")
            row()
            label {
                val pos = Screen.worldOnMouse()
                "Build:${pos.x.toInt()},${pos.y.toInt()}"
            }.touchable(Touchable.disabled).name("mouse-position-world").uniformX()


rator iter = Lib.instance().getAllPropertyNames()
//				.iterator(); iter.hasNext();) {
//			final String ifAttribute = (String) iter.next();
//			if (!ifAttribute.startsWith("Is")) {
//				continue;
//			}
//			final Thing parent = new Thing();
//			final Thing isThing = new Thing(parent);
//
//			Thing prototype = null;
//
//			// might fail if no things have the property set
//			try {
//				prototype = Lib.createType(ifAttribute, 1);
//			} catch (final Throwable t) {
//				// nothing
//			}
//			if (prototype == null) {
//				prototype = Lib.create("strange rock");
//			}
//			isThing.set("Name", ifAttribute + ThingMaker.FLAG_ENDING);
//			// set these in the parent so they aren't saved
//			parent.set("AuthorIsTyped", true);
//			parent.set("LevelMin", 1);
//			parent.set("ImageSource", prototype.getString("ImageSource"));
//			parent.set("Image", prototype.getStat("Image"));
//			Lib.add(isThing);
//			pushLocalUp(isThing);
//			isThings.put(ifAttribute, isThing);
//		}
//	}
//
//	private static void pushLocalUp(final Thing isThing) {
//		final BaseObject parent = isThing.getInherited();
//		if (parent == null) {
//			return;
//		}
//		for (final Iterator iter = isThing.getLocal().entrySet().iterator(); iter
//				.hasNext();) {
//			final java.util.Map.Entry entry = (java.util.Map.Entry) iter.next();
//			final String key = (String) entry.getKey();
//			final Object value = entry.getValue();
//			if (key.equals("Name")) {
//				continue;
//			}
//			parent.set(key, value);
//			iter.remove();
//		}
//	}
//
//	private Thing[] tilesAsThings() {
//		return (Thing[]) Lib.instance().getTiles()
//				.toArray(new Thing[Lib.instance().getTiles().size()]);
//	}
//
//	protected ActionMapping createActions() {
//		final ActionMapping actionMapping = new ActionMapping();
//		actionMapping.addDefaultMovementActions();
//		actionMapping.map('l', LINE);
//		actionMapping.map('r', RECTANGLE);
//		actionMapping.map('c', CIRCLE);
//		actionMapping.map('-', Action.SAVE_GAME);
//		actionMapping.map('+', Action.LOAD_GAME);
//		actionMapping.map('=', Action.LOAD_GAME);
//		actionMapping.map('t', ADD_TILE);
//		actionMapping.map('h', ADD_THING);
//		actionMapping.map('z', UNDO);
//		// actionMapping.map('e', ERASE);
//		actionMapping.map('f', FILL);
//		actionMapping.map('p', POINT);
//		actionMapping.map('s', SELECT);
//		return actionMapping;
//	}
//
//	private void doRectangle(final Point mapPoint, final boolean isShiftDown) {
//		map.setTiles(copy(oldTiles));
//		map.setObjects(copy(oldThings));
//		final int westX = Math.min(mapPoint.x, currentPoint.x);
//		int eastX = Math.max(mapPoint.x, currentPoint.x);
//		final int northY = Math.min(mapPoint.y, currentPoint.y);
//


_FOUND';
  throw err;
}

export namespace resolve {
  export function LOAD_AS_FILE(x: string): string | undefined {
    const exts = ['', '.js', '.json'];

    for (const ext of exts) {
      const p = x + ext;
      const stat = safeStatSync(p);

      if (stat && stat.isFile()) {
        return p;
      }
    }
  }

  export function LOAD_INDEX(x: string): string | undefined {
    const exts = ['.js', '.json'];

    for (const ext of exts) {
      const p = path.join(x, `index${ext}`);
      const stat = safeStatSync(p);

      if (stat && stat.isFile()) {
        return p;
      }
    }
  }

  export function LOAD_AS_DIRECTORY(x: string): string | undefined {
    try {
      const packageJson = JSON.parse(fs.readFileSync(path.join(x, 'package.json'), { encoding: 'utf8' }));

      if (packageJson.main) {
        const m = path.join(x, packageJson.main);
        const foundPathAsFile = resolve.LOAD_AS_FILE(m);

        if (foundPathAsFile) {
          return foundPathAsFile;
        }

        const foundPathAsIndex = resolve.LOAD_INDEX(m);

        if (foundPathAsIndex) {
          return foundPathAsIndex;
        }
      }
    } catch (e) {
      // ignore fs and json errors
    }

    const foundPath = resolve.LOAD_INDEX(x);

    if (foundPath) {
      return foundPath;
    }
  }
}

export function resolveBin(m: string, bin: string, options?: ResolveOptions): string {
  const packageJsonPath = resolve(`${m}/package`, options);
  const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, { encoding: 'utf8' }));

  if (!isPackageJson(packageJson) || !packageJson.bin) {
    throw ERROR_INVALID_PACKAGE_JSON;
  }

  const desiredBin = packageJson.bin[bin];

  if (!desiredBin) {
    throw ERROR_BIN_NOT_FOUND;
  }

  return path.resolve(path.dirname(packageJsonPath), desiredBin);
}

function safeStatSync(filePath: string): fs.Stats | undefined {
  try {
    return fs.statSync(filePath);
  } catch (e) {
    // ignore
  }
}
import * as service from './../services/student.service';
import { Request, Response } from 'express';

export type handler = (req: Request, res: Response) => void;

interface IRoutes {
  http: string;
  path: string;
  handler: handler;
}

const collection = service.studentDocument;

const studentGetHandler = async (req: Request, res: Response) => {
  const data = await service.getAll(collection);
  res.send({ success: true, data });
};

const studentSaveHandler = async (req: Request, res: Response) => {
  console.log(req.body);
  const savedStudent = await service.save(collection, req.body);
  res.send(savedStudent);
};

export let routes: IRoutes[] = [
  {
    http: 'get',
    path: '/student',
    handler: studentGetHandler,
  },
  {
    http: 'post',
    path: '/student',
    handler: studentSaveHandler,
  },
];
import {AfterViewInit, Component, ViewChildren, Renderer} from '@angular/core';

@Component({
  selector: 'home',
  styleUrls: ['./home.component.css'],
  templateUrl: './home.component.html'
})

// class SomeCmp implements AfterViewInit {


#ifndef EV3_API_EV3_ULTRASONIC_H
#define EV3_API_EV3_ULTRASONIC_H

#include <stdbool.h>
#include "ev3_sensors.h"

// see http://docs.ev3dev.org/projects/lego-linux-drivers/en/ev3dev-buster/sensor_data.html#lego-ev3-us

#define EV3_ULTRASONIC_SENSOR_TYPE              30

#define EV3_ULTRASONIC_SENSOR_DISTANCE_MM_MODE  0
#define EV3_ULTRASONIC_SENSOR_DISTANCE_IN_MODE  1
#define EV3_ULTRASONIC_SENSOR_LISTEN_MODE       2
#define EV3_ULTRASONIC_SENSOR_SINGLE_MM_MODE    3
#define EV3_ULTRASONIC_SENSOR_SINGLE_IN_MODE    4
#define EV3_ULTRASONIC_SENSOR_DC_MM_MODE        5
#define EV3_ULTRASONIC_SENSOR_DC_IN_MODE        6
#define EV3_ULTRASONIC_SENSOR_DEFAULT_MODE      EV3_ULTRASONIC_SENSOR_DISTANCE_MM_MODE

#define EV3_ULTRASONIC_FIRE_COMMAND  0x11

/**
 * @brief EV3 Ultrasonic Sensor (LEGO #45504)
 */
extern SensorHandler * EV3Ultrasonic;

/**
 * @brief Units to measure the result in
 */
typedef enum EV3UltrasonicDistanceUnit {
    /**
     * @brief Return the distance in centimeters
     * (discard the decimal place of the *-MM measurement)
     * range: 0-255
     */
    EV3_ULTRASONIC_CM,

    /**
     * @brief Return the distance in millimetes (*-MM)
     * range: 0-255
     */
    EV3_ULTRASONIC_MM,

    /**
     * @brief Return the distance in inches (*-IN)
     * range: 0-1003
     */
    EV3_ULTRASONIC_IN,
} EV3UltrasonicDistanceUnit;

/**
 * @brief Returns the distance continually measured by the sensor (US-DIST-*)
 * @param port Port to which the sensor is connected
 * @param mode Wheter to read the distance in cm, mm or inches
 * @return measured value or INT_MIN in case of error
 */
int ReadEV3UltrasonicSensorDistance(int port, EV3UltrasonicDistanceUnit mode);

/**
 * @brief Returns the distance measured by the sensor by a single ping (US-SI-*)
 *
 * The distance will be measured only once after the mode is set.
 * To do the measurement again, either switch the sensor mode, or
 * call the FireEV3UltrasonicSensor() function.
 *
 * @param port Port to which the sensor is connected
 * @param mode Wheter to read the distance in cm, mm or inches
 * @return measured value or INT_MIN in case of error
 * @remark Beware, if you switch the sensor modes too often or
 *         trigger the ping too often, the sensor may lock up for 2-3 seconds.
 */
int ReadEV3UltrasonicSensorSingleDistance(int port, EV3UltrasonicDistanceUnit mode);

/**
 * @brief Returns the distance measured by the sensor in an unknown alternative way (US-DC-*)
 * @param port Port to which the sensor is connected
 * @param mode Wheter to read the distance in cm, mm or inches
 * @return measured value or INT_MIN in case of error
 * @remark It is not known how this mode is different from US-DIST-*.
 *         It is recommended to use US-DIST-* as that is
 *         the mode used in the stock lms2012 VM.
 */
int ReadEV3UltrasonicSensorDcDistance(int port, EV3UltrasonicDistanceUnit mode);

/**
 * @brief Makes the sensor send out a ping for the single measurement mode.
 * @param port Port to which the sensor is connected
 * @return 0 or INT_MIN in case of error
 */
int FireEV3UltrasonicSensor(int port);

/**
 * @brief Tries to find another ultrasonic sensor running in distance mode (US-LISTEN)
 * @param port Port to which the sensor is connected
 * @return true if there exists another ultrasonic sensor reading in distance mode,
 *         false if not and finally INT_MIN in case of error
 */
int ReadEV3UltrasonicSensorListen(int port);

#endif //EV3_API_EV3_ULTRASONIC_H


ion)
                // xcrun simctl launch --console 7F49203A-1F16-4DEE-B9A2-7A1BB153DF70 com.sample.demo.app-X64-Debug
                //logger.info(params.joinToString(" "))
                val arch = if (isArm) "SimulatorArm64" else "X64"
                execLogger { it.commandLine("xcrun", "simctl", "launch", "--console", device.udid, "${korge.id}.app-$arch-$debugSuffix") }
            }
        }

        tasks.createTyped<Task>("run${targetNameCapitalized}$debugSuffix") {
            dependsOn(runIosDevice)
        }
    }

    tasks.createThis<Task>("${targetName}EraseAllSimulators") {
        doLast { execLogger { it.commandLine("osascript", "-e", "tell application \"iOS Simulator\" to quit") } }
        doLast { execLogger { it.commandLine("osascript", "-e", "tell application \"Simulator\" to quit") } }
        doLast { execLogger { it.commandLine("xcrun", "simctl", "erase", "all") } }
    }

}
package samples

import korlibs.image.font.*
import korlibs.io.async.*
import korlibs.io.file.std.*
import korlibs.korge.scene.*
import korlibs.korge.view.*
import korlibs.korge.view.align.*
import korlibs.korge.view.filter.*
import korlibs.time.*

class MainBmpFont : Scene() {
    override suspend fun SContainer.sceneMain() {
        val font1 = resourcesVfs["font1.fnt"].readBitmapFont()
        val segment7 = resourcesVfs["segment7.fnt"].readBitmapFont() // mono spaced
        val text1 = text("Hello World!", textSize = 96.0, font = font1)
        val text2 = text("Hello : World! jg", textSize = 96.0, font = font1) {
            smoothing = false
            alignTopToBottomOf(text1)
        }
        val text3 = text("Hello World!", textSize = 96.0, font = font1) {
            filter = Convolute3Filter(Convolute3Filter.KERNEL_GAUSSIAN_BLUR)
            alignTopToBottomOf(text2)
        }
        text("Hello World 2!", textSize = 32.0, font = font1) {
            val text = this
            launchImmediately {
                var n = 0
                while (true) {
                    text.text = "Hello World! ${n++}"
                    centerOn(root)
                    delay(1.milliseconds)
                }
            }
        }
        text("42:10", textSize = 64.0, font = segment7) {
            val text = this
            alignX(root, 0.5, true)
            alignY(root, 0.75, true)
            launchImmediately {
                var count = 10
                while (true) {
                    text.text = "42:${count++}"
                    delay(1.seconds)
                }
            }
        }
    }
}
package samples

import korlibs.time.seconds
import korlibs.korge.resources.resourceBitmap
import korlibs.korge.scene.ScaledScene
import korlibs.korge.tween.get
import korlibs.korge.tween.tween
import korlibs.korge.view.SContainer
import korlibs.korge.view.anchor
import korlibs.korge.view.image
import korlibs.korge.view.position
import korlibs.korge.view.scale
import korlibs.image.bitmap.*
import korlibs.math.geom.degrees
import korlibs.math.interpolation.*

// @TODO: We could autogenerate this via gradle
private val korlibs.io.resources.ResourcesContainer.korge_png by resourceBitmap("korge.png")

class MainHelloWorld : ScaledScene(512, 512) {
    override suspend fun SContainer.sceneMain() {
        gameWindow.icon = korge_png.get().bmp.toBMP32().scaled(32, 32)

        val minDegrees = (-16).degrees
        val maxDegrees = (+16).degrees

        val image = image(


class="coverageStat">

    100%

    (2/2)

  Total

    100%

    (15/15)

    83.3%

    (10/12)

    93.2%

    (124/133)

 package org.umlg.sqlg.test.topology;

 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Assert;
 import org.junit.Assume;
 import org.junit.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.umlg.sqlg.structure.PropertyDefinition;
 import org.umlg.sqlg.structure.PropertyType;
 import org.umlg.sqlg.structure.topology.VertexLabel;
 import org.umlg.sqlg.test.BaseTest;

 import java.util.HashMap;
 import java.util.List;
 import java.util.concurrent.ExecutorService;
 import java.util.concurrent.Executors;
 import java.util.concurrent.TimeUnit;

 public class TestTopologyLock extends BaseTest {

     private static final Logger LOGGER = LoggerFactory.getLogger(TestTopologyLock.class);

     @Test
     public void testTopologyLocked() {
         this.sqlgGraph.getTopology().lock();
         boolean failed = false;
         try {
             this.sqlgGraph.addVertex(T.label, "A");
         } catch (IllegalStateException e) {
             failed = true;
         }
         Assert.assertTrue(failed);
         failed = false;
         this.sqlgGraph.getTopology().unlock();
         this.sqlgGraph.addVertex(T.label, "A");
         this.sqlgGraph.tx().commit();
         List<Vertex> vertexList = this.sqlgGraph.traversal().V().toList();
         Assert.assertEquals(1, vertexList.size());
         this.sqlgGraph.getTopology().lock();
         VertexLabel vertexLabel = this.sqlgGraph.getTopology().getPublicSchema().getVertexLabel("A").orElseThrow();
         try {
             vertexLabel.ensurePropertiesExist(new HashMap<&


 ticks, values & grid are aligned to logical temporal breakpoints and not an arbitrary timestamp
		// https://www.timeanddate.com/time/dst/
		// https://www.timeanddate.com/time/dst/2019.html
		// https://www.epochconverter.com/timezones
		function timeAxisSplits(tzDate) {
			return (self, axisIdx, scaleMin, scaleMax, foundIncr, foundSpace) => {
				let splits = [];
				let isYr = foundIncr >= y;
				let isMo = foundIncr >= mo && foundIncr < y;

				// get the timezone-adjusted date
				let minDate = tzDate(scaleMin);
				let minDateTs = roundDec(minDate * ms, 3);

				// get ts of 12am (this lands us at or before the original scaleMin)
				let minMin = mkDate(minDate.getFullYear(), isYr ? 0 : minDate.getMonth(), isMo || isYr ? 1 : minDate.getDate());
				let minMinTs = roundDec(minMin * ms, 3);

				if (isMo || isYr) {
					let moIncr = isMo ? foundIncr / mo : 0;
					let yrIncr = isYr ? foundIncr / y  : 0;
				//	let tzOffset = scaleMin - minDateTs;		// needed?
					let split = minDateTs == minMinTs ? minDateTs : roundDec(mkDate(minMin.getFullYear() + yrIncr, minMin.getMonth() + moIncr, 1) * ms, 3);
					let splitDate = new Date(round(split / ms));
					let baseYear = splitDate.getFullYear();
					let baseMonth = splitDate.getMonth();

					for (let i = 0; split <= scaleMax; i++) {
						let next = mkDate(baseYear + yrIncr * i, baseMonth + moIncr * i, 1);
						let offs = next - tzDate(roundDec(next * ms, 3));

						split = roundDec((+next + offs) * ms, 3);

						if (split <= scaleMax)
							splits.push(split);
					}
				}
				else {
					let incr0 = foundIncr >= d ? d : foundIncr;
					let tzOffset = floor(scaleMin) - floor(minDateTs);
					let split = minMinTs + tzOffset + incrRoundUp(minDateTs - minMinTs, incr0);
					splits.push(split);

					let date0 = tzDate(split);

					let prevHour = date0.getHours() + (date0.getMinutes() / m) + (date0.getSeconds() / h);
					let incrHours = foundIncr / h;

					let minSpace = self.axes[axisIdx]._space;
					let pctSpace = foundSpace / minSpace;

					while (1) {
						split = roundDec(split + foundIncr, ms == 1 ? 0 : 3);

						if (split > scaleMax)
							break;

						if (incrHours > 1) {
							let expectedHour = floor(roundDec(prevHour + incrHours, 6)) % 24;
							let splitDate = tzDate(split);
							let actualHour = splitDate.getHours();

							let dstShift = actualHour - expectedHour;

							if (dstShift > 1)
								dstShift = -1;

							split -= dstShift * h;

							prevHour = (prevHour + incrHours) % 24;

							// add a tick only if it's further than 70% of the min allowed label spacing
							let prevSplit = splits[splits.length - 1];
							let pctIncr = roundDec((split - prevSplit) / foundIncr, 3);

							if (pctIncr * pctSpace >= .7)
								splits.push(split);
						}
						else
							splits.push(sp


)))

	for label, dfs := range deferred {
		ec.processDeferredGroup(graphql.DeferredGroup{
			Label:    label,
			Path:     graphql.GetPath(ctx),
			FieldSet: dfs,
			Context:  ctx,
		})
	}

	return out
}

var github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors = []string{"Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec"}

func (ec *executionContext) _Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec(ctx context.Context, sel ast.SelectionSet, obj *model.GithubComKloudliteOperatorApisClustersV1ClusterSpec) graphql.Marshaler {
	fields := graphql.CollectFields(ec.OperationContext, sel, github__com___kloudlite___operator___apis___clusters___v1__ClusterSpecImplementors)

	out := graphql.NewFieldSet(fields)
	deferred := make(map[string]*graphql.FieldSet)
	for i, field := range fields {
		switch field.Name {
		case "__typename":
			out.Values[i] = graphql.MarshalString("Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec")
		case "accountId":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountId(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				out.Invalids++
			}
		case "accountName":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_accountName(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				out.Invalids++
			}
		case "availabilityMode":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_availabilityMode(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				out.Invalids++
			}
		case "aws":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_aws(ctx, field, obj)
		case "backupToS3Enabled":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_backupToS3Enabled(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				out.Invalids++
			}
		case "cloudflareEnabled":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudflareEnabled(ctx, field, obj)
		case "cloudProvider":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_cloudProvider(ctx, field, obj)
			if out.Values[i] == graphql.Null {
				out.Invalids++
			}
		case "clusterInternalDnsHost":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterInternalDnsHost(ctx, field, obj)
		case "clusterServiceCIDR":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterServiceCIDR(ctx, field, obj)
		case "clusterTokenRef":
			out.Values[i] = ec._Github__com___kloudlite___operator___apis___clusters___v1__ClusterSpec_clusterTokenRef(ctx, field, obj)
		case "gcp":
			out.Values[i] = ec._Github__com_


time < data->min ? data->time : data->min;
    data->max = data->time > data->max ? data->time : data->max;

    if (data->time < data->running_threshold) {
        data->nearest_nonoutlier = data->time > data->nearest_nonoutlier ?
                        data->time : data->nearest_nonoutlier;
    }

    if (data->time >= data->running_threshold) {
        dprintf("Found valid pair: (%p, %p)\n", phy_addr1, phy_addr2);
        return true;
    }

    return false;
}
void *find_next_dram_partition_pair(void *phy_addr1, void *phy_start_addr,
        void *phy_end_addr, size_t offset, void *arg)
{
    uintptr_t a, b;
    uintptr_t ustart_addr = (uintptr_t)phy_start_addr;
    uintptr_t uend_addr = (uintptr_t)phy_end_addr;

    cb_arg_t *data = (cb_arg_t *)arg;

    for (; ustart_addr <= uend_addr; ustart_addr += offset) {

        if (check_dram_partition_pair(phy_addr1, (void *)ustart_addr, arg))
            return (void *)ustart_addr;
    }

    return NULL;
}

static double get_histogram_bin(double time, double min_time, int spacing)
{
    int min_rounded = ((int)(min_time) / spacing) * spacing;
    int time_rounded = ((int)(time) / spacing) * spacing;

    return (time_rounded - min_rounded) / spacing;
}

static double get_histogram_bin_start_time(int bin, double min_time, int spacing)
{
    int min_rounded = ((int)(min_time) / spacing) * spacing;

    return (double)(min_rounded + spacing * bin);
}

/*
 * Finds the hash function for DRAM Banks
 * virt start and phy start are virtual/physical start address of a contiguous
 * memory range.
 */
static hash_context_t *run_dram_exp(void *virt_start, void *phy_start,
        size_t allocated, int min_bit, int max_bit)
{
    void *phy_end;
    size_t min_row_size;
    void *row_start, *row_end;
    uintptr_t a, b, b_phy;
    double threshold = LONG_MAX;
    double time, sum, running_threshold, nearest_nonoutlier;
    double min, max;
    hash_context_t *hctx;
    cb_arg_t data;
    int ret;
    size_t offset = (1ULL << min_bit);
    size_t max_entries = allocated / offset;
    int count = std::min(max_entries, (size_t)THRESHOLD_SAMPLE_SIZE);
    std::vector<std::pair<void *, double>> times;
    std::vector<int> dram_histogram;

    if (g_dram_histogram_enabled || g_dram_trendline_enabled) {

        count = std::min(max_entries, (size_t)g_dram_sample_size);
        if (count != g_dram_sample_size) {
            fprintf(stderr, "WARNING: DRAM histogram sample size will be %d, instead of %d\n",
                    count, g_dram_sample_size);
        }
    }

    // Find running threshold
    min = LONG_MAX;
    max = 0;
    sum = 0;
    printf("Finding threshold\n", count);
    for (int i = 0; i < count; i++) {
        a = (uintptr_t)virt_start;
        b = a + offset * i;
        b_phy = (uintptr_t)phy_start +  offset * i;

        time = device_find_dram_read_time((void *)a, (void *)b, threshold);
        sum += time;
        min = time < min ?


=1
 *      		nup++;
 *      		to += 3;
 *      		seq >>= 24;
 *      	} else if (chr == '/') {        // completed a dir name that is not ".."
 *      		// #9.  execute if TMP==1
 *      		if (nup > 0) {          // we have to drop the dir name due to a ".."
 *      			// #10.  execute if TM4==1
 *      			to = brk;       // rewind to last brk index
 *      			nup--;          // decrement nup
 *      		} else {                // normal case, keep this dir name
 *      			// #11.  execute if TM2==1
 *      			brk = ito;      // note brk for future use
 *      		}
 *      	}
 *      }
 *
 *      // #12.  point to the first char in the output
 *      to++;
 *
 *      // #13.  for absolute paths, forget about nup:  "/.." is equivalent to "/"
 *      if (src[0] == '/')
 *      	goto Lout;
 *
 *      // #14.  for relative paths, advance past the initial, artificial '/'
 *      to++;
 *
 *      // #15.  for each nup, prepend a "../"
 *      while (nup > 0) {
 *      	ito -= 3;
 *      	dst[ITO + 0] = '.';
 *      	dst[ITO + 1] = '.';
 *      	dst[ITO + 2] = '/';
 *      	nup--;
 *      }
 *
 *      Lout:
 *
 *      // #16.  move the result string to the beginning of the dst buffer
 *      strcpy(dst, &dst[to]);
 *
 *      // #17.  check for empty string
 *      if (strlen(dst) < 1) {
 *      	dst = ".";
 *      	return;
 *      }
 *
 *      // #18.  check for single-char string
 *      if (strlen(dst) < 2)
 *      	return;
 *
 *      // #19.  strip off the trailing '/'
 *      dst[strlen(dst) - 1] = '\0';
 */

#include <bpf_asm_helpers.h>

/*
 * void dt_cleanpath(const dt_dctx_t *dctx, char *src, char *dst);
 */
	.text
	.align	4
	.global	dt_cleanpath
	.type	dt_cleanpath, @function
dt_cleanpath :

#define DST %r9
	/* Cache dst pointer. */
	mov	DST, %r3

	/*
	 * Copy src to &dst[1].  Then we can directly dereference individual chars.
	 * The first byte, dst[0], is reserved for prepending a '/'.
	 */
	mov	%r3, %r2
	lddw	%r2, STRSZ
	add	%r2, 1
	mov	%r1, DST
	add	%r1, 1
	call	BPF_FUNC_probe_read_str
	/* At this point, %r0 has strlen(src) + 1. */

	/* #1.  Handle empty string: cleanpath("") = "". */
	jsgt	%r0, 1, .Lnotempty
	stb	[DST+0], 0
	mov	%r0, 0
	exit
.Lnotempty:

	/*
	 * #2.  Handle single-char string: cleanpath("x") = "x", even for '.' and '/'.
	 * Load the first char (which we had put in dst[1]) and stuff it in dst[0].
	 */
	ldxb	%r1, [DST+1]
	jgt	%r0, 2, .Lnotsinglechar
	stxb	[DST+0], %r1
	stb	[DST+1], 0
	mov	%r0, 0
	exit
.Lnotsinglechar:

#define FIRSTCHAR [%fp+-1]
	/* Save the first char. */
	stxb	FIRSTCHAR, %r1

	/* Save the last char. */
	mov	%r8, %r0
	add	%r8, DST
	ldxb	%r8, [%r8+-1]

	/* #3.  Prepend a '/'. */
	stb	[DST+0], '/'

	/* #3.  Append a '/'. */
	add


/*
 * Copyright 2018 Red Hat Inc.
 *
 * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) 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.
 */
#include "wimm.h"
#include "atom.h"
#include "wndw.h"

#include <nvif/clc37b.h>
#include <nvif/pushc37b.h>

#include <nvhw/class/clc37b.h>

static int
wimmc37b_update(struct nv50_wndw *wndw, u32 *interlock)
{
	struct nvif_push *push = wndw->wimm.push;
	int ret;

	if ((ret = PUSH_WAIT(push, 2)))
		return ret;

	PUSH_MTHD(push, NVC37B, UPDATE, 0x00000001 |
		  NVVAL(NVC37B, UPDATE, INTERLOCK_WITH_WINDOW,
			!!(interlock[NV50_DISP_INTERLOCK_WNDW] & wndw->interlock.data)));
	return PUSH_KICK(push);
}

static int
wimmc37b_point(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
{
	struct nvif_push *push = wndw->wimm.push;
	int ret;

	if ((ret = PUSH_WAIT(push, 2)))
		return ret;

	PUSH_MTHD(push, NVC37B, SET_POINT_OUT(0),
		  NVVAL(NVC37B, SET_POINT_OUT, X, asyw->point.x) |
		  NVVAL(NVC37B, SET_POINT_OUT, Y, asyw->point.y));
	return 0;
}

static const struct nv50_wimm_func
wimmc37b = {
	.point = wimmc37b_point,
	.update = wimmc37b_update,
};

static int
wimmc37b_init_(const struct nv50_wimm_func *func, struct nouveau_drm *drm,
	       s32 oclass, struct nv50_wndw *wndw)
{
	struct nvc37b_window_imm_channel_dma_v0 args = {
		.pushbuf = 0xb0007b00 | wndw->id,
		.index = wndw->id,
	};
	struct nv50_disp *disp = nv50_disp(drm->dev);
	int ret;

	ret = nv50_dmac_create(&drm->client.device, &disp->disp->object,
			       &oclass, 0, &args, sizeof(args), -1,
			       &wndw->wimm);
	if (ret) {
		NV_ERROR(drm, "wimm%04x allocation failed: %d\n", oclass, ret);
		return ret;
	}

	wndw->interlock.wimm = wndw->interlock.data;
	wndw->immd = func;
	return 0;
}

int
wimmc37b_init(struct nouveau_drm *drm, s32 oclass, struct nv50_wndw *wndw)
{
	return wimmc37b_init_(&wimmc37b, drm, oclass, wndw);
}


.4 4a3.9 3.9 0 015.5 5.5l-2 2zM7.6 6.3a.8.8 0 01-1 1.1L3.3 4.2a.7.7 0 111-1l3.2 3.1zM5.1 8.6a.8.8 0 010 1.5H3a.8.8 0 010-1.5H5zm5-3.5a.8.8 0 01-1.5 0V3a.8.8 0 011.5 0V5zm6 11.8a.8.8 0 011-1l3.2 3.2a.8.8 0 01-1 1L16 17zm-2.2 2a.8.8 0 011.5 0V21a.8.8 0 01-1.5 0V19zm5-3.5a.7.7 0 110-1.5H21a.8.8 0 010 1.5H19z" fill-rule="nonzero"/></svg>',unlock:'<svg width="24" height="24"><path d="M16 5c.8 0 1.5.3 2.1.9.6.6.9 1.3.9 2.1v3h-2V8a1 1 0 00-.3-.7A1 1 0 0016 7h-2a1 1 0 00-.7.3 1 1 0 00-.3.7v3h.3c.2 0 .3 0 .5.2l.2.6v7.4c0 .3 0 .4-.2.6l-.6.2H4.8c-.3 0-.4 0-.6-.2a.7.7 0 01-.2-.6v-7.4c0-.3 0-.4.2-.6l.5-.2H11V8c0-.8.3-1.5.9-2.1.6-.6 1.3-.9 2.1-.9h2z" fill-rule="evenodd"/></svg>',"unordered-list":'<svg width="24" height="24"><path d="M11 5h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zm0 6h8c.6 0 1 .4 1 1s-.4 1-1 1h-8a1 1 0 010-2zM4.5 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1zm0 6c0-.4.1-.8.4-1 .3-.4.7-.5 1.1-.5.4 0 .8.1 1 .4.4.3.5.7.5 1.1 0 .4-.1.8-.4 1-.3.4-.7.5-1.1.5-.4 0-.8-.1-1-.4-.4-.3-.5-.7-.5-1.1z" fill-rule="evenodd"/></svg>',unselected:'<svg width="24" height="24"><path fill-rule="nonzero" d="M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6c0-1.1.9-2 2-2zm0 1a1 1 0 00-1 1v12c0 .6.4 1 1 1h12c.6 0 1-.4 1-1V6c0-.6-.4-1-1-1H6z"/></svg>',upload:'<svg width="24" height=


vementMethod.getInstance()
            while (matcher.find()) {
                val group = matcher.group()
                if (EmojiUtil.getEmoji(group) != -1) {
                    val emoji: Drawable =
                        mContext.getDrawable(EmojiUtil.getEmoji(group))!!
                    emoji.setBounds(
                        0,
                        0,
                        (holder.reply.textSize * 1.3).toInt(),
                        (holder.reply.textSize * 1.3).toInt()
                    )
                    val imageSpan = CenteredImageSpan(emoji)
                    builder.setSpan(
                        imageSpan,
                        matcher.start(),
                        matcher.end(),
                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
                    )
                    holder.reply.text = builder
                }
            }
        } else {
            val text =
                //"""${reply.username}回复${reply.rusername}: ${reply.message}"""
                if (reply.pic == "")
                    """${reply.username}回复${reply.rusername}: ${reply.message}"""
                else
                    """${reply.username}回复${reply.rusername}: ${reply.message}  查看图片(${reply.picArr.size}) """

            val mess = Html.fromHtml(
                text.replace("\n", "
"),
                Html.FROM_HTML_MODE_COMPACT
            )
            val builder = SpannableStringBuilder(mess)
            val pattern = Pattern.compile("\\[[^\\]]+\\]")
            val matcher = pattern.matcher(builder)
            val urls = builder.getSpans(
                0, text.length,
                URLSpan::class.java
            )
            for (url in urls) {
                val myURLSpan = MyURLSpan(mContext, null, url.url, urlList)
                val start = builder.getSpanStart(url)
                val end = builder.getSpanEnd(url)
                val flags = builder.getSpanFlags(url)
                builder.setSpan(myURLSpan, start, end, flags)
                builder.removeSpan(url)
            }
            holder.reply.text = builder
            holder.reply.movementMethod = LinkMovementMethod.getInstance()
            while (matcher.find()) {
                val group = matcher.group()
                if (EmojiUtil.getEmoji(group) != -1) {
                    val emoji: Drawable =
                        mContext.getDrawable(EmojiUtil.getEmoji(group))!!
                    emoji.setBounds(
                        0,
                        0,
                        (holder.reply.textSize * 1.3).toInt(),
                        (holder.reply.textSize * 1.3).toInt()
                    )
                    val imageSpan = CenteredImageSpan(emoji)
                    builder.setSpan(
                        imageSpan,
                        matcher.start(),
                        matcher.end(),
                        Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
                    )
                    holder.reply.text = builder
                }
            }
        }
    }

    @SuppressLint("RestrictedApi")
    private fun setTextFieldColor(text: String, start: Int, end: Int): SpannableString {
        val spannableString = SpannableString(text)
        val foregroundColorSpan = ForegroundColorSpan(
            ThemeUtils


,    "エグゼ",      "「･･･この奇妙な矢といい、君達･･･何者だい･･･？」"],
                [f_empty,  "",            "召喚された天子は、ゆっくりと着地すると、鋭い目でエグゼ等３人を睨んだ。"],
                [f_rap,    "ラプソディア", "「それはこっちが聞きたいのぅ･･･」"],
                [f_rap,    "ラプソディア", "「アグニの爺様を残してきてまで、ワシを呼ぶとは･･･」"],
                [f_rap,    "ラプソディア", "「･･･オランピアよ。･･･よほどの急時じゃろうのぅ？」"],
                [f_oranpia,"オランピア",   "「そうよ･･･」"],
                [f_rap,    "ラプソディア", "「ふぅむ･･････あやつら何者じゃ」"],
                [f_empty,  "",            "ラプソディアは尋常ではない力を感じ取ったのか、エグゼ等から視線を離そうとしない。"],
                [f_siki,   "シキ",        "「閻魔天子･･･っ、そいつらは恐らくキューブを守護するスペシャリストだ･･･！」"],
                [f_rap,    "ラプソディア", "「スペシャリストじゃと？」"],
                [f_rap,    "ラプソディア", "「･･･ほぅぉ･･･オクタビー伝説に登場する不老不死のスペシャリストか？」"],
                [f_siki,   "シキ",        "「そうだ･･･」"],
                [f_rap,    "ラプソディア", "「本当じゃろうのぅ･･･？嘘をつくと舌をひっこ抜くぞ」"],
                [f_siki,   "シキ",        "「あの子供が碑石に触れた途端、突然出現した･･･間違いない･･･」"],
                [f_rap,    "ラプソディア", "「ほぅ･･････、ムフフ･･･」"],
                [f_empty,  "",           "ラプソディアはルインの方を一瞥すると、エグゼ達に再び視線を戻し不気味な笑い声をあげた。"],
                [f_rap,    "ラプソディア", "「伝説のスペシャリストと戦えるというのか？」"],
                [f_rap,    "ラプソディア", "「･･･ムフフ･･･ならば面白い･･･」"],
                [f_rap,    "ラプソディア", "「三対三というわけじゃな･･･よくぞワシを呼んだ！」"],
            ]
        );
        await s.set(
            new Img("img/story/s_pic25.jpg"),
            [
                [f_ruin,   "ルイン",      "（･･･ピアー･･･！）"],
                [f_pea,    "ピアー",      "「･･･！？」"],
                [f_empty,  "",           "ラプソディア達の様子にただ困惑していた


  message.add_repeated_double(-std::numeric_limits<double>::signaling_NaN());
  message.add_repeated_string(std::string("\000\001\a\b\f\n\r\t\v\\\'\"", 12));

  // Fun story:  We used to use 1.23e22 instead of 1.23e21 above, but this
  //   seemed to trigger an odd case on MinGW/GCC 3.4.5 where GCC's parsing of
  //   the value differed from strtod()'s parsing.  That is to say, the
  //   following assertion fails on MinGW:
  //     assert(1.23e22 == strtod("1.23e22", nullptr));
  //   As a result, SimpleDtoa() would print the value as
  //   "1.2300000000000001e+22" to make sure strtod() produce the exact same
  //   result.  Our goal is to test runtime parsing, not compile-time parsing,
  //   so this wasn't our problem.  It was found that using 1.23e21 did not
  //   have this problem, so we switched to that instead.

  EXPECT_EQ(
      StrCat("repeated_int64: ", kDebugStringSilentMarker,
                   "-9223372036854775808\n"
                   "repeated_uint64: 18446744073709551615\n"
                   "repeated_double: 123.456\n"
                   "repeated_double: 1.23e+21\n"
                   "repeated_double: 1.23e-18\n"
                   "repeated_double: inf\n"
                   "repeated_double: -inf\n"
                   "repeated_double: nan\n"
                   "repeated_double: nan\n"
                   "repeated_double: nan\n"
                   "repeated_double: nan\n"
                   "repeated_string: "
                   "\"\\000\\001\\007\\010\\014\\n\\r\\t\\013\\\\\\'\\\"\"\n"),
      RemoveRedundantZeros(message.DebugString()));
}

TEST_F(TextFormatTest, PrintFloatPrecision) {
  unittest::TestAllTypes message;

  message.add_repeated_float(1.0);
  message.add_repeated_float(1.2);
  message.add_repeated_float(1.23);
  message.add_repeated_float(1.234);
  message.add_repeated_float(1.2345);
  message.add_repeated_float(1.23456);
  message.add_repeated_float(1.2e10);
  message.add_repeated_float(1.23e10);
  message.add_repeated_float(1.234e10);
  message.add_repeated_float(1.2345e10);
  message.add_repeated_float(1.23456e10);
  message.add_repeated_double(1.2);
  message.add_repeated_double(1.23);
  message.add_repeated_double(1.234);
  message.add_repeated_double(1.2345);
  message.add_repeated_double(1.23456);
  message.add_repeated_double(1.234567);
  message.add_repeated_double(1.2345678);
  message.add_repeated_double(1.23456789);
  message.add_repeated_double(1.234567898);
  message.add_repeated_double(1.2345678987);
  message.add_repeated_double(1.23456789876);
  message.add_repeated_double(1.234567898765);
  message.add_repeated_double(1.2345678987654);
  message.add_repeated_double(1.23456789876543);
  message.add_repeated_double(1.2e100);
  message.add_repeated_double(1.23e100);
  message.add_repeated_double(1.234e100);
  message.add_repeated_double(1.2345e100);
  message.add_repeated_double(1.23456e100);
  message.add_repeated_double(1.234567e100);
  messa


541987c0 8.639774-7.333313 15.909341-15.90897 15.909341L146.077828 957.451328c-8.701529 0-15.909993-7.330966-15.909993-15.909341L130.167835 82.458013c0-8.639774 7.334336-15.909341 15.909993-15.909341l477.289567 0c4.721728 0 10.191524 0.620124 15.909993 1.738597l0 252.80268 252.813038 0c1.119543 5.718235 1.740715 11.062963 1.740715 15.909341L893.831142 941.541987z"  ></path>' +
    '' +
    '</symbol>' +
    '' +
    '<symbol id="icon-list" viewBox="0 0 1024 1024">' +
    '' +
    '<path d="M64.661184 810.227242l894.675586 0 0-99.411127L64.661184 710.816115 64.661184 810.227242zM64.661184 561.711192l894.675586 0 0-99.411127L64.661184 462.300065 64.661184 561.711192zM64.661184 213.772758l0 99.397824 894.675586 0 0-99.397824L64.661184 213.772758z"  ></path>' +
    '' +
    '</symbol>' +
    '' +
    '<symbol id="icon-service" viewBox="0 0 1024 1024">' +
    '' +
    '<path d="M537.676629 572.777016C667.27978 572.777016 772.259879 466.772722 772.259879 336.112332 772.259879 205.451942 667.27978 99.447648 537.676629 99.447648 408.073477 99.447648 303.093381 205.451942 303.093381 336.112332 303.093381 466.772722 408.073477 572.777016 537.676629 572.777016L537.676629 572.777016ZM537.676629 530.304582C431.623156 530.304582 345.565814 443.407655 345.565814 336.112332 345.565814 228.817008 431.623156 141.920082 537.676629 141.920082 643.730103 141.920082 729.787446 228.817008 729.787446 336.112332 729.787446 443.407655 643.730103 530.304582 537.676629 530.304582L537.676629 530.304582Z"  ></path>' +
    '' +
    '<path d="M1001.664066 1024.000004C1001.664066 751.431228 782.755985 530.387459 512.615542 530.387459 242.4751 530.387459 23.567019 751.431228 23.567019 1024.000004L66.039452 1024.000004C66.039452 774.796294 266.024779 572.859892 512.615542 572.859892 759.206306 572.859892 959.191633 774.796294 959.191633 1024.000004L1001.664066 1024.000004 1001.664066 1024.000004Z"  ></path>' +
    '' +
    '<path d="M233.809816 572.859892C281.846495 572.859892 320.7039 533.623389 320.7039 485.325241 320.7039 437.027096 281.846495 397.790593 233.809816 397.790593 185.773138 397.790593 146.915732 437.027096 146.915732 485.325241 146.915732 533.623389 185.773138 572.8


public class Kotlin extends JVMLanguage implements FERunnable{
	public void runOnFE(){
		...
	}
}
```

当然，我们还知道 Kotlin 可以编译成 Js 运行，那我们硬生生的把 Kotlin 称作 JVMLanguage 就有些牵强了，而刚刚我们觉得很完美的写法呢，其实是不合适的。

简单的说，继承和实现接口的区别就是：继承描述的是这个类『是什么』的问题，而实现的接口则描述的是这个类『能做什么』的问题。

Kotlin 与 Java 在能够运行在 JVM 这个问题上是一致的，可 Java 却不能像 Kotlin 那样去运行在前端，Kotlin 和 Java 运行在 JVM 上这个点只能算作一种能力，而不能对其本质定性。

于是我们在 Java 8 当中看到了接口默认实现的 Feature，于是我们的代码可以改改了：

```java
public interface JVMRunnable{
	default void runOnJVM(){
		...
	}
}

public class Java extends Language implements JVMRunnable{

}

public class Kotlin extends Language implements JVMRunnable, FERunnable{
	public void runOnFE(){
		...
	}
}
```

这样很好，不过，由于接口无法保存状态，runOnJVM 这个方法的接口级默认实现仍然非常受限制。

那么 Kotlin 给我们带来什么呢？大家请看下面的代码：

```kotlin
abstract class Language

interface JVMRunnable{
    fun runOnJVM()
}

class DefaultJVMRunnable : JVMRunnable {
    override fun runOnJVM() {
        println("running on JVM!")
    }
}

class Java(jvmRunnable: JVMRunnable) : Language(), JVMRunnable by jvmRunnable
class Kotlin(jvmRunnable: JVMRunnable) : Language(), JVMRunnable by jvmRunnable, FERunnable{
	fun runOnFE(){
		...
	}
}
```
通过接口代理的方式，我们把 JVMRunnable 的具体实现代理给了 jvmRunnable 这个实例，这个实例当然是可以保存状态的，它一方面可以很好地解决我们前面提到的接口默认实现的问题，另一方面也能在提供能力的同时不影响原有类的『本质』。
# Kotlin 1.1：我们都路上

##►1.1 RC 来了，Release 还会远吗？

![](11RC-01.png)

去年 2 月 19 日 1.0 发版，我记得此前看到论坛上面开始讨论 1.0 API 趋于稳定的话题，想想都还挺兴奋呢，一不留神，Kotlin 1.0 在稳定奔跑一年之后，也终于迎来下一个版本：就在前天（17日），我留意到 Kotlin 官博发出了 1.1 RC(Release Candidate) 的消息，截止到目前，1.1 的所有开发工作都已经进入尾声，剩下的就只有我们期待的眼神了。

##►成长，一路有你

![](road.JPG)

2016 这一年发生了挺多的事情，最重要的就是 Kotlin 终于有一个正式的版本，开始了按部就班的日子：每两个月一个正式版本以及一个 1.1 的里程碑版本。接着，我们也很快的发现我们期待的功能都悄悄的走进了 Kotlin 的更新日志，Kotlin 正一天一天的成长起来。


XRvLWZlbGZhLz91dG1fc291cmNlPXJlZmVycmFsJnV0bV9tZWRpdW09cGFydG5lciZ1dG1fY2FtcGFpZ249bWVkaWF3b3Jrcw%3D%3D?utm_source=www.mindmegette.hu&utm_medium=ottboxcikk&utm_campaign=ott" target="_blank" class="item ezekIsErdekelhetnek">

                            player.hu

Elkészült a legpraktikusabb karácsonyfa: a fal mellé állítható félfa

                            borsonline.hu

Borzalmas veszteség: lesújtó hírt kapott Gabriela Spanic

                            ripost.hu

Intim helyzetben kapták le Palvin B


and(0),
                         Op.getOperand(1));
    }
    return SDValue();
  };
  SDValue ZeroN0 = GetZeroableOp(N0);
  SDValue ZeroN1 = GetZeroableOp(N1);
  if (!ZeroN0 && !ZeroN1)
    return SDValue();
  N0 = ZeroN0 ? ZeroN0 : N0;
  N1 = ZeroN1 ? ZeroN1 : N1;

  // Use SplitOpsAndApply to handle AVX splitting.
  auto PMADDWDBuilder = [](SelectionDAG &DAG, const SDLoc &DL,
                           ArrayRef<SDValue> Ops) {
    MVT ResVT = MVT::getVectorVT(MVT::i32, Ops[0].getValueSizeInBits() / 32);
    MVT OpVT = MVT::getVectorVT(MVT::i16, Ops[0].getValueSizeInBits() / 16);
    return DAG.getNode(X86ISD::VPMADDWD, DL, ResVT,
                       DAG.getBitcast(OpVT, Ops[0]),
                       DAG.getBitcast(OpVT, Ops[1]));
  };
  return SplitOpsAndApply(DAG, Subtarget, DL, VT, {N0, N1}, PMADDWDBuilder);
}

static SDValue combineMulToPMULDQ(SDNode *N, const SDLoc &DL, SelectionDAG &DAG,
                                  const X86Subtarget &Subtarget) {
  if (!Subtarget.hasSSE2())
    return SDValue();

  EVT VT = N->getValueType(0);

  // Only support vXi64 vectors.
  if (!VT.isVector() || VT.getVectorElementType() != MVT::i64 ||
      VT.getVectorNumElements() < 2 ||
      !isPowerOf2_32(VT.getVectorNumElements()))
    return SDValue();

  SDValue N0 = N->getOperand(0);
  SDValue N1 = N->getOperand(1);

  // MULDQ returns the 64-bit result of the signed multiplication of the lower
  // 32-bits. We can lower with this if the sign bits stretch that far.
  if (Subtarget.hasSSE41() && DAG.ComputeNumSignBits(N0) > 32 &&
      DAG.ComputeNumSignBits(N1) > 32) {
    auto PMULDQBuilder = [](SelectionDAG &DAG, const SDLoc &DL,
                            ArrayRef<SDValue> Ops) {
      return DAG.getNode(X86ISD::PMULDQ, DL, Ops[0].getValueType(), Ops);
    };
    return SplitOpsAndApply(DAG, Subtarget, DL, VT, {N0, N1}, PMULDQBuilder,
                            /*CheckBWI*/ false);
  }

  // If the upper bits are zero we can use a single pmuludq.
  APInt Mask = APInt::getHighBitsSet(64, 32);
  if (DAG.MaskedValueIsZero(N0, Mask) && DAG.MaskedValueIsZero(N1, Mask)) {
    auto PMULUDQBuilder = [](SelectionDAG &DAG, const SDLoc &DL,
                             ArrayRef<SDValue> Ops) {
      return DAG.getNode(X86ISD::PMULUDQ, DL, Ops[0].getValueType(), Ops);
    };
    return SplitOpsAndApply(DAG, Subtarget, DL, VT, {N0, N1}, PMULUDQBuilder,
                            /*CheckBWI*/ false);
  }

  return SDValue();
}

static SDValue combineMul(SDNode *N, SelectionDAG &DAG,
                          TargetLowering::DAGCombinerInfo &DCI,
                          const X86Subtarget &Subtarget) {
  EVT VT = N->getValueType(0);
  SDLoc DL(N);

  if (SDValue V = combineMulToPMADDWD(N


ы.",
  "subToTeamMessages": "Падпісацца на камандныя паведамленні",
  "teamBattle": "Камандная бітва",
  "teamBattleOverview": "Бітва некалькіх каманд, кожны гулец набірае балы для сваёй каманды",
  "teamTournament": "Камандны турнір",
  "teamTournamentOverview": "Арэнный турнір, ўступіць у які могуць толькі члены вашай групы",
  "swissTournamentOverview": "Турнір па швейцарскай сістэме, да якога могуць далучыцца толькі чальці вашай каманды",
  "messageAllMembers": "Напісаць ўсім удзельнікам",
  "messageAllMembersOverview": "Напісаць асобнае паведамленне ўсім удзельнікам каманды",
  "messageAllMembersLongDescription": "Даслаць асабістае паведамленне да ЎСІХ чальцоў каманды.\nГэта можна выкарыстоўваць, каб паклікаць далучыцца да турніру або каманднай гульні.\nГульцы, якія ня любяць такія паведамленні могуць пакінуць каманду.",
  "teamsIlead": "Каманды, лідарам якіх я з'яўляюся",
  "youWayWantToLinkOneOfTheseTournaments": "Можа вы хочаце дадаць якія небудзь з найбліжэйшых турніраў?",
  "usersWhoCanManageThisTeam": "Карыстальнікі, якія могуць кіраваць камандай",
  "leadersChat": "Чат лідараў",
  "closeTeam": "Зачыніць каманду",
  "closeTeamDescription": "Зачыніць каманду назаўсёды.",
  "entryCode": "Код далучэння да каманды",
  "entryCodeDescriptionForLeader": "(Неабавязкова) Код далучэння, якія новыя ўдзельнікі павінны ведаць, каб далучыцца да каманды.",
  "incorrectEntryCode": "Няправільны код далучэння.",
  "teamAlreadyExists": "Каманда ўжо існуе.",
  "upcomingTourns": "Надыходзячыя турніры",
  "completedTourns": "Завершаныя турніры",
  "declinedRequests": "Адхіленыя запыты",
  "teamLeaders:one": "Лідар каманды",
  "teamLeaders:few": "Лідары каманды",
  "teamLeaders:many": "Лідары каманды",
  "teamLeaders:other": "Лідары каманды",
  "xJoinRequests


Internal::LogNodeDiscoveryFailed(_trace_data);                                                            \
    } while (false)

#else // MATTER_TRACING_ENABLED

#define _MATTER_TRACE_DISABLE(...)                                                                                \
    do                                                                                \
    {                                                                                \
    } while (false)

#define MATTER_TRACE_BEGIN(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_TRACE_END(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_TRACE_INSTANT(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_TRACE_SCOPE(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_TRACE_COUNTER(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)

#define MATTER_LOG_MESSAGE_SEND(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_LOG_MESSAGE_RECEIVED(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)

#define MATTER_LOG_NODE_LOOKUP(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_LOG_NODE_DISCOVERED(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)
#define MATTER_LOG_NODE_DISCOVERY_FAILED(...) _MATTER_TRACE_DISABLE(__VA_ARGS__)

#endif // MATTER_TRACING_ENABLED