bottles.api.global.interceptor.AuthRequired
import com.nexters.bottles.api.global.resolver.AuthUserId
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.PostMapping
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController

@RestController
@RequestMapping("/api/v2/bottles")
class BottleControllerV2(
    private val bottleFacadeV2: BottleFacadeV2
) {

    @ApiOperation("모래사장 - 랜덤으로 받은 보틀 목록 조회하기")
    @GetMapping("/random")
    @AuthRequired
    fun getRandomBottlesList(@AuthUserId userId: Long): RandomBottleListResponse {
        return bottleFacadeV2.getRandomBottles(userId)
    }

    @ApiOperation("호감 - 호감을 받은 보틀 목록 조회하기")
    @GetMapping("/sent")
    @AuthRequired
    fun getSentBottlesList(@AuthUserId userId: Long): SentBottleListResponse {
        return bottleFacadeV2.getSentBottles(userId)
    }

    @ApiOperation("문답 - 핑퐁중인 보틀 목록 조회하기")
    @GetMapping("/ping-pong")
    @AuthRequired
    fun getPingPongList(@AuthUserId userId: Long): PingPongListResponseV2 {
        return bottleFacadeV2.getPingPongBottles(userId)
    }

    // TODO: 따닥 방지
    @ApiOperation("마이페이지 - 추가로 보틀 받기")
    @PostMapping("/additional-random")
    @AuthRequired
    fun getAdditionalRandomBottle(@AuthUserId userId: Long) {
        return bottleFacadeV2.getAdditionalRandomBottle(userId)
    }

    @ApiOperation("보틀 읽음 표시하기")
    @PostMapping("/bottle/{bottleId}/read")
    @AuthRequired
    fun readBottle(@AuthUserId userId: Long, @PathVariable bottleId: Long) {
        bottleFacadeV2.readBottle(userId, bottleId)
    }
}
package com.nexters.bottles.api.global.resolver

import com.nexters.bottles.api.auth.component.JwtTokenProvider
import com.nexters.bottles.api.global.exception.UnauthorizedException
import org.springframework.core.MethodParameter
import org.springframework.stereotype.Component
import org.springframework.web.bind.support.WebDataBinderFactory
import org.springframework.web.context.request.NativeWebRequest
import org.springframework.web.method.support.HandlerMethodArgumentResolver
import org.springframework.web.method.support.ModelAndViewContainer
import javax.servlet.http.HttpServletRequest

@Component
class AuthUserIdArgumentResolver(
    private val jwtTokenProvider: JwtTokenProvider
) : HandlerMethodArgumentResolver {

    override fun supportsParameter(parameter: MethodParameter): Boolean {
        return parameter.hasParameterAnnotation(AuthUserId::class.java)
    }

    override fun resolveArgument(
        parameter: MethodParameter,
        mavContainer: ModelAndViewContainer?,
        webRequest: NativeWebRequest,
        binderFactory: WebDataBinderFactory?
    ): Any {
        val request = webRequest.nativeRequest as HttpServletRequest
        val token = jwtTokenProvider.resolveToken(request)
        val userId = token?.takeIf { jwtTokenProvider.validateToken(it, isAccessToken = true) }
            ?.let { jwtTokenProvider.getUserIdFromToken(it, isAccessToken = true) }
        return userId ?: throw UnauthorizedException("고객센터에 문의해주세요")
    }
}
@file:Suppress("UnstableApiUsage")

enableFeatu


upStringProperty ],
        ( y, a, x2 ) => `${y} ${MathSymbols.EQUAL_TO} ${a}${x2}` ),
      textFill: GQColors.QUADRATIC_TERM,
      tandem: tandem,
      phetioDocumentation: 'checkbox that makes the quadratic term (y = ax^2) visible on the graph'
    } );
  }

  /**
   * Creates the checkbox for the linear term, y = bx
   */
  public static createLinearTermCheckbox( property: Property<boolean>, tandem: Tandem ): GQCheckbox {
    return new GQCheckbox( property, {

      // y = bx
      string: new DerivedProperty(
        [ GQSymbols.yMarkupStringProperty, GQSymbols.bMarkupStringProperty, GQSymbols.xMarkupStringProperty ],
        ( y, b, x ) => `${y} ${MathSymbols.EQUAL_TO} ${b}${x}` ),
      textFill: GQColors.LINEAR_TERM,
      tandem: tandem,
      phetioDocumentation: 'checkbox that makes the linear term (y = bx) visible on the graph'
    } );
  }

  /**
   * Creates the checkbox for the constant term, y = c
   */
  public static createConstantTermCheckbox( property: Property<boolean>, tandem: Tandem ): GQCheckbox {
    return new GQCheckbox( property, {

      // y = c
      string: new DerivedProperty(
        [ GQSymbols.yMarkupStringProperty, GQSymbols.cMarkupStringProperty ],
        ( y, c ) => `${y} ${MathSymbols.EQUAL_TO} ${c}` ),
      textFill: GQColors.CONSTANT_TERM,
      tandem: tandem,
      phetioDocumentation: 'checkbox that makes the constant term (y = c) visible on the graph'
    } );
  }

  /**
   * Creates the 'Axis of Symmetry' checkbox, with a vertical dashed line for the icon.
   */
  public static createAxisOfSymmetryCheckbox( property: Property<boolean>, tandem: Tandem ): GQCheckbox {
    return new GQCheckbox( property, {
      string: GraphingQuadraticsStrings.axisOfSymmetryStringProperty,
      icon: new Line( 0, 0, 0, 5 * GQConstants.AXIS_OF_SYMMETRY_LINE_DASH[ 0 ], {
        stroke: GQColors.AXIS_OF_SYMMETRY,
        lineWidth: GQConstants.AXIS_OF_SYMMETRY_LINE_WIDTH,
        lineDash: GQConstants.AXIS_OF_SYMMETRY_LINE_DASH
      } ),
      tandem: tandem,
      phetioDocumentation: 'checkbox that makes the axis of symmetry visible on the graph'
    } );
  }

  /**
   * Creates the 'Coordinates' checkbox.
   */
  public static createCoordinatesCheckbox( property: Property<boolean>, tandem: Tandem ): GQCheckbox {
    return new GQCheckbox( property, {
      string: GraphingQuadraticsStrings.coordinatesStringProperty,
      tandem: tandem,
      phetioDocumentation: 'checkbox that makes the (x,y) coordinates visible on points on the graph'
    } );
  }

  /**
   * Creates the 'Directrix' checkbox, with a horizontal dashed line for the icon.
   */
  public static createDirectrixCheckbox( property: Property<boolean>, tandem: Tandem ): GQCheckbox {
    return new GQCheckbox( property, {
      string: GraphingQuadraticsStrings.directrixStringProperty,
      icon: new Line( 0, 0, 5 * GQConstants.DIRECTRIX_LINE_DASH[ 0 ], 0, {
        stroke: GQColors.DIRECTRIX,
        lineWidth: GQConstants.DIRECTRIX_LINE_WIDTH,
        lineDash: GQConstants.DIRECTRIX_LINE_DASH
      } ),
      tandem: tandem,
      phetioDocumentation: 'checkbox that shows the directrix on the graph'
    } );
  }

  /**
   * Creates the 'Equations' checkbox.
   */
  public static create


 handlers 和 filters。Nginx 的配置文件主要有三个主要的块组成，分别是main、server、location。 假设您的自定义Nginx模块引入了一个新的配置指令，那么您还需要注册一个处理程序（handler）来处理该指令的配置的值。因此整个过程如下 Nginx 解析配置文件，每一个配置部分解析后就会调用注册的相应处理程序。下面是lua-nginx-module（Openresty Nginx 组件的核心模块）的实现：

```
ngx_http_module_t ngx_http_lua_module_ctx = {
#if (NGX_HTTP_LUA_HAVE_MMAP_SBRK)                                            \
    && (NGX_LINUX)                                                           \
    && !(NGX_HTTP_LUA_HAVE_CONSTRUCTOR)
    ngx_http_lua_pre_config,          /*  preconfiguration */
#else
    NULL,                             /*  preconfiguration */
#endif
    ngx_http_lua_init,                /*  postconfiguration */

    ngx_http_lua_create_main_conf,    /*  create main configuration */
    ngx_http_lua_init_main_conf,      /*  init main configuration */

    ngx_http_lua_create_srv_conf,     /*  create server configuration */
    ngx_http_lua_merge_srv_conf,      /*  merge server configuration */

    ngx_http_lua_create_loc_conf,     /*  create location configuration */
    ngx_http_lua_merge_loc_conf       /*  merge location configuration */
};
```

这里是 Nginx 模块注册的处理程序。从注释中你也可以看到，Nginx 解析出来一个 location 配置 就会调用 ngx_http_lua_merge_loc_conf 将配置和 main 块合并。回到我们的上面的gdb输出,可以看到#13就是这个函数调用。默认情况下对于每一个 location 块配置这个函数将会被调用。通过源码我们可以看到这个函数直接去读去配置值、继承server中的配置条目、设置默认值。如果设置了lua_ssl_trusted_certificate 指令，可以看到其中调用了ngx_http_lua_set_ssl,在其内部又调用了Nginx SSL 模块的 ngx_ssl_trusted_certificate。ngx_ssl_trusted_certificate 是一个非常简单的函数，对于给定的配置块（一个location 块），设置SSL 环境(context)的验证深度，调用另外一个 OpenSSL API 加载验证文件（还有一些错误处理）。

```
0649 ngx_int_t
0650 ngx_ssl_trusted_certificate(ngx_conf_t *cf, ngx_ssl_t *ssl, ngx_str_t *cert,
0651     ngx_int_t depth)
0652 {
0653     SSL_CTX_set_verify_depth(ssl->ctx, depth);
0654
0655     if (cert->len == 0) {
0656         return NGX_OK;
0657     }
0658
0659     if (ngx_conf_full_name(cf->cycle, cert, 1) != NGX_OK) {
0660         return NGX_ERROR;
0661     }
0662
0663     if (SSL_CTX_load_verify_locations(ssl->ctx, (char *) cert->data, NULL)
0664


 const e = document.createEvent(type || 'Event')
  e.initEvent(name, true, false)
  return e
}

export function dispatchClick(target, props) {
  const event = createEvent('', 'click')
  Object.assign(event, props)
  target.dispatchEvent(event)
}

export function dispatchDblclick(target, props) {
  const event = createEvent('', 'dblclick')
  Object.assign(event, props)
  target.dispatchEvent(event)
}

export function dispatchTap(target) {
  const touch = {
    clientX: target.offsetLeft + 1,
    clientY: target.offsetTop + 1
  }
  dispatchTouchStart(target, touch)
  dispatchTouchEnd(target, touch)
}

export function dispatchMouse (target, name = 'mousedown') {
  const event = createEvent('', name)
  const domRect = target.getBoundingClientRect()
  event.clientX = domRect.left + 1
  event.clientY = domRect.top + 1
  target.dispatchEvent(event)
}

export function dispatchTouch(target, name = 'touchstart', touches) {
  const event = createEvent('', name)
  event.touches = event.targetTouches = event.changedTouches = Array.isArray(touches) ? touches : [touches]
  target.dispatchEvent(event)
}

export function dispatchTouchStart(target, touches) {
  dispatchTouch(target, 'touchstart', touches)
}

export function dispatchTouchMove(target, touches) {
  dispatchTouch(target, 'touchmove', touches)
}

export function dispatchTouchEnd(target, touches) {
  dispatchTouch(target, 'touchend', touches)
}

export function dispatchSwipe(target, touches, duration, cb) {
  if (!Array.isArray(touches)) {
    touches = [touches]
  }
  dispatchTouchStart(target, touches[0])
  const moveAndEnd = () => {
    if (touches.length > 1) {
      for (let i = 1; i < touches.length; i++) {
        dispatchTouchMove(target, touches[i])
      }
    } else {
      dispatchTouchMove(target, touches[0])
    }
    dispatchTouchEnd(target, touches[touches.length - 1])
    cb && cb()
  }
  if (duration) {
    setTimeout(moveAndEnd, duration)
  } else {
    moveAndEnd()
  }
}

export function dispatchMoveAction(target, touches, stepDuration,


([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",AU).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),VOA=Zn(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,XG).getRegex(),l7="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",eU=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ZOA=Zn("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ 	]*)+\\n|$))","i").replace("comment",eU).replace("tag",l7).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ilA=Zn($G).replace("hr",yf).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",l7).getRegex(),WOA=Zn(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ilA).getRegex(),tU={blockquote:WOA,code:HOA,def:qOA,fences:zOA,heading:OOA,hr:yf,html:ZOA,lheading:tlA,list:VOA,newline:TOA,paragraph:ilA,table:Df,text:jOA},VcA=Zn("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\


9898, -13.938164971999925 ] ] ], [ [ [ -172.280506964999859, -13.493584893999923 ], [ -172.219064907999893, -13.805352471999967 ], [ -172.523182745999918, -13.805352471999967 ], [ -172.78258216099988, -13.520277601999851 ], [ -172.280506964999859, -13.493584893999923 ] ] ] ] } },
{ "type": "Feature", "properties": { "scalerank": 0, "featurecla": "Admin-0 country", "LABELRANK": 3, "SOVEREIGNT": "Yemen", "SOV_A3": "YEM", "ADM0_DIF": 0, "LEVEL": 2, "TYPE": "Sovereign country", "ADMIN": "Yemen", "ADM0_A3": "YEM", "GEOU_DIF": 0, "GEOUNIT": "Yemen", "GU_A3": "YEM", "SU_DIF": 0, "SUBUNIT": "Yemen", "SU_A3": "YEM", "BRK_DIFF": 0, "NAME": "Yemen", "NAME_LONG": "Yemen", "BRK_A3": "YEM", "BRK_NAME": "Yemen", "BRK_GROUP": null, "ABBREV": "Yem.", "POSTAL": "YE", "FORMAL_EN": "Republic of Yemen", "FORMAL_FR": null, "NOTE_ADM0": null, "NOTE_BRK": null, "NAME_SORT": "Yemen, Rep.", "NAME_ALT": null, "MAPCOLOR7": 5, "MAPCOLOR8": 3, "MAPCOLOR9": 3, "MAPCOLOR13": 11, "POP_EST": 23822783, "GDP_MD_EST": 55280, "POP_YEAR": -99, "LASTCENSUS": 2004, "GDP_YEAR": -99, "ECONOMY": "7. Least developed region", "INCOME_GRP": "4. Lower middle income", "WIKIPEDIA": -99, "FIPS_10_": "YM", "ISO_A2": "YE", "ISO_A3": "YEM", "ISO_N3": "887", "UN_A3": "887", "WB_A2": "RY", "WB_A3": "YEM", "WOE_ID": 23425002, "WOE_ID_EH": 23425002, "WOE_NOTE": "Exact WOE match as country", "ADM0_A3_IS": "YEM", "ADM0_A3_US": "YEM", "ADM0_A3_UN": -99, "ADM0_A3_WB": -99, "CONTINENT": "Asia", "REGION_UN": "Asia", "SUBREGION": "Western Asia", "REGION_WB": "Middle East & North Africa", "NAME_LEN": 5, "LONG_LEN": 5, "ABBREV_LEN": 4, "TINY": -99, "HOMEPART": 1 }, "geometry": { "type": "MultiPolygon", "coordinates": [ [ [ [ 53.308239457000155, 12.118394537000171 ], [ 53.310267307000146, 12.111443672000149 ], [ 53.248326142000082, 12.121302453000084 ], [ 53.268071121000077, 12.128831559000076 ], [ 53.308239457000155, 12.118394537000171 ] ] ], [ [ [ 53.03854985500007, 12.180332719000177 ], [ 53.082917786000081, 12.164794378000167 ], [ 53.086378447000158, 12.134344390000123 ], [ 52.985265038000108, 12.162727253000099 ], [ 53.03854985500007, 12.180332719000177 ] ] ], [ [ [ 52.178876221000138, 12.213943448000165 ], [ 52


源网络，侵删）

记得多用消毒液什么的多消毒一下 ，没有什么大碍的 ，家养猫咪本来就很爱干净 ，所以被抓伤了也没什么事 。但是要是野猫的话建议去医院问问怎么办 。

被猫抓伤超过24小时也是需要***的，在48小时之内都是可以进行疫苗注射的，但是建议最好还是在被抓伤后的24小时内完成疫苗注射，抵抗病毒的时间是最好的。

...一点点血而已,我没有任何的清理,已经超过了24小时,会不会有事_百度...

人家强调24小时，或者是48小时，是怕在这个时间段之内就发病，来不及***。

正常的！用一个很好理解的方法解释就是，做人流就好像其他的外科手术一下，做手术总要出点血的，没有血了就说明身体本身自己在一点一点愈合伤口。所以不用担心了。记得好好休息，一个月不能同房。

<img style="max-width: 100%;" alt="猫轻微抓伤有一点渗血过了24小时会好吗（猫�


Collection, self).__init__(sources, **kwargs)
        self.connections = connections

    @coroutine
    def async_fetch(self):
        """Fetch all source urls"""
        args = (async_get_pipe, self.zargs, self.connections)
        mapped = yield ait.async_map(*args)
        return_value(multiplex(mapped))

    def async_pipe(self, **kwargs):
        """Return an AsyncPipe primed with the source feed"""
        return AsyncPipe(source=self.async_fetch(), **kwargs)

    @property
    @coroutine
    def list(self):
        result = yield self.async_fetch()
        return_value(list(result))

def get_chunksize(length, workers):
    return (length // (workers * 4)) or 1

def get_worker_cnt(length, threads=True):
    multiplier = 2 if threads else 1
    return min(length or 1, cpu_count() * multiplier)

def lenish(source, default=50):
    funcs = (len, lambda x: x.__length_hint__())
    errors = (TypeError, AttributeError)
    zipped = list(zip(funcs, errors))
    return multi_try(source, zipped, default)

def listpipe(args):
    source, pipeline = args
    return list(pipeline(source))

def getpipe(args, pipe=SyncPipe):
    source, conf = args
    ptype = source.get("type", "fetch")
    return pipe(ptype, conf=merge([conf, source])).output

@coroutine
def async_list_pipe(args):
    source, async_pipeline = args
    output = yield async_pipeline(source)
    return_value(list(output))

async_get_pipe = partial(getpipe, pipe=AsyncPipe)


.util.ApiUtil;

import java.util.Collections;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;

/**
 *
 * @author Stan Silvert ssilvert@redhat.com (C) 2016 Red Hat Inc.
 */

public class ClientProtocolMapperTest extends AbstractProtocolMapperTest {

    private ClientResource oidcClientRsc;
    private String oidcClientId;
    private ProtocolMappersResource oidcMappersRsc;
    private ClientResource samlClientRsc;
    private String samlClientId;
    private ProtocolMappersResource samlMappersRsc;

    @BeforeEach
    public void init() {
        oidcClientId = createOidcClient("oidcMapperClient");
        oidcClientRsc = findClientResource("oidcMapperClient");
        oidcMappersRsc = oidcClientRsc.getProtocolMappers();

        samlClientId = createSamlClient("samlMapperClient");
        samlClientRsc = findClientResource("samlMapperClient");
        samlMappersRsc = samlClientRsc.getProtocolMappers();

        super.initBuiltinMappers();
    }

    @AfterEach
    public void tearDown() {
        removeClient(oidcClientId);
        removeClient(samlClientId);
    }

    @Test
    public void test01GetMappersList() {
        // Built-in protocol mappers are empty by default
        assertTrue(oidcMappersRsc.getMappers().isEmpty());
        assertTrue(samlMappersRsc.getMappers().isEmpty());
    }

    @Test
    public void test02CreateOidcMappersFromList() {
        testAddAllBuiltinMappers(oidcMappersRsc, "openid-connect");
    }

    @Test
    public void test03CreateSamlMappersFromList() {
        testAddAllBuiltinMappers(samlMappersRsc, "saml");
    }

    @Test
    public void test04CreateSamlProtocolMapper() {

        //{"protocol":"saml",
        // "config":{"role":"account.view-profile","new.role.name":"new-role-name"},
        // "consentRequired":true,
        // "consentText":"My consent text",
        // "name":"saml-role-name-maper",
        // "protocolMapper":"saml-role-name-mapper"}
        ProtocolMapperRepresentation rep = makeSamlMapper("saml-role-name-mapper");

        int totalMappers = samlMappersRsc.getMappers().size();
        int totalSamlMappers = samlMappersRsc.getMappersPerProtocol("saml").size();
        Response resp = samlMappersRsc.createMapper(rep);
        resp.close();
        String createdId = ApiUtil.getCreatedId(resp);

        assertEquals(totalMappers + 1, samlMappersRsc.getMappers().size());
        assertEquals(totalSamlMappers + 1, samlMappersRsc.getMappersPerProtocol("saml").size());

        ProtocolMapperRepresentation created = samlMappersRsc.getMapperById(createdId);
        assertEqualMappers(rep, created);
    }

    @Test
    public void test05CreateOidcProtocolMapper() {
        //{"protocol":"openid-connect",
        // "config":{"role":"myrole"},
        // "consentRequired":true,
        // "consentText":"My consent text",
        // "name":"oidc-hardcoded-role-mapper",
        // "protocolMapper":"oidc-hardcoded-role-mapper"}
        ProtocolMapperRepresentation rep = makeOidcMapper("oidc-hardcoded-role-mapper");

        int totalMappers = oidcMappersRsc.getMappers().size();
        int totalOidcMappers = oidcMappersRsc.getMappersPerProtocol("openid-


stances();
	end
	if g_iUs == -1 or g_iThem == -1 then
		return;
	end

	--print("Displaying Deal");

	local itemType;
	local duration;
	local finalTurn;
	local data1;
	local data2;
	local data3;
	local flag1;
	local fromPlayer;

	local strString;
	local strTooltip;

	ResetDisplay();

	local iNumItemsFromUs = 0;
	local iNumItemsFromThem = 0;

	g_Deal:ResetIterator();
	if bnw_mode then
		itemType, duration, finalTurn, data1, data2, data3, flag1, fromPlayer = g_Deal:GetNextItem();
	else
		itemType, duration, finalTurn, data1, data2, fromPlayer = g_Deal:GetNextItem();
	end

	local iItemToBeChanged = -1;	-- This is -1 because we're not changing anything right now

	--print("Going through check");
	if( itemType ~= nil ) then
	repeat
		local bFromUs = false;

		--print("Adding trade item to active deal: " .. itemType);

		if( fromPlayer == (OverridePlayer or Game.GetActivePlayer()) ) then
			bFromUs = true;
			iNumItemsFromUs = iNumItemsFromUs + 1;
		else
			iNumItemsFromThem = iNumItemsFromThem + 1;
		end

		if( TradeableItems.TRADE_ITEM_PEACE_TREATY == itemType ) then
			local str = Locale.ConvertTextKey("TXT_KEY_DIPLO_PEACE_TREATY", g_iPeaceDuration);
			if( bFromUs ) then
				Controls.UsTablePeaceTreaty:SetText(str);
				Controls.UsTablePeaceTreaty:SetHide( false );
			else
				Controls.ThemTablePeaceTreaty:SetText(str);
				Controls.ThemTablePeaceTreaty:SetHide( false );
			end

		elseif( TradeableItems.TRADE_ITEM_GOLD == itemType ) then

			Controls.UsPocketGold:SetHide( true );
			Controls.ThemPocketGold:SetHide( true );

			Controls.UsTableGold:SetHide( not bFromUs );
			Controls.ThemTableGold:SetHide( bFromUs );

			-- update quantity
			if( bFromUs ) then
				Controls.UsGoldAmount:SetText( data1 );

				strString = Locale.ConvertTextKey("TXT_KEY_DIPLO_GOLD");
				Controls.UsTableGold:SetText( strString );
				strTooltip = Locale.ConvertTextKey( "TXT_KEY_DIPLO_CURRENT_GOLD", g_Deal:GetGoldAvailable(g_iUs, iItemToBeChanged) );
				Controls.UsTableGold:SetToolTipString( strTooltip );
			else
				Controls.ThemGoldAmount:SetText( data1 );

				strString = Locale.ConvertTextKey("TXT_KEY_DIPLO_GOLD");
				Controls.ThemTableGold:SetText( strString );
				strTooltip = Locale.ConvertTextKey( "TXT_KEY_DIPLO_CURRENT_GOLD", g_Deal:GetGoldAvailable(g_iThem, iItemToBeChanged) );
				Controls.ThemTableGold:SetToolTipString( strTooltip );
			end

		elseif( TradeableItems.TRADE_ITEM_GOLD_PER_TURN == itemType ) then

			Controls.UsPocketGoldPerTurn:SetHide( true );
			Controls.ThemPocketGoldPerTurn:SetHide( true );

			if( bFromUs ) then
				Controls.UsTableGoldPerTurn:SetHide( false );
				Controls.UsGoldPerTurnTurns:LocalizeAndSetText( "TXT_KEY_DIPLO_TURNS", duration );
				Controls.UsGoldPerTurnAmount:SetText( data1 );

				strString = Locale.ConvertTextKey( "TXT_KEY_DIPLO_GOLD_PER_TURN" );
				Controls.UsTableGoldPerTurnButton:SetText( strString );


 === forcedLevel || set.level === maxForcedLevel) {
			// Note that we're temporarily setting level 50 pokemon in VGC to level 100
			// This allows e.g. level 50 Hydreigon even though it doesn't evolve until level 64.
			// Leveling up can't make an obtainable pokemon unobtainable, so this is safe.
			// Just remember to set the level back to forcedLevel at the end of the file.
			set.level = maxLevel;
		}

		const nameTemplate = dex.getTemplate(set.name);
		if (nameTemplate.exists && nameTemplate.name.toLowerCase() === set.name.toLowerCase()) {
			// Name must not be the name of another pokemon
			set.name = '';
		}
		set.name = set.name || template.baseSpecies;
		let name = set.species;
		if (set.species !== set.name && template.baseSpecies !== set.name) name = `${set.name} (${set.species})`;
		let isHidden = false;
		const lsetData: PokemonSources = {sources: [], sourcesBefore: dex.gen};

		const setHas: {[k: string]: true} = {};
		const ruleTable = this.ruleTable;

		for (const [rule] of ruleTable) {
			const subformat = dex.getFormat(rule);
			if (subformat.onChangeSet && ruleTable.has(subformat.id)) {
				problems = problems.concat(subformat.onChangeSet.call(dex, set, format, setHas, teamHas) || []);
			}
		}
		if (format.onChangeSet) {
			problems = problems.concat(format.onChangeSet.call(dex, set, format, setHas, teamHas) || []);
		}

		// onChangeSet can modify set.species, set.item, set.ability
		template = dex.getTemplate(set.species);
		item = dex.getItem(set.item);
		ability = dex.getAbility(set.ability);

		if (ability.id === 'battlebond' && template.id === 'greninja' && !ruleTable.has('ignoreillegalabilities')) {
			template = dex.getTemplate('greninjaash');
			if (set.gender && set.gender !== 'M') {
				problems.push(`Battle Bond Greninja must be male.`);
			}
			set.gender = 'M';
		}
		if (ability.id === 'owntempo' && template.id === 'rockruff') {
			template = dex.getTemplate('rockruffdusk');
		}
		if (!template.exists) {
			return [`The Pokemon "${set.species}" does not exist.`];
		}

		if (item.id && !item.exists) {
			return [`"${set.item}" is an invalid item.`];
		}
		if (ability.id && !ability.exists) {
			if (dex.gen < 3) {
				// gen 1-2 don't have abilities, just silently remove
				ability = dex.getAbility('');
				set.ability = '';
			} else {
				return [`"${set.ability}" is an invalid ability.`];
			}
		}
		if (set.nature && !dex.getNature(set.nature).exists) {
			if (dex.gen < 3) {
				// gen 1-2 don't have natures, just remove them
				set.nature = '';
			} else {
				problems.push(`${name}'s nature is invalid.`);
			}
		}
		if (set.happiness !== undefined && isNaN(set.happiness)) {
			problems.push(`${name} has an invalid happiness.`);
		}
		if (set.hpType && (!dex.getType(set.hpType).exists || ['normal', 'fairy'].includes(toID(set.hpType)))) {
			problems.push(`${name}'s Hidden Power type (${set.hpType}) is invalid.`);
		}

		let banReason = ruleTable.check('pokemon:' + te


breadth-first search (BFS) starting from node 0?

# Choices
- [x] 0, 1, 2, 3
- [ ] 0, 1, 3, 2
- [ ] 0, 2, 3, 1
- [ ] 0, 1, 3, 1

---
title: Quiz Explanation
description:
duration: 30
card_type: cue_card
---
The correct answer is (a) 0, 1, 2, 3.

BFS (Breadth-First Search) explores neighbor nodes first before moving to the next level. Starting from node 0, BFS visits its neighbors 1 and 2. It then moves to the next level and visits 1's neighbor 3. Finally, it moves to the next level but finds no more unvisited nodes. Therefore, the order of BFS traversal is 0, 1, 2, 3.

---
title: Multisource BFS
description:
duration: 2000
card_type: cue_card
---

#### Problem
There are N number of nodes and multisource(S1,S2,S3), we need to find the length of shortest path for given destination node to any one of the source node{S1,S2,S3}.

#### Solution
Length = 2
In the beginning, we need to push all source node at once and apply exact BFS,then return the distance of destination node.
#### Time and Space Complexity
* **TC -** O(N+E)
* **SC -** O(N+E)

---
title: Rotten Oranges
description:
duration: 2000
card_type: cue_card
---

#### Problem
There is given a matrix and there are 3 values where 0 means empty cell, 1 means fresh orange present and 2 means rotten orange prsent, we need to find the time when all oranges will become rotten.
**Note:** If not possible, return - 1.

#### Solution

**Answer:** after 3 minutes all oranges will get rotten.
* Initially, We need to insert all rotten oranges in Queue (where each element in queue is in a pair),
* Then check if any fresh oranges has become rotten and if they did, return the time otherwise return -1.

#### Pseudocode
```java
public class RottingOranges {
    private static final int[] dx = {-1, 1, 0, 0};
    private static final int[] dy = {0, 0, -1, 1};

    public int orangesRotting(int[][] grid) {
        int rowCount = grid.length;
        int colCount = grid[0].length;
        Queue<int[]> queue = new LinkedList<>();
        int freshOranges = 0;
        int minutes = 0;

        // Count fresh oranges and add rotten oranges to the queue
        for (int i = 0; i < rowCount; i++) {
            for (int j = 0; j < colCount; j++) {
                if (grid[i][j] == 2) {
                    queue.offer(new int[]{i, j, minutes});
                } else if (grid[i][j] == 1) {
                    freshOranges++;
                }
            }
        }
        if (freshOranges == 0) {
            // If there are no fresh oranges initially, they are already rotten.
            return 0;
        }

        while (!queue.isEmpty()) {
            int[] cell = queue.poll();
            int x = cell[0];
            int y = cell[1];


nt values are not changed
    #[test]
    fn test_describe_account_override() {
        verify_account_override(LoginOverride::AutologinGuest, "autologinguest");
        verify_account_override(LoginOverride::None, "none");
        verify_account_override(LoginOverride::AuthProvider, "auth");
    }

    fn verify_account_override(login_override: LoginOverride, expected: &str) {
        match describe_login_override(Some(login_override)) {
            Ok(description) => {
                assert_eq!(description, expected);
            }
            _ => {
                panic!("expected");
            }
        }
    }
}
<reponame>reinfer/elastic<gh_stars>100-1000
use super::mapping::{
    TextFieldType,
    TextMapping,
};
use crate::types::string::mapping::DefaultStringMapping;
use serde::{
    de::{
        Error,
        Visitor,
    },
    Deserialize,
    Deserializer,
    Serialize,
    Serializer,
};
use std::{
    borrow::Borrow,
    marker::PhantomData,
};

impl TextFieldType<DefaultStringMapping> for String {}
impl<'a> TextFieldType<DefaultStringMapping> for &'a str {}

/**
An Elasticsearch `text` field with a mapping.

Where the mapping isn't custom, you can use the standard library `String` instead.

# Examples

Defining a `text` field with a mapping:

```
use elastic::types::string::text::mapping::DefaultTextMapping;
use elastic::types::string::text::Text;

let string = Text::<DefaultTextMapping>::new("my string value");
```
*/
#[derive(Debug, Clone, Default, PartialEq)]
pub struct Text<TMapping>
where
    TMapping: TextMapping,
{
    value: String,
    _m: PhantomData<TMapping>,
}

impl<TMapping> Text<TMapping>
where
    TMapping: TextMapping,
{
    /**
    Creates a new `Text` with the given mapping.

    # Examples

    Create a new `Text` from a `String`:

    ```
    use elastic::types::string::text::mapping::DefaultTextMapping;
    use elastic::types::string::text::Text;

    let string = Text::<DefaultTextMapping>::new("my string");
    ```
    */
    pub fn new<I>(string: I) -> Text<TMapping>
    where
        I: Into<String>,
    {
        Text {
            value: string.into(),
            _m: PhantomData,
        }
    }

    /** Change the mapping of this string. */
    pub fn remap<TNewMapping>(text: Text<TMapping>) -> Text<TNewMapping>
    where
        TNewMapping: TextMapping,
    {
        Text::new(text.value)
    }
}

impl_string_type!(Text, TextMapping, TextFieldType);
<gh_stars>0
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.

use crate::{fail::Fail, runtime::RuntimeBuf};

use std::{
    fmt,
    ops::{Deref, DerefMut},
    sync::Arc,
};

//==============================================================================
// Bytes
//==============================================================================

/// Non-Mutable Buffer
#[derive(Clone, Default)]
pub struct Bytes {
    buf: Option<Arc<[u8]>>,
    offset: usize,
    len: usize,
}

/// Equality of Bytes only depends on the data values and not in the offset of the buffer.
impl PartialEq for Bytes {
    fn eq(&self, rhs: &Self) -> bool {
        self[..] == rhs[..]
    }
}

impl Eq for Bytes {}

/// Runtime implementation for non-mutable buffers.
impl RuntimeBuf for Bytes {
    /// Creates an empty runtime buffer.
    fn empty() -> Self {
        Self::default()
    }

    fn from_slice(src: &[


 nonNullName = name ?: return null

        return LineAuthenticationParams.BotPrompt.values().firstOrNull {
            it.name.equals(nonNullName, ignoreCase = true)
        }
    }

    companion object {
        private const val KEY_IDENTIFIER = "identifier"
        private const val KEY_CHANNEL_ID = "channelId"
        private const val KEY_SCOPE = "scope"
        private const val KEY_ONLY_WEB_LOGIN = "onlyWebLogin"
        private const val KEY_BOT_PROMPT = "botPrompt"
        private const val KEY_TOKEN_NONCE = "tokenNonce"

        private const val REQUEST_CODE_LOGIN: Int = 1234
        private const val TAG: String = "LineSdkWrapperActivity"
        private val gson: Gson = Gson()

        fun startActivity(
            activity: Activity,
            identifier: String,
            channelId: String,
            scope: String,
            onlyWebLogin: Boolean,
            botPrompt: String,
            tokenNonce: String?
        ) {
            val intent = Intent(activity, LineSdkWrapperActivity::class.java).apply {
                addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION)
                putExtra(KEY_IDENTIFIER, identifier)
                putExtra(KEY_CHANNEL_ID, channelId)
                putExtra(KEY_SCOPE, scope)
                putExtra(KEY_ONLY_WEB_LOGIN, onlyWebLogin)
                putExtra(KEY_BOT_PROMPT, botPrompt)
                putExtra(KEY_TOKEN_NONCE, tokenNonce)
            }
            activity.startActivityForResult(intent,
                REQUEST_CODE_LOGIN
            )
        }
    }
}/*
 *  Copyright 2024 LY Corporation
 *
 *  LY Corporation licenses this file to you under the Apache License,
 *  version 2.0 (the "License"); you may not use this file except in compliance
 *  with the License. You may obtain a copy of the License at:
 *
 *  https://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 *  License for the specific language governing permissions and limitations
 *  under the License.
 */

package com.linecorp.cse.reqshield.service

import com.linecorp.cse.reqshield.dto.Product
import com.linecorp.cse.reqshield.spring.annotation.ReqShieldCacheEvict
import com.linecorp.cse.reqshield.spring.cache.ReqShieldCache
import org.slf4j.LoggerFactory
import org.springframework.cache.annotation.Cacheable
import org.springframework.stereotype.Service

private val log = LoggerFactory.getLogger(CacheableGetProductService::class.java)

@Service
class CacheableGetProductService(
    private val reqShieldCache: ReqShieldCache<Product>,
) {
    @Cacheable(cacheNames = ["product"])
    fun getProduct(productId: String): Product {
        log.info("get product with 3s delay (Simulate db request) / productId : $productId")

        Thread.sleep(3000)

        return Product(productId, "product_$productId")
    }

    @ReqShieldCacheEvict(cacheName = "product")
    fun removeProduct(productId: String) {
        log.info("remove product ($productId)")
    }
}
/*
 *  Copyright 2024 LY Corporation
 *
 *  LY Corporation licenses this file to you under the Apache License,
 *  version 2.0 (the "License"); you may not use this file except in compliance
 *  with the License. You may obtain a copy of the License at:
 *
 *  https://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distr


 *handle)
{
   unsigned long ret = winapi::wait_for_single_object(handle, 0);
   if(ret == winapi::wait_object_0){
      return true;
   }
   else if(ret == winapi::wait_timeout){
      return false;
   }
   else{
      error_info err = system_error_code();
      throw interprocess_exception(err);
   }
}

inline bool winapi_wrapper_timed_wait_for_single_object(void *handle, const boost::posix_time::ptime &abs_time)
{
   //Windows does not support infinity abs_time so check it
   if(abs_time == boost::posix_time::pos_infin){
      winapi_wrapper_wait_for_single_object(handle);
      return true;
   }
   const boost::posix_time::ptime cur_time = microsec_clock::universal_time();
   //Windows uses relative wait times so check for negative waits
   //and implement as 0 wait to allow try-semantics as POSIX mandates.
   unsigned long ret = winapi::wait_for_single_object
      ( handle
      , (abs_time <= cur_time) ? 0u
                                 : (abs_time - cur_time).total_milliseconds()
      );
   if(ret == winapi::wait_object_0){
      return true;
   }
   else if(ret == winapi::wait_timeout){
      return false;
   }
   else{
      error_info err = system_error_code();
      throw interprocess_exception(err);
   }
}

}  //namespace ipcdetail {
}  //namespace interprocess {
}  //namespace boost {

#include <boost/interprocess/detail/config_end.hpp>

#endif   //BOOST_INTERPROCESS_DETAIL_WINAPI_MUTEX_WRAPPER_HPP
//////////////////////////////////////////////////////////////////////////////
//
// (C) Copyright Ion Gaztanaga 2005-2012. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/interprocess for documentation.
//
//////////////////////////////////////////////////////////////////////////////

#ifndef BOOST_INTERPROCESS_POSIX_NAMED_CONDITION_HPP
#define BOOST_INTERPROCESS_POSIX_NAMED_CONDITION_HPP

#ifndef BOOST_CONFIG_HPP
#  include <boost/config.hpp>
#endif
#
#if defined(BOOST_HAS_PRAGMA_ONCE)
#  pragma once
#endif

#include <boost/interprocess/detail/config_begin.hpp>
#include <boost/interprocess/detail/workaround.hpp>

#include <boost/interprocess/sync/posix/semaphore_wrapper.hpp>

namespace boost {
namespace interprocess {

#if !defined(BOOST_INTERPROCESS_DOXYGEN_INVOKED)
namespace ipcdetail{ class interprocess_tester; }
#endif   //#ifndef BOOST_INTERPROCESS_DOXYGEN_INVOKED

namespace ipcdetail {

class posix_named_semaphore
{
   posix_named_semaphore();
   posix_named_semaphore(const posix_named_semaphore&);
   posix_named_semaphore &operator= (const posix_named_semaphore &);

   public:
   posix_named_semaphore
      (create_only_t, const char *name, unsigned int initialCount, const permissions &perm = permissions())
   {  semaphore_open(mp_sem, DoCreate, name, initialCount, perm);   }

   posix_named_semaphore(open_or_create_t, const char *name, unsigned int initialCount, const permissions &perm = permissions())
   {  semaphore_open(mp_sem, DoOpenOrCreate, name, initialCount, perm);   }

   posix_named_semaphore(open_only_t, const char *name)
   {  semaphore_open(mp_


)
	}

	u := c.baseURL.JoinPath(ingestPath, action, peerID.String())
	req, err := http.NewRequestWithContext(ctx, method, u.String(), body)
	if err != nil {
		return err
	}

	if len(queryPairs) != 0 {
		qpLen := len(queryPairs)
		if qpLen%2 != 0 {
			return fmt.Errorf("number of query pairs must be even; got %d", qpLen)
		}

		values := req.URL.Query()
		for i := 0; i < qpLen; i += 2 {
			values.Add(queryPairs[i], queryPairs[i+1])
		}
		req.URL.RawQuery = values.Encode()
	}

	resp, err := c.c.Do(req)
	if err != nil {
		return err
	}
	defer resp.Body.Close()

	if resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusAccepted {
		body, err := io.ReadAll(resp.Body)
		if err != nil {
			return err
		}
		return apierror.FromResponse(resp.StatusCode, body)
	}

	return nil
}
package registry

import (
	"errors"
	"sync"
	"time"

	"github.com/libp2p/go-libp2p/core/peer"
)

const defaultMaxAge = 48 * time.Hour
const seqRetireInterval = time.Hour

type sequences struct {
	lastRetire time.Time
	maxAge     time.Duration
	mutex      sync.Mutex
	seqs       map[peer.ID]uint64
}

func newSequences(maxAge time.Duration) *sequences {
	if maxAge == 0 {
		maxAge = defaultMaxAge
	}
	return &sequences{
		maxAge: maxAge,
		seqs:   make(map[peer.ID]uint64),
	}
}

func (s *sequences) check(id peer.ID, sequence uint64) error {
	oldestAllowed := uint64(time.Now().Add(-s.maxAge).UnixNano())
	if sequence < oldestAllowed {
		return errors.New("sequence too small")
	}

	s.mutex.Lock()
	defer s.mutex.Unlock()

	prevSeq, ok := s.seqs[id]
	if ok && sequence <= prevSeq {
		return errors.New("sequence less than or equal to last seen")
	}
	s.seqs[id] = sequence

	if time.Since(s.lastRetire) > seqRetireInterval {
		go s.retire()
	}
	return nil
}

func (s *sequences) retire() {
	oldestAllowed := uint64(time.Now().Add(-s.maxAge).UnixNano())
	active := make(map[peer.ID]uint64)

	s.mutex.Lock()
	defer s.mutex.Unlock()

	for id, seq := range s.seqs {
		if seq > oldestAllowed {
			active[id] = seq
		}
	}
	s.seqs = active
	s.lastRetire = time.Now()
}
package registry

import (
	"testing"
	"time"

	"github.com/ipfs/go-cid"
	"github.com/ipfs/go-test/random"
	"github.com/libp2p/go-libp2p/core/peer"
	"github.com/multiformats/go-multiaddr"
	"github.com/multiformats/go-multihash"
	"github.com/stretchr/testify/require"
)

func TestRegToApiProviderInfo(t *testing.T) {
	peerID, err := peer.Decode(limitedID)
	require.NoError(t, err)
	maddr, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/3002")
	require.NoError(t, err)
	provAddrInfo := peer.AddrInfo{
		ID:    peerID


000000 15 0 f")
            << u"hi_IN"_s << qlonglong(23000000)  << 15  << U'0' << false << u"000000023000000"_s;
    QTest::newRow("hi_IN 23000000 -15 0 t")
            << u"hi_IN"_s << qlonglong(23000000)  << -15 << U'0' << true  << u"2,30,00,0000000"_s;
    QTest::newRow("hi_IN 23000000 -15 0 f")
            << u"hi_IN"_s << qlonglong(23000000)  << -15 << U'0' << false << u"230000000000000"_s;
    QTest::newRow("hi_IN -23000000 -15 0 t")
            << u"hi_IN"_s << qlonglong(-23000000) << -15 << U'0' << true  << u"-2,30,00,000000"_s;
    QTest::newRow("hi_IN -23000000 -15 0 f")
            << u"hi_IN"_s << qlonglong(-23000000) << -15 << U'0' << false << u"-23000000000000"_s;
    QTest::newRow("hi_IN -23000000 15 0 t")
            << u"hi_IN"_s << qlonglong(-23000000) << 15  << U'0' << true  << u"-0002,30,00,000"_s;
    QTest::newRow("hi_IN -23000000 15 0 f")
            << u"hi_IN"_s << qlonglong(-23000000) << 15  << U'0' << false << u"-00000023000000"_s;

    QTest::newRow("emoji -2300 7 😀 f")
        << u"en_US"_s << qlonglong(-23000) << 7  << U'😀' << false << u"😀-23000"_s;
    QTest::newRow("emoji -2300 -7 😀 f")
        << u"en_US"_s << qlonglong(-23000) << -7 << U'😀' << false << u"-23000😀"_s;
    QTest::newRow("emoji -2300 8 😀 t")
        << u"en_US"_s << qlonglong(-23000) << 8  << U'😀' << true  << u"😀-23,000"_s;
    QTest::newRow("emoji -2300 -8 😀 t")
        << u"en_US"_s << qlonglong(-23000) << -8 << U'😀' << true  << u"-23,000😀"_s;

    QTest::newRow("ar_EG 0 0 x f")
        << u"ar_EG"_s << qlonglong(0) << 0 << U'x' << false << u"\u0660"_s;
    QTest::newRow("ar_EG 0 0 x t")
        << u"ar_EG"_s << qlonglong(0) << 0 << U'x' << true << u"\u0660"_s;

    QTest::newRow("ccp_BD 0 0 𑄃 t")
        << u"ccp_BD"_s << qlonglong(0) << 0  << U'𑄃' << false << u"𑄶"_s;
    QTest::newRow("ccp_BD 0 0 𑄃 f")
        << u"ccp_BD"_s << qlonglong(0) << 0  << U'𑄃' << true << u"𑄶"_s;
    QTest::newRow("ccp_BD -2300 6 𑄃 f")
        << u"ccp_BD"_s << qlonglong(-2300) << 6  << U'𑄃' << false << u"𑄃-𑄸𑄹𑄶𑄶"_s;
    QTest::newRow("ccp_BD -2300 -6 𑄃 f")
        << u"ccp_BD"_s << qlonglong(-2300) << -6 << U'𑄃' << false << u"-𑄸𑄹𑄶𑄶𑄃"_s;
    QTest::newRow("ccp_BD -2300 7 𑄃 t")
        << u"ccp_BD"_s << qlong


$060, r0
	jsr	pc,PUTC
	jbr     start
2:
	mov	(sp)+,r2
	mov	(sp)+,r3
	mov	(sp)+,r4
	mov	(sp)+,r5
	mo


chGroup, ConVar* pmm_match_group_size )
		:	IMatchGroupDescription( eMatchGroup
								  , { eMatchMode_MatchMaker_LateJoinMatchBased // m_eLateJoinMode;
								  , eMMPenaltyPool_Ranked	   // m_ePenaltyPool
								  , true					   // m_bUsesSkillRatings;
								  , true					   // m_bSupportsLowPriorityQueue;
								  , true					   // m_bRequiresMatchID;
								  , LADDER_REQUIRED_SCORE	   // m_pmm_required_score;
								  , true					   // m_bUseMatchHud;
								  , "server_competitive.cfg"   // m_pszExecFileName;
								  , pmm_match_group_size	   // m_pmm_match_group_size;
								  , NULL					   // m_pmm_match_group_size_minimum;
								  , MATCH_TYPE_COMPETITIVE	   // m_eMatchType;
								  , true					   // m_bShowPreRoundDoors;
								  , true					   // m_bShowPostRoundDoors;
								  , "#TF_Competitive_GameOver" // m_pszMatchEndKickWarning;
								  , "MatchMaking.RoundStart"   // m_pszMatchStartSound;
								  , false					   // m_bAutoReady;
								  , true					   // m_bShowRankIcons;
								  , true					   // m_bUseMatchSummaryStage;
								  , true					   // m_bDistributePerformanceMedals;
								  , true					   // m_bIsCompetitiveMode;
								  , true					   // m_bUseFirstBlood;
								  , true					   // m_bUseReducedBonusTime;
								  , false					   // m_bUseAutoBalance;
								  , false					   // m_bAllowTeamChange;
								  , false					   // m_bRandomWeaponCrits;
								  , true					   // m_bFixedWeaponSpread;
								  , true					   // m_bRequireCompleteMatch;
								  , true					   // m_bTrustedServersOnly;
								  , true					   // m_bForceClientSettings;
								  , true					   // m_bAllowDrawingAtMatchSummary
								  , false					   // m_bAllowSpecModeChange
								  , false					   // m_bAutomaticallyRequeueAfterMatchEnds
								  , false					   // m_bUsesMapVoteOnRoundEnd
								  , false					   // m_bUsesXP
								  , true					   // m_bUsesDashboardOnRoundEnd
								  , true					   // m_bUsesSurveys
								  , true } )				   // m_bStrictMatchmakerScoring
	{
		m_pProgressionDesc = new CLadderProgressionDesc( eMatchGroup );
	}

#ifdef GC_DLL
	virtual EMMRating PrimaryMMRatingBackend() const OVERRIDE
	{
		// Right now all ladders have this hard-coded. Live-swapping won't work either, since lobbies don't know what
		// they were formed with in Match_Result
		FixmeMMRatingBackendSwapping();
		return k_nMMRating_6v6_DRILLO;
	}

	virtual const std::vector< EMMRating > &MatchResultRatingBackends() const OVERRIDE
	{
		FixmeMMRatingBackendSwapping(); // Shouldn't be hard-coded for 6v6, param
		static std::vector< EMMRating > ladderRatings = { k_nMMRating_6v6_DRILLO, k_nMMRating_6v6_GLICKO };
		return ladderRatings;
	}

	virtual bool InitMatchFromParty( MatchDescription_t* pMatch, const MatchParty_t* pParty ) const OVERRIDE { return true; }
	virtual bool InitMatchFromLobby( MatchDescription_t* pMatch, CTFLobby* pLobby ) const OVERRIDE { return true; }
	virtual void SyncMatchParty( const CTFParty *pParty, MatchParty_t *pMatchParty ) const OVERRIDE {};
	virtual void SelectModeSpecificParameters( const MatchDescription_t* pMatch, CTFLobby* pLobby ) const OVERRIDE
	{
		// Forced to use the


validateAgainst

public final org.codehaus.stax2.validation.XMLValidator validateAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
                                                                 throws XMLStreamException

Specified by:
validateAgainst in interface org.codehaus.stax2.validation.Validatable

Throws:

XMLStreamException

stopValidatingAgainst

public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidationSchema schema)
                                                                       throws XMLStreamException

Specified by:
stopValidatingAgainst in interface org.codehaus.stax2.validation.Validatable

Throws:

XMLStreamException

stopValidatingAgainst

public final org.codehaus.stax2.validation.XMLValidator stopValidatingAgainst(org.codehaus.stax2.validation.XMLValidator validator)
                                                                       throws XMLStreamException

Specified by:
stopValidatingAgainst in interface org.codehaus.stax2.validation.Validatable

Throws:

XMLStreamException

<


MztzdG9wLW9wYWNpdHk6MSIvPjxzdG9wIG9mZnNldD0iMTAwJSIgc3R5bGU9InN0b3AtY29sb3I6I2FhYTtzdG9wLW9wYWNpdHk6MSIvPjwvbGluZWFyR3JhZGllbnQ+PC9kZWZzPjxwYXRoIGQ9Ik0xMSA2SDR2MWgxdjFoMXYxaDF2MWgxVjloMVY4aDFWN2gxVjZaIiBmaWxsPSJ1cmwoI2EpIi8+PC9zdmc+"),var(--button-gradient-active);border-color:var(--button-border-color-active);box-shadow:var(--button-shadow-active);outline:none}select:not([multiple]):focus{box-shadow:inset 0 0 0 2px var(--button-shade-light-active);outline:1px dotted #000;outline-offset:-4px}fieldset{border:1px solid #cdd7db;border-radius:var(--border-radius);box-shadow:inset 0 0 0 1px #fff;margin:0;padding:calc(var(--border-width)*2 + var(--element-spacing));-webkit-padding-before:var(--element-spacing);padding-block-start:var(--element-spacing)}fieldset legend{font:var(--font)}.field-row{align-items:center;display:flex}.field-row>*+*{margin-left:var(--grouped-element-spacing)}.field-row-stacked{display:flex;flex-direction:column}.field-row-stacked *+*,[class^=field-row]+[class^=field-row]{margin-top:var(--grouped-element-spacing)}[role=listbox],select[multiple]{background:#fff;border:1px solid #c0c1cd;display:block;font:var(--font);overflow-y:scroll}[role=listbox].has-shadow,select[multiple].has-shadow{box-shadow:4px 4px 3px -2px #999}[role=listbox].has-hover li:hover,select[multiple].has-hover li:hover{background-color:#2a90ff;color:#fff}[role=listbox]:focus,select[multiple]:focus{outline:none}[role=listbox] [role=option],[role=listbox] option,select[multiple] [role=option],select[multiple] option{padding:2px}[role=listbox] [role=option]:focus,[role=listbox] [role=option][aria-selected],[role=listbox] option:focus,[role=listbox] option[aria-selected],select[multiple] [role=option]:focus,select[multiple] [role=option][aria-selected],select[multiple] option:focus,select[multiple] option[aria-selected]{background-color:#2a90ff;color:#fff}:root{--listview-chevron-size:5px;--listview-background:#fff;--listview-border:1px solid;--listview-border-color:#eee;--listview-border-color-header:#d7d7d7;--listview-gradient:linear-gradient


ture: Testing feature
  Scenario: Testing scenario
    Given the following users exist <name> <twitter>
    | name            | twitter       |
    | 'Oleksandr'     | '@olexale'    |
    | 'Flutter'       | '@FlutterDev' |
    And I wait
    And user <name> with twitter <email> is still there
    | name | email |
    | 'Oleksandr' | '@olexale' |
''';

    const expectedFeatureDart = '''
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import './step/the_following_users_exist.dart';
import './step/i_wait.dart';
import './step/user_with_twitter_is_still_there.dart';

void main() {
  group(\'\'\'Testing feature\'\'\', () {
    testWidgets(\'\'\'Testing scenario\'\'\', (tester) async {
      await theFollowingUsersExist(tester, 'Oleksandr', '@olexale');
      await theFollowingUsersExist(tester, 'Flutter', '@FlutterDev');
      await iWait(tester);
      await userWithTwitterIsStillThere(tester, 'Oleksandr', '@olexale');
    });
  });
}
''';

    final feature = FeatureFile(
      featureDir: 'test.feature',
      package: 'test',
      input: featureFile,
    );
    expect(feature.dartContent, expectedFeatureDart);
  });

  test('Data table with any cucumber keyword', () {
    const featureFile = '''
Feature: Testing feature
  Scenario: Testing scenario
    Given the following songs
    | 'artist'         | 'title'             |
    | 'The Beatles'    | 'Let It Be'          |
    | 'Camel'          | 'Slow yourself down' |
    And the following songs
    | 'artist'         | 'title'             |
    | 'The Beatles'    | 'Let It Be'          |
    | 'Camel'          | 'Slow yourself down' |
    But the following songs
    | 'artist'         | 'title'             |
    | 'The Beatles'    | 'Let It Be'          |
    | 'Camel'          | 'Slow yourself down' |
    When the following songs
    | 'artist'         | 'title'             |
    | 'The Beatles'    | 'Let It Be'          |
    | 'Camel'          | 'Slow yourself down' |
    And I wait
    Then the following songs
    | 'The Beatles'    | 'Let It Be'          |
''';

    const expectedFeatureDart = '''
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint, type=warning

import 'package:bdd_widget_test/data_table.dart' as bdd;
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';

import './step/the_following_songs.dart';
import './step/i_wait.dart';

void main() {
  group(\'\'\'Testing feature\'\'\', () {
    testWidgets(\'\'\'Testing scenario\'\'\', (tester) async {
      await theFollowingSongs(tester, const bdd.DataTable([['artist', 'title'], ['The Beatles', 'Let It Be'], ['Camel', 'Slow yourself down']]));
      await theFollowingSongs(tester, const bdd.DataTable([['artist', 'title'], ['The Beatles', 'Let It Be'], ['Camel', 'Slow yourself down']]));
      await theFollowingSongs(tester, const bdd.DataTable([['artist', 'title'], ['The Beatles', 'Let It Be'], ['Camel', 'Slow yourself down']]));
      await the


round:#ff3860!important}input[type=range].slider.is-danger::-ms-fill-lower{background:#ff3860}input[type=range].slider.is-danger::-ms-fill-upper{background:#ff3860}input[type=range].slider.is-danger .has-output-tooltip+output,input[type=range].slider.is-danger.has-output+output{background-color:#ff3860;color:#fff}@tailwind base;

@tailwind components;

@tailwind utilities;

body {
  /* Code blocks */
  --code-inner-color: #718096;
  --code-token1-color: #d5408c;
  --code-token2-color: #805ad5;
  --code-token3-color: #319795;
  --code-token4-color: #dd6b21;
  --code-token5-color: #690;
  --code-token6-color: #9a6e3a;
  --code-token7-color: #e90;
  --code-linenum-color: #cbd5e0;
  --code-added-color: #47bb78;
  --code-added-bg-color: #d9f4e6;
  --code-deleted-color: #e53e3e;
  --code-deleted-bg-color: #f5e4e7;
  --code-highlight-color: #a0aec0;
  --code-highlight-bg-color: #e2e8f0;
  --code-result-bg-color: #e7edf3;
  --main-font-color: #1a202c;
  --border-color: #e2e8f0;
  --code-bgd-color: #f6f8fa;
}

/* Prism */

code[class*="language-"],
pre[class*="language-"],
pre[class*="language-"] code {
  color: var(--main-font-color) !important;
  font-family: "Roboto Mono", SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-variant: no-common-ligatures no-discretionary-ligatures
    no-historical-ligatures no-contextual;
  font-size: 14px;
  text-align: left;
  white-space: pre;
  word-spacing: normal;
  word-break: normal;
  word-wrap: normal;
  line-height: 1.5;

  -moz-tab-size: 4;
  -o-tab-size: 4;
  tab-size: 4;

  -webkit-hyphens: none;
  -moz-hyphens: none;
  -ms-hyphens: none;
  hyphens: none;

  border-radius: 8px;
  display: block;
  grid-template-rows: max-content;
  width: 100%;
  overflow: auto;
}

/* Code blocks */
pre[class*="language-"] {
  padding: 1em;
  border-radius: 1em;
  margin: 0;
  overflow: auto;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
  background: var(--code-bgd-color) !important;
}

/* Inline code */
:not(pre) > code[class*="language-"] {
  padding: 0.1em;
  border-radius: 0.3em;
  white-space: normal;
}

code.inline-code,
.inline-code {
  display: inline;
  vertical-align: baseline;
  padding: 0.05em 0.3em 0.2em 0.3em;
  background: var(--code-inline-bgd-color);
  font-size: 14px;
  font-feature-settings: "clig" 0, "calt" 0;
  font-variant: no-common-ligatures no-discretionary-ligatures
    no-historical-ligatures no-contextual;
  font-family: "Roboto Mono";
  font-style: normal;
  line-height: 24px;
  border-radius: 5px;
  color: var(--main-font-color);
  font-weight: 500;
}

.inline-code {
  background-color: var(--border


r_ref (value->contents.serialised.buffer);
      child->contents.serialised.data = s_child.data;
     }
  else
    child = g_variant_ref (value->contents.tree.children[index_]);

  g_variant_unlock (value);

  return child;
}

/**
 * g_variant_store:
 * @value: the #GVariant to store
 * @data: the location to store the serialised data at
 *
 * Stores the serialised form of @value at @data.  @data should be
 * large enough.  See g_variant_get_size().
 *
 * The stored data is in machine native byte order but may not be in
 * fully-normalised form if read from an untrusted source.  See
 * g_variant_normalise() for a solution.
 *
 * This function is approximately O(n) in the size of @data.
 *
 * Since: 2.24
 **/
void
g_variant_store (GVariant *value,
                 gpointer  data)
{
  g_variant_lock (value);

  if (value->state & STATE_SERIALISED)
    {
      if (value->contents.serialised.data != NULL)
        memcpy (data, value->contents.serialised.data, value->size);
      else
        memset (data, 0, value->size);
    }
  else
    g_variant_serialise (value, data);

  g_variant_unlock (value);
}

/**
 * g_variant_is_normal_form:
 * @value: a #GVariant instance
 * @returns: %TRUE if @value is in normal form
 *
 * Checks if @value is in normal form.
 *
 * The main reason to do this is to detect if a given chunk of
 * serialised data is in normal form: load the data into a #GVariant
 * using g_variant_create_from_data() and then use this function to
 * check.
 *
 * If @value is found to be in normal form then it will be marked as
 * being trusted.  If the value was already marked as being trusted then
 * this function will immediately return %TRUE.
 *
 * Since: 2.24
 **/
gboolean
g_variant_is_normal_form (GVariant *value)
{
  if (value->state & STATE_TRUSTED)
    return TRUE;

  g_variant_lock (value);

  if (value->state & STATE_SERIALISED)
    {
      GVariantSerialised serialised = {
        value->type_info,
        (gpointer) value->contents.serialised.data,
        value->size
      };

      if (g_variant_serialised_is_normal (serialised))
        value->state |= STATE_TRUSTED;
    }
  else
    {
      gboolean normal = TRUE;
      gsize i;

      for (i = 0; i < value->contents.tree.n_children; i++)
        normal &= g_variant_is_normal_form (value->contents.tree.children[i]);

      if (normal)
        value->state |= STATE_TRUSTED;
    }

  g_variant_unlock (value);

  return (value->state & STATE_TRUSTED) != 0;
}

#define __G_VARIANT_CORE_C__
#include "galiasdef.c"


s._metrics;
  };

  // Converts contours to a Path object that can be rendered

  TTFGlyph.prototype._getPath = function _getPath() {
    var contours = this._getContours();
    var path = new Path();

    for (var i = 0; i < contours.length; i++) {
      var contour = contours[i];
      var firstPt = contour[0];
      var lastPt = contour[contour.length - 1];
      var start = 0;

      if (firstPt.onCurve) {
        // The first point will be consumed by the moveTo command, so skip in the loop
        var curvePt = null;
        start = 1;
      } else {
        if (lastPt.onCurve) {
          // Start at the last point if the first point is off curve and the last point is on curve
          firstPt = lastPt;
        } else {
          // Start at the middle if both the first and last points are off curve
          firstPt = new Point(false, false, (firstPt.x + lastPt.x) / 2, (firstPt.y + lastPt.y) / 2);
        }

        var curvePt = firstPt;
      }

      path.moveTo(firstPt.x, firstPt.y);

      for (var j = start; j < contour.length; j++) {
        var pt = contour[j];
        var prevPt = j === 0 ? firstPt : contour[j - 1];

        if (prevPt.onCurve && pt.onCurve) {
          path.lineTo(pt.x, pt.y);
        } else if (prevPt.onCurve && !pt.onCurve) {
          var curvePt = pt;
        } else if (!prevPt.onCurve && !pt.onCurve) {
          var midX = (prevPt.x + pt.x) / 2;
          var midY = (prevPt.y + pt.y) / 2;
          path.quadraticCurveTo(prevPt.x, prevPt.y, midX, midY);
          var curvePt = pt;
        } else if (!prevPt.onCurve && pt.onCurve) {
          path.quadraticCurveTo(curvePt.x, curvePt.y, pt.x, pt.y);
          var curvePt = null;
        } else {
          throw new Error("Unknown TTF path state");
        }
      }

      // Connect the first and last points
      if (curvePt) {
        path.quadraticCurveTo(curvePt.x, curvePt.y, firstPt.x, firstPt.y);
      }

      path.closePath();
    }

    return path;
  };

  return TTFGlyph;
}(Glyph);

/**
 * Represents an OpenType PostScript glyph, in the Compact Font Format.
 */

var CFFGlyph = function (_Glyph) {
  _inherits(CFFGlyph, _Glyph);

  function CFFGlyph() {
    _classCallCheck(this, CFFGlyph);

    return _possibleConstructorReturn(this, _Glyph.apply(this, arguments));
  }

  CFFGlyph.prototype._getName = function _getName() {
    if (this._font.CFF2) {
      return _Glyph.prototype._getName.call(this);
    }

    return this._font['CFF '].getGlyphName(this.id);
  };

  CFFGlyph.prototype.bias = function bias(s) {
    if (s.length < 1240) {
      return 107;
    } else if (s.length < 33900) {
      return 1131;
    } else {
      return 32768;
    }
  };

  CFFGlyph.prototype._getPath = function _getPath() {
    var stream = this._font.stream;
    var pos = stream.pos;

    var cff = this._font.CFF2 || this._font['CFF '];
    var str = cff.topDict.CharStrings[this.id];
    var end = str.offset + str.length;
    stream.pos = str.offset;

    var path = new Path();
    var stack = [];
    var trans = [];

    var width = null;
    var nStems =


lass<out BukkitEntity>, EntityType<*>>()

    init {
        val server: MinecraftServer = (Bukkit.getServer() as CraftServer).server
        val level = server.allLevels.first()

        Registry.ENTITY_TYPE.forEach { type ->
            type.create(level)?.let { entity ->
                val bukkitClass = entity.bukkitEntity.javaClass
                val interfaces = bukkitClass.interfaces

                ENTITIES[bukkitClass.asSubclass(BukkitEntity::class.java)] = type

                for (i in interfaces) {
                    if (BukkitEntity::class.java.isAssignableFrom(i)) {
                        ENTITIES[i.asSubclass(BukkitEntity::class.java)] = type
                    }
                }
            }
        }
    }

    @JvmStatic
    fun findType(bukkitClass: Class<out BukkitEntity>): EntityType<*> {
        return ENTITIES[bukkitClass] ?: error("Unknown entity type $bukkitClass")
    }
}// Moosync
// Copyright (C) 2024, 2025  Moosync <support@moosync.app>
//
// 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 3 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, see <http://www.gnu.org/licenses/>.

package app.moosync.audioplayer.services

import android.content.Context
import android.util.Log
import app.moosync.audioplayer.models.Song
import app.moosync.audioplayer.services.players.GenericPlayer
import app.moosync.audioplayer.services.players.LocalPlayer
import app.moosync.audioplayer.services.players.PlayerListeners

class PlaybackManager(mContext: Context, private val playerListeners: PlayerListeners) {
    private val players: HashMap<String, GenericPlayer> = hashMapOf(Pair("LOCAL", LocalPlayer()))

    init {
        for (player in players.values) {
            player.setPlayerListeners(playerListeners)
        }
    }

    fun stop(key: String) {
        players[key]?.stop()
    }

    fun release() {
        players.forEach {
            it.value.release()
        }
    }

    fun pause(key: String) {
        players[key]?.pause()
    }

    fun play(key: String) {
        players[key]?.play()
    }

    fun seek(key: String, pos: Int) {
        players[key]?.progress = pos
    }

    fun canPlay(key: String, song: Song): Boolean {
        return players[key]?.canPlay(song) == true
    }

    fun load(key: String, context: Context, src: String, autoPlay: Boolean) {
        players[key]?.load(context, src, autoPlay)
    }
}
// Moosync
// Copyright (C) 2024, 2025  Moosync <support@moosync.app>
//
// 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 3 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.
//
//


 protobuf:"bytes,3,opt,name=valueFrom"`
}

func (c *Credential) ToString() string {
	if len(c.Value) > 0 {
		return c.Value
	}

	if c.ValueFrom != nil {
		if c.ValueFrom.SecretKeyRef != nil {
			return fmt.Sprintf("%s/%s/%s", c.ValueFrom.SecretKeyRef.Namespace, c.ValueFrom.SecretKeyRef.Name, c.ValueFrom.SecretKeyRef.Key)
		}
	}

	return ""
}
package utils

import (
	"sync"

	v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"kubesphere.io/tower/pkg/api/cluster/v1alpha1"
)

type Agents struct {
	sync.RWMutex
	inner map[string]*v1alpha1.Cluster
}

func NewAgents() *Agents {
	return &Agents{
		inner: map[string]*v1alpha1.Cluster{},
	}
}

func FakeAgents() *Agents {
	agents := NewAgents()
	agents.inner["alpha"] = &v1alpha1.Cluster{
		ObjectMeta: v1.ObjectMeta{
			Name: "alpha",
		},
		Spec: v1alpha1.ClusterSpec{
			Connection: v1alpha1.Connection{
				Type:                    v1alpha1.ConnectionTypeProxy,
				Token:                   "abcedefg",
				KubernetesAPIServerPort: 6443,
				KubeSphereAPIServerPort: 16443,
			},
		},
	}

	return agents
}

// Len returns the number of agents
func (g *Agents) Len() int {
	g.RLock()
	l := len(g.inner)
	g.RUnlock()
	return l
}

// Get agent from the index by key
func (g *Agents) Get(key string) (*v1alpha1.Cluster, bool) {
	g.RLock()
	agent, found := g.inner[key]
	g.RUnlock()
	return agent, found
}

// Set an agent into the list by specific key
func (g *Agents) Set(key string, agent *v1alpha1.Cluster) {
	g.Lock()
	g.inner[key] = agent
	g.Unlock()
}

// Delete an agent from the list
func (g *Agents) Del(key string) {
	g.Lock()
	delete(g.inner, key)
	g.Unlock()
}

// Add adds an agent to the list
func (g *Agents) Add(cluster *v1alpha1.Cluster) {
	g.Set(cluster.Name, cluster)
}
package certs

import (
	"crypto"
	cryptorand "crypto/rand"
	"crypto/rsa"
	"crypto/x509"
	"crypto/x509/pkix"
	"encoding/pem"
	"github.com/pkg/errors"
	certutil "k8s.io/client-go/util/cert"
	"math"
	"math/big"
	"time"
)

const (
	// ECPrivateKeyBlockType is a possible value for pem.Block.Type.
	ECPrivateKeyBlockType = "EC PRIVATE KEY"
	// PrivateKeyBlockType is a possible value for pem.Block.Type.
	PrivateKeyBlockType = "PRIVATE KEY"
	// PublicKeyBlockType is a possible value for pem.Block.Type.
	PublicKeyBlockType = "PUBLIC KEY"
	// CertificateBlockType is a possible value for pem.Block.Type.
	CertificateBlockType = "CERTIFICATE"
	// RSAPrivateKeyBlockType is a possible value for pem.Block.Type.
	RSAPrivateKeyBlockType = "RSA PRIVATE KEY"
	rsaKeySize             = 2048
	// CertificateValidity defines the validity for all the signed certificates generated by kubeadm
	CertificateValidity = time.Hour * 24 * 365 * 10
)

// NewPrivateKey creates an RSA private key
func NewPrivateKey() (crypto.Signer, error) {
	return rsa.GenerateKey(cryptorand.Reader, rsaKeySize)
}

func NewCertif


, ' ', 0)
	fmt.Fprintf(tw, "\tID\t%v\n", x.ID)
	fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
	fmt.Fprintf(tw, "\tCreatedAt\t%v\n", x.CreatedAt)
	fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
	fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
	fmt.Fprintf(tw, "\tAddr\t%v\n", x.Addr)
	fmt.Fprintf(tw, "\tRegion\t%v\n", x.Region)
	tw.Flush()
	fmt.Fprintf(&b, "}\n")
	return b.String()
}

type ReservedAddrList struct {
	// the list of all reserved addresses on this account
	ReservedAddrs []ReservedAddr `json:"reserved_addrs,omitempty"`
	// URI of the reserved address list API resource
	URI string `json:"uri,omitempty"`
	// URI of the next page, or null if there is no next page
	NextPageURI *string `json:"next_page_uri,omitempty"`
}

func (x *ReservedAddrList) String() string {
	return x.GoString()
}

func (x *ReservedAddrList) GoString() string {
	var b bytes.Buffer
	fmt.Fprintf(&b, "ReservedAddrList {\n")
	tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
	fmt.Fprintf(tw, "\tReservedAddrs\t%v\n", x.ReservedAddrs)
	fmt.Fprintf(tw, "\tURI\t%v\n", x.URI)
	fmt.Fprintf(tw, "\tNextPageURI\t%v\n", x.NextPageURI)
	tw.Flush()
	fmt.Fprintf(&b, "}\n")
	return b.String()
}

type ReservedDomainCreate struct {
	// hostname of the reserved domain
	Domain string `json:"domain,omitempty"`
	// deprecated: With the launch of the ngrok Global Network domains traffic is now
	// handled globally. This field applied only to endpoints. Note that agents may
	// still connect to specific regions. Optional, null by default. (au, eu, ap, us,
	// jp, in, sa)
	Region string `json:"region,omitempty"`
	// human-readable description of what this reserved domain will be used for
	Description string `json:"description,omitempty"`
	// arbitrary user-defined machine-readable data of this reserved domain. Optional,
	// max 4096 bytes.
	Metadata string `json:"metadata,omitempty"`
	// ID of a user-uploaded TLS certificate to use for connections to targeting this
	// domain. Optional, mutually exclusive with certificate_management_policy.
	CertificateID *string `json:"certificate_id,omitempty"`
	// configuration for automatic management of TLS certificates for this domain, or
	// null if automatic management is disabled. Optional, mutually exclusive with
	// certificate_id.
	CertificateManagementPolicy *ReservedDomainCertPolicy `json:"certificate_management_policy,omitempty"`
}

func (x *ReservedDomainCreate) String() string {
	return x.GoString()
}

func (x *ReservedDomainCreate) GoString() string {
	var b bytes.Buffer
	fmt.Fprintf(&b, "ReservedDomainCreate {\n")
	tw := tabwriter.NewWriter(&b, 0, 4, 0, ' ', 0)
	fmt.Fprintf(tw, "\tDomain\t%v\n", x.Domain)
	fmt.Fprintf(tw, "\tRegion\t%v\n", x.Region)
	fmt.Fprintf(tw, "\tDescription\t%v\n", x.Description)
	fmt.Fprintf(tw, "\tMetadata\t%v\n", x.Metadata)
	fmt.Fprintf(tw, "\tCertificateID\t%v\n", x.CertificateID)
	fmt.Fprintf(tw, "\tCertificateManagementPolicy\t%v\n", x.CertificateManagementPolicy)
	tw.Flush()


_ZNK16QAbstractSpinBox18hasAcceptableInputEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	return rv != 0
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:93
// index:0
// Public Visibility=Default Availability=Available
// [8] QString text() const

/*

 */
func (this *QAbstractSpinBox) Text() string {
	rv, err := qtrt.InvokeQtFunc6("_ZNK16QAbstractSpinBox4textEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	rv2 := qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
	rv3 := rv2.ToUtf8().Data()
	qtcore.DeleteQString(rv2)
	return rv3
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:95
// index:0
// Public Visibility=Default Availability=Available
// [8] QString specialValueText() const

/*

 */
func (this *QAbstractSpinBox) SpecialValueText() string {
	rv, err := qtrt.InvokeQtFunc6("_ZNK16QAbstractSpinBox16specialValueTextEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	rv2 := qtcore.NewQStringFromPointer(unsafe.Pointer(uintptr(rv)))
	rv3 := rv2.ToUtf8().Data()
	qtcore.DeleteQString(rv2)
	return rv3
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:96
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setSpecialValueText(const QString &)

/*

 */
func (this *QAbstractSpinBox) SetSpecialValueText(txt string) {
	var tmpArg0 = qtcore.NewQString5(txt)
	var convArg0 = tmpArg0.GetCthis()
	rv, err := qtrt.InvokeQtFunc6("_ZN16QAbstractSpinBox19setSpecialValueTextERK7QString", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
	qtrt.ErrPrint(err, rv)
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:98
// index:0
// Public Visibility=Default Availability=Available
// [1] bool wrapping() const

/*

 */
func (this *QAbstractSpinBox) Wrapping() bool {
	rv, err := qtrt.InvokeQtFunc6("_ZNK16QAbstractSpinBox8wrappingEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	return rv != 0
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:99
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setWrapping(bool)

/*

 */
func (this *QAbstractSpinBox) SetWrapping(w bool) {
	rv, err := qtrt.InvokeQtFunc6("_ZN16QAbstractSpinBox11setWrappingEb", qtrt.FFI_TYPE_POINTER, this.GetCthis(), w)
	qtrt.ErrPrint(err, rv)
}

// /usr/include/qt/QtWidgets/qabstractspinbox.h:101
// index:0
// Public Visibility=Default Availability=Available
// [-2] void setReadOnly(bool)

/*

 */
func (this *QAbstractSpinBox) SetReadOnly(r bool) {
	rv, err := qtrt.InvokeQtFunc6("_ZN16QAbstractSpinBox11setReadOnlyEb", qtrt.FFI_TYPE_POINTER, this.GetCthis(), r)
	qtrt.


,
}
<filename>src/api/auth/kubernetes/requests.rs
use super::responses::{
    ListRolesResponse, ReadKubernetesAuthConfigResponse, ReadKubernetesRoleResponse,
};
use rustify_derive::Endpoint;

/// ## Configure Kubernetes Auth
/// Sets backend configuration for the Kubernetes auth mount
///
/// * Path: /auth/kubernetes/config
/// * Method: POST
/// * Response: N/A
/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#configure-method
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(path = "/auth/{self.mount}/config", method = "POST", builder = "true")]
#[builder(setter(into, strip_option), default)]
pub struct ConfigureKubernetesAuthRequest {
    #[endpoint(skip)]
    pub mount: String,
    pub kubernetes_host: String,
    pub kubernetes_ca_cert: Option<String>,
    pub pem_keys: Option<Vec<String>>,
    pub issuer: Option<String>,
    pub disable_iss_validation: bool,
    pub disable_local_ca_jwt: bool,
}

/// ## Read Kubernetes Auth Config
/// Gets backend configuration for the Kubernetes auth mount
///
/// * Path: /auth/kubernetes/config
/// * Method: GET
/// * Response: [ReadKubernetesAuthConfigResponse]
/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#read-config
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
    path = "/auth/{self.mount}/config",
    method = "GET",
    response = "ReadKubernetesAuthConfigResponse",
    builder = "true"
)]
#[builder(setter(into))]
pub struct ReadKubernetesAuthConfigRequest {
    #[endpoint(skip)]
    pub mount: String,
}

/// ## Login with Kubernetes
/// Issues a Vault token based on the presented credentials.
///
/// * Path: /auth/kubernetes/login
/// * Method: POST
/// * Response: N/A
/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#login
#[derive(Builder, Debug, Endpoint)]
#[endpoint(path = "/auth/{self.mount}/login", method = "POST", builder = "true")]
#[builder(setter(into))]
pub struct LoginWithKubernetesRequest {
    #[endpoint(skip)]
    pub mount: String,
    pub role: String,
    pub jwt: String,
}

/// ## List Roles
/// Returns a list the existing Kubernetes roles.
///
/// * Path: /auth/{self.mount}/role
/// * Method: LIST
/// * Response: [ListRoleResponse]
/// * Reference: https://www.vaultproject.io/api-docs/auth/kubernetes#list-roles
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
    path = "/auth/{self.mount}/role",
    method = "LIST",
    response = "ListRolesResponse",
    builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct ListRolesRequest {
    #[endpoint(skip)]
    pub mount: String,
}

/// ## Create Kubernetes role
/// Creates a new Kubernetes Role.
///
/// * Path: /auth/{self.mount}/role/{self.name}
/// * Method: POST
/// * Response: N/A
/// * Reference: https://www.vaultproject.io/api/auth/kubernetes#create-role
#[derive(Builder, Debug, Default, Endpoint)]
#[endpoint(
    path = "/auth/{self.mount}/role/{self.name}",
    method = "POST",
    builder = "true"
)]
#[builder(setter(into, strip_option), default)]
pub struct CreateKubernete


   throw new NullPointerException("baz3");
      }
      if (quuxBaz == null) {
        throw new NullPointerException("quuxBaz");
      }
      if (quuxQuuxBaz == null) {
        throw new NullPointerException("quuxQuuxBaz");
      }
      if (bazBaz == null) {
        throw new NullPointerException("bazBaz");
      }
      this.baz2 = baz2;
      this.baz3 = baz3;
      this.mapBaz = (mapBaz != null) ? mapBaz : Collections.<Q, GenericNested.Baz<W>>emptyMap();
      this.quuxBaz = quuxBaz;
      this.quuxQuuxBaz = quuxQuuxBaz;
      this.bazBaz = bazBaz;
    }

    @AutoMatter.Field
    @Override
    public GenericNested.Baz<GenericNested.Baz<Q>> baz2() {
      return baz2;
    }

    @AutoMatter.Field
    @Override
    public GenericNested.Baz<GenericNested.Baz<GenericNested.Baz<Q>>> baz3() {
      return baz3;
    }

    @AutoMatter.Field
    @Override
    public Map<Q, GenericNested.Baz<W>> mapBaz() {
      return mapBaz;
    }

    @AutoMatter.Field
    @Override
    public GenericNested.Quux<Q, GenericNested.Baz<W>> quuxBaz() {
      return quuxBaz;
    }

    @AutoMatter.Field
    @Override
    public GenericNested.Quux<GenericNested.Quux<String, Integer>, GenericNested.Quux<W, GenericNested.Baz<Q>>> quuxQuuxBaz(
    ) {
      return quuxQuuxBaz;
    }

    @AutoMatter.Field
    @Override
    public GenericNested.Baz<GenericNested.Baz<Q>> bazBaz() {
      return bazBaz;
    }

    @Override
    public GenericNestedBuilder<Q, W> builder() {
      return new GenericNestedBuilder<Q, W>(this);
    }

    @Override
    public boolean equals(Object o) {
      if (this == o) {
        return true;
      }
      if (!(o instanceof GenericNested)) {
        return false;
      }
      final GenericNested<?, ?> that = (GenericNested<?, ?>) o;
      if (baz2 != null ? !baz2.equals(that.baz2()) : that.baz2() != null) {
        return false;
      }
      if (baz3 != null ? !baz3.equals(that.baz3()) : that.baz3() != null) {
        return false;
      }
      if (mapBaz != null ? !mapBaz.equals(that.mapBaz()) : that.mapBaz() != null) {
        return false;
      }
      if (quuxBaz != null ? !quuxBaz.equals(that.quuxBaz()) : that.quuxBaz() != null) {
        return false;
      }
      if (quuxQuuxBaz != null ? !quuxQuuxBaz.equals(that.quuxQuuxBaz()) : that.quuxQuuxBaz() != null) {
        return false;
      }
      if (bazBaz != null ? !bazBaz.equals(that.bazBaz()) : that.bazBaz() != null) {
        return false;
      }
      return true;
    }

    @Override
    public int hashCode() {
      int result = 1;
      result = 31 * result + (this.baz2 != null ? this.baz2.hashCode() : 0);
      result = 31 * result + (this.baz3 != null ? this.baz3.hashCode() : 0);
      result =


s` | Access Mode for Volume | `- ReadWriteOnce` |
| `medium` | Attributes to use when the `metastore` is `emptyDir` | `""` |

__tieredstore values:__

| Parameter | Description | Default |
| --- | --- | --- |
| `levels` | Tiered Storage | `[]` |
| `levels.level` | Level # starts from 0 | `0` |
| `levels.alias` | Alias name of tiered storage | `MEM` |
| `levels.mediumtype` | `MEM`, `HDD`, `SSD` | `MEM` |
| `levels.type` | `hostPath`, `emptyDir` or `persistentVolumeClaim` | `emptyDir` |
| `levels.path` | Mount Path for Volume | `/dev/shm` |
| `levels.quota` | Volume Size | `1G` |
| `levels.high` | Upper usage bound | `0.95` |
| `levels.low` | Lower usage bound | `0.7` |

__shortCircuit values:__

| Parameter | Description | Default |
| --- | --- | --- |
| `enabled` | Whether use short circuit or not | `true` |
| `policy` | The policy for short circuit can be `local` or `uuid` | `uuid` |
| `volumeType` | `volumeType` controls the type of `shortCircuit` volume. It can be `persistentVolumeClaim` or `hostPath` | `persistentVolumeClaim` |
| `size` | Volume Size | `1Mi` |
| `pvcName` | Attributes to use if the domain socket volume is PVC | `alluxio-worker-domain-socket` |
| `accessModes` | Access Mode | `- ReadWriteOnce` |
| `storageClass` | Storage Class | `standard` |
| `hostPath` | Attributes to use if the domain socket volume is `hostPath`. The `hostPath` directory to use | `/tmp/alluxio-domain` |

__fuse values:__

| Parameter | Description | Default |
| --- | --- | --- |
| `env` | Extra environment variables for the fuse pod | `{}` |
| `image` | Docker image | `alluxio/alluxio` |
| `imageTag` | Docker image tag | `2.5.0-SNAPSHOT` |
| `imagePullPolicy` | Docker image pull policy | `IfNotPresent` |
| `enabled` | Set to true to deploy FUSE | `false` |
| `clientEnabled` | Set to true to deploy FUSE | `false` |
| `properties` | Properties for the fuse component | `{}` |
| `jvmOptions` | JVM options specific to the fuse container | `[]` |
| `hostNetwork` | Controls whether the pod may use the node network namespace | `true` |
| `hostPID` | hostPID requires escalated privileges for using Java profile | `true` |
| `dnsPolicy` | `dnsPolicy` will be `ClusterFirstWithHostNet` if `hostNetwork: true` and `ClusterFirst` if `hostNetwork: false` | `ClusterFirstWithHostNet` |
| `user` | Security Context for user | `0` |
| `group` | Security Context for group | `0` |
| `fsGroup` | Security Context for fsGroup | `0` |
| `args` | Arguments to Docker entrypoint | - fuse <br/> - --fuse-opts=allow_other |
| `mountPath` | Mount path in the host | `/mnt/alluxio-fuse` |
| `resources.limits.cpu` | CPU Limit | `4` |
| `resources.limits.memory` | Memory Limit | `4G` |
| `resources.requests.cpu` | CPU Request | `0.5` |
| `resources.requests.memory` | Memory Request | `1G` |
| `podAnnotations` | Pod Annotations for the FUSE pods | `{}` |

__Metrics values:__

| Parameter | Description | Default |
| --- | --- | --- |
| `enabled` | Enabling Alluxio Metrics | `false` |
| `ConsoleSink.enabled` | Enabling ConsoleSink | `false` |
| `ConsoleSink.period` | Poll period | `


SUBRESOURCE_DATA> dx_sub_resources(sub_resources_raw_count, D3D12_SUBRESOURCE_DATA{});
    for(const SubResource& sub_resource : sub_resources)
    {
        ValidateSubResource(sub_resource);

        const uint32_t sub_resource_raw_index = sub_resource.GetIndex().GetRawIndex(sub_resource_count);
        META_CHECK_LESS(sub_resource_raw_index, dx_sub_resources.size());

        D3D12_SUBRESOURCE_DATA& dx_sub_resource = dx_sub_resources[sub_resource_raw_index];
        dx_sub_resource.pData      = sub_resource.GetDataPtr();
        dx_sub_resource.RowPitch   = static_cast<int64_t>(settings.dimensions.GetWidth())  * pixel_size;
        dx_sub_resource.SlicePitch = dx_sub_resource.RowPitch * settings.dimensions.GetHeight();

        META_CHECK_GREATER_OR_EQUAL_DESCR(sub_resource.GetDataSize(), dx_sub_resource.SlicePitch,
                                          "sub-resource data size is less than computed MIP slice size, possibly due to pixel format mismatch");
    }

    // NOTE: scratch_image is the owner of generated mip-levels memory, which should be hold until UpdateSubresources call completes
    ::DirectX::ScratchImage scratch_image;
    if (settings.mipmapped && sub_resources.size() < sub_resources_raw_count)
    {
        GenerateMipLevels(dx_sub_resources, scratch_image);
    }

    // Upload texture subresources data to GPU via intermediate upload resource
    const TransferCommandList& upload_cmd_list = PrepareResourceTransfer(TransferOperation::Upload, target_cmd_queue, State::CopyDest);
    UpdateSubresources(&upload_cmd_list.GetNativeCommandList(),
                       GetNativeResource(), m_upload_resource_cptr.Get(), 0, 0,
                       static_cast<UINT>(dx_sub_resources.size()), dx_sub_resources.data());
    GetContext().RequestDeferredAction(Rhi::IContext::DeferredAction::UploadResources);
}

Rhi::SubResource Texture::GetData(Rhi::ICommandQueue& target_cmd_queue, const SubResource::Index& sub_resource_index, const BytesRangeOpt& data_range)
{
    META_FUNCTION_TASK();
    META_CHECK_TRUE_DESCR(GetUsage().HasAnyBit(Rhi::ResourceUsage::ReadBack),
                          "getting texture data from GPU is allowed for buffers with CPU Read-back flag only");
    META_CHECK_NOT_NULL(m_read_back_resource_cptr);

    ValidateSubResource(sub_resource_index, data_range);

    const TransferCommandList& transfer_cmd_list = PrepareResourceTransfer(TransferOperation::Readback, target_cmd_queue, State::CopySource);

    const Settings& settings = GetSettings();
    const Data::Index sub_resource_raw_index = sub_resource_index.GetRawIndex(GetSubresourceCount());
    const DXGI_FORMAT pixel_format = TypeConverter::PixelFormatToDxgi(settings.pixel_format, TypeConverter::ResourceFormatType::ViewRead);

    const D3D12_PLACED_SUBRESOURCE_FOOTPRINT src_footprint { 0U,
        D3D12_SUBRESOURCE_FOOTPRINT {
            pixel_format,
            settings.dimensions.GetWidth(),
            settings.dimensions.GetHeight(),
            settings.dimensions.GetDepth(),
            static_cast<UINT>(settings.dimensions.GetWidth() * ::DirectX::BitsPerPixel(pixel_format) / 8)
        }
    };
    const CD3DX12_TEXTURE_COPY_LOCATION src_copy_location(GetNativeResource(), sub_resource_raw_index);
    const CD3DX12_TEXTURE_COPY_LOCATION dst_copy_location(m_read_back_resource_cptr.Get(), src_footprint);
    transfer_cmd_list.GetNativeCommandList().CopyTextureRegion(&d


"〜本の為の本〜",
        text = "ノースティリスで広く流通している記録媒体。中には重要なことが書かれているものがあるが、その殆どがとるに値しない端書程度の内容だ。"
      },
      main = {
        footnote = "〜鑑定報告書：＜書類＞カテゴリ〜",
        text = "雑多な情報が書かれた本。特に利用できるものはない。"
      }
    },
    name = "本",
    unidentified_name = "本"
  },
  book_of_bokonon = {
    _0 = {
      footnote = "〜本の為の本・歴史書編〜",
      text = "非常に変わっているとされる一団の掲げる宗教書。そのページを開いた時あなたは知るだろう、それが真実であり、真っ赤な嘘であることを。"
    },
    name = "ボコノンの書"
  },
  book_of_rachel = {
    desc = {
      _0 = {
        footnote = "〜本の為の本・児童書編〜",
        text = "童話作家、レイチェルが描いた童話集。独特の温かみある文章と挿絵は読んだ者に心に触れる何かを与えるという。"
      },
      main = {
        footnote = "〜鑑定報告書：＜書類＞カテゴリ〜",
        text = "ある童話作家の書いた本。読むことができる。"
      }
    },
    name = "レイチェルの絵本",

    title = function(no)
       return ("第%s巻目の"):format(no)
    end
  },
  book_of_resurrection = {
    desc = {
      _0 = {
        footnote = "〜本の為の本・魔法書編〜",
        text = "失われた存在を呼び戻すとされる貴重な書物。皮肉なことに、古代この書物を巡って大きな戦争があり、多くの生命が失われたという。"
      },
      main = {
        footnote = "〜鑑定報告書：＜書類＞カテゴリ〜",
        text = "死んでいる者を復活させる本。読むことができる。"
      }
    },
    name = "復活の書"
  },
  bookshelf = {
    desc = {
      _0 = {
        footnote = "〜ノースティリス大家具事典〜",
        text = "家具屋でよく売られている書物を収める為の棚。特に目立った悪い点もいい点も無く、無難な出来栄えとなっている。"
      },
      main = {
        footnote = "〜鑑定報告書：＜家具＞カテゴリ〜",
        text = "極普通の本を収める為の棚だ。"
      }
    },
    name = "普通の本棚"
  },
  boots = {
    desc = {
      _0 = {
        footnote = "〜明日から使えるあなたの為の武具集〜",
        t


unc (this *QSizePolicy) Operator_not_equal(s QSizePolicy_ITF) bool {
	var convArg0 unsafe.Pointer
	if s != nil && s.QSizePolicy_PTR() != nil {
		convArg0 = s.QSizePolicy_PTR().GetCthis()
	}
	rv, err := qtrt.InvokeQtFunc6("_ZNK11QSizePolicyneERKS_", qtrt.FFI_TYPE_POINTER, this.GetCthis(), convArg0)
	qtrt.ErrPrint(err, rv)
	return rv != 0
}

// /usr/include/qt/QtWidgets/qsizepolicy.h:153
// index:0
// Public inline Visibility=Default Availability=Available
// [4] int horizontalStretch() const

/*
Returns the horizontal stretch factor of the size policy.

See also setHorizontalStretch(), verticalStretch(), and horizontalPolicy().
*/
func (this *QSizePolicy) HorizontalStretch() int {
	rv, err := qtrt.InvokeQtFunc6("_ZNK11QSizePolicy17horizontalStretchEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	return qtrt.Cretval2go("int", rv).(int) // 1111
}

// /usr/include/qt/QtWidgets/qsizepolicy.h:154
// index:0
// Public inline Visibility=Default Availability=Available
// [4] int verticalStretch() const

/*
Returns the vertical stretch factor of the size policy.

See also setVerticalStretch(), horizontalStretch(), and verticalPolicy().
*/
func (this *QSizePolicy) VerticalStretch() int {
	rv, err := qtrt.InvokeQtFunc6("_ZNK11QSizePolicy15verticalStretchEv", qtrt.FFI_TYPE_POINTER, this.GetCthis())
	qtrt.ErrPrint(err, rv)
	return qtrt.Cretval2go("int", rv).(int) // 1111
}

// /usr/include/qt/QtWidgets/qsizepolicy.h:155
// index:0
// Public inline Visibility=Default Availability=Available
// [-2] void setHorizontalStretch(int)

/*
Sets the horizontal stretch factor of the size policy to the given stretchFactor. stretchFactor must be in the range [0,255].

When two widgets are adjacent to each other in a horizontal layout, setting the horizontal stretch factor of the widget on the left to 2 and the factor of widget on the right to 1 will ensure that the widget on the left will always be twice the size of the one on the right.

See also horizontalStretch(), setVerticalStretch(), and setHorizontalPolicy().
*/
func (this *QSizePolicy) SetHorizontalStretch(stretchFactor int) {
	rv, err := qtrt.InvokeQtFunc6("_ZN11QSizePolicy20setHorizontalStretchEi", qtrt.FFI_TYPE_POINTER, this.GetCthis(), stretchFactor)
	qtrt.ErrPrint(err, rv)
}

// /usr/include/qt/QtWidgets/qsizepolicy.h:156
// index:0
// Public inline Visibility=Default Availability=Available
// [-2] void setVerticalStretch(int)

/*
Sets the vertical stretch factor of the size policy to the given stretchFactor. stretchFactor must be in the range [0,255].

When two widgets are adjacent to each other in a vertical layout, setting the vertical stretch factor of the widget on the top to 2 and the factor of widget on the bottom to 1 will ensure that the widget on the top will always be twice the size of the one on the bottom.

See also verticalStretch(), setHorizontalStretch(), and setVerticalPolicy().
*/
func (this *QSizePolicy) SetVerticalStretch(stretchFactor int) {
	rv, err := qtrt.Invoke


//=============================================================================
//
// Adventure Game Studio (AGS)
//
// Copyright (C) 1999-2011 Chris Jones and 2011-2025 various contributors
// The full list of copyright holders can be found in the Copyright.txt
// file, which is part of this source code distribution.
//
// The AGS source code is provided under the Artistic License 2.0.
// A copy of this license can be found in the file License.txt and at
// https://opensource.org/license/artistic-2-0/
//
//=============================================================================
//
// BufferedStream is a proxy implementation of IStreamBase which works
// as a buffering mechanism over another IStreamBase. BufferedStream uses the
// memory buffer during read and write operations, which reduces number of
// reads and writes on actual device, thus possibly improving i/o performance.
//
// BufferedStream optionally supports limiting the stream operations
// to an arbitrary offset range.
//
//=============================================================================
#ifndef __AGS_CN_UTIL__BUFFEREDSTREAM_H
#define __AGS_CN_UTIL__BUFFEREDSTREAM_H

#include <vector>
#include "util/stream.h"

namespace AGS
{
namespace Common
{

class BufferedStream : public StreamBase
{
public:
    // Needs tuning depending on the platform.
    static const size_t BufferSize = 1024u * 8;
    BufferedStream(std::unique_ptr<IStreamBase> &&base_stream)
        { Open(std::move(base_stream)); }
    // Constructs a BufferedStream limited by an arbitrary offset range
    BufferedStream(std::unique_ptr<IStreamBase> &&base_stream, soff_t start_pos, soff_t end_pos)
        { OpenSection(std::move(base_stream), start_pos, end_pos); }
    ~BufferedStream();

    IStreamBase *GetStreamBase() { return _base.get(); }
    std::unique_ptr<IStreamBase> ReleaseStreamBase();

    const char *GetPath() const override { return _base ? _base->GetPath() : ""; }
    StreamMode GetMode() const override { return _base ? _base->GetMode() : kStream_None; }
    bool    GetError() const override { return _base ? _base->GetError() : false; }

    // Is end of stream
    bool    EOS() const override;
    // Total length of stream (if known)
    soff_t  GetLength() const override;
    // Current position (if known)
    soff_t  GetPosition() const override;

    void    Close() override;
    bool    Flush() override;

    size_t  Read(void *buffer, size_t size) override;
    int32_t ReadByte() override;
    size_t  Write(const void *buffer, size_t size) override;
    int32_t WriteByte(uint8_t val) override;

    soff_t  Seek(soff_t offset, StreamSeek origin) override;

private:
    void Open(std::unique_ptr<IStreamBase> &&base_stream);
    void OpenSection(std::unique_ptr<IStreamBase> &&base_stream, soff_t start_pos, soff_t end_pos);
    // Reads a chunk of data into the buffer, starting from the given offset
    void FillBufferFromPosition(soff_t position);
    // Writes a buffer into the underlying stream impl, and reposition to the new offset
    void FlushBuffer(soff_t position);

    // TODO: store IStreamBase as a shader_ptr instead? will let use it after wrapper is disposed
    std::unique_ptr<IStreamBase> _base;
    soff_t _start = 0; // valid section starting offset
    soff_t _end = 0; // valid section ending offset
    soff_t _position = 0; // absolute read/write offset
    soff_t _bufferPosition = 0; // buffer's location relative to base stream
    std::vector<uint8_t> _buffer;
};

} // namespace Common
} // namespace AGS

#endif // __AGS_CN_UTIL__BUFFEREDSTREAM_H


), %edi
 addl %eax,0(%edi)
 addl %ebx,4(%edi)
 addl %ecx,8(%edi)
 addl %edx,12(%edi)

 movl (20 -4)(%esp), %edi
 cmpl %edi, %ebp
 jb 0b

 movl (20 -8)(%esp), %ebx
 movl (20 -12)(%esp), %esi
 movl (20 -16)(%esp), %edi
 addl $(20), %esp
 popl %ebp
 ret


loat *>(&out.data[distance_ptr_offset]) = pt_out[0];
      pt_out[0] = std::numeric_limits<float>::quiet_NaN();
    }

    memcpy(&out.data[xyz_offset[0]], &pt_out[0], sizeof(float));
    memcpy(&out.data[xyz_offset[1]], &pt_out[1], sizeof(float));
    memcpy(&out.data[xyz_offset[2]], &pt_out[2], sizeof(float));

    xyz_offset += in.point_step;
  }

  // Check if the viewpoint information is present
  int vp_idx = pcl::getFieldIndex(in, "vp_x");
  if (vp_idx != -1) {
    // Transform the viewpoint info too
    for (size_t i = 0; i < out.width * out.height; ++i) {
      float * pstep =
        reinterpret_cast<float *>(&out.data[i * out.point_step + out.fields[vp_idx].offset]);
      // Assume vp_x, vp_y, vp_z are consecutive
      Eigen::Vector4f vp_in(pstep[0], pstep[1], pstep[2], 1);
      Eigen::Vector4f vp_out = transform * vp_in;

      pstep[0] = vp_out[0];
      pstep[1] = vp_out[1];
      pstep[2] = vp_out[2];
    }
  }
}

//////////////////////////////////////////////////////////////////////////////////////////////
void
transformAsMatrix(const tf2::Transform & bt, Eigen::Matrix4f & out_mat)
{
  double mv[12];
  bt.getBasis().getOpenGLSubMatrix(mv);

  tf2::Vector3 origin = bt.getOrigin();

  out_mat(0, 0) = mv[0]; out_mat(0, 1) = mv[4]; out_mat(0, 2) = mv[8];
  out_mat(1, 0) = mv[1]; out_mat(1, 1) = mv[5]; out_mat(1, 2) = mv[9];
  out_mat(2, 0) = mv[2]; out_mat(2, 1) = mv[6]; out_mat(2, 2) = mv[10];

  out_mat(3, 0) = out_mat(3, 1) = out_mat(3, 2) = 0; out_mat(3, 3) = 1;
  out_mat(0, 3) = origin.x();
  out_mat(1, 3) = origin.y();
  out_mat(2, 3) = origin.z();
}

void
transformAsMatrix(const geometry_msgs::msg::TransformStamped & bt, Eigen::Matrix4f & out_mat)
{
  tf2::Transform transform;
  tf2::convert(bt.transform, transform);
  transformAsMatrix(transform, out_mat);
}
}  // namespace pcl_ros

//////////////////////////////////////////////////////////////////////////////////////////////
template void pcl_ros::transformPointCloudWithNormals<pcl::PointNormal>(
  const pcl::PointCloud<pcl::PointNormal> &, pcl::PointCloud<pcl::PointNormal> &,
  const tf2::Transform &);
template void pcl_ros::transformPointCloudWithNormals<pcl::PointXYZRGBNormal>(
  const pcl::PointCloud<pcl::PointXYZRGBNormal> &, pcl::PointCloud<pcl::PointXYZRGBNormal> &,
  const tf2::Transform &);
template void pcl_ros::transformPointCloudWithNormals<pcl::PointXYZINormal>(
  const pcl::PointCloud<pcl::PointXYZINormal> &, pcl::PointCloud<pcl::PointXYZINormal> &,
  const tf2::Transform &);

//////////////////////////////////////////////////////////////////////////////////////////////
template void pcl_ros::transformPointCloudWithNormals<pcl::PointNormal>(
  const pcl::PointCloud<pcl::PointNormal> &, pcl::PointCloud<pcl::PointNormal> &,
  const geometry_msgs::msg::TransformStamped &);
template void pcl


/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public fun <E> ReceiveChannel<E>.dropWhile(
    context: CoroutineContext = Dispatchers.Unconfined,
    predicate: suspend (E) -> Boolean
): ReceiveChannel<E> =
    GlobalScope.produce(context, onCompletion = consumes()) {
        for (e in this@dropWhile) {
            if (!predicate(e)) {
                send(e)
                break
            }
        }
        for (e in this@dropWhile) {
            send(e)
        }
    }

@PublishedApi
internal fun <E> ReceiveChannel<E>.filter(
    context: CoroutineContext = Dispatchers.Unconfined,
    predicate: suspend (E) -> Boolean
): ReceiveChannel<E> =
    GlobalScope.produce(context, onCompletion = consumes()) {
        for (e in this@filter) {
            if (predicate(e)) send(e)
        }
    }

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public fun <E> ReceiveChannel<E>.filterIndexed(
    context: CoroutineContext = Dispatchers.Unconfined,
    predicate: suspend (index: Int, E) -> Boolean
): ReceiveChannel<E> =
    GlobalScope.produce(context, onCompletion = consumes()) {
        var index = 0
        for (e in this@filterIndexed) {
            if (predicate(index++, e)) send(e)
        }
    }

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public fun <E> ReceiveChannel<E>.filterNot(
    context: CoroutineContext = Dispatchers.Unconfined,
    predicate: suspend (E) -> Boolean
): ReceiveChannel<E> =
    filter(context) { !predicate(it) }

@PublishedApi
@Suppress("UNCHECKED_CAST")
internal fun <E : Any> ReceiveChannel<E?>.filterNotNull(): ReceiveChannel<E> =
    filter { it != null } as ReceiveChannel<E>

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public suspend fun <E : Any, C : MutableCollection<in E>> ReceiveChannel<E?>.filterNotNullTo(destination: C): C {
    consumeEach {
        if (it != null) destination.add(it)
    }
    return destination
}

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public suspend fun <E : Any, C : SendChannel<E>> ReceiveChannel<E?>.filterNotNullTo(destination: C): C {
    consumeEach {
        if (it != null) destination.send(it)
    }
    return destination
}

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public fun <E> ReceiveChannel<E>.take(n: Int, context: CoroutineContext = Dispatchers.Unconfined): ReceiveChannel<E> =
    GlobalScope.produce(context, onCompletion = consumes()) {
        if (n == 0) return@produce
        require(n >= 0) { "Requested element count $n is less than zero." }
        var remaining: Int = n
        for (e in this@take) {
            send(e)
            remaining--
            if (remaining == 0)
                return@produce
        }
    }

/** @suppress **/
@Deprecated(message = "Binary compatibility", level = DeprecationLevel.HIDDEN)
public fun <E> ReceiveChannel<E>.takeWhile(
    context: CoroutineContext = Dispatchers.Unconfined,
    predicate: suspend (E) -> Boolean
): ReceiveChannel<E> =