(allowUpdate))
            } catch (e: Exception) {
                fileUploadHandler.cleanup(flowIdentifier)
                throw e
            }

            return ResponseEntity.ok().build()
        }

        // Not every chunk uploaded yet
        return ResponseEntity.status(HttpStatus.ACCEPTED).build()
    }

    override fun catalogExport(principal: Principal, catalogIdentifier: String): ResponseEntity<ByteArray?> {
        authUtils.isSuperAdmin(principal).ifFalse {
            return ResponseEntity.status(HttpStatus.FORBIDDEN)
                .build()
        }

        val exportedTables = catalogExportService.exportCatalog(catalogIdentifier)
        val mapper = jacksonObjectMapper()
        mapper.registerModule(JavaTimeModule())
        mapper.dateFormat = SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'")
        val file = mapper.writerWithDefaultPrettyPrinter().writeValueAsBytes(exportedTables)
        return ResponseEntity.ok()
            .header(CONTENT_DISPOSITION, "attachment;filename=catalogExport.json")
            .contentType(MediaType.APPLICATION_JSON)
            .body(file)
    }
}

data class CatalogStatistic(
    val lastDocModification: Date? = null,
    val countDocuments: Int = 0,
)
/**
 * ==================================================
 * Copyright (C) 2023-2025 wemove digital solutions GmbH
 * ==================================================
 * Licensed under the EUPL, Version 1.2 or – as soon they will be
 * approved by the European Commission - subsequent versions of the
 * EUPL (the "Licence");
 *
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * https://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */
package de.ingrid.igeserver.profiles

import org.springframework.context.annotation.ComponentScan
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.Profile

@Profile("ingrid-kommunal-st")
@Configuration
@ComponentScan(basePackages = ["de.ingrid.igeserver.profiles.ingrid_kommunal_st"])
class InGridKommunalSTConfig
/**
 * ==================================================
 * Copyright (C) 2024-2025 wemove digital solutions GmbH
 * ==================================================
 * Licensed under the EUPL, Version 1.2 or – as soon they will be
 * approved by the European Commission - subsequent versions of the
 * EUPL (the "Licence");
 *
 * You may not use this work except in compliance with the Licence.
 * You may obtain a copy of the Licence at:
 *
 * https://joinup.ec.europa.eu/software/page/eupl
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the Licence is distributed on an "AS IS" basis,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the Licence for the specific language governing permissions and
 * limitations under the Licence.
 */
package de.ingrid.igeserver.model

import com.fasterxml.jackson.databind.node.ObjectNode
import java.time.OffsetDateTime

data class DocumentWithMetadata(
    val document: ObjectNode,
    val metadata: DocMetadata,
)

data class DocMetadata(
    val hasChildren: Boolean,
    val parentId: Int?,
    val parentDocType: String?,
    // TODO: next two fields not really necessary, since they can be simply evaluated from doc
    val createdUserExists: Boolean,
    val modifiedUserExists: Boolean,
    val pendingDate: String?,
    val tags: List<String>,
    val responsibleUser: Int?,
    val metadataDate: String?,
    val hasWritePermission: Boolean,
    val hasOnlySubtreeWritePermission: Boolean,
    val wrapperId: Int,
    val cr


SG_ATOHAND)
	local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter2),tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil)
	if #g>0 then
		Duel.SendtoHand(g,nil,REASON_EFFECT)
		Duel.ConfirmCards(1-tp,g)
	end
end


d{5}|(?:2(?:657|9(?:54|66))|3(?:48[27]|7(?:55|77)|8(?:65|78)))[2-8]\d{5}|(?:2(?:284|3(?:02|23)|477|622|920)|3(?:4(?:46|89|92)|541))[2-7]\d{5}|(?:(?:11[1-8]|670)\d|2(?:2(?:0[45]|1[2-6]|3[3-6])|3(?:[06]4|7[45])|494|6(?:04|1[2-8]|[36][45]|4[3-6])|80[45]|9(?:[17][4-6]|[48][45]|9[3-6]))|3(?:364|4(?:1[2-8]|[25][4-6]|3[3-6]|84)|5(?:1[2-9]|[38][4-6])|6(?:2[45]|44)|7[069][45]|8(?:0[45]|1[2-7]|3[4-6]|5[3-6]|7[2-6]|8[3-68])))\d{6}|(?:2(?:2(?:62|81)|320|9(?:42|83))|3(?:329|4(?:62|7[16])|5(?:43|64)|7(?:18|5[17])))[2-6]\d{5}|2(?:2(?:21|4[23]|6[145]|7[1-4]|8[356]|9[267])|3(?:16|3[13-8]|43|5[346-8]|9[3-5])|6(?:2[46]|4[78]|5[1568])|9(?:03|2[1457-9]|3[1356]|4[08]|[56][23]|82))4\d{5}|(?:2(?:257|3(?:24|46|92)|9(?:01|23|64))|3(?:4(?:42|64)|5(?:25|37|4[47]|71)|7(?:35|72)|825))[3-6]\d{5}|(?:2(?:2(?:02|2[3467]|4[156]|5[45]|6[6-8]|91)|3(?:1[47]|25|[45][25]|96)|47[48]|625|932)|3(?:38[2578]|4(?:0[0-24-9]|3[78]|4[457]|58|6[035-9]|72|83|9[136-8])|5(?:2[124]|[368][23]|4[2689]|7[2-6])|7(?:16|2[15]|3[14]|4[13]|5[468]|7[3-5]|8[26])|8(?:2[67]|3[278]|4[3-5]|5[78]|6[1-378]|[78]7|94)))[4-6]\d{5}",
    voip: r"",
    tollFree: r"800\d{7,8}",
    premiumRate: r"60[04579]\d{7}",
    sharedCost: r"",
    personalNumber: r"",
    uan: r"810\d{7}",
    pager: r"",
    voiceMail: r"",
  ),
  IsoCode.AS: PhoneMetadataPatterns(
    nationalPrefixForParsing: r"([267]\d{6})$|1",
    nationalPrefixTransformRule: r"684$1",
    general: r"(?:[58]\d\d|684|900)\d{7}",
    mobile: r"684(?:2(?:48|5[2468]|7[26])|7(?:3[13]|70|82))\d{4}",
    fixedLine: r"6846(?:22|33|44|55|77|88|9[19])\d{4}",
    voip: r"",
    tollFree: r"8(?:00|33|44|55|66|77|88)[2-9]\d{6}",
    premiumRate: r"900[2-


_ONE, true);

    public static final Dop INSTANCE_OF =
        new Dop(Opcodes.INSTANCE_OF, Opcodes.INSTANCE_OF,
            Opcodes.NO_NEXT, Form22c.THE_ONE, true);

    public static final Dop ARRAY_LENGTH =
        new Dop(Opcodes.ARRAY_LENGTH, Opcodes.ARRAY_LENGTH,
            Opcodes.NO_NEXT, Form12x.THE_ONE, true);

    public static final Dop NEW_INSTANCE =
        new Dop(Opcodes.NEW_INSTANCE, Opcodes.NEW_INSTANCE,
            Opcodes.NO_NEXT, Form21c.THE_ONE, true);

    public static final Dop NEW_ARRAY =
        new Dop(Opcodes.NEW_ARRAY, Opcodes.NEW_ARRAY,
            Opcodes.NO_NEXT, Form22c.THE_ONE, true);

    public static final Dop FILLED_NEW_ARRAY =
        new Dop(Opcodes.FILLED_NEW_ARRAY, Opcodes.FILLED_NEW_ARRAY,
            Opcodes.FILLED_NEW_ARRAY_RANGE, Form35c.THE_ONE, false);

    public static final Dop FILLED_NEW_ARRAY_RANGE =
        new Dop(Opcodes.FILLED_NEW_ARRAY_RANGE, Opcodes.FILLED_NEW_ARRAY,
            Opcodes.NO_NEXT, Form3rc.THE_ONE, false);

    public static final Dop FILL_ARRAY_DATA =
        new Dop(Opcodes.FILL_ARRAY_DATA, Opcodes.FILL_ARRAY_DATA,
            Opcodes.NO_NEXT, Form31t.THE_ONE, false);

    public static final Dop THROW =
        new Dop(Opcodes.THROW, Opcodes.THROW,
            Opcodes.NO_NEXT, Form11x.THE_ONE, false);

    public static final Dop GOTO =
        new Dop(Opcodes.GOTO, Opcodes.GOTO,
            Opcodes.GOTO_16, Form10t.THE_ONE, false);

    public static final Dop GOTO_16 =
        new Dop(Opcodes.GOTO_16, Opcodes.GOTO,
            Opcodes.GOTO_32, Form20t.THE_ONE, false);

    public static final Dop GOTO_32 =
        new Dop(Opcodes.GOTO_32, Opcodes.GOTO,
            Opcodes.NO_NEXT, Form30t.THE_ONE, false);

    public static final Dop PACKED_SWITCH =
        new Dop(Opcodes.PACKED_SWITCH, Opcodes.PACKED_SWITCH,
            Opcodes.NO_NEXT, Form31t.THE_ONE, false);

    public static final Dop SPARSE_SWITCH =
        new Dop(Opcodes.SPARSE_SWITCH, Opcodes.SPARSE_SWITCH,
            Opcodes.NO_NEXT, Form31t.THE_ONE, false);

    public static final Dop CMPL_FLOAT =
        new Dop(Opcodes.CMPL_FLOAT, Opcodes.CMPL_FLOAT,
            Opcodes.NO_NEXT, Form23x.THE_ONE, true);

    public static final Dop CMPG_FLOAT =
        new Dop(Opcodes.CMPG_FLOAT, Opcodes.CMPG_FLOAT,
            Opcodes.NO_NEXT, Form23x.THE_ONE, true);

    public static final Dop CMPL_DOUBLE =
        new Dop(Opcodes.CMPL_DOUBLE, Opcodes.CMPL_DOUBLE,
            Opcodes.NO_NEXT, Form23x.THE_ONE, true);

    public static final Dop CMPG_DOUBLE =
        new Dop(Opcodes.CMPG_DOUBLE, Opcodes.CMPG_DOUBLE,
            Opco


OCK,
    ITEM_SILVER_POWDER,
    ITEM_AMULET_COIN,
    ITEM_CLEANSE_TAG,
    ITEM_SOUL_DEW,
    ITEM_DEEP_SEA_TOOTH,
    ITEM_DEEP_SEA_SCALE,
    ITEM_SMOKE_BALL,
    ITEM_EVERSTONE,
    ITEM_FOCUS_BAND,
    ITEM_LUCKY_EGG,
    ITEM_SCOPE_LENS,
    ITEM_METAL_COAT,
    ITEM_LEFTOVERS,
    ITEM_DRAGON_SCALE,
    ITEM_LIGHT_BALL,
    ITEM_SOFT_SAND,
    ITEM_HARD_STONE,
    ITEM_MIRACLE_SEED,
    ITEM_BLACK_GLASSES,
    ITEM_BLACK_BELT,
    ITEM_MAGNET,
    ITEM_MYSTIC_WATER,
    ITEM_SHARP_BEAK,
    ITEM_POISON_BARB,
    ITEM_NEVER_MELT_ICE,
    ITEM_SPELL_TAG,
    ITEM_TWISTED_SPOON,
    ITEM_CHARCOAL,
    ITEM_DRAGON_FANG,
    ITEM_SILK_SCARF,
    ITEM_UP_GRADE,
    ITEM_SHELL_BELL,
    ITEM_SEA_INCENSE,
    ITEM_LAX_INCENSE,
    ITEM_LUCKY_PUNCH,
    ITEM_METAL_POWDER,
    ITEM_THICK_CLUB,
    ITEM_STICK,
    ITEM_FAIRY_GEM,
    // Contest held items,
    ITEM_RED_SCARF,
    ITEM_BLUE_SCARF,
    ITEM_PINK_SCARF,
    ITEM_GREEN_SCARF,
    ITEM_YELLOW_SCARF,
};

u16 RandomItemId(u16 itemId)
{
    u8 mapId = NuzlockeGetCurrentRegionMapSectionId();
    if (ItemId_GetPocket(itemId) == POCKET_TM_HM)
    {
        if (itemId != ITEM_HM01
            && itemId != ITEM_HM02
            && itemId != ITEM_HM03
            && itemId != ITEM_HM04
            && itemId != ITEM_HM05
            && itemId != ITEM_HM06
            && itemId != ITEM_HM07
            && itemId != ITEM_HM08)
        {
            u8 i;
            itemId = ITEM_TM01 + RandomSeededModulo(itemId, 50);
            for (i = 0; i < 255; i++)
            {
                if (!CheckBagHasItem(itemId, 1))
                    break;
                itemId = ITEM_TM01 + RandomSeededModulo(itemId, 50);
            }
        }
    }
    else if (ItemId_GetPocket(itemId) != POCKET_KEY_ITEMS)
        itemId = sRandomValidItems[RandomSeededModulo(itemId + mapId, RANDOM_ITEM_COUNT)];

    return itemId;
}

u16 RandomItem(void)
{
    u16 itemId = RandomItemId(gSpecialVar_0x8000);

    gSpecialVar_0x8000 = itemId;
    return itemId;
}

u16 RandomItemHidden(void) //same as normal hidden item, but differen special var
{
    u16 itemId = RandomItemId(gSpecialVar_0x8005);

    gSpecialVar_0x8005 = itemId;
    return itemId;
}


4
.L2576:
	str	r3, [sp]
	mov	r2, r7
	mov	r3, r0
	ldr	r1, .L2829+92
	mov	r0, #1
	bl	dprint_vfmw
	mvn	r0, #0
	b	.L2766
.L2533:
	mov	r2, r9
	ldr	r1, .L2829+96
	mov	r0, #1
	bl	dprint_vfmw
	mvn	r0, #0
	b	.L2766
.L2811:
	mov	r1, #1
	ldr	r0, [r4, #2308]
	bl	BsGet
	strb	r0, [r10, #1030]
	b	.L2540
.L2810:
	mov	r1, #1
	ldr	r0, [r4, #2308]
	bl	BsGet
	uxtb	r0, r0
	strb	r0, [r10, #1028]
	cmp	r0, #0
	beq	.L2636
	mov	r1, #1
	ldr	r0, [r4, #2308]
	bl	BsGet
	uxtb	r0, r0
	strb	r0, [r10, #1029]
	cmp	r0, #0
	bne	.L2633
	ldr	r1, .L2829+100
	ldr	r0, [r4, #2308]
	bl	HEVC_se_v
	add	r3, r0, #6
	mov	r2, r0
	cmp	r3, #12
	str	r0, [r10, #1148]
	bhi	.L2826
.L2637:
	ldr	r1, .L2829+104
	ldr	r0, [r4, #2308]
	bl	HEVC_se_v
	add	r3, r0, #6
	mov	r2, r0
	cmp	r3, #12
	str	r0, [r10, #1152]
	bls	.L2775
	ldr	r1, .L2829+108
	mov	r0, #1
	bl	dprint_vfmw
	ldr	r3, [r5, #80]
	ldrb	r0, [r10, #1029]	@ zero_extendqisi2
	str	r3, [r10, #1152]
	b	.L2633
.L2582:
	ldr	r2, [fp, #-108]
	cmp	r3, #0
	ldr	r5, [fp, #-112]
	add	r2, r2, #14400
	ldr	r6, [fp, #-76]
	ldr	r4, [fp, #-52]
	add	r2, r2, #17
	ldr	r10, [fp, #-64]
	beq	.L2584
	add	r2, r2, r3
	add	lr, r4, #55552
	add	lr, lr, #108
	mov	r7, #0
	add	r2, r4, r2, lsl #2
	ldr	r8, [fp, #-104]
	ldr	ip, [fp, #-116]
	ldr	r9, [fp, #-100]
	str	r4, [fp, #-48]
	b	.L2587
.L2828:
	ldr	r0, [r10, #1064]
	ldr	r4, [lr]
	rsb	r1, r9, r0
	add	r1, r1, r4
	ldr	r4, [r2, #-1948]


from fastapi import FastAPI, HTTPException, Header,Query, Depends, Body
from fastapi.middleware.cors import CORSMiddleware
from typing import Dict, List
from schemas import UserInRequest, Token, Question
from chatgpt_manager import user_chatgpt_session_manager
from auth import (
    authenticate_user,
    create_access_token,
    get_current_user,
    HTTPException,
)

app = FastAPI()
origins = ["*"]
app.add_middleware(
    CORSMiddleware,
    allow_origins=origins,
    allow_methods=["GET", "POST", "PUT", "DELETE"],
    allow_headers=["*"],
)

@app.post("/token", response_model=Token)
async def login_for_access_token(input: UserInRequest):
    user = await authenticate_user(input.username, input.password)
    if not user:
        credentials_exception = HTTPException(
        status_code=401,
        detail="Could not validate credentials",
        headers={"WWW-Authenticate": "Bearer"},
    )
        raise credentials_exception

    access_token = create_access_token(data={"sub": user["username"]})
    return {"access_token": access_token, "token_type": "bearer"}

@app.get("/create_chatgpt_session")
async def create_chatgpt_session(current_user: dict = Depends(get_current_user)):
    existed_session=user_chatgpt_session_manager.get_session(str(current_user.get('_id')))
    if existed_session:
        return {"msg":"chatgpt session created before"}
    user_id = str(current_user.get('_id'))
    user_chatgpt_session_manager.create_session(user_id)
    return {"msg":"chatgpt session created"}

@app.post("/chat/")
async def chat(current_user: dict = Depends(get_current_user), input: Question=Body()):
    if input.question==None or input.question=="":
        return "enter a message"
    user_id = str(current_user.get('_id'))
    chatgpt = user_chatgpt_session_manager.get_session(user_id)
    if chatgpt:
        try:
            chatgpt.send_prompt_to_chatgpt(input.question)
            answer = chatgpt.return_last_response()

            return {"answer":answer}
        except:
            chatgpt = user_chatgpt_session_manager.get_session(user_id)
            chatgpt.quit()
            user_chatgpt_session_manager.delete_session(user_id)
            return {"msg":"create another gpt session"}
    else:
        return {"answer":"you dont have any chatgpt session ."}

@app.post("/quit/")
async def quit(current_user: dict = Depends(get_current_user)):
    user_id = str(current_user.get('_id'))
    try:
        chatgpt = user_chatgpt_session_manager.get_session(user_id)
        chatgpt.quit()
        return {"msg":"chatgpt session quited"}
    except:
        return {"msg":"you dont have any chatgpt session ."}


// Copyright 2016 Emilie Gillet.
//
// Author: Emilie Gillet (emilie.o.gillet@gmail.com)
//
// 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.
//
// See http://creativecommons.org/licenses/MIT/ for more information.
//
// -----------------------------------------------------------------------------
//
// Filtered random pulses.

#ifndef PLAITS_DSP_ENGINE_PARTICLE_ENGINE_H_
#define PLAITS_DSP_ENGINE_PARTICLE_ENGINE_H_

#include "plaits/dsp/engine/engine.h"
#include "plaits/dsp/fx/diffuser.h"
#include "plaits/dsp/noise/particle.h"

namespace plaits {

const int kNumParticles = 6;

class ParticleEngine : public Engine {
 public:
  ParticleEngine() { }
  ~ParticleEngine() { }

  virtual void Init(stmlib::BufferAllocator* allocator);
  virtual void Reset();
  virtual void Render(const EngineParameters& parameters,
      double* out,
      double* aux,
      size_t size,
      bool* already_enveloped);

 private:
  Particle particle_[kNumParticles];
  Diffuser diffuser_;
  stmlib::Svf post_filter_;

  DISALLOW_COPY_AND_ASSIGN(ParticleEngine);
};

}  // namespace plaits

#endif  // PLAITS_DSP_ENGINE_PARTICLE_ENGINE_H_


r:before { content: $fa-var-header; }
.#{$fa-css-prefix}-paragraph:before { content: $fa-var-paragraph; }
.#{$fa-css-prefix}-sliders:before { content: $fa-var-sliders; }
.#{$fa-css-prefix}-share-alt:before { content: $fa-var-share-alt; }
.#{$fa-css-prefix}-share-alt-square:before { content: $fa-var-share-alt-square; }
.#{$fa-css-prefix}-bomb:before { content: $fa-var-bomb; }
@import url(https://fonts.googleapis.com/css?family=Lato:400,700,400italic,700italic);
/**
 * Beige theme for reveal.js.
 *
 * Copyright (C) 2011-2012 Hakim El Hattab, http://hakim.se
 */
@font-face {
  font-family: 'League Gothic';
  src: url("../../lib/font/league_gothic-webfont.eot");
  src: url("../../lib/font/league_gothic-webfont.eot?#iefix") format("embedded-opentype"), url("../../lib/font/league_gothic-webfont.woff") format("woff"), url("../../lib/font/league_gothic-webfont.ttf") format("truetype"), url("../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular") format("svg");
  font-weight: normal;
  font-style: normal; }

/*********************************************
 * GLOBAL STYLES
 *********************************************/
body {
  background: #f7f2d3;
  background: -moz-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
  background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%, white), color-stop(100%, #f7f2d3));
  background: -webkit-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
  background: -o-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
  background: -ms-radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
  background: radial-gradient(center, circle cover, white 0%, #f7f2d3 100%);
  background-color: #f7f3de; }

.reveal {
  font-family: "Lato", sans-serif;
  font-size: 36px;
  font-weight: normal;
  letter-spacing: -0.02em;
  color: #333333; }

::selection {
  color: white;
  background: rgba(79, 64, 28, 0.99);
  text-shadow: none; }

/*********************************************
 * HEADERS
 *********************************************/
.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal h5,
.reveal h6 {
  margin: 0 0 20px 0;
  color: #333333;
  font-family: "League Gothic", Impact, sans-serif;
  line-height: 0.9em;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: none; }

.reveal h1 {
  text-shadow: 0 1px 0 #cccccc, 0 2px 0 #c9c9c9, 0 3px 0 #bbbbbb, 0 4px 0 #b9b9b9, 0 5px 0 #aaaaaa, 0 6px 1px rgba(0, 0, 0, 0.1), 0 0 5px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.3), 0 3px 5px


negative)}.cm-s-inner .cm-positive{color:var(--cm-positive)}.cm-s-inner :is(.cm-meta,.cm-qualifier){color:var(--cm-meta)}.cm-s-inner .cm-builtin{color:var(--cm-bulidin)}.cm-s-inner .cm-bracket{color:var(--cm-bracket)}.cm-s-inner .cm-atom,.cm-s-inner.cm-atom{color:var(--cm-atom)}.cm-s-inner .cm-number{color:var(--cm-number)}#write .md-fences{border-radius:var(--c-br-b);width:100%;margin:.5em 0 0;padding:0}#write :is(hr,.md-hr)+ul,#write :is(hr,.md-hr)+ol{text-align:center;margin-top:0;padding-left:0}#write :is(hr,.md-hr)+ul>li,#write :is(hr,.md-hr)+ol>li{text-align:left;box-shadow:0 0 0 2px var(--std-code-sd)inset;border-radius:var(--c-br-b);background-color:var(--d-bc);margin-top:1em;margin-bottom:0;padding-bottom:10px;padding-left:10px;padding-right:10px;list-style:none}#write :is(hr,.md-hr)+ul>li>p:first-of-type,#write :is(hr,.md-hr)+ol>li>p:first-of-type{font:var(--v-fw-bd)1em var(--v-fm-bd);color:var(--d-fc);background:var(--std-code-sd);border-radius:var(--v-r-t)var(--v-r-t-xc)0 0;text-align:center;width:auto;margin-top:0;margin-left:-10px;margin-right:-10px;padding:5px}#write :is(hr,.md-hr)+ul>li>p:first-of-type .md-link .md-url{color:var(--a-c)}content>#write .md-hr+ul:before,content>#write .md-hr+ol:before{background:linear-gradient(90deg,transparent,transparent 5%,var(--d-bc)15%,var(--d-bc)85%,transparent 95%,transparent);color:var(--d-fc-a);font:condensed italic 12px/1 var(--v-fm-tag);text-transform:uppercase;text-align:center;white-space:pre;opacity:1;pointer-events:none;width:auto;margin-left:0;padding:0 10px;position:absolute;left:0;right:0}content>#write .md-hr+:is(ul,ol):before{content:"⬛ ⬛  2 Columns of List / 双栏列表  ⬛ ⬛";margin-top:-1.8em;line-height:2em}content>#write .md-hr+.md-hr+:is(ul,ol):before{content:"⬛ ⬛ ⬛  3 Columns of List / 三栏列表  ⬛ ⬛ ⬛";margin-top:-1.6em;line-height:2em}content>#write .md-hr+.md-hr+.md-hr+:is(ul,ol):before{content:"⬛ ⬛ ⬛ ⬛  4 Columns of List / 四栏列表  ⬛ ⬛ ⬛ ⬛ "


/** @file useries.h
 *
 *  Interface to class for extended truncated univariate power series. */

/*
 *  Copyright (C) 2016  Ralf Stephan <ralf@ark.in-berlin.de>
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 */

#ifndef __PYNAC_USERIES_H__
#define __PYNAC_USERIES_H__

#include "pseries.h"
#include "expairseq.h"

namespace GiNaC {

bool useries_can_handle(const ex& the_ex, const symbol& s);
ex useries(const ex& the_ex, const symbol& s, int order, unsigned options = 0);

} // namespace GiNaC

#endif // ndef __PYNAC_USERIES_H__


  final number = alpha.codeUnitAt(0) - ('a'.codeUnitAt(0) - 1);
    if (number >= 10) return 0.0;
    return number / 10.0;
  }
}
import 'package:flutter_discord_rpc_fork/flutter_discord_rpc.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:mangayomi/models/chapter.dart';
import 'package:mangayomi/models/manga.dart';
import 'package:mangayomi/modules/more/providers/incognito_mode_state_provider.dart';
import 'package:mangayomi/modules/more/settings/general/providers/general_state_provider.dart';

class DiscordRPC {
  /// Id of the Discord Application
  final String applicationId;

  /// Whether it should reconnect to the discord client
  final bool autoRetry;

  /// Seconds between each attempt to reconnect
  final int retryDelayInSeconds;

  /// Start timestamp in millis
  final int startAt = DateTime.timestamp().millisecondsSinceEpoch;

  /// Temp var
  late bool rpcShowReadingWatchingProgress;

  /// Instance of the current RPC activity
  final RpcActivity activity = RpcActivity(
    assets: const RPCAssets(largeImage: "app-icon", largeText: "Mangayomi"),
    buttons: [
      const RPCButton(
        label: "Get Mangayomi",
        url: "https://github.com/kodjodevf/mangayomi",
      ),
      const RPCButton(
        label: "Join us",
        url: "https://discord.com/invite/EjfBuYahsP",
      ),
    ],
    details: "Idle",
    state: "-----",
    timestamps: RPCTimestamps(
      start: DateTime.timestamp().millisecondsSinceEpoch,
    ),
    activityType: ActivityType.watching,
  );

  DiscordRPC({
    required this.applicationId,
    this.autoRetry = true,
    this.retryDelayInSeconds = 10,
  });

  Future<void> initialize() async {
    await FlutterDiscordRPC.initialize(applicationId);
  }

  Future<void> connect(WidgetRef ref) async {
    final enableDiscordRpc = ref.read(enableDiscordRpcStateProvider);
    final incognitoMode = ref.read(incognitoModeStateProvider);
    final hideDiscordRpcInIncognito = ref.read(
      hideDiscordRpcInIncognitoStateProvider,
    );
    rpcShowReadingWatchingProgress = ref.read(
      rpcShowReadingWatchingProgressStateProvider,
    );
    if (enableDiscordRpc && (!hideDiscordRpcInIncognito || !incognitoMode)) {
      await FlutterDiscordRPC.instance.connect(
        autoRetry: autoRetry,
        retryDelay: Duration(seconds: retryDelayInSeconds),
      );
      await Future.delayed(Duration(seconds: 3));
      showIdleText();
    }
  }

  Future<void> showIdleText() async {
    await updateActivity(
      details: "Idle",
      state: "-----",
      assets: const RPCAssets(largeImage: "app-icon", largeText: "Mangayomi"),
    );
  }

  Future<void> showChapterDetails(WidgetRef ref, Chapter chapter) async {
    final status = chapter.manga.value!.itemType == ItemType.anime
        ? "Watching"
        : "Reading";
    final title = chapter.manga.value!.name;
    final chapterTitle = chapter.name;
    final imageUrl = chapter.manga.value!.imageUrl;
    final rpcShowTitle = ref.read(rpcShowTitleStateProvider);
    final rpcShowCoverImage = ref.read(rpcShowCoverImageStateProvider);
    await updateActivity(
      details: rpcShowTitle ? "$status $title" : "Idle",
      state:


## 构建嵌入式开发平台

嵌入式 linux 软件系统由 bootloader、kernel、root filesystem 构成，如下：

Bootloader(一次固化) + 内核(多次更新) + 根文件系统制作

资料拷贝：

资料存放路径如下：

6_平台\linux_resource\3.4.39_tools_

6_平台\3.4.39_tools

将上面路径下用到的文件拷到自己虚拟机中，存放在自建目录下：

例如（推荐）：/home/edu/share/linux_platform2.6.35.7/

注意： 以上资料一定要拷贝放入 linux 虚拟机目录下， 且目录有**一切权限**，一定**不能放到 /mnt/hgfs** 所映射的磁盘中

### 安装交叉编译器 arm-linux-gcc-4.3.2

进入虚拟机中找到你上步自建的目录中， 找到 arm-linux-gcc-4.3.2.bz2 文件：

```shell
cd /home/edu/share/linux_platform2.6.35.7/
```

查看自己的虚拟机是否安装交叉编译工具链：

```shell
echo $PATH
```

![image-20200702223501699](https://gitee.com/cpu_code/picture_bed/raw/master//20200702223501.png)

安装以下交叉编译工具： （4.3.2： 用于交叉编译各种镜像）

```shell
# 如果有这个目录就不用建了
mkdir –p /usr/local/arm

sudo tar jxvf arm-linux-gcc-4.3.2.bz2 –C /usr/local/arm

# 或 将 arm-linux-gcc-4.3.2.bz2 拷贝到/usr/local/arm 直接解压
cd /usr/local/arm
sudo tar jxvf arm-linux-gcc-4.3.2.bz2
```

其中 4.3.2 需要假加入环境变量

```shell
sudo vim ~/.bashrc
# 在最后加入下面这行
export PATH=/usr/local/arm/4.3.2/bin:$PATH

# 使环境变量设置立即生效
source ~/.bashrc
```

### 配置编译 u-boot

```shell
# 在虚拟机中解压 u-boot-2014.07.tar.bz2 文件
tar jxv 7.tar.bz2

# 进入解压后的文件目录中
cd u-boot-2014.07

# 编译前清除旧的配置文件
make distclean

# 生成新的配置文件
make x6818_config

# 编译生成 u-boot 可执行文件
make
# 在当前目录下会生成一个 ubootpak.bin 的文件
# 将 tools 目录下生成的 mkimage 文件拷贝到/bin 目录中， 后面用于制作 u-boot 所需格式的内核
# 这一步也可以不做， 主要用于生成 uImage
cp u-boot-2014.07/tools/mkimage /bin
```

### 配置编译内核

```shell
# 在虚拟�


终于抓住这只鸟进行治疗。（[via](https://static.cdsb.com/micropub/Articles/202204/5d2f9fe9cf8a9a3b9a45943767d30ab1.html)）

## 本周话题：晋升制度的问题

我最近读到[一篇文章](https://www.warp.dev/blog/problems-with-promotion-oriented-cultures)，作者是谷歌表格（Google Sheets）的前主管 Zach Lloyd，现在已经离职创业了。他说自己烦透了谷歌的晋升制度。

![](https://cdn.beekka.com/blogimg/asset/202205/bg2022052405.jpg)

我读完发现，谷歌的晋升制度跟国内大厂一模一样，员工行为也是晋升导向，产生的问题也是相似的，所以这篇文章读起来根本不像在说国外的事情。

![](https://cdn.beekka.com/blogimg/asset/202205/bg2022052210.webp)

现在正好是晋升季，很多人忙了一年，等的就是这一天。互联网大厂的财年三月底结束，然后主管提名晋升人选，四五月进行晋升答辩。只要通过了，你的职级就会上调，工资、期权、职务、地位都会随之增加。<ins>如果你连续好几年没有获得晋升，就是一个危险的信号</ins>，表明公司并不肯定你这几年的工作。

所以毫不奇怪，**大厂员工的行为都是晋升导向**。做任何事情之前，都会首先考虑是否有利于晋升。即使你真的非常关心其他事情，也不得不权衡它们对晋升的影响。

![](https://cdn.beekka.com/blogimg/asset/202205/bg2022052211.webp)

Zach Lloyd 说，这样的制度设计会导致4个严重的问题。我觉得分析得非常好，下面跟大家分享。

（1）晋升导向的最大问题是，**晋升标准与公司利益并不完全一致**，员工追求晋升和短期绩效，可能不会导致公司利益最大化，甚至会伤害公司的长期利益。

让我们看一个例子。假定有两个程序员，甲专注开发新产品新功能，乙专注维护老产品


            args->keep_duplicate_tiles = true;
        }
        else if(!strcmp(argv[i], "-sprite_no_optimize"))
        {
            args->keep_duplicate_tiles = true;
            args->keep_empty_sprite_tiles = true;
        }
        else if(!strcmp(argv[i], "-no_palettes"))
        {
            args->include_palettes = false;
        }
        else if(!strcmp(argv[i], "-source_tileset"))
        {
            // Warning / TODO:FIXME
            // includeTileData gets overridden back to TRUE if any tiles not present in the source tileset are found.
            // This makes understanding it's full export behavior much harder. Would be better to remove it and try to simplify logic.
            args->includeTileData = false;
            args->source_tilesets.push_back(argv[++i]);
        }
        else if(!strcmp(argv[i], "-entity_tileset"))
        {
            args->entity_tileset_filename = argv[++i];
            args->has_entity_tileset = true;
        }
        else if(!strcmp(argv[i], "-bin"))
        {
            args->output_binary = true;
        }
        else if(!strcmp(argv[i], "-transposed"))
        {
            args->output_transposed = true;
        }
        else if(!strcmp(argv[i], "-rel_paths")) {
            args->relative_paths = true;
        }
        else {
            printf("Warning: Argument \"%s\" not recognized\n", argv[i]);
        }
    }

    int slash_pos = (int)args->output_filename.find_last_of('/');
    if(slash_pos == -1)
        slash_pos = (int)args->output_filename.find_last_of('\\');
    int dot_pos = (int)args->output_filename.find_first_of('.', slash_pos == -1 ? 0 : slash_pos);

    args->output_filename_h = args->output_filename.substr(0, dot_pos) + ".h";
    args->output_filename_bin = args->output_filename.substr(0, dot_pos) + "_map.bin";
    args->output_filename_attributes_bin = args->output_filename.substr(0, dot_pos) + "_map_attributes.bin";
    args->output_filename_tiles_bin = args->output_filename.substr(0, dot_pos) + "_tiles.bin";
    args->output_filename_palettes_bin = args->output_filename.substr(0, dot_pos) + "_palettes.bin";
    args->data_name = args->output_filename.substr(slash_pos + 1, dot_pos - 1 - slash_pos);
    replace(args->data_name.begin(), args->data_name.end(), '-', '_');

    if ((args->area_specified == true) && (args->bank == BANK_NUM_UNSET)) {
        printf("Error: \"-area\" specified but bank number is missing. A bank number is required, use \"-b\"\n");
        return EXIT_FAILURE;
    }

    return EXIT_SUCCESS;
}

#ifndef interface_h
#define interface_h

typedef void* LinearGBM;
typedef void* LinearGBMDataMat;
typedef void* LinearGBMBoosterConfig;

extern "C" int CreateLinearGBM(LinearGBMBoosterConfig booster_config,
                               LinearGBMDataMat train_data,
                               LinearGBMDataMat test_data,
                               LinearGBM *out);

extern "C" int CreateLinearGBMBoosterConfig(LinearGBMBoosterConfig *out);

extern "C" int SetLinearGBMParams(LinearGBMBoosterConfig booster_config,
                                  const char* key, const char* value);

extern "C" int CreateLinearGBMDataMat(LinearGBMBoosterConfig booster_config, const char* na


pt 1
	 */
	public BU_Simplex1to4(Vector3f pt0, Vector3f pt1) {
		addVertex(pt0);
		addVertex(pt1);
	}

	/**
	 * Instantiates a new b U simplex 1 to 4.
	 *
	 * @param pt0 the pt 0
	 * @param pt1 the pt 1
	 * @param pt2 the pt 2
	 */
	public BU_Simplex1to4(Vector3f pt0, Vector3f pt1, Vector3f pt2) {
		addVertex(pt0);
		addVertex(pt1);
		addVertex(pt2);
	}

	/**
	 * Instantiates a new b U simplex 1 to 4.
	 *
	 * @param pt0 the pt 0
	 * @param pt1 the pt 1
	 * @param pt2 the pt 2
	 * @param pt3 the pt 3
	 */
	public BU_Simplex1to4(Vector3f pt0, Vector3f pt1, Vector3f pt2, Vector3f pt3) {
		addVertex(pt0);
		addVertex(pt1);
		addVertex(pt2);
		addVertex(pt3);
	}

	/**
	 * Reset.
	 */
	public void reset() {
		numVertices = 0;
	}

	@Override
	public BroadphaseNativeType getShapeType() {
		return BroadphaseNativeType.TETRAHEDRAL_SHAPE_PROXYTYPE;
	}

	/**
	 * Adds the vertex.
	 *
	 * @param pt the pt
	 */
	public void addVertex(Vector3f pt) {
		if (vertices[numVertices] == null) {
			vertices[numVertices] = new Vector3f();
		}

		vertices[numVertices++] = pt;

		recalcLocalAabb();
	}

	@Override
	public int getNumVertices() {
		return numVertices;
	}

	@Override
	public int getNumEdges() {
		// euler formula, F-E+V = 2, so E = F+V-2

		switch (numVertices) {
			case 0: return 0;
			case 1: return 0;
			case 2: return 1;
			case 3: return 3;
			case 4: return 6;
		}

		return 0;
	}

	@Override
	public void getEdge(int i, Vector3f pa, Vector3f pb) {
		switch (numVertices) {
			case 2:
				pa.set(vertices[0]);
				pb.set(vertices[1]);
				break;
			case 3:
				switch (i) {
					case 0:
						pa.set(vertices[0]);
						pb.set(vertices[1]);
						break;
					case 1:
						pa.set(vertices[1]);
						pb.set(vertices[2]);
						break;
					case 2:
						pa.set(vertices[2]);
						pb.set(vertices[0]);
						break;
				}
				break;
			case 4:
				switch (i) {
					case 0:
						pa.set(vertices[0]);
						pb.set(vertices[1]);
						break;
					case 1:
						pa.set(vertices[1]);
						pb.set(vertices[2]);
						break;
					case 2:
						pa.set(vertices[2]);
						pb.set(vertices[0]);
						break;
					case 3:
						pa.set(vertices[0]);
						pb.set(vertices[3]);
						break;
					case 4:
						pa.set(vertices[1]);
						pb.set(vertices[3]);
						break;
					case 5:
						pa.set(vertices[2]);
						pb.set(vertices[3]);
						break;
				}
		}
	}

	@Override
	public void getVertex(int i, Vector3f vtx) {
		vtx.set(vertices[i]);
	}

	@Override
	public int getNumPlanes() {
		switch (numVertices) {
			case 0: return 0;
			case 1: return 0;
			case 2: return 0;
			case 3: return 2;
			case 4: return 4;
		}
		return 0;
	}

	@Override
	public void getPlane(Vector3f planeNormal, Vector3f planeSupport, int i) {
	}

	/**
	 * Gets the index.
	 *
	 * @param i the i
	 * @return the index
	 */
	public int getIndex(int i) {
		return 0;
	}

	@Override
	public boolean isInside(Vector3f pt, float tolerance) {
		return false;
	}

	@Override
	public String getName() {
		return "BU


#canvas-container canvas").css("min-width", "");
							$("#canvas-container canvas").css("min-height", "");
							$("#canvas-container canvas").css("max-width", "");
							$("#canvas-container canvas").css("max-height", "");
							$("#mainPanel").css("max-height", "");

							/*
							$("#canvas-container").css("width", canvasStartWidth);
							$("#canvas-container").css("height", canvasStartHeight);
							*/
							$("#print-title").remove();
							$("#print-overlay").remove();
							$("#buttonHolder").show();
							$("p").css("font-size", "");
							$("h3").css("font-size", "");
							opinion.sizeChanged();
						}).save();
					}, 4000)
				});
	        $("#printBtn").hide();
			this.startQuestions();
			this.sizeChanged();
			x_pageLoaded();
		}

		this.showPrintButton = function (force) {
			$("#printBtn")[printAvailable && force !== false && x_currentPageXML.getAttribute('disableprinting') != 'true' && x_currentPageXML.getAttribute("diagram") !== "true" ? 'show' : 'hide']();
		}

		this.resetGraph = function () {
			// Throw away iframe
			$("#mainPanel fieldset iframe").remove();
			// Reset feedbak and diagram

			$("#feedback").remove();
			$("#canvas-container").hide();

			$("#mainPanel fieldset").prepend(
					"

\n"
			);
		}
	};

	opinion.init();

</script>

				<fieldset class="noStyle">

					<canvas id="diagram"></canvas>

							<button id="printBtn"></button>
							<button id="resetBtn"></button>
							<button id="backBtn"></button>
							<button id="checkBtn"></button>

				</fieldset>


ingFish(player);
                    return;
                }

                this.eightBitter.actions.animateExclamation(player);
                this.eightBitter.fishing.playerLandedFish(player, rod);
            },
            180,
        );
    }

    /**
     * Displays message and starts battle when player lands a fish.
     *
     * @param player   A Player who landed the fish.
     * @param rod   The rod that will be used to fish.
     */
    private playerLandedFish(player: IPlayer, rod: IRod): void {
        const currentMap: IMap = this.eightBitter.areaSpawner.getMap(player.mapName) as IMap;
        const currentArea: IArea = currentMap.areas[player.bordering[player.direction]!.areaName];
        const options: IWildPokemonSchema[] = currentArea.wildPokemon!.fishing![rod.type]!;
        const chosen: IWildPokemonSchema = this.eightBitter.equations.chooseRandomWildPokemon(options);
        const chosenPokemon: IPokemon = this.eightBitter.equations.createPokemon(chosen);

        this.eightBitter.timeHandler.addEvent(
            (): void => {
                this.eightBitter.menuGrapher.createMenu("GeneralText", {
                    deleteOnFinish: true,
                });
                this.eightBitter.menuGrapher.addMenuDialog(
                    "GeneralText",
                    [
                        "Oh! \n It's a bite!",
                    ],
                    (): void => {
                        console.log("Should start battle with", chosenPokemon);
                        // this.eightBitter.battles.startBattle({
                        //     battlers: {
                        //         opponent: {
                        //             name: chosenPokemon.title,
                        //             actors: [chosenPokemon],
                        //             category: "Wild",
                        //             sprite: chosenPokemon.title.join("") + "Front"
                        //         }
                        //     }
                        // });
                    });
                this.eightBitter.menuGrapher.setActiveMenu("GeneralText");
                this.eightBitter.graphics.classes.removeClass(player, "fishing");
                this.eightBitter.physics.setWidth(player, 8, true);
            },
            140,
        );
    }

    /**
     * Displays message when a Player does not land a fish.
     *
     * @param player   A Player who does not land a fish.
     */
    public playerFailedLandingFish(player: IPlayer): void {
        this.eightBitter.menuGrapher.deleteActiveMenu();
        this.eightBitter.menus.displayMessage("rekt");
        this.eightBitter.graphics.classes.removeClass(player, "fishing");
        this.eightBitter.physics.setWidth(player, 8, true);
    }

    /**
     * @todo Add functionality.
     */
    public canLandFish(): boolean {
        return true;
    }
}
export class Helper{

    // converts strings with CSV formattings to an array
    public static csvToArray(strData: string, strDelimiter: string) : any {

        strDelimiter = (strDelimiter || ",");
        let objPattern = new RegExp((
            // Delimiters.
        "(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
        // Quoted fields.
        "(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
        // Standard fields.
        "([^\"\\" + strDelimiter


width: 150, height: 84, aspectRatio: 1.78};
export const IMG_SIZE_XS: ImageSize = {width: 282, height: 158, aspectRatio: 1.78};
export const IMG_SIZE_S: ImageSize = {width: 393, height: 221, aspectRatio: 1.78};
export const IMG_SIZE_M: ImageSize = {width: 615, height: 345, aspectRatio: 1.78};
export const IMG_SIZE_L: ImageSize = {width: 756, height: 425, aspectRatio: 1.78};
export const IMG_SIZE_XL: ImageSize = {width: 756, height: 425, aspectRatio: 1.78};
export const IMG_SIZE_XXL: ImageSize = {width: 1287, height: 836, aspectRatio: 1.54};

/**
 * Maximum available scale factor in percent
 * Where 1.0 = 100%
 */

const sizes = [IMG_SIZE_XXS, IMG_SIZE_XS, IMG_SIZE_S, IMG_SIZE_M, IMG_SIZE_L, IMG_SIZE_XL];

//Finds the image size for given width by finding smallest width offset.
export const getImageSizeForWidth = (width: number) => {
  const MAX_AVAILABLE_SCALE_FACTOR = store.getState().config.imageMaxScaleFactor;

  return (
    sizes.find((s) => {
      const maxAvailableOffset = s.width - s.width * (1.0 - MAX_AVAILABLE_SCALE_FACTOR);
      return s.width + maxAvailableOffset >= width;
    }) || IMG_SIZE_L
  );
};

export const buildImageUri = (size: ImageSize, prefix?: string, postfix?: string) => {
  return BASE_IMG_URL + prefix + size.width + 'x' + size.height + postfix;
};

export const buildArticleImageUri = (size: ImageSize, url?: string) => {
  if (url) {
    const s = size.width + 'x' + size.height;
    return BASE_IMG_URL + url.replace('{WxH}', s);
  } else {
    return undefined;
  }
};
enum STORAGE_TYPE {
    localStorage = 'localStorage',
    sessionStorage = 'sessionStorage',
}

export default STORAGE_TYPE;

export function isValidStorageType(storageType: string): boolean {
    return Object.values(STORAGE_TYPE).includes(storageType);
}
import { Request, Response } from 'express';

import pool from '../database';

class GamesController {

    public async list (req: Request, res: Response): Promise<void> {
        pool.query('SELECT * FROM games', function (err, result, fields) {
            if (err)
                throw err;
            res.json(result);
        }); //crea un query donde sí existe un error, lo arroja, en caso de que no crea el json
    }

    public async getOne (req: Request, res: Response): Promise<any>{    //el método puede o no devolver un resultado
        const { id } = req.params;
        pool.query('SELECT * FROM games WHERE id = ?', [id], function (err, result, fields) {
            if (err)
                throw err;
            if (result.length > 0) {
                console.log(result[0]);
                return res.json(result[0]);
            }
            res.status(404).json({text: "The game doesn't exist"});
        }); //crea un query donde sí existe un error, lo arroja, en caso de que no crea el json
    }

    public async create (req: Request, res: Response):  Promise<void>{ //para definir el método como void, pues no regresa nada, más no es necesario
        pool.query('INSERT INTO games set ?', [req.body]);
        res.json({message: 'Game Saved'});
    }

    public async delete(req: Request, res: Response): Promise<void>{
        const {


{}}]
      table.insert(names,sample.ids[1])

      if opt.dumpLocalize then
          frameoutputs[{{nframe+1,nframe+25},{}}] = tmp
          for b=1,25 do
              framenames[nframe+b] = sample.ids[1]
              framenr[nframe+b] = b
          end
          nframe = nframe+25
      end

      print(('%s | Test2: [%d][%d/%d]    Time %.3f  Data %.3f'):format(
         opt.name, epoch, n, size, timer:time().real, dataTime))

      timer:reset()
      dataTimer:reset()
   end
   self.model:training()
   outputs = outputs[{{1,n2},{}}]
   gt = gt[{{1,n2},{}}]
   ap = charades_ap(outputs, gt)

   print((' * Finished epoch # %d     mAP: %7.3f\n'):format(
      epoch, torch.mean(ap)))

   print('dumping output to file')
   local out = assert(io.open(self.opt.save .. "/epoch" .. epoch .. ".txt", "w"))
   for i=1,outputs:size(1) do
      out:write(names[i] .. " " .. tensor2str(outputs[{{i},{}}]:view(-1)) .. "\n")
   end
   out:close()

   if opt.dumpLocalize then
       print('dumping localization output to file')
       frameoutputs = frameoutputs[{{1,nframe},{}}]
       local out = assert(io.open(self.opt.save .. "/localize" .. epoch .. ".txt", "w"))
       for i=1,frameoutputs:size(1) do
          f = framenr[i]
          vidid = framenames[i]
          out:write(vidid .. " " .. f .. " " .. tensor2str(frameoutputs[{{i},{}}]:view(-1)) .. "\n")
       end
       out:close()
   end

   return ap
end

function Trainer:computeScore(output, target, nCrops)
   if nCrops > 1 then
      -- Sum over crops
      output = output:view(output:size(1) / nCrops, nCrops, output:size(2))
         --:exp()
         :sum(2):squeeze(2)
   end

   -- Coputes the top1 and top5 error rate
   local batchSize = output:size(1)

   local _ , predictions = output:float():sort(2, true) -- descending

   -- Find which predictions match the target
   local correct = predictions:eq(
      target:long():view(batchSize, 1):expandAs(output))

   -- Top-1 score
   local top1 = 1.0 - (correct:narrow(2, 1, 1):sum() / batchSize)

   -- Top-5 score, if there are at least 5 classes
   local len = math.min(5, correct:size(2))
   local top5 = 1.0 - (correct:narrow(2, 1, len):sum() / batchSize)

   return top1 * 100, top5 * 100
end

function Trainer:copyInputs(sample)
   -- Copies the input to a CUDA tensor, if using 1 GPU, or to pinned memory,
   -- if using DataParallelTable. The target is always copied to a CUDA tensor
   self.input = self.input or (self.opt.nGPU == 1
      and torch.CudaTensor()
      or cutorch.createCudaHostTensor())
   self.target = self.target or torch.CudaTensor()

   self.input:resize(sample.input:size()):copy(sample.input)
   self.target:resize(sample.target:size()):copy(sample.target)
end

function Trainer:learningRateModifier(epoch)
   -- Training schedule
   local decay = 0
   if self.opt.dataset == 'charades' then
      decay = math.floor((


B 9E 00 01 */	addi r28, r30, 1
/* 802DE588 002DB388  3B 60 00 00 */	li r27, 0
/* 802DE58C 002DB38C  48 00 00 14 */	b lbl_802DE5A0
lbl_802DE590:
/* 802DE590 002DB390  38 6D C2 E0 */	addi r3, r13, lbl_805D93C0@sda21
/* 802DE594 002DB394  4C C6 31 82 */	crclr 6
/* 802DE598 002DB398  48 0F 67 51 */	bl _OSReport
/* 802DE59C 002DB39C  3B 7B 00 01 */	addi r27, r27, 1
lbl_802DE5A0:
/* 802DE5A0 002DB3A0  7C 1B E0 40 */	cmplw r27, r28
/* 802DE5A4 002DB3A4  41 80 FF EC */	blt lbl_802DE590
/* 802DE5A8 002DB3A8  C0 3D 00 20 */	lfs f1, 0x20(r29)
/* 802DE5AC 002DB3AC  38 7F 21 8C */	addi r3, r31, 0x218c
/* 802DE5B0 002DB3B0  C0 5D 00 24 */	lfs f2, 0x24(r29)
/* 802DE5B4 002DB3B4  C0 7D 00 28 */	lfs f3, 0x28(r29)
/* 802DE5B8 002DB3B8  C0 9D 00 2C */	lfs f4, 0x2c(r29)
/* 802DE5BC 002DB3BC  4C C6 32 42 */	crset 6
/* 802DE5C0 002DB3C0  48 0F 67 29 */	bl _OSReport
/* 802DE5C4 002DB3C4  3B 9E 00 01 */	addi r28, r30, 1
/* 802DE5C8 002DB3C8  3B 60 00 00 */	li r27, 0
/* 802DE5CC 002DB3CC  48 00 00 14 */	b lbl_802DE5E0
lbl_802DE5D0:
/* 802DE5D0 002DB3D0  38 6D C2 E0 */	addi r3, r13, lbl_805D93C0@sda21
/* 802DE5D4 002DB3D4  4C C6 31 82 */	crclr 6
/* 802DE5D8 002DB3D8  48 0F 67 11 */	bl _OSReport
/* 802DE5DC 002DB3DC  3B 7B 00 01 */	addi r27, r27, 1
lbl_802DE5E0:
/* 802DE5E0 002DB3E0  7C 1B E0 40 */	cmplw r27, r28
/* 802DE5E4 002DB3E4  41 80 FF EC */	blt lbl_802DE5D0
/* 802DE5E8 002DB3E8  38 9F 23 4C */	addi r4, r31, 0x234c
/* 802DE5EC 002DB3EC  38 6D C2 E8 */	addi r3, r13, lbl_805D93C8@sda21
/* 802DE5F0 002DB3F0  4C C6 31 82 */	crclr 6
/* 802DE5F4 002DB3F4  48 0F 66 F5 */	bl _OSReport
/* 802DE5F8 002DB3F8  3B 9E 00 01 */	addi r28, r30, 1
/* 802DE5FC 002DB3FC  3B 60 00 00 */	li r27, 0
/* 802DE600 002DB400  48 00 00 14 */	b lbl_802DE614
lbl_802DE604:
/* 802DE604 002DB404  38 6D C2 E0 */	addi r3, r13, lbl_805D93C0@sda21
/* 802DE608 002DB408  4C C6 31 82 */	crclr 6
/* 802DE60C 002


using System;
using System.Runtime.InteropServices;

namespace VulkanCore
{
    /// <summary>
    /// Opaque handle to a shader module object.
    /// <para>
    /// Shader modules contain shader code and one or more entry points. Shaders are selected from a
    /// shader module by specifying an entry point as part of pipeline creation. The stages of a
    /// pipeline can use shaders that come from different modules. The shader code defining a shader
    /// module must be in the SPIR-V format.
    /// </para>
    /// </summary>
    public unsafe class ShaderModule : DisposableHandle<long>
    {
        internal ShaderModule(Device parent, ref ShaderModuleCreateInfo createInfo, ref AllocationCallbacks? allocator)
        {
            Parent = parent;
            Allocator = allocator;

            fixed (byte* codePtr = createInfo.Code)
            {
                createInfo.ToNative(out ShaderModuleCreateInfo.Native nativeCreateInfo, codePtr);
                long handle;
                Result result = vkCreateShaderModule(Parent, &nativeCreateInfo, NativeAllocator, &handle);
                VulkanException.ThrowForInvalidResult(result);
                Handle = handle;
            }
        }

        /// <summary>
        /// Gets the owner of the resource.
        /// </summary>
        public Device Parent { get; }

        /// <summary>
        /// Destroy a shader module.
        /// </summary>
        public override void Dispose()
        {
            if (!Disposed) vkDestroyShaderModule(Parent, this, NativeAllocator);
            base.Dispose();
        }

        private delegate Result vkCreateShaderModuleDelegate(IntPtr device, ShaderModuleCreateInfo.Native* createInfo, AllocationCallbacks.Native* allocator, long* shaderModule);
        private static readonly vkCreateShaderModuleDelegate vkCreateShaderModule = VulkanLibrary.GetStaticProc<vkCrea


zeNumber(String number) {
    return number.replaceAll(RegExp(r'[^0-9]'), '');
  }

  static UICWagonCode fromNumber(String number) {
    var _number = sanitizeNumber(number);

    if (_number.length != 12) {
      throw const FormatException('uic_wagoncode_invalid_number');
    }

    var mainType = _getWagonType(_number);
    switch(mainType.name) {
      case UICWagonTypes.OUT_OF_ORDER: return UICWagonCode(_number);
      case UICWagonTypes.TRACTIVE:  return UICWagonCodeTractiveUnit(_number);
      case UICWagonTypes.PASSENGER_WAGON: return UICWagonCodePassengerWagon(_number);
      case UICWagonTypes.FREIGHT_WAGON: return UICWagonCodeFreightWagon(_number);
      case UICWagonTypes.SPECIAL: return UICWagonCodeSpecialVehicle(_number);
      default: return UICWagonCode(_number);
    }
  }

  static UICWagonType _getWagonType(String number) {
    if (number.startsWith('00')) {
      return UICWagonType('00', UICWagonTypes.OUT_OF_ORDER);
    }

    if (number.startsWith('99') && number[4] == '9') {
      return UICWagonType('99', UICWagonTypes.SPECIAL);
    }

    var code = number[0];
    late UICWagonTypes type;

    switch (code) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4': type = UICWagonTypes.FREIGHT_WAGON; break;
      case '5':
      case '6':
      case '7': type = UICWagonTypes.PASSENGER_WAGON; break;
      case '8': type = UICWagonTypes.FREIGHT_WAGON; break;
      case '9': type = UICWagonTypes.TRACTIVE; break;
      default: type = UICWagonTypes.INVALID; break;
    }

    return UICWagonType(code, type);
  }

  String _getCountryCode(String number) {
    return number.substring(2, 4);
  }

  String _getCountry(String? code) {
    UICCountryCode? country = UICCountryCodes.firstWhereOrNull((element) => element.numberCode == code);
    return country == null ?  'uic_countrycode_invalid' : country.name;
  }

  String _getRunningNumber(String number) {
    return number.substring(8, 11);
  }

  String _getCheckDigit(String number) {
    return number[11];
  }

  bool _hasValidUICWagonCodeCheckDigit(String number) {
    return (checkDigit == calculateUICWagonCodeCheckDigit(number));
  }

  static String calculateUICWagonCodeCheckDigit(String number) {
    var _number = sanitizeNumber(number);
    if (_number.length < 11) {
      throw const FormatException('uic_wagoncode_invalid_number');
    }
    _number = _number.substring(0, 11);

    int sum = 0;
    int product = 0;
    String digits = '';
    for (int i = 0; i < _number.length; i++) {
      if (i % 2 == 0) {
        product = 2 * int.parse(_number[i]);
      } else {
        product = 1 * int.parse(_number[i]);
      }
      digits = digits + product.toString();
    }
    for (int i = 0; i < digits.length; i++) {
      sum = sum + int.parse(digits[i]);
    }
    if (sum % 10 == 0) {
      return '0';
    } else {
      return (10 * (sum ~/ 10 + 1) - sum).toString();


ternal void notify(
    String key,
  );
  external void set(
    String key,
    JSAny? value,
  );
  @JS('setValues')
  external void _setValues(JSObject /*Object<null>*/ ? values);
  set values(JSObject /*Object<null>*/ ? values) => _setValues(values);
  external void unbind(
    String key,
  );
  external void unbindAll();
}
// Copyright 2015 Alexandre Ardhuin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

part of '../journey_sharing_map_view.dart';

@JS('google.maps.journeySharing.JourneySharingMapView')
extension type JourneySharingMapView._(JSObject _) implements JSObject {
  external JourneySharingMapView(
    JourneySharingMapViewOptions options,
  );
  external AutomaticViewportMode automaticViewportMode;
  external Element element;
  external bool enableTraffic;
  @JS('locationProviders')
  external JSArray<LocationProvider>? _locationProviders;
  List<LocationProvider>? get locationProviders => _locationProviders?.toDart;
  set locationProviders(List<LocationProvider>? value) =>
      _locationProviders = value?.toJS;
  external Map map;
  external MapOptions mapOptions;
  external LocationProvider? locationProvider;
  external MarkerSetup destinationMarkerSetup;
  external MarkerSetup originMarkerSetup;
  external MarkerSetup taskOutcomeMarkerSetup;
  external MarkerSetup unsuccessfulTaskMarkerSetup;
  external MarkerSetup vehicleMarkerSetup;
  external MarkerSetup waypointMarkerSetup;
  external PolylineSetup anticipatedRoutePolylineSetup;
  external PolylineSetup takenRoutePolylineSetup;
  external MarkerSetup pingMarkerSetup;
  external MarkerSetup successfulTaskMarkerSetup;
  @JS('destinationMarkers')
  external JSArray<Marker> _destinationMarkers;
  List<Marker> get destinationMarkers => _destinationMarkers.toDart;
  set destinationMarkers(List<Marker> value) =>
      _destinationMarkers = value.toJS;
  @JS('originMarkers')
  external JSArray<Marker> _originMarkers;
  List<Marker> get originMarkers => _originMarkers.toDart;
  set originMarkers(List<Marker> value) => _originMarkers = value.toJS;
  @JS('successfulTaskMarkers')
  external JSArray<Marker> _successfulTaskMarkers;
  List<Marker> get successfulTaskMarkers => _successfulTaskMarkers.toDart;
  set successfulTaskMarkers(List<Marker> value) =>
      _successfulTaskMarkers = value.toJS;
  @JS('taskOutcomeMarkers')
  external JSArray<Marker> _taskOutcomeMarkers;
  List<Marker> get taskOutcomeMarkers => _taskOutcomeMarkers.toDart;
  set taskOutcomeMarkers(List<Marker> value) =>
      _taskOutcomeMarkers = value.toJS;
  @JS('unsuccessfulTaskMarkers')
  external JSArray<Marker> _unsuccessfulTaskMarkers;
  List<Marker> get unsuccessfulTaskMarkers => _unsuccessfulTaskMarkers.toDart;
  set unsuccessfulTaskMarkers(List<Marker> value) =>
      _unsuccessfulTaskMarkers = value.toJS;
  @JS('vehicleMarkers')
  external JSArray<Marker> _vehicleMarkers;
  List<Marker> get vehicleMarkers => _vehicleMarkers.toDart;
  set vehicleMarkers(List<Marker> value) => _vehicle


ack=16(%rsp)
movq %r13,16(%rsp)

# qhasm:   c4_stack = c4
# asm 1: movq <c4=int64#12,>c4_stack=stack64#4
# asm 2: movq <c4=%r14,>c4_stack=24(%rsp)
movq %r14,24(%rsp)

# qhasm:   c5_stack = c5
# asm 1: movq <c5=int64#13,>c5_stack=stack64#5
# asm 2: movq <c5=%r15,>c5_stack=32(%rsp)
movq %r15,32(%rsp)

# qhasm:   c6_stack = c6
# asm 1: movq <c6=int64#14,>c6_stack=stack64#6
# asm 2: movq <c6=%rbx,>c6_stack=40(%rsp)
movq %rbx,40(%rsp)

# qhasm:   c7_stack = c7
# asm 1: movq <c7=int64#15,>c7_stack=stack64#7
# asm 2: movq <c7=%rbp,>c7_stack=48(%rsp)
movq %rbp,48(%rsp)

# qhasm:   rp_stack = rp
# asm 1: movq <rp=int64#1,>rp_stack=stack64#8
# asm 2: movq <rp=%rdi,>rp_stack=56(%rsp)
movq %rdi,56(%rsp)

# qhasm: yp = yp
# asm 1: mov  <yp=int64#3,>yp=int64#4
# asm 2: mov  <yp=%rdx,>yp=%rcx
mov  %rdx,%rcx

# qhasm:   mulrax = *(uint64 *)(xp + 24)
# asm 1: movq   24(<xp=int64#2),>mulrax=int64#3
# asm 2: movq   24(<xp=%rsi),>mulrax=%rdx
movq   24(%rsi),%rdx

# qhasm:   mulrax *= 19
# asm 1: imulq  $19,<mulrax=int64#3,>mulrax=int64#7
# asm 2: imulq  $19,<mulrax=%rdx,>mulrax=%rax
imulq  $19,%rdx,%rax

# qhasm:   mulx319_stack = mulrax
# asm 1: movq <mulrax=int64#7,>mulx319_stack=stack64#9
# asm 2: movq <mulrax=%rax,>mulx319_stack=64(%rsp)
movq %rax,64(%rsp)

# qhasm:   (uint128) mulrdx mulrax = mulrax * *(uint64 *)(yp + 16)
# asm 1: mulq  16(<yp=int64#4)
# asm 2: mulq  16(<yp=%rcx)
mulq  16(%rcx)

# qhasm:   r0 = mulrax
# asm 1: mov  <mulrax=int64#7,>r0=int64#5
# asm 2: mov  <mulrax=%rax,>r0=%r8
mov  %rax,%r8

# qhasm:   mulr01 = mulrdx
# asm 1: mov  <mulrdx=int64#3,>mulr01=int64#6
# asm 2: mov  <mulrdx=%rdx,>mulr01=%r9
mov  %rdx,%r9

# qhasm:   mulrax = *(uint64 *)(xp + 32)
# asm 1: movq   32(<xp=int64#2),>mulrax=int64#3
# asm 2: movq   32(<xp=%rsi),>mulrax=%rdx
movq   32(%rsi),%rdx

# qhasm:   mulrax *= 19
# asm 1: imulq  $19,<


を選択。\
      CPUインスタンスの場合は「ユーザーデータ」に当リポジトリ内の `scripts/userdata.yml` の内容をコピー。
   1. 右の概要欄を確認して「インスタンスを起動」をクリック。\
      インスタンス数はとりあえず1で試すのが良い。
1. 「インスタンスを起動中」のようなメッセージが表示される。\
   「すべてのインスタンスを表示」をクリック。
1. 起動中のインスタンス一覧が表示される。
   接続したいインスタンスを選んで「接続」をクリック。
1. 「RDPクライアント」タブを選ぶ。
   「リモートデスクトップファイルのダウンロード」をクリックしてrdpファイルを手に入れる。\
   「パスワードを取得」をクリック(インスタンス起動直後はもう少し待てという旨のエラーが出る)、上記で指定したキーペアを選択してアップロード、「パスワードを復号化」をクリック。\
   ログインパスワードが表示されるのでコピー。
1. ダウンロードしたrdpファイルをダブルクリックしてリモートデスクトップ起動、接続、パスワード入力。\
   (ちなみにrdpファイル右クリックから編集に入ると解像度指定などができる。)

- `userdata.xml` (や下記のNVIDIAドライバー個別インストール用の `semiauto_set_up.ps1`)ではpythonのインストール、パスの設定を行っていますが、何やらたまに"python"とPowershellで打ってもコマンドが認識されないことがあるみたいです。その場合は再起動してみてください。

#### NVIDIAドライバーなどのインストール

1. 当リポジトリ内の `scripts/semiauto_set_up.ps1` をデスクトップに転送する。
1. CUDAツールキットの内容に依存しない場合は引数なしでPowerShellから次のように、\
   `C:\Users\Administrator\Desktop> .\semiauto_set_up.ps1`\
   依存する場合はCUDA 12.5のインストーラーを転送して次のように\
   `C:\Users\Administrator\Desktop> .\semiauto_set_up.ps1 path_to_cuda_installler`\
   スクリプトを実行。しばらく待つ。CUDA無しだと6分半くらいかかった。(よくある罠としてPowerShellなどでテキスト選択状態になってしまうとログが進まないので注意。)

- 2024/07/20時点では以下の画像に示すドライバーがインストールされました。\
  <img src="images/nv_system_info.png">

#### インスタンスの終了

1. インスタンス一覧から該当のインスタンスを選んで\
   インスタンスの状態 > インスタンスを終了
   をクリック。

- 終了


5,d0),d2	16
	move.l d2,a3		4
	move.b (a3),d6		8
	move.b (a6,d1),d3	16
	move.l d3,a3		4
	move.b (a3),d5		8
	elseif
	move.b (a5,d0),d6	16
	move.b (a6,d1),d5	16
	endc
	add d5,d6		4
	lsr d6		8
	eor d7,d6		4
	move.b d6,(a0)+		8
	lea 1(a0),a0		8

	swap d0		4
	swap d1		4

	dbra d4,.l1		12 / 132

	lea audio1(pc),a3

	add.l d0,AudLoPtr(a3)
	bcc.s .ok2
	addq #1,AudPtr(a3)
.ok2	add.l d1,w+AudLoPtr(a3)
	bcc.s .ok3
	addq #1,w+AudPtr(a3)
.ok3	rts

	elseif

* 344*frq/8000000

ste_cnt	sub.l a0,d4
	lsr #2,d4
	subq #1,d4
	bmi .ok3

	movem.l d4/a0,-(a7)

w	set audio2-audio0

	lea audio0(pc),a3

	move.l AudPeriod32(a3),a1	Voice 1
	move.l AudVolumePtr(a3),d2
	moveq #0,d0
	move AudPrecision(a3),d0
	move.l AudPtr(a3),a5

	move.l w+AudPeriod32(a3),a2	Voice 2
	move.l w+AudVolumePtr(a3),d3
	moveq #0,d1
	move w+AudPrecision(a3),d1
	move.l w+AudPtr(a3),a6

	moveq #0,d5
	move.l tabben_ptr,a4
	move .old0(pc),d7

.l0	add.l a1,d0		8
	add.l a2,d1		8

	swap d0		4
	swap d1		4

	moveq #0,d6		4
	move.b (a5,d0),d2	16
	move.l d2,a3		4
	move.b (a3),d6		8
	move.b (a6,d1),d3	16
	move.l d3,a3		4
	move.b (a3),d5		8
	add d5,d6		4

	add d6,d7		4
	move.b (a4,d7),(a0)	20
	move d6,d7		4
	add d6,d6		4
	move.b (a4,d6),2(a0)	24
	lea 4(a0),a0		8

	swap d0		4
	swap d1		4

	dbra d4,.l0		12 / 172

	move d7,.old0
	lea audio0(pc),a3

	add.l d0,AudLoPtr(a3)
	bcc.s .ok0
	addq #1,AudPtr(a3)
.ok0	add.l d1,w+AudLoPtr(a3)
	bcc.s .ok1
	addq #1,w+AudPtr(a3)
.ok1
	movem.l (a7)+,d4/a0

	lea audio1-audio0(a3),a3

	move.l AudPeriod32(a3),a1	Voice 1
	move.l AudVolumePtr(a3),d2
	moveq #0,d0
	move AudPrecision(a3),d


you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

.TimelineViewingLayer {
    bottom: 0;
    cursor: vertical-text;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
  }

  .TimelineViewingLayer--cursorGuide {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 1px;
    background-color: red;
  }

  .TimelineViewingLayer--dragged {
    position: absolute;
    top: 0;
    bottom: 0;
  }

  .TimelineViewingLayer--dragged.isDraggingLeft {
    border-left: 1px solid;
  }

  .TimelineViewingLayer--dragged.isDraggingRight {
    border-right: 1px solid;
  }

  .TimelineViewingLayer--dragged.isShiftDrag {
    background-color: rgba(68, 68, 255, 0.2);
    border-color: #44f;
  }

  .TimelineViewingLayer--dragged.isReframeDrag {
    background-color: rgba(255, 68, 68, 0.2);
    border-color: #f44;
  }

  .TimelineViewingLayer--fullOverlay {
    bottom: 0;
    cursor: col-resize;
    left: 0;
    position: fixed;
    right: 0;
    top: 0;
    user-select: none;
  }

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 100;
  src: url('/assets/fonts/Montserrat-ThinItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 200;
  src: url('/assets/fonts/Montserrat-ExtraLightItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 300;
  src: url('/assets/fonts/Montserrat-LightItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 400;
  src: url('/assets/fonts/Montserrat-Italic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 500;
  src: url('/assets/fonts/Montserrat-MediumItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 600;
  src: url('/assets/fonts/Montserrat-SemiBoldItalic.ttf') format('truetype');
}

@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 700;
  src: url('/assets/fonts/Mon


           break;
              case Mode.ALPHANUMERIC:
                DecodedBitStreamParser.decodeAlphanumericSegment(bits, result, count, fc1InEffect);
                break;
              case Mode.BYTE:
                DecodedBitStreamParser.decodeByteSegment(bits, result, count, currentCharacterSetECI, byteSegments, hints);
                break;
              case Mode.KANJI:
                DecodedBitStreamParser.decodeKanjiSegment(bits, result, count);
                break;
              default:
                throw new FormatException();
            }
            break;
        }
      } while (mode !== Mode.TERMINATOR);
    } catch (iae/*: IllegalArgumentException*/) {
      // from readBits() calls
      throw new FormatException();
    }

    return new DecoderResult(bytes,
      result.toString(),
      byteSegments.length === 0 ? null : byteSegments,
      ecLevel === null ? null : ecLevel.toString(),
      symbolSequence,
      parityData);
  }

  /**
   * See specification GBT 18284-2000
   */
  private static decodeHanziSegment(bits: BitSource,
    result: StringBuilder,
    count: number /*int*/): void /*throws FormatException*/ {
    // Don't crash trying to read more bits than we have available.
    if (count * 13 > bits.available()) {
      throw new FormatException();
    }

    // Each character will require 2 bytes. Read the characters as 2-byte pairs
    // and decode as GB2312 afterwards
    const buffer = new Uint8Array(2 * count);
    let offset = 0;
    while (count > 0) {
      // Each 13 bits encodes a 2-byte character
      const twoBytes = bits.readBits(13);
      let assembledTwoBytes = (((twoBytes / 0x060) << 8) & 0xFFFFFFFF) | (twoBytes % 0x060);
      if (assembledTwoBytes < 0x003BF) {
        // In the 0xA1A1 to 0xAAFE range
        assembledTwoBytes += 0x0A1A1;
      } else {
        // In the 0xB0A1 to 0xFAFE range
        assembledTwoBytes += 0x0A6A1;
      }
      buffer[offset] = /*(byte) */((assembledTwoBytes >> 8) & 0xFF);
      buffer[offset + 1] = /*(byte) */(assembledTwoBytes & 0xFF);
      offset += 2;
      count--;
    }

    try {
      result.append(StringEncoding.decode(buffer, StringUtils.GB2312));
      // TYPESCRIPTPORT: TODO: implement GB2312 decode. StringView from MDN could be a starting point
    } catch (ignored/*: UnsupportedEncodingException*/) {
      throw new FormatException(ignored);
    }
  }

  private static decodeKanjiSegment(bits: BitSource,
    result: StringBuilder,
    count: number /*int*/): void /*throws FormatException*/ {
    // Don't crash trying to read more bits than we have available.
    if (count * 13 > bits.available()) {
      throw new FormatException();
    }

    // Each character will require 2 bytes. Read the characters as 2-byte pairs
    // and decode as Shift_JIS afterwards
    const buffer = new Uint8Array(2 * count);
    let offset = 0;
    while (count > 0) {
      // Each 13 bits encodes a 2-byte character
      const twoBytes = bits.readBits(13);
      let assembledTwoBytes = (((twoBytes / 0x0C0) << 8) & 0xFFFFFFFF) | (twoBytes % 0x0C0);
      if (assembledTwoBytes < 0x01F00) {
        // In the 0x8140 to 0x9FFC range
        assembledTwoBytes += 0x08140;
      } else {
        // In the 0xE040 to 0xEBBF range
        assembledTwoBytes += 0x0C140;
      }
      buffer[offset] = /*(byte) */(assembledTwoBytes >> 8);
      buffer[offset + 1] = /*(byte) */assembledTwoBytes;
      offset += 2;
      count--;
    }
    // Shift_JIS may not be supported in some environments:
    try {
      result.append


decodings("1010102101012012010210210".into()), 1);
  assert_eq!(num_decodings("1230123102301023013010".into()), 0);
  assert_eq!(num_decodings("10".into()), 1);
  assert_eq!(num_decodings("12".into()), 2);
  assert_eq!(num_decodings("226".into()), 3);
  assert_eq!(num_decodings("0".into()), 0);
  assert_eq!(num_decodings("1".into()), 1);
  assert_eq!(num_decodings("12312312312".into()), 54);
  assert_eq!(num_decodings("2010316520123123123102".into()), 54);
  assert_eq!(num_decodings("111111".into()), 13);
  assert_eq!(
    num_decodings("111111111111111111111111111111111111111111111".into()),
    1836311903
  );
}
use anyhow::{anyhow, Result};
use cosmwasm_std::{Addr, DepsMut, MessageInfo, Response};

use crate::{config::get_config, registry::NameRegistry};

/// Attempt to set the owner for a name
/// Validates that the current owner address is the one asking for the change
/// Returned data includes the new name record, including updated lineage hash
pub fn try_set_owner(
    deps: &mut DepsMut,
    info: &MessageInfo,
    name: &String,
    tld: &String,
    new_owner: Addr,
) -> Result<Response> {
    let config = get_config(deps.storage)?;

    if !config.allowed_tlds.contains(tld) {
        return Err(anyhow!("Unknown TLD: {}", tld));
    }

    let mut name_registry = NameRegistry::new(tld);
    let name_record = name_registry.try_resolve_name(deps.storage, name)?;

    if name_record.owner != info.sender {
        return Err(anyhow!("Only the name owner can change its owner"));
    }

    let name_record = name_registry.try_set_owner(deps.storage, name, new_owner)?;

    Ok(Response::new()
        .add_attribute("name", name)
        .add_attribute("tld", tld)
        .add_attribute("owner", name_record.owner))
}

/// Attempt to set the value for a name record
/// Validates that the owner address is the one setting the value
/// Returned data includes the new name record, including updated lineage hash
pub fn try_set_value(
    deps: &mut DepsMut,
    info: &MessageInfo,
    name: &String,
    tld: &String,
    value: Option<String>,
) -> Result<Response> {
    let config = get_config(deps.storage)?;

    if !config.allowed_tlds.contains(tld) {
        return Err(anyhow!("Unknown TLD: {}", tld));
    }

    let mut name_registry = NameRegistry::new(tld);
    let name_record = name_registry.try_resolve_name(deps.storage, name)?;

    if name_record.owner != info.sender {
        return Err(anyhow!("Only the name owner can change its value"));
    }

    let name_record = name_registry.try_set_value(deps.storage, name, value)?;

    let response = Response::new()
        .add_attribute("name", name)
        .add_attribute("tld", tld)
        .add_attribute("owner", name_record.owner);

    Ok(match name_record.value {
        Some(value) => response.add_attribute("value", value),
        None => response,
    })
}

/// Attempt to register a name
/// Validates that the configured fee (if any) has been paid
/// Names that have been registered cannot be re-registered
pub fn try_register_name(
    deps: &mut DepsMut,
    info: &MessageInfo,
    name: &String,
    tld: &String,
) -


ApiContract? ReleaseEvent { get; init; }

	[DataMember(EmitDefaultValue = false)]
	public ReleaseEventForApiContract[] ReleaseEvents { get; init; }

	[DataMember]
	[JsonConverter(typeof(StringEnumConverter))]
	public SongType SongType { get; init; }

	[DataMember]
	[JsonConverter(typeof(StringEnumConverter))]
	public EntryStatus Status { get; init; }

	/// <summary>
	/// List of tags. Optional field.
	/// </summary>
	[DataMember(EmitDefaultValue = false)]
	public TagUsageForApiContract[]? Tags { get; init; }

	/// <summary>
	/// URL to the thumbnail. Optional field.
	/// </summary>
	[DataMember(EmitDefaultValue = false)]
	public string? ThumbUrl { get; init; }

	[DataMember]
	public int Version { get; init; }

	/// <summary>
	/// List of external links. Optional field.
	/// </summary>
	[DataMember(EmitDefaultValue = false)]
	public WebLinkForApiContract[]? WebLinks { get; init; }

	/// <summary>
	/// List of assigned culture codes (ISO 639-1/639-3). Optional field.
	/// </summary>
	[DataMember]
	[JsonProperty(DefaultValueHandling = DefaultValueHandling.Populate)]
	public string[] CultureCodes { get; init; }
}

[Flags]
public enum SongOptionalFields
{
	None = 0,
	AdditionalNames = 1 << 0,
	Albums = 1 << 1,
	Artists = 1 << 2,
	Lyrics = 1 << 3,
	MainPicture = 1 << 4,
	Names = 1 << 5,
	PVs = 1 << 6,
	ReleaseEvent = 1 << 7,
	Tags = 1 << 8,
	[Obsolete($"Use {nameof(SongForApiContract.MainPicture)}.{nameof(SongForApiContract.MainPicture.UrlThumb)} instead.")]
	ThumbUrl = 1 << 9,
	WebLinks = 1 << 10,
	Bpm = 1 << 11,
	CultureCodes = 1 << 12
}


="%2320c997" d="m12 2c-5.5 0-10 4.5-10 10s4.5 10 10 10c2.2 0 4.3-.7 6-2l9 10 3-3-10-9c1.3-1.7 2-3.8 2-6 0-5.5-4.5-10-10-10zm0 3c3.9 0 7 3.1 7 7s-3.1 7-7 7-7-3.1-7-7 3.1-7 7-7z"/%3e%3cpath fill="%2320c997" d="m2 24v6h4v-6zm6 0v6h4v-6zm6 0v6h4v-6z"/%3e%3c/svg%3e')}.ic_b_spatial{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"%3e%3cpath fill="%2320c997" d="m12 2v28h2v-28zm-10 4v20h8v-20zm2 2h4v4h-4zm0 6h4v4h-4zm0 6h4v4h-4z"/%3e%3cpath fill="%2320c997" d="m24 6c-3.3 0-6 2.7-6 6 0 5 4 9 6 14 2-5 6-9 6-14 0-3.3-2.7-6-6-6zm0 3c1.7 0 3 1.3 3 3s-1.3 3-3 3-3-1.3-3-3 1.3-3 3-3z"/%3e%3c/svg%3e')}.ic_b_sql{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"%3e%3cpath fill="%2320c997" d="m9 2c-1.7 0-3 1.3-3 3v21h-3c-.5 0-1 .5-1 1 0 1.4 1.3 3 3 3h18c1.7 0 3-1.3 3-3v-21h3c.5 0 1-.5 1-1 0-1.4-1.3-3-3-3zm0 2h15.2c-.1.3-.2.7-.2 1v22c0 .6-.4 1-1 1s-1-.5-1-1-.5-1-1-1h-13v-21c0-.6.4-1 1-1zm1 2v2h10v-2zm0 4v2h12v-2zm0 4v2h8v-2zm0 4v2h10v-2zm0 4v2h12v-2z"/%3e%3c/svg%3e')}.ic_b_sqlhelp{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"%3e%3cpath fill="%2320c997" d="m8 2c-2.2 0-4 1.8-4 4v20c0 2.2 1.8 4 4 4h20v-24h-2v22h-17c-4 0-4-6 0-6h15v-20zm1 22c-1.3 0-1.3 2 0 2h15v-2z"/%3e%3c/svg%3e')}.ic_b_table_add{background-image:url('data:image/svg+xml,%3csvg viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"%3e%3cpath fill="%2320c997" d="m2 2v28h15.4c-.4-.6-.8-1.3-1-2h-12.4v-20h24


ite-space:pre}.swagger-ui .opblock-link{font-weight:400}.swagger-ui .opblock-link.shown{font-weight:700}.swagger-ui span.token-string{color:#555}.swagger-ui span.token-not-formatted{color:#555;font-weight:700}.swagger-ui .btn{background:transparent;border:2px solid gray;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.1);color:#3b4151;font-family:sans-serif;font-size:14px;font-weight:700;padding:5px 23px;transition:all .3s}.swagger-ui .btn.btn-sm{font-size:12px;padding:4px 23px}.swagger-ui .btn[disabled]{cursor:not-allowed;opacity:.3}.swagger-ui .btn:hover{box-shadow:0 0 5px rgba(0,0,0,.3)}.swagger-ui .btn.cancel{background-color:transparent;border-color:#ff6060;color:#ff6060;font-family:sans-serif}.swagger-ui .btn.authorize{background-color:transparent;border-color:#49cc90;color:#49cc90;display:inline;line-height:1}.swagger-ui .btn.authorize span{float:left;padding:4px 20px 0 0}.swagger-ui .btn.authorize svg{fill:#49cc90}.swagger-ui .btn.execute{background-color:#4990e2;border-color:#4990e2;color:#fff}.swagger-ui .btn-group{display:flex;padding:30px}.swagger-ui .btn-group .btn{flex:1}.swagger-ui .btn-group .btn:first-child{border-radius:4px 0 0 4px}.swagger-ui .btn-group .btn:last-child{border-radius:0 4px 4px 0}.swagger-ui .authorization__btn{background:none;border:none;padding:0 0 0 10px}.swagger-ui .authorization__btn.locked{opacity:1}.swagger-ui .authorization__btn.unlocked{opacity:.4}.swagger-ui .model-box-control,.swagger-ui .models-control,.swagger-ui .opblock-summary-control{all:inherit;border-bottom:0;cursor:pointer;flex:1;padding:0}.swagger-ui .model-box-control:focus,.swagger-ui .models-control:focus,.swagger-ui .opblock-summary-control:focus{outline:auto}.swagger-ui .expand-methods,.swagger-ui .expand-operation{background:none;border:none}.swagger-ui .expand-methods svg,.swagger-ui .expand-operation svg{height:20px;width:20px}.swagger-ui .expand-methods{padding:0 10px}.swagger-ui .expand-methods:hover svg{fill:#404040}.swagger-ui .expand-methods svg{fill:#707070;transition:all .3s}.swagger-ui button{cursor:pointer}.swagger-ui button.invalid{animation:shake .4s 1;background:#feebeb;border-color:#f93e3e}.swagger-ui .copy-to-clipboard{align-items:center;background:#7d8293;border:none;border-radius:4px;bottom:10px;display:flex;height:30px;justify-content:center;position:absolute;right:100px;width:30px}.swagger-ui .copy-to-clipboard button{background:url("data:image/svg+xml;charset=utf-8,<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"15\" aria-hidden=\"true\"><path fill=\"%23fff\" fill-rule=\"evenodd\" d=\"M4 12h4v1H4v-1zm5-6H4v1h5V6zm2 3V7l-3 3 3 3v-2h5V9h-5zM6.5 8H4v1h2.5V8zM4 11h2.5v-1H4v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H3c-.55 0-1-.45-1-


require "box2d"

local texture = Texture.new("gfx/newsh(.shp.000000.png", false, {transparentColor = 0xbfdcbf})

local bullets = {
	{13, 42, 10, 11, 3},
	{120, 140, 6, 11, 3},
	{138, 140, 6, 11, 3},
	{120, 112, 11, 11, 3},
	{133, 112, 11, 11, 3},

	{207, 74, 7, 7, 3},
	{121, 172, 21, 21, 10}
}

BulletLayer = Core.class(Sprite)

function BulletLayer:init(game)
	self.game = game
	self.world = game.world
	self.pool = {}
	self.bullets = {}

	self:addEventListener(Event.ENTER_FRAME, self.onEnterFrame, self)
end

function BulletLayer:addBullet(id, x, y, dx, dy, type, categoryBits, maskBits)
	local bullet = bullets[id]

	local radius = bullet[5]

	self.pool[radius] = self.pool[radius] or {}

	local pool = self.pool[radius]

	local sprite
	if #pool == 0 then
		local textureRegion = TextureRegion.new(texture, bullet[1], bullet[2], bullet[3], bullet[4])
		sprite = Bitmap.new(textureRegion)
		sprite.textureRegion = textureRegion
		sprite:setAnchorPoint(0.5, 0.5)
		local body = self.world:createBody({type = b2.KINEMATIC_BODY})
		lo


ralizeRoad(Tile);
      if (((Tile == 237) || ((Tile >= 64) && (Tile <= 78))) &&
	  (Tile != 77) && (Tile != 238) && (Tile != 64))
	adjTile |= 0x0001;
    }

    if (x < (WORLD_X - 1)) {
      Tile = TileAdrPtr[WORLD_Y];
      NeutralizeRoad(Tile);
      if (((Tile == 238) || ((Tile >= 64) && (Tile <= 78))) &&
	  (Tile != 78) && (Tile != 237) && (Tile != 65))
	adjTile |= 0x0002;
    }

    if (y < (WORLD_Y - 1)) {
      Tile = TileAdrPtr[1];
      NeutralizeRoad(Tile);
      if (((Tile == 237) || ((Tile >= 64) && (Tile <= 78))) &&
	  (Tile != 77) && (Tile != 238) && (Tile != 64))
	adjTile |= 0x0004;
    }

    if (x > 0) {
      Tile = TileAdrPtr[-WORLD_Y];
      NeutralizeRoad(Tile);
      if (((Tile == 238) || ((Tile >= 64) && (Tile <= 78))) &&
	  (Tile != 78) && (Tile != 237) && (Tile != 65))
	adjTile |= 0x0008;
    }

    (*TileAdrPtr) = _RoadTable[adjTile] | BULLBIT | BURNBIT;
    return;
  }

  if ((Tile >= 226) && (Tile <= 236)) {		/* Cleanup Rail */

    if (y > 0) {
      Tile = TileAdrPtr[-1];
      NeutralizeRoad(Tile);
      if ((Tile >= 221) && (Tile <= 238) &&
	  (Tile != 221) && (Tile != 237) && (Tile != 224))
	adjTile |= 0x0001;
    }

    if (x < (WORLD_X - 1)) {
      Tile = TileAdrPtr[WORLD_Y];
      NeutralizeRoad(Tile);
      if ((Tile >= 221) && (Tile <= 238) &&
	  (Tile != 222) && (Tile != 238) && (Tile != 225))
	adjTile |= 0x0002;
    }

    if (y < (WORLD_Y - 1)) {
      Tile = TileAdrPtr[1];
      NeutralizeRoad(Tile);
      if ((Tile >= 221) && (Tile <= 238) &&
	  (Tile != 221) && (Tile != 237) && (Tile != 224))
	adjTile |= 0x0004;
    }

    if (x > 0) {
      Tile = TileAdrPtr[-WORLD_Y];
      NeutralizeRoad(Tile);
      if ((Tile >= 221) && (Tile <= 238) &&
	  (Tile != 222) && (Tile != 238) && (Tile != 225))
	adjTile |= 0x0008;
    }

    (*TileAdrPtr) = _RailTable[adjTile] | BULLBIT | BURNBIT;
    return;
  }

  if ((Tile >= 210) && (Tile <= 220)) {		/* Cleanup Wire */

    if (y > 0) {
      Tile = TileAdrPtr[-1];
      if (Tile & CONDBIT) {
	NeutralizeRoad(Tile);
	if ((Tile != 209) && (Tile != 78) && (Tile != 222))
	  adjTile |= 0x0001;
      }
    }

    if (x < (WORLD_X - 1)) {
      Tile = TileAdrPtr[WORLD_Y];
      if (Tile & CONDBIT) {
	NeutralizeRoad(Tile);
	if ((Tile != 208) && (Tile != 77) && (Tile != 221))
	  adjTile |= 0x0002;
      }
    }

    if (y < (WORLD_Y - 1)) {
      Tile = TileAdrPtr[1];
      if (Tile & CONDBIT) {
	NeutralizeRoad(Tile);
	if ((Tile != 209) && (Tile != 78) && (Tile != 222))
	  adjTile |= 0x0004;
      }
    }

    if (x > 0) {
      Tile = TileAdrPtr[-WORLD_Y];
      if (Tile & CONDBIT) {
	NeutralizeRoad(Tile);
	if ((Tile != 208) && (Tile != 77) && (Tile != 221))
	  adjTile |= 0x0008;
      }
    }

    (*TileAdrPtr) = _WireTable[adjTile] | BULLBIT | BURNBIT | CONDBIT;
    return;
  }
}


### 제출 일자

2024년 10월 14일 11:07:35

### 문제 설명

민우는 학창시절 승부욕이 강해서 달리기를 할 때에도 누가 가장 빠른지를 중요하게 생각하고, 시험을 볼 때에도 누가 가장 성적이 높은지를 중요하게 생각한다. 이번에 반에서 키를 측정하였는데, 민우는 마찬가지로 누구의 키가 가장 큰지 궁금해한다. 민우를 도와 가장 키가 큰 사람을 찾아보자.

### 입력

입력은 여러개의 테스트케이스로 구성되어있다. 각 테스트케이스는 첫 번째 줄에 학생의 수 N (0 < N ≤ 50)이 주어지고, 이어서 N개의 줄에 각 학생의 이름과 키가 공백으로 구별되어 주어진다. 학생의 이름은 알파벳 대/소문자로만 이루어져 있고, 길이는 10을 넘지 않는다. 학생의 키는 소숫점 이하 2자리까지 주어진다. N이 0으로 주어지는 경우 프로그램을 종료한다.

### 출력

각 테스트케이스에 대해, 가장 키가 큰 학생의 이름을 한 줄에 출력한다. 같은 키의 사람이 여러명 일 경우 모두 출력해야 하며, 순서는 입력으로 들어온 순서를 유지해야 한다.

# [Silver IV] 한윤정이 이탈리아에 가서 아이스크림을 사먹는데 - 2422

[문제 링크](https://www.acmicpc.net/problem/2422)

### 성능 요약

메모리: 32812 KB, 시간: 2888 ms

### 분류

브루트포스 알고리즘

### 제출 일자

2025년 4월 15일 16:01:26

### 문제 설명

한윤정과 친구들은 이탈리아로 방학 여행을 갔다. 이탈리아는 덥다. 윤정이와 친구들은 아이스크림을 사먹기로 했다. 아이스크림 가게에는 N종류의 아이스크림이 있다. 모든 아이스크림은 1부터 N까지 번호가 매겨져있다. 어떤 종류의 아이스크림을 함께먹으면, 맛이 아주 형편없어진다. 따라서 윤정이는 이러한 경우를 피하면서 아이스크림을 3가지 선택하려고 한다. 이때, 선택하는 방법이 몇 가지인지 구하려고 한다.

### 입력

첫째 줄에 정수 N과 M이 주어진다. N은 아이스크림 종류의 수이고, M은 섞어먹으면 안 되는 조합의 개수이다. 아래 M개의 줄에는 섞어�


alé písmeno latinky o s čárkou nad vpravo',ocirc:'Malé písmeno latinky o s vokáněm',otilde:'Malé písmeno latinky o s tildou',ouml:'Malé písmeno latinky o s dvěma tečkami',divide:'Znak dělení',oslash:'Malé písmeno latinky o přeškrtnuté',ugrave:'Malé písmeno latinky u s čárkou nad vlevo',uacute:'Malé písmeno latinky u s čárkou nad vpravo',ucirc:'Malé písmeno latinky u s vokáněm',uuml:'Malé písmeno latinky u s dvěma tečkami',yacute:'Malé písmeno latinky y s čárkou nad vpravo',thorn:'Malé písmeno latinky thorn',yuml:'Malé písmeno latinky y s dvěma tečkami',OElig:'Velká ligatura latinky OE',oelig:'Malá ligatura latinky OE',372:'Velké písmeno latinky W s vokáněm',374:'Velké písmeno latinky Y s vokáněm',373:'Malé písmeno latinky w s vokáněm',375:'Malé písmeno latinky y s vokáněm',sbquo:'Dolní 9 uvozovka jednoduchá',8219:'Horní obrácená 9 uvozovka jednoduchá',bdquo:'Dolní 9 uvozovka dvojitá',hellip:'Trojtečkový úvod',trade:'Obchodní značka',9658:'Černý ukazatel směřující vpravo',bull:'Kolečko',rarr:'Šipka vpravo',rArr:'Dvojitá šipka vpravo',hArr:'Dvojitá šipka vlevo a vpravo',diams:'Černé piky',asymp:'Téměř se rovná'});
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/

CKEDITOR.dialog.add('specialchar',function(a){var b,c=a.lang.specialChar,d=function(j){var k,l;if(j.data)k=j.data.getTarget();else k=new CKEDITOR.dom.element(j);if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){k.removeClass('cke_light_background');b.hide();var m=a.document.createElement('span');m.setHtml(l);a.insertText(m.getText());}},e=CKEDITOR.tools.addFunction(d),f,g=function(j,k){var l;k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'&&(l=k.getChild(0).getHtml())){if(f)h(null,f);var m=b.getContentElement('info','htmlPreview').getElement();b.getContentElement('info','charPreview').getElement().setHtml(l);m.setHtml(CKEDITOR.tools.htmlEncode(l));k.getParent().addClass('cke_light_background');f=k;}},h=function(j,k){k=k||j.data.getTarget();if(k.getName()=='span')k=k.getParent();if(k.getName()=='a'){b.getContentElement('info','charPreview').getElement().setHtml(' ');b.getContentElement('info','htmlPreview').getElement().setHtml(' ');k.getParent().removeClass('cke_light_background');f=undefined;}},i=CKEDITOR.tools.addFunction


href = "https://people.sc.fsu.edu/~jburkardt/m_src/calpak/calpak.html">a MATLAB version and
      an Octave version and
      a Python version.

      Related Data and Programs:

      calpak_test

      analemma,
      a Fortran90 code which
      evaluates the equation of time, a formula for the difference between
      the uniform 24 hour day and the actual position of the sun,
      based on a program by Brian Tung.

      calendar_nyt,
      a Fortran90 code which
      shows the correspondence between dates and the New York Times volume and
      issue number;

      calendar_rd,
      a C++ code which
      computes the representation of a given date in a
      number of calendrical systems,
      by Edward Reingold and Nachum Dershowitz

      dates,
      a dataset directory which
      contains lists of dates in various calendar systems.

      doomsday,
      a Fortran90 code which
      is given the year, month and day of a date, and uses
      John Conway's doomsday algorithm to determine the corresponding
      day of the week.

      weekday,
      a Fortran90 code which
      determines the day of the week for a given day.

      Reference:

          Anonymous,

          A Correction; Welcome to 51,254,

          The New York Times,

          01 January 2000, Volume 149, Issue 51254.

          James Barron,

          What's in a Number? 143 Years of News,

          The New York Times,

          14 March 1995, Volume 144, Issue 50000.

          Bonnie Blackburn, Leofranc Holford-Stevens,

          The Oxford Companion to the Year,

          Oxford, 1999,

          ISBN: 0192142313,

          LC: CE73.B553.

          Lewis Carroll (Charles Dodgson),

          To Find the Day of the Week for Any Given Date,

          Nature, 31 March 1887.

          John Conway,

          Tomorrow is the Day After Doomsday,

          Eureka,

          Volume 36, October 1973, pages 28-31.

          Peter Duffett-Smith,

          Practical Astronomy With Your Calculator,

          Third Edition,

          Cambridge U


his.builderForward
			.setSequence("atggcaaatctcacaatcgtgactgaatttatccttatggggttttctaccaataaaaatatgtgcattttgcattcgattctcttcttgttgatttatttgtgtgccctgatggggaatgtcctcattatcatgatcacaactttggaccatcatctccacacccccgtgtatttcttcttgaagaatctatctttcttggatctctgccttatttcagtcacggctcccaaatctatcgccaattctttgatacacaacaactccatttcattccttggctgtgtttcccaggtctttttgttgctttcttcagcatctgcagagctgctcctcctcacggtgatgtcctttgaccgctatactgctatatgtcaccctctgcactatgatgtcatcatggacaggagcacctgtgtccaaagagccactgtgtcttggctgtatgggggtctgattgctgtgatgcacacagctggcaccttctccttatcctactgtgggtccaacatggtccatcagttcttctgtgacattccccagttattagctatttcttgctcagaaaatttaataagagaaattgcactcatccttattaatgtagttttggatttctgctgttttattgtcatcatcattacctatgtccacgtcttctctacagtcaagaagatcccttccacagaaggccagtcaaaagcctactctatttgccttccacacttgctggttgtgttatttctttccactggattcattgcttatctgaagccagcttcagagtctccttctattttggatgctgtaatttctgtgttctacactatgctgcccccaacctttaatcccattatatacagtttgagaaacaaggccataaaggtggctctggggatgttgataaagggaaagctcaccaaaaagtaa"
				.toUpperCase());
		this.builderForward.setGeneSymbol("OR14A16");
		this.infoForward = builderForward.build();
		// RefSeq NM_001001966.1

		GenomeVariant change1 = new GenomeVariant(new GenomePosition(refDict, Strand.FWD, 1, 247978543,
			PositionType.ZERO_BASED), "GAG", "");
		Annotation annotation1 = new DeletionAnnotationBuilder(infoForward, change1, new AnnotationBuilderOptions())
			.build();
		Assertions.assertEquals(infoForward.getAccession(), annotation1.getTranscript().getAccession());
		Assertions.assertEquals(0, annotation1.getAnnoLoc().getRank());
		Assertions.assertEquals("488_490del", annotation1.getCDSNTChange().toHGVSString());
		Assertions.assertEquals("(Ser163del)", annotation1.getProteinChange().toHGVSString(AminoAcidCode.THREE_LETTER));
		Assertions.assertEquals(ImmutableSortedSet.of(VariantEffect.DISRUPTIVE_INFRAME_DELETION), annotation1.getEffects());
	}

	@Test
	public void testRealWorldCase_uc011azx_2() throws InvalidGenomeVariant {
		this.builderForward = TranscriptModelFactory
			.parseKnownGenesLine(
				refDict,
				"uc011azx.2	chr3	-	44540461	44552128	44540636	44544471	4	44540461,44544033,44544456,44552044,	44542126,44544160,44544548,44552128,	Q6ZMS4-2	uc011azx.2");
		this.builderForward
			.setSequence("gcaactggggaagctgggaggtaggcgcggggcggtcggctgcggtggcggcgtttggatgattgtctctcggcggcggagtcgctcaatgtacttctccagttcctacccttcctcaagtggggaactcaggagaccaagcaggggcaactgtacttcggatggtcaggccccaggatactgtggcgtat


        note_off_velocity: 0,
                        reserved_1: 0,
                        reserved_2: 0,
                    };
                    *ev = midi_event;

                    self.output_events_buffer.num_events += 1;
                }

                _ => {}
            }
        }

        if self.output_events_buffer.num_events > 0 {
            // update pointers
            for (evt, evt_ptr) in self
                .output_events_buffer
                .events
                .iter_mut()
                .zip(self.output_events_buffer.event_ptrs.iter_mut())
            {
                *evt_ptr = evt as *mut MidiEvent;
            }

            // send to host
            (self.host_cb)(&mut self.effect as *mut AEffect,
                host_opcodes::PROCESS_EVENTS,
                0, 0, &self.output_events_buffer as *const _ as *mut _, 0.0);
        }
    }
}
use super::makefile::MakeFile;
use std::fs;
use std::fs::File;
use std::io;
use std::io::{Read, Seek};
use zip::read::ZipArchive;
use zip::read::ZipFile;
use zip::result::ZipResult;

pub fn run(path: &str) -> Vec<String> {
    let mut file = File::open(path).expect(&format!("Couldn't open file {}", &path));
    let files = browse_zip_archive(&mut file, |f| Ok(format!("{}", f.name())));

    match files {
        Ok(file) => {
            file
        }
        Err(e) => {
            panic!(" Panic {:?}", e);
        }
    }
}

fn browse_zip_archive<T, F, U>(buf: &mut T, browse_func: F) -> ZipResult<Vec<U>>
where
    T: Read + Seek,
    F: Fn(&ZipFile) -> ZipResult<U>,
{
    let mut archive = ZipArchive::new(buf)?;
    (0..archive.len())
        .map(|i| archive.by_index(i).and_then(|file| browse_func(&file)))
        .collect()
}

pub fn extract_zip_mk(mk: &MakeFile) {
    let default_architectures = mk.get_default_architectures();
    let input = &mk.get_input();
    let fname = std::path::Path::new(input);
    if mk.has_default_architecture() {
        mk.log(format!(
            "Extracting: {:?} for architecture {:?} ",
            fname, mk.get_default_architectures()
        ));
    } else {
        mk.log(format!(
            "Extracting: {:?} for architectures {:?} ",
            fname, mk.get_architectures()
        ));
    }

    let file = fs::File::open(&fname).unwrap();

    let mut archive = zip::ZipArchive::new(file).unwrap();

    for i in 0..archive.len() {
        let mut file = archive.by_index(i).unwrap();
        let outpath = match file.enclosed_name() {
            Some(path) => path.to_owned(),
            None => continue,
        };

        {
            let comment = file.comment();
            if !comment.is_empty() {
                mk.log(format!("File {} comment: {}", i, comment));
            }
        }

        if (&*file.name()).ends_with('/') {
            mk.log(format!("File {} extracted to \"{}\"", i, outpath.display()));
            fs::create_dir_all(&outpath).unwrap();
        } else if (&*file.name()).ends_with(".so") {
            // Create directory if it does not exist and if the architecture matches
            if let Some(p) = outpath.parent() {
                // If we specified a default architecture, check if the one we're extracting matches
                if mk.has


TypeSettings.Type.COMPOSITE) {
            executionTimeoutMin = timeout
        }
        testFailure = true
        supportTestRetry = true
        add {
            failOnText {
                conditionType = BuildFailureOnText.ConditionType.CONTAINS
                pattern = "%unmaskedFakeCredentials%"
                failureMessage = "This build might be leaking credentials"
                reverse = false
                stopBuildOnFailure = true
            }
        }
    }

    if (os !in listOf(Os.WINDOWS, Os.MACOS)) {
        steps {
            exec {
                name = "EC2_BUILD_CUSTOMIZATIONS"
                executionMode = BuildStep.ExecutionMode.ALWAYS
                path = ".teamcity/scripts/configure_build_env_on_ec2.sh"

                conditions {
                    requiresEc2Agent()
                }
            }
        }
    }
}

fun javaHome(
    jvm: Jvm,
    os: Os,
    arch: Arch = Arch.AMD64,
) = "%${if (os == Os.ALPINE) "linux" else os.name.lowercase()}.${
    jvm.version.name.lowercase().replace(
        "_",
        "",
    )
}.${jvm.vendor.name.lowercase()}.${arch.suffix}%"

fun BuildType.paramsForBuildToolBuild(
    buildJvm: Jvm = BuildToolBuildJvm,
    os: Os,
    arch: Arch = Arch.AMD64,
) {
    params {
        param("env.BOT_TEAMCITY_GITHUB_TOKEN", "%github.bot-teamcity.token%")
        param("env.JAVA_HOME", javaHome(buildJvm, os, arch))
        param("env.ANDROID_HOME", os.androidHome)
        param("env.ANDROID_SDK_ROOT", os.androidHome)
        param("env.GRADLE_INTERNAL_REPO_URL", "%gradle.internal.repository.url%")
        if (os == Os.MACOS && arch == Arch.AMD64) {
            // Use fewer parallel forks only on Intel macOS builds, since they are not very powerful.
            param("maxParallelForks", "2")
        }
        if (os == Os.LINUX || os == Os.MACOS) {
            param("env.LC_ALL", "en_US.UTF-8")
        }
    }
}

fun BuildSteps.checkCleanM2AndAndroidUserHome(
    os: Os = Os.LINUX,
    buildType: BuildType? = null,
) {
    script {
        name = "CHECK_CLEAN_M2_ANDROID_USER_HOME"
        executionMode = BuildStep.ExecutionMode.ALWAYS
        scriptContent =
            if (os == Os.WINDOWS) {
                checkCleanDirWindows("%teamcity.agent.jvm.user.home%\\.m2\\repository") +
                    checkCleanDirWindows("%teamcity.agent.jvm.user.home%\\.m2\\.gradle-enterprise") +
                    checkCleanDirWindows("%teamcity.agent.jvm.user.home%\\.m2\\.develocity") +
                    checkCleanDirWindows(
                        "%teamcity.agent.jvm.user.home%\\.android",
                        false,
                    )
            } else {
                checkCleanDirUnixLike("%teamcity.agent.jvm.user.home%/.m2/repository") +
                    checkCleanDirUnixLike("%teamcity.agent.jvm.user.home%/.m2/.gradle-enterprise") +
                    checkCleanDirUnixLike("%teamcity.agent.jvm.user.home%/.m2/.develocity") +
                    checkCleanDirUnixLike(
                        "%teamcity.agent.jvm.user.home%/.android",
                        false,
                    )
            }
        skipConditionally(buildType)
    }
}

fun BuildStep.onlyRunOnGitHubMergeQueueBranch() {
    conditions {
        matches("teamcity.build.branch", "gh-readonly-queue/.*")
    }
}

fun BuildStep.skipConditionally(buildType


h
		if rightNode.depth > leftNode.depth {
			newDepth = rightNode.depth
		}

		if newDepth+1 < newDepth {
			return nil, errors.New("depth overflow")
		}

		n.depth = newDepth + 1

		if bytes.Compare(leftNode.key, rightNode.key) > 0 {
			n.key = leftNode.key
		} else {
			n.key = rightNode.key
		}

		balanceFactor := int(leftNode.depth) - int(rightNode.depth)
		if balanceFactor < -1 || balanceFactor > 1 {
			return nil, errors.New("invalid balance factor")
		}

		if n.viewID < leftNode.viewID || n.viewID < rightNode.viewID {
			return nil, errors.New("invalid view id")
		}

		if n.id != n.rehashNoWrite() {
			return nil, errors.New("hash mismatch")
		}

		n.leftObj = leftNode
		n.rightObj = rightNode

		return n, nil
	default:
		return nil, errors.New("unknown node kind")
	}
}
// Copyright (c) 2019 Perlin
//
// 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.

package main

import (
	"gopkg.in/urfave/cli.v1"
	"os"
	"path/filepath"
	"strings"

	"github.com/benpye/readline"
)

func (cli *CLI) getCompleter() *readline.PrefixCompleter {
	if cli.client.Server == nil {
		return nil
	}

	return readline.PcItemDynamic(func(line string) []string {
		f := strings.Split(line, " ")
		if len(f) < 2 {
			return nil
		}

		text := f[len(f)-1]

		return cli.client.Server.Ledger.Find(text, 10)
	})
}

type PathCompleter struct {
	*readline.PrefixCompleter
}

func (p *PathCompleter) GetDynamicNames(line []rune) [][]rune {
	var path string

	words := strings.Split(string(line), " ")
	if len(words) > 1 && words[1] != "" { // has some file
		path = filepath.Dir(strings.Join(words[1:], " "))
	} else {
		path = "."
	}

	f, err := os.Open(path)
	if err != nil {
		return nil
	}

	defer f.Close()

	files, err := f.Readdir(-1)
	if err != nil {
		return nil
	}

	names := make([][]rune, 0, len(files))

	for _, f := range files


fff 0 -1px 0px 0 inset, #fff -1px 0 0px 0 inset, #fff 1px 0 0px 0 inset;
    -moz-box-shadow: #fff 0 1px 0px 0 inset, #fff 0 -1px 0px 0 inset, #fff -1px 0 0px 0 inset, #fff 1px 0 0px 0 inset;
    box-shadow: #fff 0 1px 0px 0 inset, #fff 0 -1px 0px 0 inset, #fff -1px 0 0px 0 inset, #fff 1px 0 0px 0 inset;
}

.x-btn-group-header-default {
    padding: 4px 5px;
    line-height: 16px;
    background: #e5e5e5;
    -moz-border-radius-topleft: 0px;
    -webkit-border-top-left-radius: 0px;
    border-top-left-radius: 0px;
    -moz-border-radius-topright: 0px;
    -webkit-border-top-right-radius: 0px;
    border-top-right-radius: 0px;
}

.x-btn-group-header-default .x-tool-img {
    background-image: url(images/tools/tool-sprites-dark.png);
    background-color: #e5e5e5;
}

.x-btn-group-header-title-default {
    font: normal 16px 'Proxima Nova', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    line-height: 16px;
    color: #666;
}

.x-btn-group-body-default {
    padding: 0 1px;
}

.x-btn-group-body-default .x-table-layout {
    border-spacing: 5px;
}

.x-btn-group-default-framed {
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    -ms-border-radius: 3px;
    -o-border-radius: 3px;
    border-radius: 3px;
    padding: 0px 1px 0px 1px;
    border-width: 3px;
    border-style: solid;
    background-color: #fff;
}

.x-btn-group-default-framed-mc {
    background-color: #fff;
}

.x-nbr .x-btn-group-default-framed {
    padding: 0 !important;
    border-width: 0 !important;
    -webkit-border-radius: 0px;
    -moz-border-radius: 0px;
    -ms-border-radius: 0px;
    -o-border-radius: 0px;
    border-radius: 0px;
    background-color: transparent !important;
    box-shadow: none !important;
}

.x-btn-group-default-framed-frameInfo {
    font-family: dh-3-3-3-3-3-3-3-3-0-1-0-1;
}

.x-btn-group-default-framed-tl {
    background-position: 0 -6px;
}

.x-btn-group-default-framed-tr {
    background-position: right -9px;
}

.x-btn-group-default-framed-bl {
    background-position: 0 -12px;
}

.x-btn-group-default-framed-br {
    background-position: right -15px;
}

.x-btn-group-default-framed-ml {
    background-position: 0 top;
}

.x-btn-group-default-framed-mr {
    background-position: right top;
}

.x-btn-group-default-framed-tc {
    background-position: 0 0;
}

.x-btn-group-default-framed-bc {
    background-position: 0 -3px;
}

.x-btn-group-default-framed-tr,
.