);
    dprintf(1,"Dpos=%d Dvel=%d\n",Dpos,Dvel);

    tnow = getdparam("time");

    outfile = getparam("out");
    if(hasvalue("etot")) {	  /* energy given; calculate missing vx (for y) or vy (for x) */
 	   etot = getdparam("etot");
	   dprintf(1,"etot=%g\n", etot);
           if(!hasvalue("potname"))
              error("No potential given (potname=)");
	   pot = get_potential_double(p.name, p.pars, p.file);
	   if (pot==NULL)
		error("potential %s cannot be loaded",p.name);
	   omega = get_pattern();
	   dprintf(0,"Using pattern speed = %g\n",omega);
	   if (hasvalue("lz")) {
	     lz = getdparam("lz");
	     lzsign = SGN(lz);
	   } else
	     lz = 0;

	   /* launching orbit is perpendicular to the axis for which X or Y is given */

	   pos[0] = x = getdparam("x");
	   pos[1] = y = getdparam("y");
	   pos[2] = z = 0.0;			/* force z=0 if E_tot given */
	   (*pot)(&ndim,pos,acc,&epot,&tnow);
	   dprintf(1,"acc: %g %g %g \n", acc[0],acc[1],acc[2]);
	   epot -= 0.5*omega*omega*(x*x+y*y);

           if(hasvalue("y")) {                /* vx missing */
		v = getdparam("vy");
		u = 2*(etot-epot) - v*v;
		if (u<0.0)
		  error("vy too large for this energy: epot=%g vy(max)=%g\n",
			epot,2*sqrt(etot-epot));
		else
		  u = sqrt(u);
		lz = x*v-y*u;
		if(lzsign != SGN(lz)) u = -u;     /* switch rotation */
	   } else if(hasvalue("x")) {
		u = getdparam("vx");
		v = 2*(etot-epot) - u*u;
		if (v<0.0)
		  error("vx too large for this energy: epot=%g vx(max)=%g\n",
					epot,2*sqrt(etot-epot));
		else
		  v = sqrt(v);
		lz = x*v-y*u;
		if(lzsign != SGN(lz)) v = -v;     /* switch rotation */
	   }
	   w = 0.0;
           lz = x*v-y*u;
    } else {
	   if(hasvalue("lz")) warning("Initial value for lz= not used");
	   x = getdparam("x");
	   y = getdparam("y");
	   z = getdparam("z");
	   dprintf(0,"Dvel=%d\n",Dvel);
	   u = Dvel==0 ? 0 : getdparam("vx");
	   v = Dvel==1 ? 0 : getdparam("vy");
	   w = Dvel==2 ? 0 : getdparam("vz");

           if(hasvalue("potname")) {
    	       pot = get_potential_double(p.name, p.pars, p.file);
	       if (pot==NULL) {
		  warning("potential %s cannot be loaded",p.name);
                  etot = 0.0;
               } else {
	          omega = get_pattern();
                  dprintf(0,"Using pattern speed = %g\n",omega);
	          pos[0] = x;
	          pos[1] = y;
	          pos[2] = z;
	          (*pot)(&ndim,pos,acc,&epot,&tnow);
		  dprintf(1,"acc: %g %g %g \n", acc[0],acc[1],acc[2]);
		  if (Dvel==0) {
		    error("Dvel=0 not implemented");
		  } else if (Dvel==1) {
		    vel2 = -acc[0]*x;
		    v = sqrt(vel2);
		    per = TWO_PI*x/v;
		    dprintf(0,"vel2=%g  p=%g\n",vel2,per);
		  } else if (Dvel==2) {
		    error("Dvel=2 not implemented");
		  }
		  etot = epot + 0.5*(u*u+v*v+w*w) - 0.5*omega*omega*(x*x+y*y);
               }
           } else {
               warning("Potential potname=%s not used; set etot=0.0",p.name);
               etot = 0.0;
           }
           lz = x*v-y*u;
    }
    if (hasvalue("headline")) set_headline(getparam("headline"));
}


) {
  return request('/core/admin/update-definition', {
    data,
    method: 'PUT',
    showLoading: true,
    ...(options || {}),
  });
}

export async function deleteDefinition(params, options) {
  return request('/core/admin/delete-definition', {
    method: 'DELETE',
    showLoading: true,
    params: { ...params },
    ...(options || {}),
  });
}

export async function saveDefinitionNode(data, options) {
  return request('/core/admin/save-definition-node', {
    data,
    method: 'POST',
    showLoading: true,
    ...(options || {}),
  });
}

export async function updateDefinitionNode(data, options) {
  return request('/core/admin/update-definition-node', {
    data,
    method: 'PUT',
    showLoading: true,
    ...(options || {}),
  });
}

export async function deleteDefinitionNode(params, options) {
  return request('/core/admin/delete-definition-node', {
    method: 'DELETE',
    showLoading: true,
    params: { ...params },
    ...(options || {}),
  });
}
export default {
  'app.setting.pagestyle': '整体风格设置',
  'app.setting.pagestyle.dark': '暗色菜单风格',
  'app.setting.pagestyle.light': '亮色菜单风格',
  'app.setting.content-width': '内容区域宽度',
  'app.setting.content-width.fixed': '定宽',
  'app.setting.content-width.fluid': '流式',
  'app.setting.themecolor': '主题色',
  'app.setting.themecolor.dust': '薄暮',
  'app.setting.themecolor.volcano': '火山',
  'app.setting.themecolor.sunset': '日暮',
  'app.setting.themecolor.cyan': '明青',
  'app.setting.themecolor.green': '极光绿',
  'app.setting.themecolor.daybreak': '拂晓蓝（默认）',
  'app.setting.themecolor.geekblue': '极客蓝',
  'app.setting.themecolor.purple': '酱紫',
  'app.setting.navigationmode': '导航模式',
  'app.setting.sidemenu': '侧边菜单布局',
  'app.setting.topmenu': '顶部菜单布局',
  'app.setting.fixedheader': '固定 Header',
  'app.setting.fixedsidebar': '固定侧边菜单',
  'app.setting.fixedsidebar.hint': '侧边菜单布局时可配置',
  'app.setting.hideheader': '下滑时隐藏 Header',
  'app.setting.hideheader.hint': '固定 Header 时可配置',
  'app.setting.othersettings': '其他设置',
  'app.setting.weakmode': '色弱模式',
  'app.setting.copy': '拷贝设置',
  'app.setting.copyinfo': '拷贝成功，请到 config/defaultSettings.js 中替换默认配置',
  'app.setting.production.hint':
    '配置栏只在开发环境用于预览，生产环境不会展现，请拷贝后手动修改配置文件',
};
ex


)
DATA_WORD(b__MGIA7naqebvq26OcNhqvbCbyvplFreivprPyvragR)
.weak b__MGIA7naqebvq26OcNhqvbCbyvplFreivprPyvragR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_25VNhqvbCbyvplFreivprPyvragR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_25VNhqvbCbyvplFreivprPyvragR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_10VVagresnprR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_10VVagresnprR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_10VVagresnprR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_10VVagresnprR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_25VNhqvbCbyvplFreivprPyvragR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_25VNhqvbCbyvplFreivprPyvragR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR8_AF_9OcErsOnfrR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR8_AF_9OcErsOnfrR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR8_AF_9OcErsOnfrR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR8_AF_9OcErsOnfrR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR
DATA_WORD(b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR)
.weak b__MGPA7naqebvq26OcNhqvbCbyvplFreivprPyvragR0_AF_11OcVagresnprVAF_25VNhqvbCbyvplFreivprPyvragRRR
DATA_WORD(b__MGIA7naqebvq26OcNhqvbCbyvplFreivpr


	0.909831,
			0.966109,
			1.022387,
			1.078666,
		},
	}
	// attack: charge = [4]
	charge = []float64{
		1.15412,
		1.24806,
		1.342,
		1.4762,
		1.57014,
		1.6775,
		1.82512,
		1.97274,
		2.12036,
		2.2814,
		2.44244,
		2.60348,
		2.76452,
		2.92556,
		3.0866,
	}
	// attack: collision = [6]
	collision = []float64{
		0.639324,
		0.691362,
		0.7434,
		0.81774,
		0.869778,
		0.92925,
		1.011024,
		1.092798,
		1.174572,
		1.26378,
		1.352988,
		1.442196,
		1.531404,
		1.620612,
		1.70982,
	}
	// attack: highPlunge = [8]
	highPlunge = []float64{
		1.596762,
		1.726731,
		1.8567,
		2.04237,
		2.172339,
		2.320875,
		2.525112,
		2.729349,
		2.933586,
		3.15639,
		3.379194,
		3.601998,
		3.824802,
		4.047606,
		4.27041,
	}
	// attack: lowPlunge = [7]
	lowPlunge = []float64{
		1.278377,
		1.382431,
		1.486485,
		1.635134,
		1.739187,
		1.858106,
		2.02162,
		2.185133,
		2.348646,
		2.527025,
		2.705403,
		2.883781,
		3.062159,
		3.240537,
		3.418915,
	}
	// skill: arkhe = [3]
	arkhe = []float64{
		0.336,
		0.3612,
		0.3864,
		0.42,
		0.4452,
		0.4704,
		0.504,
		0.5376,
		0.5712,
		0.6048,
		0.6384,
		0.672,
		0.714,
		0.756,
		0.798,
	}
	// skill: skillDot = [1]
	skillDot = []float64{
		1.2,
		1.29,
		1.38,
		1.5,
		1.59,
		1.68,
		1.8,
		1.92,
		2.04,
		2.16,
		2.28,
		2.4,
		2.55,
		2.7,
		2.85,
	}
	// skill: skillDur = [2]
	skillDur = []float64{
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
		20,
	}
	// skill: skillInital = [0]
	skillInital = []float64{
		0.504,
		0.5418,
		0.5796,
		0.63,
		0.6678,
		0.7056,
		0.756,
		0.8064,
		0.8568,
		0.9072,
		0.9576,
		1.008,
		1.071,
		1.134,
		1.197,
	}
	// burst: burst = [0]
	burst = []float64{
		5.928,
		6.3726,
		6.8172,
		7.41,
		7.8546,
		8.2992,
		8.892,
		9.4848,
		10.0776,
		10.6704,
		11.2632,
		11


проверка на блокове и гарантира че миньорът има пълен контрол върху извършваната от тях работа. Възелът може също да функционира като отдалечен възел за собствения портфейл на миньорите да допринася за мрежата и много повече.
\n\n
 Другата ключова разлика от централизираното копаене е че малките копачи използващи p2pool ще имат малко повече "вариация" или време между изплащанията отколкото голям централизиран пул -- но 'е  изключително  важно е да се отбележи че това няма да доведе до печелене на по-малко Monero с течение на времето! p2pool ще бъде също толкова печеливш дори за малки копачи с течение на времето както централизираните пулове. Част от тази дисперсия също се компенсира от p2pool, който първоначално има 0% такси тъй като няма оператор на централизиран пул който да плаща за техните услуги!
';

  @override
  String get knowledge250Sbp2pool250Sb5250Sbtitle => 'Какви са недостатъците?';

  @override
  String get knowledge250Sbp2pool250Sb6250Sbtext => '
За щастие поради отличния дизайн на внедряването на p2pool на Monero' и многото хора в общността които са отделили време за да помогнат за опростяването на процеса на копаене чрез p2pool започването става все по-лесно с времето. Има няколко начина да започнете копаене с p2pool но тъй като техническите подробности са извън обхвата на тази статия не се колебайте да преминете към връзката по-долу в зависимост от вашата операционна система:
\n
\n
Windows
\n
Linux
\n
';

  @override
  String get knowledge250Sbp2pool250Sb6250Sbtitle => 'Как мога да започна?';

  @override
  String get knowledge250Sbp2pool250Sb7250Sbtext => '
Ако това е събудило любопитството ви към копаенето на p2pool погледнете по-долу за някои допълнителни връзки и обяснения за p2pool, как работи и какво означава за Monero:
\n
\n
Официалният Github за p2pool<


0
		);
	}

	private static int dropConstraint(ConnectionDetails cd, Session session, RenderConfig dropConfig, Constraint constraint) {
		var translation = Map.of(
			Constraint.Type.UNIQUE, "UNIQUENESS",
			Constraint.Type.KEY, "NODE_KEY"
		);

		String cypher = CONSTRAINT_RENDERER.render(constraint, dropConfig);
		Integer constraintsDropped = HBD.silentDropConstraint(cd, session, cypher, null);
		if (constraintsDropped == 0) {
			// Enforce unnamed
			cypher = CONSTRAINT_RENDERER.render(constraint, dropConfig.ignoreName());
			try {
				constraintsDropped = HBD.silentDropConstraint(cd, session, cypher, null);
			} catch (MigrationsException e) {
				// While you might be able to create unnamed constraints on 5.x, you cannot drop them without
				// the generated name anymore, so here's to that…
				if (e.getCause() instanceof Neo4jException n && "Neo.ClientError.Statement.SyntaxError".equals(n.code())) {
					var name = session.executeRead(tx -> tx.run("SHOW CONSTRAINTS YIELD * WHERE type = $type AND entityType = $entityType AND properties = $properties RETURN name", Map.of("type", translation.get(constraint.getType()), "entityType", constraint.getTargetEntityType().name(), "properties", constraint.getProperties())).single().get(0).asString());
					cypher = CONSTRAINT_RENDERER.render(constraint.withName(name), dropConfig);
					constraintsDropped = HBD.silentDropConstraint(cd, session, cypher, null);
				}
			}
		}
		return constraintsDropped;
	}

	record SummaryCountersImpl(int nodesCreated, int nodesDeleted, int relationshipsCreated,
		int relationshipsDeleted, int propertiesSet, int labelsAdded, int labelsRemoved,
		int indexesAdded, int indexesRemoved, int constraintsAdded, int constraintsRemoved,
		int systemUpdates
	) implements SummaryCounters {

		@Override
		public boolean containsUpdates() {
			return (nodesCreated | nodesDeleted | relationshipsCreated | relationshipsDeleted | propertiesSet | labelsAdded | labelsRemoved | indexesAdded | indexesRemoved | constraintsAdded | constraintsRemoved) > 0;
		}

		@Override
		public boolean containsSystemUpdates() {
			return systemUpdates > 0;
		}
	}

	String lock() {

		if (LOGGER.isLoggable(Level.FINE)) {
			MigrationsConfig config = context.getConfig();
			UnaryOperator<String> databaseNameMapper = v -> "database `" + v + "`";
			String formattedTargetDatabaseName = config.getOptionalDatabase().map(databaseNameMapper).orElse("the default database");
			LOGGER.log(Level.FINE, "Acquiring lock {0} on {1} in {2}", new Object[] { id, formattedTargetDatabaseName, config
				.getOptionalSchemaDatabase().map(databaseNameMapper).orElse(formattedTargetDatabaseName) });
		}

		createUniqueConstraintIfNecessary();

		try (Session session = context.getSchemaSession()) {
			lockLockingLocks.writeLock().lock();
			var internalId = session.executeWrite(t ->
				t.run("CREATE (l:__Neo4jMigrationsLock {id: $id, name: $name}) RETURN l",
					Values.parameters("id", id, "name", nameOfLock))
					.single().get("l").asNode().elementId()
			);
			LOGGER.log(Level.FINE, "Acquired lock {0} with internal id {1}", new Object[] { id, internalId });
			Runtime.getRuntime().addShutdownHook(cleanUpTask);
			return id;
		} catch (Neo4jException e) {
			throw new MigrationsException(
				"Cannot create __Neo4jMigrationsLock node. Likely another migration is going on or has crashed", e);
		} finally {
			lockLockingLocks


     end
        if
          type(pattern) == "string"
          and string.len(pattern) > 0
          and (type(route) == "string" or type(route) == "function")
        then
          -- override default routers
          result[user_router_type].map_routers[pattern] = route
        end
      end
    end
  end
  -- logger.debug("|gitlinker._merge_routers| result:%s", vim.inspect(result))
  return result
end

--- @alias gitlinker.Options table<string, any>
--- @param opts gitlinker.Options?
--- @return gitlinker.Options
M.setup = function(opts)
  local merged_routers = M._merge_routers(opts or {})
  Configs = vim.tbl_deep_extend("force", vim.deepcopy(Defaults), opts or {})
  Configs._routers = merged_routers

  return Configs
end

--- @return gitlinker.Options
M.get = function()
  return Configs
end

return M


/*
 * Copyright (C) 2011 Shinpei Kato
 *
 * Systems Research Lab, University of California at Santa Cruz
 * All Rights Reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice (including the next
 * paragraph) shall be included in all copies or substantial portions of the
 * Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */

#include "cuda.h"
#include "gdev_cuda.h"

/**
 * Returns in *driverVersion the version number of the installed CUDA driver.
 * This function automatically returns CUDA_ERROR_INVALID_VALUE if the
 * driverVersion argument is NULL.
 *
 * Parameters:
 * driverVersion - Returns the CUDA driver version
 *
 * Returns:
 * CUDA_SUCCESS, CUDA_ERROR_INVALID_VALUE
 */
CUresult cuDriverGetVersion(int *driverVersion)
{
	if (!driverVersion)
		return CUDA_ERROR_INVALID_VALUE;
	*driverVersion = GDEV_CUDA_VERSION;

	return CUDA_SUCCESS;
}


_list_of
            ( 0, uint256S("0x0000027235b5679bcd28c90d03d4bf1a9ba4c07c4efcc1c87d6c68cce25e6e5d")),
            1337966069,
            1488,
            300
        };

    }
};
static CTestNetParams testNetParams;

/**
 * Regression test
 */
class CRegTestParams : public CChainParams {
public:
    CRegTestParams() {
        strNetworkID = "regtest";
        consensus.nMajorityEnforceBlockUpgrade = 750;
        consensus.nMajorityRejectBlockOutdated = 950;
        consensus.nMajorityWindow = 1000;
        consensus.BIP34Height = -1; // BIP34 has not necessarily activated on regtest
        consensus.BIP34Hash = uint256();
        consensus.powLimit = uint256S("7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");
        consensus.nPowTargetTimespan = 10 * 55; // two weeks
        consensus.nPowTargetSpacing = 55;
        consensus.fPowAllowMinDifficultyBlocks = true;
        consensus.fPowNoRetargeting = true;
        consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains
        consensus.nMinerConfirmationWindow = 144; // Faster than normal for regtest (144 instead of 2016)
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].bit = 28;
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nStartTime = 0;
        consensus.vDeployments[Consensus::DEPLOYMENT_TESTDUMMY].nTimeout = 999999999999ULL;
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].bit = 0;
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nStartTime = 0;
        consensus.vDeployments[Consensus::DEPLOYMENT_CSV].nTimeout = 999999999999ULL;
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].bit = 1;
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nStartTime = 0;
        consensus.vDeployments[Consensus::DEPLOYMENT_SEGWIT].nTimeout = 999999999999ULL;

        // The best chain should have at least this much work.
        consensus.nMinimumChainWork = uint256S("0x00");

        pchMessageStart[0] = 0xfa;
        pchMessageStart[1] = 0xbf;
        pchMessageStart[2] = 0xb5;
        pchMessageStart[3] = 0xda;
        vAlertPubKey = ParseHex("04517d8a699cb43d3938d7b24faaff7cda448ca4ea267723ba614784de661949bf632d6304316b244646dea079735b9a6fc4af804efb4752075b9fe2245e14e412");
        nDefaultPort = 18444;
        nPruneAfterHeight = 1000;

        std::vector<unsigned char> extraNonce(4);
        extraNonce[0] = 0x09;
        extraNonce[1] = 0x00;
        extraNonce[2] = 0x00;
        extraNonce[3] = 0x00;

        genesis = CreateGenesisBlock(1296688602, 2, 0x207fffff, 1, 50 * COIN,extraNonce);
        consensus.hashGenesisBlock = genesis.GetHash();
        //assert(consensus.hashGenesisBlock == uint256S("0x0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206"));
        //assert(genesis.hashMerkleRoot == uint256S("0x4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"));

        vFixedSeeds.clear(); //!<


}.bg-redbrown{color:#fff;position:relative;z-index:0}.bg-redbrown.bg-white-strip:before{position:absolute;z-index:-1;bottom:0;left:0;background:#fff;height:280px;width:100%;content:"";display:block}.bg-gray-light{background-color:#f5f5f5}.bg-blue-dark{background-color:#001a33;color:#fff}.bg-blue-dark a{color:#fff}.bg-blue-dark .h,.bg-blue-dark .h2,.bg-blue-dark .h3,.bg-blue-dark h2{color:#fff}.bg-blue-dark p{color:#fff}.bg-blue-dark .title-section p{color:#fff}.bg-bluelectric,.bg-bluelectricdark{color:#fff}.bg-bluelectric a,.bg-bluelectricdark a{color:#fff}.bg-red-gradient{background:#ab2b3e;background:-moz-linear-gradient(left,#ab2b3e 0,#f83e5a 100%);background:-webkit-linear-gradient(left,#ab2b3e 0,#f83e5a 100%);background:linear-gradient(to right,#ab2b3e 0,#f83e5a 100%);color:#fff}.bg-red-gradient a{color:#fff}.form-check [type=checkbox]:focus+label,.form-check [type=radio]:focus+label,.toggles label input[type=checkbox]:focus+.lever,:focus:not(.focus--mouse):not([data-focus-mouse=true]){border-color:#000!important;box-shadow:0 0 0 2px #000!important;outline:2px solid #fff!important;outline-offset:3px}.bg-red-gradient .h1,.bg-red-gradient .h2,.bg-red-gradient .h3,.bg-red-gradient h1,.bg-red-gradient h2,.bg-red-gradient h3,.bg-red-gradient p{color:#fff!important}.bg-white.border-bottom,.bg-white.border-top{border-color:#d1d6db!important}.icon-bluelectric{fill:#0D00FF!important}.bg-purplextralight{background-color:#e7e6ff}.bg-linear-vertical-blue-light{position:relative;z-index:0}.bg-linear-vertical-blue-light:before{position:absolute;z-index:1;top:0;left:0;width:100%;height:100%;background:#7a73ff;background:-moz-linear-gradient(top,#7a73ff 0,#50e3c2 100%);background:-webkit-linear-gradient(top,#7a73ff 0,#50e3c2 100%);background:linear-gradient(to bottom,#7a73ff 0,#50e3c2 100%);content:"";display:block;opacity:.15}.bg-linear-vertical-blue-light:after{position:absolute;z-index:2;top:0;left:0;width:100%;height:100%;background-image:url("data:image/svg+xml,%3Csvg width='100%25' height='100%25' viewBox='0 0 1280 360' version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' xml:space='preserve' xmlns:serif='http://www.serif.com/' style='fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;'%3E%3Cg id='Group-27'%3E%3Cpath id='Rectangle-12' d='M0,-45.918l351,213.455l0,322.347l-351,-213.455l0,-322.347Z' style='fill:url(%23_Linear1);fill-rule:nonzero;'/%3E%3Cpath id='Rectangle-12-Copy-2' d='M


 SCTP_CC_OPT_STEADY_STEP: ::std::os::raw::c_uint = 8194;
pub const SCTP_CMT_OFF: ::std::os::raw::c_uint = 0;
pub const SCTP_CMT_BASE: ::std::os::raw::c_uint = 1;
pub const SCTP_CMT_RPV1: ::std::os::raw::c_uint = 2;
pub const SCTP_CMT_RPV2: ::std::os::raw::c_uint = 3;
pub const SCTP_CMT_MPTCP: ::std::os::raw::c_uint = 4;
pub const SCTP_CMT_MAX: ::std::os::raw::c_uint = 4;
/// Stream scheduling: default simple round-robin.
pub const SCTP_SS_DEFAULT: ::std::os::raw::c_uint = 0;
/// Stream scheduling: real round-robin.
pub const SCTP_SS_ROUND_ROBIN: ::std::os::raw::c_uint = 1;
/// Stream scheduling: real round-robin per packet.
pub const SCTP_SS_ROUND_ROBIN_PACKET: ::std::os::raw::c_uint = 2;
/// Stream scheduling: priority.
pub const SCTP_SS_PRIORITY: ::std::os::raw::c_uint = 3;
/// Stream scheduling: fair bandwidth.
pub const SCTP_SS_FAIR_BANDWITH: ::std::os::raw::c_uint = 4;
/// Stream scheduling: first come, first serve.
pub const SCTP_SS_FIRST_COME: ::std::os::raw::c_uint = 5;
/// Flag for use with [`usrsctp_bindx()`](fn.usrsctp_bindx.html) to bind addresses.
pub const SCTP_BINDX_ADD_ADDR: ::std::os::raw::c_uint = 32769;
/// Flag for use with [`usrsctp_bindx()`](fn.usrsctp_bindx.html) to unbind addresses.
pub const SCTP_BINDX_REM_ADDR: ::std::os::raw::c_uint = 32770;
pub const SCTP_DUMP_OUTBOUND: ::std::os::raw::c_uint = 1;
pub const SCTP_DUMP_INBOUND: ::std::os::raw::c_uint = 0;
pub type sctp_assoc_t = u32;
#[repr(C, packed)]
#[derive(Debug, Copy, Clone)]
pub struct sctp_common_header {
    pub source_port: u16,
    pub destination_port: u16,
    pub verification_tag: u32,
    pub crc32c: u32,
}
#[test]
fn bindgen_test_layout_sctp_common_header() {
    assert_eq!(
        ::std::mem::size_of::<sctp_common_header>(),
        12usize,
        concat!("Size of: ", stringify!(sctp_common_header))
    );
    assert_eq!(
        ::std::mem::align_of::<sctp_common_header>(),
        1usize,
        concat!("Alignment of ", stringify!(sctp_common_header))
    );
    assert_eq!(
        unsafe { &(*(::std::ptr::null::<sctp_common_header>())).source_port as *const _ as usize },
        0usize,
        concat!(
            "Offset of field: ",
            stringify!(sctp_common_header),
            "::",
            stringify!(source_port)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<sctp_common_header>())).destination_port as *const _ as usize
        },
        2usize,
        concat!(
            "Offset of field: ",
            stringify!(sctp_common_header),
            "::",
            stringify!(destination_port)
        )
    );
    assert_eq!(
        unsafe {
            &(*(::std::ptr::null::<sctp_common_header>())).verification_tag as *const _ as usize
        },
        4usize,
        concat!(


}

// RemoveTodoIDs removes the "todos" edge to Todo entities by IDs.
func (pu *ProjectUpdate) RemoveTodoIDs(ids ...int) *ProjectUpdate {
	pu.mutation.RemoveTodoIDs(ids...)
	return pu
}

// RemoveTodos removes "todos" edges to Todo entities.
func (pu *ProjectUpdate) RemoveTodos(t ...*Todo) *ProjectUpdate {
	ids := make([]int, len(t))
	for i := range t {
		ids[i] = t[i].ID
	}
	return pu.RemoveTodoIDs(ids...)
}

// Save executes the query and returns the number of nodes affected by the update operation.
func (pu *ProjectUpdate) Save(ctx context.Context) (int, error) {
	return withHooks(ctx, pu.sqlSave, pu.mutation, pu.hooks)
}

// SaveX is like Save, but panics if an error occurs.
func (pu *ProjectUpdate) SaveX(ctx context.Context) int {
	affected, err := pu.Save(ctx)
	if err != nil {
		panic(err)
	}
	return affected
}

// Exec executes the query.
func (pu *ProjectUpdate) Exec(ctx context.Context) error {
	_, err := pu.Save(ctx)
	return err
}

// ExecX is like Exec, but panics if an error occurs.
func (pu *ProjectUpdate) ExecX(ctx context.Context) {
	if err := pu.Exec(ctx); err != nil {
		panic(err)
	}
}

// Modify adds a statement modifier for attaching custom logic to the UPDATE statement.
func (pu *ProjectUpdate) Modify(modifiers ...func(u *sql.UpdateBuilder)) *ProjectUpdate {
	pu.modifiers = append(pu.modifiers, modifiers...)
	return pu
}

func (pu *ProjectUpdate) sqlSave(ctx context.Context) (n int, err error) {
	_spec := sqlgraph.NewUpdateSpec(project.Table, project.Columns, sqlgraph.NewFieldSpec(project.FieldID, field.TypeInt))
	if ps := pu.mutation.predicates; len(ps) > 0 {
		_spec.Predicate = func(selector *sql.Selector) {
			for i := range ps {
				ps[i](selector)
			}
		}
	}
	if pu.mutation.TodosCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   project.TodosTable,
			Columns: []string{project.TodosColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(todo.FieldID, field.TypeInt),
			},
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := pu.mutation.RemovedTodosIDs(); len(nodes) > 0 && !pu.mutation.TodosCleared() {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   project.TodosTable,
			Columns: []string{project.TodosColumn},
			Bidi:    false,
			Target: &sqlgraph.EdgeTarget{
				IDSpec: sqlgraph.NewFieldSpec(todo.FieldID, field.TypeInt),
			},
		}
		for _, k := range nodes {
			edge.Target.Nodes = append(edge.Target.Nodes, k)
		}
		_spec.Edges.Clear = append(_spec.Edges.Clear, edge)
	}
	if nodes := pu.mutation.TodosIDs(); len(nodes) > 0 {
		edge := &sqlgraph.EdgeSpec{
			Rel:     sqlgraph.O2M,
			Inverse: false,
			Table:   project.TodosTable,
			Columns: []string{project.TodosColumn},
			Bidi:    false,
			Target: &sqlgrap


			name: "SSHW_TX_chongyingshenfu",
				},
				{
					name: "SSHW_TX_lingbaoxianhu",
				},
				{
					name: "SSHW_TX_taijifuchen",
				},
				{
					name: "effect_xianding",
					fileType: "json",
				},
				{
					name: "effect_caochuanjiejian",
					follow: true,
				},
				{
					name: "effect_guohechaiqiao",
					follow: true,
				},
				{
					name: "effect_leisha",
					follow: true,
				},
				{
					name: "effect_heisha",
					follow: true,
				},
				{
					name: "effect_huosha",
					follow: true,
				},
				{
					name: "effect_hongsha",
					follow: true,
				},
				{
					name: "effect_huogong",
					follow: true,
				},
				{
					name: "effect_panding",
					follow: true,
				},
				{
					name: "effect_shan",
					follow: true,
				},
				{
					name: "effect_tao",
					follow: true,
				},
				{
					name: "effect_tiesuolianhuan",
					follow: true,
				},
				{
					name: "effect_jiu",
					follow: true,
				},
				{
					name: "effect_shunshouqianyang",
					follow: true,
				},
				{
					name: "effect_shushangkaihua",
					follow: true,
				},
				{
					name: "effect_wanjianqifa",
					follow: true,
				},
				{
					name: "effect_wuzhongshengyou",
					follow: true,
				},
				{
					name: "effect_wuxiekeji",
					follow: true,
				},
				{
					name: "effect_wugufengdeng",
					follow: true,
				},
				{
					name: "effect_yuanjiaojingong",
					follow: true,
				},
				{
					name: "effect_zhijizhibi",
					follow: true,
				},
				{
					name: "effect_zhulutianxia",
					follow: true,
				},
			];
			var fileNameList = fileList.concat();
			var read = function () {
				if (fileNameList.length) {
					var file = fileNameList.shift();
					if (file.follow) {
						//	这个是专门播放追踪卡牌的动画，调用方式 decadeUI.animation.cap.playSpineTo(element, animation, position);
						//	建议非追踪对象的特效不要滥用，因为每次导入1个骨骼会生成4个预制骨骼，资源占用较多
						animation.cap.loadSpine(file.name, file.fileType, function () {
							read();
						});
					} else {
						//	这个是专门播放全屏位置的动画
						animation.loadSpine(file.name, file.fileType, function () {
							read();
							animation.prepSpine(this.name);
						});
					}
				}
			};
			read();
			read();
			var skillAnimation = (function () {
				var defines = {
					skill: {
						rw_bagua_skill: {
							skill: "rw_bagua_skill",
							name: "XTBGZ_xiao",
							scale: 1,
						},
						rw_renwang_skill: {
							skill: "rw_renwang_skill",
							name: "RWJGD_xiao",


 val ELAPSED_TIME = "elapsedTime"
        const val PATH = "path"

        private val ignorePath = setOf(
            "/actuator/prometheus",
            "/actuator/health",
        )
    }
}
package org.gitanimals.core.auth

import jakarta.servlet.http.HttpServletRequest
import org.gitanimals.core.AUTHORIZATION_EXCEPTION
import org.gitanimals.core.AuthorizationException
import org.gitanimals.core.filter.MDCFilter.Companion.USER_ENTRY_POINT
import org.gitanimals.core.filter.MDCFilter.Companion.USER_ID
import org.slf4j.LoggerFactory
import org.slf4j.MDC
import org.springframework.beans.factory.annotation.Value
import org.springframework.http.HttpHeaders
import org.springframework.stereotype.Component
import java.security.SecureRandom
import java.util.*
import javax.crypto.Cipher
import javax.crypto.spec.GCMParameterSpec
import javax.crypto.spec.SecretKeySpec

@Component
class InternalAuth(
    private val httpServletRequest: HttpServletRequest,
    private val internalAuthClient: InternalAuthClient,
    @Value("\${internal.auth.secret}") private val internalAuthSecret: String,
) {

    private val logger = LoggerFactory.getLogger(this::class.simpleName)

    private val secretKey by lazy {
        val decodedKey = Base64.getDecoder().decode(internalAuthSecret)
        SecretKeySpec(decodedKey, "AES")
    }

    fun getUserId(throwOnFailure: () -> Unit = throwCannotGetUserInfo): Long {
        val userId = findUserId()

        if (userId == null) {
            throwOnFailure.invoke()
        }

        return userId ?: throw AUTHORIZATION_EXCEPTION
    }

    fun findUserId(): Long? {
        val userIdInMdc = runCatching {
            MDC.get(USER_ID).toLong()
        }.getOrNull()

        if (userIdInMdc != null) {
            return userIdInMdc
        }

        val token: String? = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION)
        val iv: String? = httpServletRequest.getHeader(INTERNAL_AUTH_IV_KEY)
        val internalAuthSecret: String? = httpServletRequest.getHeader(INTERNAL_AUTH_SECRET_KEY)

        var userId: Long? = runCatching {
            if (internalAuthSecret == null || iv == null) {
                return@runCatching null
            }
            return decrypt(
                iv = Base64.getDecoder().decode(iv),
                secret = Base64.getDecoder().decode(internalAuthSecret),
            )
        }.getOrElse {
            logger.warn("[InternalAuth] Fail to get userId by secret and iv", it)
            null
        }

        if (token != null) {
            userId = runCatching {
                internalAuthClient.getUserByToken(token).id.toLong()
            }.getOrElse {
                if (it is AuthorizationException) {
                    return@getOrElse null
                }
                logger.warn("[InternalAuth] Fail to get userId by token", it)
                null
            }
        }

        return userId
    }

    fun getUserEntryPoint(throwOnFailure: () -> Unit = throwCannotGetUserInfo): String {
        val entryPoint = findUserEntryPoint()

        if (entryPoint == null) {
            throwOnFailure.invoke()
        }

        return entryPoint ?: throw AUTHORIZATION_EXCEPTION
    }

    fun findUserEntryPoint(): String? {
        val entryPointInMdc = runCatching {
            MDC.get(USER_ENTRY_POINT)
        }.getOrNull()

        if (entryPointInMdc != null) {
            return entryPointInMdc
        }

        httpServletRequest.getHeader(INTERNAL_ENTRY_POINT_KEY)?.let {
            return it
        }

        val token: String = httpServletRequest.getHeader(HttpHeaders.AUTHORIZATION) ?: return


s
            call.Should().BeNullGuarded();
        }

        [Fact]
        public void RecordedCalls_returns_recorded_calls_from_manager()
        {
            var fake = new Fake<IFoo>();
            var fakeObject = Fake.GetFakeManager(fake.FakedObject);

            fake.FakedObject.Bar();

            fake.RecordedCalls.Should().BeEquivalentTo(fakeObject.GetRecordedCalls());
        }

        [Theory]
        [MemberData(nameof(CallSpecificationActions))]
        public void Call_specifications_should_not_add_rule_to_manager(Action<Fake<IFoo>> action)
        {
            // Arrange
            var fake = new Fake<IFoo>();
            var manager = Fake.GetFakeManager(fake.FakedObject);
            var initialRules = manager.Rules.ToList();

            // Act
            action(fake);

            // Assert
            manager.Rules.Should().Equal(initialRules);
        }

        public class Foo
        {
        }
    }
}


 typed ✅");
                new_result = true;
            }
        } else {
            for (_, weight) in ok_program.iter() {
                if *weight == 1 {
                    println!("Program correctly typed ✅");
                    new_result = true;
                }
            }
            if ok_program.len() == 0 {
                println!("Program typing error ❌");
            }
        }
    }
    new_result
}

// Use a procedural macro to convert AST relations to equivalent DDlog relations.
// (As they are syntactically almost identical due to direct mapping).
pub trait EquivRelId {
    fn get_equiv_relid(&self) -> Relations;
}

fn convert_relation(ast_relation: &AstRelation, update_type: UpdateKind) -> Update<DDValue> {
    match update_type {
        UpdateKind::InsertUpdate => Update::Insert {
            relid: ast_relation.get_equiv_relid() as RelId,
            v: get_equiv_ddvalue(ast_relation),
        },
        UpdateKind::DeleteUpdate => Update::DeleteValue {
            relid: ast_relation.get_equiv_relid() as RelId,
            v: get_equiv_ddvalue(ast_relation),
        },
    }
}

// See relation changes (for debugging purposes).
#[allow(dead_code)]
fn dump_delta(delta: &DeltaMap<DDValue>) {
    for (_, changes) in delta.iter() {
        for (val, weight) in changes.iter() {
            println!("{} {:+}", val, weight);
        }
    }
}

// Need to do some type conversion to convert to DDlog vectors and relations.
fn get_equiv_ddvalue(ast_relation: &AstRelation) -> DDValue {
    match ast_relation.clone() {
        AstRelation::TransUnit { id, body_ids } => {
            let mut converted_body_ids: DDlogVec<i32> = DDlogVec::new();
            for vec_id in body_ids {
                converted_body_ids.push(vec_id);
            }
            TransUnit {
                id,
                body_ids: converted_body_ids,
            }
            .into_ddvalue()
        }
        AstRelation::FunDef {
            id,
            fun_name,
            return_type_id,
            arg_ids,
            body_id,
        } => {
            let mut converted_arg_ids: DDlogVec<i32> = DDlogVec::new();
            for vec_id in arg_ids {
                converted_arg_ids.push(vec_id);
            }
            FunDef {
                id,
                fun_name,
                return_type_id,
                arg_ids: converted_arg_ids,
                body_id,
            }
            .into_ddvalue()
        }
        AstRelation::FunCall {
            id,
            fun_name,
            arg_ids,
        } => {
            let mut converted_arg_ids: DDlogVec<i32> = DDlogVec::new();
            for vec_id in arg_ids {
                converted_arg_ids.push(vec_id);
            }
            FunCall {
                id,
                fun_name,
                arg_ids: converted_arg_ids,
            }
            .into_ddvalue()
        }
        AstRelation::Assign {
            id,
            var_name,
            type_id,
            expr_id,
        } => Assign {
            id,
            var_name,
            type_id,
            expr_id,
        }
        .into_ddvalue(),
        AstRelation::Return { id, expr_id } => Return { id, expr_id }.into_ddvalue(),
        AstRelation::If {
            id,
            cond_id,
            then_id,


an 1,2,4, or
	 * 8
	 */
	subql #1,d0
	moveq #7,d1
	cmpl d1,d0
	jhi bad
	asll #1,d0
1:
	movew pc@(2f-1b-2:b,d0:l),d1
	clrl d0
	jmp pc@(2,d1:w)
2:
	.word oneByte-2b
	.word twoByte-2b
	.word bad-2b
	.word fourByte-2b
	.word bad-2b
	.word bad-2b
	.word bad-2b
	.word eightByte-2b
oneByte:
	moveb a1@,a0@
	rts
twoByte:
	movew a1@,a0@
	rts
fourByte:
	movel a1@,a0@
	rts
eightByte:
	movel a1@,a0@
	movel a1@(4),a0@(4)
	rts
bad:
	moveq #1,d0
	rts
	.globl _MachProbeEnd
	.even
_MachProbeEnd:
|*----------------------------------------------------------------------------
|*
|* Mach_Return2 -
|*
|*	void	MachReturn2(int val)
|*
|* Results:
|*     	Sets the second return value to val.  This is used for Unix
|*	compatibility for system calls that return two values.
|*
|* Side effects:
|*	d1 <- val
|*
|*----------------------------------------------------------------------------

    .text
    .globl	_Mach_Return2
_Mach_Return2:
    movl	sp@(4),d1
    rts


ITY_CLASS);
    #endif
        AffinitySetterTask::m_result = true;
        AffinitySetterTask::m_nThreads = p;
        tbb::task_list  tl;
        for ( int i = 0; i < p; ++i ) {
            tbb::task &t = *new( tbb::task::allocate_root() ) AffinitySetterTask( affMode == amSparse ? i * NumCpus / p : i );
            t.set_affinity( tbb::task::affinity_id(i + 1) );
            tl.push_back( t );
        }
        tbb::task::spawn_root_and_wait(tl);
        return AffinitySetterTask::m_result;
    }

    inline
    void Affinitize ( int p, int affMode ) {
        if ( !AffinitizeTBB (p, affMode) )
            REPORT("Warning: Failed to set affinity for %d TBB threads\n", p);
    }

    class TbbWorkersTrapper {
        tbb::atomic<int> my_refcount;
        tbb::task *my_root;
        tbb::task_group_context my_context;
        Harness::SpinBarrier my_barrier;

        friend class TrapperTask;

        class TrapperTask : public tbb::task {
            TbbWorkersTrapper& my_owner;

            tbb::task* execute () {
                my_owner.my_barrier.wait();
                my_owner.my_root->wait_for_all();
                my_owner.my_barrier.wait();
                return NULL;
            }
        public:
            TrapperTask ( TbbWorkersTrapper& owner ) : my_owner(owner) {}
        };

    public:
        TbbWorkersTrapper ()
            : my_context(tbb::task_group_context::bound,
                         tbb::task_group_context::default_traits | tbb::task_group_context::concurrent_wait)
        {
            my_root = new ( tbb::task::allocate_root(my_context) ) tbb::empty_task;
            my_root->set_ref_count(2);
            my_barrier.initialize(NumThreads);
            for ( int i = 1; i < NumThreads; ++i )
                tbb::task::spawn( *new(tbb::task::allocate_root()) TrapperTask(*this) );
            my_barrier.wait(); // Wait util all workers are ready
        }

        ~TbbWorkersTrapper () {
            my_root->decrement_ref_count();
            my_barrier.wait(); // Make sure no tasks are referencing us
            tbb::task::destroy(*my_root);
        }
    }; // TbbWorkersTrapper

#if __TBB_STATISTICS
    static bool StatisticsMode = true;
#else
    static bool StatisticsMode = false;
#endif

//! Suppresses silly warning
inline bool __TBB_bool( bool b ) { return b; }

#define START_WORKERS(needScheduler, p, a, setWorkersAffinity, trapWorkers) \
    tbb::task_scheduler_init init(tbb::task_scheduler_init::deferred);      \
    TbbWorkersTrapper *trapper = NULL;                                      \
    if ( theSettings.my_opts & UseTaskScheduler                   \
         && (needScheduler) && ((setWorkersAffinity) || (trapWorkers)) )    \
    {                                                                       \
        init.initialize( p );                                               \
        if ( __TBB_bool(setWorkersAffinity) )                               \
            Affinitize( p, a );                                             \
        if ( __TBB_bool(trapWorkers) )                                      \
            trapper = new TbbWorkersTrapper;                                \
    }

#define STOP_WORKERS()  \
    if ( theSettings.my_opts & UseTaskScheduler && init.is_active() ) {     \
        if ( trapper )                                                      \
            delete trapper;


)
        }
    };

    let (graph_result, first_score_result) = tokio::join!(graph_fut, oldest_fut);

    let graph = match graph_result {
        Ok(graph) => Some(graph),
        Err(err) => {
            warn!("{:?}", Report::new(err));

            None
        }
    };

    let first_score = match first_score_result {
        Ok(score) => score,
        Err(why) => {
            let _ = data.error(&ctx, OSU_API_ISSUE).await;

            return Err(why.into());
        }
    };

    let embed_data = PlayerSnipeStatsEmbed::new(user, player, first_score, &ctx).await;

    // Sending the embed
    let embed = embed_data.into_builder().build();
    let mut builder = MessageBuilder::new().embed(embed);

    if let Some(bytes) = graph {
        builder = builder.file("stats_graph.png", bytes);
    }

    data.create_message(&ctx, builder).await?;

    Ok(())
}

const W: u32 = 1350;
const H: u32 = 350;

pub fn graphs(
    history: &BTreeMap<Date<Utc>, u32>,
    stars: &BTreeMap<u8, u32>,
    w: u32,
    h: u32,
) -> Result<Vec<u8>, GraphError> {
    let len = (w * h * 3) as usize; // PIXEL_SIZE = 3
    let mut buf = vec![0; len];

    let style: fn(RGBColor) -> ShapeStyle = |color| ShapeStyle {
        color: color.to_rgba(),
        filled: false,
        stroke_width: 1,
    };

    {
        let root = BitMapBackend::with_buffer(&mut buf, (w, h)).into_drawing_area();
        let background = RGBColor(19, 43, 33);
        root.fill(&background)?;

        let star_canvas = if history.len() > 1 {
            let (left, right) = root.split_horizontally(3 * w / 5);

            let (min, max) = history
                .iter()
                .map(|(_, n)| *n)
                .fold((u32::MAX, 0), |(min, max), curr| {
                    (min.min(curr), max.max(curr))
                });

            let min = match min < 20 {
                true => 0,
                false => min - min / 11,
            };

            let first = *history.keys().next().unwrap();
            let last = *history.keys().last().unwrap();

            let mut chart = ChartBuilder::on(&left)
                .margin(9)
                .caption("National #1 Count History", ("sans-serif", 30, &WHITE))
                .x_label_area_size(20)
                .y_label_area_size(40)
                .build_cartesian_2d((first..last).monthly(), min..max + 1)?;

            // Mesh and labels
            chart
                .configure_mesh()
                .disable_x_mesh()
                .x_labels(8)
                .x_label_formatter(&|d| format!("{}-{}", d.year(), d.month()))
                .label_style(("sans-serif", 15, &WHITE))
                .bold_line_style(&WHITE.mix(0.3))
                .axis_style(RGBColor(7, 18, 14))
                .axis_desc_style(("sans-serif", 16, FontStyle::Bold, &WHITE))
                .draw()?;

            // Draw area
            let iter = history.iter().map(|(date, n)| (*date, *n));
            let area_style = RGBColor(2, 186, 213).mix(0.7).filled();
            let border_style = style(RGBCo


six, suits[0]),
		cardRune(seven, suits[0]),
		cardRune(eight, suits[1]),
		cardRune(ten, rand.IntN(4)),
		cardRune(jack, suits[1]),
	}})
	suits = rand.Perm(4)
	hands = append(hands, Hand{"High Card", []rune{
		cardRune(ace, suits[0]),
		cardRune(three, suits[0]),
		cardRune(five, suits[0]),
		cardRune(eight, suits[0]),
		cardRune(ten, suits[1]),
	}})

	// Pair
	for range handCount {
		cards := rand.Perm(13)
		suits := rand.Perm(4)
		hands = append(hands, Hand{"Pair", []rune{
			cardRune(cards[0], suits[0]),
			cardRune(cards[0], suits[1]),
			cardRune(cards[1], rand.IntN(4)),
			cardRune(cards[2], rand.IntN(4)),
			cardRune(cards[3], rand.IntN(4)),
		}})
	}
	suits = rand.Perm(4)
	hands = append(hands, Hand{"Pair", []rune{
		cardRune(nine, suits[0]),
		cardRune(nine, suits[1]),
		cardRune(ten, rand.IntN(4)),
		cardRune(queen, rand.IntN(4)),
		cardRune(king, rand.IntN(4)),
	}})
	suits = rand.Perm(4)
	hands = append(hands, Hand{"Pair", []rune{
		cardRune(nine, suits[0]),
		cardRune(nine, suits[1]),
		cardRune(jack, rand.IntN(4)),
		cardRune(queen, rand.IntN(4)),
		cardRune(king, rand.IntN(4)),
	}})
	suits = rand.Perm(4)
	hands = append(hands, Hand{"Pair", []rune{
		cardRune(ten, suits[0]),
		cardRune(ten, suits[1]),
		cardRune(jack, rand.IntN(4)),
		cardRune(queen, rand.IntN(4)),
		cardRune(king, rand.IntN(4)),
	}})
	suits = rand.Perm(4)
	hands = append(hands, Hand{"Pair", []rune{
		cardRune(king, suits[0]),
		cardRune(king, suits[1]),
		cardRune(jack, rand.IntN(4)),
		cardRune(ten, rand.IntN(4)),
		cardRune(nine, rand.IntN(4)),
	}})

	// Two Pair
	for range handCount {
		cards := rand.Perm(13)
		suit1 := rand.Perm(4)
		suit2 := rand.Perm(4)
		hands = append(hands, Hand{"Two Pair", []rune{
			cardRune(cards[0], suit1[0]),
			cardRune(cards[0], suit1[1]),
			cardRune(cards[1], suit2[0]),
			cardRune(cards[1], suit2[1]),
			cardRune(cards[2], rand.IntN(4)),
		}})
	}
	suit1 := rand.Perm(4)
	suit2 := rand.Perm(4)
	hands = append(hands, Hand{"Two Pair", []rune{
		cardRune(king, suit1[0]),
		cardRune(king, suit1[1]),
		cardRune(nine, suit2[0]),
		cardRune(nine, suit2[1]),
		cardRune(ten, rand.IntN(4)),
	}})
	suit1 = rand.Perm(4)
	suit2 = rand.Perm(4)
	hands = append(hands, Hand{"Two Pair", []rune{
		cardRune(king, suit1[0]),
		cardRune(king, suit1[1]),
		cardRune(four, suit2[0]),
		cardRune(four,


uals(
          0, result.exitCode, "Non-zero exitcode from compile_platform.dart");
      Expect.isTrue(await new File.fromUri(platformDill).exists());
      Expect.isTrue(await new File.fromUri(outlineDill).exists());
    });
  });

  asyncTest(() async {
    await withTemporaryDirectory("compile_platform_test_", (Uri tmp) async {
      Uri platformDill = tmp.resolve("dart2js_platform.dill");
      Uri outlineDill = tmp.resolve("dart2js_outline.dill");
      ProcessResult result = await Process.run(dartVm.toFilePath(), <String>[
        compilePlatform.toFilePath(),
        "--target=dart2js",
        "--no-deps",
        "-v",
        "dart:core,dart:js_util",
        librariesJson.toFilePath(),
        outlineDill.toFilePath(),
        platformDill.toFilePath(),
        outlineDill.toFilePath(),
      ]);
      stdout.write(result.stdout);
      stderr.write(result.stderr);
      Expect.equals(
          0, result.exitCode, "Non-zero exitcode from compile_platform.dart");
      Expect.isTrue(await new File.fromUri(platformDill).exists());
      Expect.isTrue(await new File.fromUri(outlineDill).exists());
    });
  });
}

Future<void> withTemporaryDirectory(
    String prefix, Future<void> f(Uri tmp)) async {
  Directory tmp = await Directory.systemTemp.createTemp(prefix);
  try {
    await f(tmp.uri);
  } finally {
    await tmp.delete(recursive: true);
  }
}
// Copyright (c) 2017, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:io' show File, exitCode;

import "package:_fe_analyzer_shared/src/messages/severity.dart"
    show severityEnumNames;

import 'package:dart_style/dart_style.dart' show DartFormatter;

import 'package:yaml/yaml.dart' show loadYaml;

import '../../test/utils/io_utils.dart' show computeRepoDirUri;

void main(List<String> arguments) {
  final Uri repoDir = computeRepoDirUri();
  Messages message = generateMessagesFiles(repoDir);
  if (message.sharedMessages.trim().isEmpty ||
      message.cfeMessages.trim().isEmpty) {
    print("Bailing because of errors: "
        "Refusing to overwrite with empty file!");
  } else {
    new File.fromUri(computeSharedGeneratedFile(repoDir))
        .writeAsStringSync(message.sharedMessages, flush: true);
    new File.fromUri(computeCfeGeneratedFile(repoDir))
        .writeAsStringSync(message.cfeMessages, flush: true);
  }
}

Uri computeSharedGeneratedFile(Uri repoDir) {
  return repoDir
      .resolve("pkg/_fe_analyzer_shared/lib/src/messages/codes_generated.dart");
}

Uri computeCfeGeneratedFile(Uri repoDir) {
  return repoDir
      .resolve("pkg/front_end/lib/src/fasta/fasta_codes_cfe_generated.dart");
}

class Messages {
  final String sharedMessages;
  final String cfeMessages;

  Messages(this.sharedMessages, this.cfeMessages);
}

Messages generateMessagesFiles(Uri repoDir) {
  Uri messagesFile = repoDir.resolve("pkg/front_end/messages.yaml");
  Map<dynamic, dynamic> yaml =
      loadYaml(new File.fromUri(messagesFile).readAsStringSync());
  StringBuffer sharedMessages = new StringBuffer();
  StringBuffer cfeMessages = new StringBuffer();

  const String preamble1 = """
// Copyright (c) 2021, the Dart project authors.  Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
//


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <errno.h>

#define PORT 8899

int main()
{
    int sockfd;
    struct sockaddr_in server_addr;

    // 1. 创建套接字
    // 使用 AF_INET (IPv4), SOCK_STREAM (TCP), 0 (默认协议)
    sockfd = socket( AF_INET, SOCK_STREAM, 0 );
    if ( sockfd < 0 )
    {
        perror( "Error creating socket" );
        return 1;
    }

    // 设置服务器地址结构体
    memset( &server_addr, 0, sizeof( server_addr ) );
    server_addr.sin_family = AF_INET;
    server_addr.sin_port = htons( PORT ); // 转换为网络字节序
    server_addr.sin_addr.s_addr = inet_addr( "127.0.0.1" ); // 转换为网络字节序

    // 2. 绑定套接字
    // 强制将 sockaddr_in 转换为通用的 sockaddr
    if ( bind( sockfd, ( struct sockaddr* ) &server_addr, sizeof( server_addr ) ) < 0 )
    {
        perror( "Error binding socket" ); // 如果失败，打印错误信息
        close( sockfd );
        return 1;
    }

    printf( "Successfully bound to 127.0.0.1:%d\n", PORT );

    // 3. 释放资源：关闭套接字
    close( sockfd );

    return 0;
}


0 0 .5.5h1a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5z"/>
                        </svg>
                        FRAMEWORKS

                        <svg width="16" height="16" fill="currentColor" class="bi bi-pencil-square icon-size" viewBox="0 0 16 16">
                            <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
                            <path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5z"/>
                        </svg>
                        ASSESSMENT

                        <svg fill="currentColor" class="bi bi-layout-text-window-reverse icon-size" viewBox="0 0 16 16">
                            <path d="M13 6.5a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 .5-.5m0 3a.5.5 0 0 0-.5-.5h-5a.5.5 0 0 0 0 1h5a.5.5 0 0 0 .5-.5m-.5 2.5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1z"/>
                            <path d="M14 0a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zM2 1a1 1 0 0 0-1 1v1h14V2a1 1 0 0 0-1-1zM1 4v10a1 1 0 0 0 1 1h2V4zm4 0v11h9a1 1 0 0 0 1-1V4z"/>
                        </svg>
                        PLANO DE AÇÃO

                        <


(physic.Ohm)) / 100000) << 12

// calibrate sets the scaling factor of the current and power registers for the
// maximum resolution. calibrate is run on init.
func (d *Dev) calibrate(sense physic.ElectricResistance, maxCurrent physic.ElectricCurrent) error {
	// TODO: Check calibration with float implementation in tests.
	if sense <= 0 {
		return errSenseResistorValueInvalid
	}
	if maxCurrent <= 0 {
		return errMaxCurrentInvalid
	}

	d.mu.Lock()
	defer d.mu.Unlock()

	d.currentLSB = maxCurrent / (1 << 15)
	d.powerLSB = physic.Power((maxCurrent*20 + (1 << 14)) / (1 << 15))
	// Calibration Register = 0.04096 / (current LSB * Shunt Resistance)
	// Where lsb is in Amps and resistance is in ohms.
	// Calibration register is 16 bits.
	cal := calibratescale / (int64(d.currentLSB) * int64(sense))
	if cal >= (1 << 16) {
		return errCalibrationOverflow
	}
	return d.m.WriteUint16(calibrationRegister, uint16(cal))
}

// PowerMonitor represents measurements from ina219 sensor.
type PowerMonitor struct {
	Shunt   physic.ElectricPotential
	Voltage physic.ElectricPotential
	Current physic.ElectricCurrent
	Power   physic.Power
}

// String returns a PowerMonitor as string
func (p PowerMonitor) String() string {
	return fmt.Sprintf("Bus: %s, Current: %s, Power: %s, Shunt: %s", p.Voltage, p.Current, p.Power, p.Shunt)
}

var (
	errReadShunt                 = errors.New("failed to read shunt voltage")
	errReadBus                   = errors.New("failed to read bus voltage")
	errReadPower                 = errors.New("failed to read power")
	errReadCurrent               = errors.New("failed to read current")
	errAddressOutOfRange         = errors.New("i2c address out of range")
	errSenseResistorValueInvalid = errors.New("sense resistor value cannot be negative or zero")
	errMaxCurrentInvalid         = errors.New("max current cannot be negative or zero")
	errRegisterOverflow          = errors.New("bus voltage register overflow")
	errWritingToConfigRegister   = errors.New("failed to write to configuration register")
	errCalibrationOverflow       = errors.New("calibration would exceed maximum scaling")
)
// Copyright 2018 The Periph Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.

package ht16k33

import (
	"errors"

	"periph.io/x/conn/v3/i2c"
)

// I2CAddr i2c default address.
const I2CAddr uint16 = 0x70

const (
	cmdRAM        = 0x00
	cmdKeys       = 0x40
	displaySetup  = 0x80
	displayOff    = 0x00
	displayOn     = 0x01
	systemSetup   = 0x20
	oscillatorOff = 0x00
	oscillatorOn  = 0x01
	cmdBrightness = 0xE0
)

// BlinkFrequency display frequency must be a value allowed by the HT16K33.
type BlinkFrequency byte

// Blinking frequencies.
const (
	BlinkOff    = 0x00
	Blink2Hz    = 0x02
	Blink1Hz    = 0x04
	BlinkHalfHz = 0x06
)

// Dev is a handler to ht16k33 controller
type Dev struct {
	dev i2c.Dev
}

// NewI2C returns a Dev object that communicates over I2C.
//
// To use on the default address, ht16k33.I2CAddr must be passed as argument.
func NewI2C(bus i2c.Bus


Brogues & Hose

   Sporrans

   Material Shop >

   Tartan Ribbon

   Tartan Swatches

   Tartan Material

   Metalware >

   Quaichs

   Cointrays

   Tableware

   Flasks

   Trinket Boxes

   Scottish Books etc. >

   Scottish Books

   Scottish CDs

   Clan CD ROMs

   Scottish Maps

   Scottish Clan Items >

   Clan Crest Plaque

   Crest Cross Stitch

   Clan Embossed Items

   Clan Crest Badges

   Thistle Buckle with Badge

 About Us | Site Map  | Terms & Conditions | Contact Us


 &i__5, &c_b8, &u[(i2 +
			    1) * u_dim1 + 1], ldu, &wv[(i2 + 1) * wv_dim1 + 1]
, ldwv);

/*                 ==== Multiply by U22 ==== */

		    i__5 = i4 - i2;
		    i__7 = j4 - j2;
		    dgemm_("N", "N", &jlen, &i__5, &i__7, &c_b8, &h__[jrow + (
			    incol + 1 + j2) * h_dim1], ldh, &u[j2 + 1 + (i2 +
			    1) * u_dim1], ldu, &c_b8, &wv[(i2 + 1) * wv_dim1
			    + 1], ldwv);

/*                 ==== Copy it back ==== */

		    dlacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &h__[
			    jrow + (incol + 1) * h_dim1], ldh);
/* L200: */
		}

/*              ==== Multiply Z (also vertical) ==== */

		if (*wantz) {
		    i__4 = *ihiz;
		    i__3 = *nv;
		    for (jrow = *iloz; i__3 < 0 ? jrow >= i__4 : jrow <= i__4;
			     jrow += i__3) {
/* Computing MIN */
			i__5 = *nv, i__7 = *ihiz - jrow + 1;
			jlen = min(i__5,i__7);

/*                    ==== Copy right of Z to left of scratch (first */
/*                    .     KZS columns get multiplied by zero) ==== */

			dlacpy_("ALL", &jlen, &knz, &z__[jrow + (incol + 1 +
				j2) * z_dim1], ldz, &wv[(kzs + 1) * wv_dim1 +
				1], ldwv);

/*                    ==== Multiply by U12 ==== */

			dlaset_("ALL", &jlen, &kzs, &c_b7, &c_b7, &wv[
				wv_offset], ldwv);
			dtrmm_("R", "U", "N", "N", &jlen, &knz, &c_b8, &u[j2
				+ 1 + (kzs + 1) * u_dim1], ldu, &wv[(kzs + 1)
				* wv_dim1 + 1], ldwv);

/*                    ==== Multiply by U11 ==== */

			dgemm_("N", "N", &jlen, &i2, &j2, &c_b8, &z__[jrow + (
				incol + 1) * z_dim1], ldz, &u[u_offset], ldu,
				&c_b8, &wv[wv_offset], ldwv);

/*                    ==== Copy left of Z to right of scratch ==== */

			dlacpy_("ALL", &jlen, &j2, &z__[jrow + (incol + 1) *
				z_dim1], ldz, &wv[(i2 + 1) * wv_dim1 + 1],
				ldwv);

/*                    ==== Multiply by U21 ==== */

			i__5 = i4 - i2;
			dtrmm_("R", "L", "N", "N", &jlen, &i__5, &c_b8, &u[(
				i2 + 1) * u_dim1 + 1], ldu, &wv[(i2 + 1) *
				wv_dim1 + 1], ldwv);

/*                    ==== Multiply by U22 ==== */

			i__5 = i4 - i2;
			i__7 = j4 - j2;
			dgemm_("N", "N", &jlen, &i__5, &i__7, &c_b8, &z__[
				jrow + (incol + 1 + j2) * z_dim1], ldz, &u[j2
				+ 1 + (i2 + 1) * u_dim1], ldu, &c_b8, &wv[(i2
				+ 1) * wv_dim1 + 1], ldwv);

/*                    ==== Copy the result back to Z ==== */

			dlacpy_("ALL", &jlen, &kdu, &wv[wv_offset], ldwv, &
				z__[jrow + (incol + 1) * z_dim1], ldz);
/* L210: */
		    }
		}
	    }
	}
/* L220: */
    }

/*     ==== End of DLAQR5 ==== */

    return 0;
} /* dlaqr5_ */


] = this.x
        array[index + 1] = this.y
    }

    toArray() {
        return [this.x, this.y]
    }

    toFloat32Array() {
        return new Float32Array(this.toArray())
    }

    toString() {
        return `(${this.x},${this.y})`
    }

}'use strict';

import { KeyStore } from './keystore';
import { KeyPair } from '../utils/key_pair';

/**
 * Keystore which can be used to merge multiple key stores into one virtual key store.
 */
export class MergeKeyStore extends KeyStore {
    keyStores: KeyStore[];

    /**
     * @param keyStores first keystore gets all write calls, read calls are attempted from start to end of array
     */
    constructor(keyStores: KeyStore[]) {
        super();
        this.keyStores = keyStores;
    }

    async setKey(networkId: string, accountId: string, keyPair: KeyPair): Promise<void> {
        this.keyStores[0].setKey(networkId, accountId, keyPair);
    }

    async getKey(networkId: string, accountId: string): Promise<KeyPair> {
        for (const keyStore of this.keyStores) {
            const keyPair = await keyStore.getKey(networkId, accountId);
            if (keyPair) {
                return keyPair;
            }
        }
        return null;
    }

    async removeKey(networkId: string, accountId: string): Promise<void> {
        for (const keyStore of this.keyStores) {
            keyStore.removeKey(networkId, accountId);
        }
    }

    async clear(): Promise<void> {
        for (const keyStore of this.keyStores) {
            keyStore.clear();
        }
    }

    async getNetworks(): Promise<string[]> {
        const result = new Set<string>();
        for (const keyStore of this.keyStores) {
            for (const network of await keyStore.getNetworks()) {
                result.add(network);
            }
        }
        return Array.from(result);
    }

    async getAccounts(networkId: string): Promise<string[]> {
        const result = new Set<string>();
        for (const keyStore of this.keyStores) {
            for (const account of await keyStore.getAccounts(networkId)) {
                result.add(account);
            }
        }
        return Array.from(result);
    }
}
import { Lexer } from './lexer';
import { Token } from './tokens';

const samples: { input: string; output: Token[] }[] = [
  {
    input: 'hello world\n',
    output: [
      { type: 'WordToken', value: 'hello', pos: 0 },
      { type: 'WhitespaceToken', value: ' ', pos: 5 },
      { type: 'WordToken', value: 'world', pos: 6 },
      { type: 'NewLineToken', pos: 11 }
    ]
  },
  {
    input: '(hello world)',
    output: [
      { type: 'OpenBracket', bracket: 'RoundBracket', pos: 0 },
      { type: 'WordToken', value: 'hello', pos: 1 },
      { type: 'WhitespaceToken', value: ' ', pos: 6 },
      { type: 'WordToken', value: 'world', pos: 7 },
      { type: 'CloseBracket', bracket: 'RoundBracket', pos: 12 }
    ]
  },
  {
    input: '(print "Hello, world!")',
    output: [
      { type: 'OpenBracket', bracket: 'RoundBracket', pos: 0 },


rn accumulator;
                                }
                            }
                            pendingPos = startPos;
                            pendingEnd = pos;
                            pendingKind = kind;
                            pendingHasTrailingNewLine = hasTrailingNewLine;
                            hasPendingCommentRange = true;
                        }
                        continue;
                    }
                    goto breakScan;

                default:
                    if (ch > CharacterCodes.MaxAsciiCharacter && (IsWhiteSpaceLike(ch)))
                    {
                        if (hasPendingCommentRange && IsLineBreak(ch))
                            pendingHasTrailingNewLine = true;
                        pos++;
                        continue;
                    }
                    goto breakScan;
            }
        }

    breakScan:
        if (hasPendingCommentRange)
            accumulator = cb((pendingPos, pendingEnd, pendingKind, pendingHasTrailingNewLine, state, accumulator));

        return accumulator;
    }

    List<CommentDirective> AppendIfCommentDirective(List<CommentDirective> commentDirectives, string text, Regex commentDirectiveRegEx, int lineStart)
    {
        var type = GetDirectiveFromComment(text.TrimStart(), commentDirectiveRegEx);
        if (type == null)
        {
            return commentDirectives;
        }

        commentDirectives ??= [];
        commentDirectives.Add(new(new() { Pos = lineStart, End = pos }, type.Value));
        return commentDirectives;
    }

    CommentDirectiveType? GetDirectiveFromComment(string text, Regex commentDirectiveRegEx)
    {
        var match = commentDirectiveRegEx.Match(text);
        if (!match.Success || match.Groups.Count < 0)
        {
            return null;
        }

        return match.Groups[1].Value switch
        {
            "ts-expect-error" => (CommentDirectiveType?)CommentDirectiveType.ExpectError,
            "ts-ignore" => (CommentDirectiveType?)CommentDirectiveType.Ignore,
            _ => null,
        };
    }

#if !NET7_0_OR_GREATER
    private static readonly Regex commentDirectiveRegExSingleLine = new(@"^\/\/\/?\s*@(ts-expect-error|ts-ignore)/", RegexOptions.Compiled);
    private static readonly Regex commentDirectiveRegExMultiLine = new(@"^\/\/\/?\s*@(ts-expect-error|ts-ignore)/", RegexOptions.Compiled);
    private static readonly Regex jsDocSeeOrLink = new(@"@(?:see|link)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant);
#else
    // Test for whether a single line comment with leading whitespace trimmed's text contains a directive.
    private static readonly Regex commentDirectiveRegExSingleLine = commentDirectiveReExSingleLineGen();

    // Test for whether a multi-line comment with leading whitespace trimmed's last line contains a directive.
    private static readonly Regex commentDirectiveRegExMultiLine = commentDirectiveRegExMultiLineGen();

    [GeneratedRegex(@"^\/\/\/?\s*@(ts-expect-error|ts-ignore)/")]
    private static partial Regex commentDirectiveReExSingleLineGen();

    [GeneratedRegex(@"^(?:\\/|\\*)*\\s*@(ts-expect-error|ts-ignore)")]
    private static partial Regex commentDirectiveRegExMultiLineGen();

    private static readonly Regex jsDocSeeOrLink = jsDocSeeOrLinkGen();

    [GeneratedRegex(@"@(?:see|link)", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant)]
    private static partial Regex jsDocSeeOrLinkGen();
#endif
}


data-v-01b203fd]{width:100%;bottom:0;padding:0 16px;margin:48px 0 24px;text-align:center}#userLayout.user-layout-wrapper .container .user-layout-content .footer .links[data-v-01b203fd]{margin-bottom:8px;font-size:14px}#userLayout.user-layout-wrapper .container .user-layout-content .footer .links a[data-v-01b203fd]{color:rgba(0,0,0,.45);-webkit-transition:all .3s;transition:all .3s}#userLayout.user-layout-wrapper .container .user-layout-content .footer .links a[data-v-01b203fd]:not(:last-child){margin-right:40px}#userLayout.user-layout-wrapper .container .user-layout-content .footer .copyright[data-v-01b203fd]{color:rgba(0,0,0,.45);font-size:14px}#userLayout.user-layout-wrapper .container a[data-v-01b203fd]{text-decoration:none}.ant-pro-drop-down[data-v-e142e804] .action{margin-right:8px}.ant-pro-drop-down[data-v-e142e804] .ant-dropdown-menu-item{min-width:160px}.business-pro-ad[data-v-4109f67d]{position:fixed;background:hsla(0,0%,100%,.25);left:0;bottom:0;padding:0 12px;height:48px;width:258px;z-index:99}.ant-pro-global-header-index-right{margin-right:8px}.ant-pro-global-header-index-right.ant-pro-global-header-index-dark .ant-pro-global-header-index-action{color:hsla(0,0%,100%,.85)}.ant-pro-global-header-index-right.ant-pro-global-header-index-dark .ant-pro-global-header-index-action:hover{background:#1890ff}.ant-pro-global-header-index-right .ant-pro-account-avatar .antd-pro-global-header-index-avatar{margin:20px 0;margin-right:8px;color:#1890ff;vertical-align:top;background:hsla(0,0%,100%,.85)}.ant-pro-global-header-index-right .menu .anticon{margin-right:8px}.ant-pro-global-header-index-right .menu .ant-dropdown-menu-item{min-width:100px}.ant-pro-multi-tab{margin:-23px -24px 24px -24px;background:#fff}.topmenu .ant-pro-multi-tab-wrapper{max-width:1200px;margin:0 auto}.topmenu.content-width-Fluid .ant-pro-multi-tab-wrapper{max-width:100%;margin:0 auto}body,html{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,:after,:before{-webkit-box-sizing:border-box;box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;color:rgba(0,0,0,.65);font-size:14px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-variant:tabular-nums;line-height:1.5;background-color:#fff;-webkit-font-feature-settings:"tnum";font-feature-settings:


 this.mapLayer);
		map.put(DRAW_NON_MOVING_ITEMS, Boolean.toString(this.showParking));
		map.put(DRAW_TRANSIT_FACILITIES, Boolean.toString(this.drawTransitFacilities));
		map.put(DRAW_TRANSIT_FACILITY_IDS, Boolean.toString(this.drawTransitFacilityIds));
		return map;
	}

	@Override
	public final Map<String, String> getComments() {
		Map<String,String> map = super.getComments();
		map.put(AGENT_SIZE, "The (initial) size of the agents.  Only a range of numbers is allowed, otherwise otfvis aborts"
				+ " rather ungracefully, or displays no agents at all.");
		map.put(LINK_WIDTH, "The (initial) width of the links of the network. Use positive floating point values.");
		map.put(LINK_WIDTH_IS_PROPORTIONAL_TO, "Link width is proportional to `"+NUMBER_OF_LANES+"' or to `"+CAPACITY+"'.");

		StringBuilder allowedColorings = new StringBuilder();
		for (ColoringScheme scheme : ColoringScheme.values()) {
			allowedColorings.append(' ');
			allowedColorings.append(scheme.toString());
		}
		map.put(COLORING, "coloring scheme for otfvis.  Currently (2012) allowed values:" + allowedColorings);

		map.put(MAP_OVERLAY_MODE, "Render everything on top of map tiles. Default: From tiles.openstreetmap.org");
		map.put(MAP_BASE_URL, "URL to get WMS tiles from. For a local GeoServer instance, use http://localhost:8080/geoserver/wms?service=WMS&");
		map.put(MAP_LAYER, "The WMS layer to display. For GeoServer and a layer called clipped in workspace mz, use mz:clipped");

		map.put(DRAW_NON_MOVING_ITEMS, "If non-moving items (e.g. agents at activities, at bus stops, etc.) should be showed.  " +
				"May affect all non-moving items.") ;
		return map ;
	}

	/* direct access */

	public float getAgentSize() {
		return this.agentSize;
	}

	public OTFVisConfigGroup setAgentSize(final float agentSize) {
		if(this.agentSize != agentSize) setModified();
		this.agentSize = agentSize;
		return this;
	}

	public String getMiddleMouseFunc() {
		return this.middleMouseFunc;
	}

	public OTFVisConfigGroup setMiddleMouseFunc(final String middleMouseFunc) {
		if(this.middleMouseFunc.equals(middleMouseFunc)) setModified();
		this.middleMouseFunc = middleMouseFunc;
		return this;
	}

	public String getLeftMouseFunc() {
		return this.leftMouseFunc;
	}

	public OTFVisConfigGroup setLeftMouseFunc(final String leftMouseFunc) {
		if(this.leftMouseFunc.equals(leftMouseFunc)) setModified();
		this.leftMouseFunc = leftMouseFunc;
		return this;
	}

	public String getRightMouseFunc() {
		return this.rightMouseFunc;
	}

	public OTFVisConfigGroup setRightMouseFunc(final String rightMouseFunc) {
		if(this.rightMouseFunc.equals(rightMouseFunc)) setModified();
		this.rightMouseFunc = rightMouseFunc;
		return this;
	}

	public int getBigTimeStep() {
		return this.bigTimeStep;
	}

	public OTFVisConfigGroup setBigTimeStep(final int bigTimeStep) {
		if(this.bigTimeStep != bigTimeStep) setModified();
		this.bigTimeStep = bigTimeStep;
		return this;
	}

	public String getQueryType() {
		return this.queryType;
	}

	public OTFVisConfigGroup setQueryType( final String queryType ) {
		setModified() ;
		this.queryType = queryType;
		return this;
	}

	public boolean isMultipleSelect() {
		return this.multipleS


a Vermelha. Destrua-o e arranque sua cabeça. Leve o crânio para Ardeluta."}},
[6602] = {"Sangue do Campeão dos Dragões Negros", nil, {"Viaje para o Pico da Rocha Negra e mate o General Drakkisath. Recolha seu sangue e leve-o para Petraro."}},
[6603] = {"Problema em Hibérnia!", nil, {"Encontre Bruna Covaneve perto das fontes termais de Hibérnia."}},
[6604] = {"Coruscante enfurecido", nil, {"Fale com Jaron Moldapedra na Aldeia Chuva Estelar."}},
[6605] = {"Sujeitinha esquisita", nil, {"Fale com Winna Perícon na Selva Maleva."}},
[6607] = {"Nat Pagle, o pescador supremo", nil, {"Nat Pagle quer que você pesque os seguintes peixes:\n\nO Graçapé-brumalga, na Praia Brumalga, que fica no Pântano das Mágoas.\n\nA Piranha-de-sar'theris, na Praia de Sar'theris, que fica na Desolação.\n\nO Atum-amarelo-de-feralas, no Rio Verdantis, em Feralas.\n\nA Molinésia-azul-da-costa-selvagem, na Costa Selvagem, na Selva do Espinhaço.\n\nFale novamente com Nat Pagle quando já tiver fisgado todos!"}},
[6608] = {"Você bom demais", nil, {"Você acha que Lumak está tentando dizer que ele já não pode mais ajudar a melhorar suas habilidades de pesca. Você pode tentar encontrar o amigo dele, Nat Pagle, um humano pescador, que fica em uma das ilhas ao sul de Theramore (pelo menos é isso o que você acha que Lumak disse)."}},
[6609] = {"Eu não sei nada!", nil, {"Vá até a cidade costeira de Theramore, em Kalimdor. A partir de lá, procure uma ilha a sul da capital. Nat Pagle o aguarda!"}},
[6610] = {"Escondidinho Marisquete", nil, {"Funesto Marrão quer que você consiga os seguintes itens:\n\n10 Ovos Gigantescos. Você os encontra nas rocas que vagueiam por Tanaris ou em qualquer pássaro grande.\n\n10 fatias de Carne de Marisco Condimentada. Você as encontra dentro dos mariscos, óbvio!\n\n20 pedaços de Cheddar Bem Envelhecido. Procure alguém que venda esse queijo!\n\nConsiga todos os itens e fale novamente com Funesto."}},
[6611] = {"Para Geringontzan!", nil, {"Vá para Geringontzan, no Deserto de Tanaris, e fale com Funesto Marrão para progredir na carreira de cozinheiro."}},
[6612] = {"Eu sei de um cara...", nil, {"Vá para Geringontzan, no deserto de Tanaris, e fale com Funesto Marrão sobre como se desenvolver na carreira de cozinheiro."}},
[6621] = {"O rei dos Torpeflora", nil, {"Finque o Estandarte de Senani no Montículo Totêmico dos Torpeflora. Não deixe que os pelursos destruam o estandarte. Derrote o Chefe Murgut e leve o Totem de Murgut para Senani no Refúgio Brisaprata."}},
[6622] = {"Triagem", nil, {"Use Bandagens de Triagem para salvar pacientes. Você precisa salvar 15 deles antes que 6 morram devido aos ferimentos.\n\nLembre-se da ordem da triagem! Os Soldados Mortalmente Feridos são os que morrem mais rápido, se


step: function( percent, tween )", 1, function() {
	var counter = {};
	jQuery( "#foo" ).animate({
		prop1: 1,
		prop2: 2,
		prop3: 3
	}, {
		duration: 1,
		step: function( value, tween ) {
			var calls = counter[ tween.prop ] = counter[ tween.prop ] || [];
			// in case this is called multiple times for either, lets store it in
			// 0 or 1 in the array
			calls[ value === 0 ? 0 : 1 ] = value;
		}
	}).queue( function( next ) {
		deepEqual( counter, {
			prop1: [0, 1],
			prop2: [0, 2],
			prop3: [0, 3]
		}, "Step function was called once at 0% and once at 100% for each property");
		next();
		start();
	});
});

asyncTest( "Animate callbacks have correct context", 2, function() {
	var foo = jQuery( "#foo" );
	foo.animate({
		height: 10
	}, 10, function() {
		equal( foo[ 0 ], this, "Complete callback after stop(true) `this` is element" );
	}).stop( true, true );
	foo.animate({
		height: 100
	}, 10, function() {
		equal( foo[ 0 ], this, "Complete callback `this` is element" );
		start();
	});
});

asyncTest( "User supplied callback called after show when fx off (#8892)", 2, function() {
	var foo = jQuery( "#foo" );
	jQuery.fx.off = true;
	foo.hide();
	foo.fadeIn( 500, function() {
		ok( jQuery( this ).is( ":visible" ), "Element is visible in callback" );
		foo.fadeOut( 500, function() {
			ok( jQuery( this ).is( ":hidden" ), "Element is hidden in callback" );
			jQuery.fx.off = false;
			start();
		});
	});
});

test( "animate should set display for disconnected nodes", function() {
	expect( 18 );

	var i = 0,
		methods = {
			toggle: [ 1 ],
			slideToggle: [],
			fadeIn: [],
			fadeTo: [ "fast", 0.5 ],
			slideDown: [ "fast" ],
			show: [ 1 ],
			animate: [{ width: "show" }]
		},
		$divTest = jQuery("
test
"),
		// parentNode = null
		$divEmpty = jQuery("
"),
		$divNone = jQuery("
"),
		$divInline = jQuery("
");

	strictEqual( $divTest.show()[ 0 ].style.display, "block", "set display with show() for element with parentNode = document fragment" );
	strictEqual( $divEmpty.show()[ 0 ].style.display, "block", "set display with show() for element with parentNode = null" );
	strictEqual( $divNone.show()[ 0 ].style.display, "block", "show() should change display if it already set to none" );
	strictEqual( $divInline.show()[ 0 ].style.display, "inline", "show() should not change display if it already set" );

	QUnit.expectJqData( $divTest[ 0 ], "olddisplay" );
	QUnit.expectJqData( $divEmpty[ 0 ], "olddisplay" );
	QUnit.expectJqData( $divNone[ 0 ], "olddisplay" );

	stop();
	jQuery.each( methods, function( name, opt ) {
		jQuery.each([

			// parentNode = document fragment
			jQuery("
test
"),

			// parentNode = null
			jQuery("
")

		], function() {
			var callback = [function () {
					strictEqual( this.style.display, "block", "set display to block with " + name );

					QUnit.expectJqData( this, "olddisplay" );

					if ( ++i === 14 ) {
						start();
					}
			}];


H680Q693 197 693 190Q693 186 692 184T686 177T680 170H578L526 92L478 17L580 15H682Q693 4 693 -4T680 -25H451L353 -179L518 -181H682Q694 -193 694 -201Q694 -211 682 -219L504 -221H326L293 -272Q257 -332 246 -332Q238 -332 232 -326T225 -313Q225 -310 226 -308Q226 -305 251 -265T278 -223Q278 -221 186 -221H95Q93 -218 89 -214T84 -208T82 -201T95 -181H306L404 -25H249L93 -23L86 -19Q82 -14 82 -7",10956:"82 732Q82 739 95 752H251Q415 752 426 750Q539 736 615 657Q667 599 689 517Q692 496 692 461T689 406Q668 325 615 266Q522 170 382 170H355L326 95Q319 80 311 59T298 28T293 17Q293 15 486 15H680Q693 0 693 -6T680 -25H275L213 -179L449 -181H682Q693 -192 693 -199T680 -221H198L178 -270Q153 -333 139 -333Q132 -333 126 -327T119 -314T135 -266T153 -223Q153 -221 124 -221H95Q82 -207 82 -201T95 -181H171L233 -25H162L93 -23L86 -19Q82 -14 82 -7T95 15H251L313 170H202L93 172L86 177Q82 182 82 190Q82 199 93 210H211L329 212L349 261Q366 301 372 311T386 321Q392 321 399 315T407 302Q407 295 390 254T373 210Q374 209 377 209Q412 209 444 217Q512 231 564 273T638 377Q651 414 651 461Q651 509 638 548Q613 613 555 656T422 710Q411 712 249 712H95Q82 727 82 732"},{})},711:function(t,e,n,r,i){r(),n.texVariant={710:[.845,-.561,2.333,{ic:.013}],732:[.899,-.628,2.333],770:[.845,-.561,0,{ic:.013}],771:[.899,-.628,0],1008:[.434,.006,.667,{ic:.067}],8463:[.695,.013,.54,{ic:.022}],8592:[.437,-.064,.5],8594:[.437,-.064,.5],8652:[.514,.014,1],8708:[.86,.166,.556],8709:[.587,0,.778],8722:[.27,-.23,.5],8726:[.43,.023,.778],8733:[.472,-.028,.778],8739:[.43,.023,.222],8740:[.43,.023,.222,{ic:.018}],8741:[.431,.023,.389],8742:[.431,.024,.389,{ic:.018}],8764:[.365,-.132,.778],8776:[.481,-.05,.778],8808:[.752,.284,.778],8809:[.752,.284,.778],8816:[.919,.421,.778],8817:[.919,.421,.778],8840:[.828,.33,.778],8841:[.828,.33,.778],8842:[.634,.255,.778],8843:[.634,.254,.778],8872:[.694,0,.611],8901:[.189,0,.278],8994:[.378,-.122,.778],8995:[.378,-.143,.778],9651:[.575,.02,.722],9661:[.576,.019,.722],10887:[.801,.303,.778],10888:[.801,.303,.778],10955:[.752,.332,.778],10956:[.752,.333,.778]}},712:function(t,e,n,r,i){r();var o=t(578);n.HDW1=[.75,.25,.875],n.HDW2=[.85,.349,.667],n.HDW3=[.583,.082,.5],n.VSIZES=[1,1.2,1.8,2.4,3];var s={c:47,dir:o.V,sizes:n.VSIZES},a={c:175,dir:o.H,sizes:[.5],stretch:[0,175],HDW:[.59,-.544,.5]},l={c:710,dir:o.H,sizes:[.5,.556,1,


Test</title>

	<link rel="stylesheet" id="themeStyles" href="../../../dijit/themes/tundra/tundra.css">
	<link rel="stylesheet" href="../SortList/SortList.css">

Dojox SortList test

Simple sortable example

Children of a TabContainer

Child of a BorderContainer

Raw, degradable UL list:

one

two

three

four

five

six

four

five

six

four

five

six

four

five

six

	</ul


ray()
    kotlin.test.assertEquals(DEFAULT_LS_OUTPUT, displayedLines[0])

    assertPluginError(false)
  }
}
/*
 * Copyright 2003-2023 The IdeaVim authors
 *
 * Use of this source code is governed by an MIT-style
 * license that can be found in the LICENSE.txt file or at
 * https://opensource.org/licenses/MIT.
 */

package org.jetbrains.plugins.ideavim.ex.implementation.expressions

import org.jetbrains.plugins.ideavim.SkipNeovimReason
import org.jetbrains.plugins.ideavim.TestWithoutNeovim
import org.jetbrains.plugins.ideavim.VimTestCase
import org.junit.jupiter.api.Test

class OptionTest : VimTestCase() {

  @TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
  @Test
  fun `test option`() {
    configureByText("\n")
    enterCommand("set ignorecase") // Default is off
    typeText(commandToKeys("if &ic | echo 'ignore case is on' | else | echo 'ignore case is off' | endif"))
    assertExOutput("ignore case is on")
  }

  @TestWithoutNeovim(reason = SkipNeovimReason.OPTION)
  @Test
  fun `test option2`() {
    configureByText("\n")
    enterCommand("set ignorecase") // Default is off
    enterCommand("set noignorecase")
    typeText(commandToKeys("if &ic | echo 'ignore case is on' | else | echo 'ignore case is off' | endif"))
    assertExOutput("ignore case is off")
  }

  @Test
  fun `test multiple options`() {
    configureByText("\n")
    enterCommand("set ignorecase digraph") // Both off by default
    typeText(commandToKeys("if &ic | echo 'ignore case is on' | else | echo 'ignore case is off' | endif"))
    assertExOutput("ignore case is on")
    typeText(commandToKeys("if &dg | echo 'digraph is on' | else | echo 'digraph is off' | endif"))
    assertExOutput("digraph is on")
  }
}
/*
 * Copyright 2003-2024 The IdeaVim authors
 *
 * Use of this source code is governed by an MIT-style
 * license that can be found in the LICENSE.txt file or at
 * https://opensource.org/licenses/MIT.
 */

package org.jetbrains.plugins.ideavim.ex.implementation.variables

import com.maddyhome.idea.vim.api.injector
import com.maddyhome.idea.vim.newapi.vim
import org.jetbrains.plugins.ideavim.VimTestCase
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals

class RegisterVariableTest : VimTestCase() {

  @Test
  fun `test default v register`() {
    configureByText("abcd")
    typeText(commandToKeys("echo v:register"))
    assertExOutput("\"")
  }

  @Test
  fun `test default v register in expression mapping`() {
    configureByText("abcd")
    enterCommand("""nnoremap <expr> X ':echo v:register<CR>'""")
    typeText("X")
    assertExOutput("\"")
  }

  @Test
  fun `test named v register`() {
    configureByText("abcd")
    typeText("\"w")
    typeText(commandToKeys("echo v:register"))
    assertExOutput("w")
  }

  @Test
  fun `test named v register in expression mapping`() {
    configureByText("abcd")
    enterCommand("""vnoremap <expr> y '"' . v:register . 'y'""")
    typeText("vl\"zy")
    val vimEditor = fixture.editor.vim
    val context = injector.executionContextManager.getEditorExecutionContext(vimEditor)
    val register = injector.registerGroup.getRegisters(vimEditor, context).first { reg -> reg.name == 'z' }
    assertEquals("ab", register.text)
  }


taining //export lines.
The _cgo_export.h file now begins with the C preamble comment,
so that exported function definitions can use types defined there.
This has the effect of compiling the preamble multiple times, so a
package using //export must not put function definitions
or variable initializations in the C preamble.

Packaged releases

One of the most significant changes associated with Go 1 is the availability
of prepackaged, downloadable distributions.
They are available for many combinations of architecture and operating system
(including Windows) and the list will grow.
Installation details are described on the
Getting Started page, while
the distributions themselves are listed on the
downloads page.

Build version go1.0.1.

A link noted,
and then, coming up on the very next line, we will
find yet another link, link 3.0 if you will,
after a few more words link text.

Terms of Service |
Privacy Policy

Checks the placeholders count in functions / methods.

Known functions are (case-insensitive):

fmt.Printf

fmt.Sprintf

fmt.Errorf

fmt.Fprintf

fmt.Fscanf

fmt.Scanf

fmt.Sscanf

log.Printf

log.Fatalf

log.Panicf

<!DOCTYPE html>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale


EP_FAILED: StepFailedPayload<T>
}
import * as countryToCurrency from 'country-to-currency';
// import countryToCurrency from 'country-to-currency';
// const countryToCurrency = require( 'country-to-currency' );

// @see https://tc39.es/ecma402/#sec-properties-of-intl-numberformat-instances

// type NumberFormatOptions = Intl.NumberFormatOptions;

// There are more options, but we will only use the following:
interface NumberFormatOptions {

    style?: 'decimal' | 'percent' | 'unit' | 'currency';

    notation?: 'standard' | 'scientific' | 'engineering' | 'compact';
    compactDisplay?: 'long' | 'short';

    currency?: string;
    currencyDisplay?: 'symbol' | 'narrowSymbol' | 'name' | 'code';
    currencySign?: 'standard' | 'accounting';
    signDisplay?: 'auto' | 'always' | 'exceptZero' | 'never';

    useGrouping?: boolean;

    minimumIntegerDigits?: number; // 1 to 21
    minimumFractionDigits?: number; // 0 to 20
    maximumFractionDigits?: number; // 0 to 20
    minimumSignificantDigits?: number; // 0 to 20
    maximumSignificantDigits?: number; // 0 to 20
}

// Try it on https://regex101.com
const regex = /^([$d%u$wnoaEecls])?(?: |\\t)*(\#?)(?: |\\t)*([+!@])?([0-9]{0,2})(?:\.([0-9]{0,2})(?:\-([0-9]{0,2}))?)?(?:\;([0-9]{0,2})(?:\-([0-9]{0,2}))?)?$/;

/**
 * Indicates if the given pattern is correct.
 *
 * @param pattern Pattern
 */
export function isPatternCorrect( pattern: string ): boolean {
    return regex.test( pattern );
}

/**
 * Generates a configuration for `Intl.NumberFormat` from the given pattern.
 *
 * @see readme.md for documentation about the pattern.
 *
 * @param pattern Pattern to transform.
 * @param additionalOptions Additional options to be copied to the resulting object.
 *
 * @example
 * ```typescript
 * const options = makeOptions( '$', { currency: 'USD' } );
 * const numberStr = new Intl.NumberFormat( 'en-US', options ).format( 123456 );
 * ```
 */
export function makeOptions(
    pattern: string,
    additionalOptions?: NumberFormatOptions
): NumberFormatOptions {

    const r: RegExpExecArray | null = regex.exec( pattern );
    if ( ! r || r.length < 1 ) {
        if ( additionalOptions ) {
            return Object.assign( {}, additionalOptions );
        }
        return {};
    }

    const [
        /* fullMatch */,
		style,
		grouping,
        sign,
        minimumIntegerDigits,
        minimumFractionDigits,
        maximumFractionDigits,
        minimumSignificantDigits,
        maximumSignificantDigits,
    ] = r;

	let obj: NumberFormatOptions = objectFromStyle( style );

    if ( '#' === grouping ) {
        obj.useGrouping = false;
    }

    if ( '+' === sign ) {
        obj.signDisplay = 'exceptZero';
    } else if ( '!' === sign ) {
        obj.signDisplay = 'never';
    } else if ( '@' === sign ) {
        obj.signDisplay = 'always';
    }

    if ( minimumIntegerDigits ) {
        obj.minimumIntegerDigits = Number( minimumIntegerDigits );
    }

    if ( minimumFractionDigits ) {
        obj.minimumFractionDigits = Number( minimumFractionDigits );
    }

    if ( maximumFractionDigits ) {
        obj.maximumFractionDigits = Number( maximumFractionDigits );
    }

    if ( minimumSignificantDigits ) {
        obj.minimumSignificantDigits = Number( minimumSignificantDigits );
    }

    if ( maximumSignificantDigits ) {
        obj.maximumSignificantDigits = Number( maximumSignificantDigits );
    }

    if ( additionalOptions ) {
        return


      // tell dialog where to get info
        SetWindowLongPtr(hDlg, DWLP_USER, (LONG_PTR)pasi);

        // save the handle to the page
        pasi->hDlg         = hDlg;
        pasi->pSec         = (LPSECURITYPAGE)lParam;
        pasi->hwndWebSites = GetDlgItem(hDlg, IDC_LIST_WEBSITES);
        pasi->hwndAdd      = GetDlgItem(hDlg, IDC_EDIT_ADD_SITE);

        // cross-lang platform support
        SHSetDefaultDialogFont(hDlg, IDC_EDIT_ADD_SITE);

        // limit the text so it will fit
        SendMessage(pasi->hwndAdd, EM_SETLIMITTEXT, (WPARAM)sizeof(pasi->szWebSite), (LPARAM)0);

        pasi->fRequireServerVerification = pasi->pSec->pszs->dwFlags & ZAFLAGS_REQUIRE_VERIFICATION;
        CheckDlgButton(hDlg, IDC_CHECK_REQUIRE_SERVER_VERIFICATION, pasi->fRequireServerVerification);

        // hide the checkbox if it doesn't support server verification
        if (!(pasi->pSec->pszs->dwFlags & ZAFLAGS_SUPPORTS_VERIFICATION))
            ShowWindow(GetDlgItem(hDlg, IDC_CHECK_REQUIRE_SERVER_VERIFICATION), SW_HIDE);

        SendMessage(hDlg, WM_SETTEXT, (WPARAM)0, (LPARAM)pasi->pSec->pszs->szDisplayName);
        SetDlgItemText(hDlg, IDC_ADDSITES_GROUPBOX,(LPTSTR)pasi->pSec->pszs->szDisplayName);
        SendDlgItemMessage(hDlg, IDC_ZONE_ICON, STM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)pasi->pSec->pszs->hicon);
        EnableWindow(GetDlgItem(hDlg, IDC_BUTTON_REMOVE), FALSE);

        if (pasi->pSec->pInternetSecurityManager || SUCCEEDED(CoInternetCreateSecurityManager(NULL, &(pasi->pSec->pInternetSecurityManager), 0)))
        {
            IEnumString *pEnum;

            if (SUCCEEDED(pasi->pSec->pInternetSecurityManager->GetZoneMappings(pasi->pSec->pszs->dwZoneIndex, &pEnum, 0)))
            {
                LPOLESTR pszMapping;
#ifndef UNICODE
                CHAR szMapping[MAX_URL_STRING];
#endif
                LPTSTR psz;

                while (pEnum->Next(1, &pszMapping, NULL) == S_OK)
                {
#ifndef UNICODE
                    WideCharToMultiByte(CP_ACP, 0, pszMapping, -1, szMapping, ARRAYSIZE(szMapping), NULL, NULL);
                    psz = szMapping;
#else
                    psz = pszMapping;
#endif // UNICODE
                    SendMessage(pasi->hwndWebSites, LB_INSERTSTRING, (WPARAM)-1, (LPARAM)psz);
                    CoTaskMemFree(pszMapping);
                }
                pEnum->Release();
            }
        }

        if (pasi->pSec->fNoAddSites || pasi->pSec->fNoZoneMapEdit)
        {
            EnableDlgItem(hDlg, IDC_EDIT_ADD_SITE, FALSE);
            EnableDlgItem(hDlg, IDC_BUTTON_REMOVE, FALSE);
        }

        if (pasi->pSec->fNoZoneMapEdit)
        {
            EnableDlgItem(hDlg, IDC_CHECK_REQUIRE_SERVER_VERIFICATION, FALSE);
            EnableDlgItem(hDlg, IDS_STATIC_ADDSITE, FALSE);
        }

        SHAutoComplete(GetDlgItem(hDlg, IDC_EDIT_ADD_SITE), SHACF_DEFAULT);
    }

    else
        p


store bought! It's super easy and only takes 2 ingredients!", "regions": [{"bbox": [5.98, 2.91, 599.5, 396.55], "phrase": "Homemade Raw Organic Cream Cheese"}]}}
{"filename": "012378809.jpg", "height": 252, "width": 450, "grounding": {"caption": "naive : Heart graphics in a notebook background", "regions": [{"bbox": [93.8, 47.59, 126.19, 77.01], "phrase": "Heart graphics"}, {"bbox": [2.49, 1.44, 448.74, 251.1], "phrase": "a notebook background"}]}}
```
</details>

# Config

```
config/cfg_odvg.py                   # for backbone, batch size, LR, freeze layers, etc.
config/datasets_mixed_odvg.json      # support mixed dataset for both OD and VG
```

# Training

- **Datasets:** before starting the training, you need to modify the ``config/datasets_mixed_example.json`` according to [data_format.md](data_format.md).
- **Configs:** defaults to using coco_val2017 for evaluation.
    - If you are evaluating with your own test set, you need to convert the test data to coco format (not the ovdg format) and modify the config to set **use_coco_eval = False** (The COCO dataset has 80 classes used for training but 90 categories in total, so there is a built-in mapping in the code).
    - Also, add(or update) the **label_list** in the config with your own class names like **label_list=['dog', 'cat', 'person']**.

``` diff
- use_coco_eval = True
+ use_coco_eval = False
+ label_list=['dog', 'cat', 'person']
```
- **Train/Eval**:

```  bash
# train/eval on torch.distributed.launch:
bash train_dist.sh  ${GPU_NUM} ${CFG} ${DATASETS} ${OUTPUT_DIR}
bash test_dist.sh  ${GPU_NUM} ${CFG} ${DATASETS} ${OUTPUT_DIR}

# train/eval on slurm cluster：
bash train_slurm.sh  ${PARTITION} ${GPU_NUM} ${CFG} ${DATASETS} ${OUTPUT_DIR}
bash test_slurm.sh  ${PARTITION} ${GPU_NUM} ${CFG} ${DATASETS} ${OUTPUT_DIR}
# e.g.  check train_slurm.sh for more details
# bash train_slurm.sh v100_32g 32 config/cfg_odvg.py config/datasets_mixed_odvg.json ./logs
# bash train_slurm.sh v100_32g 8 config/cfg_coco.py config/datasets_od_example.json ./logs
```

# Results and Models

      Name
      Pretrain data
      Task
      mAP on COCO
      Ckpt
      Misc

      GroundingDINO-T
(offical)
      O365,GoldG,Cap4M
      zero-shot
      48.4
(zero-shot)
      model
       -

      GroundingDINO-T
(fine-tune


 1.401 1.088-3.093-1.496-5.593-4.256-5.192-2.025.291-3.401 1.88-3.328 3.791zm14.885-2.468c.38-.177.932-.552 1.12-.328.281.333-.615.629-1 .885-1.224.797-2.308 1.635-3.303 2.729-1.276 1.411-2.593 3.172-3.4 5.093.828.041 4.031.208 4.801 1.975.62 1.416-.516 2.875-1.76 3.5.885.552 2.411 1.26 2.328 2.531-.213 3.125-4.927 2.989-6.907.927-.323-.385-.473-.64-.333-.771.204-.177.437.251.901.636.303.249.505.333.765.473 1.735.912 4.448.537 4.636-1.057.083-.739-.885-1.276-1.625-1.604-.661-.301-2.016-.516-1.989-1.271.025-.74.697-.599 1.375-.864.735-.292 1.339-1.204 1.333-1.491-.005-1.208-2.744-1.181-4.292-1.229-.364.813-.629 1.636-.921 2.881-.188.776-.203 2.525-1 2.703-.979.219-1.349-.636-1.937-1.317-.792-.923-1.917-2.188-2.589-2.969-4.047 1.339-7.192 2.792-11.009 4.953-1.751.989-2.751 2.12-3.391 1.803-.532-.256-.453-.844-.199-1.183a92.125 92.125 0 001.86-2.516c.801-1.131 1.405-2.224 1.833-3.26.921-2.251 1.64-6.292 1.963-7.813.12-.547.417-.463.433-.197.036.563-.319 2.729-.385 3.177-.584 3.708-1.032 5.88-2.683 8.468 2.927-1.812 6.407-4.025 10.125-5.276C11.797 13.25 7.797 9.136 2.234 6.541c-.855-.484-2.235-.588-2.235-.916 0-.36 1.041-.079 1.391.011 3.177.796 6.421 2.853 8.803 4.593 2.859 2.088 6.285 5.287 7.572 6.776.875-.303 3.047-.609 4.928-.661 1-2.109 3.4-5.36 6.385-7.261.547-.348 1.119-.791 1.749-1.077zm-11.459 10.76c.568.573.991 1.245 1.485 1.865.228-.787.536-1.62.853-2.344-.823.109-1.708.271-2.339.479z"/></svg>';
  static const String arduino =
      '<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="32" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path fill="currentColor" d="M31.76 16c-.077-4.251-3.588-7.636-7.839-7.563-.391 0-.801.032-1.203.068-3.359.495-5.599 2.907-6.839 4.76-1.265-1.853-3.52-4.265-6.853-4.76a13.361 13.361 0 00-1.199-.068C3.578 8.374.078 11.754-.001 16c.079 4.245 3.579 7.625 7.828 7.563.401 0 .797-.032 1.224-.084 3.36-.479


/*
 * Copyright (C) 2008 Apple Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 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
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public License
 * along with this library; see the file COPYING.LIB.  If not, write to
 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef SVGGlyphMap_h
#define SVGGlyphMap_h

#if ENABLE(SVG_FONTS)
#include "SVGGlyphElement.h"

namespace WebCore {

struct GlyphMapNode;

typedef HashMap<UChar, RefPtr<GlyphMapNode> > GlyphMapLayer;

struct GlyphMapNode : public RefCounted<GlyphMapNode> {
private:
    GlyphMapNode() { }
public:
    static PassRefPtr<GlyphMapNode> create() { return adoptRef(new GlyphMapNode); }

    Vector<SVGGlyph> glyphs;

    GlyphMapLayer children;
};

class SVGGlyphMap {

public:
    SVGGlyphMap() : m_currentPriority(0) { }

    void add(const String& string, const SVGGlyph& glyph)
    {
        size_t len = string.length();
        GlyphMapLayer* currentLayer = &m_rootLayer;

        RefPtr<GlyphMapNode> node;
        for (size_t i = 0; i < len; ++i) {
            UChar curChar = string[i];
            node = currentLayer->get(curChar);
            if (!node) {
                node = GlyphMapNode::create();
                currentLayer->set(curChar, node);
            }
            currentLayer = &node->children;
        }

        if (node) {
            node->glyphs.append(glyph);
            node->glyphs.last().priority = m_currentPriority++;
            node->glyphs.last().unicodeStringLength = len;
            node->glyphs.last().isValid = true;
        }
    }

    static inline bool compareGlyphPriority(const SVGGlyph& first, const SVGGlyph& second)
    {
        return first.priority < second.priority;
    }

    void get(const String& string, Vector<SVGGlyph>& glyphs)
    {
        GlyphMapLayer* currentLayer = &m_rootLayer;

        for (size_t i = 0; i < string.length(); ++i) {
            UChar curChar = string[i];
            RefPtr<GlyphMapNode> node = currentLayer->get(curChar);
            if (!node)
                break;
            glyphs.append(node->glyphs);
            currentLayer = &node->children;
        }
        std::sort(glyphs.begin(), glyphs.end(), compareGlyphPriority);
    }

    void clear()
    {
        m_rootLayer.clear();
        m_currentPriority = 0;
    }

private:
    GlyphMapLayer m_rootLayer;
    int m_currentPriority;
};

}

#endif // ENABLE(SVG_FONTS)

#endif // SVGGlyphMap_h