      totalFlowRuntime = Utils.getTotalRuntime(flowExecIdToJobsMap.get(flowExecPair));

      JsonArray jobSeverity = new JsonArray();
      List<Severity> keys = getSortedSeverityKeys(jobSeverityCount.keySet());
      for (Severity key : keys) {
        JsonObject severityObject = new JsonObject();
        severityObject.addProperty(JsonKeys.SEVERITY, key.getText());
        severityObject.addProperty(JsonKeys.COUNT, jobSeverityCount.get(key));
        jobSeverity.add(severityObject);
      }

      // Execution record
      JsonObject dataset = new JsonObject();
      dataset.addProperty(JsonKeys.ID, mrJobsList.get(0).flowExecId);
      dataset.addProperty(JsonKeys.USERNAME, mrJobsList.get(0).username);
      dataset.addProperty(JsonKeys.START_TIME, mrJobsList.get(0).startTime);
      dataset.addProperty(JsonKeys.FINISH_TIME, mrJobsList.get(mrJobsList.size() - 1).finishTime);
      dataset.addProperty(JsonKeys.RUNTIME, totalFlowRuntime);
      dataset.addProperty(JsonKeys.WAITTIME, totalFlowDelay);
      dataset.addProperty(JsonKeys.RESOURCE_USED, totalFlowMemoryUsed);
      dataset.addProperty(JsonKeys.RESOURCE_WASTED, totalFlowMemoryWasted);
      dataset.addProperty(JsonKeys.QUEUE, mrJobsList.get(0).queueName);
      dataset.addProperty(JsonKeys.SEVERITY, flowSeverity.getText());
      dataset.addProperty(JsonKeys.SCHEDULER, mrJobsList.get(0).scheduler);
      dataset.addProperty(JsonKeys.FLOW_EXEC_ID, mrJobsList.get(0).flowExecId);
      dataset.addProperty(JsonKeys.FLOW_DEF_ID, mrJobsList.get(0).flowDefId);
      dataset.add(JsonKeys.JOBS_SEVERITY, jobSeverity);
      workflowSummaryArray.add(dataset);
    }
    JsonArray sortedWorkflowSummaryArray = getSortedJsonArrayByFinishTime(workflowSummaryArray);
    JsonObject parent = new JsonObject();
    parent.add(JsonKeys.WORKFLOW_SUMMARIES, sortedWorkflowSummaryArray);
    return ok(new Gson().toJson(parent));
  }

  /**
   * This method returns the workflow response object based on the flow execution id
   * @param flowId The flow execution id for which the flow should be returned
   * @return Return the workflow detail based on the flow execution id
   *
   * response object:
   * <pre>
   * *{
   *    "workflows": {
   *    "id": "flowid",
   *        "username": "username",
   *        "starttime": 1471910835628,
   *        "finishtime": 1471911099238,
   *        "runtime": 263610,
   *        "waittime": 46234,
   *        "resourceused": 101382144,
   *        "resourcewasted": 15993417,
   *        "severity": "Moderate",
   *        "flowexecid": "flowexecid",
   *        "flowdefid": "flowdefid",
   *        "jobssummaries": [
   *          {
   *            "id": "jobid",
   *            "jobname": "jobname",
   *            "jobtype": "Pig",
   *            "username": "username",
   *            "starttime": 1471910835628,
   *            "finishtime": 1471911099238,
   *            "runtime": 263610,
   *            "waittime": 46234,
   *            "resourceused": 101382144,
   *            "resourcewasted": 15993417,
   *            "severity": "Moderate",
   *            "tasksseverity": [
   *              {
   *                "severity": "Moderate",
   *                "count": 1
   *


/*
 * Copyright (C) 2013 Google Inc. 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 Google Inc. nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
#ifndef THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_ANGLE_INSTANCED_ARRAYS_H_
#define THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_ANGLE_INSTANCED_ARRAYS_H_

#include "third_party/blink/renderer/modules/webgl/webgl_extension.h"

namespace blink {

class WebGLRenderingContextBase;

class ANGLEInstancedArrays final : public WebGLExtension {
  DEFINE_WRAPPERTYPEINFO();

 public:
  static bool Supported(WebGLRenderingContextBase*);
  static const char* ExtensionName();

  explicit ANGLEInstancedArrays(WebGLRenderingContextBase*);

  WebGLExtensionName GetName() const override;

  void drawArraysInstancedANGLE(GLenum mode,
                                GLint first,
                                GLsizei count,
                                GLsizei primcount);
  void drawElementsInstancedANGLE(GLenum mode,
                                  GLsizei count,
                                  GLenum type,
                                  int64_t offset,
                                  GLsizei primcount);
  void vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_MODULES_WEBGL_ANGLE_INSTANCED_ARRAYS_H_


ed } from '@serenity-js/core'
 * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
 * import { Ensure, equals } from '@serenity-js/assertions'
 *
 * interface Book {
 *     title: string;
 *     author: string;
 * }
 *
 * await actorCalled('Apisit')
 *   .whoCan(CallAnApi.at('https://api.example.org/'))
 *   .attemptsTo(
 *     Send.a(GetRequest.to('/books/0-688-00230-7')),
 *     Ensure.that(LastResponse.status(), equals(200)),
 *     Ensure.that(LastResponse.header('Content-Type'), equals('application/json')),
 *     Ensure.that(LastResponse.body<Book>(), equals({
 *         title: 'Zen and the Art of Motorcycle Maintenance: An Inquiry into Values',
 *         author: 'Robert M. Pirsig',
 *     })),
 *   )
 * ```
 *
 * ## Use Serenity/JS adapters to navigate complex response objects
 *
 * ```ts
 * import { actorCalled } from '@serenity-js/core'
 * import { CallAnApi, GetRequest, LastResponse, Send } from '@serenity-js/rest'
 * import { Ensure, equals } from '@serenity-js/assertions'
 *
 * interface Developer {
 *     name: string;
 *     id: string;
 *     projects: Project[];
 * }
 *
 * interface Project {
 *     name: string;
 *     repoUrl: string;
 * }
 *
 * await actorCalled('Apisitt')
 *   .whoCan(CallAnApi.at('https://api.example.org/'))
 *   .attemptsTo(
 *     Send.a(GetRequest.to('/developers/jan-molak')),
 *     Ensure.that(LastResponse.status(), equals(200)),
 *     Ensure.that(LastResponse.body<Developer>().name, equals('Jan Molak')),
 *     Ensure.that(LastResponse.body<Developer>().projects[0].name, equals('Serenity/JS')),
 * )
 * ```
 *
 * ## Learn more
 * - [AxiosResponse](https://github.com/axios/axios/blob/v0.27.2/index.d.ts#L133-L140)
 *
 * @group Questions
 */
export class LastResponse {

    /**
     * Retrieves the status code of the {@apilink LastResponse|last response}
     *
     * #### Learn more
     * - [HTTP response status codes](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status)
     */
    static status(): QuestionAdapter<number> {
        return Question.about<number>(`the status of the last response`, async actor => {
            return CallAnApi.as(actor).mapLastResponse(response => response.status);
        });
    }

    /**
     * Retrieves the body of the {@apilink LastResponse|last response}
     *
     * #### A type-safe approach using generics
     *
     * ```ts
     * import { actorCalled } from '@serenity-js/core'
     * import { CallAnApi, LastResponse } from '@serenity-js/rest'
     * import { Ensure, equals } from '@serenity-js/assertions'
     *
     * interface Book {
     *   title: string;
     *   author: string;
     * }
     *
     * await actorCalled('Apisitt')
     *   .whoCan(CallAnApi.at('https://api.example.org/'))
     *   .attemptsTo(
     *      // ...
     *
     *      // note body<T>() parameterised with type "Book"
     *      Ensure.that(LastResponse.body<Book>(), equals({
     *        title: 'Zen and the Art of Motorcycle Maintenance: An Inquiry into Values',
     *        author: 'Robert M. Pirsig',


-> true
                else -> {
                    // 必须要查询到
                    val cateGroup =
                        tallyCategoryService.getTallyCategoryGroupById(id = category!!.groupId)!!
                    when (cateGroup.type) {
                        TallyCategoryGroupTypeDTO.Spending -> true
                        else -> false
                    }
                }
            }
            val targetAccount: TallyAccountDTO = when {
                isReimbursementType -> {
                    tallyAccountService.getByUid(
                        uid = billCreateReimbursementUseCase.reimbursementBillInitDataObservableDTO.value!!.bill.accountId
                    )!!
                }

                isTransfer -> {
                    tallyAccountService.getByUid(
                        uid = billCreateTransferUseCase.selectedOutAccountObservableDTO.value!!.uid
                    )!!
                }

                else -> {
                    if (accountId == null) {
                        tallyAccountService.getDefaultAccount()
                    } else {
                        tallyAccountService.getByUid(
                            uid = accountId
                        )!!
                    }
                }
            }
            var transferTargetAccount = when {
                isTransfer -> {
                    tallyAccountService.getByUid(
                        uid = billCreateTransferUseCase.selectedInAccountObservableDTO.value!!.uid
                    )!!
                }

                else -> {
                    null
                }
            }

            val targetBook: TallyBookDTO? = when {
                isReimbursementType -> {
                    tallyBookService.getBookById(
                        uid = billCreateReimbursementUseCase.reimbursementBillInitDataObservableDTO.value!!.bill.bookId
                    )
                }

                else -> {
                    if (bookId == null) {
                        tallyBookService.getDefaultBook()
                    } else {
                        tallyBookService.getBookById(
                            uid = bookId
                        )
                    }
                }
            }

            Assert.assertNotNull(value = targetAccount)
            Assert.assertNotNull(value = targetBook)

            val realCost = when {
                isReimbursementType -> {
                    cost
                }

                else -> {
                    when (costTypeInitData.value) {
                        CostType.Relative -> {
                            if (isSpending) {
                                -cost
                            } else {
                                cost
                            }
                        }

                        CostType.Absolute -> {
                            cost
                        }
                    }
                }
            }

            // 做最后值的确认
            when {
                isReimbursementType -> {
                    Assert.assertNotNull(value = billCreateReimbursementUseCase.reimbursementBillInitDataObservableDTO.value)
                }

                isTransfer -> {
                    // 转账这个值不需要
                    category = null
                    Assert.assertNotNull(value = transferTargetAccount)
                }

                else -> {
                    // 普通记账不需要这个字段
                    transferTargetAccount = null
                    Assert.assertNotNull(value = category)
                }
            }

            // 做图片的上传
            val imageDTOList = selectedImageObservableDTO.value
            val totalImageSize = imageDTOList.size

            // 图片个数控制为 3 个
            if (totalImageSize > 3) {
                tallyAppToast(content = app.getString(R.string.res_str_err_tip9))
                return@launch
            }

            var completeCount by Delegates.observable(initialValue = 0) { _,


edUrls(URL_FIRST);
        assertEquals("", requestedUrls.get(0));
        assertEquals("img.jpg", requestedUrls.get(1));
        assertEquals("img2.jpg", requestedUrls.get(2));
    }

    /**
     * @throws Exception if an error occurs
     */
    @Test
    @Alerts("[object HTMLImageElement]")
    public void ctorImage() throws Exception {
        final String html = DOCTYPE_HTML
            + "\n"
            + "  \n"
            + "    \n"
            + "  \n"
            + "  \n"
            + "  \n"
            + "";

        loadPageVerifyTitle2(html);
    }

    /**
     * @throws Exception if an error occurs
     */
    @Test
    @Alerts("TypeError")
    public void ctorHTMLImageElement() throws Exception {
        final String html = DOCTYPE_HTML
            + "\n"
            + "  \n"
            + "    \n"
            + "  \n"
            + "  \n"
            + "  \n"
            + "";

        loadPageVerifyTitle2(html);
    }

    /**
     * @throws Exception if an error occurs
     */
    @Test
    @Alerts("{\"enumerable\":true,\"configurable\":true}")
    public void imagePrototype() throws Exception {
        final String html = DOCTYPE_HTML
            + "\n"
            + "  \n"
            + "    \n"
            + "  \n"
            + "  \n"
            + "  \n"
            + "";

        loadPageVerifyTitle2(html);
    }

    /**
     * Verifies that if an image has an <tt>onload</tt> attribute, it gets downloaded
     * and the <tt>onload</tt> handler gets invoked.
     * @throws Exception if an error occurs
     */
    @Test
    @Alerts({"0", "1"})
    public void onLoad_calledWhenImageDownloaded_static() throws Exception {
        final URL urlImage = new URL(URL_FIRST, "img.jpg");
        try (InputStream is = getClass().getClassLoader().getResourceAsStream("testfiles/tiny-jpg.img")) {
            final byte[] directBytes = IOUtils.toByteArray(is);

            getMockWebConnection().setResponse(urlImage, directBytes, 200, "ok",
                    MimeType.IMAGE_JPEG, Collections.emptyList());
        }

        final String html = DOCTYPE_HTML
                + "\n"
                + "\n"
                + "  \n"
                + LOG_TEXTAREA

                + "


		*/
		public final org.ldk.structs.Option_u64Z last_local_balance_msat;
		private ChannelClosed(long ptr, bindings.LDKEvent.ChannelClosed obj) {
			super(null, ptr);
			long channel_id = obj.channel_id;
			org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_conv = new org.ldk.structs.ChannelId(null, channel_id); }
			if (channel_id_hu_conv != null) { channel_id_hu_conv.ptrs_to.add(this); };
			this.channel_id = channel_id_hu_conv;
			byte[] user_channel_id = obj.user_channel_id;
			org.ldk.util.UInt128 user_channel_id_conv = new org.ldk.util.UInt128(user_channel_id);
			this.user_channel_id = user_channel_id_conv;
			long reason = obj.reason;
			org.ldk.structs.ClosureReason reason_hu_conv = org.ldk.structs.ClosureReason.constr_from_ptr(reason);
			if (reason_hu_conv != null) { reason_hu_conv.ptrs_to.add(this); };
			this.reason = reason_hu_conv;
			this.counterparty_node_id = obj.counterparty_node_id;
			long channel_capacity_sats = obj.channel_capacity_sats;
			org.ldk.structs.Option_u64Z channel_capacity_sats_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(channel_capacity_sats);
			if (channel_capacity_sats_hu_conv != null) { channel_capacity_sats_hu_conv.ptrs_to.add(this); };
			this.channel_capacity_sats = channel_capacity_sats_hu_conv;
			long channel_funding_txo = obj.channel_funding_txo;
			org.ldk.structs.OutPoint channel_funding_txo_hu_conv = null; if (channel_funding_txo < 0 || channel_funding_txo > 4096) { channel_funding_txo_hu_conv = new org.ldk.structs.OutPoint(null, channel_funding_txo); }
			if (channel_funding_txo_hu_conv != null) { channel_funding_txo_hu_conv.ptrs_to.add(this); };
			this.channel_funding_txo = channel_funding_txo_hu_conv;
			long last_local_balance_msat = obj.last_local_balance_msat;
			org.ldk.structs.Option_u64Z last_local_balance_msat_hu_conv = org.ldk.structs.Option_u64Z.constr_from_ptr(last_local_balance_msat);
			if (last_local_balance_msat_hu_conv != null) { last_local_balance_msat_hu_conv.ptrs_to.add(this); };
			this.last_local_balance_msat = last_local_balance_msat_hu_conv;
		}
	}
	/**
	 * Used to indicate to the user that they can abandon the funding transaction and recycle the
	 * inputs for another purpose.
	 *
	 * This event is not guaranteed to be generated for channels that are closed due to a restart.
	 *
	 * # Failure Behavior and Persistence
	 * This event will eventually be replayed after failures-to-handle (i.e., the event handler
	 * returning `Err(ReplayEvent ())`) and will be persisted across restarts.
	 */
	public final static class DiscardFunding extends Event {
		/**
		 * The channel_id of the channel which has been closed.
		*/
		public final org.ldk.structs.ChannelId channel_id;
		/**
		 * The full transaction received from the user
		*/
		public final org.ldk.structs.FundingInfo funding_info;
		private DiscardFunding(long ptr, bindings.LDKEvent.DiscardFunding obj) {
			super(null, ptr);
			long channel_id = obj.channel_id;
			org.ldk.structs.ChannelId channel_id_hu_conv = null; if (channel_id < 0 || channel_id > 4096) { channel_id_hu_c


croll-vertical {
  right: 0; top: 0;
  width: 8px;
}
.CodeMirror-simplescroll-vertical div {
  right: 0;
  width: 100%;
}

.CodeMirror-overlayscroll .CodeMirror-scrollbar-filler, .CodeMirror-overlayscroll .CodeMirror-gutter-filler {
  display: none;
}

.CodeMirror-overlayscroll-horizontal div, .CodeMirror-overlayscroll-vertical div {
  position: absolute;
  background: #bcd;
  border-radius: 3px;
}

.CodeMirror-overlayscroll-horizontal, .CodeMirror-overlayscroll-vertical {
  position: absolute;
  z-index: 6;
}

.CodeMirror-overlayscroll-horizontal {
  bottom: 0; left: 0;
  height: 6px;
}
.CodeMirror-overlayscroll-horizontal div {
  bottom: 0;
  height: 100%;
}

.CodeMirror-overlayscroll-vertical {
  right: 0; top: 0;
  width: 6px;
}
.CodeMirror-overlayscroll-vertical div {
  right: 0;
  width: 100%;
}
/* The lint marker gutter */
.CodeMirror-lint-markers {
  width: 16px;
}

.CodeMirror-lint-tooltip {
  background-color: #ffd;
  border: 1px solid black;
  border-radius: 4px 4px 4px 4px;
  color: black;
  font-family: monospace;
  font-size: 10pt;
  overflow: hidden;
  padding: 2px 5px;
  position: fixed;
  white-space: pre;
  white-space: pre-wrap;
  z-index: 100;
  max-width: 600px;
  opacity: 0;
  transition: opacity .4s;
  -moz-transition: opacity .4s;
  -webkit-transition: opacity .4s;
  -o-transition: opacity .4s;
  -ms-transition: opacity .4s;
}

.CodeMirror-lint-mark {
  background-position: left bottom;
  background-repeat: repeat-x;
}

.CodeMirror-lint-mark-warning {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=");
}

.CodeMirror-lint-mark-error {
  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJg


ut_padding=1,
                 relu=False,
                 norm='bn'):
        super(ConvTBlock, self).__init__()
        self.conv = nn.ConvTranspose2d(in_channel,
                                       out_chanel,
                                       kernel_size=kernel_size,
                                       padding=padding,
                                       stride=stride,
                                       output_padding=output_padding)
        if norm == 'bn':
            self.norm = nn.BatchNorm2d(out_chanel)
        else:
            self.norm = None
        self.relu = nn.ReLU(True) if relu else None

        for m in self.modules():
            if isinstance(m, nn.ConvTranspose2d):
                nn.init.kaiming_normal_(m.weight, mode='fan_out', nonlinearity='relu')
            elif isinstance(m, (nn.BatchNorm2d, nn.GroupNorm)):
                nn.init.constant_(m.weight, 1)
                nn.init.constant_(m.bias, 0)

    def forward(self, x):
        x = self.conv(x)
        if self.norm is not None:
            x = self.norm(x)
        if self.relu is not None:
            x = self.relu(x)

        return x

class SelfAttention(nn.Module):

    def __init__(self, in_dim):
        super(SelfAttention, self).__init__()
        self.query_conv = nn.Linear(in_dim, in_dim)
        self.key_conv = nn.Linear(in_dim, in_dim)
        self.value_conv = nn.Linear(in_dim, in_dim)

        for name, param in self.named_parameters():
            if 'bias' in name:
                nn.init.constant_(param, 0)
            else:
                nn.init.xavier_uniform_(param)

        self.gamma = nn.Parameter(torch.zeros(1))
        self.softmax = nn.Softmax(dim=-1)

    def forward(self, x):
        m_batchsize, num_dim = x.size()
        proj_query = self.query_conv(x).view(m_batchsize, 1, num_dim).permute(0, 2, 1)
        proj_key = self.key_conv(x).view(m_batchsize, 1, num_dim)
        energy = torch.bmm(proj_query, proj_key)
        attention = self.softmax(energy)
        proj_value = self.value_conv(x).view(m_batchsize, 1, num_dim)

        out = torch.bmm(proj_value, attention.permute(0, 2, 1))
        out = out.view(m_batchsize, num_dim)

        out = self.gamma * out + x

        return out


sultDigits[resultUsed++] = 1; // Quotient = 1.
      // Subtract divisor from remainder.
      _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
    } else {
      // Account for possible carry in _mulAdd step.
      resultDigits[resultUsed++] = 0;
    }

    // Negate y so we can later use _mulAdd instead of non-existent _mulSub.
    var nyDigits = Uint16List(yUsed + 2);
    nyDigits[yUsed] = 1;
    _absSub(nyDigits, yUsed + 1, yDigits, yUsed, nyDigits);
    // nyDigits is read-only and has yUsed digits (possibly including several
    // leading zeros).
    // resultDigits is modified during iteration.
    // resultDigits[0..yUsed-1] is the current remainder.
    // resultDigits[yUsed..resultUsed-1] is the current quotient.
    --i;

    while (j > 0) {
      var estimatedQuotientDigit =
          _estimateQuotientDigit(topDigitDivisor, resultDigits, i);
      j--;
      _mulAdd(estimatedQuotientDigit, nyDigits, 0, resultDigits, j, yUsed);
      if (resultDigits[i] < estimatedQuotientDigit) {
        // Reusing the already existing tmpDigits array.
        var tmpUsed = _dlShiftDigits(nyDigits, yUsed, j, tmpDigits);
        _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
        while (resultDigits[i] < --estimatedQuotientDigit) {
          _absSub(resultDigits, resultUsed, tmpDigits, tmpUsed, resultDigits);
        }
      }
      i--;
    }
    // Cache result.
    _lastDividendDigits = _digits;
    _lastDividendUsed = _used;
    _lastDivisorDigits = other._digits;
    _lastDivisorUsed = other._used;
    _lastQuoRemDigits = resultDigits;
    _lastQuoRemUsed = resultUsed;
    _lastRemUsed = yUsed;
    _lastRem_nsh = nsh;
  }

  int get hashCode {
    // This is the [Jenkins hash function][1] but using masking to keep
    // values in SMI range.
    //
    // [1]: http://en.wikipedia.org/wiki/Jenkins_hash_function

    int combine(int hash, int value) {
      hash = 0x1fffffff & (hash + value);
      hash = 0x1fffffff & (hash + ((0x0007ffff & hash) << 10));
      return hash ^ (hash >> 6);
    }

    int finish(int hash) {
      hash = 0x1fffffff & (hash + ((0x03ffffff & hash) << 3));
      hash = hash ^ (hash >> 11);
      return 0x1fffffff & (hash + ((0x00003fff & hash) << 15));
    }

    if (_isZero) return 6707; // Just a random number.
    var hash = _isNegative ? 83585 : 429689; // Also random.
    for (int i = 0; i < _used; i++) {
      hash = combine(hash, _digits[i]);
    }
    return finish(hash);
  }

  /**
   * Test whether this value is numerically equal to `other`.
   *
   * If [other] is a [_BigIntImpl] returns whether the two operands have the same
   * value.
   *
   * Returns false if `other` is not a [_BigIntImpl].
   */
  bool operator ==(Object other) =>
      other is _BigIntImpl && compareTo(other) == 0;

  /**
   * Returns the minimum number of bits required to store this big integer.
   *
   * The number of bits excludes the sign bit, which gives the natural length
   * for non-negative (unsigned) values.  Negative values are complemented to


  gems: 4,
                },
                action: (player: Player, enemy: Player) => {
                    player.updateResources({gems: -4});
                    enemy.updateTowerLife(-5);
                },
                isActive: false,
                object: {},
                backObject: {},
            },
            gemstone_flaw: {
                name: "gemstone_flaw",
                source: "magic",
                description: {
                    rus: "Дефектный самоцвет",
                    eng: "Gemstone flaw",
                },
                text: {
                    rus: "3 урона\nбашне врага",
                    eng: "3 damage to\nenemy tower",
                },
                src: "./images/cards/gemstone_flaw.png",
                resource: {
                    gems: 2,
                },
                action: (player: Player, enemy: Player) => {
                    player.updateResources({gems: -2});
                    enemy.updateTowerLife(-3);
                },
                isActive: false,
                object: {},
                backObject: {},
            },
            gnoll: {
                name: "gnoll",
                source: "dungeon",
                description: {
                    rus: "Гнолл",
                    eng: "Gnoll",
                },
                text: {
                    rus: "3 урона,\n+1 самоцвет",
                    eng: "3 damage,\n+1 gem",
                },
                src: "./images/cards/gnoll.png",
                resource: {
                    beasts: 2,
                },
                action: (player: Player, enemy: Player) => {
                    player.updateResources({beasts: -2, gems: 1});
                    enemy.takeDamage(3);
                },
                isActive: false,
                object: {},
                backObject: {},
            },
            goblin_archer: {
                name: "goblin_archer",
                source: "dungeon",
                description: {
                    rus: "Гоблин-лучник",
                    eng: "Goblin archer",
                },
                text: {
                    rus: "3 урона башне\nврага, вы получаете\n1 урона",
                    eng: "3 damage to\nenemy tower,\nyou take\n1 damage",
                },
                src: "./images/cards/goblin_archer.png",
                resource: {
                    beasts: 4,
                },
                action: (player: Player, enemy: Player) => {
                    player.updateResources({beasts: -4});
                    enemy.updateTowerLife(-3);
                    player.takeDamage(1);
                },
                isActive: false,
                object: {},
                backObject: {},
            },
            goblin_mob: {
                name: "goblin_mob",
                source: "dungeon",
                description: {
                    rus: "Гоблин",
                    eng: "Goblin mob",
                },
                text: {
                    rus: "6 урона,\nвы получаете\n3 урона",
                    eng: "6 damage,\n you take\n3 damage",
                },
                src: "./images/cards/goblin_mob.png",
                resource: {
                    beasts: 3,
                },
                action: (player: Player, enemy: Player) => {
                    player.updateResources({beasts: -3});
                    enemy.takeDamage(6);
                    player.takeDamage(3);
                },
                isActive: false,
                object: {},
                backObject: {},
            },
            gold_mine: {
                name: "gold_mine",
                source: "mine",
                description: {
                    rus: "Золотая шахта",
                    eng: "Gold mine",
                },
                text: {
                    rus: "Если шахта < шахты\nврага, +2 шахта,\nиначе +1 шахта",
                    eng: "If mine < enemy\nmine, +2 mine,\nelse +1 mine",
                },


//let direction : boolean; // False is up, true is down
//
//         //direction = e.deltaY < 0 ? true : false;
//
//         //console.log(this.count);
//
//         this.count = e.deltaY < 0 ? ++this.count : --this.count;
//         this.style.transform.scale = this.count * 0.1;
//         console.log(this.count);
//     }
// }
//
// var zoom = new Zoom( document.querySelector('img') );
import { Min, Max } from 'class-validator';

export class OrderDto {
  @Min(0.0001, {
    message: 'Field Price is too short',
  })
  @Max(999999999, {
    message: 'Field Price is too short',
  })
  price: number;

  @Min(0.001, {
    message: 'Field Volume is too short',
  })
  @Max(999999999, {
    message: 'Field Volume is too short',
  })
  volume: number;
}
import {primeFactors} from "../primeFactors";

/**
 * The prime factors of 13195 are 5, 7, 13 and 29.
 *
 * What is the largest prime factor of the number 600851475143?
 */
export const p003 = () => primeFactors(600851475143)
    .sort((a, b) => a - b)
    .pop() as number
export class Token {
  private expirationDateHour: Date;
  static readonly ESTIMATED_SECONDS_OF_REQUEST = 10;
  constructor(
    private accessToken: string,
    private tokenType: string,
    expiresIn: number,
  ) {
    this.expirationDateHour = new Date();
    this.expirationDateHour.setSeconds(
      this.expirationDateHour.getSeconds() +
        expiresIn -
        Token.ESTIMATED_SECONDS_OF_REQUEST,
    );
  }

  get $accessToken(): string {
    return this.accessToken;
  }

  get $tokenType(): string {
    return this.tokenType;
  }

  get $expirationDateHour(): Date {
    return this.expirationDateHour;
  }
}
/* eslint-disable no-shadow */
import { apply, either, readonlyNonEmptyArray } from 'fp-ts'
import { pipe } from 'fp-ts/function'

import { Command, Opts } from '../../src'

/**
 * Command type
 */
type Link = NoTargetDirectory | Target | TargetsToDirectory | TargetDirectory

type NoTargetDirectory = {
  readonly _tag: 'NoTargetDirectory'
  readonly target: string
  readonly link: string
}

type Target = {
  readonly _tag: 'Target'
  readonly target: string
}

type TargetsToDirectory = {
  readonly _tag: 'TargetsToDirectory'
  readonly targets: readonlyNonEmptyArray.ReadonlyNonEmptyArray<string>
  readonly directory: string
}

type TargetDirectory = {
  readonly _tag: 'TargetDirectory'
  readonly targetDirectory: string
  readonly targets: readonlyNonEmptyArray.ReadonlyNonEmptyArray<string>
}

const linkNoTargetDirectory = (target: string, link: string): NoTargetDirectory => ({
  _tag: 'NoTargetDirectory',
  target,
  link,
})
const linkTarget = (target: string): Target => ({ _tag: 'Target', target })
const linkTargetsToDirectory = (
  targets: readonlyNonEmptyArray.ReadonlyNonEmptyArray<string>,
  directory: string,
): TargetsToDirectory => ({ _tag: 'TargetsToDirectory', targets, directory })
const linkTargetDirectory = (
  targetDirectory: string,
  targets: readonlyNonEmptyArray.ReadonlyNonEmptyArray<string>,
): TargetDirectory => ({ _tag: 'TargetDirectory', targetDirectory, targets })

/**
 * Command
 */
const target = Opts.argument(either.right)('target')
const linkName = O


cmpl	$0x7f800000, %ecx	/* |x| is finite ? */
	jae	L(arg_inf_or_nan)

	/* Here if |x|>under/overflow bound, and x is finite */
	testq	%rax, %rax		/* sign of x nonzero ? */
	je	L(res_overflow)

	/* Here if -inf<x<underflow bound (x<0) */
	movss	L(SP_SMALL)(%rip), %xmm0/* load small value 2^(-100) */
	mulss	%xmm0, %xmm0		/* Return underflowed result (zero or subnormal) */
	ret

	.p2align	4
L(res_overflow):
	/* Here if overflow bound<x<inf (x>0) */
	movss	L(SP_LARGE)(%rip), %xmm0/* load large value 2^100 */
	mulss	%xmm0, %xmm0		/* Return overflowed result (Inf or max normal) */
	ret

	.p2align	4
L(arg_inf_or_nan):
	/* Here if |x| is Inf or NAN */
	jne	L(arg_nan)	/* |x| is Inf ? */

	/* Here if |x| is Inf */
	lea	L(SP_INF_0)(%rip), %rdx	/* depending on sign of x: */
	movss	(%rdx,%rax,4), %xmm0	/* return zero or Inf */
	ret

	.p2align	4
L(arg_nan):
	/* Here if |x| is NaN */
	addss	%xmm0, %xmm0		/* Return x+x (raise invalid) */
	ret

	.p2align	4
L(near_under_or_overflow):
	/* Here if 125*log(2)<=|x|<under/overflow bound */
	cvtsd2ss	%xmm2, %xmm2	/* SP x*K/log(2)+RS */
	movd	%xmm2, %eax		/* bits of n*K+j with trash */
	subss	L(SP_RS)(%rip), %xmm2	/* SP t=round(x*K/log(2)) */
	movl	%eax, %edx		/* n*K+j with trash */
	cvtss2sd	%xmm2, %xmm2	/* DP t */
	andl	$0x3f, %eax		/* bits of j */
	mulsd	L(DP_NLN2K)(%rip), %xmm2/* DP -t*log(2)/K */
	andl	$0xffffffc0, %edx	/* bits of n */
#ifdef __AVX__
	vaddsd	%xmm1, %xmm2, %xmm0	/* DP y=x-t*log(2)/K */
	vmulsd	%xmm0, %xmm0, %xmm2	/* DP z=y*y */
#else
	addsd	%xmm1, %xmm2		/* DP y=x-t*log(2)/K */
	movaps	%xmm2, %xmm0		/* DP y */
	mulsd	%xmm2, %xmm2		/* DP z=y*y */
#endif
	mulsd	%xmm2, %xmm4		/* DP P3*z */
	addl	$0xffc0, %edx		/* bits of n + DP exponent bias */
	mulsd	%xmm2, %xmm3		/* DP P2*z */
	shlq	$46, %rdx		/* DP 2^n


/* -*- Mode: C; indent-tabs-mode: t; tab-width: 4 -*-
// ---------------------------------------------------------------------------
// SquirrelJME
//     Copyright (C) Stephanie Gawroriski <xer@multiphasicapps.net>
// ---------------------------------------------------------------------------
// SquirrelJME is under the Mozilla Public License Version 2.0.
// See license.mkd for licensing and copyright information.
// -------------------------------------------------------------------------*/

#include "test.h"
#include "proto.h"
#include "mock.h"
#include "unit.h"
#include "sjme/bitStream.h"

/** Test bit sequence. */
static const sjme_jubyte testData[132] =
{
	29, 21, 227U, 128U, 144U, 64, 129U,
	5, 48, 64, 3, 112, 0, 30, 0,
	16, 0, 17, 0, 36, 0, 152U,
	0, 0, 5, 0, 84, 0, 0, 11,
	0, 224U, 2, 0, 128U, 1, 0,
	144U, 1, 0, 64, 3, 0, 128U,
	13, 0, 0, 112, 0, 0, 64,
	7, 0, 0, 240U, 0, 0, 0, 62,
	0, 0, 0, 32, 0, 0, 0,
	179U, 80, 12, 14, 1, 18, 40,
	64, 3, 12, 128U, 5, 224U,
	0, 240U, 0, 8, 0, 16, 1,
	64, 2, 0, 50, 0, 160U, 0,
	0, 84, 0, 0, 13, 0, 128U,
	14, 0, 128U, 1, 0, 0,
	19, 0, 0, 44, 0, 0,
	96, 3, 0, 0, 14, 0,
	0, 192U, 5, 0, 0, 240U,
	0, 0, 0, 248U, 0, 0,
	0, 4
};

/**
 * Tests reading from a bit stream.
 *
 * @since 2024/08/27
 */
SJME_TEST_DECLARE(testBitStreamRead)
{
	sjme_bitStream_input input;
	sjme_bitStream_order order;
	sjme_jint i, actual;
	sjme_juint val;

	/* Open the bit stream. */
	input = NULL;
	if (sjme_error_is(test->error = sjme_bitStream_inputOpenMemory(
		test->pool, &input,
		testData, sizeof(testData))) ||
		input == NULL)
		return sjme_unit_fail(test, "Could not open bit stream?");

	/* Read in all bits. */
	for (i = 1; i <= 64; i++)
	{
		/* Zero is really 32. */
		actual = ((i % 32) == 0 ? 32 : i % 32);

		/* Write in both orders. */
		order = (i <= 32 ? SJME_BITSTREAM_LSB : SJME_BITSTREAM_MSB);

		/* Read in value. */
		val = INT32_MAX;
		if (sjme_error_is(test->error = sjme_bitStream_inputRead(
			input, order,
			&val, actual)))
			return sjme_unit_fail(test, "Could not read %d bits?", actual);

		/* Should match the number given in. */
		sjme_unit_equalI(test, actual, val,
			"Read value did not match? %d", actual);
	}

	/* Close the bit stream. */
	if (sjme_error_is(test->error = sjme_closeable_close(
		SJME_AS_CLOSEABLE(input))))
		return sjme_unit_fail(test, "Could not close the bit stream?");

	/* Success! */
	return SJME_TEST_RESULT_PASS;
}


 ( printDebug )
            out.println(s);
    }

}
/*
 * This file is part of Splice Machine.
 * Splice Machine is free software: you can redistribute it and/or modify it under the terms of the
 * GNU Affero General Public License as published by the Free Software Foundation, either
 * version 3, or (at your option) any later version.
 * Splice Machine 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 Affero General Public License for more details.
 * You should have received a copy of the GNU Affero General Public License along with Splice Machine.
 * If not, see <http://www.gnu.org/licenses/>.
 *
 * Some parts of this source code are based on Apache Derby, and the following notices apply to
 * Apache Derby:
 *
 * Apache Derby is a subproject of the Apache DB project, and is licensed under
 * the Apache License, Version 2.0 (the "License"); you may not use these files
 * 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.
 *
 * Splice Machine, Inc. has modified the Apache Derby code in this file.
 *
 * All such Splice Machine modifications are Copyright 2012 - 2020 Splice Machine, Inc.,
 * and are licensed to you under the GNU Affero General Public License.
 */
package com.splicemachine.dbTesting.system.optimizer.query;

/**
 *
 * Class Query3: Returns a list of queries that Selects from multiple views with
 * joins on columns having indexes
 *
 */

public class Query3 extends GenericQuery {

	public Query3() {
		description = "Select from multiple views with joins on columns having indexes";
		generateQueries();
	}

	/**
	 */
	public void generateQueries() {
		queries
				.add("select v8.col5, v8.col2 , v8.col3  from v8 inner join v8_2 on v8.col4=v8_2.col4 where (v8.col1>100 and v8.col1<110) union all select v8.col5, v8.col6 , v8_2.col7  from v8 inner join v8_2 on v8.col7=v8_2.col7 where (v8.col1>100 and v8.col1<110)");
		queries
				.add("select v16.col5, v16.col2 , v16.col3  from v16 inner join v16_2 on v16.col4=v16_2.col4 where (v16.col1>100 and v16.col1<110) union all select v16.col5, v16.col6 , v16_2.col7  from v16 inner join v16_2 on v16.col7=v16_2.col7 where (v16.col1>100 and v16.col1<110)");
		queries
				.add("select v32.col5, v32.col2 , v32.col3  from v32 inner join v32_2 on v32.col4=v32_2.col4 where (v32.col1>100 and v32.col1<110) union all select v32.col5, v32.col6 , v32_2.col7  from v32 inner join v32_2 on v32.col7=v32_2.col7 where (v32.col1>100 and v32.col1<110)");
		queries
				.add("select v42.col5, v42.col2 , v42.col3  from v42 inner join v42_2 on v42.col4=v42_2.col4 where (v42.col1>100 and v42.col1<110) union all select v42.col5, v42.col6 , v42_2.col7  from v42 inner join v42_2 on v42.col7=v42_2.col7 where (v42.col1>100 and v42.col1<110)");

	}

}
/*
 * This file is part of Splice Machine.
 * Splice Machine is free software: you can redistribute it and/or modify it under the terms of the
 * GNU Affero General Public License as published


*/
    private fun setTextSizeFor(
        boxPaint: Paint,
        boxWidth: Float,
        boxHeight: Float,
        text: String,
        multiplier: Double = 1.0
    ): Float {
        var size = baselineTextSize
        boxPaint.textSize = size
        boxPaint.getTextBounds(text, 0, text.length, tempRect)
        val w = tempRect.width().toFloat()
        val h = tempRect.height().toFloat()
        val diffW = abs(boxWidth - w)
        val diffH = abs(boxHeight - h)
        if (w < boxWidth && h < boxHeight) {
            // Text fits, scale up on axis which has less room
            size *= if (diffW < diffH) {
                1.0f + diffW / w
            } else {
                1.0f + diffH / h
            }
        } else if (w >= boxWidth && h < boxHeight) {
            // Text does not fit on x-axis
            size *= (1.0f - diffW / w)
        } else if (w < boxWidth && h >= boxHeight) {
            // Text does not fit on y-axis
            size *= (1.0f - diffH / h)
        } else {
            // Text does not fit at all, scale down on axis which has most overshoot
            size *= if (diffW < diffH) {
                1.0f - diffH / h
            } else {
                1.0f - diffW / w
            }
        }
        size *= multiplier.toFloat()
        boxPaint.textSize = size
        return size
    }

    override fun onThemeUpdated(theme: Theme) {
        if (isPreviewMode) {
            cachedTheme = theme
            background =
                (theme.getAttr(Theme.Attr.KEYBOARD_BG_DRAWABLE).toDrawable()
                    .getDrawableId(context))
//            backgroundDrawable.apply {
//                paint.color = theme.getAttr(Theme.Attr.KEYBOARD_BACKGROUND).toSolidColor().color
//            }
        }
        if (theme.getAttr(Theme.Attr.GLIDE_TRAIL_COLOR).toSolidColor().color == 0) {
            glideTrailPaint.color =
                theme.getAttr(Theme.Attr.WINDOW_COLOR_PRIMARY).toSolidColor().color
            glideTrailPaint.alpha = 32
        } else {
            glideTrailPaint.color = theme.getAttr(Theme.Attr.GLIDE_TRAIL_COLOR).toSolidColor().color
        }
        val isBorderless = !theme.getAttr(Theme.Attr.KEY_SHOW_BORDER).toOnOff().state
        for (n in 0 until childCount) {
            val rv = getChildAt(n) as? TextKeyView
            if (rv?.key != null) {
                layoutRenderView(rv, rv.key!!, isBorderless)
                prepareKey(
                    rv.key!!,
                    cachedTheme ?: themeManager?.activeTheme ?: Theme.BASE_THEME,
                    rv
                )
                rv.invalidate()
            }
        }
    }

    private fun invalidate(key: TextKey) {
        for (n in 0 until childCount) {
            val rv = getChildAt(n) as? TextKeyView
            if (rv != null && rv.key == key) {
                prepareKey(key, cachedTheme ?: themeManager?.activeTheme ?: Theme.BASE_THEME, rv)
                rv.invalidate()
                break
            }
        }
    }

    fun onDrawComputedKey(canvas: Canvas, key: TextKey, renderView: TextKeyView) {
        if (!key.isVisible) return

        val label = key.label
        if (label != null) {
            renderView.labelPaint.let {
                val centerX = key.visibleLabelBounds.exactCenterX()
                val centerY =
                    key.visibleLabelBounds.exactCenterY() + (it.textSize - it.descent()) / 2
                if (label.contains("\n")) {
                    // Even if more lines may be existing only the first 2 are shown
                    val labelLines = label.split("\n")
                    val verticalAdjustment = key.visibleBounds.height() * 0.18f
                    canvas.drawText(labelLines[0], centerX, centerY - verticalAdjustment, it)


_det_01',
	[280674249] = 'po1_01_ship_dt05_det_010',
	[-1670228174] = 'po1_01_ship_dt05_det_012',
	[-1489474370] = 'po1_01_ship_dt05_det_013',
	[-1327071206] = 'po1_01_ship_dt05_det_014',
	[-1016716007] = 'po1_01_ship_dt05_det_015',
	[1629675672] = 'po1_01_ship_dt05_det_016',
	[-1343586778] = 'po1_01_ship_dt05_det_019',
	[675435983] = 'po1_01_ship_dt05_det_02',
	[371576371] = 'po1_01_ship_dt05_det_020',
	[-1040152243] = 'po1_01_ship_dt05_det_03',
	[-264116793] = 'po1_01_ship_dt05_det_04',
	[-374155095] = 'po1_01_ship_dt05_det_05',
	[-721670340] = 'po1_01_ship_dt05_det_06',
	[-1088027760] = 'po1_01_ship_dt05_det_07',
	[-1199147439] = 'po1_01_ship_dt05_det_08',
	[-1517669147] = 'po1_01_ship_dt05',
	[1563060572] = 'po1_01_shipa_stairs01',
	[1942207558] = 'po1_01_shipa_stairs01b',
	[1339870913] = 'po1_01_shipa_stairs02',
	[-881889556] = 'po1_01_shipa_stairs02b',
	[1723983835] = 'po1_01_shipa01',
	[-1199302180] = 'po1_01_shipbuffer012_det01',
	[1893403271] = 'po1_01_shipbuffer012_det02',
	[-493457920] = 'po1_01_shipbuffer012_det03',
	[-1916418980] = 'po1_01_shipbuffer012_det04',
	[2139039695] = 'po1_01_shipbuffer012_det05',
	[-1928326835] = 'po1_01_shipbuffer012',
	[-618543443] = 'po1_01_shipdecal',
	[-2038774770] = 'po1_01_shipdetail01',
	[-106280541] = 'po1_01_shipmain_det_01',
	[2123780985] = 'po1_01_shipmain_det_02',
	[109750574] = 'po1_01_shipmain',
	[-299421617] = 'po1_01_shiprad1',
	[1081824506] = 'po1_01_shiprad2',
	[-160989943] = 'po1_01_shrailing01',
	[762276628] = 'po1_01_shrailing02',
	[439960744] = 'po1_01_shrailing03',
	[1358180893] = 'po1_01_shrailing04',
	[-916731185] = 'po1_01_sidewall044',
	[458921549] = 'po1_01_sidewall044b',
	[2117252226] = 'po1_01_sidewall046',
	[-648307731] = 'po1_01_sidewall046b',
	[1850197188] = 'po1_01_spotlite01',
	[1860049994] = 'po1_01_tug_dec',
	[1382867804] = 'po1_01_tug_det',
	[1461947337] = 'po1_01_tug',
	[203292


ANG||(LA122_1>=TIME && LA122_1<=LETTER)||(LA122_1>=NAME && LA122_1<=LBRACE)||(LA122_1>=FOR && LA122_1<=DONE)||(LA122_1>=SELECT && LA122_1<=CASE)||(LA122_1>=TILDE && LA122_1<=SINGLE_QUOTED_STRING_TOKEN)||(LA122_1>=SLASH && LA122_1<=QMARK)||(LA122_1>=COMMAND_SUBSTITUTION_PAREN && LA122_1<=COMMAND_SUBSTITUTION_TICK)) && ((!((case_body_scope)case_body_stack.peek()).case_end))) {s = 8;}

                        input.seek(index122_1);
                        if ( s>=0 ) return s;
                        break;
                    case 9 :
                        int LA122_0 = input.LA(1);

                        int index122_0 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (LA122_0==BLANK) ) {s = 1;}

                        else if ( (LA122_0==EOL) ) {s = 2;}

                        else if ( (LA122_0==EOF||(LA122_0>=SEMIC && LA122_0<=AMP)||(LA122_0>=LOGICAND && LA122_0<=LOGICOR)||LA122_0==PIPE||(LA122_0>=LESS_THAN && LA122_0<=GREATER_THAN)||LA122_0==RPAREN||(LA122_0>=HERE_STRING_OP && LA122_0<=AMP_RSHIFT)||LA122_0==DOUBLE_SEMIC) ) {s = 3;}

                        else if ( (LA122_0==POUND||LA122_0==BANG||(LA122_0>=TIME && LA122_0<=LETTER)||LA122_0==LPAREN||LA122_0==DIGIT||(LA122_0>=NAME && LA122_0<=LBRACE)||(LA122_0>=FOR && LA122_0<=DONE)||(LA122_0>=SELECT && LA122_0<=SINGLE_QUOTED_STRING_TOKEN)||(LA122_0>=SLASH && LA122_0<=QMARK)||(LA122_0>=COMMAND_SUBSTITUTION_PAREN && LA122_0<=COMMAND_SUBSTITUTION_TICK)) && ((!((case_body_scope)case_body_stack.peek()).case_end))) {s = 4;}

                        input.seek(index122_0);
                        if ( s>=0 ) return s;
                        break;
                    case 10 :
                        int LA122_12 = input.LA(1);

                        int index122_12 = input.index();
                        input.rewind();
                        s = -1;
                        if ( (LA122_12==POUND||LA122_12==BANG||(LA122_12>=TIME && LA122_12<=HERE_STRING_OP)||(LA122_12>=RSHIFT && LA122_12<=FOR)||LA122_12==DO||LA122_12==LLPAREN||(LA122_12>=SELECT && LA122_12<=CASE)||(LA122_12>=TILDE && LA122_12<=SINGLE_QUOTED_STRING_TOKEN)||(LA122_12>=SLASH && LA122_12<=QMARK)||(LA122_12>=COMMAND_SUBSTITUTION_PAREN && LA122_12<=COMMAND_SUBSTITUTION_TICK)) ) {s = 19;}

                        else if ( (LA122_12==BLANK) ) {s = 9;}

                        else if ( (LA122_12==ESAC) ) {s = 22;}

                        else if ( (LA122_12==DONE) ) {s = 10;}

                        else if ( (LA122_12==EOL) ) {s = 12;}

                        else if ( (LA122_12==DOUBLE_SEMIC) ) {s = 14;}

                        else if ( (LA122_12==IN) && ((!((case_body_scope)case_body_stack.peek()).case_end))) {s = 13;}

                        input.seek(index122_12);


nt32
	FrontCounterClockwise uint32
	DepthBias             int32
	DepthBiasClamp        float32
	SlopeScaledDepthBias  float32
	DepthClipEnable       uint32
	ScissorEnable         uint32
	MultisampleEnable     uint32
	AntialiasedLineEnable uint32
}

var (
	_IID_ID3D11Texture2D = _GUID{0x6f15aaf2, 0xd208, 0x4e89, 0x9a, 0xb4, 0x48, 0x95, 0x35, 0xd3, 0x4f, 0x9c}
	_IID_IDXGIDevice     = _GUID{0x54ec77fa, 0x1377, 0x44e6, 0x8c, 0x32, 0x88, 0xfd, 0x5f, 0x44, 0xc8, 0x4c}
	_IID_IDXGIFactory    = _GUID{0x7b7166ec, 0x21c7, 0x44ae, 0xb2, 0x1a, 0xc9, 0xae, 0x32, 0x1a, 0xe3, 0x69}
)

var (
	d3d11 = windows.NewLazySystemDLL("d3d11.dll")

	__D3D11CreateDevice             = d3d11.NewProc("D3D11CreateDevice")
	__D3D11CreateDeviceAndSwapChain = d3d11.NewProc("D3D11CreateDeviceAndSwapChain")
)

const (
	_D3D11_SDK_VERSION        = 7
	_D3D_DRIVER_TYPE_HARDWARE = 1

	_DXGI_FORMAT_UNKNOWN             = 0
	_DXGI_FORMAT_R16_FLOAT           = 54
	_DXGI_FORMAT_R32_FLOAT           = 41
	_DXGI_FORMAT_R32G32_FLOAT        = 16
	_DXGI_FORMAT_R32G32B32_FLOAT     = 6
	_DXGI_FORMAT_R32G32B32A32_FLOAT  = 2
	_DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29
	_DXGI_FORMAT_R16_SINT            = 59
	_DXGI_FORMAT_R16G16_SINT         = 38
	_DXGI_FORMAT_R16_UINT            = 57
	_DXGI_FORMAT_D24_UNORM_S8_UINT   = 45
	_DXGI_FORMAT_R16G16_FLOAT        = 34
	_DXGI_FORMAT_R16G16B16A16_FLOAT  = 10

	_D3D11_FORMAT_SUPPORT_TEXTURE2D     = 0x20
	_D3D11_FORMAT_SUPPORT_RENDER_TARGET = 0x4000

	_DXGI_USAGE_RENDER_TARGET_OUTPUT = 1 << (1 + 4)

	_D3D11_CPU_ACCESS_READ = 0x20000

	_D3D11_MAP_READ = 1

	_DXGI_SWAP_EFFECT_DISCARD = 0

	_D3D_FEATURE_LEVEL_9_1  = 0x9100
	_D3D_FEATURE_LEVEL_9_3  = 0x9300
	_D3D_FEATURE_LEVEL_11_0 = 0xb000

	_D3D11_USAGE_IMMUTABLE = 1
	_D3D11_USAGE_STAGING   = 3

	_D3D11_BIND_VERTEX_BUFFER   = 0x1
	_D3D11_BIND_INDEX_BUFFER    = 0x2
	_D3D11_BIND_CONSTANT_BUFFER = 0x4
	_D3D11_BIND_SHADER_RESOURCE = 0x8
	_D3D11_BIND_RENDER_TARGET   = 0x20
	_D3D11_BIND_DEPTH_STENCIL   = 0x40

	_D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST  = 4
	_D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5

	_D3D11_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14
	_D3D11_FILTER_MIN_MAG_MIP_POINT        = 0

	_D3D11_TEXTURE_ADDRESS_MIRROR = 2
	_D3D11_TEXTURE_ADDRESS_CLAMP  = 3
	_D3D11_TEXTURE_ADDRESS_WRAP   = 1

	_D3D11_SRV_DIMENSION_TEXTURE2D = 4

	_D3D11_CREATE_DEVICE_DEBUG = 0x2

	_D3D11_FILL_SOLID = 3

	_D3D11_CULL_NONE = 1

	_D3D11_CLEAR_DEPTH   = 0x1
	_D3


LAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------

/// Used when generating the blended base texture.
singleton ShaderData( TerrainBlendShader )
{
   DXVertexShaderFile   = $Core::CommonShaderPath @ "/terrain/blendV.hlsl";
   DXPixelShaderFile    = $Core::CommonShaderPath @ "/terrain/blendP.hlsl";

   OGLVertexShaderFile = $Core::CommonShaderPath @ "/terrain/gl/blendV.glsl";
   OGLPixelShaderFile = $Core::CommonShaderPath @ "/terrain/gl/blendP.glsl";

   samplerNames[0] = "layerTex";
   samplerNames[1] = "textureMap";

   pixVersion = 2.0;
};


O, BI, 8), BO
	negq	BI
	negq	%rax
	ALIGN_4

.L2_22:

	KERNEL4x2_1(xxx)
	KERNEL4x2_2(xxx)
	KERNEL4x2_3(xxx)
	KERNEL4x2_4(xxx)

	KERNEL4x2_1(xxx)
	KERNEL4x2_2(xxx)
	KERNEL4x2_3(xxx)
	KERNEL4x2_4(xxx)

	je	.L2_26

	KERNEL4x2_1(xxx)
	KERNEL4x2_2(xxx)
	KERNEL4x2_3(xxx)
	KERNEL4x2_4(xxx)

	KERNEL4x2_1(xxx)
	KERNEL4x2_2(xxx)
	KERNEL4x2_3(xxx)
	KERNEL4x2_4(xxx)

	je	.L2_26

	jmp	.L2_22
	ALIGN_4

.L2_26:
#ifndef TRMMKERNEL
        movq    K, %rax
#else
        movq    KKK, %rax
#endif

	andq	$7, %rax		# if (k & 1)
	je .L2_29

	movq    %rax, BI                        //  Index for BO
        leaq    (BI,BI,1), BI                   //  BI = BI * 2 ; number of values

	salq	$2, %rax			// rax = rax * 4 ; number of values
	leaq	(AO, %rax, 8), AO
	leaq	(BO, BI, 8), BO
	negq	BI
	negq	%rax
	ALIGN_4

.L2_27:

	KERNEL4x2_SUB(xxx)
	addq	$2, BI
	addq	$4, %rax
	jl	.L2_27
	ALIGN_4

.L2_29:

	vmovddup	ALPHA, %xmm0

#ifndef TRMMKERNEL

	vfmaddpd 	 (CO1),%xmm0, %xmm4,%xmm4
	vfmaddpd 2 * SIZE(CO1),%xmm0, %xmm7,%xmm7

	vfmaddpd 	 (CO1, LDC),%xmm0, %xmm5,%xmm5
	vfmaddpd 2 * SIZE(CO1, LDC),%xmm0, %xmm8,%xmm8

#else
	vmulpd	%xmm0, %xmm4,%xmm4
	vmulpd	%xmm0, %xmm7,%xmm7

	vmulpd	%xmm0, %xmm5,%xmm5
	vmulpd	%xmm0, %xmm8,%xmm8

#endif

	vmovups	%xmm4 ,  	(CO1)
	vmovups	%xmm7 , 2 * SIZE(CO1)

	vmovups	%xmm5 ,  	(CO1, LDC)
	vmovups	%xmm8 , 2 * SIZE(CO1, LDC)

#if (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
    (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
        movq    K, %rax
        subq    KKK, %rax
        movq    %rax, BI                        //  Index for BO
        leaq    (BI,BI,1), BI                   //  BI = BI * 2 ; number of values
        leaq    (BO, BI, 8), BO
        salq    $2, %rax                        // rax = rax * 4 ; number of values
        leaq    (AO, %rax, 8), AO
#endif

#if defined(TRMMKERNEL) && defined(LEFT)
        addq    $4, KK
#endif

	addq	$4 * SIZE, CO1		# coffset += 4
	ALIGN_4

.L2_30:
	testq	$2, M
	jz	.L2_40

	ALIGN_4

.L2_31:
#if !defined(TRMMKERNEL) || \
        (defined(TRMMKERNEL) &&  defined(LEFT) &&  defined(TRANSA)) || \
        (defined(TRMMKERNEL) && !defined(LEFT) && !defined(TRANSA))
        leaq    BUFFER1, BO             // first buffer to BO
        addq    $4 * SIZE, BO
#else
        movq    KK, %rax
        leaq    BUFFER1, BO             // first buffer to BO
        addq    $4 * SIZE, BO
        movq    %


d              atomic.Value
	}

	// incoming packet
	inPacket struct {
		from net.Addr
		data []byte
	}
)

// monitor incoming data for all connections of server
func (l *Listener) monitor() {
	// cache last session
	var lastKey sessionKey
	var lastSession *UDPSession

	chPacket := make(chan inPacket, qlen)
	go l.receiver(chPacket)
	for {
		select {
		case p := <-chPacket:
			raw := p.data
			data := p.data
			from := p.from
			dataValid := false
			if l.block != nil {
				l.block.Decrypt(data, data)
				data = data[nonceSize:]
				checksum := crc32.ChecksumIEEE(data[crcSize:])
				if checksum == binary.LittleEndian.Uint32(data) {
					data = data[crcSize:]
					dataValid = true
				} else {
					atomic.AddUint64(&DefaultSnmp.InCsumErrors, 1)
				}
			} else if l.block == nil {
				dataValid = true
			}

			if dataValid {
				var conv uint32
				convValid := false
				if l.fecDecoder != nil {
					isfec := binary.LittleEndian.Uint16(data[4:])
					if isfec == typeData {
						conv = binary.LittleEndian.Uint32(data[fecHeaderSizePlus2:])
						convValid = true
					}
				} else {
					conv = binary.LittleEndian.Uint32(data)
					convValid = true
				}

				if convValid {
					key := sessionKey{
						addr:   from.String(),
						convID: conv,
					}
					var s *UDPSession
					var ok bool

					// packets received from an address always come in batch.
					// cache the session for next packet, without querying map.
					if key == lastKey {
						s, ok = lastSession, true
					} else if s, ok = l.sessions[key]; ok {
						lastSession = s
						lastKey = key
					}

					if !ok { // new session
						if !blacklist.has(from.String(), conv) && len(l.chAccepts) < cap(l.chAccepts) && len(l.sessions) < 4096 { // do not let new session overwhelm accept queue and connection count
							ses := newUDPSession(conv, l.dataShards, l.parityShards, l, l.conn, from, l.block)
							ses.kcpInput(data)
							l.sessions[key] = ses
							l.chAccepts <- ses
						}
					} else {
						s.kcpInput(data)
					}
				}
			}

			xmitBuf.Put(raw)
		case key := <-l.chSessionClosed:
			if key == lastKey {
				lastKey = sessionKey{}
			}
			delete(l.sessions, key)
		case <-l.die:
			return
		}
	}
}

func (l *Listener) receiver(ch chan<- inPacket) {
	for {
		data := xmitBuf.Get().([]byte)[:mtuLimit]
		if n, from, err := l.conn.ReadFrom(data); err == nil && n >= l.headerSize+IKCP_OVERHEAD {
			select {
			case ch <- inPacket{from, data[:n]}:
			case <-l.die:
				return
			}
		} else if err != nil {
			return
		} else {
			atomic.AddUint64(&DefaultSnmp.InErrs, 1)
		}
	}
}

// SetReadBuffer sets the socket read buffer for the Listener
func (l *Listener) SetReadBuffer(bytes int) error {
	if nc, ok := l.conn.(setReadBuffer); ok {
		return nc.SetReadBuffer(bytes)
	}
	return errors.New(errInvalidOperation)
}

// SetWriteBuffer sets the socket write


le;
  width: 100%;
  height: 100%;
}

// Use: @include screen-reader-text;
@mixin screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;

  &:focus {
    clip: auto !important;
    display: block;
    width: auto;
    height: auto;
    left: 5px;
    top: 5px;
    z-index: 100000;
  }
}

// Responsive screen sizes
@mixin mobile {
  @media (max-width: #{$tablet}-1) {
    @content;
  }
}

@mixin mobile-tablet {
  @media (max-width: #{$desktop}-1) {
    @content;
  }
}

@mixin tablet {
  @media (min-width: #{$tablet}) and (max-width: #{$desktop}-1) {
    @content;
  }
}

@mixin tablet-desktop {
  @media (min-width: #{$tablet}) {
    @content;
  }
}

@mixin desktop {
  @media (min-width: #{$desktop}) {
    @content;
  }
}
@font-face{font-family:icomoon;src:url(../fonts/icomoon/fonts/icomoon.woff) format("woff"),url(../fonts/icomoon/fonts/icomoon.svg#icomoon) format("svg");font-weight:400;font-style:normal}/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}[hidden],template{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}.model-nested__title,h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0;overflow:visible}.button,button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:700}.button,button,input{overflow:visible}.button,button,select{text-transform:none}.button,[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}.button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}.button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;


                    results['revision_impacts'])

    columns = ['forecast (prev)', 'observed', 'weight', 'impact']
    actual = news.details_by_impact.loc['2016-09', 'GDPC1'][columns]
    assert_allclose(actual.loc[('2016-06', 'CPIAUCSL')],
                    results['news_table'][0])
    assert_allclose(actual.loc[('2016-06', 'UNRATE')],
                    results['news_table'][1])
    assert_allclose(actual.loc[('2016-06', 'PAYEMS')],
                    results['news_table'][2])
    if mod1.k_endog_M == 6:
        i = 6
        assert_allclose(actual.loc[('2016-06', 'RSAFS')],
                        results['news_table'][3])
        assert_allclose(actual.loc[('2016-05', 'TTLCONS')],
                        results['news_table'][4])
        assert_allclose(actual.loc[('2016-06', 'TCU')],
                        results['news_table'][5])
    else:
        i = 3
    assert_allclose(actual.loc[('2016-06', 'GDPC1')],
                    results['news_table'][i])


romptPaidEvent.User,
		},
	)
}

func (db *AgentUsageIndexerDatabaseInMemory) StorePromptConsumedData(addr [32]byte, promptConsumedEvent *PromptConsumedEvent) {
	db.mu.Lock()
	defer db.mu.Unlock()

	usage := db.getOrCreateAgentUsage(addr)

	var succeeded bool
	var drainAddress *felt.Felt

	if promptConsumedEvent.DrainedTo.Bytes() == addr {
		succeeded = false
		drainAddress = new(felt.Felt)
	} else {
		succeeded = true
		drainAddress = promptConsumedEvent.DrainedTo
	}

	promptCacheKey := db.promptCacheKey(addr, promptConsumedEvent.PromptID)
	promptCacheData, ok := db.promptCache.Peek(promptCacheKey)
	if !ok {
		slog.Error("prompt not found in cache", "agent", "0x"+hex.EncodeToString(addr[:]), "prompt", promptConsumedEvent.PromptID)
		promptCacheData = AgentUsageIndexerDatabaseInMemoryPromptCacheData{}
	} else {
		db.promptCache.Remove(promptCacheKey)
	}

	prompt := &AgentUsagePrompt{
		PromptID:  promptConsumedEvent.PromptID,
		TweetID:   promptCacheData.TweetID,
		Prompt:    promptCacheData.Prompt,
		User:      promptCacheData.User,
		IsSuccess: succeeded,
		DrainedTo: drainAddress,
	}

	if succeeded {
		usage.IsDrained = true
		usage.DrainPrompt = prompt

		db.totalUsage.TotalSuccesses++
	}

	usage.LatestPrompts = append(usage.LatestPrompts, prompt)
	if uint64(len(usage.LatestPrompts)) > db.maxPrompts {
		usage.LatestPrompts = usage.LatestPrompts[1:]
	}

	db.usages[addr] = usage
}

func (db *AgentUsageIndexerDatabaseInMemory) StoreWithdrawnData(addr [32]byte, withdrawnEvent *WithdrawnEvent) {
	db.mu.Lock()
	defer db.mu.Unlock()

	usage := db.getOrCreateAgentUsage(addr)

	usage.IsWithdrawn = true
	db.usages[addr] = usage
}

func (db *AgentUsageIndexerDatabaseInMemory) GetTotalUsage() *AgentUsageIndexerTotalUsage {
	db.mu.RLock()
	defer db.mu.RUnlock()

	return db.totalUsage
}

func (db *AgentUsageIndexerDatabaseInMemory) GetLastIndexedBlock() uint64 {
	return db.lastIndexedBlock
}

func (db *AgentUsageIndexerDatabaseInMemory) SetLastIndexedBlock(block uint64) {
	db.mu.Lock()
	defer db.mu.Unlock()

	db.lastIndexedBlock = block
}

func (db *AgentUsageIndexerDatabaseInMemory) getOrCreateAgentUsage(addr [32]byte) *AgentUsage {
	usage, ok := db.usages[addr]
	if !ok {
		usage = &AgentUsage{
			BreakAttempts: 0,
			LatestPrompts: make([]*AgentUsagePrompt, 0, db.maxPrompts+1),
			DrainPrompt:   nil,
			IsDrained:     false,
		}
	}

	return usage
}

func (db *AgentUsageIndexerDatabaseInMemory) promptCacheKey(addr [32]byte, promptID uint64) AgentUsageIndexerDatabaseInMemoryPromptCacheKey {
	data := make([]byte, 40)
	copy(data[:32], addr[:])
	binary.BigEndian.PutUint64(data[32:], promptID)

	hash := sha256.Sum256(data)
	return AgentUsageIndexerDatabaseInMemoryPromptCacheKey(hash)
}
package indexer

import (
	"context"
	"log/slog"
	"math/big"
	"sync"
	"time"

	"golang.org/x/sync/errgroup"

	"github.com/NethermindEth/juno/core/felt"

	"github.com/N


##
# Assembler used:           Clang
# Assembly syntax:          x86 Intel
# CPU architecture:         Intel x86-64
# Platform architecture:    PC
# OS architecture:          Linux
##
# Program to demonstrate the SystemV AMD64 ABI while interfacing with the C library
# Will print out command-line arguments and argument count
#
# Compile with: clang -fPIE -s test.s
#
# Author: @theonekevin on GitHub
##

.intel_syntax noprefix
.global main
.global printf
.global exit

.text

main:
    int 3                       # Set breakpoint
    push    rbp                 # Set up stack frame
    mov     rbp, rsp            # Stack frame looks like:
                                # +0x0000: junk values          <- rsp,rbp
                                # +0x0008: old rbp
                                # +0x0010: main return address
                                # +0x0018: argv**
                                # +0x0020: argc
                                ##
                                # Note: We should only use r12-r14 and ebx (callee saved regs)
                                # See https://www.uclibc.org/docs/psABI-x86_64.pdf Fig3.4
    mov     r12, [rbp+0x20]     # r12 = argc
    mov     r13, [rb


ON_GFX1, 0, &charlayout, 0, 2 },
	{ REGION_GFX2, 0, &charlayout, 0, 2 },
	{ -1 } /* end of array */
};

static struct MachineDriver machine_driver_safarir =
{
	/* basic machine hardware */
	{
		{
			CPU_8080,
			3072000,	/* 3 Mhz ? */								\
			readmem,writemem,0,0,
			ignore_interrupt,1
		}
	},
	60, DEFAULT_REAL_60HZ_VBLANK_DURATION,
	1,      /* single CPU, no need for interleaving */
	0,	/* init machine */

	/* video hardware */
	32*8, 32*8, { 0*8, 30*8-1, 0*8, 28*8-1 },
	gfxdecodeinfo,
	3,2*2,
	init_palette,

	VIDEO_TYPE_RASTER,
	0,
	0,
	0,
	safarir_vh_screenrefresh,

	/* sound hardware */
	0,0,0,0
};

/***************************************************************************

  Game driver(s)

***************************************************************************/

ROM_START( safarir )
	ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for main CPU */
	ROM_LOAD( "rl01",		0x0000, 0x0400, 0xcf7703c9 )
	ROM_LOAD( "rl02",		0x0400, 0x0400, 0x1013ecd3 )
	ROM_LOAD( "rl03",		0x0800, 0x0400, 0x84545894 )
	ROM_LOAD( "rl04",		0x0c00, 0x0400, 0x5dd12f96 )
	ROM_LOAD( "rl05",		0x1000, 0x0400, 0x935ed469 )
	ROM_LOAD( "rl06",		0x1400, 0x0400, 0x24c1cd42 )

	ROM_REGION( 0x0400, REGION_GFX1 | REGIONFLAG_DISPOSE )
	ROM_LOAD( "rl08",		0x0000, 0x0400, 0xd6a50aac )

	ROM_REGION( 0x0400, REGION_GFX2 | REGIONFLAG_DISPOSE )
	ROM_LOAD( "rl07",		0x0000, 0x0400, 0xba525203 )
ROM_END

GAMEX( ????, safarir, 0, safarir, safarir, 0, ROT90, "SNK", "Safari Rally", GAME_NO_SOUND | GAME_IMPERFECT_COLORS )


656d-4934-acd0-ca4690004ac0"}, {"type": "LinearAxis", "id": "233d961c-352c-4c5d-aea5-c2e0cd290bdc"}, {"type": "Grid", "id": "cc674508-dec8-4407-87e4-dfa361db85ad"}, {"type": "GlyphRenderer", "id": "7f434619-56a6-4e9e-b38c-1ba04694d27b"}], "extra_x_ranges": {}, "plot_height": 120, "tool_events": {"type": "ToolEvents", "id": "d02ac90d-b3ab-49c3-91e6-54095788a70b"}, "tools": [{"type": "PanTool", "id": "93bfc7ce-1e22-43dc-bd93-79c51f9ce8c0"}, {"type": "WheelZoomTool", "id": "e8610faa-bd02-4329-ac58-a68d5445fa7a"}, {"type": "BoxZoomTool", "id": "75d8d6be-5ffb-4310-96b9-b3b5ee34ebf1"}, {"type": "PreviewSaveTool", "id": "0e97b4d4-8148-4dcb-b873-3b4a9f60ebe7"}, {"type": "ResizeTool", "id": "6f9af3fc-0dd0-45b7-94f0-2d79cd70dccd"}, {"type": "ResetTool", "id": "c4552b59-39e1-4163-ac9e-903a1a050839"}, {"type": "HelpTool", "id": "fd9131d2-e6de-4511-ba1b-953537223f73"}], "doc": null, "id": "0df28562-0578-4350-b1eb-b7f061dbc4b4", "y_range": {"type": "Range1d", "id": "87b5252f-e599-45c9-8fe8-d776d990c459"}, "below": [{"type": "LinearAxis", "id": "50fe82a7-95c9-46c9-a871-6789262b10ee"}], "left": [{"type": "LinearAxis", "id": "233d961c-352c-4c5d-aea5-c2e0cd290bdc"}]}}, {"attributes": {"plot": {"subtype": "Figure", "type": "Plot", "id": "dfd75103-2c06-4b2f-880f-c01cd3516163"}, "tags": [], "doc": null, "id": "0d496d35-f239-4b6f-a032-73ad58e13179"}, "type": "ResizeTool", "id": "0d496d35-f239-4b6f-a032-73ad58e13179"}, {"attributes": {"plot": {"subtype": "Figure", "type": "Plot", "id": "3ae15f91-3ee6-449d-a492-2ab0768b1cc9"}, "dimensions": ["width", "height"], "tags": [], "doc": null, "id": "df7f638c-3934-4541-aedf-165734120d42"}, "type": "BoxZoomTool", "id": "df7f638c-3934-4541-aedf-165734120d42"}, {"attributes": {"plot": {"subtype": "Figure", "type": "Plot", "id": "9b5c9443-2d5f-4a78-9b2b-8195c498f6f7"}, "tags": [], "doc": null, "id": "ed244293-57a7-4c1e-8b8e-538d0a7079e4"}, "type": "HelpTool", "id": "ed244293-57a7-4c1e-8b8e-538d0a7079e4"}, {"attributes": {"tags": [], "doc": null, "mantissas": [2, 5, 10], "id": "e2d90c3a-32c9-4316-96b8-6f85a85b7


   Name of the field to set.
     * @param value
     *            Value to which to set the field.
     */
    public static void setFieldValue(Object object, String fieldName, Object value) {
        try {
            getDeclaredFieldInHierarchy(object.getClass(), fieldName).set(object, value);
        } catch (IllegalArgumentException e) {
            throw new RuntimeException(e);
        } catch (IllegalAccessException e) {
            throw new RuntimeException(e);
        }
    }

    /**
     * Returns the value of a field identified using a path from the parent.
     *
     *
     * @param object
     *            Parent object.
     * @param path
     *            Path to identify the field. May contain one or more dots, e.g.
     *            "address.city".
     * @param value
     *            Value to which to set the field.
     * @throws IllegalStateException
     *             if one of the intermediate objects on the path is null.
     */
    public static void setFieldValueWithPath(Object object, String path, Object value) throws IllegalStateException {

        int lastDot = path.lastIndexOf('.');

        if (lastDot > -1) {

            String parentPath = path.substring(0, lastDot);
            String field = path.substring(lastDot + 1);
            Object parentObject = getFieldValueWithPath(object, parentPath);

            if (parentObject == null) {
                throw new IllegalStateException(String.format("Null value for %s while accessing %s on object %s",
                        parentPath,
                        path,
                        object));
            }

            setFieldValue(parentObject, field, value);

        } else {
            setFieldValue(object, path, value);
        }

    }

}
/*
 *    Copyright 2016 Jakub Księżniak
 *
 *    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.
 */
package com.github.jksiezni.permissive.fragments;

import android.app.Activity;
import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v4.app.DialogFragment;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

import com.github.jksiezni.permissive.PermissiveMessenger;
import com.github.jksiezni.permissive.Rationale;

/**
 *
 */
public class RationaleDialogFragment extends DialogFragment implements Rationale {
  private static final boolean DEBUG = BuildConfig.DEBUG;

  private String[] allowablePermissions;
  private PermissiveMessenger permissiveMessenger;

  public String[] getPermissions() {
    return allowablePermissions;
  }

  public PermissiveMessenger getPermissiveMessenger() {
    return permissiveMessenger;
  }

  public boolean isAnyAllowablePermission() {
    return allowablePermissions.length > 0;
  }

  @Override
  public void onShowRationale(Activity activity, String[] allowablePermissions, PermissiveMessenger messenger) {
    this.allowablePermissions = allowablePermissions;
    this.permissiveMessenger = messenger;

    if (activity instanceof FragmentActivity) {
      FragmentActivity fa = (FragmentActivity) activity;
      show(fa.getSupportFragmentManager(), null);
    } else {
      throw new ClassCastException("This fragment (" + this +
          ") requires an instance of FragmentActivity to work, but was: " + activity);
    }
  }

  @Override
  public void onSaveInstanceState(Bundle outState) {
    if (DEBUG) {
      Log.d(


      "FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16".."1000330002",
        "FORMAT_G16_B16R16_2PLANE_444_UNORM".."1000330003",
        "FORMAT_A4R4G4B4_UNORM_PACK16".."1000340000",
        "FORMAT_A4B4G4R4_UNORM_PACK16".."1000340001"
    )

    EnumConstant(
        "ATTACHMENT_STORE_OP_NONE".."1000301000"
    )

    EnumConstant(
        "DYNAMIC_STATE_CULL_MODE".."1000267000",
        "DYNAMIC_STATE_FRONT_FACE".."1000267001",
        "DYNAMIC_STATE_PRIMITIVE_TOPOLOGY".."1000267002",
        "DYNAMIC_STATE_VIEWPORT_WITH_COUNT".."1000267003",
        "DYNAMIC_STATE_SCISSOR_WITH_COUNT".."1000267004",
        "DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE".."1000267005",
        "DYNAMIC_STATE_DEPTH_TEST_ENABLE".."1000267006",
        "DYNAMIC_STATE_DEPTH_WRITE_ENABLE".."1000267007",
        "DYNAMIC_STATE_DEPTH_COMPARE_OP".."1000267008",
        "DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE".."1000267009",
        "DYNAMIC_STATE_STENCIL_TEST_ENABLE".."1000267010",
        "DYNAMIC_STATE_STENCIL_OP".."1000267011",
        "DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE".."1000377001",
        "DYNAMIC_STATE_DEPTH_BIAS_ENABLE".."1000377002",
        "DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE".."1000377004"
    )

    EnumConstantLong(
        "FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT".enum(0x00000001L),
        "FORMAT_FEATURE_2_STORAGE_IMAGE_BIT".enum(0x00000002L),
        "FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT".enum(0x00000004L),
        "FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT".enum(0x00000008L),
        "FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT".enum(0x00000010L),
        "FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT".enum(0x00000020L),
        "FORMAT_FEATURE_2_VERTEX_BUFFER_BIT".enum(0x00000040L),
        "FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT".enum(0x00000080L),
        "FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT".enum(0x00000100L),
        "FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT".enum(0x00000200L),
        "FORMAT_FEATURE_2_BLIT_SRC_BIT".enum(0x00000400L),
        "FORMAT_FEATURE_2_BLIT_DST_BIT".enum(0x00000800L),
        "FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT".enum(0x00001000L),
        "FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT".enum(0x00002000L),
        "FORMAT_FEATURE_2_TRANSFER_SRC_BIT".enum(0x00004000L),
        "FORMAT_FEATURE_2_TRANSFER_DST_BIT".enum(0x00008000L),
        "FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT".enum(0x00010000L),
        "FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT".enum(0x00020000L),
        "FORMAT_FEATURE


 true if so, false otherwise.
//
static bool resolveImplementsStmt(FnSymbol* wrapFn, ImplementsStmt* istm,
                                  bool nested, //used only for debugging output
                                  Expr*   addlSite,
                                  bool    reportErrors,
                                  bool    generatedOnly) {
  if (istm->id == breakOnResolveID) debuggerBreakHere();

  IfcConstraint* icon = istm->iConstraint;
  InterfaceSymbol* isym = icon->ifcSymbol();

  INT_ASSERT(wrapFn->hasFlag(FLAG_IMPLEMENTS_WRAPPER));
  if (wrapFn->isResolved()) {
    // We can get here because we have already resolved 'istm'.
    // If so, no need to resolve it again.
    //
    // We can also get here while resolving 'istm' recursively,
    // because wrapFn gets marked resolved before checkAssocConstraints().
    // If so, we return successful implementation, i.e. we break recursion
    // by assuming success.

    warnForImproperAutomaticImplements(isym, istm, addlSite);

    IstmAndSuccess iss = implementsStmtForWrapperFn(wrapFn);
    // if isSuccess can legitimately be false, return it and remove the assert
    INT_ASSERT(iss.isSuccess);
    return true;
  }

  const char* indent = nested ? "  " : ""; //used only for debugging output
  if (nested) cgprint("    resolving it...\n");
  else cgprint("resolving implements statement%s for ifc %s  %s {\n",
               idstring("", istm), symstring(isym), debugLoc(istm));

  resolveInterfaceSymbol(isym);

  // This CallExpr will represent the checking of 'istm'.
  CallExpr* callsite = new CallExpr(wrapFn);
  wrapFn->defPoint->insertBefore(callsite);
  callStack.add(callsite);

  resolveIStmActuals(wrapFn, istm);  // marks wrapFn with FLAG_RESOLVED

  SET_LINENO(istm->implBody);
  BlockStmt* holder = createHolderBlock(wrapFn, istm);

  INT_ASSERT(istm->witnesses.symWits.n == 0);     // we have not filled it yet
  istm->witnesses.symWits.copy(isym->requiredFns);  // start with the defaults

  SymbolMap fml2act; // isym formal -> istm actual
  buildAndCheckFormals2Actuals(isym, icon, "implements statement",
                               holder, fml2act);

  bool success = true;
  Symbol* genSym = hasEntriesMappedToGenerics(fml2act);

  if (genSym == nullptr) {
    // istm is concrete
    // check each category of istm contents
    success =
     resolveAssociatedTypes(isym, istm, fml2act, holder, nested, indent,
                              reportErrors)
     && instantiateAggregateTypes(isym, istm,
                              fml2act)
     && checkAssocConstraints(isym, istm, fml2act, holder, callsite, addlSite,
                              reportErrors)
     && resolveRequiredFns(isym, istm, fml2act, holder, addlSite, indent,
                              reportErrors, generatedOnly);
  } else {
    // no early checking of generic implements statements
    cgprint("%s  not checking due to generic type %s\n",
            indent, symstring(genSym));

    // we expect generic implements statements to come about
    // only in the source code
    INT_ASSERT(reportErrors);
  }

  cgprint("}%s\n", nested ? "    ...done" : "");
  // CG TODO: holder->remove() ? see comment in createHolderBlock()
  INT_ASSERT(wrapFn->hasFlag(FLAG_RESOLVED));
  CallExpr* popped = callStack.pop();
  INT_ASSERT(popped == callsite);
  callsite->remove();

  if (!success) {
    if


o Outland AncOrcBuildings AncOrcHutBig.wmo",
  [2010062] = "World wmo Outland AncOrcBuildings AncOrcHutSmall.wmo",
  [2010063] = "World wmo Outland AncOrcBuildings AncOrcLumberMill.wmo",
  [2010064] = "World wmo Outland AncOrcBuildings AncOrcTownHall.wmo",
  [2010065] = "World wmo Outland ArokkoaBuildings Arakkoahouse.wmo",
  [2010066] = "World wmo Outland ArokkoaBuildings Arakkoahut.wmo",
  [2010067] = "World wmo Outland ArokkoaBuildings Arakkoahut_destroyed.wmo",
  [2010068] = "World wmo Outland ArokkoaBuildings Arakkoashack.wmo",
  [2010069] = "World wmo Outland ArokkoaBuildings Arakkoashack_destroyed.wmo",
  [2010070] = "World wmo Outland ArokkoaBuildings Arakkoatent.wmo",
  [2010071] = "World wmo Outland BrokenBuildings Broken_bdelftower.wmo",
  [2010072] = "World wmo Outland BrokenBuildings Brokenhut_01.wmo",
  [2010073] = "World wmo Outland BrokenBuildings Brokenhut_02.wmo",
  [2010074] = "World wmo Outland BrokenBuildings Brokenhut_03.wmo",
  [2010075] = "World wmo Outland BrokenBuildings Brokenpiece_01.wmo",
  [2010076] = "World wmo Outland BrokenBuildings Brokenpiece_02.wmo",
  [2010077] = "World wmo Outland BrokenBuildings Thebroken_house01.wmo",
  [2010078] = "World wmo Outland BrokenBuildings Thebroken_house03.wmo",
  [2010079] = "World wmo Outland BrokenBuildings Thebroken_house04.wmo",
  [2010080] = "World wmo Outland DarkPortal DarkPortal_Temple.wmo",
  [2010081] = "World wmo Outland DarkPortal war2darkportal.wmo",
  [2010082] = "World wmo Outland DraeniBuildings AncDraeFlyM.wmo",
  [2010083] = "World wmo Outland DraeniBuildings AncDraeHutA.wmo",
  [2010084] = "World wmo Outland DraeniBuildings AncDraeHutB.wmo",
  [2010085] = "World wmo Outland DraeniBuildings AncDraeHutC.wmo",
  [2010086] = "World wmo Outland DraeniBuildings AncDraePost.wmo",
  [2010087] = "World wmo Outland DraeniBuildings AncDraeSmith.wmo",
  [2010088] = "World wmo Outland DraeniBuildings AncDraeTemple.wmo",
  [2010089] = "World wmo Outland DraeniBuildings AncDrae_terrace.wmo",
  [2010090] = "World wmo Outland DraeniBuildings DR_Stairs.wmo",
  [2010091] = "World wmo Outland DraeniBuildings Draenei_bridge02.wmo",
  [2010092] = "World wmo Outland DraeniBuildings Draenei_bridge03.wmo",
  [2010093] = "World wmo Outland DraeniBuildings HF_draenei_outposthut.wmo",
  [2010094] = "World wmo Outland DraeniBuildings HF_draenei_outpostpilllar.wmo",
  [2010095] = "World wmo Outland DraeniBuildings HF_draenei


0):i.length===0||i.length===1&&!i[0]?i=void 0:i.length<=2&&(Array.isArray(i[0])||!i[0])?(e=i[1],i=i[0]):typeof i[i.length-1]=="object"&&(e=i.pop()),e||(e={}),e.browser)throw new Error("Change `browser` option to `overrideBrowserslist` in Autoprefixer");if(e.browserslist)throw new Error("Change `browserslist` option to `overrideBrowserslist` in Autoprefixer");e.overrideBrowserslist?i=e.overrideBrowserslist:e.browsers&&(typeof console!="undefined"&&console.warn&&(ru.red?console.warn(ru.red(ab.replace(/`[^`]+`/g,n=>ru.yellow(n.slice(1,-1))))):console.warn(ab)),i=e.browsers);let t={ignoreUnknownVersions:e.ignoreUnknownVersions,stats:e.stats,env:e.env};function r(n){let a=sb,s=new P5(a.browsers,i,n,t),o=s.selected.join(", ")+JSON.stringify(e);return iu.has(o)||iu.set(o,new D5(a.prefixes,s,e)),iu.get(o)}return{postcssPlugin:"autoprefixer",prepare(n){let a=r({from:n.opts.from,env:e.env});return{OnceExit(s){M5(n,a),e.remove!==!1&&a.processor.remove(s,n),e.add!==!1&&a.processor.add(s,n)}}},info(n){return n=n||{},n.from=n.from||m.cwd(),q5(r(n))},options:e,browsers:i}}ir.postcss=!0;ir.data=sb;ir.defaults=O5.defaults;ir.info=()=>ir().info()});var ub={};Ae(ub,{default:()=>B5});var B5,fb=C(()=>{l();B5=[]});var pb={};Ae(pb,{default:()=>F5});var cb,F5,db=C(()=>{l();hi();cb=K(bi()),F5=Ze(cb.default.theme)});var mb={};Ae(mb,{default:()=>N5});var hb,N5,gb=C(()=>{l();hi();hb=K(bi()),N5=Ze(hb.default)});l();"use strict";var L5=Je(ym()),$5=Je(me()),j5=Je(lb()),z5=Je((fb(),ub)),V5=Je((db(),pb)),U5=Je((gb(),mb)),W5=Je((ts(),ku)),G5=Je((bo(),wo)),H5=Je((gs(),rf));function Je(i){return i&&i.__esModule?i:{default:i}}console.warn("cdn.tailwindcss.com should not be used in production. To use Tailwind CSS in production, install it as a PostCSS plugin or use the Tailwind CLI: https://tailwindcss.com/docs/installation");var Qn="tailwind",nu="text/tailwindcss",yb="/template.html",vt,wb=!0,bb=0,su=new Set,au,vb="",xb=(i=!1)=>({get(e,t){return(!i||t==="config")&&typeof e[t]=="object"&&e[t]!==null?new Proxy(e[t],xb()):e[t]},set(e,t,r){return e[t]=r,(!i||t==="config")&&ou(!0),!0}});window[Qn]=new Proxy({config:{},defaultTheme:V5.default,defaultConfig:U5.default,colors:W5.default,plugin:G5.default,resolveConfig:H5.default},xb(!0));function kb(i){au.observe(i,{attributes:!0,attributeFilter:["type"],chara


s";

export type ATOM_CALLBACK<T> = (newValue: T) => void;

export type ATOM_EFFECT_FN = (
	get: <T>(atomValue: ATOM<T>, subscribed?: boolean) => T,
	set: <T>(atomValue: ATOM<T>, newValue: T) => T
) => void;

export type ATOM<T> = {
	proxy: { value: T };
	setCallback: (callbackFN: (newValue: T) => void) => () => void;
	readOnly: boolean;
};

export type ATOM_EFFECT_SNAPSHOT_FN<K extends unknown[]> = (
	get: <T>(atomValue: ATOM<T>) => T,
	set: <T>(atomValue: ATOM<T>, newValue: T) => T,
	...args: K
) => void;

export type ATOM_MOLECULE_FAMILY_FN<T, K extends unknown[]> = (
	get: <J>(atomValue: ATOM<J>) => J,
	...args: [string, ...K]
) => T extends Promise<unknown> ? never : T;

export type ASYNC_ATOM_MOLECULE_FAMILY_FN<T, K extends unknown[]> = (
	get: <J>(atomValue: ATOM<J>) => J,
	...args: [string, ...K]
) => Promise<T>;

export type ATOM_MOLECULE_FAMILY_INITIAL_VALUE_FN<T, K extends unknown[]> = (
	get: <J>(atomValue: ATOM<J>) => J,
	...args: [string, ...K]
) => T;
/**
 * @license
 * Copyright 2021 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
 *
 * https://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.
 * =============================================================================
 */

import {Pose} from '../types';

import {Track} from './interfaces/common_interfaces';
import {TrackerConfig} from './interfaces/config_interfaces';
import {validateTrackerConfig} from './tracker_utils';

/**
 * A stateful tracker for associating detections between frames. This is an
 * abstract base class that performs generic mechanics. Implementations must
 * inherit from this class.
 */
export abstract class Tracker {
  protected tracks: Track[];
  private readonly maxTracks: number;
  private readonly maxAge: number;
  private readonly minSimilarity: number;
  private nextID: number;

  constructor(config: TrackerConfig) {
    validateTrackerConfig(config);
    this.tracks = [];
    this.maxTracks = config.maxTracks;
    this.maxAge = config.maxAge * 1000;  // Convert msec to usec.
    this.minSimilarity = config.minSimilarity;
    this.nextID = 1;
  }

  /**
   * Tracks person instances across frames based on detections.
   * @param poses An array of detected `Pose`s.
   * @param timestamp The timestamp associated with the incoming poses, in
   * microseconds.
   * @returns An updated array of `Pose`s with tracking id properties.
   */
  apply(poses: Pose[], timestamp: number): Pose[] {
    this.filterOldTracks(timestamp);
    const simMatrix = this.computeSimilarity(poses);
    this.assignTracks(poses, simMatrix, timestamp);
    this.updateTracks(timestamp);
    return poses;
  }

  /**
   * Computes pairwise similarity scores between detections and tracks, based
   * on detected features.
   * @param poses An array of detected `Pose`s.
   * @returns A 2D array of shape


containsKey(usage.fieldName)) {
								ArrayList<Series> origSeries = Utils.getSeriesFromBundle(origData);
								if (origSeries != null && origSeries.size() > 0)
									newData.remove(usage.fieldName);
							}
						} else {
							// If the original was non-blank, erase from list
							if (origData.containsKey(usage.fieldName) && origData.getString(usage.fieldName) != null && origData.getString(usage.fieldName).length() > 0 )
								newData.remove(usage.fieldName);
						}
						break;
					case ADD_EXTRA:
						// Handle arrays
						if (usage.fieldName.equals(CatalogueDBAdapter.KEY_AUTHOR_ARRAY)) {
							UpdateThumbnailsThread.<Author>combineArrays(usage.fieldName, origData, newData);
						} else if (usage.fieldName.equals(CatalogueDBAdapter.KEY_SERIES_ARRAY)) {
							UpdateThumbnailsThread.<Series>combineArrays(usage.fieldName, origData, newData);
						} else {
							// No idea how to handle this for non-arrays
							throw new RuntimeException("Illegal usage '" + usage.usage + "' specified for field '" + usage.fieldName + "'");
						}
						break;
					}

				}
			}
		}

		// Update
		if (newData.size() > 0) {
			mDbHelper.updateBook(bookId, new BookData(newData), 0);
		}

	}

	private static<T extends Serializable> void combineArrays(String key, Bundle origData, Bundle newData) {
		// Each of the lists to combine
		ArrayList<T> origList = null;
		ArrayList<T> newList = null;
		// Get the list from the original, if present.
		if (origData.containsKey(key)) {
			origList = Utils.getListFromBundle(origData, key);
		}
		// Otherwise an empty list
		if (origList == null)
			origList = new ArrayList<T>();

		// Get from the new data
		if (newData.containsKey(key)) {
			newList = Utils.getListFromBundle(newData, key);
		}
		if (newList == null)
			newList = new ArrayList<T>();
		origList.addAll(newList);
		// Save combined version to the new data
		newData.putSerializable(key, origList);
	}

	/**
	 * Called to signal that the search is complete AND the class-level data has
	 * been cached by the processing thread, so that a new search can begin.
	 */
	private void doSearchDone() {
		// Let another search begin
		mSearchLock.lock();
		try {
			mSearchDone.signal();
		} finally {
			mSearchLock.unlock();
		}
	}

	/**
	 * Cleanup any DB connection etc after main task has run.
	 */
	private void cleanup() {
		if (mDbHelper != null) {
			mDbHelper.close();
			mDbHelper = null;
		}
	}

	@Override
	protected void finalize() throws Throwable {
		cleanup();
		super.finalize();
	}

}
/*
 * @copyright 2011 Philip Warner
 * @license GNU General Public License
 *
 * This file is part of Book Catalogue.
 *
 * Book Catalogue 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.
 *
 * Book Catalogue 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 Book Catalogue.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.eleybour


)
            pdf.ln(5)
            for _, row in df_hist.iterrows():
                pdf.cell(0, 8, f"{row['Horodatage']} | {row['Prediction']} | Dangerosité: {row['Dangerosité']}%", ln=True)
            pdf.output("historique.pdf")
            with open("historique.pdf", "rb") as f:
                st.download_button("📥 Télécharger en PDF", f.read(), "historique_predictions.pdf")

    if st.button("🗑 Vider l'historique"):
        st.session_state["historique"] = pd.DataFrame(columns=["Prediction", "Dangerosité", "Horodatage"])
        st.success("✅ Historique vidé.")


      Non-NULL pointer to the hardware counter accumulator.
 * @ts_start_ns: Non-NULL pointer where the start timestamp of the dump will
 *               be written out to on success.
 * @ts_end_ns:   Non-NULL pointer where the end timestamp of the dump will
 *               be written out to on success.
 * @dump_buf:    Pointer to the buffer where the dump will be written out to on
 *               success. If non-NULL, must have the same metadata as the
 *               accumulator. If NULL, the dump will be discarded.
 *
 * If this function fails for some unexpected reason (i.e. anything other than
 * invalid args), then the accumulator will be put into the error state until
 * the parent context is next disabled.
 *
 * Return: 0 on success or error code.
 */
int kbase_hwcnt_accumulator_dump(
	struct kbase_hwcnt_accumulator *accum,
	u64 *ts_start_ns,
	u64 *ts_end_ns,
	struct kbase_hwcnt_dump_buffer *dump_buf);

#endif /* _KBASE_HWCNT_ACCUMULATOR_H_ */


he banner image for the quest. May be empty if no banner image is
        /// specified in the play console (this is allowed prior to quest publication).
        /// </summary>
        string BannerUrl
        {
            get;
        }

        /// <summary>
        /// The URL containing the icon image for the quest. May be empty if no banner image is
        /// specified in the play console (this is allowed prior to quest publication).
        /// </summary>
        string IconUrl
        {
            get;
        }

        /// <summary>
        /// Gets the start time of the quest, i.e. the time after which the quest may be accepted
        /// by the player.
        /// </summary>
        DateTime StartTime
        {
            get;
        }

        /// <summary>
        /// The time after which quest is no longer eligible for acceptance.
        /// </summary>
        DateTime ExpirationTime
        {
            get;
        }

        /// <summary>
        /// The time at which the user accepted the quest. Absent if the quest has not been accepted.
        /// </summary>
        /// <value>The accepted time.</value>
        DateTime? AcceptedTime
        {
            get;
        }

        /// <summary>
        /// The current milestone for the quest. This represents the next goal that players should hit
        /// on their way to completing the quest.
        /// </summary>
        [Obsolete("Quests are being removed in 2018.")]
        IQuestMilestone Milestone
        {
            get;
        }

        /// <summary>
        /// The current state of the quest.
        /// </summary>
        QuestState State
        {
            get;
        }
    }
}


s(this: &Map) -> Iterator;

    /// The `values()` method returns a new Iterator object that contains the
    /// values for each element in the Map object in insertion order.
    ///
    /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map/values)
    #[wasm_bindgen(method)]
    pub fn values(this: &Map) -> Iterator;
}

// Iterator
#[wasm_bindgen]
extern "C" {
    /// Any object that conforms to the JS iterator protocol. For example,
    /// something returned by `myArray[Symbol.iterator]()`.
    ///
    /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols)
    #[derive(Clone, Debug)]
    #[wasm_bindgen(is_type_of = Iterator::looks_like_iterator, typescript_type = "Iterator<any>")]
    pub type Iterator;

    /// The `next()` method always has to return an object with appropriate
    /// properties including done and value. If a non-object value gets returned
    /// (such as false or undefined), a TypeError ("iterator.next() returned a
    /// non-object value") will be thrown.
    #[wasm_bindgen(catch, method, structural)]
    pub fn next(this: &Iterator) -> Result<IteratorNext, JsValue>;
}

impl Iterator {
    fn looks_like_iterator(it: &JsValue) -> bool {
        #[wasm_bindgen]
        extern "C" {
            type MaybeIterator;

            #[wasm_bindgen(method, getter)]
            fn next(this: &MaybeIterator) -> JsValue;
        }

        if !it.is_object() {
            return false;
        }

        let it = it.unchecked_ref::<MaybeIterator>();

        it.next().is_function()
    }
}

// Async Iterator
#[wasm_bindgen]
extern "C" {
    /// Any object that conforms to the JS async iterator protocol. For example,
    /// something returned by `myObject[Symbol.asyncIterator]()`.
    ///
    /// [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of)
    #[derive(Clone, Debug)]
    #[wasm_bindgen(is_type_of = Iterator::looks_like_iterator, typescript_type = "Iterator<Promise<any>>")]
    pub type AsyncIterator;

    /// The `next()` method always has to return a Promise which resolves to an object
    /// with appropriate properties including done and value. If a non-object value
    /// gets returned (such as false or undefined), a TypeError ("iterator.next()
    /// returned a non-object value") will be thrown.
    #[wasm_bindgen(catch, method, structural)]
    pub fn next(this: &AsyncIterator) -> Result<Promise, JsValue>;
}

/// An iterator over the JS `Symbol.iterator` iteration protocol.
///
/// Use the `IntoIterator for &js_sys::Iterator` implementation to create this.
pub struct Iter<'a> {
    js: &'a Iterator,
    state: IterState,
}

/// An iterator over the JS `Symbol.iterator` iteration protocol.
///
/// Use the `IntoIterator for js_sys::Iterator` implementation to create this.
pub struct IntoIter {
    js: Iterator,
    state: IterState,
}

struct IterState {
    done: bool,
}

impl<'a> IntoIterator for &'a Iterator {
    type Item = Result<JsValue, JsValue>;
    type IntoIter = Iter<'a>;

    fn into_iter(self) -> Iter<'a> {
        Iter {
            js: self,
            state: IterState::new(),
        }
    }
}

impl<'a> std::iter::Iterator for Iter<'a> {
    type Item = Result<


   ユーザーからの入力の受付
    *   Tauriコマンドの呼び出し

### 5.3 なぜそのアーキテクチャパターンを採用したのか

*   **関心の分離:** フロントエンドとバックエンドの役割を明確に分離することで、コードの保守性と可読性を向上させます。
*   **テスト容易性:** 各コンポーネントが独立しているため、単体テストが容易になります。

## 11. ライセンス

[LICENSE](https://github.com/howlrs/gen-readme/blob/master/LICENSE)

## 12. 連絡先

[@xhowlrs](https://x.com/xhowlrs)
# Slide with voice(vox)

## 1. プロジェクト概要

### 1.1 プロジェクトの目的

Slide with voice(vox) は、テキストファイルから動画を生成するツールです。特にプレゼンテーションやサービス紹介など、プログラマブルなテンプレートライクな動画を素早く生成することに特化しています。

### 1.2 特徴

*   **テキストから動画生成:** テキストファイルとスライド画像から、ナレーション付きの動画を自動生成します。
*   **プログラマブルなテンプレート:** スライドとテキストを組み合わせて、一定のフォーマットで動画を生成できます。
*   **Voicevox連携:** 音声合成にVoicevoxを使用し、多様なキャラクターによるナレーションを作成できます。
*   **AivisSpeech連携** 音声合成にAivisSpeechを使用いただけます。

### 1.3 デモ

[紹介動画](https://youtu.be/MiVK6Sxf-vQ)

[![Slide with voice(vox)](https://github.com/howlrs/slide_with_voice/blob/release/images/icon.png?raw=true)](https://www.youtube.com/watch?v=MiVK6Sxf-vQ)

## 2. 使い方

### 2.1 依存関係

*   **Voicevox:** 起動している必要があります。
*   **ffmpeg:** システムにインストールされている必要があります。

### 2.2 準備

1.  スライドに使用する画像および動画ファイル群を作業ディレクトリに用意します。
2.  テキストファイル（`resource.txt`）を編集し、スライドに対応するテキスト、タイトルなどを記述します。

### 2.3 記述ルール

*   ファイル名に対して、単一タイトル・複数テキストが紐づきます。
*   ファイル名・テキスト郡は必須です。
*   タイトルは任意です。
*   行単位でのボイス出力に対応しています。

`resource.txt`の例:

```txt
[C:\path\to\slide1.png]
# スライド1のタイトル
@2 これはスライド1の説明です。
@3 これはスライド1の別の説明です。
[C:\path\to\slide2.png]
# スライド2のタイトル
@2 これはスライド2の説明です。