query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
47d02a2748e4b552abb14c7df034328a | 2cd2f2031896556ff61d53ceb2cca3db | 不发送给当前发送消息的人 | public class MainActivity extends AppBaseActivity private class NewMessageBroadcastReceiver extends BroadcastReceiver
@Override
public void onReceive(Context context, Intent intent) {
String from = intent.getStringExtra("from");
String msgId = intent.getStringExtra("msgid");
... | 1 |
ab201aa278e767fab4bec4334c7c10c1 | f74772b3e7b9a0e020f2fa79e4a0dfe8 | 将交易时段的临时数据保存到数据库中,传入CtpGateway中的tradeDict | class BacktestEngine(object):
def SaveTradeKline(self, d):
Daily_bar = []
Daily_time = []
Daily_volume = []
mark_points = []
for i in self.dbCursor:
time_now = datetime.strptime(i.strendtime[:10] + ' ' + i.strendtime[11:19], '%Y-%m-%d %H:%M:%S')
if (Daily_... | 0 |
d83635f71eb0c93c29ba8071c1781bdf | 7c5c802cb182a0c7f52fffa46919072c | Create a local array containing supported password characters
grouped by types. You can remove character groups from this
array, but doing so will weaken the password strength. | {
return [
['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'],
['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'],
['K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T'],
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j'],
['*a', '*b', '*c', '*d', '*e'... | 1 |
78ea0e59acad9e1e942faf63b84a844d | ae17e8e5b686f0785c2c8806875b2d52 | Gets the event sub heading. | {
switch(nSubEvent%100)
{
case Subevent_DropCall:
return "DropCall";
case Subevent_TxNextBurst:
return "TxNextBurst";
default:
return "GSM_UnknownEvent";
}
} | 1 |
5f1d6695c3c12081b108691d8793e795 | 857df8b19796f2476d3dad0b4d770cb8 | Provide a random SHA1 hash. | class CryptographyProvider internal constructor(
fakerService: FakerService
) : AbstractFakeDataProvider<CryptographyProvider>(fakerService)
fun sha1(): String = sha(40) | 1 |
0c6cf23c00cc1f39a79bd896f8b68261 | e2f7b213df346d8421ae8b879a3d40e1 | !
\brief Отрисовка карты сегментации.
\details Для каждого идентификатора сегмента случайным образом генерируется цвет,
после чего отрисовывает карту, в виде залитых данными цветами областей. | int i = 0;
int index, x, y;
for (auto &segment:segments) {
auto *mask = &segment.mask;
mask->resize(segment.segment.x_masks.size());
for (int k = 0; k < int(segment.segment.x_masks.size()); ++k) {
x = segment.segment.x_masks[k];
... | 0 |
709999206e7f21b27b56ff457cbe747d | 89d8fd3dbbaa66df31956d93a674efca | Returns the number of swaps for the last sort. | int MergeSort::GetSwaps ()
{
return lastSwapCount;
} | 1 |
6cd0b841b91f8d8f7db77ce9e2634509 | 769d2ad8efbbfb76012ded8647a636ae | 新增校区 | @RequestMapping("/addCampus")
public String addCampus(Campus campus){
JsonObject resultJson=new JsonObject();
resultJson.addProperty("success", campusService.addCampus(campus));
return resultJson.toString();
} | 1 |
db04d8d81df18fa949000dabedeadeca | 2c438f752cbfc3c91bc32dc55f704013 | Affiche les unités de mesure de la liste selon le type | def get_typeMesures():
return TypeMesure.query.order_by(TypeMesure.nom_typeM) | 0 |
f142a138022c92937f065c3445aaa300 | a17becc22fd2f086b0d04898b8c19e9a | funkcia vracia uzivatelov ktory maju aktivne clenstvo v danom kluba | $this->db->select('clanovigrupe.idKor, student.ime, student.prezime, korisnik.korisnicko as korisnik');
$this->db->from('clanovigrupe');
$this->db->join('student', 'student.idKor = clanovigrupe.idKor');
$this->db->join('korisnik', 'korisnik.idKor = student.idKor');
$this->db->whe... | 1 |
69c02a36922ab04564766ef9a47f0ca4 | 7fce3eb1205091477f58488904f2ed6e | Information giving disk's basic disposition within
its overlying spare pool. Omitted if container-type
is not "spare", or if excluded by 'desired-attributes'. | static int
aac_query_disk(struct aac_softc *sc, caddr_t uptr)
{
struct aac_query_disk query_disk;
struct aac_container *co;
int error, id;
fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, "");
mtx_lock(&sc->aac_io_lock);
error = copyin(uptr, (caddr_t)&query_disk,
sizeof(struct aac_query_disk));
if (error) {... | 0 |
d5b86a7ac065882bcf12cbc341bfc8aa | 60c62afb9f6c51e44a78577b116957de | Finds all active agents linked to a rollup code within a branch | {
$dtos = $this->getEntityRepository()->findBy([
'flowUuid' => (string) $flowUuid,
'tide.codeReference.branch' => $branch,
'tide.status' => Tide::STATUS_PENDING,
]);
return array_map(function (TideDto $dto) {
return $dto->toTide();
}, $... | 0 |
c26c04377c7ebe06d1da5502f2db2f66 | 702a62061aa96fffb1865f8b96eb1b5c | 按指定大小把图片进行缩和放(会遵循原图高宽比例) | {
$im = $this->loadFile($url);
$rx = imagesx($im);
$ry = imagesy($im);
$xx = $h;
$yy = $w;
$im2 = imagecreatetruecolor($w, $h);
imagecopyresized($im2, $im, 0, 0, 0, 0, $yy, $xx, $rx, $ry);
return $im2;
} | 0 |
b208042da73fc7d96118f62663412c76 | 516596f9f5a58ff570c4848e748b5ccd | Liefert alle PlanetenKlassen zurück | try {
ObservableList<Class> classes = FXCollections
.observableArrayList(DBHandler.getAllClasses());
return classes;
} catch (final DatabaseException db) {
db.printStackTrace();
throw new IllegalArgumentException("Datenbankfehler: "
+ db.getMessage());
}
} | 0 |
ff90bdb643b2c5a8c89544a77b1f7d27 | 2c067db07282bdf5b25ffd0fa788e415 | Function Name: ACC_DR_INT_Enable
Enables the interrupt to the interrupt controller. Do not call this function
unless ISR_Start() has been called or the functionality of the ISR_Start()
function, which sets the vector and the priority, has been called.
None
None | void isr_ZeroAccel_Enable(void)
{
*isr_ZeroAccel_INTC_SET_EN = isr_ZeroAccel__INTC_MASK;
} | 0 |
d64cb8814178194bf4cb4ca91afb93fd | 4349749dadc2a1e4aeb012158252fb78 | Pass graph embedding and new feature vector through MLP | nx_G = read_graph()
G_node2vec = node2vec.Graph(nx_G, args.directed, args.p, args.q)
G_node2vec.preprocess_transition_probs()
node2vec_walks = G_node2vec.simulate_walks(args.num_walks, args.walk_length)
nd_vec = learn_embeddings(nx_G, node2vec_walks, args.output_n2v, args.dimensions, args.window_siz... | 0 |
c6c80d6329dfcf01b0c52f624eee8fd8 | 36d758e58e091653b092b522f7c758e0 | for now, just average word length
number of non-whitespace characters / number of words | def average_word_length(text):
clean_text_str = ""
clean_text_str = clean_up(text)
list_of_words = list()
list_of_words = word(clean_text_str)
list_of_wordlengths = list()
for word in list_of_words:
list_of_wordlength.append(len(word))
num = float(sum(list_of_wordlength))
denom = float(len(list_of_wordlength... | 1 |
21b22881ead5b5e827186a69187663b7 | efc2791ef865d13d3f799225dd743177 | パーティーメンバー(名前)からパーティーメンバー(id)情報に変換 | class DataMigrator
protected function transPlayerId($data)
{
$gameServer = new GameServer();
try {
$newPlatformUserList = $gameServer->request('GET', config('custom.game_server_api_users'))['accounts'];
} catch (\Exception $e) {
throw new CustomException($e->getMessag... | 1 |
2492dce9aa040c0555a2fc9b996ba57e | bb4d241166ecece0004dbd408cbd7173 | Gets to the absolute home url link. | public class TSWAHyperlinkBuilder
public URI getHomeURL() {
return getHomeURL(AccessMappingMonikers.PUBLIC_ACCESS_MAPPING);
} | 1 |
da3a1864f6c6628dcecafb66fe4ac0d6 | 4ab6c681ac18cf647116b5a8461be702 | This method was generated by MyBatis Generator.
This method returns the value of the database column EPSS.ES_ITEM_STL_TKCTT_ENG_MEA.CREATED_DATE | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "MT_Tumbol", propOrder = {
"tumbolID",
"thTumbolName",
"enTumbolName",
"postCode",
"amphurID",
"isActive",
"updatedDate",
"updatedBy",
"updatedByName",
"createdDate",
"createdBy",
"createdByName"
})
publ... | 0 |
3556dcbaf24497262fca661377f52324 | 3ef787732c220871b198723e942e42fe | Enables the users to select the desired fruit. | return (
<div>
<button className='fruitBtn' onClick={this.addFruit('Apple')}>Add Apple</button>
<button className='fruitBtn' onClick={this.addFruit('Orange')}>Add Orange</button>
<button className='fruitBtn' onClick={this.addFruit('Watermelon')}>Add Wa... | 1 |
c6b0e38d50e6bc57d1c0f5466d1c0650 | 9f2ea083ce12e8fc8d291ceafac0977c | Boot LogEntries service. | {
int ret;
cJSON *output = NULL, *getLogServicesJson = NULL, *payload = NULL;
UtoolResult *result = &(UtoolResult) {0};
UtoolRedfishServer *server = &(UtoolRedfishServer) {0};
struct argparse_option options[] = {
OPT_BOOLEAN('h', "help", &(commandOption->flag), HELP_SUB_COMMAND_DESC, Uto... | 1 |
2680f5e992fd3664db45e3b94e8e0d7a | b7dfead1fcf0d29c78cb53ac20fe28ca | This call returns the document types that the user can access but in a preformatted tree with parent/child relationship | namespace MyDataMyConsent.Api
public partial class OrganizationsApi : IOrganizationsApi
public async System.Threading.Tasks.Task<PaginatedListOfDocumentTypes> V1OrganizationsDocumentsTypesGetAsync(int? pageNo = default(int?), int? pageSize = default(int?), int operationIndex = 0, System.Threading.CancellationToken ... | 0 |
e8dd4ad1901d2bc73649a8cfc2a5cc84 | 44494ad2e97e84a061bffc317facbcfe | Finalizar tickets de entrada (Estado Terminado) | {
$id = ($id !== false) ? $id : $this->input->get('id');
$this->db->update('tickets', array('status'=>'0'), array('id'=>$id));
$this->db->update('tickets_detalle', array('preparado'=>'1','usuario_preparo'=>'1','fin_preparacion'=>''.date('Y-m-d H:i:s')), array('ticket_id'=>$id));
return array(true, '')... | 0 |
aabc6f8a7d2a02f346538768dab1d7ce | 6f226d249d9b5fa742df61027e753f9c | Clear the stack to bring you back to the base fragment | if (baseFragment != null) {
addFragmentToStack(baseFragment, baseFragment.getFragmentTag(), true);
}
} | 0 |
d6b36562a6e77443e2a41c555d708c3d | 4c385c345244581c5acf1b3d56b4c57c | Get the python struct formatting string for the message payload | class FixedSizeDataTypeDefinition(DataTypeDefinition):
def GetStructFormatString(self): | 1 |
de26ad0c26e40806d03cf3c8c83c3eef | 6a060d255fb2ce68d92ec461a1872f29 | 多条件分页查询客户计划表 | List<SinglePlan> selectByPage(Map map); | 1 |
1427b970352cbb90c4e095bd072bb3ef | 669bcd09afe78622ec68c66b6e3c176d | Get not only size of the given object, but also the
size of objects referenced by the object, down to
`max_depth` distance from the object.
Note that this measure is necessarily approximate
since some memory is shared between objects. The
`max_depth` of 4 is roughly tested to give reasonable
size information about data... | def get_size(obj: Any, seen: Optional[Set[Any]] = None) -> int:
try:
return _fast_get_size(obj)
except TypeError:
pass
return _slow_get_size(obj, seen) | 0 |
271a4f17c080050aa74b642fd87d3167 | c2814072f8a52582bbc2e4b055299ae9 | Выберит из массива объекты, которые подходят под выбраные пользователем критерии | {
$result = array();
foreach( $this->data as $data )
{
if ( $this->matchCriteria( $data, $criteria )
$result[] = $data;
}
return $result;
} | 1 |
7bcba92726fca8ece1f462d0131b164c | 3c98a1943548662878642b77c6761d46 | FQDNからバイト形式のQNAMEを返す | unsigned char* buf;
buf = malloc(sizeof(unsigned char)*BUF_SIZE);
memset(buf,0,sizeof(unsigned char)*BUF_SIZE);
unsigned char* beg = domain;
unsigned char* pos;
int i = 0, len = 0;
while ((pos = strchr(beg, '.'))) {
len = pos - beg;
buf[i] = len;
i++;
memcpy(b... | 1 |
83593b773443f500f85e12ed0de65b55 | 2c2d846d233ca3b0af3ae2af20475c68 | Estimate step length | n = X.shape[1]
mat = (X @ X.T) / n
L = np.linalg.eigvalsh(mat)[-1] + self._lambda_
step_size = 1 / L
return step_size | 1 |
74e52300d0e4b61385cec88d385cae7d | b034ffaf8fded8c09f7a9c573a6e4d64 | Shows HTML within Jupyter notebook. | def jupyter(): | 0 |
571c0a06261fc31459e7de97d1401355 | dc05ad0f1da57a063c59aba17cfee4ae | 给用户新增角色 | @RestController
@RequestMapping("/auth")
public class AuthController
@PostMapping("/userRole/add/{userId}/{roleId}")
public Rest roleGiven(@PathVariable("userId") String userId, @PathVariable("roleId") String roleId) {
if (checkUserRole(userId)) {
return Rest.bad("用户已有角色!");
}
Us... | 1 |
6192f7fb380c651ab7583e8860ac227b | c39af718527a4fde6d184b04d84926c6 | Callback after cache has been written | class zcache_backend_file implements zcache_backend_interface
public function postsave ()
{} | 1 |
9bad61a9cbe4f27d82db251898ee03c1 | de6a6aa985ab281c4951e454e886b65b | 获取当日投诉信息 | namespace BLL
public class MessageService : ServiceBase
public List<MessageForView> GetComplaintList(DateTimeCondition input)
{
var result = new List<MessageForView>();
using (var db = new RTDbContext())
{
var list = db.Messages.Where(p => p.MessageType ==... | 1 |
3f19eac1305d8b381ad9520fe446037c | 1090915ba296f9064d547f6858bfd3a2 | Set active power limit in % of rated capacity. | {
int ret;
CHECK_HSMP_INPUT();
if (sock_ind >= psm->total_sockets) {
return ESMI_INVALID_INPUT;
}
ret = hsmp_write32(SOCKET_POWER_LIMIT_TYPE, sock_ind, cap);
return errno_to_esmi_status(ret);
} | 1 |
dddac5a536fe515d4b099c62928d0498 | 60458fffbd3bd3ac4e5566f8e193f0d9 | 阻止尝试某个资源加载,目前是还未加载的资源,从列队中做移除,其他状态不处理 | {
queue = new Queue<GameObject>(queue.Where(p => p != a_resource));
} | 1 |
6c1db04c2b9ca9d47f0defcbfa012f05 | ee199672caf0bc76ac53de04ad4b2178 | Vrátí string složeny s jména a příjmení uživatele | class User implements AdvancedUserInterface, \Serializable, \JsonSerializable
public function getUsername()
{
return $this->lastName.' '.$this->firstName ;
} | 1 |
280cf10d33a544497d7ed21e9f088000 | da6e1960c172c40467392744163dba73 | 验证字符串类型的参数是否不为空(去除首尾空格) | public class ParametorValidator
public static void checkStringNotBlank(String str, String errorMessage) {
checkArgument(StringUtils.isNotBlank(str), EventCodeEnum.GENERAL_ACTION, ErrorCodeEnum.PARAMETER_ILLEGAL, errorMessage);
} | 1 |
6fda0bfb0e775862f5784424a3378441 | a1128ad4bdd19fbc85cbd35672cbb8a6 | Test for mapping json to OpenHour object | test_dir = os.path.dirname(__file__)
test_file = os.path.join(test_dir, "data/test_intake_query_result_from_file_new_json.dat")
map = self.svc_adapter._intake_query_result_from_file(test_file)
assert map | 0 |
f890b6cbaf4f193f70602a832cce0fbf | e5f19c2618248020fc1567990cebf74c | present a page with current information for the selected Boat Type to be edited | Class BoatView
public function showBoat(Boat $boat)
{
$contentString = "
<h4>Boat Information</h4>
<ul>
<li>Boat type: " . $boat->getBoatType() . "</li>
<li>Boat length: " . $boat->getLength() . "</li>
</ul>
";
return $contentString;
} | 0 |
52429f787cf0af9400007aca3d9b059e | 57abdc709ad6a14ac147d1a8bd0803c2 | Creates a button secured by the specified rule. | {
$other['button_only'] = true;
return $this->addPage($label, $privilege, $controller, $action, $other);
} | 1 |
29404bb8ec938ffb077b718a196456ac | 9a5b26769df83fd503d29f56f3da864c | Raised whenever a configuration file is being read as a 'flat' dictionary (merging all sections into one dict) but
the same key appears in several sections | class UnflattenDictTest(unittest.TestCase):
def test_raises_error_on_key_conflict(self):
with self.assertRaisesRegex(TypeError, r"Cannot unflatten dict"):
unflatten_dict({"a": 1, "a/b": 2, "a/c": 3})
with self.assertRaisesRegex(TypeError, r"Cannot unflatten dict"):
unflatten_dict... | 1 |
63770841f4f517c933060e86d91c8dc6 | 9cf116efa8b4fa091996f5e01b6a4c52 | Sets a collection of Phone objects related by a many-to-many relationship
to the current object by way of the company_phone cross-reference table.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection. | {
$this->clearAddresses();
$currentAddresses = $this->getAddresses(null, $con);
$this->addressesScheduledForDeletion = $currentAddresses->diff($addresses);
foreach ($addresses as $address) {
if (!$currentAddresses->contains($address)) {
$this->doAddAddress... | 1 |
89a1a4f16f80d233a49052d54eb69b5e | 95595daaa418ef5d8dedd00c173d8c5f | 年齢のタプルを作成 | ageBins = [(0, 2), (4, 6), (8, 13), (15, 20), (25, 32),
(38, 43), (48, 53), (60, np.inf)]
return ageBins | 1 |
b029b84b34f909305afc5d55126f502f | 50468e20f0a02299341d744bde8393c3 | Lấy dữ liệu một bản ghi truyền về ở dạng OBJ. | class QueryResult
public function anonymObject()
{
return $this->getStmt()->fetch(PDO::FETCH_OBJ);
} | 1 |
bc593fd2a35e857e80b678a2955e3a28 | 4a13d8595c6c632b14b3d7ae9a2b08d7 | Recursively converts Bukkit configuration sections into documents | {
if (!$sections) {
return $this->processSection($value);
}
$nestedSection = [];
$first = \array_shift($sections);
$nestedSection[$first] = $this->buildNestedSection($sections, $value);
return $nestedSection;
} | 1 |
d43b1363bcdc1b32d007ea0c8c60df32 | ea7f62ea79dc541e6ad90eed1728435d | 获取内置存储卡剩余空间 | public class DeviceUtils
public static long getExternalStorageSpace() {
long availableSDCardSpace = -1L;
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState())) {
StatFs sf = new StatFs(Environment.getExternalStorageDirectory().getPath());
long blockSize = sf... | 1 |
5e9527a05764d67e4339b9a27ba99356 | 7f95a873d5e5932f92f54d288a5422b7 | This example demonstrates how to limit count of items when rendering Outlook
data files. | function limitItems(err, words) {
words.count({first:'p'}, function (err, count) {
console.log("Words starting with p: " + count);
});
words.find({ first: 'p'}, function (err, cursor) {
displayWords("Words starting with p: ", cursor);
});
words.find({ first: 'p'}, {limit: 5}, functi... | 0 |
bb8408550d6628169f23d4c50af85c56 | 1b52fb236ad88e1f945c02f5a84458ed | Capture keydown event and check if the pressed key is part of the sequence. | namespace HackTheWorld
public partial class Form1 : Form
protected override void OnKeyDown(KeyEventArgs e)
{
if (!_pressedKeys.Contains(e.KeyCode)) _pressedKeys.AddLast(e.KeyCode);
} | 1 |
1a908ffede95e54858ff7fd8557c7653 | 7aa2e94b227c5747730d4cda4fc4d67f | Returns true if the entry exists in the database | namespace Kraken.Api.Sensor.Services
bool Exists<T>(string id) where T : IDatabaseModel; | 1 |
d88119eb123022884b04c2537c0b3cbd | 9d436e1d5dd4f8d9d6f96d4efa23f610 | Go through all the models at root level and create xml. | {
if (modelRootList == null)
{
throw new ArgumentNullException(nameof(modelRootList));
}
new DbContextGenerator(rootNamespace, parameters).Generate(modelRootList);
var classGenerator = new CSharpClassGenerator(rootNamespace, parameters)... | 0 |
c80e86fd34bcab5451b618f96de3d212 | 62126d248b536acd651a3b651cf98766 | ldloc.0 - Load local variable 0 onto stack. | TEmitter Ldloc_2() => Emit(OpCodes.Ldloc_2); | 0 |
e453c1de2ff94de3b40e7bbcdd552091 | 50ed7b33698f0f09d0d2b1450de59142 | Test the add_customer method sends the trade name. | class Test_add_customer_Method(TestCCAPIMethod):
def test_add_customer_sends_trade_name(self):
self.assertDataSent("TradName", self.TRADE_NAME) | 1 |
7d60be917b9e1e5b00d599850ec566be | 3fb61c02015fd6a32ea10e6975fa7eb0 | Returns whether we are computing the Pre of the already finished fixpoint,
or if we are computing the fixpoint from scratch | class PluginScanContext(PluginModifyContext):
def in_fix_mode(self) -> bool:
return self.__in_fix_mode | 1 |
aa64138c787812ed9095bc1b1f454817 | 429b3fa628edfd1253548e58bbbef976 | output human-readable description of contents of container as HTML
<p>
used for debugging / output to JSP
Uses descriptions from components that implement the {@link org.astrogrid.jes.component.descriptor.ComponentDescriptor} interface | public String toHTML(); | 1 |
5aa49840119dd2f6fe29862a595bf961 | c80fb89dcabe34f152a236bfaded9fc3 | 点击。根据控件的resource-id和text属性找到指定的控件执行点击操作。text包含,非绝对匹配。 | public class TestBase
void clickByResIdIfExists(String resId) throws Exception
{
UiObject img_know = mDevice.findObject(new UiSelector().resourceId(resId));
if(img_know.exists()){
Log.d(TAG,"clickByResIdExists()->resId:"+resId);
img_know.click();
}else {
... | 0 |
e859810fa0405c88080c9cd0fc61d68a | 464c5a890df6d6e90f1c7a0622ba3a43 | 如果删除父部门,则会同时删除下面的子部门 | @Service
public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> implements ISysDeptService
@Transactional
@Override
public boolean deleteById(Serializable id) {
EntityWrapper<SysDept> wrapper = new EntityWrapper<>();
wrapper.setEntity(new SysDept().setParentId(String.valueOf... | 1 |
7186171f94cd5e1bff8a9d09a2a0e5c1 | c6a505ce66067d27532f4626f041f59a | 生成账号密码签名(SHA512) | String generatedPassword = null;
try {
MessageDigest md = MessageDigest.getInstance("SHA-512");
md.update(salt.getBytes(StandardCharsets.UTF_8));
byte[] bytes = md.digest(password.getBytes(StandardCharsets.UTF_8));
StringBuilder builder = new StringBuilder... | 1 |
461d59b971d8a45aec839244ea222ca4 | a0dd229541d8dff8486f586f6b1cc3bc | 从serviceInfoList集合中获取所有要创建的AC对象 | List<HubGroup> hubAcs = new ArrayList<>();
for(HubAc hubgrp : hubGroup) {
HubGroup hubac = new HubGroup();
hubac.setAcId(hubgrp.getAcId());
hubac.setHubDirection(hubgrp.getHubDirection());
hubAcs.add(hubac);
}
return hubAcs;
} | 0 |
cd7b384adef10b51926bfda6929fefca | 3121b547f18b044de5342b5bf9a777b5 | We need to hold last entered text to set it as an item description, 'cause
combo box sets matched text into it's edit part | void DccAddressPanel::enterField()
{
oldContents = val->text();
} | 1 |
a498be7250b63bf0bb3d81370344e20a | c8326ccdfaa0f16eb22c6701901fb993 | 数量确认-导入 | {
if (chkCount == null)
return false;
try
{
var purchaseOrderDetail = grPurchaseDetail.Get(x => x.Id == purchaseOrderDetailId);
string currentChkStatus = purchaseOrderDetail.ChkStatus;
if (currentChkStatus != Pur... | 1 |
ce3634faed25daa56e78039e7f3c7dcd | 37065536e6321f741252829ff9b92557 | Converts the signed value on the top of the evaluation stack to a single floating (8 bit integer) with no overflow check. Pushes an F value onto the evaluation stack. | TEmitter Conv_U() => Emit(OpCodes.Conv_U); | 0 |
79b953f4a91d210ecbc36e9dd4f31f36 | 345ca3fdd1b68382542c0eeb70e325ac | Specifies in property list whether to create missing intermediate
groups.
See https://www.hdfgroup.org/HDF5/doc/RM/RM_H5P.html#Property-SetCreateIntermediateGroup | static hid_t _hdf_create(const char *path, int cmode)
{
hid_t grp_id;
hid_t fd;
hid_t tmp_id;
hid_t hdf_gpid;
hid_t fpid;
fpid = H5Pcreate (H5P_FILE_ACCESS);
H5Pset_libver_bounds(fpid, H5F_LIBVER_V18, H5F_LIBVER_V18);
H5Pset_cache(fpid, 0, 2503, miget_cfg_present(MICFG_MINC_FILE_CACHE)?miget_cfg_int(MIC... | 0 |
78b052be4e6f2e742ffbbed633494ed6 | def2d416c36b9e3914b3942755feb8ba | 插入多条提醒 | Integer batchInsertStudyRemind(List<StudyRemindEntity> studyRemindList); | 1 |
e7bf4eb84c5e0d414f0967afd984381a | b111428e64d9bbe97dcd224d40e65c0c | Affiche la scène du menu du jeu. | public class ColorsWitch extends Application
public void setMenuScene() {
VBox root = new VBox();
root.setStyle("-fx-background-color: black;");
GridPane grid = new GridPane();
menuScene = new Scene(root, WIDTH, HEIGHT);
Text csText = new Text();
csText.setText("Colors Wi... | 1 |
56756e9cc03d9f3ce71d71259a1345ce | 07b9b7b0cdb4f4d24a47532f27b5982e | 包含默认name属性的装饰器。 | function Name(name: string): PropertyDecorator {
return N(name) as any;
} | 0 |
4ae2314d49e3fb8c9c7c7ba2445b3142 | 1986cab52c0a751e2b20e71c674feb37 | 使能GPIO外设和AFIO复用功能模块时钟 | void gpio_enable_clocks(void)
{
STM32_RCC_AHB2ENR |= STM32_RCC_AHB2ENR_GPIOMASK;
clock_wait_bus_cycles(BUS_AHB, 1);
} | 1 |
5d6a3b3af94e2a67ebe1ad3d2ddec118 | 7d9aba67d6639c5419354ee70cbd02a5 | Set has comparison expression for a dimension. | {
if (comparisonValue != null)
HavingClause = (true, comparisonFlavor, comparisonValue);
return this;
} | 1 |
24cd75efb5c8245d74185bf0a21be254 | a359fa725e598dc54aa60d09accbb79a | Download the RSS file locally. | print("Saving " + local_filename)
headers = {'Authorization': 'Bearer '+ token}
r = requests.get(url, headers=headers)
with open(local_filename, 'wb') as f:
for chunk in r:
if chunk:
f.write(chunk) | 1 |
ab09d0f938c8aa1e5846d9e9e1d8bdd6 | 440c86dfcf838889ceb0804644cdbb97 | formal past negative | function getFormalPresentNegative(wordEntry: JapaneseWordEntry): string {
const verbStem = getVerbStem(wordEntry);
return `${verbStem}ません`;
} | 0 |
fa845d616a2fbc9da50c78eaf18b0972 | 0ee880900dfbec4a6d8c97b3266a1f54 | Get Wcf client instance. A new instance is created for each call then disposed and will not throw any exception. | namespace DevLib.ServiceModel
public static class WcfClientProxy<TChannel> where TChannel : class
public static TChannel GetPerSessionUnthrowableInstance(string endpointConfigurationName, string remoteUri, bool fromCaching = true)
{
return GetInstance<WcfClientPerSessionUnthrowableClassBuilder<T... | 1 |
666e5f8371ff5daa79e5dcabd11e19f9 | 023660ac1fa95103c4ef6e40506ade88 | Create a new console Progress Bar. | function ProgressBar(description, bar_length) {
this.description = description || "PROGRESS";
this.length = bar_length.length || 28;
this.render = function (opts) {
var percentage = (opts.completed / opts.total).toFixed(4);
var cell_num = Math.floor(percentage * this.length);
var cel... | 1 |
99fce82ba52ff327b522420d26514cf2 | 8e809a37d6f79baa2a77619409ce0470 | Sets the tuple at an index to the given tuple. | {
for (int i = 0; i < tuples; i++)
data[i] = value;
} | 0 |
9b3472afac85dd0fd95b1b877bc92a59 | dc86bba2226deb0b3a50f434da077a8a | 判断某年某月第一天是周几 | y = year - 1 if month < 3 else year
q = day
m = month + 12 if month < 3 else month
k = y % 100
j = y // 100
h = (q + 13 * (m + 1) // 5 + k + k // 4 + j // 4 + 5 * j) % 7
return ((h + 5) % 7) + 1 | 1 |
34538a5dbc69b5f6f592e6f34e824f9c | c57a1d4e505f85b00026a563d44aa8af | 移除文件注释 | class StringHelper extends BaseStringHelper
public static function removeAnnotation($content)
{
return preg_replace("/(\/\*(\s|.)*?\*\/)|(\/\/.(\s|.*))|(#(\s*)?(.*))/", '',
str_replace(["\r\n", "\r"], "\n", $content));
} | 1 |
e86bfe943002c7395ed132a55bd6bfe4 | 3e60a9765b75e51390b947d4081c81fb | Taken from a forum.
Create concatenated ranges of integers for multiple start/stop | r = []
if inclusive:
stop = stop + step
while start < stop:
r.append(start)
start = start + step
return r | 0 |
f02844a304dc3f666e404a0d7643be75 | 74befb91b48da95cbc393140e156b0e4 | switch the data grid from all item to current item and from the opposite side | class MainActivity : AppCompatActivity()
private fun switchLayout() {
if (gridLayoutManager.spanCount == 1) {
gridLayoutManager.spanCount = 2
} else {
gridLayoutManager.spanCount = 1
}
itemsAdapter.notifyItemRangeChanged(0, itemsAdapter.getItemCount())
} | 0 |
d81b8863d99e6eab54f22c1bdf44d223 | eb1c48c0b321e538a3eebb2d574306de | 判断组件是否在DOM树里 | class VMNode
get isMount () {
return this._el && this._el.parentNode
} | 1 |
74f125c8f145ae69d0433bb42c0011ea | 8dfc2d60c35b292c6d90d7cbb1a0c209 | # Max available level for Outsiders with growing costs | {
$arrArmys = $objUser->get_armys();
$arrGoods = $objUser->get_goods();
$arrArmyHome = $objUser->get_armys_home();
$iCitizens = $objUser->get_pop(CITIZENS);
$strRace = $objUser->get_stat(RACE);
$objRace = $objUser->get_race();
$arrUnitCost = $objRace->getUnitCosts()... | 0 |
72b7167b1f233d631bdfc94ced7fe67e | 2c74bfbc31fc8c35c2efaf598f67f526 | URL编码
<p>若系统不支持指定的编码字符集,则直接将input原样返回</p> | @SuppressWarnings("restriction")
public class StringUtil
public static String toUrlStr(String input, String charset) {
try {
return URLEncoder.encode(input, charset);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | 0 |
3c31b02ea6db4eb608e8536548f52c4d | 337183854fd3553b6fa52fc9b02d4bfe | possible percepts:
'stench' - wumpus is adjacent
'breeze' - pit is adjacent
'empty' - nothing perceived in this cell
'bump' - hit a wall (calling function should not move the agent)
'glitter' - gold in cell | class Floor(Environment):
def percept(self, agent):
things = self.list_things_at(agent.location)
return things | 0 |
b2f43a348498a925a5550ba090b6afc6 | d96966c3000e7b1b8bcbb57f7932e87d | Initiates the asynchronous execution of the ListCopyJobs operation. | namespace Amazon.Backup
ListCopyJobsResponse ListCopyJobs(ListCopyJobsRequest request); | 0 |
ea7045cc94a855266d3cd21c7bce033a | 895d174f5a7216919e9b586e6c5bc12b | Método que imprime o acervo de livros, ordenado em ordem crescente pro chave | namespace InterfaceBiblioteca
class Program
private static void MostrarLivro()
{
Console.WriteLine("-- Lista de LIVROS cadastrados --");
livrosController.RetornaListaDeLivros().ToList<Livro>().ForEach(i=>
Console.WriteLine($"\r\nO livro selecionado é: {i.Nome} e o seu ID ... | 0 |
777dfcfb884a7e144d50c247c64689cb | be1ad8967cdcecf7a91adeb726f71627 | Reports if SingularWS has a fast connection available. | public class DeviceInfo
public static boolean isConnectedFast(){
NetworkInfo info = DeviceInfo.getNetworkInfo();
return (info != null && info.isConnected() && DeviceInfo.isConnectionFast(info.getType(),info.getSubtype()));
} | 0 |
dec261d0232ca3adbdf192e03a587394 | 3d35b1de7353fa0775a799302d2a0d40 | After the wave finishes it adds the products it produced to a queue. | if self.next_wave:
self.active_waves.append(self.next_wave)
self.sent_next_wave = True
if self.waves:
self.next_wave = self.waves[0]
self.waves.remove(self.next_wave)
else:
self.next_wave = None | 0 |
26bd6bf72f21dfc2fdafc3f95432848b | 9b5effcf3e17f6229656484eb3496306 | Deletes all feedbacks for user with specific user Id. | public function deleteByUserId($userId); | 1 |
6cc1074548d5e572c62d2f087de4902c | 44b7006ec3fe70e6fb12e5edc601f1ce | Function Name: Userdef_RIIC0_WaitReceiveFull
Description : Execute this function to wait until the conditions for the
Arguments : none
Return Value : none | {
INT32 retval;
DDIM_USER_FLGPTN waitptn;
#ifdef CO_PARAM_CHECK
if( (im_raw_check_pointer(condition) == D_IM_RAW_FALSE)
|| (im_raw_check_pointer(byte) == D_IM_RAW_FALSE)
|| (im_raw_check_wait_time(wait_time) == D_IM_RAW_FALSE) ){
Ddim_Assertion(("I:im_raw_wait_end_enc : INVALID_ARG_ERR\n"));
return D_IM_... | 0 |
38fee26954d5e5c6f5ed3dba72d34cc4 | 6721ba6f656a59bf5f6e8f96d35795a1 | Shut-down the Zoe M8 GNSS chip. | class piezo_wrapper(DeviceWrapper):
def shutdown(self):
return self.packet().close().send() | 0 |
1ce56d40bad857a1dc1c90bd2016ad99 | d565610ab5e68f47a83dbcb06f2968c3 | method to return the calculated empirical counts vector for gradient calculation | class TruncatedLogisticRegressionModel(LinearModel):
def calc_emp_model(self):
self.log_reg = LogisticRegression(penalty='none', fit_intercept=False, multi_class=self.args.multi_class)
self.log_reg.fit(self.X, self.y.flatten())
self.emp_weight = Tensor(self.log_reg.coef_).T
self.weight ... | 0 |
4f4752f2af8b1e212c6a6e71ee32baff | a73cbb2ba2747b820e1262e271d39cf8 | Generate random IPv6 address generators. | namespace MockingData.Generators.Extensions
public class ItGenerator : IItGenerator
public string RandomIPv6Address()
{
var suggestedIp = SuggestedIPv6Address();
if (_onlyUniqueIPv6Addresses)
{
while (_generatedIPv6Addresses.BinarySearch(suggestedIp) >= 0)... | 1 |
f74cea44146dfc7e5a4999d542797cf3 | 2c572f94c5d3c6523f25b9fd72293040 | 遍历所有事务实例进行事务提交 | {
foreach ($this->useConnect as $key => $val) {
foreach ($val as $connects) {
list($id, $connect) = $connects;
if (!$connect->isTran()) {
continue;
}
$connect->commit();
}
}
$this->hasTrancation = false;
} | 1 |
6e1f9a79b1be9eae71bc1cca382aa31f | 7bc9110bc073b5e35dea5b26fe57a61e | Delete old files and generate all feeds | if (os.path.isfile(self.cgi_db) and self.no_feed_update is not None):
print("FeedManager: DB exists. NO_FEED_UPDATE is set...")
print("FeedManager: Skipping feed update!")
return
for feed_id in self.mcc_list:
feed_file = FeedManager.place_feed_file(self.fe... | 0 |
05d9227161c160926466f4c5653acff4 | 37b872e481b377a70f4463bd6f419510 | Tests that CV qnodes can compute the correct gradient when the same parameter is used
in multiple gates. | dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev, interface=interface)
def circuit(x):
qml.RX(x[0], wires=[0])
qml.CNOT(wires=[0, 1])
return qml.expval(qml.PauliZ(0)), qml.expval(qml.PauliX(1))
x = qml.numpy.array([0.543, 0.2], requires_grad=T... | 0 |
4c12f873b24a9b9be17eb49aea70990b | 77fe952f3fa94cba5c4066cbbca13325 | Indicates whether the simulation is completed or not
Returns | class Simulation(object):
def isinitialized(self):
return self._isinitialized | 0 |
740ada2c2a2718e8bba138490e1a3a03 | 060fc1e2ce9a5314bb63d8642a5a9cd7 | return true if ter1 is a neighbor of ter2 | public boolean isAdjacent(Territory terr1, Territory terr2) {
return terr1.isAdjacent(terr2);
} | 1 |
a404373c241e1699d0423d502d7f5ca1 | 18d165011f91173cb7eb2c6f6bfb1bb8 | Get a string which uniquely represents the algorithms and keys used to encrypt the data. | class TKEYRecord extends Record
public function
getAlgorithm() {
return alg;
} | 0 |
50540693fcb8e032d50969489de64986 | 02a35fd4a048c88b83ce3b3733e3edf9 | 根据O'Brien的混合法则计算在cracks中的层间出现分层时的总能量释放率
!!! 注意: 如果出现多个裂纹,计算结果是这几个裂纹一同扩展时的总能量释放率 | def calculate_total_E(crystal, O_loc, H1_loc, H2_loc):
en = len(E_Labels)*[0]
if MIRROR_H2O_IN_PERIODIC:
crystal = mirrorH20(crystal, [O_loc, H1_loc, H2_loc])
def calculate_single_E(atom1, atom2):
r = nl.norm(numpy.array(atom1["coord"]) - numpy.array(atom2["coord"]))
if r == 0:
... | 0 |
63f52656a9566cd5165d67aaa3776d41 | 26bdd241afeb03467ef7305f7f604c7f | Indicate whether the robot functional tests all passed | def runner_tests_ok(tests: RunnerTestResults) -> bool:
return False not in [result for test, result in tests] | 1 |
4e85374dc2bc5733baf3da47534cb5eb | f47d389e692168057e8d05c8a3fd4e30 | Add one value to histogram. This increases the count of the relevant bin by 1 | namespace CSL.Statistics
public class Hist
public void Add(long valueToAdd)
{
long currentLeftBorder = 0;
long currentRightBorder = 0;
if (valueToAdd == 0)
{
histogram[0]++;
}
else
{
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.