dyTarget;
}

export function findActiveStringTargetInEditor(editor: TextEditor): FindActiveStringTargetResult {
    let document = editor.document;
    let language = document.languageId;

    if (supportedLanguages.indexOf(language) < 0) {
        Window.showInformationMessage('Language not supported: ' + language);
        return;
    }

    let source = document.getText();
    let selection = editor.selection;

    let result = parse(source);

    let stringTargets = result.stringTargets;
    let activeTarget = findActiveStringTarget(stringTargets, selection);

    if (!activeTarget) {
        Window.showInformationMessage('No string found at selected range.');
    }

    return {
        defaultQuote: result.defaultQuote,
        target: activeTarget
    };
}

export interface FindActiveStringTargetsResult {
    defaultQuote: string;
    targets: StringTarget[];
}

export function findActiveStringTargetsInEditor(editor: TextEditor): FindActiveStringTargetsResult {
    let document = editor.document;
    let language = document.languageId;

    if (supportedLanguages.indexOf(language) < 0) {
        Window.showInformationMessage('Language not supported.');
        return;
    }

    let source = document.getText();
    let selection = editor.selection;

    let result = parse(source);
    let stringTargets = result.stringTargets;
    let activeTargets = findActiveStringTargets(stringTargets, selection);

    if (!activeTargets) {
        Window.showInformationMessage('No string found at selected range.');
    }

    return {
        defaultQuote: result.defaultQuote,
        targets: activeTargets
    };
}
import Config from "./Config";
import DailyReportSheetReader from "./DailyReportSheetReader";
import KeyValueSheet from "./KeyValueSheet";

/**
 * 作業者に関する情報を操作するクラス
 */
export default class Worker
{
    /**
     * 現時刻の作業メンバーの情報を取得する
     *
     * @return {string[][]}
     */
    public getWorkMemberNowTime(): string[][]
    {
        const config = new Config();
        const keyValueSheetReader = new KeyValueSheet();
        const nowTime = Utilities.formatDate(new Date(), "Asia/Tokyo", config.calendarType);
        const calendar = keyValueSheetReader.find("カレンダー", config.calendarSheetKey, nowTime, 0, config.spreadsheetIdMember);
        const members = this.getWorkMember();
        const joinMembers = [];

        for (const member of members) {
            // 勤務時間外の場合はnullが返る。nullの場合は何も作業していないので作業報告者対象から除外する
            const spreadSheetReader = new DailyReportSheetReader();
            const reportNowTime = spreadSheetReader.findWorkResultByNowTime(member, calendar);
            if (reportNowTime === null) {
                continue;
            }

            joinMembers.push(member);
        }

        return joinMembers;
    }

    /**
     * 作業メンバーの情報を取得する
     *
     * @param {number} nextDayCount いくつ先の営業日のデータを対象とするかどうか
     * @return {string[][]}
     */
    public getWorkMember(nextDayCount: number = 0): string[][]
    {
        const result = [];

        // 設定値の取得
        const keyValueSheetReader = new KeyValueSheet();
        const config = new Config()

        // 営業日を取得
        const nowTime = Utilities.formatDate(new Date(), "Asia/Tokyo", config.calendarType);
        const calendar = keyValueSheetReader.find("カレンダー", config.calendarSheetKey, nowTime, nextDayCount, config.spreadsheetIdMember);

        // 対象外となるメンバーを除外する
        const rowsMemberList = keyValueSheetReader.getAll("メンバーリスト", config.spreadsheetIdMember);


*
   */
  com.google.protobuf.TimestampOrBuilder getCreateTimeOrBuilder();

  /**
   *
   *
   *

   * Output only. The time this case was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return Whether the updateTime field is set.
   */
  boolean hasUpdateTime();

  /**
   *
   *
   *

   * Output only. The time this case was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   *
   * @return The updateTime.
   */
  com.google.protobuf.Timestamp getUpdateTime();

  /**
   *
   *
   *

   * Output only. The time this case was last updated.
   *

   *
   * .google.protobuf.Timestamp update_time = 14 [(.google.api.field_behavior) = OUTPUT_ONLY];
   *
   */
  com.google.protobuf.TimestampOrBuilder getUpdateTimeOrBuilder();

  /**
   *
   *
   *

   * The user who created the case.
   *
   * Note: The name and email will be obfuscated if the case was created by
   * Google Support.
   *

   *
   * .google.cloud.support.v2beta.Actor creator = 15;
   *
   * @return Whether the creator field is set.
   */
  boolean hasCreator();

  /**
   *
   *
   *

   * The user who created the case.
   *
   * Note: The name and email will be obfuscated if the case was created by
   * Google Support.
   *

   *
   * .google.cloud.support.v2beta.Actor creator = 15;
   *
   * @return The creator.
   */
  com.google.cloud.support.v2beta.Actor getCreator();

  /**
   *
   *
   *

   * The user who created the case.
   *
   * Note: The name and email will be obfuscated if the case was created by
   * Google Support.
   *

   *
   * .google.cloud.support.v2beta.Actor creator = 15;
   */
  com.google.cloud.support.v2beta.ActorOrBuilder getCreatorOrBuilder();

  /**
   *
   *
   *

   * A user-supplied email address to send case update notifications for. This
   * should only be used in BYOID flows, where we cannot infer the user's email
   * address directly from their EUCs.
   *

   *
   * string contact_email = 35;
   *
   * @return The contactEmail.
   */
  java.lang.String getContactEmail();

  /**
   *
   *
   *

   * A user-supplied email address to send case update notifications for. This
   * should only be used in BYOID flows, where we cannot infer the user's email
   * address directly from their EUCs.
   *

   *
   * string contact_email = 35;
   *
   * @return The bytes for contactEmail.
   */
  com.google.protobuf.ByteString getContactEmailBytes();

  /**
   *
   *
   *

   * Whether the case is currently escalated.
   *

   *
   * bool escalated = 17;
   *
   * @return The escalated.
   */
  boolean getEscalated();

  /**
   *
   *
   *

   * Whether this case was created for


	if( VS(st.MessageString) )
						Add("MessageString", st.MessageString);
					Add("MessageNumber", st.MessageNumber.ToString());
				}
				else if( item is QuestTransporter )
				{
					QuestTransporter st = (QuestTransporter)item;

					Add("TeleportName", st.TeleportName);
					Add("Required", st.Required);
					if( VS(st.MessageString) )
						Add("MessageString", st.MessageString);
				}
				else if( item is KeywordTeleporter )
				{
					KeywordTeleporter kt = (KeywordTeleporter)item;

					if( VS(kt.Substring) )
						Add("Substring", kt.Substring);
					Add("Keyword", kt.Keyword.ToString());
					Add("Range", kt.Range.ToString());
				}
				Add("PointDest", tp.PointDest.ToString());
				if( tp.MapDest != null )
					Add("MapDest", tp.MapDest.ToString());
				Add("Creatures", tp.Creatures.ToString());
				Add("SourceEffect", tp.SourceEffect.ToString());
				Add("DestEffect", tp.DestEffect.ToString());
				Add("SoundID", tp.SoundID.ToString());
				Add("Delay", tp.Delay.ToString());
			}

			if( item.Light != LightType.ArchedWindowEast )
				Add("Light", item.Light.ToString());
			if( item.Hue > 0 )
				Add("Hue", item.Hue.ToString());
			if( VS(item.Name) )
				Add("Name", item.Name);
			if( item.Amount > 1 )
				Add("Amount", item.Amount.ToString());

			s = String.Format("{0} {1}", ConstructType(item), itemID);

			if( List.Count > 0 )
			{
				s += " (";
				for( int i = 0; i < List.Count; i++ )
				{
					if( List[i][1] == String.Empty )
						s += String.Format("{0}{1}", List[i][0], (i < List.Count-1 ? "; " : String.Empty));
					else
						s += String.Format("{0}={1}{2}", List[i][0], List[i][1], (i < List.Count-1 ? "; " : String.Empty));
				}
				s += ")";
			}

			List.Clear();
			return s;
		}

		public static bool VS(string s)
		{
			if( s == null || s == String.Empty )
				return false;
			return true;
		}

		public static string ConstructType(Item item)
		{
			string s = item.GetType().ToString();

			if( s.LastIndexOf('.') > -1 )
				s = s.Remove(0, s.LastIndexOf('.')+1);

			return s;
		}

		public static DoorFacing GetFacing(Point3D p)
		{
			DoorFacing facing = DoorFacing.WestCW;
			for(int i = 0; i < m_Offsets.Length; i++)
			{
				if( p == m_Offsets[i] )
				{
					facing = (DoorFacing)i;
					break;
				}
			}

			return facing;
		}
		private static Point3D[] m_Offsets = new Point3D[]
		{
			new Point3D(-1, 1, 0 ),
			new Point3D( 1, 1, 0 ),
			new Point3D(-1, 0, 0 ),
			new Point3D( 1,-1, 0 ),
			new Point3D( 1, 1, 0 ),
			new Point3D( 1,-1, 0 ),
			new Point3D( 0, 0, 0 ),
			new Point3D( 0,-1, 0 ),

			new Point3D( 0, 0, 0 ),
			new Point3D( 0, 0, 0 ),
			new Point3D( 0, 0, 0 ),
			new Point3D( 0, 0, 0 )
		};
	}
}


p(about = "Name of the program in target/deploy/<id>.so")]
        program: String,
        #[clap(short, long)]
        #[clap(about = "Network to deploy to")]
        #[clap(
            default_value = Network::Devnet.into(),
            possible_values = Network::VARIANTS
        )]
        network: Network,
        #[clap(short, long)]
        #[clap(about = "Skip the Anchor IDL upload.")]
        skip_anchor_idl: bool,
    },
}

#[derive(Debug, Clap)]
#[clap(about = crate_description!())]
#[clap(version = crate_version!())]
#[clap(author = crate_authors!())]
#[clap(setting = AppSettings::ColoredHelp)]
pub struct Opts {
    #[clap(subcommand)]
    command: SubCommand,
}

fn main_with_result() -> Result<()> {
    let opts: Opts = Opts::parse();

    match opts.command {
        SubCommand::Init => {
            if std::env::current_dir()?.join("Captain.toml").exists() {
                println!(
                    "{}",
                    "Captain.toml has already been initialized in this directory.".red()
                );
                std::process::exit(1);
            }
            if !std::env::current_dir()?.join("Cargo.toml").exists() {
                println!(
                    "{}",
                    "Cargo.toml does not exist in the current working directory. Ensure that you are at the Cargo workspace root.".red()
                );
                std::process::exit(1);
            }
            let mut cfg = Config::default();

            let deployers_root = PathBuf::from("./.captain/deployers/");
            std::fs::create_dir_all(&deployers_root)?;

            for network in &[
                Network::Mainnet,
                Network::Devnet,
                Network::Testnet,
                Network::Localnet,
            ] {
                let deployer_kp = solana_sdk::signer::keypair::Keypair::new();
                let deployer_path =
                    deployers_root.join(format!("{}/deployer.json", network.to_string()));
                solana_sdk::signer::keypair::write_keypair_file(&deployer_kp, &deployer_path)
                    .map_err(|_| format_err!("could not generate temp buffer keypair"))?;

                let networks = &mut cfg.networks;
                networks.insert(
                    network.clone(),
                    NetworkConfig {
                        deployer: CaptainPath(deployer_path),
                        url: network.url().to_string().into(),
                        ws_url: network.ws_url().to_string().into(),
                        upgrade_authority: "~/.config/solana/id.json".to_string(),
                    },
                );
            }

            let toml = toml::to_string(&cfg)?;
            let mut file = File::create("Captain.toml")?;
            file.write_all(toml.as_bytes())?;
        }
        SubCommand::Build => {
            let (_, _, root) = Config::discover()?;
            if root.join("Anchor.toml").exists() {
                println!("{}", "Anchor found! Running `anchor build -v`.".green());
                command::exec(Command::new("anchor").arg("build").arg("-v"))?;
            } else {
                println!(
                    "{}",
                    "Anchor.toml not found in workspace root. Running `cargo build-bpf`.".yellow()
                );


0, r3, lsr 6
	ldr r1, [r4, o_SoundChannel_xpi]
	cmp r0, r1
	beq _081DD594
	str r0, [r4, o_SoundChannel_xpi]
	mov r1, 0x21
	mul r2, r1, r0
	ldr r1, [r4, o_SoundChannel_wav]
	add r2, r2, r1
	add r2, r2, 0x10
	ldr r5, =sDecodingBuffer
	ldr r6, =gDeltaEncodingTable
	mov r7, 0x40
	ldrb lr, [r2], 1
	strb lr, [r5], 1
	ldrb r1, [r2], 1
	b _081DD57C
_081DD568:
	ldrb r1, [r2], 1
	mov r0, r1, lsr 4
	ldrsb r0, [r6, r0]
	add lr, lr, r0
	strb lr, [r5], 1
_081DD57C:
	and r0, r1, 0xF
	ldrsb r0, [r6, r0]
	add lr, lr, r0
	strb lr, [r5], 1
	subs r7, r7, 2
	bgt _081DD568
_081DD594:
	ldr r5, =sDecodingBuffer
	and r0, r3, 0x3F
	ldrsb r1, [r5, r0]
	pop {r0,r2,r5-r7,pc}
	.pool
	arm_func_end SoundMainRAM_Unk2
.endif

	thumb_func_start SoundMainBTM
SoundMainBTM:
	mov r12, r4
	movs r1, 0
	movs r2, 0
	movs r3, 0
	movs r4, 0
	stm r0!, {r1-r4}
	stm r0!, {r1-r4}
	stm r0!, {r1-r4}
	stm r0!, {r1-r4}
	mov r4, r12
	bx lr
	thumb_func_end SoundMainBTM

	thumb_func_start RealClearChain
RealClearChain:
	ldr r3, [r0, o_SoundChannel_track]
	cmp r3, 0
	beq _081DD5E2
	ldr r1, [r0, o_SoundChannel_nextChannelPointer]
	ldr r2, [r0, o_SoundChannel_prevChannelPointer]
	cmp r2, 0
	beq _081DD5D6
	str r1, [r2, o_SoundChannel_nextChannelPointer]
	b _081DD5D8
_081DD5D6:
	str r1, [r3, o_MusicPlayerTrack_chan]
_081DD5D8:
	cmp r1, 0
	beq _081DD5DE
	str r2, [r1, o_SoundChannel_prevChannelPointer]
_081DD5DE:
	movs r1, 0
	str r1, [r0, o_SoundChannel_track]
_081DD5E2:
	bx lr
	thumb_func_end RealClearChain

	thumb_func_start ply_fine
ply_fine:
	push {r4,r5,lr}
	adds r5, r1, 0
	ldr r4, [r5, o_MusicPlayerTrack_chan]
	cmp r4, 0
	beq ply_fine_done
ply_fine_loop:
	ldrb r1, [r4, o_SoundChannel_statusFlags]
	movs r0, SOUND_CHANNEL_SF_ON
	tst r0, r1
	beq ply_fine_ok
	movs r0, SOUND_CHANNEL_SF_STOP
	orrs r1, r0
	strb r1, [r4, o_SoundChannel_statusFlags]
ply_fine_ok:
	adds r0, r4, 0
	bl RealClearChain
	ldr r4, [r4, o_SoundChannel_nextChan


     */
    public ForeignExchangeTerms5 setQtdCcy(String value) {
        this.qtdCcy = value;
        return this;
    }

    /**
     * Gets the value of the xchgRate property.
     *
     * @return
     *     possible object is
     *     {@link BigDecimal }
     *
     */
    public BigDecimal getXchgRate() {
        return xchgRate;
    }

    /**
     * Sets the value of the xchgRate property.
     *
     * @param value
     *     allowed object is
     *     {@link BigDecimal }
     *
     */
    public ForeignExchangeTerms5 setXchgRate(BigDecimal value) {
        this.xchgRate = value;
        return this;
    }

    /**
     * Gets the value of the qtnDt property.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public OffsetDateTime getQtnDt() {
        return qtnDt;
    }

    /**
     * Sets the value of the qtnDt property.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public ForeignExchangeTerms5 setQtnDt(OffsetDateTime value) {
        this.qtnDt = value;
        return this;
    }

    /**
     * Gets the value of the qtgInstn property.
     *
     * @return
     *     possible object is
     *     {@link PartyIdentification2Choice }
     *
     */
    public PartyIdentification2Choice getQtgInstn() {
        return qtgInstn;
    }

    /**
     * Sets the value of the qtgInstn property.
     *
     * @param value
     *     allowed object is
     *     {@link PartyIdentification2Choice }
     *
     */
    public ForeignExchangeTerms5 setQtgInstn(PartyIdentification2Choice value) {
        this.qtgInstn = value;
        return this;
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.MULTI_LINE_STYLE);
    }

    @Override
    public boolean equals(Object that) {
        return EqualsBuilder.reflectionEquals(this, that);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

}

package com.prowidesoftware.swift.model.mx.dic;

import jakarta.xml.bind.annotation.XmlAccessType;
import jakarta.xml.bind.annotation.XmlAccessorType;
import jakarta.xml.bind.annotation.XmlElement;
import jakarta.xml.bind.annotation.XmlType;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * Details of the standing settlement instruction to be applied.
 *
 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "StandingSettlementInstruction13", propOrder = {
    "sttlmStgInstrDB",
    "vndr",
    "othrDlvrgSttlmPties",
    "othrRcvgSttlmPties"
})
public class StandingSettlementInstruction13 {

    @XmlElement(name = "SttlmStgInstrDB", required = true)
    protected SettlementStandingInstructionDatabase4Choice sttlmStgInstrDB;
    @XmlElement(name = "Vndr")
    protected PartyIdentification117Choice vndr;
    @XmlElement(name = "OthrDlvrgSttlmPties")
    protected SettlementParties59 othrDlvrgSttlmPties;
    @XmlElement(name


    if (state) {
            url.addQueryParameter("nsfw", "true")
        }
    }
}

class AdultContentFilter : Filter.CheckBox("Conteúdo adulto"), UrlQueryFilter {
    override fun addQueryParameter(url: HttpUrl.Builder) {
        if (state) {
            url.addQueryParameter("hentai", "true")
        }
    }
}

open class EnhancedSelect<T>(name: String, values: Array<T>) : Filter.Select<T>(name, values) {
    val selected: T
        get() = values[state]
}

data class Status(val name: String, val value: String) {
    override fun toString() = name
}

class StatusFilter(statusList: List<Status>) :
    EnhancedSelect<Status>("Status", statusList.toTypedArray()),
    UrlQueryFilter {

    override fun addQueryParameter(url: HttpUrl.Builder) {
        if (state > 0) {
            url.addQueryParameter("status", selected.value)
        }
    }
}

data class Type(val name: String, val value: String) {
    override fun toString() = name
}

class TypeFilter(typesList: List<Type>) :
    EnhancedSelect<Type>("Tipo", typesList.toTypedArray()),
    UrlQueryFilter {

    override fun addQueryParameter(url: HttpUrl.Builder) {
        if (state > 0) {
            url.addQueryParameter("type", selected.value)
        }
    }
}

class Genre(name: String, val id: String) : Filter.CheckBox(name) {
    override fun toString() = name
}

class GenreFilter(genres: List<Genre>) :
    Filter.Group<Genre>("Gêneros", genres),
    UrlQueryFilter {

    override fun addQueryParameter(url: HttpUrl.Builder) {
        state.filter(Genre::state)
            .forEach { url.addQueryParameter("genres[]", it.id) }
    }
}

val genresList: List<Genre> = listOf(
    Genre("Ação", "1"),
    Genre("Aventura", "8"),
    Genre("Comédia", "2"),
    Genre("Drama", "3"),
    Genre("Ecchi", "15"),
    Genre("Esportes", "14"),
    Genre("Fantasia", "6"),
    Genre("Hentai", "19"),
    Genre("Horror", "4"),
    Genre("Mahou shoujo", "18"),
    Genre("Mecha", "17"),
    Genre("Mistério", "7"),
    Genre("Música", "16"),
    Genre("Psicológico", "9"),
    Genre("Romance", "13"),
    Genre("Sci-fi", "11"),
    Genre("Slice of life", "10"),
    Genre("Sobrenatural", "5"),
    Genre("Suspense", "12"),
)

val statusList: List<Status> = listOf(
    Status("Todos", ""),
    Status("Finalizado", "COMPLETE"),
    Status("Em lançando", "ONGOING"),
    Status("Hiato", "HIATUS"),
    Status("Pausado", "ONHOLD"),
    Status("Planejado", "PLANNED"),
    Status("Arquivado", "ARCHIVED"),
    Status("Cancelado", "CANCELLED"),
)

val typesList: List<Type> = listOf(
    Type("Todos", ""),
    Type("Mangá", "MANGA"),
    Type("Manhwa", "MANHWA"),
    Type("Manhua", "MANHUA"),
    Type("One-shot", "ONESHOT"),
    Type("Doujinshi", "DOUJINSHI"),
    Type("Outros", "OTHER"),
)
package eu.kanade.tachiyomi.extension.pt.taosect

import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.network.POST
import eu.kanade.tachiyomi.network.interceptor.rateLimit
import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.source.model.MangasPage
import eu.kanade.tachiyomi.source.model


"puter\data" -ItemType Directory -Force
Invoke-WebRequest -Uri "https://raw.githubusercontent.com/HeyPuter/puter/main/docker-compose.yml" -OutFile "docker-compose.yml"
docker compose up
```

### ☁ Puter.com

Puter-ը հասանելի է որպես հյուրընկալվող ծառայություն [**puter.com**](https://puter.com).

## System Requirements

- **Օպերացիոն համակարգ:** Linux, macOS, Windows
- **Օպերատիվ հիշողություն:** 2GB նվազագույնը (4GB խորհուրդ է տրվում)
- **Համակարգչի հիշողություն:** 1GB ազատ տարածություն
- **Node.js:** Տարբերակ 16+ (Տարբերակ 22+ խորհուրդ է տրվում)
- **npm:** Վերջին կայուն տարբերակը

## Աջակցություն

Կապվեք համակարգողների և համայնքի հետ այս կայքերի միջոցով՝

- Սխալների կամ գործառույթի հարցում՝ (https://github.com/HeyPuter/puter/issues/new/choose).
- Discord: [discord.com/invite/PQcx7Teh8u](https://discord.com/invite/PQcx7Teh8u)
- X (Twitter): [x.com/HeyPuter](https://x.com/HeyPuter)
- Reddit: [reddit.com/r/puter/](https://www.reddit.com/r/puter/)
- Mastodon: [mastodon.social/@puter](https://mastodon.social/@puter)
- Անվտանգության խնդիրներ՝ [security@puter.com](mailto:security@puter.com)
- Email maintainers at [hi@puter.com](mailto:hi@puter.com)

Մենք միշտ ուրախ ենք օգնել ձեզ ցանկացած հարցում։ Մի կաշկանդվեք հարցնել։

##  Լիցենզիա

Այս պահոցարանը, ներառյալ բոլոր իր բովանդակո


4E8;">;

',5)])])}const m=i(s,[["render",n]]);export{l as __pageData,m as default};
import{_ as t,c as e,o as s,ae as i}from"./chunks/framework.Bffdpg9E.js";const d=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"api/extract-pg-schema.informationschemaroutine.udt_schema.md","filePath":"api/extract-pg-schema.informationschemaroutine.udt_schema.md"}'),n={name:"api/extract-pg-schema.informationschemaroutine.udt_schema.md"};function r(o,a,h,c,p,m){return s(),e("div",null,[...a[0]||(a[0]=[i('
Home > extract-pg-schema > InformationSchemaRoutine > udt_schema

InformationSchemaRoutine.udt_schema property

Applies to a feature not available in PostgreSQL

Signature:

<button title="Copy Code" class="copy"></button>typescript
udt_schema: string | null;

',5)])])}const u=t(n,[["render",r]]);export{d as __pageData,u as default};
import{_ as e,c as a,o as s,ae as i}from"./chunks/framework.Bffdpg9E.js";const h=JSON.parse('{"title":"","description":"","frontmatter":{},"headers":[],"relativePath":"api/extract-pg-schema.functiondetails.estimatedcost.md","filePath":"api/extract-pg-schema.functiondetails.estimatedcost.md"}'),c={name:"api/extract-pg-schema.functiondetails.estimatedcost.md"};function n(o,t,r,p,d,l){return s(),a("div",null,[...t[0]||(t[0]=[i('
Home > extract-pg-schema > FunctionDetails > estimatedCost

FunctionDetails.estimatedCost property <a class="header-anchor" href="#functiondetails-estimatedcost-property" aria-label="Permalink to "F


# vim: ai ts=4 sts=4 et sw=4 nu

import argparse
import os
import sys

from zimfarm_worker.common import logger
from zimfarm_worker.common.constants import (
    DEFAULT_WEB_API_URLS,
    DEFAULT_WORKDIR,
    WORKER_MANAGER,
)
from zimfarm_worker.manager.worker import WorkerManager

def main():
    parser = argparse.ArgumentParser(prog=WORKER_MANAGER)

    parser.add_argument(
        "--webapi-uri",
        help="zimfarm API URI",
        required=not bool(DEFAULT_WEB_API_URLS),
        default=[],
        dest="webapi_uris",
        action="append",
    )

    parser.add_argument(
        "--socket-uri",
        help="[obsolete] zimfarm websocket URI",
        required=False,
        dest="socket_uri",
    )

    parser.add_argument(
        "--username",
        help="username to authenticate to zimfarm",
        required=not bool(os.getenv("USERNAME")),
        default=os.getenv("USERNAME"),
    )

    parser.add_argument(
        "--workdir",
        help="directory in which workers create task-related files",
        required=not bool(DEFAULT_WORKDIR),
        default=DEFAULT_WORKDIR,
        dest="workdir",
    )

    parser.add_argument(
        "--name",
        help="name of this worker",
        dest="worker_name",
        required=not bool(os.getenv("WORKER_NAME")),
        default=os.getenv("WORKER_NAME"),
    )

    args = parser.parse_args()

    if not args.webapi_uris and DEFAULT_WEB_API_URLS:
        args.webapi_uris += DEFAULT_WEB_API_URLS

    logger.info(f"starting zimfarm {WORKER_MANAGER}.")
    try:
        manager = WorkerManager(
            username=args.username,
            webapi_uris=args.webapi_uris,
            workdir=args.workdir,
            worker_name=args.worker_name,
        )
        sys.exit(manager.run())
    except Exception as exc:
        logger.error(f"Unhandled exception: {exc}")
        logger.exception(exc)
        logger.error("exiting.")
        sys.exit(1)


#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Time    : 2023/5/11 17:45
@Author  : alexanderwu
@File    : test_write_code_review.py
"""
import pytest

from metagpt.actions.write_code_review import WriteCodeReview
from metagpt.schema import CodingContext, Document

@pytest.mark.asyncio
async def test_write_code_review(capfd, context):
    context.src_workspace = context.repo.workdir / "srcs"
    code = """
def add(a, b):
    return a +
"""
    coding_context = CodingContext(
        filename="math.py", design_doc=Document(content="编写一个从a加b的函数，返回a+b"), code_doc=Document(content=code)
    )

    await WriteCodeReview(i_context=coding_context, context=context).run()

    # 我们不能精确地预测生成的代码评审，但我们可以检查返回的是否为字符串
    assert isinstance(coding_context.code_doc.content, str)
    assert len(coding_context.code_doc.content) > 0

    captured = capfd.readouterr()
    print(f"输出内容: {captured.out}")

if __name__ == "__main__":
    pytest.main([__file__, "-s"])


"icon-remove">删除

        编号
        商品编码
        商品名称
        商品型号
        类别ID
        类别
        单位
        采购价
        出售价
        库存下限
        生产厂商
        备注

            添加
            修改
            删除

             商品名称： <input type="text" id="s_name" size="20" onkeydown="if(event.keyCode==13) searchGoods()"/>
            搜索
            友情提示:双击左侧商品类别可以按照商品类别搜索商品,输入搜索条件(商品名称)后再双击商品类别可以在该商品类别中搜索商品

    <form id="fm" method="post">

            商品类别： <input type="text" id="goodsTypeName" name="goodsTypeName" class="easyui-validatebox"
                              required="true"/>

    </form>

    保存
    关闭

    <form id="fm2" method="post" enctype="multipart/form-data">


import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import warnings
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn import linear_model

data = pd.read_csv("Melbourne_housing_FULL (1).csv")

# Get unique values across the whole DataFrame
data_unique = pd.unique(data.values.ravel())
print(data_unique[:10])
print("Total unique values:", len(data_unique))
print("Original shape:", data.shape)#(34857, 21)
print(data.columns)
cols_to_use=['Suburb', 'Address', 'Rooms', 'Type', 'Price', 'Method', 'SellerG',
       'Date', 'Distance', 'Postcode', 'Bedroom2', 'Bathroom', 'Car',
       'Landsize', 'BuildingArea', 'YearBuilt', 'CouncilArea', 'Lattitude',
       'Longtitude', 'Regionname', 'Propertycount']

print(data.isnull().sum())

cols_to_fill_zero=['Distance','Postcode','Bedroom2','Bathroom','Lattitude','Longtitude','Car',]
data[cols_to_fill_zero]=data[cols_to_fill_zero].fillna(0)
print(data.isnull().sum())
data['Landsize']=data['Landsize'].fillna(data['Landsize'].mean())
data['BuildingArea']=data['BuildingArea'].fillna(data['BuildingArea'].mean())
data['YearBuilt']=data['YearBuilt'].fillna(data['YearBuilt'].mean())
data.dropna(inplace=True)
print(data.isnull().sum())

data=pd.get_dummies(data,columns=['Suburb', 'Type', 'Method', 'SellerG', 'Date', 'CouncilArea', 'Regionname'],drop_first=True)
X=data.drop('Price',axis=1)
Y=data['Price']

X_train, X_test, Y_train, Y_test = train_test_split(X, Y, test_size=0.3, random_state=2)
reg= LinearRegression()
reg.fit(X_train, Y_train)
print("Training score:", reg.score(X_train, Y_train))

lesso_reg=linear_model.Lasso(alpha=0.1)
lesso_reg.fit(X_train,Y_train)
print("Lasso Training score:", lesso_reg.score(X_train, Y_train))
print("Lasso Test score:", lesso_reg.score(X_test, Y_test))

ridge_reg=linear_model.Ridge(alpha=0.1)
ridge_reg.fit(X_train,Y_train)
print("Ridge Training score:", ridge_reg.score(X_train, Y_train))
print("Ridge Test score:", ridge_reg.score(X_test, Y_test))


EQUEST");
        }
        WebhookConfigsDao dao = WebhookConfigsDao.get();
        try {
            dao.delete(new Integer(hookId));
            addMsgInfo("knowledge.webhook.delete.success");
        } catch (Exception e) {
            LOG.error(e.getMessage());
            addMsgError("knowledge.webhook.delete.error");
        }

        return config();
    }

    @Get(publishToken = "admin")
    @Auth(roles = "admin")
    public Boundary get() throws Exception {
        String hookId = getParam("hook_id");
        if (!StringUtils.isInteger(hookId)) {
            return send(HttpStatus.SC_400_BAD_REQUEST, "BAD_REQUEST");
        }
        WebhookConfigsDao webhookConfigDao = WebhookConfigsDao.get();
        WebhookConfigsEntity webhookConfig = webhookConfigDao.selectOnKey(new Integer(hookId));
        if (null == webhookConfig) {
            return send(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
        }
        String template = WebhookLogic.get().loadTemplate(webhookConfig);
        webhookConfig.setTemplate(template);
        setSendEscapeHtml(false);
        return send(webhookConfig);
    }
    @Post(subscribeToken = "admin")
    @Auth(roles = "admin")
    public Boundary customize() throws Exception {
        String hookId = getParam("hook_id");
        if (!StringUtils.isInteger(hookId)) {
            return send(HttpStatus.SC_400_BAD_REQUEST, "BAD_REQUEST");
        }
        WebhookConfigsDao webhookConfigDao = WebhookConfigsDao.get();
        WebhookConfigsEntity webhookConfig = webhookConfigDao.selectOnKey(new Integer(hookId));
        if (null == webhookConfig) {
            return send(HttpStatus.SC_404_NOT_FOUND, "NOT FOUND");
        }

        // 更新
        String ignoreProxy = getParam("ignoreProxy");
        if ("1".equals(ignoreProxy)) {
            webhookConfig.setIgnoreProxy(INT_FLAG.ON.getValue());
        }
        String template = getParam("template");
        if (StringUtils.isNotEmpty(template)) {
            try {
                JsonElement actual = new JsonParser().parse(new StringReader(template));
                actual.getAsJsonObject();
            } catch (Exception e) {
                // パースエラー
                return send(HttpStatus.SC_400_BAD_REQUEST, "template json parse error.");
            }
        }
        webhookConfig.setTemplate(template);
        webhookConfigDao.save(webhookConfig);
        return send("OK");
    }

}package org.support.project.knowledge.control.protect;

import java.io.IOException;
import java.util.List;
import java.util.Map;

import org.apache.commons.codec.binary.Base64;
import org.support.project.common.bean.ValidateError;
import org.support.project.common.config.INT_FLAG;
import org.support.project.common.exception.ParseException;
import org.support.project.common.log.Log;
import org.support.project.common.log.LogFactory;
import org.support.project.common.util.StringUtils;
import org.support.project.di.Container;
import org.support.project.di.DI;
import org.support.project.di.Instance;
import org.support.project.knowledge.config.AppConfig;
import org.support.project.knowledge.config.SystemConfig;
import org.support.project.knowledge.config.UserConfig;
import org.support.project.knowledge.control.Control;
import org.support.project.knowledge.logic.AccountLogic;
import org.support.project.knowledge.logic.KnowledgeAuthenticationLogic;
import org.support.project.knowledge.logic.TargetLogic;
import org.support.project.knowledge.logic.UserLogicEx;
import org.support.project.knowledge.vo.UploadFile;
import org.support.project.web.bean.LabelValue;
import org.support.project.web.bean.


cludegraphics.")}}}var p=Ft(e[0],"url").url;return""===h&&(h=(h=(h=p).replace(/^.*[\\\/]/,"")).substring(0,h.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:p})?{type:"includegraphics",mode:a.mode,alt:h,width:n,height:i,totalheight:s,src:p}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:function(t,e){var r=Tt(t.height,e),a=0;t.totalheight.number>0&&(a=Tt(t.totalheight,e)-r,a=Number(a.toFixed(2)));var n=0;t.width.number>0&&(n=Tt(t.width,e));var i={height:r+a+"em"};n>0&&(i.width=n+"em"),a>0&&(i.verticalAlign=-a+"em");var o=new R(t.src,t.alt,i);return o.height=r,o.depth=a,o},mathmlBuilder:function(t,e){var r=new ve.MathNode("mglyph",[]);r.setAttribute("alt",t.alt);var a=Tt(t.height,e),n=0;if(t.totalheight.number>0&&(n=(n=Tt(t.totalheight,e)-a).toFixed(2),r.setAttribute("valign","-"+n+"em")),r.setAttribute("height",a+n+"em"),t.width.number>0){var i=Tt(t.width,e);r.setAttribute("width",i+"em")}return r.setAttribute("src",t.src),r}}),Qt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],allowedInText:!0},handler:function(t,e){var r=t.parser,a=t.funcName,n=Ft(e[0],"size");if(r.settings.strict){var i="m"===a[1],o="mu"===n.value.unit;i?(o||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, not "+n.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):o&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:n.value}},htmlBuilder:function(t,e){return Dt.makeGlue(t.dimension,e)},mathmlBuilder:function(t,e){var r=Tt(t.dimension,e);return new ve.SpaceNode(r)}}),Qt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:function(t,e){var r=t.parser,a=t.funcName,n=e[0];return{type:"lap",mode:r.mode,alignment:a.slice(5),body:n}},htmlBuilder:function(t,e){var r;"clap"===t.alignment?(r=Dt.makeSpan([],[ue(t.body,e)]),r=Dt.makeSpan(["inner"],[r],e)):r=Dt.makeSpan(["inner"],[ue(t.body,e)]);var a=Dt.makeSpan(["fix"],[]),n=Dt.makeSpan([t.alignment],[r,a],e),i=Dt.makeSpan(["strut"]);return i.style.height=n.height+n.depth+"em",i.style.verticalAlign=-n.depth+"em",n.children.unshift(i),n=Dt.makeVList({positionType:"


88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z"></path>
			</svg>

Distributed Denial of Service (DDoS) attacks are a type of cyber attack that aim to disrupt and take down websites and other online services. When DDoS attacks succeed and websites are taken offline, it can lead to significant revenue loss and damage to reputation.

Distribution of DDoS attack types for 2023

One common way to disrupt and take down a website is to flood its servers with more traffic than it can handle. This is known as an HTTP flood attack. It is a type of DDoS attack that targets the website directly with a lot of HTTP requests. According to our last DDoS trends report, in 2023 our systems automatically mitigated 5.2 million HTTP DDoS attacks — accounting for 37% of all DDoS attacks.

Diagram of an HTTP flood attack

However, there is another way to take down websites: by targeting them indirectly. Instead of flooding the website servers, the threat actor floods the DNS servers. If the DNS servers are overwhelmed with more queries than their capacity, hostname to IP address translation fails and the website experiences an indirectly inflicted outage because the DNS server cannot respond to legitimate queries.

One notable example is the attack that targeted Dyn, a DNS provider, in October 2016. It was a devastating DDoS attack launched by the infamous Mirai botnet. It caused disruptions for major sites like Airbnb, Netflix, and Amazon, and it took Dyn an entire day to restore services. That’s a long time for service disruptions that can lead to significant reputation and revenue impact.

Over seven years later, Mirai attacks and DNS attacks are still incredibly common. In 2023, DNS attacks were the second most common attack


8aeb3683.js";import"./lodash.329a9ebf.js";import"./vue-router.9605b890.js";import"./pinia.9b4180ce.js";import"./css-color-function.32b8b184.js";import"./color.3683ba49.js";import"./clone.a10503d0.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.c50c242d.js";import"./vue-clipboard3.51d666ae.js";import"./clipboard.e9b83688.js";import"./echarts.7e912674.js";import"./zrender.754e8e90.js";import"./tslib.60310f1a.js";import"./highlight.js.7165574c.js";import"./@highlightjs.7fc78ec7.js";const f={class:"my-service"},h={key:0,class:"title px-[15px] py-[10px]"},y={key:1,class:"flex flex-wrap pt-[20px] pb-[10px]"},v={class:"mt-[7px]"},g={key:2},b={class:"ml-[10px] flex-1"},k=u({__name:"content",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},setup(o){return(w,V)=>{const d=x;return t(),e("div",f,[o.content.title?(t(),e("div",h,[r("div",null,s(o.content.title),1)])):c("",!0),o.content.style==1?(t(),e("div",y,[(t(!0),e(a,null,l(o.content.data,(i,n)=>(t(),e("div",{key:n,class:"flex flex-col items-center w-1/4 mb-[15px]"},[p(m,{width:"26px",height:"26px",src:i.image,alt:""},null,8,["src"]),r("div",v,s(i.name),1)]))),128))])):c("",!0),o.content.style==2?(t(),e("div",g,[(t(!0),e(a,null,l(o.content.data,(i,n)=>(t(),e("div",{key:n,class:"flex items-center border-b border-[#e5e5e5] h-[50px] px-[12px]"},[p(m,{width:"24px",height:"24px",src:i.image,alt:""},null,8,["src"]),r("div",b,s(i.name),1),r("div",null,[p(d,{name:"el-icon-ArrowRight"})])]))),128))])):c("",!0)])}}});const rt=_(k,[["__scopeId","data-v-a7e52d47"]]);export{rt as default};
import{H as T,I as L,w as N,J as U,t as O,K as P,L as j}from"./element-plus.ef27c94c.js";import{u as z,_ as H}from"./usePaging.c15919e0.js";import{f as E,b as I}from"./index.b60a26c4.js";import{o as J,d as K,e as Q}from"./wx_oa.29fa83b3.js";import{_ as X}from"./edit.vue_vue_type_script_setup_true_lang.70088f77.js";import{


from pymtl import *
from lizard.util.rtl.interface import Interface, UseInterface
from lizard.util.rtl.method import MethodSpec
from lizard.bitutil import clog2, clog2nz

class OneHotEncoderInterface(Interface):

  def __init__(s, noutbits, enable=False):
    s.Out = Bits(noutbits)
    s.In = clog2nz(noutbits)
    s.En = enable
    super(OneHotEncoderInterface, s).__init__([
        MethodSpec(
            'encode',
            args={
                'number': s.In,
            },
            rets={
                'onehot': s.Out,
            },
            call=enable,
            rdy=False),
    ])

class OneHotEncoder(Model):

  def __init__(s, noutbits, enable=False):
    UseInterface(s, OneHotEncoderInterface(noutbits, enable))

    for i in range(noutbits):

      if s.interface.En:

        @s.combinational
        def handle_encode(i=i):
          s.encode_onehot[i].v = s.encode_call and (s.encode_number == i)
      else:

        @s.combinational
        def handle_encode(i=i):
          s.encode_onehot[i].v = (s.encode_number == i)

  def line_trace(s):
    return "i: {} o: {}".format(s.encode_number, s.encode_onehot)


Handler  Release
		// QƃJE^fNgA0 ɂȂȂ delete this
		if(RefCount == 1)
			delete this;
		else
			RefCount--;
		return TJS_S_OK;
	}

	tjs_error TJS_INTF_METHOD GetName(
			/*out*/const tjs_char ** name)
	{
		// ̃gWV̖OԂ
		if(name) *name = TJS_W("mosaic");
		return TJS_S_OK;
	}

	tjs_error TJS_INTF_METHOD StartTransition(
			/*in*/iTVPSimpleOptionProvider *options, // option provider
			/*in*/iTVPSimpleImageProvider *imagepro, // image provider
			/*in*/tTVPLayerType layertype, // destination layer type
			/*in*/tjs_uint src1w, tjs_uint src1h, // source 1 size
			/*in*/tjs_uint src2w, tjs_uint src2h, // source 2 size
			/*out*/tTVPTransType *type, // transition type
			/*out*/tTVPTransUpdateType * updatetype, // update typwe
			/*out*/iTVPBaseTransHandler ** handler // transition handler
			)
	{
		if(type) *type = ttExchange; // transition type : exchange
		if(updatetype) *updatetype = tutDivisible;
			// update type : divisible
		if(!handler) return TJS_E_FAIL;
		if(!options) return TJS_E_FAIL;

		if(src1w != src2w || src1h != src2h)
			return TJS_E_FAIL; // src1  src2 ̃TCYvĂȂƑʖ

		// IvV𓾂
		tTJSVariant tmp;
		tjs_uint64 time;
		tjs_int maxblocksize = 30;

		if(TJS_FAILED(options->GetValue(TJS_W("time"), &tmp)))
			return TJS_E_FAIL; // time w肳ĂȂ
		if(tmp.Type() == tvtVoid) return TJS_E_FAIL;
		time = (tjs_int64)tmp;
		if(time < 2) time = 2; // ܂菬Ȑlw肷Ɩ肪N̂

		if(TJS_SUCCEEDED(options->GetValue(TJS_W("maxsize"), &tmp)))
			if(tmp.Type() != tvtVoid) maxblocksize = (tjs_int)tmp;

		// IuWFNg쐬
		*handler = new tTVPMosaicTransHandler(time, src1w, src1h, maxblocksize);

		return TJS_S_OK;
	}

} static * MosaicTransHandlerProvider;
//---------------------------------------------------------------------------
void RegisterMosaicTransHandlerProvider()
{
	// TVPAddTransHandlerProvider găgWVnhvoC_
	// o^
	MosaicTransHandlerProvider = new tTVPMosaicTransHandlerProvider();
	TVPAddTransHandlerProvider(MosaicTransHandlerProvider);
}
//---------------------------------------------------------------------------
void UnregisterMosaicTransHandlerProvider()
{
	// TVPRemoveTransHandlerProvider găgWVnhvoC_
	// o^
	TVPRemoveTransHandlerProvider(MosaicTransHandlerProvider);
	MosaicTransHandlerProvider->Release();
}
//---------------------------------------------------------------------------
#include "ncbind/ncbind.hpp


in future crawls
            "name": name,
            "fullname": reponame,
            "owner": repo_info.owner.login,
            "reputation": {
                "forks": repo_info.forks,
                "watchers": repo_info.watchers_count,
                "subscribers": repo_info.subscribers_count,
                "issues": repo_info.open_issues_count,
                "archived": repo_info.archived,
                "created": repo_info.created_at,
                "updated": repo_info.updated_at,
            },
            "repo_info": {
                "language": repo_info.language,
                "description": repo_info.description,
                "size": repo_info.size,
            },
        }

    def file_iter(self, purl: str) -> Generator[Tuple[str, str], None, None]:
        """Iterate through files in a repo."""
        # a commithash via @{commit-hashid} is expected
        reponame, commithash, baseurl = purl2repo(purl, None)

        if baseurl is None:
            baseurl = "https://github.com"

        if commithash is None:
            commithash, _ = get_latest_commit_hash_from_remote(f"{baseurl}/{reponame}")

        # create a temporary download directory
        with tempfile.TemporaryDirectory() as tmpdirname:
            repo = git.Repo.clone_from(
                f"{baseurl}/{reponame}", tmpdirname, no_checkout=True
            )

            # checkout the commit we want
            repo.git.checkout(commithash)

            # repo.commit().gpgsig
            # repo.commit().author.name
            # repo.commit().author.email
            # f'pushd {repo.working_dir}; git verify-commit {commithash}; popd'
            # (.venv) ubuntu@ip-172-31-49-92:~/src/AIRiskDatabase/tmp$ git verify-commit 72686211e2a8b78e5a5dc8c28be34eb9cfcdad4c
            # gpg: Signature made Fri Nov 25 17:11:39 2022 UTC
            # gpg:                using RSA key 4AEE18F83AFDEB23
            # gpg: Can't check signature: No public key
            # (.venv) ubuntu@ip-172-31-49-92:~/src/AIRiskDatabase/tmp$ echo $?
            # 1

            # crawl the files in this directory and yield the path for processing
            for fname in list_files_in_commit(repo.commit()):
                yield (tmpdirname, fname)

def list_files_in_commit(
    commit: git.objects.commit.Commit,
) -> Generator[str, None, None]:
    """
    Lists all the files in a repo at a given commit

    :param commit: A gitpython Commit object
    """
    stack = [commit.tree]
    while len(stack) > 0:
        tree = stack.pop()
        # enumerate blobs (files) at this level
        for b in tree.blobs:
            yield str(b.path)
        for subtree in tree.trees:
            stack.append(subtree)


 gpio_set_level(LED_GREEN_GPIO, green > 0 ? 0 : 1);
    gpio_set_level(LED_BLUE_GPIO, blue > 0 ? 0 : 1);
#else
    led_strip_set_pixel(g_strip_handle, 0, red, green, blue);
    led_strip_refresh(g_strip_handle);
#endif
#else
    g_strip_handle->set_pixel(g_strip_handle, 0, red, green, blue);
    g_strip_handle->refresh(g_strip_handle, 100);
#endif
}

static void app_driver_init(void)
{
    app_led_init();
}

static void app_bulb_ctrl_data_cb(espnow_attribute_t initiator_attribute,
                              espnow_attribute_t responder_attribute,
                              uint32_t status)
{
    ESP_LOGI(TAG, "app_bulb_ctrl_data_cb, initiator_attribute: %d, responder_attribute: %d, value: %" PRIu32 "",
             initiator_attribute, responder_attribute, status);
    /* status = 0: OFF, 1: ON, 2: TOGGLE */
    if (status != s_bulb_status) {
        s_bulb_status = !s_bulb_status; ;
        app_set_bulb_status();
        if (s_bulb_status) {
            app_led_set_color(255, 255, 255);
        } else {
            app_led_set_color(0, 0, 0);
        }
    }
}

static void app_bulb_init(void)
{
    ESP_ERROR_CHECK(espnow_ctrl_responder_bind(30 * 60 * 1000, -55, NULL));
    espnow_ctrl_responder_data(app_bulb_ctrl_data_cb);
}

static void app_espnow_event_handler(void *handler_args, esp_event_base_t base, int32_t id, void *event_data)
{
    if (base != ESP_EVENT_ESPNOW) {
        return;
    }

    switch (id) {
    case ESP_EVENT_ESPNOW_CTRL_BIND: {
        espnow_ctrl_bind_info_t *info = (espnow_ctrl_bind_info_t *)event_data;
        ESP_LOGI(TAG, "bind, uuid: " MACSTR ", initiator_type: %d", MAC2STR(info->mac), info->initiator_attribute);

        app_led_set_color(0, 255, 0);
        break;
    }

    case ESP_EVENT_ESPNOW_CTRL_BIND_ERROR: {
        espnow_ctrl_bind_error_t *bind_error = (espnow_ctrl_bind_error_t *)event_data;
        ESP_LOGW(TAG, "bind error: %s", bind_error_to_string(*bind_error));
        break;
    }

    case ESP_EVENT_ESPNOW_CTRL_UNBIND: {
        espnow_ctrl_bind_info_t *info = (espnow_ctrl_bind_info_t *)event_data;
        ESP_LOGI(TAG, "unbind, uuid: " MACSTR ", initiator_type: %d", MAC2STR(info->mac), info->initiator_attribute);

        app_led_set_color(255, 0, 0);
        break;
    }

    default:
        break;
    }
}

static esp_err_t unbind_restore_init(void)
{
    if (espnow_reboot_unbroken_count() >= UNBIND_TOTAL_COUNT) {
        ESP_LOGI(TAG, "unbind restore");
        espnow_storage_erase("bindlist");
        app_led_set_color(255, 0, 0);
        return espnow_reboot(CONFIG_ESPNOW_REBOOT_UNBROKEN_INTERVAL_TIMEOUT);
    }

    return ESP_OK;
}

void app_main(void)
{
    espnow_storage_init();
    app_driver_init();

    unbind_restore_init();

    app_get_bulb_status();
    if (s_bulb_status) {
        app_led_set_color(255, 255, 255);
    } else {
        app_led_set_color(0, 0, 0);
    }

    app_wifi_init();

    espnow_config_t espnow_config = ESPNOW_INIT_CONFIG_DEFAULT();
    espnow_init(&espnow_config);

    esp_event_handler_register(ESP_EVENT_ESPNOW, ESP_EVENT_ANY_ID, app_espnow_event_handler, NULL);

    app_bulb_init();
}


e License.
You may obtain a copy of the License at

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

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

// Package v1alpha1 contains API Schema definitions for the externaldns.k8s.io v1alpha1 API group
// +kubebuilder:object:generate=true
// +groupName=externaldns.k8s.io
package v1alpha1

import (
	"k8s.io/apimachinery/pkg/runtime/schema"
	"sigs.k8s.io/controller-runtime/pkg/scheme"
)

var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "externaldns.k8s.io", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)

func init() {
	SchemeBuilder.Register(&DNSEndpoint{}, &DNSEndpointList{})
}
/*
Copyright 2025 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

package version

var (
	// The git hash of the latest commit in the build.
	CommitSHA string

	// The build ref from the _PULL_BASE_REF from cloud build trigger.
	BuildRef string
)

const (
	// BundleVersionAnnotation is the annotation key used in the Gateway API inference extension CRDs to specify
	// the installed Gateway API inference extension version.
	BundleVersionAnnotation = "inference.networking.k8s.io/bundle-version"

	// BundleVersion is the value used for labeling the version of the gateway-api-inference-extension.
	BundleVersion = "main-dev"
)
/*
Copyright 2025 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

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

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

package main

import (
	"flag"
	"fmt"
	"os"

	"github.com/go-logr/logr"
	uberzap "go.uber.org/zap"
	"go.uber.org/zap/zapcore"
	"google.golang.org/grpc"
	healthPb "google.golang.org/grpc/health/grpc_health_v1"
	ctrl "sigs.k8s.io/controller-runtime"
	"sigs.k8s.io/controller-runtime/pkg/log/zap"
	"sigs.k8s.io/controller-runtime/pkg/manager"
	"sigs.k8s.io/controller-runtime/


html>

{{ title }}

          Periodo de tiempo
          <select id="timePeriod" [(ngModel)]="timePeriod">
            <option value="">Seleccionar periodo</option>
            <option *ngFor="let periodo of periodosTiempo" [value]="periodo.value">
              {{ periodo.label }}
            </option>
          </select>

          Año inicio
          <input type="number" id="anioInicio" [(ngModel)]="anioInicio" min="2000" max="2024">

          Semana inicio
          <input type="number" id="semanaInicio" [(ngModel)]="semanaInicio" min="1" max="52">

          Año fin
          <input type="number" id="anioFin" [(ngModel)]="anioFin" min="2000" max="2024">

          Semana fin
          <input type="number" id="semanaFin" [(ngModel)]="semanaFin" min="1" max="52">

          Departamento
          <select id="department" [(ngModel)]="department" (ngModelChange)="onDepartamentoChange()">
            <option value="">Seleccionar departamento</option>
            <option *ngFor="let dept of departamentos" [value]="dept">
              {{ dept }}
            </option>
          </select>

          Provincia
          <select id="province" [(ngModel)]="province" (ngModelChange)="onProvinciaChange()" [disabled]="!department">
            <option value="">Seleccionar provincia</option>
            <option *ngFor="let prov of provincias" [value]="prov">
              {{ prov }}
            </option>
          </select>

          Distrito
          <select id="district" [(ngModel)]="district" [disabled]="!province">
            <option value="">Seleccionar distrito</option>
            <option *ngFor="let dist of distritos" [value]="dist">
              {{ dist }}
            </option>
          </select>

        <button (click)="onSearch()" [disabled]="!(timePeriod || department || province || district)">
          Buscar
        </button>

        <google-map
          height="100%"
          width="100%"
          [center]="center"
          [zoom]="zoom"
          [options]="options"
          (mapInitialized)="onMapReady($event)">
        </google-map>

{% extends "base.html" %}
{% block title %}OverEar{% endbl


using System.Drawing;
using System.Linq;

using Duality;
using Duality.Components;
using Duality.Components.Physics;

namespace Duality.Editor.Plugins.CamView.CamViewStates
{
	public class RigidBodyEditorSelCircleShape : RigidBodyEditorSelShape
	{
		private	CircleShapeInfo	circle;

		public override Vector3 Pos
		{
			get
			{
				return this.Body.GameObj.Transform.GetWorldPoint(new Vector3(this.circle.Position));
			}
			set
			{
				value.Z = this.Body.GameObj.Transform.Pos.Z;
				this.circle.Position = this.Body.GameObj.Transform.GetLocalPoint(value).Xy;
			}
		}
		public override Vector3 Scale
		{
			get
			{
				return Vector3.One * this.circle.Radius;
			}
			set
			{
				this.circle.Radius = value.Length / MathF.Sqrt(3.0f);
			}
		}
		public override float BoundRadius
		{
			get { return this.circle.Radius * this.Body.GameObj.Transform.Scale; }
		}
		public ov


eBatch batch;
  batch.Put(Slice("foo"), Slice("bar"));
  batch.Delete(Slice("box"));
  batch.Put(Slice("baz"), Slice("boo"));
  WriteBatchInternal::SetSequence(&batch, 100);
  ASSERT_EQ(100, WriteBatchInternal::Sequence(&batch));
  ASSERT_EQ(3, WriteBatchInternal::Count(&batch));
  ASSERT_EQ("Put(baz, boo)@102"
            "Delete(box)@101"
            "Put(foo, bar)@100",
            PrintContents(&batch));
}

TEST(WriteBatchTest, Corruption) {
  WriteBatch batch;
  batch.Put(Slice("foo"), Slice("bar"));
  batch.Delete(Slice("box"));
  WriteBatchInternal::SetSequence(&batch, 200);
  Slice contents = WriteBatchInternal::Contents(&batch);
  WriteBatchInternal::SetContents(&batch,
                                  Slice(contents.data(),contents.size()-1));
  ASSERT_EQ("Put(foo, bar)@200"
            "ParseError()",
            PrintContents(&batch));
}

TEST(WriteBatchTest, Append) {
  WriteBatch b1, b2;
  WriteBatchInternal::SetSequence(&b1, 200);
  WriteBatchInternal::SetSequence(&b2, 300);
  WriteBatchInternal::Append(&b1, &b2);
  ASSERT_EQ("",
            PrintContents(&b1));
  b2.Put("a", "va");
  WriteBatchInternal::Append(&b1, &b2);
  ASSERT_EQ("Put(a, va)@200",
            PrintContents(&b1));
  b2.Clear();
  b2.Put("b", "vb");
  WriteBatchInternal::Append(&b1, &b2);
  ASSERT_EQ("Put(a, va)@200"
            "Put(b, vb)@201",
            PrintContents(&b1));
  b2.Delete("foo");
  WriteBatchInternal::Append(&b1, &b2);
  ASSERT_EQ("Put(a, va)@200"
            "Put(b, vb)@202"
            "Put(b, vb)@201"
            "Delete(foo)@203",
            PrintContents(&b1));
}

}  // namespace leveldb

int main(int argc, char** argv) {
  return leveldb::test::RunAllTests();
}
// Copyright (c) 2011 The LevelDB Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. See the AUTHORS file for names of contributors.

#include "db/version_edit.h"
#include "util/testharness.h"

namespace leveldb {

static void TestEncodeDecode(const VersionEdit& edit) {
  std::string encoded, encoded2;
  edit.EncodeTo(&encoded);
  VersionEdit parsed;
  Status s = parsed.DecodeFrom(encoded);
  ASSERT_TRUE(s.ok()) << s.ToString();
  parsed.EncodeTo(&encoded2);
  ASSERT_EQ(encoded, encoded2);
}

class VersionEditTest { };

TEST(VersionEditTest, EncodeDecode) {
  static const uint64_t kBig = 1ull << 50;

  VersionEdit edit;
  for (int i = 0; i < 4; i++) {
    TestEncodeDecode(edit);
    edit.AddFile(3, kBig + 300 + i, kBig + 400 + i,
                 InternalKey("foo", kBig + 500 + i, kTypeValue),
                 InternalKey("zoo", kBig + 600 + i, kTypeDeletion));
    edit.DeleteFile(4, kBig + 700 + i);
    edit.SetCompactPointer(i, InternalKey("x", kBig + 900 + i, kTypeValue));
  }

  edit.SetComparatorName("foo");
  edit.SetLogNumber(kBig + 100);
  edit.SetNextFile(kBig + 200);
  edit.SetLastSequence(kBig + 1000);
  TestEncodeDecode(edit);
}

}  // namespace leveldb

int main(int argc, char** argv) {
  return leveldb::test::RunAllTests();
}
// Copyright (c) 2011 The Level


 (row == w && level < h) {
                row = 0;
                level++;
            }
        }
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }
}
/*
 * Copyright (C) 2025 eccentric_nz
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */
package me.eccentric_nz.TARDIS.enumeration;

import me.eccentric_nz.TARDIS.custommodels.keys.CircuitVariant;
import org.bukkit.NamespacedKey;

import java.util.HashMap;

/**
 * @author eccentric_nz
 */
public enum GlowstoneCircuit {

    ADMIN("Server Admin Circuit", CircuitVariant.ADMIN.getKey()),
    ARS("TARDIS ARS Circuit", CircuitVariant.ARS.getKey()),
    BIO("Bio-scanner Circuit", CircuitVariant.BIO.getKey()),
    BRUSH("Brush Circuit", CircuitVariant.BRUSH.getKey()),
    CHAMELEON("TARDIS Chameleon Circuit", CircuitVariant.CHAMELEON.getKey()),
    CIRCUITS("Circuits", CircuitVariant.GALLIFREY.getKey()),
    CONVERSION("Conversion Circuit", CircuitVariant.CONVERSION.getKey()),
    DIAMOND("Diamond Disruptor Circuit", CircuitVariant.DIAMOND.getKey()),
    EMERALD("Emerald Environment Circuit", CircuitVariant.EMERALD.getKey()),
    IGNITE("Ignite Circuit", CircuitVariant.IGNITE.getKey()),
    INPUT("TARDIS Input Circuit", CircuitVariant.INPUT.getKey()),
    INVISIBILITY("TARDIS Invisibility Circuit", CircuitVariant.INVISIBILITY.getKey()),
    KNOCKBACK("Knockback Circuit", CircuitVariant.KNOCKBACK.getKey()),
    LOCATOR("TARDIS Locator Circuit", CircuitVariant.LOCATOR.getKey()),
    MATERIALISATION("TARDIS Materialisation Circuit", CircuitVariant.MATERIALISATION.getKey()),
    MEMORY("TARDIS Memory Circuit", CircuitVariant.MEMORY.getKey()),
    PAINTER("Painter Circuit", CircuitVariant.PAINTER.getKey()),
    PERCEPTION("Perception Circuit", CircuitVariant.PERCEPTION.getKey()),
    PICKUP("Pickup Arrows Circuit", CircuitVariant.PICKUP.getKey()),
    RANDOM("TARDIS Randomiser Circuit", CircuitVariant.RANDOM.getKey()),
    REDSTONE("Redstone Activator Circuit", CircuitVariant.REDSTONE.getKey()),
    RIFT("Rift Circuit", CircuitVariant.RIFT.getKey()),
    SCANNER("TARDIS Scanner Circuit", CircuitVariant.SCANNER.getKey()),
    SONIC("Sonic Oscillator", CircuitVariant.SONIC.getKey()),
    STATTENHEIM("TARDIS Stattenheim Circuit", CircuitVariant.STATTENHEIM.getKey()),
    TELEPATHIC("TARDIS Telepathic Circuit", CircuitVariant.TELEPATHIC.getKey()),
    TEMPORAL("TARDIS Temporal Circuit", CircuitVariant.TEMPORAL.getKey());

    private static final HashMap<String, GlowstoneCircuit> BY_NAME = new HashMap<>();

    static {
        for (GlowstoneCircuit glowstone : values()) {
            BY_NAME.put(glowstone.displayName, glowstone);
        }
    }

    final String displayName;
    final NamespacedKey model;


 speechSynthesis.getVoices()[currentCharacter.voice || 0];
      utterance.rate = 1;
      utterance.pitch = 1;
      utterance.volume = 1;
      backgroundAudio.volume = 0.1;
      speechSynthesis.speak(utterance);
      utterance.onend = function (event) {
        backgroundAudio.volume = maxVolume;
        utterance = null;
      }
    }

    function appendConversation(options) {
      const convo = conversationTpl.content.cloneNode(true);

      const messageContainer = convo.querySelector('.chat__conversation-board__message-container');
      const message = convo.querySelector('.chat__conversation-board__message__bubble');
      const userName = convo.querySelector('.chat__conversation-board__message__person__nickname');
      const userAvatar = convo.querySelector('.chat__conversation-board__message__person__avatar img');

      if (options.type === 'USER') {
        messageContainer.classList.add('reversed');
      }

      message.textContent = options.message;
      userName.textContent = options.character.title;
      userAvatar.src = `/images/${options.character.avatar}`;

      responseWindow.appendChild(convo);
      responseWindow.scrollTop = responseWindow.scrollHeight;
    }

    function setCharacter(character, isInitial = false) {
      currentCharacter = character;
      if (!isInitial) {
        card.style.transition = "none"; // Disable transition for immediate effect
      }

      card.style.animation = "";
      backgroundImage.style.backgroundImage = `url("/images/tunel.gif")`;
      setTimeout(() => {
          card.style.backgroundImage = `url("/images/${character.image}")`; // Updated to use character.image
          cardTitle.textContent = character.title; // Updated to use character.title
          // cardDesc.textContent = character.description; // Updated to use character.description
          card.style.transition = "background-image 0.5s ease"; // Added transition for smooth effect
          card.style.animation = "animate-rotate 0.5s ease"; // Added animation for smooth effect

          updateUrlState(character);
        }, isInitial ? 0 : 1000);

        setTimeout(() => {
          backgroundImage.style.backgroundImage = `url("/images/${character.image}")`; // Set background for the main element
        }, isInitial ? 0 : 2000);

        try {
           /*
          TODO: undo this comment once you've downloaded background music corresponding to your character
          see characters.json name field what to name a file, for example davinci.mp3
          */
          // backgroundAudio.src = `/audio/${character.name}.mp3`; // Updated to use character.name
          // backgroundAudio.volume = maxVolume;

          // backgroundAudio.play();
        } catch (error) {
          console.error("Error playing audio:", error);
        }
    }

    function updateUrlState(character) {
      const newUrl = `?character=${character.name}`;
      window.history.pushState({ path: newUrl }, '', newUrl);
    }

    function loadCharacterFromUrl() {
      const urlParams = new URLSearchParams(window.location.search);
      const characterName = urlParams.get('character');
      if (characterName) {
        const character = characters.find(c => c.name === characterName);
        if (character) {
          setCharacter(character, true);
        }
      }else {
        setCharacter(currentCharacter, true);
      }
    }

    loadCharacterFromUrl();
</script>
<html>


public function Button_Example()
{
Laya.init(640, 800);//设置游戏画布宽高。
Laya.stage.bgColor = "#efefef";//设置画布的背景颜色。
Laya.loader.load("resource/ui/button.png", Handler.create(this,onLoadComplete));//加载资源。
}
private function onLoadComplete():void
{
trace("资源加载完成！");
var button:Button = new Button("resource/ui/button.png","label");//创建一个 Button 类的实例对象 button ,并传入它的皮肤。
button.x = 100;//设置 button 对象的属性 x 的值，用于控制 button 对象的显示位置。
button.y = 100;//设置 button 对象的属性 y 的值，用于控制 button 对象的显示位置。
button.clickHandler = new Handler(this, onClickButton,[button]);//设置 button 的点击事件处理器。
Laya.stage.addChild(button);//将此 button 对象添加到显示列表。
}
private function onClickButton(button:Button):void
{
trace("按钮button被点击了！");
}
}
}
	 * @example Laya.init(640, 800);//设置游戏画布宽高、渲染模式。
Laya.stage.bgColor = "#efefef";//设置画布的背景颜色。
Laya.loader.load("resource/ui/button.png",laya.utils.Handler.create(this,loadComplete));//加载资源
function loadComplete()
{
    console.log("资源加载完成！");
    var button = new laya.ui.Button("resource/ui/button.png","label");//创建一个 Button 类的实例对象 button ,传入它的皮肤skin和标签label。
    button.x =100;//设置 button 对象的属性 x 的值，用于控制 button 对象的显示位置。
    button.y =100;//设置 button 对象的属性 y 的值，用于控制 button 对象的显示位置。
    button.clickHandler = laya.utils.Handler.create(this,onClickButton,[button],false);//设置 button 的点击事件处理函数。
    Laya.stage.addChild(button);//将此 button 对象添加到显示列表。
}
function onClickButton(button)
{
    console.log("按钮被点击了。",button);
}
	 * @example import Button=laya.ui.Button;
import Handler=laya.utils.Handler;
class Button_Example{
    constructor()
    {
        Laya.init(640, 800);
        Laya.stage.bgColor = "#efefef";//设置画布的背景颜色。
        Laya.loader.load("resource/ui/button.png", laya.utils.Handler.create(this,this.onLoadComplete));//加载资源。
    }
    private onLoadComplete()
    {
        var button:Button = new Button("resource/ui/button.png","label");//创建一个 Button 类的实例对象 button ,并传入它的皮肤。
        button.x = 100;//设置 button 对象的属性 x 的值，用于控制 button 对象的显示位置。
        button.y = 100;//设置 button 对象的属性 y 的值，用于控制 button 对象的显示位置。
        button.clickHandler = new Handler(this, this.onClickButton,[button]);//设置 button 的点击事件处理器。
        Laya.stage.addChild(button);//将此 button 对象添加到显示


 local r1 = markers.add_marker_range(1, 1, "first")
  expect_truthy(r1.success)
  local r2 = markers.add_marker_range(3, 5, "second")
  expect_truthy(r2.success)
  local group = state.get_group "default"
  MiniTest.expect.equality(2, #group.markers)
  MiniTest.expect.equality(3, group.markers[2].start_line)
  MiniTest.expect.equality(5, group.markers[2].end_line)
end

T["charwise-like explicit range spans full lines"] = function()
  local markers = require "marker-groups.markers"
  local state = require "marker-groups.state"
  setup_buffer { "A", "B", "C", "D", "E" }
  local r = markers.add_marker_range(3, 4, "visual-char")
  expect_truthy(r.success)
  local group = state.get_group "default"
  MiniTest.expect.equality(1, #group.markers)
  MiniTest.expect.equality(3, group.markers[1].start_line)
  MiniTest.expect.equality(4, group.markers[1].end_line)
end

T["reversed explicit range is normalized"] = function()
  local markers = require "marker-groups.markers"
  local state = require "marker-groups.state"
  setup_buffer { "A", "B", "C", "D", "E" }
  local res = markers.add_marker_range(4, 2, "visual-reversed")
  expect_truthy(res.success)
  local group = state.get_group "default"
  MiniTest.expect.equality(1, #group.markers)
  MiniTest.expect.equality(2, group.markers[1].start_line)
  MiniTest.expect.equality(4, group.markers[1].end_line)
end

T["consecutive explicit ranges use the latest selection range"] = function()
  local markers = require "marker-groups.markers"
  local state = require "marker-groups.state"
  setup_buffer { "A", "B", "C", "D", "E", "F" }
  local r1 = markers.add_marker_range(1, 2, "first-visual")
  expect_truthy(r1.success)
  local r2 = markers.add_marker_range(4, 5, "second-visual")
  expect_truthy(r2.success)
  local group = state.get_group "default"
  MiniTest.expect.equality(2, #group.markers)
  MiniTest.expect.equality(1, group.markers[1].start_line)
  MiniTest.expect.equality(2, group.markers[1].end_line)
  MiniTest.expect.equality(4, group.markers[2].start_line)
  MiniTest.expect.equality(5, group.markers[2].end_line)
end

T["explicit single-line results in single-line marker"] = function()
  local markers = require "marker-groups.markers"
  local state = require "marker-groups.state"
  setup_buffer { "A", "B", "C" }
  local res = markers.add_marker_range(2, 2, "visual-single")
  expect_truthy(res.success)
  local group = state.get_group "default"
  MiniTest.expect.equality(1, #group.markers)
  MiniTest.expect.equality(2, group.markers[1].start_line)
  MiniTest.expect.equality(2, group.markers[1].end_line)
end

return T


}

        }

        // Continueous CDF Sampling
        if (isInterpolateCDF == true)
        {
            for (int i = 0; i <= nDataPoint - 1; i++)
            {
                if (cdfData[i, 1] - prop >= 0)
                {
                    value = cdfData[i - 1, 0] + (cdfData[i, 0] - cdfData[i - 1, 0]) * (prop - cdfData[i - 1, 1]) / (cdfData[i, 1] - cdfData[i - 1, 1]);
                    break;
                }

            }

        }

        return value;
    }
    //===================================================================

    //===================================================================
    // Remove Value and Renormalize
    public void removePdfValue(int indexToRemove)
    {

        int nDataPoints = pdfData.GetLength(0);
        float[,] newPdfData = new float[nDataPoints - 1, 2];

        int newIndex = 0;
        float totalPDF = 0;
        for (int i = 0; i < nDataPoints; i++)
        {
            if (i != indexToRemove) {
                newPdfData[newIndex, 0] = pdfData[i, 0];
                newPdfData[newIndex, 1] = pdfData[i, 1];
                totalPDF += pdfData[i, 1];
                newIndex += 1;
            }
        }

        for (int i = 0; i < nDataPoints-1; i++)
        {
            //newPdfData[i, 0] = newPdfData[i, 0];


            .arg(++m_transactionCount).arg(QString::fromUtf8(m_request))
                            .arg(m_responseLineEdit->text()));
    m_request.clear();
}

void Dialog::activateRunButton()
{
    m_runButton->setEnabled(true);
}

void Dialog::processError(const QString &s)
{
    activateRunButton();
    m_statusLabel->setText(tr("Status: Not running, %1.").arg(s));
    m_trafficLabel->setText(tr("No traffic."));
}
// Copyright (C) 2012 Denis Shienkov <denis.shienkov@gmail.com>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include "dialog.h"

#include <QComboBox>
#include <QGridLayout>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
#include <QSerialPortInfo>
#include <QSpinBox>

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    m_transactionCount(0),
    m_serialPortLabel(new QLabel(tr("Serial port:"))),
    m_serialPortComboBox(new QComboBox),
    m_waitResponseLabel(new QLabel(tr("Wait response, msec:"))),
    m_waitResponseSpinBox(new QSpinBox),
    m_requestLabel(new QLabel(tr("Request:"))),
    m_requestLineEdit(new QLineEdit(tr("Who are you?"))),
    m_trafficLabel(new QLabel(tr("No traffic."))),
    m_statusLabel(new QLabel(tr("Status: Not running."))),
    m_runButton(new QPushButton(tr("Start")))
{
    const auto infos = QSerialPortInfo::availablePorts();
    for (const QSerialPortInfo &info : infos)
        m_serialPortComboBox->addItem(info.portName());

    m_waitResponseSpinBox->setRange(0, 10000);
    m_waitResponseSpinBox->setValue(100);

    auto mainLayout = new QGridLayout;
    mainLayout->addWidget(m_serialPortLabel, 0, 0);
    mainLayout->addWidget(m_serialPortComboBox, 0, 1);
    mainLayout->addWidget(m_waitResponseLabel, 1, 0);
    mainLayout->addWidget(m_waitResponseSpinBox, 1, 1);
    mainLayout->addWidget(m_runButton, 0, 2, 2, 1);
    mainLayout->addWidget(m_requestLabel, 2, 0);
    mainLayout->addWidget(m_requestLineEdit, 2, 1, 1, 3);
    mainLayout->addWidget(m_trafficLabel, 3, 0, 1, 4);
    mainLayout->addWidget(m_statusLabel, 4, 0, 1, 5);
    setLayout(mainLayout);

    setWindowTitle(tr("Sender"));
    m_serialPortComboBox->setFocus();

    m_timer.setSingleShot(true);

    connect(m_runButton, &QPushButton::clicked, this, &Dialog::sendRequest);
    connect(&m_serial, &QSerialPort::readyRead, this, &Dialog::readResponse);
    connect(&m_timer, &QTimer::timeout, this, &Dialog::processTimeout);
}

void Dialog::sendRequest()
{
    if (m_serial.portName() != m_serialPortComboBox->currentText()) {
        m_serial.close();
        m_serial.setPortName(m_serialPortComboBox->currentText());

        if (!m_serial.open(QIODevice::ReadWrite)) {
            processError(tr("Can't open %1, error code %2")
                         .arg(m_serial.portName()).arg(m_serial.error()));
            return;
        }
    }

    setControlsEnabled(false);
    m_statusLabel->setText(tr("Status: Running, connected to port %1.")
                           .arg(m_serialPortComboBox->currentText()));

    m_serial.write(m_requestLineEdit->text().


-Scream" AP network
     - Configure the sender to use destination IP 192.168.4.1 and port 4010
     - Audio streaming will work directly between the devices

5. **Access the web interface**
   - Find the device's IP on your network
   - Or reconnect to "ESP32-Scream"
   - Open the IP address in a browser
   - Configure options based on your use case

## Factory Reset
Hold GPIO pin 0 during the first 3 seconds of boot to reset all settings.
# 📖 Nethan's LangChain 学习笔记 2025.04

## 📚 学习笔记大纲

### 1. 简单的 QA 机器人
1. [invoke、stream 输出](1-SimpleQARobot/1-simple_demo.ipynb)
2. [Messages 类的封装使用](1-SimpleQARobot/2-messages.ipynb)

### 2. 有记忆的 QA 机器人
1. [配置前后文记忆 thread_id](./2-QARobotWithMemory/1-memory_demo.ipynb)
2. [PromptTemplate 的定义与使用](./2-QARobotWithMemory/2-templates.ipynb)
3. [结构化输出的配置与使用](./2-QARobotWithMemory/3-JSON_parser.ipynb)

### 3. 工具类的定义与集成
1. [@tool 工具注解的介绍与定义](./3-RobotWithTools/1-introduction.ipynb)
2. [LLM 如何调取工具并返回结果？](./3-RobotWithTools/2-tools_calling.ipynb)
3. [中间件 Artifacts 的获取](./3-RobotWithTools/3-tools_and_artifacts.ipynb)

### 4. 文件上传与多模态
1. [图片和文本之间的多模态输入](./4-Multimodality/1-introduction.ipynb)
2. [向量嵌入以及语义相关性](./4-Multimodality/2-embedding.ipynb)
3. [向量存储和简单的 RAG](./4-Multimodality/3-vectorstore.ipynb)
4. [文档 Loader 和 Text Splitter](./4-Multimodality/4-text_splitters.ipynb)

### 5. 检索增强生成
1. [关键词检索器](./5-RAG/1-retrievers.ipynb)
2. [从数据源检索结构化/非结构化数据](./5-RAG/2-retrieval_system.ipynb)
3. [RAG 的介绍与构建](./5-RAG/3-RAG_implementation.ipynb)

### 6. AI Agent
1. [LangChain 链的表达](6-Agent/1-LCEL_usage.ipynb)

## To be accomplished...

## 什么是 LangChain？
LangChain 是一个用于构建基于 LLM 应用的 开发框架。它的核心目标是：

> 让语言模型不仅能生成文字，还能理解上下文、调用工具、访问知识库、与外部世界交互。

因此，它并不是一个模型，而是一个模型驱动的应用开发框架，帮你组织 LLM 的输入输出、记忆、工具调用等。RAG、多 agents 都需要使用到 LangChain 或者相关技术。

## ❓为什么要创建这个仓库
LangChain 库有几个已知的缺点：
* LangChain 更新频繁，且包管理混乱。一两年前的教程使用的包和方法现在都已经标记为 Deprecated，因此会有很多 Warnings 产生。
为了解决这个问题，我目前使用的版本为 2025.4，并基于官方文档来进行构建；
* 目前 LangChain 抽象十分复杂，一个方法有若干种实现形式。所以该笔记尝试统一写法，将所有的方法调用统一的接口，并尝试将其封装并可复用。
* 在工作中也会使用到 LangChain，有一个学习文档供参考可以省去很多搜索时间。

## 💻 如何运行笔记的代码
会用到 `jupyter notebook` 文件，穿插 `markdown` 格式的表述。把常用的功能实现，并且把官方链接附在上方以


package edu.duke.cs.osprey.kstar;

import static edu.duke.cs.osprey.tools.Log.log;
import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.*;

import edu.duke.cs.osprey.astar.conf.ConfAStarTree;
import edu.duke.cs.osprey.astar.conf.RCs;
import edu.duke.cs.osprey.confspace.Sequence;
import edu.duke.cs.osprey.confspace.SimpleConfSpace;
import edu.duke.cs.osprey.ematrix.EnergyMatrix;
import edu.duke.cs.osprey.ematrix.SimplerEnergyMatrixCalculator;
import edu.duke.cs.osprey.energy.ConfEnergyCalculator;
import edu.duke.cs.osprey.energy.EnergyCalculator;
import edu.duke.cs.osprey.energy.forcefield.ForcefieldParams;
import edu.duke.cs.osprey.kstar.pfunc.GradientDescentPfunc;
import edu.duke.cs.osprey.parallelism.Parallelism;
import edu.duke.cs.osprey.tools.MathTools;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

import java.util.*;
import java.util.stream.Collectors;

public class TestMSKStar {

	private static class Problem {

		final MSKStar mskstar;
		final ForcefieldParams ffparams;

		public Problem(MSKStar mskstar, ForcefieldParams ffparams) {
			this.mskstar = mskstar;
			this.ffparams = ffparams;
		}
	}

	private static Problem make2RL0PPI(boolean boundedMemory) {

		TestKStar.ConfSpaces confSpaces = TestKStar.make2RL0();
		final double epsilon = 0.95;

		MSKStar.State protein = new MSKStar.State("Protein", confSpaces.protein);
		MSKStar.State ligand = new MSKStar.State("Ligand", confSpaces.ligand);
		MSKStar.State complex = new MSKStar.State("Complex", confSpaces.complex);

		MSKStar.LMFE objective = new MSKStar.LMFE.Builder()
			.addState(complex, 1.0)
			.addState(protein, -1.0)
			.addState(ligand, -1.0)
			.build();
		MSKStar mskstar = new MSKStar.Builder(objective)
			.setEpsilon(epsilon)
			.setMaxSimultaneousMutations(1)
			.setObjectiveWindowSize(100.0) // need a big window to get all the sequences
			.setObjectiveWindowMax(100.0)
			.setMinNumConfTrees(boundedMemory ? 5 : null)
			.build();

		initStates(mskstar.states, confSpaces.ffparams, boundedMemory);

		return new Problem(mskstar, confSpaces.ffparams);
	}

	private static void check2RL0PPI(MSKStar mskstar) {

		List<MSKStar.SequenceInfo> sequences = mskstar.findBestSequences(25);

		// check the sequences (values collected with e = 0.01 and 64 digits precision)
		assertSequence(sequences, "phe asp glu thr phe lys ile thr",   -20.947212,   -20.935187);
		assertSequence(sequences, "TYR asp glu thr phe lys ile thr",   -15.810058,   -15.797771);
		assertSequence(sequences, "ALA asp glu thr phe lys ile thr",   -16.105190,   -16.094644);
		assertSequence(sequences, "VAL asp glu thr phe lys ile thr",   -17.246337,   -17.235435);
		assertSequence(sequences, "ILE asp glu thr phe lys ile thr",   -17.589388,   -17.576462);
		assertSequence(sequences, "LEU


_CACHE = "no-cache"
    const val URL_REGEX = "(\\w+):\\/\\/([^/:]+)(:\\d*)?([^# ]*)"

    private val alphabet: List<Char> = ('a'..'z') + ('A'..'Z') + ('0'..'9')

    fun randomString(size: Int) = List(size) { alphabet.random() }.joinToString(EMPTY)
    fun uniqueId() = UUID.randomUUID().toString().replace(DASH, EMPTY).toLowerCase()

    fun randomStringByLongValue(prefix: String? = null, suffix: String? = null): String {
        var randomLong = ThreadLocalRandom.current().nextLong()
        randomLong = if (randomLong == Long.MIN_VALUE) 0 else abs(randomLong)
        var value = randomLong.toString()
        prefix?.let { value = prefix + value }
        suffix?.let { value += suffix }
        return value
    }

    fun calculateRatio(originSize: Long, newSize: Long, format: DecimalFormat = DecimalFormat("#.#")): String {
        return format.format((originSize - newSize.toDouble()) / originSize * 100).plus("%")
    }
}

fun String.ensurePrefix(prefix: CharSequence): String {
    return if (startsWith(prefix)) this else StringBuilder(prefix).append(this).toString()
}

fun String.ensureSuffix(suffix: CharSequence): String {
    return if (endsWith(suffix)) this else this + suffix
}

fun String.ensurePrefix(prefix: Char) = if (startsWith(prefix)) this else prefix + this
fun String.ensureSuffix(suffix: Char) = if (endsWith(suffix)) this else this + suffix
fun String.urlEncode() = URLEncoder.encode(this, StandardCharsets.UTF_8.displayName()).apply {
    // 空格' '会被编码为+和%20,但是%20更加通用
    // 一般情况下，服务器会兼容+和%20,但是在签名时则需要保证空格的编码要两者完全一致，所以我们这里统一转换成%20
    return this.replace("+", "%20")
}

fun String.urlDecode() = URLDecoder.decode(this, StandardCharsets.UTF_8.displayName())
/*
 * Tencent is pleased to support the open source community by making BK-CI 蓝鲸持续集成平台 available.
 *
 * Copyright (C) 2019 Tencent.  All rights reserved.
 *
 * BK-CI 蓝鲸持续集成平台 is licensed under the MIT license.
 *
 * A copy of the MIT License is included in this file.
 *
 *
 * Terms of the MIT License:
 * ---------------------------------------------------
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
 * the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 * LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
 * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.tencent.bkrepo.common.lock.service

import com.tencent.bkrepo.common.api.exception.ErrorCodeException
import com.tencent.bkrepo.common.api.message.CommonMessageCode
import org.slf4j.Logger
import org.slf4j.LoggerFactory

interface LockOperation {

    /**
     * 获取锁信息
     */
    fun


 for now, assume that only the cartridge and expansion buses are also accessible.
 */

auto APU::read(n16 address) -> n8 {
  if(address >= 0x0000 && address <= 0x3fff) return ram.read(address);  //$2000-3fff mirrors $0000-1fff
  if(address >= 0x4000 && address <= 0x5fff) return opn2.readStatus();
  if(address >= 0x7f00 && address <= 0x7fff) return readExternal(0xc00000 | (n8)address);
  if(address >= 0x8000 && address <= 0xffff) return readExternal(state.bank << 15 | (n15)address);
  debug(unusual, "[APU] read(0x", hex(address, 4L), ")");
  return 0x00;
}

auto APU::write(n16 address, n8 data) -> void {
  if(address >= 0x0000 && address <= 0x3fff) return ram.write(address, data);  //$2000-3fff mirrors $0000-1fff
  if(address >= 0x4000 && address <= 0x5fff) {
    switch(0x4000 | address & 3) {
    case 0x4000: return opn2.writeAddress(0 << 8 | data);
    case 0x4001: return opn2.writeData(data);
    case 0x4002: return opn2.writeAddress(1 << 8 | data);
    case 0x4003: return opn2.writeData(data);
    }
    unreachable;
  }
  if(address >= 0x6000 && address <= 0x60ff) return (void)(state.bank = data.bit(0) << 8 | state.bank >> 1);
  if(address >= 0x7f00 && address <= 0x7fff) return writeExternal(0xc00000 | (n8)address, data);
  if(address >= 0x8000 && address <= 0xffff) return writeExternal(state.bank << 15 | (n15)address, data);
  debug(unusual, "[APU] write(0x", hex(address, 4L), ")");
  return;
}

auto APU::readExternal(n24 address) -> n8 {
  step(3); // approximate Z80 delay
  while(MegaDrive::bus.acquired() && !scheduler.synchronizing()) step(1);
  cpu.state.stolenMcycles += 68; // approximate 68K delay; 68 Mclk ~= 9.7 68k clk
  MegaDrive::bus.acquire(MegaDrive::Bus::APU);

  n8 data = 0xff;
  if(address >= 0x000000 && address <= 0x9fffff
  || address >= 0xa10000 && address <= 0xa1ffff
  || address >= 0xc00000 && address <= 0xc000ff) {
    if(address & 1) {
      data = MegaDrive::bus.read(0, 1, address & ~1, 0x00).byte(0);
    } else {
      data = MegaDrive::bus.read(1, 0, address & ~1, 0x00).byte(1);
    }
  } else {
    debug(unusual, "[APU] readExternal(0x", hex(address, 6L), ")");
  }

  MegaDrive::bus.release(MegaDrive::Bus::APU);
  return data;
}

auto APU::writeExternal(n24 address, n8 data) -> void {
  step(3); // approximate Z80 delay
  while(MegaDrive::bus.acquired() && !scheduler.synchronizing()) step(1);
  cpu.state.stolenMcycles += 68; // approximate 68K delay; 68 Mclk ~= 9.7 68k clk
  MegaDrive::bus.acquire(MegaDrive::Bus::APU);

  if(address >= 0x000000 && address <= 0x9fffff
  || address >= 0xa10000 && address <= 0xa1ffff
  || address >= 0xc00000 && address <= 0xc000ff
  || address >= 0xe00000 && address <= 0xffffff) {
    if(address & 1) {
      MegaDrive::bus.write(0, 1, address & ~1, data << 8 | data << 0);
    } else {
      MegaDrive::bus.write(1, 0


DMLibDataInfo DestDataInfo = new DMLibDataInfo(string.Empty);
            DestDataInfo.IsFileShareSnapshot = true;
            DestAdaptor.GenerateData(DestDataInfo);

            CloudBlobDirectory SourceObject = SourceAdaptor.GetTransferObject(sourceDataInfo.RootPath, sourceDataInfo.RootNode) as CloudBlobDirectory;
            CloudFileDirectory DestObject = DestAdaptor.GetTransferObject(DestDataInfo.RootPath, DestDataInfo.RootNode) as CloudFileDirectory;

            // transfer File and failed with expected Error
            Task<TransferStatus> task = TransferManager.CopyDirectoryAsync(
                SourceObject,
                DestObject,


ng get description => 'Get app names for the targeted platforms';

  @override
  String get name => RenameCommand.getAppName.name;

  @override
  FutureOr? run() {
    final targets = argResults?[RenameOption.targets.name];
    if (targets == null || targets.isEmpty) {
      print('No targets specified.');
      return null;
    }

    print('Targets: $targets');
    final rename = Rename.fromPlatformNames(
      platformNames: targets,
    );
    return rename.applyWithCommandName(
      commandName: name,
    );
  }
}

/// [GetBundleIdCommand] is a class that extends the [PlatformFileEditorCommand] class.
/// It is responsible for getting the bundleId identifiers for the targeted platforms.
class GetBundleIdCommand extends PlatformFileEditorCommand {
  /// Constructor for [GetBundleIdCommand].
  /// It initializes the command with its name and description.
  GetBundleIdCommand()
      : super(
          RenameCommand.getBundleId.name,
          'Get bundleId identifiers for the targeted platforms',
        );

  @override
  String get description =>
      'Get bundleId identifiers for the targeted platforms';

  @override
  String get name => RenameCommand.getBundleId.name;

  @override
  FutureOr? run() {
    final targets = argResults?[RenameOption.targets.name];
    if (targets == null || targets.isEmpty) {
      print('No targets specified.');
      return null;
    }

    print('Targets: $targets');
    final rename = Rename.fromPlatformNames(
      platformNames: targets,
    );
    return rename.applyWithCommandName(
      commandName: name,
    );
  }
}
import 'dart:io';

import 'package:adaptive_theme/adaptive_theme.dart';
import 'package:editor/editor.dart';
import 'package:flutter/material.dart';
import 'package:hive/hive.dart';
import 'package:hydrated_bloc/hydrated_bloc.dart';
import 'package:path_provider/path_provider.dart';
import 'package:teta_oss/core/env/env.dart';
import 'package:teta_oss/router.dart';
import 'package:window_manager/window_manager.dart';

late final TetaEditor teta;

Future<void> main() async {
  if (!Platform.isMacOS) throw Exception('This app is only for macOS');
  WidgetsFlutterBinding.ensureInitialized();

  final dir = await getApplicationSupportDirectory();
  Hive.init(dir.path);
  HydratedBloc.storage = await HydratedStorage.build(
    storageDirectory: HydratedStorageDirectory(dir.path),
  );
  await Hive.openBox('teta');
  await windowManager.ensureInitialized();
  WindowOptions windowOptions = const WindowOptions(
    size: null,
    center: null,
    backgroundColor: Colors.transparent,
    skipTaskbar: false,
    titleBarStyle: TitleBarStyle.hidden,
  );
  windowManager.waitUntilReadyToShow(windowOptions, () async {
    await windowManager.show();
    await windowManager.focus();
  });
  final targetDir = Directory(Env.projectPath.endsWith('/')
      ? Env.projectPath.substring(0, Env.projectPath.length - 1)
      : Env.projectPath);
  teta = TetaEditor(
    targetDir.path,
    'app',
    Env.serverUrl,
  );
  runApp(_App());
}

class _App extends StatelessWidget {
  const _App();

  @override
  Widget build(BuildContext context) {
    return AdaptiveTheme(
      debugShowFloatingThemeButton: false,
      initial: AdaptiveThemeMode.dark,
      light: ThemeData(
        fontFamily: 'Wanted Sans',
        useMaterial3: true,
        colorScheme: ColorScheme.fromSeed(
          seedColor: const Color(0xFF0A84FF),
          primary: const Color(0xFF0A84FF),
          surface: Colors.white,
          onSurface: Colors.black,
          inverseSurface: Colors.black,
        ),


   }
}

pub struct EspHttpServer {
    sd: esp_idf_sys::httpd_handle_t,
    registrations: Vec<(CString, esp_idf_sys::httpd_uri_t)>,
}

impl EspHttpServer {
    pub fn new(conf: &Configuration) -> Result<Self, EspError> {
        let config: Newtype<esp_idf_sys::httpd_config_t> = conf.into();

        let mut handle: esp_idf_sys::httpd_handle_t = ptr::null_mut();
        let handle_ref = &mut handle;

        esp!(unsafe { esp_idf_sys::httpd_start(handle_ref, &config.0 as *const _) })?;

        info!("Started Httpd server with config {:?}", conf);

        Ok(EspHttpServer {
            sd: handle,
            registrations: vec![],
        })
    }

    fn unregister(&mut self, uri: CString, conf: esp_idf_sys::httpd_uri_t) -> Result<(), EspError> {
        unsafe {
            esp!(esp_idf_sys::httpd_unregister_uri_handler(
                self.sd,
                uri.as_ptr() as _,
                conf.method
            ))?;

            let _drop = Box::from_raw(conf.user_ctx as *mut _);
        };

        info!(
            "Unregistered Httpd server handler {:?} for URI \"{}\"",
            conf.method,
            uri.to_str().unwrap()
        );

        Ok(())
    }

    fn stop(&mut self) -> Result<(), EspError> {
        if !self.sd.is_null() {
            while !self.registrations.is_empty() {
                let (uri, registration) = self.registrations.pop().unwrap();

                self.unregister(uri, registration)?;
            }

            esp!(unsafe { esp_idf_sys::httpd_stop(self.sd) })?;

            self.sd = ptr::null_mut();
        }

        info!("Httpd server stopped");

        Ok(())
    }

    unsafe extern "C" fn handle(raw_req: *mut httpd_req_t) -> c_types::c_int {
        let handler = ((*raw_req).user_ctx
            as *mut Box<
                dyn Fn(EspHttpRequest, EspHttpResponse) -> Result<HttpCompletion, EspError>,
            >)
            .as_ref()
            .unwrap();

        let request = EspHttpRequest(raw_req);
        let response = EspHttpResponse {
            raw_req,
            status: 200,
            status_message: None,
            headers: BTreeMap::new(),
        };

        info!("About to handle query string {:?}", request.query_string());

        if let Err(_err) = handler(request, response) {
            // TODO
            return 0;
        }

        0

        // let mut idf_request_response = IdfRequest(rd, PhantomData);

        // log!(
        //     if err { Level::Warn } else { Level::Info },
        //     "Request handled with status {} ({:?})",
        //     &response.status,
        //     &response.status_message
        // );

        // match idf_request_response.send(response) {
        //     Result::Ok(_) => esp_idf_sys::ESP_OK as _,
        //     Result::Err(_) => esp_idf_sys::ESP_FAIL as _,
        // }
    }
}

impl Drop for EspHttpServer {
    fn drop(&mut self) {
        self.stop().expect("Unable to stop the server cleanly");
    }
}

impl HttpRegistry for EspHttpServer {
    type Request<'a> = EspHttpRequest;
    type Response<'a> = EspHttpResponse<'a>;
    type Error = EspError;

    fn


info.windowWidth * 3 + 3) & ~3);
    int data_size = row_size * info.windowHeight;
    unsigned char * data = new unsigned char [data_size];

#pragma pack (push, 1)
    struct
    {
        unsigned char identsize;    // Size of following ID field
        unsigned char cmaptype;     // Color map type 0 = none
        unsigned char imagetype;    // Image type 2 = rgb
        short cmapstart;            // First entry in palette
        short cmapsize;             // Fumber of entries in palette
        unsigned char cmapbpp;      // Number of bits per palette entry
        short xorigin;              // X origin
        short yorigin;              // Y origin
        short width;                // Width in pixels
        short height;               // Height in pixels
        unsigned char bpp;          // Bits per pixel
        unsigned char descriptor;   // Descriptor bits
    } tga_header;
#pragma pack (pop)

    glReadPixels(0, 0,                                  // Origin
                 info.windowWidth, info.windowHeight,   // Size
                 GL_BGR, GL_UNSIGNED_BYTE,              // Format, type
                 data);                                 // Data

    memset(&tga_header, 0, sizeof(tga_header));
    tga_header.imagetype = 2;
    tga_header.width = (short)info.windowWidth;
    tga_header.height = (short)info.windowHeight;
    tga_header.bpp = 24;

    FILE * f_out = fopen("screenshot.tga", "wb");
    fwrite(&tga_header, sizeof(tga_header), 1, f_out);
    fwrite(data, data_size, 1, f_out);
    fclose(f_out);

    delete [] data;
}

void bumpmapping_app::onKey(int key, int action)
{
    if (action)
    {
        switch (key)
        {
            case 'R':
                load_shaders();
                break;
            case 'S':
                make_screenshot();
                break;
            case 'P':
                paused = !paused;
                break;
        }
    }
}

void bumpmapping_app::load_shaders()
{
    GLuint vs;
    GLuint fs;

    vs = sb7::shader::load("media/shaders/bumpmapping/bumpmapping.vs.glsl", GL_VERTEX_SHADER);
    fs = sb7::shader::load("media/shaders/bumpmapping/bumpmapping.fs.glsl", GL_FRAGMENT_SHADER);

    if (program)
        glDeleteProgram(program);

    program = glCreateProgram();
    glAttachShader(program, vs);
    glAttachShader(program, fs);
    glLinkProgram(program);

    uniforms.mv_matrix = glGetUniformLocation(program, "mv_matrix");
    uniforms.proj_matrix = glGetUniformLocation(program, "proj_matrix");
    uniforms.light_pos = glGetUniformLocation(program, "light_pos");
}

DECLARE_MAIN(bumpmapping_app)
/*
 * Copyright  2012-2015 Graham Sellers
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantia


上都是极权主义——是一路货色。俺在2013年写过一篇博文——影评：《苏维埃往事》——帮你看清苏联和纳粹的共同本质——就已经强调过这两者的共性。
　　“极权主义”不仅是“自由主义”的敌人，也是所有民主派/共和派的敌人。通过本文的介绍，希望你能对“极权主义”留下深刻的印象，并保持足够的警惕性。

★关于“极权主义”的引申阅读

　　关于“极权主义”的更多介绍，可以参见“这个维基词条”。
　　对极权主义的批评，已经有好几部名著，有兴趣的读者可以去看一下（下面列出的每一本，俺的网盘上都有电子版）
波普尔：《开放社会及其敌人》/《The Open Society and Its Enemies》
（本书中更多的是介绍“开放社会的敌人”，而不是“开放社会”本身。作者追溯了共产主义意识形态的思想来源。着重批判了“柏拉图、黑格尔、马克思”这三人的哲学体系。）
波普尔：《历史决定论的贫困》/《The Poverty of Historicism》
（这本是专门批马克思的“历史决定论”，批得体无完肤）
汉娜·阿伦特：《极权主义的起源》/《The Origins of Totalitarianism》
（这本书是该领域的理论经典，第一次深刻论述了“马列主义”与“纳粹主义”的共性）
<a href="https://zh.wikipedia.org/wiki/%E5%BC%97%E9%87%8C%E5%BE%B7%E9%87%8C%E5%B8%8C%C2%B7%E5%93%88%E8%80%B6%E5%85%8B


r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 pc lr sp ip sl sb fp a1 a2 a3 a4 v1 v2 v3 v4 v5 v6 v7 v8 f0 f1 f2 f3 f4 f5 f6 f7 p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 c0 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 q0 q1 q2 q3 q4 q5 q6 q7 q8 q9 q10 q11 q12 q13 q14 q15 cpsr_c cpsr_x cpsr_s cpsr_f cpsr_cx cpsr_cxs cpsr_xs cpsr_xsf cpsr_sf cpsr_cxsf spsr_c spsr_x spsr_s spsr_f spsr_cx spsr_cxs spsr_xs spsr_xsf spsr_sf spsr_cxsf s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20 s21 s22 s23 s24 s25 s26 s27 s28 s29 s30 s31 d0 d1 d2 d3 d4 d5 d6 d7 d8 d9 d10 d11 d12 d13 d14 d15 d16 d17 d18 d19 d20 d21 d22 d23 d24 d25 d26 d27 d28 d29 d30 d31 {PC} {VAR} {TRUE} {FALSE} {OPT} {CONFIG} {ENDIAN} {CODESIZE} {CPU} {FPU} {ARCHITECTURE} {PCSTOREOFFSET} {ARMASM_VERSION} {INTER} {ROPI} {RWPI} {SWST} {NOSWST} . @"},contains:[{className:"keyword",begin:"\\b(adc|(qd?|sh?|u[qh]?)?add(8|16)?|usada?8|(q|sh?|u[qh]?)?(as|sa)x|and|adrl?|sbc|rs[bc]|asr|b[lx]?|blx|bxj|cbn?z|tb[bh]|bic|bfc|bfi|[su]bfx|bkpt|cdp2?|clz|clrex|cmp|cmn|cpsi[ed]|cps|setend|dbg|dmb|dsb|eor|isb|it[te]{0,3}|lsl|lsr|ror|rrx|ldm(([id][ab])|f[ds])?|ldr((s|ex)?[bhd])?|movt?|mvn|mra|mar|mul|[us]mull|smul[bwt][bt]|smu[as]d|smmul|smmla|mla|umlaal|smlal?([wbt][bt]|d)|mls|smlsl?[ds]|smc|svc|sev|mia([bt]{2}|ph)?|mrr?c2?|mcrr2?|mrs|msr|orr|orn|pkh(tb|bt)|rbit|rev(16|sh)?|sel|[su]sat(16)?|nop|pop|push|rfe([id][ab])?|stm([id][ab])?|str(ex)?[bhd]?|(qd?)?sub|(sh?|q|u[qh]?)?sub(8|16)|[su]xt(a?h|a?b(16)?)|srs([id][ab])?|swpb?|swi|smi|tst|teq|wfe|wfi|yield)(eq|ne|cs|cc|mi|pl|vs|vc|hi|ls|ge|lt|gt|le|al|hs|lo)?[sptrx]?",end:"\\s"},e.COMMENT("[;@]","$",{relevance:0}),e.C_BLOCK_COMMENT_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:"'",end:"[^\\\\]'",relevance:0},{className:"title",begin:"\\|",end:"\\|",illegal:"\\n",relevance:0},{className:"number",variants:[{begin:"[#$=]?0x[0-9a-f]+


arm_smp_disable:
	mrc p15, 0, r0, c1, c0, 1   // clear SMP bit in ACTLR
	bic r0, r0, #0x40
	mcr p15, 0, r0, c1, c0, 1
	bx lr

.globl arm_smp_enable
arm_smp_enable:
	mrc p15, 0, r0, c1, c0, 1   // set SMP bit in ACTLR
	orr r0, r0, #0x40
	mcr p15, 0, r0, c1, c0, 1
	bx lr

.globl cpu_mmu_disable
cpu_mmu_disable:
	mcr     p15, #0, r0, c8, c7, #0    @ invalidate tlb
	mrc     p15, #0, r0, c1, c0, #0
	bic     r0, r0, #1
	mcr     p15, #0, r0, c1, c0, #0    @ clear mmu bit
	dsb
	bx      lr

.local cpu_dcache_disable
cpu_dcache_disable:
	push    {r4-r11, lr}
	mrc     p15, #0, r0, c1, c0, #0
	bic     r0,  r0, #0x00000004
	mcr     p15, #0, r0, c1, c0, #0
	pop     {r4-r11, lr}
	bx      lr

.local cpu_icache_disable
cpu_icache_disable:
	mrc     p15, #0, r0, c1, c0, #0
	bic     r0,  r0, #0x00001000
	mcr     p15, #0, r0, c1, c0, #0
	bx      lr