query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8a1eb3cedd62ec918fcbc181edcb078b | b0a808b6e7673395fbb873e37c6d9ea0 | 离开客户端预备场地图回调 | if(typeof(data.error) != "undefined"){
alert("系统提示:" + data.error);
return;
}
radarPop(getClickObjectIndex());
changeMap('worldScreen_Layer');
} | 0 |
f6135d468168f142f329dd7f15c40df4 | 607fe61d4e600edb4ea0845118bcca81 | get a handle representing path relative to the content repository. | fun OrtResult.getRepositoryPath(provenance: RepositoryProvenance): String {
repository.nestedRepositories.forEach { (path, vcsInfo) ->
if (vcsInfo.type == provenance.vcsInfo.type
&& vcsInfo.url == provenance.vcsInfo.url
&& vcsInfo.revision == provenance.resolvedRevision
) {
... | 1 |
b8ac7b0a9c0b0ce092c62d9342d8352d | 007cc741a8b62bcb29ff03d842dd525f | 持久化 Intake | {
$result = array();
$data = array();
$data['inte_id'] = $this->input->post('inte_id');
$data['inte'] = $this->input->post('inte');
$data['resource'] = $this->input->post('resource');
$data['id_user'] = $this->input->post('id_user');
$data['user_identity'] = $... | 1 |
8b93e2b8534bfbc50245befec9a8c5bc | 0b46f1aad780bdb2dd8d95617101b67e | Make gear type non-editable. Necessary to avoid data corruption | {
PrimaryActorTick.bCanEverTick = false;
bReplicates = false;
bAlwaysRelevant = false;
bCanBeDamaged = false;
bCollideWhenPlacing = false;
bEditable = false;
bLockLocation = true;
bReplicateMovement = false;
SetActorEnableCollision(false);
} | 1 |
b47f6b1970761e36431e395ce46a8dc9 | 8e50d5ab6b808fe80a0a50e7f633541b | figure out who the other active teammates are | {
int team1, team2, unassigned;
edict_t *other;
char *p;
static char value[512];
int j;
team1 = 0;
team2 = 0;
unassigned = 0;
for (j = 1; j <= game.maxclients; j++)
{
other = &g_edicts[j];
if (!other->inuse)
continue;
if (!other->client)
continue;
if (other == ent)
continue;
strcpy(v... | 0 |
ab6e07849beab7ea408c143057e7c4c1 | d7afd554cbcacf69fda0918cc03269e0 | 调查申请选择按钮回调函数 | function btnChooseClick(){
if (isNoneChecked()) {
window.close()
window.opener.chooseQuestionCallBack(hashToArray());
}
} | 1 |
c5927a41c4d1703ea69d315776294802 | bfefae4327fd7918e66d5da73722f142 | Converts the character input to the column number for the Real FSM. Valid inputs are digits and ".". | local function charToNum(char)
if char == "." then return 0 end
local num = string.byte(char) - 48
if num > 9 then
num = num - 7
end
return num
end | 1 |
524eb124c7511b819902cbc335da8070 | 53e48c1019f2d760de31118d147ac463 | A callback function that is called when server shutdown has completed | class SpanningTree12(LineOnlyReceiver):
def callback_server_end(self):
pass | 1 |
a9003fcf7fdd18455633d1099c9b60a3 | 36738e71379b5c706ed21bbe8f10f60e | Returns true if the router is on, false if the router is off | boolean isOn(); | 1 |
ca1583e64e4f79990cc8551c942aeaec | bcb94f9ca6d6292e355b0cca8dbe0509 | 从数据库获取人员信息 | public class SPUtil
public StaffInfo getPeopleInfo() {
return gson.fromJson(getString(Global.Const.people), StaffInfo.class);
} | 0 |
18bbcaf350a46f5b05f56a3b5bdcd265 | 7e38d737eb67cdd94419c24338ff1e6a | assume that the name is a proper setter name and remove the prefix "set",
convert first letter to lower case (JavaBeans conventions) | if (name.startsWith("is")) {
name = name.substring(2);
} else if (name.startsWith("get") || name.startsWith("set")) {
name = name.substring(3);
} else {
throw new RuntimeException("Error parsing property name '" + name + "'. Didn't start with 'is', 'get' or '... | 1 |
d10f47324ed7cad0a4119ec222e51fa1 | 826b88961ebb1cd5696cd37c2fa76b9d | Fordert bestimmte Berechtigungen zur Laufzeit an | class GuruController extends Controller
public function behaviors()
{
return [
'access' => [
'class' => AccessControl::className(),
'only' => ['index', 'data', 'grafik'],
'rules' => [
['allow' => true,
'roles' =... | 1 |
28b9f803f86592a15e3a6faf7826118b | 09d3a8c06180c5585f63d433233cb081 | external push button B4 external interrupt handler | EXTINT_INTERRUPT_HANDLER(SIG_INTERRUPT4)
{
if(ExtIntFunc[EXTINT4])
ExtIntFunc[EXTINT4]();
} | 1 |
a81e2675449a354638e3a3e76b907dc2 | d27aa251f3a1c81c77c852435d8e29cc | Like filepath.Join, but only joins if the file has a relative path | if filepath.IsAbs(path) {
return path
}
baseDir := viper.GetString("base-dir")
if baseDir == "" {
homeDir, err := homedir.Dir()
if err != nil {
log.Fatal().Err(err).Msg("Could not determine a home directory")
}
baseDir = homeDir
}
return filepath.Join(baseDir, path)
} | 1 |
f092c4bcc795ce32944db8a3fc218c36 | f81eb909a995a547ed827457019639cb | Test round rectangle bounding box calculation | def test_rect_box(box_size, image_size, ratio, expected):
assert rect_box(box_size, image_size, ratio) == expected | 0 |
479572b9ee7389e249ccb0535e6721c2 | 03a541b9170aed7e4cddb1b4302f8974 | 以json格式返回指定扫描任务的数据 | JsonResponseModel<ExportScanTaskDetailsResponse> rsp = null;
String rspStr = "";
req.setSkipSign(false);
try {
Type type = new TypeToken<JsonResponseModel<ExportScanTaskDetailsResponse>>() {
}.getType();
rspStr = this.internalRequest(req, "... | 1 |
7db56858879f4d212cf33cc4dd958331 | 1d2518bb5817dbfebbb72eb9df83a6f4 | Checks to see if the object belongs to the current tenant | class ClientContext(ClientRuntimeContext):
def is_tenant(self):
return self.tenant_url == self.base_url | 1 |
e0116ac6ea8661962d8e6285ea31647e | c867268dc357cf4deac0c2357a3fecbd | Reset the VISA message queue of the instrument | class QDac2(VisaInstrument):
def clear(self) -> None:
self.visa_handle.clear() | 1 |
5ba71bb2ca340586d8a6c708ddf75b88 | c87ed0f70f4c53582a70bf1469aa06a4 | Returns True if the play is possible (no spaces or overlapping tiles)
and False otherwise. | class PuzzlePosition(DBBase):
def no_overlapping(self):
return len(duplicates(self.occupied_coordinates)) == 0 | 1 |
4bee6124dd1f2fd2edacaa859978a8a3 | 3c74039de684838ce073c6a41e0afc28 | Tests removing a Target item from the reference vector leaving an empty list. | class CampaignTargetServiceTestV201003(unittest.TestCase):
def testRemoveGeoTarget(self):
if self.__class__.campaign_id == '0':
self.testAddGeoTarget()
operations = [{
'operator': 'SET',
'operand': {
'type': 'GeoTargetList',
'campaignId': self.__class__.campaign_id,... | 1 |
34131c3ea47bdfc0b774427bc63e5600 | 0c96261895ea92aa4a95283fa8781120 | New retorna um novo Lancamento(*Lancamento) através dos parâmetros informados(id, cpfPessoa, data, numero, descricao). Função equivalente a criação de um Lancamento via literal &Lancamemto{ID: ..., ...}. Data de criação e modificação são definidos com o horário atual e o estado é definido como ativo | {
if(is_null($this->idLan))
$st_query = "INSERT INTO tb_lance
(
valorLan,
dataLan,
tb_transporte_idTransp,
tb_pessoa_idPes,
vencedorLan
)
VALUES
(
'$this->valorLan',
NOW(),
'$this->tb_transporte_idTransp',
'$this->tb_pessoa_id... | 0 |
0bc67dd4a9e487f85523e20e56698a31 | 9cef679feb79ddd6fbdaa0b01b50d709 | 获取对称加密器 | abstract class BaseWechat extends BaseObject
public function getMessageCrypter()
{
return new MessageCrypter($this->token, $this->encodingAESKey, $this->appId);
} | 1 |
dd57c6932fddda5ef56d38988b6ffafe | b9d9a87f3e660c661187bff0fb8c8fa2 | Register dependant holiday by providing concrete holiday and how many days this holiday is after
(positive number) or before (negative number) concrete holiday | SpecialDay createFrom(final HolidayItem holidayItem, final Subsidiary subsidiary); | 0 |
96e94d25e026600525d257aa1cb49556 | 732cc63bbf3c9e0563e0d9aca4728990 | Seed the XNAT test subject. | class TorchioTestCase(unittest.TestCase):
def setUp(self):
self.dir = Path(tempfile.gettempdir()) / os.urandom(24).hex()
self.dir.mkdir(exist_ok=True)
random.seed(42)
np.random.seed(42)
registration_matrix = np.array(
[
[1, 0, 0, 10],
[... | 0 |
69f722790c521a9ea89cb773bd9d9bcb | fbc3a03e3d7177d3a506b31bea227a40 | Start polling the blockchain for new directory blocks | class Adapter
def poll_changed_directories
until stopped
sleep(latency)
report_changes
end
end | 0 |
3eac34daf4b7ca7d995d2236b3befa32 | 754828fb2cdc3143a2a787cd3214324a | Returns initialized schema loader | {
if ($this->_schemaCollection !== null) {
return $this->_schemaCollection;
}
return $this->_schemaCollection = new MongoSchema($this->_driver);
} | 1 |
0cd5d8ac769a25090473a2bede34288f | 8da2c0b0a262591a1a67899805c8d3dc | オブジェクトが完全に消去された瞬間に呼ばれる | public class becameInvisible : MonoBehaviour
void OnBecameInvisible () {
Destroy (this.gameObject);
} | 0 |
e80f4e19a9c8d5fa44f9850d5a752d65 | 3806faa66e3746ed2c55bae5f3aae40d | Filter dash to camel case | class Database extends PDO
private function dasherize($method, $args, $name) {
$count = strlen($name);
$property = substr($method, $count);
$match = preg_match_all("/[A-Z]/", $property, $all);
$all = current($all);
for($i = 1; $i <= count($all)-1; $i++){
$property = str_replace($all[$i], '_'.$all[$i], $pr... | 0 |
42bd854774eaea0e03fbf004c7bd21dc | 2686d795c2f1b7d0f25034a590ccb39c | 다수건의 전자명세서 상태/요약 정보를 확인합니다.
- https://developers.popbill.com/reference/statement/dotnetcore/api/info#GetInfos | {
$CorpNum = '1234567890';
$itemCode = '121';
$MgtKey = '20230102-PHP7-002';
$UserID = 'testkorea';
try {
$result = $this->PopbillStatement->GetFiles($CorpNum, $itemCode, $MgtKey, $UserID);
} catch (PopbillException $pe) {
$code = $pe->getCode(... | 0 |
e8bc75315fba47798db032300ae0fc62 | 03415c275dfe4c3630753f16f355b0a0 | Creates the humidity table if it does not exist. | self.cursor.execute("use expert_system;")
sql = "CREATE TABLE IF NOT EXISTS watering( \
Internal_Code VARCHAR(8) PRIMARY KEY NOT NULL, \
Sprinkler_Density_W INT(10) NOT NULL, \
Sprinkler_Density_H INT(10) NOT NULL, \
Frequence VARCHAR(10) NOT NULL, \
Amount INT(5) NOT NULL, \
Electric_Bill_Year FL... | 0 |
cd7b8f0667b08feb684d61f4893f56c4 | 698938e0824630f1902e4804f2c7d508 | Notifies the agent that the user-side initialization is completed. | fn terminated(&mut self,
context: &mut Context,
terminated: Agent) {} | 0 |
d9b781c70e5865c5c9deb41101310bc4 | 1eb2639da5439874a71ccc71d989d72e | 将每个元素替换为右侧最大元素
思路:从数组尾部开始遍历,每次将上一次保存的最大值赋值给当前元素,如果当前元素大于最大值,则
更新最大值。 | var max int
var index int
var last int
for i := 0; i < len(arr)-1; i++ {
max = math.MinInt
index = -1
last = len(arr) - i - 1
for j := 0; j <= last; j++ {
if arr[j] > max {
max = arr[j]
index = j
}
}
if index != -1 {
arr[index], arr[last] = arr[last], arr[index]
}
}
} | 0 |
de5f4a5ba4ab0572020bbfc5cdb8e25a | a3dbbdfa3ff855cd781d7d5f007fae91 | Allows access only to Super Admin | class AdminUsersController extends Controller
public function __construct()
{
$this->middleware('user-roles:SuperAdmin,Admin,Moderator');
} | 0 |
7eba7a24371977356f4add421c5758b1 | bcfda29e27c5f80c3720ead07dceda09 | get the cross points of two circle. | void AlgebraicGeometry::Intersection_CC(Circle c1,Circle c2,Vector2d *p1,Vector2d *p2)
{
float A,B,C;
float theta1,theta2;
A = c1.Center.getX() - c2.Center.getX();
B = c1.Center.getY() - c2.Center.getY();
C = 0.5*(c2.Radius*c2.Radius - c1.Radius*c1.Radius - A*A - B*B)/c1.Radius;
_solve_equation.TrigonometricEquat... | 1 |
838a55e0e9a8d26241df61ad24c559f6 | 989bad95a0eb985fae1524d74d8e25a6 | 检索当前用户有没有暂存的公章外借申请 | global $_W;
$uniacid = $_W['uniacid'];
$exist = array_reverse(pdo_fetchall('SELECT * FROM '.tablename('xhbdz_deposit')." WHERE uniacid = $uniacid AND `state` != 1 AND `openid` = '$openid'"));
if (!empty($exist)) {
return $exist;
}
return false;
} | 1 |
d08c2257acddcfb2d67125a1c3d5de91 | e0df2ddccd2613b9a27169c0541acda7 | 判断颜色是亮色还是暗色 | def is_light(color):
return not is_dark(color) | 1 |
ddbd682124c0ce1b3db938faed657926 | bcb4019ccb531f5d883162e2fb1ac4c5 | 测试SQL语法错误,会抛出异常<br /> | TEST_F(MyTest, TestNo176) {
const string sql =
"SELECT * "
"ORDER BY .String "
"FROM TABLE1";
auto result = ExecuteSQL(sql, testOutputPath);
ASSERT_EQ((int)ERR_SQL_SYNTAX, result);
} | 1 |
f0ea309703d00f75752d367ab76882db | f4d2eedec2d220b53a7fd2fde65a2766 | Run a task on a background thread. This is best suited for I/O or
long-lived operations. | namespace SIL.FieldWorks.Common.FwUtils
object RunTask(bool fDisplayUi, Func<IThreadedProgress, object[], object> backgroundTask,
params object[] parameters); | 1 |
21fffd16bbd206836f00d442a36c9ee7 | aaa68123e607d575cfa323a5bfe4f2ee | Returns with the Primary Key of the Owner of the UM Event, CM Project or Case. | public function ownerKey(); | 1 |
8ae78dca6a55c2d07ab1e5f390e40fc3 | ee7bebeb8e647f1f0403db3b941e9430 | We dont need Versions in this context in my opinion, a tracking event is created once and never updated or altered | namespace ToDo.Infrastructure
public class MockApplicationMonitor : IApplicationMonitor
public void TrackEvent(string eventName, IDictionary<string, string> properties = null, IDictionary<string, double> metrics = null)
{
} | 0 |
71d5e3a227d16d46afd52c11923ffd1a | d4b895f73b3d0b07ec93fb7bb58a8a80 | move image order up | function galleryup( idselect ) {
var gelem = document.getElementById(idselect+'_gal');
var sidx= gelem.selectedIndex;
var nidx = gelem.options.length;
if ((sidx>0)) {
var auxvalue = gelem.options[sidx-1].value;
var auxtext = gelem.options[sidx-1].text;
gelem.options[sidx-1].value = gelem.options[sidx].... | 1 |
cbcb79daaeb1be28ea21d885970d853d | 2f0fc6283bb04976e6129c74be3b5d65 | Check if the sender requested a body integrity check | class ApplicationGatewayWebApplicationFirewallConfigurationResponse(dict):
def request_body_check(self) -> Optional[bool]:
return pulumi.get(self, "request_body_check") | 1 |
fa6a54aa1c19b83d1c498c4198881819 | ec59cc690d3a204c9cdf59aa8bf8f212 | Returns a string representation of the Graph.
Returns:
The string representation of the Graph's vertices dict. | class UndirectedGraph:
def __str__(self):
out = [f'{v}: {self.adj_list[v]}' for v in self.adj_list]
out = '\n '.join(out)
if len(out) < 70:
out = out.replace('\n ', ', ')
return f'GRAPH: {{{out}}}'
return f'GRAPH: {{\n {out}}}' | 1 |
6f4384767eb9357db36f1fb78cfc9278 | 6340be2eac0f7e25f3f08bcd02c425e2 | 关闭服务编辑 | class APSControl(PublicControl):
def close_edit(self):
try:
self.driver.implicitly_wait(10)
element = self.driver.find_element_by_id("closeedit")
element.click()
self.driver.implicitly_wait(10)
time.sleep(3)
except Exception as e:
r... | 1 |
e3423c4d7e1f250b83f442b5a3bb29b4 | 3385503fa30f989c88bd1cf477f50c46 | set the random parameters for bird's up/down random movement | {
while (1)
{
m_fXVel = (float)(rand() % 4);
m_fYVel = (float)(rand() % 5);
if( m_fXVel >= 2.0)
if( m_fYVel >= 3.0)
break;
}
if ((rand() % 2) == 0)
m_fXVel = m_fXVel * -1;
} | 1 |
215afaaac4b83c70e00741f6947d0634 | 6d9b68ee2bdcfd01612cbc3fad8f9cc6 | Starts the option screen before starting application.
Different options include the name used, minimum/maximum limit, and wrong amount before game over.
Default options are given for these choices, and includes start/quit buttons as well. | class MultiplicationApp(Multiplication):
def start_screen(self):
self.timer = self.IDLE_TIME
self._canvas = tkinter.Canvas(self.MASTER)
self._canvas.grid()
self._top_level()
self.reset_counter()
self.reset_streak()
_welcome = tkinter.Label(self._canvas, text='We... | 1 |
f669d6ad519171cbe4bc957333510709 | a3288598d82036b3dd6ceab2e5cbd61f | tag::display[] | for (i in 1..100) {
val output = if (i % 15 == 0) {
"FizzBuzz"
} else if (i % 5 == 0) {
"Buzz"
} else if (i % 3 == 0) {
"Fizz"
} else {
"$i"
}
print(output + if (i == 100) "\n" else ", ")
}
} | 0 |
0b799628e8de8373316245358bf1ead2 | e48a7fd32f871be568fd5867cc9d0899 | 回到均分四宫格状态 | for(var i=0;i<4;i++){
for(var j=0;j<4;j++){
var gridCell=$("#grid-cell"+"-"+i+"-"+j);
gridCell.css("top",getPosTop(i));
gridCell.css("left",getPosLeft(j));
}
}
for(var i=0;i<4;i++){
nums[i]=new Array();
hasConflivted[i]=Array();
for(var j=0;j<4;j++){
nums[i][j]=0;
hasConflivted[i][j]=false;
... | 1 |
bcd5753a2ae67a86a85b5f6730c57e6d | d29c7d77ad7933891086354510874040 | To delete the vpls instance by using the vplsname and id. | vips = json.loads(self.get_argument("vips"))
cfg_push = self.get_argument("cfg_push", True)
status = vip.delete(name, vips)
ret = _self_write(status, name, "vip", "delet", cfg_push)
self.write(json.dumps(ret)) | 0 |
f95d373529dd66aff0e6342dc7e3d08f | 9383e81d08a253230c39d3a58fec6816 | Get the parameters we want to re-load when reloading this RT model. | class AROW(OnlineLearningModel):
def get_params(self, deep=True):
params = super().get_params()
params['r'] = self._r
return params | 1 |
c3b5a9f9b3a07dab31405a1be6ad5bfd | cf4f88bb38df33f729f74cbefeb18608 | Mocks a component | class SkillComponentTestCase(TestCase):
def setUp(self):
class TestComponent(SkillComponent):
def parse_module(self, *args):
pass
def setup(self, *args):
pass
def teardown(self, *args):
pass
self.TestComponent = TestComp... | 1 |
ded3584dea58c56109207a7966fd0488 | 6cf2c41fd8b111d8497b0119e967a67d | 특정 사용자로부터 다른 사용자까지의 모든 최단 경로를 포함하는 dict | visited = {}
queue = Queue()
queue.enqueue([user_id])
while queue.size() > 0:
cur_path = queue.dequeue()
node = cur_path[-1]
if node not in visited:
visited[node] = cur_path
friends = self.friendships[node]
... | 0 |
883b7801fc6329595ebb683aba1233e2 | 3d0a601dd608497f127c175d91d619fa | (作者:GZZ)表格隔行变色方法 | function changeColor() {
var myTable = getClass("dataTable");
for(var i = 0; i < myTable.length; i++) {
var myTr = myTable[i].getElementsByTagName("tr");
for(var j = 0; j < myTr.length; j += 2){
addClass(myTr[j], 'changeBgcolor')
}
}
} | 1 |
2f886499c09e0284ed15909b69fbf111 | 22999f1286548862eea68f5772befcf6 | 双链表逆序 | if (L->next == NULL) {
printf("LinkList is NULL");
}
if (L->next->next == NULL) {
return;
}
LinkNode *cur = L->next, *pre = NULL, *n = L->next->next;
L->next = NULL;
while (n != NULL) {
cur->next = pre;
pre = cur;
cur = n;
n = n->next;
}
cur->next = pre;
L->next = cur;
} | 0 |
9f08f7182d7c1b103fc696990fed26c6 | 14088a6e31c170be4244c4e2e82f6e76 | 计算灰度最大最小值 | {
int histogram[256];
GetHistogram(image, histogram);
for (int i=0;i<=255;++i)
{
if (histogram[i] != 0)
{
minValue=i;
break;
}
}
for (int i=255;i>=0;--i)
{
if (histogram[i] != 0)
{
maxValue=i;
break;
}
}
} | 1 |
631ea18042cb9f0152fc16408809889a | 9208e8628a53778f2fdd45ddec98b400 | 该时间内未评论将自动评论 | {
$data = $this->dataExist($item_id, $type, 'user_id');
if (!$data) {
Ajax::outError(Ajax::ERROR_DATA_NOT_EXISTS);
}
$count = SocialComment::dataCount('user_id=' . $uid . ' and created>=' . strtotime('-1 hour') . ' and type="' . $type . '" and item_id=' . $item_id);
... | 0 |
cfd636f9e907b0879a24e3ef33529642 | 9b181716957e5e976040931107d64753 | Makes URLs safe, maintaining queries. | scheme, netloc, path, qs, anchor = urllib.parse.urlsplit(s)
path = urllib.parse.quote(path, '/%')
qs = urllib.parse.quote_plus(qs, ':&%=')
return urllib.parse.urlunsplit((scheme, netloc, path, qs, anchor)) | 1 |
9c29e7312bc70d83d1e0f40b6e79c566 | 97da4ddc40706878523ba1cab180e18b | Moves "Add to Cart" button over the thumbnail in loop | function woocommerce_remove_loop_button(){
remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
} | 0 |
55b680a9bee2c1c3f9ca9064946be860 | f4ba228a2fac5db24aaa6c2152f41310 | Initialize a flash IAP device
Should be called once per lifetime of the object. | serial = device_flash_info.device_serial_number
self._serial = str(serial).strip()
soc_serial = device_flash_info.device_soc_serial_number
self._soc_serial = str(soc_serial).strip()
self._switch_device_state_fct = device_flash_info.change_device_state_fct | 0 |
5422de8c77f806d7751abbc7088e0653 | 100ac459be519103d15a7662d30ed3c0 | Playing sound with a "mixed" oscillator synth | const envelope = duration >= 0.5 ? adsr(0.005, 0.495, 0, 0)
: adsr(0.005, duration - 0.005, 0, 0);
const freqs = list(67, 71, 79, 83, 89);
const sounds = map(freq => envelope(sine_sound(3 * freq, duration)), freqs);
return simultaneously(sounds);
} | 1 |
287f2fc82109278de6a0b3bc7380a35d | 0b1b2e9f4e6bcb8b01072e181dca48f2 | Returns the damage dealt overall | namespace NWN.FinalFantasy.Core.NWScript
public partial class NWScript
public static int GetTotalDamageDealt()
{
Internal.NativeFunctions.CallBuiltIn(345);
return Internal.NativeFunctions.StackPopInteger();
} | 1 |
f841d98186d933dd6462e47f6d77a8a5 | b1e9f7af44ee7a6c1d9110b8dd5f4f48 | Gets the allocated capacity in a float-percentage format. | class OUSpreadModelOutput:
def alloc_a_pct(self):
return self.m_opt_alloc | 1 |
4111f0db33389eb2e642130b94ebc985 | 4aef1c1b4d75078f9b091478bdf54251 | Choose one of the given generators with the weighted random distribution.
The input list must be non-empty. | def selection(weighted_gen):
max = sum(weighted_gen.values())
pick = random.uniform(0, max)
current = 0
for key, value in weighted_gen.items():
current += value
if current > pick:
return key | 1 |
79948391ca8b096a9bff438a8e2dc81b | e89c359ba11ede4f485ae24bf6157ccf | ########################Prediction using Decision Tree############################################### | def dtree(training_set, testing_set):
prediction = list()
tree = build_tree.build_DecisionTree(MAX_DEPTH, EPS, training_set, ENABLE_GAIN)
size = tree.get_tree_size()
max_depth = tree.get_tree_depth()
first_feature_index = tree.get_root().get_attriIndex()
first_feature = training_set.schema.features[first_feature_... | 1 |
0c50be3453f8d331c9c30fda469ecd04 | cb5a214b895e2759217294cbb1550c14 | Questo metodo restituisce il <i>figlio sinistro</i> del <i>nodo
sintattico</i>.
<i>figlio sinistro</i> del <i>nodo sintattico</i>. | public class NodeSI
public NodeSI getLeftNode() {
return leftNode;
} | 1 |
32fc918509324a79824bce5a38b57c66 | 51ddb0d222b1d707d8a84592b3c00e60 | 重组直播URL,添加渠道码 | String updateLiveChannelUrl ="https://wintv.ottcom.cn/api/updateLiveChannel.aspx";
Map<String,String> map=new HashMap<>();
String timestamp = getTimestamp();
if(StringUtils.isEmpty(timestamp)){
return false;
}
map.put("timestamp",timestamp);
map.put("tok... | 0 |
5bc318ba39cea8df98842abea28910c2 | f20ee9dc137c2146cb3a89815c1d509a | Test case for packagesV1IdGet
. | class PackagesApiTest extends \PHPUnit_Framework_TestCase
public function testPackagesV1IdGet()
{
} | 1 |
6f24dd6e286a6cfbad913ab573b65410 | 9476e5adb403e23fb3e3e361a840e2c6 | https://docs.kucoin.com/#get-market-list | let txt = http_get("https://apiv2.bitz.com/V2/Market/symbolList", None)?;
let resp = serde_json::from_str::<Response>(&txt)?;
if resp.status != 200 {
Err(Error(txt))
} else {
let markets = resp
.data
.values()
.cloned()
.filter(|x| x.status... | 0 |
d4d64fef65425956f502ce39a3a9915d | 4c0afb99f7c2f853152ce841335daa6d | Creates a resource data selector model generator. | function createSelectors<IResource extends IBaseResource>(mountPoint: string) {
const getLocalState = (state: any): IState<IResource> => state[mountPoint]
return {
findById(state: any, id: number | string) {
return getLocalState(state).records[id] || null
},
findByCid(state: any, cid: number | str... | 1 |
f17f506e9db8acb8254b122852bb6b7c | fe6d0220e96daebf656ab11b72af4997 | 最少数量货物装箱 | func MultiplePack(CW [][]int, V int) int {
N := len(CW)
dp := make([]int, V+1)
for i := 1; i <= N; i++ {
C, W, cnt := CW[i-1][0], CW[i-1][1], CW[i-1][2]
for j := V; j >= 1; j-- {
for c := 1; c <= cnt; c++ {
if j-C*c >= 0 {
dp[j] = max(dp[j], dp[j-C*c]+W*c)
} else {
break
}
}
}
}
r... | 0 |
2d7f916783ca8d050c7b9f1f8acd3a07 | cd941d777b2ab9bba8085c32b809b87a | This will get the file in which the destination is located. | public final class HippoFile
public File getDestination() {
return destination;
} | 0 |
96474925ba6ad45e749ffed4b39e96a3 | a1ac5fe2ebd4f58ade98b2df986a481c | Provides access to the Running Changed event type | export class categoryBase extends DataRecord{
get iChanged(): LatteEvent{
if(!this._iChanged){ this._iChanged = new LatteEvent(this); }
return this._iChanged;
} | 1 |
a599bc74c71c46480d4f0baf4c362636 | c5366960e66ef22b86f8f2601c0b23a6 | 不在者投票の用紙及び封筒を返還して投票した者情報の氏名リストを返します。 | public class NippoSakuseiValidator
public IValidationMessages validate投票者一覧表() {
IValidationMessages messages = ValidationMessagesFactory.createInstance();
messages.add(ValidateChain.validateStart(div)
.ifNot(NippoSakuseiSpec.不在者投票者の交付日開始チェック)
.thenAdd(NippoSakuseiValidat... | 0 |
3fca5d1d644a0e8b084b4f0442cae3b7 | 36f426098b26c2e8731b50dea1fb6c1b | 查询完成交易订单列表分页查询 | List<TransactionForOrder> queryTansactionForList(
@Param("map") Map<String, Object> map); | 0 |
469a187670caca423e33751176f8bbb6 | cef8d52437882c11772bfcbdba89ac96 | 返回图示字符对应的StoneColor. 返回null如果没有对应的StoneColor. | public function get($stoneName); | 0 |
4e86792c789410cc8439d436bfba5850 | c54b960b7a73693edfacdd059ee85ce1 | insere na lista por ordem alfabética | {
ListaSimples *novoNo, *aux, *aux2;
if(*lista == NULL) return;
else
{
aux = *lista;
*nova = (ListaSimples*)malloc(sizeof(ListaSimples));
(*nova)->carac = aux->carac;
(*nova)->freq = aux->freq;
(*nova)->no = aux->no;
(*nova)->prox = NULL;
if(aux->prox != NULL)
aux = aux->prox;
else return;
wh... | 1 |
b8d7a789e78d3cdf7654732a11c0e031 | b4de4bbf2f553a29e0b5418673052a63 | Retrieves the new value for the feature to update.
This value can be <code>null</code> if the {@link Diagram}'s feature allows it. | V getNewValue(); | 1 |
392e4840e060ea37ab6ccea15606168a | fad0edf850ef2eafedad5c98b1ad9f03 | Check if the talk page has comments above the first heading, in the lede section. | function should_load_up_the_comments_template() {
return comments_open() || get_comments_number() >= 1;
} | 0 |
c7168dc665055e29247753dd683629ff | 0b252bb6d9f45efd0246fa0485acfff9 | 通过文件名 从当前目录下载到指定路径 | File file = new File(filePath);
if (!file.exists()){
throw new IOException("Can not find the file");
}
if (!file.canRead()){
throw new IOException("The file is not readable");
}
if (fileName == null || fileName.equals("")){
fileName = file.getName();
}
downloadInputStream(new FileInputStream(fi... | 0 |
3f3facff8944e163ed6e78c3864fb061 | 2c7f5028c76006a30de10b969dbdc365 | 查询学院表的id 用于多表关联导入数据 | List<Long> findAllCollegeId(); | 1 |
d230ae99a862ac045878c55f076c5fbb | ffd7c9520ae98ccc3a94fea2de22395b | Observe and clear the dead functions | static void PruneFunctions( void )
{
TREEPTR tree;
SYM_ENTRY sym;
int marked;
marked = 0;
for( tree = FirstStmt; tree != NULL; tree = tree->left ) {
if( tree->right->op.opr == OPR_FUNCTION ) {
SymGet( &sym, tree->right->op.func.sym_handle );
if( sym.stg_... | 1 |
4e5d2dddaa22fd5a7124bf9279fee9c5 | 5e679a7098556ef52d6343d163aad684 | Check if request is to explain rather than execute the query. | class Statement extends \PDOStatement
public function execute($input_parameters = null): bool
{
if (
!is_null($input_parameters) &&
(
is_array($input_parameters) &&
!empty($input_parameters)
)
) {
$this->inputParams = ... | 1 |
efea5a0f3cc3c0c1d06727b90fc6df4a | a19d4b983d624df9e01dce0c55747a0f | naar rechts lopen | void moveEast() {
ecrobot_status_monitor("Function: moveEast");
currentCoord[0] = currentCoord[0] + 1;
drehung(1);
} | 1 |
653771a8cc1ef7de6c178e7f56b5c39b | fde6dabdc3e428f4d968b1d9334eec04 | convert types strings to user friendly type names | class cl_install(color_print, SignalInterrupt):
def convertTypeToScheme(self,data):
if type(data) == tuple:
diskScheme, driveType = data
else:
diskScheme, driveType = data,""
res = ""
if diskScheme.endswith("raid-lvm"):
return _("LVM on RAID")
... | 1 |
4e782e6aed90ccb14320bfcf51593fdd | 4b6ef17aad1a4083ff7cec0d6bb9601e | Add borders to detected face | namespace Vision
class FaceDetector
public Mat addFaceRectToMat(Mat mat, List<Rectangle> faceRects)
{
{
using (Graphics g=Graphics.FromImage(mat.Bitmap))
foreach (Rectangle faceRect in faceRects)
{
g.DrawRectangle(ne... | 1 |
7fd2d0fa7b88f8184630c8f6139673b8 | e7432f70a674946673a933748271c21d | Verifica se um ponto é interno a um circulo | class Delaunay:
def dentroCirculo(self, tri, p):
centro, raio = self.circulos[tri]
return numpy.sum(numpy.square(centro - p)) <= raio | 1 |
c2bde75729eb7ae4178172ba49724672 | 1f41940ad43cce528bdb099fab66d246 | One way of causing STDIN to be unbuffered | class LinuxCampaign(CampaignBase):
def _set_unbuffered_stdout(self):
logger.debug('set unbuffered stdout')
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | 0 |
eb3c6bc13aabd708749a466ec795accd | 7ed7a70ec5cda0510fe885cad9dfe6ca | VDP set letter box detection on/off (for module test) | {
int ret = RET_OK;
#ifdef USE_KDRV_CODES_FOR_L8
BOOLEAN on_off;
on_off = *pstParam;
if (on_off)
{
REG_WD(&gVportRegBx->cvbsafe_001, 0x01311000);
}
else
{
REG_WD(&gVportRegBx->cvbsafe_001, 0x00300000);
}
#endif
return ret;
} | 1 |
879412546245918c8cd6b4e3f6a661f8 | 5dc08cddb52ac39c6860399dafb3f986 | Shows a dialog that lets the user pick either a | class DetailEditImageSetter(
private val activity: FragmentActivity,
private val editViewModel: EditViewModel,
private var resetController: (Uri) -> Unit,
) : DefaultLifecycleObserver
fun selectImage() {
val items = arrayOf("画像を選択", "撮影する")
AlertDialog.Builder(activity)
.setItems... | 1 |
bc927cb8b3da0ccd787b11dd036c3f25 | 20fbdb3c9575402941d4e1e2533a3b67 | Adjust this display options according to the hint settings. | Configuration configuration = sketch.getConfiguration();
ImageSizeCalculator imageSizeCalculator = sketch.getConfiguration().getImageSizeCalculator();
if (displayOptions.isResizeByFixedSize()) {
FixedSize fixedSize = viewInfo.getFixedSize();
if (fixedSize != null) {
... | 1 |
e899d871ca5128faff38a015f35f7076 | 104e813a46112c7acd4553ca504077f7 | Description : Reads data from memory where load images are stored
Arguments : rx_address -
Where to read from in memory
rx_buffer -
Where to place read data
rx_bytes -
How many bytes to read
Return value : none | u_short A8L_SetCDCRxMemory(u_int rxBufAddr, u_int rxBufAddrSize)
{
u_short retVal;
glCDCRxMemory = rxBufAddr;
glCDCRxMemorySize = rxBufAddrSize;
SetA8RegW(0x6540, (u_short) rxBufAddr);
SetA8RegW(0x6542, (u_short) (rxBufAddr >> 16));
retVal = SendA8Cmd(CDC_RX_BUFFER_ADDR | A8_HOST_CMD_CDC_MEMORY); ... | 0 |
6b762bc0b02fc9a7083fa1d3305d30a3 | ba0a1f238c28806572264a3dc18eca06 | Получение форума и прав с точки зрения поста (создания сообщения) | {
$row = DB::query_fetch_array("SELECT id, name, user_id, created, date_update, cat_id, close FROM {forum} WHERE id=%d AND act='1' AND trash='0' LIMIT 1", $this->diafan->_route->show);
if (empty($row))
{
Custom::inc('includes/404.php');
}
$cat = DB::query_fetch_array("SELECT name FROM {forum_category} WHE... | 0 |
8b44786920f08caa7dea84c17f7a9838 | 8a6e710ae811cc7c83ee819fd204c68f | (re)populate the scene-object collection with scene objects that represent the current parameters | {
for (unsigned int i = 0; i < m_newSceneObjects.size(); i++)
{
m_sceneObjects.push_back(m_newSceneObjects[i]);
}
m_newSceneObjects.clear();
} | 1 |
aae08a9197a27df3153b182182a51774 | bb6cf01cf4baf2e82579c31626166388 | Returns the earliest start time (in unix epoch milliseconds) in the given
itineraries. | {
var minValue = DateTime.MaxValue;
for (int i = startIndex; i <= endIndex; i++)
if (passes[i].Time < minValue)
minValue = passes[i].Time;
return minValue;
} | 0 |
7fc1ce97ebefec290631d94202f2a9b8 | 24bf21a0882d6ab0174d17e7e3a08455 | Methods and Blocks | function Blocks() {
this._methods = {};
this.lib = {};
} | 1 |
1a7cf560bc7d1cfb6856b0519822478f | 23217a0354df2233a26ac53d6c95da01 | Set an EventHandler that is called when the WebSocket connection's readyState changes to OPEN; | export class AppRTU
public static set onOpen(func: (event: Event) => void) {
this._onOpen = func;
} | 1 |
40d27dff26807885cf9139e3331a4b6e | 1c7e491f33157d92e9090d19510683ac | This method sets the PID controlled relative drive targets. | public class Drive extends Subsystem
public void setTargetVelocity(double targetVel) {
this.leftVelPID.setDesiredValue(targetVel);
this.rightVelPID.setDesiredValue(targetVel);
} | 1 |
ab5628d6a00921df6ad6723aaeb48699 | 529c4b6a8e539b053e80801eb58b3387 | Returns message with the options that the
user has chosen | class MultiChoiceCtrl(wx.Panel, phil_controls.PhilCtrl):
def GetStringValue(self):
values = []
for choice in self._option_names :
box = self._option_controls[choice]
if (box.GetValue() == True):
values.append("*" + choice)
else :
values.append(choice)
return " ".join(values... | 1 |
e3ccb8b68f30c2f4aadd15ecf789c9d9 | 3eb42785e70ef7252f75350d176893b3 | Tests that the stream transaction gets aborted successfully. | txn = self.createTransaction()
results = self.resultOf(txn.execSQL("maybe change something!"))
[[[_ignore_counter, echo]]] = results
self.assertEquals("maybe change something!", echo)
self.factory.rollbackFail = True
[x] = self.resultOf(txn.abort())
self.assertIde... | 1 |
bd2db29c8fdcbbb22379ade272b84be4 | 654f69b3a0c9a1bcf3ded77b579be37e | Gets the currency code for the price update. | @DoNotClassMerge
public class ProductPriceUpdatePageAnnotation extends PageAnnotation
public String getCurrencyCode() {
return mCurrencyCode;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.