a.786.786 0 01-.049.188l.002-.006c-.011.027-.023.062-.036.088l-.047.088a.695.695 0 01-.056.085l.002-.002c-.02.027-.04.05-.06.073a1.051 1.051 0 01-.074.075l-.001.001c-.011.01-.02.022-.032.032a5.013 5.013 0 106.387.007l-.008-.007c-.011-.009-.019-.019-.028-.029a1.132 1.132 0 01-.077-.078l-.001-.001-.062-.074c-.02-.025-.033-.049-.049-.074a.974.974 0 01-.051-.092l-.003-.006c-.011-.023-.019-.047-.028-.07a1.215 1.215 0 01-.036-.111l-.002-.007a.658.658 0 01-.012-.064.827.827 0 01-.014-.139V4.835a2.827 2.827 0 10-5.648.006v-.006zm15.872 12.137a3.358 3.358 0 012.318-3.184l.024-.007V9.667a1.005 1.005 0 012.01 0v4.116a3.354 3.354 0 012.342 3.193 3.348 3.348 0 01-6.696 0zm-16.395 0a3.358 3.358 0 012.318-3.184l.024-.007V4.704a1.005 1.005 0 012.01 0v9.079a3.354 3.354 0 012.342 3.193 3.348 3.348 0 01-6.696 0z"/></svg>';
  static const String thermometer_alt =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="24" height="24" preserveAspectRatio="xMidYMid meet" viewBox="0 0 24 24"><path fill="currentColor" d="m1.522 1.298-.233.233c-.797.801-1.29 1.905-1.29 3.124s.493 2.323 1.29 3.124l12.577 12.577c.524.524 1.224.87 2.005.942l.013.001 4.014.362 1.974 1.974a1.247 1.247 0 101.765-1.759l-.001-.001-1.974-1.974-.362-4.014a3.316 3.316 0 00-.943-2.017L7.781 1.294A4.416 4.416 0 004.656.004a4.413 4.413 0 00-3.132 1.298zm18.013 13.381c.339.342.565.798.616 1.305l.001.009.32 3.52-.972.973-3.52-.32a2.119 2.119 0 01-1.313-.617l-.452-.451.856-.856-.623-.625-.855.856-1.13-1.13.856-.856-.623-.625-.855.856-1.141-1.139.855-.856-.625-.625-.855.856-1.13-1.13.856-.856-.625-.625-.855.856-1.139-1.139.855-.856-.625-.625-.855.856-1.129-1.13.855-.856-.625-.625-.855.856-1.139-1.139.855-.856-.624-.625-.856.856-.943-.942c-.592-.593-.959-1.411-.959-2.315s.366-1.723.959-2.315l.233-.233c.593-.592 1.411-.959 2.315-.959s1.723.366 2.315.959z"/><path fill="currentColor" d="M4.389 4.397a.679.679 0 000 .952l13.28 13.28a.677.677 0 001.213-.416.677.677 0 00-.26-.534l-.001-.001-13.2


/* { dg-do compile { target aarch64-*-* } } */
/* { dg-additional-options "-O0" } */

/*
   When compiling __RTL functions the startwith string can be either incorrect
   (i.e. not matching a pass) or be unused (i.e. can refer to a pass that is
   not run at the current optimisation level).

   Here we ensure that the state clean up is still run, so that functions other
   than the faulty one can still be compiled.
 */

int __RTL (startwith ("peephole2")) badfoo ()
{
(function "badfoo"
  (insn-chain
    (block 2
      (edge-from entry (flags "FALLTHRU"))
      (cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK)
      (cinsn 101 (set (reg:DI x19) (reg:DI x0)))
      (cinsn 10 (use (reg/i:SI x19)))
      (edge-to exit (flags "FALLTHRU"))
    ) ;; block 2
  ) ;; insn-chain
) ;; function "foo2"
}

/* Compile a valid __RTL function to test state from the "dfinit" pass has been
   cleaned with the "dfinish" pass.  */

int __RTL (startwith ("final")) foo2 ()
{
(function "foo2"
  (insn-chain
    (block 2
      (edge-from entry (flags "FALLTHRU"))
      (cnote 3 [bb 2] NOTE_INSN_BASIC_BLOCK)
      (cinsn 101 (set (reg:DI x19) (reg:DI x0)))
      (cinsn 10 (use (reg/i:SI x19)))
      (edge-to exit (flags "FALLTHRU"))
    ) ;; block 2
  ) ;; insn-chain
) ;; function "foo2"
}


4.x | >=5.10 | 1.22, 1.23 | 1.26, 1.27, 1.28, 1.29, 1.30 |
| 0.3.x | >=5.10 | 1.22 | 1.26, 1.27, 1.28, 1.29, 1.30 |

**Note:** Kmesh's Dual-Engine Mode requires the setting of `pilot.env.PILOT_ENABLE_AMBIENT=true` in istiod. so 1.22+ istio is required!

- **Kmesh Kernel-Native Mode:**

| Version | Request Kernel Version | Supported Istio Version | Support Kubernetes Version |
| :-------------: | :-------------: | :-------------: | :-------------: |
| main/latest | >=5.10 | 1.22, 1.23, 1.24 | 1.26, 1.27, 1.28, 1.29, 1.30, 1.31 |
| 0.5.x | >=5.10 | 1.22, 1.23 | 1.26, 1.27, 1.28, 1.29, 1.30 |
| 0.4.x | >=5.10 | 1.22, 1.23 | 1.26, 1.27, 1.28, 1.29, 1.30 |
| 0.3.x | >=5.10 | 1.22 | 1.26, 1.27, 1.28, 1.29, 1.30 |

**Note:**

- 1.`Kernel-Native Mode` does not depend on `pilot.env.PILOT_ENABLE_AMBIENT=true`. It is theoretically compatible with istiod <1.22.
- 2.`Kernel-Native Mode's` L7 functionality requires kernel patches. The exception is the [oe23.03](https://repo.openeuler.org/openEuler-23.03/), which can natively support L7 functionality for Kmesh `Kernel-Native Mode`.
## 背景

目前，如果服务之间在开启服务网格的情况下通信失败，很难判断问题是因为服务网格接管流量造成的，还是服务本身存在错误。 因此，我们提供了将网格服务从通信流量路径中删除的功能，以查明问题是由服务网格还是应用程序本身的错误引起的。

## 功能设计

bypass是一种通用网格功能，用于从流量路径中删除 sidecar/kmesh 网格服务。 下面两种场景介绍了启用bypass功能后的流量路径。

### 场景一：sidecar

下面两张图中，在集群中启用了sidecar来接管流量。 图一为启用bypass功能前的流量路径。从中我们可以看到，流量路径是服务A->sidecar->sidecar->服务B，当服务A和服务B通信失败时，从黑盒层面，用户无法判断是否是 sidecar 或服务本身存在问题。 图二中，开启了pod1的bypass功能，从而pod1中的sidecar会被从流量路径中移除。 如果此时服务A和服务B能够正常通信，则证明sidecar存在问题。

![alt text](pics/sidecar_pre_bypass.svg)

![alt text](pics/sidecar_bypass.svg)

### 场景二：kmesh

在图一中，流量路径是服务A->kmesh->服务B。在图二中，开启了byp


wref.clone()
    }

    /// Formular aus glade-Datei erstellen.
    fn get_objects(dialog_type: DialogTypeEnum, p: &TbEintragOrtExt) -> Rc<RefCell<Self>> {
        let glade_src = include_str!("../../res/gtkgui/tb/TB110Date.glade");
        let builder = gtk::Builder::from_string(glade_src);
        let date0 = builder.object::<gtk::Label>("datum0").unwrap();
        let date = builder.object::<gtk::Grid>("datum").unwrap();
        let g = controls::Date::new2(&date, "date", false, true, true);
        g.borrow_mut().set_accel("m", "p", Some(&date0));
        let w = Tb110Date {
            dialog_type,
            window: gtk::Dialog::new(),
            grid: builder.object::<gtk::Grid>("TB110Date").unwrap(),
            number: builder.object::<gtk::Entry>("nr").unwrap(),
            description: builder.object::<gtk::Entry>("bezeichnung").unwrap(),
            date0: builder.object::<gtk::Label>("datum0").unwrap(),
            date: builder.object::<gtk::Grid>("datum").unwrap(),
            calendar: g.borrow().calendar.clone(),
            ok: builder.object::<gtk::Button>("ok").unwrap(),
            cancel: builder.object::<gtk::Button>("abbrechen").unwrap(),
            param: p.clone(),
            result: None,
        };
        let config = config::get_config();
        w.window.set_title(
            bin::get_title(M::TB110_title, &DialogTypeEnum::Without, config.is_de()).as_str(),
        );
        w.window.set_modal(true);
        let content_area = w.window.content_area();
        content_area.add(&w.grid);
        bin::make_locale(
            &builder,
            &config,
            Some(&w.window),
            &std::any::type_name::<Tb110Date>().to_string(),
        );
        bin::set_bold(&w.date0);
        w.ok.connect_clicked(glib::clone!(@strong w => move |_| Self::on_ok(&w)));
        w.cancel
            .connect_clicked(glib::clone!(@strong w => move |_| Self::on_cancel(&w)));
        w.window.show_all();
        let w2 = Rc::new(RefCell::new(w));
        w2
    }

    /// Model-Daten initialisieren.
    /// * step: Betroffener Schritt: 0 erstmalig, 1 aktualisieren.
    fn init_data(&self, step: i32) {
        if step == 0 {
            // Werte aus Parametern nehmen.
            let loeschen = self.dialog_type == DialogTypeEnum::Delete;
            bin::set_text_entry(&self.number, &Some(self.param.ort_uid.to_string()));
            bin::set_text_entry(&self.description, &Some(self.param.bezeichnung.to_string()));
            bin::set_date_grid(&self.date, &Some(self.param.datum_bis), true);
            self.number.set_editable(false);
            self.description.set_editable(false);
            if loeschen {
                let config = config::get_config();
                self.ok.set_label(M::me(M::Forms_delete, config.is_de()));
            }
        }
    }

    /// Behandlung von OK.
    fn on_ok(&self) {
        unsafe {
            self.window.set_data("result", true);
        }
        self.window.hide();
    }

    /// Behandlung von Abbrechen.
    fn on_cancel(&self) {
        self.window.hide();
    }
}
#[macro_use]
e


ND_GRANULATION_TISSUE, CID_WOUND_INTACT, CID_WOUND_NECROTIC, CID_WOUND_NECROTIC_TISSUE, CID_WOUND_NON_BLANCHABLE_ERYTHEMA, CID_WOUND_SLOUGH, CID_WOUND_SLOUGHING]

SET_CID_WOUND_EDGE_DESCRIPTION = @x WHERE ( CID_WOUND_EDGE_DESCRIPTION -[Has Answer]-> @x )
SET_CID_WOUND_EDGE_DESCRIPTION = [CID_WOUND_EDGE_ATTACHED, CID_WOUND_EDGE_NOT_ATTACHED, CID_WOUND_EDGE_POORLY_DEFINED, CID_WOUND_EDGE_ROLLED, CID_WOUND_EDGE_SCABBED, CID_WOUND_EDGE_WELL_DEFINED]

SET_CID_WOUND_SKIN_AROUND = @x WHERE ( CID_WOUND_SKIN_AROUND -[Has Answer]-> @x )

SET_CID_PAIN_SEVERITY = @x WHERE ( CID_PAIN_SEVERITY -[Answer of]-> @x )
SET_CID_PAIN_SEVERITY = [CID_PAIN_SEVERITY_0_10]

SET_CID_DEGREE_FINDING = @x WHERE ( CID_DEGREE_FINDING -[Subsumes]-> @x )

# esses tem um trabalho a masi
WOUND_TYPES =   @x WHERE ( CID_WOUND_TYPE -[Has Answer]-> @x ) ?
WOUND_TYPES = [CID_WOUND_ABRASION, CID_WOUND_AVULSION, CID_WOUND_BITE, CID_WOUND_BLISTER, CID_WOUND_BURN, CID_WOUND_CONTUSION, CID_WOUND_CRUSH, CID_WOUND_ERYTHEMA, CID_WOUND_FISSURE, CID_WOUND_GRAFT, CID_WOUND_GUNSHOT, CID_WOUND_LACERATION, CID_WOUND_MACERATION, CID_WOUND_PRESSURE_ULCER, CID_WOUND_PUNCTURE, CID_WOUND_RASH, CID_WOUND_SURGICAL, CID_WOUND_TRAUMA, CID_WOUND_ULCER]

CID_DIABETIC_FOOT_ULCER = 4159742
CID_PRESSURE_INJURY = 37159532
CID_ARTERIAL_ULCER = 37312206
CID_TRAUMATIC_WOUND = 46287159
CID_SURGICAL_WOUND = 46284419
CID_BURN = 442013
CID_OSTOMY = 45613198
CID_TEAR_OF_SKIN = 4180738
CID_FISTULA = 4324769
CID_PHLEBITIS = 318174

# nao achei nada parecidoncom ferida neoplastic no omop
# e a ulcera venenosa no omop sempre eh algo como
# venemous ulcer on the ankle, sempre especifico de uma parte do corpo
# entao tambem tem que ver como que vai fazer


ogParserCOMMA)
}

func (s *Constant_concatenationContext) COMMA(i int) antlr.TerminalNode {
	return s.GetToken(SystemVerilogParserCOMMA, i)
}

func (s *Constant_concatenationContext) GetRuleContext() antlr.RuleContext {
	return s
}

func (s *Constant_concatenationContext) ToStringTree(ruleNames []string, recog antlr.Recognizer) string {
	return antlr.TreesStringTree(s, ruleNames, recog)
}

func (s *Constant_concatenationContext) EnterRule(listener antlr.ParseTreeListener) {
	if listenerT, ok := listener.(SystemVerilogParserListener); ok {
		listenerT.EnterConstant_concatenation(s)
	}
}

func (s *Constant_concatenationContext) ExitRule(listener antlr.ParseTreeListener) {
	if listenerT, ok := listener.(SystemVerilogParserListener); ok {
		listenerT.ExitConstant_concatenation(s)
	}
}

func (p *SystemVerilogParser) Constant_concatenation() (localctx IConstant_concatenationContext) {
	this := p
	_ = this

	localctx = NewConstant_concatenationContext(p, p.GetParserRuleContext(), p.GetState())
	p.EnterRule(localctx, 966, SystemVerilogParserRULE_constant_concatenation)
	var _la int

	defer func() {
		p.ExitRule()
	}()

	defer func() {
		if err := recover(); err != nil {
			if v, ok := err.(antlr.RecognitionException); ok {
				localctx.SetException(v)
				p.GetErrorHandler().ReportError(p, v)
				p.GetErrorHandler().Recover(p, v)
			} else {
				panic(err)
			}
		}
	}()

	p.EnterOuterAlt(localctx, 1)
	{
		p.SetState(6862)
		p.Match(SystemVerilogParserLC)
	}
	{
		p.SetState(6863)
		p.constant_expression(0)
	}
	p.SetState(6868)
	p.GetErrorHandler().Sync(p)
	_la = p.GetTokenStream().LA(1)

	for _la == SystemVerilogParserCOMMA {
		{
			p.SetState(6864)
			p.Match(SystemVerilogParserCOMMA)
		}
		{
			p.SetState(6865)
			p.constant_expression(0)
		}

		p.SetState(6870)
		p.GetErrorHandler().Sync(p)
		_la = p.GetTokenStream().LA(1)
	}
	{
		p.SetState(6871)
		p.Match(SystemVerilogParserRC)
	}

	return localctx
}

// IConstant_multiple_concatenationContext is an interface to support dynamic dispatch.
type IConstant_multiple_concatenationContext interface {
	antlr.ParserRuleContext

	// GetParser returns the parser.
	GetParser() antlr.Parser

	// IsConstant_multiple_concatenationContext differentiates from other interfaces.
	IsConstant_multiple_concatenationContext()
}

type Constant_multiple_concatenationContext struct {
	*antlr.BaseParserRuleContext
	parser antlr.Parser
}

func NewEmptyConstant_multiple_concatenationContext() *Constant_multiple_concatenationContext {
	var p = new(Constant_multiple_concatenationContext)
	p.BaseParserRuleContext = antlr.NewBaseParserRuleContext(nil, -1)
	p.RuleIndex = SystemVerilogParserRULE_constant_multiple_concatenation
	return p
}

func (*Constant_multiple_concatenationContext) IsConstant_multiple_concatenationContext() {}

func NewConstant_multiple_concatenationContext(parser antlr.Parser, parent antlr.ParserRuleContext, invokingState int) *Constant_multiple_concatenationContext {
	var


_runtime
    .execute(
      "<anon>",
      r#"
    if (!(startup)) {
        throw Error("bad");
      }
      console.log(`ts version: ${ts.version}`);
    "#,
    )
    .unwrap();
}
// Copyright 2018 TiKV Project Authors. Licensed under Apache-2.0.

use std::f64::INFINITY;
use std::sync::{Arc, Mutex};

use engine_traits::{name_to_cf, CompactExt, MiscExt, CF_DEFAULT, CF_WRITE};
use futures::sync::mpsc;
use futures::{future, Future, Stream};
use futures_cpupool::{Builder, CpuPool};
use grpcio::{ClientStreamingSink, RequestStream, RpcContext, UnarySink};
use kvproto::errorpb;

#[cfg(feature = "prost-codec")]
use kvproto::import_sstpb::write_request::*;
#[cfg(feature = "protobuf-codec")]
use kvproto::import_sstpb::WriteRequest_oneof_chunk as Chunk;
use kvproto::import_sstpb::*;

use kvproto::raft_cmdpb::*;

use crate::server::CONFIG_ROCKSDB_GAUGE;
use engine_rocks::RocksEngine;
use engine_traits::{SstExt, SstWriterBuilder};
use raftstore::router::RaftStoreRouter;
use raftstore::store::Callback;
use security::{check_common_name, SecurityManager};
use sst_importer::send_rpc_response;
use tikv_util::future::paired_future_callback;
use tikv_util::time::{Instant, Limiter};

use sst_importer::import_mode::*;
use sst_importer::metrics::*;
use sst_importer::service::*;
use sst_importer::{error_inc, Config, Error, SSTImporter};

/// ImportSSTService provides tikv-server with the ability to ingest SST files.
///
/// It saves the SST sent from client to a file and then sends a command to
/// raftstore to trigger the ingest process.
#[derive(Clone)]
pub struct ImportSSTService<Router> {
    cfg: Config,
    router: Router,
    engine: RocksEngine,
    threads: CpuPool,
    importer: Arc<SSTImporter>,
    switcher: Arc<Mutex<ImportModeSwitcher>>,
    limiter: Limiter,
    security_mgr: Arc<SecurityManager>,
}

impl<Router: RaftStoreRouter<RocksEngine>> ImportSSTService<Router> {
    pub fn new(
        cfg: Config,
        router: Router,
        engine: RocksEngine,
        importer: Arc<SSTImporter>,
        security_mgr: Arc<SecurityManager>,
    ) -> ImportSSTService<Router> {
        let threads = Builder::new()
            .name_prefix("sst-importer")
            .pool_size(cfg.num_threads)
            .create();
        ImportSSTService {
            cfg,
            router,
            engine,
            threads,
            importer,
            switcher: Arc::new(Mutex::new(ImportModeSwitcher::new())),
            limiter: Limiter::new(INFINITY),
            security_mgr,
        }
    }
}

impl<Router: RaftStoreRouter<RocksEngine>> ImportSst for ImportSSTService<Router> {
    fn switch_mode(
        &mut self,
        ctx: RpcContext<'_>,
        req: SwitchModeRequest,
        sink: UnarySink<SwitchModeResponse>,
    ) {
        if !check_common_name(self.security_mgr.cert_allowed_cn(), &ctx) {
            return;
        }
        let label = "switch_mode";
        let timer = Instant::now_coarse();

        let res = {
            let mut switcher = self.switcher.lock().unwrap();
            fn mf(cf: &str, name: &str, v: f64) {
                CONFIG_ROCKSDB_GAUGE.with_label_values(&[cf, name]).set(v);
            }

            match req.get_mode() {
                SwitchMode::Normal => switcher.enter_normal_mode(&self.engine, mf),
                SwitchMode::Import => switcher.enter_import_mode(&self.engine, mf),
            }
        };
        match


 from "bcrypt";
var db: Connection = require("./db").db;

const favourTypeEnum = {
	REQUEST: 0,
	OFFER: 1,
};

const favourStatusEnum = {
	OPEN: 0,
	CLAIMED: 1,
	COMPLETE: 2,
};
const saltRounds = 10;

//Return number of favours requested by users, specified by count
router.get("/favours", (req: Request, res: Response) => {
	var query: string =
		"SELECT f.*, u.username, GROUP_CONCAT(fc.category) AS categories FROM Favour f JOIN User u ON f.user_id = u._id LEFT JOIN Favour_Categories fc ON f._id=fc._id";
	var where_strings: string[] = [];
	var placeholder_vars: any = [];
	if (req.query["location"]) {
		where_strings.push("f.location=?");
		placeholder_vars.push(req.query["location"]);
	}
	if (req.query["categories"]) {
		//Expected for categories to be sent in csv format
		where_strings.push("fc.category IN (?)");
		placeholder_vars.push(req.query["category"]);
	}
	if (req.query["favourType"]) {
		//Expected for categories to be sent in csv format
		switch (req.query["favourType"]) {
			case "request":
				placeholder_vars.push(favourTypeEnum.REQUEST);
				where_strings.push("f.favour_type=?");
				break;
			case "offer":
				placeholder_vars.push(favourTypeEnum.OFFER);
				where_strings.push("f.favour_type=?");
				break;
			default:
				break; //Skip
		}
	}

	if (req.query["favourStatus"]) {
		//Expected for categories to be sent in csv format
		switch (req.query["favourStatus"]) {
			case "open":
				placeholder_vars.push(favourStatusEnum.OPEN);
				where_strings.push("f.favour_status=?");
				break;
			case "claimed":
				placeholder_vars.push(favourStatusEnum.CLAIMED);
				where_strings.push("f.favour_status=?");
				break;
			case "complete":
				placeholder_vars.push(favourStatusEnum.COMPLETE);

				where_strings.push("f.favour_status=?");
				break;
			default:
				break; //Skip
		}
	}

	if (where_strings.length > 0) {
		query += " WHERE " + where_strings.join(" AND ");
	}

	const page: number = req.query["page"] ? Number(req.query["page"]) - 1 : 0; //Default to 0 if no page number is given

	const count: number = req.query["count"] ? Number(req.query["count"]) : 20; //Default to 20 if no count is given
	query += " GROUP BY f._id ORDER BY date DESC LIMIT ?,?";
	db.query(query, placeholder_vars.concat([page * count, count]), function (
		err,
		result
	) {
		if (err) console.log(err), res.send("error");
		res.send(result); //Send back list of object returned by SQL query
	});
});

//Return information on particular Favour given the ID
router.get("/favours/:id", (req: Request, res: Response) => {
	var query: string =
		"SELECT f.*,u.username FROM Favour f JOIN User u ON f.user_id=u._id WHERE f._id=?";
	db.query(query, req.params.id, function (err, result) {
		if (err) console.log(err), res.send("error");
		res.send(result); //Send back list of object returned by SQL query
	});
});

//Post request to submit a favour
router.post("/favours", (req: Request, res: Response) => {
	//check if user is valid
	if (!req.session!.user


().equals(CommonConstant.MENU_TYPE_0) || permission.getMenuType().equals(CommonConstant.MENU_TYPE_1)) {
			json.put("id", permission.getId());
			if (permission.isRoute()) {
				json.put("route", "1");// 表示生成路由
			} else {
				json.put("route", "0");// 表示不生成路由
			}

			if (isWWWHttpUrl(permission.getUrl())) {
				json.put("path", MD5Util.MD5Encode(permission.getUrl(), "utf-8"));
			} else {
				json.put("path", permission.getUrl());
			}

			// 重要规则：路由name (通过URL生成路由name,路由name供前端开发，页面跳转使用)
			if (oConvertUtils.isNotEmpty(permission.getComponentName())) {
				json.put("name", permission.getComponentName());
			} else {
				json.put("name", urlToRouteName(permission.getUrl()));
			}

			// 是否隐藏路由，默认都是显示的
			if (permission.isHidden()) {
				json.put("hidden", true);
			}
			// 聚合路由
			if (permission.isAlwaysShow()) {
				json.put("alwaysShow", true);
			}
			json.put("component", permission.getComponent());
			JSONObject meta = new JSONObject();
			// 由用户设置是否缓存页面 用布尔值
			if (permission.isKeepAlive()) {
				meta.put("keepAlive", true);
			} else {
				meta.put("keepAlive", false);
			}

			/*update_begin author:wuxianquan date:20190908 for:往菜单信息里添加外链菜单打开方式 */
			//外链菜单打开方式
			if (permission.isInternalOrExternal()) {
				meta.put("internalOrExternal", true);
			} else {
				meta.put("internalOrExternal", false);
			}
			/* update_end author:wuxianquan date:20190908 for: 往菜单信息里添加外链菜单打开方式*/

			meta.put("title", permission.getName());

			//update-begin--Author:scott  Date:20201015 for：路由缓存问题，关闭了tab页时再打开就不刷新 #842
			String component = permission.getComponent();
			if(oConvertUtils.isNotEmpty(permission.getComponentName()) || oConvertUtils.isNotEmpty(component)){
				meta.put("componentName", oConvertUtils.getString(permission.getComponentName(),component.substring(component.lastIndexOf("/")+1)));
			}
			//update-end--Author:scott  Date:20201015 for：路由缓存问题，关闭了tab页时再打开就不刷新 #842

			if (oConvertUtils.isEmpty(permission.getParentId())) {
				// 一级菜单跳转地址
				json.put("redirect", permission.getRedirect());
				if (oConvertUtils.isNotEmpty(permission.getIcon())) {
					meta.put("icon", permission.getIcon());
				}
			} else {
				if (oConvertUtils.isNotEmpty(permission.getIcon())) {
					meta.put("icon", permission.getIcon());
				}
			}
			if (isWWWHttpUrl(permission.getUrl())) {
				meta.put("url", permission.getUrl());
			}
			json.put("meta", meta);
		}

		return json;
	}

	/**
	 * 判断是否外网URL 例如： http://localhost:8080/jeecg-boot/swagger-ui.html#/ 支持特殊格式： {{
	 * window._CONFIG['domianURL'] }}/druid/ {{ JS代码片段 }}，前台解析会自动执行JS代码片段
	 *
	 * @return
	 */
	private boolean isWWWHttpUrl(String url) {
		if (url != null && (url.startsWith("http://") || url.starts


periodic variant
float pnoise(vec2 P, vec2 rep) {
  vec4 Pi = floor(P.xyxy) + vec4(0.0, 0.0, 1.0, 1.0);
  vec4 Pf = fract(P.xyxy) - vec4(0.0, 0.0, 1.0, 1.0);
  Pi = mod(Pi, rep.xyxy); // To create noise with explicit period
  Pi = mod289(Pi);        // To avoid truncation effects in permutation
  vec4 ix = Pi.xzxz;
  vec4 iy = Pi.yyww;
  vec4 fx = Pf.xzxz;
  vec4 fy = Pf.yyww;

  vec4 i = permute(permute(ix) + iy);

  vec4 gx = fract(i * (1.0 / 41.0)) * 2.0 - 1.0 ;
  vec4 gy = abs(gx) - 0.5 ;
  vec4 tx = floor(gx + 0.5);
  gx = gx - tx;

  vec2 g00 = vec2(gx.x,gy.x);
  vec2 g10 = vec2(gx.y,gy.y);
  vec2 g01 = vec2(gx.z,gy.z);
  vec2 g11 = vec2(gx.w,gy.w);

  vec4 norm = taylorInvSqrt(vec4(dot(g00, g00), dot(g01, g01), dot(g10, g10), dot(g11, g11)));
  g00 *= norm.x;
  g01 *= norm.y;
  g10 *= norm.z;
  g11 *= norm.w;

  float n00 = dot(g00, vec2(fx.x, fy.x));
  float n10 = dot(g10, vec2(fx.y, fy.y));
  float n01 = dot(g01, vec2(fx.z, fy.z));
  float n11 = dot(g11, vec2(fx.w, fy.w));

  vec2 fade_xy = fade(Pf.xy);
  vec2 n_x = mix(vec2(n00, n01), vec2(n10, n11), fade_xy.x);
  float n_xy = mix(n_x.x, n_x.y, fade_xy.y);
  return 2.3 * n_xy;
}

vec3 hsv(float h, float s, float v){
	vec4 t = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
	vec3 p = abs(fract(vec3(h) + t.xyz) * 6.0 - vec3(t.w));
	return v * mix(vec3(t.x), clamp(p - vec3(t.x), 0.0, 1.0), s);
}

// Ref: http://lolengine.net/blog/2013/07/27/rgb-to-hsv-in-glsl
vec3 hsv2rgb(vec3 c) {
	vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
  vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www);
  return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}

// Ref: https://thebookofshaders.com/05/
float plot(vec2 st, float pct){
  return  smoothstep( pct - .008, pct, st.y) -
          smoothstep( pct, pct + .008, st.y);
}

// Ref: https://thebookofshaders.com/10/
float random (vec2 st) {
	return fract(sin(dot(st.xy, vec2(12.9898,78.233))) * 43758.5453123);
}

float function(in float x, in vec2 uv) {
	float y = 0.;
	${fomula}
	return y;
}

void main() {
	vec


    if (escolhahumana == 2) {
        images.createImage(`
            # # # # #
            # # # # #
            # # # # #
            # # # # #
            # # # # #
            `).showImage(0)
    }
    if (escolhahumana == 3) {
        images.createImage(`
            # # . . .
            # # . # #
            . . # . .
            # # . # #
            # # . . .
            `).showImage(0)
    }
})
let escolhamaquina = 0
let escolhahumana = 0
escolhahumana = 0
// This demo shows how to create bookmarks then link to them with internal hyperlinks

import * as fs from "fs";
import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageReference } from "docx";

const LOREM_IPSUM =
    /* cspell:disable-next-line */
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante.";

const doc = new Document({
    creator: "Clippy",
    title: "Sample Document",
    description: "A brief example of using docx with bookmarks and internal hyperlinks",
    sections: [
        {
            footers: {
                default: new Footer({
                    children: [
                        new Paragraph({
                            children: [
                                new InternalHyperlink({
                                    children: [
                                        new TextRun({
                                            text: "Click here!",
                                            style: "Hyperlink",
                                        }),
                                    ],
                                    anchor: "myAnchorId",
                                }),
                            ],
                        }),
                    ],
                }),
            },
            children: [
                new Paragraph({
                    heading: HeadingLevel.HEADING_1,
                    children: [
                        new Bookmark({
                            id: "myAnchorId",
                            children: [new TextRun("Lorem Ipsum")],
                        }),
                    ],
                }),
                new Paragraph("\n"),
                new Paragraph(LOREM_IPSUM),
                new Paragraph({
                    children: [new PageBreak()],
                }),
                new Paragraph({
                    children: [
                        new InternalHyperlink


_size; va += PAGE_SIZE)
		pmap_kenter_attr(0x10000000 + va, fb_paddr + va,
		    VM_MEMATTR_WRITE_COMBINING);
	sc->fb_info.fb_flags &= ~FB_FLAG_NOWRITE;
}

static int
ps3fb_init(struct vt_device *vd)
{
	struct ps3fb_softc *sc;
	char linux_video_mode[24];
	int linux_video_mode_num = 0;

	/* Init softc */
	vd->vd_softc = sc = &ps3fb_softc;

	sc->fb_info.fb_depth = 32;
	sc->fb_info.fb_height = 1080;
	sc->fb_info.fb_width = 1920;

	/* See if the bootloader has passed a graphics mode to use */
	bzero(linux_video_mode, sizeof(linux_video_mode));
	TUNABLE_STR_FETCH("video", linux_video_mode, sizeof(linux_video_mode));
	sscanf(linux_video_mode, "ps3fb:mode:%d", &linux_video_mode_num);

	switch (linux_video_mode_num) {
	case 1:
	case 2:
		sc->fb_info.fb_height = 480;
		sc->fb_info.fb_width = 720;
		break;
	case 3:
	case 8:
		sc->fb_info.fb_height = 720;
		sc->fb_info.fb_width = 1280;
		break;
	case 4:
	case 5:
	case 9:
	case 10:
		sc->fb_info.fb_height = 1080;
		sc->fb_info.fb_width = 1920;
		break;
	case 6:
	case 7:
		sc->fb_info.fb_height = 576;
		sc->fb_info.fb_width = 720;
		break;
	case 11:
		sc->fb_info.fb_height = 768;
		sc->fb_info.fb_width = 1024;
		break;
	case 12:
		sc->fb_info.fb_height = 1024;
		sc->fb_info.fb_width = 1280;
		break;
	case 13:
		sc->fb_info.fb_height = 1200;
		sc->fb_info.fb_width = 1920;
		break;
	}

	/* Allow explicitly-specified values for us to override everything */
	TUNABLE_INT_FETCH("hw.ps3fb.height", &sc->fb_info.fb_height);
	TUNABLE_INT_FETCH("hw.ps3fb.width", &sc->fb_info.fb_width);

	sc->fb_info.fb_stride = sc->fb_info.fb_width*4;
	sc->fb_info.fb_size = sc->fb_info.fb_height * sc->fb_info.fb_stride;
	sc->fb_info.fb_bpp = sc->fb_info.fb_stride / sc->fb_info.fb_width * 8;

	/*
	 * Arbitrarily choose address for the framebuffer
	 */

	sc->fb_info.fb_vbase = 0x10000000;
	sc->fb_info.fb_flags |= FB_FLAG_NOWRITE; /* Not available yet */
	sc->fb_info.fb_cmsize = 16;

	/* 32-bit VGA palette */
	vt_config_cons_colors(&sc->fb_info, COLOR_FORMAT_RGB,
	    255, 16, 255, 8, 255, 0);

	/* Set correct graphics context */
	lv1_gpu_context_attribute(sc->sc_fbcontext,
	    L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 0, 0, 0, 0);
	lv1_gpu_context_attribute(sc->sc_fbcontext,
	    L1GPU_CONTEXT_ATTRIBUTE_DISPLAY_FLIP, 1, 0, 0, 0);

	vt_fb_init(vd);

	return (CN_INTERNAL);
}


ents/forms/auto-complete";
@import "components/microblog/microblog";
@import "components/microblog/comment";
@import "components/forum/section";
@import "components/forum/topic";
@import "components/forum/comment";
@import "components/forum/poll";
@import "components/job/job";
@import "components/job/pricing";
@import "components/job/location";
@import "components/comment";
@import "components/guide/guide";
@import "components/gdpr";
@import "components/heading";
@import "components/popovers";

@import "perfect-scrollbar/css/perfect-scrollbar";
@import "balloon-css/src/balloon";
@mixin light {
  @include scope(theme-light) {@content}
}

@mixin dark {
  @include scope(theme-dark) {@content}
}

@mixin scope($class) {
  @if & {
    *:where(html.#{$class}) & {@content}
  } @else {
    *:where(html.#{$class}) {@content}
  }
}

@mixin both {
  @content;
}

@mixin property($property, $light, $dark) {
  @include light {#{$property}: $light}
  @include dark {#{$property}: $dark}
}

@mixin propertyImportant($property, $light, $dark) {
  @include light {#{$property}: $light !important;}
  @include dark {#{$property}: $dark !important;}
}

@mixin var($property, $themedProperty) {
  @if (type-of($themedProperty) == 'map') {
    @include property($property, map-get($themedProperty, 'light'), map-get($themedProperty, 'dark'));
  } @else {
    @include property($property, $themedProperty, $themedProperty);
  }
}

@mixin color($light, $dark) {
  @include property(color, $light, $dark);
}

@mixin background($light, $dark) {
  @include property(background, $light, $dark);
}

// Deprecated
@mixin background-theme($light, $dark) {
  @include background($light, $dark)
}

@mixin color-theme($light, $dark) {
  @include color($light, $dark);
}

@mixin theme {
  @include both {@content}
}
@use "../lookAndFeel/feel" as feel;
@use "../lookAndFeel/size" as size;
@use "../lookAndFeel/style-guide" as style;
@use "../theme/theme" as theme;

@mixin icon($size, $borderRadius) {
  display:         inline-flex;
  justify-content: center;
  align-items:     center;
  width:           $size;
  height:          $size;
  border-radius:   $borderRadius;
}

.reset {
  font-family: Arial, sans-serif;
  font-size:   14px;
  ul {
    margin-bottom: 0;
    padding-left:  0;
    list-style:    none;
  }
  p {
    margin: 0;
  }
}

.page-heading {
  text-align:    center;
  @include theme.property(color, style.$neutral-700, style.$neutral-050);
  margin-top:    44px;
  margin-bottom: 24px;
  .page-heading__title {
    font-size:   32px;
    font-weight: 600;
  }
  .page-heading__subtitle {
    font-


le": v.name, "docstatus": 0},
            order_by="maintenance_date desc",
            fields=["name", "state"],
        )
        if maintenance_visits is None or len(maintenance_visits) == 0:
            # Step A1: Create a new Maintenance Visit for each Vehicle
            create_maintenance_visit(v)
        elif len(maintenance_visits) == 1:
            # Step B1: verify that the state is UPCOMING OR UNCHECKED
            verify_vehicle_with_maintenance(v, maintenance_visits[0])
        elif len(maintenance_visits) > 1:
            # Step C1: verify that the state is UPCOMING OR UNCHECKED
            verify_vehicle_with_maintenance(v, maintenance_visits[0])
            # Step C2: keep the latest Un-submitted Maintenance Visit
            for visit in maintenance_visits[1:]:
                frappe.delete_doc("Maintenance Visit KA", visit.name)

def verify_vehicle_with_maintenance(v, mv):
    """
    Verify the Vehicle is up to date with the visit otherwise create a new one
    Steps:
    1. Get the Vehicle data and get the Maintenance Data
    Case A: as expected
    Case B: create a new one with UNCHECKED state
    """
    if mv is None:
        print("\n\n\n No Maintenance Visit for this vehicle")
        create_maintenance_visit(v)
        return
    if mv.state != VehicleStatus.UPCOMING.value and mv.state != VehicleStatus.UNCHECKED.value:
        print("\n\n\n Maintenance Visit is not in UPCOMING or UNCHECKED state")
        frappe.delete_doc("Maintenance Visit KA", mv.name)
        create_maintenance_visit(v)
        return
    if mv.rider != v.rider:
        print("\n\n\n Rider is not the same")
        mv = frappe.get_doc("Maintenance Visit KA", mv.name)
        mv.rider = v.rider
        mv.rider_name = v.rider_name
        mv.rider_phone_number = v.phone_number
        mv.rider_whatsapp_number = v.whatsapp_number
        mv.save()
        return

def create_maintenance_visit(v):
    today = nowdate()
    mv = frappe.new_doc("Maintenance Visit KA")
    mv.vehicle = v.name
    mv.company = v.company
    mv.last_km = v.current_km
    mv.new_km = v.current_km
    mv.rider = v.rider
    mv.rider_name = v.rider_name
    mv.rider_phone_number = v.phone_number
    mv.rider_whatsapp_number = v.whatsapp_number
    mv.maintenance_date = today
    mv.state = VehicleStatus.UNCHECKED.value
    mv.insert()

def update_state():
    update_state_and_send_notifications()
    delete_LTO_maintenance_visits()
    # Make sure all vehicle have a draft MaintenanceVisitKA
    sync_vehicle_with_maintenance()

#  bench execute ka_vehicle_maintenance.schedules.update_state


+ ' class="' + buttonSubscribeClass + '">' + buttonSubscribe + '</button>
');
          }

          if (channelType) {
            nSHTML.push('
Channel Type

' + channelType + '
');
          }

          if (features) {
            nSHTML.push('
Features

');

            var nF = [];

            features.forEach(iri => {
              var label, href = iri;

              switch (iri) {
                case ns.notify.startAt.value:
                case ns.notify.endAt.value:
                case ns.notify.state.value:
                case ns.notify.rate.value:
                case ns.notify.accept.value:
                  label = getFragmentFromString(iri);
                  href = 'https://solidproject.org/TR/2022/notifications-protocol-20221231#notify-' + label;
                  break;

                default:
                  break;
              }

              nSHTML.push('
' + label + '
');
            });

            nSHTML.push('

');
          }

          nSHTML.push('

');
        })

        nSHTML.push('
');
      }

      return nSHTML.join('');
    },

    //https://solidproject.org/TR/notifications-protocol#discovery
    getNotificationSubscriptions: function(g) {
      var notifysubscription = g.out(ns.notify.subscription).values;
      return (notifysubscription.length)
        ? notifysubscription
        : undefined
    },

    getNotificationChannels: function(g) {
      var notifychannel = g.out(ns.notify.channel).values;
      return (notifychannel.length)
        ? notifychannel
        : undefined
    },

    getNotificationChannelTypes: function(g) {
      var notifychannelType = g.out(ns.notify.channelType).values;
      return (notifychannelType)
        ? notifychannelType
        : undefined
    },

    getNotificationFeatures: function(g) {
      var notifyfeature = g.out(ns.notify.feature).values;
      return (notifyfeature.length)
        ? notifyfeature
        : undefined
    },

    //doap:implements <https://solidproject.org/TR/2022/notification-protocol-20221231#subscription-client-subscription-request>
    subscribeToNotificationChannel: function(url, data) {
      switch(data.type){
        //doap:implements <https://solidproject.org/TR/websocket-channel-2023>
        case ns.notify.WebSocketChannel2023.value:
          return DO.U.subscribeToWebSocketChannel(url, data);
      }
    },

    //doap:implements <https://solidproject.org/TR/2022/notification-protocol-20221231#notification-channel-data-model>
    subscribeToWebSocketChannel: function(url, d, options = {}) {
      if (!url || !d.type || !d.topic) { return Promise.reject(); }

      options['contentType'] = options.contentType || 'application/ld+json';

      var data;

      switch (options.contentType) {
        case 'text/turtle':
          data = '<> a <' + d.type  + '> ;\n\
  <http://www.w3.org/ns/solid/notifications#topic> <' + d.topic + '> .';
          break;

        default:
        case 'application/ld+json':
          d['@context'] = d['@context'] || ["https://www.w3.org/ns/solid/notification/v1"];
          // d['id'] = d['id'] || '';
          // data['feature'] = '';
          data = JSON.stringify(d);


(context) {
    Env* env = context->env();
    SetReaderFactory([this, env]() { return new TFRecordReader(name(), env); });
  }
};

REGISTER_KERNEL_BUILDER(Name("TFRecordReader").Device(DEVICE_CPU),
                        TFRecordReaderOp);
```

An example with attrs:

```c++
#include "tensorflow/core/framework/reader_op_kernel.h"

class TextLineReaderOp : public ReaderOpKernel {
 public:
  explicit TextLineReaderOp(OpKernelConstruction* context)
      : ReaderOpKernel(context) {
    int skip_header_lines = -1;
    OP_REQUIRES_OK(context,
                   context->GetAttr("skip_header_lines", &skip_header_lines));
    OP_REQUIRES(context, skip_header_lines >= 0,
                errors::InvalidArgument("skip_header_lines must be >= 0 not ",
                                        skip_header_lines));
    Env* env = context->env();
    SetReaderFactory([this, skip_header_lines, env]() {
      return new TextLineReader(name(), skip_header_lines, env);
    });
  }
};

REGISTER_KERNEL_BUILDER(Name("TextLineReader").Device(DEVICE_CPU),
                        TextLineReaderOp);
```

The last step is to add the Python wrapper.  You can either do this by
@{$adding_an_op#building_the_op_library$compiling a dynamic library}
or, if you are building TensorFlow from source, adding to `user_ops.py`.
For the latter, you will import `tensorflow.python.ops.io_ops` in
[`tensorflow/python/user_ops/user_ops.py`](https://www.tensorflow.org/code/tensorflow/python/user_ops/user_ops.py)
and add a descendant of [`io_ops.ReaderBase`](https://www.tensorflow.org/code/tensorflow/python/ops/io_ops.py).

```python
from tensorflow.python.framework import ops
from tensorflow.python.ops import common_shapes
from tensorflow.python.ops import io_ops

class SomeReader(io_ops.ReaderBase):

    def __init__(self, name=None):
        rr = gen_user_ops.some_reader(name=name)
        super(SomeReader, self).__init__(rr)

ops.NotDifferentiable("SomeReader")
```

You can see some examples in
[`tensorflow/python/ops/io_ops.py`](https://www.tensorflow.org/code/tensorflow/python/ops/io_ops.py).

## Writing an Op for a record format

Generally this is an ordinary op that takes a scalar string record as input, and
so follow @{$adding_an_op$the instructions to add an Op}.
You may optionally take a scalar string key as input, and include that in error
messages reporting improperly formatted data.  That way users can more easily
track down where the bad data came from.

Examples of Ops useful for decoding records:

*   @{tf.parse_single_example}
    (and
    @{tf.parse_example})
*   @{tf.decode_csv}
*   @{tf.decode_raw}

Note that it can be useful to use multiple Ops to decode a particular record
format.  For example, you may have an image saved as a string in
[a `tf.train.Example` protocol buffer](https://www.tensorflow.org/code/tensorflow/core/example/example.proto).
Depending on the format of that image, you might take the corresponding output
from a
@{tf.parse_single_example}
op and call @{tf.image.decode_jpeg},
@{tf.image.decode_png}, or
@{tf.decode_raw}.  It is common to
take the output of `tf.decode_raw` and use
@{tf.slice} and
@{tf.reshape} to extract pieces.
# Mandelbrot Set

Visualizing the [Mandelbrot set](https://en.wikipedia.org/wiki/Mandelbrot_set


 var1, int var2, int var3, int var4, int var5, int var6, int var7, int var8, int var9, long var10, int var12, int var13, boolean var14) {
      qh var15 = new qh();
      var15.aw((float)((double)(-var2) * 0.0030679615D), 870981566);
      var15.ak((float)((double)(-var3) * 0.0030679615D), 309319879);
      var15.ai((float)var7, (float)var8, (float)var9, -1209216541);
      qs var16 = new qs();
      var16.ab(var15, -1473520632);
      var16.ag((byte)100);
      int var17 = this.ak % 300;
      float var18 = (float)var17 / 300.0F * 6.283F;
      float var19 = (float)Math.sin((double)var18);
      float var20 = (float)Math.cos((double)var18);
      float var21 = var19 * 3.14159F / 100.0F;
      float var22 = var20 * 3.14159F / 100.0F;
      qj var23 = new qj();
      qs var24 = new qs();
      var23.ap = new qp((float)((double)var1 * 0.0030679615D), var21, var22);
      var23.aw = new qt((float)(var4 - 64), (float)var5, (float)(var6 - 64));
      qs var25 = new qs();
      var25.af(var23, 1040070323);
      var25.ag((byte)100);
      qj var26 = new qj();
      var26.aw = new qt((float)(-(this.ai * 64)), 0.0F, (float)(-(this.ay * 64)));
      qs var27 = new qs();
      var27.af(var26, 898882263);
      var24.ad(1.0F, 1.0F, 1.0F, 1.0F, -659724977);
      var27.ao(var24, 339159182);
      var24.af(var23, 2138899165);
      var27.ao(var24, 339958208);
      var27.ao(var16, -198848791);
      this.bv = (int)var25.ax((float)var7, (float)var8, (float)var9, (byte)7);
      this.bx = (int)var25.aq((float)var7, (float)var8, (float)var9, 1230594649);
      this.bk = (int)var25.al((float)var7, (float)var8, (float)var9, (byte)-122);
      this.bb = this.bv / 128;
      this.bq = this.bk / 128;
      this.bp = (int)var25.ax((float)var12, 0.0F, (float)var13, (byte)7) / 128;
      this.bz = (int)var25.al((float)var12, 0.0F, (float)var13, (byte)-10) / 128;
      jc var28 = new jc(var27);
      this.cx(var28, var14);
   }

   public void ix(int var1, int var2, int var3) {
      this.bu = var1;
      this.bt = var2;
      this.bs = var3;
   }

   public void en() {
      for(int var1 = 0; var1 < this.at; ++var1) {
         kf var2 = this.au[var1];
         this.ad(var2);
         this.au[var1] = null;
      }

      this.at = 0;
   }

   public void ef() {
      for(int var1 = 0; var1 < this.at; ++var1) {
         kf var2 = this.au[var1];
         this.ad(var2);
         this.au[var1] = null;
      }

      this.at = 0;
   }

   void em(kf var1) {
      for(int v


Month`
        */ "PeriodUnit"?: string;
        /**
        * 是否自动续费包年包月专有宿主机。
        * >当参数**ChargeType**取值PrePaid时， **AutoRenew**参数方可生效。
        * 默认值：false
        * @example `false`
        */ "AutoRenew"?: boolean;
        /**
        * 单次自动续费的周期，单位：月。取值范围：1 | 2 | 3 | 6 | 12
        * >当参数**AutoRenew**为true时，**AutoRenewPeriod**参数方可生效并为必填参数。
        * @example `1`
        */ "AutoRenewPeriod"?: number;
        /**
        * 专有宿主机自动释放时间。需按照ISO8601标准表示，并使用UTC+0时间。格式：yyyy-MM-ddTHH:mm:ssZ
        * >
        * - 最短设置为当前时间之后半小时。
        * - 最长不能超过当前时间之后三年。
        * - 若参数值中的秒（ss）不是00，则自动取为00。
        * @example `2019-08-21T12:30:24Z`
        */ "AutoReleaseTime"?: string;
        /**
        * 保证请求幂等性。从您的客户端生成一个参数值，确保不同请求间该参数值唯一。只支持ASCII字符，且不能超过64个字符。更多详情，请参见[如何保证幂等性](~~25693~~)。
        * @example `123e4567-e89b-12d3-a456-426655440000`
        */ "ClientToken"?: string;
    }): Promise<{
        "RequestId": string;
        "DedicatedHostIdSets": {
            "DedicatedHostId": string[];
        };
    }>;
    /**
    * 调用DescribeDedicatedHostTypes查询指定地域下支持的专有宿主机规格详细参数，或者查询专有宿主机支持的ECS实例规格族。
    */ DescribeDedicatedHostTypes(query: {
        /**
        * 专有宿主机所在地域ID。您可以调用[DescribeRegions](~~25609~~)查看最新的阿里云地域列表。
        * @example `cn-hangzhou`
        */ "RegionId": string;
        /**
        * @example `cn-beijing`
        */ "SourceRegionId"?: string;
        "OwnerId"?: number;
        /**
        * 专有宿主机规格。更多详情，请参见[宿主机规格](~~68564~~)。
        * @example `ddh.sn1ne`
        */ "DedicatedHostType"?: string;
        /**
        * 专有宿主机规格支持的ECS实例规格族。
        * @example `ecs.sn1ne`
        */ "SupportedInstanceTypeFamily"?: string;
    }): Promise<{
        "DedicatedHostTypes": {


MMUNE_ENEMIES
	end

	-- Scepter: Find a secondary target to shot at. Prioritize heroes
	if scepter or caster:HasTalent("special_bonus_imba_skywrath_mage_9") then
		local enemy_heroes = FindUnitsInRadius(caster:GetTeamNumber(),
											   target:GetAbsOrigin(),
											   nil,
											   scepter_search_radius,
											   DOTA_UNIT_TARGET_TEAM_ENEMY,
											   DOTA_UNIT_TARGET_HERO,
											   target_flags,
											   FIND_ANY_ORDER,
											   false)

		local extra_bolts	= caster:FindTalentValue("special_bonus_imba_skywrath_mage_9")
		local counter		= 0

		if scepter then
			extra_bolts = extra_bolts + 1
		end

		-- If at least one hero was found to shot at, make sure it's not the main target
		for _,enemy_hero in pairs(enemy_heroes) do
			if enemy_hero ~= target then
				-- Launch a bolt at this blyat
				LaunchArcaneBolt(caster, ability, enemy_hero)

				counter = counter + 1

				if counter >= extra_bolts then
					return nil
				end
			end
		end

		-- No heroes found. Try finding a creep instead
		local enemy_creeps = FindUnitsInRadius(caster:GetTeamNumber(),
											   target:GetAbsOrigin(),
											   nil,
											   scepter_search_radius,
											   DOTA_UNIT_TARGET_TEAM_ENEMY,
											   DOTA_UNIT_TARGET_BASIC,
											   target_flags,
											   FIND_ANY_ORDER,
											   false)

		for _,enemy_creep in pairs(enemy_creeps) do
			-- Make sure it's not the main target
			if enemy_creep ~= target then
				-- Fire at this creep blyat
				LaunchArcaneBolt(caster, ability, enemy_creep)

				counter = counter + 1

				if counter >= extra_bolts then
					return nil
				end
			end
		end
	end
end

function LaunchArcaneBolt(caster, ability, target)
	-- Ability properties
	local modifier_wrath = "modifier_imba_arcane_bolt_buff"

	-- Ability specials
	local projectile_speed = ability:GetSpecialValueFor("projectile_speed")
	local projectile_speed_per_stack = ability:GetSpecialValueFor("projectile_speed_per_stack")
	local vision_radius = ability:GetSpecialValueFor("vision_radius")

	-- Fetch current amount of Arcane Wrath stacks
	local stacks = 0
	if caster:HasModifier(modifier_wrath) then
		local modifier_wrath_handler = caster:FindModifierByName(modifier_wrath)
		if modifier_wrath_handler then
			stacks = modifier_wrath_handler:GetStackCount()
		end
	end

	-- Increase projectile speed based on stacks
	projectile_speed = projectile_speed + projectile_speed_per_stack * stacks

	-- Fire projectile at target
	local arcane_bolt_projectile
	arcane_bolt_projectile = {Target = target,
							  Source = caster,
							  Ability = ability,
							  EffectName = caster.arcane_bolt_pfx or "particles/units/heroes/hero_skywrath_mage/skywrath_mage_arcane_bolt.vpcf",
							  iMoveSpeed = projectile_speed,
							  bDodgeable = false,
							  bVisibleToEnemies = true,
							  bReplaceExisting = false,
							  bProvidesVision =


ck.SYSCLK_Frequency) > 0UL));

      LL_LPTIM_ClearFlag_CMPOK(LPTIMx);
    }

    if (tmpARR != 0UL)
    {
      LPTIMx->CR |= LPTIM_CR_ENABLE;
      LPTIMx->ARR = tmpARR;

      LL_RCC_GetSystemClocksFreq(&rcc_clock);
      /* Polling on ARR write ok status after above restore operation */
      do
      {
        rcc_clock.SYSCLK_Frequency--; /* Used for timeout */
      } while (((LL_LPTIM_IsActiveFlag_ARROK(LPTIMx) != 1UL)) && ((rcc_clock.SYSCLK_Frequency) > 0UL));

      LL_LPTIM_ClearFlag_ARROK(LPTIMx);
    }

#if defined(LPTIM_RCR_REP)
    if (tmpRCR != 0UL)
    {
      LPTIMx->CR |= LPTIM_CR_ENABLE;
      LPTIMx->RCR = tmpRCR;

      LL_RCC_GetSystemClocksFreq(&rcc_clock);
      /* Polling on RCR write ok status after above restore operation */
      do
      {
        rcc_clock.SYSCLK_Frequency--; /* Used for timeout */
      } while (((LL_LPTIM_IsActiveFlag_REPOK(LPTIMx) != 1UL)) && ((rcc_clock.SYSCLK_Frequency) > 0UL));

      LL_LPTIM_ClearFlag_REPOK(LPTIMx);
    }
#endif

    /* Restore LPTIM source kernel clock */
    LL_RCC_SetLPTIMClockSource(tmpclksource);
  }

  /* Restore configuration registers (LPTIM should be disabled first) */
  LPTIMx->CR &= ~(LPTIM_CR_ENABLE);
  LPTIMx->IER = tmpIER;
  LPTIMx->CFGR = tmpCFGR;
  LPTIMx->OR = tmpOR;

  /* Exit critical section: restore previous priority mask */
  __set_PRIMASK(primask_bit);
}

/**
  * @}
  */

/**
  * @}
  */

/**
  * @}
  */

#endif /* LPTIM1 || LPTIM2 */

/**
  * @}
  */

#endif /* USE_FULL_LL_DRIVER */


++) { //ģǰѾpadding
		double th[H] = { 0 };
		double x[MAX_F]; //Ĵ

		for (int k = i - hw, xp = 0; k <= i + hw; k++) { //ÿԪ
			int offset = id[k] * words.element_size;
			for (int j = 0; j < words.element_size; j++, xp++) {
				x[xp] = words.value[offset + j];
			}
		}

		fastmult(B, x, th, input_size, H); //TODO ԺH1ĴС

		for (int j = 0; j < H; j++) {
			if (th[j] > h[j]) {
				h[j] = th[j];
				maxhi[j] = i; //λ
			}
		}
	}

	for (int i = 0; i < H; i++) {
		h[i] = max(0.0, h[i] + h_b[i]);
	}

	double r[MAX_C] = { 0 };
	if (gd) { //ѵʱ
		for (int j = 0; j < H; j++) {
			if (nextDouble() < dropout) {
				h[j] = 0;
			}
		}
		for (int i = 0; i < class_size; i++) {
			r[i] = biasOutput[i];
			for (int j = 0; j < H; j++) {
				r[i] += h[j] * A[i*H + j];
			}
		}
	} else {
		for (int i = 0; i < class_size; i++) {
			r[i] = biasOutput[i];
			for (int j = 0; j < H; j++) {
				r[i] += h[j] * A[i*H + j] / (1 - dropout);
			}
		}
	}

	double y[MAX_C];
	softmax(r, y, class_size);

	double dy = ans - r[0];

	if (gd) { //޸Ĳ
		double dh[H] = { 0 };
		if (class_size == 1) { //ع
			biasOutput[0] += alpha * (dy - lambda*biasOutput[0]);
			for (int j = 0; j < H; j++) {
				dh[j] += dy * A[j];
				//dh[j] *= 1 - h[j] * h[j];
				if (h[j] <= 0)
					dh[j] = 0;
			}
		} else {
			for (int i = 0; i < class_size; i++) {
				if (i == ans) {
					biasOutput[i] += alpha*(1 - y[i] - lambda*biasOutput[i]);
				} else {
					biasOutput[i] += alpha*(0 - y[i] - lambda*biasOutput[i]);
				}
			}
			for (int j = 0; j < H; j++) {
				dh[j] = A[ans*H + j];
				for (int i = 0; i < class_size; i++) {
					dh[j] -= y[i] * A[i*H + j];
				}
				//dh[j] *= 1 - h[j] * h[j];
				if (h[j] <= 0)
					dh[j] = 0;

				if (dropout > 0 && h[j] == 0)
					dh[j] = 0;
				//dh[j] *= h[j]*(1-h[j]);
				/*if(h[j] > 1 || h[j] < -1)
				dh[j] = 0;
				biasH[j] += alpha * dh[j];*/
				h_b[j] += alpha * dh[j];
			}
		}

		//#pragma omp critical
		{
			for (int i = 0; i < class_size; i++) {
				double v = (i == ans ? 1 : 0) - y[i];
				for (int j = 0; j < H; j++) {
					int t = i*H + j;
					A[t] += alpha / sqrt(H) * (v * h[j] - lambd


ss="sidebar-link">XSS 跨站脚本漏洞

XML实体注入漏洞

SQL注入漏洞

MySQL写shell

WebSocket安全问题分析

攻防对抗 <svg viewBox="64 64 896 896" focusable="false" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg>

代码审计 <svg viewBox="64 64 896 896" focusable="false" data-icon="down" width="1em" height="1em" fill="currentColor" aria-hidden="true"><path d="M884 256h-75c-5.1 0-9.9 2.5-12.9 6.6L512 654.2 227.9 262.6c-3-4.1-7.8-6.6-12.9-6.6h-75c-6.5 0-10.3 7.4-6.5 12.7l352.6 486.1c12.8 17.6 39 17.6 51.7 0l352.6-486.1c3.9-5.3.1-12.7-6.4-12.7z"></path></svg>

MySQL注入点，用工具对目标站直接写入一句话，需要哪些条件？

root权限以及网站的绝对路径

outfile和dumpfile写shell #

利用条件 #

过滤了单引号into outfile还能用吗？不能，GPC要off才行，可以测试Hex编码

数据库当前用户为root权限；


ing]interface{}{
		"name":        fmt.Sprintf("botdetector-service-%d", time.Now().Unix()),
		"type":        "upstream",
		"description": "Bot Detector Test Service",
		"upstream_id": upstreamID,
	}
	serviceID := CreateService(t, gatewayID, servicePayload)

	rulePayload := map[string]interface{}{
		"path":       "/botcheck",
		"service_id": serviceID,
		"methods":    []string{"POST"},
		"strip_path": false,
		"active":     true,
		"plugin_chain": []map[string]interface{}{
			{
				"name":     "bot_detector",
				"enabled":  true,
				"priority": 0,
				"stage":    "pre_request",
				"parallel": true,
				"settings": map[string]interface{}{
					"threshold":        0.5,
					"action":           "block",
					"retention_period": 600,
				},
			},
		},
	}
	CreateRules(t, gatewayID, rulePayload)
	time.Sleep(2 * time.Second) // Wait for propagation

	highBotData := map[string]interface{}{
		"automationDetection": map[string]interface{}{
			"webdriver":      true,
			"chromeHeadless": true,
			"automationProperties": map[string]interface{}{
				"property1": true,
				"property2": true,
			},
			"inconsistencies": map[string]interface{}{
				"exactCommonResolution":      true,
				"utcTimezone":                true,
				"missingHardwareConcurrency": true,
				"missingDeviceMemory":        true,
				"platformInconsistency":      true,
			},
		},
		"persistenceChecker": map[string]interface{}{
			"cookiesEnabled": false,
			"localStorage":   false,
			"sessionStorage": false,
		},
		"environment": map[string]interface{}{
			"userAgent": "Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)",
			"languages": []interface{}{},
		},
		"visualFingerprint": map[string]interface{}{
			"canvasFingerprint": "",
			"webglFingerprint": map[string]interface{}{
				"supported": false,
			},
		},
	}
	highBotJson, err := json.Marshal(highBotData)
	if err != nil {
		t.Fatalf("Failed to marshal high bot data: %v", err)
	}

	// Compress the data with zlib
	var highBotBuffer bytes.Buffer
	highBotWriter := zlib.NewWriter(&highBotBuffer)
	_, err = highBotWriter.Write(highBotJson)
	if err != nil {
		t.Fatalf("Failed to write compressed high bot data: %v", err)
	}
	err = highBotWriter.Close()
	if err != nil {
		t.Fatalf("Failed to close zlib writer for high bot data: %v", err)
	}

	highBotEncoded := base64.StdEncoding.EncodeToString(highBotBuffer.Bytes())

	safeBotData := map[string]interface{}{
		"automationDetection": map[string]interface{}{
			"webdriver":      false,
			"chromeHeadless": false,
			"automationProperties": map[string]interface{}{
				"property1": false,
				"property2": false,
			},
			"inconsistencies": map[string]interface{}{
				"exactCommonResolution":      false,
				"utcTimezone":                false,
				"missingHardwareConcurrency": false,
				"missingDeviceMemory":        false,
				"platformInconsistency":      false,
			},
		},
		"persistenceChecker": map[string]interface{}{


/*
 *
 * Copyright 2021-2025 Software Radio Systems Limited
 *
 * This file is part of srsRAN.
 *
 * srsRAN 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.
 *
 * srsRAN 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.
 *
 * A copy of the GNU Affero General Public License can be found in
 * the LICENSE file in the top-level directory of this distribution
 * and at http://www.gnu.org/licenses/.
 *
 */

#pragma once

#include "srsran/adt/byte_buffer.h"
#include "srsran/du/du_cell_config.h"
#include "srsran/du/du_high/du_manager/du_manager_params.h"
#include "srsran/f1ap/du/f1ap_du_connection_manager.h"

namespace srsran {
namespace srs_du {

/// \brief Derive packed cell measurementTimingConfiguration from DU cell configuration.
/// \param[in] du_cfg DU Cell Configuration.
/// \return byte buffer with packed cell measurementTimingConfiguration as per TS38.331.
byte_buffer make_asn1_meas_time_cfg_buffer(const du_cell_config& du_cfg);

struct f1_setup_request_message;

/// \brief Derive the served Cell Information from the DU cell configuration.
du_served_cell_info make_f1ap_du_cell_info(const du_cell_config& du_cfg);

/// \brief Derive the served Cell System Information from the DU cell configuration.
gnb_du_sys_info make_f1ap_du_sys_info(const du_cell_config& du_cfg, std::string* js_str = nullptr);

/// \brief Generate request message for F1AP to initiate an F1 Setup Request procedure.
void fill_f1_setup_request(f1_setup_request_message& req, const du_manager_params::ran_params& ran_params);

} // namespace srs_du
} // namespace srsran


  img: snapshot.child('img').value.toString(),
        name: snapshot.child('name').value.toString(),
        category: snapshot.child('category').value.toString(),
        desc: snapshot.child('desc').value.toString(),
        price: int.parse(snapshot.child('price').value.toString()),
        sale_desc: snapshot.child('sale_desc').value.toString(),
        sale_price: int.parse(snapshot.child('sale_price').value.toString()),
    );
  }

  Map<String, dynamic> toJson() {
    return {
      'img': img,
      'name': name,
      'category': category,
      'desc': desc,
      'price': price,
      'sale_desc': sale_desc,
      'sale_price': sale_price,
    };
  }
}
import 'package:doan_tmdt/screen/detail_cart.dart';
import 'package:flutter/material.dart';

class CartItem {
  late String imageUrl;
  late String title;
  late double size;
  late double price;
  late int count;
  CartItem(
      {required this.imageUrl,
      required this.title,
      required this.size,
      required this.price,
      required this.count});
}

class CartScreen extends StatefulWidget {
  const CartScreen({super.key});

  @override
  State<CartScreen> createState() => _CartScreenState();
}

class _CartScreenState extends State<CartScreen> {
  final List<CartItem> cartItem = [
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF1',
        size: 20,
        price: 20000,
        count: 2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF2',
        size: 20,
        price: 20000,
        count: 2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF3',
        size: 20,
        price: 20000,
        count: 2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF4',
        size: 20,
        price: 20000,
        count: -2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF5',
        size: 20,
        price: 20000,
        count: 2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn/Files/2022/05/28/1435541/cach-chon-size-giay-nike-air-force-1-chuan-vua-ban-chan-202205300637505742.jpg',
        title: 'AF6',
        size: 20,
        price: 20000,
        count: 2),
    CartItem(
        imageUrl:
            'https://cdn.tgdd.vn


         *            st4	{ v0.2d, v1.2d, v2.2d, v3.2d }, [sp]
# M5-NEXT:   3      2     1.00           *            st4	{ v0.s, v1.s, v2.s, v3.s }[0], [sp], #16
# M5-NEXT:   5      4     2.00           *            st4	{ v0.2s, v1.2s, v2.2s, v3.2s }, [sp], #32
# M5-NEXT:   3      2     1.00           *            st4	{ v0.d, v1.d, v2.d, v3.d }[0], [sp], #32
# M5-NEXT:   6      8     4.00           *            st4	{ v0.2d, v1.2d, v2.2d, v3.2d }, [sp], #64
# M5-NEXT:   3      2     1.00           *            st4	{ v0.s, v1.s, v2.s, v3.s }[0], [sp], x0
# M5-NEXT:   5      4     2.00           *            st4	{ v0.2s, v1.2s, v2.2s, v3.2s }, [sp], x0
# M5-NEXT:   3      2     1.00           *            st4	{ v0.d, v1.d, v2.d, v3.d }[0], [sp], x0
# M5-NEXT:   6      8     4.00           *            st4	{ v0.2d, v1.2d, v2.2d, v3.2d }, [sp], x0


/* ----------------------------------------------------------------------------
   libconfig - A library for processing structured configuration files
   Copyright (C) 2005-2025  Mark A Lindner

   This file is part of libconfig.

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1 of
   the License, or (at your option) any later version.

   This library 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
   Lesser General Public License for more details.

   You should have received a copy of the GNU Library General Public
   License along with this library; if not, see
   <http://www.gnu.org/licenses/>.
   ----------------------------------------------------------------------------
*/

#ifndef __libconfig_parsectx_h
#define __libconfig_parsectx_h

#include "libconfig.h"
#include "strbuf.h"
#include "util.h"

struct parse_context
{
  config_t *config;
  config_setting_t *parent;
  config_setting_t *setting;
  char *name;
  strbuf_t string;
};

#define libconfig_parsectx_init(C) \
  __zero(C)
#define libconfig_parsectx_cleanup(C) \
  __delete(libconfig_strbuf_release(&((C)->string)))

#define libconfig_parsectx_append_string(C, S) \
  libconfig_strbuf_append_string(&((C)->string), (S))
#define libconfig_parsectx_take_string(C) \
  libconfig_strbuf_release(&((C)->string))

#endif /* __libconfig_parsectx_h */


ge configuration combining all their keys.
 * If the key exists in this and [other] config, the value from the [other] config will be used.
 *
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.config.mergeWith)
 *
 * @see [withFallback]
 */
public fun ApplicationConfig.mergeWith(other: ApplicationConfig): ApplicationConfig =
    when {
        keys().isEmpty() -> other
        other.keys().isEmpty() -> this
        else -> MergedApplicationConfig(other, this)
    }

/**
 * Merge configuration combining all their keys.
 * If the key exists in this and [other] config, the value from this config will be used.
 *
 *
 * [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.server.config.withFallback)
 *
 * @see [mergeWith]
 */
public fun ApplicationConfig.withFallback(other: ApplicationConfig): ApplicationConfig {
    return MergedApplicationConfig(this, other)
}

internal class MergedApplicationConfig(
    val first: ApplicationConfig,
    val second: ApplicationConfig
) : ApplicationConfig {

    private val firstKeys by lazy { first.keys() }
    private val secondKeys by lazy { second.keys() }

    override fun property(path: String): ApplicationConfigValue =
        merge(first.propertyOrNull(path), second.propertyOrNull(path)) ?: second.property(path)

    override fun propertyOrNull(path: String): ApplicationConfigValue? =
        merge(first.propertyOrNull(path), second.propertyOrNull(path))

    override fun config(path: String): ApplicationConfig {
        if (firstKeys.none { it.startsWith("$path.") }) return second.config(path)
        if (secondKeys.none { it.startsWith("$path.") }) return first.config(path)
        return MergedApplicationConfig(first.config(path), second.config(path))
    }

    override fun configList(path: String): List<ApplicationConfig> {
        val firstList = if (firstKeys.contains(path)) first.configList(path) else emptyList()
        val secondList = if (secondKeys.contains(path)) second.configList(path) else emptyList()
        return firstList + secondList
    }

    override fun keys(): Set<String> = firstKeys + secondKeys

    override fun toMap(): Map<String, Any?> = second.toMap().merge(first.toMap())

    /**
     * Adds entries from `other` into `this` as a new map.
     *
     * Preference for keys is given to `other`.
     */
    @Suppress("UNCHECKED_CAST")
    private fun Map<String, Any?>.merge(other: Map<String, Any?>): Map<String, Any?> =
        (this.keys + other.keys).associateWith { key ->
            val value1 = this[key]
            val value2 = other[key]

            when {
                value1 is Map<*, *> && value2 is Map<*, *> -> {
                    (value1 as Map<String, Any?>).merge(value2 as Map<String, Any?>)
                }

                else -> value2 ?: value1
            }
        }

    /**
     * Returns a non-null value with preference of the first, or null if both are null.
     *
     * When both are not null and objects, merge the keys from both.
     */
    private fun merge(
        first: ApplicationConfigValue?,
        second: ApplicationConfigValue?,
    ): ApplicationConfigValue? {
        val value = when {
            first == null -> second
            second == null -> first
            first.type != OBJECT || second.type != OBJECT -> first
            else -> mergeMapConfigValues(first, second)
        }
        return value
    }

    /**
     * Converts both config values to maps, then merges them with a preference for the first's keys.
     *
     * The resulting map is used to populate a `MapApplicationConfigValue` using a flat


parsing">

A legacy server-oriented implementation might have to support
encodings other than UTF-8 as well as have special logic for tuples of which the
name is `<code>_charset</code>`. Such logic is not described here as only UTF-8 is
conforming.

The
<dfn class="dfn-paneled" data-dfn-type="dfn" data-export data-lt="urlencoded parser" id="concept-urlencoded-parser">application/x-www-form-urlencoded parser</dfn>
takes a byte sequence <var>input</var>, and then runs these steps:

Let <var>sequences</var> be the result of splitting <var>input</var> on
 0x26 (&).

Let <var>output</var> be an initially empty list of name-value tuples where
 both name and value hold a string.

For each byte sequence <var>bytes</var> in <var>sequences</var>:

If <var>bytes</var> is the empty byte sequence, then continue.

If <var>bytes</var> contains a 0x3D (=), then let
   <var>name</var> be the bytes from the start of <var>bytes</var> up to but
   excluding its first 0x3D (=), and let <var>value</var> be the
   bytes, if any, after the first 0x3D (=) up to the end of
   <var>bytes</var>. If 0x3D (=) is the first byte, then
   <var>name</var> will be the empty byte sequence. If it is the last, then
   <var>value</var> will be the empty byte sequence.

Otherwise, let <var>name</var> have the value of <var>bytes</var>
   and let <var>value</var> be the empty byte sequence.

Replace any 0x2B (+) in <var>name</var> and <var>value</var> with 0x20 (SP).

Let <var>nameString</var> and <var>valueString</var> be the result of running UTF-8
   decode without BOM on the


0));
	CHARACTER_LB->texcoord = Vec2(info.texcoordInfo.x, y1);
	CHARACTER_LB->color = color.pack_argb8888();;

	CHARACTER_RB->position = gEnv->pRenderer->ScreenPosToViewportPos(offsetingPos + Vec3(info.width, info.height, 0));
	CHARACTER_RB->texcoord = Vec2(x1, y1);
	CHARACTER_RB->color = color.pack_argb8888();;

	m_CharacterProcessedThisFrame++;

	if (m_CharacterProcessedThisFrame >= m_vbCharacterCacheSize)
	{
		m_vbCharacterCacheSize = m_vbCharacterCacheSize << 1;
		resizeHwBuffer();
	}
}

void gkFontRenderable::RP_Prepare()
{
	m_mesh->UpdateHwBuffer();
}

#include "gkStereoDeviceRenderable.h"
//#include "gkOculus.h"

gkStereoDeivceRenderable::gkStereoDeivceRenderable(void)
{
	m_aabb.Reset();
//	m_eye_index = 0;
}

gkStereoDeivceRenderable::~gkStereoDeivceRenderable(void)
{
}

void gkStereoDeivceRenderable::getWorldTransforms(Matrix44*) const
{
	//throw std::logic_error("The method or operation is not implemented.");
}

IMaterial* gkStereoDeivceRenderable::getMaterial()
{
	return m_material.getPointer();
}

void gkStereoDeivceRenderable::setMaterialName(const gkStdString& matName)
{

}

const gkStdString& gkStereoDeivceRenderable::getMaterialName() const
{
	return _T("StereoDeviceMaterial");
}

AABB& gkStereoDeivceRenderable::getAABB()
{
	return m_aabb;
}

void gkStereoDeivceRenderable::getRenderOperation(gkRenderOperation& op)
{
	m_mesh->getRenderOperation( op );
}

gkMeshPtr& gkStereoDeivceRenderable::getMesh()
{
	throw std::logic_error("The method or operation is not implemented.");
}

void gkStereoDeivceRenderable::RP_Prepare()
{
	m_mesh->UpdateHwBuffer();

}

void gkStereoDeivceRenderable::RT_Prepare()
{

}

void gkStereoDeivceRenderable::RP_ShaderSet()
{
// 	m_material->getShader()->FX_SetFloat2( "EyeToSourceUVScale", Vec2(UVScaleOffset[m_eye_index][0].x, UVScaleOffset[m_eye_index][0].y));
// 	m_material->getShader()->FX_SetFloat2( "EyeToSourceUVOffset",  Vec2(UVScaleOffset[m_eye_index][1].x, UVScaleOffset[m_eye_index][1].y));
// 	ovrMatrix4f timeWarpMatrices[2];
// 	ovrHmd_GetEyeTimewarpMatrices(HMD, (ovrEyeType)m_eye_index, m_oculusDevice->eyeRenderPose[m_eye_index], timeWarpMatrices);
// 	m_material->getShader()->FX_SetValue( "EyeRotationStart", &(timeWarpMatrices[0]), sizeof(ovrMatrix4f)  );
// 	m_material->getShader()->FX_SetValue( "EyeRotationEnd", &(timeWarpMatrices[1]), sizeof(ovrMatrix4f) );
}
#include "gkStereoDevice.h"
#include "gkStereoDeviceRenderable.h"
#include "IRenderer.h"
#include "IRenderSequence.h"
#include "IResourceManager.h"
#include "I3DEngine


culateConsumptionEnergy.update(0);
		} else {
			this.calculateProductionEnergy.update(0);
			this.calculateConsumptionEnergy.update(-activePower);
		}
	}

	@Override
	public String debugLog() {
		return "L:" + this.getActivePower().asString();
	}

	@Override
	public void handleEvent(Event event) {
		if (!this.isEnabled()) {
			return;
		}
		switch (event.getTopic()) {
		case TOPIC_CYCLE_BEFORE_PROCESS_IMAGE -> this.calculateEnergy();
		}
	}

	@Override
	public Timedata getTimedata() {
		return this.timedata;
	}
}
package io.openems.edge.timeofusetariff.manual.octopus.heat;

import static io.openems.common.jscalendar.JSCalendar.RecurrenceFrequency.DAILY;
import static io.openems.edge.timeofusetariff.api.utils.TimeOfUseTariffUtils.generateDebugLog;

import java.time.Duration;
import java.time.LocalTime;

import org.osgi.service.component.ComponentContext;
import org.osgi.service.component.annotations.Activate;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Deactivate;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.metatype.annotations.Designate;

import com.google.common.collect.ImmutableList;

import io.openems.common.jscalendar.JSCalendar;
import io.openems.edge.common.component.AbstractOpenemsComponent;
import io.openems.edge.common.component.OpenemsComponent;
import io.openems.edge.common.meta.Meta;
import io.openems.edge.timeofusetariff.api.TimeOfUsePrices;
import io.openems.edge.timeofusetariff.api.TimeOfUseTariff;
import io.openems.edge.timeofusetariff.api.TouManualHelper;

@Designate(ocd = Config.class, factory = true)
@Component(//
		name = "TimeOfUseTariff.OctopusHeat", //
		immediate = true, //
		configurationPolicy = ConfigurationPolicy.REQUIRE //
)
public class TouOctopusHeatImpl extends AbstractOpenemsComponent
		implements TouOctopusHeat, TimeOfUseTariff, OpenemsComponent {

	@Reference
	private Meta meta;

	private TouManualHelper helper = null;

	public TouOctopusHeatImpl() {
		super(//
				OpenemsComponent.ChannelId.values(), //
				TouOctopusHeat.ChannelId.values() //
		);
	}

	@Activate
	private void activate(ComponentContext context, Config config) {
		super.activate(context, config.id(), config.alias(), config.enabled());

		// Cent/kWh -> Currency/MWh
		// Example: 12 Cent/kWh => 0.12 EUR/kWh * 1000 kWh/MWh = 120 EUR/MWh.
		final var standardPrice = config.standardPrice() * 10;
		final var lowPrice = config.lowPrice() * 10;
		final var highPrice = config.highPrice() * 10;

		if (Double.isNaN(standardPrice) || Double.isNaN(lowPrice) || Double.isNaN(highPrice)) {
			this.channel(TouOctopusHeat.ChannelId.INVALID_PRICE).setNextValue(true);
			return;
		}

		final var schedule = ImmutableList.of(
				// Lower price from 02:00 to 06:00
				JSCalendar.Task.<Double>create() //
						.setStart(LocalTime.of(2, 0)) //
						.setDuration(Duration.ofHours(4))//
						.addRecurrenceRule(b -> b


DesktopStarters() ) {
                setupStarter( starter );
            }

            if( !daemonuser.equalsIgnoreCase( "root" ) ) {
                controlBuilder.addScriptFragment( RpmControlFileBuilder.Script.POSTRMTAIL, "userdel -r " + daemonuser + " 2> /dev/null || true \n" );
                controlBuilder.addScriptFragment( RpmControlFileBuilder.Script.POSTRMTAIL, "groupdel " + daemonuser + " 2> /dev/null || true \n" );
            }

            // copy the license files
            for( LocalizedResource license : setup.getLicenseFiles() ) {
                File licensetarget = new File( buildDir.getAbsolutePath() + "/BUILD/usr/share/licenses/" + setup.getApplication() + "/" + license.getResource().getName() );
                licensetarget.mkdirs();
                Files.copy( license.getResource().toPath(), licensetarget.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING );
            }

            controlBuilder.build();

            changeDirectoryPermissionsTo755( buildDir );

            createRpmPackage();

        } catch( RuntimeException ex ) {
            throw ex;
        } catch( Exception ex ) {
            throw new RuntimeException( ex );
        }
    }

    /**
     * Creates the files and the corresponding script section for the specified service.
     *
     * @param service the service
     * @throws IOException on errors during creating or writing a file
     */
    private void setupService( Service service ) throws IOException {
    	String serviceUnixName = service.getId();
    	String installationRoot = task.getInstallationRoot();
    	String workingDir = installationRoot + (service.getWorkDir() != null ? "/" + service.getWorkDir() : "");
    	String mainJarPath = workingDir + "/" + service.getMainJar();
    	String version = task.getVersion();

    	if(task.isUseInitD()) {
    		String initTemplate = "unix/init-service.sh";
    		Template initScript = new Template( initTemplate  );
    		initScript.setPlaceholder( "name", serviceUnixName );
    		initScript.setPlaceholder( "majorversion", version.substring( 0, version.indexOf( '.' ) ) );
    		initScript.setPlaceholder( "displayName", setup.getApplication() );
    		initScript.setPlaceholder( "description", service.getDescription() );
    		initScript.setPlaceholder( "wait", "2" );

    		initScript.setPlaceholder( "workdir", workingDir );
    		initScript.setPlaceholder( "mainJar", mainJarPath );
    		initScript.setPlaceholder( "startArguments", (service.getStartArguments()).trim() );
    		initScript.setPlaceholder( "javaVMArguments", String.join( " ", service.getJavaVMArguments()).trim() );

    		initScript.setPlaceholder( "mainClass", service.getMainClass() );
    		initScript.setPlaceholder( "daemonUser", task.getDaemonUser() );
    		initScript.setPlaceholder( "daemonExec", javaMainExecutable );
    		initScript.setPlaceholder( "additionalServiceScript", task.getAdditionalServiceScript() );

    		String initScriptFile = "BUILD/etc/init.d/" + serviceUnixName;
    		initScript.writeTo( createFile( initScriptFile , true ) );
    		controlBuilder.addConfFile( initScriptFile );

    		controlBuilder.addScriptFragment( RpmControlFileBuilder.Script.PREINSTHEAD, "[ -f \"/etc/init.d/" + serviceUnixName + "\" ] && \"/etc/init.d/" + serviceUnixName + "\" stop || true" );


claim', parents=[shared_args, spec_file_shared_args, claim_shared_args, explore_args]
    )

    # KCFG show
    command_parser.add_parser(
        'show', help="Display a proof's symbolic execution tree as text", parents=[shared_args, claim_shared_args]
    )

    # KCFG view
    command_parser.add_parser(
        'view',
        help="Display a proof's symbolic execution tree in an intercative viewer",
        parents=[shared_args, claim_shared_args],
    )

    return parser

def _loglevel(args: Namespace) -> int:
    if args.debug:
        return logging.DEBUG

    if args.verbose:
        return logging.INFO

    return logging.WARNING

if __name__ == '__main__':
    main()


    {
        val skies = List(2) { textureCube("tSky_$it") }
        var skyWeights: Vec2f by uniform2f("uSkyWeights", Vec2f.X_AXIS)

        var skyOrientation: Mat3f by uniformMat3f("uSkyOrientation")
        var lod: Float by uniform1f("uLod")

        fun setSingleSky(skyTex: TextureCube?) = setBlendSkies(skyTex, 1f, skyTex, 0f)

        fun setBlendSkies(skyA: TextureCube?, weightA: Float, skyB: TextureCube?, weightB: Float) {
            skies[0].set(skyA)
            skies[1].set(skyB)
            skyWeights = Vec2f(weightA, weightB)
        }

        class Model(colorSpaceConversion: ColorSpaceConversion, depthMode: DepthMode) : KslProgram("skycube-shader") {
            init {
                val orientedPos = interStageFloat3()
                vertexStage {
                    main {
                        val cam = cameraData()
                        val skyOrientation = uniformMat3("uSkyOrientation")
                        val localPos = vertexAttribFloat3(Attribute.POSITIONS.name)
                        orientedPos.input set skyOrientation * localPos

                        val rotX = float3Var(normalize(cam.viewMat[0].xyz))
                        val rotY = float3Var(normalize(cam.viewMat[1].xyz))
                        val rotZ = float3Var(normalize(cam.viewMat[2].xyz))
                        val viewRot = mat4Var(
                            mat4Value(
                                float4Value(rotX, 0f.const),
                                float4Value(rotY, 0f.const),
                                float4Value(rotZ, 0f.const),
                                float4Value(0f.const, 0f.const, 0f.const, 1f.const),
                            )
                        )
                        outPosition set (cam.projMat * viewRot * float4Value(localPos * cam.clipNear * 5f.const, 1f))
                    }
                }
                fragmentStage {
                    main {
                        val skies = List(2) { textureCube("tSky_$it") }
                        val skyWeights = uniformFloat2("uSkyWeights")
                        val texLod = uniformFloat1("uLod")
                        val color = float3Var(sampleTexture(skies[0], orientedPos.output, texLod).rgb * skyWeights.x)
                        `if` (skyWeights.y gt 0f.const) {
                            color += sampleTexture(skies[1], orientedPos.output, texLod).rgb * skyWeights.y
                        }
                        colorOutput(convertColorSpace(color, colorSpaceConversion), 1f.const)
                        outDepth set depthMode.far.const
                    }
                }
            }
        }
    }
}package de.fabmax.kool.scene

import de.fabmax.kool.math.*
import de.fabmax.kool.util.LazyMat4d
import de.fabmax.kool.util.LazyMat4f

// <template> Changes made within the template section will also affect the other type variants of this class

/**
 * Translation, rotation, scale based transform implementation. This is the standard transform implementation.
 * In contrast to [MatrixTransformF], the TRS components are always relative to the parent coordinate frame and
 * completely independent of one another.
 *
 * The final transform matrix is computed equivalently to this:
 * ```
 *     val matrix = MutableMat4f()
 *         .translate(translation)
 *         .rotate(rotation)
 *         .scale(scale)
 * ```
 */
class TrsTransformF : TransformF() {

    val translation = MutableVec3f()
    val rotation = MutableQuatF()
    val scale = MutableVec3f(Vec3f.ONES)

    private val lazyTransformMat = LazyMat4f {


artMinute = startMinute;
    this.durationMinute = durationMinute;
  }

  public id: number = generateId();
  public color: string = generateColor();
  public isMoveing = false; // Происходит ли сейчас перемещение или растягивание трека

  public offsetLeftPx?: number; // Отступ слева в пикселях
  public widthPx?: number; // Ширина в пикселях
  private offsetLeftPxBeforeMoveing?: number; // Отступ слева до начала перетаскивания
  private widthPxBeforeMoveing?: number; // Ширина до начала перетаскивания
  private timelineWidthPx?: number; // Ширина таймлайна в пикселях по которому можно таскать трек
  private timelineLengthMinutes = 60 * 24 // Общая продолжительность таймлайна в минутах;

  public dateFrom?: Date; // Дата начала воспроизведения
  public dateTo?: Date; // Дата окончания воспроизведения

  // Посчитать размеры трека в пикселях в зависимости от размера контейнера
  public calculateSizePx(containerWidthPx: number): void {
    this.timelineWidthPx = containerWidthPx;
    this.widthPx = this.durationMinute * this.timelineWidthPx / ( 60 * 24 );
    this.offsetLeftPx = ( this.startHour * 60 + this.startMinute ) * this.timelineWidthPx / ( 60 * 24 );

    this.reCalculateDateFromTo();
  }

  // Начать перетаскивание трека по таймлайну
  public startMoveing(): void {
    this.isMoveing = true;
    this.offsetLeftPxBeforeMoveing = this.offsetLeftPx;
    this.widthPxBeforeMoveing = this.widthPx;
  }

  // Переместить трек целиком по таймлайну
  public move(offset: number): void {
    const newOffsetLeftPx = this.offsetLeftPxBeforeMoveing + offset;
    const newOffsetRightPx = this.getOffsetRightPx(newOffsetLeftPx);
    if ( newOffsetLeftPx >= 0 && newOffsetRightPx >= 0 ) {
      this.offsetLeftPx = newOffsetLeftPx;
    } else if ( newOffsetLeftPx < 0 ) {
      this.offsetLeftPx = 0;
    } else if ( newOffsetRightPx < 0 ) {
      this.offsetLeftPx = this.timelineWidthPx - this.widthPx;
    }

    this.reCalculateTime();
  }

  // Переместить левую границу трека
  public moveLeft(offset: number): void {
    const newOffsetLeftPx = this.offsetLeftPxBeforeMoveing + offset;
    if ( newOffsetLeftPx >= 0 && ( this.widthPxBeforeMoveing >= offset ) ) {
      this.offsetLeftPx = newOffsetLeftPx;
      this.widthPx = this.widthPxBeforeMoveing - offset;
    } else if ( newOffsetLeftPx < 0 ) {
      this.offsetLeftPx = 0;
      this.widthPx = this.widthPxBeforeMoveing + this.offsetLeftPxBeforeMoveing;
    } else if ( this.widthPxBeforeMoveing < offset ) {
      this.offsetLeftPx = this.widthPxBeforeMoveing + this.offsetLeftPxBeforeMoveing;
      this.widthPx = 0;
    }

    this.reCalculateTime();
  }

  // Переместить правую границу трека
  public moveRight(offset: number): void {
    const newWidthPx = this.widthPxBeforeMoveing + offset;
    const newOffsetRightPx = this.getOffsetRightPx(undefined, newWidthPx);
    if ( newWidthPx >= 0 && newOffsetRightPx >= 0 ) {
      this.widthPx = newWidthPx;
    } else if ( newWidth


------------------------------------------------------
-- localization.lua
-- for Hunter's Helper
-- English strings by default; localizations override with their own.
------------------------------------------------------

-- We treat all five resistances as the same spell, because they're identical in all ways that we care about.
FHH_ARCANE_RESIST = "Arcane Resistance";
FHH_FIRE_RESIST = "Fire Resistance";
FHH_FROST_RESIST = "Frost Resistance";
FHH_NATURE_RESIST = "Nature Resistance";
FHH_SHADOW_RESIST = "Shadow Resistance";
-- So, our reverse mapping represents any of the five resistances.
FHH_ALL_RESISTS = "Arcane/Fire/Frost/Nature/Shadow Resistance";

-- Other spell names
FHH_STAMINA = "Great Stamina";
FHH_ARMOR = "Natural Armor";
FHH_BITE = "Bite";
FHH_CLAW = "Claw";
FHH_COWER = "Cower";
FHH_DASH = "Dash";
FHH_DIVE = "Dive";
FHH_GROWL = "Growl";
FHH_HOWL = "Furious Howl";
FHH_LIGHTNING = "Lightning Breath";
FHH_POISON = "Scorpid Poison";
FHH_PROWL = "Prowl";
FHH_SCREECH = "Screech";
FHH_CHARGE = "Charge";
FHH_SHELL = "Shell Shield";
FHH_THUNDERSTOMP = "Thunderstomp";

-- Beast family names
FHH_BAT = "Bat";
FHH_BEAR = "Bear";
FHH_BOAR = "Boar";
FHH_CARRION_BIRD = "Carrion Bird";
FHH_CAT = "Cat";
FHH_CRAB = "Crab";
FHH_CROCOLISK = "Crocolisk";
FHH_GORILLA = "Gorilla";
FHH_HYENA = "Hyena";
FHH_OWL = "Owl";
FHH_RAPTOR = "Raptor";
FHH_SCORPID = "Scorpid";
FHH_SPIDER = "Spider";
FHH_TALLSTRIDER = "Tallstrider";
FHH_TURTLE = "Turtle";
FHH_WIND_SERPENT = "Wind Serpent";
FHH_WOLF = "Wolf";

-- Other strings used in tables
FHH_ALL_FAMILIES = "all beast families";
FHH_PET_TRAINER = "Pet Trainers (found in major cities and some towns)";

if ( GetLocale() == "deDE" ) then

	-- We treat all five resistances as the same spell, because they're identical in all ways that we care about.
	FHH_ARCANE_RESIST = "Arkanwiderstand";
	FHH_FIRE_RESIST = "Feuerwiderstand";
	FHH_FROST_RESIST = "Frostwiderstand";
	FHH_NATURE_RESIST = "Naturwiderstand";
	FHH_SHADOW_RESIST = "Schattenwiderstand";
	-- So, our reverse mapping represents any of the five resistances.
	FHH_ALL_RESISTS = "Arkan/Feuer/Frost/Natur/Schatten Widerstand";

	-- Other spell names
	FHH_STAMINA = "Große Ausdauer";
	FHH_ARMOR = "Natürliche Rüstung";
	FHH_BITE = "Beißen";
	FHH_CLAW = "Klaue";
	FHH_COWER = "Ducken";
	FHH_DASH = "Spurt";
	FHH_DIVE = "Sturzflug";
	FHH_GROWL = "Knurren";
	FHH_HOWL = "Wutgehe


|| []), target);
    Reflect.defineMetadata(DI_PROVIDERS_SYMBOL, new Set(options.providers || []), target);
  }
}

export namespace Factory {
  export function create(module: Function) {
    const imports: Set<Function> = Reflect.getMetadata(DI_IMPORTS_SYMBOL, module);
    const providers: Set<Function> = Reflect.getMetadata(DI_PROVIDERS_SYMBOL, module);
    const importsArr = Array.from(imports);
    importsArr.forEach(i => {
      let _moduleInstance = moduleInstances.get(i.name);
      if(!_moduleInstance) {
        moduleInstances.set(i.name, i);
      }
    })
  }
}

export class ModuleInstance {

  constructor(
    public imports: Array<ModuleInstance>,
    public providers: Map<any, any>
  ) { }

}

export class Book{
    id: number;
    title: string;
    year: number;
    author: string;
    constructor(id: number, title: string, year: number, author: string){
        this.id= id;
        this.title= title;
        this.author= author;
        this.year= year;
    }
}import { Document, Model, model, Schema } from 'mongoose';

export interface IWarehouse extends Document {
	company: string;
	bin: [];
	name: string;
	address: string;
}

const warehouseSchema: Schema = new Schema({
	company: { type: Schema.Types.ObjectId, ref: 'Company', required: true },
	bin: [{ type: Schema.Types.ObjectId, ref: 'Bin'}],
	name: { type: String, required: true },
	address: { type: String, required: true },
});

export const Warehouse: Model<IWarehouse> = model('Warehouse', warehouseSchema);
import { PokerAlgo, PokerCardGroup, PokerCard } from '../pokerAlgo';
let _, Combinatorics

if (global['window'] != null) {

} else {
  _ = require('lodash')
  Combinatorics = require('js-combinatorics')
}

export enum SanZhangCardType {
  DAN_TIAO = 0,
  DUI_ZI,
  SHUN_ZI,
  TONG_HUA,
  TONG_HUA_SHUN,
  SAN_TIAO
}

export enum SanZhangPaiCaiType {
  NONE = -1,
  AAA,
  SAN_TIAO,
  TONG_HUA_SHUN
}

export class SanZhangAlgo extends PokerAlgo {
  static paiCaiBonus = [20, 10, 5]
  static cardTypeFuncs = [
    { type: SanZhangCardType.DAN_TIAO, func: SanZhangAlgo.isDanTiao, weight: 1 },
    { type: SanZhangCardType.DUI_ZI, func: SanZhangAlgo.isDuiZi, weight: 2 },
    { type: SanZhangCardType.SHUN_ZI, func: SanZhangAlgo.isDanShunZi, weight: 3 },
    { type: SanZhangCardType.TONG_HUA, func: SanZhangAlgo.isTongHua, weight: 4 },
    { type: SanZhangCardType.TONG_HUA_SHUN, func: SanZhangAlgo.isTongHuaShun, weight: 5 },
    { type: SanZhangCardType.SAN_TIAO, func: SanZhangAlgo.isSanTiao, weight: 6 }
  ]

  static cardTypeFuncs1 = [
    { type: SanZhangCardType.DAN_TIAO, func: SanZhangAlgo.isDanTiao, weight: 1 },
    { type: SanZhangCardType.DUI_ZI, func: SanZhangAlgo.isDuiZi, weight: 2 },
    { type: SanZhangCardType.TONG_HUA, func: SanZhangAlgo.isTongHua, weight: 3 },
    { type: SanZhangCardType.SHUN_ZI, func: SanZhangAlgo.isDanShunZi, weight: 4 },
    { type: SanZhangCardType.TONG_HUA_SHUN, func: SanZhangAlgo.isT


type ProjectsLocationsDatasetsFhirStoresFhirBulkExportCall struct {
	s            *Service
	name         string
	urlParams_   gensupport.URLParams
	ifNoneMatch_ string
	ctx_         context.Context
	header_      http.Header
}

// BulkExport: Bulk exports all resources from the FHIR store to the specified
// destination. Implements the FHIR implementation guide system level $export
// (https://build.fhir.org/ig/HL7/bulk-data/export.html#endpoint---system-level-export.
// The following headers must be set in the request: * `Accept`: specifies the
// format of the `OperationOutcome` response. Only `application/fhir+json` is
// supported. * `Prefer`: specifies whether the response is immediate or
// asynchronous. Must be to `respond-async` because only asynchronous responses
// are supported. Specify the destination for the server to write result files
// by setting the Cloud Storage location bulk_export_gcs_destination on the
// FHIR store. URI of an existing Cloud Storage directory where the server
// writes result files, in the format
// gs://{bucket-id}/{path/to/destination/dir}. If there is no trailing slash,
// the service appends one when composing the object path. The user is
// responsible for creating the Cloud Storage bucket referenced. Supports the
// following query parameters: * `_type`: string of comma-delimited FHIR
// resource types. If provided, only the resources of the specified type(s) are
// exported. * `_since`: if provided, only the resources that are updated after
// the specified time are exported. * `_outputFormat`: optional, specify ndjson
// to export data in NDJSON format. Exported file names use the format:
// {export_id}_{resource_type}.ndjson. On success, the `Content-Location`
// header of the response is set to a URL that the user can use to query the
// status of the export. The URL is in the format:
// `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirStor
// es/{fhir_store_id}/operations/{export_id}`. See get-fhir-operation-status
// for more information. Errors generated by the FHIR store contain a
// JSON-encoded `OperationOutcome` resource describing the reason for the
// error.
//
//   - name: The name of the FHIR store to export resources from, in the format
//     `projects/{project_id}/locations/{location_id}/datasets/{dataset_id}/fhirSt
//     ores/{fhir_store_id}`.
func (r *ProjectsLocationsDatasetsFhirStoresFhirService) BulkExport(name string) *ProjectsLocationsDatasetsFhirStoresFhirBulkExportCall {
	c := &ProjectsLocationsDatasetsFhirStoresFhirBulkExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
	c.name = name
	return c
}

// Since sets the optional parameter "_since": If provided, only resources
// updated after this time are exported. The time uses the format
// YYYY-MM-DDThh:mm:ss.sss+zz:zz. For example, `2015-02-07T13:28:17.239+02:00`
// or `2017-01-01T00:00:00Z`. The time must be specified to the second and
// include a time zone.
func (c *ProjectsLocationsDatasetsFhirStoresFhirBulkExportCall) Since(Since string) *ProjectsLocationsDatasetsFhirStoresFhirBulkExportCall {
	c.urlParams_.Set("_since", Since)
	return c
}

// Type sets the optional parameter "_type": String of comma-delimited FHIR
// resource typ


own or cannot be determined.
   */
  @GeneratedMavField(type = "uint16_t")
  public val obstacleId: UShort = 0u,
  /**
   *  X position of the obstacle.
   * units = m
   */
  @GeneratedMavField(type = "float")
  public val x: Float = 0F,
  /**
   *  Y position of the obstacle.
   * units = m
   */
  @GeneratedMavField(type = "float")
  public val y: Float = 0F,
  /**
   *  Z position of the obstacle.
   * units = m
   */
  @GeneratedMavField(type = "float")
  public val z: Float = 0F,
  /**
   * Minimum distance the sensor can measure.
   * units = m
   */
  @GeneratedMavField(type = "float")
  public val minDistance: Float = 0F,
  /**
   * Maximum distance the sensor can measure.
   * units = m
   */
  @GeneratedMavField(type = "float")
  public val maxDistance: Float = 0F,
) : MavMessage<ObstacleDistance3d> {
  override val instanceCompanion: MavMessage.MavCompanion<ObstacleDistance3d> = Companion

  override fun serializeV1(): ByteArray {
    val encoder = MavDataEncoder(SIZE_V1)
    encoder.encodeUInt32(timeBootMs)
    encoder.encodeFloat(x)
    encoder.encodeFloat(y)
    encoder.encodeFloat(z)
    encoder.encodeFloat(minDistance)
    encoder.encodeFloat(maxDistance)
    encoder.encodeUInt16(obstacleId)
    encoder.encodeEnumValue(sensorType.value, 1)
    encoder.encodeEnumValue(frame.value, 1)
    return encoder.bytes
  }

  override fun serializeV2(): ByteArray {
    val encoder = MavDataEncoder(SIZE_V2)
    encoder.encodeUInt32(timeBootMs)
    encoder.encodeFloat(x)
    encoder.encodeFloat(y)
    encoder.encodeFloat(z)
    encoder.encodeFloat(minDistance)
    encoder.encodeFloat(maxDistance)
    encoder.encodeUInt16(obstacleId)
    encoder.encodeEnumValue(sensorType.value, 1)
    encoder.encodeEnumValue(frame.value, 1)
    return encoder.bytes.truncateZeros()
  }

  public companion object : MavMessage.MavCompanion<ObstacleDistance3d> {
    private const val SIZE_V1: Int = 28

    private const val SIZE_V2: Int = 28

    override val id: UInt = 11_037u

    override val crcExtra: Byte = -126

    override fun deserialize(bytes: ByteArray): ObstacleDistance3d {
      val decoder = MavDataDecoder(bytes)

      val timeBootMs = decoder.safeDecodeUInt32()
      val x = decoder.safeDecodeFloat()
      val y = decoder.safeDecodeFloat()
      val z = decoder.safeDecodeFloat()
      val minDistance = decoder.safeDecodeFloat()
      val maxDistance = decoder.safeDecodeFloat()
      val obstacleId = decoder.safeDecodeUInt16()
      val sensorType = decoder.safeDecodeEnumValue(1).let { value ->
        val entry = MavDistanceSensor.getEntryFromValueOrNull(value)
        if (entry != null) MavEnumValue.of(entry) else MavEnumValue.fromValue(value)
      }
      val frame = decoder.safeDecodeEnumValue(1).let { value ->
        val entry = MavFrame.getEntryFromValueOrNull(value)
        if (entry != null) MavEnumValue.of(entry) else MavEnumValue.fromValue(value)
      }

      return ObstacleDistance3d(
        timeBootMs = timeBootMs,
        sensorType = sensorType,
        frame = frame,
        obstacleId = obstacleId,
        x = x,
        y = y,
        z = z,
        minDistance = min


符，如果修改的话，注意 @{link /lib/xxxi18n.yml} 文件中对应的翻译
  static String defaultLanguagePlaceholder = '[TL]';

  // 网站基础URL
  static const String iwaraBaseUrl = 'https://www.iwara.tv';

  // 网站domain
  static const String iwaraDomain = 'iwara.tv';

  // api基础URL
  static const String iwaraApiBaseUrl = 'https://api.iwara.tv';

  // 图片资源基础URL
  static const String iwaraImageBaseUrl = 'https://i.iwara.tv';

  // 是否设置过亮度
  static bool isSetBrightness = false;

  // 默认用户头像URL
  static const String defaultAvatarUrl =
      '$iwaraBaseUrl/images/default-avatar.jpg';

  // 默认用户背景URL
  static const String defaultProfileHeaderUrl =
      '$iwaraBaseUrl/images/default-background.jpg';

  static List<Sort> mediaSorts = [
    Sort(id: SortId.trending, label: t.common.trending, icon: const Icon(Icons.trending_up)),
    Sort(id: SortId.date, label: t.common.latest, icon: const Icon(Icons.new_releases)),
    Sort(id: SortId.popularity, label: t.common.popular, icon: const Icon(Icons.star)),
    Sort(id: SortId.likes, label: t.common.likesCount, icon: const Icon(Icons.thumb_up)),
    Sort(id: SortId.views, label: t.common.viewsCount, icon: const Icon(Icons.remove_red_eye)),
  ];

  static const List<Sort> translationSorts = [
    // 中文
    Sort(id: SortId.zhCN, label: '简体中文', extData: 'zh-CN'),
    Sort(id: SortId.zhTW, label: '繁體中文', extData: 'zh-TW'),

    // 英语
    Sort(id: SortId.enUS, label: 'English', extData: 'en-US'),

    // 东亚语言
    Sort(id: SortId.ja, label: '日本語', extData: 'ja'),
    Sort(id: SortId.ko, label: '한국어', extData: 'ko'),
    Sort(id: SortId.vi, label: 'Tiếng Việt', extData: 'vi'),

    // 东南亚语言
    Sort(id: SortId.th, label: 'ภาษาไทย', extData: 'th'),
    Sort(id: SortId.id, label: 'Bahasa Indonesia', extData: 'id'),
    Sort(id: SortId.ms, label: 'Bahasa Melayu', extData: 'ms'),

    // 欧洲语言
    Sort(id: SortId.fr, label: 'Français', extData: 'fr'),
    Sort(id: SortId.de, label: 'Deutsch', extData: 'de'),
    Sort(id: SortId.es, label: 'Español', extData: 'es'),
    Sort(id: SortId.it, label: 'Italiano', extData: 'it'),
    Sort(id: SortId.pt, label: 'Português', extData: 'pt'),
    Sort(id: SortId.ru, label: 'Русский', extData: 'ru'),
  ];

  static String defaultThumbnailUrl =
      '$iwaraBaseUrl/images/default-thumbnail.jpg';

  /// ============================== 功能开关Start ==============================
  // 开启震动
  static bool enableVibration = true;
  // 是否启用R18内容
  static bool enableR18 = true;

  // 是否记录历史记录
  static bool enableHistory = true;

  static String defaultPlaylistThumbnailUrl =
      '$iwaraBaseUrl/images/default-thumbnail.jpg';

  static in