query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
675b2a52813daa97ad1276912c164187 | 5e51ad734d6af0a9a73e550b5e4458cc | Méthode permettant de retourner tous les produits d'une marque donnée et le nom de la marque | List<ProductEntity> result = new LinkedList<>();
String sql1 = "SELECT * FROM CATEGORIE WHERE libelle = '"+category+"'";
try(
Connection myConnection = this.myDao.getConnection();
PreparedStatement stmt1 = myConnection.prepareStatement(sql1);
){
... | 0 |
54ceaef48b97654e482f80f84a73405b | f979f0e62a2c032d8c79d819205ab8e3 | Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Currently we do not specify a default of \'1\' in the denominator, but this is b... | public abstract class BaseMedicine implements Serializable
public void setMedicationTimes (java.lang.String medicationTimes) {
this.medicationTimes = medicationTimes;
} | 0 |
5f420d35b2be2142b6aa8b1ed94b1e9f | 952be14de2e232a2b708cbb5d4790409 | Extract directive and condition from the given content | {
$result = null;
$length = strlen($content);
while ($position < $length) {
$tokens = self::tokenize($content, true, $position);
$separator = array_pop($tokens);
$token = !empty($tokens) ? array_shift($tokens) : $separator;
switch ($toke... | 1 |
e8c11b840a810fc90443e632764d66c2 | 0eb4395ffd31a89e96700d3ac0bcfc25 | Load questions from the given XML file. | result = []
try:
f = open(fileName, "r")
line = f.readline().strip()
while len(line) > 0:
line = line.split(";")
result.append(Question(int(line[0]),line[1],line[2],line[3],line[4],line[5],line[6]))
line = f.readline().... | 0 |
0ca5989319911c4008b7589d0b8bdde7 | 390aa53207e90d7706a885276dba36d2 | 获取所有的电影列表,只取标志位为1的那些电影 | public static List<Movie> getFavor()
{
String cmd = "select * from movie where favor=1 and type='normal'";
List<Movie> list=(List<Movie>)BaseDao.select(cmd, null, Movie.class);
return list;
} | 1 |
fb5cbdb6f6d62b1287bde0314ea487b3 | dc4052125fd574502ee559fef387aef3 | checks for and deletes award number | class AdminController extends Controller
public function destroyAward($id) {
if (Auth::user()->admin===1) {
$award = Award::find($id)->delete();
$awards = Award::all();
$categories = Category::all();
return view('admin.award')->with('awards', $awards)->with('categories', $categorie... | 1 |
724df389a043f7d37254182325133044 | 66d9606184897b15fc96b8a1d7d0714e | shows the record food page | class FoodController extends Controller
public function show(Campus $campus, Food $food)
{
return redirect()->route("food.index");
} | 0 |
d1fd87a9e9099c243ad8714d7a4ea1e1 | 27f0955761ca28ce6c21a03fd9accf83 | Sort elements of slist container with user-specifide order relation. | void sort_list(struct single_list_t* root_node, uint8_t order)
{
uint8_t flag;
struct single_list_t *cur_node, *next_node;
if (root_node == NULL) {
return;
}
while (1) {
flag = 1;
cur_node = root_node;
next_node = cur_node->pnext;
while (cur_node->pnext != NUL... | 1 |
e1e1fcd49c1ccad01ef4abe2afda0a6d | 3f2b2009ba574937e62b2326f00b83db | 设置直播计数 | var numbox = $('.live_online_number'),
url = $('#live_online_url').val();
numbox.each(function(){
var o = $(this);
var curid = o.attr('curid');
var addcur = o.attr('add-cur');
var data = {id:curid,addCur:addcur};
$.post(url,data,fun... | 1 |
fa628212878adbb3a1a2cdcdaa0edd4b | a021353d26bedfdba6aa8047bed5b3a9 | Compare two variables of type TPM2B_DIGEST. | printf("Running StructureSuccessArrayTest\n");
SETUP_STRUCT(TPM2B_DIGEST, 0)
value.t.size = sizeof(TPMU_HA)-1;
UINT16 bytes_marshalled = TPM2B_DIGEST_Marshal(&value, &buffer_ptr, &size);
UINT16 expected_bytes = sizeof(UINT16)+(sizeof(TPMU_HA)-1)*sizeof(BYTE);
CHECK_EQ(bytes_marshalled, expected_bytes);
RE... | 0 |
9c7133e56b299e74f8dc1f058e3bde4f | 54206b195bafdf09d5fcb37624c53db8 | 计算配置的公式,并将数据放到基础数据对象中 | public class DataSetInstance
private void calculateSummary(DataTableInstance dti, String billID) {
StringBuffer calSqlBuf = this.calFormualSql(dti);
if (calSqlBuf.length() > 0) {
calSqlBuf = calSqlBuf.delete(calSqlBuf.length() - 2, calSqlBuf.length());
DataTableMeta dtm = dti.getDataTableMeta();
List<Recor... | 1 |
b6cf81aa42dead7d0d1de23eef01ccf4 | 2bbd48d6ed57724c2fec4bb4b942a8c4 | 골드바흐의 추측 검증 | int goldbach(int num, int *p1, int *p2){
int i;
int j;
if (num % 2 != 0 || num <= 2)
return 0;
for (i = 3; i <= num/2 ; i++)
{
for (j = 3; j < num; ++j)
{
if( isPrime(i) == -1 && isPrime(j) == -1)
{
if ( num == i + j )
... | 1 |
e81605784fd9c86bda6216b0c9c1f0e7 | c59ce2d4ad75a3c142ebd8ea92b78162 | 替换下载在线地址模板 | CommonUtils.registerAPIObserverMgr(METHOD_TEMPLATE_DOWNLOAD, observer);
Bundle bundle = new Bundle();
bundle.putString("a", id);
bundle.putString("b", getEngineVersion());
bundle.putString("c", getLanguage());
CommonUtils.startService(ctx, SERVICE_ACTION, METHOD_TEMPLATE_DOWNLOAD, bundle);
} | 0 |
3b67d1d749847a5b81188c7806f5e5a2 | 1d5601f60101924d6eb35b58b3ea4546 | I'm a regular property, not a trait. | class ReflectionProperty extends ReflectionElement
public function isMagic()
{
return FALSE;
} | 1 |
a6a53b5ba15f35731bd41a51f410045a | a6b3c80241945275f081cdd9b4b6555d | Creates an new identical nested namespace. | export class Namespace
constructor(parent: Namespace | null, name: string) {
this.parent = parent;
this.name = name;
} | 0 |
825dcb2c03e033553f722b3502c57ffb | 2d1638d083518a54075f6f26876137ba | Нахождение суммы цифр числа | public class HomeTask1
public static long calculateSum(long number) {
long numberLocal = Math.abs(number);
long sum = 0;
while (numberLocal > 0) {
sum += numberLocal % 10;
numberLocal /= 10;
}
return (sum);
} | 1 |
902987ec6c3a7b590ffa80c635472eaf | 9622b11dfaf7c592392cf36d35f19087 | Create a particle system, will be used to randomly generate
spawn points. | particleSystem::particleSystem()
{
} | 0 |
d1058f6fd5710a4a60d05262c115ff27 | 25a0fa60f505016c0d1abe12e958bb35 | Write 6 wiggles files. 3 for denominator and for nominator - total
coverage, coverage forward strand and coverage reverse
strand. At this point the normalization by count per billion
takes place. | class CoverageRatioCalculator(object):
def write_numerator_and_denominator_wiggle_files(self):
self._write_wiggle(
self._calc_averaged_coverages(
self.coverage_denominator_normalized),
"denominator_{}".format(self._denominator_name))
self._write_wiggle(
... | 1 |
25c8f1975be0eb5c1b83883b2649711a | a627830f864f163ff2c11cbc5f4af592 | Carrega a p�gina de lista de usu�rios. | @WebServlet(name = "UsersController", urlPatterns = {"/UsersController"})
@MultipartConfig(maxFileSize = 1000 * 1000 * 5, maxRequestSize = 1000 * 1000 * 25, fileSizeThreshold = 1000 * 1000)
public class UsersController extends HttpServlet
@Override
protected void doGet(HttpServletRequest request, HttpServletRespons... | 1 |
15d732d3a7079faf419665748deb3e4c | 14f6437fa39842208796224c071ee4c2 | StGermain_ParallelepipedVolumeFromCoordList -
shortcut for StGermain_ParallelepipedVolume - assuming nodes laid out in order of
Left Bottom Front
Right Bottom Front
Right Top Front
Left Top_Front
Left Bottom Back
Right Bottom Back
Right Top Back
Left Top Back | int i, dir,nrfrontnodes;
IssmDouble levelset[NUMVERTICES];
int indicesfront[NUMVERTICES];
GetInputListOnVertices(&levelset[0],levelsetenum);
nrfrontnodes=0;
for(i=0;i<NUMVERTICES;i++){
if(levelset[i]>=0.){
indicesfront[nrfrontnodes]=i;
nrfrontnodes++;
}
}
_assert_(nrfrontnodes==2);
if((NUMVE... | 0 |
4b69de384d37faac28e9c6abce0b0bf6 | 60e7ff091f8c45e61da5729a7adaf5d6 | задаем количество обслуженных посетителей. | class Restaurant():
def set_number_served(self, served):
self.number_served = served | 1 |
9d86043c7dbab74f0a5c0b20906b6241 | 7b5154a3ef94132f4dd4c825778dda8e | Reduce error until it is below tolerance (recursively for all results) | public class ID3 extends Categorizer
private void reducedErrorPruning(ID3Node node, ID3Node parentNode, int nodeParentKey)
{
int timesReturned = 0;
if (node.isLeaf())
{
}
else
{
int[] keySet = new int[node.getChildren().keySet().size()];
int ke... | 0 |
6065ca8a61a661c4fd1e02bd09dac688 | 96ef38c744b4553fc01bc92c5ab75bb7 | Flip Image Left-Right | def flip_left_right(img):
img = np.fliplr(img)
return img | 1 |
78160e31128a4848236986f2c14a9c0b | a6ae04aa81f09192f2207ea00f51f941 | Allow inquiry of just the code reference. | class GetLinkResult:
def reference_only(self) -> Optional[bool]:
return pulumi.get(self, "reference_only") | 1 |
778b012837910b0138769dc021f7f5b8 | a81e72ea4d18118a849685e082da0f58 | 向输出流中写入一个字节数组,并可以指定偏移量和长度 | public class ByteArray implements IDataInput, IDataOutput
@Override
public void writeBytes(byte[] bytes, int offset, int length) {
dataOutput.writeBytes(bytes, offset, length);
} | 1 |
861198a3d48319640ff4fc991c5123eb | 8fab4beda9f02bace05a4fb01f4ea1b6 | 下载商铺图片,写入本地商铺文件夹 | text = response.body
file_name = response.url.split("/")[-1]
with open(self.spider_path + "shop/" + file_name, 'wb') as fw:
fw.write(text)
fw.close() | 1 |
35bd4b119befed3abebfc8332cc8db72 | d99100c2a35fe72210424fcc8c927ccb | Removes rare goods. Takes only specific goods, num per month sold of which more than rarity num. | namespace Ennui.Api.Filter
public class HarvestableDropFilterChain : FilterChain<MobHarvestableDrop, HarvestableDropFilterChain>
public HarvestableDropFilterChain FilterByRarity(int min, int max)
{
return Filter(new RangeRarityFilter(min, max));
} | 0 |
d45efac5754f12eee4b0b9f906f2ec21 | 406085af3b575825e0dab1e30525221f | region #数据绑定初始化 - 绑定当前已有子项的值到内存表!!! 当前内存表中应该没有数据 | protected void initBindData() {
ArrayList<QFormViewModel> treeChilds = mViewModel.getTreeChilds();
if (treeChilds != null) {
for (int i = 0; i < mMemoryTable.size(); i++) {
Map<String, String> row = mMemoryTable.getRow(i);
for (QFormViewModel childVM : tre... | 1 |
9643b2141a24086583e47950510d6cb8 | 1cb764ebc002ccb6c29396c4457bedf0 | Truncates the vector in-place | match self {
TinyVec::Inline(a) => a.truncate(new_len),
TinyVec::Heap(v) => v.truncate(new_len),
}
} | 1 |
48436e2d9b5458d567bdc00ad5597e88 | c0b3cf5eb4ece17390f9e3bbeb1de3cf | Accessor for the group by properties (a tuple instance or None). | class ColumnDefinition(BaseItem):
def column_group(self):
return self.properties.get('columnGroup', None) | 1 |
402a0987e3ac16f92fd6e9f1bab85771 | 9637b67579d61b5d54c836402a293055 | 测试系统分隔符 | String separator = File.pathSeparator;
System.out.println("系统文件分隔符... "+separator);
separator = File.separator;
System.out.println("系统默认名称的分隔符..."+separator);
} | 1 |
0ba3b79e2b86efe07d68d17368cc506f | e5c52aaef24cd16630dbf1f7a555cf16 | Выбрать из нескольких записей адресной книги одну | {
return ($entry = $this->parseSingleResult($result)) === null ? null : $this->newAddress($entry);
} | 0 |
ada8deb4c197795236199045c25dbf1f | 81ea63c73cbf843cd9b617b4b961083d | 根据子进程的返回,更新统计信息 | {
if (isset($this->subProcessPidMap[$pid])) {
if (pcntl_wifexited($status)) {
if (pcntl_wexitstatus($status) == parent::STOP_EXIT) {
unset($this->subProcessPidMap[$pid]);
return;
}
}
$this->makeSubPro... | 0 |
914192d4630e8f0a00d66303fcbc844c | 60b6efd1951c0e2349a15ab0f6723d8a | Compares the supplied address to all known pool payout addresses. | class Script
def to_addr
return p2pkh_addr if p2pkh?
return p2sh_addr if p2sh?
return cp2pkh_addr if cp2pkh?
return cp2sh_addr if cp2sh?
nil
end | 0 |
a5af8394c430f6ffbd472d570f6cc52d | bc575c63dfa1e2769e516fea5bcdd444 | 转换群组消息 | let usernames = payload.to_usernames;
let addGroupOther = '';
for (let user of usernames) {
if (user.username === global.user) {
addGroupOther = '您' + '、';
} else {
let name = '';
if (user.nickname && user.nickname !== '') {
name = user.nic... | 1 |
4ee30c6ad0f5aed00f76df69d4da3e9e | 26e9154f8f78c6a9b5c18dec4cac1589 | @brief Write a GEN_REQUEST64 work queue entry. | {
qib_write_kreg_port(ppd, krp_senddmalengen, ppd->sdma_descq_cnt);
qib_write_kreg_port(ppd, krp_senddmalengen,
ppd->sdma_descq_cnt |
(1ULL << QIB_7322_SendDmaLenGen_0_Generation_MSB));
} | 0 |
a7e8af3003bb6a901e2f6471d17ec35c | ca7eff167fb428483ac1cec00e0ed499 | Footer Info links. | $separate_meta = __( ', ', 'lzrestaurant' );
$categories_list = get_the_category_list( $separate_meta );
$tags_list = get_the_tag_list( '', $separate_meta );
if ( ( ( lzrestaurant_categorized_blog() && $categories_list ) || $tags_list ) || get_edit_post_link() ) {
echo '<footer class="entry-footer">';
lzres... | 1 |
04b9697fca4a0a089a678446d2ff1905 | b7fa0f786476b69dd2c1f2cb6e31ebc6 | Setter for <code>bot.GPT_TRANSFER_PRICE_LIST.PRICE_TYPE</code>. | @javax.annotation.Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.5.0"
},
comments = "This class is generated by jOOQ"
)
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class GptGuideServicePriceListItemRecord extends org.jooq.impl.UpdatableRecordImpl<dshumsky.jooq.generated.ta... | 1 |
ac5767fb480c73e9584dbe552014acd6 | ba262bedde5a12b04ac04b2aee058f7e | Удаление записи о режиссере с указанным id | class DirectorController extends Controller
public function destroy(Director $director)
{
if ($director == null) {
$message = Lang::get('message.error_undefined');
return redirect('/directors')->with('error', $message);
} else if ($director->videos()->count() > 0) {
... | 1 |
68e86f2ac6a9520e84642020691e9d57 | 3021ff3e05dcb50fd0e23de8b85869d6 | 将指定的日期标记为当前月份的假日。此方法仅在控件的通用版本中实现,而在本机控件中不执行任何操作。 | if (year == mYear && month == mMonth) {
for (int i = 0; i < mDays.length; i++) {
if (mDays[i].mIsInMonth && mDays[i].mDay == day) {
mDays[i].mTimerFlag = true;
break;
}
}
}
} | 0 |
bcbf09e632c738aca4473cc0f7933794 | 21a0df210289b9d7dc296a3fa27f3bc8 | Callback invoked by the SAX parser whenever a _closed_ XML tag
has been found. | try {
m_writer.write(CDATA_DELIMITER_CLOSE);
m_cdataTagOpen = false;
}
catch (IOException e) {
throw new SAXException(e);
}
} | 0 |
6af2052fecc5275d5560f21e2888c517 | f98c36dd3e38e84dc5af3028fa6c21e8 | アクセス制限としてブログタグの新規追加ができるか確認する | {
$permissionsService = $this->getService(PermissionsServiceInterface::class);
$addUrl = preg_replace('|^/index.php|', '', Router::url([
'plugin' => 'BcBlog',
'prefix' => 'Api/Admin',
'controller' => 'BlogTags',
'action' => 'add',
$blogCont... | 1 |
8f3a0ea05f09849a6ea2dcc76a1c0158 | aa8387605d5499118b01fd43db50b44f | View SIG specific candidates and their status | class iFlyLoglib():
def get_candidates(self):
return [item.text for item in self.keylog.get_keys('candidate_key') if item.shown == 'true'] | 0 |
c5ddb0be07b427ee2e50e2ac87924d08 | dda3e0a6aaad56db7af6957ca7262d0b | 查询城市编码API-正常的接口测试用例 | class TestIftttLinkageQueryList(unittest.TestCase):
def test_ifttt_linkage_query_list_01(self):
result = ifttt_linkage_query_list(subjectId_Gary_cube)
self.assertIn('"code":0', result.text) | 0 |
cb83bd1af7a19631764def25bc069487 | 350904d8cc00e1a2cd5ba2b5989ab422 | https://stackoverflow.com/a/17268489 | function getScrollbarWidth() {
let outer = document.createElement("div");
outer.style.visibility = "hidden";
outer.style.width = "100px";
outer.style.msOverflowStyle = "scrollbar";
document.body.appendChild(outer);
let widthNoScroll = outer.offsetWidth;
outer.style.overflow = "scroll";
... | 1 |
167e6d2679ee2a17b06fea859464926b | a5b7f01e9156519b20062db71e48e6de | 更新纪念日 | class Account extends Component
_updateBirthday() {
if (__DEV__) {
console.log('update birthday');
}
const birthday = appStore.data().getIn(['customer', 'birthday']);
const birthdayDate = moment(birthday, 'YYYY-MM-DD');
if (__DEV__) {
console.log(birthday,... | 1 |
5f36447ff95afca623fba1a7b24c2f95 | caf77fc5eb8d556b5cb9540cc7053da5 | .....................................................
OpenMP statements
..................................................... | {
vector<OpenCLNDRangeVar> GV = loop->getOclLoopIndexs();
vector<OMPMultIterIndex> multIterIndex = loop->getForStmt()->getOMPFor().getMultIterIndex();
bool hasMult = (multIterIndex.size() > 0) ? true : false;
unsigned ii = 0;
Out << " //-------------------------------------------\n";
Out << " //OpenCL global ind... | 0 |
4294fbbf69a755ed73b9105bca36a9f5 | ef0695778bc530f0ff6868d006a99161 | Function uses a google image crawler to scrape a desired number of google images and save to a directory | def retrieve_image(img_data, number_limit):
full_name = "images[" + str(number_limit) + "].png"
path = 'C:\\Users\\YourName\\Desktop\\crawler'
response = urllib.request.urlopen(img_data)
data = response.read()
f = open(os.path.join(path, full_name), 'wb')
f.write(data)
f.close() | 0 |
a1dd4eb6ea8cda9bdc5e027420e92444 | 2d0ce8777b451446c698cbd160a0318c | Test that we discard a set when the HTLC is lost | let nodes = create_network(3);
create_announced_chan_between_nodes(&nodes, 0, 1);
let chan_2 = create_announced_chan_between_nodes(&nodes, 1, 2);
let (payment_preimage, _payment_hash) = route_payment(&nodes[0], &[&nodes[1], &nodes[2]], 3000000);
let revoked_local_txn = nodes[2].node.channel_state.lock().unwrap().b... | 1 |
f172383954d99a31e23f6b8de9e50f1e | a31cf5076c746f363b98f104dc46dbc4 | Returns the max of the values of the cells in the disk. | namespace enigma_user
variant ds_grid_get_disk_max(const unsigned int id, const double x, const double y, const double r)
{
return (ds_grids[id].find_disk_max(x, y, r));
} | 1 |
5ce80b6b4606710e14f6ba8cb303f414 | 388427d9f1ee9d2e5a8ef957b87d63f1 | Hide Plugin Update Indicator | if ( !current_user_can( 'update_core' ) ) {
remove_action( 'admin_notices', 'update_nag', 3 );
}
} | 0 |
db3c87a74153793f074b08704a77edfe | d0011e3e1a621d0cb5704b7c741b13c2 | Gets percent magic damage mod. | public class RuneStats implements Serializable
public float getPercentTimeDeadMod()
{
return PercentTimeDeadMod;
} | 0 |
eb97bf93bab921e35dbc7d39fbea0095 | 3c0a1234f4943533496894a29d5c4977 | Test if protected routes are not accessible to anonymous users | class AuthorizeIndexTest extends TestCase
public function testProtectedByAuth()
{
$response = $this->get('/authorize');
$response->assertRedirect('/login');
} | 1 |
3129f4d427afad5457458c84dae94fc0 | e75c33faefd2cfb1cdee5cebeac4b2f7 | gets the id of the discipline | class Discipline:
def getId(self):
return self.disciplineId | 1 |
9aa7a5190fb6a44dedb619a6c0373186 | 2a41bb486ba98e3af5fd69740640538c | <p>
Retrieves an attribute group by its ARN, ID, or name. The attribute group can be specified by its ARN, ID, or
name.
</p>
target="_top">AWS API Documentation</a> | java.util.concurrent.Future<ListAssociatedAttributeGroupsResult> listAssociatedAttributeGroupsAsync(
ListAssociatedAttributeGroupsRequest listAssociatedAttributeGroupsRequest); | 0 |
b86404067797fe031c218ad0ab7cc15c | 6e9753641e4275ceab5b55ff8bea2e8d | Метод, рекурсивно рисующий фрактал ковёр Серпинского. | public class OriginalFractal extends JPanel
private void drawFractal(Graphics g, Circle a, Circle b, Circle c) {
Circle d = soddyCircle(a, b, c);
if (d.getRadius() > MIN_RADIUS) {
d.drawCircle(g, randColor.getNewColor());
drawFractal(g, a, b, d);
drawFractal(g, a, d, ... | 0 |
5911d4d2afc7878b5c0d4de196183f82 | 11872eaf0cac2cfe2776239b639ceb3f | Turn the security flashing lights on. | export class Mozi
turnOnLedFlash()
{
i2cSendByte(this.currentDeviceAddress, 0xb0);
} | 1 |
a9dfb913bc6ca457119fc53c673095ef | 8580adaeed25bf6215a49ba011395f54 | Устанавливает менеджера на заказ | class Client
public function getOrderManager()
{
return new Order($this);
} | 0 |
0686f9a055d40b0e4e3f721c948c2809 | d3f809125f1f154138b3563a43ccaa57 | #correlation matrix with p-values | mat <- as.matrix(mat)
n <- ncol(mat)
p.mat<- matrix(NA, n, n)
diag(p.mat) <- 0
for (i in 1:(n - 1)) {
for (j in (i + 1):n) {
tmp <- cor.test(mat[, i], mat[, j], ...)
p.mat[i, j] <- p.mat[j, i] <- tmp$p.value
}
}
colnames(p.mat) <- rownames(p.mat) <- colnames(mat)
p.mat
} | 1 |
2c313e6bcd4da0a125a5504d67c9f42e | 3c687e96657d0024283933afd087cc8e | @brief This function handles DMA TX interrupt request. | {
ald_uart_handle_t *hperh = (ald_uart_handle_t *)arg;
hperh->tx_count = hperh->tx_size;
ald_uart_dma_req_config(hperh, ALD_UART_DMA_REQ_TX, DISABLE);
hperh->tx_count = 0;
ald_uart_interrupt_config(hperh, ALD_UART_IT_TBC, ENABLE);
CLEAR_BIT(hperh->state, ALD_UART_STATE_TX_MASK);
return;
} | 0 |
9dfba639780c17a83c8e7f8b44e88ffe | c13529188e8ac7ef596d916c5c0b1e25 | Devuelve una lista de posiciones en las que hubo cruces sin elementos repetidos. | def dic_posiciones_coincidentes (l1, l2):
return {i: x for i, (x, y) in enumerate(zip(l1, l2)) if x == y} | 0 |
d2237745e133c0c5683e9baf41271021 | ec5c0dd0574628831c49258759aba278 | Takes an asana task id, and the name of a file. Uploads file to asana task.
It is assumed that the file is in the current directory. | def upload(args):
filepath, note, notebook = split_args(args)
notebook = fuzzy_find(notebook, PW.notebooks)
note = fuzzy_find(note, notebook.notes)
note.upload_file(filepath) | 0 |
3c252c45a2c03be60b7d95af35afdd56 | badf348f6a22cef0670e479f7d9d751a | 根据书名查找书本信息,并返回DataTable类型 | namespace BLL
public class BookManager
public static SqlDataReader select(string bookname)
{
return BookService.select(bookname);
} | 0 |
c2fbe04e9c5df9798386ea52317908db | 432b5c27e4376771a26b592c7d91745a | Finalize ECMA components | javacall_result finalize_wma_emulator() {
close(smsDatagramSocketHandle);
close(cbsDatagramSocketHandle);
#if (ENABLE_JSR_205)
close(mmsDatagramSocketHandle);
#endif
return JAVACALL_OK;
} | 0 |
2e9cd81ed99ba2b73af5ba5e95435772 | 079f10b003add30b5e8823efe6a74561 | 将Mesh标记为不可读,可减少内存,标记后不可再调用相关读取方法。 | {
#if UNITY_EDITOR
if (_meshRenderer == null)
{
_meshRenderer = GetComponent <MeshRenderer>();
}
#endif
if (_meshRenderer)
{
_meshRenderer.enabled = false;
}
} | 0 |
b9080f4ee692bdcbf2be1f00ed46c31b | 276461122a0608aa764bd64e4ebf23cc | Возвращает данные об изображении по URL.
Если URL не является поддреживаемым адресом
изображения, то вернется null. | public function getImageInfo($path); | 0 |
6c4ac9a262dac0ab70c286e4295dc22d | 7b6de2a7b0acff2d09d679cde3e94538 | Method used to check whether the statement is inverted. | class BetweenExpressionNode extends Node
public function isNot()
{
return $this->not;
} | 1 |
af40884f5b831fce8218e8247dba4787 | 19bf3bb14352b5eae0e226ad037ba8a7 | Load the data of the interfaces from a file | public class NetworkSimulator
private void loadInterfaces() {
List<String[]> lines = FileUtil.readFile(interfacesFile);
for (int i = 0; i < lines.size(); i++) {
String[] parts = lines.get(i);
Neighbour neighbour = neighbours.get(i);
neighbour.setAddress(parts[0]);
... | 1 |
d2bff913792e9ec5ae0966fb09d5e74f | 07d202b08bd1bc40c41bc7e1ffd9cdbd | Connect to the local OPC Server with the specified CLSID. | namespace Opc.ConfigTool
void Load([MarshalAs(UnmanagedType.LPStruct)] Guid clsid); | 1 |
787458d1ab29b6ac3913acbe367b1779 | 2664fc5f7f4700d7532496d42be3df1c | 判断字符串是否为数字(正负数或者小数) | public class ValidateUtils
public static boolean isNumber(String str, String sign) {
String regex = "";
if ("+".equals(sign)) {
regex = "^[+]?[0-9]*$";
} else if ("-".equals(sign)) {
regex = "^[-][0-9]*$";
} else {
regex = "^[+-]?[0-9]*$";
}
return match(regex, str);
} | 0 |
988c9d31a1921b63141dfe38e8c2da39 | bd2d25d8bbd391330195cd5d2e460607 | picks the most uncertain examples based on the query strategy | uncertainty = mc_dropout_uncertainty(model, X_u, nb_mc)
query_idx = np.argpartition(-uncertainty, n_instances-1, axis=0)[:n_instances]
return query_idx, X_u[query_idx] | 1 |
04546ef07bd5ed03f4cae639851c7550 | 651e64b01780c11044a2b0109f5c06af | Test search URL without tags.
Return value should be in JSON format | class EventEndPoint(unittest.TestCase):
def test_search_all(self, mock_DB_search):
mock_DB_search.side_effect = EventEndPoint.DBsearch_side_effect
event['tags'] = ["Any"]
print("datat sent")
pprint(event)
response = self.get_data(event)
self.assertTrue(response.status_cod... | 0 |
5cecd14a84bca0f319456683d1625e91 | 3906e5a619d9c30524709755f24bff48 | 关键词抽取,基于tf-idf | def extract_keywords(text, topk=5, method="tf-idf"):
if method == "textrank":
return jieba_analyse.textrank(sentence=text, topK=topk, withWeight=True)
else:
return jieba_analyse.tfidf(sentence=text, topK=topk, withWeight=True) | 1 |
0d3d06e1f603c83a7999adf933a39738 | 657a9e80faa0c2fa45db3bf4bc9b87de | 通过当前状态判断是否需要减速 | {
if ((int)movingSpeed <= 0)
{
moveState = MoveState::STOP;
}
else if (isMoveInputting && (int)movingSpeed < (int)MOVING_SPEED_MAX)
{
moveState = MoveState::ACCEL;
}
else if (isMoveInputting && (int)movingSpeed == (int)MOVING_SPEED_MAX)
{
moveState = MoveState::SPEED_MAX;
}
else if (isMoveInputting == f... | 1 |
c31cc4a23e478f00cd3e7e83b2f8a61b | dee66755a018a1bb37e927c08c5b0236 | Given an object that has fields annotated with CmdLine, and a field name,
return the name of the CmdLine argument (meaning, the actual command-line argument one would supply to
set this field). | public String getFieldName(final int index); | 0 |
b6a8c31f64ffb01de122447d0751888d | 25e19b857fff4a1ab784c0923a899e09 | 获取 feature 的base64表示形式 | @ServiceMethod(returns = ReturnType.SINGLE)
Mono<byte[]> getBase64EncodedAsync(); | 1 |
87b2e176c82e910cdfa57ce3ece5721a | e384b058c884e3b4d0b5d0bc2a241253 | # Finds cluster number for each row with the least Euclidean distance | toCluster = function(x, clusters) {
return(
which(abs(clusters[, 'lat']-x['lat'])==min(abs(x['lat']-clusters[, 'lat'])) & abs(clusters[, 'lon']-x['lon'])==min(abs(x['lon']-clusters[, 'lon'])))
)
} | 0 |
4fd6fef522f70d48c0e5e40a05d78be5 | 394eeb35344b7338a5fda637ef3cde5b | создание общего плана на неделю | class Main:
def everyweek(self):
self.ads.check_data()
self.tr.check_data()
self.tp.check_data()
tp_data = self.tp.report_data(config.WEEK_REPORT_DATE, self.date_report)
self.bar.update(60)
self.ct.check_data()
ct_report = self.ct.report_data(config.WEEK_REPORT_DA... | 0 |
86a72bcd22546db3b0a657b42bbc40a3 | f5a685ff1a1e69e35aad12988f960b06 | Extracts unigram bag-of-words features from a sentence. It's up to you to decide how you want to handle counts
and any additional preprocessing you want to do. | def extractWordFeatures(x):
counter = collections.Counter(x.split())
return dict(counter) | 1 |
eeef83a5e3cdc57d1dfd46c6d9d0d27f | ed62876eb193d5a0d7a1206f4feb23ba | 求一个点和圆的关系 | class Circle(object):
def get_relation(self, p: Pointer):
distance = round(math.sqrt((self.cp.x - p.x) ** 2 + (self.cp.y - p.y) ** 2), 6)
if distance > self.radius:
return '点在圆外'
elif distance == self.radius:
return '点在圆上'
else:
return '点在圆内' | 1 |
f6aab11f8e86729c112317a304551348 | d455e382a94e01fd2fab65208d1c632d | 点検項目ボタン押下時の処理 | namespace SlvHanbaiClient.View.UserControl.Input.Purchase
public partial class Utl_InpSearchPurchaseOrder : ExUserControl
public override void btnF1_Click(object sender, RoutedEventArgs e)
{
if (Common.gWinGroupType == Common.geWinGroupType.InpList)
{
if (entityList =... | 0 |
5524d1c2c71fc2748bbf51c25ecb7e76 | 38030afa7600c59265295ed0fc0db6e1 | 每天交易前执行 | def before_trading_start(context):
if g.t%g.tc==0:
g.if_trade=True
set_slip_fee(context)
g.stocks=get_index_stocks('000300.XSHG')
g.feasible_stocks = set_feasible_stocks(g.stocks,context)
g.t+=1 | 1 |
fb21c8b3b67b28ab9282051e3f7b55fe | d716314cd940885c031a116d7ff1e3e4 | 获取pdf文件保存路径 | export default class AcceptDataService
getPdfPath(params) {
return this.utilityService.asyncPost(this.alimsUrl + '/books/info', params);
} | 1 |
93bd65617df27757174051e8ba70013f | d3bd1c80bd1515fa3a70675a7546cccd | Implementation of packet replay window - as per RFC2401
Adapted from code in Appendix C at https://tools.ietf.org/html/rfc2401 | int
ipsec_chkreplay(u_int32_t seq,
struct secasvar *sav)
{
struct secreplay *replay;
u_int32_t diff;
int fr;
u_int32_t wsizeb;
int frlast;
replay = sav->replay;
#ifdef BUILD_ANDROID
TNC_LOGOUT("Call ipsec_chkreplay \n");
#endif
if (replay->wsize == 0)
return 1;
frlast = replay->wsize - 1;... | 1 |
3c9f2e5e9d91703a9cac10bb97de424c | 348bc5060f4a5a8416be12c794270a28 | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this Tbinstexterna is new, it will return
an empty collection; or if this Tbinstexterna has previously
been saved, it will retrieve related TbalunosRelatedByIdDestino from storage.
This method is protecte... | abstract class BaseAlmacen extends BaseObject implements Persistent
public function initOrdentablajeriasRelatedByIdalmacenorigen($overrideExisting = true)
{
if (null !== $this->collOrdentablajeriasRelatedByIdalmacenorigen && !$overrideExisting) {
return;
}
$this->collOrdentablaje... | 0 |
e2c2113d5cb269e1abe4fe34ef513a19 | c77b346fdc1e72517088bdba0d1a6c3b | Retourne l'unique instance de l'état vivant d'une cellule (Design Pattern Singleton) | CelluleEtat meurt(); | 0 |
a58f6c35f5ee0b693929ff6bcaba9d63 | dbbd617e11249e61f43d9ca7abcc6295 | transforms options to be displayed and filters them based in the search input the user types in | export class AppComponent implements AfterViewChecked, OnDestroy
optionsSearch(query: string): Promise<Array<any>> {
var options = SearchExampleStandard.standardOptions.map((o: string) => ({ title: o }));
return new Promise((resolve, reject) => {
var results = options.filter((o: any) => {
... | 1 |
ba38fe640b80b9686d6e8382a44f9259 | d7b6ec3d1377b545723c5fafe7617e2f | 更新分销商申请状态 | {
return Context.Sql("update DsDealerApp set status=@0 where sysno=@1", (int)status,sysNo)
.Execute();
} | 1 |
889b512043e499e3e9699aa640a23a69 | 1adec4c55462cb63df38cf57a550046f | add leaflet draw components | var draw = new MapboxDraw({
displayControlsDefault: false,
controls: {
line_string: true,
trash: true
},
styles: [
{
"id": "gl-draw-line",
"type": "line",
"filter": ["all", ["==", "$type", "LineString... | 0 |
f9c9184a8ee7721d3fd1dc74d6deb2dc | a5ebfb06b87cba22d3cf231ee8b57aad | 如果该插件某个依赖已经在主域中,则使用版本较高的那个. | class SqlExPlugin : Plugin<Project>
private fun configureDependencies() {
val groupName = "me.danwi.sqlex"
val artifactNames = listOf("core", "core-kotlin")
project.configurations.forEach { config ->
config.resolutionStrategy.eachDependency { resolveDetails ->
if (res... | 0 |
1089cd2620b214c451dc0525f5c2d947 | e654db15514d435d5844f9e8dff85b77 | 根据赞排序输出Top前20 | try:
result = self.redis.get(ZHIHU_REDIS_KEY)
except Exception as e:
logging.error(e)
result = None
if result:
return self.write({'status': 1, 'errmsg':'', 'data':json.loads(result.decode('utf-8'))})
else:
logging.debug('from sq... | 0 |
ae2e3ff4d58c04ece04618e4e1f2e4be | dd43144307ddc86984b73ebc90cb87eb | Add artifacts to {@link Document} document | default void makeArtifacts(JkArtifactId ... artifactFileIds) {
makeArtifacts(Arrays.asList(artifactFileIds));
} | 0 |
394f67df2a20dbee2c223f9af0cae79b | 0dff752a8d44a674b7eb3195acda6491 | 根据SaleOrderNo查询销售订单表 | Saleandorder queryById(Integer sid); | 0 |
d5d73f3ba1e8b48aafb5f2f5c32bfa03 | 03dab7844b1e0c76923df08a55915bd1 | Test that we can use the "all users" endpoint. | {
$restClient = new MockNorthstar($this->defaultConfig, [
new JwtResponse,
new UsersResponse,
]);
$response = $restClient->getAllUsers();
$this->assertInstanceOf(\DoSomething\Gateway\Common\ApiCollection::class, $response);
$this->assertEquals('Katheri... | 1 |
4edadfd02eed14abf53761585c4fcde6 | ecfc2f9c65a158b7af54ed02b03f052c | Method to return CountEntity. CountEntity is the entity for which the count is to be generated. | @RestController
@RequestMapping("/getme")
public class GreetingController
@RequestMapping("countentity")
Long countrecords()
{
return studentLogicLayerObject.countallindb();
} | 0 |
2b2ad0d0787638f2d2718183c79e8b89 | 76289337c8d54fa8846a859442af450d | Apply the user right depending of his role id | {
$auth = Yii::$app->authManager;
$role = array_keys($auth->getRolesByUser($userId));
if (in_array(self::C_DRIVER, $role)) {
return self::C_DRIVER;
} else if (in_array(self::C_MANAGER, $role)) {
return self::C_MANAGER;
} else {
return self:... | 1 |
0358861f017c23bd14092ef4bdc59158 | bfe1ca62c980b7681a5e3b68224fc3ab | Tests that inputs with "*" work as expected. | class AliasTest(RBTestBase):
def test_alias_substitution_star(self):
self.assertEqual(self._replace_arguments(b'$*', [b'a', b'b', b'c']), [
b'a', b'b', b'c']) | 1 |
928bf5b7f8e9f71993c3572f076b3be3 | 4e324735c647f192d6d07c19a15f25e2 | 获取文件是否可读 | public boolean isReadable(File f); | 1 |
7031c44887dcc2f21dcb05be4c9a988a | 2870ec66625692e0b5524b0a07c82d70 | a method that first splits input into small input tiles and perform convolution calculation
on them separately and later sums up different input channels and put the result into
the respective part in the ouput channels | class RTR_O4_Conv2d(nn.Module):
def forward(self, inputs):
weights_l = torch.einsum(self.equation_l, [self.kernels[0], self.kernels[1]])
weights_r = torch.einsum(self.equation_r, [self.kernels[2], self.kernels[3]])
weights = torch.einsum(self.equation, [weights_l, weights_r])
weights =... | 0 |
86325b05ddb143b3efbea29a16d08cfd | 61485bad053754c83ad768686935aa2c | 生成指定长度的随机字符串,字母加数字组合 | namespace Easycode.Common
public class RandomHelper
public static string RandAlphanumeric(int len) => Generate(Alphanumeric, len); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.