query_id
string
corpus_id
string
query
string
code
string
label
int64
5b2242ecaed1d989c489de326c248692
bffb7da25fafc4cf94d3abd17ab2107c
Checks to ensure every parsed field can successfully be parsed.
namespace Google.ProtocolBuffers internal class ReflectionTester public void AssertAllFieldsSetViaReflection(IMessage message) { Assert.IsTrue(message.HasField(f("optional_int32"))); Assert.IsTrue(message.HasField(f("optional_int64"))); Assert.IsTrue(message.HasField(f("o...
1
46f025f867bcbcc3de2bfdc654d9f2d0
8ddfd5f180177e0e898cd9fb3b1fe7b2
修改用户和组织的绑定关系
namespace SH3H.WAP.Auth.DataAccess.Repo.Contact bool UpdateOrganizationUserRelation(UpdateUserOrganizationRelationModel model);
1
f522894b671ea0acf8fa83b770446e59
b55b9d1352d2b26730cf1fb62add320f
Perform ret instruction.
fn reti(cpu: &mut Cpu) { let addr = cpu.pop_word(); cpu.load_pc(addr); cpu.enable_interrupts(); }
1
64e6cb5cc2058149c9336682f3ce40be
eff27d2d4e707ec2ce949c5b540848a5
Crea el panel que contendrá la imagen de la huella digital
var view = Ti.UI.createView({ backgroundColor : 'yellow', visible : false }); var label = Ti.UI.createLabel({ color : '#FFFFFF', font : { fontSize : 23 }, text : 'VISTA IMPRIMIR' }); view.add(label); return view; }
0
c25fc0c27481bde2670599845bdfa202
b8df09e92e7a66bc94e24f7de4ee716a
Returns whether Available badges section should be shown in Home Page
let objectAsAny = this.object as any; if (hasValue(objectAsAny.indexableObject)) { objectAsAny = objectAsAny.indexableObject; } const objectExists = hasValue(objectAsAny); this.privateBadge = objectExists && hasValue(objectAsAny.isDiscoverable) && !objectAsAny.isDiscoverable; this.withdraw...
0
560b26b38559eec220bab0a110971021
f6189b4499fa0562f875465d08a427a2
获取指定目录ID的护理信息列表
GetNursingCareList() { return getNursingCareList(); }
0
cd47f7f61d6449baee7207d2377a0718
61ac2254090af9315aa188ab8d57733a
Returns training set, training labels, validation set, validation labels
class DataSet: def get_training_set(self): return list(self.get_paths()), \ np.asarray(self.class_numbers), \ one_hot_encoded(class_numbers=self.class_numbers, num_classes=self.num_classes)
0
09712321e3f7536e087ba37364ce7c11
19d5c1172abd1ea5ac045f5d736e4759
演示如何监测子进程的状态(在linux上执行)
int main(void) { int ret ; if(fork()==0) { if((ret=execlp("ps","ps","-ef",NULL)<0)) perror("execlp error\n"); } }
0
5cff8dc16e37d1dc2ba7d810d47af5d6
7d2a0d45c7a9aead2b59598770240833
Color of major horizontal division labels. Set color of major horizontal divisions labels.
return unless ptrue?(val) attributes = ['val', val] @writer.empty_tag('c:majorTickMark', attributes) end
0
64437631421975a99fba6041bb8d7171
91702f11298440506c21e43becb220b6
Sets the angle of incidence for aerial imagery (available for SATELLITE and HYBR ID map types) measured in degrees from the viewport plane to the map plane. The only supported values are 0, indicating no angle of incidence (no tilt), and 45 indicating a tilt of 45deg;.
export default class MapView extends ObjectManager async setSlopeAngle(slopeAngle: number, animated: boolean): Promise<void> { let methodName = "setSlopeAngle" let paramsTypeStr = [this.FLOAT, this.BOOLEAN]; let paramsStr = [slopeAngle, animated]; await this.invokeByParam(methodName, paramsTypeStr, para...
1
ce63c16511cb6b695b679eb4dfd0d15f
b0e0544f4f602b649f30d7878ee559f2
Test bounds() when the schematic is all negative coordinates
public class EdgeTests extends TestCase public void testSetBounds_NegativeHeight() { try { edge.setBounds(0, 0, 500, -500); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException iae) { } }
0
f7cb9f94fc73f9bade00dd350fffde38
614d1d583e5a3a3dc78e14a105d8792a
Returns true if the square has an Ant that blocks the bees from moving through
export class GridManagerService public isBlocking(row: number, col: number): boolean { return !!this._grid[row][col][2]; }
1
1ba50ded3fb063fa531a7e97c6de42b1
d06e9fc78d578fee30a38392a65b938b
向服务器中发送此次获取到的城市数据信息 并返回服务器返回的响应信息
public class RetrofitHelper public GetCityMsgService postGetCityMsg() { return mRetrofit.create(GetCityMsgService.class); }
0
15e8ecad84cfafce4e554b33b521b725
f0d0d1dbc20cc00fbd2478463cc3b4b7
获取guzzle基本请求选项数组
class ClientBuilder private function getGuzzleOptions() { return [ 'timeout' => $this->timeout, 'connect_timeout' => $this->connectionTimeout, 'exceptions' => false, ]; }
1
b7be451e99ec2fa08445b7a981e4e889
4260e54209f229cf3fb6cfa11806dfaa
@brief 获取指定原始偏移量(bit为单位)处指定宽度的数据
namespace HOTINST.COMMON.Bitwise public static class ByteArrayHelper public static bool GetValue(byte[] buffer, uint byteOffset, uint bitOffset, uint bitWidth, out int returnValue, Endian ed = Endian.LittleEndian) { uint rawValue = 0; bool ret = GetValue(buff...
1
47f00c5c568573594dc6c68ff8ef4e8f
8b49ac46d466b87741bd74eca6065095
根据关键字搜索</br> 搜索订单编号、服务地址、服务人员、服务人员电话、客户电话等字段内容</br>
public String searchOrders(OrderInfoRequest request);
1
6073f0b501b7fd566eafc045bdf3a9e6
c02958310e82dd67475431a7aeef990e
当该脚本被加载或检视面板的值被修改时,此函数被调用(仅在编辑器被调用)。
[ExecuteInEditMode] public class KinematicChain : MonoBehaviour void OnValidate() { }
1
e048354c7df1e5303d6b89302c5b268f
66b4f3f426ede9f47918cdbfa681abf6
Task to verify PR bucket overflow to disk.
size_mb = 5 body = os.urandom(_SIZE_1_MB * size_mb) resp = requests.put( server_base_url + 'bucket/drops', data=body, timeout=_REQUEST_TIMEOUT ) assert resp.status_code == 200 assert resp.json().get('drops') > size_mb assert resp.json().get('sha1') == ...
1
9b5584fd9b426524ccd639cd4692014a
a9d69a9199e17f9969fa860293324ed4
Read a configuration file which is assumed to contain source/destination mappings.
class ForwardConfig(Config): def __init__(self, fname): Config.__init__(self, fname)
0
0cdaf5c0b449359798332b80f486aa05
e51df530a20daf33d239f0c4fb735864
Make participant in the group an administrator
void Account::promoteToGroupAdmin() { this->setIsCurrentGuest(true); this->setIsPastGuest(false); this->setIsGroupAdmin(true); }
1
5005bdad203d5ab695b0211df34b4713
761bb229a58188b5e5f06d70a52bfc1f
Sets what reconciling rules to use after annotation has been performed
{ $builder->add('markForReconcile', CheckboxType::class, [ 'required' => false, 'label' => 'Yes', 'label_attr' => [ 'class' => 'mt-checkbox mt-checkbox-outline' ] ]); $builder->add('reconciliationDate', DateType::class, [ ...
0
3f222673b02c0f981a347bb6e56357c1
348a6dfde5e5689eec49e0f955b19ef2
Returns a boolean that indicates if a certain string contains ' or \.
public class Parse private boolean checkIfHasDot (String term){ return term.contains("."); }
0
7633dd500f4676e6bd27f26254ddcfd0
bbef59e6dc16046705b4f9dd702cc0f5
Lấy level đối với giao diện hiển thị địa chỉ doanh nghiệp
def get_admlevel(item): lvl = '5' if 'Village/Desa/Kel:' in item: lvl = "4" elif 'Subdistrict/Kec:' in item: lvl = "3" elif 'City/Kota/Kab:' in item: lvl = "2" elif 'Province:' in item: lvl = "1" elif 'Country:' in item: lvl = "0" return lvl
1
1b83b599116f34f12961d41b1f16a634
0002a12d5f9b1b762711c21605da2aa1
Finishes the packing. Use this operation to flush the data, close used streams, etc
class DataPack: def close(self): self._wrapper.close()
1
ddb49f37d97af444f5d7686efcfb5a66
f9744d195bbe623ea580c29229d3c0d1
格式化单品信息,检查单品是否允许下单
{ return [ 'address_id' => ['required',Rule::exists('user_addresses','id')->where('user_id',$this->user()->id)], 'items' => ['required','array'], 'items.*.sku_id' => [ 'required', function ($attribute,$value,$fail){ if(...
1
3eda318b5324df0c4ae8952ffbfcb5e2
879830c06e32744d7e82a0dfcb8e9d84
Generate a geojson highlight at the given location.
const provinceData = require("../definition/china_provinces"); if (!global.isBrowserLoaded) { return response.status(500).json(APIResponse.error("try_again_later", "人家还没准备好")); } let needHighlight; try { needHighlight = JSON.parse(request.query.cities); ...
1
701efca6026a2dcdd1306df07c1d7e43
05bd9a083184d6ad41a1f90b4523c1f8
给price赋值时,重新计算技术指标
self.trading_data = trading_data.reset_index().set_index('sec_code') self.trading_data.loc[:, 'adj_close'] = self.trading_data.loc[:, 'close']*self.trading_data.loc[:, 'adjfactor'] self.trading_data.loc[:, 'adj_trade'] = (self.trading_data.loc[:, self.price]*self.trading_data.loc[:, 'adjfactor']) self.trade_inf...
0
974e6cd1a9d1ab204e9689039125b31f
2b4f3a09b8e13091783a6f665b9d36ac
打印评论信息
class Player(object): def print_info(self): singer = self.__playlist[0]['info']['cmps_info']['singer'] n = self.__playlist[0]['n'] loved = self.__playlist[0]['info']['lvd'] loved = u'真爱' if loved == 'l' else u'母鸡' raise JI( u"关键词: %s\n歌 手: %s\n歌 名: %s\n爱不爱: %s" % ( ...
0
ba44111e5d05bef37627c1669d4fbbc9
57c190d3c9fb6de057adfd530dd20916
Update this preference according to the dependency.
if old_pin in deps: i = record['depends'].index(old_pin) record['depends'][i] = new_pin
1
124c80799812bab5a88202c935e2a2ba
4f689a0888924ce9596c57b46acf6bf5
Loads all Reply made on a single Comment USP: USP_Review_LoadListReply
namespace Seagull2.YuanXin.AppApi.ZhongChouData.Models public class UserReCommentAdapter : UpdatableAndLoadableAdapterBase<UserReComment, UserReCommentCollection> public UserReCommentCollection LoadByReComment(string commentCode) { return this.Load(where => { where.Ap...
1
dc7f1cf0bc6d46545275424a441a2523
10c6853a933b5fa60182aca2f13e9d49
使用经验池升级
int curExp = data.Experience; int curLv = data.Level; int totalAddExp = exp; while (true) { int upLvNeedExp = GetExpUpvalue(curLv) - curExp; if (totalAddExp >= upLvNeedExp) { curLv += 1; curExp = 0; ...
1
9b0932e846fb53c49c531a742e48469d
2768799bc9a4756f6056177bfdfd7cf0
Test set block with wrong name.
del (self.__data['name']) client = self.client client.set_data(self.__data) client.send() client.write_to_csv(self.__path) client.check_status_code(400) client.check_dict_equal({ "status": "INVALID_ARGUMENT", "reason": "argument 'name': not...
1
a8e55fd8397d986988b67a1d6dd1c739
7069a67092f764a5def56d93855ef70b
Extract the lattice from the line dump of a poscar file
class SmactStructure: def from_poscar(poscar: str): lines = poscar.split("\n") total_specs = [int(x) for x in lines[6].split(" ")] hcf = reduce(gcd, total_specs) total_specs = [int(x / hcf) for x in total_specs] species = [] for spec_str, stoic in zip(lines[0].split(" "),...
1
6cfa2cbc41179cde7c005e3f5727516b
98762f5ff52fad4333cb432346d5371d
Provides operations to call the gammaLn method.
class FunctionsRequestBuilder(BaseRequestBuilder): def gamma_ln_precise(self) -> GammaLn_PreciseRequestBuilder: from .gamma_ln_precise.gamma_ln_precise_request_builder import GammaLn_PreciseRequestBuilder return GammaLn_PreciseRequestBuilder(self.request_adapter, self.path_parameters)
1
9c9faf8cfccdc31a96a30c87e4ce67b6
7901dd78d1f95e89678be0d9a3fdddfd
Достаем массив идентификаторов тестов, которые пользователь прошел
namespace Test public partial class DeleteUser : Window public void IdQResultIdTest(int id) { try { SqlCommand command = new SqlCommand("IdQResultIdTest", conn); command.Parameters.AddWithValue("@idTest", id); command.CommandType = Syst...
1
d9a0c20685de2dc0e993055984692e13
907a9bf729fd6d6cc2881cc21f1bbbe4
关联文件对象到其实际的文件资源。子类可以重写此方法,执行特定的行为,如:懒加载资源等
public abstract class DocFile public abstract DocFile resolve(DocPath p);
1
1dfbf40f999c8dceb62ba65a4fd7ff1f
41687d9264118e45384886c471a3a3c3
创建delay_process_queue.dlq队列
public Queue delayProcessQueue(){ Map<String, Object> params = new HashMap<>(); params.put("x-dead-letter-exchange", EXCHANGE_C); params.put("x-dead-letter-routing-key", ROUTINGKEY_C); params.put("x-message-ttl", 5000); return new Queue(QUEUE_DELAY, true, false, false, params...
1
dadbe65c459213410e5cf901f47bdce7
cb2f2ee531f6ab871b3f1189c6e02f35
Generates number of rooms in one floor
int result = 0; for(Floor floor : floors) { result += floor.totalRoomsCount(); } return result; }
0
cd9013b0a05dfc31a073f9ac050b55a0
dfb5b430be35182a0a3098f492de9c85
Stops a scheduled job and removes it from the schedule (but not from the database).
abstract class Resqee_Persistence extends Resqee_Plugin public abstract function dequeue($jobId);
0
835cba2abe5bacdbfae8c5cb8d96ee3b
ea16e4577290bb1eb6169b3d7744a2c3
Initialize object with the informed hyper-parameter values.
class Kernel(ABC): def __init__(self, hyperparameters: dict[str, float]): if not hyperparameters: raise ValueError( "Must specify hyperparameter dictionary for child kernel class.") self._hyperparameters = hyperparameters
1
5ccf9a5a874fdae18f1ae89e85717c80
2e871e19d6abdc96719deb6568c47fb2
测试通过通讯录添加成员
class TestAddMember: def test_contact_member(self): self.main.go_to_contact().go_to_add_member().add_member().save_member()
1
85c2ca5aa8f4113acdfa31f41747db09
1ca771a32d60022d3fba7d65442c161e
根据部门名称获得部门信息,当参数"是否启用PBDEPUS"的值为空的话,则抓全部部门资料
public List<Department> findByName(String name, long offShootBankId) { if (offShootBankId == 0) { String hql = "select d from Department d where d.name = ?"; return this.getHibernateTemplate().find(hql, name); } else { String hql = "select d from Department d where d.name = ? and d.organization.id = ?"; ...
0
c82b89ba4e81cb12a8843b50110a371a
e5547b1646b7e141c138680454bc1ae7
Tries to invert the transformations applied to a sample. Will throw if one of the transformations cannot be inverted.
{ for (int i = 0; i < Count; i++) { samples[i] *= InversionCoefficient; } }
0
06ed3c980880e3a3600546b48b5f3472
78da5e695fd65940ce125693c1482952
删除 chatlist 中的某项
class Chat extends MY_Controller function chat_list_del(){ user_check(null,0,'exit'); $idx = rawurldecode($this->security->xss_clean(@url_explode($this->seg_exp, 'idx'))); $this->chat_m->chat_list_delete($idx); }
1
439f331946605381982896435a0f6ab8
129694f87755f860142fbcc7a9f11cc5
Set current third-party-sharing disabled state
public void setThirdPartyIfPossible(boolean bool);
1
5d7b9345135084c4fd95af2cf1a4c9b8
2dd3772219d239540990ff595247d550
js获取项目根路径,如: http://localhost:8083/pro
function getRootPath(){ var curWwwPath=window.document.location.href; var pathName=window.document.location.pathname; var pos=curWwwPath.indexOf(pathName); var localhostPaht=curWwwPath.substring(0,pos); var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1); projectName = "/suis...
1
d945cfcd9a9a887821b3071ac56c7aec
a9658218c4b17df58d51a37a0ba74727
@brief Interna funkcija koja odredjuje dovoljne dimenzije prozora na kome moze da se prikaze dati meni.
PP(int16_t height;) { int16_t max_height; if (height < 0) return (MAX_MENU_HEIGHT); MAX_MENU_HEIGHT = height; if (height <= MIN_HEIGHT) MAX_MENU_HEIGHT = MIN_HEIGHT; max_height = ((gl_rfull.g_h - (gl_hchar / 2) - 1) / gl_hchar); if (height >= max_height) MAX_MENU_HEIGHT = max_height; return (MAX_MENU_HEIGH...
1
d7ca88af689e391e8408a237de1c08fe
e06ac942f6d06507ecd58fa53548346d
Adds elements to the window menu
class Menubar extends JMenuBar implements ActionListener public void addFile(String url) { int count = m_windowMenu.getItemCount(); JMenuItem item; if (count == 4) { m_windowMenu.addSeparator(); count++; } JMenuItem lastItem = m_windowMenu.getItem(count - 1); boolean hasMoreWin = false; int maxWin =...
1
67ccfa65dfc88f2e218a668a4c160862
7bb9c22f70f21b94f54b9d6cb0d94726
Adds initial data in the Controller
function CategoryModalCtrl ($scope, $rootScope, $q, $CommonService, $ToastrService, $uibModalInstance, $stateParams, $validator, $CategoryService) function loadInitialData() { initScope() }
1
3eca5a4dd390d4d943f6754b9e4ed378
17d95043dbc8b056f5b4fc708a27f596
Rimuove l'effetto tilt ad un FrameworkElement
namespace Microsoft.Phone.Applications.Common.Controls public class TiltEffect : DependencyObject static void StopTiltReturnStoryboardAndCleanup() { if (tiltReturnStoryboard != null) tiltReturnStoryboard.Stop(); RevertPrepareControlForTilt(currentTiltElement); }
1
176b9cafc1633f97b3af1bda58949d1a
f53890b1b5195aae0fa9aa7f6d0dddd9
根据攻击类型获取对应防御值
{ switch (type) { case 1: return 10; case 2: return 8; case 3: return 4; default: break; } return 0; }
1
46f2fd221c0262d9208b82e4719afbb6
01eb080e4a2a9ee4997224b5b4bb4b2e
通过节点中储存的整型值来找到链表中所有符合条件的节点
{ List<Node> result = new List<Node>(); foreach (Node node in list) { if (node.Attributes.TryGetValue(Path, out string ret) && ret == k) { result.Add(node); } } return result; ...
0
8b778f0ff19db9975746bdd89f1ca37a
84ee7368443ecb3904c9c82d14e9196b
Returns the URL of the specified GIS service.
public class GISProxy public String getGISServiceURL(String serviceProviderCode, long sourceNo, String gisServiceId, String constant, String callerId) throws AAException, RemoteException { return getGISServer().getGISServiceURL(serviceProviderCode, sourceNo, gisServiceId, constant, callerId); }
1
68cffa821d8094c3585af4caa685b2de
0b439149ac6a0feb6134683cdba3baaf
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % % % % ...
CLText::FONT_STYLE CLText::getFontStyle() const { return this->mFontStyle; }
1
d18b72a20928a2d4ef2ea82332004865
3f363e14c6ad3708d7e6d3c690ef8c73
Ensure notifications continue to work after a reboot
class TestDBusApply(_LiveTesting): def test_applied_no_reboot(self): ini_path = os.path.join( SystemImagePlugin.controller.ini_path, '12_noreboot.ini') shutil.copy(data_path('state.config_01.ini'), ini_path) self.iface.Reset() reactor = AppliedNoRebootingReactor(s...
0
2c0c457cbeeba961e7067111309a69ea
944383dc3407a4f37052331c5bb3e9ac
The image displayed on the front of the pass in the top left.
class Context: def front_face(self) -> str: return self.mglo.front_face
0
850457055098ce1fce0d337882c53d29
dee7c47d5b6e89f83eee56d8edb16f0c
Set's the range the mechanism can turn to the left and right (in rotations)
void setPerc(int p) { int x = (maxRot*p)/100; float currP = currRot/maxRot; if(x > maxRot) { x = maxRot; } if(x >= maxRot-2 && x > currRot) { right(); while((analogRead(A2) - analogRead(A1)) < 150) { currP = 100*currRot/maxRot; Serial.println(currP); if(currRot == maxRot) ...
0
8d4a079486d749d754c2ebb090671a74
e92d6c3a020c683aa1d3c256e6b67546
Returns identifier of this <code>ServerAdminBean</code>.
public class SMAAdminsLocalServiceWrapper implements SMAAdminsLocalService, ServiceWrapper<SMAAdminsLocalService> public java.lang.String getBeanIdentifier() { return _smaAdminsLocalService.getBeanIdentifier(); }
0
ccfbb73f08b16253224cfdb232466374
e0f88a25d4178afbd1856ab7d5e89009
Checks if the modifier list has the specified modifier set either by an explicit keyword or implicitly (for example, interface methods are implicitly public).
namespace com.habelitz.jsobjectizer.jsom.api.abstracttype bool hasModifier();
0
f1d807a9a16d8cf29863b239733b53a3
b77c9d99402d1a225b782e0213b2b1c5
获取红包的累计数量
public MessageUtil getRedPacketCount(int userId);
1
153ec1da819f613bbe63fb5bb02309b2
06d2f820b203b951ddd49886c13b8ab3
根据index数组选中对应卡牌
for k,v in ipairs(self.myCards) do if index <= mid then if k < index and self.selCards[k] == 0 then self.myCards[k]:runAction(cc.MoveBy:create(0.1, cc.p(distance*SCALE_HAND, 0))) end elseif index > mid then if k > index and self.selCards[k] == 0 th...
0
b3effe42e0a0257ee580e3737538623a
8fdd19f3798a83d168c8ee5b50a812a0
Set a successful update message. Add the corresponding edit/view links to the info message
class TeiDisplay_StylesheetsController extends Omeka_Controller_AbstractActionController protected function _getEditSuccessMessage($stylesheet) { return __('The stylesheet "%s" was successfully changed!', $stylesheet->title); }
0
bdd9f1672e6a748631494883a3097956
57c9fca5a75fc20e41354f787858c14e
Set the value in the environment file.
if not key.isidentifier(): raise KeyError(f"Invalid key: {key}") if value is None: if type(self).envkey(key, namespace) in self.environment: self.delete(key, namespace=namespace) else: self.environment[type(self).envkey(key, namespace)] = str(v...
1
5c6f9b53ee57fc6b99d4f94f134b5086
3e80056538f86dc9349d8f5cfaa1d0ab
Creates a list of all unique tiles
public class BuildNeighbourLists : MonoBehaviour private void initialiseTiles() { for (int x = tilemap.cellBounds.min.x; x < tilemap.cellBounds.max.x; x++) { for (int y = tilemap.cellBounds.min.y; y < tilemap.cellBounds.max.y; y++) { Sprite tileSprite = tilemap.Ge...
1
9277b9cbfb7312e4913d5774b6262fef
1e88d21c5a8550ea78992edc2a8dc612
gets the first name of a fb user
$json_link = "https://graph.facebook.com/" . $userId . "?access_token=".DEV_AT; $json = file_get_contents($json_link); $objArrData = json_decode($json, true); $objArr = $objArrData['name']; return $objArr; }
0
bac5708d8277e7e3ae1d8947711d4121
3a1d053f897badd8f4f5141e8239597f
Create test free space with game manager
for (int i = 0; i < 17; ++i) { switch (SPACE_TYPE_ARRAY[i]) { case GENERIC: directories.push_back(new GenericFolder(SPACE_NAME_ARRAY[i], dirDescriptions[i], &processor)); break; case ROOT: directories.p...
0
0da9f6775dcb75e2e9fbcf08c7237aef
d340ba6ca6211eb621d037de476e71ad
Clear entire screen and set default color to white
class Debug(object): def _clear_screen(self): self._screen.fill(THECOLORS["white"])
1
11ee5bc5422ca8b7d515b4eeaee21641
994af60c64e96a386f14b9bd83dcfd31
创建玩家帮派对象
function AncientTreasureTeamCtr:CreateTeam( stInfo ) if not stInfo then return end self.m_iTeamUid = self.m_iTeamUid + 1 return GetAncientTreasureTeam().new(self.m_iTeamUid, stInfo) end
0
3178f065b25a14a507cf6c7cda2808b3
9f8d73313cefda138be81e16d89c9b14
Calculates normalized error of reconstruction.
error = abs(Vn - Va) / Va error = np.where(error == np.inf, 0, error) return np.sum(error)
1
9919ee20d410d708743e033a7f8baa57
c17417b017419bc57539c49512b849c0
Firmware Download > Download the new firmware file and also its crc for successful download verification
int otafu_firmware_download() { uint32_t crc_on_server = 0; uint32_t crc_downloaded_in_sd_card = 0; printf("otafu_firmware_download: Downloading new firmware ...... \n\r"); test_file_name[0] = LUN_ID_SD_MMC_0_MEM + '0'; FRESULT ret_firm = f_unlink((char const *)test_file_name); crc_file_name[0] = LUN_ID_SD_MMC_0_...
1
093041f00d23c8a92bdb14995b28d2e2
909edc4e570b85442254940035d39e42
Переносит параметры на контролы панели редактирования.
namespace ZSI.FTNet.FT_Controls [Serializable] [ToolboxData("<{0}:FTRepPanel runat=\"server\" style='width: 150px; top: 20px; left: 20px' />")] public class FT_RepPanel : FT_Control public override void RestoreData(FT_Control other) { base.RestoreData(other); FT_RepPanel control = (FT_RepPanel)other; Edi...
1
9915ac4f25bb7d48e69bc4b52a719407
fdd61f85af75fafeedcb8470c7f6d9ba
Getter for the to next turn control needed to navigate to the next turn
public class SideComponent extends JComponent public JButton getNextTurnButton() { return nextTurnButton; }
1
cf72baee7d83e33445c2c88d1ad854ee
56a7c1515216621705c2ca2b758c3cc7
exported function that attaches the KLU linear solver in a main program. this initializes the kinsol memory block as well as a memory block for klu-related parameters and functions.
PrivateKluData_( rcp( new Amesos_Klu_Pimpl() ) ), CrsMatrixA_(0), TrustMe_(false), UseTranspose_(false), Problem_(&prob), MtxRedistTime_(-1), MtxConvTime_(-1), VecRedistTime_(-1), SymFactTime_(-1), NumFactTime_(-1), SolveTime_(-1), OverheadTime_(-1) { Teuchos::ParameterList ParamList ; SetPa...
0
d1305c25d0a7b57912dedeaf7fcfd82f
551b396f965b4f70b83feb36dd93a363
打开位图,找到新的大小为size的空闲空间,返回该物理位置,并把对应的bit置为1
int bit_idx = bitmap_scan(&m_pool->pool_bitmap, 1); if(bit_idx == -1){ return NULL; } bitmap_set(&m_pool->pool_bitmap, bit_idx , 1); uint32_t page_phyaddr = ((bit_idx * PG_SIZE) + m_pool->phy_addr_start); return (void*)page_phyaddr; }
0
2b1b0b1ab8991f9bd158296cf754f9ed
0af4c40bcb9a275344587844ee223f42
把内存数据存回磁盘
{ try { #if(SDK) uint channel = g_ManagedCameraBase.GetMemoryChannel(); g_ManagedCameraBase.SaveToMemoryChannel(channel); #endif return true; } catch (Exception ex) { Log.L_I.WriteError(Na...
0
ac85cb5f9c366d4eddefd5a35809fe55
4d0fea08ed0f79da17f379181c0a6f79
Get ERC20 Metadata
async function getErc20Data (address, user) { const [balance, decimals, icon, name] = await Promise.all([ getBalance(address, user), getDecimals(address), getIcon(address), getName(address) ]) return { address, balance, decimals, icon, name } }
1
c15ccaa461f868f73af6c79c83d7e2d1
7196a441bf35274fcb24572db219c25b
Performs the actual view item translation.
$element = []; foreach ($items as $delta => $item) { try { if ($this->getSetting('link')) { $element[$delta] = $this->viewLinkValue($item); } else { $element[$delta] = $this->viewFormattedValue($item); } } catch (\Exception $e) { $ele...
1
f7ee4116873a42fd49908bb952dac4fd
8fdc8062f6bb67b32daf01fb7ac94f14
Determine whether a password change was requested.
public class SubjectUtils public static boolean passwordChanged(String pwd) { return !StringUtils.equals(PASSWORD_UNCHANGED, pwd); }
1
06ad98babad398793cc2e7fec79521d0
442c0c1c4c09190b14be6997fdbc1fba
检查当前用户是否为域管理员,只有域管理员可以选择或取消功能模块
{ if (string.IsNullOrEmpty(UserAuthority) || UserAuthority.Length == 1) return false; bool result = false; int mi = UserAuthority.IndexOf(";" + moduleCode + "|"); if (mi >= 0) { int ml = UserAuthority.IndexOf(";", mi + 1); ...
0
d61085a7c9cf349854777823e0f87e1f
94e50a6a63b962e85226b4035b70152b
Carrega os dados dos postIt existentes no banco
fetch("http://localhost:4000/laitteet/postit") .then(results => results.json()) .then(json => { this.setState({ postit: json }) }) .catch(function (error) { confirmAlert({ title: 'Virhe', message: 'Postinumeroita haettae...
1
7a8ac50483ba59c87d8c5a825399014e
f96caae2080adaf99a52fd5f74a6a3ab
获取无符号整型参数
public int GetAsInteger() { if (_arg == IntPtr.Zero) { return 0; } return Marshal.ReadInt32(_arg, 0); }
0
07dd9bfb9f1f8d63bdfc202dee54439a
227213d657621347643d83e6d647b235
Verify conversion works when ending with an executable.
compiler = Compiler(TEMP_FOLDER, program) compiler.compile_to_binary() results = run(TEMP_FOLDER+"/a.out", stdout=PIPE) assert results.stdout == (output + "\n").encode('UTF-8')
1
ce465d58d81cd6fa30c19750ea70cbf0
afaf584ceafbdea0765ba43bd43f1f75
Defines array of data clipboard operations recognized by this paste support.
export class ExtensionManager implements ExtensionManagerInitParams private pasteRules(): ProsemirrorPlugin[] { this.checkInitialized(); const pasteRules: ProsemirrorPlugin[] = []; const extensionPasteRules = this.extensions .filter(hasExtensionProperty('pasteRules')) .filter(extension => !exten...
1
f8fa65f6a27ccb7e266149dbc8db39d2
3cbdb62eca507eaa187bed78c802fc11
# Run Analytical P-Model
df<-readRDS(paste0(wd,"/Data/",data,".RDS")) h<-readRDS(paste0(wd,"/Data/H.adj.", crop, ".RDS")) assign(paste0("H.adj.", crop), h) v<-NA n<-NA Q<-NA u<-NA alpha<-NA phi.u<-NA phi.alpha<-NA phi.prior<-NA if (priors == "pc"){ v=sd(df$YIELD,na.rm=TRUE)/0.31 n=dim(df)[1] Q = I...
1
07ce1ed4d76d5c0185967faad272da89
14f6c4396d6f085d5e85cb815cb8d25f
先检查缓存文件是否是完整文件
{ if (!is_file($cachePath)) { return true; } return filemtime($file) >= filemtime($cachePath); }
0
a239b96818b9e755aad3075f39a4775f
134e8a012e990985d7396c6a1e9c6315
Deletes the last Achievement in the Category. We only allow deleting from the end because we rely on vector index position as the Achievement key; deleting from the middle would break references (e.g. social media url shares that include specific category_id values). For the sake of permanence we can only delete the Ac...
[ValidateAntiForgeryToken] [Authorize(Policies.Review)] public async Task<IActionResult> DeleteRecord(string category, string name, string userName, CancellationToken cancellationToken) { var item = await DbContext.Records.FindAsync(new object[] { category, name, userName }, cancellationToken); if (item == nu...
0
7a3d32da9d41e3e1464dd79ce2659737
8dbd4effc07155bcf8fbfff4e37e118c
Rotate the direction of movement so that pieces can scan in all possible directions.
int tempDirection; if (directionMoving != direction && isLegalMove(direction)) { tempDirection = direction; directionPrevious = directionMoving; directionMoving = direction; rotate(); } else { tempDirection = directionMoving; } int xIncrement = 0; int yIncrement = 0; if (tempDirection == Bo...
1
2ffbe1fead009672b557c7913126bc13
5490a8133fc980924b202050cc116b57
Un-like a message for the authenticated user.
namespace Terrasoft.Configuration.ESN [DefaultBinding(typeof(IEsnCenter))] public class EsnCenter : IEsnCenter public bool UnLikeMessage(Guid userId, Guid messageId) => _likeRepository.DeleteLike(userId, messageId);
1
d0029310fd2f9b788694ebc0b375e81b
d41d407bc57fb3f4709e5bf7fab2adef
UI委托类初始化函数
public class RulerGrid : UIWidget public void RegistHandleUIClass(MonoBehaviour ui) { this.handleUI = ui; }
0
f443be07184751c1df47f11813d06d52
f68816bb793c4a97dfb8c1aeafca6d69
se calcula el tiempo inicial, apartir del cual se generan paquetes, si el modelo es periodico se calcula aleatoriamenten en un valor menor a un periodo
int main(){ srand(time(NULL)); float auxf=0; int aux=0; list<tabla> simu_tabla; const int mod_m = 1000; const int MAX = 1000000; FILE *myFile; FILE *myOtherFile; FILE *myFiletabla; int n; float a, b; int replicas, ttransicion, tsimulacion; myFile = fopen("modelo.in","r"); myFile...
0
e21acce86ee3acdc67ab4553fad406ca
d8fb2ac2fa2be3b3d3bfb5dc6b8019ee
标注经度线
var line = helpers_1.lineString(cooard); var sampling = option.sampling || 0.1; var backgroundColor = option.backgroundColor || "rgb(255,51,242,0.7)"; var total_distance = length_1.default(line); var normalizedCooard = []; var labels = []; for (var now = 0; now < total_distance; now += sam...
0
b4ae872174ba2f9c445c61438a89bb8c
6475e2d427346f05f8bef6d1b6550810
Parses the analysis context from the input file.
for item in root.iter(): if item.tag == "program": self.main = item.attrib["name"].lower() for item in root.iter(): if item.tag == "file": file_name = item.attrib["path"] file = file_name.split('/')[-1] file_regex = ...
1
cfecb5f3edbe3aab1f6146a7f0d3a8f9
ff28581b3a6a3b21d27cfe46d2559111
Function creates instances of communes.
public class ComuneMock public Comune createInstance() { return createInstance( mockValues.nextInteger() ); }
1
c7838b9672e7b5f037f129a24895c963
85dd3a44b17b2c79d80f63f1bf1f810b
Gets ExchangeType attribute data
{ return array($this->getAttribute()->getAttributeCode() => array( 'type' => 'varchar(255)', 'unsigned' => false, 'is_null' => true, 'default' => null, 'extra' => null )); }
0
3e39548723d8736a0e28fbffc7fe9c57
ce3f000d60b01c80ab86969f6366f98a
val gives us access to the authprovider, then we pass it as a props to the register form. We also have to spread over props(from connectedRegister) so that we have acces to react router dom history
super(props); if (Auth.isAuthenticated()) props.history.push("/"); this.handleInputChanges = this.handleInputChanges.bind(this); this.handleSignUp = this.handleSignUp.bind(this); this.state = { error: null }; }
0
2fb6a691f5defcf529ae9bdda5b4ae51
b17755bf682e8be73178d893580c52ae
Gets the mouse position in client coordinates
namespace SnapPeaApp class WindowManager : IDisposable static Point GetMousePosition() { Win32Point w32Mouse = new Win32Point(); GetCursorPos(ref w32Mouse); return new Point(w32Mouse.X, w32Mouse.Y); }
0
8bd5ea227aefb495bcb85abaaa0d2574
8c94b5dc1694165004d0a512e89dbea5
设置一个横向的Padding
JSONObject x = config.optJSONObject("x"); if (x == null) { x = new JSONObject(); } JSONObject padding = x.optJSONObject("padding"); if (padding == null) { padding = new JSONObject(); } padding.put("left", left); padding.put("right",...
1
7ba19abe9f6c38a446d5108add186d2c
ebd030e291a643579d692eea022a456d
print out statistics of array: min, max, mean, median
void findStats(int *arr, int N, int &min, int &max, double &average) { min = arr[0]; for (int i = 1; i < N; i++) { if (arr[i] < min) min = arr[i]; } max = arr[0]; for (int i = 1; i < N; i++) { if (arr[i] > max) max = arr[i]; } int total = 0; for (int i = 0; i < N; i++) total += a...
0
6c7fa57c7e645c252a0a80142b10bb1e
cdb42c389fc7ce6909e4db555e7d253f
Attempt to sync thr RTC time to GPS data. Display status on-screen using pseudo-text.
static void monitor_gps_main(void) { uint8_t n = gpsio_get_satellites(); if(n == 0) { if((g_loop_count & 15) > 3) { monograph_draw_string_center_P(PSTR("GPS Not Ready")); } } else { short x = 0; short y = 0; time_t t = gpsio_get_time(); if(t > 0) { struct tm *sttm = gmtime(&t); monograph_draw_da...
1
c8c09ca919d150eb548bf5b813cbb1c9
1753a11bfb3bfcbdd3f4b30e89b88737
@brief get_status_cmd 获取查询温湿度传感器状态的命令参数
int mesh_cmd_sig_light_ctl_temp_get(u8 *par, int par_len, mesh_cb_fun_par_t *cb_par) { return mesh_light_ctl_temp_st_rsp(cb_par); }
0