query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9d775bf45132f691a9a337c255661ac9 | 4f1cc8c04c6155594461d54dcb905e37 | - finalmente elimina los espacios sucesivos | char* sinEspacios(char* cad)
{
int tam = _strlen(cad);
int espacios_totales = ocurrencias(cad, ' ');
char* retorno = malloc(tam);
while(*cad)
{
if(*cad != ' ')
{
*retorno = *cad;
retorno++;
}
cad++;
}
*retorno = '\0';
retorno-=(tam-... | 0 |
78e97a87ead227c6bd9d96c3928a2b81 | 98de3dc82fbd224f272beac8b3d451f9 | Ensure that header updates are done case-insensitively. | if (typeof headerName !== 'string') {
headerName = String(headerName);
}
return headerName.toLowerCase();
} | 1 |
d03e741ee1f46869ea913022dc3dc11d | dfc96549d3b1d93e3e3fd2a09fd0dcee | <p>Retrieves the key store id.</p> | @Slf4j
public class KeyStoreKeyProvider implements RSAKeyProvider
@Override
public String getPrivateKeyId() {
return keyStoreConfig.getKeyAlias();
} | 0 |
c4fbe01fa6dc0a530aff335ab19d5648 | 973630987e8f2149487fb83fa1033824 | transform boolean into ✓ / ✗ | public class Task
public String getStatusIcon() {
return (isDone ? "✓" : "✘");
} | 1 |
fc34c97ba218755d0212bfb1e13a7dc8 | 4736f7c03ef6ac52d14515f6c05e98c7 | Evaluate the zeros of a non square MIMO system. | class TransferFunction(LTI):
def zeros(self):
if self.ninputs > 1 or self.noutputs > 1:
raise NotImplementedError(
"TransferFunction.zeros is currently only implemented "
"for SISO systems.")
else:
return roots(self.num[0][0]).astype(complex) | 0 |
defdbd2299f3de080f5bac6a597d1f26 | 83137910f7c862b4196fce46724030f9 | Метод проверки перед удалением сущности. Перед удалением сущности удаляются связанные объекты | {
userService.CheckPermission(user, Permission.AccountOrganization_Delete);
var receiptWaybillList = receiptWaybillRepository.GetList(organizationToDelete);
GetExceptionString(receiptWaybillList, 3, "приходной накладной", "и еще в {0} приходных накладных");
var mo... | 0 |
c147a0efe50b0c71d0439730fc1e9b9e | db501123b755a6baac96c51822c20d84 | retorna solo los leads de ese user | global $db;
global $userProfile;
return $db->getLead ( $userProfile->identifier );
} | 1 |
76cf643836da3735f2bc02aed0805a60 | 200080f95e40b5f146c6e8848fbd81ce | 将非数值的特征转换为数值 | def numeric_tranformation(col, df):
pass | 1 |
905ca5e2c3739f1382327106fa645e1e | 4ebac47cf8bbe62282e9a32e954a2c75 | Symmetric kullback-leibler divergence | def symKLDiv(mu1, S1, mu2, S2):
return 0.5 * (KLDiv(mu1, S1, mu2, S2) + KLDiv(mu2, S2, mu1, S1)) | 1 |
c7352736703862878ecc963290e6ac26 | 7a7c1cb7ae63d00e16c04462c0477385 | Tiny Image URL. | class TestFeedItemWithoutImage implements FeedItem
public function imageUrl(): string
{
return '';
} | 0 |
31fcb9439b8f61ef7b205c8c447bdd59 | f688688b3f82042b525109a9195608b6 | 查询指定日期日记 | public ApiResult readRecord(TextRecordDto textRecordDto, String token) throws Exception {
List<TextRecordEntity> recordEntities = textRecordManager.selectTextByDayUsrCharList(textRecordDto);
if(recordEntities==null){
throw new Exception("查询数据库失败");
}else if(recordEntities.isEmpty... | 1 |
d735a4469e63b75dd662af2673b554dc | 5412ec7afc0e534e767d5f8bbe20724a | Single Byte Transmit (TX) | {
while (U1STAHbits.UTXBF)
{
;
}
U1TXREG = tx_data;
} | 1 |
c12691e1440fd3087edd885dd5f4b8d5 | 1c33aa2c36b9cc05e1c7693a44c1b1d1 | 校验myLocator元素是否存在 | logger.entering(elementLocator);
By by = HtmlElementUtils.resolveByType(elementLocator);
ExpectedCondition<WebElement> condition = ExpectedConditions.presenceOfElementLocated(by);
waitForCondition(condition);
logger.exiting();
} | 1 |
2e39bd895b2e35a5029b164074d6f0df | 61aa84e890d6130edf62fd7778a75b6b | ! \brief Called when a Property initValue changes in the master. Adds a corresponding event to the event queue. | public class DefaultPropertyEditor extends JScrollPane
implements
PropertyEditor,
ModelListener,
PropertyStructureListener
public void masterChanged(boolean local, long viewID) {
} | 0 |
72d0ddc9045fa8b484864fe9dbc367e2 | 38dfea7624d3d647bd25a7b5bd9f4d57 | Whether this data type is an OTHER type.
<p>
The {@link SQLDataType#OTHER} type maps any unknown data types to a jOOQ
{@link DataType}. This includes unknown vendor specific types as well as
unknown user defined types which do not have any custom {@link Converter}
or {@link Binding} attached. The type may still be usab... | if (historicalOther == null) {
return false;
} else {
return historicalOther;
}
} | 0 |
7ec9b1e8c94ddc8b165179cdcda06ef0 | f035a12ee27dcf396140cdcd731d90ff | Adjusts scale and position to fit target in specified bounds. | if scale_value then
_x = _x / scale_value
_y = _y / scale_value
end
if xBounds then
target.x = clamp( xBounds[1], target.x + _x, xBounds[2] )
else
target.x = target.x + _x
end
if yBounds then
target.y = clamp( yBounds[1], target.y + _y, yBounds[2] )
el... | 1 |
d1f52431f255b52b6521e9f7a3150895 | 136214d452f5d7894d64a9b35e91dbac | Clear all interrupt status bits | void twim_clear_interrupt_flags (volatile avr32_twim_t *twim)
{
twim->idr = ~0UL;
twim->scr = ~0UL;
} | 1 |
c0135a92599e4e9fb88981e8879c382a | 98960b55360c802d02bcf088200023fe | Test for moreResults | {
if (!is_null($moreResults) && !is_bool($moreResults)) {
throw new \InvalidArgumentException(sprintf('Invalid value %s, please provide a bool, %s given', var_export($moreResults, true), gettype($moreResults)), __LINE__);
}
$this->MoreResults = $moreResults;
return $this;... | 1 |
099887ed7afb10a8d57de26cf4ff054d | b39426a96cb039ddb0f4e1069358ed85 | Set the minimum interval between acquiring tokens. | {
if ( intervalMillis < 500 ) {
_intervalMillis = 500;
} else {
_intervalMillis = intervalMillis;
}
} | 1 |
c6256ffbbb34780cc5e067ead1a4a834 | 0da7148d8f897240601e064afbf77cf9 | 获取是否自动改变测量距离单位 | try {
let isShowDistanceUnit = await MCCL.getIsShowDistanceUnit(this._MGMeasureListenerId);
return isShowDistanceUnit;
} catch (e) {
console.error(e);
}
} | 1 |
8624d2292b2d1df1caab891fdd17905d | eb6605f01157cf0704005af12dc127af | проходя циклом по всем метеоритам считает расстояние между каждым из них и кораблем
если расстояние меньше фиксированного, то происходит столкновение
т.е параметр столкновения становится равен правде | void rockContactByMissile(struct missile *mList, struct rock *rList) {
for ( ; mList ; mList = mList->next) {
for ( ; rList ; rList = rList->next) {
if ((mList->p.x < (rList->p.x + 8)) && (mList->p.x > (rList->p.x - 8))) {
if ((mList->p.y < (rList->p.y + 8)) && (mList->p.y > (rList->p.y - 8))) {
mList->t... | 0 |
f32376d44fa85d3a277571efd528865d | 7718af48d6325590f418a8bb64a38bfb | inodeブロックをstruct inodeにデシリアライズ | INode.di_number = di_number;
INode.state = 0;
INode.access_count = 0;
INode.owner = DINode.owner;
INode.group = DINode.group;
INode.file_type = DINode.file_type;
INode.mode = DINode.mode;
memcpy(INode.addr, DINode.addr, sizeof(INode.addr));
INode.block_num = DINode.block_num;
INo... | 1 |
4169fa8dc4c4433f43a1ff001a513c43 | 6cf9eff6be26a09815f77d90f17955d8 | Sets the query fields and their boosts using the same format as that used in
DisMaxQParserPlugin. These fields must also be added using {@link
#addMoreLikeThisField(String)}. | class SolrHelper
public function setMoreLikeThis(Query &$solarium_query, QueryInterface $query, $mlt_options = array(), $index_fields = array(), $fields) {
$solarium_query = $this->solr->createMoreLikeThis(array('handler' => 'select'));
if (empty($mlt_options['fields'])) {
return;
}
$mlt_fl = arra... | 0 |
b242a12f9064e9d92e0ebaa33e60a6ff | 635fcdd875b5cd3284568a71b5a53906 | 获取倒数第N个节点的父节点 | class CBstTree
BstPtr nth_node(int N)
{
if(!_root || N <= 0)
{
return NULL;
}
int k = 0;
queue<BstPtr> stack;
stack.push(_root);
while(stack.empty() == false)
{
BstPtr p = stack.front();
stack.pop();
k++;... | 0 |
fe6971511ff5be2773fc77e8d81140c8 | a0942b55d467aed5750455028f9959d1 | Returns the constraining predecessors. | @NotThreadSafe
public class SFactorGraph extends SNode implements ISolverFactorGraph
public List<IntegerEquation> getConstraints()
{
return _constraints;
} | 0 |
04ee91bdf05d1440c5df9e843f1ddf72 | 2793b793fbd199a160b8d2353a57a31d | Prints the most commons words in a histgram and their frequencies.
hist: histogram (map from word to frequency)
num: number of words to print | def print_hist(h):
for c in h:
print(c,h[c]) | 0 |
0f34555f60aff7bcca37ae7adc6f88e7 | 206767297d4212fa9e4fc8a0d5583115 | 刷新TB组,一个按下后其他的自动弹起(一组TB要放在同一个节点下) | if (this.isup == 'itup' && this.isdown == 'itdown') {
this.isup = 'isup';
this.isdown = 'isdown';
this.groupList=this.groupList.reverse()
} else if (this.isup == 'isup' && this.isdown == 'isdown') {
this.isup = 'itup';
this.isdown = 'itdown';
... | 0 |
719b4953ce20a5f0095d1abc4c0368a7 | 00d54eddec3731925db3dd2c8ae0cba5 | 向listView中添加问题标题,并启动getQuestion线程以获取具体问题 | public class MainActivity extends AppCompatActivity
private void addQuestionTitle() {
for (int i = 0; i < examinationName.size(); i++) {
QuestionListItem questionListItem = new QuestionListItem("\n " + examinationName.get(i) + "\n");
questionListItemList.add(questionListItem);
}... | 1 |
b6d191080bd96cce06a2a94188cc39c0 | 6f43d3c5edd461bb6800d882d2bd734c | Does not respond to itself | if message.author == self.user:
return
if message.content == 'hi':
await message.channel.send("bye") | 1 |
7707b1d2533fc9ee0089668c469ac2ab | 831e967de35cb3e33648824f714a2557 | Write an internal 64-bit SOC register through S-Channel messaging buffer. | void dma_chx_sar_write(struct dw_dma_chan_reg *reg, Bit32u val){
reg_direct_writel(val, reg, SAR);
} | 0 |
7d93abcc7a78ba569b3db1e33d042403 | eb37b721bab384358d55de84f1751c2a | Verify mouseUp updates state and calls handler properly. | public class GuiContainerManager
public boolean overrideMouseUp(int mousex, int mousey, int button) {
if (button >= 0 && (clickHandled & 1 << button) != 0) {
clickHandled &= ~(1 << button);
mouseUp(mousex, mousey, button);
return true;
}
return false;
} | 1 |
a854c27e403e2b53c6e64250217e54e9 | c0976f8ed0a8df2d1a778a785a83f77d | Find first non-alloca instruction. Every basic block has a non-alloc
instruction, as every well formed basic block has a terminator. | final FunctionExitNode exitNode, final String funcName, final BasicBlock pItem)
throws LLVMException {
assert pItem.getFirstInstruction() != null;
Value lastI = pItem.getLastInstruction();
assert lastI != null;
CFANode prevNode = newNode(funcName);
CFANode firstNode = prevNode;
CFAN... | 0 |
6a3fc1785799f726de9a52b7ca7da276 | e6b494dd927e2f79d1516eb80ca0fb94 | Take input from the gameplay/combat form, provide the appropriate results, and run end of turn regen/cleanup. | function endTurn(){
} | 0 |
9a0e80a2e7f4700a537ad625fc1d7cab | 517d05738873920216ddb167fc979673 | Constructeur de la classe avec un tableau de paramètres
Exemple :
'login' => 'login',
'mdp' => 'mdp',
); | $this->config = (is_array($dbParam) && !empty($dbParam)) ? $dbParam : AppConfig::$dbParam;
$this->connect();
$this->init();
} | 0 |
1547cbbd7cf7c2c614a768095e18b6d0 | 17b6e9a25ae3cf4258b5ccc23362f256 | Test activation of runes. | if not this.activate then return RESULT.NOT_YET_ACTIVATE end
if not player.IsGoldEnough(config.treasure.gold_price) then return RESULT.NOT_ENOUGH_GOLD end
if rune_count[player.GetVIPLevel()].count < player.GetVIPCount(4) then return RESULT.NO_MORE_TIMES end
if this.status[4]==1 then retu... | 1 |
c0aa7a259ddd735ca169d4161a4a68e1 | f2545da116919ddac6f5f3fc510e336d | Aktiverer kø. Kaller database klasse metode og returnerer kø-view | {
if( !isset( $this->databases[$name] ) )
{
throw new LibDb_Exception
(
'Database: Keinen Verbindungsdaten mit dem Namen: '.$name.' vorhanden'
);
}
if( isset( $this->connectionPool[$name] ) )
{
$this->activDb = $this->connectionPool[$name];
$this->activDbNa... | 0 |
15f5fa0a6ff48bea2aa268dca1ed1684 | c6713ebf90282bd2ded1e5a3d9925be5 | 统计指定栏目下的文章 | if(!isset($this->allChannel[$cid])){
$where['cid'] = array('eq',$cid);
}else{
$sonList = isset($this->allChannel[$cid]['son'])?$this->allChannel[$cid]['son']:array();
$cids = getArrKeyValue($sonList,'id');
if(!$cids){
$cids = [-1];
... | 1 |
41a2ee416eeb89926408d38ee40fd6ba | fccef8c92120843204c013524c9aa278 | 业务流水ID[SWT任务池中对应业务流水ID] | public class MyFlow extends Entity
public final long getWorkID()
{
return this.GetValInt64ByKey(MyFlowAttr.WorkID);
} | 1 |
f6b495f5e23202acef72099318bb7013 | 248e47c1878cb5f16faeba2d5c5a5f0d | Соединяет с сервером, используя прерываемый ввод-вывод | class ClientConnection
void start() {
Console console = System.console();
while (true) {
try (Socket outcoming = new Socket(InetAddress.getLocalHost(), 8800)) {
outcoming.setSoTimeout(5000);
try (ObjectOutputStream outputStream = new ObjectOutp... | 1 |
abef928f023e72da562e8876311379e4 | 0898bbab8b40ae83ee158fd61e43a92d | Execute an event on the client with one argument. Items will call this method because the items do not have a NetworkIdentifier and cannot call Rpc methods.
Note: A new method name was used because of a current Unity bug (697809). | {
if (args == null)
{
args = new List<string>()
{
NetId.ToString(),
type
};
}
else
{
args.Insert(0, NetId.ToString());
args.Insert(1, ComponentID);
args.Insert(2, type);
}
if (IsClient && IsLocalPlayer)
{
networkID.AddMessage(NetworkMessage.CreateMessage(N... | 0 |
229763d2c1276da13cea271818a8621b | 38d1a4d9c890e69b28c820640993c5dd | Returns the value of the '<em><b>Metamodel Alias</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Metamodel Alias</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | String getAlias() throws CompassException; | 1 |
357aab7f03b3ce7097bbd942539677b0 | 0ec174dc1069d40a6274828cce6aff32 | Gets an entity type's AI. | var registry_obj = {
type: type
};
register_entity_system(state, ai_id, registry_obj, id);
} | 0 |
19559772548750c21dfcbf1159a25aff | a4272cc04fe28fe7d03b59b3c62e6d33 | Returns The date the Person last changed.. | try {
return getCurrentEntry().getChangeDate();
} catch (Exception e) {
prtlnErr("getChangeDate failed: " + e.getMessage());
return "";
}
} | 1 |
61d51eabf71ecf971cce142c0b14102e | ff6086f0a269c6b5c70872adbfb46fa0 | 移除并返回集合中的一个随机元素。 <br> | if (collection.isEmpty())
return null;
final int index = (int) Math.floor(Math.random() * collection.size());
Iterator<T> it = collection.iterator();
for (int i = 0; i < index; i++) {
if (it.hasNext())
it.next();
else
it... | 0 |
c7d84a5fab126f89cf2e8863f481f534 | a7080e74e6bfb55028d6c8df0af74882 | 本月第一天时间 | Calendar c = Calendar.getInstance();
c.add(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 1);
return formateDate(c.getTime(), DATEFORMAT_STR_YMD);
} | 1 |
2eb7a363150dbd2d4c0a7a81cdd0ebb6 | 39f3ed33d83314c1486bcfcfeb8b365e | Checks and installs all TrueType fonts within a specified folder. | {
if (fontFolder.exists() && fontFolder.isDirectory())
return internalLoadFont(fontFolder);
return false;
} | 0 |
dcc7ea972208adc50f55c063b4800053 | 85b11ee5bfc0583c767920d3ae528085 | возвращает промис с мировой статистикой за сегодня | async def today_statistics(message: types.Message):
chat_id = get_id(message)
answer_message = expenses.get_today_statistics(chat_id)
await message.answer(answer_message) | 0 |
173df6af708ceaf4d7727866f47c51ce | c93692b3dbb2ad2b5106007f9d346f6c | @brief Saves the open list to the map. | std::priority_queue<CellInfo> temp_queue;
std::swap(temp_queue, current_open_list_);
while (!temp_queue.empty()) {
current_open_list_.push({temp_queue.top().xoy_,
temp_queue.top().g_value_ +
heuristic_factor_ * temp_queue.top().h_value_,
... | 0 |
9bcba061a7fd7f365c81875374773750 | bb704e105e755ec69111b68bcc0e4a8c | Decode configuration data | class ConfigManager(var configFilePath: String = "cfg.json") : Controller()
fun decodeConfig() = readFile(Path.of(configFilePath))?.let { Json.decodeFromString(ConfigFile.serializer(), it) } | 1 |
0291f15779c740b7eb6c0aa2e5c802dc | d2cc00931bd0b2bc569dd60302ec4e5c | Method to get the Response object of the last call to the service,
null if no call was done or no response was obtained | public class RestCall
public RestResponse getRestResponse() {
return Optional.ofNullable(rres).orElseThrow(()->new InternalServerError("RestResponse object has not yet been created."));
} | 0 |
09733393ab5216ffc5f70afec07d73f6 | 41a2fadec8c1fd6e4ee459c092613810 | [START containeranalysis_create_occurrence] | if (!opts) {
opts = {}
}
if (!opts.version) {
opts.version = utilities.getVersion();
}
return pulumi.runtime.invoke("google-native:containeranalysis/v1alpha1:getOccurrence", {
"occurrenceId": args.occurrenceId,
"project": args.project,
}, opts);
} | 0 |
163c20e63ae08063b19920f0a4f04372 | 40b24796249faa34a1960437d36540ea | Enter a parse tree produced by {@link TSqlParser#break_statement}.
@param ctx the parse tree | public class TSqlSyb155ParserBaseListener implements TSqlSyb155ParserListener
@Override public void enterBreak_statement(TSqlSyb155Parser.Break_statementContext ctx) { } | 1 |
b5fd6937dfa7d0fc74590cbf16c3147d | 7e295f76182237b0131b96e8d281e524 | * Get Number of Enemies Slain | public class GameController : MonoBehaviour
public int getScore ()
{
return controllerEC.getDeadEnemies();
} | 1 |
75b203bb4adf24e65ae7b1b3405d1599 | 2b4947727c2d17711b79168651eca834 | 拼接FROM表达式 | {
var sql = GetFrom();
if (string.IsNullOrWhiteSpace(sql))
{
throw new InvalidOperationException("必须设置From子句");
}
AppendSql(result, sql);
} | 1 |
60a927a2ba0dd093e4cee7308f1df349 | 8d796653f643d95f5b6a3fb14d8ab7d9 | Defines the error message for the last defined rule.
If a rule is not respected, the message will be registered as an error
for the specific property. | {
$validator = $validator ?? debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 2)[1]['args'][3];
$validator->setCustomMessages([$this->rule => $message]);
} | 1 |
c30b432bea2120fc1694b2bf8dd765cb | ac5a10cf0a526d53490eeea6f2a04612 | Returns a version of this spec that conforms to the API representation. | class ConsumerContractDecorator
def pact_specification_version
version = @decorator_options.fetch(:pact_specification_version)
"#{version[0]}.0.0"
end | 1 |
36aa6aae43e52bf726472acd161d4ad2 | ec6e245327d1762c79d93975ec0b6d41 | Add a range of options | public ListBuilder addRange(@NonNull Consumer<RangeBuilder> c) {
RangeBuilder rangeBuilder = new RangeBuilder(this);
c.accept(rangeBuilder);
return addRange(rangeBuilder);
} | 1 |
34723186676f29c3687887218a8c83d6 | 31b940300ecfe940ffe36441e1527c68 | 获取合约当前最优买卖价 | result={}
result['status']=False
try:
data = self._OKServices.get_future_depth(self._params['symbol'])
result['sell'] = data['asks'][-1][0]
result['buy']= data['bids'][0][0]
result['status'] = True
except Exception as e:
self._l... | 1 |
eebd94067cc7ceca0d70aa3d78311ce8 | 8639c85b3753400352cf504ff76c632c | 对input数据创建一层卷积层, group用来模拟alexnet提出时的分组做法,但训练过程不会真的分组 | with tf.variable_scope("net"):
with tf.variable_scope("input"):
net = tf.reshape(input_x, shape=[-1, 28, 28, 1])
print(net.get_shape())
tf.summary.image(name="image", max_outputs=5, tensor=net)
with tf.variable_scope("conv_1"):
filter_w = tf.get_variab... | 0 |
fc90f4a9c8bac5632cfaa6bfe8e6be66 | f897a442a854f0844b1caa5c1272aaf0 | Adds a zettel ID to a note. | class Contact
public function setPrimaryNoteID($contact_id, $note_id)
{
return $this->setPrimaryIDbyType($contact_id, 'NOTE', $note_id);
} | 0 |
7819cf483b82c663ce79e1edea1b1517 | 4925333fb34cc481c6bb5cfdbd7b6e2f | Updates the internal packages into DB. | class Platforms(object):
def _updateInternalPackageIndex(self):
upi = pkgindexer.UpdatePackageIndex()
return upi.run() | 1 |
6176a3da048ad95b4a9ed5e3929d4a04 | 650ccb42ab7c7c9bd1d44acad82b5a1e | .nub at3 - from Namco NUB archives [Ridge Racer 7 (PS3), Katamari Forever (PS3)] | {
sub_4A7D();
cpu.cx = game_state.unknown[6];
cpu.di = cpu.cx;
cpu.cx = 0xC960;
uint8_t val = game_state.unknown[cpu.di + 10];
unsigned char *player = get_player_data(val >> 1);
uint8_t test_val = player[cpu.bx];
uint8_t test_result = test_val & (cpu.ax & 0xFF);
cpu.cf = 0;
cpu.sf = test_result >= 0... | 0 |
ba6a8ee5fdb96cde3381f7c780b051c0 | 32e38fe1b6f95cc2a281e23c9efba129 | read the csv file with the player info and create a player dictionary: | void Read(std::ifstream &inFile) {
string line = "";
vector <string> text;
while (getline(inFile,line)){
text.push_back(line);
}
vector <string>::iterator it;
for (it = text.begin(); it != text.end(); it++) {
string s = *it;
string p = "";
vector <string> info;
for (int i = 0; i < s.length(); ++i) {
... | 0 |
63c48dffbe914fb068f18310df52efc2 | 34c421f2a311c20723ef537af20df0a4 | アンケートに回答 | {
Answer::create([
"user_id" => $this->user_id,
"answer" => $this->prepareAnswers()
]);
} | 1 |
8cf49ec82b321a987cafb7ad76bc585c | 491aa5859f853091d8b7c9e904978b96 | RemoveVDev removes vdev from the pool | {
struct vmemraid_dev *dev = gd->private_data;
pr_info("Released vmemraid");
spin_lock(&dev->lock);
dev->users--;
spin_unlock(&dev->lock);
return 0;
} | 0 |
fa4370a9b0690f86997e5e6ae56c2dd5 | 2dea5f5df545f5feaf59b27946814730 | Update versioned webapp configuration in the gateway for tenant users. | public class AppGatewayAdmin extends AbstractAdmin
public void updateNonVersionedWebAppForTenant(String appProviderName, String appName, String version,
String appConfig, String tenantDomain) throws AppManagementException {
RESTAPIAdminClient restClient = new RE... | 0 |
63eb4ba6c331d806aa5b5728c044fd34 | fd5ff2190d2c6c807260d2e92743e19d | 获取git配置路径 | def getConfigPath():
if Utilities.isWindowsPlatform():
userprofile = os.environ["USERPROFILE"]
return os.path.join(userprofile, ".gitconfig")
else:
homedir = Utilities.getHomeDir()
return os.path.join(homedir, ".gitconfig") | 1 |
cc63f824ebf2591b9c1c9b9c8681c571 | 05b5018dbd3367e369e2324c09acdc39 | Стратегия игры против двух врагов | if self.payload > 50 or self.health < 40:
self.move_at(self.my_mothership)
return
if len(self.enemy_list) > 10:
self._four_teams_strategy()
else:
self._two_teams_strategy() | 1 |
2d5dc64ee80423df3a43ae805a97eba5 | 008435eae466e0a67606d8350d2f355f | Make sure empty descriptions are rejected | class PaymentMethodCreateViewTest(test.APITransactionTestCase):
def test_blank_description(self):
self.payment_method.update({'description': ''})
response = self.client.post(
reverse('restapi:payment-methods'),
self.payment_method,
format='json'
)
self... | 1 |
8034a96e0151d7edd82ca5e34bae47e0 | f3847bc6563e68c9e9993f00a73f387a | @brief GPIOTE event handler, executed in interrupt-context. | {
u8 State = ERROR;
switch(GPIOTE_Line) {
case 0:
State = ((NRF_GPIOTE->EVENTS_IN[GPIOTE_Line] == 1) && (NRF_GPIOTE->INTENSET & GPIOTE_INTENSET_IN0_Msk)) ? SUCCESS : ERROR;
break;
case 1:
State = ((NRF_GPIOTE->EVENTS_IN[GPIOTE_Line] == 1) && (NRF_GPIOTE->INTENSET & GPIOTE_INTENSET_IN1_Msk)... | 0 |
483b29096d06295b2cf2609e801fcaf6 | e722bffcd4516505ce70579a0b7f9fdd | Sets (as xml) the "inTimeRatio" element | public void setInuMed(Double v); | 0 |
dbb9f550e7a915fab6d1c978bfff59c3 | f64f693b141c8d75880fda4f00c793f4 | 在根节点下添加一个节点 | namespace Util.Webs.EasyUi.Buttons public abstract class Button<T> : ButtonBase<T>, IButton<T> where T : IButton<T>
public T AddRootByTreeGrid( object row = null, string gridId = "", string beforeHandler = "" ) {
return Click( string.Format( "$.easyui.treegrid.addRoot({0})", GetAddParams( row, gridId, ... | 1 |
2b8cb83cfbcfab2f2797d46df9da6dc0 | 910665770105d5686688ec114a2e3b0f | Sprawdza czy podana liczba jest w zakresie. Zwraca True jeśli jest.
(liczba) -> bool | class _NumberCheck:
def is_valid_range(self, num):
return _NumberCheck.in_range(num, self.low, self.high) | 1 |
cf049206acbc559abcc9a80f6316e854 | 38818bca046817745203b48c4a9ca891 | 4G套餐变更查询 | @Component
public class CProdDao extends BaseEntityDao<CProd>
public Pager<CProdInvalidTariff> queryTariffChange(String prodSn,Integer start,Integer limit) throws Exception {
StringBuilder sqlBul = new StringBuilder("select pit.prod_sn,pit.tariff_id,pit.new_tariff_id,pit.eff_date,pit.exp_date,pit.area_id,pit.county_... | 1 |
5df89babc3900d3e1d667ddd5fb286c3 | 809d474fa76a2717994caa8d4051c369 | Register actual value reading status setter | {
if (Status > 1U) {
return IIS2DLPC_ERROR;
}
if (iis2dlpc_int_notification_set(®_ctx, (iis2dlpc_lir_t) Status) != IIS2DLPC_OK) {
return IIS2DLPC_ERROR;
}
return IIS2DLPC_OK;
} | 1 |
964c21f548917db4f3b3697e4c0029c3 | 6209105f9fdca54f1682b504c8cab51a | Changes state to suspension state | if(!mixer) {
return SW_FALSE;
}
mixer->suspended = SW_TRUE;
return SW_TRUE;
} | 1 |
dcd15b71c348ef6e1de29795752b174e | 5dbb5a26bc2c7b3bad9595df41e7b15a | Calcula a area de um trapézio | let xi, wi, resultado = 0;
for (let i = 0; i < n; i++) {
if (n === 2) {
xi = ordem2[i][0];
wi = ordem2[i][1];
} else if (n === 3) {
xi = ordem3[i][0];
wi = ordem3[i][1];
} else if (n === 4) {
xi = ordem4[i][0];
wi = ordem4[i][1];
}
resultado += wi * f(((b - a)... | 0 |
2046441a8b6a36e8dc309c60b7f663ba | 682a99b486cbc34e6573d7725795158b | This is used to generate the description uniformly from CRS wherever it might come in. | if isinstance(value, dict) and "init" in value:
value = value["init"]
if hasattr(value, "to_epsg"):
if value == CRSMeta._UNSUPPORTED_CRS:
message = (
"sentinelhub-py supports only WGS 84 coordinate reference system with "
"c... | 1 |
9f1cbcb169c5128aeefa7a447c1f6d49 | 8e5961a558dc9ab04d5ccdea50f0568a | 4. Imprime na tela o saldo médio das contas da agência | namespace Exercicio5
class Program
static void Main(string[] args)
{
int funcionarios;
double salarios = 0;
Console.Write("Digite a quantidade de funcionários de sua empresa : ");
funcionarios = int.Parse( Console.ReadLine() );
for(int cont = 1; co... | 0 |
e09d38dd7687b899e6b4a3bea0e71e67 | 2507edf4033d2d0bf3d05c7d76fa6e9d | function to write out weighted global brain connectivity voxel-wise image | def write2nifti(file_name, voxel_coord, labels):
labels = labels + 1
data = np.zeros((91, 109, 91), dtype=np.uint8)
for i in range(len(voxel_coord)):
data[voxel_coord[i][0],
voxel_coord[i][1],
voxel_coord[i][2]] = labels[i]
fsl_dir = os.getenv('FSL_DIR')
std_brain =... | 0 |
34b444c4bae8abd5873afe8a436531ff | b9a682a8b6d4734f25c1ab55fc98a4f3 | Get locator size. | match unsafe { ffi::LocalSize(self.ptr()) } {
0 => Err(GetLastError()),
sz => Ok(sz),
}
} | 1 |
99f2dd84bb070d523f152832286446dc | 92d9707b20e912ae9986aeeae74777dc | Returns valid arguments for the `iterate()` and `generate()` methods. | {
$args = isset($arguments[1]) ? (array) $arguments[1] : [];
$scope = isset($arguments[2]) ? (string) $arguments[2] :
$this->getScope($id);
if (isset($this->circular[$scope])) {
$scope .= '#' . $this->circular[$scope];
}
return [ $args, $scope, $scope... | 1 |
13393f1101d7edac1c9d3271d13d94c4 | af2234cf2a287ec674f12447b687da41 | Obtiene el total de permisos ingresados a la base de datos. | abstract class Repository implements RepositoryInterface
function getAllPermisos(){
return DB::table ( 'permiso' )->get();
} | 0 |
fdea5c2871ad4f305dcee10df71ed154 | 9f67fcd889799cd13fd3c8edcf39e4da | Put a domain on a queue | class dnsBroker( brokerBase ):
def spam( self, node ):
map( lambda queue: queue.put( node ), self.state[ 'qout' ] ) | 1 |
e78f2581efea1c8ce6db2a5e1dfc1728 | aee8ca2af9a36bca1d56a08809058b31 | Test ``tril()`` with default arguments. | def test_tril_count_simple():
assert fannypack.utils.matrix_dim_from_tril_count(6) == 3
assert fannypack.utils.tril_count_from_matrix_dim(3) == 6 | 0 |
bf070aec446514a90d80ad200728dae4 | e1c4f00540329522026373503591c918 | 获取小说评论条数 | public class DynaBookStatDTO implements Serializable
public Integer getNumComment() {
return numComment;
} | 1 |
c6f8bc3df0584a919716c7004f1607a1 | 23623b5b19a0d7926175e76eadd2c01e | 제본 여백의 크기를 반환한다. | public class Applet
public String getVspace() {
return (vspace_);
} | 1 |
bb7f3b6abd235eb844adfb7a6ea38956 | 43c9e4dbcbaac7d067a845a49e345b4c | double转String,保留小数点后两位 | try {
return String.format("%.2f",d);
}catch (Exception e){
return "0.00";
}
} | 1 |
cf93629c0b0d1eff9eb39af9cb608db0 | 2478b19694cd60a10bcdd68b4e68cfa0 | The CWD command is issued to change the client's current working directory
to the path specified with the command. FTP Voyager and other GUI-based FTP clients will automatically
issue these commands as the user browses the remote file system from within the program. | {
sendclientResponse( "CWD " );
sendclientResponseLn( dir );
s_eStatus = STATUS_WAITFORCWD;
if ( ftpTimeoutIS( STATUS_WAITFORCWD, ERRTIMEOUT ) < 0 )
{
s_eStatus = STATUS_IDLE;
return false;
}
if ( s_eStatus == STATUS_250SUCCESS )
{
s_eStatus = STATUS_IDLE;
return true;
}
else
{
s_eStatus = STATUS_I... | 1 |
48f33a3d102bd1d8e81f357b7403c569 | a7a7a010962e74cdd007c22daf42f790 | 这个池需要一个可以分配新资源的函数,并规定池的大小 | func New(fn func() (io.Closer, error), size uint) (*Pool, error) {
if size <= 0 {
return nil, errors.New("size value too small")
}
return &Pool{
factory: fn,
resource: make(chan io.Closer, size),
}, nil
} | 1 |
e54b791eeea379b8d149bf0faf37f169 | 1220cd790e31041ee6bf07e8eb87d869 | BOOL
Interface_SetParamUlongValue
(
ANSC_HANDLE hInsContext,
char* ParamName,
ULONG uValue
);
This function is called to set ULONG parameter value;
The instance handle;
char* ParamName,
The parameter name;
ULONG uVal... | LX_ADEMOD_Result ADEMOD_Parameter_Set(Handle_t hDevice, UINT32 ParamID, UINT32* pParamValue, BOOL UpdateNow)
{
LX_ADEMOD_Result status = retOK;
pLX_ADEMOD_Demod_Instance pInstance = NULL;
if ((status = ADEMOD_GetContext(hDevice, &pInstance)) != retOK) {
return status;
}
status = DEMOD_M14_Analog_Parameter... | 0 |
8a46354f93f4940342d768fbac9946ce | 475f93d09ca2754ce1ed504d369c4f31 | Check if a return statement returns the address of a stack variable. | {
if( !IsOnStack( &frame->link ) )
return false;
if( !IsOnStack( &frame->return_address ) )
return false;
return true;
} | 0 |
032fc0453808737e36215a6105896e42 | 77f198ebb499ad02e178eec085b55577 | 假删除回复 | $mReply = M('Reply');
$val = $mReply->where(array('id' => I('id')))->delete();
if (false !== $val) {
$this->success('操作成功', U('indexReply'));
} else {
$this->error('操作失败');
}
} | 0 |
22b269c9a4fab10e711fe4e2d156a877 | a08f3e40953f345de2504bb36965b2df | JobHttpTargetHttpMethodEnumToProto converts a JobHttpTargetHttpMethodEnum enum to its proto representation. | func CloudschedulerAlphaJobHttpTargetToProto(o *alpha.JobHttpTarget) *alphapb.CloudschedulerAlphaJobHttpTarget {
if o == nil {
return nil
}
p := &alphapb.CloudschedulerAlphaJobHttpTarget{}
p.SetUri(dcl.ValueOrEmptyString(o.Uri))
p.SetHttpMethod(CloudschedulerAlphaJobHttpTargetHttpMethodEnumToProto(o.HttpMethod))... | 1 |
8cf9148b896addd181e4a2e2028ae082 | e3202083d2cd0517e184214ce5e78a5b | Método que devuelve el numero de anuncios denunciados | class AnuncioRepo extends BaseRepo
public function enumerarAnunciosDenunciados()
{
return Anuncio::where('estado_id','=', 6)->count();
} | 1 |
4e37fd1f3b64e1d659b6e3dba87048fc | 7ce43e78d0826810db1a0703e251a6f4 | Write into the log file loss value when the epoch ends
function :
on_epoch_end
input :
model : the model used
output :
log file updated | fhand = open(LOG_DIR + 'training_log.txt', 'a')
fhand.write(str(self.episode) + '\t' + str(self.time_step_total)+ '\t' + str(train_loss_actor) + '\t' + str(train_loss_critic))
fhand.write('\n')
fhand.close() | 1 |
b563f452976d574d376e7c491227c52b | 66c332598c2b4049e7361d65a29704cc | Purpose:
Show detailed calibration file mapping information. | for key in self.cam.getFeatureNames():
try:
value = self.cam[key]
except IOError:
value = '<NOT READABLE>'
description = self.cam.getFeatureInfo(key)
range_ = self.cam.getFeatureRange(key)
print('{0} ({1}):\t{2}\t{3}'.fo... | 1 |
ebd6b71f8e4bff8f3b2618fdb07e139f | 81e5432597f0297087a23407b876d2c4 | Plugin configuration object for PyLint
Provides configuration panel for plugin dialog. | class PluginConfigObject(object):
def GetConfigPanel(self, parent):
raise NotImplementedError | 1 |
74a126d16937e9955de407a2343dc2c5 | c2fb269303b48887dea83bdb3e29181a | 根据频道iD查询所有正式属于该频道的文章 | public List<TCourseSiteArtical> findTCourseSiteArticalsByChannelId(Integer id,int page,int pagesize); | 1 |
8a9a3472b8e65f2c292da538c7d746c9 | 40d494367d7bb881dab7a225d85c9a0b | Instantiates a CertData object from a certificate. | class Certmgr(ShellCommand):
def _make_cert_object(data):
def _str_to_datetime(string):
return datetime.strptime(string, '%d/%m/%Y %H:%M:%S UTC')
cert = Certificate(
thumbprint=data['sha1_hash'],
serial=data['serial'],
valid_from=_str_to_datetime(data['not... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.