R : Any> storeOnEach(source: Flow<T>, crossinline transform: (T) -> R): Flow<T> {
        return source.onEach { fetchedEntity ->
            storeAndReturn(fetchedEntity) { transform(it) }
        }
    }

    private suspend inline fun <T, reified R : Any> storeAndReturn(value: T?, transform: (T) -> R): T? {
        if (value == null) return null
        cache.put(transform(value))
        return value
    }

    override fun toString(): String = "StoreEntitySupplier(supplier=$supplier, cache=$cache)"
}
package dev.kord.core.behavior.automoderation

import dev.kord.common.entity.AutoModerationRuleTriggerType
import dev.kord.common.entity.AutoModerationRuleTriggerType.*
import dev.kord.common.entity.Permission.ManageGuild
import dev.kord.common.entity.Snowflake
import dev.kord.common.exception.RequestException
import dev.kord.core.Kord
import dev.kord.core.behavior.GuildBehavior
import dev.kord.core.cache.data.AutoModerationRuleData
import dev.kord.core.entity.Guild
import dev.kord.core.entity.KordEntity
import dev.kord.core.entity.Strategizable
import dev.kord.core.entity.automoderation.*
import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.hash
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy
import dev.kord.rest.builder.automoderation.*
import dev.kord.rest.request.RestRequestException
import kotlin.contracts.InvocationKind.EXACTLY_ONCE
import kotlin.contracts.contract

/** The behavior of an [AutoModerationRule]. */
public sealed interface AutoModerationRuleBehavior : KordEntity, Strategizable {

    /** The ID of the [Guild] which this rule belongs to. */
    public val guildId: Snowflake

    /** The behavior of the [Guild] which this rule belongs to. */
    public val guild: GuildBehavior get() = GuildBehavior(guildId, kord)

    /** The rule [trigger type][AutoModerationRuleTriggerType]. */
    public val triggerType: AutoModerationRuleTriggerType?

    /**
     * Requests to get this behavior as an [AutoModerationRule]. Returns `null` if it wasn't found.
     *
     * This requires the [ManageGuild] permission.
     *
     * @throws RequestException if anything went wrong during the request.
     */
    public suspend fun asAutoModerationRuleOrNull(): AutoModerationRule? =
        supplier.getAutoModerationRuleOrNull(guildId, ruleId = id)

    /**
     * Requests to get this behavior as an [AutoModerationRule].
     *
     * This requires the [ManageGuild] permission.
     *
     * @throws RequestException if anything went wrong during the request.
     * @throws EntityNotFoundException if the [AutoModerationRule] wasn't found.
     */
    public suspend fun asAutoModerationRule(): AutoModerationRule = supplier.getAutoModerationRule(guildId, ruleId = id)

    /**
     * Requests to get the [Guild] which this rule belongs to. Returns `null` if it wasn't found.
     *
     * @throws RequestException if anything went wrong during the request.
     */
    public suspend fun getGuildOrNull(): Guild? = supplier.getGuildOrNull(guildId)

    /**
     * Requests to get the [Guild] which this rule belongs to.
     *
     * @throws RequestException if anything went wrong during the request.
     * @throws EntityNotFoundException if the [Guild] wasn't found.
     */
    public suspend fun getGuild(): Guild = supplier.getGuild(guildId)

    /**
     * Request


                   if (args[0].ToLower() == "-pickup")
                    {
                        pickUp = true;
                    }
                    else
                    {
                        this.ShowSyntax(caller);

                        return;
                    }
                }

                lock (caller.Map.Drops)
                {
                    List<Drop> toPick = new List<Drop>();

                    foreach (Drop loopDrop in caller.Map.Drops)
                    {
                        toPick.Add(loopDrop);
                    }

                    foreach (Drop loopDrop in toPick)
                    {
                        if (pickUp)
                        {
                            loopDrop.Picker = caller;
                        }

                        caller.Map.Drops.Remove(loopDrop);
                    }
                }
            }
        }
    }
}


 _)| i + 1)
        .collect::<Vec<_>>();

    content
        .match_indices(separator)
        .map(|(i, _)| i)
        .filter(|i| outside_brace_ranges.iter().any(|range| range.contains(i)))
        .filter(|i| !backslash_preceeding_indices.contains(i))
        .collect::<Vec<_>>()
}

/// Find the `Range`s of bytes in a string which are not enclosed by curly braces.
///
/// Any given variant of opening and closing characters can be used.
///
/// Since content withing braces should be kept together we often will not want to split
/// lines in the middle of them. So we need a way to identify where in a string these braces
/// are before operating on it.
///
/// This function returns all the byte ranges in a string which are not enclosed by matching
/// braces.
///
/// # Notes
/// *   Yes, the returned ranges are byte ranges instead of character index ranges.
/// *   Opening and closing characters must be single-byte characters.
fn get_brace_level_zero_ranges(
    content: &str,
    open: char,
    close: char,
) -> Result<Vec<Range<usize>>, LineErrorKind> {
    let brace_levels = get_brace_level_of_line(content, open, close)?;
    let num_bytes = brace_levels.len();

    let mut iter = brace_levels.into_iter().enumerate().peekable();

    let mut start_range = Vec::new();
    let mut end_range = Vec::new();

    while let Some((i, level)) = iter.next() {
        if i == 0 && level == 0 {
            start_range.push(i);
        }

        if let Some((_, next_level)) = iter.peek() {
            match (level, next_level) {
                (0, 1) => end_range.push(i + 1),
                (1, 0) => start_range.push(i + 2),
                _ => (),
            }
        }
    }

    if end_range.len() < start_range.len() && *start_range.last().unwrap() < num_bytes {
        end_range.push(num_bytes);
    }

    Ok(start_range
        .into_iter()
        .zip(end_range.into_iter())
        .map(|(start, end)| Range { start, end })
        .collect())
}

/// Map every byte in a string to how many braces are nested for it.
///
/// Any given variant of opening and closing characters can be used.
///
/// If the opening and closing characters are identical the nesting level toggles between
/// zero and one every time the character is encountered.
///
/// # Notes
/// *   Braces can be preceeded with backslashes ('\') in which case they do not
///     count as nesting braces.
/// *   Opening and closing characters must be single-byte characters.
///
/// # Example
/// ```ignore
/// assert_eq!(
///     &get_brace_level_of_line("0{}{{2}}{}0", '{', '}').unwrap(),
///     &[0, 1, 0, 1, 2, 2, 1, 0, 1, 0, 0]
/// );
/// ```
fn get_brace_level_of_line(
    content: &str,
    open: char,
    close: char,
) -> Result<Vec<u8>, LineErrorKind> {
    content
        .bytes()
        .scan((None, 0), |(prev, brace_level), byte| {
            if byte == open as u8 && prev.map(|c| c != b'\\').unwrap_or(true) {
                *brace_level += 1;
            } else if byte == close as u8 && prev.map(|c| c != b'\\').unwrap_or(true) {
                if *brace_level > 0 {
                    *brace_level -= 1;
                } else {


*
 *

 *
 * <Controls.dateRange:Input>
 *    <ws:startValueValidators>
 *       <ws:Array>
 *          <ws:Object>
 *             <ws:validator>
 *                <ws:Function>Controls-demo/Input/DateBase/Validators/isInRange:default</ws:Function>
 *             </ws:validator>
 *             <ws:arguments startValue="{{_startValue}}" endValue="{{_endValue}}"/>
 *          </ws:Object>
 *       </ws:Array>
 *    </ws:startValueValidators>
 * </Controls.dateRange:Input>
 *

 * @demo Controls-demo/dateRange/Input/Validators/Index
 *
 * @see Controls/_interface/IDateRangeValidators#endValueValidators
 * @see Controls/_interface/IDateRangeValidators#validateByFocusOut
 */

/**
 * @name Controls/_interface/IDateRangeValidators#endValueValidators
 * @cfg {Array} Массив вылидаторов или объектов, содержащих валидаторы и их аргументы.
 *
 * @remark
 * При вызове валидатора в качестве аргументов он получает введенное в поле значение и заданные из прикладного кода
 * аргументы.
 *
 * @example
 * Поле ввода периода с валидатором, который проверяет, что в поле ввода конца периода введено значение.
 * Так же этот валидатор устанавливается в поле ввода в диалоге выбора периода, который открывается
 * по клику на кнопку рядом с полями ввода.
 *
 *

 *
 * <Controls.dateRange:Input>
 *     <ws:endValueValidators>
 *         <ws:Array>
 *             <ws:Function>Controls/validate:isRequired</ws:Function>
 *         </ws:Array>
 *     </ws:endValueValidators>
 * </Controls.dateRange:Input>
 *

 *
 * Поле ввода с прикладным валидатором, который проверяет, что конец периода лежит в интервале между _startValue
 * и _endValue.
 *
 *

 *
 * <Controls.dateRange:Input>
 *     <ws:endValueValidators>
 *         <ws:Array>
 *             <ws:Object>
 *                 <ws:validator>
 *                     <ws:Function>Controls-demo/Input/DateBase/Validators/isInRange:default</ws:Function>
 *                 </ws:validator>
 *                 <ws:arguments startValue="{{_startValue}}" endValue="{{_endValue}}"/>
 *             </ws:Object>
 *         </ws:Array>
 *     </ws:endValueValidators>
 * </Controls.dateRange:Input>
 *

 * @demo Controls-demo/dateRange/Input/Validators/Index
 *
 * @see Controls/_interface/IDateRangeValidators#startValueValidators
 * @see Controls/_interface/IDateRangeValidators#validateByFocusOut
 */

/**
 * @name Controls/_interface/IDateRangeValidators#validateByFocusOut
 * @cfg {Boolean} Если true, то внутренняя валидация будет срабатывать по уходу фокуса из контрола, если false то
 * будет срабатывать только по внешнему триггеру, например при валидации формы.
 * @default true
 *
 * @example
 * В


_31, out_offset, bsum_offset

      64-79 : shuffle_x<0-7>y0, shuffle_x<0-7>y1

      64-79 : m0<0-3>, m1<0-3>, m2<0-3>, m3<0-3>
      80-95 : t0<0-1>, t1<0-1>, t2<0-1>, t3<0-1>

    3,2,11,10,19,18,27,26,1,0,9,8,17,16,25,24 ~ b<00|01|10|11>, x<00|01|10|11>, sum<0|1>, s0<0-1>, s1<0-1>

        // Image registers (registers assigned to avoid bank conflicts)
         96 = i00
         97 = i01
         98 = i02
         99 = i03
        100 = i30
        101 = i31
        102 = i32
        103 = i33
        105 = i13
        104 = i12
        107 = i11
        106 = i10
        108 = i23, TI23, I23
        109 = i22, TI22
        110 = i21, TI21
        111 = i20, TI20, I20
        113 = TI00, I00, TI10, I10, I21, I01
        112 = TI01, I11
        115 = TI02, I12
        114 = TI03, I03, TI11, I31
        116 = TI30, I30, TI12, I32
        117 = TI31
        118 = TI32
        119 = TI33, I33, TI13, I13, I22, I02
    // Filter registers
[+
    our $FX;
    return $FX ? q{
    104-119 : F0<0-3>, F1<0-3>, F2<0-3>, F3<0-3>
    } : q{
         96 = f00, TF00, F00
         97 = f01, TF01
         98 = f02, TF02, F03
         99 = f10
        100 = f11
        101 = f12
        102 = f20, TF30, F30
        103 = f21, TF31
        104 = f22, TF32, F33
        105 = tb3, F32
        106 = tb0, F02
        107 = ta2, TF22, F23
        108 = ta0, TF20, F20
        109 = ta1, TF21
        110 = F01
        111 = F31
        112 = TF10, F10
        113 = TF11
        114 = TF12, F13
        115 = tb1, F12
        116 = tb2, F22
        117 = F11
        118 = F21
    };
+]
</REGISTER_MAPPING>

--:-:1:-:1      S2R tid,      SR_TID.X;
--:-:2:-:1      S2R idx_PQnk, SR_CTAID.X;
<SCHEDULE_BLOCK>
01:-:-:-:1      ISETP.GE.AND P0, PT, tid, 128, PT;

--:-:-:-:1      LOP.AND tid31, tid, 31;

// c = (tid & 127) / 32
--:-:-:-:1      BFE.U32 c, tid, 0x205; // 2 bits at position 5

--:-:-:-:1      SHL addr_zero, tid31, 4;
--:-:-:-:1      ISCADD addr_zero, c, addr_zero, 11;
--:-:-:-:1  @P0 IADD addr_zero, addr_zero, 4x<512*4>;

--:-:-:-:1      STS.1


"Orca.include.node_modules.roact-hooked.out.utils", "Orca.include.node_modules.roact-hooked.out")

newModule("are-deps-equal", "ModuleScript", "Orca.include.node_modules.roact-hooked.out.utils.are-deps-equal", "Orca.include.node_modules.roact-hooked.out.utils", function () local fn = assert(loadstring("-- Compiled with roblox-ts v1.2.7\
local function areDepsEqual(nextDeps, prevDeps)\
\9if prevDeps == nil then\
\9\9return false\
\9end\
\9if #nextDeps ~= #prevDeps then\
\9\9return false\
\9end\
\9do\
\9\9local i = 0\
\9\9local _shouldIncrement = false\
\9\9while true do\
\9\9\9if _shouldIncrement then\
\9\9\9\9i += 1\
\9\9\9else\
\9\9\9\9_shouldIncrement = true\
\9\9\9end\
\9\9\9if not (i < #nextDeps) then\
\9\9\9\9break\
\9\9\9end\
\9\9\9if nextDeps[i + 1] == prevDeps[i + 1] then\
\9\9\9\9continue\
\9\9\9end\
\9\9\9return false\
\9\9end\
\9end\
\9return true\
end\
return {\
\9areDepsEqual = areDepsEqual,\
}\
", '@'.."Orca.include.node_modules.roact-hooked.out.utils.are-deps-equal")) setfenv(fn, newEnv("Orca.include.node_modules.roact-hooked.out.utils.are-deps-equal")) return fn() end)

newModule("memoized-hook", "ModuleScript", "Orca.include.node_modules.roact-hooked.out.utils.memoized-hook", "Orca.include.node_modules.roact-hooked.out.utils", function () local fn = assert(loadstring("-- Compiled with roblox-ts v1.2.7\
local EXCEPTION_INVALID_HOOK_CALL = table.concat({ \"Invalid hook call. Hooks can only be called inside of the body of a function component.\", \"This is usually the result of conflicting versions of roact-hooked.\", \"See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.\" }, \"\\n\")\
local EXCEPTION_RENDER_NOT_DONE = \"Failed to render hook! (Another hooked component is rendering)\"\
local EXCEPTION_RENDER_OVERLAP = \"Failed to render hook! (Another hooked component rendered during this one)\"\
local currentHook\
local currentlyRenderingComponent\
--[[\
\9*\
\9* Prepares for an upcoming render.\
]]\
local function renderReady(component)\
\9local _arg0 = currentlyRenderingComponent == nil\
\9assert(_arg0, EXCEPTION_RENDER_NOT_DONE)\
\9currentlyRenderingComponent = component\
end\
--[[\
\9*\
\9* Cleans up hooks. Must be called after finishing a render!\
]]\
local function renderDone(component)\
\9local _arg0 = currentlyRenderingComponent == component\
\9assert(_arg0, EXCEPTION_RENDER_OVERLAP)\
\9currentlyRenderingComponent = nil\
\9currentHook = nil\
end\
--[[\
\9*\
\9* Returns the currently-rendering component. Throws an error if a component is not mid-render.\
]]\
local function resolveCurrentComponent()\
\9return currentlyRenderingComponent or error(EXCEPTION_INVALID_HOOK_CALL


INE)
            pipeline = new TskReportPipeline();
        else
            throw TskException("Unsupported pipeline type.");

        m_pipelines.push_back(pipeline);

        for (unsigned long i = 0; i < pipelines->length(); i++)
        {
            Poco::XML::Node * pNode = pipelines->item(i);
            Poco::XML::Element* pElem = dynamic_cast<Poco::XML::Element*>(pNode);

            if (pElem)
            {
                std::string xmlPipelineType = pElem->getAttribute(TskPipelineManager::PIPELINE_TYPE_ATTRIBUTE);
                std::string xmlPipelineName = pElem->getAttribute(TskPipelineManager::PIPELINE_NAME_ATTRIBUTE);

                // The following conditions are required because we want to be able to use
                // "PostProcessing" and "Report" to be used interchangeably (at least for the moment).
                // Note that the sanity check below will not catch the case where there are both
                // "PostProcessing" and "Report" pipelines in the configuration file.
                if (xmlPipelineName == name && (xmlPipelineType == pipelineType) ||
                    (pipelineType == REPORTING_PIPELINE_STR && xmlPipelineType == POST_PROCESSING_PIPELINE_STR) ||
                    (pipelineType == POST_PROCESSING_PIPELINE_STR && xmlPipelineType == REPORTING_PIPELINE_STR))
                {
                    // quick sanity check to verify that there is only one pipeline in the config file for this type and name
                    for (unsigned long i2 = i+1; i2 < pipelines->length(); i2++) {
                        Poco::XML::Node * pNode2 = pipelines->item(i2);
                        Poco::XML::Element* pElem2 = dynamic_cast<Poco::XML::Element*>(pNode2);

                        if (pElem2 &&
                            pElem2->getAttribute(TskPipelineManager::PIPELINE_TYPE_ATTRIBUTE) == pipelineType &&
                            pElem2->getAttribute(TskPipelineManager::PIPELINE_NAME_ATTRIBUTE) == name)
                        {
                            std::stringstream exMsg;
                            exMsg << "Multiple pipelines found with the same type (" << pipelineType
                                << ") and name (" << name << ")";
                            throw TskException (exMsg.str());
                        }
                    }
                    // We found the right pipeline so initialize it.
                    Poco::XML::DOMWriter writer;
                    std::ostringstream pipelineXml;
                    writer.writeNode(pipelineXml, pNode);

                    pipeline->initialize(pipelineXml.str());

                    return pipeline;
                }
            }
        }
    }
    catch (Poco::XML::SAXParseException& )
    {
        throw TskException("Error parsing pipeline config file.");
    }
    catch (TskException& ex)
    {
        throw ex;
    }

    std::stringstream errorMsg;
    errorMsg << "Failed to find " << pipelineType << " pipeline";
    if (!name.empty())
        errorMsg << " with name " << name;

    throw TskException(errorMsg.str());
}

/**
 * Creates a pipeline object by reading the pipeline config file specified as
 * a system property.
 * @returns Pointer to TskPipeline.  Do not free this. It will be freed by the
 * TskPipelineManager destructor.
 */
TskPipeline * TskPipelineManager::createPipeline(const std::


tShQ5tjBYFCYDH5PsbV2Nu+9bqi8rCR5mTGsDrtBD3ukgBbhvIxPnqzoZigrCtweAFsu4KgQHjwChqb4LX5uGSpjouUZIzBpM5ZljGPzZoqwL6qUwLKxgLHzLydILJJL55qES2uiMXA+eZEH86mMzilis+bPOIUNX1lEQBVRjgJj1NRreqIJznpnQpKMnHwpiShy2AcFA/F5YqCzqxzaEoKHCf04EBbcp/OiRpecba8QdLFanI/vbRhCv0kHNGG+iy5O+mEKCOadhNBxTYudMzuseYyMdHX5FXz1KASZS6N+0lcA+SmWKSFxwVwgD3ghSXTNVTOTiI3FHEo61y4v0INQwwizckQjLJX/y+SLOlxpTlpxMyN4q0zWLUZdU5aBi4XzkEtjKhzUv0sYOXic35z0sUXz5HuJC0AXcNTp8FaXrCy1nXxZ2aWJruGU5P0SU8EdumuodTRzGxqwTT5hOSHPHa675DetRXPhEe4hC/6EU1xUDwUl+jjR0dK8rWx9AGsMN6xKzE90rb8N0tZ+ealmXpccqk9skbW5DnEXEt6slP1Dp7+6xUmR/FQXKqfjo+UZI4DfXANOeyPspLN0jJsxUopZErweN5OckXGi6daRIsrYjFQYxkX8NW9qA6i8D0KDztbtlzDgt5pQqlah0e9bedVe/BkE7aYj0uW6riQq5x3oSIYdyFN+IgE7kLUAajoxl1Ix30I3oWoxTnh0Gd63IWMB+1CetvCi3PCKqniIYdyP3QVT6Q5We6JhcVXSTLsCq0WfaSFh5KptD8AKu2PwMe60v4IvDzwUNsfuLdIBbU/MFTpm6YQ+hJW2L7tD8IVbIvkSrY/3ro0t26RZ6X2x3+x1apl1fM/7N14t5h1kdIVA5FXV4JxgD3gYfudSvujeBNWjKpUPCt2aR8ycOVOPuQLvmLDMVxyF7B3s84dAf/CsoDtod9cfrWdsY+/C/8HVfy/LmN347j8X8FmUoebjG3Aod3lV9sZc1GPq/ifIfhWlT5KPP4N9JQx0JLsoS9Ej1Jibi64qp7ub912rlCsdI2mDuKH3yN4u3eLc9R1WDVnnIMY61W6g5Qgxf0P/UFw0L/BhyIAAAAASUVORK5CYII=\" class=\"data-icon\"/>\n" +
            "                ${date}\n" +
            "
\n" +
            "
\n" +
            "                ${time}, ${this.props.locality}\n" +
            "
\n" +
            "
`;\n" +
            "    }\n" +
            "}\n" +
            "\n" +
            "web3.tokens.dataChanged = (oldTokens, updatedTokens, tokenCardId) => {\n" +
            "    const currentTokenInstance = updatedTokens.currentInstance;\n" +
            "    document.getElementById(tokenCardId).innerHTML = new Token(currentTokenInstance).render();\n" +
            "};\n" +
            "\n" +
            "//\n" +
            "</script>\n" +
            "      </ts:view>\n" +
            "    </ts:card>\n" +
            "    <ts:card exclude=\"expired\" type=\"action\">\n" +
            "


p00603	[
      xml
    | html
    | graphics
        ]
           Jul 11, 2006	           Glycosphingolipid biosynthesis - globoseries

          map00604	[
      xml
    | html
    | graphics
        ]
           Aug 29, 2006	           Glycosphingolipid biosynthesis - ganglioseries

<BIG>Biosynthesis of Polyketides and Nonribosomal Peptides</BIG>

          map00522	[
      xml
    | html
    | graphics
        ]
           Dec 14, 2005	           Biosynthesis of 12-, 14- and 16-membered macrolides

          map01051	[
      xml
    | html
    | graphics
        ]
           May 09, 2006	           Biosynthesis of ansamycins

          map01056	[
      xml
    | <a href="/kegg-bin/xml


: 12px;
  color: #fff;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
  text-align: center;
  background-color: red;
  z-index: 10;
  border-radius: 1000px;
  top: 0;
  right: 0;
  -webkit-transform: translate(50%, -50%);
          transform: translate(50%, -50%);
}
.am-mark-around > sup {
  position: relative;
}
.am-mark-active > sup {
  min-width: 8px;
  height: 8px;
  padding: 0;
}
/* ==========================================================================
   Component: Alert Plugin
 ============================================================================ */
.am-alert {
  margin-bottom: 1em;
  padding: 1em 1.5em;
  background: #5085FF;
  color: #fff;
  border-radius: 4px;
  font-size: 1rem;
}
@media only screen and (max-width: 640px) {
  .am-alert {
    padding: 0.75em 1em;
  }
}
.am-alert a {
  color: #fff;
}
.am-alert h1,
.am-alert h2,
.am-alert h3,
.am-alert h4,
.am-alert h5,
.am-alert h6 {
  color: inherit;
}
.am-alert .am-close {
  opacity: 1;
  font-weight: bold;
  text-shadow: none;
  color: #fff;
}
.am-alert .am-close:hover {
  opacity: .6;
}
.am-alert-icon-lg {
  position: relative;
}
.am-alert-icon-lg:before,
.am-alert-icon-lg:after {
  content: " ";
  display: table;
}
.am-alert-icon-lg:after {
  clear: both;
}
.am-alert-icon-lg .am-alert-bd {
  margin-left: 3rem;
}
@media only screen and (max-width: 640px) {
  .am-alert-icon-lg .am-alert-bd {
    margin-left: 2.5rem;
  }
}
.am-alert-icon-lg .am-alert-bd p {
  margin-top: 0px;
  margin-bottom: 0px;
}
.am-alert-icon-lg [class*='am-icon-'] {
  font-size: 2.5rem;
  float: left;
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
}
@media only screen and (max-width: 640px) {
  .am-alert-icon-lg [class*='am-icon-'] {
    font-size: 2rem;
  }
}
.am-alert-icon-lg::after {
  display: none;
}
.am-alert-icon-sm {
  position: relative;
}
.am-alert-icon-sm:before,
.am-alert-icon-sm:after {
  content: " ";
  display: table;
}
.am-alert-icon-sm:after {
  clear: both;
}
.am-alert-icon-sm [class*='am-icon-'] {
  font-size: 1rem;
  float: left;
  position: absolute;
  top: 50%;
  -webkit-transform: translateY(-50%);
          transform: translateY(-50%);
}
@media only screen and (max-width: 640px) {
  .am-alert-icon-sm [class*='am-icon-'] {
    font-size: 1.5rem;
  }
}
.am-alert-icon-sm p {
  margin-top: 0px;
  margin-left: 1.5rem;
}
@media only screen and (max-width: 640px) {
  .am-alert-icon-sm p {
    margin-left: 1.875rem;
  }
}
/* Add margin if adjace


 ViewConstraints defaultValues = ViewConstraints();
    expect(defaultValues.minWidth, 0);
    expect(defaultValues.maxWidth, double.infinity);
    expect(defaultValues.minHeight, 0);
    expect(defaultValues.maxHeight, double.infinity);

    expect(defaultValues.isTight, false);
    expect(defaultValues.isSatisfiedBy(const Size(200, 300)), true);
    expect(defaultValues.isSatisfiedBy(const Size(400, 500)), true);
    expect(defaultValues / 2, const ViewConstraints());
  });

  test('ViewConstraints', () {
    const ViewConstraints constraints = ViewConstraints(
      minWidth: 100,
      maxWidth: 200,
      minHeight: 300,
      maxHeight: 400,
    );
    expect(constraints.minWidth, 100);
    expect(constraints.maxWidth, 200);
    expect(constraints.minHeight, 300);
    expect(constraints.maxHeight, 400);

    expect(constraints.isTight, false);
    expect(constraints.isSatisfiedBy(const Size(200, 300)), true);
    expect(constraints.isSatisfiedBy(const Size(400, 500)), false);
    expect(
      constraints / 2,
      const ViewConstraints(minWidth: 50, maxWidth: 100, minHeight: 150, maxHeight: 200),
    );
  });

  test('scheduleWarmupFrame should call both callbacks and flush microtasks', () async {
    bool microtaskFlushed = false;
    bool beginFrameCalled = false;
    final Completer<void> drawFrameCalled = Completer<void>();
    PlatformDispatcher.instance.scheduleWarmUpFrame(
      beginFrame: () {
        expect(microtaskFlushed, false);
        expect(drawFrameCalled.isCompleted, false);
        expect(beginFrameCalled, false);
        beginFrameCalled = true;
        scheduleMicrotask(() {
          expect(microtaskFlushed, false);
          expect(drawFrameCalled.isCompleted, false);
          microtaskFlushed = true;
        });
        expect(microtaskFlushed, false);
      },
      drawFrame: () {
        expect(beginFrameCalled, true);
        expect(microtaskFlushed, true);
        expect(drawFrameCalled.isCompleted, false);
        drawFrameCalled.complete();
      },
    );
    await drawFrameCalled.future;
    expect(beginFrameCalled, true);
    expect(drawFrameCalled.isCompleted, true);
    expect(microtaskFlushed, true);
  });
}
// Copyright 2019 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'dart:io';
import 'dart:typed_data';
import 'dart:ui';

import 'package:path/path.dart' as path;
import 'package:test/test.dart';

void main() {
  test('Handles are distinct', () async {
    final Uint8List bytes = await _readFile('2x2.png');
    final Codec codec = await instantiateImageCodec(bytes);
    final FrameInfo frame = await codec.getNextFrame();
    codec.dispose();

    expect(frame.image.width, 2);
    expect(frame.image.height, 2);
    final Image handle1 = frame.image.clone();
    expect(handle1.width, frame.image.width);
    expect(handle1.height, frame.image.height);

    final Image handle2 = handle1.clone();
    expect(handle1 != handle2, true);
    expect(handle1 != frame.image, true);
    expect(frame.image == frame.image, true);

    frame.image.dispose();
  });

  test('Canvas can paint image from handle and byte data from handle', () async {
    final Uint8List bytes = await _readFile('2x2.png');
    final Codec codec =


/*
 * Copyright (c) 1986, 1988 The Regents of the University of California.
 * All rights reserved.
 *
 * This code is derived from software contributed to Berkeley by
 * Computer Consoles Inc.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *	This product includes software developed by the University of
 *	California, Berkeley and its contributors.
 * 4. Neither the name of the University nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 *	@(#)cpu.h	7.4 (Berkeley) 2/20/92
 */

/*
 * Assorted definitions unique to TAHOE CPU support.
 */

#define	uncache(v)	mtpr(PDCS, (caddr_t)(v))
#define	movow(a,w)	_movow((u_short *)(a), (u_short)(w))
#define	movob(a,b)	_movob((u_char *)(a), (u_char)(b))

#define	resettodr()	/* no todr to set */

#define	MAXCKEY	255		/* maximal allowed code key */
#define	MAXDKEY	255		/* maximal allowed data key */
#define	NCKEY	(MAXCKEY+1)	/* # code keys, including 0 (reserved) */
#define	NDKEY	(MAXDKEY+1)	/* # data keys, including 0 (reserved) */

#ifndef LOCORE
#ifdef KERNEL
char	ckey_cache[NCKEY];	/* 1 =>'s key i may be in code cache */
short	ckey_cnt[NCKEY];	/* code key reference count */
char	dkey_cache[NDKEY];	/* 1 =>'s key i may be in data cache */
short	dkey_cnt[NDKEY];	/* data key reference count */
#endif

/*
 * Statistics maintained for code and
 * data cache key allocations algorithms.
 */
struct	keystats {
	long	ks_avail;	/* number of keys currently unallocated */
	long	ks_dirty;	/* number of keys currently waiting for purge */
	long	ks_allocs;	/* number of keys allocated */
	long	ks_allocfree;	/* key allocated from free slot */
	long	ks_norefs;	/* key marked in use, but refcnt 0 */
	long	ks_taken;	/* key taken from single process */
	long	ks_shared;	/* key taken from multiple processes */
	long	ks_inval;	/* number of times keys exchanged */
};
#endif

long	*user_psl;		/* user mode psl for ast's */
int	intenable;		/* interrupts enable startup flag */
int	clk_enable;		/* clock enable startup flag */

/*
 * Enable realtime clock.
 */
#define	enablertclock()	(clk_enable = 1)

#ifndef _MTPR_H_
#include "mtpr.h"
#endif /* !_MTPR_H_ */


}
}// Copyright 2000-2025 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.jetbrains.ls.kotlinLsp

import com.github.ajalt.clikt.core.BadParameterValue
import com.github.ajalt.clikt.core.CliktCommand
import com.github.ajalt.clikt.core.PrintHelpMessage
import com.github.ajalt.clikt.parameters.options.*
import com.github.ajalt.clikt.parameters.types.path
import com.jetbrains.lsp.implementation.TcpConnectionConfig
import java.nio.file.Path

data class KotlinLspServerRunConfig(
    val mode: KotlinLspServerMode,
    val systemPath: Path?,
    val isolatedDocumentsMode: Boolean = false,
)

sealed interface KotlinLspServerMode {
    data object Stdio : KotlinLspServerMode

    data class Socket(val config: TcpConnectionConfig) : KotlinLspServerMode
}

fun parseArguments(args: Array<String>): KotlinLspCommand {
    val parser = Parser()
    try {
        parser.parse(args)
        return KotlinLspCommand.RunLsp(parser.createRunConfig())
    } catch (e: PrintHelpMessage) {
        return KotlinLspCommand.Help(e.command.getFormattedHelp())
    }
}

sealed class KotlinLspCommand {
    data class RunLsp(val config: KotlinLspServerRunConfig) : KotlinLspCommand()
    data class Help(val message: String) : KotlinLspCommand()
}

private class Parser : CliktCommand(name = "kotlin-lsp") {
    // the name "socket" is hardcoded in VSCode
    val socket: SocketConfig by option()
        .convert { it.toSocketConfig() }
        .default(SocketConfig("127.0.0.1", 9999))
        .help("A socket which will be used for a Kotlin LSP connection. Default is 127.0.0.1:9999")
    val stdio: Boolean by option().flag()
        .help("Whether the Kotlin LSP server is used in stdio mode. If not set, server mode will be used with a port specified by `${::socket.name}`")
    val client: Boolean by option().flag()
        .help("Whether the Kotlin LSP server is used in client mode. If not set, server mode will be used with a port specified by `${::socket.name}`")
        .validate { if (it && stdio) fail("Can't use stdio mode with client mode") }
    val systemPath: Path? by option().path()
        .help("Path for Kotlin LSP caches and indexes")
    val multiClient: Boolean by option().flag()
        .help("Whether the Kotlin LSP server is used in multiclient mode. If not set, server will be shut down after the first client disconnects.`")
        .validate {
            if (it && stdio) fail("Stdio mode doesn't support multiclient mode")
            if (it && client) fail("Client mode doesn't support multiclient mode")
        }
    val isolatedDocuments: Boolean by option().flag()
        .help("Whether the Kotlin LSP server is used in isolated documents mode, meaning that a workspace is isolated for each document (hence, each document has its own scope)")

    // TODO also parse --version flag, see LSP-225

    fun createRunConfig(): KotlinLspServerRunConfig {
        val mode = when {
            stdio -> KotlinLspServerMode.Stdio
            client -> KotlinLspServerMode.Socket(TcpConnectionConfig.Client(
                host = socket.host, port = socket.port))
            else -> KotlinLspServerMode.Socket(TcpConnectionConfig.Server(
                host = socket.host, port = socket.port, isMultiClient = multiClient))
        }
        return KotlinLspServerRunConfig(mode, systemPath, isolatedDocuments)
    }

    overrid


"),
    ITEM_TRIDENT_RIPTIDE_2("item.trident.riptide_2"),
    ITEM_TRIDENT_RIPTIDE_3("item.trident.riptide_3"),
    ITEM_TRIDENT_THROW("item.trident.throw"),
    ITEM_TRIDENT_THUNDER("item.trident.thunder"),
    ITEM_WOLF_ARMOR_BREAK("item.wolf_armor.break"),
    ITEM_WOLF_ARMOR_CRACK("item.wolf_armor.crack"),
    ITEM_WOLF_ARMOR_DAMAGE("item.wolf_armor.damage"),
    ITEM_WOLF_ARMOR_REPAIR("item.wolf_armor.repair"),
    MUSIC_CREATIVE("music.creative"),
    MUSIC_CREDITS("music.credits"),
    MUSIC_DISC_11("music_disc.11"),
    MUSIC_DISC_13("music_disc.13"),
    MUSIC_DISC_5("music_disc.5"),
    MUSIC_DISC_BLOCKS("music_disc.blocks"),
    MUSIC_DISC_CAT("music_disc.cat"),
    MUSIC_DISC_CHIRP("music_disc.chirp"),
    MUSIC_DISC_CREATOR("music_disc.creator"),
    MUSIC_DISC_CREATOR_MUSIC_BOX("music_disc.creator_music_box"),
    MUSIC_DISC_FAR("music_disc.far"),
    MUSIC_DISC_MALL("music_disc.mall"),
    MUSIC_DISC_MELLOHI("music_disc.mellohi"),
    MUSIC_DISC_OTHERSIDE("music_disc.otherside"),
    MUSIC_DISC_PIGSTEP("music_disc.pigstep"),
    MUSIC_DISC_PRECIPICE("music_disc.precipice"),
    MUSIC_DISC_RELIC("music_disc.relic"),
    MUSIC_DISC_STAL("music_disc.stal"),
    MUSIC_DISC_STRAD("music_disc.strad"),
    MUSIC_DISC_WAIT("music_disc.wait"),
    MUSIC_DISC_WARD("music_disc.ward"),
    MUSIC_DRAGON("music.dragon"),
    MUSIC_END("music.end"),
    MUSIC_GAME("music.game"),
    MUSIC_MENU("music.menu"),
    MUSIC_NETHER_BASALT_DELTAS("music.nether.basalt_deltas"),
    MUSIC_NETHER_CRIMSON_FOREST("music.nether.crimson_forest"),
    MUSIC_NETHER_NETHER_WASTES("music.nether.nether_wastes"),
    MUSIC_NETHER_SOUL_SAND_VALLEY("music.nether.soul_sand_valley"),
    MUSIC_NETHER_WARPED_FOREST("music.nether.warped_forest"),
    MUSIC_OVERWORLD_BADLANDS("music.overworld.badlands"),
    MUSIC_OVERWORLD_BAMBOO_JUNGLE("music.overworld.bamboo_jungle"),
    MUSIC_OVERWORLD_CHERRY_GROVE("music.overworld.cherry_grove"),
    MUSIC_OVERWORLD_DEEP_DARK("music.overworld.deep_dark"),
    MUSIC_OVERWORLD_DESERT("music.overworld.desert"),
    MUSIC_OVERWORLD_DRIPSTONE_CAVES("music.overworld.dripstone_caves"),
    MUSIC_OVERWORLD_FLOWER_FOREST("music.overworld.flower_forest"),
    MUSIC_OVERWORLD_FOREST("music.overworld.forest"),
    MUSIC_OVERWORLD_FROZEN_PEAKS("music.overworld.frozen_peaks"),
    MUSIC_OVERWORLD_GROVE("music.overworld.grove"),
    MUSIC_OVERWORLD_JAGGED_PEAKS("music.overworld.jagged_peaks"),
    MUSIC_OVERWORLD_JUNGLE("music.overworld.jungle"),
    MUSIC_OVERWORLD_LUSH_CAVES("music.overworld.lush_caves"),
    MUSIC_OVERWORLD_MEADOW("music.overworld.meadow"),
    MUSIC_OVERWORLD_OLD_GROW


int ' +
						'binary bit by cascade char character check checkpoint close collate ' +
						'column commit committed connect connection constraint contains continue ' +
						'create cube current current_date current_time cursor database date ' +
						'deallocate dec decimal declare default delete desc distinct double drop ' +
						'dynamic else end end-exec escape except exec execute false fetch first ' +
						'float for force foreign forward free from full function global goto grant ' +
						'group grouping having hour ignore index inner insensitive insert instead ' +
						'int integer intersect into is isolation key last level load local max min ' +
						'minute modify move name national nchar next no numeric of off on only ' +
						'open option order out output partial password precision prepare primary ' +
						'prior privileges procedure public read real references relative repeatable ' +
						'restrict return returns revoke rollback rollup rows rule schema scroll ' +
						'second section select sequence serializable set size smallint static ' +
						'statistics table temp temporary then time timestamp to top transaction ' +
						'translation trigger true truncate uncommitted union unique update values ' +
						'varchar varying view when where with work';

		var operators =	'all and any between cross in join like not null or outer some';

		this.regexList = [
			{ regex: /--(.*)$/gm,												css: 'comments' },			// one line and multiline comments
			{ regex: SyntaxHighlighter.regexLib.multiLineDoubleQuotedString,	css: 'string' },			// double quoted strings
			{ regex: SyntaxHighlighter.regexLib.multiLineSingleQuotedString,	css: 'string' },			// single quoted strings
			{ regex: new RegExp(this.getKeywords(funcs), 'gmi'),				css: 'color2' },			// functions
			{ regex: new RegExp(this.getKeywords(operators), 'gmi'),			css: 'color1' },			// operators and such
			{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),				css: 'keyword' }			// keyword
			];
	};

	Brush.prototype	= new SyntaxHighlighter.Highlighter();
	Brush.aliases	= ['sql'];

	SyntaxHighlighter.brushes.Sql = Brush;

	// CommonJS
	typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();

/**
 * SyntaxHighlighter
 * http://alexgorbatchev.com/SyntaxHighlighter
 *
 * SyntaxHighlighter is donationware. If you are using it, please donate.
 * http://alexgorbatchev.com/SyntaxHighlighter/donate.html
 *
 * @version
 * 3.0.83 (July 02 2010)
 *
 * @copyright
 * Copyright (C) 2004-2010 Alex Gorbatchev.
 *
 * @license
 * Dual licensed under the MIT and GPL licenses.
 */
;(function()
{
	// CommonJS
	typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

	function Brush()
	{
		// Contributed by Andres Almiray
		// http://jroller.com/aalmiray/entry/nice_source_code_syntax_highlighter

		var keywords =	'as assert break case catch class continue def default do else extends finally ' +
						'if in implements import instanceof interface new package property return switch ' +
						'throw throws try while public protected private static';
		var types    =  'void boolean byte char short int long float double';
		var constants = 'null';
		var methods   = 'allProperties count get size '+
						'collect each each


an style="line-height: 150%;color: white;">CVE编号

风险等级

漏洞名称

利用可能

CVE-2022-37969

<span style="color: black;font-size: 14px;


from panda_backtest.backtest_common.constant.string_constant import STOCK_ORDER_FAILED_MESSAGE, \
ORDER_PRICE_TOO_HIGH, ORDER_PRICE_TOO_LOW, SYMBOL_LIMIT_HIGH, SYMBOL_LIMIT_LOW, SYMBOL_NO_QUOTATION
from panda_backtest.backtest_common.constant.strategy_constant import SIDE_BUY, SIDE_SELL, CLOSE, REJECTED
from panda_backtest.backtest_common.data.quotation.quotation_data import QuotationData
from panda_backtest.backtest_common.system.context.core_context import CoreContext
from panda_backtest.backtest_common.order.order_verify import OrderVerify
from panda_backtest.util.log.remote_log_factory import RemoteLogFactory
class StockOrderLimitPriceVerify(OrderVerify):

    def __init__(self):
        self.context = CoreContext.get_instance()

    def can_submit_order(self, account, order_result):
        sr_logger = RemoteLogFactory.get_sr_logger()
        strategy_context = self.context.strategy_context
        run_info = strategy_context.run_info
        trade_date = strategy_context.trade_date

        bar_dict = QuotationData.get_instance().bar_dict
        bar = bar_dict[order_result.order_book_id]

        if order_result.side == SIDE_BUY:
            order_side = '买入'
        else:
            order_side = '卖出'
        if order_result.effect == CLOSE:
            order_effect = '平仓'
        else:
            order_effect = '开仓'

        trade_date = strategy_context.trade_date
        if bar.last == 0 or bar.trade_date != trade_date:
            order_result.message = STOCK_ORDER_FAILED_MESSAGE % (
                order_result.order_book_id, str(order_result.quantity),
                account, order_effect, order_side, order_result.order_id,
                SYMBOL_NO_QUOTATION)
            return False

        limit_up = bar.limit_up
        limit_down = bar.limit_down

        if limit_up == 0:
            limit_up = bar.open * 1.1
        if limit_down == 0:
            limit_down = bar.open * 0.9

        if limit_up == 0:
            limit_up = 9999
            sr_logger.error("涨停价格数据异常,不做限制")
        if limit_down == 0:
            limit_down = 0
            sr_logger.error("跌停价格数据异常,不做限制")

        jz_price = bar.last

        if jz_price >= limit_up and order_result.side == SIDE_BUY:
            order_result.message = STOCK_ORDER_FAILED_MESSAGE % (order_result.order_book_id, str(order_result.quantity),
                                                                 account, order_effect, order_side,
                                                                 order_result.order_id,
                                                                 SYMBOL_LIMIT_HIGH)

            return False
        if jz_price <= limit_down and order_result.side == SIDE_SELL:
            order_result.message = STOCK_ORDER_FAILED_MESSAGE % (order_result.order_book_id, str(order_result.quantity),
                                                                 account, order_effect, order_side,
                                                                 order_result.order_id,
                                                                 SYMBOL_LIMIT_LOW)
            return False

        if order_result.price > limit_up:
            order_result.message = STOCK_ORDER_FAILED_MESSAGE % (order_result.order_book_id, str(order_result.quantity),
                                                                 account, order_effect, order_side,
                                                                 order_result.order_id,
                                                                 ORDER_PRICE_TOO_HIGH %
                                                                 (str(order_result.price), str(limit_up)))
            return False
        if order_result.price < limit_down:
            order_result.message = STOCK_ORDER_FAILED_MESSAGE % (order_result.order_book_id, str(order_result.quantity),
                                                                 account, order_effect, order_side,
                                                                 order_result.order_id,
                                                                 ORDER_PRICE_TOO_LOW %
                                                                 (str(order_result.price), str(limit_down)))
            return False

        return True


-Tokens $token</code>
///   <para>Get all WNF notifications which can be accessed by a low integrity copy of current token.</para>
/// </example>
[Cmdlet(VerbsCommon.Get, "AccessibleWnf", DefaultParameterSetName = "All")]
[OutputType(typeof(CommonAccessCheckResult))]
public class GetAccessibleWnfCmdlet : CommonAccessBaseWithAccessCmdlet<WnfAccessRights>
{
    private protected override void RunAccessCheck(IEnumerable<TokenEntry> tokens)
    {
        GenericMapping generic_mapping = NtWnf.GenericMapping;
        AccessMask access_rights = generic_mapping.MapMask(Access);
        var entries = NtWnf.GetRegisteredNotifications();

        foreach (var entry in entries)
        {
            var sd = entry.SecurityDescriptor;
            if (sd == null)
            {
                WriteWarning($"Couldn't query security for WNF Provider {entry.StateName:X016}.");
                continue;
            }

            if (sd.Owner == null)
            {
                sd.Owner = new SecurityDescriptorSid(new Sid("SY"), false);
            }

            if (sd.Group == null)
            {
                sd.Group = new SecurityDescriptorSid(new Sid("SY"), false);
            }

            foreach (TokenEntry token in tokens)
            {
                AccessMask granted_access = NtSecurity.GetMaximumAccess(sd,
                    token.Token, generic_mapping);
                if (IsAccessGranted(granted_access, access_rights))
                {
                    WriteObject(new WnfAccessCheckResult(entry, granted_access, sd, token.Information));
                }
            }
        }
    }
}


PLOT3, 13+i, rays.isSelected(i) ? "T" : "F");

            for (int i=0; i<3; i++)
              DMF.reg.putuo(UO_PLOT3, 15+i, bhsb.isSelected(i) ? "T" : "F");
            DMF.reg.putuo(UO_PLOT3, 18, bhsb.getText());

            updateAllInstances("Plot3Dim");
        }
    }

    void doH1Ddialog(JFrame frame)
    // 1D histogram options
    {
        LabelDataBox var       = new LabelDataBox(UO_1D, 0, NCHARS);
        LabelDataBox nbins     = new LabelDataBox(UO_1D, 1, NCHARS);
        BorVertRadioBox bounds = new BorVertRadioBox("", UO_1D, 2, 3);
        LabelDataBox hmin      = new LabelDataBox(UO_1D, 5, NCHARS);
        LabelDataBox hmax      = new LabelDataBox(UO_1D, 6, NCHARS);
        LabelBitBox average    = new LabelBitBox(UO_1D, 7);

        int result = JOptionPane.showOptionDialog(frame,
           new Object[] {var, nbins, bounds, hmin, hmax, average},
           "Histogram 1Dim Options",
           JOptionPane.OK_CANCEL_OPTION,
           JOptionPane.PLAIN_MESSAGE,
           null, null, null);

        if (result == JOptionPane.OK_OPTION)
        {
            DMF.reg.putuo(UO_1D, 0, var.getText());
            DMF.reg.putuo(UO_1D, 1, nbins.getText());

            for (int i=0; i<3; i++)
              DMF.reg.putuo(UO_1D, 2+i, bounds.isSelected(i) ? "T" : "F");

            DMF.reg.putuo(UO_1D, 5, hmin.getText());
            DMF.reg.putuo(UO_1D, 6, hmax.getText());
            DMF.reg.putuo(UO_1D, 7, average.isSelected() ? "T" : "F");
            updateAllInstances("Histo1Dim");
        }
    }

    void doH2Ddialog(JFrame frame)
    // 2D histogram options
    {
        BorVertRadioBox display = new BorVertRadioBox("View", UO_2D, 0, 2);
        LabelDataBox hvar     = new LabelDataBox(UO_2D, 2, NCHARS);
        LabelDataBox vvar     = new LabelDataBox(UO_2D, 3, NCHARS);
        LabelDataBox hbins    = new LabelDataBox(UO_2D, 4, NCHARS);
        LabelDataBox vbins    = new LabelDataBox(UO_2D, 5, NCHARS);
        LabelDataBox elev     = new LabelDataBox(UO_2D, 6, NCHARS);
        LabelDataBox azim     = new LabelDataBox(UO_2D, 7, NCHARS);

        BorVertRadioBox bounds = new BorVertRadioBox("Bounds", UO_2D, 8, 3);
        LabelDataBox hmin    = new LabelDataBox(UO_2D, 11, NCHARS);
        LabelDataBox hmax    = new LabelDataBox(UO_2D, 12, NCHARS);
        LabelDataBox vmin    = new LabelDataBox(UO_2D, 13, NCHARS);
        LabelDataBox vmax    = new LabelDataBox(UO_2D, 14, NCHARS);
        BorHorizStereoBox bhsb = new BorHorizStereoBox("Format", UO_2D, 15, frame);

        int result = JOptionPane.showOptionDialog(frame,
           new Object[] {display, hvar, vvar, hbins, vbins,
              elev, azim, bounds, hmin, hmax, vmin, vmax, bhsb},


1 = bNOT(FLRGFEED), E2 = e.S}
	f.S = bAND(f.E1, f.E2)

	FRGFEED = e.S

	A333_sts_msg.R_TK_GRVTY_FEED_ONLY.Video.IN = bool2num[f.S]

end

function A333_sts_msg.PITCH_MECH_BACK_UP.Monitor()

	local a = {E1 = ZPH1, E2 = ZPH10}
	a.S = bOR(a.E1, a.E2)

	local b = {E1 = SLRELVFT, E2 = bNOT(a.S)}
	b.S = bAND(b.E1, b.E2)

	A333_sts_msg.PITCH_MECH_BACK_UP.Video.IN = bool2num[b.S]

end

function A333_sts_msg.ROLL_DIRECT_LAW.Monitor()

	A333_sts_msg.ROLL_DIRECT_LAW.Video.IN = bool2num[SLRELVFT]

end

function A333_sts_msg.BAT_ONLY.Monitor()

	local a = {E1 = ZPH1, E2 = ZPH10}
	a.S = bOR(a.E1, a.E2)

	local b = {E1 = bNOT(WENA330EMERC), E2 = EEMER, E3 = WA330, E4 = bNOT(a.S)}
	b.S = bAND4(b.E1, b.E2, b.E3, b.E4)

	A333_sts_msg.BAT_ONLY.Video.IN = bool2num[b.S]

end

function A333_sts_msg.ONE_PACK_ONLY_IF_WAI_ON.Monitor()

	local a = {E1 = BB1NA, E2 = BB2NA}
	a.S = bXOR(a.E1, a.E2)

	local b = {E1 = JR1SD, E2 = JR2SD}
	b.S = bXOR(b.E1, b.E2)

	local c = {E1 = AP1PBOF, E2 = AP2PBOF}
	c.S = bXOR(c.E1, c.E2)

	local d = {E1 = a.S, E2 = b.S}
	d.S = bOR(d.E1, d.E2)

	local e = {E1 = IWAION, E2 = c.S}
	e.S = bAND(e.E1, e.E2)

	local f = {E1 = bNOT(IWAIC), E2 = d.S, E3 = bNOT(e.S), E4 = bNOT(ZGND)}
	f.S = bAND4(f.E1, f.E2, f.E3, f.E4)

	A333_sts_msg.ONE_PACK_ONLY_IF_WAI_ON.Video.IN = bool2num[f.S]

end

function A333_sts_msg.HYD_GY_SYS_INOP.Monitor()

	local a = {E1 = HYSYSLP, E2 = HGSYSLP}
	a.S = bAND(a.E1, a.E2)

	A333_sts_msg.HYD_GY_SYS_INOP.Video.IN = bool2num[a.S]

end

function A333_sts_msg.HYD_GB_SYS_INOP.Monitor()

	local a = {E1 = HBSYSLP, E2 = HGSYSLP}
	a.S = bAND(a.E1, a.E2)

	A333_sts_msg.HYD_GB_SYS_INOP.Video.IN = bool2num[a.S]

end

function A333_sts_msg.HYD_G_SYS


import gzip
import pandas as pd
import os
import requests
import yaml

def parse(file_path):
    g = gzip.open(file_path, "rb")
    for l in g:
        yield eval(l)

def getDF(file_path):
    if file_path.endswith(".gz"):
        i = 0
        data = {}
        for d in parse(file_path):
            data[i] = d
            i += 1
        return pd.DataFrame.from_dict(data, orient="index")
    elif file_path.endswith(".csv"):
        if (
            "All_Beauty" in file_path
            or "Gift_Cards" in file_path
            or "MovieLens" in file_path
        ):
            return pd.read_csv(
                file_path,
                sep=",",
                header=0,
                names=["asin", "title"],
            )
        else:
            return pd.read_csv(
                file_path, sep=",", header=None, names=["asin", "cn_title", "title"]
            )

def is_valid_url(url):
    # 简单检查URL格式是否有效
    if (
        pd.isna(url)
        or not isinstance(url, str)
        or not url.startswith(("http://", "https://"))
    ):
        return False
    return True

def download_images(data, target_folder):
    # 确保目标文件夹存在
    os.makedirs(target_folder, exist_ok=True)

    invalid_ids = []  # 存储无效的imUrl对应的itemID

    # 遍历DataFrame中的每一行
    for index, row in data.iterrows():
        iid = row["itemID"]
        image_url = row["imUrl"]

        # 构造图片的保存路径
        file_path = os.path.join(target_folder, f"{iid}.jpg")

        # 检查 imUrl 是否有效
        if not is_valid_url(image_url):
            print(f"Invalid URL for itemID {iid}: {image_url}")
            invalid_ids.append(iid)
            continue  # 跳过此行，继续下一个

        # 检查图片文件是否已经存在
        if os.path.exists(file_path):
            print(f"Image already exists, skipping download: {file_path}")
            continue  # 如果文件已经存在，跳过下载

        try:
            # 下载图片
            response = requests.get(image_url)
            response.raise_for_status()  # 检查请求是否成功

            # 构造图片的保存路径
            file_path = os.path.join(target_folder, f"{iid}.jpg")

            # 将图片写入文件
            with open(file_path, "wb") as file:
                file.write(response.content)

            print(f"Download image successfully: {file_path}")

        except requests.exceptions.RequestException as e:
            print(f"Error when downloading image: {image_url}, Error message: {e}")

    # 输出所有无效的imUrl对应的itemID
    if invalid_ids:
        print("Invalid imUrl found for the following itemIDs:")
        print(invalid_ids)
    else:
        print("All imUrls are valid.")

def read_yaml_to_dict(file_path):
    # 打开并读取 YAML 文件
    with open(file_path, "r") as file:
        # 使用 yaml.safe_load() 将 YAML 内容加载为 Python 字典
        yaml_content = yaml.safe_load(file)
    return yaml_content

def compute_modalities_similarity(encoding1, encoding2):
    import numpy as np

    # 确保输入的两个编码具有相同的形状
    assert (
        encoding1.shape == encoding2.shape
    ), f"Two modality encodings must have the same shape. But got: {encoding1.shape} and {encoding2.shape}"

    # L2 归一化每个模态的特征向量
    encoding1_norm = encoding1 / np.linalg.norm(encoding1, axis=1, keepdims=True)
    encoding2_norm = encoding2 / np.linalg.norm(encoding2, axis=1, keepdims=True)

    # 计算每个 item 的两种模态之间的余弦相似度
    similarity = np.dot(encoding1_norm, encoding2_norm.T)
    item_similarity = np.diag(similarity)  # 对角线上的元素是每个 item 的相似度

    return item_similarity


azione Open Ended

<div align="center">

| Modello | Arena-Hard | AlpacaEval 2.0 |
|-------|------------|----------------|
| DeepSeek-V2.5-0905 | 76.2 | 50.5 |
| Qwen2.5-72B-Instruct | 81.2 | 49.1 |
| LLaMA-3.1 405B | 69.3 | 40.5 |
| GPT-4o-0513 | 80.4 | 51.1 |
| Claude-Sonnet-3.5-1022 | 85.2 | 52.0 |
| DeepSeek-V3 | **85.5** | **70.0** |

</div>

> [!NOTE]
> Valutazioni di conversazione open-ended in inglese. Per AlpacaEval 2.0, utilizziamo il win rate controllato per lunghezza come metrica.

## 5. Sito Chat & Piattaforma API
Puoi chattare con DeepSeek-V3 sul sito ufficiale di DeepSeek: [chat.deepseek.com](https://chat.deepseek.com/sign_in)

Forniamo inoltre API compatibile OpenAI sulla piattaforma DeepSeek: [platform.deepseek.com](https://platform.deepseek.com/)

## 6. Come Eseguire Localmente

DeepSeek-V3 può essere distribuito localmente utilizzando l’hardware e il software open-source della community seguenti:

1. **DeepSeek-Infer Demo**: Forniamo una demo semplice e leggera per l’inferenza FP8 e BF16.
2. **SGLang**: Supporto completo del modello DeepSeek-V3 in modalità di inferenza sia BF16 che FP8, con Multi-Token Prediction [in arrivo](https://github.com/sgl-project/sglang/issues/2591).
3. **LMDeploy**: Permette inferenza efficiente FP8 e BF16 per deployment locale e cloud.
4. **TensorRT-LLM**: Attualmente supporta inferenza BF16 e quantizzazione INT4/8, con supporto FP8 in arrivo.
5. **vLLM**: Supporto al modello DeepSeek-V3 con modalità FP8 e BF16 per parallelismo di tensori e pipeline.
6. **LightLLM**: Supporta deployment efficiente a nodo singolo o multi-nodo per FP8 e BF16.
7. **AMD GPU**: Permette l’esecuzione del modello DeepSeek-V3 su GPU AMD tramite SGLang sia in BF16 che FP8.
8. **Huawei Ascend NPU**: Supporta l’esecuzione di DeepSeek-V3 su dispositivi Huawei Ascend.

Poiché il training FP8 è nativamente adottato nel nostro framework, forniamo solo pesi FP8. Se hai bisogno di pesi BF16 per esperimenti, puoi usare lo script di conversione fornito.

Ecco un esempio per convertire i pesi FP8 in BF16:

```shell
cd inference
python fp8_cast_bf16.py --input-fp8-hf-path /path/to/fp8_weights --output-bf16-hf-path /path/to/bf16_weights
```

> [!NOTE]
> Hugging Face Transformers non è ancora supportato direttamente.

### 6.1 Inferenza con DeepSeek-Infer Demo (solo esempio)

#### Requisiti di Sistema

> [!NOTE]
> Solo Linux con Python 3.10. Mac e Windows non sono supportati.

Dipendenze:
```pip-requirements
torch==2.4.1
triton==3.0.0
transformers==4.46.3
safetensors==0.4.5
```
#### Preparazione Pesi Modello & Codice Demo

Per prima cosa, clona il nostro repository GitHub DeepSeek-V3:

```shell
git clone https://github.com/deepseek-ai/DeepSeek-V3.git
```

Naviga nella cartella `infer


"awaiting-balance";
            statusLabel = "Awaiting Balance";
            break;
          case "ganttGrey":
            status = "completed";
            statusLabel = "Fully Paid"
            break;
          default:
            status = "on-hold";
            statusLabel = "On Hold"
        }

        // Get Date
        const formattedFrom = Calendar.extractDate(from);
        const formattedTo = Calendar.extractDate(to);

        function getStayDayLength(from, to) {
          const oneDay = 24*60*60*1000;
          return Math.round(Math.abs((from - to)/(oneDay)))
        }

        // Create information instance
        const info = [{
          name: "Agent",
          value: label
        }, {
          name: "Check In",
          value: moment(new Date(formattedFrom)).format('DD MM YYYY')
        }, {
          name: "Check Out",
          value: moment(new Date(formattedTo)).format('DD MM YYYY')
        }, {
          name: "Status",
          value: statusLabel
        }]

        // Create new event for first day
        tempEvents.push({
          status: "first-day",
          date: new Date(formattedFrom),
          dayLabel: label,
          dayStay: getStayDayLength(formattedFrom, formattedTo),
          info: JSON.stringify(info)
        });

        tempEvents.push({
          status: "last-day",
          date: new Date(formattedTo),
          dayLabel: label,
          dayStay: getStayDayLength(formattedFrom, formattedTo),
          info: JSON.stringify(info)
        });

        return {
          status: status,
          link: dataObj,
          from: formattedFrom,
          to: formattedTo,
          startDate: new Date(formattedFrom),
          endDate: new Date(formattedTo),
          stay: getStayDayLength(formattedFrom, formattedTo),
          info: [],
          label
        }
      });

      return {
        name: formattedName,
        events: formattedEvents.concat(tempEvents)
      };
    });
    callback(formatted);
  }

  static initClndrHeader() {
    const CLNDR = jQuery("#calendar-header").clndr({
      showAdjacentMonths: false,
      template: jQuery('#calendar-header-template').html()
    });
    calendarInstance.push(CLNDR);
  }

  static initClndr(formattedData, callback) {
    jQuery.each(formattedData, (i, o) => {
      const {name, events} = o;
      const calendarElement = jQuery('#calendar')
      .append(`

            ${name}

`)
      .find(`.clndr-${i}`)

      const CLNDR = calendarElement.clndr({
        showAdjacentMonths: false,
        template: jQuery('#calendar-template').html(),
        events: events,
        multiDayEvents: {
          singleDay: 'date',
          endDate: 'endDate',
          startDate: 'startDate'
        }
      });

      calendarInstance.push(CLNDR);
      if (i === formattedData.length - 1) {
        callback(calendarInstance);
      }
    });
  }

  static loopInstance(instance = [], process, callback?) {
    if (!instance.length) {
      return;
    }
    instance.map((ins, key) => {
      process(ins);
      if (key === instance.length - 1) {
        callback();
      }
    });
  }

  static changeMonth(month, instance = [], callback?) {
    Calendar.loopInstance(instance, (ins) => {


7f4ce0634e86: leaq 6(%rax),%rax
  0x7f4ce0634e8a: leaq 2(%rax),%rax
  0x7f4ce0634e8e: jmp 0x00007f4ce0634e07
  0x7f4ce0634e93: leaq -1(%rax),%rcx
  0x7f4ce0634e97: movq -0x38(%rbp),%rdx
  0x7f4ce0634e9b: movzbl (%rax,%rdx),%edx
  0x7f4ce0634e9f: incl %edx
  0x7f4ce0634ea1: movq -0x38(%rbp),%rsi
  0x7f4ce0634ea5: movb %dl,(%rax,%rsi)
  0x7f4ce0634ea8: leaq -8(%rcx),%rax
  0x7f4ce0634eac: movzbl (%rax),%ecx
  0x7f4ce0634eaf: testl %ecx,%ecx
  0x7f4ce0634eb1: je 0x00007f4ce0634eef
  0x7f4ce0634eb7: leaq 6(%rax),%rax
  0x7f4ce0634ebb: movzbl (%rax),%ecx
  0x7f4ce0634ebe: testl %ecx,%ecx
  0x7f4ce0634ec0: je 0x00007f4ce0634ee6
  0x7f4ce0634ec6: movzbl (%rax),%ecx
  0x7f4ce0634ec9: addl $0xffffffff,%ecx
  0x7f4ce0634ecc: movb %cl,(%rax)
  0x7f4ce0634ece: leaq 2(%rax),%rcx
  0x7f4ce0634ed2: movzbl (%rax,%r15),%edx
  0x7f4ce0634ed7: incl %edx
  0x7f4ce0634ed9: movb %dl,(%rax,%r15)
  0x7f4ce0634edd: leaq -2(%rcx),%rax
  0x7f4ce0634ee1: jmp 0x00007f4ce0634ebb
  0x7f4ce0634ee6: leaq -0xf(%rax),%rax
  0x7f4ce0634eea: jmp 0x00007f4ce0634eac
  0x7f4ce0634eef: leaq 9(%rax),%rax
  0x7f4ce0634ef3: movzbl (%rax),%ecx
  0x7f4ce0634ef6: testl %ecx,%ecx
  0x7f4ce0634ef8: je 0x00007f4ce0634f07
  0x7f4ce0634efe: leaq 9(%rax),%rax
  0x7f4ce0634f02: jmp 0x00007f4ce0634ef3
  0x7f4ce0634f07: leaq -9(%rax),%rax
  0x7f4ce0634f0b: movzbl (%rax),%ecx
  0x7f4ce0634f0e: testl %ecx,%ecx
  0x7f4ce0634f10: je 0x00007f4ce063503e
  0x7f4ce0634f16: leaq 1(%rax),%rdx
  0x7f4ce0634f1a: movb $0,(%rax,%r12)
  0x7f4ce0634f1f: leaq -1(%rdx),%rax
  0x7f4ce0634f23: movq %rsi,%rcx
  0x7f4ce0634f26: movzbl (%rdx,%rcx),%ecx
  0x7f4ce0634f2a: addl $


e } : null;
        this._lastLine.appendChild(
            X.createElement('span', props, data)
        );
        this._lastLine.scrollIntoView();
        return this;
    }
    /** dts2md break */
    /**
     * Similar to `write()`, but begins a new line AFTER writting
     */
    writeln(data?: unknown, style?: X.StyleProperties) {
        const { _lastLine } = this;
        if (
            (data === undefined || data === '')
            && !_lastLine.childNodes.length
        ) {
            this.screen.insertBefore(X.createElement('br'), _lastLine);
        } else {
            if (data !== undefined) {
                this.write(data, style);
            }
            const newLine = X.createElement('p', {
                class: Terminal.LINE_CLASS,
            });
            this.screen.appendChild(newLine);
            this._lastLine = newLine;
        }
        this._lastLine.scrollIntoView();
        return this;
    }
    /** dts2md break */
    /**
     * Withdraw one or some writing operations
     * (only works in the last line)
     */
    withdraw(count = 1) {
        const { _lastLine } = this;
        const { childNodes: spans } = _lastLine;
        for (let i = 0; i < count; i++) {
            if (!spans.length) {
                break;
            }
            _lastLine.removeChild(spans[spans.length - 1]);
        }
        return this;
    }
    /** dts2md break */
    /**
     * Withdraw one or more lines
     */
    withdrawLine(count = 1) {
        const { screen } = this;
        const { childNodes: lines } = screen;
        for (let i = 0; i < count; i++) {
            if (lines.length < 2) {
                break;
            }
            screen.removeChild(lines[lines.length - 2]);
        }
        return this;
    }
    /** dts2md break */
    /**
     * Clear the screen
     */
    clear() {
        this.screen.innerHTML = '';
        const newLine = X.createElement('p', {
            class: Terminal.LINE_CLASS,
        });
        this.screen.appendChild(newLine);
        this._lastLine = newLine;
        return this;
    }
}
export interface etudiant {
    nom:string,
    age:number,
    majorant:boolean,
}

export const ETUDIANTS : etudiant[] = [
    {
        nom:'soufiane',
        age:21,
        majorant:false
    },
    {
        nom:'mehdi',
        age:20,
        majorant:true
    },
    {
        nom:'imad',
        age:24,
        majorant:false
    },
    {
        nom:'iliass',
        age:19,
        majorant:true
    }
]
/// <summary>
/// 二叉树节点
/// </summary>
/// <typeparam name="K"></typeparam>
/// <typeparam name="V"></typeparam>
export class BinaryNode<K, V>
{
    /// <summary>
    /// 节点元素
    /// </summary>
    key: K;

    /// <summary>
    /// 节点中的附加值
    /// </summary>
    public attach = new Set<V>();

    /// <summary>
    /// 左节点
    /// </summary>
    public left: BinaryNode<K, V>;

    /// <summary>
    /// 右节点
    /// </summary>
    public right: BinaryNode<K, V>;

    constructor(key: K, value: V, left: BinaryNode<K, V>, right: BinaryNode<K, V>) {
        //KV键值对
        this.key = key;
        this.attach.add(value);
        this.left = left;
        this.right = right;
    }

}

export class BinaryTree<K, V>{
    node: BinaryNode<K, V> = null;

    LevelOrder(T: BinaryNode<K, V>) {
        let p: BinaryNode<K, V> = T;
        //队列
        let queue = new Array<BinaryNode<K, V>>();
        //根节点入队
        queue.push(p);


:Remove { priority }
}

fn done_handle(split: Vec<&str>) -> Command {
    let priority_result = priority_from_split(&split, 1);
    if priority_result.is_err() {
        return Command::Error {
            msg: priority_result.err().unwrap(),
        };
    }
    let priority = priority_result.unwrap();
    Command::Done { priority }
}

fn redo_handle(split: Vec<&str>) -> Command {
    let priority_result = priority_from_split(&split, 1);
    if priority_result.is_err() {
        return Command::Error {
            msg: priority_result.err().unwrap(),
        };
    }
    let priority = priority_result.unwrap();
    Command::Redo { priority }
}

fn swap_handle(split: Vec<&str>) -> Command {
    let priority_0_result = priority_from_split(&split, 1);
    if priority_0_result.is_err() {
        return Command::Error {
            msg: priority_0_result.err().unwrap(),
        };
    }
    let priority_0 = priority_0_result.unwrap();

    let priority_1_result = priority_from_split(&split, 2);
    if priority_1_result.is_err() {
        return Command::Error {
            msg: priority_1_result.err().unwrap(),
        };
    }
    let priority_1 = priority_1_result.unwrap();

    Command::Swap {
        priority_0,
        priority_1,
    }
}

pub fn stdin_input() -> Command {
    let mut cmd = String::new();
    stdin().read_line(&mut cmd).unwrap();
    parse_input(cmd)
}

pub fn parse_input(cmd: String) -> Command {
    let split: Vec<&str> = cmd.split(" ").map(|s| s.trim()).collect();

    match split.get(0).unwrap().to_lowercase().as_str() {
        "view" | "list" => Command::View,
        "help" => Command::Help,
        "exit" => Command::Exit,
        "clear" | "cls" => Command::Clear,
        "add" => add_handle(split),
        "rm" => rm_handle(split),
        "done" => done_handle(split),
        "redo" => redo_handle(split),
        "swap" | "mv" => swap_handle(split),
        other_cmd => Command::Error {
            msg: format!("unrecognized command '{other_cmd}', try 'help'"),
        },
    }
}
//!
//! The file reader.
//!

pub mod error;

use std::cell::RefCell;
use std::collections::HashMap;
use std::convert::TryFrom;
use std::io::Read;
use std::path::PathBuf;
use std::rc::Rc;
use std::sync::RwLock;

use lazy_static::lazy_static;

use crate::generator::bytecode::Bytecode;
use crate::semantic::analyzer::entry::Analyzer as EntryAnalyzer;
use crate::semantic::analyzer::module::Analyzer as ModuleAnalyzer;
use crate::semantic::scope::Scope;
use crate::syntax::parser::Parser;

use self::error::Error;

pub struct File {
    path: PathBuf,
    code: String,
}

lazy_static! {
    pub static ref INDEX: RwLock<Vec<PathBuf>> = RwLock::new(Vec::new());
}

impl File {
    pub fn try_into_entry(
        self,
        bytecode: Rc<RefCell<Bytecode>>,
        dependencies: HashMap<String, Rc<RefCell<Scope>>>,
    ) -> Result<(), String> {
        let lines = self.code.lines().collect::<Vec<&str>>();

        let next_file_id = INDEX.read().expect(crate::PANIC_MUTEX_SYNC).len();
        INDEX
            .write()
            .expect(crate::PANIC_MUTEX_SYNC


n:justify}.handsontable .htTop{vertical-align:top}.handsontable .htMiddle{vertical-align:middle}.handsontable .htBottom{vertical-align:bottom}.htAutocomplete{padding-right:20px}.htPlaceholder{color:#999}.htAutocompleteArrow{color:#999;cursor:default;font-size:0;line-height:1;position:absolute;top:50%;right:4px;margin-top:-2px;display:inline-block;margin-right:4px;border-top:4px dashed;border-right:4px solid transparent;border-left:4px solid transparent}.handsontable td:hover .htAutocompleteArrow,.handsontable th:hover .htAutocompleteArrow{color:#333}.autocompleteEditor,.autocompleteEditor .htCore,.autocompleteEditor .wtHolder{min-width:180px}.dataTables_length .select2-choice,.venntooltip{min-width:60px}.htCheckboxRendererInput.noValue{opacity:.5;filter:alpha(opacity=50)}.htCheckboxRendererLabel{cursor:pointer;display:inline-block;width:100%;margin-bottom:0}.htCheckboxRendererLabel>.htCheckboxRendererInput{margin-right:10px}.htCommentCell{position:relative}.htCommentCell:after{content:'';position:absolute;top:0;right:0;border-left:6px solid transparent;border-top:6px solid red}.htCommentTextArea{background-color:#fff;border:1px solid #ccc;padding:8px;margin-top:-1px;border-radius:0 0 3px 3px;-webkit-box-shadow:0 2px 4px rgba(0,0,0,.1);box-shadow:0 2px 4px rgba(0,0,0,.1)}.handsontable .handsontable.ht_clone_top .wtHider{padding:0 0 5px}.handsontable.listbox{margin:0;background-color:#fff;border:1px solid #ddd}.handsontable.listbox .ht_master table{border-collapse:separate;border:0}.handsontable.listbox td,.handsontable.listbox th,.handsontable.listbox tr:first-child td,.handsontable.listbox tr:first-child th,.handsontable.listbox tr:last-child th{border-color:transparent}.handsontable.listbox td,.handsontable.listbox th{white-space:nowrap;text-overflow:ellipsis}.handsontable.listbox td.htDimmed{cursor:pointer;color:inherit;font-style:inherit}.handsontable.listbox tr td.current,.handsontable.listbox tr:hover td{background-color:#f5f5f5}.ht_clone_top{z-index:11}.ht_clone_left{z-index:12}.ht_clone_bottom_left_corner,.ht_clone_debug,.ht_clone_top_left_corner{z-index:13}.ht_clone_bottom,.ht_clone_left,.ht_clone_top,.ht_master{overflow:hidden}.ht_master .wtHolder{overflow:auto}.ht_clone_left .wtHolder{overflow-x:hidden;overflow-y:auto}.ht_clone_bottom .wtHolder,.ht_clone_top .wtHolder{overflow-x:hidden;overflow-y:hidden}.handsontable td.htSearchResult{background-color:#FFF3E0}.htBordered{border-width:1px}.htBordered.htTopBorderSolid{border-top-style:solid;border-top-color:#000}.htBordered.htRightBorderSolid{border-right-style:solid;border-right-color:#000}.htBordered.htBottomBorderSolid{border-bottom-style:solid;border-bottom-color:#000}.htBordered.htLeftBorderSolid{border-left-style:solid;border-left-color:#000}.htCollapseButton{width:10px;height:10px;line-height:10px;text-align:center;border-radius:3px;border:1px solid #f5f5f5;cursor:pointer;margin-bottom:3px;position:relative;-webkit-box-shadow:1px 1px


_ACCESS : "您可以在隱私設定中啟用存取權限。", NO_PHOTO_IN_CAMERA_ROLL : "相機膠捲中沒有照片", DELETE_MESSAGE_BODY_MOBILE : "您確定您要刪除這則訊息? 此操作是無法還原的。", PIN_MESSAGE_BODY_MOBILE : "", JOIN_VOICE_CHANNEL : "連接這個語音頻道？", LEAVE_SERVER_BODY_MOBILE : "您確定要退出 {name}?", KICK_USER_TITLE : "踢除 '{user}'", KICK_USER_BODY : "您確定要踢除 {user}? 他們可以透過新的邀請再次加入。", KICK_USER_CONFIRMED : "'{user}' 已經從伺服器中踢除。", KICK_USER_ERROR_GENERIC : "", BAN_USER_BODY : "你確定要封鎖{user} 嗎？除非你解除對他們的封鎖，否則他們不能重新加入。", BAN_USER_ERROR_GENERIC : "", VOICE_DISCONNECT_TITLE : "語音斷線", VOICE_DISCONNECT_BODY : "", JOIN_AFK_CHANNEL_BODY : "看來您進入了閒置頻道。您不能在這個頻道中說話。", TAKE_PHOTO_OR_VIDEO : "", CAMERA_ROLL : "相機膠捲", IMAGE : "圖片", VIDEO : "", REPORT_TITLE : "您確定您要檢舉 {username}？", REPORT : "檢舉", REPORTED : "已檢舉", CLOSE_DM : "關閉私人訊息", EDIT_MESSAGE : "編輯訊息", DELETE_MESSAGE : "刪除訊息", EDITING_MESSAGE : "正在編輯訊息", READ_ONLY_CHANNEL : "此頻道為唯讀狀態。", COMING_SOON_TITLE : "即將推出！", COMING_SOON_NOTIFICATIONS : "目前詳細的通知功能設定只有在桌面版應用程式有效，請先暫時使用 iOS 內建的通知設定。", CREATE_CHANNEL : "建立頻道", OPEN_IN_BROWSER : "在瀏覽器開啟", SAVE_CONTENT : "", OPEN_APP : "我已經有了應用程式。開啟它!", NO_CHANNEL_DESCRIPTION : "您的 **私人訊息** 以及 **伺服器** 可以在這裡找到。", NEW_DM : "新的私人訊息", UNVERIFIED_ACCOUNT_TITLE_MOBILE : "您的電子信箱尚未驗證", UNVERIFIED_ACCOUNT_BUTTON_MOBILE : "重新傳送連結", EXPIRES_IN : "到期日為:", DELETE_CHANNEL_BODY : "您確定您要刪除 **!!{channelName}!!**？ 此操作是無法還原的。", SERVERS : "伺服器", SERVERS_MANAGEMENT_TITLE : "", SERVER_SORT : "", JOIN_SERVER_DESCRIPTION_MOBILE : "輸入即時邀請網址或代碼", APP_OPENING_MOBILE_BODY : "如果您無法開啟應用程式，下載應用程式後複製邀請代碼加入。", APP_D


essenza quando colpisci un nemico vulnerabile.",
					"jaJP": "幸運の一撃: 脆弱状態の敵1体を攻撃すると、最大10.0%の確率で{30/50}の精髄を生成する。",
					"koKR": "행운의 적중: 취약한 적을 적중시키면 최대 10.0% 확률로 정수가 {30/50} 생성됩니다.",
					"plPL": "Szczęśliwy traf: Masz maksymalnie 10.0% szans na wygenerowanie {30/50} pkt. esencji, gdy trafiasz odsłoniętych wrogów.",
					"ptBR": "Golpe de Sorte: Até 10.0% de chance de gerar {30/50} de essência ao atingir um inimigo vulnerável.",
					"ruRU": "Удачный удар: при попадании в уязвимого противника вы с вероятностью до 10.0% накапливаете {30/50} ед. эссенции.",
					"trTR": "Şanslı Vuruş: Savunmasız bir düşmana vurduğunda en fazla 10.0% ihtimalle {30/50} Öz oluştur.",
					"zhCN": "幸运一击: 命中易伤敌人时, 最多有 10.0% 几率生成 {30/50} 点精魂。",
					"zhTW": "幸運觸發:擊中易傷敵人時,最高有 10.0% 機率產生 {30/50} 點魂能。"
				},
				"dungeon": "",
				"region": ""
			},
			"Fastblood Aspect": {
				"id": 68,
				"type": "Legendary",
				"description": "Blood Orbs reduce your Ultimate Cooldown by {1/1.5} seconds.",
				"nameLocalized": {
					"deDE": "[ms]Schnellblütiger[fs]Schnellblütige[ns]Schnellblütiges[p]Schnellblütige[c]Schnellblut-",
					"esES": "de sangre rápida",
					"esMX": "Sangre Veloz",
					"frFR": "d'hémorragie",
					"itIT": "Sanguelesto",
					"jaJP": "ファストブラッドの",
					"koKR": "빠른피",
					"plPL": "[ms]Chyżokrwisty[fs]Chyżokrwista[ns]Chyżokrwiste[p]Chyżokrwiste",
					"ptBR": "de Sangue Ligeiro",
					"ruRU": "[ms]живокровный[fs]живокровная[ns]живокровное[p]живокровные",
					"trTR": "[n2]Hızlı Kan",
					"zhCN": "迅血",
					"zhTW": "迅血"
				},
				"descriptionLocalized": {
					"deDE": "Blutkugeln verringern die Abklingzeit Eurer ultimativen Fertigkeit um {1/1.5} Sek.",
					"esES": "Los orbes de sangre reducen {1/1.5} s el tiempo de reutilización de tu definitiva.",
					"esMX": "Los Orbes de Sangre reducen la recuperación de tu habilidad máxima {1/1.5} segundos.",
					"frFR": "Les orbes de sang réduisent le temps de recharge de votre compétence ultime de {1/1.5} s.",
					"itIT": "I Globi di Sangue riducono il tempo di recupero delle tue abilità Ultra


BRunUtil;
import org.ballerinalang.test.CompileResult;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

/**
 * Test cases for interop of Java instance methods with client resource methods.
 *
 * @since 2201.7.0
 */
public class InstanceMethodResourceClientTest {

    private CompileResult result;

    @BeforeClass
    public void setup() {
        result = BCompileUtil.compile("test-src/javainterop/basic/instance_method_resource_client_test.bal");
    }

    @Test
    public void testInstanceMethodResourceClient() {
        BRunUtil.invoke(result, "testInstanceMethodResourceClient");
    }

    @AfterClass
    public void tearDown() {
        result = null;
    }
}
/*
 * Copyright (c) 2023, WSO2 LLC. (https://www.wso2.com) All Rights Reserved.
 *
 * WSO2 LLC. 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
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package org.ballerinalang.test.query;

import org.ballerinalang.test.BAssertUtil;
import org.ballerinalang.test.BCompileUtil;
import org.ballerinalang.test.BRunUtil;
import org.ballerinalang.test.CompileResult;
import org.testng.Assert;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

/**
 * This contains methods to test nested query expressions.
 *
 * @since 2201.7.0
 */
public class GroupByClauseTest {
    private CompileResult resultWithListCtr;
    private CompileResult resultWithInvocation;
    private CompileResult negativeResult;
    private CompileResult negativeSemanticResult;

    @BeforeClass
    public void setup() {
        resultWithListCtr = BCompileUtil.compile("test-src/query/group_by_clause_with_list_ctr.bal");
        resultWithInvocation = BCompileUtil.compile("test-src/query/group_by_clause_with_invocation.bal");
        negativeResult = BCompileUtil.compile("test-src/query/group_by_clause_negative.bal");
        negativeSemanticResult = BCompileUtil.compile("test-src/query/group_by_clause_negative_semantic.bal");
    }

    @Test(dataProvider = "dataToTestGroupByClauseWithListCtr")
    public void testGroupByClauseWithListCtr(String functionName) {
        BRunUtil.invoke(resultWithListCtr, functionName);
    }

    @DataProvider
    public Object[] dataToTestGroupByClauseWithListCtr() {
        return new Object[] {
                "testGroupByExpressionAndSelectWithGroupingKeys1",
                "testGroupByExpressionAndSelectWithGroupingKeys2",
                "testGroupByExpressionAndSelectWithGroupingKeys3",
                "testGroupByExpressionAndSelectWithGroupingKeys4",
                "testGroupByExpressionAndSelectWithGroupingKeys5",


hout
// modifications, are permitted. We encourage users to contribute to the project and respect the
// guidelines outlined in the LICENSE file. By using this software, you agree to the terms and
// conditions specified in the MIT License, ensuring the continuation of free and open software
// practices.

using EpicChain.Persistence;
using EpicChain.Plugins.ApplicationLogs.Store;
using EpicChain.Plugins.Storage;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xunit;

namespace EpicChain.Plugins.ApplicationsLogs.Tests.Setup
{
    public class TestStorage
    {
        private static readonly string s_dirPath = Path.GetRandomFileName();
        private static readonly RocksDBStore rocksDbStore = new RocksDBStore();
        public static readonly IStore Store = rocksDbStore.GetStore(s_dirPath);
    }
}


alse())
				g.Expect(finalizers).To(gomega.BeEmpty())
			},
		},
	}

	for _, c := range testcases {
		testFn(c)
	}
}

func TestBackupControlUpdateBackupStatus(t *testing.T) {
	g := gomega.NewWithT(t)
	cli := fake.NewSimpleClientset()
	bm := backup.NewFakeBackupManager()
	ctl := NewDefaultVolumeBackupControl(cli, bm)

	volumeBackup := newVolumeBackup()
	status := volumeBackup.Status.DeepCopy()
	v1alpha1.UpdateVolumeBackupCondition(status, &v1alpha1.VolumeBackupCondition{
		Type:   v1alpha1.VolumeBackupComplete,
		Status: corev1.ConditionTrue,
	})

	err := ctl.UpdateStatus(volumeBackup, status)
	g.Expect(err).To(gomega.BeNil())
	g.Expect(bm.IsStatusUpdated()).To(gomega.BeTrue())
}
// Copyright 2023 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// See the License for the specific language governing permissions and
// limitations under the License.

package fedvolumebackup

import (
	"context"
	"fmt"
	"math"
	"time"

	apiequality "k8s.io/apimachinery/pkg/api/equality"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
	"k8s.io/client-go/tools/cache"
	"k8s.io/klog/v2"

	"github.com/pingcap/tidb-operator/pkg/apis/federation/pingcap/v1alpha1"
	"github.com/pingcap/tidb-operator/pkg/apis/label"
	"github.com/pingcap/tidb-operator/pkg/client/federation/clientset/versioned"
	informers "github.com/pingcap/tidb-operator/pkg/client/federation/informers/externalversions/pingcap/v1alpha1"
	"github.com/pingcap/tidb-operator/pkg/controller"
	"github.com/pingcap/tidb-operator/pkg/fedvolumebackup"
	"github.com/pingcap/tidb-operator/pkg/metrics"
	"github.com/pingcap/tidb-operator/pkg/third_party/k8s"
)

// ControlInterface implements the control logic for updating VolumeBackup
// It is implemented as an interface to allow for extensions that provide different semantics.
// Currently, there is only one implementation.
type ControlInterface interface {
	// UpdateBackup implements the control logic for VolumeBackup's creation, deletion
	UpdateBackup(volumeBackup *v1alpha1.VolumeBackup) error
	// UpdateStatus updates the status for a VolumeBackup, include condition and status info
	// NOTE(federation): add a separate struct for newStatus as non-federation backup control did if needed
	UpdateStatus(volumeBackup *v1alpha1.VolumeBackup, newStatus *v1alpha1.VolumeBackupStatus) error
}

// NewDefaultVolumeBackupControl returns a new instance of the default VolumeBackup ControlInterface implementation.
func NewDefaultVolumeBackupControl(
	cli versioned.Interface,
	backupManager fedvolumebackup.BackupManager) ControlInterface {
	return &defaultBackupControl{
		cli,
		backupManager,
	}
}

type defaultBackupControl struct {
	cli           versioned.Interface


chema:accessMode"}, "visual"},
		{"meta", tagAttrs{"property": "schema:accessModeSufficient"}, "visual"},
		{"meta", tagAttrs{"property": "schema:accessibilityHazard"}, "noFlashingHazard"},
		{"meta", tagAttrs{"property": "schema:accessibilityHazard"}, "noMotionSimulationHazard"},
		{"meta", tagAttrs{"property": "schema:accessibilityHazard"}, "noSoundHazard"},
		{"meta", tagAttrs{"name": "book-type", "content": "comic"}, ""},
		{"opf:meta", tagAttrs{"name": "fixed-layout", "content": "true"}, ""},
		{"opf:meta", tagAttrs{"name": "original-resolution", "content": o.ImageOptions.View.Dimension()}, ""},
		{"dc:title", tagAttrs{}, o.Title},
		{"dc:identifier", tagAttrs{"id": "ean"}, "urn:uuid:" + o.UID},
		{"dc:language", tagAttrs{}, "en"},
		{"dc:creator", tagAttrs{}, o.Author},
		{"dc:publisher", tagAttrs{}, o.Publisher},
		{"dc:contributor", tagAttrs{}, "Go Comic Convertor"},
		{"dc:date", tagAttrs{}, o.UpdatedAt},
	}

	if o.ImageOptions.View.PortraitOnly {
		metas = append(metas, []tag{
			{"meta", tagAttrs{"property": "rendition:layout"}, "pre-paginated"},
			{"meta", tagAttrs{"property": "rendition:spread"}, "none"},
			{"meta", tagAttrs{"property": "rendition:orientation"}, "portrait"},
		}...)
	} else {
		metas = append(metas, []tag{
			{"meta", tagAttrs{"property": "rendition:layout"}, "pre-paginated"},
			{"meta", tagAttrs{"property": "rendition:spread"}, "auto"},
			{"meta", tagAttrs{"property": "rendition:orientation"}, "auto"},
		}...)
	}

	if o.ImageOptions.Manga {
		metas = append(metas, tag{"meta", tagAttrs{"name": "primary-writing-mode", "content": "horizontal-rl"}, ""})
	} else {
		metas = append(metas, tag{"meta", tagAttrs{"name": "primary-writing-mode", "content": "horizontal-lr"}, ""})
	}

	metas = append(metas, tag{"meta", tagAttrs{"name": "cover", "content": "img_cover"}, ""})

	if o.Total > 1 {
		metas = append(
			metas,
			tag{"meta", tagAttrs{"name": "calibre:series", "content": o.Title}, ""},
			tag{"meta", tagAttrs{"name": "calibre:series_index", "content": utils.IntToString(o.Current)}, ""},
		)
	}

	return metas
}

func (o Content) getManifest() []tag {
	var imageTags, pageTags, spaceTags []tag
	addTag := func(img epubimage.EPUBImage, withSpace bool) {
		imageTags = append(imageTags,
			tag{"item", tagAttrs{"id": img.ImgKey(), "href": img.ImgPath(), "media-type": img.MediaType()}, ""},
		)
		pageTags = append(pageTags,
			tag{"item", tagAttrs{"id": img.PageKey(), "href": img.PagePath(), "media-type": "application/xhtml+xml"}, ""},
		)
		if withSpace {
			spaceTags = append(spaceTags,
				tag{"item", tagAttrs{"id": img.SpaceKey(), "href": img.SpacePath(), "media-type": "application/xhtml+xml"}, ""},
			)
		}
	}

	items := []tag{
		{"item", tagAttrs{"id": "toc", "href": "toc.xhtml", "properties": "nav


unds()
            {
                Alignment = EnumDialogArea.None,
                verticalSizing = ElementSizing.Fixed,
                horizontalSizing = ElementSizing.Percentual,
                percentWidth = 1,
                fixedHeight = (float)GuiStyle.TitleBarHeight
            };
        }
    }
}


 $) {
			if ( ! root ) {
				root = window;
			}

			if ( ! $ || ! $.fn.dataTable ) {
				$ = require('datatables.net')(root, $).$;
			}

			return factory( $, root, root.document );
		};
	}
	else {
		// Browser
		factory( jQuery, window, document );
	}
}(function( $, window, document, undefined ) {
'use strict';
var DataTable = $.fn.dataTable;
var _firefoxScroll;

/**
 * When making use of DataTables' x-axis scrolling feature, you may wish to
 * fix the left most column in place. This plug-in for DataTables provides
 * exactly this option (note for non-scrolling tables, please use the
 * FixedHeader plug-in, which can fix headers and footers). Key
 * features include:
 *
 * * Freezes the left or right most columns to the side of the table
 * * Option to freeze two or more columns
 * * Full integration with DataTables' scrolling options
 * * Speed - FixedColumns is fast in its operation
 *
 *  @class
 *  @constructor
 *  @global
 *  @param {object} dt DataTables instance. With DataTables 1.10 this can also
 *    be a jQuery collection, a jQuery selector, DataTables API instance or
 *    settings object.
 *  @param {object} [init={}] Configuration object for FixedColumns. Options are
 *    defined by {@link FixedColumns.defaults}
 *
 *  @requires jQuery 1.7+
 *  @requires DataTables 1.8.0+
 *
 *  @example
 *      var table = $('#example').dataTable( {
 *        "scrollX": "100%"
 *      } );
 *      new $.fn.dataTable.fixedColumns( table );
 */
var FixedColumns = function ( dt, init ) {
	var that = this;

	/* Sanity check - you just know it will happen */
	if ( ! ( this instanceof FixedColumns ) ) {
		alert( "FixedColumns warning: FixedColumns must be initialised with the 'new' keyword." );
		return;
	}

	if ( init === undefined || init === true ) {
		init = {};
	}

	// Use the DataTables Hungarian notation mapping method, if it exists to
	// provide forwards compatibility for camel case variables
	var camelToHungarian = $.fn.dataTable.camelToHungarian;
	if ( camelToHungarian ) {
		camelToHungarian( FixedColumns.defaults, FixedColumns.defaults, true );
		camelToHungarian( FixedColumns.defaults, init );
	}

	// v1.10 allows the settings object to be got form a number of sources
	var dtSettings = new $.fn.dataTable.Api( dt ).settings()[0];

	/**
	 * Settings object which contains customisable information for FixedColumns instance
	 * @namespace
	 * @extends FixedColumns.defaults
	 * @private
	 */
	this.s = {
		/**
		 * DataTables settings objects
		 *  @type     object
		 *  @default  Obtained from DataTables instance
		 */
		"dt": dtSettings,

		/**
		 * Number of columns in the DataTable - stored for quick access
		 *  @type     int
		 *  @default  Obtained from DataTables instance
		 */
		"iTableColumns": dtSettings.aoColumns.length,

		/**
		 * Original outer widths of the columns as rendered by DataTables - used to calculate
		 * the FixedColumns grid bounding box
		 *  @type     array.<int>
		 *  @default  []
		 */
		"aiOuterWidths": [],

		/**
		 * Original inner widths of the columns as rendered by DataTables - used to apply widths
		 * to the columns
		 *  @type     array.<int>
		 *  @default  []
		 */
		"aiInnerWidths": [],

		/**
		 * Is the document layout right-to-left
		 * @type boolean
		 */
		rtl: $(dtSettings.nTable).css('direction') === 'rtl'
	};

	/**
	 * DOM elements used by t


ch(n, MIDC-MIDR+n, '\\');
		refresh();
	}
	mvaddch(MIDR,MIDC,'*');
	for(n = LINES-1-2; n >= MIDR + 1; n--){
		mvaddch(n, MIDC+MIDR-n, ' ');
		mvaddch(n, MIDC-MIDR+n, ' ');
		refresh();
	}
	alarm(1);
}

void
moveenemy()
{
	double d;
	int oldr, oldc;

	oldr = row;
	oldc = column;
	if (fuel > 0){
		if (row + dr <= LINES-3 && row + dr > 0)
			row += dr;
		if (column + dc < COLS-1 && column + dc > 0)
			column += dc;
	} else if (fuel < 0){
		fuel = 0;
		mvaddstr(0,60,"*** Out of fuel ***");
	}
	d = (double) ((row - MIDR)*(row - MIDR) + (column - MIDC)*(column - MIDC));
	if (d < 16){
		row += (rnd(9) - 4) % (4 - abs(row - MIDR));
		column += (rnd(9) - 4) % (4 - abs(column - MIDC));
	}
	clock--;
	mvaddstr(oldr, oldc - 1, "   ");
	if (cross)
		target();
	mvaddstr(row, column - 1, "/-\\");
	move(LINES-1, 24);
	printw("%3d", torps);
	move(LINES-1, 42);
	printw("%3d", fuel);
	move(LINES-1, 57);
	printw("%3d", clock);
	refresh();
	signal(SIGALRM, moveenemy);
	alarm(1);
}

endfly()
{
	alarm(0);
	signal(SIGALRM, SIG_DFL);
	mvcur(0,COLS-1,LINES-1,0);
	endwin();
	signal(SIGTSTP, SIG_DFL);
	signal(SIGINT, oldsig);
}


/* Copyright (c) 2005-2021 Jay Berkenbilt
 * Copyright (c) 2022-2025 Jay Berkenbilt and Manfred Holger
 *
 * This file is part of qpdf.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 * in compliance with the License. You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under the License
 * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 * or implied. See the License for the specific language governing permissions and limitations under
 * the License.
 *
 * Versions of qpdf prior to version 7 were released under the terms of version 2.0 of the Artistic
 * License. At your option, you may continue to consider qpdf to be licensed under those terms.
 * Please see the manual for additional information.
 */

#ifndef QPDFLOGGER_H
#define QPDFLOGGER_H

/*
 * This file provides a C API for QPDFLogger. See QPDFLogger.hh for information about the logger and
 * examples/qpdfjob-c-save-attachment.c for an example.
 */

#include <qpdf/DLL.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

    /* To operate on a logger, you need a handle to it. call qpdflogger_default_logger to get a
     * handle for the default logger. There are functions in qpdf-c.h and qpdfjob-c.h that also take
     * or return logger handles. When you're done with the logger handler, call qpdflogger_cleanup.
     * This cleans up the handle but leaves the underlying log object intact. (It uses a shared
     * pointer and will be cleaned up automatically when it is no longer in use.) That means you can
     * create a logger with qpdflogger_create(), pass the logger handle to a function in qpdf-c.h or
     * qpdfjob-c.h, and then clean it up, subject to constraints imposed by the other function.
     */

    typedef struct _qpdflogger_handle* qpdflogger_handle;
    QPDF_DLL
    qpdflogger_handle qpdflogger_default_logger();

    /* Calling cleanup on the handle returned by qpdflogger_create destroys the handle but not the
     * underlying logger. See comments above.
     */
    QPDF_DLL
    qpdflogger_handle qpdflogger_create();

    QPDF_DLL
    void qpdflogger_cleanup(qpdflogger_handle* l);

    enum qpdf_log_dest_e {
        qpdf_log_dest_default = 0,
        qpdf_log_dest_stdout = 1,
        qpdf_log_dest_stderr = 2,
        qpdf_log_dest_discard = 3,
        qpdf_log_dest_custom = 4,
    };

    /* Function should return 0 on success. */
    typedef int (*qpdf_log_fn_t)(char const* data, size_t len, void* udata);

    QPDF_DLL
    void qpdflogger_set_info(
        qpdflogger_handle l, enum qpdf_log_dest_e dest, qpdf_log_fn_t fn, void* udata);
    QPDF_DLL
    void qpdflogger_set_warn(
        qpdflogger_handle l, enum qpdf_log_dest_e dest, qpdf_log_fn_t fn, void* udata);
    QPDF_DLL
    void qpdflogger_set_error(
        qpdflogger_handle l, enum qpdf_log_dest_e dest, qpdf_log_fn_t fn, void* udata);

    /* A non-zero value for only_if_not_set means that the save pipeline will only be changed if it
     * is not already set.
     */
    QPDF_DLL
    void qpdflogger_set_save(
        qpdflogger_handle l,
        enum qpdf_log_dest_e dest,
        qpdf_log_fn_t fn,
        void* udata,
        int only_if_not_set);
    QPDF_DLL
    void qpdflogger_save_to_standard_output(qpdflogger_handle l, int only_if_not_set);

    /* For testing */
    QPDF_DLL
    int qpdflogger_equal(qpdflogger_handle l1, qpdflogger_handle l2);

#ifdef __cplusplus
}
#endif

#endif // QPDFLOGGER_H


 "number".
    g. Return ? OrdinaryToPrimitive(input, hint).
   ...

  OrdinaryToPrimitive( O, hint )
   ...
    3. If hint is "string", then
      a. Let methodNames be « "toString", "valueOf" ».
   ...
    5. For each name in methodNames in List order, do
      a. Let method be ? Get(O, name).
      b. If IsCallable(method) is true, then
        i. Let result be ? Call(method, O).
        ii. If Type(result) is not Object, return result.
    6. Throw a TypeError exception.
features: [string-trimming, String.prototype.trimEnd, Symbol.toPrimitive]
---*/

assert.sameValue(typeof String.prototype.trimEnd, "function");

var thisVal = {
  [Symbol.toPrimitive]: undefined,
  toString: undefined,
  valueOf: undefined,
};

// If trimEnd is called on an object with neither Symbol.toPrimitive, toString
// nor valueOf defined, then a TypeError exception should be thrown.
assert.throws(
  TypeError,
  function() {
    String.prototype.trimEnd.call(thisVal);
  }
);

reportCompare(0, 0);
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-string.prototype.trimEnd
description: >
    Abrupt completion when Symbol.toPrimitive abrupt completes.
info: |
  Runtime Semantics: TrimString ( string, where )
  1. Let str be ? RequireObjectCoercible(string).
  2. Let S be ? ToString(str).
   ...

  ToString ( argument )
  If argument is Object:
    1. Let primValue be ? ToPrimitive(argument, hint String).
   ...

  ToPrimitive ( input [, PreferredType ])
   ...
    d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive).
    e. If exoticToPrim is not undefined, then
      i. Let result be ? Call(exoticToPrim, input, « hint »).
   ...
features: [string-trimming, String.prototype.trimEnd, Symbol.toPrimitive]
---*/

var thisVal = {
  [Symbol.toPrimitive]: function() {
    throw new Test262Error();
  },
};

assert.throws(Test262Error, function() {
  String.prototype.trimEnd.call(thisVal);
});

reportCompare(0, 0);
// Copyright (C) 2017 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-string.prototype.trimEnd
description: >
  Priority of toString when converting object to string for trimming
info: |
  Runtime Semantics: TrimString ( string, where )
  1. Let str be ? RequireObjectCoercible(string).
  2. Let S be ? ToString(str).
   ...

  ToString ( argument )
  If argument is Object:
    1. Let primValue be ? ToPrimitive(argument, hint String).
   ...

  ToPrimitive ( input [, PreferredType ])
   ...
    b. Else if PreferredType is hint String, let hint be "string".
   ...
    d. Let exoticToPrim be ? GetMethod(input, @@toPrimitive)
    e. If exoticToPrim is not undefined, then
      i. Let result be ? Call(exoticToPrim, input, « hint »).
      ii. If Type(result) is not Object, return result.
      iii. Throw a TypeError exception.
    f. If hint is "default", set hint to "number".
    g. Return ? OrdinaryToPrimitive(input, hint).
   ...

  OrdinaryToPrimitive( O, hint )
   ...
    3. If hint is "string", then
      a. Let methodNames be « "toString", "valueOf" ».
   ...
    5. For each name in metho


//--------------------------------------------------------------------------------------
// File: WICTextureLoader.h
//
// Function for loading a WIC image and creating a Direct3D 11 runtime texture for it
// (auto-generating mipmaps if possible)
//
// Note: Assumes application has already called CoInitializeEx
//
// Warning: CreateWICTexture* functions are not thread-safe if given a d3dContext instance for
//          auto-gen mipmap support.
//
// Note these functions are useful for images created as simple 2D textures. For
// more complex resources, DDSTextureLoader is an excellent light-weight runtime loader.
// For a full-featured DDS file reader, writer, and texture processing pipeline see
// the 'Texconv' sample and the 'DirectXTex' library.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
// https://go.microsoft.com/fwlink/?LinkId=248926
// https://go.microsoft.com/fwlink/?LinkId=248929
//--------------------------------------------------------------------------------------

#pragma once

#include <d3d11.h>

#pragma warning(push)
#pragma warning(disable : 4005)
#include <stdint.h>
#pragma warning(pop)

HRESULT CreateWICTextureFromMemory(_In_ ID3D11Device* d3dDevice,
    _In_opt_ ID3D11DeviceContext* d3dContext,
    _In_bytecount_(wicDataSize) const uint8_t* wicData,
    _In_ size_t wicDataSize,
    _Out_opt_ ID3D11Resource** texture,
    _Out_opt_ ID3D11ShaderResourceView** textureView,
    _In_ size_t maxsize = 0
);

HRESULT CreateWICTextureFromFile(_In_ ID3D11Device* d3dDevice,
    _In_opt_ ID3D11DeviceContext* d3dContext,
    _In_z_ const wchar_t* szFileName,
    _Out_opt_ ID3D11Resource** texture,
    _Out_opt_ ID3D11ShaderResourceView** textureView,
    _In_ size_t maxsize = 0
);