MODE, route.getMode(), "transitMode should be mapped");
    assertEquals(
      SubMode.UNKNOWN,
      route.getNetexSubmode(),
      "submode should be unknown, when ro replacing route is found"
    );
    assertNotEquals(REPLACED_ROUTE, route, "Should not re-use replaced route");
  }

  @Test
  void testAddedTripFailOnMissingServiceId() {
    var addedTrip = new AddedTripBuilder(
      transitService,
      ENTITY_RESOLVER,
      AbstractTransitEntity::getId,
      TRIP_ID,
      OPERATOR,
      LINE_REF,
      REPLACED_ROUTE,
      null,
      TRANSIT_MODE,
      SUB_MODE,
      getCalls(0),
      false,
      null,
      false,
      SHORT_NAME,
      HEADSIGN,
      List.of(),
      "DATASOURCE"
    ).build();

    assertTrue(addedTrip.isFailure(), "Trip creation should fail");
    assertEquals(
      UpdateError.UpdateErrorType.NO_START_DATE,
      addedTrip.failureValue().errorType(),
      "Trip creation should fail without start date"
    );
  }

  @Test
  void testAddedTripFailOnNonIncreasingDwellTime() {
    List<CallWrapper> calls = List.of(
      TestCall.of()
        .withStopPointRef(STOP_A.getId().getId())
        .withAimedDepartureTime(zonedDateTime(10, 20))
        .withExpectedDepartureTime(zonedDateTime(10, 20))
        .build(),
      TestCall.of()
        .withStopPointRef(STOP_B.getId().getId())
        .withAimedArrivalTime(zonedDateTime(10, 30))
        .withExpectedArrivalTime(zonedDateTime(10, 31))
        .withAimedDepartureTime(zonedDateTime(10, 30))
        .withExpectedDepartureTime(zonedDateTime(10, 29))
        .build(),
      // Expected to arrive one minute prior to irrelevant aimed departure time
      TestCall.of()
        .withStopPointRef(STOP_C.getId().getId())
        .withAimedArrivalTime(zonedDateTime(10, 40))
        .withExpectedArrivalTime(zonedDateTime(10, 40))
        .build()
    );

    var addedTrip = new AddedTripBuilder(
      transitService,
      ENTITY_RESOLVER,
      AbstractTransitEntity::getId,
      TRIP_ID,
      OPERATOR,
      LINE_REF,
      REPLACED_ROUTE,
      SERVICE_DATE,
      TRANSIT_MODE,
      SUB_MODE,
      calls,
      false,
      null,
      false,
      SHORT_NAME,
      HEADSIGN,
      List.of(),
      "DATASOURCE"
    ).build();

    assertTrue(addedTrip.isFailure(), "Trip creation should fail");
    assertEquals(
      UpdateError.UpdateErrorType.NEGATIVE_DWELL_TIME,
      addedTrip.failureValue().errorType(),
      "Trip creation should fail with invalid dwell time"
    );
  }

  @Test
  void testAddedTripFailOnTooFewCalls() {
    List<CallWrapper> calls = List.of(
      TestCall.of()
        .withStopPointRef(STOP_A.getId().getId())
        .withAimedDepartureTime(zonedDateTime(10, 20))
        .withExpectedDepartureTime(zonedDateTime(10, 20))
        .build()
    );
    var addedTrip = new AddedTripBuilder(
      transitService,
      ENTITY_RESOLVER,
      AbstractTransitEntity::getId,
      TRIP_ID,
      OPERATOR,
      LINE_REF,
      REPLACED_ROUTE,
      SERVICE_DATE,
      TRANSIT_MODE,
      SUB_MODE,
      calls,
      false,
      null,
      false,


li2=[12,3434.34,-599,329090,214.2,1442.42,421,42,859,980,-2909]
print(all(li2))


rise
  stx frame_time+0
  sty frame_time+1
  ; frame_time is

  ; Measure period of 192 scanlines in 12 cycle units
  ; (or scanline period in 1/16 cycle units)
  jsr sov_to_s0
  stx time_192_lines+0
  sty time_192_lines+1

  jsr now_to_nmi
  stx time_s0_nmi+0
  sty time_s0_nmi+1

  ; If frame_time > time_192_lines + time_192_lines / 2
  ; then there are more than 288 lines, that is, PAL
  rts
.endproc


223d89c
.arm
Function_223d8a0: @ 223d8a0 :arm
	stmfd   sp!, {r4,lr}
	ldr     r1, [pc, #0x2c] @ [0x223d8d8] (=0x225337c)
	mov     r4, r0
	ldr     r0, [r1]
	mvn     r1, #0x0
	ldrh    r3, [r0, #0x12]
	ldrh    r2, [r0, #0x10]
	ldr     r0, [r0]
	add     r3, r4, r3
	bl      Function_2243cf4
	ldr     r0, [pc, #0x8] @ [0x223d8d8] (=0x225337c)
	ldr     r0, [r0]
	strb    r4, [r0, #0x1a]
	ldmfd   sp!, {r4,pc}
@ 0x223d8d8

.word 0x225337c @ 0x223d8d8
.arm
Function_223d8dc: @ 223d8dc :arm
	stmfd   sp!, {r3,lr}
	ldr     r0, [pc, #0x20] @ [0x223d908] (=0x2253380)
	ldr     r0, [r0]
	cmp     r0, #0x0
	ldmnefd sp!, {r3,pc}
	ldr     r0, [pc, #0x14] @ [0x223d90c] (=0x1e60)
	mov     r1, #0x20
	bl      Function_2245068
	ldr     r1, [pc, #0x4] @ [0x223d908] (=0x2253380)
	str     r0, [r1]
	ldmfd   sp!, {r3,pc}
@ 0x223d908

.word 0x2253380 @ 0x223d908
.word 0x1e60 @ 0x223d90c
.arm
Function_223d910: @ 223d910 :arm
	stmfd   sp!, {r3,lr}
	ldr     r0, [pc, #0x20] @ [0x223d93c] (=0x2253380)
	ldr     r0, [r0]
	cmp     r0, #0x0
	ldmeqfd sp!, {r3,pc}
.arm
branch_223d924: @ 223d924 :arm
	bl      WM_GetAllowedChannel
	cmp     r0, #2, 18 @ #0x8000
	bne     branch_223d924
	ldr     r0, [pc, #0x8] @ [0x223d940] (=0x2253380)
	bl      Function_224508c
	ldmfd   sp!, {r3,pc}
@ 0x223d93c

.word 0x2253380 @ 0x223d93c
.word 0x2253380 @ 0x223d940
.arm
Function_223d944: @ 223d944 :arm
	stmfd   sp!, {r3-r5,lr}
	ldr     r1, [pc, #0xb4] @ [0x223da04] (=0x2253380)
	mov     r0, #0x0
	ldr     r1, [r1]
	mov     r2, #210, 30 @ #0x348
	add     r1, r1, #19, 24 @ #0x1300
	bl      MIi_CpuClear16
	ldr     r0, [pc, #0x9c] @ [0x223da04] (=0x2253380)
	ldr     r1, [pc, #0x9c] @ [0x223da08] (=0x223db3c)
	ldr     r0, [r0]
	mov     r2, #0x3
	bl      Function_20cecc8
	cmp


-- cabinet.lua
-- cabinet.dll

local ffi = require("ffi");

local WTypes = require("WTypes");
local basetsd = require("basetsd")

DECLARE_HANDLE("COMPRESSOR_HANDLE");

ffi.cdef[[
typedef COMPRESSOR_HANDLE *PCOMPRESSOR_HANDLE;

typedef COMPRESSOR_HANDLE DECOMPRESSOR_HANDLE;
typedef COMPRESSOR_HANDLE *PDECOMPRESSOR_HANDLE;

static const int COMPRESS_ALGORITHM_INVALID     = 0;
static const int COMPRESS_ALGORITHM_NULL        = 1;
static const int COMPRESS_ALGORITHM_MSZIP       = 2;
static const int COMPRESS_ALGORITHM_XPRESS      = 3;
static const int COMPRESS_ALGORITHM_XPRESS_HUFF = 4;
static const int COMPRESS_ALGORITHM_LZMS        = 5;
static const int COMPRESS_ALGORITHM_MAX         = 6;

static const int COMPRESS_RAW            = (1 << 29);

typedef PVOID (*PFN_COMPRESS_ALLOCATE) (
    PVOID UserContext,
    SIZE_T Size
    );

typedef VOID (*PFN_COMPRESS_FREE) (
    PVOID UserContext,
    PVOID Memory
    );

typedef struct _COMPRESS_ALLOCATION_ROUTINES {
    PFN_COMPRESS_ALLOCATE Allocate;
    PFN_COMPRESS_FREE Free;
    PVOID UserContext;
} COMPRESS_ALLOCATION_ROUTINES, *PCOMPRESS_ALLOCATION_ROUTINES;

typedef enum {
    COMPRESS_INFORMATION_CLASS_INVALID = 0,
    COMPRESS_INFORMATION_CLASS_BLOCK_SIZE,
    COMPRESS_INFORMATION_CLASS_LEVEL
} COMPRESS_INFORMATION_CLASS;
]]

ffi.cdef[[
BOOL
CloseCompressor (
    COMPRESSOR_HANDLE CompressorHandle
    );

BOOL
CloseDecompressor (
    DECOMPRESSOR_HANDLE DecompressorHandle
    );

BOOL
Compress (
    COMPRESSOR_HANDLE CompressorHandle,
    PVOID UncompressedData,
    SIZE_T UncompressedDataSize,
    PVOID CompressedBuffer,
    SIZE_T CompressedBufferSize,
    PSIZE_T CompressedDataSize
    );

BOOL
CreateCompressor (
    DWORD Algorithm,
    PCOMPRESS_ALLOCATION_ROUTINES AllocationRoutines,
    PCOMPRESSOR_HANDLE CompressorHandle
    );

BOOL
CreateDecompressor (
    DWORD Algorithm,
    PCOMPRESS_ALLOCATION_ROUTINES AllocationRoutines,
    PDECOMPRESSOR_HANDLE DecompressorHandle
    );

BOOL
Decompress (
    DECOMPRESSOR_HANDLE DecompressorHandle,
    PVOID CompressedData,
    SIZE_T CompressedDataSize,
    PVOID UncompressedBuffer,
    SIZE_T UncompressedBufferSize,
    PSIZE_T UncompressedDataSize
    );
]]

ffi.cdef[[
BOOL
QueryCompressorInformation (
    COMPRESSOR_HANDLE CompressorHandle,
    COMPRESS_INFORMATION_CLASS CompressInformationClass,
    PVOID CompressInformation,
    SIZE_T CompressInformationSize
    );

BOOL
QueryDecompressorInformation (
    DECOMPRESSOR_HANDLE DecompressorHandle,
    COMPRESS_INFORMATION_CLASS CompressInformationClass,
    PVOID CompressInformation,
    SIZE_T CompressInformationSize
    );

BOOL
ResetCompressor (
    COMPRESSOR_HANDLE CompressorHandle
    );

BOOL
ResetDecompressor (
    DECOMPRESSOR_HANDLE DecompressorHandle
    );

BOOL
SetCompressorInformation (
    COMPRESSOR_HANDLE CompressorHandle,
    COMPRESS_INFORMATION_CLASS CompressInformationClass,
    PVOID CompressInformation,
    SIZE_T CompressInformationSize
    );

BOOL
SetDecompressorInformation (
    DECOMPRESSOR_HANDLE DecompressorHandle,
    COMPRESS_INFORMATION_CLASS CompressInf


cko + WebKit = font-weight: bolder.
 */

#drupal-off-canvas b,
#drupal-off-canvas strong {
  font-weight: bold;
}

#drupal-off-canvas em,
#drupal-off-canvas i {
  font-style: italic;
}

#drupal-off-canvas img {
  vertical-align: middle;
  color: transparent;
  font-size: 0;
}

#drupal-off-canvas ul,
#drupal-off-canvas ol {
  list-style: none;
}

/* reset table styling. */

#drupal-off-canvas table {
  border-spacing: 0;
  border-collapse: collapse;
}

#drupal-off-canvas table thead,
#drupal-off-canvas table tbody,
#drupal-off-canvas table tbody tr:nth-child(even),
#drupal-off-canvas table tbody tr:nth-child(odd),
#drupal-off-canvas table tfoot {
  border: 0;
  background: transparent none;
}

#drupal-off-canvas th,
#drupal-off-canvas td,
#drupal-off-canvas caption {
  font-weight: normal;
}

#drupal-off-canvas q {
  quotes: none;
}

#drupal-off-canvas q:before,
#drupal-off-canvas q:after {
  content: none;
}

#drupal-off-canvas sub,
#drupal-off-canvas sup,
#drupal-off-canvas small {
  font-size: 75%;
}

#drupal-off-canvas sub,
#drupal-off-canvas sup {
  position: relative;
  vertical-align: baseline;
  line-height: 0;
}

#drupal-off-canvas sub {
  bottom: -0.25em;
}

#drupal-off-canvas sup {
  top: -0.5em;
}

/*
 * For IE9. Without, occasionally draws shapes
 * outside the boundaries of <svg> rectangle.
 */

#drupal-off-canvas svg {
  overflow: hidden;
}

/* Specific resets for inputs. */

#drupal-off-canvas input[type="search"]::-webkit-search-decoration {
  display: none;
}

#drupal-off-canvas input {
  margin: 0;
  padding: 0;
}

#drupal-off-canvas input[type="checkbox"],
#drupal-off-canvas input[type="radio"] {
  position: static;
  margin: 0;
}

#drupal-off-canvas input:invalid,
#drupal-off-canvas button:invalid,
#drupal-off-canvas select:invalid,
#drupal-off-canvas textarea:invalid,
#drupal-off-canvas input:focus,
#drupal-off-canvas button:focus,
#drupal-off-canvas select:focus,
#drupal-off-canvas textarea:focus,
#drupal-off-canvas input[type="file"]:focus,
#drupal-off-canvas input[type="file"]:active,
#drupal-off-canvas input[type="radio"]:focus,
#drupal-off-canvas input[type="radio"]:active,
#drupal-off-canvas input[type="checkbox"]:focus,
#drupal-off-canvas input[type="checkbox"]:active {
  z-index: 1;
  box-shadow: none;
}

#drupal-off-canvas input[role="button"] {
  cursor: pointer;
}

#drupal-off-canvas button,
#drupal-off-canvas input[type="reset"],
#drupal-off-canvas input[type="submit"],
#drupal-off-canvas input[type="button"] {
  display: inline-block;
  overflow: visible;
  cursor: pointer;
  vertical-align: middle;
  text-decoration: none;
  border: 0;
  outline: 0;
  background-image: none;
  text-shadow: none;
  -webkit-appearance: none;
  -moz-app


color: #ccc;
}
figure {
  display: table;
  margin: 1rem auto;
}
figure figcaption {
  color: #999;
  display: block;
  margin-top: 0.25rem;
  text-align: center;
}
hr {
  border-color: #ccc;
  border-style: solid;
  border-width: 1px 0 0 0;
}
code {
  background-color: #e8e8e8;
  border-radius: 3px;
  padding: 0.1rem 0.2rem;
}
.mce-content-body:not([dir=rtl]) blockquote {
  border-left: 2px solid #ccc;
  margin-left: 1.5rem;
  padding-left: 1rem;
}
.mce-content-body[dir=rtl] blockquote {
  border-right: 2px solid #ccc;
  margin-right: 1.5rem;
  padding-right: 1rem;
}
(()=>{var wb=Object.create;var li=Object.defineProperty;var bb=Object.getOwnPropertyDescriptor;var vb=Object.getOwnPropertyNames;var xb=Object.getPrototypeOf,kb=Object.prototype.hasOwnProperty;var au=i=>li(i,"__esModule",{value:!0});var ou=i=>{if(typeof require!="undefined")return require(i);throw new Error('Dynamic require of "'+i+'" is not supported')};var C=(i,e)=>()=>(i&&(e=i(i=0)),e);var v=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),Ae=(i,e)=>{au(i);for(var t in e)li(i,t,{get:e[t],enumerable:!0})},Sb=(i,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of vb(e))!kb.call(i,r)&&r!=="default"&&li(i,r,{get:()=>e[r],enumerable:!(t=bb(e,r))||t.enumerable});return i},X=i=>Sb(au(li(i!=null?wb(xb(i)):{},"default",i&&i.__esModule&&"default"in i?{get:()=>i.default,enumerable:!0}:{value:i,enumerable:!0})),i);var h,l=C(()=>{h={platform:"",env:{},versions:{node:"14.17.6"}}});var Cb,te,je=C(()=>{l();Cb=0,te={readFileSync:i=>self[i]||"",statSync:()=>({mtimeMs:Cb++}),promises:{readFile:i=>Promise.resolve(self[i]||"")}}});var Qn=v((PO,uu)=>{l();"use strict";var lu=class{constructor(e={}){if(!(e.maxSize&&e.maxSize>0))throw new TypeError("`maxSize` must be a number greater than 0");if(typeof e.maxAge=="number"&&e.maxAge===0)throw new TypeError("`maxAge` must be a number greater than 0");this.maxSize=e.maxSize,this.maxAge=e.maxAge||1/0,this.onEviction=e.onEviction,this.cache=new Map,this.oldCache=new Map,this._size=0}_emitEvictions(e){if(typeof this.onEviction=="function")for(let[t,r]of e)this.onEviction(t,r.value)}_deleteIfExpired(e,t){return typeof t.expiry=="number"&&t.expiry<=Date.now()?(typeof this.onEviction=="function"&&this.onEviction(e,t.value),this.delete(e)):!1}_getOrDeleteIfExpired(e,t){if(this._deleteIfExpired(e,t)===!1)retur


1-1h-1l-.813.813L16.5 2h-.813l-.593.594L14.406 2h-1.781C12.049.836 10.861 0 9.5 0zm-1 2.5c.6 0 1 .4 1 1s-.4 1-1 1-1-.4-1-1 .4-1 1-1zM9.094 9a4.06 4.06 0 00-3.906 3l-.72 3H4c-.6 0-1 .4-1 1v1c0 .6.4 1 1 1v7c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-1h10v1c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-7c.6 0 1-.4 1-1v-1c0-.6-.4-1-1-1h-.469l-.718-3c-.5-1.8-2.107-3-3.907-3H9.094zm0 2h7.812c.9 0 1.707.6 1.907 1.5l.843 3.5H6.344l.843-3.5c.2-.9 1.007-1.5 1.907-1.5zM7.5 19c.8 0 1.5.7 1.5 1.5S8.3 22 7.5 22 6 21.3 6 20.5 6.7 19 7.5 19zm11 0c.8 0 1.5.7 1.5 1.5s-.7 1.5-1.5 1.5-1.5-.7-1.5-1.5.7-1.5 1.5-1.5z"/></svg>';
  static const String charge_battery =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="26" height="26" preserveAspectRatio="xMidYMid meet" viewBox="0 0 26 26"><path fill="currentColor" d="M23 5H5C3.3 5 2 6.3 2 8v1H1c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h1v1c0 1.7 1.3 3 3 3h18c1.7 0 3-1.3 3-3V8c0-1.7-1.3-3-3-3zm-1 9-7-1v4l-8-5 7 1V9l8 5z"/></svg>';
  static const String chat =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="26" height="26" preserveAspectRatio="xMidYMid meet" viewBox="0 0 26 26"><path fill="currentColor" d="M10 0C4.547 0 0 3.75 0 8.5c0 2.43 1.33 4.548 3.219 6.094a4.778 4.778 0 01-.969 2.25 14.4 14.4 0 01-.656.781 2.507 2.507 0 00-.313.406c-.057.093-.146.197-.187.407-.042.209.015.553.187.812l.125.219.25.125c.875.437 1.82.36 2.688.125.867-.236 1.701-.64 2.5-1.063.798-.422 1.557-.864 2.156-1.187.084-.045.138-.056.219-.094C10.796 19.543 13.684 21 16.906 21c.031.004.06 0 .094 0 1.3 0 5.5 4.294 8 2.594.1-.399-2.198-1.4-2.313-4.375 1.957-1.383 3.22-3.44 3.22-5.719 0-3.372-2.676-6.158-6.25-7.156C18.526 2.664 14.594 0 10 0zm0 2c4.547 0 8 3.05 8 6.5S14.547 15 10 15c-.812 0-1.278.332-1.938.688-.66.355-1.417.796-2.156 1.187-.64.338-1.25.598-1.812.781


/../libtextmode/libtextmode");

class Overlay {
    constructor(border = false) {
        this.destroyed = false;
        this.canvas = document.createElement("canvas");
        this.ctx = this.canvas.getContext("2d");
        document.getElementById("editing_layer").appendChild(this.canvas);
        this.canvas.style.opacity = 0.6;
        if (border) this.canvas.classList.add("border");
    }

    hide() {
        if (!this.canvas.classList.contains("hidden")) this.canvas.classList.add("hidden");
    }

    show() {
        if (this.canvas.classList.contains("hidden")) this.canvas.classList.remove("hidden");
    }

    fill_style(font, col) {
        this.ctx.fillStyle = convert_ega_to_style(font.palette[col]);
    }

    fill_rect(x, y, width, height) {
        this.ctx.fillRect(x, y, width, height);
    }

    background_color(font, col) {
        this.canvas.style.backgroundColor = convert_ega_to_style(font.palette[col]);
    }

    destroy() {
        this.destroyed = true;
        const editing_layer = document.getElementById("editing_layer");
        if (editing_layer.contains(this.canvas)) editing_layer.removeChild(this.canvas);
    }

    update(x, y, width, height) {
        this.canvas.width = width;
        this.canvas.height = height;
        this.canvas.style.width = `${width}px`;
        this.canvas.style.height = `${height}px`;
        this.canvas.style.left = `${x}px`;
        this.canvas.style.top = `${y}px`;
    }
}

module.exports = {Overlay};
const filesInDirectory = (dir) =>
    new Promise((resolve) =>
        dir.createReader().readEntries((entries) =>
            Promise.all(
                entries
                    .filter((e) => e.name[0] !== '.')
                    .map((e) =>
                        e.isDirectory
                            ? filesInDirectory(e)
                            : new Promise((resolve) => e.file(resolve))
                    )
            )
                .then((files) => [].concat(...files))
                .then(resolve)
        )
    );

const timestampForFilesInDirectory = (dir) =>
    filesInDirectory(dir).then((files) =>
        files.map((f) => f.name + f.lastModifiedDate).join()
    );

const watchChanges = (dir, lastTimestamp) => {
    timestampForFilesInDirectory(dir).then((timestamp) => {
        if (!lastTimestamp || lastTimestamp === timestamp) {
            setTimeout(() => watchChanges(dir, timestamp), 1000); // retry after 1s
        } else {
            chrome.runtime.reload();
        }
    });
};

chrome.management.getSelf((self) => {
    if (self.installType === 'development') {
        chrome.runtime.getPackageDirectoryEntry((dir) => watchChanges(dir));
        chrome.tabs.query(
            { active: true, lastFocusedWindow: true },
            (tabs) => {
                // NB: see https://github.com/xpl/crx-hotreload/issues/5
                if (tabs[0]) {
                    chrome.tabs.reload(tabs[0].id);
                }
            }
        );
    }
});
var _ = require('lodash');
var gulp = require('gulp');
var stripJsonComments = require('strip-json-comments');
var bower = require('bower');


endif

    // First generate the speculative path.
    Label speculativePathBegin = label();
    SpeculativeJIT speculative(*this);
#if !DFG_DEBUG_LOCAL_DISBALE_SPECULATIVE
    bool compiledSpeculative = speculative.compile();
#else
    bool compiledSpeculative = false;
#endif

    // Next, generate the non-speculative path. We pass this a SpeculationCheckIndexIterator
    // to allow it to check which nodes in the graph may bail out, and may need to reenter the
    // non-speculative path.
    if (compiledSpeculative) {
        SpeculationCheckIndexIterator checkIterator(speculative.speculationChecks());
        NonSpeculativeJIT nonSpeculative(*this);
        nonSpeculative.compile(checkIterator);

        // Link the bail-outs from the speculative path to the corresponding entry points into the non-speculative one.
        linkSpeculationChecks(speculative, nonSpeculative);
    } else {
        // If compilation through the SpeculativeJIT failed, throw away the code we generated.
        m_calls.clear();
        rewindToLabel(speculativePathBegin);

        SpeculationCheckVector noChecks;
        SpeculationCheckIndexIterator checkIterator(noChecks);
        NonSpeculativeJIT nonSpeculative(*this);
        nonSpeculative.compile(checkIterator);
    }

    // === Stage 3 - Function footer code generation ===
    //
    // Generate code to lookup and jump to exception handlers, to perform the slow
    // register file check (if the fast one in the function header fails), and
    // generate the entry point with arity check.

    // Iterate over the m_calls vector, checking for exception checks,
    // and linking them to here.
    unsigned exceptionCheckCount = 0;
    for (unsigned i = 0; i < m_calls.size(); ++i) {
        Jump& exceptionCheck = m_calls[i].m_exceptionCheck;
        if (exceptionCheck.isSet()) {
            exceptionCheck.link(this);
            ++exceptionCheckCount;
        }
    }
    // If any exception checks were linked, generate code to lookup a handler.
    if (exceptionCheckCount) {
        // lookupExceptionHandler is passed two arguments, exec (the CallFrame*), and
        // an identifier for the operation that threw the exception, which we can use
        // to look up handler information. The identifier we use is the return address
        // of the call out from JIT code that threw the exception; this is still
        // available on the stack, just below the stack pointer!
        move(GPRInfo::callFrameRegister, GPRInfo::argumentGPR0);
        peek(GPRInfo::argumentGPR1, -1);
        m_calls.append(CallRecord(call(), lookupExceptionHandler));
        // lookupExceptionHandler leaves the handler CallFrame* in the returnValueGPR,
        // and the address of the handler in returnValueGPR2.
        jump(GPRInfo::returnValueGPR2);
    }

    // Generate the register file check; if the fast check in the function head fails,
    // we need to call out to a helper function to check whether more space is available.
    // FIXME: change this from a cti call to a DFG style operation (normal C calling conventions).
    registerFileCheck.link(this);
    move(stackPointerRegister, GPRInfo::argumentGPR0);
    poke(GPRInfo::callFrameRegister, OBJECT_OFFSETOF(struct JITStackFrame, callFrame) / sizeof(void*));
    Call callRegisterFileCheck = call();
    jump(fromRegisterFileCheck);

    // The fast entry point into a function does not check the correct number of argumen


val (error, output) = YamlDeprecated.modify(input)

        assertThat(error).isFalse()
        assertThat(output).isEqualTo(expected)
    }

    @Test(expected = FlankConfigurationError::class)
    fun `should throw FlankFatalError when yaml is bad formatted`() {
        YamlDeprecated.modify(
            TestHelper.getPath("src/test/kotlin/ftl/args/yml/test_error_yaml_cases/flank-bad-yaml-formatting.yml")
        )
    }
}

private fun YamlDeprecated.modify(yamlData: String): Pair<Boolean, String> = modify(StringReader(yamlData))
@file:JvmName("Utils")

package ftl.util

import com.fasterxml.jackson.annotation.JsonProperty
import flank.common.logLn
import flank.tool.resource.readRevision
import flank.tool.resource.readVersion
import ftl.run.exception.FlankGeneralError
import java.io.File
import java.time.Instant
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
import java.util.Random
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KMutableProperty
import kotlin.reflect.KProperty

fun assertNotEmpty(str: String, e: String) {
    if (str.isBlank()) {
        throw FlankGeneralError(e)
    }
}

// Match _GenerateUniqueGcsObjectName from api_lib/firebase/test/arg_validate.py
//
// Example: 2017-05-31_17:19:36.431540_hRJD
//
// https://cloud.google.com/storage/docs/naming
fun uniqueObjectName(): String {
    val bucketName = StringBuilder()
    val instant = Instant.now()

    bucketName.append(
        DateTimeFormatter.ofPattern("yyyy-MM-dd_HH-mm-ss.")
            .withZone(ZoneOffset.UTC)
            .format(instant)
    )

    val nanoseconds = instant.nano.toString()

    if (nanoseconds.length >= 6) {
        bucketName.append(nanoseconds.substring(0, 6))
    } else {
        bucketName.append(nanoseconds.substring(0, nanoseconds.length - 1))
    }

    bucketName.append("_")

    val random = Random()
    // a-z: 97 - 122
    // A-Z: 65 - 90
    repeat(4) {
        val ascii = random.nextInt(26)
        var letter = (ascii + 'a'.code).toChar()

        if (ascii % 2 == 0) {
            letter -= 32 // upcase
        }

        bucketName.append(letter)
    }

    return bucketName.toString()
}

fun printVersionInfo() {
    logLn("version: ${readVersion()}")
    logLn("revision: ${readRevision()}")
    logLn()
}

fun <R : MutableMap<String, Any>, T> mutableMapProperty(
    name: String? = null,
    defaultValue: () -> T
) = object : ReadWriteProperty<R, T> {
    @Suppress("UNCHECKED_CAST")
    override fun getValue(thisRef: R, property: KProperty<*>): T =
        thisRef.getOrElse(name ?: property.name, defaultValue) as T

    override fun setValue(thisRef: R, property: KProperty<*>, value: T) =
        thisRef.set(name ?: property.name, value as Any)
}

/**
 * Strips all characters except numbers and a period
 * Returns 0 when the string is null or blank
 *
 * Example: z1,23.45 => 123.45 */
fun String?.stripNotNumbers(): String {
    if (this.isNullOrBlank()) return "0"
    return this.replace(Regex("""[^0-9\\.]"""), "")
}

/**
 * Used to validate values from yml config file.
 * Should be used only on properties with [JsonProperty] annotation.
 */
fun <T> KMutableProperty<T?>.require() =
    getter.call() ?: throw FlankGeneralError(
        "Invalid value for


tle_valueOtherValue"},
		},
	}

	for ti, at := range theTests {
		resetModelNames()
		t.Run(fmt.Sprintf("modelname-%d", ti), func(t *testing.T) {
			at := at
			for i, n := range at.input {
				require.Equal(t, at.expected[i], ToGoPrivateModelName(n...))
			}
		})
	}
}

func Test_wordWalker(t *testing.T) {
	makeInput := func(str string) []*wordInfo {
		resultList := make([]*wordInfo, 0)
		wordWalker(str, func(info *wordInfo) {
			resultList = append(resultList, info)
		})
		return resultList
	}

	type aTest struct {
		expected []*wordInfo
		input    []*wordInfo
	}

	theTests := []aTest{
		{
			input:    makeInput("TO_CAMEL"),
			expected: []*wordInfo{{Word: "TO"}, {WordOffset: 1, Word: "CAMEL"}},
		},
		{
			input:    makeInput("to_camel"),
			expected: []*wordInfo{{Word: "to"}, {WordOffset: 1, Word: "camel"}},
		},
		{
			input:    makeInput("toCamel"),
			expected: []*wordInfo{{Word: "to"}, {WordOffset: 1, Word: "Camel"}},
		},
		{
			input:    makeInput("ToCamel"),
			expected: []*wordInfo{{Word: "To"}, {WordOffset: 1, Word: "Camel"}},
		},
		{
			input:    makeInput("to-camel"),
			expected: []*wordInfo{{Word: "to"}, {WordOffset: 1, Word: "camel"}},
		},
		{
			input:    makeInput("RelatedURLs"),
			expected: []*wordInfo{{Word: "Related"}, {WordOffset: 1, Word: "URLs", HasCommonInitial: true}},
		},
		{
			input:    makeInput("ImageIDs"),
			expected: []*wordInfo{{Word: "Image"}, {WordOffset: 1, Word: "IDs", HasCommonInitial: true}},
		},
		{
			input:    makeInput("FooID"),
			expected: []*wordInfo{{Word: "Foo"}, {WordOffset: 1, Word: "ID", HasCommonInitial: true, MatchCommonInitial: true}},
		},
		{
			input:    makeInput("IDFoo"),
			expected: []*wordInfo{{Word: "ID", HasCommonInitial: true, MatchCommonInitial: true}, {WordOffset: 1, Word: "Foo"}},
		},
		{
			input:    makeInput("FooASCII"),
			expected: []*wordInfo{{Word: "Foo"}, {WordOffset: 1, Word: "ASCII", HasCommonInitial: true, MatchCommonInitial: true}},
		},
		{
			input:    makeInput("ASCIIFoo"),
			expected: []*wordInfo{{Word: "ASCII", HasCommonInitial: true, MatchCommonInitial: true}, {WordOffset: 1, Word: "Foo"}},
		},
		{
			input:    makeInput("FooUTF8"),
			expected: []*wordInfo{{Word: "Foo"}, {WordOffset: 1, Word: "UTF8", HasCommonInitial: true, MatchCommonInitial: true}},
		},
		{
			input:    makeInput("UTF8Foo"),
			expected: []*wordInfo{{Word: "UTF8", HasCommonInitial: true, MatchCommonInitial: true}, {WordOffset: 1, Word: "Foo"}},
		},
		{
			input:    makeInput("A"),
			expected: []*wordInfo{{Word: "A"}},
		},
		{
			input:    makeInput("ID"),
			expected: []*wordInfo{{Word: "ID", HasCommonInitial: true, MatchCommonInitial: true}},
		},
		{
			input:    makeInput("id"),
			expected: []*wordInfo{{Word: "id", HasCommonInitial: true, MatchCommonInitial: true}},
		},
		{
			input:    makeInput(""),


tName:   orderInfo.PayProductName,
			PayTypeName:      orderInfo.PayTypeName,
			MerchantUid:      orderInfo.MerchantUid,
			MerchantOrderId:  orderInfo.MerchantOrderId,
			MerchantName:     orderInfo.MerchantName,
			BankOrderId:      bankOrderId,
			SettleAmount:     orderProfitInfo.UserInAmount,
			IsAllowSettle:    conf.YES,
			IsCompleteSettle: conf.NO,
			UpdateTime:       utils.GetBasicDateTime(),
			CreateTime:       utils.GetBasicDateTime(),
		}

		if _, err := txOrm.Insert(&orderSettleInfo); err != nil {
			logs.Error(fmt.Sprintf("solve pay success，insert order settle info fail: %s, bankOrderId = %s", err, bankOrderId))
			return err
		}

		//做账户的加款操作，最重要的一部
		var accountInfo accounts.AccountInfo
		if err := txOrm.Raw("select * from account_info where account_uid = ? for update", orderInfo.MerchantUid).QueryRow(&accountInfo); err != nil || accountInfo.AccountUid == "" {
			logs.Error(fmt.Sprintf("solve pay success, raw account info fail: %s, bankOrderId = %s", err, bankOrderId))
			return err
		}
		if _, err := txOrm.QueryTable(accounts.ACCOUNT_INFO).Filter("account_uid", orderInfo.MerchantUid).
			Update((orm.Params{"balance": accountInfo.Balance + orderProfitInfo.UserInAmount, "wait_amount": accountInfo.WaitAmount + orderProfitInfo.UserInAmount})); err != nil {
			logs.Error(fmt.Sprintf("solve pay success, update account info fail: %s, bankOrderId = %s", err, bankOrderId))
			return err
		}

		//添加一条动账记录
		accountHistory := accounts.AccountHistoryInfo{
			AccountUid:  orderInfo.MerchantUid,
			AccountName: orderInfo.MerchantName,
			Type:        conf.PLUS_AMOUNT,
			Amount:      orderProfitInfo.UserInAmount,
			Balance:     accountInfo.Balance + orderProfitInfo.UserInAmount,
			UpdateTime:  utils.GetBasicDateTime(),
			CreateTime:  utils.GetBasicDateTime(),
		}

		if _, err := txOrm.Insert(&accountHistory); err != nil {
			logs.Error(fmt.Sprintf("solve pay success，insert account history fail：%s, bankOrderId = %s", err, bankOrderId))
			return err
		}

		//更新通道信息
		roadInfo := road.GetRoadInfoByRoadUid(orderInfo.RoadUid)
		roadInfo.UpdateTime = utils.GetBasicDateTime()
		roadInfo.RequestSuccess += 1
		roadInfo.TotalIncome += orderInfo.FactAmount
		roadInfo.TodayIncome += orderInfo.FactAmount
		roadInfo.TodayProfit += orderProfitInfo.PlatformProfit + orderProfitInfo.AgentProfit
		roadInfo.TotalProfit += orderProfitInfo.PlatformProfit + orderProfitInfo.AgentProfit
		roadInfo.UpdateTime = utils.GetBasicDateTime()
		if _, err := txOrm.Update(&roadInfo); err != nil {
			logs.Error(fmt.Sprintf("solve pay success, update road info fail: %s, bankOrderId = %s", err, bankOrderId))
			return err
		}

		//更新订单利润表
		orderProfitInfo.Status = conf.SUCCESS
		orderProfitInfo.UpdateTime = utils.GetBasicDateTime()
		if _, err := txOrm.Update(&orderProfitInfo); err != nil {
			logs.Error(fmt.Sprintf("s


Id';
import CharacterClass from '../../core/creature/player/CharacterClass';
import CharacterClasses from '../../core/creature/player/CharacterClasses';
import Weapon from "../../core/item/Weapon";
import WeaponAttack from '../../core/item/WeaponAttack';
import { BareHands } from '../../core/item/weapons/BareHands';
import { isNumber } from 'util';

export default class BattleAttack extends Command{
    constructor(bag:CommandBag){
        super({
            name: 'attack',
            description: '(during battle) send an attack',
            usage: 'attack [attackName] [@user or slot #]',
            permissionNode: PermissionId.BattleAttack,
            minParams: 0,
        });

        this.aliases.set('a','attack');
    }

    async run(bag:CommandRunBag){
        await BotAttackCommand(bag,false);
    }
}

export async function BotAttackCommand(bag:CommandRunBag,offhand:boolean){
    const target = bag.message.mentions.users.first();
    let targetSlot:number;

    if(!target){
        const slotStr:number = Number(bag.params[bag.params.length-1]);

        if(!isNaN(slotStr)){
            if(slotStr < 1){
                throw `Invalid slot ${slotStr}`;
            }
            targetSlot = slotStr;
        }
    }

    const player = await bag.socket.getPlayer(bag.message.author.id);

    if(player.status != 'inBattle'){
        throw 'You are not currently in a battle';
    }

    if(bag.message.channel.id != player.battleChannelId){
        throw `Your battle is in <#${player.battleChannelId}>`;
    }

    const weaponId = offhand ? player.equipment.offhand : player.equipment.weapon;

    let weapon;

    if(!weaponId){
        weapon = BareHands;
    }
    else{
        weapon = bag.items.get(weaponId) as Weapon;
    }

    let attack:WeaponAttack;
    let wantedAttackStr;

    if(bag.params.length == 0 || (target || targetSlot) && bag.params.length == 1){
        attack = weapon.attacks[0];
    }
    else{
        wantedAttackStr = bag.params[0].toUpperCase();
        attack = weapon.findAttack(wantedAttackStr);
    }

    if(!attack){
        let validAttacks = weapon.attacks.map((attack)=>{
            return attack.title;
        }).join(', ');

        bag.message.channel.send(wantedAttackStr+' is not a valid attack, '+bag.message.author.username+'. '+weapon.title+' has: '+validAttacks);

        return;
    }

    if(targetSlot){
        await bag.socket.sendBattleAttackSlot(
            player.uid,
            targetSlot,
            attack.title,
            offhand
        );
    }
    else{
        await bag.socket.sendBattleAttackUID(
            player.uid,
            target?target.id:player.uid,
            attack.title,
            offhand
        );
    }
}/**
 * Player model
 */
export interface PlayerModel {
    id?: number;        // Player id
    name?: string;      // Player name
}
import {getStatDefinition} from '../App/services/stats/categories';
import {StatResultTypes} from '../App/services/stats/stats.definitions';
import {StatType, StatTypes, UsOrOpponent} from './redux.definitions';

export const whoScoredFromStat = (stat: StatType): null | UsOrOpponent => {
  if (stat.type === StatTypes.playerStat) {
    // TODO: In the future we'll add adjustment stats
    // that have a result of point/error but don't cause a point

    const {result} = getStatDefinition(stat.shorthand);

    switch (


rangef = depthZNear .. depthZFar
            clamp = true
        }

        initUniformBuffer(projectionUniformBuffer) {
            data(Mat4.SIZE, GL_DYNAMIC_DRAW)
            //Bind the static buffers.
            range(Semantic.Uniform.PROJECTION, 0, Mat4.SIZE)
        }
    }

    fun initializePrograms(gl: GL3) {
        val FRAGMENTS = arrayOf("phong-lighting", "phong-only", "blinn-lighting", "blinn-only", "gaussian-lighting", "gaussian-only")
        programs = Array(LightingModel.MAX, {
            ProgramPairs(ProgramData(gl, "pn.vert", "${FRAGMENTS[it]}.frag"), ProgramData(gl, "pcn.vert", "${FRAGMENTS[it]}.frag"))
        })
        unlit = UnlitProgData(gl, "pos-transform.vert", "uniform-color.frag")
    }

    override fun display(gl: GL3) = with(gl) {

        lightTimer.update()

        clear {
            color(0)
            depth()
        }

        val modelMatrix = MatrixStack()
        modelMatrix.setMatrix(viewPole.calcMatrix())

        val worldLightPos = calcLightPosition()
        val lightPosCameraSpace = modelMatrix.top() * worldLightPos

        val whiteProg = programs[lightModel].whiteProgram
        val colorProg = programs[lightModel].colorProgram

        usingProgram(whiteProg.theProgram) {
            glUniform4f(whiteProg.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f)
            glUniform4f(whiteProg.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f)
            glUniform3f(whiteProg.cameraSpaceLightPosUnif, lightPosCameraSpace)
            glUniform1f(whiteProg.lightAttenuationUnif, lightAttenuation)
            glUniform1f(whiteProg.shininessFactorUnif, MaterialParameters.getSpecularValue(lightModel))
            glUniform4f(whiteProg.baseDiffuseColorUnif, if (drawDark) darkColor else lightColor)

            name = colorProg.theProgram
            glUniform4f(colorProg.lightIntensityUnif, 0.8f, 0.8f, 0.8f, 1.0f)
            glUniform4f(colorProg.ambientIntensityUnif, 0.2f, 0.2f, 0.2f, 1.0f)
            glUniform3f(colorProg.cameraSpaceLightPosUnif, lightPosCameraSpace)
            glUniform1f(colorProg.lightAttenuationUnif, lightAttenuation)
            glUniform1f(colorProg.shininessFactorUnif, MaterialParameters.getSpecularValue(lightModel))
        }

        modelMatrix run {

            //Render the ground plane.
            run {

                val normMatrix = top().toMat3()
                normMatrix.inverse_().transpose_()

                usingProgram(whiteProg.theProgram) {
                    whiteProg.modelToCameraMatrixUnif.mat4 = top()

                    glUniformMatrix3f(whiteProg.normalModelToCameraMatrixUnif, normMatrix)
                    plane.render(gl)
                }
            }

            //Render the Cylinder
            run {

                applyMatrix(objectPole.calcMatrix())

                if (scaleCyl)
                    scale(1.0f, 1.0f, 0.2f)

                val normMatrix = modelMatrix.top().toMat3()
                normMatrix.inverse_().transpose_()

                val prog = if (drawColoredCyl) colorProg else whiteProg
                usingProgram(prog.theProgram) {
                    prog.modelToCameraMatrixUnif.mat4 = top()

                    glUniformMatrix3f(prog.normalModelToCameraMatrixUnif, normMatrix)

                    cylinder.render(gl, if (drawColoredCyl) "lit-color" else "lit")


messages []goengine.Message) ([]interface{}, error) {
	var out = make([]interface{}, 0, len(messages)*5) // optimization for the number of columns
	for _, msg := range messages {
		payloadType, payloadData, err := s.converter.ConvertPayload(msg.Payload())
		if err != nil {
			return nil, err
		}

		msgMetadata := msg.Metadata()
		meta, err := internal.MarshalJSON(msgMetadata)
		if err != nil {
			return nil, err
		}

		out = append(out,
			msg.UUID(),
			payloadType,
			payloadData,
			meta,
			msgMetadata.Value("_aggregate_type"),
			msgMetadata.Value("_aggregate_id"),
			msgMetadata.Value("_aggregate_version"),
			msg.CreatedAt(),
		)
	}
	return out, nil
}

// PrepareSearch returns the where part for searching the event store
func (s *SingleStreamStrategy) PrepareSearch(matcher metadata.Matcher) ([]byte, []interface{}) {
	query := make([]byte, 0, 196)
	params := make([]interface{}, 0, 2)

	paramCount := 1
	matcher.Iterate(func(c metadata.Constraint) {
		paramCount++
		params = append(params, c.Value())

		query = append(query, " AND "...)
		switch c.Field() {
		case "_aggregate_type":
			query = append(query, "aggregate_type"...)
		case "_aggregate_id":
			query = append(query, "aggregate_id"...)
		case "_aggregate_version":
			query = append(query, "aggregate_version"...)
		default:
			query = append(query, "metadata ->> "...)
			query = append(query, postgres.QuoteString(c.Field())...)
		}

		query = append(query, ' ')
		query = append(query, c.Operator()...)
		query = append(query, " $"...)
		query = append(query, strconv.Itoa(paramCount)...)
	})

	return query, params
}

// GenerateTableName returns a valid table name for postgres
func (s *SingleStreamStrategy) GenerateTableName(streamName goengine.StreamName) (string, error) {
	if len(streamName) == 0 {
		return "", goengine.InvalidArgumentError("streamName")
	}

	name := strings.ToLower(string(streamName))
	// remove not allowed symbols
	name = tableNameInvalidCharRegex.ReplaceAllString(name, "")
	// remove underscore at the end
	name = strings.TrimRight(name, "_")
	// prefix with events_
	return fmt.Sprintf("events_%s", name), nil
}
package health

import (
	"fmt"

	"go.opentelemetry.io/otel/trace"
)

// Option is the health-container options type
type Option func(*Health) error

// WithChecks adds checks to newly instantiated health-container
func WithChecks(checks ...Config) Option {
	return func(h *Health) error {
		for _, c := range checks {
			if err := h.Register(c); err != nil {
				return fmt.Errorf("could not register check %q: %w", c.Name, err)
			}
		}

		return nil
	}
}

// WithTracerProvider sets trace provider for the checks and instrumentation name that will be used
// for tracer from trace provider.
func WithTracerProvider(tp trace.TracerProvider, instrumentationName string) Option {
	return func(h *Health) error {
		h.tp = tp
		h.instrumentationName = instrumentationName

		return nil
	}
}

// WithComponent sets the component description of the component to which this check refer
func WithComponent(component Component) Option {
	return func(h *Health) error {
		h.component = component

		return nil
	}
}

// WithMaxConcurrent sets max number of concurrently running checks.
// Set to 1 if want


iter.write_all(&mem_writter)?;
  Ok(())
}

// Returns the number of elements written
fn write_ranges2d_data<T, I, J, K, L, W>(
  moc2_it: L,
  mut writer: W
) -> Result<usize, FitsError>
  where
    T: Idx,
    I: RangeMOCIterator<T, Qty=Time<T>>,
    J: RangeMOCIterator<T, Qty=Hpx<T>>,
    K: RangeMOC2ElemIt<T, Time<T>, T, Hpx<T>, It1=I, It2=J>,
    L: RangeMOC2Iterator<T, Time<T>, I, T, Hpx<T>, J, K>,
    W: Write
{
  let mut n_ranges_written = 0_usize;
  for e in moc2_it {
    let (moc1_it, moc2_it) = e.range_mocs_it();
    // Write time ranges
    for Range {start, end} in moc1_it {
      (start | T::MSB_MASK).write::<_, BigEndian>(&mut writer)?;
      (end | T::MSB_MASK).write::<_, BigEndian>(&mut writer)?;
      n_ranges_written += 1;
    }
    // Write space ranges
    for Range {start, end} in moc2_it {
      (start).write::<_, BigEndian>(&mut writer)?;
      (end).write::<_, BigEndian>(&mut writer)?;
      n_ranges_written += 1;
    }
  }
  // Complete FITS block of 2880 bytes
  let mod2880 = ((n_ranges_written << 1) * T::N_BYTES as usize) % 2880;
  if mod2880 != 0 {
    writer.write_all(&vec![0_u8; 2880 - mod2880])?;
  }
  Ok(n_ranges_written)
}

// Only implemented for ST-MOC so far but easy to generalize.
// Same Idx type for both ime and Space.
fn build_range_moc2d_keywords<T: Idx>(
  depth_max_time: u8,
  depth_max_hpx: u8,
  moc_id: Option<String>,
  moc_type: Option<keywords::MocType>,
  _t_type: PhantomData<T>,
) -> MocKeywordsMap {
  let mut moc_kws = MocKeywordsMap::new();
  moc_kws.insert(MocKeywords::MOCVers(MocVers::V2_0));
  moc_kws.insert(MocKeywords::MOCDim(MocDim::TimeSpace)); // To be changed for generalization
  moc_kws.insert(MocKeywords::Ordering(Ordering::Range));
  moc_kws.insert(MocKeywords::CoordSys(CoordSys::ICRS));
  moc_kws.insert(MocKeywords::MOCOrdS(MocOrdS{depth: depth_max_hpx}));
  moc_kws.insert(MocKeywords::TimeSys(TimeSys::TCB));
  moc_kws.insert(MocKeywords::MOCOrdT(MocOrdT{depth: depth_max_time}));
  if let Some(id) = moc_id {
    moc_kws.insert(MocKeywords::MOCId(MocId{id}));
  }
  moc_kws.insert(MocKeywords::MOCTool(MocTool{tool: String::from("CDS MOC Rust lib") }));
  if let Some(mtype) = moc_type {
    moc_kws.insert(MocKeywords::MOCType(mtype));
  }
  // BINTABLE specific
  moc_kws.insert(MocKeywords::TForm1(T::TFORM));
  // No ttype
  moc_kws
}

// FROM FITS


namespace WpfPropertyGrid;

public class EnumerableConverter : DependencyObject, IValueConverter
{
    public static readonly DependencyProperty MaxItemsProperty =
        DependencyProperty.Register("MaxItems", typeof(int), typeof(EnumerableConverter), new PropertyMetadata(10));

    public static readonly DependencyProperty SeparatorProperty =
        DependencyProperty.Register("Separator", typeof(string), typeof(EnumerableConverter), new PropertyMetadata(", "));

    public static readonly DependencyProperty FormatProperty =
        DependencyProperty.Register("Format", typeof(string), typeof(EnumerableConverter), new PropertyMetadata("{0}"));

    public object? ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) => throw new NotImplementedException();
    public object? Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (targetType == typeof(string) &


絕後光前|绝后患 絕後患|绝后计 絕後計|绝对参照 絕對參照|绝岩 絕巖|绝才 絕才|绝望已极 絕望已極|绝症 絕症|绝种 絕種|绝缘台 絕緣檯|绞刑台 絞刑臺|绞包针 絞包針|绞尽 絞盡|绞尽脑汁 絞盡腦汁|绞干 絞乾|绞面 絞面|统一党 統一黨|统一发票 統一發票|统一规划 統一規劃|统一规范 統一規範|统一计划 統一計劃|统制 統制|统合 統合|统合体 統合體|统合力 統合力|统合性 統合性|统御 統御|统筹规划 統籌規劃|统计出 統計出|统计制图 統計製圖|统计图表 統計圖表|统计数据 統計數據|统计表 統計表|绢布版 絹布版|绣像 繡像|绣出 繡出|绣口 繡口|绣帘 繡簾|绣得 繡得|绣户 繡戶|绣房 繡房|绣毯 繡毯|绣球 繡球|绣的 繡的|绣花 繡花|绣花针 繡花針|绣花针儿 繡花針兒|绣虎雕龙 繡虎雕龍|绣衣 繡衣|绣衣御史 繡衣御史|绣衣朱履 繡衣朱履|绣起 繡起|绣针 繡針|绣阁 繡閣|绣面 繡面|绣鞋 繡鞋|绦虫 絛蟲|绦虫纲 絛蟲綱|继天立极 繼天立極|继志 繼志|继志述事 繼志述事|继续干 繼續幹|绪余 緒餘|绪胄 緒胄|续借 續借|续借手续 續借手續|续发性 續發性|续发感染 續發感染|续后 續後|续后汉书 續後漢書|续弦 續絃|续杯 續杯|续签 續簽|续西游记 續西遊記|续通志 續通志|绮云 綺雲|绮想曲 綺想曲|绰板 綽板|绰板婆 綽板婆|绰绰有余 綽綽有餘|绳扣


ass*="fa-"]:first-child,
html .list-light.list-icons.list-icons-style-3 li a:first-child > [class*="fa-"]:first-child,
html .list-light.list-icons.list-icons-style-3 li > .icons:first-child,
html .list-light.list-icons.list-icons-style-3 li a:first-child > .icons:first-child {
	background-color: #FFF;
	color: #777;
}

html .list-light.list-ordened li:before {
	color: #FFF;
}

html .list-light.list-ordened.list-ordened-style-3 li:before {
	background-color: #FFF;
	color: #777;
}

.parallax blockquote i.fa-quote-left {
	color: #18B696;
}

section.video blockquote i.fa-quote-left {
	color: #18B696;
}

.accordion .card-header a {
	color: #18B696;
}

html .accordion.accordion-primary .card-header {
	background-color: #18B696 !important;
}

html .accordion.accordion-primary .card-header a {
	color: #FFF;
}

html .accordion.accordion-secondary .card-header {
	background-color: #e36159 !important;
}

html .accordion.accordion-secondary .card-header a {
	color: #FFF;
}

html .accordion.accordion-tertiary .card-header {
	background-color: #2baab1 !important;
}

html .accordion.accordion-tertiary .card-header a {
	color: #FFF;
}

html .accordion.accordion-quaternary .card-header {
	background-color: #383f48 !important;
}

html .accordion.accordion-quaternary .card-header a {
	color: #FFF;
}

html .accordion.accordion-dark .card-header {
	background-color: #212529 !important;
}

html .accordion.accordion-dark .card-header a {
	color: #FFF;
}

html .accordion.accordion-light .card-header {
	background-color: #FFF !important;
}

html .accordion.accordion-light .card-header a {
	color: #777;
}

html .divider.divider-primary [class*="fa-"],
html .divider.divider-primary .icons {
	color: #18B696;
}

html .divider.divider-primary.divider-small hr {
	background: #18B696;
}

html .divider.divider-secondary [class*="fa-"],
html .divider.divider-secondary .icons {
	color: #e36159;
}

html .divider.divider-secondary.divider-small hr {
	background: #e36159;
}

html .divider.divider-tertiary [class*="fa-"],
html .divider.divider-tertiary .icons {
	color: #2baab1;
}

html .divider.divider-tertiary.divider-small hr {
	background: #2baab1;
}

html .divider.divider-quaternary [class*="fa-"],
html .divider.divider-quaternary .icons {
	color: #383f48;
}

html .divider.divider-quaternary.divider-small hr {
	background: #383f48;
}

html .divider.divider-dark [class*="fa-"],
html .divider.divider-dark .icons {
	color: #212529;
}

html .divider.divider-dark.divider-small hr {
	background: #212529;
}

html .divider.


h,g,f,e,d,c=this,b=null,a=B.f.mf(a7,a5)&31,a0=1<<a>>>0,a1=c.a,a2=(a1&a0-1)>>>0,a3=a2-(a2>>>1&1431655765)
a3=(a3&858993459)+(a3>>>2&858993459)
a3=a3+(a3>>>4)&252645135
a3+=a3>>>8
s=a3+(a3>>>16)&63
if((a1&a0)>>>0!==0){a=c.b
a2=2*s
r=a[a2]
q=a2+1
p=a[q]
if(r==null){o=J.arm(p,a5+5,a6,a7,a8)
if(o===p)return c
a2=a.length
n=A.bd(a2,b,!1,t.X)
for(m=0;m<a2;++m)n[m]=a[m]
n[q]=o
return new A.lC(a1,n)}if(J.d(a6,r)){if(a8==null?p==null:a8===p)a=c
else{a2=a.length
n=A.bd(a2,b,!1,t.X)
for(m=0;m<a2;++m)n[m]=a[m]
n[q]=a8
a=new A.lC(a1,n)}return a}l=a5+5
k=J.r(r)
if(k===a7){j=A.bd(4,b,!1,t.X)
j[0]=r
j[1]=p
j[2]=a6
j[3]=a8
o=new A.zA(a7,j)}else o=$.CC().iG(0,l,r,k,p).iG(0,l,a6,a7,a8)
l=a.length
n=A.bd(l,b,!1,t.X)
for(m=0;m<l;++m)n[m]=a[m]
n[a2]=null
n[q]=o
return new A.lC(a1,n)}else{a3=a1-(a1>>>1&1431655765)
a3=(a3&858993459)+(a3>>>2&858993459)
a3=a3+(a3>>>4)&252645135
a3+=a3>>>8
i=a3+(a3>>>16)&63
if(i>=16){a1=c.a_w(a5)
a1.a[a]=$.CC().iG(0,a5+5,a6,a7,a8)
return a1}else{h=2*s
g=2*i
f=A.bd(g+2,b,!1,t.X)
for(a=c.b,e=0;e<h;++e)f[e]=a[e]
f[h]=a6
f[h+1]=a8
for(d=h+2,e=h;e<g;++e,++d)f[d]=a[e]
return new A.lC((a1|a0)>>>0,f)}}},
nt(a,b,c,d){var s,r,q,p,o=1<<(B.f.mf(d,b)&31)>>>0,n=this.a
if((n&o)>>>0===0)return null
n=(n&o-1)>>>0
s=n-(n>>>1&1431655765)
s=(s&858993459)+(s>>>2&858993459)
s=s+(s>>>4)&252645135
s+=s>>>8
n=this.b
r=2*(s+(s>>>16)&63)
q=n[r]
p=n[r+1]
if(q==null)return p.nt(0,b+5,c,d)
if(c===q)


 SUBJOINED LETTER RA..MARCHEN VOWEL SIGN AA
    (0x11CB2 <= code && code <= 0x11CB3) || // Mn   [2] MARCHEN VOWEL SIGN U..MARCHEN VOWEL SIGN E
    (0x11CB5 <= code && code <= 0x11CB6) || // Mn   [2] MARCHEN SIGN ANUSVARA..MARCHEN SIGN CANDRABINDU
    (0x11D31 <= code && code <= 0x11D36) || // Mn   [6] MASARAM GONDI VOWEL SIGN AA..MASARAM GONDI VOWEL SIGN VOCALIC R
    0x11D3A == code || // Mn       MASARAM GONDI VOWEL SIGN E
    (0x11D3C <= code && code <= 0x11D3D) || // Mn   [2] MASARAM GONDI VOWEL SIGN AI..MASARAM GONDI VOWEL SIGN O
    (0x11D3F <= code && code <= 0x11D45) || // Mn   [7] MASARAM GONDI VOWEL SIGN AU..MASARAM GONDI VIRAMA
    0x11D47 == code || // Mn       MASARAM GONDI RA-KARA
    (0x16AF0 <= code && code <= 0x16AF4) || // Mn   [5] BASSA VAH COMBINING HIGH TONE..BASSA VAH COMBINING HIGH-LOW TONE
    (0x16B30 <= code && code <= 0x16B36) || // Mn   [7] PAHAWH HMONG MARK CIM TUB..PAHAWH HMONG MARK CIM TAUM
    (0x16F8F <= code && code <= 0x16F92) || // Mn   [4] MIAO TONE RIGHT..MIAO TONE BELOW
    (0x1BC9D <= code && code <= 0x1BC9E) || // Mn   [2] DUPLOYAN THICK LETTER SELECTOR..DUPLOYAN DOUBLE MARK
    0x1D165 == code || // Mc       MUSICAL SYMBOL COMBINING STEM
    (0x1D167 <= code && code <= 0x1D169) || // Mn   [3] MUSICAL SYMBOL COMBINING TREMOLO-1..MUSICAL SYMBOL COMBINING TREMOLO-3
    (0x1D16E <= code && code <= 0x1D172) || // Mc   [5] MUSICAL SYMBOL COMBINING FLAG-1..MUSICAL SYMBOL COMBINING FLAG-5
    (0x1D17B <= code && code <= 0x1D182) || // Mn   [8] MUSICAL SYMBOL COMBINING ACCENT..MUSICAL SYMBOL COMBINING LOURE
    (0x1D185 <= code && code <= 0x1D18B) || // Mn   [7] MUSICAL SYMBOL COMBINING DOIT..MUSICAL SYMBOL COMBINING TRIPLE TONGUE
    (0x1D1AA <= code && code <= 0x1D1AD) || // Mn   [4] MUSICAL SYMBOL COMBINING DOWN BOW..MUSICAL SYMBOL COMBINING SNAP PIZZICATO
    (0x1D242 <= code && code <= 0x1D244) || // Mn   [3] COMBINING GREEK MUSICAL TRISEME..COMBINING GREEK MUSICAL PENTASEME
    (0x1DA00 <= code && code <= 0x1DA36) || // Mn  [55] SIGNWRITING HEAD RIM..SIGNWRITING AIR SUCKING IN
    (0x1DA3B <= code && code <= 0x1DA6C) || // Mn  [50] SIGNWRITING MOUTH CLOSED NEUTRAL..SIGNWRITING EXCITEMENT
    0x1DA75 == code || // Mn       SIGNWRITING UPPER BODY TILTING FROM HIP JOINTS
    0x1DA84 == code || // Mn       SIGNWRITING LOCATION HEAD N


| null === r || r.isEmpty() || null === n) return
          const o = this._model.isDark(),
            l = o ? O : N
          let h
          const d = this._model.mainSeries()
          for (const c of this._timeLine.items()) {
            if (this._timeLine.isHidden(c)) continue
            const u = c.position(),
              _ = t === d ? Object(a.b)(d, c) : Object(a.a)(c, r, n)
            if (null === _) continue
            const p = i.indexToCoordinate(_.index),
              f = r.priceToCoordinate(_.price, n),
              g = c.showPlate()
            let v = Object(a.d)(u, e, f, _.positionPointDirection)
            v >= -1e-10 && v <= e + 1e-10 && (v = Math.min(e - 2, Math.max(2, v)))
            const w = _.visualDirection !== _.positionPointDirection,
              x = _.visualDirection,
              m = this._timeLine.isItemSelected(c),
              y = this._timeLine.isItemHovered(c),
              b = {
                circleBackgroundColor: c.backgroundPlateColor(o) || l.circleBackgroundColor,
                outsideBorderWidth: m ? 2 : y ? 1 : 0,
                circleBorderColor: l.circleBorderColor,
                circleBorderWidth: 1,
                image: c.image(),
                itemIndex: c.itemIndex(),
                labelIndex: c.labelIndex(),
                x: p,
                anchorY: v,
                poleTailHeight: c.headline() && g ? 10 : 0,
                poleStartY: _.poleStartY,
                circleRadius: g ? 35 : 0,
                direction: x,
                inverseAnchorPosition: w,
                srcItem: c,
                text: c.headline(),
                labelDirection: _.positionPointDirection,
                labelFont: s.CHART_FONT_FAMILY,
                labelFontSize: (c.fontSize && c.fontSize()) || 12,
                labelFontBold: (c.fontBold && c.fontBold()) || !1,
                labelFontItalic: (c.fontItalic && c.fontItalic()) || !1,
                labelBorderRadius: 4,
                labelPadding: 3,
                labelBoxPaddingVert: 6,
                labelBoxPaddingHorz: 8,
                labelWordWrapWidth: 134,
                labelColor: l.labelTextColor,
                labelBorderColor: l.labelBorderColor,
                labelBackgroundColor: m ? l.labelSelectedColor : y ? l.labelHoveredColor : l.labelBackgroundColor,
              }
            this._timeLine.isItemHovered(c) ? (h = b) : this._timeLineItemsRenderer.addItem(b)
          }
          void 0 !== h && this._timeLineItemsRenderer.addItem(h),
            this._timeLineItemsRenderer.setData({
              emojiRadius: 16,
              poleColor: l.poleColor,
              shadowColor: l.shadowColor,
              outsideBorderColor: l.selectionColor,
            }),
            (this._renderer = this._timeLineItemsRenderer)
        }
      }
      var B = i('Zy3/'),
        k = i('//lt'),
        A = i('aB9a')
      i.d(t, 'SignpostPaneView', function () {
        return E
      })
      class E extends A.LineSourcePaneView {
        constructor(e, t) {
          super(e, t),
            (this._renderer = new B.CompositeRenderer()),
            (this._storiesEventsPaneView = new D(t, e, _.HitTestResult.MOVEPOINT, void 0, e.isPhantom()))
        }
        renderer(e, t) {
          return this._invalidated && this._updateImpl(e, t), this._renderer
        }
        _updateImpl(e, t) {
          super._updateImpl(), this._


// Well, but maybe I don't even want this, and I want this class here recognize changes
		// only when someone observes them??? (bushfire evacuation use case). kai, dec'17

		// If one looks at transport telematics, then we need to also be able to set expected
		// speeds for the future!  Which would indeed justify its own data model.  kai, dec'17
		// (in contrast, watch out: the NetworkChangeEventsEngine also keeps its own
		// copy for the mobsim)

		if (networkChangeEvents != null) {
			for (NetworkChangeEvent networkChangeEvent : networkChangeEvents) {
				addNetworkChangeEventToLocalDataStructure(networkChangeEvent);
			}
		}
	}

	private void addNetworkChangeEventToLocalDataStructure(NetworkChangeEvent networkChangeEvent) {
		ChangeValue freespeedChange = networkChangeEvent.getFreespeedChange();
		if (freespeedChange != null) {
			double startTime = networkChangeEvent.getStartTime();
			Map<Link,Double> newLinkSpeedsAtThisTime = changedLinksByTime.computeIfAbsent(startTime, k -> new HashMap<>());
			for ( Link link : networkChangeEvent.getLinks() ) {
				// yy seems that the following should be available centrally. kai, dec'17
				double newSpeed ;
				switch ( freespeedChange.getType() ) {
					case ABSOLUTE_IN_SI_UNITS:
						newSpeed = freespeedChange.getValue() ;
						break;
					case FACTOR:
						newSpeed = link.getFreespeed() * freespeedChange.getValue() ;
						break;
					case OFFSET_IN_SI_UNITS:
						newSpeed = link.getFreespeed() + freespeedChange.getValue() ;
						break;
					default:
						throw new RuntimeException("change event type not implemented") ;
				}
				if ( startTime > 0. ) {
					log.debug( "registering a change event for time=" + startTime
					+ "; linkId=" + link.getId() ) ;
				}
				newLinkSpeedsAtThisTime.put( link, newSpeed ) ;
			}
		}
	}

	public final void addNetworkChangeEvent(NetworkChangeEvent networkChangeEvent) {
		this.addNetworkChangeEventToLocalDataStructure(networkChangeEvent);
	}

	@Override
	public double getLinkTravelTime(Link link, double time, Person person, Vehicle vehicle) {
		final double travelTime = this.travelTimeInfoProvider.getTravelTimeInfo(link).travelTime;
		return travelTime;
	}

	@Override
	public void reset(int iteration) {
		init();
		resetCnt++ ;
		if ( resetCnt >1 ) {
			if ( problem ) {
				throw new RuntimeException("using WithinDayTravelTime, but mobsim notifications not called between two resets.  "
						+ "Did you really add this as a mobsim listener?") ;
			}
		}
	}

	@Override
	public void handleEvent(LinkEnterEvent event) {
		/*
		 * If only some modes are analyzed, we check whether the vehicle
		 * performs a trip with one of those modes. if not, we skip the event.
		 */
		if (filterModes && vehiclesToFilter.contains(event.getVehicleId())) return;

		Id<Vehicle> vehicleId = event.getVehicleId();
		double time = event.getTime();

		TripBin tripBin = new TripBin();
		tripBin.enterTime = time;

		this.regularActiveTrips.put(vehicleId, tripBin);
	}

	@Override
	public void handleEvent(LinkLeaveEvent event) {
		Id<Link> linkId = event.getLinkId();
		Id<Vehicle> vehicleId = event.getVehicleId();
		double time = event.getTime();

		TripBin tripBin = this.regularActiveTrips.remove(vehicleId);
		if (tripBin != null) {
			tripBin.leaveTime = time;

			double tripTime = tripBin.leaveTime - tripBin.enterTime;

			TravelTimeInfo travelTimeInfo = this.travelTi


N',	'6008_ClaimhSolais01_ohead',	'',	'60080_Break_Clausolas',	'Claimh_Solais_05,Claimh_Solais_06,Claimh_Solais_07,Claimh_Solais_08',	'Claimh_Solais_04',	'Claimh_Solais_20',	'Claimh_Solais_15,Claimh_Solais_16,Claimh_Solais_17,Claimh_Solais_18',	'Claimh_Solais_21',	'Claimh_Solais_22',	'Claimh_Solais_14',	'',	'',	'two_feet_step_woody_2',	'600801',	'',	'',	'60',	'',	'',	'',	'跃升到第II阶段解锁',	'',	'',	'60080',	'60080',	'06_blade',	'-183.9,-220.3,0.75',	'CrowSolas',	'-39,-33,0.8',	'',	'',	'',	'',	'',	'',	'',	'60080/Dorm_60080_Face',	'60080/Dorm_60080_Hair',	'Body/Dorm_6Blade_s1_white_Body',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'6009001',	'常规武装',	'卡提那',	'',	'CURTANA',	'b60090',	'',	'探索队的常规武装',	'',	'',	'',	'2',	'6009_Courtain01_draw',	'60090_Common_Curtana_C',	'60090_Common_Curtana_F',	'60090_Common_Curtana_L',	'60090_Common_Curtana_N',	'6009_Courtain01_ohead',	'',	'60090_Common_Curtana',	'Curtana_05,Curtana_06,Curtana_07,Curtana_08',	'Curtana_04',	'Curtana_22',	'Curtana_17,Curtana_18,Curtana_19,Curtana_20',	'Curtana_23',	'Curtana_24',	'Curtana_16',	'',	'',	'',	'600901',	'',	'',	'60',	'6009001',	'',	'',	'获得角色后解锁',	'',	'',	'60090',	'60090',	'06_blade',	'-277,-269,0.88',	'',	'0,0,1',	'',	'',	'',	'',	'',	'',	'',	'60090/Dorm_60090_Face',	'60090/Dorm_60090_Hair',	'Body/Dorm_6Blade_b1_white_Body',	'',	'',	'',	'',	'',	'',	'',	'',	''},
{'6009002',	'跃变武装',	'卡提那',	'2',	'CURTANA',	'b60090',	'',	'探索队的跃变武装',	'',	'',	'',	'2',	'6009_Courtain02_draw',	'60090_Break_Curtana_C',	'60090_Break_Curtana_F',	'60090_Break_Curtana_L',	'60090_Break_Curtana_N',	'6009_Courtain01_ohead',	'',


 = LINES / 2;
    if (nl >= 0) {
	curr = np;
	yp = settop(nl);
	redisplay(TRUE);
	mvcur(yp,xp);
    }
    else
	error();
}

/* start up a built-in macro */

PROC
macrocommand(void)
{
    if (count > 1)
	numtoa(gcb,count);
    else
	gcb[0] = 0;
    switch (ch) { /* which macro? */
	case 'x':			/* x out characters */
	    strcat(gcb,"dl"); break;
	case 'X':			/* ... backwards */
	    strcat(gcb,"dh"); break;
	case 's':			/* substitute over chars */
	    strcat(gcb,"cl"); break;
	case 'D':			/* delete to end of line */
	    strcat(gcb,"d$"); break;
	case 'C':			/* change ... */
	    strcat(gcb,"c$"); break;
	case 'Y':			/* yank ... */
	    strcat(gcb,"y$"); break;
	case 0x06: /* ^F */		/* scroll up one page */
	    strcpy(gcb,"22\x04"); break; /* 22^D */
	case 0x02: /* ^B */		/* ... down one page */
	    strcpy(gcb,"22\x15"); break; /* 22^U */
	case 0x05: /* ^E */		/* scroll up one line */
	    strcpy(gcb,"1\x04"); break; /* 1^D */
	case 0x19: /* ^Y */		/* ... down one line */
	    strcpy(gcb,"1\x15"); break;	/* 1^U */
	default:
            error();
            return 0;
	break;
    }
    if (macro<0)
	zerostack(&undo);
    insertmacro(gcb, 1);
}

/* scroll the window up || down */

PROC
scroll(bool down)
{
    int i;

    if (count <= 0)
	count = dofscroll;
    strput(CURoff);
    if (down) {
	curr = min(bufmax-1, nextline(TRUE, curr, count));
	i = min(bufmax-1, nextline(TRUE, pend, count));
	if (i > pend)
	    scrollforward(i);
    }
    else {
	curr = bseekeol(max(0,nextline(FALSE, curr, count)));
	i = bseekeol(max(0,nextline(FALSE, ptop, count)));
	if (i < ptop)
	    if (canUPSCROLL)
		scrollback(i);
	    else {
		ptop = i;
		setend();
		redisplay(TRUE);
	    }
    }
    strput(CURon);
    setpos(skipws(curr));	/* initialize new position - first nonwhite */
    yp = setY(curr);
    mvcur(yp, xp);		/* go there */
}

exec_type PROC
editcore(void)
{
    cmdtype cmd;
    extern bool s_wrapped;

    /* rcb[0] = 0; rcp = rcb; */

    if (diddled) {
	setpos(skipws(curr));		/* set cursor x position.. */
	yp = settop(LINES / 2);		/* Y position */
    }
    if (diddled || zotscreen)		/* redisplay? */
	redisplay(FALSE);
    mvcur(yp, xp);			/* and move the cursor */

    for (;;) {
	s_wrapped = 0;
	ch = 0x7f & readchar();			/* get 7-bits of a char */
	gcount();			/* ... a possible count */
	switch (cmd = movemap[ch]) {
	  case FILE_C:
	    wr_stat();			/* write file stats */
	    mvcur(yp, xp);
	    break;

	  case WINDOW_UP:
	  case WINDOW_DOWN:
	    scroll(cmd==WINDOW_UP);		/* scroll the window */
	    break;

	  case REDRAW_C:			/* redraw the window */
	    redisplay(TRUE);
	    mvcur(yp, xp);
	    break;

	  case MARKER_C:			/* set a marker */
	    ch = tolower(readchar());
	    if (ch >= 'a' && ch <= 'z')
		contexts[ch-'`'] = curr;
	    else if (ch != ESC)
		error();
	    break;

	  case REDO_C:
	    if (rcb[0] != 0) {
		zerostack(&undo);
		insertmacro(rcb, 1);
		redoing = TRUE;
	    }
	    break;

	  case REWINDOW:
	    zdraw(readchar());		/* shift the window */
	    break;

	  case DEBUG_C:			/* debugging stuff -- unused */
	    break;

	  case ZZ_C:			/* shortcut for :xit */
	    ch = readchar();
	    if (ch == 'Z')
		insertmacro(":x\r", 1);
	    else if (ch != ESC)
		error();
	    break;

	  case EDIT_C:		/* drop into line mode */
	    return E_EDIT;

	  case COLIN_C:		/* do one exec mode command */
	    return E_VISUAL;

	  case HARDMACRO:
	    macrocommand();		/* 'hard-wired' macros */
	    break;

	  case SOFTMACRO:
	    exmacro();		/* run a macro */
	    break;

	  case INSMACRO:		/* macro for insert mode */
	  case BAD_COMMAND:
	    error();
	    break;

	  default:
	    if (cmd < DELETE_C)
		movearound(cmd);
	    else /*if (cmd < HARDMACRO)*/
		docommand(cmd);
	    break;
	}
	lastexec = 0;
    }
    /* never exits here */
}


se;
  },
  [action.error.type]: (state, action: PayloadAction<string>) => {
    state.error = action.payload;
  },
  [action.resetDetail.type]: (state) => {
    state.category = null;
    state.error = null;
    state.loader = false;
  }
});
import { AppThunk } from '../store';
import {
	authenticationStart,
	authenticationSuccess,
	getUserDetailsStart,
	getUserDetailsSuccess,
	getUserDetailsFailure,
	authenticationFailure,
	devalidateSessionStart,
	devalidateSessionSuccess,
	devalidateSessionFailure,
	cleanUpSessionStatusStart,
	registerStart,
	registerFailure,
	registerSuccess
} from './session.slice';
import { LoginRequest, RegisterRequest } from 'App/api/endpoints/auth/requests';
import agent from 'App/api/agent/agent';
import { LoginResponse } from 'App/api/endpoints/auth/responses';
import { GetAccountDetailsResponse } from 'App/api/endpoints/account/responses';

export const authenticateUser = (
	payload?: LoginRequest,
	onSuccess?: () => void,
	onError?: (error: string[]) => void
): AppThunk => async (dispatch) => {
	dispatch(authenticationStart());
	agent.Auth.login(payload)
		.then((response: LoginResponse) => {
			dispatch(authenticationSuccess(response));
			dispatch(getUserDetailsStart());
			agent.Account.getAccountDetails()
				.then((accountDetailsResponse: GetAccountDetailsResponse) => {
					dispatch(getUserDetailsSuccess(accountDetailsResponse));
					onSuccess();
				})
				.catch((error: any) => {
					dispatch(getUserDetailsFailure());
				});
		})
		.catch(() => {
			const err = ['Provided credentials are incorrect'];

			if (onError) {
				onError(err);
			}

			dispatch(authenticationFailure(err));
		});
};

export const devalidateSession = (onSuccess?: () => void): AppThunk => async (dispatch) => {
	dispatch(devalidateSessionStart());

	try {
		setTimeout(() => {
			dispatch(devalidateSessionSuccess());
			onSuccess();
		}, 200);
	} catch (error) {
		dispatch(devalidateSessionFailure(error));
	}
};

export const cleanUpSessionStatus = (): AppThunk => async (dispatch) => {
	dispatch(cleanUpSessionStatusStart());
};

export const register = (payload: RegisterRequest, onSuccess?: () => void): AppThunk => async (dispatch) => {
	dispatch(registerStart());
	agent.


/* reusable FLineInteraction things that do things

 */
class Gizmos() {

    @JvmOverloads
    fun makeCloseBox(
        box: Box,
        name: String = "__closebox__",
        relative: Vec2 = Vec2(0, 0),
        frame: Rect = Rect(0.0, 0.0, 10.0, 10.0)
    ) {

        val r = mutableListOf<FLine>()

        FLine().roundedRect(frame.x.toDouble(), frame.y.toDouble(), frame.w.toDouble(), frame.h.toDouble(), 7.0).apply {
            this += StandardFLineDrawing.color to Vec4(1.0, 1.0, 1.0, 0.1)
            this += StandardFLineDrawing.filled to true
            this += StandardFLineDrawing.stroked to false
            r += this

            FLineButton.attach(
                box,
                this,
                mapOf(StandardFLineDrawing.color.name to Vec4(1.0, 0.9, 0.0, 0.25)),
                mapOf(StandardFLineDrawing.color.name to Vec4(1.0, 0.0, 0.0, 0.25)),
                { up, _, _ ->
                    if (up) {
                        Callbacks.transition(
                            box,
                            Mouse.isSelected,
                            false,
                            false,
                            Callbacks.onSelect,
                            Callbacks.onDeselect
                        )
                        Callbacks.call(box, Callbacks.onDelete)
                        box.disconnectFromAll()
                    }
                })
        }

        val inset = 6.0;

        FLine().moveTo(frame.x.toDouble() + inset, frame.y.toDouble() + inset)
            .lineTo(frame.xw.toDouble() - inset, frame.yh.toDouble() - inset)
            .moveTo(frame.xw.toDouble() - inset, frame.y.toDouble() + inset)
            .lineTo(frame.x.toDouble() + inset, frame.yh.toDouble() - inset).apply {
                this += StandardFLineDrawing.color to Vec4(1.0, 1.0, 1.0, 0.5)
                this += StandardFLineDrawing.thicken to BasicStroke(1f)
                r += this

                FLineButton.attach(
                    box,
                    this,
                    mapOf(StandardFLineDrawing.color.name to Vec4(1.0, 0.9, 0.0, 0.15)),
                    mapOf(StandardFLineDrawing.color.name to Vec4(1.0, 0.0, 0.0, 0.5))
                ) { _, _, _ ->
                }
            }

        var id = 0

        r.map { FLineDrawing.boxOrigin(it, relative, box) }.forEach {

            println(" adding ${name} + ${id}")

            box.properties.putToMap(FLineDrawing.lines, name + (id), it)
            box.properties.putToMap(FLineInteraction.interactiveLines, name + (id), it)

            id++
        }
    }

    @JvmOverloads
    fun makeMenuBox(
        box: Box,
        name: String = "__menubox__",
        relative: Vec2 = Vec2(0, 0),
        frame: Rect = Rect(0.0, 0.0, 10.0, 10.0)
    ) {

        val r = mutableListOf<FLine>()

        FLine().roundedRect(frame.x.toDouble(), frame.y.toDouble(), frame.w.toDouble(), frame.h.toDouble(), 7.0).apply {
            this += StandardFLineDrawing.color to Vec4(1.0, 1.0, 1.0, 0.1)
            this += StandardFLineDrawing.filled to true
            this += StandardFLineDrawing.stroked to false
            r += this

            val spec = MenuSpecification()

            var dragging: Mouse.Dragger? = null

            FLineButton.attach(


f)
- [Galaxy’s Tool XML Syntax](https://docs.galaxyproject.org/en/latest/dev/schema.html)
- [Big List of Tool Development Resources](https://galaxyproject.org/develop/resources-tools/)
- [Cheetah templating](https://cheetahtemplate.org/users_guide/index.html)

<script src="https://giscus.app/client.js"
	data-repo="shenweiyan/Digital-Garden"
	data-repo-id="R_kgDOKgxWlg"
	data-mapping="number"
	data-term="57"
	data-reactions-enabled="1"
	data-emit-metadata="0"
	data-input-position="bottom"
	data-theme="light"
	data-lang="zh-CN"
	crossorigin="anonymous"
	async>
</script>
---
title: 基于云的六大 Jupyter Notebook 平台测评
urlname: 2019-07-01-cloud-services-for-jupyter-notebook
author: 章鱼猫先生
date: 2019-07-01
updated: "2021-06-30 09:38:08"
---

**作\*\*\*\*者：**[Kevin Markham](https://twitter.com/justmarkham)
\*\*编译：\*\*Steven Shen
**原文：**<https://www.dataschool.io/cloud-services-for-jupyter-notebook/>

![1_oj36TMqOkHmi6u3kCSsr7Q.png](https://shub.weiyan.tech/yuque/elog-cookbook-img/FmI-XQJskzKJrjXg9rD0pZPaF0g0.png)

有许多方法可以与其他人共享静态 Jupyter 笔记本，例如把它发布在 GitHub 上或通过 nbviewer 链接进行分享。 但是，如果接收人已经安装了 Jupyter Notebook 环境，那么他们只能通过笔记本文件进行交互。

但是，如果您想分享一个不需要安装任何东西的全交互式 Jupyter 笔记，该怎么办？ 或者，您只想要创建一个自己的 Jupyter 笔记但又不想在本地计算机上安装任何东西？

在这篇文章中，我将回顾六种可以用来在云端轻松运行 Jupyter 笔记的服务。所有这些服务都具有以下特征：

- 它们不需要在你的本地计算机上安装任何东西。
- 它们都是完全免费的（或者它们有自己的免费计划）。
- 它们都可以让你访问 Jupyter Notebook 环境（或类似 Jupyter 的环境）。
- 它们都持 Python 语言（并且大多数支持其他语言）。

由于所有的这些都是基于云的服务，如果您仅限于使用内部部署的数据，则它们都不适合您。

## 比较标准

以下是我对六种服务进行比较的标准：

- **支持的语言：**  此服务是否支持除 Python 以外的其他编程语言？
- **安装软件包：**  除了已安装的软件包，此服务是否允许您安装其他软件包（或特定版本的软件包）？
- **界面相似性：**  如果服务提供的是 "Jupyter-like" 界面（而不是原生的 Jupyter 界面），它与 Jupyter 的界面有多相似？ （这会使地已有的 Jupyter 用户更容易转换到该服务。）
- **键盘快捷键：**  此服务是否使用了与 Jupyter Notebook 相同的键盘快捷键？
- **缺少的功能：**  在 Jupyter Notebook 中可以执行的操作，在此服务不支持？
- **新增的功能：** Jupyter Notebook 中不支持的操作，此服务可以实现支持吗？
- **数据集易用性：**  此服务可以轻松地使用您自己的数据集吗？
- **网络访问：**  此服务是否允许您从 Notebook 中访问 Internet，以便在必要时可以从 URL 读取数据？
- **保证工作私密性：**  这项服务是否能允许保持你工作的私密性？
- **公开分�


a> ANY_VALUE()

SELECT item.item_id, ANY_VALUE(uses.tag) tag,
        COUNT(*) number_of_uses
  FROM item
  JOIN uses ON item.item_id, uses.item_id
 GROUP BY item.item_id

shows the rows in a table called item, the count of related rows, and one of the values in the related table called uses.

You can think of this ANY_VALUE() function<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> (opens new window) as a strange a kind of aggregate function. Instead of returning a count, sum, or maximum, it instructs the MySQL server to choose, arbitrarily, one value from the group in question. It's a way of working around Error 1055.

Be careful when using ANY_VALUE() in queries in production applications.

It really should be called SURPRISE_ME(). It returns the value of some row in the GROUP BY group. Which row it returns is indeterminate. That means it's entirely up to the MySQL server. Formally, it returns an unpredictable value.

The server doesn't choose a random value, it's worse than that. It returns the same value every time you run the query, until it doesn't. It can change, or not, when a table grows or shrinks, or when the server has more or less RAM, or when the server version changes, or when Mars is in retrograde (whatever that means), or for no reason at all.

You have been warned.

# Remarks

For a long time now, MySQL has contained a notorious nonstandard extension to GROUP BY, which allows oddball behavior in the name of efficiency. This extension has allowed countless developers around the world to use GROUP BY in production code without completely understanding what they were doing.

In particular, it's a bad idea to use SELECT * in a GROUP BY query, because a standard GROUP BY clause requires enumerating


n() {
        let prev_nums = &nums[(i - 25)..i];
        if !is_valid(prev_nums, nums[i]) {
            return nums[i];
        }
    }
    unreachable!();
}

fn solve_part2(nums: &[isize], target: isize) -> isize {
    let mut partial_sums = HashMap::new();
    let mut sum = 0;
    for i in 0..nums.len() {
        partial_sums.insert(sum, i);
        sum += nums[i];
        if let Some(&j) = partial_sums.get(&(sum - target)) {
            // Set of numbers we are after is index j through i, inclusive
            let target_set: Vec<isize> = nums[j..(i + 1)].to_vec();
            let min = target_set.iter().min().unwrap();
            let max = target_set.iter().max().unwrap();
            return min + max;
        }
    }
    unreachable!();
}

fn main() {
    let nums: Vec<isize> = file_to_vec("input/day09.txt")
        .iter()
        .map(|s| s.parse().unwrap())
        .collect();
    let ans_1 = solve_part1(&nums);
    let ans_2 = solve_part2(&nums, ans_1);
    println!("Part 1 Answer: {}", ans_1);
    println!("Part 2 Answer: {}", ans_2);
}
<filename>workspace/.cargo/vendored-sources/swiss-army-knife-0.0.22/src/strings/into_line_feed_terminated_byte_string/mod.rs
// This file is part of linux-support. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT. No part of linux-support, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2020 The developers of linux-support. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/linux-support/master/COPYRIGHT.

use super::*;

include!("integer_wrapper.rs");

include!("IntegerIntoLineFeedTerminatedByteString.rs");
include!("IntoLineFeedTerminatedByteString.rs");
include!("UnpaddedDecimalInteger.rs");
include!("UnpaddedLowerCaseHexadecimalInteger.rs");
include!("UnpaddedOctalInteger.rs");
include!("UnpaddedUpperCaseHexadecimalInteger.rs");
include!("ZeroPaddedLowerCaseHexadecimalInteger.rs");
include!("ZeroPaddedUpperCaseHexadecimalInteger.rs");
#[cfg(target_env = "sgx")]
mod sgx_app;

#[cfg(target_env = "sgx")]
fn main() -> std::io::Result<()> {
    let subscriber = tracing_subscriber::FmtSubscriber::builder()
        .with_max_level(tracing::Level::INFO)
        .finish();

    tracing::subscriber::set_global_default(subscriber).expect("setting default subscriber failed");
    let mut args = std::env::args();
    let command = args.next();
    if command.is_none() {
        tracing::error!("no enclave command provided");
        return Err(std::io::ErrorKind::Other.into());
    }
    let request = serde_json::from_str(&command.unwrap());
    if request.is_err() {
        tracing::error!("invalid enclave command provided");
        return Err(std::io::ErrorKind::Other.into());
    }
    let request = request.unwrap();
    let mcloud_key = args.next();
    let cloud_key = if let Some(k) = mcloud_key {
        let decoded_vec = subtle_encoding::hex::decode(k)
            .map_err(|_e


V2Client()
	th.AssertNoErr(t, err)

	// Create a random tag to ensure we only get networks created
	// by this test
	testtag := tools.RandomString("zzz-tag-", 8)

	// Create Networks
	network1 := createNetworkWithTags(
		t, client, []string{"a", "b", "c", testtag})
	defer networking.DeleteNetwork(t, client, network1.ID)

	network2 := createNetworkWithTags(
		t, client, []string{"b", "c", "d", testtag})
	defer networking.DeleteNetwork(t, client, network2.ID)

	// Tags - Networks that match all tags will be returned
	listOpts := networks.ListOpts{
		Tags: fmt.Sprintf("a,b,c,%s", testtag)}
	ids := listNetworkWithTagOpts(t, client, listOpts)
	th.AssertDeepEquals(t, []string{network1.ID}, ids)

	// TagsAny - Networks that match any tag will be returned
	listOpts = networks.ListOpts{
		SortKey: "id", SortDir: "asc",
		TagsAny: fmt.Sprintf("a,b,c,%s", testtag)}
	ids = listNetworkWithTagOpts(t, client, listOpts)
	expected_ids := []string{network1.ID, network2.ID}
	sort.Strings(expected_ids)
	th.AssertDeepEquals(t, expected_ids, ids)

	// NotTags - Networks that match all tags will be excluded
	listOpts = networks.ListOpts{Tags: testtag, NotTags: "a,b,c"}
	ids = listNetworkWithTagOpts(t, client, listOpts)
	th.AssertDeepEquals(t, []string{network2.ID}, ids)

	// NotTagsAny - Networks that match any tag will be excluded.
	listOpts = networks.ListOpts{Tags: testtag, NotTagsAny: "d"}
	ids = listNetworkWithTagOpts(t, client, listOpts)
	th.AssertDeepEquals(t, []string{network1.ID}, ids)
}
//go:build acceptance || networking || segments

package segments

import (
	"context"
	"testing"

	"github.com/gophercloud/gophercloud/v2/internal/acceptance/clients"
	networking "github.com/gophercloud/gophercloud/v2/internal/acceptance/openstack/networking/v2"
	"github.com/gophercloud/gophercloud/v2/internal/acceptance/tools"
	"github.com/gophercloud/gophercloud/v2/openstack/networking/v2/extensions/segments"
	th "github.com/gophercloud/gophercloud/v2/testhelper"
)

func TestSegmentCRUD(t *testing.T) {
	clients.RequireAdmin(t)

	client, err := clients.NewNetworkV2Client()
	th.AssertNoErr(t, err)

	// Skip these tests if we don't have the required extension
	networking.RequireNeutronExtension(t, client, "segment")

	network, err := networking.CreateNetwork(t, client)
	th.AssertNoErr(t, err)
	defer networking.DeleteNetwork(t, client, network.ID)

	segment, err := CreateSegment(t, client, network.ID)
	th.AssertNoErr(t, err)
	defer DeleteSegment(t, client, segment.ID)

	// Get
	segGet, err := segments.Get(context.TODO(), client, segment.ID).Extract()
	th.AssertNoErr(t, err)
	th.AssertEquals(t, segment.ID, segGet.ID)

	// Update
	newName := tools.RandomString("UPDATED-SEGMENT-", 8)
	newDesc := "updated description"
	updateOpts := segments.UpdateOpts{
		Name:        &newName,
		Description: &newDe


* Allocates Memory   | No
 * Thread-Safe        | Yes
 * Uses Atomics       | No
 * Lock-Free          | Yes
 *
 * \param[in] str string identifying a qos policy value.
 * \return the policy value represented by the string, or
 * \return `RMW_QOS_POLICY_*_UNKNOWN` if the string doesn't represent any value.
 */
RMW_PUBLIC
rmw_qos_durability_policy_t
rmw_qos_durability_policy_from_str(const char * str);

/// Return a enum value based on the provided string.
/**
 * See \ref rmw_qos_durability_policy_from_str() for more details.
 */
RMW_PUBLIC
rmw_qos_history_policy_t
rmw_qos_history_policy_from_str(const char * str);

/// Return a enum value based on the provided string.
/**
 * See \ref rmw_qos_durability_policy_from_str() for more details.
 */
RMW_PUBLIC
rmw_qos_liveliness_policy_t
rmw_qos_liveliness_policy_from_str(const char * str);

/// Return a enum value based on the provided string.
/**
 * See \ref rmw_qos_durability_policy_from_str() for more details.
 */
RMW_PUBLIC
rmw_qos_reliability_policy_t
rmw_qos_reliability_policy_from_str(const char * str);

#ifdef __cplusplus
}
#endif

#endif  // RMW__QOS_STRING_CONVERSIONS_H_


ization::load_t_from_binary(account_data_check, account_data);

  if (encrypted_secret_keys)
    account_data_check.decrypt_keys(key);

  const cryptonote::account_keys& keys = account_data_check.get_keys();
  r = r && hwdev.verify_keys(keys.m_view_secret_key,  keys.m_account_address.m_view_public_key);
  if(!no_spend_key)
    r = r && hwdev.verify_keys(keys.m_spend_secret_key, keys.m_account_address.m_spend_public_key);
  return r;
}

void wallet2::encrypt_keys(const crypto::chacha_key &key)
{
  boost::lock_guard<boost::mutex> lock(m_decrypt_keys_lock);
  if (--m_decrypt_keys_lockers) // another lock left ?
    return;
  m_account.encrypt_keys(key);
  m_account.decrypt_viewkey(key);
}

void wallet2::decrypt_keys(const crypto::chacha_key &key)
{
  boost::lock_guard<boost::mutex> lock(m_decrypt_keys_lock);
  if (m_decrypt_keys_lockers++) // already unlocked ?
    return;
  m_account.encrypt_viewkey(key);
  m_account.decrypt_keys(key);
}

void wallet2::encrypt_keys(const epee::wipeable_string &password)
{
  crypto::chacha_key key;
  crypto::generate_chacha_key(password.data(), password.size(), key, m_kdf_rounds);
  encrypt_keys(key);
}

void wallet2::decrypt_keys(const epee::wipeable_string &password)
{
  crypto::chacha_key key;
  crypto::generate_chacha_key(password.data(), password.size(), key, m_kdf_rounds);
  decrypt_keys(key);
}

void wallet2::setup_new_blockchain()
{
  cryptonote::block b;
  generate_genesis(b);
  m_blockchain.push_back(get_block_hash(b));
  m_last_block_reward = cryptonote::get_outs_money_amount(b.miner_tx);
  add_subaddress_account(tr("Primary account"));
}

void wallet2::create_keys_file(const std::string &wallet_, bool watch_only, const epee::wipeable_string &password, bool create_address_file)
{
  if (!wallet_.empty())
  {
    bool r = store_keys(m_keys_file, password, watch_only);
    THROW_WALLET_EXCEPTION_IF(!r, error::file_save_error, m_keys_file);

    if (create_address_file)
    {
      r = save_to_file(m_wallet_file + ".address.txt", m_account.get_public_address_str(m_nettype), true);
      if(!r) MERROR("String with address text not saved");
    }
  }
}

/*!
 * \brief determine the key storage for the specified wallet file
 * \param device_type     (OUT) wallet backend as enumerated in hw::device::device_type
 * \param keys_file_name  Keys file to verify password for
 * \param password        Password to verify
 * \return                true if password correct, else false
 *
 * for verification only - determines key storage hardware
 *
 */
bool wallet2::query_device(hw::device::device_type& device_type, const std::string& keys_file_name, const epee::wipeable_string& password, uint64_t kdf_rounds)
{
  rapidjson::Document json;
  wallet2::keys_file_data keys_file_data;
  std::string buf;
  bool r = load_from_file(keys_file_name, buf);
  THROW_WALLET_EXCEPTION_IF(!r, error::file_rea


/* Copyright Joyent, Inc. and other Node contributors. All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "uv.h"
#include "task.h"

#define REQ_COUNT 10000

static uv_timer_t timer;
static uv_tcp_t server;
static uv_tcp_t client;
static uv_tcp_t incoming;
static int connect_cb_called;
static int close_cb_called;
static int connection_cb_called;
static int write_callbacks;
static int write_cancelled_callbacks;
static int write_error_callbacks;

static uv_write_t write_requests[REQ_COUNT];

static void close_cb(uv_handle_t* handle) {
  close_cb_called++;
}

void timer_cb(uv_timer_t* handle) {
  uv_close((uv_handle_t*) &client, close_cb);
  uv_close((uv_handle_t*) &server, close_cb);
  uv_close((uv_handle_t*) &incoming, close_cb);
}

void write_cb(uv_write_t* req, int status) {
  if (status == 0)
    write_callbacks++;
  else if (status == UV_ECANCELED)
    write_cancelled_callbacks++;
  else
    write_error_callbacks++;
}

static void connect_cb(uv_connect_t* req, int status) {
  static char base[1024];
  int r;
  int i;
  uv_buf_t buf;

  ASSERT(status == 0);
  connect_cb_called++;

  buf = uv_buf_init(base, sizeof(base));

  for (i = 0; i < REQ_COUNT; i++) {
    r = uv_write(&write_requests[i],
                 req->handle,
                 &buf,
                 1,
                 write_cb);
    ASSERT(r == 0);
  }
}

static void connection_cb(uv_stream_t* tcp, int status) {
  ASSERT(status == 0);

  ASSERT(0 == uv_tcp_init(tcp->loop, &incoming));
  ASSERT(0 == uv_accept(tcp, (uv_stream_t*) &incoming));

  connection_cb_called++;
}

static void start_server(void) {
  struct sockaddr_in addr;

  ASSERT(0 == uv_ip4_addr("0.0.0.0", TEST_PORT, &addr));

  ASSERT(0 == uv_tcp_init(uv_default_loop(), &server));
  ASSERT(0 == uv_tcp_bind(&server, (struct sockaddr*) &addr, 0));
  ASSERT(0 == uv_listen((uv_stream_t*) &server, 128, connection_cb));
}

TEST_IMPL(tcp_write_queue_order) {
  uv_connect_t connect_req;
  struct sockaddr_in addr;

  start_server();

  ASSERT(0 == uv_ip4_addr("127.0.0.1", TEST_PORT, &addr));

  ASSERT(0 == uv_tcp_init(uv_default_loop(), &client));
  ASSERT(0 == uv_tcp_connect(&connect_req,
                             &client,
                             (struct sockaddr*) &addr,
                             connect_cb));

  ASSERT(0 == uv_timer_init(uv_default_loop(), &timer));
  ASSERT(0 == uv_timer_start(&timer, timer_cb, 100, 0));

  ASSERT(0 == uv_run(uv_default_loop(), UV_RUN_DEFAULT));

  ASSERT(connect_cb_called == 1);
  ASSERT(connection_cb_called == 1);
  ASSERT(write_callbacks > 0);
  ASSERT(write_cancelled_callbacks > 0);
  ASSERT(write_callbacks +
         write_error_callbacks +
         write_cancelled_callbacks == REQ_COUNT);
  ASSERT(close_cb_called == 3);

  MAKE_VALGRIND_HAPPY();
  return 0;
}


rand2.focused,
.select.brand2.focused,
.textarea.brand2.focused,
.keypad.brand2.focused,
.tag-input.brand2.focused,
.spinner.brand2.focused {
  -webkit-box-shadow: 0 0 0 3px rgba(0, 77, 111, 0.45);
          box-shadow: 0 0 0 3px rgba(0, 77, 111, 0.45);
}
/*html {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Helvetica Neue", sans-serif;
  font-size: 100%;
}
body {
  font-family: -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", "Roboto", "Ubuntu", "Helvetica Neue", sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  font-style: normal;
  font-weight: 400;
  color: #212121;
}*/
.text-ultralight {
  font-weight: 100 !important;
}
.text-light {
  font-weight: 200 !important;
}
.text-normal {
  font-weight: 400 !important;
}
.text-medium {
  font-weight: 500 !important;
}
.text-bold {
  font-weight: 700 !important;
}
.display4 {
  font-size: 7rem;
  font-weight: 200;
}
.display3 {
  font-size: 3.5rem;
  font-weight: 400;
}
.display2 {
  font-size: 3rem;
  font-weight: 400;
}
.display1 {
  font-size: 2.25rem;
  font-weight: 400;
}
.display1,
.display2,
.display3,
.display4 {
  margin-bottom: 1.25rem;
  line-height: 1.2;
}
.display4,
.display3,
.display2,
.display1 {
  color: #757575;
}
.leader,
.h1,
h1 {
  font-weight: 100;
  font-size: 3rem;
}
.sub-leader,
.h2,
h2 {
  font-weight: 400;
  font-size: 2rem;
}
.header,
.h3,
h3 {
  font-weight: 500;
  font-size: 1.75rem;
}
.sub-header,
.h4,
h4 {
  font-weight: 500;
  font-size: 1.5rem;
}
.alt-header,
.h5,
h5 {
  font-weight: 500;
  font-size: 1.25rem;
}
.sub-alt-header,
.h6,
h6 {
  font-weight: 500;
  font-size: 1.125rem;
}
.text-small {
  font-weight: 400;
  font-size: 0.75rem;
}
.text-secondary {
  font-weight: 400;
  font-size: 0.875rem;
}
.text-leader {
  font-size: 1.5rem;
  font-weight: 300;
}
.text-leader2 {
  font-size: 1.25rem;
  font-weight: 300;
}
.text-muted {
  color: #bebebe;
}
.leader,
.h1,
h1,
.sub-leader,
.h2,
h2,
.header,
.h3,
h3,
.sub-header,
.h4,
h4,
.alt-header,
.h5,
h5,
.sub-alt-header,
.h6,
h6 {
  color: inherit;
  margin-bottom: 0.5rem;
  line-height: 1.1;
}
.leader > small,
.h1 > small,
h1 > small,
.sub-leader > small,
.h2 > small,
h2 > small,
.header > small,
.h3 > small,
h3 > small,
.sub-header > small,
.h4 > small,
h4 > small,
.alt-header > small,
.h5 > small,
h5 > small,
.sub-alt-header > small,
.h6 > small,


public float dot(final Vector3f v) {
		return x * v.x + y * v.y + z * v.z;
	}

	public float dot(float x, float y, float z) {
		return this.x * x + this.y * y + this.z * z;
	}

	public final static float dot(Vector3f a, Vector3f b) {
		return a.x * b.x + a.y * b.y + a.z * b.z;
	}

	public Vector3f crsSelf(final Vector3f v) {
		return this.set(y * v.z - z * v.y, z * v.x - x * v.z, x * v.y - y * v.x);
	}

	public Vector3f crsSelf(float x, float y, float z) {
		return this.set(this.y * z - this.z * y, this.z * x - this.x * z, this.x * y - this.y * x);
	}

	public Vector3f mul4x3(float[] matrix) {
		return set(x * matrix[0] + y * matrix[3] + z * matrix[6] + matrix[9],
				x * matrix[1] + y * matrix[4] + z * matrix[7] + matrix[10],
				x * matrix[2] + y * matrix[5] + z * matrix[8] + matrix[11]);
	}

	public Vector3f mulSelf(final Matrix4 matrix) {
		final float l_mat[] = matrix.val;
		return this.set(x * l_mat[Matrix4.M00] + y * l_mat[Matrix4.M01] + z * l_mat[Matrix4.M02] + l_mat[Matrix4.M03],
				x * l_mat[Matrix4.M10] + y * l_mat[Matrix4.M11] + z * l_mat[Matrix4.M12] + l_mat[Matrix4.M13],
				x * l_mat[Matrix4.M20] + y * l_mat[Matrix4.M21] + z * l_mat[Matrix4.M22] + l_mat[Matrix4.M23]);
	}

	public Vector3f traMul(final Matrix4 matrix) {
		final float l_mat[] = matrix.val;
		return this.set(x * l_mat[Matrix4.M00] + y * l_mat[Matrix4.M10] + z * l_mat[Matrix4.M20] + l_mat[Matrix4.M30],
				x * l_mat[Matrix4.M01] + y * l_mat[Matrix4.M11] + z * l_mat[Matrix4.M21] + l_mat[Matrix4.M31],
				x * l_mat[Matrix4.M02] + y * l_mat[Matrix4.M12] + z * l_mat[Matrix4.M22] + l_mat[Matrix4.M32]);
	}

	public Vector3f mulSelf(Matrix3 matrix) {
		final float l_mat[] = matrix.val;
		return set(x * l_mat[Matrix3.M00] + y * l_mat[Matrix3.M01] + z * l_mat[Matrix3.M02],
				x * l_mat[Matrix3.M10] + y * l_mat[Matrix3.M11] + z * l_mat[Matrix3.M12],
				x * l_mat[Matrix3.M20] + y * l_mat[Matrix3.M21] + z * l_mat[Matrix3.M22]);
	}

	public Vector3f traMul(Matrix3 matrix) {
		final float l_mat[] = matrix.val;
		return set(x * l_mat[Matrix3.M00] + y * l_mat[Matrix3.M10] + z * l_mat[Matrix3.M20],
				x * l_mat[Matrix3.M01] + y * l_mat[Matrix3.M11] + z * l_mat[Matrix3.M21],
				x * l_mat[Matrix3.M02] + y * l_mat[Mat


  font-family: Georgia, Cambria, "Times New Roman", Times, serif;
}

blockquote {
  font-style: italic;
}

footer {
  font-size: 0.9625rem;
}

.lead {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  color: #868e96;
}

table,
.table {
  font-size: 0.9625rem;
}

.nav,
.breadcrumb,
.pagination {
  font-size: 0.9625rem;
}

.dropdown-menu {
  font-size: 0.9625rem;
}

.alert {
  font-size: 0.9625rem;
  color: #fff;
}
.alert,
.alert p {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
}
.alert a,
.alert .alert-link {
  font-weight: 400;
  color: #fff;
  text-decoration: underline;
}
.alert-primary {
  background-color: #4582ec;
}
.alert-secondary {
  background-color: #adb5bd;
}
.alert-success {
  background-color: #02b875;
}
.alert-info {
  background-color: #17a2b8;
}
.alert-warning {
  background-color: #f0ad4e;
}
.alert-danger {
  background-color: #d9534f;
}
.alert-light {
  background-color: #f8f9fa;
}
.alert-dark {
  background-color: #343a40;
}
.alert-light,
.alert-light a,
.alert-light .alert-link {
  color: #343a40;
}

.badge.bg-light {
  color: #343a40;
}

.list-group {
  font-size: 0.9625rem;
}@charset "UTF-8";
/*!
 * Bootswatch v5.3.8 (https://bootswatch.com)
 * Theme: lux
 * Copyright 2012-2025 Thomas Park
 * Licensed under MIT
 * Based on Bootstrap
*/
/*!
 * Bootstrap  v5.3.8 (https://getbootstrap.com/)
 * Copyright 2011-2025 The Bootstrap Authors
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
 */
@import url("https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@200;300;400;500;600;700&display=swap");
:root,
[data-bs-theme=light] {
  --bs-blue: #007bff;
  --bs-indigo: #6610f2;
  --bs-purple: #6f42c1;
  --bs-pink: #e83e8c;
  --bs-red: #d9534f;
  --bs-orange: #fd7e14;
  --bs-yellow: #f0ad4e;
  --bs-green: #4bbf73;
  --bs-teal: #20c997;
  --bs-cyan: #1f9bcf;
  --bs-black: #000;
  --bs-white: #fff;
  --bs-gray: #919aa1;
  --bs-gra


pesShouldBeReturned(settings);
  }

  @Then("^(\\d++) standard events should be returned$")
  public void numberOfEventsShouldBeReturned(
      final int numberOfEvents, final Map<String, String> settings) throws Throwable {
    super.eventsShouldBeReturned(numberOfEvents, settings);
  }

  @Override
  protected List<EventType> getAllowedEventTypes() {
    return allowed;
  }
}
// SPDX-FileCopyrightText: Copyright Contributors to the GXF project
//
// SPDX-License-Identifier: Apache-2.0

package org.opensmartgridplatform.cucumber.platform.smartmetering.glue.steps.ws.smartmetering.smartmeteringmanagement;

import static org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.addSetting;

import io.cucumber.java.en.Then;
import io.cucumber.java.en.When;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EventLogCategory;
import org.opensmartgridplatform.adapter.ws.schema.smartmetering.management.EventType;
import org.opensmartgridplatform.cucumber.platform.PlatformKeys;

public class FindAuxillaryEventsReads extends AbstractFindEventsReads {
  private static final List<EventType> allowed =
      Collections.unmodifiableList(
          Arrays.asList(
              EventType.AUXILIARY_EVENTLOG_CLEARED,
              EventType.MBUS_FW_UPGRADE_SUCCESSFUL_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_BLOCK_SIZE_NOT_SUPPORTED_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_IMAGE_SIZE_TOO_BIG_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_INVALID_BLOCK_NUMBER_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_DATA_RECEIVE_ERROR_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_IMAGE_NOT_COMPLETE_ERROR_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_INVALID_SECURITY_ERROR_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_INVALID_FIRMWARE_FOR_THIS_DEVICE_CHANNEL_1,
              EventType.MBUS_FW_UPGRADE_SUCCESSFUL_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_BLOCK_SIZE_NOT_SUPPORTED_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_IMAGE_SIZE_TOO_BIG_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_INVALID_BLOCK_NUMBER_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_DATA_RECEIVE_ERROR_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_IMAGE_NOT_COMPLETE_ERROR_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_INVALID_SECURITY_ERROR_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_INVALID_FIRMWARE_FOR_THIS_DEVICE_CHANNEL_2,
              EventType.MBUS_FW_UPGRADE_SUCCESSFUL_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_BLOCK_SIZE_NOT_SUPPORTED_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_IMAGE_SIZE_TOO_BIG_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_INVALID_BLOCK_NUMBER_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_DATA_RECEIVE_ERROR_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_IMAGE_NOT_COMPLETE_ERROR_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_INVALID_SECURITY_ERROR_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_INVALID_FIRMWARE_FOR_THIS_DEVICE_CHANNEL_3,
              EventType.MBUS_FW_UPGRADE_SUCCESSFUL_CHANNEL_4,
              EventType.MBUS_FW_UPGRADE_BLOCK_SIZE_NOT