   Theme.of(context).colorScheme.primary;
          style = style.copyWith(
              color: color,
              fontFamily: "code",
              fontFeatures: const [FontFeature.disable("calt")]);
          break;
        case "pre":
          style = style.copyWith(
              color: Theme.of(context).colorScheme.surfaceContainerHighest,
              fontFamily: "code",
              fontFeatures: const [FontFeature.disable("calt")]);
          break;
        case "a":
          style = style.copyWith(color: Theme.of(context).colorScheme.primary);
          break;
        case "del":
          style = style.copyWith(decoration: TextDecoration.lineThrough);
          break;
        case "h1":
          style = style.copyWith(fontSize: 14 * 2, fontWeight: FontWeight.bold);
          break;
        case "h2":
          style =
              style.copyWith(fontSize: 14 * 1.5, fontWeight: FontWeight.bold);
          break;
        case "h3":
          style =
              style.copyWith(fontSize: 14 * 1.17, fontWeight: FontWeight.bold);
          break;
        case "h4":
          style = style.copyWith(fontSize: 14 * 1, fontWeight: FontWeight.bold);
          break;
        case "h5":
          style =
              style.copyWith(fontSize: 14 * 0.83, fontWeight: FontWeight.bold);
          break;
        case "h6":
          style =
              style.copyWith(fontSize: 14 * 0.67, fontWeight: FontWeight.bold);
          break;
      }

      if (node.children != null) {
        for (var element in node.children!) {
          currentIndex =
              handleNode(context, currentIndex, text, children, style, element);
        }
      }
    }
    return currentIndex;
  }
}
import 'dart:async';

import 'package:commet/client/client.dart';
import 'package:commet/client/components/user_presence/user_presence_component.dart';
import 'package:commet/client/member.dart';
import 'package:commet/ui/atoms/shimmer_loading.dart';
import 'package:commet/ui/navigation/adaptive_dialog.dart';
import 'package:commet/ui/organisms/user_profile/user_profile.dart';
import 'package:flutter/material.dart' as material;
import 'package:flutter/material.dart';
import 'package:tiamat/tiamat.dart';
import 'package:tiamat/tiamat.dart' as tiamat;

class UserPanel extends material.StatefulWidget {
  const UserPanel(
      {super.key,
      required this.userId,
      required this.client,
      required this.contextRoom,
      this.initialMember,
      this.isDirectMessage = false,
      this.onTap});
  final String userId;
  final Client client;
  final Member? initialMember;
  final Room contextRoom;
  final bool isDirectMessage;
  final void Function()? onTap;

  @override
  State<UserPanel> createState() => _UserPanelState();
}

class _UserPanelState extends material.State<UserPanel> {
  late String displayName;
  late Color color;
  ImageProvider? avatar;
  String? detail;
  TextStyle? detailStringStyle;
  late UserPresence presence;

  StreamSubscription? sub;

  @override
  initState() {
    presence = UserPresence(UserPresenceStatus.unknown);

    super.initState();
    initPresence();
    getInfoFromMember();
  }

  void getInfoFromMember() {
    if (widget.isDirectMessage) {
      displayName = widget.contextRoom.displayName;
      color = widget.contextRoom.defaultColor;
      avatar = widget.contextRoom.avatar;
      return;
    }

    final member = widget.initialMember ??


            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 85, (getY() + (height - 24) / 2), 12, 12, 0, 0, 12, 12, 12, 12, m1.darker(), m2.darker(), m3.darker(), m4.darker());
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 75, (getY() + (height - 34) / 2), 16, 16, 0, 0, 16, 16, 16, 16, m1, m2, m3, m4);
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 65, (getY() + (height - 20) / 2), 12, 12, 0, 0, 12, 12, 12, 12, m1.darker().darker(), m2.darker().darker(), m3.darker().darker(), m4.darker().darker());
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 55, (getY() + (height - 28) / 2), 6, 6, 0, 0, 6, 6, 6, 6, m1, m2, m3, m4);
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 45, (getY() + (height - 17) / 2), 17, 17, 0, 0, 17, 17, 17, 17, m1, m2, m3, m4);
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 35, (getY() + (height - 30) / 2), 15, 15, 0, 0, 15, 15, 15, 15, m1.darker().darker().darker(), m2.darker().darker().darker(), m3.darker().darker().darker(), m4.darker().darker().darker());
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 25, (getY() + (height - 21) / 2), 8, 8, 0, 0, 8, 8, 8, 8, m1, m2, m3, m4);
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 15, (getY() + (height - 22) / 2), 12, 12, 0, 0, 12, 12, 12, 12, m1.darker().darker().darker(), m2.darker().darker().darker(), m3.darker().darker().darker(), m4.darker().darker().darker());
            Render2DEngine.renderGradientTextureInternal(b, context.getMatrices(), getX() + 5, (getY() + (height - 28) / 2), 20, 20, 0, 0, 20, 20, 20, 20, m1, m2, m3, m4);
            BufferRenderer.drawWithGlobalProgram(b.end());
            RenderSystem.disableBlend();
            Render2DEngine.popWindow();
        }

        Render2DEngine.drawBlurredShadow(context.getMatrices(),
                ((int) getX() + (width - 4) / 2) - FontRenderers.categories.getStringWidth(getName()) / 2f, (int) getY() + (int) height / 2f - 10, FontRenderers.categories.getStringWidth(getName()) + 6, 13, 20, Render2DEngine.injectAlpha(Color.black, 170));

        FontRenderers.categories.drawCenteredString(context.getMatrices(), getName(), ((int) getX() + 2 + (width - 4) / 2), (int) getY() + (int) height / 2f - 7, new Color(-1).getRGB());
        context.getMatrices().pop();
        updatePosition();
    }

    @Override
    public void mouseClicked(int mouseX, int mouseY, int button) {

        if (button == 1 && hovered) {
            setOpen(!isOpen());
        }
        super.mouseClicked(mouseX, mouseY, button);

        if (isOpen() && scrollHover)
            buttons.forEach(b -> b.mouseClicked(mouseX, mouseY, button));
    }

    @Override
    public void mouseReleased(int mouseX, int mouseY, int button) {
        super.mouseReleased(mouseX, mouseY, button);
        if (isOpen())
            buttons.forEach(b -> b.


t": {
                        "type": "string",
                        "description": "Completion message or summary to present to user - should provide clear indication of what was accomplished. Include: 1) Summary of completed tasks, 2) Key deliverables or outputs, 3) Any important notes or next steps, 4) Impact or benefits achieved."
                    },
                    "attachments": {
                        "anyOf": [
                            {"type": "string"},
                            {"items": {"type": "string"}, "type": "array"}
                        ],
                        "description": "(Optional) List of files or URLs to attach to the completion message. Include when: 1) Completion relates to specific files or configurations, 2) User needs to review final outputs, 3) Deliverables are documented in files, 4) Supporting evidence or context is needed. Always use relative paths to /workspace directory."
                    }
                },
                "required": []
            }
        }
    })
    @usage_example('''
        <function_calls>
        <invoke name="complete">
        <parameter name="text">I have successfully completed all tasks for your project. Here's what was accomplished:
1. Created the web application with modern UI components
2. Implemented user authentication and database integration
3. Deployed the application to production
4. Created comprehensive documentation

All deliverables are attached for your review.</parameter>
        <parameter name="attachments">app/src/main.js,docs/README.md,deployment-config.yaml</parameter>
        </invoke>
        </function_calls>
        ''')
    async def complete(self, text: Optional[str] = None, attachments: Optional[Union[str, List[str]]] = None) -> ToolResult:
        """Indicate that the agent has completed all tasks and is entering complete state.

        Args:
            text: Optional completion message or summary to present to the user
            attachments: Optional file paths or URLs to attach to the completion message

        Returns:
            ToolResult indicating successful transition to complete state
        """
        try:
            # Convert single attachment to list for consistent handling
            if attachments and isinstance(attachments, str):
                attachments = [attachments]

            return self.success_response({"status": "complete"})
        except Exception as e:
            return self.fail_response(f"Error entering complete state: {str(e)}")

if __name__ == "__main__":
    import asyncio

    async def test_message_tool():
        message_tool = MessageTool()

        # Test question
        ask_result = await message_tool.ask(
            text="Would you like to proceed with the next phase?",
            attachments="summary.pdf"
        )
        print("Question result:", ask_result)

        # Test inform
        inform_result = await message_tool.inform(
            text="Completed analysis of data. Processing results now.",
            attachments="analysis.pdf"
        )
        print("Inform result:", inform_result)

    asyncio.run(test_message_tool())


	})
	}
}

func convertPassengers(res GetPNRResponse, pnr *PNR) {
	for _, pax := range res.Detail.Travelers {
		pnr.Passengers = append(pnr.Passengers, Passenger{
			Name:   pax.Person.GivenName + " " + pax.Person.Surname,
			Status: pax.LoyaltyProgramProfile.LoyaltyProgramMemberTierLevel,
		})
	}
}

func convertRemarks(res GetPNRResponse, pnr *PNR) {
	for _, rmk := range res.Detail.Remarks {
		pnr.Remarks = append(pnr.Remarks, Remark{
			Description:     rmk.Description,
			DisplaySequence: rmk.DisplaySequence,
		})
	}
}

func convertTickets(res GetPNRResponse, pnr *PNR) {
	for _, pax := range res.Detail.Travelers {
		for _, tkt := range pax.Tickets {
			formattedTicket := Ticket{
				DocumentID:         tkt.DocumentID,
				IssueDate:          tkt.IssueDate,
				TicketValidityDate: tkt.TicketValidityDate,
				Coupons:            []Coupon{},
			}

			for _, coupon := range tkt.FlightCoupons {
				formattedTicket.Coupons = append(formattedTicket.Coupons, Coupon{
					Status:               coupon.Status.Code,
					DepartureAirport:     coupon.FlightSegment.DepartureAirport.IATACode,
					ArrivalAirport:       coupon.FlightSegment.ArrivalAirport.IATACode,
					FlightNumber:         coupon.FlightSegment.FlightNumber,
					OperatingAirlineCode: coupon.FlightSegment.OperatingAirlineCode,
				})
			}

			pnr.Tickets = append(pnr.Tickets, formattedTicket)
		}
	}
}

func convertSsrs(res GetPNRResponse, pnr *PNR) {
	for _, service := range res.Detail.Services {
		pnr.SSRs = append(pnr.SSRs, SSR{
			Comments:    service.Comments,
			Code:        service.Code,
			Key:         service.Key,
			Description: service.Description,
		})
	}
}
package main

import (
	"fmt"
	ratchet "github.com/iangrunert/git-ratchet/cmd"
	"github.com/spf13/cobra"
	log "github.com/spf13/jwalterweatherman"
	"os"
)

var GitTag string // Will be passed to the compiler by scripts/build.sh

func main() {
	var write bool
	var verbose bool
	var zeroOnMissing bool
	var prefix string
	var slack float64
	var usePercents bool
	var inputType string

	var versionCmd = &cobra.Command{
		Use:   "version",
		Short: "Print the version number",
		Long:  `All software has versions.`,
		Run: func(cmd *cobra.Command, args []string) {
			fmt.Printf("git-ratchet version: %s\n", GitTag)
		},
	}

	var checkCmd = &cobra.Command{
		Use:   "check",
		Short: "Checks the values passed in against the most recent stored values.",
		Long: `Checks the values passed in against the most recent stored values.
The most recent stored values are found by walking up the commit graph and looking at the git-notes stored.`,
		Run: func(cmd *cobra.Command, args []string) {
			if verbose {
				log.SetLogThreshold(log.LevelInfo)
				log.SetStdoutThreshold(log.LevelInfo)
			}

			err := ratchet.Check(prefix, slack, usePercents, write, inputType, zeroOnMissing, os.Stdin)
			if err != 0 {
				os.Exit(err)
			}
		},
	}

	checkCmd.Flags().B


 we're able to define methods structs
// using `impl`, we're also able to define methods on enums. Here's a method named `call` that we
// could define on our `Message` enum
impl Message {
    fn call(&self) {
        // method body would be defined here
    }
}

fn main() {
    // The body of the method implemented on the `Message` enum would use `self` to get the value
    // that we called the method on. Below we've created a variable `m` that has the value
    // `Message::Write(String::from("hello"))`, and that is what `self` will be in the body of the
    // `call` method when `m.call()` runs
    let m = Message::Write(String::from("hello"));
    m.call();
}
<reponame>Acidburn0zzz/crates.io<gh_stars>1-10
use std::fs;
use std::env;
use std::thread;
use std::path::PathBuf;
use std::sync::{Once, ONCE_INIT};

use git2;
use url::Url;

fn root() -> PathBuf {
    env::current_dir().unwrap().join("tmp").join(
        thread::current()
            .name()
            .unwrap(),
    )
}

pub fn checkout() -> PathBuf {
    root().join("checkout")
}
pub fn bare() -> PathBuf {
    root().join("bare")
}

pub fn init() {
    static INIT: Once = ONCE_INIT;
    let _ = fs::remove_dir_all(&checkout());
    let _ = fs::remove_dir_all(&bare());

    INIT.call_once(|| {
        fs::create_dir_all(root().parent().unwrap()).unwrap();
    });

    // Prepare a bare remote repo
    {
        let bare = git2::Repository::init_bare(&bare()).unwrap();
        let mut config = bare.config().unwrap();
        config.set_str("user.name", "name").unwrap();
        config.set_str("user.email", "email").unwrap();
    }

    // Initialize a fresh checkout
    let checkout = git2::Repository::init(&checkout()).unwrap();
    let url = Url::from_file_path(&*bare()).ok().unwrap().to_string();

    // Setup the `origin` remote
    checkout.remote_set_url("origin", &url).unwrap();
    checkout.remote_set_pushurl("origin", Some(&url)).unwrap();
    checkout
        .remote_add_push("origin", "refs/heads/master")
        .unwrap();

    // Create an empty initial commit
    let mut config = checkout.config().unwrap();
    config.set_str("user.name", "name").unwrap();
    config.set_str("user.email", "email").unwrap();
    let mut index = checkout.index().unwrap();
    let id = index.write_tree().unwrap();
    let tree = checkout.find_tree(id).unwrap();
    let sig = checkout.signature().unwrap();
    checkout
        .commit(Some("HEAD"), &sig, &sig, "Initial Commit", &tree, &[])
        .unwrap();

    // Push the commit to the remote repo
    let mut origin = checkout.find_remote("origin").unwrap();
    origin.push(&["refs/heads/master"], None).unwrap();
}
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// T


.Put([]byte("zzzzzzzzzzz"), []byte("zzzzzzzzzzzzzzzzzzzzzzzz"))
	b1.Delete([]byte("key10000"))
	b1.Delete([]byte("k"))
	buf := b1.encode()
	b2 := new(Batch)
	err := b2.decode(0, buf)
	if err != nil {
		t.Error("error when decoding batch: ", err)
	}
	compareBatch(t, b1, b2)
}

func TestBatch_Append(t *testing.T) {
	b1 := new(Batch)
	b1.seq = 10009
	b1.Put([]byte("key1"), []byte("value1"))
	b1.Put([]byte("key2"), []byte("value2"))
	b1.Delete([]byte("key1"))
	b1.Put([]byte("foo"), []byte("foovalue"))
	b1.Put([]byte("bar"), []byte("barvalue"))
	b2a := new(Batch)
	b2a.seq = 10009
	b2a.Put([]byte("key1"), []byte("value1"))
	b2a.Put([]byte("key2"), []byte("value2"))
	b2a.Delete([]byte("key1"))
	b2b := new(Batch)
	b2b.Put([]byte("foo"), []byte("foovalue"))
	b2b.Put([]byte("bar"), []byte("barvalue"))
	b2a.append(b2b)
	compareBatch(t, b1, b2a)
}

func TestBatch_Size(t *testing.T) {
	b := new(Batch)
	for i := 0; i < 2; i++ {
		b.Put([]byte("key1"), []byte("value1"))
		b.Put([]byte("key2"), []byte("value2"))
		b.Delete([]byte("key1"))
		b.Put([]byte("foo"), []byte("foovalue"))
		b.Put([]byte("bar"), []byte("barvalue"))
		mem := memdb.New(&iComparer{comparer.DefaultComparer}, 0)
		b.memReplay(mem)
		if b.size() != mem.Size() {
			t.Errorf("invalid batch size calculation, want=%d got=%d", mem.Size(), b.size())
		}
		b.Reset()
	}
}
// Copyright (c) 2012, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package leveldb

import (
	"container/list"
	"fmt"
	"runtime"
	"sync"
	"sync/atomic"

	"github.com/syndtr/goleveldb/leveldb/iterator"
	"github.com/syndtr/goleveldb/leveldb/opt"
	"github.com/syndtr/goleveldb/leveldb/util"
)

type snapshotElement struct {
	seq uint64
	ref int
	e   *list.Element
}

// Acquires a snapshot, based on latest sequence.
func (db *DB) acquireSnapshot() *snapshotElement {
	db.snapsMu.Lock()
	defer db.snapsMu.Unlock()

	seq := db.getSeq()

	if e := db.snapsList.Back(); e != nil {
		se := e.Value.(*snapshotElement)
		if se.seq == seq {
			se.ref++
			return se
		} else if seq < se.seq {
			panic("leveldb: sequence number is not increasing")
		}
	}
	se := &snapshotElement{seq: seq, ref: 1}
	se.e = db.snapsList.PushBack(se)
	return se
}

// Releases given snapshot element.
func (db *DB) releaseSnapshot(se *snapshotElement) {
	db.snapsMu.Lock()
	defer db.snapsMu.Unlock()

	se.ref--
	if se.ref == 0 {
		db.snapsList.Remove(se.e)
		se.e = nil
	} else if se.ref < 0 {
		panic("leveldb: Snapshot: negative element reference")
	}
}

// Gets minimum sequence that not being snapshoted.
func (db *DB) minSeq() uint64 {
	db.snapsMu.Lock()
	defer db.snapsMu.Unlock()

	if e := db.snapsList.Front(); e != nil {
		return e.Value.(*snapshotElement).seq
	}

	return d


 @param includingBuiltIn whether to include built-in elements in the serialization
	 * @return the GAML code representation of this symbol
	 */
	@Override
	public String serializeToGaml(final boolean includingBuiltIn) {
		return getSerializer().serialize(this, includingBuiltIn);
	}

	/**
	 * Collects metadata information about this symbol.
	 *
	 * @param meta the properties object to populate with metadata
	 */
	@Override
	public void collectMetaInformation(final GamlProperties meta) {
		getSerializer().collectMetaInformation(this, meta);
	}

	/**
	 * Gets the kind of this symbol.
	 *
	 * @return the symbol kind as defined in its prototype
	 */
	@Override
	public int getKind() {
		return getMeta().getKind();
	}

	/**
	 * Compiles all facets that can provide type information.
	 * This ensures type provider facets are compiled before they are needed.
	 */
	protected void compileTypeProviderFacets() {
		visitFacets((facetName, exp) -> {
			if (typeProviderFacets.contains(facetName)) {
				exp.compile(SymbolDescription.this);
			}
			return true;
		});
	}

	/**
	 * Compiles specific facets that may provide type information.
	 *
	 * @param names the names of the facets to compile
	 */
	protected void compileTypeProviderFacets(final String... names) {
		for (String s : names) {
			IExpressionDescription exp = getFacet(s);
			if (exp != null) {
				exp.compile(this);
			}
		}
	}

	/**
	 * Gets the metadata prototype for this symbol.
	 *
	 * @return the symbol prototype
	 */
	@Override
	public final SymbolProto getMeta() {
		return proto;
	}

	/**
	 * Internal method to handle error, warning, and info flags during validation.
	 * Determines the proper reporting method based on the error type and context.
	 *
	 * @param s the message text
	 * @param code the issue code
	 * @param type the error type (Error, Warning, or Info)
	 * @param source the source object where the issue occurred
	 * @param data additional data for the issue
	 * @throws GamaRuntimeException if there's no way to report the error in compile time
	 */
	protected void flagError(final String s, final String code, final GamlCompilationErrorType type,
			final EObject source, final String... data) throws GamaRuntimeException {

		if (type == GamlCompilationErrorType.Warning && !GamaPreferences.Modeling.WARNINGS_ENABLED.getValue()
				|| type == GamlCompilationErrorType.Info && !GamaPreferences.Modeling.INFO_ENABLED.getValue())
			return;

		IDescription desc = this;
		EObject e = source;
		if (e == null) { e = getUnderlyingElement(); }
		while (e == null && desc != null) {
			desc = desc.getEnclosingDescription();
			if (desc != null) { e = desc.getUnderlyingElement(); }
		}
		// throws a runtime exception if there is no way to signal the error in the source
		// (i.e. we are probably in a runtime scenario)
		if (e == null || e.eResource() == null || e.eResource().getURI().path().contains(SYNTHETIC_RESOURCES_PREFIX)) {
			if (type == GamlCompilationErrorType.Error)
				throw GamaRuntimeException.error(s, gama.core.runtime.GAMA.getRuntimeScope());
			return;

		}
		final ValidationContext c = getValidationContext();
		if (c == null) {
			DEBUG.ERR((type == GamlCompilationErrorType.Warning ? "Warning" : "Error") + ": " + s);
			return;
		}
		c.add(new GamlCompilationError(s, code, e, type, data));
	}

	/**
	 * Checks if the given EMF object is synthetic (not from an actual source file).
	 *
	 * @param e the EMF object to check
	 * @return true if the object is synthetic, false otherwise
	 */
	private boolean isSynthetic(final EObject


ство",
  },
  [9928] = {
    ["D"] = "Чтобы мой план сработал, мне нужно, чтобы ты $Gвыкрал:выкрала; оружие из бастиона Вечной Скорби.$B$BОбыщи крепость. Ищи сундуки с оружием Вечной Скорби. Все, что найдешь, неси мне.$B$BБастион расположен прямо на юге и чуть к западу от руин Пылающего Клинка.",
    ["O"] = "Lantresor of the Blade at the Burning Blade Ruins in Nagrand wants you to collect 20 Kil\'sorrow Armaments.",
    ["T"] = "Военная хитрость",
  },
  [9929] = {
    ["D"] = "Думаю, вы еще не знакомы с Дугаром, не так ли? Это торговец, который торгует с различными фракциями Шаттрата.$B$BНе спрашивайте, как он это делает, но ему как-то удается выменивать у них такое товары, которых нашим интендантам в жизни не достать.$B$BДугар три дня назад уехал в Шаттрат и до сих пор не вернулся, а обычно на поезду туда и обратно у него уходит куда меньше времени. Если вдруг поедете в лес, не поищете ли его там?",
    ["O"] = "Отправляйтесь по дороге на северо-запад, по направлению к Шаттрату, и поищите какие-нибудь намеки на то, что могло случиться с Дугаром.",
    ["T"] = "Пропавший торговец",
  },
  [9930] = {
    ["D"] = "Думаю, вы еще не знакомы с Дейромом, не так ли? Это торговец, который торгует с различными фракциями Шаттрата.$B$BНе спрашивайте, как он это делает, но ему как-то удается выменивать у них такое товары, которых нашим интендантам в жизни не достать.$B$BДугар три дня назад уехал в Шаттрат и до сих пор не вернулся, а обычно на поезду туда и обратно у него уходит куда меньше времени. Так что вы уж поищите его, а обо всех находках сообщите капитану Тандеру, хорошо?",
    ["O"] = "Отправляйтесь по дороге на северо-запад, по направлению к Шаттрату, и поищите какие-нибудь намеки на то, что могло случиться с Дейромом.",
    ["T"] = "Пропавший торговец",
  },
  [9931] = {
    ["D"] = "Теперь мы дадим хорошего пинка этим жирным тупицам из Боевого Молота. На северо-западе, у гор


);

		qinziLL = (LinearLayout) findViewById(R.id.ll_qinzidongman);
		rexueLL = (LinearLayout) findViewById(R.id.ll_rexuedongman);
		hougongLL = (LinearLayout) findViewById(R.id.ll_hougongdongman);
		tuiliLL = (LinearLayout) findViewById(R.id.ll_tuilidongman);
		jizhanLL = (LinearLayout) findViewById(R.id.ll_jizhandongman);
		gaoxiaoLL = (LinearLayout) findViewById(R.id.ll_gaoxiaodongman);

		zuijinguankanBtn = (Button) findViewById(R.id.bt_zuijinguankan);
		zhuijushoucangBtn = (Button) findViewById(R.id.bt_zhuijushoucang);

		topLinearLayout = (LinearLayout) findViewById(R.id.ll_show_movie_top);

		shoucangTitlleLL = (LinearLayout) findViewById(R.id.ll_shoucanggengxin);
		shoucangTv = (TextView) findViewById(R.id.tv_shoucanggengxin_name);

		keyBoardView = new KeyBoardView(this, searchEt,
				new KeyBoardView.OnKeyBoardResultListener() {

					@Override
					public void onResult(boolean isSearch) {
						// TODO Auto-generated method stub
						if (keyBoardWindow != null
								&& keyBoardWindow.isShowing()) {
							keyBoardWindow.dismiss();
						}

						if (isSearch) {

							searchPlay();
						}
					}
				});

		playGv.setNextFocusLeftId(R.id.bt_quanbufenlei);
		playGv.setNextFocusUpId(R.id.gv_movie_show);
		playGv.setNextFocusDownId(R.id.gv_movie_show);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub

		if (v.getId() == R.id.bt_quanbufenlei && activeView != null
				&& activeView.getId() == R.id.bt_quanbufenlei) {

			filterPopWindowShow();
		}

		if (v.getId() == R.id.bt_zuijinguankan) {

			startActivity(new Intent(this, HistoryActivity.class));

			return;
		} else if (v.getId() == R.id.bt_zhuijushoucang) {

			startActivity(new Intent(this, ShowShoucangHistoryActivity.class));
			return;
		}

		if (activeView != null && activeView.getId() == v.getId()) {

			return;
		}

		switch (v.getId()) {
		case R.id.ll_qinzidongman:
			currentListIndex = QINZI;
			resetGvActive();
			String url1 = URLUtils.getDongman_QinziFirstURL();
			if (lists[currentListIndex] != null
					&& !lists[currentListIndex].isEmpty()) {

				currentListIndex = QINZI_QUAN;
				notifyAdapter(lists[QINZI_QUAN]);
			} else {

				showDialog(DIALOG_WAITING);
				getUnQuanbuData(url1);
			}
			break;
		case R.id.ll_rexuedongman:
			currentListIndex = REXUE;
			resetGvActive();
			String url2 = URLUtils.getDongman_RexueFirstURL();
			if (lists[currentListIndex] != null
					&& !lists[currentListIndex].isEmpty()) {

				currentListIndex = REXUE_QUAN;
				notifyAdapter(lists[REXUE_QUAN]);
			} else {

				showDialog(DIALOG_WAITING);
				getUnQuanbuData(url2);
			}
			break;
		case R.id.ll_hougongdongman:
			currentListIndex = HOUGONG_XIAOYUAN;
			resetGvActive();


/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM ../../../dist/idl\nsIDOMHTMLAudioElement.idl
 */

#ifndef __gen_nsIDOMHTMLAudioElement_h__
#define __gen_nsIDOMHTMLAudioElement_h__

#ifndef __gen_nsIDOMHTMLMediaElement_h__
#include "nsIDOMHTMLMediaElement.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif

/* starting interface:    nsIDOMHTMLAudioElement */
#define NS_IDOMHTMLAUDIOELEMENT_IID_STR "75a7f3ca-0761-4b63-863b-6fd6a87ed51c"

#define NS_IDOMHTMLAUDIOELEMENT_IID \
  {0x75a7f3ca, 0x0761, 0x4b63, \
    { 0x86, 0x3b, 0x6f, 0xd6, 0xa8, 0x7e, 0xd5, 0x1c }}

class NS_NO_VTABLE nsIDOMHTMLAudioElement : public nsIDOMHTMLMediaElement {
 public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOMHTMLAUDIOELEMENT_IID)

};

  NS_DEFINE_STATIC_IID_ACCESSOR(nsIDOMHTMLAudioElement, NS_IDOMHTMLAUDIOELEMENT_IID)

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIDOMHTMLAUDIOELEMENT \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIDOMHTMLAUDIOELEMENT(_to) \
  /* no methods! */

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIDOMHTMLAUDIOELEMENT(_to) \
  /* no methods! */

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsDOMHTMLAudioElement : public nsIDOMHTMLAudioElement
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIDOMHTMLAUDIOELEMENT

  nsDOMHTMLAudioElement();

private:
  ~nsDOMHTMLAudioElement();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsDOMHTMLAudioElement, nsIDOMHTMLAudioElement)

nsDOMHTMLAudioElement::nsDOMHTMLAudioElement()
{
  /* member initializers and constructor code */
}

nsDOMHTMLAudioElement::~nsDOMHTMLAudioElement()
{
  /* destructor code */
}

/* End of implementation class template. */
#endif

#endif /* __gen_nsIDOMHTMLAudioElement_h__ */


if (lastDirectoryPath != null) {
            lastDirectoryFile = new File(lastDirectoryPath);
        }

        return lastDirectoryFile;
    }

    /**
     * Set the color scheme for the track type.  Its unfortunate that this is a public
     * method,  color schemes are managed by ColorScaleFactory and that is the
     * only object that should call this method.
     *
     * @param type
     * @param colorScale
     */
    public void setColorScale(TrackType type, ContinuousColorScale colorScale) {
        String colorScaleString = colorScale.asString();
        put(COLOR_SCALE_KEY + type.toString(), colorScaleString);
        colorScaleCache.put(type, colorScale);
    }

    /**
     * Get the default color scheme for the track type.  Only specific TrackTypes have default schemes.  The scale
     * returned is marked as "default".
     *
     * @param type
     * @return
     */

    public ContinuousColorScale getColorScale(TrackType type) {
        if (type == null) {
            return null;
        }

        ContinuousColorScale scale = colorScaleCache.get(type);

        if (scale == null && scaledTypes.contains(type)) {
            String colorScaleString = get(COLOR_SCALE_KEY + type.toString(), null);
            if (colorScaleString != null) {
                scale = (ContinuousColorScale) ColorScaleFactory.getScaleFromString(colorScaleString);
            } else {
                scale = getDefaultColorScale(type);
            }
            if (scale != null) {
                scale.setDefault(true);
                colorScaleCache.put(type, scale);
            }
        }
        return scale;
    }

    static Set<String> scaledTypes = new HashSet(Arrays.asList(
            TrackType.LOH, TrackType.RNAI, TrackType.POOLED_RNAI, TrackType.DNA_METHYLATION,
            TrackType.GENE_EXPRESSION, TrackType.COPY_NUMBER, TrackType.ALLELE_SPECIFIC_COPY_NUMBER, TrackType.CNV));

    /**
     * Return the default color scale.  This si the scale for track type "generic",
     * as well as any track type without a specific scale.
     *
     * @param type
     * @return
     */
    public static ContinuousColorScale getDefaultColorScale(TrackType type) {
        switch (type) {
            case LOH:
                return new ContinuousColorScale(0, -1, 0, 1, Color.red, UIConstants.LIGHT_YELLOW, Color.blue);
            case RNAI:
            case POOLED_RNAI:
                ContinuousColorScale cs = new ContinuousColorScale(0, -3, 0, 3, Color.red, Color.white, Color.blue);
                cs.setNoDataColor(new Color(225, 225, 225));
                return cs;

            case DNA_METHYLATION:
                cs = new ContinuousColorScale(0, 1, Color.BLUE, Color.RED);
                cs.setNoDataColor(Color.WHITE);
                return cs;

            case GENE_EXPRESSION:
                cs = getDefaultColorScale(Color.BLUE, Color.WHITE, Color.RED);
                cs.setNoDataColor(new Color(225, 225, 225));
                return cs;

            case COPY_NUMBER:
            case ALLELE_SPECIFIC_COPY_NUMBER:
            case CNV:
                return getDefaultColorScale(Color.BLUE, Color.WHITE, Color.RED);

            default:
                return null;
        }
    }

    public static ContinuousColorScale getDefaultColorScale(Color negColor, Color neutralColor, Color posColor) {
        return new ContinuousColorScale(-0.1, -1.5, 0.1, 1.5, negColor, neutralColor, posColor);
    }

    /**
     * Original labels:  Indel, Missense, Nonsesne, Splice_site, Synonymous, Targetd_Region, Unknown
     * Nico's labels:   Synonymous, Missense, Truncating


        Bitmap.createScaledBitmap(it, targetWidth, targetHeight, true)
                }
            } catch (_: Exception) {
                null
            }
        }

    /**
     * 计算采样率
     */
    private fun calculateInSampleSize(
        options: BitmapFactory.Options,
        reqWidth: Int,
        reqHeight: Int
    ): Int {
        val height = options.outHeight
        val width = options.outWidth
        var inSampleSize = 1

        if (height > reqHeight || width > reqWidth) {
            val halfHeight = height / 2
            val halfWidth = width / 2

            while (halfHeight / inSampleSize >= reqHeight && halfWidth / inSampleSize >= reqWidth) {
                inSampleSize *= 2
            }
        }

        return inSampleSize
    }

    /**
     * 绘制文字水印
     */
    /**
     * 绘制文字水印
     */
    private fun drawTextWatermark(
        canvas: Canvas,
        text: String,
        centerX: Float,
        centerY: Float,
        textSizePercent: Float,
        bitmap: Bitmap,
        config: WatermarkConfig
    ) {
        // 处理多行文本
        val lines = text.split("\n")
        if (lines.isEmpty()) return

        // 根据背景图宽度计算文字大小
        val baseTextSizePx = bitmap.width * textSizePercent / 100f

        // 确保基础文字大小有效
        if (baseTextSizePx <= 0) return

        // 找到最长的行来计算合适的字体大小
        val longestLine = lines.maxByOrNull { it.length } ?: ""
        if (longestLine.isEmpty()) return

        val paint = Paint().apply {
            color = config.getTextColorInt()
            alpha = (config.textOpacity * 255 / 100).toInt() // 使用新的文字透明度
            isAntiAlias = true

            // 设置文本对齐方式
            textAlign = when (config.textAlignment) {
                cn.alittlecookie.lut2photo.lut2photo.model.TextAlignment.LEFT -> Paint.Align.LEFT
                cn.alittlecookie.lut2photo.lut2photo.model.TextAlignment.CENTER -> Paint.Align.CENTER
                cn.alittlecookie.lut2photo.lut2photo.model.TextAlignment.RIGHT -> Paint.Align.RIGHT
            }

            // 加载自定义字体
            if (config.fontPath.isNotEmpty()) {
                try {
                    val fontFile = File(config.fontPath)
                    if (fontFile.exists()) {
                        typeface = Typeface.createFromFile(fontFile)
                    }
                } catch (_: Exception) {
                    // 使用默认字体
                }
            }
        }

        // 计算最大允许宽度（图片宽度的80%）
        val maxAllowedWidth = bitmap.width * 0.8f

        // 先设置基础文字大小
        paint.textSize = baseTextSizePx

        // 测量文字宽度（不考虑字间距）
        val measuredWidth = paint.measureText(longestLine)

        // 如果文字宽度超过最大允许宽度，按比例缩小
        val finalTextSize = if (measuredWidth > maxAllowedWidth && measuredWidth > 0) {
            baseTextSizePx * (maxAllowedWidth / measuredWidth)
        } else {
            baseTextSizePx
        }

        // 设置最终的字体大小
        paint.textSize = finalTextSize

        // 设置字间距（使用背景图宽度百分比）
        if (config.letterSpacing > 0 && finalTextSize > 0) {
            val letterSpacingPx = bitmap.width * config.letterSpacing / 100f
            paint.letterSpacing = letterSpacingPx / finalTextSize
        } else {
            paint.letterSpacing = 0f
        }

        // 计算行间距
        val baseLineHeight = finalTextSize * 1.2f
        val additionalLineSpacing = if (config


ല് അവന് എന്നെ തോല്‍പിച്ച് കളയുകയും ചെയ്തു."
  },
  {
    "surah_number": 38,
    "verse_number": 24,
    "content":
        "അദ്ദേഹം (ദാവൂദ്) പറഞ്ഞു: തന്‍റെ പെണ്ണാടുകളുടെ കൂട്ടത്തിലേക്ക് നിന്‍റെ പെണ്ണാടിനെ കൂടി ആവശ്യപ്പെട്ടതു മുഖേന അവന് നിന്നോട് അനീതി കാണിക്കുക തന്നെ ചെയ്തിരിക്കുന്നു. തീര്‍ച്ചയായും പങ്കാളികളില് (കൂട്ടുകാരില്) പലരും പരസ്പരം അതിക്രമം കാണിക്കുകയാണ് ചെയ്യുന്നത്. വിശ്വസിക്കുകയും സല്‍കര്‍മ്മങ്ങള് പ്രവര്‍ത്തിക്കുകയും ചെയ്തവരൊഴികെ. വളരെ കുറച്ച് പേരേയുള്ളു അത്തരക്കാര്. ദാവൂദ് വിചാരിച്ചു; നാം അദ്ദേഹത്തെ പരീക്ഷിക്കുക തന്നെയാണ് ചെയ്തതെന്ന്. തുടര്‍ന്ന് അദ്ദേഹം തന്‍റെ രക്ഷിതാവിനോട് പാപമോചനം തേടുകയും അദ്ദേഹം കുമ്പിട്ടു കൊണ്ട് വീഴുകയും ഖേദിച്ചുമടങ്ങുകയും ചെയ്തു."
  },
  {
    "surah_


()
        {
            if (geo == Geo3DType.Default)
            {
                sizeZ = Mathf.Min(4, Mathf.Min(tSize.x, tSize.y)) * 2;
            }
            else
                sizeZ = Mathf.Min(4, Mathf.Min(tSize.x, tSize.y)) * 8;
        }

        private static HashSet<Tile> data = new HashSet<Tile>();
        private static Queue<Tile> queue = new Queue<Tile>();

        private void DetectSelfConnection()
        {
            if (selfConnected == false)
                return;

            data.Clear();
            for (int i = 0; i < tiles.Count; i++)
                data.Add(tiles[i]);
            queue.Clear();

            Tile tile = tiles[0];
            Tile tile1;
            data.Remove(tile);
            queue.Enqueue(tile);
            int count = 1;

            while (queue.Count > 0)
            {
                tile = queue.Dequeue();
                for (int i = 0; i < Converter.absDirs.Length; i++)
                {
                    int newIndex = tile.index + Converter.absDirs[i];
                    tile1 = tileGrid[newIndex];
                    if (data.Contains(tile1) && tile.ReachedBorder(i) && tile1.ReachedBorder(3 - i))
                    {
                        data.Remove(tile1);
                        queue.Enqueue(tile1);
                        count++;
                    }
                }
            }
            selfConnected = (count == tiles.Count);
        }

        public bool Completed
        {
            get { return tiles2D.Count == refPattern.tiles2D.Count; }
        }

        private void DetectParameters()
        {
            DetectDensity();
            DetectGeo();
            DetectDepth();
            OptimizeSize();
        }
    }
}


''' A bivariate `kernel density estimation`_ plot of the "autompg" data using
the `scipy.stats.gaussian_kde`_ function and Bokeh contour renderers.

.. bokeh-example-metadata::
    :sampledata: autompg
    :apis: bokeh.plotting.figure.contour
    :refs: :ref:`ug_topics_stats_kde`
    :keywords: kde, contour

.. _kernel density estimation: https://en.wikipedia.org/wiki/Kernel_density_estimation
.. _scipy.stats.gaussian_kde: https://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.gaussian_kde.html

'''
import numpy as np
from scipy.stats import gaussian_kde

from bokeh.palettes import Blues9
from bokeh.plotting import figure, show
from bokeh.sampledata.autompg import autompg as df

def kde(x, y, N):
    xmin, xmax = x.min(), x.max()
    ymin, ymax = y.min(), y.max()

    X, Y = np.mgrid[xmin:xmax:N*1j, ymin:ymax:N*1j]
    positions = np.vstack([X.ravel(), Y.ravel()])
    values = np.vstack([x, y])
    kernel = gaussian_kde(values)
    Z = np.reshape(kernel(positions).T, X.shape)

    return X, Y, Z

x, y, z = kde(df.hp, df.mpg, 300)

p = figure(height=400, x_axis_label="hp", y_axis_label="mpg",
           background_fill_color="#fafafa", tools="", toolbar_location=None,
           title="Kernel density estimation plot of HP vs MPG")
p.grid.level = "overlay"
p.grid.grid_line_color = "black"
p.grid.grid_line_alpha = 0.05

palette = Blues9[::-1]
levels = np.linspace(np.min(z), np.max(z), 10)
p.contour(x, y, z, levels[1:], fill_color=palette, line_color=palette)

show(p)


	}
	ids := DecrementingBatchIDs(tenKey, initialKey)
	require.Len(t, ids, 11)
	require.Equal(t, NewBatchID(tenKey), ids[0])
	require.Equal(t, NewBatchID(initialKey), ids[10])

	// Make sure we don't loop forever if unrelated keys are used.
	ids = DecrementingBatchIDs(unrelatedKey, initialKey)

	// We don't use require.Len() here, otherwise if this ever fails, the
	// library prints the whole result which is huuuuuge.
	require.Equal(t, MaxBatchIDHistoryLookup, len(ids))
}

// TestChannelOutput makes sure the correct keys are used for looking up an
// expected channel output.
func TestChannelOutput(t *testing.T) {
	var (
		bidKeyIndex      int32 = 101
		sidecarKeyIndex  int32 = 102
		_, pubKeyAsk           = test.CreateKey(100)
		_, pubKeyBid           = test.CreateKey(bidKeyIndex)
		_, pubKeySidecar       = test.CreateKey(sidecarKeyIndex)
		mockWallet             = test.NewMockWalletKit()
		askNonce               = Nonce{1, 2, 3}
		bidNonce               = Nonce{3, 2, 1}
		batchTx                = &wire.MsgTx{
			TxOut: []*wire.TxOut{{}},
		}
	)

	askKit := NewKit(askNonce)
	matchedAsk := &MatchedOrder{
		Order:       &Ask{Kit: *askKit},
		UnitsFilled: 4,
	}
	copy(matchedAsk.MultiSigKey[:], pubKeyAsk.SerializeCompressed())

	// First test is a normal bid where the funding key should be derived
	// from the wallet
	bid := &Bid{
		Kit: newKitFromTemplate(bidNonce, &Kit{
			MultiSigKeyLocator: keychain.KeyLocator{
				Family: 1234,
				Index:  uint32(bidKeyIndex),
			},
			Units:         4,
			LeaseDuration: 12345,
		}),
	}
	_, batchTx.TxOut[0], _ = input.GenFundingPkScript(
		pubKeyBid.SerializeCompressed(),
		matchedAsk.MultiSigKey[:], int64(4*BaseSupplyUnit),
	)
	out, idx, err := ChannelOutput(batchTx, mockWallet, bid, matchedAsk)
	require.NoError(t, err)
	require.Equal(t, uint32(0), idx)
	require.Equal(t, batchTx.TxOut[0], out)

	// And the second test is with a sidecar channel bid.
	ticket, err := sidecar.NewTicket(
		400_000, 0, 12345, pubKeyBid, false, false, false,
	)
	require.NoError(t, err)
	ticket.Recipient = &sidecar.Recipient{
		MultiSigPubKey:   pubKeySidecar,
		MultiSigKeyIndex: uint32(sidecarKeyIndex),
	}
	bid = &Bid{
		Kit: newKitFromTemplate(bidNonce, &Kit{
			MultiSigKeyLocator: keychain.KeyLocator{
				Family: 1234,
				Index:  uint32(bidKeyIndex),
			},
			Units:         4,
			LeaseDuration: 12345,
		}),
		SidecarTicket: ticket,
	}
	_, batchTx.TxOut[0], _ = input.GenFundingPkScript(
		pubKeySidecar.SerializeCompressed(),
		matchedAsk.MultiSigKey[:], int64(4*BaseSupplyUnit),
	)

	out, idx, err = ChannelOutput(batchTx, mockWallet, bid, matchedAsk)
	require.NoError(t, err)
	require.Equal(t, uint32(0), idx)
	require.Equal(t, batchTx.TxOut[0], out)
}

// TestBatchVersionFlags tests the various batch versions and their supported
// features.
func TestBatchVersionFlags(t *testing.T) {
	testCases := []struct {
		version            BatchVersion
		suppor


import sys

from core.api.grpc import client, wrappers
from core.api.grpc.wrappers import NodeType, Position

def main():
    if len(sys.argv) != 2:
        print("usage core-python scenario.py <interface-name>")
        exit()

    # interface helper
    iface_helper = client.InterfaceHelper(
        ip4_prefix="10.0.0.0/24",
        ip6_prefix="2001::/64",
    )

    # create grpc client and connect
    core = client.CoreGrpcClient()
    core.connect()

    # add session
    session = core.create_session()

    # create nodes
    position = Position(x=100, y=100)
    node1 = session.add_node(1, name="n1", position=position)
    position = Position(x=300, y=100)
    rj45 = session.add_node(2, name=sys.argv[1], _type=NodeType.RJ45, position=position)

    # create link
    iface1 = iface_helper.create_iface(node1.id, 0)
    iface1.ip4 = "10.0.0.20"
    iface1.ip6 = "2001::14"
    rj45_iface1 = wrappers.Interface(0)
    session.add_link(node1=node1, node2=rj45, iface1=iface1, iface2=rj45_iface1)

    # start session
    core.start_session(session)

if __name__ == "__main__":
    main()


ic const struct net_offload ip6ip6_offload = {
	.callbacks = {
		.gso_segment	= ipv6_gso_segment,
		.gro_receive    = sit_ip6ip6_gro_receive,
		.gro_complete   = ip6ip6_gro_complete,
	},
};
static int __init ipv6_offload_init(void)
{

	if (tcpv6_offload_init() < 0)
		pr_crit("%s: Cannot add TCP protocol offload\n", __func__);
	if (ipv6_exthdrs_offload_init() < 0)
		pr_crit("%s: Cannot add EXTHDRS protocol offload\n", __func__);

	dev_add_offload(&ipv6_packet_offload);

	inet_add_offload(&sit_offload, IPPROTO_IPV6);
	inet6_add_offload(&ip6ip6_offload, IPPROTO_IPV6);
	inet6_add_offload(&ip4ip6_offload, IPPROTO_IPIP);

	return 0;
}

fs_initcall(ipv6_offload_init);


rence_typeE");

var __ZNSt3__27__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_ = Module["__ZNSt3__27__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_"] = createExportWrapper("_ZNSt3__27__sort5IRNS_6__lessIwwEEPwEEjT0_S5_S5_S5_S5_T_");

var __ZNSt3__27__sort4INS_17_ClassicAlgPolicyERNS_6__lessIwwEEPwEEjT1_S6_S6_S6_T0_ = Module["__ZNSt3__27__sort4INS_17_ClassicAlgPolicyERNS_6__lessIwwEEPwEEjT1_S6_S6_S6_T0_"] = createExportWrapper("_ZNSt3__27__sort4INS_17_ClassicAlgPolicyERNS_6__lessIwwEEPwEEjT1_S6_S6_S6_T0_");

var __ZNSt3__218__insertion_sort_3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEvT1_S6_T0_ = Module["__ZNSt3__218__insertion_sort_3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEvT1_S6_T0_"] = createExportWrapper("_ZNSt3__218__insertion_sort_3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEvT1_S6_T0_");

var __ZNSt3__214__partial_sortINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaS5_EET1_S6_S6_T2_RT0_ = Module["__ZNSt3__214__partial_sortINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaS5_EET1_S6_S6_T2_RT0_"] = createExportWrapper("_ZNSt3__214__partial_sortINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaS5_EET1_S6_S6_T2_RT0_");

var __ZNSt3__219__sort5_wrap_policyINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_S6_S6_T0_ = Module["__ZNSt3__219__sort5_wrap_policyINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_S6_S6_T0_"] = createExportWrapper("_ZNSt3__219__sort5_wrap_policyINS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_S6_S6_T0_");

var __ZNSt3__27__sort3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_T0_ = Module["__ZNSt3__27__sort3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_T0_"] = createExportWrapper("_ZNSt3__27__sort3INS_17_ClassicAlgPolicyERNS_6__lessIaaEEPaEEjT1_S6_S6_T0_");

var __ZNSt3__28_IterOpsINS_17_ClassicAlgPolicyEE4nextB6v15007IPaEET_S5_S5_ = Module["__ZNSt3__28_IterOpsINS_17_ClassicAlgPolicyEE4nextB6v15007IPaEET_S5_S5_"] = createExportWrapper("_ZNSt3__28_IterOpsINS_17_ClassicAlgPolicyEE4nextB6v15007IPaEET_S5_S5_");

var __ZNSt3__223__debug_randomize_rangeB6v15007INS_17_Class


3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.7746033,7 7,21.7746033 7,40 C7,58.2253967 21.7746033,73 40,73 L40,80 C17.90861,80 0,62.09139 0,40 C0,17.90861 17.90861,0 40,0 Z' fill='url(%23linearGradient-2)'%3E%3C/path%3E%3Ccircle id='Oval' fill='%23606060' cx='40.5' cy='3.5' r='3.5'%3E%3C/circle%3E%3C/g%3E%3CanimateTransform attributeName='transform' begin='0s' dur='1s' type='rotate' values='0 40 40;360 40 40' repeatCount='indefinite'/%3E%3C/g%3E%3C/svg%3E%0A") 0 0 no-repeat;mask:url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg width='80px' height='80px' viewBox='0 0 80 80' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink'%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient x1='94.0869141%25' y1='0%25' x2='94.0869141%25' y2='90.559082%25' id='linearGradient-1'%3E%3Cstop stop-color='%23606060' stop-opacity='0' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient x1='100%25' y1='8.67370605%25' x2='100%25' y2='90.6286621%25' id='linearGradient-2'%3E%3Cstop stop-color='%23606060' offset='0%25'%3E%3C/stop%3E%3Cstop stop-color='%23606060' stop-opacity='0.3' offset='100%25'%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg stroke='none' stroke-width='1' fill='none' fill-rule='evenodd' opacity='0.9'%3E%3Cg%3E%3Cpath d='M40,0 C62.09139,0 80,17.90861 80,40 C80,62.09139 62.09139,80 40,80 L40,73 C58.2253967,73 73,58.2253967 73,40 C73,21.7746033 58.2253967,7 40,7 L40,0 Z' fill='url(%23linearGradient-1)'%3E%3C/path%3E%3Cpath d='M40,0 L40,7 C21.77


    final sBytes = s.toBytes();

    // The signature bytes are ready
    final result = Uint8List.fromList(<int>[
      ...pointRCompressed,
      ...sBytes,
    ]);

    return Signature(
      result,
      publicKey: publicKey,
    );
  }

  @override
  Future<bool> verify(List<int> message, {required Signature signature}) async {
    // Check that parameters appear valid
    final publicKeyBytes = (signature.publicKey as SimplePublicKey).bytes;
    final signatureBytes = signature.bytes;
    if (publicKeyBytes.length != 32) {
      throw ArgumentError.value(
        signature,
        'signature',
        'Invalid public key length',
      );
    }
    if (signatureBytes.length != 64) {
      throw ArgumentError.value(
        signature,
        'signature',
        'Invalid signature length',
      );
    }

    // Decompress `a`
    final a = _pointDecompress(publicKeyBytes);
    if (a == null) {
      return false;
    }

    // Decompress `r`
    final rBytes = signatureBytes.sublist(0, 32);
    final r = _pointDecompress(rBytes);
    if (r == null) {
      return false;
    }

    // Get `s`
    final s = bigIntFromBytes(signatureBytes.sublist(32));
    if (s >= RegisterL.constantL) {
      return false;
    }

    // Calculate `h`
    final hh = await _sha512.hash(_join([rBytes, publicKeyBytes, message]));
    final h = RegisterL();
    h.readBytes(hh.bytes);

    // Calculate: s * basePoint
    final sB = _pointMul(Register25519()..setBigInt(s), Ed25519Point.base);

    // Calculate: h * a + r
    final rhA = Ed25519Point.zero();
    _pointAdd(
      rhA,
      _pointMul(h.toRegister25519(), a),
      r,
    );

    // Compare
    return sB.equals(rhA);
  }

  Future<SimplePublicKey> _publicKey(List<int> seed) async {
    // Take SHA512 hash of the private key.
    final hashOfPrivateKey = await _sha512.hash(seed);
    final tmp = Uint8List.fromList(hashOfPrivateKey.bytes.sublist(0, 32));
    DartEd25519._setPrivateKeyFixedBits(tmp);

    // We get public key by multiplying the modified private key hash with G.
    final publicKeyBytes = DartEd25519._pointCompress(DartEd25519._pointMul(
      Register25519()..setBytes(tmp),
      Ed25519Point.base,
    ));

    return SimplePublicKey(
      publicKeyBytes,
      type: KeyPairType.ed25519,
    );
  }

  static Uint8List _join(List<List<int>> parts) {
    final totalLength = parts.fold<int>(0, (a, b) => a + b.length);
    final buffer = Uint8List(totalLength);
    var i = 0;
    for (var part in parts) {
      buffer.setAll(i, part);
      i += part.length;
    }
    return buffer;
  }

  static void _pointAdd(
    Ed25519Point r,


区管理等。

``` rust
//bpb.rs
pub enum BootSectorOffset {
    /// 此项忽略
    JmpBoot = 0,
    /// 此项忽略
    OEMName = 3,
    /// 此项忽略
    DrvNum = 64,
    /// 保留位
    Reserved1 = 65,
    /// 扩展引导标记，用于指明此后的 3 个域可用
    BootSig = 66,
    /// 此项忽略
    VolID = 67,
    /// 磁盘卷标
    ///
    /// 此项必须与根目录中 11 字节长的卷标一致
    VolLab = 71,
    /// 文件系统类型
    ///
    /// 此项可为 FAT12、FAT16、FAT32 之一
    FilSysType = 82,
}

impl BootSectorOffset {
    // 从启动扇区中获取扩展引导标记
    pub fn boot_sig(sector: &[u8]) -> u8;

    // 从启动扇区中获取磁盘卷标字符串
    pub fn vol_lab(sector: &[u8]) -> String;

    // 从启动扇区中提取指定区间的数据
    fn split(sector: &[u8], start: Self, end: Self) -> &[u8];
}

pub enum BPBOffset {
    /// 每扇区字节数
    ///
    /// 取值只能是以下的几种情况：512、1024、2048 或是 4096
    BytsPerSec = 11,
    /// 每簇扇区数
    ///
    /// 其值必须是 2 的整数次方
    SecPerClus = 13,
    /// 保留区中保留扇区的数目
    RsvdSecCnt = 14,
    /// 此卷中 FAT 表的份数，通常为 2
    NumFATs = 16,
    /// 对于 FAT32，此项必须为 0
    RootEntCnt = 17,
    /// 对于 FAT32，此项必须为 0
    TotSec16 = 19,
    /// 此项忽略
    Media = 21,
    /// 对于 FAT32，此项必须为 0
    FATSz16 = 22,
    /// 此项忽略
    SecPerTrk = 24,
    /// 此项忽略
    NumHeads = 26,
    /// 在此 FAT 卷之前所隐藏的扇区数
    HiddSec = 28,
    /// 该卷总扇区数
    TotSec32 = 32,
    /// 一个 FAT 表包含的扇区数
    FATSz32 = 36,
    /// Bits 0-3：活动 FAT 表，只有在镜像禁止时才有效
    ///
    /// Bits 7：0 表示 FAT 实时镜像到所有的 FAT 表中；1 表示只有一个活动的 FAT 表
    ExtFlags = 40,
    /// FAT32 版本号
    ///
    /// 高位为主版本号，低位为次版本号
    FSVer = 42,
    /// 根目录所在第一个簇的簇号
    RootClus = 44,
    /// 保留区中 FAT32 卷 FSINFO 结构所占的扇区数
    FSInf


za/blog-wc-go) 找到。

```bash
$ /usr/bin/time -f "%es %MKB" wc test.txt
```

我们使用 [与原文相同版本的 `wc`](https://opensource.apple.com/source/text_cmds/text_cmds-68/wc/wc.c.auto.html) ，用 gcc 9.2.1 编译，编译优化选项为 `-O3`。在我们的实现中，使用 Go 1.13.4（我确实也试过用 gccgo，但结果不是很理想）。我们用以下配置来运行所有的基准：

- Intel Core i5-6200U @ 2.30 GHz (2 physical cores, 4 threads)
- 4+4 GB RAM @ 2133 MHz
- 240 GB M.2 SSD
- Fedora 31

公平起见，所有实现都使用一个 16 KB 的 buffer 来读取输入。输入是两个 us-ascii 编码的文本文件，大小分别是 100 MB 和 1 GB。

## 一个纯朴的方法

因为我们只需要输入文件路径，所以解析参数很容易：

```go
if len(os.Args) < 2 {
    panic("no file path specified")
}
filePath := os.Args[1]

file, err := os.Open(filePath)
if err != nil {
    panic(err)
}
defer file.Close()
```

我们会逐字节遍历文本，跟踪状态。幸运的是，在本文案例中，我们只需要引入两个状态：

- 前一个字节是 whitespace
- 前一个字节不是 whitespace

当从一个 whitespace 字符跳到一个 non-whitespace 字符时，单词计数加 1。这种方法可以直接从字节流读取信息，保持低内存消耗。

```go
const bufferSize = 16 * 1024
reader := bufio.NewReaderSize(file, bufferSize)

lineCount := 0
wordCount := 0
byteCount := 0

prevByteIsSpace := true
for {
    b, err := reader.ReadByte()
    if err != nil {
        if err == io.EOF {
            break
        } else {
            panic(err)
        }
    }

    byteCount++

    switch b {
    case '\n':
        lineCount++
        prevByteIsSpace = true
    case ' ', '\t', '\r', '\v', '\f':
        prevByteIsSpace = true
    default:
        if prevByteIsSpace {
            wordCount++
            prevByteIsSpace = false
        }
    }
}
```

为了展示结果，我们用原生的 println() 函数 — 在我的试验中，导入 fmt 包会导致运行时空间增加约 400 KB。

```go
println(lineCount, wordCount, byteCount, file.Name())
```

运行结果：

|          | input size | elapsed time | max memory |
| -------- | ---------- | ------------ | ---------- |
| wc       | 100 MB     | 0.58 s       | 2052 KB    |
| wc-naive | 100 MB     | 0.77 s       | 1416 KB    |
| wc       | 1 GB       | 5.56 s       | 2036 KB    |
| wc-naive | 1 GB       | 7.69 s       | 1416 KB    |

好消息是我们的第一次尝试在性能方面非常接近 C 语言。事实上，在内存使用方面，我们做得比 C 语言*更好*。

## 分割输入

虽然对 I/O 读取进行缓冲显著提升了性能，但是调用 ReadByte() 和在循环中检查 error 造成了一大笔不必要的开销。我们可以通过手动缓冲读请求来规避上述情况，而


�本地和远程，而显示此弹窗有必须至少选中一个条目的前置判断，所以执行到这里一律启用ok即可；如果是fetch/push，则必须至少选一个remote，否则禁用ok
            showForce = showForce.value,
            requireDel = requireDel.value,
            requireDelRemoteChecked = requireDelRemoteChecked,
            trueFetchFalsePush = trueFetchFalsePush.value,
            showTagFetchPushDialog=showTagFetchPushDialog,
            loadingOn=loadingOn,
            loadingOff=loadingOff,
            loadingTextForFetchPushDialog=loadingTextForFetchPushDialog,
            curRepo=curRepo.value,
            selectedTagsList=selectedItemList.value,
            allTagsList= list.value,
            onCancel = { showTagFetchPushDialog.value=false },
            onSuccess = {
                Msg.requireShow(activityContext.getString(R.string.success))
            },
            onErr = { e->
                val errMsgPrefix = "${fetchPushDialogTitle.value} err: "
                Msg.requireShowLongDuration(e.localizedMessage ?: errMsgPrefix)
                createAndInsertError(curRepo.value.id, errMsgPrefix + e.localizedMessage)
                MyLog.e(TAG, "#TagFetchPushDialog onOK error when '${fetchPushDialogTitle.value}': ${e.stackTraceToString()}")
            },
            onFinally = {
                changeStateTriggerRefreshPage(needRefresh)
            },
            pushFailedListHandler = { pushFailedList ->
                val prefix = "${pushFailedList.size} remotes are push failed"

                val toastMsg = StringBuilder("$prefix: ")
                val repoLogMsg = StringBuilder("$prefix:\n")
                val logMsg = StringBuilder("$prefix:\n")
                val suffix = ", "
                val spliter = "\n----------\n"

                pushFailedList.forEachBetter {
                    toastMsg.append(it.remoteName).append(suffix)
                    repoLogMsg.append("remoteName='${it.remoteName}', err=${it.exception?.localizedMessage}").append(spliter)
                    logMsg.append("remoteName='${it.remoteName}', err=${it.exception?.stackTraceToString()}").append(spliter)
                }

                //提示用户
                Msg.requireShowLongDuration(toastMsg.removeSuffix(suffix).toString())

                //记错误到仓库卡片
                createAndInsertError(curRepo.value.id, repoLogMsg.removeSuffix(spliter).toString()+"\n\n")

                //记到日志
                MyLog.e(TAG, "#TagFetchPushDialog: ${logMsg.removeSuffix(spliter)}\n\n")
            }
        )
    }

    val initDelTagDialog = {
        requireDel.value = true
        requireDelRemoteChecked.value = false  //默认不要勾选同时删除远程分支，要不然容易误删
        trueFetchFalsePush.value = false
        fetchPushDialogTitle.value = activityContext.getString(R.string.delete_tags)
        showForce.value = false

        loadingTextForFetchPushDialog.value = activityContext.getString(R.string.deleting)

        showTagFetchPushDialog.value = true

    }

    val initPushTagDialog= {
        requireDel.value = false
        trueFetchFalsePush.value = false
        fetchPushDialogTitle.value = activityContext.getString(R.string.push_tags)
        showForce.value = true

        loadingTextForFetchPushDialog.value = activityContext.getString(R.string.pushing)

        showTagFetchPushDialog.value = true
    }

    val initFetchTagDialog = {
        requireDel.value = false
        trueFetchFalsePush.value = true
        fetchPushDialogTitle.value = activityContext.getString(R.string.fetch_tags)
        showForce.value = true

        loadingTextForFetchPushDialog.value = activityContext.getString(R.strin


s two values if err is nil.
// It is useful for handling errors in initialization code where recovery is not possible
// and two values need to be returned.
func Must2[T1 any, T2 any](v1 T1, v2 T2, err error) (T1, T2) {
	if err != nil {
		panic(err)
	}

	return v1, v2
}
// Copyright (C) 2025 wangyusong
//
// 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 <https://www.gnu.org/licenses/>.

package jsonrpc

import (
	"bytes"
	"context"
	"encoding/json"
	"errors"
	"io"
	"net/http"
	"net/http/httptest"
	"testing"

	. "github.com/onsi/gomega"

	"github.com/glidea/zenfeed/pkg/api"
	"github.com/glidea/zenfeed/pkg/test"
)

func TestAPI(t *testing.T) {
	RegisterTestingT(t)

	type TestRequest struct {
		Name string `json:"name"`
	}

	type TestResponse struct {
		Greeting string `json:"greeting"`
	}

	type givenDetail struct {
		handler Handler[TestRequest, TestResponse]
	}
	type whenDetail struct {
		method      string
		requestBody string
	}
	type thenExpected struct {
		statusCode   int
		responseBody string
	}

	successHandler := func(ctx context.Context, req *TestRequest) (*TestResponse, error) {
		return &TestResponse{Greeting: "Hello, " + req.Name}, nil
	}

	badRequestHandler := func(ctx context.Context, req *TestRequest) (*TestResponse, error) {
		return nil, api.ErrBadRequest(errors.New("invalid request"))
	}

	notFoundHandler := func(ctx context.Context, req *TestRequest) (*TestResponse, error) {
		return nil, api.ErrNotFound(errors.New("resource not found"))
	}

	internalErrorHandler := func(ctx context.Context, req *TestRequest) (*TestResponse, error) {
		return nil, api.ErrInternal(errors.New("server error"))
	}

	genericErrorHandler := func(ctx context.Context, req *TestRequest) (*TestResponse, error) {
		return nil, errors.New("generic error")
	}

	tests := []test.Case[givenDetail, whenDetail, thenExpected]{
		{
			Scenario: "Successful request",
			Given:    "a handler that returns a successful response",
			When:     "making a valid request",
			Then:     "should return 200 OK with the expected response",
			GivenDetail: givenDetail{
				handler: successHandler,
			},
			WhenDetail: whenDetail{
				method:      http.MethodPost,
				requestBody: `{"name":"World"}`,
			},
			ThenExpected: thenExpected{
				statusCode:   http.StatusOK,
				responseBody: `{"greeting":"Hello, World"}`,
			},
		},
		{
			Scenario: "Empty request body",
			Given:    "a handler that returns a successful response",
			When:     "making a request with empty body",
			Then:     "should return 200 OK with default values",
			GivenDetail: givenDetail{
				handler: successHandler,
			},
			WhenDetail: whenDetail{
				method:      http.


export type FrameAlias = "album" | "bpm" | "composer" | "genre" | "copyright" | "date" | "playlistDelay" | "encodedBy" | "textWriter" | "fileType" | "time" | "contentGroup" | "title" | "subtitle" | "initialKey" | "language" | "length" | "mediaType" | "originalTitle" | "originalFilename" | "originalTextwriter" | "originalArtist" | "originalYear" | "fileOwner" | "artist" | "performerInfo" | "conductor" | "remixArtist" | "partOfSet" | "publisher" | "trackNumber" | "recordingDates" | "internetRadioName" | "internetRadioOwner" | "size" | "ISRC" | "encodingTechnology" | "year";
export type FrameName = "TALB" | "TBPM" | "TCOM" | "TCON" | "TCOP" | "TDAT" | "TDLY" | "TENC" | "TEXT" | "TFLT" | "TIME" | "TIT1" | "TIT2" | "TIT3" | "TKEY" | "TLAN" | "TLEN" | "TMED" | "TOAL" | "TOFN" | "TOLY" | "TOPE" | "TORY" | "TOWN" | "TPE1" | "TPE2" | "TPE3" | "TPE4" | "TPOS" | "TPUB" | "TRCK" | "TRDA" | "TRSN" | "TRSO" | "TSIZ" | "TSRC" | "TSSE" | "TYER";

export type SpecialFrameName = "COMM" | "APIC" | "USLT" | "TXXX";
export type SpecialFrameAlias = "comment" | "image" | "unsynchronisedLyrics" | "userDefinedText";

export type AllFrameNames = V2FrameName | FrameName | SpecialFrameName | V2SpecialFrameName;
export type AllFrameAliases = V2FrameAlias | FrameAlias | SpecialFrameAlias | V2SpecialFrameAlias;

type TextFrames = {[key in FrameAlias]?: string};

/**
 * A special text frame
 */
export interface ISpecialTextFrame {
	/**
	 * The text of the frame
	 */
	text: string;

	/**
	 * The language of text frame
	 */
	language?: string;

	/**
	 * The descriptor of the text frame
	 */
	shortText: string;
}

/**
 * A user defined text frame
 */
export interface IUserDefinedTextFrame {
	/**
	 * The descriptor
	 */
	description: string;

	/**
	 * The value
	 */
	value: string;
}

/**
 * All of the possible ID3 frames
 */
export interface IFrames extends TextFrames {
	/**
	 * A comment frame
	 */
	comment?: ISpecialTextFrame;

	/**
	 * An image frame
	 */
	image?: Buffer | string;

	/**
	 * The unsynchronised lyrics
	 */
	unsynchronisedLyrics?: ISpecialTextFrame;

	/**
	 * User defined text
	 */
	userDefinedText?: IUserDefinedTextFrame[] | IUserDefinedTextFrame;
}

/**
 * A class which holds all the information about specific frames
 */
export default class FrameDefinitions {
	/**
	 * Standard text frames, these are all a pair of ke
	 */
	public static textFrames: {[key in FrameAlias]: FrameName} = {
		album: "TALB",
		bpm: "TBPM",
		composer: "TCOM",
		genre: "TCON",
		copyright: "TCOP",
		date: "TDAT",
		playlistDelay: "TDLY",
		encodedBy: "TENC",
		textWriter: "TEXT",
		fileType: "TFLT",
		time: "TIME",
		contentGroup: "TIT1",
		title: "TIT2",
		subtitle: "TIT3",
		initialKey: "TKEY",
		language: "TLAN",
		length: "TLEN"


况和教师们生活改善的事实证明，党和政府是重视教育工作的。农民出身的学生李凤才说，他在农村二十多年，从没看到过农民轻视教师的现象。相反，农民有点好菜，自己舍不得吃，却送给老师吃。经过辩论，大家明白了社会上轻视教师的只有少数的资产阶级知识分子、资本家和地主，以及深受他们思想影响的人才 不尊重教师。不愿意当红色优秀教师的人，实际上也就是受到了这种思想影响的人。

   主张师范生应当成为教育工作以外的什么“专家”的学生的主要论据是：国家正在进行伟大的社会主义建设，就需要大量的工程师、科学家，因此，党号召我们成为 又红又专的专家。这些人给自己规划的路线是由大学生而助教、而讲师、而教授、科学家，并且说这是从国家需要和党的号召出发的。许多学生不同意这种看法。董 鉴源认为，这样理解国家需要是错误的，不应该把国家对干部和青年的一般要求和对每个人的具体要求混为一谈。他说，对于师范学院的学生来说，就是要求他们成 为一个优秀的中学教师。抛开这个具体要求，强调一般要求，实际上是用国家需要为借口来掩饰自己个人主义的打算。

   经过这次辩论，学生们明确了国家对师范生的要求是要他们成为优秀的红色人民教师。许多学生澄清了各种错误观点，感到眼睛明亮了，精神愉快了，劲头饱满了，并且认识到教师工作是一种艰巨复杂的有创造性的高尚事业，愿意把自己的毕生精力贡献给它。

   来源：1958年1月10日《人民日报》。

    [返回索引页面]

   Copyright (C)  2024  Marxist-Leninist-Maoist.

   Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no


的主编。不要党的领导，就是反社会主义言论，可以和储安平、葛佩琦等的言论相提并论。”

   “剧谱说，韩秋夫文中没有让程下台的话，可我看韩秋夫文中有这样话：一建议不要党委委派主编，二不要文联主席兼主编。如果被采用了，程秀山就自然下台。”

   宋森说：把《冬日的黄昏》作参考资料并没有错

   青海日报宋森说：“别的意见以后再说，在这里只谈一点意见。关于韩秋夫的《冬日的黄昏》曾打印了一部分作为省宣传会议的参考资料的问题，在几次座谈会上都有人抓住这一点说是侵犯人权，又说‘简直是盗窃’，又说是侵害版权，有人说是当作反动材料处理是阴谋；甚至要在会上大声喊‘抗议’，有人说‘应该向法院控告。’这种种说法无非是想取得一些人的同情，其实不必在这个问题上大做文章。宣传会议当作参考材料是事实，而且我觉得并没有错误。《冬日的黄昏》虽然说未写起，但已经把这一部分初稿在文联不止一次的当作品讨论过了，韩秋夫也参加了讨论。既然能在文联讨论为什么不能在党的宣传会议上作参考资料？党的宣传工作不只是以党员为对象，是以全体人民为对象，那就要研究在全体人民中存在的各种问题，掌握各方面的情况，文联代表着文学艺术界，程秀山同志是文联副主席，也是一个共产党员，无论从那方面来说，他有义务把文艺界的思想提供党参考。韩秋夫是党领导下的一个干部，党难道连这个权利都没有？反而说把没公开的东西打印参考是阴谋。所以这问题根本不涉及‘侵犯人权’、‘侵害出版权’等，不是法律范围以内的事情，而是常识范围以内的问题。这种说法类似哗众取宠，我不同意。”

   程秀山的几点说明

   程秀山在会上说：同志们对我的错误和缺点，在整风中进行了批评，我表示诚恳接受。并准备做�


th: 33%;
  var-b-height: 30EM;
}

.test {
  background-color: var(test, orange);
}

body {
  background: var(a) var(image) no-repeat right top;
}

div {
  background: var(color-background) url('img_tree.png') no-repeat right top;
}

.test-2 {
  background: var(color-background) var(image-2, url('img_1.png'))
              no-repeat right top;
}

.test-3 {
  background: var(color-background) var(image) no-repeat right top;
}

.test-4 {
  background: #ffff00 var(image) no-repeat right top;
}

.test-5 {
  background: var(test-color, var(a)) var(image) no-repeat right top;
}

.test-6 {
  border: red var(a-1, solid 20px);
}
''';

  final generated = '''
:root {
  var-color-background: #f00;
  var-color-foreground: #00f;
  var-a: var(b, #0a0);
  var-b: var(c, #0b0);
  var-c: #0f0;
  var-image: url("test.png");
  var-b-width: 20cm;
  var-m-width: 33%;
  var-b-height: 30em;
}
.test {
  background-color: var(test, #ffa500);
}
body {
  background: var(a) var(image) no-repeat right top;
}
div {
  background: var(color-background) url("img_tree.png") no-repeat right top;
}
.test-2 {
  background: var(color-background) var(image-2, url("img_1.png")) no-repeat right top;
}
.test-3 {
  background: var(color-background) var(image) no-repeat right top;
}
.test-4 {
  background: #ff0 var(image) no-repeat right top;
}
.test-5 {
  background: var(test-color, var(a)) var(image) no-repeat right top;
}
.test-6 {
  border: #f00 var(a-1, solid 20px);
}''';

  compileAndValidate(input, generated);

  var generatedPolyfill = r'''
:root {
}
.test {
  background-color: #ffa500;
}
body {
  background: #0a0 url("test.png") no-repeat right top;
}
div {
  background: #f00 url("img_tree.png") no-repeat right top;
}
.test-2 {
  background: #f00 url("img_1.png") no-repeat right top;
}
.test-3 {
  background: #f00 url("test.png") no-repeat right top;
}
.test-4 {
  background: #ff0 url("test.png") no-repeat right top;
}
.test-5 {
  background: #0a0 url("test.png") no-repeat right top;
}
.test-6 {
  border: #f00 solid 20px;
}''';

  compilePolyfillAndValidate(input, generatedPolyfill);
}

void undefinedVars() {
  final errors = <Message>[];
  final input = '''
:root {
  var-color-background: red;
  var-color-foreground: blue;

  var-a: var(b);
  var-b: var(c);
  var-c: #00ff00;

  var-one: var(two);
  var-two: var(one);

  var-four: var(five);
  var-five: var(six);
  var-six: var(four);

  var-def-


o5, %l7
ld [%l7], %l3
st %l3, [%l7]
add %l7, %o5, %l7
ld [%l7], %l3
st %l3, [%l7]

P2954: !ST [13] (maybe <- 0x18000e0) (Int)
stw   %l4, [%i3 + 64 ]
add   %l4, 1, %l4

P2955: !DWST [12] (maybe <- 0x18000e1) (Int)
mov %l4, %l3
sllx %l3, 32, %l3
stx %l3, [%i3 + 0 ]
add   %l4, 1, %l4

P2956: !REPLACEMENT [9] (Int)
sethi %hi(0x200), %o5
or %o5, %lo(0x200),  %o5
sethi %hi(0x10000), %l3
or %l3, %lo(0x10000),  %l3
add %i3, %o5, %o5
add %o5, %l3, %o5
ld [%o5], %l6
st %l6, [%o5]
add %o5, %l3, %o5
ld [%o5], %l6
st %l6, [%o5]
add %o5, %l3, %o5
ld [%o5], %l6
st %l6, [%o5]
add %o5, %l3, %o5
ld [%o5], %l6
st %l6, [%o5]

P2957: !LD [10] (Int)
lduw [%i2 + 32], %o1
! move %o1(lower) -> %o1(upper)
sllx %o1, 32, %o1

P2958: !SWAP [15] (maybe <- 0x18000e2) (Int)
mov %l4, %l7
swap  [%i3 + 192], %l7
! move %l7(lower) -> %o1(lower)
srl %l7, 0, %l3
or %l3, %o1, %o1
add   %l4, 1, %l4

P2959: !DWST [12] (maybe <- 0x18000e3) (Int)
mov %l4, %o5
sllx %o5, 32, %o5
stx %o5, [%i3 + 0 ]
add   %l4, 1, %l4

P2960: !REPLACEMENT [10] (Int)
sethi %hi(0x20), %l7
or %l7, %lo(0x20),  %l7
sethi %hi(0x10000), %o5
or %o5, %lo(0x10000),  %o5
add %i3, %l7, %l7
add %l7, %o5, %l7
ld [%l7], %l3
st %l3, [%l7]
add %l7, %o5, %l7
ld [%l7], %l3
st %l3, [%l7]
add %l7, %o5, %l7
ld [%l7], %l3
st %l3, [%l7]
add %l7, %o5, %l7
ld [%l7], %l3
st %l3, [%l7]

P2961: !CASX [14] (maybe <- 0x18000e4) (Int)
add %i3, 128, %l7
ldx [%l7], %o2
! move %o2(upper) -> %o2(upper)
! move %o2(lower) -> %o2(lower)
mov  %o2, %l6
sllx %l4, 32, %o3
casx [%l7], %l6, %o3
! move %o3(upper) -> %o3(upper)
! move %o3(lower) -> %o3


"Ajouter l'ID de la carte"
L["Add Name or NPC ID"] = "Ajouter le nom ou l'ID d'un PNJ"
L["Add Regular Filter"] = "Ajouter un filtre"
L["Add Special Filter"] = "Ajouter un filtre spécial"
L["Add Spell ID or Name"] = "Ajouter l'ID du sort ou son nom"
L["Add SpellID"] = "Ajouter l'identifiant d'un sort"
L["Add Subzone Name"] = "Ajouter le nom de la sous-zone"
L["Add Texture"] = "Ajouter une texture"
L["Add Zone Name"] = "Ajouter le nom de la zone"
L["Add"] = "Ajouter"
L["Added Instance ID: %s"] = "ID d'instance ajouté : %s"
L["Added Map ID: %s"] = "ID de carte ajouté : %s"
L["Added Subzone Name: %s"] = "Nom de sous-zone ajouté : %s"
L["Added Zone Name: %s"] = "Nom de zone ajouté : %s"
L["Additional Power Prediction Color"] = "Couleur de prédiction de puissance additionnelle"
L["Additional Power"] = "Puissance additionnelle"
L["Additional spacing between each individual group."] = "Espace additionnel entre chaque groupe individuel."
L["Additive Blend"] = "Mélange additif"
L["AddOn Manager"] = "Gestionnaire d'add-ons"
L["Adds an arrow in front of the chat lines to copy the entire line."] = "Ajoute une flèche devant les lignes de chat pour copier toute la ligne."
L["Adjust the height of your left chat panel."] = "Ajustez la hauteur de votre panneau de discussion gauche."
L["Adjust the height of your right chat panel."] = "Ajuste la hauteur de la fenêtre de discussion de droite."
L["Adjust the scale of the minimap and also the pins. Eg: Quests, Resource nodes, Group members"] = "Ajuste l'échelle de la minicarte ainsi que des repères. Exemple : quêtes, ressources, membres du groupe"
L["Adjust the size of the minimap."] = "Ajuster la taille de la minicarte."
L["Adjust the width of the bag frame."] = "Ajuster la largeur de la fenêtre du sac."
L["Adjust the width of the bank frame."] = "Ajuster la largeur de la fenêtre du sac de banque."
L["Adjust the width of your left chat panel."] = "Ajustez la largeur de votre panneau de discussion gauche."
L["Adjust the width of your right chat panel."] = "Ajuste la largeur de la fenêtre de discussion de droite."
L["ADVENTURE_MAP_TITLE"] = "Reconnaissance"
L["Alert Frames"] = "Fenêtre d'Alerte"
L["Alerts"] = "Alertes"
L["Alive"] = "En vie"
L["Alliance"] = true
L["Allied Races"] = "Races alliées"
L["Allow Masque to handle the skinning of this element."] = "Autoriser Masque à gérer l'habillage de cet élement."
L["Allow newly learned spells to be automatically placed on an empty actionbar slot."] = "Autoriser les nouveaux sorts à être automatiquement ajoutés dans un emplacement vide d'une barre d'action."
L["Allow Sharing"] = "Autoriser le partage"
L["Allows you to tie a stack count to an aura when you add it to the list, which allows the trigger to act when an aura reaches X number of stacks."] = "Vous permet d'associer un compte de piles à une aura lorsque vous l'aj


).is_err());
    assert!(blocks.get_verified_at(10).is_ok());
    verify_balances(&scribe, &blocks, 10);
    // height 10 is the first block available for balance query, but not for
    // transaction search. Transaction search is available from 11
    let ledger = Arc::new(TestLedger::from_blockchain(blocks));
    let req_handler = RosettaRequestHandler::new(ledger);
    verify_account_search(&scribe, &req_handler, 11, last_verified).await;

    drop(req_handler);

    let mut blocks = Blocks::new_persistent(location);
    blocks.load_from_store().unwrap();

    verify_balances(&scribe, &blocks, 10);

    let ledger = Arc::new(TestLedger::from_blockchain(blocks));
    let req_handler = RosettaRequestHandler::new(ledger);
    verify_account_search(&scribe, &req_handler, 11, last_verified).await;

    let resp = req_handler
        .search_transactions(SearchTransactionsRequest::new(
            req_handler.network_id(),
            None,
            None,
        ))
        .await
        .unwrap();

    assert_eq!(resp.total_count as u64, last_verified - 10 + 1);
    assert_eq!(resp.transactions.len() as u64, last_verified - 10 + 1);
    assert_eq!(resp.next_offset, None);
    assert_eq!(
        resp.transactions.first().unwrap().block_identifier.index as u64,
        last_verified
    );
    assert_eq!(resp.transactions.last().unwrap().block_identifier.index, 10);
}

// remove this test if it's in the way of a new spec
#[actix_rt::test]
async fn load_unverified_test() {
    init_test_logger();
    let tmpdir = create_tmp_dir();
    let location = tmpdir.path();
    let scribe = Scribe::new_with_sample_data(10, 150);

    let mut blocks = Blocks::new_persistent(location);
    for hb in &scribe.blockchain {
        blocks.add_block(hb.clone()).unwrap();
        if hb.index < 20 {
            blocks.block_store.mark_last_verified(hb.index).unwrap();
        }
    }

    blocks
        .try_prune(&Some((scribe.blockchain.len() - 51) as u64), 0)
        .unwrap();

    assert!(blocks.get_verified_at(49).is_err());
    assert!(blocks.get_verified_at(50).is_err());

    drop(blocks);

    let mut blocks = Blocks::new_persistent(location);
    blocks.load_from_store().unwrap();
    let last_verified = (scribe.blockchain.len() - 1) as u64;
    blocks
        .block_store
        .mark_last_verified(last_verified)
        .unwrap();

    assert!(blocks.get_verified_at(49).is_err());
    assert!(blocks.get_verified_at(50).is_ok());

    verify_balances(&scribe, &blocks, 50);

    let ledger = Arc::new(TestLedger::from_blockchain(blocks));
    let req_handler = RosettaRequestHandler::new(ledger);
    verify_account_search(&scribe, &req_handler, 51, last_verified).await;
}

#[actix_rt::test]
async fn store_batch_test() {
    init_test_logger();
    let tmpdir = create_tmp_dir();
    let location = tmpdir.path();
    let scribe = Scribe::new_with_sample_data(10, 150);

    let mut blocks = Blocks::new_persiste


 {
			return Err(Error::WrongMethodParameters);
		}

		Ok(Self {
			left,
			right,
			min_value: value,
			min_index: 0,
			index: 0,
			window: Window::new(left + right + 1, value),
		})
	}

	#[inline]
	fn next(&mut self, value: Self::Input) -> Self::Output {
		self.window.push(value);

		let first_index = (self.index + 1).saturating_sub(self.window.len());

		if self.min_index < first_index {
			let mut min_index = first_index;
			let mut min_value = self.window.first();

			self.window
				.iter()
				.zip(first_index..)
				.skip(1)
				.for_each(|(x, i)| {
					if x <= min_value {
						min_value = x;
						min_index = i;
					}
				});
			self.min_value = min_value;
			self.min_index = min_index;
		} else if value <= self.min_value {
			self.min_value = value;
			self.min_index = self.index;
		}

		let s = if self.index >= self.right
			&& self.min_index == self.index.saturating_sub(self.right)
		{
			Action::BUY_ALL
		} else {
			Action::None
		};

		self.index += 1;
		s
	}
}

#[cfg(test)]
mod tests {
	use super::*;
	use crate::methods::tests::test_const;

	#[test]
	fn test_pivot_low_const() {
		for i in 1..10 {
			for j in 1..10 {
				let input = (i as ValueType + 56.0) / 16.3251;
				let mut method = ReverseLowSignal::new(i, j, input).unwrap();

				let output = method.next(input);
				test_const(&mut method, input, output);
			}
		}
	}

	#[test]
	#[rustfmt::skip]
	fn test_pivot_low() {
		let v: Vec<ValueType> = vec![2.0, 1.0, 2.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 3.0, 4.0, 1.0, 2.0, 1.0, 2.0, 3.0];
		let r: Vec<i8> =  vec![ 0,   0,   0,   1,   0,   0,   0,   0,   1,   0,   0,   1,   0,   0,   0,   0,   1 ];

		let mut pivot = ReverseLowSignal::new(2, 2, v[0]).unwrap();

		let r2: Vec<i8> = v.iter().map(|&x| pivot.next(x).analog()).collect();
		assert_eq!(r, r2);
	}

	#[test]
	fn test_pivot_high_const() {
		for i in 1..10 {
			for j in 1..10 {
				let input = (i as ValueType + 56.0) / 16.3251;
				let mut method = ReverseHighSignal::new(i, j, input).unwrap();

				let output = method.next(input);
				test_const(&mut method, input, output);
			}
		}
	}

	#[test]
	#[rustfmt::skip]
	fn test_pivot_high() {
		let v: Vec<ValueType> = vec![2.0, 1.0, 2.0, 2.0, 3.0, 2.0, 1.0, 2.0, 3.0, 2.0, 3.0, 4.0, 1.0, 2.0, 1.0, 2.0, 3.0];
		let r: Vec<i8> =  vec![ 0,   0,   0,   0,   0,   0,   1,   0,   0,   0,   0,   0,   0,   1,   0,   0,   0 ];

		let mut pivot = ReverseHighSignal::new(2, 2, v[0]).unwrap();

		let r2: Vec<i8> = v.iter().map(|&x| pivot.next(x).analog()).collect();
		assert_eq!(r, r2);
	}
}
// Copyright 2019 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

use {


 fun defineExecResult(vararg commandLine: String, result: List<TestableExecResult>) {
        var time = 0
        defineExecResult(*commandLine) { result[time++] }
    }

    fun defineExecResult(vararg commandLine: String, result: TestableExecResult) {
        defineExecResult(*commandLine) { result }
    }

    fun defineExecResult(vararg commandLine: String, stdout: String, stderr: String = "", exitCode: Int = 0) {
        defineExecResult(*commandLine, result = TestableExecResult(stdout, stderr, exitCode))
    }

    override fun exec(closure: Closure<*>): ExecResult = exec { closure.call(this) }
    override fun exec(action: Action<in ExecSpec>): ExecResult {
        val spec = TestableExecSpec()
        action.execute(spec)
        val request = TestableExecRequest(spec.commandLine.toList(), spec.workingDir)
        val resultFactory = execResults[request.normalizedCommandLine] ?: error("Can't find output for $request")
        val result = resultFactory(request)
        spec.standardOutput.write(result.stdout.toByteArray(Charsets.UTF_8))
        return result
    }
}

open class AbstractGradleIntegrationTest {
    val project = TestableProject()

    inline fun createTempDirectory(block: (dir: File) -> Unit) {
        val dir = Files.createTempDirectory("temp").toFile()
        try {
            block(dir)
        } finally {
            dir.deleteRecursively()
        }
    }

    val Task.dependsOnNames: List<String> get() = this.dependsOn.map { when (it) {
        is Task -> it.name
        else -> it.toString()
    } }

    val Task.dependsOnResolved: List<Task> get() = this.dependsOn.map { when (it) {
        is Task -> it
        else -> project.tasks.getByName(it.toString())
    } }

    fun Project.executeTasks(list: Iterable<Task>) {
        for (task in list) {
            task.execute()
        }
    }

    fun Task.execute() {
        project.executeTasks(this.dependsOnResolved)
        for (action in actions) {
            action.execute(this)
        }
        project.executeTasks(this.finalizedBy.getDependencies(this))
    }

    fun captureStdout(block: () -> Unit): String {
        val out = ByteArrayOutputStream()
        val tempOut = System.out
        System.setOut(PrintStream(out, true, "UTF-8"))
        try {
            block()
        } finally {
            System.setOut(tempOut)
        }
        return out.toByteArray().toString(Charsets.UTF_8)
    }
}
package korlibs.korge.gradle

import korlibs.*
import korlibs.korge.gradle.module.*
import korlibs.korge.gradle.targets.*
import korlibs.korge.gradle.targets.all.*
import korlibs.korge.gradle.targets.jvm.*
import korlibs.korge.gradle.targets.linux.LDLibraries
import korlibs.korge.gradle.typedresources.*
import korlibs.korge.gradle.util.*
import korlibs.modules.*
import korlibs.root.*
import org.gradle.api.*
import org.gradle.api.plugins.*
import org.gradle.api.tasks.*
import org.gradle.api.tasks.diagnostics.*
import org.gradle.internal.classloader.*
import org.jetbrains.kotlin.gradle.dsl.*
import java.io.*
import java.net.*
import java.util.*
import java.util.concurrent.*
import kotlin.concurrent.*

class KorgeGradleApply(val project: Project, val projectType: ProjectType) {
	fun apply(includeIndirectAndroid: Boolean = true) = project {
        checkMinimumJavaVersion()
        // @TODO: Doing this disables the ability to use configuration cache
		//System.setProperty("java.awt.headless", "true")

		val currentGradleVersion = SemVer(project.gradle.gradleVersion)
        //val expectedGradleVersion = SemVer("6.8


		"resource": {
			"op": "All"
		}
	}`
		testutil.JSONMarshalsTo(t, p, expected)

		var unmarshaled ast.Policy
		err := unmarshaled.UnmarshalJSON([]byte(expected))
		testutil.OK(t, err)
		testutil.Equals(t, &unmarshaled, p)
	})

	t.Run("unmarshal error", func(t *testing.T) {
		var unmarshaled ast.Policy
		err := unmarshaled.UnmarshalJSON([]byte("[]"))
		testutil.Error(t, err)
	})
}

func TestPolicy_MarshalCedar(t *testing.T) {
	t.Parallel()

	t.Run("roundtrip", func(t *testing.T) {
		p := ast.Permit().PrincipalEq(types.NewEntityUID("Foo::Bar", "Baz"))
		expected := `permit (
    principal == Foo::Bar::"Baz",
    action,
    resource
);`

		testutil.Equals(t, string(p.MarshalCedar()), expected)

		var unmarshaled ast.Policy
		err := unmarshaled.UnmarshalCedar([]byte(expected))

		p.Position = internalast.Position{Offset: 0, Line: 1, Column: 1}
		testutil.OK(t, err)
		testutil.Equals(t, &unmarshaled, p)
	})

	t.Run("unmarshal error", func(t *testing.T) {
		var unmarshaled ast.Policy
		err := unmarshaled.UnmarshalCedar([]byte("this isn't Cedar"))
		testutil.Error(t, err)
	})
}
package ast

import (
	"testing"

	"github.com/cedar-policy/cedar-go/internal/testutil"
	"github.com/cedar-policy/cedar-go/types"
)

func TestInspectCounts(t *testing.T) {
	t.Parallel()
	leaf1 := NodeValue{Value: types.Long(1)}
	leaf2 := NodeValue{Value: types.Long(2)}
	cases := []struct {
		name string
		node Node
		want int
	}{
		{"IfThenElse", NewNode(NodeTypeIfThenElse{If: leaf1, Then: leaf1, Else: leaf1}), 4},
		{"Or", NewNode(NodeTypeOr{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"And", NewNode(NodeTypeAnd{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"LessThan", NewNode(NodeTypeLessThan{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"LessThanOrEqual", NewNode(NodeTypeLessThanOrEqual{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"GreaterThan", NewNode(NodeTypeGreaterThan{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"GreaterThanOrEqual", NewNode(NodeTypeGreaterThanOrEqual{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"NotEquals", NewNode(NodeTypeNotEquals{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"Equals", NewNode(NodeTypeEquals{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"In", NewNode(NodeTypeIn{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"HasTag", NewNode(NodeTypeHasTag{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"GetTag", NewNode(NodeTypeGetTag{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"Contains", NewNode(NodeTypeContains{BinaryNode: BinaryNode{Left: leaf1, Right: leaf2}}), 3},
		{"ContainsAll", NewNode(NodeTypeContainsAll{BinaryNo


il += overfulfil;
    }
    if (partiallyCompletedTotalValue != 0) {
      this.partiallyCompletedTotalValue += partiallyCompletedTotalValue;
    }
    if (autoComplateTotalValue != 0) {
      this.autoComplateTotalValue += autoComplateTotalValue;
    }
    if (complateTotalValue != 0) {
      this.complateTotalValue += complateTotalValue;
    }
    if (overfulfilTotalValue != 0) {
      this.overfulfilTotalValue += overfulfilTotalValue;
    }
  }

  @override
  String toString() => 'HabitDetailFreqChartData('
      'pavo=$_partiallyCompleted|$_autoComplate|$_complate|$_overfulfil,'
      'pv=$_partiallyCompletedTotalValue,'
      'av=$_autoComplateTotalValue,'
      'cv=$_complateTotalValue,'
      'ov=$_overfulfilTotalValue)';
}

class HabitDetailScoreChartDate {
  num totalScore;
  int count;

  HabitDetailScoreChartDate({
    this.totalScore = 0.0,
    this.count = 0,
  });

  num get avgScore => count == 0 ? totalScore : totalScore / count;

  void addScore(num score) {
    totalScore += score;
    count += 1;
  }

  @override
  String toString() =>
      'HabitDetailScoreChartDate(ts=$totalScore,c=$count,avs=$avgScore)';
}
// Copyright 2023 Fries_I23
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// coverage:ignore-file

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

import '../l10n/localizations.dart';
import '../models/app_reminder_config.dart';
import '../models/app_sync_options.dart';
import '../models/habit_display.dart';
import '../models/habit_form.dart';
import '../theme/color.dart';
import 'enums.dart';

const String appID = "599df5df-7b99-46a1-9ff3-426831ec7c15";
const String appName = "mhabit";
const String appDBName = "mhabit.db";
const String aboutInfoFilePath = "configs/about_info.json";
const String debuggerLogFileName = "app_debug.log";
const String debuggerInfoFileName = "debug.txt";
const String debuggerZipFile = "debug.zip";
const String appSyncFailedLogDirSubPath = 'app_sync_failed_logs';
const String appSyncFailedLogFilePrefix = "app_sync_failed";
const String appSyncFailedLogFileSuffix = ".txt";
const String appSyncFailedZipFile = "app_sync_failed.zip";

/// # Sqlite versions
///
/// ## version 1
/// - init databases
/// ## verion 2
/// - add record reason column
/// ## version 3
/// - add daily goal extra column
/// ## version 4
/// - add sync table
const int appDBVersion = 4;
//#endregion

//#region app-theme
const Color appDefaultThemeMainColor = Color(0xFF006493);
const AppThemeType appDefaultThemeType = AppThemeType.followSystem;
const int appCalendarBarMaxOccupyPrt = 70;
const int appCalendarBarMinOccupyPrt = 20;
const int appCalendarBarDefualtOccup


is.AssociatedObject.TemplateApplied += new TemplateAppliedEventHandler(AssociatedObject_TemplateApplied);
        }

        void AssociatedObject_TemplateApplied(object sender, TemplateAppliedEventArgs args)
        {
            if (this.AssociatedObject.GanttGrid.Columns.Count > 0)
            {
                this.AssociatedObject.GanttGrid.IsReadOnly = true;

                // Customizing the header text of the Grid.
                this.AssociatedObject.GanttGrid.Columns[0].HeaderText = "Resource Name";
                this.AssociatedObject.GanttGrid.Columns[1].HeaderText = "Start Date";
                this.AssociatedObject.GanttGrid.Columns[2].HeaderText = "Finish Date";
                this.AssociatedObject.ScrollGanttChartTo(new DateTime(2012, 01, 06));
            }
        }

        /// <summary>
        /// Called when [detaching].
        /// </summary>
        protected override void OnDetaching()
        {
            this.AssociatedObject.TemplateApplied -= new TemplateAppliedEventHandler(AssociatedObject_TemplateApplied);
        }
    }
}


cription("질문에 대한 응답")
                                )
                ))
                .when().post("/v1/applyform/{applyFormId}/submit", applyForm.getId())
                .then().log().all().statusCode(400);
    }

    @DisplayName("지원서 폼 제출 시, 필수 질문에 응답하지 않은 경우 400를 반환한다.")
    @Test
    void submit_RequiredNotReplied() {
        // given
        Dashboard dashboard = dashboardRepository.save(DashboardFixture.backend());
        processRepository.save(ProcessFixture.applyType(dashboard));
        ApplyForm applyForm = applyFormRepository.save(ApplyFormFixture.backend(dashboard));
        questionRepository.save(QuestionFixture.required(applyForm));

        ApplyFormSubmitRequest request = new ApplyFormSubmitRequest(
                new ApplicantCreateRequest("초코칩", "dev.chocochip@gmail.com", "01000000000"),
                List.of(),
                true
        );

        // when&then
        RestAssured.given(spec).log().all()
                .contentType(ContentType.JSON)
                .body(request)
                .filter(document("applicant/submit-fail/required-not-replied",
                        pathParameters(parameterWithName("applyFormId").description("지원폼의 id")),
                        requestFields(APPLICANT_SUBMIT_FIELD_DESCRIPTORS)
                ))
                .when().post("/v1/applyform/{applyFormId}/submit", applyForm.getId())
                .then().log().all().statusCode(400);
    }

    @DisplayName("지원서 폼 조회 시, 200을 반환한다.")
    @Test
    void read() {
        // given
        Dashboard dashboard = dashboardRepository.save(DashboardFixture.backend());
        processRepository.save(ProcessFixture.applyType(dashboard));
        ApplyForm applyForm = applyFormRepository.save(ApplyFormFixture.backend(dashboard));
        Question question1 = questionRepository.save(QuestionFixture.shortAnswerType(applyForm));
        Question question2 = questionRepository.save(QuestionFixture.multipleChoiceType(applyForm));
        choiceRepository.saveAll(ChoiceFixture.fiveChoices(question2));

        // when&then
        RestAssured.given(spec).log().all()
                .contentType(ContentType.JSON)
                .filter(document("applicant/read-applyform",
                        pathParameters(parameterWithName("applyFormId").description("지원폼의 id")),
                        responseFields(
                                fieldWithPath("title").description("지원폼의 제목"),
                                fieldWithPath("postingContent").description("지원자의 내용(본문)"),
                                fieldWithPath("startDate").description("지원 가능 날짜"),
                                fieldWithPath("endDate").description("지원 마감 날짜"),
                                fieldWithPath("questions").description("지원폼의 질문들")
                        ).andWithPrefix("questions[].", QUESTION_FIELD_DESCRIPTORS)
                                .andWithPrefix("questions[].choices[].", CHOICE_FIELD_DESCRIPTORS)
                ))
                .when().get("/v1/applyform/{applyFormId}", applyForm.getId())
                .then().log().all().statusCode(200);
    }

    @DisplayName("지원서 폼 조회 시, 지원서 폼이 존재하지 않을 경우 404을 반환한다.")
    @Test
    void read_notFound() {
        // given
        int invalidApplyFormId = -1;

        // when&then
        Rest


RX_CLK_DISABLE();

    /**ETH GPIO Configuration
    PC1     ------> ETH_MDC
    PB13     ------> ETH_TXD1
    PC5     ------> ETH_RXD1
    PB12     ------> ETH_TXD0
    PA7     ------> ETH_CRS_DV
    PA1     ------> ETH_REF_CLK
    PB11     ------> ETH_TX_EN
    PA2     ------> ETH_MDIO
    PC4     ------> ETH_RXD0
    */
    HAL_GPIO_DeInit(GPIOC, GPIO_PIN_1|GPIO_PIN_5|GPIO_PIN_4);

    HAL_GPIO_DeInit(GPIOB, GPIO_PIN_13|GPIO_PIN_12|GPIO_PIN_11);

    HAL_GPIO_DeInit(GPIOA, GPIO_PIN_7|GPIO_PIN_1|GPIO_PIN_2);

    /* ETH interrupt DeInit */
    HAL_NVIC_DisableIRQ(ETH_IRQn);
    /* USER CODE BEGIN ETH_MspDeInit 1 */

    /* USER CODE END ETH_MspDeInit 1 */
  }

}

/**
  * @brief UART MSP Initialization
  * This function configures the hardware resources used in this example
  * @param huart: UART handle pointer
  * @retval None
  */
void HAL_UART_MspInit(UART_HandleTypeDef* huart)
{
  GPIO_InitTypeDef GPIO_InitStruct = {0};
  RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
  if(huart->Instance==USART3)
  {
    /* USER CODE BEGIN USART3_MspInit 0 */

    /* USER CODE END USART3_MspInit 0 */

  /** Initializes the peripherals clock
  */
    PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_USART3;
    PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_D2PCLK1;
    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
    {
      Error_Handler();
    }

    /* Peripheral clock enable */
    __HAL_RCC_USART3_CLK_ENABLE();

    __HAL_RCC_GPIOD_CLK_ENABLE();
    /**USART3 GPIO Configuration
    PD9     ------> USART3_RX
    PD8     ------> USART3_TX
    */
    GPIO_InitStruct.Pin = GPIO_PIN_9|GPIO_PIN_8;
    GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
    GPIO_InitStruct.Pull = GPIO_NOPULL;
    GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
    GPIO_InitStruct.Alternate = GPIO_AF7_USART3;
    HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

    /* USER CODE BEGIN USART3_MspInit 1 */

    /* USER CODE END USART3_MspInit 1 */

  }

}

/**
  * @brief UART MSP De-Initialization
  * This function freeze the hardware resources used in this example
  * @param huart: UART handle pointer
  * @retval None
  */
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
  if(huart->Instance==USART3)
  {
    /* USER CODE BEGIN USART3_MspDeInit 0 */

    /* USER CODE END USART3_MspDeInit 0 */
    /* Peripheral clock disable */
    __HAL_RCC_USART3_CLK_DISABLE();

    /**USART3 GPIO Configuration
    PD9     ------> USART3_RX
    PD8     ------> USART3_TX
    */
    HAL_GPIO_DeInit(GPIOD, GPIO_PIN_9|GPIO_PIN_8);

    /* USER CODE BEGIN USART3_MspDeInit 1 */

    /* USER CODE END USART3_MspDeInit 1 */
  }

}

/* USER CODE BEGIN 1 */

/* USER CODE END 1 */


行，以及它可被主机调用还是可被设备调用。

### B.1.1 \_\_global\_\_
`__global__` 执行空间说明符将函数声明为内核。 它的功能是：

* 在设备上执行，
* 可从主机调用，
* 可在计算能力为 3.2 及以上的设备调用（有关更多详细信息，请参阅 [CUDA 动态并行性](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#cuda-dynamic-parallelism)）。
`__global__` 函数必须具有 void 返回类型，并且不能是类的成员。

对 `__global__` 函数的任何调用都必须指定其执行配置，如[执行配置](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#execution-configuration)中所述。

对 `__global__` 函数的调用是异步的，这意味着它在设备执行完成之前返回。

### B.1.2 \_\_device\_\_
`__device__` 执行空间说明符声明了一个函数：

* 在设备上执行，
* 只能从设备调用。
`__global__` 和 `__device__` 执行空间说明符不能一起使用。

### B.1.3 \_\_host\_\_
`__host__` 执行空间说明符声明了一个函数：

* 在主机上执行，
* 只能从主机调用。

声明一个只带有 `__host__` 执行空间说明符的函数等价于声明一个没有 `__host__` `、__device__` 或 `__global__` 执行空间说明符的函数； 在上述任何一种情况下，该函数都仅为主机编译。

`__global__` 和 `__host__` 执行空间说明符不能一起使用。

但是， `__device__` 和 `__host__` 执行空间说明符可以一起使用，在这种情况下，该函数是为主机和设备编译的。 [应用程序兼容性]()中引入的 `__CUDA_ARCH__ `宏可用于区分主机和设备之间的代码路径：
```C++
__host__ __device__ func()
{
#if __CUDA_ARCH__ >= 800
   // Device code path for compute capability 8.x
#elif __CUDA_ARCH__ >= 700
   // Device code path for compute capability 7.x
#elif __CUDA_ARCH__ >= 600
   // Device code path for compute capability 6.x
#elif __CUDA_ARCH__ >= 500
   // Device code path for compute capability 5.x
#elif __CUDA_ARCH__ >= 300
   // Device code path for compute capability 3.x
#elif !defined(__CUDA_ARCH__)
   // Host code path
#endif
}
```

### B.1.4 Undefined behavior
在以下情况下，“跨执行空间(cross-


-pudding-with-ginger-amaranth-and-mango-51264660.json)
 * [Yam And Black Bean Burritos With Amaranth 51195810](../../index/y/yam-and-black-bean-burritos-with-amaranth-51195810.json)
# apricots

 * [Cognac Glazed Dried Apricots With Cinnamon Spiced Yogurt](../../index/c/cognac-glazed-dried-apricots-with-cinnamon-spiced-yogurt-238271.json)
 * [Cornmeal Cream Cheese Pancakes With Dried Cranberries And Apricots In Maple Syrup](../../index/c/cornmeal-cream-cheese-pancakes-with-dried-cranberries-and-apricots-in-maple-syrup-103973.json)
 * [Couscous With Apricots](../../index/c/couscous-with-apricots-104895.json)
 * [Couscous With Dried Apricots And Pistachios](../../index/c/couscous-with-dried-apricots-and-pistachios-2239.json)
 * [Couscous With Dried Apricots Currants And Pistachios](../../index/c/couscous-with-dried-apricots-currants-and-pistachios-13240.json)
 * [English Chocolate Trifle With Apricots And Raspberries](../../index/e/english-chocolate-trifle-with-apricots-and-raspberries-2832.json)
 * [Grilled Maple Butter Apricots With Vanilla Ice Cream](../../index/g/grilled-maple-butter-apricots-with-vanilla-ice-cream-56389626.json)
 * [Grilled Skewered Scallops And Apricots With Honey Mustard Dressing](../../index/g/grilled-skewered-scallops-and-apricots-with-honey-mustard-dressing-235338.json)
 * [Honey Caramel Tart With Apricots And Almonds](../../index/h/honey-caramel-tart-with-apricots-and-almonds-237924.json)
 * [Honey Vanilla Poached Apricots](../../index/h/honey-vanilla-poached-apricots-12387.json)
 * [Lamb And Rice Pilaf With Dried Apricots And Pine Nuts](../../index/l/lamb-and-rice-pilaf-with-dried-apricots-and-pine-nuts-104951.json)
 * [Lamb Tagine With Chickpeas And Apricots](../../index/l/lamb-tagine-with-chickpeas-and-apricots-367761.json)
 * [Lamb Tagine With Prunes Apricots And Vegetables](../../index/l/lamb-tagine-with-prunes-apricots-and-vegetables-103829.json)
 * [Marshmallow Semifreddo With Hazelnuts Dried Apricots And Chocolate](../../index/m/marshmallow-semifreddo-with-hazelnuts-dried-apricots-and-chocolate-358531.json)
 * [Orange Rhubarb Pie With Apricots](../../index/o/orange-rhubarb-pie-with-apricots-2695.json)
 * [Poached Apricots In Vanilla Thyme Syrup With Creme Fraiche](../../index/p/poached-apricots-in-vanilla-thyme-syrup-with-creme-fraiche-105037.json)
 * [Poached Pear And Dried Apricots With Chocolate Sauce](../../index/p/poached-pear-and-dried-apricots-with-chocolate-sauce-12811.json)
 * [Red Cabbage With Apricots And Balsamic Vinegar](../../index/r/red-cabbage-with-apricots-and-balsamic-vinegar-15649.json)
 * [Red M