query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fd19e0b5b04fa9be1fff1f80b74753ab | b7facd1eafd514e13399d7dc60b76c6a | Checks if the string is a valid 24 hour formatted time | def validTime(time):
hours, minutes = int(time[:2]), int(time[3:])
return 0 <= hours <= 23 and 0 <= minutes <= 59 | 1 |
93fddf5ddcfeaca1e8efe9ad3c476655 | f77abdced19a8cafeb127d7d9cff8f46 | TEST 8: Que el usuario docente pueda cambiar su clave por una clave válida | ValidarCampos::validarCambiarClave($datosCambiarClave);
$usuarioDAO = new UsuarioDAO();
try {
$usuarioBean = new UsuarioBean();
$usuarioDAO->consultarDatosUsuario($idUsuario, $usuarioBean);
echo "clave: ".$usuarioBean->getClave();
echo "claveActual: ".$datosCambiarClave->getClaveActual();
if ($usua... | 1 |
bea97253fa8fe62ae7003809c8bd8419 | 1562244b80911985285682a4c9960b8e | 跳转到添加视图(jsp页面) | @Controller @Scope("prototype")
public class FindAction extends ActionSupport implements ModelDriven<FindUserInfo>{
public String toAdd(){
return "add";
} | 1 |
8b7859c3df7b663ecb3e485e786603bd | 3c9b3d3d350e1a9094e9b78897b97900 | Deletes all rows from the ali_cron table. | class Default_CronController extends Zend_Controller_Action
public function clearAction()
{
$this->getHelper( 'admin' )
->startCronTask( 'clear-cron-stat' );
Table::_( 'cronStat' )->deleteOld();
$this->getHelper( 'admin' )
->stopCronTask( 'clear-cron-stat' );
} | 0 |
c515990206e6e5421be8391aa74f990c | 88a81fe5988433d60c80d370ab8e83bf | 相交链表的简单解法,两个链表的指针一直向前走,到了终点就换条链表走,
直到相遇走了相同的长度,所以相遇之后一定是相交点 | if(headA == null || headB == null) return null;
ListNode pA = headA, pB = headB;
while(pA != pB){
pA = pA == null ? headB : pA.next;
pB = pB == null ? headA : pB.next;
}
return pA;
} | 1 |
51c87678d881c1f75b32fc0c770fd3ce | 4bda8a04ce597963747e66e2ae61af21 | Gets a distance based for a specific shot type at a specific step | if self.shot_value == 3:
if self.is_corner_3:
return pbpstats.CORNER_3_STRING
else:
return pbpstats.ARC_3_STRING
if self.distance is None:
return pbpstats.UNKNOWN_SHOT_DISTANCE_STRING
elif self.distance < pbpstats.AT_RIM_CUTOFF:... | 1 |
ed9909d54e652292abab9a8234dd3091 | c9e9f7d7894dbdce85793502aae6f0ec | 如果是从房号详情页跳转过来的,带着房号ID,
则需要在置业计划表中选中该房号的栋号,单元号等。 | putInMyhouse(e) {
let item = e.currentTarget.dataset.item
wx.setStorageSync('caseItem', item)
wx.navigateTo({
url: '../../plan/case-house-type/case-house-type'
})
} | 0 |
812a79c1c7bc5ae53499cb0a6199e0ab | be3203ead5f61daa64898dfdc4236d35 | ShippingOptionController constructor. | class GuestShippingInformationManagement
public function __construct(
\Magento\Checkout\Model\Session $checkoutSession,
\Cartsguru\Cartsguru\Helper\Data $helper
) {
$this->_checkoutSession = $checkoutSession;
$this->_cartsguruHelper = $helper;
} | 0 |
6717d7d4a305647d1356f0f1867c5395 | 900bf0abd5b52ab167fae438a0c08954 | Utility method to convert from list of tuple2 to double[] | double[] toConvert;
if (toConvertRaw instanceof double[]) {
toConvert = (double[]) toConvertRaw;
} else {
toConvert = new double[0];
}
double[] tmp = new double[2];
int length = toConvert.length;
Object[] result = new Object[length / 2];
for (int i = 0; i < (length / 2); i++) {
tmp[0] = toConv... | 0 |
34f62971e293c15efe682ff317ed570d | 1bb3b3af3592065b398980f76a080e77 | Create a file in Alluxio fuse mount point. | response = await self._invoke({
"jsonrpc": "2.0",
"method": "LambdaAPI.CreateFile",
"id": self.__next_id(),
"params": [token, uid, path, dir, ]
})
assert response.status // 100 == 2, str(response.status) + " " + str(response.reason)
payload... | 1 |
9327d27ec0aee184664ac889a073d72c | 27a58b2e00bed565f9fe2cac084b9886 | 判断手机是否有录像设备 | @SuppressLint({ "InflateParams", "ClickableViewAccessibility" })
public class PopWindowCatFriend extends PopupWindow implements OnClickListener
public static boolean checkCameraDevice(Context context) {
if (context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_CAMERA)) {
return true;
} else {
re... | 0 |
73921f2b6a7e7d79b0cb1b334a1505a2 | b9d5e99a7368dc00b42b8fdacd19bc71 | Updates a guild in internal cache, if it doesn't exist, doesn't do anything. | {
await Task.Run(async () =>
{
try
{
await SqlHelper.UpdateGuildAsync(arg);
await SqlHelper.UpdateGuildMemberAsync(arg.Users);
await SqlHelper.UpdateGuildChannelAsync(arg.Channels);
... | 0 |
e7bb76db2acc7192e18a9f65fc3f4651 | e5c6d8bb0dc2eeb761efa1ee5ce35584 | Update cached base address for the remote process | void ProcessorModel::updateGmmBaseAddr (UINT32 offset, UINT32 writeData)
{
if (offset == 0x18) {
char msg[MAX_PATH];
sprintf_s (msg, MAX_PATH, "[DEBUG] updateGmmBaseAddr. old: 0x%08X -> new: 0x%08X\n", gmmBase, writeData & 0xFFFFFFF0);
printToLogFile (m_pciLog, msg);
gmmBase = writeData & 0xFFFFFFF0;
}
} | 1 |
9b97c4ab3dac7e2c49e6837a3a0eeffb | 74a065ea32e852760ca9ce583bacd1df | метод управления разрешением экрана | if (_fullScreen != status.FullScreen) {
if (status.FullScreen) {
ChangeToFullScreen();
} else {
ChangeToWindowed();
}
}
} | 0 |
fbc1d24562b201712a845dffd13b7521 | be2b51d568eca23885d0d038893e867e | 响应开始新的录制按钮 | void AudioWidget::on_button_audio_sampleStart_2_clicked()
{
if(ui->combo_audio_2->currentText().isEmpty())
return;
int label = -1;
for (auto i = registeredLabs.begin(); i != registeredLabs.end(); ++i)
if (i.value() == ui->combo_audio_2->currentText())
{
label = i.key();
break;
}
ui->button... | 1 |
7502a8151a1d04da5819b5dd1f514566 | 6b81e77221c60426bfce097e548605d3 | NewLZ4Compressor instantiates a new LZ4Compressor | LZWCompressor::LZWCompressor()
{
rawData = NULL;
compressedData = NULL;
listeners = new List<LZWCompressionListener*>();
setStartNoOfBits(INIT_BITS-1);
setDefaultPolicies();
} | 0 |
e6d8d3fc8962d86daf50657ed6ee14f7 | 57be3a6b9c12ded7869775cf6153a1d0 | 自定义页错误处理函数.
当出现页错误,主要是对标志为可写的或者COW的物理页分配新页,复制旧页的数据到新页并映射到旧页的地址空间 | void do_no_page(unsigned long error_code, unsigned long addr)
{
unsigned long page;
addr &= 0xfffff000;
if(!(page = get_free_page()))
oom();
if(put_page(page, addr))
return ;
free_page(page);
oom();
} | 0 |
bd4534bff0f10d552f718375368c0cde | 3190c994cf827570ee65d8dfd18c1c9f | Get the top up history from the logged in user | {
if (auth()->user()->username=="smsadmin") {
$topups = Topup::all();
return view('posts.topup',['topups'=>$topups]);
}else {
$topups = Topup::where('username',auth()->user()->username)->get();
return view('posts.topup',['topups'=>$topups]);
... | 1 |
4bf0d3f67d0bf6d9094d5c2ff8fae495 | 67bb86d913d140720392ef18e57209a7 | Prevent the next player from taking their turn. | self.player_turn = -self.player_turn
self.legal_moves = self.board.legalMoves(self.player_turn)
if len(self.legal_moves) == NONE:
self.player_turn = -self.player_turn
self.legal_moves = self.board.legalMoves(self.player_turn) | 0 |
041fa9541ea408ee8b92a65bdad4a5ce | 49919eac5473e4259eff11c4d250eedf | 将时间戳转换为当地时间 | def timestamp_to_local(timestamp_int, local_format='%Y-%m-%d %H:%M:%S.%f'):
local_time = time.localtime(timestamp_int)
return time.strftime(local_format, local_time) | 1 |
fb21de19159f1da5423e244f26d47494 | db21d53b662ae57a428f4a8128e7c19c | Compute the pseudo-inverse for stability via symmetric eigen-decomposition
E = V D V^T therefore E^+ = V D^+ V^T | void PrMatrix::eig( PrMatrix& D, PrMatrix& V ) const
{
SAIAssert( m_row == m_col );
D.resize( m_row, m_row );
V.resize( m_row, m_row );
NEWMAT::SymmetricMatrix nm;
NEWMAT::DiagonalMatrix nm_D;
NEWMAT::Matrix nm_V;
copyToNewmat( nm );
EigenValues( nm, nm_D, nm_V );
D.copyFromNewmat( nm_D );
V.copyFro... | 0 |
c66066b7680de542e26fefc1cdb5c65f | dcde233b2cccef82e80afc53387c1b23 | Validates for non-conflicting roles | {
foreach ($roles as $code)
{
if (!isset($this->roles[$code]))
{
return false;
}
}
return true;
} | 0 |
3a927c605caa5502fd5083f0f06dbade | bf65127a8c224738f0355da5bb8d46ad | Add a unit sphere to a 3D plot | s = x.shape
x = x.flatten()
y = y.flatten()
z = z.flatten()
p = np.zeros((3, x.shape[0]))
p[0, :] = x
p[1, :] = y
p[2, :] = z
p = rotate_translate_points(p, rotation, t, method)
x = p[0, :].reshape(s)
y = p[1, :].reshape(s)
... | 0 |
a189ef518e0b70b94e212658d3134e41 | 857034ff9c5f94929e851cacfae6cb67 | 将整数列表转换成分隔符分隔的ID列表字符串返回 | {
if (ids == null || ids.Count <= 0) return "0";
StringBuilder s = new StringBuilder();
s.AppendFormat("{0}", ids[0].ToString());
for (int i = 1; i < ids.Count; i++)
{
s.AppendFormat(",{0}", ids[i].ToString());
}
... | 1 |
8e25baafb88acf8f85f8409c567cc157 | 995a308fb4a7876a511685f82752b893 | 获取在拨号界面优先显示的 信息 1=Label 2=DisplayName 3=UserName 默认为3 | DIAL_UI_TYPE CDialProcessor::GetDialUIType()
{
return m_objDialUIData.m_eDialUIType;
} | 0 |
6dc9aae8d2a178f35fbcb41dac78ca5f | e8984261f6f12738969de18869869eac | Saves a trade condition log | {
$objLibLog = kernel::single('systrade_data_trade_log');
if(!$objLibLog->addLog($sdfTradeLog))
{
return false;
}
return true;
} | 1 |
e995ff9738efe163552eda5e72af8e69 | d7469a9592bac65390853f5d13c6853b | 接收消息, 把消息放至消息总线
Receive the message and place the message on the message bus. | class Handler(rpc.Handler):
def receive_message(self, **kwargs):
message_queue.put(kwargs) | 1 |
46d3bc00c63bec1a8b5574f787d3eb22 | 2995098999be6d63336b18ca533e1d8d | Xử lý hủy phiếu bán hàng | class ReceiptController extends Controller
public function destroy($id)
{
$result = Receipt::where('id', $id)->first();
$product = Product::find($result->product_id);
if ($product) {
$oldQuantity = $product->quantity;
if ($result->type == 'in') {
$newQ... | 1 |
b552f518e3370fb1e64ce3e7752edab8 | ce77d48184a652c7c2b4168be090b8d4 | The identification of whether the Control Agreement is a Credit Support Document with respect to each party | this.UCA = UCA;
this.VC = VC;
this.init = initServices;
this.isValidGlobalIdentifier = isValidGlobalIdentifier;
this.isClaimRelated = isClaimRelated;
return this;
} | 0 |
4b80a8cecce8a0105d73e36e4abb7bbd | 29d24539ea048cc6129a6bdc818bde9a | Email template arguments setter | class MailTemplate extends Template
public function getSettingsArguments()
{
return [
'type',
'subject'
];
} | 0 |
b5806c72052aca814acaec6aefbc3b17 | a873859ba24bb2ef062d0af51f249b61 | Определяет, нужно ли сохранять статьи | class MKB_Options
public static function need_to_flush_rules() {
$flushed_cpt = get_option('_mkb_flushed_rewrite_cpt');
$flushed_topic = get_option('_mkb_flushed_rewrite_topic');
$flushed_tag = get_option('_mkb_flushed_rewrite_tag');
$cpt_slug = self::option('cpt_slug_switch') ? self::option('article_slug') : s... | 0 |
8ddafed244990d7007e1d5cdf0b12790 | 94f5924162db18cf522ab27da9001fae | ====================================================================
This function switches width control to manual
======================================================================= | namespace De.Kjg.Diversity.Impl.UXs.Guis.Layout
public class BaseLayout : ILayout
public void UseAutomaticalWidth()
{
HasManualWidth = false;
HasPercentualWidth = false;
} | 0 |
6610cd43d18b64904c3b1dad6cc45f88 | 90fd6f3160d8f4e68e9f8211bd84dbbd | This method prints the link state changes of ports on the switch | void reportPort(int socket, struct ofp_header * ofp_hdr, uint8_t * payload)
{
uint8_t reason = payload[0];
uint16_t portNum;
memcpy(&portNum, payload + 1 + 7, 2);
printf("Link state change: ");
if (reason == 0x00)
printf("added port number %d\n", ntohs(portNum));
else if (reason == 0x01)... | 1 |
9f86189e9c74c7fc1f7ac46276ae50c8 | eaf06081dc1e2f7b3f267bbe970c0254 | Get the command for converting a text to EPUB. | function getCommand() {
return "original";
} | 0 |
8d0df6f8b6e9b011d68a33fe6b6d3702 | 29a659ef264eab630cf0972e370e4b40 | safari隐私模式,无法写缓存,会进入catch | function setWarn() {
let isOk = true
if (typeof sessionStorage === 'undefined' || typeof window.localStorage === 'undefined') {
isOk = false
} else {
try {
sessionStorage.setItem('isCanSave', '1')
localStorage.setItem('isCanSave', '1')
if(sessionStorage.getItem('isCanSave') !== '1' || lo... | 1 |
7514eeac87a03e69d3960b28630a8964 | a82f8a140a2085c174b483d4c9c90f8a | Delete occurrence as well as associated meta data. | class Cloud(object):
def delete(self, metadata):
self.metadata_provider.delete(metadata["key"])
self.database.delete(metadata["key"])
if not self.database.find_one(
provider=self.metadata_provider.__name__,
checksum=metadata["checksum"]):
self.provider... | 1 |
9659eb4fc660df810f24f6689933525b | d5bb38971057dbc0cff99a9ec84e0883 | Construct a translation that displaces any point by the amount specified by the vector "v"
<param name="v">The displacement vector</param>
<returns>The translation transform. </returns> | namespace Base
public static Matrix4 CreateTranslation(Vector3 vector)
{
CreateTranslation(vector.X, vector.Y, vector.Z, out Matrix4 result);
return result;
} | 1 |
a442e9c54cab6c2c32c3644a606dae9b | 8db5cd5075006b16b8701eba9705b599 | TestCase基类方法,每次执行case后自动执行 | class TestCases(unittest.TestCase):
def tearDown(self):
MyLog().debug('用例测试执行完毕') | 1 |
1d5f5ca5706b23134dfb05945316cefa | d90be05f9eebaba7dafed83641aa7515 | Checks if the guild has a leader. | namespace TaskGL
bool IsLeader(); | 1 |
cc1a13d8ba8be526637c3fe7a2705e92 | b5a30a2018cb77ba416f8866afe3ec6d | Hook to generate output before the variable dump | class BaseFormatter
def start_dump
end | 1 |
551a49891090316d4f9aa38aaa51b318 | e53f6df7f72d093389a7d897b7221e70 | PERFORMING THE DEPTH FIRST TRAVERSAL OVER THE PARSE TREE | public class Assembler
private void traverse(SyntaxTreeNode node) {
while(node != null) {
handlerSentenceblock(node);
node = node.getRight();
}
} | 0 |
16e20a891c880487610116d0bb2ea5bf | ea0d10ad0540db98f139194b33608dbe | 设置保険会社(是否显示) | @DepositaryWebBean
@LoggerCreateBean
public class UserBean extends GenericBaseBean implements Serializable{
public void setSelectSubsidiary(boolean selectSubsidiary) {
this.selectSubsidiary = selectSubsidiary;
} | 0 |
508dae4ba50b347029bc0d2d79aab097 | ae52631fe089e504b6ca38128929199a | !
Returns the number of items in this struct. | {
if(pItemStore && pItemStore->m_pVector)
{
return IVector_Size(pItemStore->m_pVector);
}
return 0;
} | 1 |
4ee6a0b43ae6a4687a445ff75c0903e8 | 44120938999e86e5d7c5bb28e6e2ea14 | Returns the number of the maximum active blocks per
streaming multiprocessor. | mpi = multiprocessing_mode == 'mpi'
return multiproc_mpi.cpu_count() - 1 if mpi else\
multiproc_proc.cpu_count() | 0 |
f52c96134b9e5474a26fe41e064f916a | f405f7dea373eca697dda632745c907f | Essa funcao recebe uma lista de palavras e devolve o numero de palavras que
aparecem uma unica vez | def n_palavras_unicas(lista_palavras):
freq = dict()
unicas = 0
for palavra in lista_palavras:
p = palavra.lower()
if p in freq:
if freq[p] == 1:
unicas -= 1
freq[p] += 1
else:
freq[p] = 1
unicas += 1
return unicas | 1 |
03a814b29d8b4c8ba27c8c717799e275 | 552419250d7933a971c0ad33ae31afb8 | 将DTO转为物料-公式关联 | {
ehsure.Material.Data.DTOCode data = Factory.Create<ehsure.Material.Data.DTOCode>();
data.Code = codeData.Code;
data.EptCode = codeData.EptCode;
data.ParentCode = codeData.ParentCode;
data.BatchPrintId = codeData.BatchPrintId;
data.Product... | 0 |
fbd2ddf3ee8c04d756a7e37af109d42f | e8c71ded616d1e755a9739fd05a967b8 | Get one specific dog from server. | def get_dog_by_name(dog_name: str):
return dogs.find_one({'dog_name': dog_name}) | 1 |
00f01e87a81e102f4aa04b5a0af1fc96 | 6c31635b58f29298ee24b35b9e1a0a3f | Get file name and remove extension | def getFN(FNP):
Dir, FN = os.path.split(FNP)
return FN | 0 |
8cb8bbedff4ede317992e9bdf2cea2ac | 2c7acf33ed2288ff96123e57a93841fd | 根据Uuid-逻辑删除对象( AliveFlag修改为0) | public void deleteByUuid(String detailUuid); | 0 |
4cd59c4402181691598984d6f7f28dc9 | ae1b8ad9b265ce3b3e3447d5a45979cc | 商品是否可以上架 | {
Dictionary<string, object> dic = LoadParam<Dictionary<string, object>>();
var ID = new Guid(dic["ID"].ToString());
int type = dic["type"].ToInt32();
var res = domin.bShelves(ID, type, SessionUser.User);
if (res > 0)
{
resu... | 1 |
f6b958627e9751f36f55fde432d2bec5 | 4dd5c9e83bd7b69895feeb36c4af883c | 返回方法上的注解 | public void test1() throws Exception {
Class<ReAnnotationTest01> clazz = ReAnnotationTest01.class;
Method method = clazz.getMethod("reAnnotation", String.class);
MyAnnotation[] annotations = method.getAnnotationsByType(MyAnnotation.class);
for(MyAnnotation annotation : annotations) {... | 1 |
75805a7b7e23ceeb2e19c247f653d38d | 298bd444c778505e872aae4826406d22 | Creates a {@code String} representation of the {@code long[]} passed. The
result is surrounded by brackets ({@code "[]"}), each element
is converted to a {@code String} via the {@link String#valueOf(long)} and
separated by {@code ", "}. If the array is {@code null}, then
{@code "null"} is returned.
the {@code long} arr... | {
final StringBuilder sb = new StringBuilder();
sb.append('[');
final int nullValue = this.nullValue;
final int[] elements = this.elements;
for (@DoNotSub int i = 0, size = this.size; i < size; i++)
{
final int value = elements[i];
sb.append(va... | 0 |
5263084880ee04a5e40a0395860926c1 | c695b05600b0e71d3ff3e7ce6578d78e | Set the capacity of the hall | public class Village : MonoBehaviour
public void SetCapacity()
{
WoodRackCapacity = (int)Mathf.Pow(WoodRackInvestment / 2, 1.5f);
} | 0 |
0ac5e8026e79e207700364d3fbe5ad03 | 5392ecc51706607431882fb9b7ac4c01 | Takes in a matrix containing voxels in suit space and the value of the parcel (output from read_suit_nii)
and calculate the average for each roi | roiCenter = [0, 0, 0]
roiNode.GetXYZ( roiCenter )
roiRadius = [0, 0, 0]
roiNode.GetRadiusXYZ( roiRadius )
roiOrigin_Roi = [roiCenter[0] - roiRadius[0], roiCenter[1] - roiRadius[1], roiCenter[2] - roiRadius[2], 1 ]
roiToRas = vtk.vtkMatrix4x4()
if roiNode.GetTransformNodeID() != None:
r... | 0 |
5b28791a58ec6019a96cc260205d2b3a | afc0fd41c537372f1a09533b82e752be | Validate a charge. | {
if (!$this->isDisplayContainer()) {
return false;
}
if (!$this->getAmountToCharge()) {
return false;
}
return true;
} | 1 |
09e39cfdd379821851860a87f6d5f7f0 | e0eceb89c0349e2120adf4b273f6ceaa | Loads ra/dec corrdinates from a file. | class general_data():
def rabi_load(self, filename, colX, colY):
temp_load = np.loadtxt(filename)
self.rabi_x = temp_load[:, colX]
self.rabi_y = temp_load[:, colY] * 10**6 | 0 |
05df4eeffddd8d90cd815d3d6bc37248 | ce18ec9965bc687c00a66d68b10a1575 | Read LN Control Point's Client Characteristic Configuration success callback | {
if(NULL != CyBle_CscsApplCallback)
{
if(cyBle_cscsc.characteristics[CYBLE_CSCS_SC_CONTROL_POINT].charInfo.valueHandle ==
eventParam->handleValPair.attrHandle)
{
CYBLE_CSCS_CHAR_VALUE_T ntfParam;
ntfParam.charIndex = CYBLE_CSCS_SC_CONTROL_POINT;
... | 0 |
291fd954ce410df26b823ec138b2b790 | fec77c53bcbb0087a5fb309b99872f96 | Should update the screen saying you're changing direction. | class RadioOperatorClient(PlayerClient):
def draw_stop_screen(self):
self.screen.fill(Color.BLACK)
self.display_message("stop " + self.state.last_enemy_move_direction) | 0 |
c20bb113612a305fcd55fca009f3ef51 | 3c3f6a28a60672f23bea71090ef1ea0a | Check if there are features over quota
if the current subscription would be swapped
to a new one. | if self._pk is None:
raise AttributeError('Id is not present')
slot: AbstractResource = await self.get()
if slot.overbook:
return True
return False | 0 |
3c4454911ce64a7db10101e81715671e | df71f13362344fd541d1b4e3107cc6a2 | Organize spike and LFP data by tetrode. | return xr.concat([preproc.create_spike_train(st, self.time_points.end, bin_length)
for st in self.spike_times],
dim = 'neuron') | 0 |
841eb69ee618d4d31054dd6faf952ea0 | f328da0591a755f967cd0c37a48a5a31 | Get a cached set of abbreviations. | public class LanguageManager
public HashMap<String, String> getAbbreviations() {
return lang.getAbbreviations().getAbbreviations();
} | 1 |
cab43e006b01f170f0b1d4dbdb9abe5e | b43f0d480c4105464c48726166aed837 | 将选中的车辆注销 | String[] carID = new String[getSelectedNum(listContent)];
for (int i = 0, j = 0; i < listContent.length; i++) {
if (listContent[i].isSelected()) {
carID[j] = listContent[i].getContent().getCarID();
j++;
}
}
notifier = new PioneerNotifier();
if (!carBl.delCar(carID)) {
notifier.setType(Notifie... | 1 |
f143795af0121b7995c3326000e4730e | d9c4507bc5eb41cbc37715b557a5ea26 | Initiates a {@link #shutdown()} and handover to another tradefed process on this same host.
<p/>
The scheduler will inform the remote tradefed process listening on that port of freed devices
as they become available.
otherwise | @NonNull BACnetDevice asyncStart(); | 0 |
177287db534e5f6553f849eb062ad45d | b4ab1bb8b8de316eb46aa35f93ac83ff | Get the current number of file that is being transferred | public class WebhookMessageBuilder
public int getFileAmount() {
return fileIndex;
} | 1 |
9c1d75d23caa933e61c31fe641e7ca57 | 164b496071858eb2201b6379c74ecf63 | Internationalization for parameter and payload validation messages. | public MessageSource validationMessageSource() {
ReloadableResourceBundleMessageSource messageSource = new ReloadableResourceBundleMessageSource();
messageSource.addBasenames("classpath:/messages/validation");
messageSource.setDefaultEncoding("UTF-8");
messageSource.setUseCodeAsDefaultMes... | 1 |
14145325593596882f4ba8fa4cb3f497 | d61c3b1a1555ef847e092a617cbb5c65 | HTML5 Blank navigation | function html5blank_nav()
{
wp_nav_menu(
array(
'theme_location' => 'header-menu',
'menu' => '',
'container' => 'div',
'container_class' => 'menu-{menu slug}-container',
'container_id' => '',
'menu_class' => 'menu',
'menu_id... | 1 |
dac00bb57537441a8d9fcbfc91067d88 | d2ff4ee32aa1eb1279396b1c93e2164b | 获取MYSQL最大值 | {
$one = $this->field(["max($field)" => 'max'])->find();
return !empty($one) ? $one['max'] : 0;
} | 1 |
c87e4870d7c63b6f84fff8326950eba1 | 46e8e97b934d1bd975a5c820c0da63b9 | 获取流程表单(首先获取任务节点表单KEY,如果没有则取流程开始节点表单KEY) | public String getFormKey(String procDefId, String taskDefKey) {
String formKey = "";
if (Strings.isNotBlank(procDefId)) {
try {
if (Strings.isNotBlank(taskDefKey)) {
formKey = formService.getTaskFormKey(procDefId, taskDefKey);
}
... | 1 |
bf57aaba08477e6dba6a5c873d352352 | 2c3bc383e1a2d36ddaa086e7b686ee2e | The running time in nanoseconds.
<p>
API name: {@code running_time_ns} | public long getTimeStartedNanos(); | 0 |
97f3bb95e695d606eb0a88fed75abf28 | 0d1db365dece3714fafc8072086ec22f | 构建查询:通过join中间表来查询从表 | def querying_with_joins():
session = Session()
print_header()
for u, a in session.query(User, Address).filter(User.id == Address.user_id).filter(
Address.email_address == 'jack@google.com').all():
print(u)
print(a)
print_header()
users = session.query(User).join(Address).... | 1 |
8dddeb9458f549f079b86d8bcf940625 | 36b89096a4d144bfbd2d29119a996144 | Set different background image for landscape and portrait layouts | public class NewsTitleFragment extends Fragment implements AdapterView.OnItemClickListener
@Override
public void onActivityCreated(Bundle savedInstanceState) {
super.onActivityCreated(savedInstanceState);
if (view.findViewById(R.id.content_fragment_layout) != null) {
isLand = true;
... | 0 |
9f213415dda097305a71a9aaa7229b99 | f7cbf9c4d770d634f3caf34cf5706902 | Executes all commands sent to the manager and exits | class Commander(val MAX_CONNECTIONS: Int, val WELCOME_MESSAGE: String, val STRING_BUFFER_SIZE: Int, var log: Logger){
fun mainLoop(){
checkDisconnectedList()
checkNewConnectionList()
sendMudOutput()
getInput()
ExecuteCommand()
} | 0 |
2f6b304e57a0f3840ed78bbf04e2e63a | a48e7f267709bc82c497d5409ac73b3b | Get angle given 3 side lengths, in degrees | def compute_angle(a, b, c):
return round(degrees(acos((a ** 2 + b ** 2 - c ** 2) / (2 * a * b)))) | 1 |
0dfd8911b6cad998d5e06638a5916882 | ae87e2040072a203746f7415107974b3 | Copies the selected content to the internal clipboard | {
WindowUtility.Instance.Refresh();
VWindow window = WindowUtility.Instance.GetTopWindow();
if (window != VWindow.InvalidWindow && WindowUtility.Instance.GetProcessName(window.Handle) == "explorer")
{
_is_windows_explorer_top_window = true;
... | 0 |
0bf492d789e0da861f36e8032df05c43 | 48d4f358787efbb641b33e8133441cc9 | Send a distance vector to neighbors | namespace ThreadSynchronization
class Node
private void SendRoutingMessages()
{
foreach(int iNeighbor in m_dNeighbors.Keys)
{
RoutingMessage routingMessage = new RoutingMessage(ID, iNeighbor, distanceTable);
m_dNeighbors[iNeighbor].Send(routingMessage)... | 1 |
076947d247c4379e7de4e27a6b00804a | 9bb41e12e3871f704b56f4d4f73a7f3a | Gets the tile type. | public class Tile extends Entity
public TileType getType() {
return type;
} | 1 |
64a0e81aec941796d3d1ce90761a790f | 5da261054478daa4b6cb6a65111f3018 | 设置三角形翻转 | public class BubblePopupWindow extends PopupWindow
public void setTriangleSize(int high, int bottom) {
bubbleView.setmPadding(high);
bubbleView.setmTriangleHalfBase(bottom / 2);
} | 0 |
b073dbb668183d51ee9f6ab9f30ba648 | 47b445ff51bf310c33f1d7f8ed3d519f | Permite obtener un submódulo por su id | {
$query = "SELECT DISTINCT *
FROM module_submodule sm, permission_submodule ps
WHERE sm.submod_id=ps.persub_submoduleid
AND ps.persub_moduleid=$module_id
AND ps.persub_userid={$_SESSION['user_id']}
AND ps.persub_submoduleid=sm.submod_id
AND sm.submod_status=1";
$ejecutar = $this->db->query($query)... | 0 |
525fc0dfcf932462afabece94401126c | 92a6a486760b6ee0d6d727efc6387a77 | Prints average residential market value for provided zip code | escad = address.replace(' ','+')
url = 'http://www.zillow.com/webservice/GetDeepSearchResults.htm?zws-id=%s&address=%s&citystatezip=%s' %(zwskey,escad,city)
doc = xml.dom.minidom.parseString(urllib.request.urlopen(url).read())
code = doc.getElementsByTagName('code')[0].firstChild.data
if code != '0'... | 0 |
3ac09054fb4b6ac78f8a4026566e336f | a7058c62d6f596504a69c86a97d5aab1 | Cleanup this native info by unlocking the global handle | {
if (NULL != nativeObjPtr)
{
msclr::lock lk(privateLock);
if (NULL != nativeObjPtr)
{
delete nativeObjPtr;
nativeObjPtr = NULL;
}
}
} | 0 |
e75c8f964dd9a703c5f4a80e46d4f3bc | ae4f837c5d105bc37b85f0e3d63b73dc | Disables lazy loading mechanism and init object fully | class Object implements IObject, ILocalizable, ILocalesAware, IObjectManagerAware, IObjectPersisterAware
public function fullyLoad($withLocalization = false)
{
$this->collection->fullyLoadObject($this, $withLocalization);
} | 1 |
ae9bbae99e7dc5608a180009e8957fc4 | 6e776e9b0d5f346b64c1e7843bbaf0b3 | Function that move all zeroes to the end of the list. | class Solution:
def moveZeroes(self, nums: List[int]) -> None: | 1 |
011ce4068c7134f4cd3d063a80d532d1 | 473e4023276d610e87bf1d141fc40b20 | Получение меню по системному имени | public function getMenuByName($menuName); | 1 |
31b7eca89568906b558c63697f54d6ce | 3dc0b5a79612040d9fd78b1424cf4ea2 | Trigger pause or resume play. | class MainWindow(QtGui.QMainWindow):
def pauseTriggered(self, state):
if state:
self.streamAction.setChecked(False)
self.streamAction.setEnabled(True)
self.pauseAction.setEnabled(False)
self.setStatus(streaming=not state) | 1 |
8a8acdad3cf52e9b19b2b658e29a3cef | 577b2907dd6f13d563afc5aafc32a8ac | For each subsequent call to the mock, it will return the next result. | namespace Moq.Language
IReturnsResult<TMock> Returns<T1, T2, T3>(Func<T1, T2, T3, TResult> valueFunction); | 0 |
bba9b0dde0e5d2193b0a5bcb1f0f919e | b29773c7e708bd78b98a97870c963cf5 | Determines the wheel package filenames and versions. | self.request.locator = MagicMock()
version = "1.1"
name = "foo"
filename = "%s-%s.tar.gz" % (name, version)
url = "https://pypi.org/pypi/%s/%s" % (name, filename)
wheelname = "%s-%s.whl" % (name, version)
wheel_url = "https://pypi.org/pypi/%s/%s" % (name, wheelnam... | 1 |
5b36652adbca231d42582e8d6ef7a579 | c924241728a83e3d4878682faa213abf | 找start到finish换乘最少路线 | {
List<Path> result = new List<Path>();
Station startStation = _metro.Stations.Find((Station s) => { return s.Id == startId; });
Station endStation = _metro.Stations.Find((Station s) => { return s.Id == endId; });
List<int> startPassLines = startStation.PassLineId... | 1 |
7f0e68dcd038f8b8457a25e2e636fc3b | 69eb8eda700d58a3dcb25a71d6bda3ee | 当前K线序号(0开始) | int currentIndex(); | 1 |
674ecdbdc781ed91dc46a779f78f7081 | b3bfcec0e58a63b5faa248e7ee5de850 | Método que ejecuta llamado a los componentes de negocio, mediante
endpoint suministrado por el service registry | public class JpaGreetingServiceComponent implements GreetingService
@Override
public void processGreetings() throws Exception {
getService().processGreetings();
} | 0 |
23b8df06fbc2456b88f0f66470fb2b97 | 2c4c97f7cdcc2c72d48631a5496b5d16 | Generates the total rule infographic | return {
categories: [
'Follow Directions',
'Complete Work',
'Kind Words',
'Be Safe'],
points: _.map(totalsData, function(item) {
var toPercent = function(x){ return parseInt( x * 100 / item.bs.eligible);};
return [
moment(ite... | 1 |
819ad1f6d6174c87cfe9329747802cfe | 1c8d4d871c8c277b82aa409f2c04a818 | Если тип текущего токена совпадает с переданным типом, то считывает очередной токен
Иначе бросает исключение | {
Token<TType> token = TakeToken();
if (token.ID != wanted)
throw new ParseException(token, String.Format("Token doesn't match type constraint \"{0}\"", wanted));
return token;
} | 1 |
45fc5f78e2dda8667d413b99c5f7f24c | c97547a36be7385999cb58f8e121bf5f | Responds to chunk_size changes. | class Toplevel1:
def set_chunk_size_val(self, event=None):
if (int(self.Number_Of_Words_Spinbox.get()) < 2 * int(self.Chunk_Size_Spinbox.get())):
self.Chunk_Size_Spinbox.invoke("buttondown")
if (int(self.Delay_Spinbox.get()) == int(self.Chunk_Size_Spinbox.get())):
self.Chunk_Size... | 1 |
ff294b48896013243c57cbb711f94610 | 9a152baba8a11a4de0944e3a38f8d414 | save model and their optimizer | model_params_path = os.path.join(args.save_model, 'epoch_%d' % epoch_id)
if not os.path.exists(model_params_path):
os.makedirs(model_params_path)
torch.save(model.state_dict(), os.path.join(model_params_path, 'model_params.pth'))
torch.save(metric_fc.state_dict(), os.path.join(model_params_path,... | 1 |
79a2b773844ccbc20aa9accc233ffbfb | 6eca309cf66b89304c38dbf10eaf5a3c | Load values from an ``*.ini`` style config file.
If the config file contains sections, their names are used as
namespaces for the values within. The two special sections
``DEFAULT`` and ``bottle`` refer to the root namespace (no prefix). | class Configurable(object):
def _load_ini(filename):
ini_config = ConfigParser.SafeConfigParser(allow_no_value=True)
if Configurable._is_url(filename):
configfd = Configurable._get_file_descriptor(filename)
ini_config.readfp(configfd)
else:
ini_config.read(fil... | 1 |
c19192bde6867449d1982997229313eb | 2199d47d4a427071a9f0a8459eb6b0ba | Returns the boolean indicating whether this
<code>TextComponent</code> is editable or not. | public class CTreeCombo extends Composite
public boolean getEditable() {
checkWidget();
return text.getEditable();
} | 1 |
f99d699c4fb2e6c27c8a2dea87210ca3 | 1648204cdb94fa79c54f153cd9a5301a | Generate Base url with user credentials | return [
baseUrl
, [
"?"
, "auth"
, "="
, accessToken
].join("")
].join("/");
} | 1 |
769d76523b10a7d9a02bf8bb130aed4c | 9d1b37ae2a557823a924b8ef77fd0c18 | Color animation of money. | function colorize() {
var currentCash = document.getElementById("cashNum").innerHTML;
if (parseInt(currentCash) >= 100 || goldenColorize == true) {
if (goldenColorize == false) {
cash -= 100;
document.getElementById("cashNum").innerHTML = cash;
var ele = document.getE... | 1 |
6ab9a8a63728fb28f5c2a084e497da84 | 101e425a4f2846ef491f87b7f9432d8e | Logea el inicio del proceso NPRACH.
Logs beginning of NPRACH process. | class Log:
def log_periodoNPRACH_fin(self,node,throughput):
if self.log_states:
self.log_file.write("%f,%d,%s,%d,%s,%d,%s,%d,%s\n" %
(self.sim.get_time(), node.get_id(),node.get_tipo(),
node.get_id(),node.get_tipo(), Log.LOG_NPRACH_FIN... | 0 |
8f42ae63a3364a70c99a142b3732cb39 | ec4aa4438f462d37a426b1f9637d8c8e | Generate input command line tokens for the csp (csp_galexev) utility. | output_path):
images_path = self.project.images_path
command_lines = textwrap.wrap('''
%(cp2_call)s -b -c -i %(images_path)s -o %(output_path)s \
--do-not-build --do-not-fetch --pipeline=%(cp_pipeline_file)s \
--data-file=%(csv_filepath)s -L ... | 1 |
fe5e35b07099bb2360765d5984bf953d | e96cf4fc517f690a143bfaa00138a865 | This method increment the progression bar by adding 1 percent. | {
gameObject.GetComponent<UIScrollBar>().value = gameObject.GetComponent<UIScrollBar>().value +
(gameObject.GetComponent<UIScrollBar>().barSize / (1.0f - gameObject.GetComponent<UIScrollBar>().barSize));
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.