query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c17e524675d41ce3b635237d4b3b9214 | b740dcf5446608c2c9078b6d1ac181f2 | Loop over all items after the given index. | if not isinstance(item, AttributeDict):
item = AttributeDict(item)
for i in range(len(self)):
if i == index:
yield item
yield self[i] | 0 |
e072c9e15dd7aaf67a8dc3bfb19ddf97 | 79a693aa20c3c966fddfd727e7d7ce70 | creates one card from the two arrays above. | def drawCard(cardsIdentity,cardsValue):
card = choice(cardsIdentity.keys()) + ' ' + choice(cardsValue.keys())
return card | 1 |
18cc64fc1da563933285d219e79e3ddb | 87976e59531f7a239abe9d94cb1d14d9 | 将毫秒数的时间转换成分+秒的形式 | public class CommonTool
public static final String getTimeFromMillisecond(Long millisecond) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("mm:ss");
Date date = new Date(millisecond);
String timeStr = simpleDateFormat.format(date);
return timeStr;
} | 1 |
9ed3fbfe2c6b1a8e200231899e94931c | fa0b833692135978a05b0ae6cceb9ace | Route for all topics | class TopicsController extends Controller
public function index()
{
} | 0 |
e2f5705fcf7bf5879c35a74e42a09245 | 9cfb0f5352493d3f8c678b1325a13a23 | Will check to see if you are on a bucket and change the color of the player's label | String playerName = assPlayer.getLastName() + " " + assPlayer.getFirstName().substring(0, 1) + ".";
switch (formation) {
case BOX:
if (label12.getText().equals(playerName))
label12.setText("A");
else if (label32.getText().equals(playerName))
label32.setText("B");
else if (label14.getText().equals... | 0 |
b879a845ff2d8d082b74a8705c8b537f | 13a1f92dee1e2e385cee9f71613076ea | 获取评论有效回复数量,未审核的不包括在内. | {
return Comment::find()
->joinWith([
'post' => function (ActiveQuery $query) {
$query->join('INNER JOIN', 'adminuser', 'post.author_id = adminuser.id')
->andWhere(['adminuser.id' => Yii::$app->user->id]);
}
... | 1 |
68571d510c017c8cb8278b8c1c5170e0 | ad31893df7e0af71ee3916d0ae5024dd | Функция для девятого задания: выводит студентов под определённым номером | def gradesStudents(request, num):
grade = Grades.objects.get(pk=num)
studentsList = grade.students_set.all()
return render(request,'MyApp/students.html',{'students':studentsList}) | 1 |
69ac4d38a1037a7e96e59f0e2fc87799 | 627d55eddc04f0f5f0a1c433fb8bf62a | Создает из числа строку с ведущими нулями | {
string sNumber = Convert.ToString(iNumber);
while (sNumber.Length < iCharCount)
sNumber = "0" + sNumber;
return sNumber;
} | 1 |
ea258568256bd35f212a65ad8600ca49 | fac7fb57338ce1f214577f19f73a8d8c | Обрамляет кавычками алиасы полей | if(stripos($field, 'as') !== false) return $field;
if (!strpos($field, ',')) return "`{$field}`";
$temp_arr = explode(',', $field);
foreach ( $temp_arr as $k => $v ) {
$temp_arr[$k] = "`{$v}`";
}
return implode(',', $temp_arr);
} | 1 |
9deb58e0ef14f1fe99f9d240a7c86aa4 | e49a8de16c92bff1e4b428b7d5f0f61e | Registers binary type information in cluster. Do not update binary
registry. This is a literal implementation of Ignite thin client
protocol's `OP_PUT_BINARY_TYPE` operation. You would probably want
to use :py:meth:`~pyignite.client.Client.register_binary_type` instead. | class AioClient(BaseClient):
async def get_binary_type(self, binary_type: Union[str, int]) -> dict:
conn = await self.random_node()
result = await get_binary_type_async(conn, binary_type)
return self._process_get_binary_type_result(result) | 0 |
6836446dff00aace8c6784ddc2422379 | 4952e6fb51fad138de76da1bc2b6ef32 | 删除轮播(直接删除) | @RestController
@RequestMapping("/Carouserl")
public class CarouserlController
@PostMapping("deleteCarouserl")
public AppResponse deleteCarouserl(String listString) {
try {
AppResponse appResponse = carouserlService.deleteCarouserl(listString);
return appResponse;
} catch (Ex... | 1 |
566c76d1eccc2c2e40e95fe35fe6fbc9 | 70b959027b995b53bae66b04b1c87b43 | 添加自定义机器人服务 | namespace QQ.Framework.Domains
void RemoveCustomRoBot(IServerMessageObserver robot); | 0 |
88e13e6f3410c4c7af60259645fe7384 | 2692ac6c17285e2436906e115fe38372 | 零售销售月率 | String calculateMonthSaleRate(String sale, String monthSale); | 1 |
239395f40c028ee371887f6dae317474 | b8b87eac394fc7c1723f0d25d2251e61 | 判断项目名称是否存在,,如存在返回真 | public class MlGoodsAppService
public boolean exists(int projectId, String name) {
name = name.toLowerCase().trim();
String sql = "select id from ml_goods where lower(goods_name) = ? and id != ? limit 1";
Integer id = Db.queryInt(sql, name, projectId);
return id != null;
} | 0 |
e722c68335e358edc65aeb2112df040c | 05007a6185311259e66a565d45128aec | Test whether student information inserts correctly | instructor = Instructor('98763','Newton, I','SYEN')
instructor.add_coursestudent('SYS 660')
self.assertEqual(instructor.one_instructordetails(), ['98763', 'Newton, I', 'SYEN', 'SYS 660', 1]) | 0 |
383f59bdf71c13792efef772b8378d59 | 8b054df1829cca4d954672fde70effc8 | Gets the "ESTATE_DEVELOPMENT" element | com.abctech.transition.xmladbeans.iadifestateforsale.ESTATEDEVELOPMENTDocument.ESTATEDEVELOPMENT getESTATEDEVELOPMENT(); | 1 |
f0e88f4ebdca3b5161f9083b9dce9302 | 34405b9d3bf24b00252974907c9d11d7 | Prints a string multiplied by a number | def print_num_multiplications(num):
print(str(num)) | 0 |
105be983ffb369036daf597f3e42c451 | 3a4b118502a42cc0d8ed7a8e39c2a596 | Draws the Menu Button for adding a component to the component list. | namespace UI.Windows.MainWindow.MainMenu
public class MainMenuScript : MonoBehaviour, IShortcutHandler
public void OnComponent_Add()
{
Debug.Log("MainMenuScript.OnComponent_Add");
AppUtils.ShowContributeMessage();
} | 0 |
e0022b12f89417f35494203bff3de805 | 9aa9bb2205ba9b7046635654eb8bf98c | Returns a list of the pixels the snake is occupying. Pixels
are represented by a list with 2 elements | pixels = []
for i in range(len(arr)):
for j in range(len(arr[i])):
if shape[i][j]:
pixels.append([i, j])
return pixels | 1 |
f3a005f69c674e9c45e304a4b7ffdbd7 | 0827c3b24501905d66fea7f121d82f91 | Given -
trampee - the name of the symbol to hook
tramp - the stage 2 trampoline entry
orig_func - out parameter storing the address of the function that was
originally called.
This function will update the ruby binary image so that all calls to trampee
will be routed to tramp.
Returns 0 on success | relocs := ldr.Relocs(s)
r := relocs.At(ri)
const pcrel = 1
switch r.Type() {
case objabi.ElfRelocOffset + objabi.RelocType(elf.R_AARCH64_CALL26),
objabi.ElfRelocOffset + objabi.RelocType(elf.R_AARCH64_JUMP26),
objabi.MachoRelocOffset + ld.MACHO_ARM64_RELOC_BRANCH26*2 + pcrel:
fallthrough
case objabi.R_CALLA... | 0 |
6b01dbbc710004cc2e08db0aecf1edb8 | 7f61448ad6da3ef0f9cb03f40c5be655 | No-op if nothing to add | cases like (1) | 0 |
26bfc3c84a2edafbf799cbe974b0b365 | dac35061ceb7d65512b2f3ec12d9fb51 | Metodo para definir la operacion sql para listar todos los documentos registrados en la base de datos | public class MbUsuario implements Serializable{
public String prepareSelect(){
return "list";
} | 0 |
f98070470006286512552a3cd47bd215 | a30f7307f0353c66cdb3405c45cb2d9a | Opens the file and reloads the CompactLabelToOrdinal. The file it expects
is generated from the <see cref="Flush(Stream)"/> command. | {
Require.StringNotEmpty(fileName, nameof(fileName));
Require.FileExists(fileName, nameof(fileName));
return OpenInternal(fileName, null, false);
} | 0 |
2db9b02c56b173b9b4c7701facacf6fb | 8e0230aabe4ff99037b93a9986ddbaa1 | 怒气特效处理 | local fade_in = CCFadeIn:actionWithDuration(0.8)
local delay = CCDelayTime:actionWithDuration(1.4)
local fade_out = CCFadeOut:actionWithDuration(0.8);
local remove_act = CCRemove:action()
local array = CCArray:array();
array:addObject(fade_in);
array:addObject(delay);
array:addObject(fad... | 1 |
4d6c58c561d724647a1dbdff9f8fe76a | e13d7bc7cf11b040c8a0d02f72090a37 | вывод информации о шрифте | void CFont::debug(void){
unsigned int i;
Log->printf("chars: %d\n",m_chars.size());
for(i=0;i<m_chars.size();i++){
Log->printf("code: %d x_off: %d ",m_chars[i].code, m_chars[i].x_offset);
Log->printf("y_offs: %d width: %d ",m_chars[i].y_offset, m_chars[i].width);
Log->printf("height:... | 1 |
53f384e45c0048af00d2ab04b9fec4a1 | a36223095cf131a2af1d54c67a66f881 | Ziska zvuky ze zadane slozky a nastavi delku pole | if ("cz".equals(name)) {
mediaPlayer = MediaPlayer.create(this, R.raw.cz);
}else if ("sk".equals(name)){
mediaPlayer = MediaPlayer.create(this, R.raw.sk);
}else if ("xs".equals(name)){
mediaPlayer = MediaPlayer.create(this, R.raw.xs);
}else if ("lr".eq... | 0 |
993dbce87fbca27a40195d01a99edc70 | 0ce9c777bcfb3adfa136ccce85f24cef | Speichert ein Gipfel | class TAnzeige extends JPanel
public void addGeschoss(TGeschoss g) {
fgeschosse.add(g);
} | 0 |
0e1c3718a4a7920790aef2eea6134e48 | 5d6decf8e02ef6aab244df81044fa008 | Returns a map with all ReportTable identifier and name entries. | const rpc = await getRpc();
return await rpc.get_table_rows(
new AssurerRequest(resourceHash, ReportStruct.TABLE_NAME, 'sha256'));
} | 0 |
0d1bdd5563fe95723761bc017d77361c | 00353cea944af1c0ce4348ae9fe2f4fc | this function is called when the towers are changed
the "fresh" variable determines if a move has been made yet
if it has not then it means we're getting this function called because
of a reset. here we remake the disks from scratch | void mksfs(int fresh) {
if (fresh) {
init_fresh_disk(DU_ZHUOCHENG_DISK, DEFAULT_BLOCK_SIZE, NUM_BLOCKS);
init_super();
init_int();
init_fdt();
init_rdt();
for(int index = 0; index < DIR_BLOCK_N + INODES_BLOCK_N + SUPER_BLOCK_N; index++){
force_set_index(i... | 1 |
be2630be67c527e1892f3792a133a340 | d140df6f42872641ea5aa6a6dbe379f7 | Тест, проверяющий удаление по id элемента в массиве. | {
DynamicArray* repo;
repo = createDynamicArray(10, DestroyProfile);
assert(CheckExisting(repo, 12) == 0);
char placeOfBirth[] = "Bistrita";
char psychologicalProfile[] = "normal";
Profile* p = CreateProfile(12, placeOfBirth, psychologicalProfile, 2);
add(repo, p);
int index = ReturnIndex(repo, p->profileIdNumb... | 1 |
7312ef6ed8dbbf88726ac9c99f1649b8 | 0f33c335ad69f1a030a556ec14ed7f50 | Creates a handler that will stop a feature as part of a transaction. | def subfeature_handler(f):
return ''.join(
['autoincrement:',
f.attributes['transcript_id'][0],
'_',
f.featuretype]) | 0 |
1bc72f48993cdd60388ea481bae10a9d | 5497f9ad4ee427b7334b8422b2dd8734 | Deletes the choice corresponding to the identifier from the list of choices. | namespace KeyboardReader.Pages.ExerciseControls
public sealed partial class SingleChoiceControl : UserControl, IExerciseControlContent
private void DeleteChoice(ChoiceControl choiceControl)
{
choicesPanel.Children.Remove(choiceControl);
} | 0 |
3bf75603041648a3355a1eb065474c55 | 2344c9229a36e033bf89fdb4d1b3fb60 | @brief テンプレート設定を初期化する。 | class LC_Page_Admin_Basis_Mail_Template extends LC_Page_Admin_Ex
public function init()
{
parent::init();
$this->tpl_mainno = 'basis';
$this->tpl_subno = 'mail';
$this->tpl_mainpage = 'basis/mail_template.tpl';
$this->tpl_maintitle = '基本情報管理';
$this->tpl_subtitle = 'メ... | 1 |
3d302c4508de8e6f078862ddae1405fa | 14f8dffe875c84489ee6b267fb9afe26 | Recursively scan directory at given depth, create array with filenames and their checksums | function crawlDir(dir, depth = 0) {
const empty = []
return fs.readdirSync(dir).reduce((acc, curr) => {
const currPath = path.join(dir, curr)
if (fs.statSync(currPath).isDirectory()) {
acc.concat(crawlDir(currPath, depth + 1))
} else {
acc.push([currPath, depth])
}
return acc
}, em... | 0 |
f8f6d1ec708d5e1b869fa4dc74f19e8c | 1d2f3cbe1c309971397accf998d28e59 | Obtiene los descendientes de un concepto | public function getAncestros($id_concepto); | 0 |
7f9a7473b89494616a0642d34bbd6a4c | 4c29f9a94a0bb712dedbf9810990fb54 | Gets whether the armor stand has marker enabled. If true, the armor stand's bounding box is set to zero and
cannot be interacted with. | public class EntityArmorStand extends EntityLivingBase
public boolean hasMarker()
{
return (((Byte)this.dataManager.get(STATUS)).byteValue() & 16) != 0;
} | 1 |
c0602b7d775cbb9cfa7bbe7f91d5a69b | 95fb74730e729922b427d1091bfa6b11 | Description: Function that creates a list with the provinces of Costa Rica
Returns the list with the elements | def q1():
return regioes | 0 |
03f97b331e9615946a3f662461ee643c | 71c20c3ee2a378edec367a401ae92b22 | метод для построения дерева с файлами из папки проекта по умолчанию | function constructionTreeFile($path, &$treeDir) {
$files = ignorSysFile(scandir($path));
$reg = "/^[\s\S]*\.jpg|png|jpeg|avi|mp4$/i";
for ($i=0; $i < count($files); $i++) {
$bufPath = $path . '/' . $files[$i];
if(is_dir($bufPath)) constructionTreeFile($bufPath, $treeDir);
else
if(preg_match($reg... | 1 |
b073c046c32c3ca44324b6871d51dd58 | 95ff1dce512da0461760a9eb55616ea0 | The agent supports special, built-in "vines" commands beginning with
'v' that the agent executes itself, without invoking a shell. For example,
+v user root+ will change the user account that future shell commands
execute as. | class _vimcmd(object):
def __init__(self, name):
self.__name = name | 0 |
1b73304cf13fa9e1c4937e818a3f34db | 9fd7819f1760c9b2d545a16d9319ebb8 | very similar to redirect_in | void redirect_in(char * command, char * file){
command = trim(command);
file = trim(file);
int fd, fd1;
fd = open(file ,O_RDONLY, 0644);
if (fd == -1){
printf("owl: %s: No such file or directory\n", file);
}
else {
fd1 = dup(STDIN_FILENO);
dup2(fd, STDIN_FILENO);
execute(command);
dup2... | 1 |
d47a81ea27cd09d7260fffc8f824d17b | b5b3b8886606ff662f7af4fe4d9a36de | Групповая отправка чеков или отправка чеков кнопкой управления | {
HttpGroupsReceiptsAccess receiptsAccess = new HttpGroupsReceiptsAccess(_group.Id, 0, 0);
List<Task> tasks = new List<Task>();
foreach (Entry cell in entries.Where(e => e.Text != "0"))
{
var personId = Convert.ToUInt32(cell.ClassId);
... | 1 |
c5ccf8942d084d10b30ea55720baa5fe | 0f68fd94dde101b8062d4148198c9a37 | 个人砍价列表 | class BargainController extends Controller
public function bargainList(Request $request)
{
$this->validate($request, [
'page' => 'required|int'
]);
$uid = $this->authService->authorization();
if (isset($uid['error']) && $uid['error'] > 0) {
$uid = 0;
}... | 1 |
9b47304ac9114db7b04ab64f70ae583a | 9672942f7097ca77aabfd88d0ffbe064 | Test case for deletePortfolioAssetSizeUsingDelete
Delete a portfolio asset size. | namespace Nucleus.Api
public partial class PortfolioApi : IPortfolioApi
public async System.Threading.Tasks.Task DeletePortfolioAssetSizeUsingDeleteAsync (Guid? portfolioAssetSizeId)
{
await DeletePortfolioAssetSizeUsingDeleteAsyncWithHttpInfo(portfolioAssetSizeId);
} | 1 |
0446d1e19aa90668da9f05112e254194 | 92a714cdef68bdfc116133ea8efeea53 | If evalutes to true, then any actions defined on this controller will be
available even when a proxy is present. However, if both this controller
and the proxy define the same action, then the parent's version will be
invoked. Defaults to true, but can be overriden in subclasses. | public boolean canProxy(); | 1 |
79cb7226f7d0a334556f3684aea7f7ce | 7c6198fb8aa86c2114974e6a3fcbf97a | Get the score of the given team | int result = 0;
switch (teamNumber) {
case 1: result = firstTeamScore;
break;
case 2: result = secondTeamScore;
}
return result;
} | 1 |
c24f04d22640377180129511dd5639c0 | 4b9575f47dc7db782bac1e30d563be38 | Clear Global Interrupt Enable. | void disable_global_int(void)
{
GIE = 0;
PEIE = 0;
} | 1 |
9d4ab72dbbc69521f8839e79c07e79fe | 158bc06df7fdad70c20d159c4ce6a2c4 | Упаковывает типы полей.
В конфигурационном файле необходимо указать массив идентификаторов типов полей. | class EnumType extends AbstractType implements BuildableFieldTypeInterface
public function build(AbstractBuilder $builder, Field $field): void
{
if ($builder instanceof ObjectBuilder) {
$types = [];
foreach ($field->getValueSet() as $valueSet) {
$constName = strtouppe... | 1 |
bb09db0d2e11e31df3c2da5d795e63f3 | 2bece412e885110135a1b3abc9dae0de | Abandon ongoing attempt to split this subproblem. | AtSubAbort_Portals(SubTransactionId mySubid,
SubTransactionId parentSubid,
ResourceOwner myXactOwner,
ResourceOwner parentXactOwner)
{
HASH_SEQ_STATUS status;
PortalHashEnt *hentry;
hash_seq_init(&status, PortalHashTable);
while ((hentry = (PortalHashEnt *) hash_seq_search(&status)) != NULL)
{... | 1 |
9a3c2a15e297acfbfad7693818b08a35 | 6bf4617ee4a92cc9c20c24153b4e0416 | Add columns with the percent difference between base values and the
Exponential Moving Average of those values. | df['_%mom'] = df.iloc[:,0].pct_change() * 100
df['_%yoy'] = df.iloc[:,0].pct_change(12) * 100
df['_smoothingMA'] = (df['_%yoy'] + df['_%yoy'].shift(1) + df['_%yoy'].shift(2) + df['_%yoy'].shift(3)) / 4
df['_rocMA'] = roc(df['_smoothingMA'], 1)
df['_smoothedRoC'] = smoothingMA2(df['_rocMA'])
df =... | 0 |
afab83ef10aec2b481b568bbe75e102f | a725238f5b48c9c48fe29c7471ece348 | Returns a record reader for the rows within the file. Records are sorted if sort order is configured. | public final class PublishKafkaRecord_0_11
public final String getRecordReader() {
return properties.get(RECORD_READER_PROPERTY);
} | 0 |
a053549c8697b26bb02575ad4552ed32 | 17e99d90f2fe6c0793fdbf5dcfe4bd78 | Find and broadcast the priority and id of this archon (higher number means more priority). | fifo_lock();
if ( fifo_byte_available() > 8 ) {
_fifo_enqueue( (6 >> 8) & 0xFF );
_fifo_enqueue( 6 & 0xFF );
_fifo_enqueue( (_instance->id >> 8) & 0xFF );
_fifo_enqueue( _instance->id & 0xFF );
union u_p_t {
long p;
byte bytebuffer[4];
} u_p;
u_p.p = p;
_fifo_enqueue(u_p.bytebuffer[3] & 0xFF);
_fifo_enqueue(u_p.bytebuf... | 1 |
38ad305b219a1f90bbfac76f198b993c | 52030bff031869520b8b709c662f1ae1 | Filters out shadow and replaces it with the background pixels | def removeBG(frame):
rm = bgsub.apply(frame)
blur = cv2.bilateralFilter(rm,9,75,75)
eroded = cv2.erode(blur, kernel_2, iterations=1)
fg = cv2.morphologyEx(blur,cv2.MORPH_OPEN,kernel_2)
result = cv2.bitwise_and(frame, frame,mask=fg)
return result | 0 |
7aae196603c3af97c47a9496b62256ff | a956e8f8885dc071a39b0c023b2c286b | Assert that reset key must be valid. | @RunWith(SpringRunner.class)
@SpringBootTest(classes = AssistantGatewayApp.class)
@Transactional
public class AccountBusinessServiceIntTest extends AbstractUserServiceInitTest
@Test
@Transactional
public void assertThatResetKeyMustBeValid() {
userRepository.saveAndFlush(user.activated(true));
In... | 1 |
1029a4c1ef74108e6af9ea6abb12770e | f9f880e17bc60a2ff9875c699af2a42d | This function generates boxplot of income per capita for different regions for a given year. | vec = regionExp.loc[year].sort_values(by = 'Region Expenditure', ascending = True)
vec = vec.reset_index()
vec = vec.drop(['Region Expenditure'], axis = 1).head(total)
vec.columns = [year]
vec.index = vec.index + 1
return vec | 0 |
992a9d76df472c3cc185f6425a9d231d | 7ddc2f6780729136b4d815c0ba50dd43 | 已经存在的不再记录 | bool SQLProcess::addOneHistoryRecord(Database *db, const HistoryChatRecord &record)
{
if(containHistoryRecord(db,record.accountId))
return true;
DataTable::RHistoryChat rhc;
RPersistence rps(rhc.table);
rps.insert({{rhc.type,record.type}
,{rhc.accountId,record.accountId}
... | 1 |
ca0db9b0e54869699ccf45bc942c81e6 | f8505dd0f03d8d4a1137002f0aef572f | Gets number of sectors in the circular chart area. | namespace TwilightShards.AetherumExplorerW
public partial class AetherumSettings : PropertyHandler
public long GetSectorMaxNum()
{
return this.Get<long>(PropertyName.MaxSizeOfSectorCatalog);
} | 0 |
f01557fe79489e1984656c6b910a61f0 | 07cc56fa7d6b8908dc1c9c05de4236a5 | Get the wallet's primary address. | public class WalletToken
public String getAddress() {
return (currency == null || currency.size() == 0) ? "" : currency.get(0).getTokenAddress();
} | 1 |
4e4de7b8587e03209e3a9ff8c044260c | c53d0f46870d2953e2addab4a5829cfd | @brief IIS发送通道使能配置 | static void adcp_channel_config(void)
{
g_analog_ch_0.Enable = 1;
g_analog_ch_0.Gain = 200.0/2048.0;
g_analog_ch_0.Value = &(I_IGBT_1.f);
g_analog_ch_1.Enable = 1;
g_analog_ch_1.Gain = 200.0/2048.0;
g_analog_ch_1.Value = &(I_IGBT_2.f);
g_analog_ch_2.Enable = 0;
g_analog_ch_3.Enable = 0;
... | 0 |
5c29bb155347c005a5deeae4905b4d09 | 209fdce78867a3fbd259fa0cb56c0d73 | Return whether a given user has permission to perform bulk edit actions on these elements | {
$element_id = (integer) $element_id;
$user_id = (integer) $user_id;
$result = [
'owner' => FALSE,
'read' => FALSE,
'edit' => FALSE
];
if ($user_id == 0 && $this->CodeIgniter->User->auth)
{
$user_id = $this->CodeIgniter->User->id;
}
if ($element_id > 0 && $user_id > 0)
{
$access ... | 0 |
fa9f8e976e10af879c90683d3cf947f3 | f3bc71faf402e162ebad99d01e5e8fa9 | Inserts the new node after the specified node in the <see cref="SingleLinkedList{T}"/>. | void insertAfter(LinkedListNode<T> listNode,LinkedListNode<T> addNode); | 1 |
aa22abe3c8613673a08f2de1ec51b43b | 84866a387c45b50c1ec4c62a09815587 | of SH registers to be loaded using LOAD_SH_REG_INDEX. | static void photon256_load_top
(Code &code, const Reg &s0, const Reg &s1, const Reg &s2, const Reg &s3)
{
code.ldz(s0, 0);
code.ldz(s1, 4);
code.ldz(s2, 8);
code.ldz(s3, 12);
} | 0 |
ee482626148b98c1e35e471f79db999a | 70921b11ddd58a2200395ede525b804e | It should throw an exception with invalid options. | drv = self.driver
none_opts = self.TEST_NFS_MOUNT_OPTIONS_FAIL_NONE
self.configuration.nfs_mount_options = none_opts
self.assertRaises(
exception.NfsException, drv.do_setup, context.RequestContext) | 1 |
e49ee0204fb4b7cb4928cacfb0aab2b2 | 80e7f8bf1b7a48f2fbd377f2f62ee4f4 | localsテーブルにデータ挿入 | {
$site_id = $this->_session->getParameter("_site_id");
$user_id = $this->_session->getParameter("_user_id");
$user_name = $this->_session->getParameter("_handle");
$time = timezone_date();
$category_id = $this->_request->getParameter("category_id");
$display_sequence = $this->_reservationView->getLocation... | 0 |
78a6be8889b3ad9973afd195bcf3ce6d | 888a3cabcd9259f3ef78e637e65eaca7 | Retrieves the last line/communication received from the server, for use
in debugging purposes. | public class TcpByteLineServer extends ExternalResource
public List<byte[]> getReceivedLines() {
return receivedLines;
} | 0 |
72e403a54fceaf4d79520b3573ce9121 | 3ad8770482b2215523efd62e56920ca2 | Reads the symbol from the specified position. | class CHTBLexer
public final char yycharat(int pos) {
return zzBuffer[zzStartRead+pos];
} | 1 |
d585545b863af665b43fae079a216542 | 8bf99967655e191751ff5e033d555fc5 | Retourne l'horaire de fin de l'activite. | if ( this.getFinPeriode() != null )
return new Time(this.getFinPeriode().getTime());
else
return null;
} | 1 |
5070657cfb41e243e8c4738732548047 | f80ccef7019404072cade583a94dd2e7 | Map our API-side Nameserver list to WHMCS format | class NamesiloDomainsNs
public function getInfo(array $vars)
{
return $this->api->submit('listRegisteredNameServers', $vars);
} | 0 |
7be8a832954765958451dff9cb9281e6 | 6793e352309ffc9e319af8aa776a9ffc | Read all data set types (hits, markers, parametric data, status data)
from pridb to Pandas DataFrame. | project = db.session.query(Project).get(int(ship["project_number"]))
query = (
db.session.query(Run, Model, LoadingCondition, Ship)
.filter((Run.project == project))
.join(Model, Run.model_number == Model.model_number)
.join(LoadingCondition, Run.loading_condition_id == LoadingCo... | 0 |
fa2642e0f05c16fbc6a17552a73d08c5 | 27a35d9539562e92d3f3f19cfcc5ac31 | Make a local copy of the file and return the path to it. | abstract class BaseAssetSourceType extends BaseSavableComponentType
abstract public function getLocalCopy(AssetFileModel $file); | 1 |
8ec92bb5c66242a4e653a01bc988dc11 | cc5a811bcfa34db2b1d9fc6d8663111d | 复用的以审核通过的用户范围. | public class WorkFlowUtils
public static List<String> getValidUser(String key, int candidateType, String groupId, Map<String, Object> data){
AbstractUserRange rule = UserRangeUtils.getUserRange(key);
return rule.getValidUser(candidateType, groupId, data);
} | 1 |
e3b47fa14e157cb22292eb8ad6e1b7a1 | 3330ff85dab0f9e36537454e7a03014a | 获取网卡信息和当前TCP连接数。 | def get_key():
nics = psutil.net_io_counters(pernic=True).keys()
recv = {}
sent = {}
for key in nics:
recv.setdefault(key, psutil.net_io_counters(pernic=True).get(key).bytes_recv)
sent.setdefault(key, psutil.net_io_counters(pernic=True).get(key).bytes_sent)
return nics, recv, s... | 0 |
94d39ca76b0f2134f7b638423fd1cbc8 | b1e577e3409a6fb6696e74a6c8935a58 | Reads the differential between two channels. | {
for (size_t i=0; i<7;++i)
if (fUsedChans & (0x1<<i))
GetChannel(i).Differential(*this,dt_nsec,multi);
} | 0 |
b121f5aadc506d00f2a0069cde01781f | 67e370f319636306c1481aa186d62626 | Callback for getdirent | uint8_t fat16_dir_entry_read_callback(uint8_t* buffer, uint32_t offset, void* p)
{
struct fat16_dir_entry_struct* dir_entry = ( struct fat16_dir_entry_struct*)p;
if(buffer[0] == FAT16_DIRENTRY_DELETED || !buffer[0])
return 0;
if(!dir_entry->entry_offset)
dir_entry->entry_offset = offset;
s... | 1 |
1018b4ae3a1252af5eb21e8605cedcf4 | 5c067aeee6c368e0232b0832fed89e2c | Add a point to a filled shape. | checkNotNull(shape, "shape cannot be null");
checkNotNull(color, "color cannot be null");
checkArgument(index >= 0, "index must be >= 0");
checkArgument(index < yData.getSize(), "index is out of bounds");
markedPointsList.add(new MarkedPoints(Markers.newShapeMarker(shape, color, ... | 0 |
5b4b51194b5ae34dd29c9b8a6cc67c3d | 7c8fa8f27829b63e992da8b7798875a5 | 删除数据库中已被删除的原微博 | try:
for filename in os.listdir(os.path.join(f_path, "tmp_weibo", keyword)):
file_name = filename.split(".")[0]
screen_name = file_name.split("_")[1]
with open(os.path.join(f_path, "tmp_weibo", keyword, filename), "r",
encoding="utf-8") as weibo_file... | 0 |
9ea01afac437419b0b3f7c28faa9d39f | 1e0a27f45eac9f75a37fc200e59ecdab | Get the enumerator of the offsprings by the depth-first pre-order search. | namespace BinaryTree
public abstract class BinaryTreeBase<T> : IBinaryTree<T> where T : IComparable<T>
public IEnumerator<T> GetEnumerator() => TraverseDepth().GetEnumerator(); | 1 |
e05e112f061ade9fd3e642d950da5078 | 2b438d158c2551036b7cecf45feb07ec | Set the transforms of the containers and this portalObject's portalMeshes. | {
foreach (MeshRenderer r in GetComponentsInChildren<MeshRenderer>())
{
r.enabled = true;
}
if (GetComponentInChildren<PortalNew>() != null)
{
GetComponentInChildren<PortalNew>().enabled = true;
}
if (GetComponentInChildren<GlitchValueGenerator>() != null)
... | 0 |
761e97ff09378246a067a825872621c7 | 2ba3743c7d041cf94aae7db881bed858 | Compare a string of bytes - not a character string, since a NULL can
appear anywhere. | {
while (n && *s1 && (*s1 == *s2))
{
++s1;
++s2;
--n;
}
if (n == 0)
{
return 0;
}
else
{
return ( *(unsigned char *)s1 - *(unsigned char *)s2 );
}
} | 1 |
73452c7bb92c3d8ecd2c7c8ccc0478a1 | 0fc562b4c26208e69f08fbe994c6e06b | Sets the local bind address to which the multicast socket is bound for discovery. | void bind(InetSocketAddress localSocketAddress); | 1 |
3747de9abac2c6a9748d1d292c3ca5b3 | 023a3609b3a388c11c3ec8e66a516db9 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This function will form the Link State database by using link state updates
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | def initLinkMap(net):
LSAmap= {}
for tls in net._tlss:
for connection in tls._connections:
edge= str(connection[0].getID())
edge= edge[: len(edge)-2]
if LSAmap.has_key(edge):
LSAmap[edge].append(connection[2])
else:
linkCoun... | 1 |
d8121a165c91b9814b7bbb4591dc0fb4 | ea2f3dc24ac05bca0fc4ed116a35e4e9 | this function takes two images as input along with their homography matrix and returns the stitched image | sift = cv2.SIFT()
kpts_l, descs_l = get_features(img_l, sift)
kpts_m, descs_m = get_features(img_m, sift)
kpts_r, descs_r = get_features(img_r, sift)
print len(kpts_l), "features detected in left"
print len(kpts_m), "features detected in middle"
print len(kpts_r), "features detected in right"
lm_fc_l = ... | 0 |
f9324deddd042cda4bfc79cb54359a44 | 8d668725728d9b53decdbf853d726250 | set currently captured photo in image view | if (imagePath != null) {
Bitmap bitmap = BitmapFactory.decodeFile(imagePath);
cropImageView.setImageBitmap(bitmap);
crop_layout.setVisibility(View.VISIBLE);
rl_selected.setVisibility(View.GONE);
rl_photo.setVisibility(View.GONE);
} else {
... | 1 |
425477d7ffa620b34ec107c075e24467 | dd6e75cc15cca1e7f5ed32fb0d21e919 | Fonction pour initialiser le json à envoyer à InfluxDB | json_body = [
{
"measurement": measurement,
"fields": {
"value": val
}
}
]
return json_body | 1 |
7189b5c1e2ec81b00a90b0b4092ffcbe | b48bbac9c870224ce021c7f4fec0d72b | Убрать лишние пробелы перед запятой | {
if (value.Length > 0)
{
if (value.Substring(value.Length - 1, 1) == ",")
{
value = value.Substring(0, value.Length - 1);
}
}
return value;
} | 0 |
c80acd4c5b6de86c2b7856a533203d57 | f0366ca7cfc5120dea0261fb06a099dc | Sets the restart strategy configuration. The configuration specifies which restart strategy
will be used for the execution graph in case of a restart. | @Public
public class StreamExecutionEnvironment implements AutoCloseable
@PublicEvolving
public void setRestartStrategy(
RestartStrategies.RestartStrategyConfiguration restartStrategyConfiguration) {
config.setRestartStrategy(restartStrategyConfiguration);
} | 1 |
036062455e39505200814804ff456bdf | 86152390943f3ffe03d022f88ad6972f | Method called at the start of the dialog.
Caches current values and displays them in the GDS tab. | self.__showDlg.accept()
self.configTable = self.__showDlg.configTable()
self.uriDb = self.__showDlg.uriDb()
self.schemaDb = self.__showDlg.schemaDb() | 0 |
5deb804e048ec407b6e93f06a5f6fe39 | 24b1d302217594a56c645ec958bb368b | @brief Function to send an interrupt to the registered
driver | static void
lan91cxx_deliver(struct eth_drv_sc *sc)
{
struct lan91cxx_priv_data *cpd =
(struct lan91cxx_priv_data *)sc->driver_private;
DEBUG_FUNCTION();
lan91cxx_poll(sc);
cyg_drv_interrupt_unmask(cpd->interrupt);
} | 0 |
353ae258bddde3984a6726cedae0cc5f | 8195f5a18b4131a9e88f78094c9de17d | Formats the flux. | row = "{:35}{}"
return (
'Fluxes(\n' +
row.format(
' Fq = {:.4} g/m^2/s,'.format(1e3 * self.Fq),
'Fc = {:.4} mg/m^2/s,\n'.format(1e6 * self.Fc)) +
row.format(
' Fqt = {:.4} g/m^2/s,'.format(1e3 * self.Fqt),
... | 1 |
05e45d2cf3b213fff3796f2fa8091bf1 | 9367880521f3ddc0c1b717536961d24c | Sin implementar, la función siempre regresa error. | public class Function extends Nodo
@Override
public double calcular() {
return 0;
} | 0 |
a70bcc73514fe953db1323d8039ade24 | c4cc345ee5cc2a7e313ce0605754ca6e | Try to get the Destructible script on the object. If found, attach the OnDestroyed event listener to the DestroyedEvent. | namespace Destructible
[RequireComponent(typeof(Destructible))]
public class WhenDamagedDamageParents : MonoBehaviour
private void OnDisable()
{
if (_destObj == null) return;
_destObj.DamagedEvent -= OnDamaged;
} | 0 |
9e98b9a575d7fb183a1ed27dea862873 | 4b516de284f2c39e4403c27396725e58 | Plot the Picard GC Bias plot | hetData=readHetsCSV()
covData=getCoverageDataAllBams()
hetData=addGeneAnnotation(hetData)
figure, axes=PLT.subplots(2,2)
bins=[0.15,0.175,0.2,0.225,0.25,0.275,0.3,0.325,0.35,0.375,0.4,0.425,0.45,0.475,0.5]
axes[0,0].hist(hetData["Ratio"].values, bins, color=getColourRange(14))
axes[0,0].set_xlim([0.15,0.5])
axe... | 0 |
392f0b6ca0004776e8239e13e5616d81 | a78589cd073fc49460cfb66d4553cf5c | 是否可以领悟技能 | function SkillModel:IsCanUpgrade(skillId)
local rtnIsCan = true
if skillId ~= nil then
local curSkill = self:GetSkillById(skillId)
local mainPlayer = SceneModel:GetInstance():GetMainPlayer()
if mainPlayer ~= nil and curSkill ~= nil then
if (curSkill.mastery < curSkill.needMastery) or (mainPlayer.level < curS... | 1 |
1182fc918b72866ef4832aa9d8b3e6ed | 2288494fd51340a7681bf6e5fd5a9bf8 | Metoda zwracająca zamówienie na podstawie nazwy użytkownika | {
var order = from odr in orderList where odr.orderNumber == name orderby odr.orderAmount select odr;
List<Order> result = order.ToList();
if(result == null)
throw new ArgumentException("doesn't exist.");
return result;
} | 0 |
3f52e97da24df371d18cfe2fbf300bf2 | c2b830a5a8727cd9a75a5f8dc497a46c | Temperature along an isentrope (Anderson and Ahrens; Equation B5) | T = T + 273.15
c = {}
c['b'] = 58.0
c['c'] = (28.31 + 0.10721*T - 8.81e-6*T**2)*1e6
c['d'] = (9380.0 - 8.53*T + 1.189e-3*T**2)*1e6
c['e'] = (-368654.0 + 715.9*T + 0.1534*T**2)*1e6
c['a'] = c['c'] + c['d']/v + c['e']/v**2
y = c['b']/(4*v)
pt1 = (83.... | 0 |
1dd3a652ddfe5668e57229a5348661ba | 7970d2b29c568523da4adef5db13cc6c | 元素到浏览器边的距离 | var l=ele.offsetLeft;
var t=ele.offsetTop;
var p=ele.offsetParent;
while(p){
if(window.navigator.userAgent.indexOf("MSIE 8")>-1){
l+=p.offsetLeft;
t+=p.offsetTop;
}else{
l+=p.offsetLeft+p.clientLeft;
t+=p.offsetTop+p.clientTop;
}
p=p.offsetParent;
}
return {left:l,top:t}
} | 1 |
b4f9bf04ad319aaba35bf7623848adce | 3f1df180611a65f6a5c260318e910d2f | Method 1: Brute Force - TLE | class Solution:
# Solution 1 : Brute Force
# (nested loop get all combination of two numbers)
#
# TC: O(N^2) : because there is only n * (n - 1) / 2 combinations
# SC: O(1) : we occupy no extra space in memory
def twoSum_solution_1_brute_force(self, nums: List[int], target: int)... | 1 |
7d22904840da168967c4789a1059b247 | 22de0f58bb43bfa0f7dab6cf8fac37ea | Babylonian method to approximate the square root | double eps = 10e-10;
double val = x;
double last;
do {
last = val;
val =(val + x/val) / 2;
} while(Math.abs(val-last) > eps);
return val;
} | 1 |
2b16545c342aab03b5d140f3dd637c4b | 13906733c1a5dbd01e287884c879a095 | กำหนด สี | public class SemaphoreSimpleL extends Ellipse
public void semaphoreColor(String color){
if(color.equalsIgnoreCase("red")){
semaphoreL.setBackgroundColor(ColorConstants.red);
}
if(color.equalsIgnoreCase("white")){
semaphoreL.setBackgroundColor(ColorConstants.white);
}
if(color.equalsIgnoreCase("green... | 1 |
241a66fad38417b56496cb0c046e4c45 | 0f15df0aa8078700c05f6c17bd230568 | 将定义的内容转成php-swagger的定义 | class Swagger
public function initDefinitions() {
$this->confSwagger['definitions'] = [];
$this->confSwagger['schemaMethods'] = [];
$baseCtrlClass = $this->confGlobal->get('apihelper.api.base_controller');
if (empty($baseCtrlClass)) {
throw new RuntimeException("apihelper.a... | 1 |
26d3b94952c6faeafee7cf9435f02bfe | 9f0ca2883c64adcf370216fdc3a19c5d | Because we display input as "percentage" to user but store it as
decimal, we need a way to convert our weights from decimal to % | list_all_percentage_weights = []
for i in all_percentage_weights:
current_sample_weights = []
for j in i.keys():
current_sample_weights.append(float(i[j]))
list_all_percentage_weights.append(current_sample_weights)
return pd.DataFrame(list_all_... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.