60.4-41.6-77.8-3.2-4.3-9.6-4.3-12.8 0C436.5 20.6 408 61 408 81c0 26 21.5 47 48 47zm0 32c-44.1 0-80-35.4-80-79 0-4.4.3-14.2 8.1-32.2C345 23.1 298.3 8 248 8 111 8 0 119 0 256s111 248 248 248 248-111 248-248c0-35.1-7.4-68.4-20.5-98.6-6.3 1.5-12.7 2.6-19.5 2.6zm-128-8c23.8 0 52.7 29.3 56 71.4.7 8.6-10.8 12-14.9 4.5l-9.5-17c-7.7-13.7-19.2-21.6-31.5-21.6s-23.8 7.9-31.5 21.6l-9.5 17c-4.1 7.4-15.6 4-14.9-4.5 3.1-42.1 32-71.4 55.8-71.4zm-160 0c23.8 0 52.7 29.3 56 71.4.7 8.6-10.8 12-14.9 4.5l-9.5-17c-7.7-13.7-19.2-21.6-31.5-21.6s-23.8 7.9-31.5 21.6l-9.5 17c-4.2 7.4-15.6 4-14.9-4.5 3.1-42.1 32-71.4 55.8-71.4zm80 280c-60.6 0-134.5-38.3-143.8-93.3-2-11.8 9.3-21.6 20.7-17.9C155.1 330.5 200 336 248 336s92.9-5.5 123.1-15.2c11.5-3.7 22.6 6.2 20.7 17.9-9.3 55-83.2 93.3-143.8 93.3z"; // Grinning Face With Sweat

        public const string Grinning_Face_With_Sweat_Regular =
            "M440 160c29.5 0 53.3-26.3 53.3-58.7 0-25-31.7-75.5-46.2-97.3-3.6-5.3-10.7-5.3-14.2 0-14.5 21.8-46.2 72.3-46.2 97.3 0 32.4 23.8 58.7 53.3 58.7zM248 400c51.9 0 115.3-32.9 123.3-80 1.7-9.9-7.7-18.5-17.7-15.3-25.9 8.3-64.4 13.1-105.6 13.1s-79.6-4.8-105.6-13.1c-9.8-3.1-19.4 5.3-17.7 15.3 8 47.1 71.4 80 123.3 80zm130.3-168.3c3.6-1.1 6-4.5 5.7-8.3-3.3-42.1-32.2-71.4-56-71.4s-52.7 29.3-56 71.4c-.3 3.7 2.1 7.2 5.7 8.3 3.5 1.1 7.4-.5 9.3-3.7l9.5-17c7.7-13.7 19.2-21.6 31.5-21.6s23.8 7.9 31.5 21.6l9.5 17c2.1 3.6 6.2 4.6 9.3 3.7zm105.3-52.9c-24.6 15.7-46 12.9-46.4 12.9 6.9 20.2 10.8 41.8 10.8 64.3 0 110.3-89.7 200-200 200S48 366.3 48 256 137.7 56 248 56c39.8 0 76.8


     b_data = unpack_asn1_bit_string(value)
            return struct.unpack(">I", b_data)[0]

        def unpack_etype(value: typing.Union[ASN1Value, bytes]) -> typing.List[KerberosEncryptionType]:
            return [KerberosEncryptionType(unpack_asn1_integer(e)) for e in unpack_asn1_sequence(value)]

        def unpack_addresses(value: typing.Union[ASN1Value, bytes]) -> typing.List[HostAddress]:
            return [unpack_hostname(h) for h in unpack_asn1_sequence(value)]

        def unpack_ticket(value: typing.Union[ASN1Value, bytes]) -> typing.List[Ticket]:
            return [Ticket.unpack(t) for t in unpack_asn1_sequence(value)]

        kdc_options = get_sequence_value(sequence, 0, "KDC-REQ-BODY", "kdc-options", unpack_kdc_options)
        cname = get_sequence_value(sequence, 1, "KDC-REQ-BODY", "cname", unpack_principal_name)
        realm = get_sequence_value(sequence, 2, "KDC-REQ-BODY", "realm", unpack_asn1_general_string)
        sname = get_sequence_value(sequence, 3, "KDC-REQ-BODY", "sname", unpack_principal_name)
        postdated_from = get_sequence_value(sequence, 4, "KDC-REQ-BODY", "from", unpack_asn1_generalized_time)
        postdated_till = get_sequence_value(sequence, 5, "KDC-REQ-BODY", "till", unpack_asn1_generalized_time)
        rtime = get_sequence_value(sequence, 6, "KDC-REQ-BODY", "rtime", unpack_asn1_generalized_time)
        nonce = get_sequence_value(sequence, 7, "KDC-REQ-BODY", "nonce", unpack_asn1_integer)
        etype = get_sequence_value(sequence, 8, "KDC-REQ-BODY", "etype", unpack_etype)
        addresses = get_sequence_value(sequence, 9, "KDC-REQ-BODY", "addresses", unpack_addresses)
        enc_auth_data = get_sequence_value(sequence, 10, "KDC-REQ-BODY", "enc-authorization-data", EncryptedData.unpack)
        additional_tickets = get_sequence_value(sequence, 11, "KDC-REQ-BODY", "additional-tickets", unpack_ticket)

        return KdcReqBody(
            kdc_options,
            cname,
            realm,
            sname,
            postdated_from,
            postdated_till,
            rtime,
            nonce,
            etype,
            addresses,
            enc_auth_data,
            additional_tickets,
        )


// Copyright (c) Duende Software. All rights reserved.
// Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information.

namespace Duende.AccessTokenManagement;

/// <summary>
/// Client access token options
/// </summary>
public sealed class ClientCredentialsTokenManagementOptions
{
    /// <summary>
    /// Used to prefix the cache key
    /// </summary>
    public string CacheKeyPrefix { get; set; } = "Duende.AccessTokenManagement.Cache::";

    /// <summary>
    /// Prefix used for the nonce store key
    /// </summary>
    public string NonceStoreKeyPrefix { get; set; } = "Duende.AccessTokenManagement.DPoPNonceStore::";

    /// <summary>
    /// Value to subtract from token lifetime for the cache entry lifetime (defaults to 60 seconds)
    /// </summary>
    public int CacheLifetimeBuffer { get; set; } = 60;

    /// <summary>
    /// How long should client credentials be cached.
    ///
    /// If <see cref="UseCacheAutoTuning"/> is set to false, this value will be used as the default cache lifetime


    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT9_WEBGL: u32 = 36073u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT10_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT10_WEBGL: u32 = 36074u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT11_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT11_WEBGL: u32 = 36075u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT12_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT12_WEBGL: u32 = 36076u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT13_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT13_WEBGL: u32 = 36077u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT14_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT14_WEBGL: u32 = 36078u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.COLOR_ATTACHMENT15_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const COLOR_ATTACHMENT15_WEBGL: u32 = 36079u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.DRAW_BUFFER0_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const DRAW_BUFFER0_WEBGL: u32 = 34853u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.DRAW_BUFFER1_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const DRAW_BUFFER1_WEBGL: u32 = 34854u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.DRAW_BUFFER2_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const DRAW_BUFFER2_WEBGL: u32 = 34855u64 as u32;
    #[doc = "The `WEBGL_draw_buffers.DRAW_BUFFER3_WEBGL` const."]
    #[doc = ""]
    #[doc = "*This API requires the following crate features to be activated: `WebglDrawBuffers`*"]
    pub const DRAW_BUFFER3_WEBGL: u32 = 34856u64 as u32;
    #[doc = "The `WEBGL_d


ion_resource_type == "no_consumption" then
		return ret
	end

	if not self.consumption_amount or not self.SumOfAllProducers then
		return ret
	end

	local str = ret[1]

	-- try to stick it under daily prod
	local idx1 = 3
	local idx2 = 5
	if str.j ~= 5 then
		-- or at the end if it isn't 5 (modded?)
		idx1 = str.j-1
		idx2 = str.j
	end
	str.j = str.j + 2

	AddStrings(self, str, idx1, idx2)
	return ret
end

local ChoOrig_GetUISectionConsumptionRollover = Building.GetUISectionConsumptionRollover
function Building:GetUISectionConsumptionRollover(...)
	local ret = ChoOrig_GetUISectionConsumptionRollover(self, ...)

	if not self.consumption_amount or not self.SumOfAllProducers then
		return ret
	end

	local res_prod = self:IsKindOf("ResourceProducer")
	if not res_prod or res_prod and not self:DoesHaveConsumption() then
		return ret
	end

	-- just stick it at the end
	local str = ret[1]
	str.j = str.j + 3
	local c = #str.table + 1

	-- add a header for this one
	str.table[c] = T("") .. T(692, "Resources") .. T("")

	AddStrings(self, str, c+1, c+2)
	return ret
end


 doesn't mean to use
-- 			the tags file relative to the current file, but the
-- 			tags file in the current directory.
--
-- 		D	Can't use CTRL-K to enter a digraph after Normal mode
-- 			commands with a character argument, like |r|, |f| and
-- 			|t|.
--
-- 		e	When executing a register with ":@r", always add a
-- 			<CR> to the last line, also when the register is not
-- 			linewise.  If this flag is not present, the register
-- 			is not linewise and the last line does not end in a
-- 			<CR>, then the last line is put on the command-line
-- 			and can be edited before hitting <CR>.
--
-- 		E	It is an error when using "y", "d", "c", "g~", "gu" or
-- 			"gU" on an Empty region.  The operators only work when
-- 			at least one character is to be operated on.  Example:
-- 			This makes "y0" fail in the first column.
--
-- 		f	When included, a ":read" command with a file name
-- 			argument will set the file name for the current buffer,
-- 			if the current buffer doesn't have a file name yet.
--
-- 		F	When included, a ":write" command with a file name
-- 			argument will set the file name for the current
-- 			buffer, if the current buffer doesn't have a file name
-- 			yet.  Also see |cpo-P|.
--
-- 		i	When included, interrupting the reading of a file will
-- 			leave it modified.
--
-- 		I	When moving the cursor up or down just after inserting
-- 			indent for `'autoindent'` , do not delete the indent.
--
-- 		J	A |sentence| has to be followed by two spaces after
-- 			the `'.'` , `'!'`  or `'?'` .  A <Tab> is not recognized as
-- 			white space.
--
-- 		K	Don't wait for a key code to complete when it is
-- 			halfway through a mapping.  This breaks mapping
-- 			<F1><F1> when only part of the second <F1> has been
-- 			read.  It enables cancelling the mapping by typing
-- 			<F1><Esc>.
--
-- 		l	Backslash in a [] range in a search pattern is taken
-- 			literally, only "\]", "\^", "\-" and "\\" are special.
-- 			See |/[]|
-- 			   `'l'`  included: "/[ \t]"  finds <Space>, `'\'`  and `'t'`
-- 			   `'l'`  excluded: "/[ \t]"  finds <Space> and <Tab>
--
-- 		L	When the `'list'`  option is set, `'wrapmargin'` ,
-- 			`'textwidth'` , `'softtabstop'`  and Virtual Replace mode
-- 			(see |gR|) count a <Tab> as two characters, instead of
-- 			the normal behavior of a <Tab>.
--
-- 		m	When included, a showmatch will always wait half a
-- 			second.  When not included, a showmatch will wait half
-- 			a second or until a character is typed.  |`'showmatch'` |
--
-- 		M	When excluded, "%" matching will take backslashes into
-- 			account.  Thus in "( \( )" and "\( ( \)" the outer
-- 			parenthesis match.  When included "%" ignores
-- 			backslashes, which is Vi compatible.
--
-- 		n	When included, the column used for `'number'`  and
-- 			`'relativenumber'`  will also be used for text of wrapped
-- 			lines.
--
-- 		o	Line offset to search command is not remembered for
-- 			next search.


	"invalid secret": base64.StdEncoding.EncodeToString([]byte("foo bar baz")),
						"invalid base64": "foo bar baz",
					},
				},
			}

			_, err = validator.ValidateCreate(ctx, obj)
			var serr *apierrors.StatusError
			Expect(errors.As(err, &serr)).To(BeTrue())

			causes := serr.Status().Details.Causes
			Expect(causes).To(ContainElements(
				metav1.StatusCause{
					Type: metav1.CauseTypeFieldValueInvalid,
					// revive:disable-next-line
					Message: "Invalid value: \"invalid base64\": cannot be decrypted: illegal base64 data at input byte 8",
					Field:   "spec.sshSecrets",
				},
				metav1.StatusCause{
					Type: metav1.CauseTypeFieldValueInvalid,
					// revive:disable-next-line
					Message: "Invalid value: \"invalid secret\": cannot be decrypted: unable to decrypt data with any of the private keys",
					Field:   "spec.sshSecrets",
				},
			))
			Expect(causes).To(HaveLen(2))
		})

		It("Should deny creation when a capability custom field is not configured", func() {
			// Update PaasConfig
			latestConf := &v1alpha2.PaasConfig{}
			err := k8sClient.Get(ctx, types.NamespacedName{Name: conf.Name}, latestConf)
			Expect(err).To(Not(HaveOccurred()))
			latestConf.Spec.Capabilities["foo"] = v1alpha2.ConfigCapability{
				CustomFields: map[string]v1alpha2.ConfigCustomField{
					"bar": {},
				},
				QuotaSettings: v1alpha2.ConfigQuotaSettings{
					DefQuota: map[corev1.ResourceName]resource.Quantity{"bar": resource.MustParse("1")},
				},
			}
			err = k8sClient.Update(ctx, latestConf)
			Expect(err).To(Not(HaveOccurred()))

			obj = &v1alpha1.Paas{
				Spec: v1alpha1.PaasSpec{
					Capabilities: v1alpha1.PaasCapabilities{
						"foo": v1alpha1.PaasCapability{
							Enabled: true,
							CustomFields: map[string]string{
								"bar": "baz",
								"baz": "qux",
							},
						},
					},
				},
			}
			_, err = validator.ValidateCreate(ctx, obj)

			var serr *apierrors.StatusError
			Expect(errors.As(err, &serr)).To(BeTrue())
			causes := serr.Status().Details.Causes
			Expect(causes).To(HaveLen(1))
			Expect(causes).To(ContainElements(
				metav1.StatusCause{
					Type: metav1.CauseTypeFieldValueInvalid,
					//revive:disable-next-line
					Message: "Invalid value: \"custom_fields\": custom field baz is not configured in capability config",
					Field:   "spec.capabilities[foo]",
				},
			))
		})

		It("Should deny creation when a capability is missing a required custom field", func() {
			// Update PaasConfig
			latestConf := &v1alpha2.PaasConfig{}
			err := k8sClient.Get(ctx, types.NamespacedName{Name: conf.Name}, latestConf)
			Expect(err).To(Not(HaveOccurred()))
			latestConf.Spec.Capabilities["foo"] = v1alpha2.ConfigCapability{
				CustomFields: map[string]v1alpha2.ConfigCustomField{
					"bar": {Required: true},
				},
				QuotaSettings: v1alpha2.ConfigQuotaSettings{
					DefQuota: map[corev1.ResourceName]resource.Quantity{"bar": resource.MustParse("1")},
				},
			}
			err = k8sClient.Update(ctx, latestConf)
			Expect(err).To(Not(HaveOccurred()))

			obj = &v1alpha1.Paas{
				Spec


r) => {
          const ns = await nsgetter();
          const cmds = await _getCommandMetadataList(ns, [...namespaceDepthList, ns.name]);
          namespacedCommandList = namespacedCommandList.concat(cmds);
        }));
      }

      namespacedCommandList.sort((a, b) => strcmp(a.fullName, b.fullName));

      return commandList.concat(namespacedCommandList);
    };

    return _getCommandMetadataList(this, [this.name]);
  }
}
export class Vendor {
  private _vendorStatus: VendorType;

  constructor(public name: string, private openingBalance: number) { }

  makePurchase(amount: number) {
    this.openingBalance -= amount;
  }

  get balance(): number { // getBalance
    return this.openingBalance;
  }

  get vendorStatus() {
    return this._vendorStatus;
  }

  set vendorStatus(val: VendorType) {
    this._vendorStatus = val;
  }
}

type VendorType = 'Active' | 'Retired' | 'InDefault';

interface Printable {
  print: (message: string) => void;
}

export class GoldVendor extends Vendor implements Printable {
  print(message: string) {
    console.log('The Gold Vendor says,', message);
  }

  makePurchase(amount: number) {
    super.makePurchase(amount * .9);
  }
}
import {joinErrors, toResult, Result} from './util';
import * as chalk from 'chalk';
import SoyContext from './soy-context';
import JSContext from './js-context';
import {Config, ImplicitParamsMap} from './config';

function getImplicitParams(className: string, paramsMap: ImplicitParamsMap): Array<string> {
  const initialImplicitParams: Array<string> = [];

  return Object.keys(paramsMap)
    .filter(nameOrRegex => className.match(new RegExp(nameOrRegex)))
    .reduce((acc, value) => acc.concat(paramsMap[value]), initialImplicitParams);
}

export default function validateParams(soyContext: SoyContext, jsContext: JSContext, config: Config): Result {
  const jsParams = jsContext.getParamNames();
  const classMethods = jsContext.getClassMethodNames();

  const className = jsContext.getClassName();
  const implicitParams = className ? getImplicitParams(className, config.implicitParams) : [];

  const missingParams = soyContext.getRenderParams()
    .map(param => param.name)
    .filter(param => !jsParams.includes(param) && !classMethods.includes(param) && !implicitParams.includes(param));

  if (missingParams.length) {
    return toResult(
      false,
      `These params can't be found in ${chalk.yellow('STATE')} or your ${chalk.yellow('Class')}:\n\n` +
      joinErrors(missingParams));
  }

  return toResult(true);
};
import { Injectable } from '@angular/core';
import { HttpClient } from '@angular/common/http'
import { Observable, observable } from 'rxjs';

export interface Contact {
    nombre: String;
    apellidos: String;
    email: String;
    empresa: String;
    descripcion: String;
    publicidad: boolean;
}
export interface ContactResponse{
    status: number;
    message: String;
}

@Injectable({
    providedIn: 'root'
})
export class ContactService {

    API_URI = 'http://localhost:3000/contacto'

    constructor(protected http: HttpClient) {

    }

    public sendContact(contact: Contact) {
        if(contact){
            return this.http.post(this.API_URI, contact);
        }else {
            throw new Error("Incomplete data provided")
        }
    }
}import { Offers } from 'src/types';

export function setOffers(offers?: Offers | Offers[]) {
  function mapOffer({ seller, ...rest }: Off


)
            .addExpected("BRIGHT CYAN", make8BitColorCtrlSeq(14, isForeground = false))
            .addExpected("BRIGHT WHITE", make8BitColorCtrlSeq(15, isForeground = false))
    )

    fun `test multiple attributes`() = check(
        ColoredText("${CSI}0m${CSI}48;$ANSI_24_BIT_COLOR_FORMAT;0;0;0m${CSI}38;$ANSI_8_BIT_COLOR_FORMAT;255mTEXT")
            .addExpected("TEXT", "${CSI}0;48;$ANSI_8_BIT_COLOR_FORMAT;0;38;$ANSI_8_BIT_COLOR_FORMAT;${if (SystemInfo.isWindows) 0 else 15}m")
    )

    private class ColoredText(val rawText: String, val outputType: Key<*> = ProcessOutputTypes.STDOUT) {
        val expectedColoredChunks: MutableList<Pair<String, String>> = mutableListOf()

        fun addExpected(text: String, colorKey: String): ColoredText {
            expectedColoredChunks.add(Pair(text, colorKey))
            return this
        }
    }

    companion object {
        private fun check(text: ColoredText) {
            val decoder = RsAnsiEscapeDecoder()
            val actualColoredChunks = mutableListOf<Pair<String, String>>()
            val acceptor = AnsiEscapeDecoder.ColoredTextAcceptor { s, attrs ->
                actualColoredChunks.add(Pair(s, attrs.escapeSequence))
            }
            decoder.escapeText(text.rawText, text.outputType, acceptor)
            val expectedColoredChunks = mutableListOf<Pair<String, String>>()
            expectedColoredChunks.addAll(text.expectedColoredChunks)
            assertEquals(expectedColoredChunks, actualColoredChunks)
        }

        private fun make24BitColorCtrlSeq(r: Int, g: Int, b: Int, isForeground: Boolean): String =
            "${CSI}0;${if (isForeground) "38;" else "48;"}$ANSI_24_BIT_COLOR_FORMAT;$r;$g;${b}m"

        private fun make8BitColorCtrlSeq(n: Int, isForeground: Boolean): String =
            "${CSI}0;${if (isForeground) "38;" else "48;"}$ANSI_8_BIT_COLOR_FORMAT;${n}m"
    }
}
/*
 * Use of this source code is governed by the MIT license that can be
 * found in the LICENSE file.
 */

package org.rust.lang.core.resolve

import org.intellij.lang.annotations.Language

class RsClosuresResolveTest : RsResolveTestBase() {
    override fun checkByCode(@Language("Rust") code: String) {
        val fnLangItems = """
            #[lang = "fn_once"]
            trait FnOnce<Args> { type Output; }

            #[lang = "fn_mut"]
            trait FnMut<Args>: FnOnce<Args> { }

            #[lang = "fn"]
            trait Fn<Args>: FnMut<Args> { }
        """
        super.checkByCode("$fnLangItems\n\n$code")
    }

    fun `test simple method resolve for closure`() = checkByCode("""
        struct T;
        impl T {
            fn bar(&self) {}
             //X
        }

        fn foo<F: Fn(&T) -> ()>(f: F) {}

        fn main() {
            foo(|t| { t.bar(); })
        }              //^
    """)

    fun `test wrong closure parameter`() = checkByCode("""
        struct T;
        impl T {
            fn bar(&self) {}
        }

        fn foo<F: Fn(&T) -> ()>(f: F) {}

        fn main() {
            foo(None, |t| { t.bar(); })
        }                    //^ unresolved
    """)

    fun `test simple method resolve with where for closure`() = checkByCode("""
        struct T;
        impl T {
            fn bar(&self) {}


 * @return new [KtNDArray] of type [T].
 * @see asArray
 * @see asContiguousArray
 * @see asFArray
 */
inline fun <reified T : Any> asAnyArray(a: List<Any>, order: Order? = null): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("asanyarray"), args = arrayOf(a, T::class.javaObjectType), order = order)

/**
 * Convert the input [KtNDArray] to an [KtNDArray] of type [T].
 *
 * @param a is [KtNDArray] of [Any].
 * @param order [Order]. Default is 'C'.
 * @return new [KtNDArray] of type [T].
 * @see asArray
 * @see asContiguousArray
 * @see asFArray
 */
inline fun <reified T : Any> asAnyArray(a: KtNDArray<out Any>, order: Order? = null): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("asanyarray"), args = arrayOf(a, T::class.javaObjectType), order = order)

/**
 * Return a contiguous array.
 *
 * @param a input array.
 * @return contiguous [KtNDArray].
 */
inline fun <reified T : Any> asContiguousArray(a: KtNDArray<out Any>): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("ascontiguousarray"), args = arrayOf(a, T::class.javaObjectType))

/**
 * Return an array converted to a float type.
 *
 * @param a [KtNDArray] of type [T].
 * @return new [KtNDArray] of type [Double]
 */
fun <T : Any> asFArray(a: KtNDArray<T>): KtNDArray<Double> =
    callFunc(nameMethod = arrayOf("asfarray"), args = arrayOf(a))

/**
 * Join a sequence of arrays along an existing axis.
 *
 * @param arrs the input arrays.
 * The arrays must have the same shape, except in the dimension corresponding to axis (the first, by default).
 * @param axis the axis along which the arrays will be joined. If axis is None, arrays are flattened before use. Default is 0.
 * @return new concatenated array.
 */
fun <T : Any> concatenate(vararg arrs: KtNDArray<T>, axis: Int = 0): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("concatenate"), args = arrayOf(arrs, axis))

/**
 * Join a sequence of arrays along a new axis.
 *
 * @param arrs the input arrays. Each array must have the same shape.
 * @param axis the axis in the result array along which the input arrays are stacked. Default is 0.
 * @return new [KtNDArray]. The stacked array has one more dimension than the input arrays.
 */
fun <T : Any> stack(vararg arrs: KtNDArray<T>, axis: Int = 0): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("stack"), args = arrayOf(arrs, axis))

/**
 * Stack 1-D arrays as columns into a 2-D array.
 *
 * @param tup arrays to stack. All of them must have the same first dimension.
 * @return 2D array. The array formed by stacking the given arrays.
 */
fun <T : Any> columnStack(vararg tup: KtNDArray<T>): KtNDArray<T> =
    callFunc(nameMethod = arrayOf("column_stack"), args = arrayOf(tup))

/**
 * Stack arrays in sequence depth wise (along third axis).
 *
 * @param tup the arrays must have the same shape along all but the third axis. 1-D or 2-D arrays must have the same shape.
 * @return The array formed


c"."V_Friend" ON b.vertex_id = "public"."V_Friend"."ID"
ORDER BY b.gen_random_uuid, b.path, b.path, b.ordinal;

@Test
public void friendOfFriendsTillTheLeafNodesOr() {
    VertexLabel friendVertexLabel = this.sqlgGraph.getTopology().getPublicSchema().ensureVertexLabelExist("Friend", new LinkedHashMap<>() {{
        put("name", PropertyDefinition.of(PropertyType.STRING, Multiplicity.of(1, 1)));
    }});
    friendVertexLabel.ensureEdgeLabelExist(
            "of",
            friendVertexLabel,
            EdgeDefinition.of(
                    Multiplicity.of(0, -1),
                    Multiplicity.of(0, -1)
            )
    );
    this.sqlgGraph.tx().commit();
    this.sqlgGraph.getTopology().lock();

    Vertex a = this.sqlgGraph.addVertex(T.label, "Friend", "name", "a");
    Vertex b = this.sqlgGraph.addVertex(T.label, "Friend", "name", "b");
    Vertex c = this.sqlgGraph.addVertex(T.label, "Friend", "name", "c");
    Vertex d = this.sqlgGraph.addVertex(T.label, "Friend", "name", "d");
    Vertex e = this.sqlgGraph.addVertex(T.label, "Friend", "name", "e");
    Vertex f = this.sqlgGraph.addVertex(T.label, "Friend", "name", "f");

    a.addEdge("of", b);
    a.addEdge("of", c);
    c.addEdge("of", d);
    c.addEdge("of", e);
    e.addEdge("of", f);

    this.sqlgGraph.tx().commit();
    List<Path> paths = this.sqlgGraph.traversal().V(a)
            .repeat(__.out("of").simplePath())
            .until(
                    __.or(
                            __.not(__.out("of").simplePath()), (1)
                            __.has("name", P.within("e")) (2)
                    )

            )
            .path()
            .by("name")
            .toList();
    for (Path path : paths) {
        LOGGER.info(path.toString());
    }

}

Repeat traversing of till the leaf nodes.

Repeat till friend 'e'

output

path[a, c, e]
path[a, b]
path[a, c, d]

sql

 WITH start AS (
    SELECT
	"public"."V_Friend"."ID" AS "alias1",
	"public"."V_Friend"."name" AS "alias2"
FROM
	"public"."V_Friend"
WHERE
	( "public"."V_Friend"."ID" = ?)
), a AS (
    WITH RECURSIVE search_tree("ID", "public.Friend__O", "public.Friend__I", depth, is_cycle, previous, path) AS (
        SELECT
            e."ID", e."public


几行代码搞定。TF也可以在不同设备，不同线程上处理。

## 广播操作

TF支持广播元素操作。一般来说，如果你想执行加法或者乘法之类操作，你得确保相加或者相乘元素形状匹配，比如你不能把形状为[3, 2]的tensor加到形状为[3, 4]的tensor上。但是有个特例，就是当你把一个tensor和另一有维度长度是1的tensor是去加去乘，TF会把银行的把那个维扩展，让两个tensor可操作。（去看numpy的广播机制吧）

```python
import tensorflow as tf

a = tf.constant([[1., 2.], [3., 4.]])
b = tf.constant([[1.], [2.]])
# c = a + tf.tile(b, [1, 2])
c = a + b

print(c)
```

广播可以让我们代码更短更高效。我们可以把不同长度的特征连接起来。比如用一些非线性操作复制特定维度，这在很多神经网络里经常用的到：

```python
a = tf.random.uniform([5, 3, 5])
b = tf.random.uniform([5, 1, 6])

# 连接a和b
tiled_b = tf.tile(b, [1, 3, 1])
c = tf.concat([a, tiled_b], 2)
d = tf.keras.layers.Dense(10, activation=tf.nn.relu).apply(c)

print(d)
```

但这个用了广播就更简单了，我们可以用f(m(x + y))等效f(mx + my)这个特性。然后隐含用广播来做连接。

```python
pa = tf.keras.layers.Dense(10).apply(a)
pb = tf.keras.layers.Dense(10).apply(b)
d = tf.nn.relu(pa + pb)

print(d)
```

事实下面的代码在可以广播的场景下更好用。

```python
def merge(a, b, units, activation=None):
    pa = tf.keras.layers.Dense(units).apply(a)
    pb = tf.keras.layers.Dense(units).apply(b)
    c = pa + pb
    if activation is not None:
        c = activation(c)
    return c
```

所以，我们说了广播的好处，那么广播有啥坏处呢。隐含的广播可能导致debug麻烦。

```python
a = tf.constant([[1.], [2.]])
b = tf.constant([1., 2.])
c = tf.reduce_sum(a + b)

print(c)
```

所以c的结果是啥？正确答案是12，当tensor形状不一样，TF自动的进行了广播。

避免这个问题的法子就是尽量显式，比如reduce时候注明维度。

```python
a = tf.constant([[1.], [2.]])
b = tf.constant([1., 2.])
c = tf.reduce_sum(a + b, 0)

print(c)
```

这里c得到[5, 7], 然后很容易发现问题。以后用reduce和tf.squeeze操作时最好注明维度。

## 利用重载函数
</a


    def handle_401(self, r, **kwargs):
        """Takes the given response and tries digest-auth, if needed."""

        if self.pos is not None:
            # Rewind the file position indicator of the body to where
            # it was to resend the request.
            r.request.body.seek(self.pos)
        num_401_calls = getattr(self, 'num_401_calls', 1)
        s_auth = r.headers.get('www-authenticate', '')

        if 'digest' in s_auth.lower() and num_401_calls < 2:

            setattr(self, 'num_401_calls', num_401_calls + 1)
            pat = re.compile(r'digest ', flags=re.IGNORECASE)
            self.chal = parse_dict_header(pat.sub('', s_auth, count=1))

            # Consume content and release the original connection
            # to allow our new request to reuse the same one.
            r.content
            r.raw.release_conn()
            prep = r.request.copy()
            extract_cookies_to_jar(prep._cookies, r.request, r.raw)
            prep.prepare_cookies(prep._cookies)

            prep.headers['Authorization'] = self.build_digest_header(
                prep.method, prep.url)
            _r = r.connection.send(prep, **kwargs)
            _r.history.append(r)
            _r.request = prep

            return _r

        setattr(self, 'num_401_calls', 1)
        return r

    def __call__(self, r):
        # If we have a saved nonce, skip the 401
        if self.last_nonce:
            r.headers['Authorization'] = self.build_digest_header(r.method, r.url)
        try:
            self.pos = r.body.tell()
        except AttributeError:
            pass
        r.register_hook('response', self.handle_401)
        return r


ocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tcode $*')
set_shell_function("textget",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg textget $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg textget $*')
set_shell_function("textsearch",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg textsearch $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg textsearch $*')
set_shell_function("tfextract",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfextract $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfextract $*')
set_shell_function("tfm",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfm $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfm $*')
set_shell_function("tfscan",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfscan $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tfscan $*')
set_shell_function("tmap",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tmap $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tmap $*')
set_shell_function("tranalign",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tranalign $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg tranalign $*')
set_shell_function("transeq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg transeq $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg transeq $*')
set_shell_function("trimest",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg trimest $@','singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg trimest $*')
set_shell_function("trimseq",'singularity exec ${BIOCONTAINER_DIR}/biocontainers/emboss/emboss-6.6.0--h6debe1e_0.simg trimseq $@','singularity exec ${BIOCONTAINER_DIR}/biocont


ver);pointer-events:none}._fade_ckwnl_8._visible_ckwnl_16{opacity:1;pointer-events:auto}._fade_ckwnl_8 ._bg_ckwnl_21{position:absolute;width:var(--size-112);height:100%;pointer-events:none}@media (max-width: 650px){._fade_ckwnl_8 ._bg_ckwnl_21{width:var(--size-64);opacity:.75}}._fade_ckwnl_8._left_ckwnl_33{left:0;justify-content:flex-start}._fade_ckwnl_8._left_ckwnl_33 ._bg_ckwnl_21{background:linear-gradient(to right,var(--color-bg-primary) var(--size-16),rgb(var(--color-bg-primary-raw) / 0));background:linear-gradient(90deg,rgb(var(--color-bg-primary-raw)) 0%,rgb(var(--color-bg-primary-raw) / .9990234375) 6.25%,rgb(var(--color-bg-primary-raw) / .9921875) 12.5%,rgb(var(--color-bg-primary-raw) / .9736328125) 18.75%,rgb(var(--color-bg-primary-raw) / .9375) 25%,rgb(var(--color-bg-primary-raw) / .8779296875) 31.25%,rgb(var(--color-bg-primary-raw) / .7890625) 37.5%,rgb(var(--color-bg-primary-raw) / .6650390625) 43.75%,rgb(var(--color-bg-primary-raw) / .5) 50%,rgb(var(--color-bg-primary-raw) / .3349609375) 56.25%,rgb(var(--color-bg-primary-raw) / .2109375) 62.5%,rgb(var(--color-bg-primary-raw) / .1220703125) 68.75%,rgb(var(--color-bg-primary-raw) / .0625) 75%,rgb(var(--color-bg-primary-raw) / .0263671875) 81.25%,rgb(var(--color-bg-primary-raw) / .0078125) 87.5%,rgb(var(--color-bg-primary-raw) / .0009765625) 93.75%,rgb(var(--color-bg-primary-raw) / 0) 100%)}._fade_ckwnl_8._right_ckwnl_66{right:0;justify-content:flex-end}._fade_ckwnl_8._right_ckwnl_66 ._bg_ckwnl_21{background:linear-gradient(to left,var(--color-bg-primary) var(--size-36),rgb(var(--color-bg-primary-raw) / 0));background:linear-gradient(90deg,rgb(var(--color-bg-primary-raw) / 0) 0%,rgb(var(--color-bg-primary-raw) / .0009765625) 6.25%,rgb(var(--color-bg-primary-raw) / .0078125) 12.5%,rgb(var(--color-bg-primary-raw) / .0263671875) 18.75%,rgb(var(--color-bg-primary-raw) / .0625) 25%,rgb(var(--color-bg-primary-raw) / .1220703125) 31.25%,rgb(var(--color-bg-primary-raw) / .2109375) 37.5%,rgb(var(--color-bg-primary-raw) / .3349609375) 43.75%,rgb(var(--color-bg-primary-raw) / .5) 50%,rgb(var(--color-bg-primary-raw) / .6650390625) 56.25%,rgb(var(--color-bg-primary-raw) / .7890625) 62.5%,rgb(var(--color-bg-primary-raw) / .8779296875) 68.75%,rgb(var(--color-bg-primary-raw) / .9375) 75%,rgb(var(--color-bg-primary-raw) / .9736328125) 81.25%,rgb(var(--color-bg-primary-raw) / .9921875) 87.5%,rgb(var(--color-bg-primary-raw) / .9990234375) 93.75%,rgb


储，每个条目包含：

- **情境描述**：描述道德困境的背景故事。
- **选项A**：情境中的一个可能行动。
- **选项B**：与选项A相互排斥的另一个可能行动。
- **道德原则**：与每个选项关联的道德原则。

### 使用方法

数据集可以用于训练和评估LLMs在特定道德情境下的表现，以及它们对不同道德原则的偏好。

## 代码

我们提供了用于道德选择和道德辩论的代码，包括：

- **道德选择模块**：用于生成模型在给定道德场景中的选择。
- **道德辩论模块**：通过模拟辩论来测试模型对其道德选择的坚定程度。
- **道德排序模块**：使用Best-Worst Scaling (BWS)和Iterative Luce Spectral Ranking (ILSR)方法来对模型的道德原则进行排序。

## 引用
如果您在研究中使用了这个数据集或代码，请引用我们的论文：
Evaluating Moral Beliefs across LLMs through a Pluralistic Framework
Thank you for your detailed review and suggestions to improve our paper.

**Weakness 1:** “How robust is Ernie Bot to regenerate ChatGPT’s 514 moral scenarios? And does the bias from the model interfere with the generated scenarios? How do the authors mitigate this?”

**Response:**
With the help of ChatGPT, we successfully generated 514 moral scenarios, with only a few Chinese idioms not being accurately understood by it. To more precisely grasp the connotations of these Chinese idioms, we introduced the Chinese language model Ernie Bot, which exhibited remarkable robustness and could assist us in generating moral scenarios closely related to these idioms. Since the number of idioms involved was relatively small, minor deviations in the model had little interference on the generated scenarios. Additionally, we set up prompts to guide the model in explaining moral terms first, ensuring that it generates moral scenarios that are in line with the modified terms based on a thorough understanding. This measure effectively reduced the differences between different models in generating moral scenarios, enhancing overall consistency and accuracy.

**Weakness 2:** “The authors mentioned that “The temperature settings for the four models are 0.95, 0.95, 0.9, and 0.9”, is there any specific reason in using different temperature settings for each model used? And will the results change if we change the temperature?”

**Response:**
The temperature parameter indeed plays a crucial role in shaping the diversity and certainty of the text generated by the models. At lower temperature settings, models are more inclined to select words with higher probabilities, yielding outputs that are more predictable and consistent. On the other hand, higher temperature settings introduce greater randomness into the generation process, which can lead to a wider variety of outputs, albeit with potential inconsistencies.
To address the question of how results may vary with different temperature settings for the models, we have conducted extensive experiments to examine the consistency rate of the models' outputs during the moral choice phase across a range of temperature settings: 0, 0.25, 0.5, 0.75, and 1. The detailed findings from


中有建设性的意见。 c:11

### 克制做人：放弃“我行我素”，选择“以和为贵”

不要总是对那些处事特别圆滑的人有抵触心理，要懂得，能做到在各种人际关系中表现自如，安然处之，是一种学问，也是一种能力，而成功的人都拥有这种能力，我们都应该去学习，去培养。
 c:11

### 难得糊涂：太执著的人会把事情搞砸

水至清则无鱼，人至察则无徒”，如果眼里不揉沙子，把问题看得太清楚而不能容人，那么就没有什么有价值的东西可取了。成大事者必定抓大局，不被表面的、直接的东西蒙蔽，能够果断地舍弃那些无关大局的东西。少了一份执著心，得到的将是整个世界 c:14

能够迁就别人的个性或是习惯，将会给你带来更多的朋友。人的一生，短短数载，不够时间计较，不够时间事事明细，不必在一些小事上太过苛求，不必在思前想后中耗磨时间，多包容一些，少苛求一些，享受生命的乐趣。
 c:13

第二，保持乐观心态和感恩的心。 c:12

### 人心难测：率真也害人，吃亏上当是因为太傻太天真

首先不能交心的人便是自己的同事。 c:11
## 气场：气场决定成败 气场改变人生

沐阳  -  个人成长榜-情绪心灵

> 本书内容包括：做你自己，才能有自己的气场；王者心态诞生王者气场；让气场步步飙升的心灵拓展术；气场圈决定人脉圈；气场力等于影响力、气场富了，你就富了；，拥抱成功人生等。

### 序言 掌控气场，改变人生

气场就是一种围绕在人身体周围的能量场，它以人的身体为中心，向四周发散。 c:63

气场能感染、带动周遭人的情绪，还能影响、左右事态的发展 c:32

第一类是强大且吸引人的气场，属于最佳的气场 c:55

你的身体和心灵越健康，你的能量就越活跃，气场力就越强，受到的干扰就越小，你就越有力量去做要做和想做的事，凡事就更容易成功。 c:69

### 气场是你我独特的“名片”


 (
            "SELECT player_id, quantity FROM BlendItem",
            select!(player_id | quantity; I64 | I64; 1 1; 2 4; 2 9; 3 2; 3 1),
        ),
        (
            "SELECT player_id, player_id FROM BlendItem",
            select!(player_id | player_id; I64 | I64; 1 1; 2 2; 2 2; 3 3; 3 3),
        ),
        (
            "
            SELECT u.id, i.id, player_id
            FROM BlendUser u
            JOIN BlendItem i ON u.id = 1 AND u.id = i.player_id
            ",
            select!(id | id | player_id; I64 | I64 | I64; 1 101 1),
        ),
        (
            "
            SELECT i.*, u.name
            FROM BlendUser u
            JOIN BlendItem i ON u.id = 2 AND u.id = i.player_id
            ",
            select!(
                id  | player_id | quantity | name
                I64 | I64       | I64      | Str;
                102   2           4          "Mike".to_owned();
                103   2           9          "Mike".to_owned()
            ),
        ),
        (
            "
            SELECT u.*, i.*
            FROM BlendUser u
            JOIN BlendItem i ON u.id = i.player_id
            ",
            select!(
                id  | name                 | id  | player_id | quantity
                I64 | Str                  | I64 | I64       | I64;
                1     "Taehoon".to_owned()   101   1           1;
                2     "Mike".to_owned()      102   2           4;
                2     "Mike".to_owned()      103   2           9;
                3     "Jorno".to_owned()     104   3           2;
                3     "Jorno".to_owned()     105   3           1
            ),
        ),
        (
            "SELECT id as Ident, name FROM BlendUser",
            select!(
                Ident | name
                I64   | Str;
                1       "Taehoon".to_owned();
                2       "Mike".to_owned();
                3       "Jorno".to_owned()
            ),
        ),
        (
            "SELECT (1 + 2) as foo, 2+id+2*100-1 as Ident, name FROM BlendUser",
            select!(
                foo | Ident | name
                I64 | I64   | Str;
                3     202     "Taehoon".to_owned();
                3     203     "Mike".to_owned();
                3     204     "Jorno".to_owned()
            ),
        ),
        (
            "
            SELECT id FROM BlendUser
            WHERE id IN (
                SELECT BlendUser.id FROM BlendItem
                WHERE quantity > 5 AND BlendUser.id = player_id
            );",
            select!(id; I64; 2),
        ),
    ];

    for (sql, expected) in test_cases {
        test!(Ok(expected), sql);
    }

    let error_cases = vec![
        (
            SelectError::TableAliasNotFound("Whatever".to_owned()).into(),
            "SELECT Whatever.* FROM BlendUser",
        ),
        (
            SelectError::BlendTableAliasNotFound("Whatever".to_owned()).into(),
            "SELECT * FROM BlendUser WHERE id IN (SELECT Whatever.* FROM BlendUser)",
        ),
        (
            EvaluateError::ValueNotFound("noname".to_owned()).into(),
            "SELECT noname FROM BlendUser",
        ),
    ];

    for (error, sql) in error_cases {
        test!(Err(error), sql);
    }
});
<reponame>danpashin/libproc-rs
extern crate errno;
extern crate libc;

#[cfg(any(target_os = "macos", target_os = "ios"))]
use std::str;

#[cfg(any(


ackages and old versions of Rhino. Pre-existing versions on the server (without distributions) will be treated as `any-any` when installing. New package versions that do not include a distribution tag, e.g. those created by previous versions of the CLI, will also be treated as `any-any` when publishing.

## Next Steps

Now that you've have seen what is in a package, why not create a package:

* [Create a Grasshopper package](../pushing-a-package-to-the-server) of your plugin.
* [Create a Rhino package](../pushing-a-package-to-the-server) for everyone.
* [Create a multi-targeted package](../creating-a-multi-targeted-rhino-plugin-package) for Rhino 8.
+++
aliases = ["/en/5/samples/rhinocommon/project-points-to-mesh/", "/en/6/samples/rhinocommon/project-points-to-mesh/", "/en/7/samples/rhinocommon/project-points-to-mesh/", "/en/wip/samples/rhinocommon/project-points-to-mesh/"]
authors = [ "steve" ]
categories = [ "Other" ]
description = "Demonstrates how to project points to a mesh."
keywords = [ "project", "points", "mesh" ]
languages = [ "C#", "Python", "VB" ]
sdk = [ "RhinoCommon" ]
title = "Project Points to Mesh"
type = "samples/rhinocommon"
weight = 1

[admin]
TODO = ""
origin = "http://wiki.mcneel.com/developer/rhinocommonsamples/projectpointstomeshes"
picky_sisters = ""
state = ""

[included_in]
platforms = [ "Windows", "Mac" ]
since = 0
+++

```cs
partial class Examples
{
  public static Result ProjectPointsToMeshesEx(RhinoDoc doc)
  {
    ObjRef obj_ref;
    var rc = RhinoGet.GetOneObject("mesh", false, ObjectType.Mesh, out obj_ref);
    if (rc != Result.Success) return rc;
    var mesh = obj_ref.Mesh();

    ObjRef[] obj_ref_pts;
    rc = RhinoGet.GetMultipleObjects("points", false, ObjectType.Point, out obj_ref_pts);
    if (rc != Result.Success) return rc;
    var points = new List<Point3d>();
    foreach (var obj_ref_pt in obj_ref_pts)
    {
      var pt = obj_ref_pt.Point().Location;
      points.Add(pt);
    }

    int[] indices;
    var prj_points = Intersection.ProjectPointsToMeshesEx(new[] {mesh}, points, new Vector3d(0, 1, 0), 0, out indices);
    foreach (var prj_pt in prj_points) doc.Objects.AddPoint(prj_pt);
    doc.Views.Redraw();
    return Result.Success;
  }
}
```

```vbnet
Partial Friend Class Examples
  Public Shared Function ProjectPointsToMeshesEx(ByVal doc As RhinoDoc) As Result
	Dim obj_ref As ObjRef = Nothing
	Dim rc = RhinoGet.GetOneObject("mesh", False, ObjectType.Mesh, obj_ref)
	If rc IsNot Result.Success Then
		Return rc
	End If
	Dim mesh = obj_ref.Mesh()

	Dim obj_ref_pts() As ObjRef = Nothing
	rc = RhinoGet.GetMultipleObjects("points", False, ObjectType.Point, obj_ref_pts)
	If rc IsNot Result.Success Then
		Return rc
	End If
	Dim points = New List(Of Point3d)()
	For Each obj_ref_pt In obj_ref_pts
	  Dim pt = obj_ref_pt.Point().Location
	  points.Add(pt)
	Next obj_ref_pt

	Dim indices() As Integer = Nothing
	Dim prj_points = Intersection.ProjectPointsToMeshes


e](https://img.shields.io/github/repo-size/HollowMan6/Answers-for-My-LZU-UG-Courses.svg)](../../../archive/master.zip)

这是我的兰州大学路永刚老师的“算法设计与分析”的期末考试考点整理，PPT版权归属路永刚老师，我进行了一些整理。教材是算法设计与分析基础（第3版，Anany Levitin），答案来自于网络，本人剔除了题目和提示部分之后进行了整理。

## 考点
* [算法复杂度分析](算法复杂度分析.pdf)
* [各种排序算法](各种排序算法.pdf)
* [图的遍历](图的遍历.pdf)、[拓扑排序](拓扑排序.pdf)、[最小生成树](最小生成树.pdf)
* [矩阵的LU分解](矩阵的LU分解.pdf)
* [散列法](散列法.pdf)、[字符串匹配](字符串匹配.pdf)
* [生成排列](生成排列.pdf)、[幂集合](幂集合（生成子集）.pdf)
* [构建最优二叉查找树](各种动态规划算法（包含构建最优二叉查找树）.pdf)
* [哈夫曼编码](哈夫曼编码.pdf)
* [各种动态规划算法](各种动态规划算法（包含构建最优二叉查找树）.pdf)

## [课后习题答案](课后习题答案.pdf)
# 汇编语言课程设计 实验报告

[![last-commit](https://img.shields.io/github/last-commit/HollowMan6/Answers-for-My-LZU-UG-Courses)](../../../graphs/commit-activity)

[![Followers](https://img.shields.io/github/followers/HollowMan6?style=social)](https://github.com/HollowMan6?tab=followers)
[![watchers](https://img.shields.io/github/watchers/HollowMan6/Answers-for-My-LZU-UG-Courses?style=social)](../../../watchers)
[![stars](https://img.shields.io/github/stars/HollowMan6/Answers-for-My-LZU-UG-Courses?style=social)](../../../stargazers)
[![forks](https://img.shields.io/github/forks/HollowMan6/Answers-for-My-LZU-UG-Courses?style=social)](../../../network/members)

[![Open Source Love](https://badges.frapsoft.com/os/v1/open-source.svg?v=103)](https://hollowman6.github.io/fund.html)
[![GPL Licence](https://badges.frapsoft.com/os/gpl/gpl.svg?v=103)](https://opensource.org/licenses/GPL-3.0/)
[![Repo-Size](https://img.shields.io/github/repo-size/HollowMan6/Answers-for-My-LZU-UG-Courses.svg)](../../../archive/master.zip)

这个仓库是我的兰州大学“汇编语言课程设计”实验课的实验报告。

# Answers for my Assemble Language programing lesson

These are my reports for the LZU Assemble Language Experiment course.
# 计算机网络实验 实验报告和材料

[![last-commit](https://img.shields.io/github/last-commit/HollowMan6/Answers-for-My-LZU-UG-Courses)](../../../graphs/commit-activity)

[![Followers](https://img.shields.io/github/followers/HollowMan6?style=social)](https://github.com/HollowMan6?tab=followers)
[![watchers](https://img.shields.io/github/watchers/HollowMan6/Answers-for-My-LZU-UG-Courses?style=social)](../../../watchers)


n() == 0);
        assert (bbuf.position() == 0);
        final int r1 = Utils.decimal_str2bin(sbuf, sbuf.capacity(),
                                             prec, scale,
                                             bbuf, bbuf.capacity());
        if (r1 != Utils.E_DEC_OK) {
            out.println("decimal_str2bin() returned: " + r1);
            return;
        }

        // clear string buffer
        sbuf.clear();
        for (int i = 0; i < sbuf.capacity(); i++) sbuf.put((byte)0);
        sbuf.rewind();

        // binary->string
        assert (bbuf.position() == 0);
        assert (sbuf.position() == 0);
        final int r2 = Utils.decimal_bin2str(bbuf, bbuf.capacity(),
                                             prec, scale,
                                             sbuf, sbuf.capacity());
        if (r2 != Utils.E_DEC_OK) {
            out.println("decimal_bin2str() returned: " + r2);
            return;
        }

        // read string buffer
        assert (sbuf.position() == 0);
        sbuf.limit(prec);
        final String t = Charset.forName("US-ASCII").decode(sbuf).toString();

        out.println("'" + t + "'");
    }

    public void test() {
        out.println("--> MySqlUtilsDecimalTest.test()");

        // load native library
        loadSystemLibrary("ndbclient");

        test_s2b2s("3.3", 2, 1);
        test_s2b2s("124.000", 20, 4);
        test_s2b2s("-11", 14, 1);
        test_s2b2s("1.123456000000000", 20, 16);
        test_s2b2s("0", 20, 10);
        test_s2b2s("1 ", 20, 10);
        test_s2b2s("1,35", 20, 10);
        test_s2b2s("text",20, 10);

        out.println();
        out.println("<-- MySqlUtilsDecimalTest.test()");
    };

    static public void main(String[] args) throws Exception {
        out.println("--> MySqlUtilsDecimalTest.main()");

        out.println();
        MySqlUtilsDecimalTest test = new MySqlUtilsDecimalTest();
        test.test();

        out.println();
        out.println("<-- MySqlUtilsDecimalTest.main()");
    }
}
/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 * All rights reserved.
 *
 * This source code is licensed under the license found in the
 * LICENSE file in the root directory of this source tree.
 */

package com.facebook.gamingservices;

import android.app.Activity;
import android.content.Intent;
import android.net.Uri;
import androidx.fragment.app.Fragment;
import com.facebook.FacebookCallback;
import com.facebook.FacebookRequestError;
import com.facebook.FacebookSdk;
import com.facebook.internal.AppCall;
import com.facebook.internal.CallbackManagerImpl;
import com.facebook.internal.FacebookDialogBase;
import com.facebook.internal.FragmentWrapper;
import com.facebook.internal.instrument.crashshield.AutoHandleExceptions;
import java.util.List;

@AutoHandleExceptions
public class GamingGroupIntegration
    extends FacebookDialogBase<Void, GamingGroupIntegration.Result> {

  private static final int DEFAULT_REQUEST_CODE =
      CallbackManagerImpl.RequestCodeOffset.GamingGroupIntegration.toRequestCode();
  private static final String ERROR_KEY = "error";
  /**
   * Constructs a new GamingGroupIntegration.
   *
   * @param activity Activity to use to trigger this Dialog.
   */
  public GamingGroupIntegration(final Activity activity) {
    super(activity, DEFAULT_REQUEST_CODE);
  }
  /**
   * Constructs a new GamingGroupIntegration.
   *
   * @param fragment fragment to use to trigger this Dialog.
   */
  public GamingGroupIntegration(final android.app.Fragment fragment) {


,
            rank.toByte(),
            world.toUShort(),
            discardedBoolean,
        )

        public constructor(
            name: String,
            rank: Int,
            world: Int,
        ) : this(
            name,
            rank.toByte(),
            world.toUShort(),
            false,
        )

        public val rank: Int
            get() = _rank.toInt()
        public val world: Int
            get() = _world.toInt()

        override fun equals(other: Any?): Boolean {
            if (this === other) return true
            if (javaClass != other?.javaClass) return false

            other as ClanMember

            if (name != other.name) return false
            if (_rank != other._rank) return false
            if (_world != other._world) return false
            if (discardedBoolean != other.discardedBoolean) return false

            return true
        }

        override fun hashCode(): Int {
            var result = name.hashCode()
            result = 31 * result + _rank
            result = 31 * result + _world.hashCode()
            result = 31 * result + discardedBoolean.hashCode()
            return result
        }

        override fun toString(): String {
            return "ClanMember(" +
                "name='$name', " +
                "rank=$rank, " +
                "world=$world, " +
                "discardedBoolean=$discardedBoolean" +
                ")"
        }
    }

    public companion object {
        public const val FLAG_USE_BASE_37_NAMES: Int = 0x1
        public const val FLAG_USE_DISPLAY_NAMES: Int = 0x2
        public const val FLAG_HAS_VERSION: Int = 0x4
        public const val DEFAULT_OLDSCHOOL_VERSION: Int = 2
    }
}
package net.rsprox.protocol.game.outgoing.model.specific

import net.rsprox.protocol.game.outgoing.model.IncomingServerGameMessage
import net.rsprox.protocol.game.outgoing.model.zone.payload.util.CoordInBuildArea

/**
 * Proj anim specific packets are used to send a projectile for a specific user,
 * without anyone else in the world seeing it.
 * Unlike the regular [net.rsprot.protocol.game.outgoing.zone.payload.MapProjAnim]
 * zone packet, this packet does not support transmitting the source index.
 *
 * While it is possible to compress this message further as the [targetIndex]
 * only needs to be a 24-bit integer, the entire payload of this packet
 * sums to just 19 bytes, which is 1 less than the 8-byte padding that will
 * be performed by the JVM anyway - so there are no benefits in doing so.
 *
 * @property id the id of the spotanim that is this projectile
 * @property startHeight the height of the projectile as it begins flying
 * @property endHeight the height of the projectile as it finishes flying
 * @property startTime the start time in client cycles (20ms/cc) until the
 * projectile begins moving
 * @property endTime the end time in client cycles (20ms/cc) until the
 * projectile arrives at its destination
 * @property angle the angle that the projectile takes during its flight
 * @property progress the fine coord progress that the projectile
 * has made before it begins flying. If the value is 0, the projectile begins flying
 * at the defined start coordinate. For every 128 units of value, the projectile
 * is moved 1 game square towards the end position. Interpolate between 0-128 for
 * units smaller than 1 game square.
 * This is commonly set to 128 to make a projectile appear as if it's flying
 * straight down, as the projectile will not render if its defined start and
 * end coords are equal. So, in order to avoid that, one solution is to put the
 * end coordinate 1 game square away from the start in a cardinal direction,
 * and set the value of this property to 128 - ensuring that the projectile
 * will appear to fly completely v


tAttID = 3000
                local ComAttID = 3001
                local ShootNum = ai:GetRandam_Int(2, 5)
                Shoot_Act(ai, goal, FirstAttID, ComAttID, ShootNum)
            else
                local FirstAttID = 3002
                local ComAttID = 3003
                local ShootNum = ai:GetRandam_Int(2, 5)
                Shoot_Act(ai, goal, FirstAttID, ComAttID, ShootNum)
            end
            goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 2, TARGET_ENE_0, 20, TARGET_ENE_0, true, -1)
        elseif fateAct <= Act01Per + Act02Per + Act03Per then
            if fate <= 50 then
                local FirstAttID = 3000
                local ComAttID = 3001
                local ShootNum = ai:GetRandam_Int(1, 3)
                Shoot_Act(ai, goal, FirstAttID, ComAttID, ShootNum)
            else
                local FirstAttID = 3002
                local ComAttID = 3003
                local ShootNum = ai:GetRandam_Int(1, 3)
                Shoot_Act(ai, goal, FirstAttID, ComAttID, ShootNum)
            end
            goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 5, TARGET_ENE_0, 20, TARGET_SELF, false, -1)
        else
            local approachDist = Att3006_Dist_max
            local dashDist = Att3006_Dist_max + 2
            local Odds_Guard = 0
            local AttID = 3006
            local AttDist = DIST_Middle
            Approach_and_Attack_Act(ai, goal, approachDist, dashDist, Odds_Guard, AttID, AttDist)
            goal:AddSubGoal(GOAL_COMMON_LeaveTarget, 5, TARGET_ENE_0, 20, TARGET_SELF, false, -1)
        end
    end
    return
end

function HusiMino_Gun253002Battle_Update(ai, goal)
    return GOAL_RESULT_Continue
end

function HusiMino_Gun253002Battle_Terminate(ai, goal)
    return
end

function HusiMino_Gun253002Battle_Interupt(ai, goal)
    local fate = ai:GetRandam_Int(1, 100)
    local fate2 = ai:GetRandam_Int(1, 100)
    local fate3 = ai:GetRandam_Int(1, 100)
    local targetDist = ai:GetDist(TARGET_ENE_0)
    local distDamagedStep = 3
    local oddsDamagedStep = 15
    local bkStepPer = 30
    local leftStepPer = 35
    local rightStepPer = 35
    local safetyDist = 4
    if Damaged_Step(ai, goal, distDamagedStep, oddsDamagedStep, bkStepPer, leftStepPer, rightStepPer, safetyDist) then
        return true
    else
        return false
    end
end

return


PerWriter = 100
	)

	var (
		totalWrites      int64
		successfulWrites int64
		rotationErrors   int64
		writeErrors      int64
		wg               sync.WaitGroup
	)

	// Start concurrent writers
	for i := 0; i < numWriters; i++ {
		wg.Add(1)
		go func(writerID int) {
			defer wg.Done()

			for j := 0; j < writesPerWriter; j++ {
				key := fmt.Sprintf("writer%d-key%d", writerID, j)
				value := fmt.Sprintf("value-%d-%d", writerID, j)

				atomic.AddInt64(&totalWrites, 1)

				err := manager.Put([]byte(key), []byte(value))
				if err != nil {
					if err == wal.ErrWALRotating {
						atomic.AddInt64(&rotationErrors, 1)
					} else {
						atomic.AddInt64(&writeErrors, 1)
						t.Logf("Write error: %v", err)
					}
				} else {
					atomic.AddInt64(&successfulWrites, 1)
				}

				// Small delay to allow rotation opportunities
				time.Sleep(100 * time.Microsecond)
			}
		}(i)
	}

	// Start concurrent WAL rotations
	wg.Add(1)
	go func() {
		defer wg.Done()

		for i := 0; i < numRotations; i++ {
			// Wait a bit between rotations
			time.Sleep(50 * time.Millisecond)

			err := manager.RotateWAL()
			if err != nil {
				t.Logf("Rotation error: %v", err)
			}

			// Check if rotation state is properly managed
			if manager.isRotating() {
				t.Logf("Rotation %d in progress", i+1)
				// Allow some time for rotation to complete
				time.Sleep(10 * time.Millisecond)
			}
		}
	}()

	// Wait for all operations to complete
	wg.Wait()

	// Verify results
	t.Logf("Test completed:")
	t.Logf("  Total writes attempted: %d", atomic.LoadInt64(&totalWrites))
	t.Logf("  Successful writes: %d", atomic.LoadInt64(&successfulWrites))
	t.Logf("  Rotation errors (retried): %d", atomic.LoadInt64(&rotationErrors))
	t.Logf("  Other write errors: %d", atomic.LoadInt64(&writeErrors))

	// Verify that most writes succeeded (allowing for some rotation conflicts)
	if atomic.LoadInt64(&successfulWrites) < atomic.LoadInt64(&totalWrites)*8/10 {
		t.Errorf("Too many writes failed: %d successful out of %d total",
			atomic.LoadInt64(&successfulWrites), atomic.LoadInt64(&totalWrites))
	}

	// Verify no unexpected write errors occurred
	if atomic.LoadInt64(&writeErrors) > 0 {
		t.Errorf("Unexpected write errors occurred: %d", atomic.LoadInt64(&writeErrors))
	}

	// Verify data integrity by reading back some values
	for i := 0; i < 5; i++ {
		key := fmt.Sprintf("writer%d-key%d", 0, i)
		expectedValue := fmt.Sprintf("value-%d-%d", 0, i)

		value, err := manager.Get([]byte(key))
		if err != nil {
			t.Logf("Error reading key %s: %v", key, err)
			continue
		}

		if value != nil && string(value) == expectedValue {
			t.Logf("Successfully verified key %s", key)
		}
	}
}

// TestWALRotationAtomicity tests the atomicity of WAL rotation operations
func TestWALRotationAtomicity(t *testing.T) {
	tempDir := t.TempDir()

	cfg := &config.Config{
		Version:         config.CurrentManifestVersion,
		SSTDir:          tempDir + "/sst",
		WALDi


ange a waiting room's behavior during a specified
	//     period of time. For additional information, look at the event properties
	//     `prequeue_start_time`, `event_start_time`, and `event_end_time` in the
	//     documentation for creating waiting room events. Events are considered active
	//     between these start and end times, as well as during the prequeueing period
	//     if it exists.
	//  18. `isEventPrequeueing`: Valid only when `isEventActive` is **true**. Boolean
	//     indicating if an event is currently prequeueing users before it starts.
	//  19. `timeUntilEventStart`: Valid only when `isEventPrequeueing` is **true**.
	//     Integer indicating the number of minutes until the event starts.
	//  20. `timeUntilEventStartFormatted`: String displaying the `timeUntilEventStart`
	//     formatted in English for users. If `isEventPrequeueing` is **false**,
	//     `timeUntilEventStartFormatted` will display **unavailable**.
	//  21. `timeUntilEventEnd`: Valid only when `isEventActive` is **true**. Integer
	//     indicating the number of minutes until the event ends.
	//  22. `timeUntilEventEndFormatted`: String displaying the `timeUntilEventEnd`
	//     formatted in English for users. If `isEventActive` is **false**,
	//     `timeUntilEventEndFormatted` will display **unavailable**.
	//  23. `shuffleAtEventStart`: Valid only when `isEventActive` is **true**. Boolean
	//     indicating if the users in the prequeue are shuffled randomly when the event
	//     starts.
	//  24. `turnstile`: Empty when turnstile isn't enabled. String displaying an html
	//     tag to display the Turnstile widget. Please add the `{{{turnstile}}}` tag to
	//     the `custom_html` template to ensure the Turnstile widget appears.
	//  25. `infiniteQueue`: Boolean indicating whether the response is for a user in
	//     the infinite queue.
	//
	// An example cURL to a waiting room could be:
	//
	//	curl -X GET "https://example.com/waitingroom" \
	//		-H "Accept: application/json"
	//
	// If `json_response_enabled` is **true** and the request hits the waiting room, an
	// example JSON response when `queueingMethod` is **fifo** and no event is active
	// could be:
	//
	//	{
	//		"cfWaitingRoom": {
	//			"inWaitingRoom": true,
	//			"waitTimeKnown": true,
	//			"waitTime": 10,
	//			"waitTime25Percentile": 0,
	//			"waitTime50Percentile": 0,
	//			"waitTime75Percentile": 0,
	//			"waitTimeFormatted": "10 minutes",
	//			"queueIsFull": false,
	//			"queueAll": false,
	//			"lastUpdated": "2020-08-03T23:46:00.000Z",
	//			"refreshIntervalSeconds": 20,
	//			"queueingMethod": "fifo",
	//			"isFIFOQueue": true,
	//			"isRandomQueue": false,
	//			"isPassthroughQueue": false,
	//			"isRejectQueue": false,
	//			"isEventActive": false,
	//			"isEventPrequeueing": false,
	//			"timeUntilEventStart": 0,
	//			"timeUntilEventStartFormatted": "unavailable",
	//			"timeUntilEventEnd": 0,
	//			"timeUntilEventEndFormatted": "unavailable",
	//			"shuffleAtEventStart": false
	//		}
	//	}
	//
	// If `json_response_enabled` is **true** and the request hits the waiting room, an
	// example JSON response when `queueingMethod` is **random** and an event is active
	// could be:
	//
	//	{
	//		"cfWaitingRoom": {
	//			"inWaitingRoom": true,
	//			"waitTimeKnown": true,
	//			"waitTime": 10,
	//			"waitTime25Percentile": 5,
	//			"waitTime50Percentile": 10,


/
# define COMPILER_VERSION_MAJOR DEC(__WATCOMC__ / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
#  define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif

#elif defined(__WATCOMC__)
# define COMPILER_ID "OpenWatcom"
   /* __WATCOMC__ = VVRP + 1100 */
# define COMPILER_VERSION_MAJOR DEC((__WATCOMC__ - 1100) / 100)
# define COMPILER_VERSION_MINOR DEC((__WATCOMC__ / 10) % 10)
# if (__WATCOMC__ % 10) > 0
#  define COMPILER_VERSION_PATCH DEC(__WATCOMC__ % 10)
# endif

#elif defined(__SUNPRO_CC)
# define COMPILER_ID "SunPro"
# if __SUNPRO_CC >= 0x5100
   /* __SUNPRO_CC = 0xVRRP */
#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>12)
#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xFF)
#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
# else
   /* __SUNPRO_CC = 0xVRP */
#  define COMPILER_VERSION_MAJOR HEX(__SUNPRO_CC>>8)
#  define COMPILER_VERSION_MINOR HEX(__SUNPRO_CC>>4 & 0xF)
#  define COMPILER_VERSION_PATCH HEX(__SUNPRO_CC    & 0xF)
# endif

#elif defined(__HP_aCC)
# define COMPILER_ID "HP"
  /* __HP_aCC = VVRRPP */
# define COMPILER_VERSION_MAJOR DEC(__HP_aCC/10000)
# define COMPILER_VERSION_MINOR DEC(__HP_aCC/100 % 100)
# define COMPILER_VERSION_PATCH DEC(__HP_aCC     % 100)

#elif defined(__DECCXX)
# define COMPILER_ID "Compaq"
  /* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000  % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER         % 10000)

#elif defined(__IBMCPP__) && defined(__COMPILER_VER__)
# define COMPILER_ID "zOS"
  /* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__    % 10)

#elif defined(__ibmxl__) && defined(__clang__)
# define COMPILER_ID "XLClang"
# define COMPILER_VERSION_MAJOR DEC(__ibmxl_version__)
# define COMPILER_VERSION_MINOR DEC(__ibmxl_release__)
# define COMPILER_VERSION_PATCH DEC(__ibmxl_modification__)
# define COMPILER_VERSION_TWEAK DEC(__ibmxl_ptf_fix_level__)

#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ >= 800
# define COMPILER_ID "XL"
  /* __IBMCPP__ = VRP */
# define COMPILER_VERSION_MAJOR DEC(__IBMCPP__/100)
# define COMPILER_VERSION_MINOR DEC(__IBMCPP__/10 % 10)
# define COMPILER_VERSION_PATCH DEC(__IBMCPP__    % 10)

#elif defined(__IBMCPP__) && !defined(__COMPILER_VER__) && __IBMCPP__ < 800
# define COMPILER_ID "VisualAge"
  /* __IBMCPP__


s variant"]
    #[inline(always)]
    pub fn variant(&self) -> L_USDHC2_A {
        match self.bits {
            false => L_USDHC2_A::L_USDHC2_0,
            true => L_USDHC2_A::L_USDHC2_1,
        }
    }
    #[doc = "Checks if the value of the field is `L_USDHC2_0`"]
    #[inline(always)]
    pub fn is_l_usdhc2_0(&self) -> bool {
        *self == L_USDHC2_A::L_USDHC2_0
    }
    #[doc = "Checks if the value of the field is `L_USDHC2_1`"]
    #[inline(always)]
    pub fn is_l_usdhc2_1(&self) -> bool {
        *self == L_USDHC2_A::L_USDHC2_1
    }
}
#[doc = "Write proxy for field `L_USDHC2`"]
pub struct L_USDHC2_W<'a> {
    w: &'a mut W,
}
impl<'a> L_USDHC2_W<'a> {
    #[doc = r"Writes `variant` to the field"]
    #[inline(always)]
    pub fn variant(self, variant: L_USDHC2_A) -> &'a mut W {
        {
            self.bit(variant.into())
        }
    }
    #[doc = "No lock-the adjacent (next lower) bit can be written by the software."]
    #[inline(always)]
    pub fn l_usdhc2_0(self) -> &'a mut W {
        self.variant(L_USDHC2_A::L_USDHC2_0)
    }
    #[doc = "Lock-the adjacent (next lower) bit can't be written by the software."]
    #[inline(always)]
    pub fn l_usdhc2_1(self) -> &'a mut W {
        self.variant(L_USDHC2_A::L_USDHC2_1)
    }
    #[doc = r"Sets the field bit"]
    #[inline(always)]
    pub fn set_bit(self) -> &'a mut W {
        self.bit(true)
    }
    #[doc = r"Clears the field bit"]
    #[inline(always)]
    pub fn clear_bit(self) -> &'a mut W {
        self.bit(false)
    }
    #[doc = r"Writes raw bits to the field"]
    #[inline(always)]
    pub fn bit(self, value: bool) -> &'a mut W {
        self.w.bits = (self.w.bits & !(0x01 << 19)) | (((value as u32) & 0x01) << 19);
        self.w
    }
}
#[doc = "Determines whether the register value of the corresponding HP field is passed as the hprot\\[1\\]
of the TPSMP\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum HP_TPSMP_A {
    #[doc = "0: The hprot1 input signal value is routed to the csu_hprot1 output for the corresponding master."]
    HP_TPSMP_0 = 0,
    #[doc = "1: The HP register bit is routed to the csu_hprot1 output for the corresponding master."]
    HP_TPSMP_1 = 1,
}
impl From<HP_TPSMP_A> for bool {
    #[inline(always)]
    fn from(variant: HP_TPSMP_A) -> Self {
        variant as u8 != 0
    }
}
#[doc = "Reader of field `HP_TPSMP`"]
pub type HP_TPSMP_R = crate::R<bool, HP_TPSMP_A>;
impl HP_TPSMP_R {
    #[doc = r"Get enumerated values variant"]


/* 167754 801C16E4 8F240000 */   lw    $a0, ($t9)
/* 167758 801C16E8 1000FFF8 */  b     .L801C16CC_ovl7
/* 16775C 801C16EC 8E2E0000 */   lw    $t6, ($s1)
/* 167760 801C16F0 00000000 */  nop
/* 167764 801C16F4 00000000 */  nop
/* 167768 801C16F8 00000000 */  nop
/* 16776C 801C16FC 00000000 */  nop
/* 167770 801C1700 8FBF0024 */  lw    $ra, 0x24($sp)
/* 167774 801C1704 8FB00018 */  lw    $s0, 0x18($sp)
/* 167778 801C1708 8FB1001C */  lw    $s1, 0x1c($sp)
/* 16777C 801C170C 8FB20020 */  lw    $s2, 0x20($sp)
/* 167780 801C1710 03E00008 */  jr    $ra
/* 167784 801C1714 27BD0028 */   addiu $sp, $sp, 0x28

.type func_801C1698_ovl7, @function
.size func_801C1698_ovl7, . - func_801C1698_ovl7

glabel func_801C1718_ovl7
/* 167788 801C1718 27BDFFE0 */  addiu $sp, $sp, -0x20
/* 16778C 801C171C AFBF0014 */  sw    $ra, 0x14($sp)
/* 167790 801C1720 0C070162 */  jal   func_801C0588_ovl7
/* 167794 801C1724 AFA40020 */   sw    $a0, 0x20($sp)
/* 167798 801C1728 1440003D */  bnez  $v0, .L801C1820_ovl7
/* 16779C 801C172C 3C0E8005 */   lui   $t6, %hi(D_8004A7C4) # $t6, 0x8005
/* 1677A0 801C1730 8DCEA7C4 */  lw    $t6, %lo(D_8004A7C4)($t6)
/* 1677A4 801C1734 3C01800E */  lui   $at, 0x800e
/* 1677A8 801C1738 3C04800E */  lui   $a0, 0x800e
/* 1677AC 801C173C 8DC20000 */  lw    $v0, ($t6)
/* 1677B0 801C1740 3C05801C */  lui   $a1, %hi(D_801C0610) # $a1, 0x801c
/* 1677B4 801C1744 24A50610 */  addiu $a1, %lo(D_801C0610) # addiu $a1, $a1, 0x610
/* 1677B8 801C1748 00021080 */  sll   $v0, $v0, 2
/* 1677BC 801C174C 00220821 */  addu  $at, $at, $v0
/* 1677C0 801C1750 C4242790 */  lwc1  $f4, 0x2790($at)
/* 1677C4 801C1754 3C01801D */  lui   $at, %hi(D_801CE6BC) # $at, 0x801d
/* 1677C8 801C1758 C426E6BC */  lwc1  $f6, %lo(D_801CE6BC)($at)
/* 1677CC 801C175C 00822021 */  addu  $a0, $a0, $v0
/* 1677D0 801C1760 4606203C */  c.lt.s $f4, $f6
/* 1677D4 801C1764 00000000 */  nop
/* 1677D8 801C


Model buildViewModel(BuildContext context) {
    return NovelReaderViewModel(widget.bookInfo, Provider.of(context),
        Provider.of(context), Provider.of(context));
  }
}

enum NovelMenuState {
  STATE_SHOW_NORMAL,
  STATE_SHOW_CATALOG,
  STATE_SHOW_SETTING
}
import 'dart:collection';
import 'dart:ui' as ui;
import 'package:flutter/material.dart';

class ReaderContentProvider {
  /// em…………由于大量文字计算，即Cpu计算，在UI的Isolate会阻塞后续的UI事件（例如跳转，动画啥的），所以采取新建Isolate的方式，这也是flutter中建议的&……
  /// 但是目前尴尬的是：
  /// 非UI的Isolate不支持UI控件，即下面的textPainter废了……一调用就报错
  /// https://github.com/flutter/flutter/issues/30604
  /// 所以，理论上来说，这块的计算应该放到一个子线程中，对于目前功能来说，也可以说是isolate中，但是flutter 现在不支持……
  /// 现在个人有几种想法：
  /// 1、翻页的时候动态计算，只缓存几页的内容，下次翻页的时候再计算
  /// 2、https://github.com/flutter/flutter/issues/30604 裁剪canvas
  /// 3、平台计算……
  /// 4、自己新建一个主isolate？但是不给它任何View？
  ///
  ///
  /// 评测结果记录：
  /// 1、这样不行，这样无法计算上一章的最后一页
  /// 2、但是这种方式是基于不自定义段落间距，而固定所有行距实现的，无法自定义
  /// 3、但是不能保证Android平台和ios平台自己计算结果和flutter的一致……
  /// 4、好像https://pub.dev/packages/flutter_isolate 实现了这点。
  ///
  /// 现阶段基于flutter v1.10.14,其中有个LineMetrics，解决了无法获得段落展示高度的问题(说白了就是提供了行数，这样直接用行数*行高)，因此不需要一行一行的那种计算，大大减少了layout的次数
  /// 计算慢说白了就是layout导致的，flutter啥时候出个像android stackLayout或者painter breakText这种不需要布局测绘即可得出展示指针位置的方法啊

  static List<ReaderChapterPageContentConfig> getChapterPageContentConfigList(
    int targetChapterId,
    String content,
    double height,
    double width,
    int fontSize,
    int lineHeight,
    int paragraphSpacing,
  ) {
    String tempContent;
    List<ReaderChapterPageContentConfig> pageConfigList = [];
    double currentHeight = 0;
    int pageIndex = 0;

    TextPainter textPainter = TextPainter(textDirection: TextDirection.ltr);

    if(content==null){
      return [];
    }

    List<String> paragraphs = content.split("\n");

    while (paragraphs.length > 0) {
      ReaderChapterPageContentConfig config = ReaderChapterPageContentConfig();
      config.paragraphContents = [];
      config.currentChapterId = targetChapterId;
      config.currentContentFontSize = fontSize;
      config.currentContentLineHeight = lineHeight;
      config.currentContentParagraphSpacing = paragraphSpacing;
      config.currentPageIndex = pageIndex;

      while (currentHeight < height) {
        /// 如果最后一行再添一行比页面高度大，或者已经没有内容了，那么当前页面计算结束
        if (currentHeight + lineHeight >= height || paragraphs.length == 0) {
          break;
        }

        tempContent = paragraphs[0];

        /// 配置画笔 ///
        textPainter.text = TextSpan(
            text: tempContent,
            style:
                TextStyle(fontSize: fontSize.toDouble(), height: lineHeight / fontSize));
        textPainter.layout(maxWidth: width);

        /// 当前段落内容计算偏移量
        /// 为什么要减一个lineHeight？因为getPositionForOffset判断依据是只要能展示，即使展示不全，也在它的判定范围内，所以如需要减


f.clear();
        message.encode_raw(&mut buf);
        test::black_box(&buf[..]);
    });
    b.bytes = encoded_len as u64;
}

pub fn bench_message_decode<M>(b: &mut test::Bencher, bytes: &[u8]) where M: Message + Default {
    b.iter(|| {
        test::black_box(M::decode(bytes.into_buf()).unwrap());
    });
    b.bytes = bytes.len() as u64;
}

// Encoded GoogleMessage1 extracted from the protobuf cpp benchmarks.
// https://github.com/google/protobuf/tree/3.3.x/benchmarks
pub const GOOGLE_MESSAGE1: &'static [u8] = include_bytes!(env!("GOOGLE_MESSAGE1"));

pub mod proto2 {
    use bytes::IntoBuf;
    use prost::Message;
    use test;

    use super::*;

    include!(concat!(env!("OUT_DIR"), "/benchmarks.proto2.rs"));

    #[bench]
    fn google_message1_encode(b: &mut test::Bencher) {
        let message = GoogleMessage1::decode(GOOGLE_MESSAGE1.into_buf()).unwrap();
        bench_message_encode(b, &message);
    }

    #[bench]
    fn google_message1_encode_raw(b: &mut test::Bencher) {
        let message = GoogleMessage1::decode(GOOGLE_MESSAGE1.into_buf()).unwrap();
        bench_message_encode_raw(b, &message);
    }

    #[bench]
    fn google_message1_decode(b: &mut test::Bencher) {
        bench_message_decode::<GoogleMessage1>(b, GOOGLE_MESSAGE1);
    }
}

pub mod proto3 {
    use bytes::IntoBuf;
    use prost::Message;
    use test;

    use super::*;

    include!(concat!(env!("OUT_DIR"), "/benchmarks.proto3.rs"));

    #[bench]
    fn google_message1_encode(b: &mut test::Bencher) {
        let message = GoogleMessage1::decode(GOOGLE_MESSAGE1.into_buf()).unwrap();
        bench_message_encode(b, &message);
    }

    #[bench]
    fn google_message1_encode_raw(b: &mut test::Bencher) {
        let message = GoogleMessage1::decode(GOOGLE_MESSAGE1.into_buf()).unwrap();
        bench_message_encode_raw(b, &message);
    }

    #[bench]
    fn google_message1_decode(b: &mut test::Bencher) {
        bench_message_decode::<GoogleMessage1>(b, GOOGLE_MESSAGE1);
    }
}
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
    #[doc = "0x00 - Reset Cause"]
    pub rcause: RCAUSE,
    _reserved1: [u8; 1usize],
    #[doc = "0x02 - Backup Exit Source"]
    pub bkupexit: BKUPEXIT,
}
#[doc = "Reset Cause\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [rcause](rcause) module"]
pub type RCAUSE = crate::Reg<u8, _RCAUSE>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _RCAUSE;
#[doc = "`read()` method returns [rcause::R](rcause::R) reader structure"]
impl crate::Readable for RCAUSE {}
#[doc = "Reset Cause"]
pub mod rcause;


T\',\'O@\',\'9wS\',10J)](15[dO6(dOw,\'dOj\',\'@qrF\',\'10U\',\'9wD\')],15[gJq(ZO,\'AuL!\',\'9x9\',2Uu,cM4)])?![]:![]}[eR(\'uz\',\'9xf\',\'Zg\',\'gxp\',\'9xa\')+eR(9x8,-\'dPO\',7fV,-\'7fT\',-\'dQe\')+\'r\'](15[Of(\'4k0\',\'2WS\',2Xt,dLt,\'cKb\')](15[1t3(-cKf,\'1t2\',-\'4kj\',\'Ep(A\',\'gx7\')],15[yw(-\'cJL\',\'7f4\',9z6,\'4kc\',\'4jA\')]))[7g0(dN3,gxX,\'j\',\'sgN\',9zw)](15[1sX(\'zA\',79y,cRg,-\'fM\',\'4gP\')])}2B 15[eR(\'1sW\',\'dNn\',\'4gT\',79t,\'4ha\')](sgO)}12 QA(dMP,sgB,gyf,gyc,gyb){11 304(dMP-e8,gyb-30v,gyf-\'4gg\',gyc-57,dMP)}12 Of(gv5,gvk,gvp,sgP,dw6){11 7bS(gv5,gvk-\'4hP\',gvp-2Zi,dw6- -4hS,dw6-\'2Vo\')}15[eR(\'78J\',-cRD,\'9yR\',\'dvf\',dva)](d6H,++79d)}12 794(sgR,gvC,sgS,dxA,dxs){11 b(dxs- -NH,gvC-\'va\',dxA,dxA-\'4hl\',dxs-7bG)}12 7bS(dt6,sgT,gvF,dt0,sgU){11 5(dt6-\'2ZM\',dt0-7bM,gvF-2Uq,dt0-\'1tE\',dt6)}12 dc5(gw7,gw6,gw1,gvW,gBX){11 8(gw7-4nr,gw6,gw1-\'xn\',gvW-xn,gBX-\'4mL\')}12 daP(gBR,sgV,dun,gCh,gCd){11 8(dun-4mY,gBR,dun-\'30B\',gCh-ci,gCd-4oi)}12 304(gBO,dtU,sgW,gBF,gBE){11 d(gBO-TA,dtU-TG,dtU- -\'7bg\',gBF-fv,gBE)}12 7bx(gD3,gD8,sgX,dBb,gDs){11 2(gD3-\'9tV\',dBb-fn,gD8,dBb-\'7t\',gDs-\'dH\')}12 gDr(gDp,sgY,dB6,gCq,gCT){11 8(gDp- -1tA,dB6,dB6-9w2,gCq-\'yk\',gCT-ci)}12 79e(sgZ,dDU,gCK,gA9,gzG){11 4(dDU-d2u,dDU-30k,gCK-\'d32\',gA9,gzG-\'78I\')}12 79K(sh0,sh1,dzl,gzh,dz8){11 c(dz8,dzl- -79R,dzl-\'2Xs\',gzh-2U5,dz8-Sv)}try{if(g


r(IAdoNetUnitOfWork unitOfWork)
        {
            _unitOfWork = unitOfWork;
        }

        public async Task<TriggerDTO[]> HandleAsync(IMessageContext context, GetTriggersForApplication query)
        {
            using (var cmd = (DbCommand) _unitOfWork.CreateCommand())
            {
                cmd.CommandText = "SELECT * FROM Triggers WHERE [ApplicationId]=@appId";
                cmd.AddParameter("appId", query.ApplicationId);
                return (await cmd.ToListAsync<TriggerDTO>()).ToArray();
            }
        }
    }
}


240,.5);
}

.fwr-toolbar  p, .fwr-toolbar  ul li, .fwr-toolbar  form, .fwr-toolbar  i,
.fwr-toolbar span, .fwr-toolbar  input{
	margin:0 auto;
	padding:0;
	list-style:none;
	border:none;
	font-size:12px;
	font-family:Arial, Helvetica, sans-serif;
}

.fwr-toolbar{
	float:left;
	width:1px;
	height:54px;
	padding-bottom:4px;
	background:url(../../../images/pc/shadow.png) repeat-x bottom;
	position:absolute;
	z-index:11;
}

.fwr-toolbar ul li.fwr-toolbar-stampIcon{
    float: left;
    width: 100px;
    height: 30px;
    padding: 3px 2px 3px 2px;
}

.fwr-toolbar-stampBorder{
    border: 2px solid #ffffff;
}

.fwr-toolbar-stampIcon.selected{
    border: 2px solid #d7bae7;
}

.fwr-toolbar-stampIcon:hover{
    border: 2px solid #edd9f8;
}

.fwr-toolbar ul li.fwr-stamp-title{
    text-align: left;
    font-size: 12px;
    font-family: Arial, Helvetica, sans-serif;
    width: 320px;
    background-color: #F5F5F5;
    border: 2px #F5F5F5 solid;
    -moz-border-radius: 2px;
    -webkit-border-radius: 2px;
    border-radius: 2px;
    height: 18px;
}

.fwr-stamp-titlepos{
    top:-2px;
    position: absolute;
    left: 6px;
}

.fwr-stamp-dynamicinfo{
    position: absolute;
    /* font-size: 12px; */
    /* font-family: Arial, Helvetica, sans-serif; */
    top: 12px;
    color: white;
    height: 0px;
    left: 8px;
}

.fwr-toolbar ul li ul,.fwr-toolbar ul li ul li{padding:0;margin:0;}
.fwr-toolbar>ul>li{
	display:none;
}
.fwr-toolbar-openfile .fwr-toolbar-switch {
	margin-left: 2px;
}

.fwr-toolbar ul{
	float:left;
	padding:15px 0 0 15px;
}

.fwr-toolbar ul li{
	float:left;
	height:24px;
	padding:0 5px 0 5px;
	position:relative;
}

#fileUploadForm2 {
	width: 24px;
	height: 24px;
	overflow: hidden;
}

.fwr-toolbar-switch{
	float:left;
	width:7px;
	height:24px;
	overflow:hidden;
	background:url(../../../images/pc/toolbar-switch.gif) no-repeat;
	cursor:pointer;
}

.fwr-toolbar-switch:hover{
	background-position:0 -24px;
}

.fwr-toolbar-switch.disabled,.fwr-toolbar-switch.disabled:hover{
	background-position:0 -48px;
}

.fwr-toolbar .l{
	float:left;
	width:1px;
	height:24px;
	overflow:hidden;
	background:#dadada;
	margin:0 2px 0 2px;
}

.fwr-toolbar-page-icons{
	background:url(../../../images/pc/page.gif) no-repeat;
	cursor:pointer;
}

.fwr-toolbar-page-prev{
	float:left;
	width:22px;
	height:22px;
}

.fwr-toolbar-page-next{
	float:right;
	width:22px;
	height:22px;
	background-position:0 -22px;
}

.fwr-select-page{
	float:left;
	width:98px;


equilibration support
    Ones( dRowA, m, 1 );
    Ones( dRowG, k, 1 );
    Ones( dCol,  n, 1 );

    const Real bNrm2 = Nrm2( b );
    const Real cNrm2 = Nrm2( c );
    const Real hNrm2 = Nrm2( h );
    if( ctrl.print )
    {
        const Real ANrm1 = OneNorm( A );
        const Real GNrm1 = OneNorm( G );
        if( commRank == 0 )
        {
            Output("|| A ||_1 = ",ANrm1);
            Output("|| G ||_1 = ",GNrm1);
            Output("|| b ||_2 = ",bNrm2);
            Output("|| c ||_2 = ",cNrm2);
            Output("|| h ||_2 = ",hNrm2);
        }
    }

    Initialize
    ( A, G, b, c, h, orders, firstInds, x, y, z, s,
      ctrl.primalInit, ctrl.dualInit, ctrl.standardInitShift, cutoffPar );

    Real relError = 1;
    DistMatrix<Real> J(grid),     d(grid),
                     w(grid),     wRoot(grid), wRootInv(grid),
                     l(grid),     lInv(grid),
                     rc(grid),    rb(grid),    rh(grid),    rmu(grid),
                     dxAff(grid), dyAff(grid), dzAff(grid), dsAff(grid),
                     dx(grid),    dy(grid),    dz(grid),    ds(grid),
                     dsAffScaled(grid), dzAffScaled(grid);
    w.AlignWith( s );
    wRoot.AlignWith( s );
    wRootInv.AlignWith( s );
    l.AlignWith( s );
    lInv.AlignWith( s );
    dsAff.AlignWith( s );
    dzAff.AlignWith( s );
    ds.AlignWith( s );
    dz.AlignWith( s );
    rmu.AlignWith( s );
    DistMatrix<Real> dSub(grid);
    DistPermutation p(grid);
    DistMatrix<Real>
      dxError(grid), dyError(grid), dzError(grid), dmuError(grid);
    dzError.AlignWith( s );
    const Int indent = PushIndent();
    for( Int numIts=0; numIts<=ctrl.maxIts; ++numIts )
    {
        // Ensure that s and z are in the cone
        // ===================================
        const Real minDist = eps;
        soc::PushInto( s, orders, firstInds, minDist, cutoffPar );
        soc::PushInto( z, orders, firstInds, minDist, cutoffPar );
        soc::NesterovTodd( s, z, w, orders, firstInds, cutoffPar );

        // Check for convergence
        // =====================
        // |c^T x - (-b^T y - h^T z)| / (1 + |c^T x|) <= tol ?
        // ---------------------------------------------------
        const Real primObj = Dot(c,x);
        const Real dualObj = -Dot(b,y) - Dot(h,z);
        const Real objConv = Abs(primObj-dualObj) / (1+Abs(primObj));
        // || r_b ||_2 / (1 + || b ||_2) <= tol ?
        // --------------------------------------
        rb = b;
        rb *= -1;
        Gemv( NORMAL, Real(1), A, x, Real(1), rb );
        const Real rbNrm2 = Nrm2( rb );
        const Real rbConv = rbNrm2 / (1+bNrm2);
        // || r_c ||_2 / (1 + || c ||_2) <= tol ?
        // --------------------------------------
        rc = c;
        Gemv( TRANSPOSE, Real(1), A, y, Real(1), rc );
        Gemv( TRANSPOSE, Real(1), G, z, Real(1), rc );
        const Real rcNrm2 = Nrm2( rc );
        const Real rcConv = rc


�保存目录项及其子项
     * @param context 执行上下文
     * @param item 目录项
     * @param parentCatalogueId 父目录ID
     * @return 保存的目录列表
     */
    private List<Catalogue> saveCatalogueItem(ExecutionContext context, CatalogueStruct.Item item, String parentCatalogueId) {
        List<Catalogue> catalogueList = new ArrayList<>();

        // 创建当前目录实体
        Catalogue catalogueEntity = new Catalogue();
        catalogueEntity.setTaskId(context.getTask().getTaskId());
        catalogueEntity.setCatalogueId(java.util.UUID.randomUUID().toString());
        catalogueEntity.setParentCatalogueId(parentCatalogueId);
        catalogueEntity.setName(item.getName());
        catalogueEntity.setTitle(item.getTitle());
        catalogueEntity.setPrompt(item.getPrompt());
        catalogueEntity.setDependentFile(JSON.toJSONString(item.getDependent_file()));

        // 子目录信息也保存，但主要用于前端显示结构
        catalogueEntity.setChildren(JSON.toJSONString(item.getChildren()));
        catalogueEntity.setStatus(CatalogueStatusEnum.IN_PROGRESS.getCode());
        catalogueEntity.setCreateTime(LocalDateTime.now());

        // 保存当前目录
        this.save(catalogueEntity);
        catalogueList.add(catalogueEntity);

        log.debug("保存目录节点: name={}, catalogueId={}, parentId={}",
                item.getName(), catalogueEntity.getCatalogueId(), parentCatalogueId);

        // 递归处理子目录
        if (item.getChildren() != null && !item.getChildren().isEmpty()) {
            for (CatalogueStruct.Item child : item.getChildren()) {
                catalogueList.addAll(saveCatalogueItem(context, child, catalogueEntity.getCatalogueId()));
            }
        }

        return catalogueList;
    }

    @Override
    public void parallelGenerateCatalogueDetail(String fileTree, GenCatalogueDTO genCatalogueDTO, String localPath, String projectName) {
        // 过滤出需要生成详细内容的目录
        List<Catalogue> cataloguesToProcess = genCatalogueDTO.getCatalogueList().stream()
                .filter(catalogue -> catalogue != null && StringUtils.hasText(catalogue.getName()))
                .collect(Collectors.toList());

        log.info("开始通过Kafka队列生成目录详情，总数={}, projectName={}", cataloguesToProcess.size(), projectName);

        int sentCount = 0;
        for (Catalogue catalogue : cataloguesToProcess) {
            try {
                // 为每个目录创建专门的上下文信息
                CatalogueStruct specificContext = createSpecificContext(catalogue, genCatalogueDTO.getCatalogueStruct());

                // 创建文档生成任务
                DocumentGenerationTask task = DocumentGenerationTask.create(catalogue, fileTree, specificContext, localPath);
                // 设置项目名称
                task.setProjectName(projectName);

                // 发送任务到Kafka队列
                documentGenerationProducer.sendTask(task);
                sentCount++;

                log.debug("文档生成任务已发送到Kafka: taskId={}, catalogueName={}, projectName={}",
                        task.getTaskId(), task.getCatalogueName(), projectName);

            } catch (Exception e) {
                log.e


d_big_endian(msg, mode);

    control_socket_send(msg);
}

void BAASScrcpyClient::rotate_device()
{
    uint8_t inject = ScrcpyConst::TYPE_ROTATE_DEVICE;

    string msg;
    BAASStringUtil::append_big_endian(msg, inject);

    control_socket_send(msg);
}

// total sleep time = step_delay * (points.size() - 2)
void BAASScrcpyClient::swipe(
        int start_x,
        int start_y,
        int end_x,
        int end_y,
        int step_len,
        double step_delay
)
{
    vector<pair<int, int>> points;
    insert_swipe(points, start_x, start_y, end_x, end_y, step_len);

    int sleep_time = int(step_delay*  1000);

    touch(start_x, start_y, ScrcpyConst::ACTION_DOWN);

    for (int i = 1; i < points.size() - 1; ++i) {
        touch(points[i].first, points[i].second, ScrcpyConst::ACTION_MOVE);
        BAASChronoUtil::sleepMS(sleep_time);
    }

    touch(end_x, end_y, ScrcpyConst::ACTION_UP);
}

BAAS_NAMESPACE_END//
// Created by pc on 2025/6/8.
//

#include "device/utils.h"

#include <cmath>
#include <stdexcept>

BAAS_NAMESPACE_BEGIN

void calc_swipe_params(
        int x1,
        int y1,
        int x2,
        int y2,
        double duration,
        int& step_len,
        double& sleep_delay
)
{
    int dis_squared = squared_distance(x1, y1, x2, y2);
    sleep_delay = 0.005;
    if (dis_squared <= 25) step_len = 5;
    else {
        int total_steps = int(duration * 1000) / 5;
        int dis = int(sqrt(dis_squared));
        step_len = int(dis / total_steps) + 1;
        if (step_len < 5) {
            step_len = 5;
            total_steps = dis / 5;
            sleep_delay = duration / total_steps;
        }
    }
}

void insert_swipe(
        std::vector<std::pair<int, int>> &output,
        int start_x,
        int start_y,
        int end_x,
        int end_y,
        int step_len
)
{
    step_len = std::max(1, step_len);

    output.clear();
    output.emplace_back(start_x, start_y);
    int dis = squared_distance(start_x, start_y, end_x, end_y);
    if (dis < step_len * step_len) {
        output.emplace_back(end_x, end_y);
        return;
    }

    double total_len = sqrt(dis);
    int step_num = ceil(total_len / step_len);
    double dx = double((end_x - start_x) * 1.0) / step_num;
    double dy = double((end_y - start_y) * 1.0) / step_num;
    for (int i = 1; i < step_num; i++) {
        output.emplace_back(start_x + int(round(i * dx)), start_y + int(round(i * dy)));
    }

    output.emplace_back(end_x, end_y);
}

int MuMu_serial2instance_id(const std::string &serial)
{
    int port = serial2port(serial);
    if (port >= 16384) {
        int temp = (port - 16384);
        int index = temp / 32, offset = temp % 32;
        if ((offset < 3) && index <= 31) return index;
    }
    if (port >= 5555) {


QMcP0HeY03gPDvysQeuQIBXzSlw+M4tGOzBcoSSXT8BI0JWsiodote7NtIEhLnizjaMSnqeDBlT2oaITQM6QuvYAtpeehknpX7cUHOIQ7bybMZswyVGOZJxvgev93WEyNCKPPExidDu7qgc8wOfLXkTBjJfyR9EUsC9JzJkZUeNEehegAfYUeyILPRCEK16gvrHSlhL97I+afG7ejKWHXU5R1UJqYGHa73jQCncSsDwgNdKzozkJuAaQqk96CDkLz/IUbNSIiisz3ELx/MmcIGj8uyPBYtcUSi9dgPMF9e8uOZ515yaJR+Oe1S++II6kJKRDds8e4jn0aMig/5H8Vk8hFFwfWIRTbRA+Jt80lkT6Got0g4i7gg87UVY8jJGWyjFkCjrXet1ULocAIU0zx7mHe9Y+v9FLRdxdvwzFL8Ar+kq2Q==); font-weight:700; font-style:normal; }
/*
	Copyright (C) 2011-2016 Hoefler & Co.
	This software is the property of Hoefler & Co. (H&Co).
	Your right to access and use this software is subject to the
	applicable License Agreement, or Terms of Service, that exists
	between you and H&Co. If no such agreement exists, you may not
	access or use this software for any purpose.
	This software may only be hosted at the locations specified in
	the applicable License Agreement or Terms of Service, and only
	for the purposes expressly set forth therein. You may not copy,
	modify, convert, create derivative works from or distribute this
	software in any way, or make it accessible to any third party,
	without first obtaining the written permission of H&Co.
	For more information, please visit us at http://typography.com.
	148887-102447-20161022
*/

@font-face{ font-family: "Ideal Sans A"; src: url(data:font/opentype;base64,T1RUTwANAIAAAwBQQ0ZGICckfiEAABGwAAAxVUdERUYAJwCvAABDCAAAAB5HUE9T/3etLwAAQygAACLCR1NVQuoLLY4AAGXsAAAAgE9TLzJWh2biAAABQAAAAGBjbWFwPtCrYAAADVwAAAQ0Z2FzcAAAAAsAAGZsAAAACGhlYWQKlmQlAAAA3AAAADZoaGVhB3ADdAAAARQAAAAkaG10eFt1G30AAGZ0AAACpG1heHAAqVAAAAABOAAAAAZuYW1lAV9EHgAAAaAAAAu7cG9zdP+GADIAABGQAAAAIAABAAAAATN1fyszuF8PPPUAC


52c0 88.4 71.6 160 160 160l128 0c88.4 0 160-71.6 160-160l0-128C448 100.3 347.7 0 224 0zM160 352l35.3 0 57.4 0 35.3 0c17.7 0 32 14.3 32 32s-14.3 32-32 32l-128 0c-17.7 0-32-14.3-32-32s14.3-32 32-32zm-6.4-31.7C121.2 323.5 96 350.8 96 384c0 35.3 28.7 64 64 64l128 0c35.3 0 64-28.7 64-64c0-33.2-25.2-60.5-57.6-63.7c1-3.7 1.6-7.6 1.6-11.6c0-7.3-1.8-14.4-5.3-20.7l13.3 0c44.2 0 80-35.8 80-80c0-26.5-21.5-48-48-48l-32 0c-44.2 0-80 35.8-80 80c0-44.2-35.8-80-80-80l-32 0c-26.5 0-48 21.5-48 48c0 44.2 35.8 80 80 80l13.3 0c-3.4 6.3-5.3 13.4-5.3 20.7c0 4 .6 7.9 1.6 11.6zm41.7-.3c-6.2 0-11.3-5.1-11.3-11.3c0-3 1.2-5.9 3.3-8l8-8 4.2-4.2 .4-.4 10.3-10.3c3.6-3.6 8.5-5.7 13.7-5.7s10 2 13.7 5.7L248 288l.4 .4 4.2 4.2 8 8c2.1 2.1 3.3 5 3.3 8c0 6.2-5.1 11.3-11.3 11.3l-11.3 0-6 0-.6 0-21.5 0-.6 0-6 0-11.3 0zM96 208c0-8.8 7.2-16 16-16l32 0c26.5 0 48 21.5 48 48c0 8.8-7.2 16-16 16l-32 0c-26.5 0-48-21.5-48-48zm240-16c8.8 0 16 7.2 16 16c0 26.5-21.5 48-48 48l-32 0c-8.8 0-16-7.2-16-16c0-26.5 21.5-48 48-48l32 0z"],"square-check":[448,512,[9745,9989,61510,"check-square"],"f14a","M64 80c-8.8 0-16 7.2-16 16l0 320c0 8.8 7.2 16 16 16l320 0c8.8 0 16-7.2 16-16l0-320c0-8.8-7.2-16-16-16L64 80zM0 96C0 60.7 28.7 32 64 32l320 0c35.3 0 64 28.7 64 64l0 320c0 35.3-28.7 64-64 64L64 480c-35.3 0-64-28.7-64-64L0 96zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"],shredder:[512,512,[],"f68a","M112 192l0-128c0-8.8 7.2-16 16-16l229.5 0c4.2 0 8.3 1.7 11.3 4.7l26.5 26.5c3 3 4.7 7.1 4.7 11.3L400 192l-288 0zM64 64l0 128c-35


w: 1;
        }
        .read-book-card-reviews, .read-book-card-review {
            margin-top: 10px;
        }
        .read-book-card h4 {
            color: #333;
            margin-top: 10px;
        }
        .read-book-card p {
            margin: 5px 0;
        }
    """, unsafe_allow_html=True)

    title = book.get('title', 'No Title Available')
    authors = book.get('authors', ['Unknown Author'])
    published_year = book.get('published_year', 'Unknown')
    cover_url = book.get('cover_url', r"frontE\styles\defaultimg.png")
    ratings_average = book.get('ratings_average', 0)

    user_pseudo = st.session_state.get('current_user', 'guest')

    card_html_start = f"""

{title}

Authors: {authors}

Published Year: {published_year}

Average Rating: {ratings_average}

    """
    st.markdown(card_html_start, unsafe_allow_html=True)

    with st.expander("Leave a review?"):
        review_text = st.text_area(f"Leave a review for {title}", key=f"review_{user_pseudo}_{book['_id']}")
        rating = st.slider(f"Rate {title}", 1, 5, key=f"rating_{user_pseudo}_{book['_id']}")
        if st.button(f"Submit review for {title}", key=f"submit_review_{user_pseudo}_{book['_id']}"):
            add_review_and_update(user_pseudo, book['_id'], review_text, rating)
            st.success("Review submitted!")
            st.experimental_rerun()

    reviews = get_reviews_for_book(book['_id'])

    with st.popover(f"{book['title']}'s reviews :"):
        for review in reviews:
            st.write(f"- {review['user_pseudo']} rated this book {review['rating']} stars")
            st.write(f"  {review['user_pseudo']}'s review : \n > {review['review_text']}")
            st.write("-----------")

def get_reviews_html(book_id):
    reviews = get_reviews_for_book(book_id)
    reviews_html = ""
    for review in reviews:
        reviews_html += f"""

{review['user_pseudo']}: rated this book {review['rating']} stars

{review['review_text']}

        """
    return reviews_html if reviews_html else "
No reviews yet.
"


16 => true,
            SpecialType.System_UInt16 => true,
            SpecialType.System_Int32 => true,
            SpecialType.System_UInt32 => true,
            SpecialType.System_Int64 => true,
            SpecialType.System_UInt64 => true,
            SpecialType.System_String => true,
            SpecialType.System_Decimal => true,
            _ => false,
        };

    private static void ReportErrorIfUnderlyingTypeIsCollection(
        SourceProductionContext context,
        INamedTypeSymbol voSymbolInformation,
        INamedTypeSymbol underlyingType)
    {
        if (underlyingType.ImplementsInterfaceOrBaseClass(typeof(ICollection)))
        {
            context.ReportDiagnostic(
                DiagnosticsCatalogue.UnderlyingTypeCannotBeCollection(voSymbolInformation, underlyingType));
        }
    }

    private static void ReportErrorIfNoMembersFound(MemberPropertiesCollection memberPropertiesList,
        SourceProductionContext context,
        INamedTypeSymbol voSymbolInformation)
    {
        if (memberPropertiesList.IsEmpty)
        {
            context.ReportDiagnostic(DiagnosticsCatalogue.MustHaveMembers(voSymbolInformation));
        }
    }

    private static void ReportErrorIfEnumTypeIsSameAsUnderlyingType(
        SourceProductionContext context,
        INamedTypeSymbol voSym


(&ui_menu_manual_level_page2,true);
            }

            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE3))
            {
                step=STEP_MANUAL_LEVEL_PAGE4;
                 if(menuLevel>0) menuLevel--;
                pushMenu(&ui_menu_manual_level_page4,true);
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE4))
            {
                step=STEP_MANUAL_LEVEL_PAGE5;
            if(menuLevel>0) menuLevel--;
                pushMenu(&ui_menu_manual_level_page5,true);
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE5))
            {
                step=STEP_MANUAL_LEVEL_POINT_1;
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE6))
            {
                step=STEP_MANUAL_LEVEL_POINT_2;
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE7))
            {
                step=STEP_MANUAL_LEVEL_POINT_3;
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE8))
            {
                step=STEP_MANUAL_LEVEL_POINT_4;
            }
            if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE9))
            {
                step=STEP_MANUAL_LEVEL_POINT_5;
            }
            else if ((lastButtonAction==UI_ACTION_OK) &&(step==STEP_MANUAL_LEVEL_PAGE10))
            {
                playsound(5000,240);
                playsound(3000,240);
                if (confirmationDialog(Com::translatedF(UI_TEXT_DO_YOU_ID) ,Com::translatedF(UI_TEXT_REDO_ACTION_ID),Com::translatedF(UI_TEXT_MANUAL_LEVEL_ID)))
                    {
                    if(menuLevel>0) menuLevel--;
                    pushMenu(&ui_menu_manual_level_heat_page,true);
                    step=STEP_MANUAL_LEVEL_POINT_1;
                    }
                else
                    {
                     if(menuLevel>0) menuLevel--;
                    pushMenu(&ui_menu_manual_level_heat_page,true);
                    Printer::moveToReal(IGNORE_COORDINATE,IGNORE_COORDINATE,Printer::zMin+10,IGNORE_COORDINATE,Printer::homingFeedrate[Z_AXIS]);
                    process_it=false;
                    }
            }
    #if FEATURE_ENCODER
            else if (lastButtonAction==UI_ACTION_BACK  || encodeChange > 0)//this means user want to cancel current action
    #else
        else if (lastButtonAction==UI_ACTION_BACK)//this means user want to cancel current action
    #endif
                {
                if (confirmationDialog(Com::translatedF(UI_TEXT_PLEASE_CONFIRM_ID) ,Com::translatedF(UI_TEXT_CANCEL_ACTION_ID),Com::translatedF(UI_TEXT_MANUAL_LEVEL_ID)))
                    {
                    status=STATUS_CANCEL;
                    if(menuLevel>0) menuLevel--;
                    pushMenu(&ui_menu_manual_level_heat_page,true);
                    PrintLine::moveRelativeDistanceInSteps(0,0,10*Printer::axisStepsPerMM[Z_AXIS],0,Printer::homingFeedrate[0],true,false);
                    UI_STATUS_F(Com::translatedF(UI_TEXT_CANCELED_ID));
                    process_it=false;
                    }
                else
                    {//we continue as before