query_id
string
corpus_id
string
query
string
code
string
label
int64
24dadfc06d0905c9d4be683a7a098184
01eaf98384558bbd7682b56e80d8e63c
检查一系列IP地址的有效性,分隔符为','
$ips_arr = explode(',', $value); $valid_arr = array_filter($ips_arr,function($i){ return $this->checkIpRange($i); }); return count($ips_arr) == count($valid_arr); }
1
57245425f7ad558cfe49682f6a946b80
f2c37e4cc81b10c2f07a1c677e2d0339
bool: Flag indicating whether to back up the geodatabase schema.
class OracleSubclient(DatabaseSubclient): def backup_archive_log(self): return self._oracle_subclient_properties.get("backupArchiveLog")
0
ea7d20d66a5b1afe09bbf32463ec8b20
91ab005178d634b34680b072d8d61e6b
produces the list of athletes that had less than the given number of shooting rounds set on the competiton.
public class Official extends Participant public Athlete [] scoreGame(Athlete [] athletes, int [] scores) { Athlete [] ordered = new Athlete[athletes.length]; for (int i=0; i<athletes.length; i++) { int min = Arrays.stream(scores).min().getAsInt(); int minIndex = find(scores, min); ordered[i] = athletes[mi...
0
adff84e060e346d17298e20979275429
0c3734de01974bfb89fc22dd99888c5d
获取小兵攻击、攻击范围、攻击间隔
{ _enemyStatas.GetEnemyType(); switch (_enemyStatas.GetEnemyType()) { case EnemyType.Destroy: _sphereCollider = _enemyAttack.GetComponent<SphereCollider>(); _sphereCollider.enabled = false; _attackInterval = 1.0f; _a...
1
7b8de31526291d7cb30dfb6434d904ac
e9ed1de3577a1f97320fb1d55b5b40eb
Handles the Click event of the allToolStripMenuItem control.
namespace Drones public partial class Form1 : Form private void buttonShowAll_Click(object sender, EventArgs e) { RefreshData(); toolStripComboBoxStatus.SelectedIndex = 0; }
0
12389477e16609dd55472a49132ccc9c
fb9e62466d3118ab7ea8f1686f7adcbd
Change virtual terminal, returning success.
int uv_tty_reset_mode(void) { return 0; }
0
6b9db803f09c99c215bb7c105f2e9dc5
7ad27983e9e45e066ab7a7a5c6a0e68e
Tests if channel 0 is disabled, once again. Verification is done by using API.
public void IsInactiveWhenDisabled() { _mockSettings.Setup(settings => settings.GetValue(_testService.PublicEnabledPreferenceKey, It.IsAny<bool>())) .Returns(false); _testService.OnChannelGroupReady(_mockChannelGroup.Object, string.Empty); Assert.IsTru...
0
73be4cf34ee9a74a7f9f36d668449b39
40d5856d80568ff3214f0e2e1c3ff1af
This method is called when <code>MsLinkEventID.LINK_FAILED</code> is fired. Fired when <p> <blockquote> <pre> MsLink msLink; ... msLink.join("media/trunk/IVR/$", "media/trunk/Conference/enp-1"); </pre> </blockquote> </p> is called and joining of two Endpoint fails
public class ImsCallSessionListenerImplBase extends IImsCallSessionListener.Stub @Override public void callSessionConferenceExtendFailed(IImsCallSession session, ImsReasonInfo reasonInfo) { }
0
6452ba01742fdcf816e4b385099e5f11
870e7cf323862dc862cacc1778881c14
Reads entropies (or perplexities) from the pandas data frame.
tokenizer = RegexpTokenizer(r'\w+') c = 0 randomness_info = [] for index, row in df.iterrows(): body_only = re.sub('<code>[^>]+</code>', '', row['Body']) soup = BeautifulSoup(body_only,"lxml") tag_removed_text = soup.text tag_removed_text = tag_removed_text.replace("\n","") char_in_body = list(tag_removed...
0
cc0f0880f65e06e287d4fcadc81a9943
fa8277f1cf06e6ef29c6d48ad2761e2c
constants for index access into the probability vectors
void EMClassifier::allocateSpace() { double initial_p = 1.0 / m_k; m_cp.assign( m_d.size(), vector<double>(m_k, 0.0) ); m_p.resize( m_k ); m_p[0] = .25; m_p[1] = .5; m_p[2] = .25; m_pnew = m_p; m_u.resize( m_k ); m_u[0] = 5; m_u[1] = 15; m_u[2] = 25; m_s.resize( m_k ); if ( !m_constVariance ) { m_...
0
2db3939346c5e6fe3a05c811b84e38aa
721920ee0cb19b0f8a0a6c11f90a459a
SHOW PWD
public class MainActivity extends AppCompatActivity public void showPw(View view) { if (isclick) { isclick = !isclick; Log.d("google-my:", "showPw: ------------------------------------------->" ); View pwView = LayoutInflater.from(this).inflate(R.layout.pw_layout, null); ...
1
5372bc9d5218e8452af8be82bccdc55d
fc7412298b2d02652df81d2743ec7460
Gets whether or not the group regex collection is cached
class GroupManager extends AbstractGroupManager public function getAclCollectionCache() { return $this->aclCollectionCache; }
0
d4b8c2004995dc928c64052376dafdd5
e56edd5856ca752681b77ed38da2d5f6
是否是键盘按键
public class HomeActivity extends BaseActivity implements View.OnFocusChangeListener,View.OnKeyListener,View.OnClickListener, SurfaceHolder.Callback, android.media.MediaPlayer.OnPreparedListener, android.media.MediaPlayer.OnCompletionListener, android.media.MediaPlayer.OnErrorListener{ private boolean isKeyDown(KeyEven...
1
e95589c80fd09b7585fe1754d1cc2538
4306652575d10e15a71fd5dbe63b0e0f
Clear the given reset reasons.
static void clearResetCauses(void) { RMU->CMD |= RMU_CMD_RCCLR; EMU->AUXCTRL |= EMU_AUXCTRL_HRCCLR; EMU->AUXCTRL &= ~EMU_AUXCTRL_HRCCLR; }
1
b0fb958c09a55220fefcce430b632610
b66204f4071b4282fc02c5f3b96190c6
Updates the 'global' part of a header. Can be used for both vehicle and line files given `finfo`.
class SigMFFile(): def set_global_info(self, new_global): self._validate_dict_in_section(new_global, self.GLOBAL_KEY) self._metadata[self.GLOBAL_KEY] = new_global
1
642ea78894a92ffb64917b660295dc98
2bb693df1b67876e7f559382b013fdb1
remove or add a player to the current players array
if($('#player1').val()) { playerNum = 1; } if($('#player2').val()) { playerNum++; } if($('#player3').val()) { playerNum++; } }
0
6bf1016e5e776d83b0b0b5c1403e2ce5
78f820c3c51f338ecba05df0a8be0519
Возвращает исходный код геттера для связи OneToOne
class OneToOneEntity public function getToOne(bool $modifyValue = true): ?ByValueDifferentiatorEntity { if ($modifyValue) { $this->toOne->setField('Modified from getToOne getter', false); } return $this->toOne; }
1
950320decbbd9b926cbe12f79149ce84
d4494f4dc143ac4c7c77c4d6bf48bd1f
Calculate the bit in the GPIO register that a specific GPIO number corresponds to.
static inline s32int getIndexByAddress(u32int physicalAddress) { switch (physicalAddress & ADDRESS_MASK) { case GPIO1: return 0; case GPIO2: return 1; case GPIO3: return 2; case GPIO4: return 3; case GPIO5: return 4; case GPIO6: return 5; default: ...
0
1b21541122129970f68d009751c1eaa6
275e4709bcecc5f517e1ae0d6d0b4dd2
取得したセッションIDからサインインする
class Signin extends CI_Controller public function index(){ $getData = $this->input->get(); $requireArr = array( 'user_id' ); $verify = parameter_necessary_verify( $getData, $requireArr, $dataNew ); if( $verify !== true ){ echo $verify; exi...
0
5ff09f83c3f07701a1fba30a657c8b9c
0d3f6b53bd7753712288fa6b0284a3c6
获取国家缩写,小写
@Table(name = "t_sys_province") public class TSysProvince public String getShortname() { return shortname; }
0
fa7dba680668e94617681b5c4e5d4bb0
804a93c0276bd755602d15ca9cde1370
head라는 태그를 찾아 충돌 했을 때 게임오브젝트 삭제
public class ColliderMove : MonoBehaviour void OnCollisionEnter(Collision collision) { Destroy(collision.gameObject); }
0
9aafd71f3aa6e096b72bc680df0fe5f1
c434fc4c699170917be5f3c5b9a024e8
如果该线程还没有Session,则创建一个新的Session
SqlSession session = threadlocal.get(); if(session==null){ newSession(); session = threadlocal.get(); } return session; }
1
115c543564c5309a31177a04d83dc786
632d650d7747bdca5d99088ee9b7007c
Retrieves a storm record from the server given a Storm ID
function getRecord(recordId) { return server.get('record/'+recordId).then(handleResponse) }
1
cd55fbc96179fa1806eea8a3f086e8f6
97cce2498e6977862f3d85c3b24a2803
Returns a hash of the element, ready to be added to the block formatted message. Abstract method that needs to be implemented in each subclassed element.
class BlockBase(VerifiableMixin): def GetMessage(self): return Helper.GetHashData(self)
0
bd7c33d4f19354ab031950a69371cd8b
11d8dd06613423c7f93c7a2cf3e6a334
Final re-formatting/re-structuring of input data to conform with REST API's requirements.
def _reformat_enum(rest_param): type = rest_param['type'] options = rest_param['options'] size = rest_param['size'] return {'type':type,'options':options,'size':size}
1
cb8359459bae0f09180206bf3e9f0b0f
a8be7ed890816b558f3cab4a19b00b87
Low level IL for this function
{ if (methodContext == null) throw new ArgumentNullException(nameof(methodContext)); if (methodContext.NativeCode == null) throw new NullReferenceException(nameof(methodContext.NativeCode)); System.Reflection.MethodInfo method = (System.Reflect...
1
ec0f804073aa1ec0426b31803da84f8d
f856d6c381c9dba89d17bef94488d072
Список пакетов основного репозитория
class PackageController extends Controller public function index() { $meta = []; $this->authorize('create', Package::class); $builder = $this->model->orderBy('name', 'ASC'); $builder = $builder->with('cycle')->with('service'); if (request()->has('q') && request()->get('q')) {...
1
ddce63cb5e9eda2456d2b134fe66b581
e76cefde8c512ebfd41cf8253650f1d4
Describe the user data being stored and exported.
class UserData: def __init__(self, user_id: str, user_roles: list, secret: str): self.user_id = user_id self.user_roles = user_roles self.secret = secret
1
95d5f3b77d5796758f0dcfa300686d0c
d07f40ecec4b1870426bd7fe6f422a11
build a monitor to compute BER/FER on each thread
self.num_threads = num_threads self.count_threads1 = [self.num_threads] self.count_threads2 = [self.num_threads] self.count_lock = Lock() self.threads_sem1 = Semaphore(0) self.threads_sem2 = Semaphore(0)
0
8d53fff807ab056375e67ae83d80adcf
a2343e4d5c0db132f0ab8aa594c095c8
Gets report cards within the student competencies.
namespace inBloomApiLibrary public class StudentDataService : ServiceBase public JArray GetStudentCompetenciesReportCards(string accessToken, string studentId) { string apiEndPoint = String.Format(ApiHelper.BaseUrl + "/studentCompetencies/{0}/reportCards", studentId); return ApiHelper.CallApiForGet(apiEndPoint...
1
e01d891c3e1b63efee961605cfaa675e
bd313f0a2854e852c64f5db5418d7e45
玩家治疗
{ if (isAdd) { this.damage += damage; this.hp += hp; this.power = (this.hp + this.damage); } else { this.damage -= damage; this.hp -= hp; this.power = (this.hp + this.damage); } OnPlayerIn...
1
caea373b2265fe57a3063a92c2ef25c8
8c2d9235c46b5acd52a6e467966704f0
管理员获取所有活动预约(根据room/status分)
if request.method == "GET": try: Rid = request.GET.get('Rid') display_token = request.GET.get('token', None) check = Room.objects.filter(Rid=Rid) assert len(check) > 0 assert display_token is not None except: return JsonResponse...
0
bf9eb18b90fca104155b100ca252b677
4fa978791d7131810fd26bec5dedacda
Return the classic GAN losses for the generator and the discriminator. (Generator) log(1 - sigmoid(D(G(z)))) (Discriminator) - log(sigmoid(D(x))) - log(1 - sigmoid(D(G(z))))
def ra_hinge_gan_loss(discriminator_data, discriminator_z): d_r = discriminator_data - tf.reduce_mean(discriminator_z, axis=0) d_z = discriminator_z - tf.reduce_mean(discriminator_data, axis=0) loss_discriminator_data = tf.reduce_mean(tf.nn.relu(1 - d_r)) loss_discriminator_z = tf.reduce_mean(tf.nn.relu...
0
e4f73b4331f9931542d625c463556e15
2333fcaf3c88f3be50abe5714400b79e
Switch to showing monthly plans.
class AdminMonthlyPlanController extends AdminAppController public function add() { $this->addViewValueSet(); }
0
b1548926c176bdb5ddd680e230ed8647
6b4c5231d3d02df03616be3bd0e0e2ea
Turn on the power to Heater and LED
namespace K8055Controller public partial class FrmDemo : Form private void button1_Click(object sender, EventArgs e) { tc.SetNoHeaterOn(1); }
0
8564a38cde1cab77f8fa7177083b5c06
97be1b850417aa9c8e7cf50c9ea548d3
Função que popula a tabela IpsCurso com os cursos da ESE
global $conexao ,$Vestibular; $SQL = "SELECT f.filialnome ,vc.filialcodigo ,vc.cursocodigo ,c.cursonome ,vc.percodigo ,p.perdescricao FROM vestibularcursos vc INNER JOIN filiais f ON f.filialcodigo=vc.filialcodigo INNER JOIN cursos c ON c.cur...
0
3bf2d025feb7dcced45bd4d695d074c3
1f9299dadf15e61acdd627cd3e10f0bb
轮询查询时间数据
self.log.log_start("query_time_rule") timerulData = self.get_table_data("query_time_rule") for dataRow in range(len(timerulData)): data = timerulData[dataRow] try: if dataRow != 0: self.timerule.click_reset_time() if dataRow != 4: self.timerule.set_search_timename((data[1])) self.ti...
1
15d8e9ffa2c63b60527d5ad075a33753
061fab47b0c22bc5ecdfcfb000893b4b
Extracts the transition effect procedure pin bindings given the transition term
IObjectEntry obj, IStateEntry state, Vector transitionVec) { IProcessEntry proc; ILinkEntry link1, link2; Enumeration linkListOut, procLinkOut; IStateEntry state2; IEntry ent; IObjectEntry obj2; String path1 = "", path2 = ""; linkListOut = state.getLinksByDestination(); while (linkListOut.hasMoreE...
1
a0bbbf9d9713acd1953150372a29fb80
9dfb68f7af07ecc35304d021f9bb13e9
#Z-normalization
m = mean(vec) s = sd(vec) if(s!=0){ zs = (vec - m)/s } else{ zs=vec-m } return(zs) }
1
049e8841f3168e02ffbe2c5b33956582
8b7eaa1b3cc8a1aceb4d4827df96173e
(String[]) --> List[String[]] Returns the revision ids and when the edits were made in xml format excluding edits made by anonymous users of the url list of url strings. The revisions returned is limited by the revisionlimit integer which must be greater than or equal to zero
titles = '|'.join(p.title for p in self._things) params = { 'action': 'query', 'titles': titles, 'prop': 'deletedrevisions', 'drvlimit': limit, } params.update(evil) return self._mklist(params, 'deletedrevisions', Page, Revision)
0
35b23697e7e66d278682cfdf8defdb3a
30064cd08848449e706af2debf2d5572
Provides reasonable default values for an HtmlErrorReporter that would be used in unit tests
StatisticsReport statisticsReport = new StatisticsReport(); statisticsReport.setNumCorrect(BigInteger.TEN); statisticsReport.setNumIncorrect(BigInteger.ONE); statisticsReport.setNumTestInstances(BigInteger.TEN); statisticsReport.setMaxAucValue(BigDecimal.ONE); statisticsR...
0
700847e4e7d247b798aad64936ecae15
6c0ef8647f895dd6c22fec4bc2edfbfe
Gets all possible combinations between two uneven lists of reactants
def get_all_possible_combinations(s1, s2, R): candidates = [] permutation_sets = enumerate_subsets(R, set_upper=False) for positions in permutation_sets: s1_list = list(s1) s2_list = list(s2) for pos in positions: s1_orig = s1[pos] s2_orig = s2[pos] ...
0
b5d7ab73c2d65f31b028f0f63c5d0cf5
1caea35202c3d22bbaa0757363077e6a
获取制定场景中的未接取任务,如果场景名为空,则返回所有未接取任务 检测的是接取任务NPC所在的场景
function TaskModel:GetTaskListBySubmitNPC(npcId) local rtnTaskDataList = {} if npcId then for index = 1, #self.taskDataList do local v = self.taskDataList[index] if v:GetTaskState() == TaskConst.TaskState.Finish then if v:GetSubmitNPCId() == npcId then table.insert(rtnTaskDataList, v) end end ...
0
6595fb25268c60c0001b66784fbacd65
e9950923e4561099c9eef7ef53a240ff
Needs to handle all types of log lines. Currently can handle those of: auth.log fail2ban. Returns None if parsing is unsuccessful.
class Command(BaseCommand): def parse_line(self, line): try: regex_data = re.match( r'(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\s\-\s\-\s\[(.+)\]\s\"(\w{1,7})\s(\S*)\s\S*\s(\d*)\s(\d*).*', line, ).groups() return ApacheLog( ipv4_addr...
0
86bdff834fe8ae8ac7bb78a4cec2c84a
77f4d82ee1e814cf482562e447e35f4a
Populate model from core entity
class StockOutItemDTO extends BaseDTO public function fromEntity(BaseEntity $entity) { $values = $entity->getAttributes(); $this->setAttributes($values); $goods = GoodsRepository::repository()->findByPk($entity->goods_id); $this->goods_name = $goods->name; }
1
9e51ab12986efad8ecec59cc840f9d2f
0f438d9ed5d66f63885f2105b15a94f6
判断5张牌的牌型
export class CardCountSys public checkSiZha(cards: Array<wanRenDouNiu.CardModel>): boolean { var boo: boolean = false; cards = this.sortCard_5(cards); this.resultCards = new Array<wanRenDouNiu.CardModel>(); if ((cards[0].dianShu == cards[1].dianShu && cards[0].dianShu == cards[2].dianShu && cards[0]...
1
0486dd25c90466ce200d452514ccf80d
39d09c63de0082763a96fae0011fa127
The location where the instance launched.
class GetInstanceResult: def location(self) -> str: return pulumi.get(self, "location")
1
7a9f4a63c02cedf3e1312fecf4ebd863
9b09482d85003f50af910edc2283fe1f
Integrate the equations using the Euler-Maruyama scheme
self.dt = self.T / self.nsteps self.STs = np.full((self.niter, self.nsteps), self.S0, dtype=np.float32) for i in range(self.nsteps): X = np.random.randn(int(self.niter/2)) X = np.concatenate((X, -X), axis=0) self.STs[:,i] = self.STs[:,i-1] * np.exp( (self.r- (...
1
ba0505ef8f0b026c14fcfad721c0e3fc
6e2a240287144070b1b73e01aee7f6e2
Returns true if the inputted string is comprised of all lowercase characters
function isAllLower(x) { return x === x.toLowerCase(); }
1
d9d5a94c70f0e315ed7f0382ab353730
5058ab24ee100425d57c35a7dbdf667a
Gets text of the Save paragraph
{ if (this.PART_TextBox == null) { return string.Empty; } return this.PART_TextBox.GetSelectionText(); }
0
3ad90064f4badc11b23b371436a0c3ee
a9aba75100519dc5f7e680ae8aec101f
Opens a zip file for reading.
namespace Microsoft.Arcade.Common ZipArchive OpenArchive(string archivePath, ZipArchiveMode mode);
1
00cd1f137b0046d77f02aeaf79fdc577
93601a27a66e4f11efee9ece61574553
连接对端的端口类型
@Configuration @ConditionalOnClass({FtpClient.class, StandAloneFtpClient.class, StandAloneSFtpClient.class}) @EnableConfigurationProperties(FtpConfigutationProperties.class) public class FtpAutoConfiguration private void setConnectType() { Set<FtpConnectInfo> connectInfoSet = this.configutationProperties.getCon...
1
c89a205703ad3594ad9965de1e97857a
1c2353ad1122fcf7fac48b2ec6e76168
If there is a next parameter we redirect to this page, else we redirect to home
{ if(isset($_POST['goToPages'])) { $sId = DB::table('pages')->where('url_page', Input::get('currentPageParameters'))->value('site_id'); $sName = DB::table('sites')->where('id', $sId)->value('url_site'); return redirect('sitePages/'.$sName); } }
0
b73f1c1daec5819859421e7afe611108
225d8d761074fdf68a868d03b4659544
@brief <i>VIC</i>: emit code to wait for next raster irq This function outputs assembly code needed to wait for the next raster. Meanwhile, the execution of the main code will resume where it left off.
void vic2z_next_raster_at( Environment * _environment, char * _label, char * _positionlo, char * _positionhi ) { MAKE_LABEL outline1("LDA %s", _positionlo); outline0("STA $D012"); outline1("LDA %s", _positionhi ); outline0("AND #%00000001" ); cpu6502_beq(_environment, label); outline0("LDA $...
1
71e6f65825ac6e6ce68ed764c9eab7ff
4f80d7880f72cb456afdfaf338cd26c8
Finishes a multi-statement transaction by applying the changes.
{ EnsureIsNotDisposed(); EnsureTransactionIsActive(); try { await ActiveTransaction.CommitAsync(token).ConfigureAwait(false); } finally { await ActiveTransaction.DisposeAsync().ConfigureAwait(false); ClearActiveTransaction(); } }
1
8f43bfc9edce04a32ce12e2644c17fd5
d0007b8a92f997aec6a0626c5c692e70
method to stop falling through platforms
public class PlayerMovement : MonoBehaviour void StopFalling() { velocity.y = 0; }
1
6bdc5d02ca2486ff0086a58f4c82642d
a950358da4fba2c39f30fbb476a57c29
Draw current tetrimino and next piece, and update any dirty rects.
for (unsigned char i = 0; i < tetrisCurrentPieceSize; i++) { tetrisPixels[(unsigned char)(tetrisCurrentPiece[i][0]) - 1] [(unsigned char)(tetrisCurrentPiece[i][1])] = 2; } tetrisIndex = (tetrisIndex + 1) % 7; tetrisCurrentPieceType = tetrisPieces[tetrisIndex]; tetrisCur...
0
de759d660efb3ed4ee29619b663debfa
5a9619c04cab3c6dacc5bde9e8c209ec
Updates the UI by displaying the currently used avatar sprite.
public class AvatarTabController : MonoBehaviour void Update () { }
0
b7a8b84eeb55cc5ccb243304ed968e97
8e18cc902f9e54440474672de7759fb7
If the LCD Display exists, write a simple message on the first line.
{ char dispBuff[20]; command_lcd(LCD_CMD_SET_CUR_POS(0x00)); memset(dispBuff, 0, 20); sprintf(dispBuff, "INVERTER ON "); data_string_lcd((unsigned char *) dispBuff); }
1
712d8d9fbe75e43d45ae0fa85a74cfd8
b2a0922e580c32961ebf9fdd8dc832c3
Delete a jobTimeActivity Deletes the jobTimeActivity identified by the specified id.
{ $returnType = '\Infoplus\Infoplus\Model\JobTimeActivity'; $request = $this->getJobTimeActivityByIdRequest($job_time_activity_id); try { $options = $this->createHttpClientOption(); try { $response = $this->client->send($request, $options); ...
0
2dbcd5eb4ca6b7f88fbff84b233d4337
07984116e932fceafd78192c7826177f
returns an array of hashtable for given query; optionally fill values
class MonetDBAdapter def select(sql, name = nil, binds = []) hdl = execute(sql, name) hdl.result_hashes end
1
8386c9ba0870fa695cbb45f865eb0bdf
3b10f104410e62a9e467d07cb4c728b5
把标签字段写入mongo
{ $tagModel = new Tag(); $rows = array(); foreach ($tags as $tag) { if (!Tag::findOne(['name' => $tag])) { $tagModel = clone $tagModel; $tagModel->get_autoincrement_id(); $rows[] = [ 'id' => $tagModel->id, ...
1
6182ce2a99604a9b87b3aa141822c008
62a75d6c9dff4b5a3ae15f7ced5b897b
Choose a random mob from the rooms spawn table
{ nullpo_ret(value); if (count < 1) { count = 0; while(count < 5 && mobdb_checkid(value[count])) count++; if(count < 1) return 0; } else { if(mobdb_checkid(value[0]) == 0) return 0; } return mobdb_checkid(value[rnd()%count]); }
1
70161ec0a983a21cfae379e16683f2be
1afcf4bd04deaae61d0d8e85289034ae
每次支付的时候尝试支付最大面额的金钱,这样子,就能得到最优解
var top float64 var maxRet float64 top = money[0] maxRet = 0 for i := 1; i < len(money); i++ { if money[i] > top { top = money[i] } else { tmpRet := (money[i] - top) / money[i] if tmpRet < maxRet { maxRet = tmpRet } } } fmt.Println("max ret:", maxRet) }
0
20f67592b5112d5fab74260857fb762f
95540fdaf710c5e191b6ac107eb58eb9
Zeichnet einen Sitzplatz in den Saalplan
final double xgroesse = c.getXgroesse(); final double ygroesse = c.getYgroesse(); final double max = c.getPosmax(); final double xoffset = xgroesse * 1.5; final double yoffset = ygroesse * 4.0; final double xanzahl = c.getSaeulen().size(); final double yanzahl = c...
0
793aadb5da1d848cdbf0391ab338d503
b7aec320925c1b399a92b9c31457d1e7
Tests if the relative path switch works.
class PathPatternFinderTest @Test void testRelative() { String[] expectedFirstValue = new String[] { "commonFirst", File.separator, "PREFIX_", "5671", "_", "aaaa", ...
1
f740f64b9383de98968d62e071861877
fdb45bef654d20570c9a73729bd4cb71
convert the information from the array in icalendar format
return [ 'BEGIN:VCALENDAR', 'VERSION:2.0', 'BEGIN:VEVENT', 'CLASS:PUBLIC', 'DESCRIPTION:' + formatIcsText(data.description, 62), 'DTSTART:' + data.startDate, 'DTEND:' + data.endDate, 'LOCATION:' + formatIcsText(data.location, 64), 'SUMMARY:' + formatIcsText(data.title, 66), 'TR...
1
917150478b1f50df0b8c8c78721bee4c
ee0df9f60f7b08b13379c3d75008fb0a
Sets turtle's step distance.
public void setStepSize(Double ss);
1
89b437547efc59dad49584824c975131
06ea76ad4c7e7d76562375935b61ea32
permet de recuperer l'id du membre
class Member public function getId() { return $this->id; }
1
d514b5e3e01ab8a17b35ad7d959af9fc
09bd26048e2c1b9e18aa16101063b3be
修改机构资质附件
HttpSession session = Struts2Utils.getSession(); boolean appendixIsChange = false; if(session.getAttribute("appendixIsChange") != null){ appendixIsChange = (Boolean) session.getAttribute("appendixIsChange"); } Integer tempZykid = (Integer) session.getAttribute("zykid"); String tempZyktype = (String) ses...
1
c1b62de82732d2857fe3113515a504b8
3cd65d984fa322fc1495668dd7675724
Returns a single direct message, specified by an id parameter. Like the /1.1/direct_messages.format request, this method will include the user objects of the sender and recipient.
url = 'http://twitter.com/direct_messages/destroy/%s.json' % id json = self._FetchUrl(url, post_data={}) data = simplejson.loads(json) self._CheckForTwitterError(data) return DirectMessage.NewFromJsonDict(data)
0
bbdbea324a021e90d4237868209e8a3f
0972541c661d80a406ce859a73e0545a
define a global function called echo which prints the first argument on stdout
int echo_variables(int num) { return num; }
0
b05f40e5fef007ed6cb3d709dfba523f
caa21e3cdb1bf1bed34e915756ad27ad
Gets the ProblemInfo object from the DSS for given problem_id.
public SuccessZoneProblemDto getPatProblem(int problemId);
0
4643cce5102214f36d65755f368d000e
e9cf45048f49f3498b26890fa5fa2e43
查询memberId对应的会员所有的被举报的动态
List<Map<String, Object>> queryByMemberId(Map<String, Object> map);
1
c6aa6bf5d3036597c50d7e0e58984b46
65899289f8e0f6717b5c0df86f636fef
初始状态,如果合成的音频数据已经加载则开始朗读,否则调用相应tts获取音频数据后朗读
this.audioContext = wx.getBackgroundAudioManager() this.InitAudioState() this.EventListener() this.playProcessListener() if(this.useTaiAudio){ this.taiUpdateAudioListener(); } }
0
d99474a804e777b6658b1deb624c7b2e
870efb7ea2d502f1bfb9beb5e3425420
Sets the font for this component. This is overridden to update the cached font metrics and to recalculate which lines are visible.
if (scale != 0.0 && scale != 1.0) { if (oPos != null) { String sFontFace = oPos.getFontFace(); int nFontSize = oPos.getFontSize(); int nFontStyle = oPos.getFontStyle(); Font font2 = new Font(sFontFace, nFontStyle, nFontSize); Point p1 = UIUtilities.transformPoint(font2.getSize(), font2.getSize...
1
e886c38b8b955dc23d24ceb31405100b
8dcd86cb534410f26c034e1a12e05944
инициализация кнопки закрытия формы (крестик)
class closeButton(QPushButton): def __init__(self): super().__init__() self.setFixedSize(60, 60) self.setIconSize(QSize(40, 40)) self.setStyleSheet('border:none;') self.setIcon(QIcon('./images/close.png'))
1
54877e6a18145fd40117868157926036
abe8406732a32ae8e751bc7438d3896c
Generate Random 6-digits
function generateRandom6Digits() { return Math.floor(100000 + Math.random() * 900000); }
1
bb0a555967cfe9b575b579472727c863
8f3a630b0ac36f2873406b0043c2ecbb
串行矩阵乘
var r1, r2, r3, r4; var c; var a = { m11: 1, m12: 2, m13: 3, m14: 4, m21: 5, m22: 6, m23: 7, m24: 8, m31: 9, m32: 10, m33: 11, m34: 12, m41: 13, m42: 14, m43: 15, m44: 16 }; ...
1
0da4812ae1e1d538fe2cc2661e9ea99f
324ed15088180ba5a705f904ad080c14
Wait for all background commits for an AU to finish
this.verifyNotClosed(); const trackedBatches = this.batchQueue; const writePromises = trackedBatches.map(batch => batch.awaitBulkCommit()); this.sendReadyBatches(); await Promise.all(writePromises); }
1
0862b7a09f043330becf18f685a3f7bf
e28196d1c3aa63ac6499e6fac2cd7ad1
Function input: Nothing Change the direction of the scheduler.
void sched_alternator(){ getcontext(&signal_context); signal_context.uc_stack.ss_sp = signal_stack; signal_context.uc_stack.ss_size = TAM_STACK; signal_context.uc_stack.ss_flags = 0; sigemptyset(&signal_context.uc_sigmask); switch_sched = 0; switch_sched = switch_sched^sched_actual; ca...
1
3cbdc7310bc954586b494fc6516858cf
7f5c495205162c465179f29a543b5bd7
根据权限项序号获取权限项
String sql = "select SEQ_ID,ITEM_NAME from oa_sal_item where SEQ_ID ="+seqID; PreparedStatement stmt = null; ResultSet rs = null; String seqIds = ""; YHSalItem salItem = new YHSalItem(); try { stmt = dbConn.prepareStatement(sql); rs = stmt.executeQuery(); if(rs.next()){ salIt...
1
424f9055e2fc6d58aa092430324d77b5
85ef79760412e3e0dc778f807bef5138
Get number of callbacks of TLS
uint16_t os_count_callbacks(void) { return list_length(_callbacks); }
0
cd829a2fbdca0708cd56ec1ef6fd7610
208c9339903a2bb68f33ab710dd454c0
Transforms direction vector v (v.w is presumed 0.0) by the inverse of this rigid transformation. Actually, only the rotation is used.
v.x -= origin.x; v.y -= origin.y; v.z -= origin.z; return rotation.InverseMultiply(ref v); }
1
2b0317411b3ea4a7765f5f8bfdf76437
58d8b5543c348dc258e9045112ad1b0c
Returns the first employee hiring in the ordered set where uuid = &#63; and companyId = &#63;.
public Fichaje fetchByUuid_C_First(String uuid, long companyId, com.liferay.portal.kernel.util.OrderByComparator<Fichaje> orderByComparator);
1
c30a899aa7bd879cc28f3defd3f54830
bc39ca306ded2ff6cd7025443ae8a10a
Capture first of the supplied regex
val compile = Pattern.compile(regex) val matcher = compile.matcher(text) if (matcher.find()) return matcher.group(1) return "" }
1
08c879cd99aee26e7f4ef1949d26c919
3dce33f391e8e1673af91ed4d0ab2368
call this to turn all debugging OFF, both error messages AND debug( ) method output
class Api function debug_off() { $this->debug = FALSE; }
1
7b77ce9477dc9ece8dbb02f73bcdbfcc
aa6686c0b482a58bc211e1b394b95eae
Validate the input fields of the tab Income history in view transaction for SND reference.
@Component public class BsInviAcep extends BaseBS protected void validateInput(BaseBSArea a) throws Exception { BsInviAcepArea area = (BsInviAcepArea)a; validateInputField(area.IN.iden, Invi.IDEN); }
0
6448aecf86ad854581605e6c45d724ad
11ee5ce2e71e63b4ff884b0b09e6caae
When a product is selected in the product explorer clear the operator editor
if (this.reportIsDisabled || !report) { return; } const selected = !!report.value.selected; if (selected) { this.clearProductForm(report); } report.get("selected").setValue(!selected); }
1
512e80c793b77b4a76fcbf452ca89810
4fe1925aa9a54b46c2111ad591a42ac1
Test ordering the permission fields without any fields in the form. Expected result: No errors are raised.
class TestSurveyGetLatestCreateView(APIExampleMixin, APIRequestTestCase): def test_new_field(self): SurveyFieldOrderingFactory.create( field=self.field_one, fieldset=self.fieldset_three, ) view = views_api.SurveyGetLatestCreateView.as_view() request = self.create_...
0
0c05f8dbd43106167244571d9a8ee57d
5b46b869793955cf1279615ab187e0f4
プレイヤーをタップ位置によって左右上に動かす
void Thunder::onTouchMoved(Touch *touch, Event *event) { Vec2 delta = touch->getDelta(); if (player->getPositionX() >= 50 && player->getPositionX() <= visibleSize.width - 50) { player->setPosition(Vec2(player->getPositionX() + delta.x, player->getPositionY())); } else if (player->getPositionX() < 50) { player->...
0
e33b66744e4f412760cfe3f3f2fec64e
39842f5556b074adb702fa6f27f3363b
# 佣兵移动判定
if unit.team ~= myHero.team and unit.type == myHero.type and unit.distance < 3000 then if state == "Run" then local visPos = Vector(unit) + Vector(GetDirection(unit)):normalized() * (125 + myHero.boundingRadius + unit.boundingRadius) local d1 = unit.distance local d2 = myHero:DistanceTo(visPos) i...
1
8dd2819730b9f2aff5bae031f4ae6ecd
a241573c1c5c3cf122352b8a390559f2
装载密钥
{ if (isEncryption) { for (int i = 0; i < key.Count; i += 4) { K.Add(key.GetRange(i, 4)); } for (int i = 0; i < 2; i++) { K.AddRange(K); } ...
1
bbaf8520b492481ab26e92464bdf2dec
e68e2499bac4c1b03791df7daadf10c1
This tests the case where the sync source metadata is behind us but we get a document which is equal to us. Since that means the metadata is stale and can be ignored, we should accept this sync source.
public class TestSynchronizedMetadataValidation @Test public void TestDocumentWithoutInformation() throws Exception { try { ve = sync.validateMetadataSynchronization(doc, metadata); Assert.assertEquals(0, ve.size()); } catch (ValidationException e) ...
0
73eb5cabfc55f36576ae6f1dd3874300
5fc168d37b7998f01f9fe405f959936f
turns reverse-linear history into a dependency map
h = {} bh = $buffer_history.reverse.select { |x| r = h[x] == nil; h[x] = true; r } $buffer_history = bh.reverse end
0
f73f38cdcf049abd08f97aabdb99d86f
fe4699fbc5a49a98877d539be9089edf
This test ensures that we get errors from callbacks correctly and in particular that we do not segv when callbacks fail
bst_noerror = train( self.params, RayDMatrix(self.x, self.y), num_boost_round=10, ray_params=RayParams(max_actor_restarts=0, num_actors=2)) bst_2part_1 = train( self.params, RayDMatrix(self.x, self.y), num_boost_round=5,...
1
3deabe412705e33503524f665e66cec6
24eeba4d479dbb50ac1d3e9c62d723dd
Gets only the usernames of the participants of a booking.
{ if( isset($this->participantUsers) ) { $users = $this->participantUsers; if( !empty($userId) ){ $users = $users->where('id', $userId); } } else $users = $this->participantUsers($userId); $userNames = $users->pluck($col...
1
7acee7d6829d00036af33bcd3f34ae24
a28db06e130f2bcae8c156def1fe7610
实现一个简单的HTTP服务器,在浏览器里输入http://127.0.0.1:8080即可浏览文件, 这些文件正是当前目录在HTTP服务器上的映射目录。
func main() { http.ListenAndServe(":8080", http.FileServer(http.Dir("."))) }
1
f1a98f1d4886201b6d000086bb6e1909
ad060a4ef39df83938b54ed1d8586c36
区分HK站点和CN站点文件
class Shop_Model_ShippingRegionDetail extends Seed_Model_Db public function __construct($label, $config_file=null) { parent::__construct($label, $config_file); if(defined('CURRENT_MODULE_NAME') && (CURRENT_MODULE_NAME=='www_hk' || CURRENT_MODULE_NAME=='center_hk' || CURRENT_MODULE_NAME=='api_hk')){ ...
1
ee668563e8d9c5703008f35c064acfd5
26c66ba5c0c60f86e20956a169201894
指定日期与当前日期的间隔秒数 added by wangzhe
public class DateUtil public static long calIntervalSeconds(Date date) { DateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); DateFormat df1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); long seconds = 0l; try { df.setLenient(false); df1.setLenient(false); Date d1 = df.parse(df1.format(new Dat...
1