r) {
                player = (Player) sender;
            }
            if (player == null) {
                // must provide coords
                if (args.length < 4) {
                    new TARDISCommandHelper(plugin).getCommand("tardisnetherportal", sender);
                    return true;
                }
                int x = TARDISNumberParsers.parseInt(args[0]);
                int y = TARDISNumberParsers.parseInt(args[1]);
                int z = TARDISNumberParsers.parseInt(args[2]);
                return o2n(sender, x, y, z, args[3].equalsIgnoreCase("overworld"));
            } else {
                // get player's coords and environment
                return o2n(player);
            }
        }
        return false;
    }

    private boolean o2n(Player player) {
        int x, y, z, dx, dz;
        // get player coords
        Location l = player.getLocation();
        boolean overworld = !(l.getWorld().getEnvironment().equals(Environment.NETHER));
        x = l.getBlockX();
        y = l.getBlockY();
        z = l.getBlockZ();
        if ((y > 123) || (y < 1)) {
            plugin.getMessenger().send(player, TardisModule.TARDIS, "O2N_Y");
            return false;
        }
        // get player direction
        String d = TARDISStaticUtils.getPlayersDirection(player, false);
        String message = (overworld) ? "O2N_COORDS_N" : "O2N_COORDS_O";
        // get destination coords
        if (overworld) {
            dx = x / 8;
            dz = z / 8;
        } else {
            dx = x * 8;
            dz = z * 8;
        }
        String coords = "X: " + dx + ", " + "Y: " + y + ", " + "Z: " + dz + ", facing " + d;
        plugin.getMessenger().send(player, TardisModule.TARDIS, message, coords);
        return true;
    }

    private boolean o2n(CommandSender sender, int x, int y, int z, boolean overworld) {
        int dx, dz;
        if ((y > 123) || (y < 1)) {
            plugin.getMessenger().send(sender, TardisModule.TARDIS, "O2N_Y");
            return false;
        }
        String message = (overworld) ? "O2N_COORDS_N" : "O2N_COORDS_O";
        // get destination coords
        if (overworld) {
            dx = x / 8;
            dz = z / 8;
        } else {
            dx = x * 8;
            dz = z * 8;
        }
        String coords = "X: " + dx + ", " + "Y: " + y + ", " + "Z: " + dz;
        plugin.getMessenger().send(sender, TardisModule.TARDIS, message, coords);
        return true;
    }

    @Override
    public List<String> onTabComplete(CommandSender sender, Command command, String label, String[] args) {
        if (args.length == 4) {
            return partial(args[3], ENVIRON_SUBS);
        }
        return ImmutableList.of();
    }
}
/*
 * 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.commands.dev.wiki;

import io.papermc


= W [ I2 ++ ];	DBGA ( R0.L , 0x13d3 );
	R0.L = W [ I2 ++ ];	DBGA ( R0.L , 0x15f2 );
	R0.L = W [ I2 ++ ];	DBGA ( R0.L , 0x16b9 );
	R0.L = W [ I2 ++ ];	DBGA ( R0.L , 0x1650 );

	pass

	.data
state:
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000
	.dw 0x0000

	.data
Coeff:
	.dw 0x7fff
	.dw 0x5999
	.dw 0x4000
	.dw 0xe0


namespace Test.UC
{
    partial class UCTestLED
    {
        /// <summary>
        /// 必需的设计器变量。
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// 清理所有正在使用的资源。
        /// </summary>
        /// <param name="disposing">如果应释放托管资源，为 true；否则为 false。</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region 组件设计器生成的代码

        /// <summary>
        /// 设计器支持所需的方法 - 不要
        /// 使用代码编辑器修改此方法的内容。
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.ucledNum27 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum26 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum25 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum24 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum23 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum22 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum21 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum20 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum19 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum18 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum17 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum16 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum15 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum14 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum13 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum12 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum11 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum10 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum9 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum8 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum7 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum6 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum5 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum4 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum3 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum2 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNum1 = new HZH_Controls.Controls.UCLEDNum();
            this.ledNum1 = new HZH_Controls.Controls.UCLEDNum();
            this.ucledNums2 = new HZH_Controls.Controls.UCLEDNums();
            this.ucledNums1 = new HZH_Controls.Controls.UCLEDNums();
            this.ucledDataTime1 = new HZH_Controls.Controls.UCLEDDataTime();
            this.ucledTime2 = new HZH_Controls.Controls.UCLEDTime();
            this.ucledDate1 = new HZH_Controls.Controls.UCLEDData();
            this.timer1 = new


form-control,.selectize-dropdown{font-size:.9rem}.panel-sidebar .form-control,.panel-input .form-control{padding-top:.1rem}.tab-pane div.sourceCode{margin-top:0px}.tab-pane>p{padding-top:0}.tab-pane>p:nth-child(1){padding-top:0}.tab-pane>p:last-child{margin-bottom:0}.tab-pane>pre:last-child{margin-bottom:0}.tab-content>.tab-pane:not(.active){display:none !important}div.sourceCode{background-color:#16242f;border:1px solid #16242f}pre.sourceCode{background-color:rgba(0,0,0,0)}pre.sourceCode{border:none;font-size:.875em;overflow:visible !important;padding:.4em}div.sourceCode{overflow-y:hidden}.callout div.sourceCode{margin-left:initial}.blockquote{font-size:inherit;padding-left:1rem;padding-right:1.5rem;color:#9da3aa}.blockquote h1:first-child,.blockquote .h1:first-child,.blockquote h2:first-child,.blockquote .h2:first-child,.blockquote h3:first-child,.blockquote .h3:first-child,.blockquote h4:first-child,.blockquote .h4:first-child,.blockquote h5:first-child,.blockquote .h5:first-child{margin-top:0}pre{background-color:initial;padding:initial;border:initial}p pre code:not(.sourceCode),li pre code:not(.sourceCode),pre code:not(.sourceCode){background-color:initial}p code:not(.sourceCode),li code:not(.sourceCode),td code:not(.sourceCode){background-color:#b9c680;padding:.2em}nav p code:not(.sourceCode),nav li code:not(.sourceCode),nav td code:not(.sourceCode){background-color:rgba(0,0,0,0);padding:0}td code:not(.sourceCode){white-space:pre-wrap}#quarto-embedded-source-code-modal>.modal-dialog{max-width:1000px;padding-left:1.75rem;padding-right:1.75rem}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body{padding:0}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-body div.sourceCode{margin:0;padding:.2rem .2rem;border-radius:0px;border:none}#quarto-embedded-source-code-modal>.modal-dialog>.modal-content>.modal-header{padding:.7rem}.code-tools-button{font-size:1rem;padding:.15rem .15rem;margin-left:5px;color:#6c757d;background-color:rgba(0,0,0,0);transition:initial;cursor:pointer}.code-tools-button>.bi::before{display:inline-block;height:1rem;width:1rem;content:"";vertical-align:-0.125em;background-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(108, 117, 125)" viewBox="0 0 16 16"><path d="


, 0
/* 800245CC 000213CC  7C 7F 02 14 */	add r3, r31, r0
/* 800245D0 000213D0  98 83 00 09 */	stb r4, 9(r3)
lbl_800245D4:
/* 800245D4 000213D4  88 79 00 45 */	lbz r3, 0x45(r25)
/* 800245D8 000213D8  7C 9F EA 14 */	add r4, r31, r29
/* 800245DC 000213DC  38 00 00 00 */	li r0, 0
/* 800245E0 000213E0  98 64 00 49 */	stb r3, 0x49(r4)
/* 800245E4 000213E4  98 19 00 45 */	stb r0, 0x45(r25)
/* 800245E8 000213E8  88 04 00 31 */	lbz r0, 0x31(r4)
/* 800245EC 000213EC  98 04 00 2D */	stb r0, 0x2d(r4)
/* 800245F0 000213F0  88 04 00 2D */	lbz r0, 0x2d(r4)
/* 800245F4 000213F4  7C 00 07 74 */	extsb r0, r0
/* 800245F8 000213F8  7C 7F 02 14 */	add r3, r31, r0
/* 800245FC 000213FC  88 03 00 66 */	lbz r0, 0x66(r3)
/* 80024600 00021400  98 04 00 61 */	stb r0, 0x61(r4)
/* 80024604 00021404  4B FE 26 11 */	bl gmGetGlobalP
/* 80024608 00021408  3B 23 01 0A */	addi r25, r3, 0x10a
/* 8002460C 0002140C  7F DC 07 74 */	extsb r28, r30
/* 80024610 00021410  7C 79 E2 14 */	add r3, r25, r28
/* 80024614 00021414  88 03 00 4D */	lbz r0, 0x4d(r3)
/* 80024618 00021418  7C 00 07 75 */	extsb. r0, r0
/* 8002461C 0002141C  41 82 01 B0 */	beq lbl_800247CC
/* 80024620 00021420  3B 40 00 00 */	li r26, 0
/* 80024624 00021424  9B 43 00 4D */	stb r26, 0x4d(r3)
lbl_80024628:
/* 80024628 00021428  38 1A 00 25 */	addi r0, r26, 0x25
/* 8002462C 0002142C  7C 19 00 AE */	lbzx r0, r25, r0
/* 80024630 00021430  7C 00 07 74 */	extsb r0, r0
/* 80024634 00021434  7C 00 E0 00 */	cmpw r0, r28
/* 80024638 00021438  40 82 00 20 */	bne lbl_80024658
/* 8002463C 0002143C  7F 43 07 74 */	extsb r3, r26
/* 80024640 00021440  38 80 00 00 */	li r4, 0
/* 80024644 00021444  48 10 F8 A5 */	bl func_80133EE8
/* 80024648 00021448  7F C4 F3 78 */	mr r4, r30
/* 8002464C 0002144C  7F 43 07 74 */	extsb r3, r26
/* 80024650 00021450  38 A0 00 00 */	li r5, 0
/* 80024654 00021454  48 10 FE CD */	bl func_80134520
lbl_80024658:
/* 80024658 00021458  3B 5A 00 01 */	addi r26, r26, 1
/* 8002465C 0002145C  2C 1A 00 04 */	cmpwi r26,


 2 + d1, 1 + d2, 9] : 0 <= d1 <= 1079 and 0 <= d2 <= 59; sbl7_32_1_merged839[d0 = 0, d1, d2] -> [0, 2 + d1, 1 + d2, 11] : 0 <= d1 <= 1079 and 0 <= d2 <= 59; mag_y_to_gp_324_ld29_merged827[d0 = 0, d1, d2] -> [0, 2 + d1, 1 + d2, 10] : 0 <= d1 <= 1079 and 0 <= d2 <= 59 }
//   { mag_x_to_gp_316_ld21_merged825[d0 = 0, d1, d2] -> [0, 2 + d1, 1 + d2, 9] : 0 <= d1 <= 1079 and 0 <= d2 <= 59 }
// Condition for mag_x_to_gp_316_ld21_merged825(((((-9 + 1*i3)) == 0) && (((1*i0)) == 0) && (((-2 + 1*i1)) >= 0) && (((1081 + -1*i1)) >= 0) && (((-1 + 1*i2)) >= 0) && (((60 + -1*i2)) >= 0)))
//   { sbl7_32_1_merged839[d0 = 0, d1, d2] -> [0, 2 + d1, 1 + d2, 11] : 0 <= d1 <= 1079 and 0 <= d2 <= 59 }
// Condition for sbl7_32_1_merged839(((((-11 + 1*i3)) == 0) && (((1*i0)) == 0) && (((-2 + 1*i1)) >= 0) && (((1081 + -1*i1)) >= 0) && (((-1 + 1*i2)) >= 0) && (((60 + -1*i2)) >= 0)))
//   { mag_y_to_gp_324_ld29_merged827[d0 = 0, d1, d2] -> [0, 2 + d1, 1 + d2, 10] : 0 <= d1 <= 1079 and 0 <= d2 <= 59 }
// Condition for mag_y_to_gp_324_ld29_merged827(((((-10 + 1*i3)) == 0) && (((1*i0)) == 0) && (((-2 + 1*i1)) >= 0) && (((1081 + -1*i1)) >= 0) && (((-1 + 1*i2)) >= 0) && (((60 + -1*i2)) >= 0)))

	// time range: { [0, i1, i2, i3] : 2 <= i1 <= 1081 and 0 < i2 <= 60 and 9 <= i3 <= 11 }
	// # sets: 1
	int i0 = 0;
	  for (int i1 = 2; i1 <= 1081; i1++) {
	    for (int i2 = 1; i2 <= 60; i2++) {
	#pragma HLS pipeline II=1
	        // { [i0, i1, i2] }
	        // { [i0, i1, i2] :  }
	        if ((true)) {
	          mag_x_to_gp_316_ld21_merged825(mag_x_to_gp_316 /* buf name */, mag_x_FIFO_buf20, 0, ((-2 + 1*i1)), ((-1 + 1*i2)));
	        }
	        // { [i0, i1, i2] }
	        // { [i0, i1, i2] :  }
	        if ((true)) {
	          mag_y_to_gp_324_ld29_merged827(mag_y_to_gp_324 /* buf name */, mag_y_FIFO_buf28, 0, ((-2 + 1*i1)), ((-1 + 1*i2)));
	        }
	        // { [i0, i1, i2] }
	        // { [i0, i1, i2] :  }
	        if ((true)) {
	          sbl7_32_1_merged839(mag_x_FIFO_buf20 /* buf name */, mag_y_FIFO_buf28 /* buf name */, sbl7_32, 0, ((-2 + 1*i1)), ((-1 + 1*i2)));
	        }
	    }
	  }

#ifndef __VIVADO_SYNTH__
  debug_file.close();
#endif //__VIVADO_SYNTH__
}

//


import csv
import os
from fpdf import FPDF
from config import OUTPUT_DIR

def save_csv(filename, rows, headers):
    os.makedirs(os.path.dirname(filename), exist_ok=True)
    with open(filename, 'w', newline='', encoding='utf-8') as f:
        writer = csv.writer(f)
        writer.writerow(headers)
        writer.writerows(rows)

def generate_pdf_transcript(transcriptions, out_path=None):
    if out_path is None:
        out_path = os.path.join(OUTPUT_DIR, "transcription_summary.pdf")
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("helvetica", size=12)
    pdf.multi_cell(0, 10, "Lecture Transcriptions\n\n")
    for ts, text in transcriptions:
        pdf.multi_cell(0, 12, f"[{ts}] {text or '(No speech detected)'}")
        pdf.ln(5)
    pdf.output(out_path)

def generate_pdf_logs(events, out_path=None):
    if out_path is None:
        out_path = os.path.join(OUTPUT_DIR, "engagement_log_summary.pdf")
    pdf = FPDF()
    pdf.add_page()
    pdf.set_font("helvetica", size=12)
    pdf.multi_cell(0, 10, "Engagement Log Summary\n\n")
    for ts, etype, desc, speech in events:
        log_entry = f"[{ts}] {etype}: {desc}"
        if speech:
            log_entry += f"\n    Speech Context: \"{speech}\""
        pdf.multi_cell(0, 12, log_entry)
        pdf.ln(5)
    pdf.output(out_path)


)
    where
        T: IntoIterator<Item = Vec<u8>>,
    {
        self.trusted_certificates.extend(trusted_certificates);
    }

    /// This method calls the revoker to check the status of the certificate cert.
    pub fn is_revoked<V: Revokable>(&self, cert: &V) -> Result<(), RevokeError> {
        self.revoker.is_revoked(cert)
    }
}

impl<R: Revoker> Validator for TrustValidator<R> {
    /// Checks the certificate if it is valid.
    /// If the CV knows a revoke server, that is queried as well.
    fn is_valid<V: Validatable + Revokable>(&self, cert: &V) -> Result<(), ValidationError> {
        // if the certificate is trusted, it is valid
        if self.trusted_certificates.contains(&cert.fingerprint()) {
            return Ok(());
        }

        // this returns an Error if it fails
        cert.self_validate(self)?;

        // this returns an Error if it fails
        self.revoker.is_revoked(cert)?;

        // if nothing fails, the certificate is valid!
        Ok(())
    }

    fn is_signature_valid(&self, _: &[u8], _: &[u8]) -> bool {
        // The TrustValidator is not using a single root public key, so no certificate signed by
        // a "root" key is valid.
        false
    }
}

#[test]
fn test_trusted_certificates() {
    use crate::certificate::Certificate;
    use crate::fingerprint::Fingerprint;
    use crate::meta::Meta;
    use crate::revoker::NoRevoker;
    use chrono::{DateTime, Utc};

    let mut meta = Meta::new_empty();
    meta.set("use-for", r#"["edcert.sign"]"#);

    let cert: Certificate = Certificate::generate_random(
        meta,
        DateTime::parse_from_rfc3339("2030-01-01T00:00:00+00:00")
            .unwrap()
            .with_timezone(&Utc),
    );
    let mut child: Certificate = Certificate::generate_random(
        Meta::new_empty(),
        DateTime::parse_from_rfc3339("2030-01-01T00:00:00+00:00")
            .unwrap()
            .with_timezone(&Utc),
    );

    cert.sign_certificate(&mut child).unwrap();

    let trusted = vec![cert.fingerprint()];

    let cv = TrustValidator::with_trusted_certificates(trusted, NoRevoker);

    match cv.is_valid(&child) {
        Err(x) => {
            println!("{:?}", x);
            panic!();
        }
        _ => {}
    };

    assert_eq!(cv.is_valid(&child).is_ok(), true);
}

#[test]
fn test_add_trusted_certificates() {
    use crate::certificate::Certificate;
    use crate::fingerprint::Fingerprint;
    use crate::meta::Meta;
    use crate::revoker::NoRevoker;
    use chrono::{DateTime, Utc};

    let meta = Meta::new_empty();

    let cert: Certificate = Certificate::generate_random(
        meta,
        DateTime::parse_from_rfc3339("2030-01-01T00:00:00+00:00")
            .unwrap()
            .with_timezone(&Utc),
    );

    let mut cv = TrustValidator::new(NoRevoker);

    assert_eq!(cv.is_valid(&cert).is_ok(), false);

    cv.add_trusted_certificates(vec![cert.fingerprint()]);

    assert_eq!(cv.is_valid(&cert).is_ok(), true);
}

#[test]
fn test_trusted_certificates_fail() {
    use crate::certificate::Certificate;
    use crate::fingerpri


ment

 What should we call this?

Also known as centering on the longest line, the longest line in a column is found and centered, and other entries in the column are aligned to the left edge of the longest line.

As before, header and footer cells are ignored, and the author should be able to exclude specified cells from the alignment process.

This type of alignment is often used in text, for poetry or prose extracts.

User agents should not break single-word cells.

12.2.
Table widths

In print, tables are not randomly sized but typically set to one of a few fixed widths. This requirement necessitates that a composition engine know how to “snap to” one of the desired widths. This may help show relationships between separate tables.

broadside

placement of caption/title

spread

multi-page

continued lines

13.
Lists, Indexes, and Tables of Contents

13.1.
Indexes

13.1.1.
Collapsing Page Ranges

When generating indexes or referring to page ranges, one often ends up with duplicated or sequential numbers.

1, 3, 3, 7, 8, 9, 10, 16

This should be formatted as:

1, 3, 7–10, 16

with duplicates removed and consecutive numbers replaced by ranges.

14.
Footnotes

Having to read footnotes resembles having to go downstairs to answer the door while in the midst of making love.

—Noël Coward

In print publishing, a footnote consists of two parts: a reference (often rendered as an asterisk or superscripted number) and the footnote body.

Footnotes themselves can be quite complicated. Footnotes can contain multiple paragraphs, block quotes, poems, lists, and tables. Footnotes can contain other footnotes (an edge case, admittedly, but David Foster Wallace was notorious for this). Footnotes can extend across multiple pages. In short, a footnote is a container that can hold almost anything.

In order to describe footnotes in HTML, one must


of(false, true))));
    getSolrClient().commit(true, true);

    assertQR(fieldName, "true", 2);
    assertQR(fieldName, "false", 2);

    Collection<Object> fieldValues = getSolrClient().getById("20000").getFieldValues(fieldName);
    assertEquals(2, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));
    fieldValues = getSolrClient().getById("20001").getFieldValues(fieldName);
    assertEquals(2, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));

    getSolrClient().add(sdoc("id", "20000", fieldName, Map.of("remove", List.of(false))));
    getSolrClient().commit(true, true);

    assertQR(fieldName, "true", 2);
    assertQR(fieldName, "false", 1);

    fieldValues = getSolrClient().getById("20000").getFieldValues(fieldName);
    assertEquals(1, fieldValues.size());
    assertThat(fieldValues, hasItems(true));
    fieldValues = getSolrClient().getById("20001").getFieldValues(fieldName);
    assertEquals(2, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));

    getSolrClient().add(sdoc("id", "20001", fieldName, Map.of("remove", List.of(true, false))));
    getSolrClient().commit(true, true);

    assertQR(fieldName, "true", 1);
    assertQR(fieldName, "false", 0);

    fieldValues = getSolrClient().getById("20000").getFieldValues(fieldName);
    assertEquals(1, fieldValues.size());
    assertThat(fieldValues, hasItems(true));
    assertThat(fieldValues, not(hasItems(false)));
    fieldValues = getSolrClient().getById("20001").getFieldValues(fieldName);
    assertNull(fieldValues);

    getSolrClient()
        .add(Arrays.asList(sdoc("id", "20000", fieldName, Map.of("add", List.of(false, false)))));
    getSolrClient().commit(true, true);

    assertQR(fieldName, "true", 1);
    assertQR(fieldName, "false", 1);

    fieldValues = getSolrClient().getById("20000").getFieldValues(fieldName);
    assertEquals(3, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));
    fieldValues = getSolrClient().getById("20001").getFieldValues(fieldName);
    assertNull(fieldValues);

    getSolrClient()
        .add(
            Arrays.asList(
                sdoc("id", "20000", fieldName, Map.of("set", List.of(true, false))),
                sdoc("id", "20001", fieldName, Map.of("set", List.of(false, true)))));
    getSolrClient().commit(true, true);

    assertQR(fieldName, "true", 2);
    assertQR(fieldName, "false", 2);

    fieldValues = getSolrClient().getById("20000").getFieldValues(fieldName);
    assertEquals(2, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));
    fieldValues = getSolrClient().getById("20001").getFieldValues(fieldName);
    assertEquals(2, fieldValues.size());
    assertThat(fieldValues, hasItems(true, false));
  }

  @Test
  public void testMultivalueCollationField() throws SolrServerException, IOException {
    runTestForFieldWithQuery("collationRemove", new String[] {"cf1", "cf2", "cf3", "cf4"});
  }

  @Test
  public void testMultivalueDatePointField() throws S


).secondary;
    final textColor = ColorScheme.of(context).onSecondary;

    final loadingIndicator = SpinKitFadingFour(color: textColor.withValues(alpha: 0.7), size: 10);

    const microChipSize = 28.0;
    final iconTextStyle = TextStyle(
      color: textColor,
      fontFeatures: const [FontFeature.tabularFigures()],
      fontSize: 11,
    );

    return SemanticIconButton(
      semanticsLabel: switch (eval) {
        LocalEval(:final depth) => '$engineName, ${context.l10n.depthX('$depth')}',
        CloudEval(:final depth) =>
          '${context.l10n.cloudAnalysis}, ${context.l10n.depthX('$depth')}',
        _ => context.l10n.loadingEngine,
      },
      onPressed: eval != null
          ? () {
              showPopover(
                context: context,
                bodyBuilder: (_) {
                  return _EnginePopup(eval: eval, goDeeper: goDeeper);
                },
                direction: PopoverDirection.top,
                width: 250,
                backgroundColor:
                    DialogTheme.of(context).backgroundColor ??
                    ColorScheme.of(context).surfaceContainerHigh,
                transitionDuration: Duration.zero,
                popoverTransitionBuilder: (_, child) => child,
              );
            }
          : null,
      icon: Badge(
        offset: const Offset(4, -7),
        backgroundColor: ColorScheme.of(context).tertiaryContainer,
        textColor: ColorScheme.of(context).onTertiaryContainer,
        label: eval is CloudEval ? const Text('CLOUD') : null,
        textStyle: const TextStyle(fontSize: 8),
        isLabelVisible: eval is CloudEval,
        child: AnimatedOpacity(
          opacity: engineState == EngineState.computing ? 1.0 : 0.8,
          duration: const Duration(milliseconds: 150),
          child: Stack(
            alignment: Alignment.center,
            children: [
              CustomPaint(
                size: const Size(microChipSize, microChipSize),
                painter: MicroChipPainter(color),
              ),
              SizedBox(
                width: microChipSize,
                height: microChipSize,
                child: RepaintBoundary(
                  child: Center(
                    child: eval?.depth != null
                        ? Text('${math.min(99, eval!.depth)}', style: iconTextStyle)
                        : loadingIndicator,
                  ),
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}

class MicroChipPainter extends CustomPainter {
  const MicroChipPainter(this.color);

  final Color color;

  @override
  void paint(Canvas canvas, Size size) {
    const pinLength = 3.5;
    const pinRadius = Radius.circular(1);
    const innerRimWidth = 1.0;
    const outerRimWidth = 2.5;

    final fillPaint = Paint()
      ..color = color
      ..style = PaintingStyle.fill;

    final strokePaint = Paint()
      ..color = color
      ..style = PaintingStyle.stroke
      ..strokeWidth = outerRimWidth;

    final innerSquareSize = size.width - pinLength - innerRimWidth - outerRimWidth / 2;

    final innerSquarePath = Path()
      ..addRRect(
        RRect.fromLTRBR(
          pinLength + innerRimWidth + outerRimWidth / 2,
          pinLength + innerRimWidth + outerRimWidth / 2,
          innerSquareSize,
          innerSquareSize,
          const Radius.circular(2),
        ),
      );

    final outerRimPath = Path()
      ..addRRect(
        RRect.fromLTRBR(
          pinLength,
          pinLength,
          size.width - pinLength,


93 0 0 0 .32 19.57l-22.38-1.34a12.28 12.28 0 0 1-11.76-12.79L107 119c1-12.17 13.87-11.27 13.26-11.32l29.11 1.73a144.35 144.35 0 0 0-7 19.17zm148.42 172.18a10.51 10.51 0 0 1-14.35-1.39l-9.68-11.49-34.42 27a8.09 8.09 0 0 1-11.13-1.08l-15.78-18.64a7.38 7.38 0 0 1 1.34-10.34l34.57-27.18-14.14-16.74-17.09 13.45a7.75 7.75 0 0 1-10.59-1s-3.72-4.42-3.8-4.53a7.38 7.38 0 0 1 1.37-10.34L214 225.19s-18.51-22-18.6-22.14a9.56 9.56 0 0 1 1.74-13.42 10.38 10.38 0 0 1 14.3 1.37l81.09 96.32a9.58 9.58 0 0 1-1.74 13.44zM187.44 419a18 18 0 1 0 18 18 18 18 0 0 0-18-18z"],
    "apple-pay": [640, 512, [], "f415", "M116.9 158.5c-7.5 8.9-19.5 15.9-31.5 14.9-1.5-12 4.4-24.8 11.3-32.6 7.5-9.1 20.6-15.6 31.3-16.1 1.2 12.4-3.7 24.7-11.1 33.8m10.9 17.2c-17.4-1-32.3 9.9-40.5 9.9-8.4 0-21-9.4-34.8-9.1-17.9.3-34.5 10.4-43.6 26.5-18.8 32.3-4.9 80 13.3 106.3 8.9 13 19.5 27.3 33.5 26.8 13.3-.5 18.5-8.6 34.5-8.6 16.1 0 20.8 8.6 34.8 8.4 14.5-.3 23.6-13 32.5-26 10.1-14.8 14.3-29.1 14.5-29.9-.3-.3-28-10.9-28.3-42.9-.3-26.8 21.9-39.5 22.9-40.3-12.5-18.6-32-20.6-38.8-21.1m100.4-36.2v194.9h30.3v-66.6h41.9c38.3 0 65.1-26.3 65.1-64.3s-26.4-64-64.1-64h-73.2zm30.3 25.5h34.9c26.3 0 41.3 14 41.3 38.6s-15 38.8-41.4 38.8h-34.8V165zm162.2 170.9c19 0 36.6-9.6 44.6-24.9h.6v23.4h28v-97c0-28.1-22.5-46.3-57.1-46.3-32.1 0-55.9 18.4-56.8 43.6h27.3c2.3-12 13.4-19.9 28.6-19.9 18.5 0 28.9 8.6 28.9 24.5v10.8l-37.8 2.3c-35.1 2.1-54.1 16.5-54.1 41.5.1 25.2 19.7 42 47.8 42zm8.2-23.1c-16.1 0-26.4-7.8-26.4-19.6 0-12.3 9.9-19.4 28.8-20.5l33.6-2.1v11c0 18.2-15.5 31.2-36 31.2zm102.5 74.6c29.5 0


ery: string) => {
    const beersDB = firebase.database().ref("beersDB");

    beersDB.push({ name, style, brewery });
  },

  update: (id: string, beer: object): void => {
    let beerDB = firebase.database().ref("beersDB").child(id);

    beerDB.update(beer);
  },
};

export default beerService;
import { readFileSync } from 'fs';
import { part1, part2 } from '.';

const input = readFileSync(`${__dirname}/input`, 'utf-8').split('\n').map(Number);

describe('Day 1', () => {
  describe('Part 1', () => {
    it('should find the two entries that sum to 2020', () => {
      expect.assertions(2);

      expect(part1([1721, 979, 366, 299, 675, 1456], 2020)).toStrictEqual(514579);
      expect(part1(input, 2020)).toStrictEqual(902451);
    });
  });

  describe('Part 2', () => {
    it('should find the three entries that sum to 2020', () => {
      expect.assertions(2);

      expect(part2([1721, 979, 366, 299, 675, 1456], 2020)).toStrictEqual(241861950);
      expect(part2(input, 2020)).toStrictEqual(85555470);
    });

    it('should not mutate input', () => {
      expect.assertions(1);

      const entries = [1721, 979, 366, 299, 675, 1456];

      part2(entries, 2020);

      expect(entries).toStrictEqual([1721, 979, 366, 299, 675, 1456]);
    });
  });
});
// Simple edge detection: check neighboring pixels for different values.
import type { Pixel } from "features/qed/matrix";
import { getPixelMatrix } from "features/qed/matrix";

export const drawSimple = (
  canvasIn: HTMLCanvasElement,
  canvasOut: HTMLCanvasElement
) => {
  const w = canvasIn.width;
  const h = canvasIn.height;
  const canvas2dIn = canvasIn.getContext("2d") as CanvasRenderingContext2D;
  const canvas2dOut = canvasOut.getContext("2d") as CanvasRenderingContext2D;

  const selection = canvas2dIn.getImageData(0, 0, w, h);
  const matrix = getPixelMatrix(selection);

  // Iterate through all but edge pixels.
  for (let x = 0; x < w - 1; x++) {
    for (let y = 0; y < h - 1; y++) {
      const currentPixel = matrix.get(x, y) as Pixel;
      const downPixel = matrix.get(x + 1, y) as Pixel;
      const rightPixel = matrix.get(x, y + 1) as Pixel;

      // Pixels match, no edge.
      if (
        currentPixel.r === downPixel.r &&
        currentPixel.g === downPixel.g &&
        currentPixel.b === downPixel.b &&
        currentPixel.a === downPixel.a &&
        //
        currentPixel.r === rightPixel.r &&
        currentPixel.g === rightPixel.g &&
        currentPixel.b === rightPixel.b &&
        currentPixel.a === rightPixel.a
      ) {
        canvas2dOut.fillStyle = "#ffffff"; // white
        canvas2dOut.fillRect(x, y, 1, 1);
      }
      // Pixels don't match, edge.
      else {
        canvas2dOut.fillStyle = "#000000"; // black
        canvas2dOut.fillRect(x, y, 1, 1);
      }
    }
  }
};
import { Subscribe, Unsubscribe } from './interface';
import { remove } from './utils';

export default class Emitter<T> {
    private subscribers: Array<Subscribe<T>> = [];

    public subscribe(sub: Subscribe<T>): Unsubscribe {
        this.subscribers.push(sub);
        return ()


using CryptoTool.Algorithms;
using LittleFancyTool.Utils;
using Org.BouncyCastle.Utilities.Encoders;
using System.Security.Cryptography;
using System.Text;

namespace LittleFancyTool.Algorithms
{
    public class DESEncryption : IEncryptionSymmetric
    {
        public string Encrypt(string input, string key = null, string paddingMode = "PKCS7", int keyLength = 64, string iv = null, string mode = null, string? outputType = "base64", string? keyIvType = "text")
        {
            using (DES desAlg = DES.Create())
            {
                if (keyIvType == "hex")
                {
                    desAlg.Key = Hex.Decode(key);
                    desAlg.IV = Hex.Decode(iv);
                }
                else if (keyIvType == "text")
                {
                    desAlg.Key = Encoding.UTF8.GetBytes(key);
                    desAlg.IV = Encoding.UTF8.GetBytes(iv);
                }
                else if (keyIvType == "base64")
                {
                    desAlg.Key = Convert.FromBase64String(key);
                    desAlg.IV = Convert.FromBase64String(iv);
                }
                else
                {
                    return "key iv type error";
                }
                desAlg.Padding = GetPaddingMode(paddingMode);
                desAlg.Mode = ToolMethod.EncryptMode(mode);

                ICryptoTransform encryptor = desAlg.CreateEncryptor(desAlg.Key, desAlg.IV);

                using (System.IO.MemoryStream msEncrypt = new System.IO.MemoryStream())
                {
                    using (CryptoStream csEncrypt = new CryptoStream(msEncrypt, encryptor, CryptoStreamMode.Write))
                    {
                        using (System.IO.StreamWriter swEncrypt = new System.IO.StreamWriter(csEncrypt))
                        {
                            swEncrypt.Write(input);
                        }
                        byte[] encrypted = msEncrypt.ToArray();
                        if (outputType == "base64")
                        {
                            return Convert.ToBase64String(encrypted);
                        }
                        else if (outputType == "hex")
                        {
                            return Hex.ToHexString(encrypted);
                        }
                        return "output type error";
                    }
                }
            }
        }

        public string Decrypt(string input, string key = null, string paddingMode = "PKCS7", int


ieldNames ? '' : 'butDayColor')
    ..aOS(3, _omitFieldNames ? '' : 'butNightColor')
    ..hasRequiredFields = false;

  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  MerchandiseButton clone() => deepCopy();
  @$core.Deprecated('See https://github.com/google/protobuf.dart/issues/998.')
  MerchandiseButton copyWith(void Function(MerchandiseButton) updates) =>
      super.copyWith((message) => updates(message as MerchandiseButton))
          as MerchandiseButton;

  @$core.override
  $pb.BuilderInfo get info_ => _i;

  @$core.pragma('dart2js:noInline')
  static MerchandiseButton create() => MerchandiseButton._();
  @$core.override
  MerchandiseButton createEmptyInstance() => create();
  static $pb.PbList<MerchandiseButton> createRepeated() =>
      $pb.PbList<MerchandiseButton>();
  @$core.pragma('dart2js:noInline')
  static MerchandiseButton getDefault() => _defaultInstance ??=
      $pb.GeneratedMessage.$_defaultFor<MerchandiseButton>(create);
  static MerchandiseButton? _defaultInstance;

  @$pb.TagNumber(1)
  $core.String get butTitle => $_getSZ(0);
  @$pb.TagNumber(1)
  set butTitle($core.String value) => $_setString(0, value);
  @$pb.TagNumber(1)
  $core.bool hasButTitle() => $_has(0);
  @$pb.TagNumber(1)
  void clearButTitle() => $_clearField(1);

  @$pb.TagNumber(2)
  $core.String get butDayColor => $_getSZ(1);
  @$pb.TagNumber(2)
  set butDayColor($core.String value) => $_setString(1, value);
  @$pb.TagNumber(2)
  $core.bool hasButDayColor() => $_has(1);
  @$pb.TagNumber(2)
  void clearButDayColor() => $_clearField(2);

  @$pb.TagNumber(3)
  $core.String get butNightColor => $_getSZ(2);
  @$pb.TagNumber(3)
  set butNightColor($core.String value) => $_setString(2, value);
  @$pb.TagNumber(3)
  $core.bool hasButNightColor() => $_has(2);
  @$pb.TagNumber(3)
  void clearButNightColor() => $_clearField(3);
}

class MerchandiseCard extends $pb.GeneratedMessage {
  factory MerchandiseCard({
    $core.String? cover,
    $core.String? title,
    $core.Iterable<MerchandiseTitle>? subTitle,
    MerchandiseButton? button,
    $0.Any? sourceContent,
  }) {
    final result = create();
    if (cover != null) result.cover = cover;
    if (title != null) result.title = title;
    if (subTitle != null) result.subTitle.addAll(subTitle);
    if (button != null) result.button = button;
    if (sourceContent != null) result.sourceContent = sourceContent;
    return result;
  }

  MerchandiseCard._();

  factory MerchandiseCard.fromBuffer($core.List<$core.int> data,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromBuffer(data, registry);
  factory MerchandiseCard.fromJson($core.String json,
          [$pb.ExtensionRegistry registry = $pb.ExtensionRegistry.EMPTY]) =>
      create()..mergeFromJson(json, registry);

  static final $pb.BuilderInfo _i = $pb.BuilderInfo(
      _omitMessageNames ? '' : 'Merchandise


CacN/mBLzbj4DijlRtvywggAAAABJRU5ErkJggg==') !important;
	background-repeat: no-repeat !important;
}

.ocx_palette_pencil_x24 {
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABI0lEQVRIib2VQUoDQRBFf8UxMyIIgkuDK0E8hofQXVyMMOLem7jpRW/6Et7DG+iICCYIgjCtmXw3naCNkMqkk79qiq73eqiCAdYcAYBhWT0CGCRm186aIwTBNDF8zsxSg+OoBJdX17skRwCKUGoAHDprxkkEJMci0g9nikhB8gVAnkQQwF8BKCQ9woIkEThrisW3VhAMy8oD6Eflb2dNXOsmCHBGtW1No3oGIiLAfMhCxr4VBfxFDOd0QwY28AVdoxU0JGerOnu9TyZw1uwoH9JNsHX3wLb39+rB52s7uj1b2K8StL1skE+aJ58VAgD5pIEGrhbg5vT5oqyy+5Pz9iPfx55/P35TNS6xRc6aKWAEALTwpQRdszFBvYb/cp2Y939+AHaab/0tnBmvAAAAAElFTkSuQmCC') !important;
	background-repeat: no-repeat !important;
}

.ocx_palette_pencil_x32 {
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAA7EAAAOxAGVKw4bAAABR0lEQVRYhe2XT06DQBhHHxRqTUCXxjO40Jh4FRfdsGExGv9cptFZjIvZeJ4a7+BCTUygpgq1uBAVjTXpQEeb8FvBB3zvJcwMA/xxHIAoFgkQWmZnWskVrzwJgRegYwmelky8SrGjlXRs0KNYFO/H3m832sjyCUSxCHgbvDdAUJafgE1grJV8XqgA0APufqg9mIyhuQW0kvdRLOZ9rDmBUqKx2WIkUJ1G1Vh5BU2nFWgFWoHlE4hi0QUSYO3bpcSKgFYyA9ZNYI0IRLEILndEOnF9Cj5XXn+a0R/K3sI/x1rJkT84+AIHKHCKeeFGAgD50bbjD66K3PUBWM0fGZ/uuSa9jGdBf3ge6t2TFGD/+mJDG/YxFtBKjpyzY7zpBK3krWmfWutAcbjl5HUa1BVoIv9KIJu11VpAPn4DvUqhawlOCU8t8mbnFcRDW/DFP9aJAAAAAElFTkSuQmCC') !important;
	background-repeat: no-repeat !important;
}

.ocx_palette_pencil_x48 {
	background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAA7EAAAOxAGVKw4bAAABuUlEQVRoge2ZsUrDUBSG/2M7Ojm6SBcFxaVdxDdwchQUUqUFi0LrM3QUE


ror> {
        let result: Result<ICPTs, (Option<i32>, String)> = call(
            LEDGER_CANISTER_ID,
            "total_supply_pb",
            protobuf,
            TotalSupplyArgs {},
        )
        .await;

        result.map_err(|(code, msg)| {
            GovernanceError::new_with_message(
                ErrorType::External,
                format!(
                    "Error calling method 'total_supply' of the ledger canister. Code: {:?}. Message: {}",
                    code, msg
                )
            )
        })
    }

    async fn account_balance(&self, account: AccountIdentifier) -> Result<ICPTs, GovernanceError> {
        let result: Result<ICPTs, (Option<i32>, String)> = call(
            LEDGER_CANISTER_ID,
            "account_balance_pb",
            protobuf,
            AccountBalanceArgs { account },
        )
        .await;

        result.map_err(|(code, msg)| {
            GovernanceError::new_with_message(
                ErrorType::External,
                format!(
                    "Error calling method 'account_balance_pb' of the ledger canister. Code: {:?}. Message: {}",
                    code, msg
                )
            )
        })
    }
}

#[export_name = "canister_init"]
fn canister_init() {
    dfn_core::printer::hook();

    match GovernanceProto::decode(&arg_data()[..]) {
        Err(err) => {
            println!(
                "Error deserializing canister state in initialization: {}.",
                err
            );
            Err(err)
        }
        Ok(proto) => {
            canister_init_(proto);
            Ok(())
        }
    }
    .expect("Couldn't initialize canister.");
}

#[candid_method(init)]
fn canister_init_(init_payload: GovernanceProto) {
    println!(
        "{}canister_init: Initializing with: economics: \
              {:?}, genesis_timestamp_seconds: {}, neuron count: {}",
        LOG_PREFIX,
        init_payload.economics,
        init_payload.genesis_timestamp_seconds,
        init_payload.neurons.len()
    );

    unsafe {
        assert!(
            GOVERNANCE.is_none(),
            "{}Trying to initialize an already-initialized governance canister!",
            LOG_PREFIX
        );
        GOVERNANCE = Some(Governance::new(
            init_payload,
            Box::new(CanisterEnv::new()),
            Box::new(LedgerCanister {}),
        ));
    }
    governance()
        .validate()
        .expect("Error initializing the governance canister.");
}

#[export_name = "canister_pre_upgrade"]
fn canister_pre_upgrade() {
    println!("{}Executing pre upgrade", LOG_PREFIX);

    let mut writer = BufferedStableMemWriter::new(STABLE_MEM_BUFFER_SIZE);

    governance()
        .proto
        .encode(&mut writer)
        .expect("Error. Couldn't serialize canister pre-upgrade.");

    writer.flush(); // or `drop(writer)`
}

#[export_name = "canister_post_upgrade"]
fn canister_post_upgrade() {
    dfn_core::printer::hook();
    println!("{}Executing post upgrade", LOG_PREFIX);

    let reader = BufferedStableMemReader::new(STABLE_MEM_BUFFER_SIZE);

    match GovernanceProto::decode(reader) {
        Err(err) => {
            println!(
                "Error deserializing canister state post-upgrade. \
             CANISTER MIGHT HAVE BROKEN STATE!!!!. Error: {:?}",
                err
            );
            Err(err)
        }
        Ok(proto) => {
            canister_init_(proto);
            Ok(())
        }
    }
    .expect("Couldn't upgrade canister.");
}

#[export_name = "canister_update update_authz"]
fn update_authz() {
    check_caller_is


    title: 'French',
    color: Colors.pink,
  ),
  Category(
    id: 'c10',
    title: 'Summer',
    color: Colors.teal,
  ),
];

const dummyMeals = [
  Meal(
    id: 'm1',
    categories: [
      'c1',
      'c2',
    ],
    title: 'Spaghetti with Tomato Sauce',
    affordability: Affordability.affordable,
    complexity: Complexity.simple,
    imageUrl:
        'https://upload.wikimedia.org/wikipedia/commons/thumb/2/20/Spaghetti_Bolognese_mit_Parmesan_oder_Grana_Padano.jpg/800px-Spaghetti_Bolognese_mit_Parmesan_oder_Grana_Padano.jpg',
    duration: 20,
    ingredients: [
      '4 Tomatoes',
      '1 Tablespoon of Olive Oil',
      '1 Onion',
      '250g Spaghetti',
      'Spices',
      'Cheese (optional)'
    ],
    steps: [
      'Cut the tomatoes and the onion into small pieces.',
      'Boil some water - add salt to it once it boils.',
      'Put the spaghetti into the boiling water - they should be done in about 10 to 12 minutes.',
      'In the meantime, heaten up some olive oil and add the cut onion.',
      'After 2 minutes, add the tomato pieces, salt, pepper and your other spices.',
      'The sauce will be done once the spaghetti are.',
      'Feel free to add some cheese on top of the finished dish.'
    ],
    isGlutenFree: false,
    isVegan: true,
    isVegetarian: true,
    isLactoseFree: true,
  ),
  Meal(
    id: 'm2',
    categories: [
      'c2',
    ],
    title: 'Toast Hawaii',
    affordability: Affordability.affordable,
    complexity: Complexity.simple,
    imageUrl:
        'https://cdn.pixabay.com/photo/2018/07/11/21/51/toast-3532016_1280.jpg',
    duration: 10,
    ingredients: [
      '1 Slice White Bread',
      '1 Slice Ham',
      '1 Slice Pineapple',
      '1-2 Slices of Cheese',
      'Butter'
    ],
    steps: [
      'Butter one side of the white bread',
      'Layer ham, the pineapple and cheese on the white bread',
      'Bake the toast for round about 10 minutes in the oven at 200°C'
    ],
    isGlutenFree: false,
    isVegan: false,
    isVegetarian: false,
    isLactoseFree: false,
  ),
  Meal(
    id: 'm3',
    categories: [
      'c2',
      'c3',
    ],
    title: 'Classic Hamburger',
    affordability: Affordability.pricey,
    complexity: Complexity.simple,
    imageUrl:
        'https://cdn.pixabay.com/photo/2014/10/23/18/05/burger-500054_1280.jpg',
    duration: 45,
    ingredients: [
      '300g Cattle Hack',
      '1 Tomato',
      '1 Cucumber',
      '1 Onion',
      'Ketchup',
      '2 Burger Buns'
    ],
    steps: [
      'Form 2 patties',
      'Fry the patties for c. 4 minutes on each side',
      'Quickly fry the buns for c. 1 minute on each side',
      'Bruch buns with ketchup',
      'Serve burger with tomato, cucumber and onion'
    ],
    isGlutenFree: false,
    isVegan: false,
    isVegetarian: false,
    isLactoseFree: true,
  ),
  Meal(
    id: 'm4',
    categories: [
      'c4',
    ],
    title: 'Wiener Schnitzel',
    affordability: Aff


#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int n;							//µĿ,0<n<100
int doc[101]={0};				//¼ÿµʼλ
int l=0;						//
char lines[2000][90]={0};
int num=0;						//
int words[15000];				//
int step;
struct term{
	char Word[100];
	int Doc;
	int Line;
}Term[15000];					//
int cmp(const void *a, const void *b)
{
	int x,y,z;
	x=*(int *)a;
	y=*(int *)b;
	z=strcmp(Term[x].Word,Term[y].Word);
	if (z==0)
		z=Term[x].Line-Term[y].Line;
	return z;
}
void input(int p)
{
	int i,j;
	doc[p]=l;
	while (gets(lines[l]),strcmp(lines[l],"**********")!=0)
	{
		words[num]=num;
		j=0;
		for (i=0;lines[l][i]!='\0';i++)
		{
			if (isalpha(lines[l][i])==0)
			{
				if (j!=0)
				{
					Term[num].Doc=p;
					Term[num].Line=l;
					num++;
					words[num]=num;
					j=0;
				}
			}
			else Term[num].Word[j++]=tolower(lines[l][i]);
		}
		if (j!=0)
		{
			Term[num].Doc=p;
			Term[num].Line=l;
			num++;
		}
		l++;
	}
}
int search(char *w)
{
	int low=0;
	int high=num-1;
	int mid;
	int i,temp;
	step=-1;
	while (low<=high)
	{
		mid=(low+high)/2;
		temp=strcmp(Term[words[mid]].Word,w);
		if (temp<0)
			low=mid+1;
		else if (temp>0)
			high=mid-1;
		else break;
	}
	if (low<=high)
	{
		for (step=mid+1;strcmp(Term[words[step]].Word,w)==0;step++);
		do
			mid--;
		while (strcmp(Term[words[mid]].Word,w)==0);
		return mid+1;
	}
	return -1;
}
void AndOr(int and,char *s,char *t)
{
	int a,b,c,d,i,j,one=0;
	int not[2][101]={0};
	int sort[2000]={0};
	a=search(s);
	b=step;
	c=search(t);
	d=step;
	for (i=a;i<b;i++)
		not[0][Term[words[i]].Doc]=1;
	for (i=c;i<d;i++)
		not[1][Term[words[i]].Doc]=1;
	for (i=a;i<b;i++)
		if (not[0][Term[words[i]].Doc]+not[1][Term[words[i]].Doc]+and>1)
			one=1,sort[Term[words[i]].Line]=1;
	for (i=c;i<d;i++)
		if (not[0][Term[words[i]].Doc]+not[1][Term[words[i]].Doc]+and>1)
			one=1,sort[Term[words[i]].Line]=1;
	if (one==0)
	{
		puts("Sorry, I found nothing.");
		return;
	}
	one=0;
	for (i=0;i<n;i++)
	{
		if (not[0][i]+not[1][i]+and<=1)
			continue;
		if (one==1) puts("----------");
		one=1;
		for (j=doc[i];j<doc[i+1];j++)
		{
			if (sort[j]==1)
				puts(lines[j]);
		}
	}
}
void query()
{
	int i,j,k;
	int one=0,and;
	int not[101]={0};
	int D,L;
	char str[200];
	char s[200],r[200];
	gets(str);
	for (i=0,j=0;str[i]!='\0' && str[i]!=' ';i++,j++)
		s[j]=str[i];
	s[j]='\0';
	if (strcmp("NOT",s)==0)
	{
		for (i++,j=0;str[i]!='\0';i++,j++)
			s[j]=str[i];
		s[j]='\0';
		k=search(s);
		while (k<step)
		{
			not[Term[words[k]].Doc]=1;
			k++;
		}
		for (i=0;i<n;i++)
		{
			if (not[i]==1)
				continue;
			if (one==1) puts("----------");
			for (j=doc[i];j<doc[i+1];j++)
				puts(lines[j]);
			one=1;
		}
	}
	else {
		if (str[i]=='\0')
		{
			k=search(s);
			if (k==-1)
			{
				puts("Sorry, I found nothing.");
				return;
			}
			D=Term[words[k]].Doc;
			L=Term[words[k]].Line;
			puts(lines[L]);
			for (i=k+1;i<step;i++)
			{
				if (D!=Term[words[i]].Doc)
				{
					puts("----------");
					D=Term[words[i]].Doc;
				}
				else if (L==Term[words[i]].Line)
					continue;
				L=Term[words[i]].Line;
				puts(lines[L]);
			}
			return ;
		}
		for (i++,j=0;str[i]!=' ';i++,j++)
			r[j]=str[i];
		r[j]='\0';
		if (strcmp(r,"AND")==0)	and=0;
		else	and=1;
		for (i++,j=0;str[i]!='\0';i++,j++)
			r[j]=str[i];
		r[j]='\0';
		AndOr(and,s,r);
	}
}
int main()
{
	int i,m;
	scanf("%d\n",&n);
	for (i=0;i<n;i++)
		input(i);
	doc[n]=l;
	qsort(words,num,sizeof(words[0]),cmp);
	scanf("%d\n",&m);
	for (i=0;i<m;i++)
	{
		query();
		puts("==========");
	}
	return 0;
}


)
                }
            }

            override fun onDenied(deniedList: MutableList<String>) {
                toast(R.string.no_read_store_permission_tips)
                task.run()
            }
        }, Manifest.permission.READ_EXTERNAL_STORAGE)
    }

    fun delBackup(task: Runnable) {

        PermissionManager.request(object : PermissionListener {
            override fun onGranted(grantedList: MutableList<String>) {
                kotlin.run {
                    FileUtil.deleteFile(BACKUP_FILE_PATH)
                    task.run()
                    toast(getString(R.string.backup_success))
                }
            }

            override fun onDenied(deniedList: MutableList<String>) {
                toast(R.string.no_wire_store_permission_tips)
                task.run()
            }
        }, Manifest.permission.READ_EXTERNAL_STORAGE)

    }
}package com.allever.lib.recommend

import java.util.concurrent.TimeUnit

import okhttp3.OkHttpClient
import okhttp3.ResponseBody
import retrofit2.Callback
import retrofit2.Retrofit
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory
import retrofit2.converter.gson.GsonConverterFactory
import rx.Subscriber
import rx.android.schedulers.AndroidSchedulers
import rx.schedulers.Schedulers

/**
 * Created by Allever on 2017/1/15.
 */

object RetrofitUtil {
    private const val BASE_URL = "https://raw.githubusercontent.com/devallever/DataProject/master/"
    private val retrofit: Retrofit
    private val retrofitService: RetrofitService

    init {
        val client = OkHttpClient.Builder()
            .connectTimeout(5000, TimeUnit.SECONDS)
            .build()
        retrofit = Retrofit.Builder()
            .client(client)
            .addConverterFactory(GsonConverterFactory.create())
            .addCallAdapterFactory(RxJavaCallAdapterFactory.create())
            .baseUrl(BASE_URL)
            .build()
        retrofitService = retrofit.create(RetrofitService::class.java)
    }

    fun getRecommendZh(subscriber: Subscriber<RecommendBean>) {
        retrofitService.getRecommendZh()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .unsubscribeOn(Schedulers.io())
            .subscribe(subscriber)
    }
    fun getRecommendEn(subscriber: Subscriber<RecommendBean>) {
        retrofitService.getRecommendEn()
            .subscribeOn(Schedulers.io())
            .observeOn(AndroidSchedulers.mainThread())
            .unsubscribeOn(Schedulers.io())
            .subscribe(subscriber)
    }

//    fun translate(
//        subscriber: Subscriber<TranslationBean>,
//        content: String,
//        sl: String,
//        tl: String
//    ) {
//        retrofitService.translate(content, sl = sl, tl = tl)
//            .subscribeOn(Schedulers.io())
//            .observeOn(AndroidSchedulers.mainThread())
//            .unsubscribeOn(Schedulers.io())
//            .subscribe(subscriber)
//    }
//
//    fun requestTTS(content: String, tl: String, callback: Callback<ResponseBody>) {
//        val call =
//            retrofitService.requestTTS(q = content, tl = tl, textlen = content.length.toString())
//        call.enqueue(callback)
//    }
}
package com.allever.lib.common.util

import android.app.Service
import android.util.DisplayMetrics
import android.view.WindowManager
import com.allever.lib.common.app.App

/**
 * Created by allever on 17-8-5.
 * 单位转换工具类
 */

object DisplayUtils {

    private val TAG = "DisplayUtil"

    /**
     * 将px转换成dip或dp
     * @param context
     * @param px 像素值
     * @density 转换比例 例如1dp = 3px, density值就是3
     *
     * 320x480      mdpi    1dp = 1px   density = 1
     * 480x800      hdpi    1dp = 1.5px density = 1.5
     * 720x1280


dart:io';

import 'package:anytime/services/settings/mobile_settings_service.dart';
import 'package:anytime/ui/anytime_podcast_app.dart';
import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:logging/logging.dart';

// ignore_for_file: avoid_print
void main() async {
  List<int> certificateAuthorityBytes = [];
  WidgetsFlutterBinding.ensureInitialized();
  SystemChrome.setSystemUIOverlayStyle(const SystemUiOverlayStyle(statusBarColor: Colors.transparent));

  Logger.root.level = Level.FINE;

  Logger.root.onRecord.listen((record) {
    print('${record.level.name}: - ${record.time}: ${record.loggerName}: ${record.message}');
  });

  var mobileSettingsService = (await MobileSettingsService.instance())!;
  certificateAuthorityBytes = await setupCertificateAuthority();

  runApp(AnytimePodcastApp(
    mobileSettingsService: mobileSettingsService,
    certificateAuthorityBytes: certificateAuthorityBytes,
  ));
}

/// When certificate authorities certificates expire, older devices may not be able to handle
/// the re-issued certificate resulting in SSL errors being thrown. This routine is called to
/// manually install the newer certificates on older devices so they continue to work.
Future<List<int>> setupCertificateAuthority() async {
  List<int> ca = [];
  var loadedCerts = false;

  if (Platform.isAndroid) {
    DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
    AndroidDeviceInfo androidInfo = await deviceInfo.androidInfo;
    var major = androidInfo.version.release.split('.');

    if ((int.tryParse(major[0]) ?? 100.0) < 8.0) {
      ByteData data = await PlatformAssetBundle().load('assets/ca/lets-encrypt-r3.pem');
      ca.addAll(data.buffer.asUint8List());
      loadedCerts = true;
    }

    if ((int.tryParse(major[0]) ?? 100.0) < 10.0) {
      ByteData data = await PlatformAssetBundle().load('assets/ca/globalsign-gcc-r6-alphassl-ca-2023.pem');
      ca.addAll(data.buffer.asUint8List());
      loadedCerts = true;
    }

    if (loadedCerts) {
      SecurityContext.defaultContext.setTrustedCertificatesBytes(ca);
    }
  }

  return ca;
}
// Copyright 2020 Ben Hills and the project contributors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

import 'package:anytime/entities/episode.dart';

abstract class QueueEvent {
  Episode? episode;
  int? position;

  QueueEvent({
    this.episode,
    this.position,
  });
}

class QueueAddEvent extends QueueEvent {
  QueueAddEvent({required Episode super.episode, super.position});
}

class QueueRemoveEvent extends QueueEvent {
  QueueRemoveEvent({required Episode episode}) : super(episode: episode);
}

class QueueMoveEvent extends QueueEvent {
  final int oldIndex;
  final int newIndex;

  QueueMoveEvent({
    required Episode episode,
    required this.oldIndex,
    required this.newIndex,
  }) : super(episode: episode);
}

class QueueClearEvent extends QueueEvent {}

abstract class QueueState {
  final Episode? playing;
  final List<Episode> queue;

  QueueState({
    required this.playing,
    required this.queue,
  });
}

class Que


жение качества изображения";
OPTION_TOOLTIP_WATCH_FRAME_WIDTH = "Увеличивает ширину списка отслеживаемых задач.";
OPTION_TOOLTIP_WATER_COLLISION = "Расположение камеры над водой, если персонаж находится на поверхности воды, и под водой, если он ныряет.";
OPTION_TOOLTIP_WEATHER_DETAIL = "Изменение интенсивности погодных эффектов. Уменьшение значения этого параметра может привести к повышению производительности игры.";
OPTION_TOOLTIP_WINDOWED_MAXIMIZED = "Запуск игры в развернутом окне.";
OPTION_TOOLTIP_WINDOWED_MODE = "Запуск игры в оконном режиме.\n\nПри этом используются параметры гаммы, установленные для монитора, и регулировка гаммы средствами игры становится недоступной.";
OPTION_TOOLTIP_WINDOW_LOCK = "Блокировка изменения размера окна игры.";
OPTION_TOOLTIP_WINDOW_SIZE = "Настройка разрешения окна игры";
OPTION_TOOLTIP_WORLD_LOD = "Адаптация геометрической детализации ландшафта. Включение этого параметра может повысить производительность игры.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY1 = "Отображать задачи для открытых PvP-зон, когда вы находитесь в соответствующих зонах.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY2 = "Отображать задачи для открытых PvP-зон, когда вы находитесь рядом с соответствующими объектами.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY3 = "Не отображать задачи для открытых PvP-зон.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY_ALWAYS = "Отображать задачи для открытых PvP-зон, когда вы находитесь в соответствующих зонах.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY_DYNAMIC = "Отображать задачи для открытых PvP-зон, когда вы находитесь рядом с соответствующими объектами.";
OPTION_TOOLTIP_WORLD_PVP_DISPLAY_NEVER = "Не отображать задачи открытых PvP-зон.";
OPTION_TOOLTIP_WOW_MOUSE = "Включите этот параметр, если у вас есть игровая мышь World of Warcraft и вы хотите назначить какие-либо действия на дополнительные кнопки.";
OPTION_TOOLTIP_XP_BAR = "Отображение текстовой информации на индикаторе опыта.";
OPTION_TOOTIP_RETINA_CURSOR = "Включите, чтобы использовать указатели высокого разрешения.\nДля мониторов с очень высоким разрешением/


/**
 *	BitThunder Kernel Entry for ARM architectures.
 */

#include <btlinker_config.h>
#include <asm/assembly.h>

.section .bt.init.vectors					// The HEAD of the kernel is placed by the .bt.init section.
.globl bt_reset

.extern __bt_mmu_table_start
.extern bt_do_bug

	/*
	 *	This defines the ARM vector table, it is repeated twice, so that it may be used on initial
	 *	boot-up from address 0x0, but also a trampoline can be injected within the space of
     * 	the first copy of the table for starting other processors.
	 */
_bt_vector_table:
#ifdef BT_CONFIG_USE_VIRTUAL_ADDRESSING
  ldr pc, =(bt_reset - BT_CONFIG_RAM_VIRT + BT_CONFIG_RAM_PHYS)
#else
	ldr pc, =bt_reset	// Reset vector
#endif
	ldr	pc, [pc, #24]							// undefined instruction vector
	ldr pc, [pc, #24]							// SVC handler
	ldr pc, [pc, #24]							// Prefetch abort handler
	ldr pc, [pc, #24]							// Data abort handler
	ldr pc, [pc, #24]							// Historical Handler - Was invalid address from the old 26-bit ARM CPUs
	ldr pc, [pc, #24]							// IRQ handler
	ldr pc, [pc, #24]							// FIQ handler

	.word 	bt_reset
	.word	undefined
	.word	_bt_syscall_entry
	.word	prefetch
	.word	data
	.word	hang
#ifndef BT_CONFIG_KERNEL_NONE
	.word 	vFreeRTOS_IRQInterrupt
#else
	.word	BT_ARCH_ARM_GIC_IRQHandler
#endif
	.word	fiq

	.align	5									// Guarantee that 2nd table falls on a 32byte boundary.

_bt_vector_second_table:
#ifdef BT_CONFIG_USE_VIRTUAL_ADDRESSING
  ldr pc, =(bt_reset - BT_CONFIG_RAM_VIRT + BT_CONFIG_RAM_PHYS)
#else
	ldr pc, =bt_reset	// Reset vector
#endif
	ldr	pc, [pc, #24]							// undefined instruction vector
	ldr pc, [pc, #24]							// SVC handler
	ldr pc, [pc, #24]							// Prefetch abort handler
	ldr pc, [pc, #24]							// Data abort handler
	ldr pc, [pc, #24]							// Historical Handler - Was invalid address from the old 26-bit ARM CPUs
	ldr pc, [pc, #24]							// IRQ handler
	ldr pc, [pc, #24]							// FIQ handler

	.word 	bt_reset
	.word	undefined
	.word	_bt_syscall_entry
	.word	prefetch
	.word	data
	.word	hang
#ifndef BT_CONFIG_KERNEL_NONE
	.word 	vFreeRTOS_IRQInterrupt
#else
	.word	BT_ARCH_ARM_GIC_IRQHandler
#endif
	.word	fiq
_bt_vector_table_end:

.section .bt.init

bt_reset:
	/*
	 * Disable the IRQs as soon as possible, just in-case the boot-loader was naughty!
	 */
	mrs	r9,cpsr
	orr	r9,r9,#0x80
	msr	cpsr_c,r9

	mov r7,	r1	// Sa


I/gguf-models/qwen2-72b-FT-1110
# 量化(可选)
./quantize old-gguf-f16.gguf new-gguf-q4_0.gguf q4_0
```
### 四、将一个本地模型导入ollama
```
# 要先修改modelfile文件，将其与gguf文件绑定
ollama crate YOUR-MODEL-NAME -f /path/to/your/modelfile.txt
```

## 一键脚本
```
bash train-from-tensor-to-ollama-model.sh YOUR_TRAIN_NAME
```

## 文档的解析处理

#### ~~部署一个mark_server，用于接收用户文档，并解析成markdown~~ ps:改成docling
```
# dockerfile 文件参考 marker_docker.dockerfile
docker pull dockerpull.org/dibz15/marker_docker
```
~~调用方式~~
```
docker run -v .\documents\:/pdfs dockerpull.org/dibz15/marker_docker python convert_single.py /pdfs/1.pdf /pdfs/1.md --parallel_factor 2 --max_pages 10

```
#### ~~使用convert_pdfs.py批量处理pdf文件~~
```
# 基本用法
python convert_pdfs.py ./documents ./output

# 指定并行因子和最大页数
python convert_pdfs.py ./documents ./output --parallel_factor 4 --max_pages 20
```

> 使用cursor 完成convert_pdf的编写，并测试通过。
>> 写一个python程序，遍历输入文件夹中的所有子目录，对于其中的pdf文件做如下处理：调用marker_docker程序将pdf转换为md格式文件，并将所有输出文件保存到输出文件夹中 ***

#### 使用docling 处理文件
```
FROM dockerproxy.net/yokohide0317/docling:2.5.2
```
```
# examples
docker run -it --rm -v .:/work docling docling /work/documents/1.pdf
```
#### 拆分章节
```
请写一个python程序，将documents/test.md 文件的内容按照不同的章节划分为多个文件，文件名为章节名称+标题
```# ICP Image Classification

https://internetcomputer.org/docs/current/developer-docs/ai/ai-on-chain

https://github.com/dfinity/examples/tree/6edfa86177fed55ac2cb641ee2359de6a6bbccf9/rust/image-classification

official canister: https://qmbwn-qaaaa-aaaak-aknvq-cai.icp0.io/
my canister: https://nlb26-cyaaa-aaaak-akqwq-cai.icp0.io/

This is an ICP smart contract that accepts an image from the user and runs image classification inference.
The smart contract consists of two canisters:

- the backend canister embeds the [the Tract ONNX inference engine](https://github.com/sonos/tract) with [the MobileNet v2-7 model](https://github.com/onnx/models/tree/main/validated/vision/classification/mobilenet). It provides a `classify()` endpoint for the frontend code to call.
- the frontend canister contains the Web assets such as HTML, JS, CSS that are served to the browser.

Note that currently Wasm execution is not optimized for this workload.
A single call executes about 24B instructions (~10s).

This


字段为空字符串时，Location方法应该返回空的URL。
2. Location字段包含一个相对路径时，Location方法应该将其解析为绝对路径的URL。
3. Location字段包含一个绝对路径时，Location方法应该将其解析为绝对路径的URL。
4. Location字段包含一个完整的URL时，Location方法应该直接返回该URL。

这些测试用例可以确保net包中的Response结构体在处理不同类型的Location字段时表现正确，并且可以提高代码的可靠性和稳定性。

---

### Structs:

### respTest

在go/src/net中，response_test.go这个文件定义了一些测试用例来测试net包中的Response结构体的功能。在这个文件中，respTest是一个定义在测试用例里的结构体，用于存储测试用例的输入和期望输出。

respTest结构体的定义如下：

```go
type respTest struct {
    req  string                // 输入的请求字符串
    resp *Response             // 期望输出的 Response 对象
    err  error                 // 期望输出的 error 对象
}
```

其中，req字段是一个字符串类型，表示要测试的HTTP请求的完整消息，包括第一行请求行和请求头。resp字段是一个指向Response结构体的指针，表示预期的HTTP响应结果。err字段是一个error类型，表示预期的错误信息。

在每个测试用例中，我们创建一个respTest结构体实例，将输入和期望输出的值都填进去。然后，我们调用Response的解析函数解析输入的请求字符串，并与期望输出的结果进行比较。

通过使用respTest结构体，我们可以轻松地添加、运行和扩展测试用例，从而确保Response结构体的正确功能。

### readerAndCloser

在`response_test.go`文件中，`readerAndCloser`结构体是一个测试用的ReadCloser接口的实现。它主要的作用是为了模拟一个网络连接的响应体，用于在测试中验证Response对象在接收和处理响应时的正确性。

该结构体实现了`io.Reader`和`io.Closer`接口，其中`Reader`接口的作用是读取响应体的内容，而`Closer`接口的作用是关闭响应体的连接。在模拟响应体时，结构体中的`buf`变量保存了响应体的内容，`closed`变量用于记录响应体是否已经被关闭。

在响应对象的测试中，`readerAndCloser`结构体会被用来创建一个包含特定状态码、响应头和响应体的Response实例，然后测试对Response实例的方法进行验证，确保它们正确地处理响应体的读取和连接关闭。

总的来说，`readerAndCloser`结构体是一个用于在测试中提供模拟响应体的工具，使得测试更加可靠和可控。

### responseLocationTest

responseLocationTest是一个测试用的结构体，用


#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
**Project Name:**      MakeHuman

**Product Home Page:** http://www.makehumancommunity.org/

**Github Code Home Page:**    https://github.com/makehumancommunity/

**Authors:**           Jonas Hauquier

**Copyright(c):**      MakeHuman Team 2001-2020

**Licensing:**         AGPL3

    This file is part of MakeHuman (www.makehumancommunity.org).

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero 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 Affero General Public License for more details.

    You should have received a copy of the GNU Affero General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

Abstract
--------

Skeleton library.
Allows a selection of skeletons which can be exported with the MH character.
Skeletons are used for skeletal animation (skinning) and posing.
"""

# TODO add sort by number of bones

from . import skeletonlibrary

#------------------------------------------------------------------------------------------
#   Load plugin
#------------------------------------------------------------------------------------------

def load(app):
    global maintask
    import gui3d
    import mh
    category = app.getCategory('Pose/Animate')
    maintask = skeletonlibrary.SkeletonLibrary(category)
    maintask.sortOrder = -0.5
    category.addTask(maintask)

    human = gui3d.app.selectedHuman
    app.addLoadHandler('skeleton', maintask.loadHandler)
    app.addSaveHandler(maintask.saveHandler, priority=5)

    if not mh.isRelease():
        from . import debugtab
        debugtask = debugtab.SkeletonDebugLibrary(category)
        debugtask.sortOrder = 3
        category = app.getCategory('Utilities')
        category.addTask(debugtask)

# This method is called when the plugin is unloaded from makehuman
# At the moment this is not used, but in the future it will remove the added GUI elements
def unload(app):
    maintask.onUnload()


ound, CancellationToken cancellationToken)
        => Trace(stream, Operations.ReadEvents, () => Inner.ReadEvents(stream, start, count, failIfNotFound, cancellationToken));

    [RequiresDynamicCode(AttrConstants.DynamicSerializationMessage)]
    [RequiresUnreferencedCode(AttrConstants.DynamicSerializationMessage)]
    public Task<StreamEvent[]> ReadEventsBackwards(StreamName stream, StreamReadPosition start, int count, bool failIfNotFound, CancellationToken cancellationToken)
        => Trace(stream, Operations.ReadEvents, () => Inner.ReadEventsBackwards(stream, start, count, failIfNotFound, cancellationToken));

    // ReSharper disable once ConvertToAutoProperty
    protected override string ComponentName => _componentName;
}


// For example, if each `indices[m]` is scalar or vector, we have
//
// ```python
//     # Scalar indices:
//     merged[indices[m], ...] = data[m][...]
//
//     # Vector indices:
//     merged[indices[m][i], ...] = data[m][i, ...]
// ```
//
// Each `data[i].shape` must start with the corresponding `indices[i].shape`,
// and the rest of `data[i].shape` must be constant w.r.t. `i`.  That is, we
// must have `data[i].shape = indices[i].shape + constant`.  In terms of this
// `constant`, the output shape is
//
//     merged.shape = [max(indices)] + constant
//
// Values are merged in order, so if an index appears in both `indices[m][i]` and
// `indices[n][j]` for `(m,i) < (n,j)` the slice `data[n][j]` will appear in the
// merged result. If you do not need this guarantee, ParallelDynamicStitch might
// perform better on some devices.
//
// For example:
//
// ```python
//     indices[0] = 6
//     indices[1] = [4, 1]
//     indices[2] = [[5, 2], [0, 3]]
//     data[0] = [61, 62]
//     data[1] = [[41, 42], [11, 12]]
//     data[2] = [[[51, 52], [21, 22]], [[1, 2], [31, 32]]]
//     merged = [[1, 2], [11, 12], [21, 22], [31, 32], [41, 42],
//               [51, 52], [61, 62]]
// ```
//
// This method can be used to merge partitions created by `dynamic_partition`
// as illustrated on the following example:
//
// ```python
//     # Apply function (increments x_i) on elements for which a certain condition
//     # apply (x_i != -1 in this example).
//     x=tf.constant([0.1, -1., 5.2, 4.3, -1., 7.4])
//     condition_mask=tf.not_equal(x,tf.constant(-1.))
//     partitioned_data = tf.dynamic_partition(
//         x, tf.cast(condition_mask, tf.int32) , 2)
//     partitioned_data[1] = partitioned_data[1] + 1.0
//     condition_indices = tf.dynamic_partition(
//         tf.range(tf.shape(x)[0]), tf.cast(condition_mask, tf.int32) , 2)
//     x = tf.dynamic_stitch(condition_indices, partitioned_data)
//     # Here x=[1.1, -1., 6.2, 5.3, -1, 8.4], the -1. values remain
//     # unchanged.
// ```
//
//

//
//

func DynamicStitch(scope *Scope, indices []tf.Output, data []tf.Output) (merged tf.Output) {
	if scope.Err() != nil {
		return
	}
	opspec := tf.OpSpec{
		Type: "DynamicStitch",
		Input: []tf.Input{
			tf.OutputList(indices), tf.OutputList(data),
		},
	}
	op := scope.AddOperation(opspec)
	return op.Output(0)
}

// Records the bytes size of each element of `input_dataset` in a StatsAggregator.
func BytesProducedStatsDataset(scope *Scope, input_dataset tf.Output, tag tf.Output, output_types []tf.DataType, output_shapes []tf.Shape) (handle tf.Output) {
	if scope.Err() != nil {
		return
	}
	attrs := map[string]interface{}{"output_types": output_types, "output_shapes": output_shapes}
	opspec := tf.OpSpec{
		Type: "BytesProducedStatsDataset",
		Input: []tf.Input{
			input_dataset, tag,


// CHECK: encoding: [0x8f,0x69,0x80,0x95,0x7c,0x82,0xc0]
vpshlw -64(%rdx,%rax,4), %xmm15, %xmm15

// CHECK: vpshlw 64(%rdx,%rax,4), %xmm6, %xmm6
// CHECK: encoding: [0x8f,0xe9,0xc8,0x95,0x74,0x82,0x40]
vpshlw 64(%rdx,%rax,4), %xmm6, %xmm6

// CHECK: vpshlw -64(%rdx,%rax,4), %xmm6, %xmm6
// CHECK: encoding: [0x8f,0xe9,0xc8,0x95,0x74,0x82,0xc0]
vpshlw -64(%rdx,%rax,4), %xmm6, %xmm6

// CHECK: vpshlw 64(%rdx,%rax), %xmm15, %xmm15
// CHECK: encoding: [0x8f,0x69,0x80,0x95,0x7c,0x02,0x40]
vpshlw 64(%rdx,%rax), %xmm15, %xmm15

// CHECK: vpshlw 64(%rdx,%rax), %xmm6, %xmm6
// CHECK: encoding: [0x8f,0xe9,0xc8,0x95,0x74,0x02,0x40]
vpshlw 64(%rdx,%rax), %xmm6, %xmm6

// CHECK: vpshlw 64(%rdx), %xmm15, %xmm15
// CHECK: encoding: [0x8f,0x69,0x80,0x95,0x7a,0x40]
vpshlw 64(%rdx), %xmm15, %xmm15

// CHECK: vpshlw 64(%rdx), %xmm6, %xmm6
// CHECK: encoding: [0x8f,0xe9,0xc8,0x95,0x72,0x40]
vpshlw 64(%rdx), %xmm6, %xmm6

// CHECK: vpshlw (%rdx), %xmm15, %xmm15
// CHECK: encoding: [0x8f,0x69,0x80,0x95,0x3a]
vpshlw (%rdx), %xmm15, %xmm15

// CHECK: vpshlw (%rdx), %xmm6, %xmm6
// CHECK: encoding: [0x8f,0xe9,0xc8,0x95,0x32]
vpshlw (%rdx), %xmm6, %xmm6

// CHECK: vpshlw %xmm15, 485498096, %xmm15
// CHECK: encoding: [0x8f,0x69,0x00,0x95,0x3c,0x25,0xf0,0x1c,0xf0,0x1c]
vpshlw %xmm15, 485498096, %xmm15

// CHECK: vpshlw %xmm15, 64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x8f,0x69,0x00,0x95,0x7c,0x82,0x40]
vpshlw %xmm15, 64(%rdx,%rax,4), %xmm15

// CHECK: vpshlw %xmm15, -64(%rdx,%rax,4), %xmm15
// CHECK: encoding: [0x8f,0x69,0x00,0x95,0x7c,0x82,0xc0]
vpshlw %xmm15, -64(%rdx,%rax,4), %xmm15

// CHECK: vpshlw %xmm15, 64(%rdx,%rax), %xmm15
// CHECK: encoding: [0x8f,0x69,0x00,0x95,0x7c,0x02,0x40]
vpshlw %xmm15, 64(%rdx,%rax), %xmm15

// CHECK: vpshlw


    + sizeof(samplespersec)
    + sizeof(avgbps)
    + sizeof(blockalign)
    + sizeof(bitspersample)
    + sizeof(cbsize);

  ui32_t write_count = 0;
  ui64_t RIFF_len = data_len + SimpleWavHeaderLength - 8;
  //  DefaultLogSink().Debug("RIFF_len is %llu.\n", RIFF_len);
  byte_t* tmp_header = NULL;
  ui32_t header_len = 0;

  if (RIFF_len > MAX_RIFF_LEN)
  {
    DefaultLogSink().Debug("Will write out an RF64 wave file.\n");
    ui32_t data32_len = ((data_len < MAX_RIFF_LEN) ? data_len : MAX_RIFF_LEN);
    ui64_t data64_len = ((data_len < MAX_RIFF_LEN) ? 0 : data_len);
    static ui32_t ds64_len =
            sizeof(RIFF_len)
            + sizeof(data64_len)
            + sizeof(SAMPLE_COUNT)
            + sizeof(TABLE_LEN);

    header_len = SIMPLE_RF64_HEADER_LEN;
    tmp_header = new byte_t[header_len];
    byte_t* p = tmp_header;
    p += Kumu::i2p<fourcc>(FCC_RF64, p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(MAX_RIFF_LEN), p);
    p += Kumu::i2p<fourcc>(Wav::FCC_WAVE, p);
    p += Kumu::i2p<fourcc>(FCC_ds64, p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(ds64_len), p);
    p += Kumu::i2p<ui64_t>(KM_i64_LE(RIFF_len), p);
    p += Kumu::i2p<ui64_t>(KM_i64_LE(data64_len), p);
    p += Kumu::i2p<ui64_t>(KM_i64_LE(SAMPLE_COUNT), p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(TABLE_LEN), p);
    p += Kumu::i2p<fourcc>(Wav::FCC_fmt_, p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(fmt_len), p);
    p += Kumu::i2p<ui16_t>(KM_i16_LE(format), p);
    p += Kumu::i2p<ui16_t>(KM_i16_LE(nchannels), p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(samplespersec), p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(avgbps), p);
    p += Kumu::i2p<ui16_t>(KM_i16_LE(blockalign), p);
    p += Kumu::i2p<ui16_t>(KM_i16_LE(bitspersample), p);
    p += Kumu::i2p<ui16_t>(KM_i16_LE(cbsize), p);
    p += Kumu::i2p<fourcc>(Wav::FCC_data, p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(data32_len), p);
    write_count = (p - tmp_header);
  }
  else
  {
    DefaultLogSink().Debug("Will write out a regular wave file.\n");
    header_len = SimpleWavHeaderLength;
    tmp_header = new byte_t[header_len];
    byte_t* p = tmp_header;
    p += Kumu::i2p<fourcc>(Wav::FCC_RIFF, p);
    p += Kumu::i2p<ui32_t>(KM_i32_LE(RIFF_len), p);
    p += Kumu::i2p<fourcc>(Wav::FCC_WAVE, p);
    p += Kumu::i2p<fourcc>(


 full block")
    }

    if c.iv != nil {
        ct := c.decryptWithIV(src)
        copy(dst, ct)
    } else {
        ct := c.decrypt(src)
        copy(dst, ct)
    }
}

func (c *spritzCipher) encrypt(m []byte) []byte {
    ctxt := make([]byte, len(m))

    for i, x := range c.squeeze(len(ctxt)) {
        ctxt[i] = m[i] + x
    }

    return ctxt
}

func (c *spritzCipher) decrypt(m []byte) []byte {
    ptxt := make([]byte, len(m))

    for i, x := range c.squeeze(len(ptxt)) {
        ptxt[i] = m[i] - x
    }

    return ptxt
}

func (c *spritzCipher) encryptWithIV(m []byte) []byte {
    c.absorbStop()
    c.absorb(c.iv)

    ctxt := make([]byte, len(m))

    for i, x := range c.squeeze(len(ctxt)) {
        ctxt[i] = m[i] + x
    }

    return ctxt
}

func (c *spritzCipher) decryptWithIV(m []byte) []byte {
    c.absorbStop()
    c.absorb(c.iv)

    ptxt := make([]byte, len(m))

    for i, x := range c.squeeze(len(ptxt)) {
        ptxt[i] = m[i] - x
    }

    return ptxt
}

func (c *spritzCipher) initializeState() {
    c.w = 1

    for i := 0; i < N; i++ {
        c.s[i] = byte(i)
    }
}

func (c *spritzCipher) absorb(I []byte) {
    for _, b := range I {
        c.absorbByte(b)
    }
}

func (c *spritzCipher) absorbByte(b byte) {
    c.absorbNibble(b & 0x0f)
    c.absorbNibble((b & 0xf0) >> 4)
}

func (c *spritzCipher) absorbNibble(x byte) {

    if c.a == N/2 {
        c.shuffle()
    }

    c.s[c.a], c.s[N/2+x] = c.s[N/2+x], c.s[c.a]
    c.a++
}

func (c *spritzCipher) absorbStop() {

    if c.a == N/2 {
        c.shuffle()
    }

    c.a++
}

func (c *spritzCipher) shuffle() {
    c.whip(2 * N)
    c.crush()
    c.whip(2 * N)
    c.crush()
    c.whip(2 * N)
    c.a = 0
}

func (c *spritzCipher) whip(r int) {
    for v := 0; v < r; v++ {
        c.update()
    }

    c.w += 2
}

func (c *spritzCipher) crush() {

    for v := 0; v <


T_R = crate::R<u16, u16>;
impl R {
    #[doc = "Bits 0:15 - Current Target Value for the SensorStrobe Channel 1"]
    #[inline(always)]
    pub fn ss1tgt(&self) -> SS1TGT_R {
        SS1TGT_R::new((self.bits & 0xffff) as u16)
    }
}
extern crate serde;
extern crate serde_json;

use self::serde::{Deserialize, Serialize};
use std::fs::File;
use std::io::{BufRead, BufReader};
use std::path::PathBuf;

#[derive(Debug)]
pub struct JormungandrLogger {
    pub log_file_path: PathBuf,
}

#[derive(Serialize, Deserialize)]
pub struct LogEntry {
    msg: String,
    level: String,
    ts: String,
    task: String,
}

impl JormungandrLogger {
    pub fn new(log_file_path: PathBuf) -> Self {
        JormungandrLogger { log_file_path }
    }

    pub fn get_lines_with_error(&self) -> impl Iterator<Item = String> {
        let lines = self.get_lines_from_log();
        lines.filter(JormungandrLogger::is_error_line)
    }

    fn is_error_line(line: &String) -> bool {
        let entry: LogEntry = serde_json::from_str(&line).expect(&format!(
            "Cannot parse log line into json '{}'. Please ensure json logger is used for node",
            &line
        ));
        entry.level == "ERROR"
    }

    fn get_lines_from_log(&self) -> impl Iterator<Item = String> {
        let file = File::open(self.log_file_path.clone()).unwrap();
        let reader = BufReader::new(file);
        reader.lines().map(|line| line.unwrap())
    }
}
<gh_stars>1-10
use sdl2::keyboard::Mod;
use shrev::EventChannel;
use specs::BitSet;
use std::ops::{Deref, DerefMut};

pub use sdl2::{
    controller::{Axis as ControllerAxis, Button as ControllerButton},
    keyboard::Keycode,
    mouse::MouseButton,
};

/// Resource for accessing delta time
#[derive(Debug)]
pub struct Time {
    pub first_frame: f32,
    delta: f32,
    timescale: f32,
}

impl Time {
    pub fn new(first_frame: f32, delta: f32, timescale: f32) -> Self {
        Self {
            first_frame,
            delta,
            timescale,
        }
    }

    pub fn delta(&self) -> f32 {
        self.delta * self.timescale
    }

    pub fn timescale(&self) -> f32 {
        self.timescale
    }
}

impl Default for Time {
    fn default() -> Self {
        Self {
            delta: 1.,
            first_frame: 0.,
            timescale: 1.,
        }
    }
}

#[derive(Default)]
pub struct DirtyEntities {
    pub dirty: BitSet,
}

/// Resource for signaling that the user has asked to close the game
#[derive(Debug, Default)]
pub struct ShouldClose(pub bool);

/// Is the main window focused?
#[derive(Debug, Default)]
pub struct FocusGained(pub bool);

#[derive(Debug)]
pub struct KeyboardEvent {
    pub pressed: bool,
    pub keycode: Keycode,
    pub keymod: Mod,
    pub repeat: bool,
}

#[derive(Default)]
pub struct KeyboardEvents(EventChannel<KeyboardEvent>);

impl Deref for KeyboardEvents {
    type Target = EventChannel<KeyboardEvent>;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl DerefMut for KeyboardEvents {
    fn deref_mut(&mut self) -> &mut Self::Target {
        &mut self.0
    }
}

#[derive(Debug)]
pub enum MouseEvent {
    Button {
        pressed: bool,
        button: MouseButton,
        clicks: u8,


 fails
*/
public static final List<String> getColumnNames(ResultSet rs) throws SQLException
{
	List<String> columnNames = new ArrayList<String>();

	ResultSetMetaData meta = rs.getMetaData();

	int numColumns = meta.getColumnCount();
	for (int i = 1; i <= numColumns; ++i) {
		columnNames.add(meta.getColumnName(i));
	}

	return columnNames;
}

}
import play.Play;
import play.PlayPlugin;
import play.libs.IO;
import play.libs.MimeTypes;
import play.mvc.Http.Request;
import play.mvc.Http.Response;
import play.mvc.Router;
import play.vfs.VirtualFile;

import java.io.File;

public class DocViewerPlugin extends PlayPlugin {

    @Override
    public boolean rawInvocation(Request request, Response response) throws Exception {
        if ("/@api".equals(request.path) || "/@api/".equals(request.path)) {
            response.status = 302;
            response.setHeader("Location", "/@api/index.html");
            return true;
        }
        if (request.path.startsWith("/@api/")) {
            if (request.path.matches("/@api/-[a-z]+/.*")) {
                String module = request.path.substring(request.path.indexOf("-") + 1);
                module = module.substring(0, module.indexOf("/"));
                VirtualFile f = Play.modules.get(module).child("documentation/api/" + request.path.substring(8 + module.length()));
                if (f.exists()) {
                    response.contentType = MimeTypes.getMimeType(f.getName());
                    response.out.write(f.content());
                }
                return true;
            }
            File f = new File(Play.frameworkPath, "documentation/api/" + request.path.substring(6));
            if (f.exists()) {
                response.contentType = MimeTypes.getMimeType(f.getName());
                response.out.write(IO.readContent(f));
            }
            return true;
        }
        return false;
    }

    @Override
    public void onRoutesLoaded() {
        Router.prependRoute("GET", "/@documentation/?", "PlayDocumentation.index");
        Router.prependRoute("GET", "/@documentation/{id}", "PlayDocumentation.page");
        Router.prependRoute("GET", "/@documentation/home", "PlayDocumentation.index");
        Router.prependRoute("GET", "/@documentation/{docLang}/{id}", "PlayDocumentation.page");
        Router.prependRoute("GET", "/@documentation/images/{name}", "PlayDocumentation.image");
        Router.prependRoute("GET", "/@documentation/files/{name}", "PlayDocumentation.file");
        Router.prependRoute("GET", "/@documentation/{docLang}/images/{name}", "PlayDocumentation.image");
        Router.prependRoute("GET", "/@documentation/{docLang}/files/{name}", "PlayDocumentation.file");
        Router.prependRoute("GET", "/@documentation/{docLang}/modules/{module}/{id}", "PlayDocumentation.page");
        Router.prependRoute("GET", "/@documentation/{docLang}/releases/{id}", "PlayDocumentation.releases");
        Router.prependRoute("GET", "/@documentation/{docLang}/releases/{version}/{id}", "PlayDocumentation.releases");
        Router.prependRoute("GET", "/@documentation/modules/{module}/images/{name}", "PlayDocumentation.image");
        Router.prependRoute("GET", "/@documentation/modules/{module}/files/{name}", "PlayDocumentation.file");
        Router.prependRoute("GET", "/@documentation/cheatsheet/{category}", "PlayDocumentation.cheatSheet");
        Router.prependRoute("GET", "/@documentation/{docLang}/cheatsheet/{category}", "PlayDocumentation.cheatSheet");
        Router.prependRoute("GET", "/@projectdocs/?", "ProjectDocumentation.index");
        Router.prependRoute("


Store(2)
  $store0.watch(watch.fn)
  $store1.watch(watch.fn)

  assert.is($store0.getState(), 1)
  assert.is($store1.getState(), 2)
  assert.is(watch.callCount, 2)
  assert.equal(watch.calls[0].arguments, [1])
  assert.equal(watch.calls[1].arguments, [2])

  persist({ store: $store0, adapter: adapter1, key: 'same-key-1' })
  persist({ store: $store1, adapter: adapter2, key: 'same-key-1' })

  await timeout(0)

  assert.is($store0.getState(), 0)
  assert.is($store1.getState(), 0)
  assert.is(watch.callCount, 4)
  assert.equal(watch.calls[2].arguments, [0])
  assert.equal(watch.calls[3].arguments, [0])

  //
  ;($store0 as any).setState(3)
  await timeout(0)

  assert.is($store0.getState(), 3)
  assert.is($store1.getState(), 3) // <- also changes
  assert.is(watch.callCount, 6)
  assert.equal(watch.calls[4].arguments, [3])
  assert.equal(watch.calls[5].arguments, [3])
})

test('should not throw on storage access error', async () => {
  const watch = snoop(() => undefined)
  const fail = createEvent<any>()
  fail.watch(watch.fn)

  const $storex = createStore(0, { name: 'counterx' })

  const throwAdapter = asyncStorage({
    storage() {
      throw new Error('Access denied')
    },
  })

  assert.not.throws(() =>
    persist({ store: $storex, adapter: throwAdapter, fail })
  )

  await timeout(0)

  assert.is(watch.callCount, 1)
  const { error, ...args } = watch.calls[0].arguments[0 as any] as any
  assert.equal(args, {
    key: 'counterx',
    keyPrefix: '',
    operation: 'get',
    value: undefined,
  })
  assert.instance(error, Error)
  assert.match(error, /Access denied/)
})

//
// Launch tests
//

test.run()
export interface IChart {
  series: IChartSerie[];
}

export interface IChartSerie {
  name: string;
  values: ChartValue[];
}

export class ChartValue {
  name: string;
  value: number;
}

export enum AbsenceType {
  Avspassering = 1,
  Sykmelding = 2,
  Permisjon = 3,
  Egenmelding = 4,
}
'use strict';

const canvas = document.querySelector('.main-canvas') as HTMLCanvasElement;
const ctx = canvas.getContext('2d');

// DO NOT TOUCH THE CODE ABOVE THIS LINE
// Draw the night sky:
//  - The background should be black
//  - The stars should be small squares
//  - The stars should have random positions on the canvas
//  - The stars should have random color (some shade of grey)

ctx.fillStyle = "black";
ctx.fillRect(0, 0, canvas.width, canvas.height);

for (let i: number = 0; i < 1000; i++) {
    let starSize: number = Math.floor(Math.random()*3+1);
    let starColor: number = Math.round(Math.random()*255);
    ctx.fillStyle = 'rgb(' + starColor + ',' + starColor + ',' + starColor + ')';
    ctx.fillRect(Math.round(Math.random()*canvas.width), Math.round(Math.random()*canvas.height), starSize, starSize);
}
/**
 * 锚点URL规范化
 * https://github.com/vuejs/vitepress/blob/master/src/node/markdown/plugins/slugify.


zrezc0k#1318450719069000",,"105422871059252962617","z12ld3fwhlnexv5b004cjv0oapmuflzrezc0k",0,1,"./105422871059252962617",1,,,0,[,,,,,,,,,,,,[]
,,,,,[]
,0]
,"https://lh3.googleusercontent.com/-QYC7Qdg28q0/AAAAAAAAAAI/AAAAAAAAAAA/LsVJ5PVgoOc/photo.jpg"]
,[,"J.C. Kendall","\u003cspan class\u003d\"proflinkWrapper\"\u003e\u003cspan class\u003d\"proflinkPrefix\"\u003e+\u003c/span\u003e\u003ca href\u003d\"https://plus.google.com/117937415022745482256\" class\u003d\"proflink\" oid\u003d\"117937415022745482256\"\u003eCameron Siguenza\u003c/a\u003e\u003c/span\u003e  Nope. This is not an external document. This is something best sent up the chain. Google is charitable if not misguided to allow it to remain public, as it serves no purpose beyond a detailed rant. I have no problem with strong opinions, but this is not one that should have gone over the firewall for many reasons. \u003cbr /\u003e\u003cbr /\u003eYou dont put your employer in this position, right or wrong. I can confirm that Google management is very good at listening to their staff, which makes it all the more curious as to why this has seen the light of day. I think this does not get written and posted this way unless all sides know the kid is on the way out the door. \u003cbr /\u003e\u003cbr /\u003eThis not exactly an upward mobility action. Have your opinion, share it where it can do some good. If you shared it up the chain and they told you to fuck off, then shut the fuck up and do your job, or find another place that better appreciates your point of view. \u003cbr /\u003e\u003cbr /\u003eI\u0026#39;ve been both a developer and a manager of developers and had the kid worked for me, wrote this and not showed it to me first, before posting it public, I\u0026#39;d be handing him a box.",1318450734435,"z12ld3fwhlnexv5b004cjv0oapmuflzrezc0k#1318450734435000",,"115145812983523155770","z12ld3fwhlnexv5b004cjv0oapmuflzrezc0k",0,1,"./115145812983523155770",1,,,0,["5/jcsn4v34ahnbiu3ghtmrkxlpgcs30h33hdv30vv1i1qretngjdtaeyn3a1pmagdna4w3chdkawtnch1naos30g0/asbe#comment#1318450734435000",5,,,,,0.0,,,,,,[[6.0,,[]
]
]
,0,,,6,[]
,0,0]
,"https://lh6.googleusercontent.com/-sRdzAbm23vE/AAAAAAAAAAI/AAAAAAAAAAA/S__XOdlWwrU/photo.jpg"]
,[,"Dmitriy Likhten","The first step to solving a problem is admitting you have one. This man should be praised and his advice taken to heart at every level of google.",131845078


*
If {@code descriptorType} is {@link NVRayTracing#VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV}, the {@code pNext} chain must include a {@link VkWriteDescriptorSetAccelerationStructureNV} structure whose {@code accelerationStructureCount} member equals {@code descriptorCount}

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE DESCRIPTOR_TYPE_SAMPLED_IMAGE}, then the {@code imageView} member of each {@code pImageInfo} element must have been created without a {@link VkSamplerYcbcrConversionInfo} structure in its {@code pNext} chain

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, and if any element of {@code pImageInfo} has a {@code imageView} member that was created with a {@link VkSamplerYcbcrConversionInfo} structure in its {@code pNext} chain, then {@code dstSet} must have been allocated with a layout that included immutable samplers for {@code dstBinding}, and the corresponding immutable sampler must have been created with an identically defined {@link VkSamplerYcbcrConversionInfo} object

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER}, and {@code dstSet} was allocated with a layout that included immutable samplers for {@code dstBinding}, then the {@code imageView} member of each element of {@code pImageInfo} which corresponds to an immutable sampler that enables sampler Y’CBCR conversion must have been created with a {@link VkSamplerYcbcrConversionInfo} structure in its {@code pNext} chain with an identically defined {@link VkSamplerYcbcrConversionInfo} to the corresponding immutable sampler

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_IMAGE DESCRIPTOR_TYPE_STORAGE_IMAGE}, for each descriptor that will be accessed via load or store operations the {@code imageLayout} member for corresponding elements of {@code pImageInfo} must be {@link VK10#VK_IMAGE_LAYOUT_GENERAL IMAGE_LAYOUT_GENERAL}

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER DESCRIPTOR_TYPE_UNIFORM_BUFFER} or {@link VK10#VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC}, the {@code offset} member of each element of {@code pBufferInfo} must be a multiple of {@link VkPhysicalDeviceLimits}{@code ::minUniformBufferOffsetAlignment}

 *
If {@code descriptorType} is {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_BUFFER DESCRIPTOR_TYPE_STORAGE_BUFFER} or {@link VK10#VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAM


d

Styleguide 6.8.1
*/

[data-toggle="sort"] {
    .glyphicon-sort-by-attributes(); // default icon - sorting asc
    white-space: nowrap;
    cursor: pointer;
    .user-select(none);

    // Actual icon
    &:before {
        .glyphicon();
        margin-right: .5ex;
        color: @gray-light;
    }

    &.sorting-desc {
        .glyphicon-sort-by-attributes-alt();
    }

    &:hover,
    &:focus {
        &:before {
            color: @text-color;
        }
    }

    &:focus {
        outline: none;
    }

    // Highlight column by which we are currently sorting
    &.sorting-asc,
    &.sorting-desc {
        &:before {
            color: @brand-warning;
        }
    }
}

/*
Sortable Table with Navigation

Table with automatically generated header sections and letter navigation.

Markup:

                        #
                        User

                       1
                        Brown, James

                        2
                        Paisley, Brad

                        3
                        Parker, Maceo

                        4
                        Wesley, Fred

Styleguide 6.8.2
*/

.sortable-table-nav ul {
    &:extend(.nav all);
    &:extend(.nav-letters all);
}
/*
Datetimepicker

[Bootstrap Datetimepicker](http://eonasdan.github.io/bootstrap-datetimepicker/) created by
[Jonathan Peterson](https://github.com/Eonasdan).

JavaScript Required

        Please note that `moment.js` (must be loaded before `bootstrap.js`) and `bootstrap-datetimepicker.js` are
        required.

Markup:

    Pick date and time
    <div class="input-group date" data-onload


'''
Kattis - lowerorderzeros
This is a scam solution... It is quite obvious that we don't need to store all the digits before the
trailing zeros, but how many is a good enough number? Well.. im not sure but we can just store as many
as we can... 20 digits is probably enough since people coding in C++ will not even be able to store
that many digits in a long long. (note storing 20 digits will give AC)

Thinking abit, the number of digits before the trailing zeros must be at least 1 more than the number
of additional zeros that can occur after multiplying by i. Every matching 2 and 5 prime factor will
produce 1 more additional zero. E.g. from 14! to 15!, we multiply by 15 = 3 * 5. We are adding 1
more 0 due to the additional prime factor of 5. Note that the pairing is limited by the number of 5s
rather than the number of 2s. So in the worse case scenario, we are adding 7 5s to the prime
factorisation when we go from (5^8 -1)! to (5^8)!, so thats 8 extra 0s and thus we need to minimally
store 9 digits.

Note that generally, if we compute until UPPERBOUND!, we need to store floor(log5(UPPERBOUND)) + 1
digits.

Time: O(1e6), Space: O(1e6)
'''
from math import log10, floor
lowestnonzero = [1]

for i in range(1, int(1e6) + 1):
    x = lowestnonzero[-1] * i
    while (x % 10 == 0):
        x //= 10
    x %= 10**(9) # store minimally 9 digits
    lowestnonzero.append(x)
    # print(i, x)

while(1):
    c = int(input())
    if (c == 0):
        break
    print(lowestnonzero[c] % 10)


from .detector3d_template import Detector3DTemplate

class PVRCNNPlusPlus(Detector3DTemplate):
    def __init__(self, model_cfg, num_class, dataset):
        super().__init__(model_cfg=model_cfg, num_class=num_class, dataset=dataset)
        self.module_list = self.build_networks()

    def forward(self, batch_dict):
        batch_dict = self.vfe(batch_dict)
        batch_dict = self.backbone_3d(batch_dict)
        batch_dict = self.map_to_bev_module(batch_dict)
        batch_dict = self.backbone_2d(batch_dict)
        batch_dict = self.dense_head(batch_dict)

        batch_dict = self.roi_head.proposal_layer(
            batch_dict, nms_config=self.roi_head.model_cfg.NMS_CONFIG['TRAIN' if self.training else 'TEST']
        )
        if self.training:
            targets_dict = self.roi_head.assign_targets(batch_dict)
            batch_dict['rois'] = targets_dict['rois']
            batch_dict['roi_labels'] = targets_dict['roi_labels']
            batch_dict['roi_targets_dict'] = targets_dict
            num_rois_per_scene = targets_dict['rois'].shape[1]
            if 'roi_valid_num' in batch_dict:
                batch_dict['roi_valid_num'] = [num_rois_per_scene for _ in range(batch_dict['batch_size'])]

        batch_dict = self.pfe(batch_dict)
        batch_dict = self.point_head(batch_dict)
        batch_dict = self.roi_head(batch_dict)

        if self.training:
            loss, tb_dict, disp_dict = self.get_training_loss()

            ret_dict = {
                'loss': loss
            }
            return ret_dict, tb_dict, disp_dict
        else:
            pred_dicts, recall_dicts = self.post_processing(batch_dict)
            return pred_dicts, recall_dicts

    def get_training_loss(self):
        disp_dict = {}
        loss_rpn, tb_dict = self.dense_head.get_loss()
        if self.point_head is not None:
            loss_point, tb_dict = self.point_head.get_loss(tb_dict)
        else:
            loss_point = 0
        loss_rcnn, tb_dict = self.roi_head.get_loss(tb_dict)

        loss = loss_rpn + loss_point + loss_rcnn
        return loss, tb_dict, disp_dict


Outlined:opsz,wght,FILL,GRAD@24,400,0..1,0',
      ),
      link(rel: 'stylesheet', href: '/assets/css/main.css?v=3'),

      script(src: '/assets/js/main.js?v=4'),
      if (pageData['js'] case final List<Object?> jsList)
        for (final js in jsList)
          if (js case {'url': final String jsUrl, 'defer': final Object? defer})
            script(
              src: jsUrl,
              attributes: {if (defer == 'true' || defer == true) 'defer': ''},
            ),
      script(
        src:
            'https://cdn.jsdelivr.net/npm/@justinribeiro/lite-youtube@1.8.2/lite-youtube.js',
        attributes: {
          'type': 'module',
          'integrity': 'sha256-Jy0j0fUMJ2T3WxSEs2WjHLrS+3DlO7S9DItQtP55FII=',
          'crossorigin': 'anonymous',
          'referrerpolicy': 'no-referrer',
        },
      ),

      // Set up tag manager and analytics.
      raw('''

'''),
      raw('''

'''),
    ];
  }

  @override
  Component buildBody(Page page, Component child) {
    final pageData = page.data.page;
    final bodyClass = pageData['bodyClass'] as String?;
    final pageUrl = page.url.startsWith('/') ? page.url : '/${page.url}';
    final sideNavEntries = switch (page.data['sidenav']) {
      final List<Object?> sidenavData => navEntriesFromData(sidenavData),
      _ => null,
    };
    final obsolete = pageData['obsolete'] == true;

    return Component.fragment(
      [
        if (bodyClass != null) Document.body(attributes: {'class': bodyClass}),
        raw('''

'''),
        a(
          id: 'skip-to-main',
          classes: 'filled-button',
          href: '#site-content-title',
          attributes: {'tabindex': '1'},
          [text('Skip to main content')],
        ),
        const CookieNotice(),
        const DashHeader(),
        div(id: 'site-below-header', [
          div(id: 'site-main-row', [
            if (sideNavEntries != null)
              DashSideNav(
                navEntries: sideNavEntries,
                currentPageUrl: pageUrl,
              ),
            main_(
              id: 'page-content',
              classes: [
                if (pageData['focusedLayout'] == true) 'focused',