query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f153aa3b4dde6916034620dcccc67a88 | ef6182ce3f0fd1996de6f69ea7cb2c3b | Retorna zero se o elemento for independente de qualquer outro, ou 1, 2,
3, etc conforme distância para o elemento independente mais longinquo. | {
float homogeneidade = 0;
for (int i = 0; i < McoLen; i++)
{
for (int j = 0; j < McoLen; j++)
{
if (mco[i][j] > 0) homogeneidade += mco[i][j] / (1 + (i - j) * (i - j));
}
}
return hom... | 0 |
1f140ea94bbb0896675ae2c970d0650f | 71741c9755ff1ab4ceae8b22ccc115fd | This method is called when airbus_cobot_gui closes.
You can free memory and disconnects topics | worldNode::~worldNode() {
cObjPub.shutdown();
aObjPub.shutdown();
delete fingerClient;
} | 1 |
38692b35b059065efe2661c032034bbb | 8e97ae892af80ad93c94a09e8e414214 | 初始化ViewFlipper的数据 | mDatas = datas
if (DisplayUtils.notEmpty(mDatas)) {
mViewFlipper!!.removeAllViews()
for (i in mDatas!!.indices) {
val textView = TextView(context)
setTextView(textView, i)
mViewFlipper!!.addView(textView, i)
}
}... | 1 |
99439fc8c9b125fa593f6b550f4f1ed5 | 53a21071fa5a33f110743b7498833519 | Extract specified length of bits. | class SimpleFlake
private function extract_bits($data, $shift, $length)
{
$bitmask = ((1 << $length) - 1) << $shift;
return (($data & $bitmask) >> $shift);
} | 1 |
2ad14f48edf1e69a7447a30a272e2a8b | 7489d805a7a8d435eea2a025811cd94e | Get entity ID by code | public function get_ids_by_code( $code ); | 1 |
182b558a28f25f0796e512c2caecd656 | f298ec9466911df30cc3d3ffe33e23fe | Update the Accessory Display Settings
Returns TRUE / FALSE if the update was (un)successful. | {
struct TERM_DATA term_data;
DispLineMW(KPABX, MW_LINE5, MW_BIGFONT);
ReadSFile(iTermDataFd, (DWORD) psTermDataOffset, &term_data, sizeof(struct TERM_DATA));
if (UpdateFData(term_data.sb_pabx, 4)) {
UpdTermData(&term_data);
fCommitAllMW();
return(TRUE);
}
return(FALSE);
} | 1 |
afc893a704f0b048b47981c1ca149e7b | bf25998e22443e36acb3cefc0ebf3858 | 根据传入的用户id和文章标题,找到相应的文章,并返回 如果出现错误的话,返回null | Article queryArticleByInfo(String title,int userId); | 1 |
ec853361d1ee55d98cb8891ff05a1f64 | e65577f776a3ee729a6cfa2015dd5f3d | Realeses the memory allocated to the scheduler. | namespace class IslScheduleOptimizerWrapperPass final : public ScopPass
void releaseMemory() override {
LastSchedule = {};
IslCtx.reset();
} | 1 |
9ab73fb0d3dbbf40b51faf59a717a6c1 | 2685646b27be577d6086b705106dd1d0 | Handles the camera sway based on the input vector | namespace Spacehop.Gameplay.PlayerSystem.Core
[System.Serializable]
public class CameraSwayComponent
public void SwayCamera(Vector3 _inputVector, float _rawXInput)
{
float _xAmount = _inputVector.x;
m_xAmountThisFrame = _rawXInput;
if (_rawXInput != 0f)
{... | 1 |
7306cf446a76bd65b5375cce8047de6e | 70764357edd13df45ba9e531c619bdc6 | Get a specific ajax handler | check_ajax_referer( 'jwp-dh' );
if( ! current_user_can( 'manage_options' ) ) {
wp_die();
}
$handler_slug = $_POST['slug'];
$offset = intval( $_POST['offset'] );
$total = $_POST['total'];
$response = new JWP_DH_Response;
$handler = $this->get_handler( $handler_slug );
if ( ! $han... | 1 |
72bfcf04f76af581ae0e04b317b45608 | b646ebbbed53d8b69a14f546d3397362 | 지정한 년도, 분기의 완료 시각 | function getQuarterEndDate(paraYear,paraSeason){
switch (paraSeason){
case '1' : return paraYear+"-03-31";
case '2' : return paraYear+"-06-30";
case '3' : return paraYear+"-09-30";
case '4' : return paraYear+"-12-31";
}
} | 1 |
ff6365753a07315d2d0476c0d8e03573 | 08416ba1a5a98b6fde8348540fd1764f | \brief Skip given number of bytes in usart buffer. | void usart_send_buf(const uint8_t* buf, int len)
{
do {
usart_send(*buf++);
} while (--len);
} | 0 |
f017a41290db9fff48febc167af64d25 | b094c23377b5136625430c4a8b235cb5 | Creates a new C2M_CHECKMD5 request object | class CheckPasswordRequest(object):
def __init__(self, file_path, storage_name=None, version_id=None):
self.file_path = file_path
self.storage_name = storage_name
self.version_id = version_id | 0 |
d3b18cd66aef738cce73c8251037fbf4 | 5199c002889ab4b43ccc92e0aee2e34b | Returns whether the sequence can be extended by one cell. | class Sequence:
def can_extend(self, pos: Coord) -> bool:
return (
self.start < pos < self.end
or coord.distance(pos, self.start) <= 2
or coord.distance(pos, self.end) <= 2
) | 1 |
8543ea1fb5ca2bd9e88b5eefe67a75b4 | 2c6ed6761fe5df778766d49eb3042d27 | Get an Entry by target resource name. | {
ListCell* l = NULL;
foreach (l, tlist) {
TargetEntry* tle = (TargetEntry*)lfirst(l);
if (tle->resno == resno) {
return tle;
}
}
return NULL;
} | 0 |
a857eeca1b21e4d376da988864ae7cc2 | 60367553572b343ce43226f8c515d785 | Called if the stack check fails | void g_stackcheck (void)
{
AddCodeLine ("BL stkchk");
} | 0 |
711b15bb127368135d8c1fd7650e6ec9 | 1328ec334e4ca48a9a0dbe00ce7385dd | Установка переменной имени текущей страницы | setCurrentPageName(state, name) {
state.currentPageName = name;
} | 1 |
26e6d382b541d00ccbc8097e8fd21fe5 | 33fd6bd1cee87de93d934a7b7790d922 | Получить список счетов в кассе | $user = User::getUserCheckAccess();
$page = $this->getPage($page);
$where = "id_users > 0";
$kassaList = Kassa::getKassaListFilter($where, $page);
$count = count(Db::getSelect('kassa', $where));
$pagination = new Pagination($count, $page, $this->show_def, 'page-');
... | 0 |
f393092651bf6def4e4893d87ec53835 | 4250b09e6530106008678c047ed83b79 | Update whether notifications are used | if (!is_bool($include)) {
$include = true;
}
$this->settings[$Model->alias]['includeNotifications'] = $include;
} | 1 |
26ec13193e2b8e8a0890b049a8b7a7bb | 5fa0572fdb9ed7f8265094699e7c51f2 | Sets the final approve status based on child's
implementation. | {
log.info("approveIt - " + toString());
setIsApproved(true);
return true;
} | 0 |
ccf7555234a166ddecde63e4183a4a2f | 8b90efd74e1022e8ac8030bebe8425e4 | Determine whether two queens are in conflict with each other | class Queen:
def can_attack(self, another_queen: object) -> bool:
if self.position == another_queen.position:
raise ValueError("Invalid queen position: both queens in the same square")
if self.row == another_queen.row or self.column == another_queen.column:
return True
op... | 1 |
0552d7008d837ffa7146c6e0c27dc593 | 62024f4d562b6af3e9736f9b4e5cf1d9 | Loops through timelines assigned to the view. | {
MStatus status = MS::kSuccess;
animCurveListIter = animCurveFnList.begin();
while( (animCurveListIter != animCurveFnList.end()) && (status == MS::kSuccess) )
{
status = retimeAnimCurve( *animCurveListIter );
animCurveListIter++;
}
return status;
} | 0 |
b86314781a01bc637f4e277d1a0f3801 | 22f43af15d543a44dfe3af8187fb3a1b | 以逗号分隔的字符串中是否包含另一个字符串 | public class StringUtil
static public boolean isInclude(String allStr, String childStr) {
if (isEmpty(allStr) || isEmpty(childStr))
return false;
String[] arr = allStr.split(",");
for (int i = 0; i < arr.length; i++) {
if (childStr.equals(arr[i])) {
return true;
}
}
return false;
} | 1 |
baef45cc606d78e4772c20f24c56f37a | cd25de887d3df8d3245a4ae8f8ceab8f | use to add payment method | form = PaymentMethodForm()
with db.connection.cursor() as cursor:
db.reconnect()
if form.validate_on_submit():
cursor.execute('INSERT INTO payment_method (payment_name) VALUES (%s)', (form.name.data))
db.connection.commit()
return redirect(url_for('admin.paym... | 1 |
2c133d03c0a514a771e6239ba2482470 | 17ac2e4cc6bbd9c3efaa2ef43f5e4e73 | Adds an equality test to the specified category. | namespace Slarsh.NHibernate
public class NHDynamicQueryProperty : DynamicObject
public virtual void Eq(object value)
{
this.criterions.Add(Restrictions.Eq(this.propertyInfo.Name, value));
} | 1 |
e9907bee2037f3faa8508f62430115fd | adb039da04773d8747a2c37ae1ac0e7c | second method with out in-built method | def reverseArray1(arr):
arr.reverse()
return arr | 0 |
67dec0bc8b208bc9399e15386d6933a3 | 68ca181a6c4c938543af2448deb1b662 | Get response factory
If no response factory has been set, this method will
set and return a default response factory, if any such
value is available | class Server
public function setResponseFactory(ResponseFactoryInterface $responseFactory = null)
{
$this->responseFactory = $responseFactory;
} | 0 |
b888e08991c60344e8fd270393faf481 | ec428acb5a1c14a36389eed10e1f018b | Безопасная проверка на существование объекта | namespace JPlayer.Core.DataContract
public static class DataValidator
public static void ShouldExist(this Model obj)
{
if (obj == null) throw new DataNotFoundException("Data not found", new ArgumentNullException());
} | 1 |
c6b9280a11dc75f7d90452906fec2529 | 7ae59361ead5315e3029ca1a84690f40 | Obtains the player's name who achieves the best scores stored in the
configuration file. | {
if (score.Count == 0) return "";
String output = score.First().Key;
foreach (String k in score.Keys)
{
if (score[k] > score[output]) output = k;
}
return output;
} | 1 |
1e28290ad459c4f8ee7b367b7a4bbd21 | c89c2ecfbf0c30e1f77f178b21de60e6 | 在外選挙人国内住所情報エンティティを登録します。 | public void register(KokyakuTantoBushoDomain domain); | 0 |
bdda963b6dd0470f7a9472f79c51af4a | 0ad0ae56cc4cac3a4700d9187b14a1a6 | The sensor model for observing something. | super(ElfiModel, self).__init__(source_net)
self.name = name or "model_{}".format(random_name())
self.observed = observed or {} | 0 |
2660e3741ae976a3525355b206bd1f0a | 8bff84e0354c8e95d31fcbd534468e82 | 根据BufferedImage构造ImageKit | ZuiImage Image = (ZuiImage)malloc(sizeof(ZImage));
if (!Image) { return NULL; }
memset(Image, 0, sizeof(ZImage));
Image->image = new ZuiSkiaImage();
if (!Image->image) { free(Image); return NULL; }
Image->image->data = SkData::MakeWithCopy(buf, len);
Image->image-... | 0 |
955a5ae51334238325ef1f5e892e8343 | 2f7c228e12373aa077ae56946b44bbca | Obtém os dados de um fabricante através do seu código de identificação. | class FabricanteController extends Controller
public function show($id)
{
$fabricante = Fabricante::find($id);
if (!$fabricante) {
return response()->json(['errors' => array(['code' => 404, 'message' => 'No se encuentra un fabricante con ese código.'])], 404);
}
return re... | 1 |
ced07acfb669966eb468de98eef0b2cf | 22f7ccaba49827eda83ec924c87100b7 | 根据Id获取应用用户数据 | public async Task<ResponseMessage<SysUserAppRole>> GetByIdAsync(string id)
{
var sysUserAppRole = await _sysUserAppRoleService.GetByIdAsync(id);
return new ResponseMessage<SysUserAppRole> { data = sysUserAppRole };
} | 1 |
f17d833b8264b409483a69f231b48394 | d873c2437d2ca408e9c775c75e7a302c | 获取存储loading页信息 | getStorage() {
let star = wx.getStorageSync('star')
let right = wx.getStorageSync('right')
let error = wx.getStorageSync('error')
this.setData({
star: star || {},
right: right || {},
error: error || {},
})
} | 0 |
394af335753e0cae727f0e5b06172b14 | c9fcea623589a400552537d312d546bf | List the actions that correspond to a post of this module.
This is used by the participation report.
crud = ('c' || 'u' || 'd') and edulevel = LEVEL_PARTICIPATING
will be considered as post action. | qs = self.character.past_participated_actions.order_by("-date_submitted")
user = self.request.user
if not user or not user.is_authenticated:
return qs.filter(public=True)
if (
user.is_staff
or user.check_permstring("builders")
or user.char_... | 0 |
41427d77cdbeaa2ff3fac8850ab58587 | c99430b29e0ee05b8858179f5bb4a0d0 | Return `sqlalchemy.Query` with eagerly loaded `created_by`. | class SelectLoadedRelationship(BaseLoadedRelationship):
async def _load(self):
return await self.query.all() | 0 |
dd6c06b1074d3c2da463188432537510 | 9ea1222f5df7abb0a8d37f55f0f89f26 | 顯示各品牌每週發文數圖表 | $data = DB::select("SELECT DATE_FORMAT(created_at,'%Y-%m') as time,count(*) as cont FROM member GROUP BY time");
for ($i=0; $i < count($data); $i++) {
$cont[$i] = $data[$i]->cont;
$time[$i] = $data[$i]->time;
}
$data2 = json_encode($data);
$cont2 = json_e... | 0 |
b1569a82aff4bb2aae4d9e68fbd74b23 | dd10f377100f8c3ff2f34276bcf69ad7 | 通过标签获取视频 | void getAudiosByTag(String tagID); | 0 |
b3da46e0bd3299d79a5022cbc45dac7c | 98d6bfdc27d2e55ba41843873ecf7604 | 当购买游戏(虚拟产品之一)成功时执行的代码 | public class InAppPurchaseManager : MonoBehaviour
public void onItemPurchased(PurchasableVirtualItem pvi, string payload)
{
Debug.Log ("Arslan::InApp::onItemPurchased pvi id = " + pvi.ID);
} | 1 |
33a434fb8c87bd720bd4d8ac25c33fbc | 9e22b4b7e79a2456d35cccda6ad5a90b | Returns the last score. | class HighScores:
def latest(self) -> int:
return self._scores[-1] | 1 |
8501adb701109f7ecc95826b84bd5c88 | d91bc7047da1baeb3b310f21553015a6 | 设置EditText值通过Accessibility自动方法 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Bundle arguments = new Bundle();
arguments.putCharSequence(AccessibilityNodeInfo.ACTION_ARGUMENT_SET_TEXT_CHARSEQUENCE, text);
nodeInfo.performAction(AccessibilityNodeInfo.ACTION_SET_TEXT, arguments);
} else... | 1 |
bbbb3ad985413802279777bb952370cb | 3640e55d4b70c9887164cec6230e0be3 | disables 404 permalink guessing | function __disable_feed(){static $url = null; if(null===$url) $url = get_bloginfo('url'); wp_redirect($url);} | 0 |
2a21a53ce12e9316624bbfbd925ae827 | 4f820c96cc3ff63edbce393e3ff5e833 | This function reveals a letter by adding a .show class to it in the hidden phrase | class Phrase
showMatchedLetter(guessedLetter) {
const lettersOnGameBoard = document.querySelectorAll("#phrase ul li");
lettersOnGameBoard.forEach(function(letter) {
if (letter.classList.contains(guessedLetter)) {
letter.classList.add("show");
letter.classList.remove("hide");
letter... | 1 |
cdea1a737311ea49c2c699ed5ffd60d5 | 778b0299a331bb82e7bb24a1231f8b5d | Reads the Response from the intent. | val responseFromIntent = LoginActivity.getResponseFromIntent(intent)
return if (resultCode == Activity.RESULT_OK && responseFromIntent != null) {
responseFromIntent
} else {
AuthResponse(AuthResponse.Type.EMPTY)
}
} | 1 |
aee165a5793d0f4f939cc8a50acf2247 | 05624a90d40070922a01680aa8683fc7 | Results in only outline being shown | def test_outline(scene_one_triangle_, generate=False):
geometry = scene_one_triangle_.geometry[0]
geometry.outline_width = 0.1
buf_proxy = fresnel.preview(scene_one_triangle_,
w=100,
h=100,
anti_alias=False)
... | 1 |
f8a7ff4ecf56edc9e7d9c6a2c4845d75 | ceae426113697cae5e26c49f55a54663 | GET /membership_types/1
GET /membership_types/1.xml | @RestController
@RequestMapping("/Memberships")
public class MembershipController
@GetMapping(path = "/{mId}",
produces = { MediaType.APPLICATION_JSON_VALUE,
MediaType.APPLICATION_XML_VALUE })
public ResponseEntity getMembership(@PathVariable Integer mId){
MembershipRespons... | 0 |
bf35b78ea9cb3b47b40a55510fae9afa | b631fd9b775c0d9bd564d2d50cf4ab49 | Returns the amount of squares that the queen can move to the right diagonal down, stop counting when an obstacle is found. | bool ChessBoard::checkDiagonalRight(int row, int column)
{
int rows = row;
int columns = column;
if (column == (getSize() - 1))
{
return true;
}
while ((column != (getSize() - 1)) && (row != 0))
{
++column;
--row;
if (boardPtr[row][column] == 'Q')
{
return false;
}
}
while ((columns != (getSize... | 0 |
dac47b5a76cf33d2cd91c66ef4707150 | 271e4a24f650e946b97fbe5f1070d9c5 | Signal to listeners that we need the fleet to assist with a given target. | public class WaypointFollower implements
ConnectionListener,
CollisionListener,
MissionListener,
VehicleListener
public void engageWaypoingFollower() {
sWpfState = WpfState.WPF_ENGAGE_REQUESTED;
SkyControlUtils.log("WPF requested\n", false);
Mission.get().send... | 0 |
bc59ec65631d7ce2a06760627e0636f5 | 475021c81156afe4ca09033e743f94eb | Gets the animation action. | public final class AssignWeaponInterface
public int getAnimation() {
return animation;
} | 1 |
fa24e753f1787dab304464bfa869470b | 0fcd1a4c71b1d1b0e171ec32fe113414 | 当相机运行时,不可以再次运行 | public class CaptureActivity extends Activity implements View.OnClickListener,
SurfaceHolder.Callback, Camera.PictureCallback, Camera.AutoFocusCallback
protected void timerTimeout() {
if(cameraWorking)
return;
stopTimer();
if(this.mCamera != null) {
cameraWorking=... | 1 |
1479248f29ecd65b3ab60216ff679461 | 68163fa6748bc9359d808fa5b63b1d16 | Gets the count of projects belonging to the current user. The count of all projects directly related to the
current user are returned. A project is directly related to a user if the user is either the data owner or in a
collaboration group which has been granted access to the project. | int getProjectsCount(); | 1 |
9b005afc750326b2333f9b4dc5ebf531 | 2e7413aaeb2b2fc910d193bd44a9cf85 | Lists all of the Front Doors within an Azure subscription. | public final class FrontendEndpointsListByFrontDoorSamples
public static void listFrontendEndpointsInAFrontDoor(com.azure.resourcemanager.frontdoor.FrontDoorManager manager) {
manager.frontendEndpoints().listByFrontDoor("rg1", "frontDoor1", com.azure.core.util.Context.NONE);
} | 0 |
4d76c0fb5fa8292a60b42ed871a04f73 | 9579dae4e820524e51ef3a2abed93d36 | 0x8A | void CPU::op0x84 () {
AddA(HL.hi);
clockCycles = 4;
} | 0 |
c07147f7397978175fee63c9a1e47962 | 3bcce5347ab51f016339e18b168b9b94 | 菜单名搜索器 | if (e.target.value.length < 20) {
this.setState({
searchMenuName: e.target.value
});
}
} | 1 |
3029ddadb2f9cc34a1226886d98dc56a | c07371e824d291d61d5f59170309b0b8 | Converts date/milliseconds to cycles. | long toMillisecond(long timelineValue); | 0 |
a6ef454dad6f85ce67b32bf5956dfde7 | ba51a5b156c8d576849bb19b4a0a5291 | Metodo per aggiornare il numero di rating della domanda corrente | class Answer extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
public function updateTotalAnswers(AbstractModel $object)
{
$this->updateTheQuestion($object);
} | 0 |
2853c1e327af9346e52680a1916545c3 | 31af6d1597fb3d473cc1444253efe65c | ==================================================================
BNO055のシステムステータスを取得する | StatusWord_t CC8531Class::getStatus() {
StatusWord_t nStatus;
nStatus = writeWord(0x80, 0x00);
DESELECT_CC8531();
return nStatus;
} | 0 |
a96af32578bf156d677433df16371bb3 | 2ade829a09e27570ecf290d621476f02 | Método que permite obter o título da eleição | title_str = " ".join(response.css(".padding h1 *::text").extract())
if "Special" in title_str:
return title_str
return "Board of Elections" | 1 |
112475ec0fc17d73c07b096966731fba | d71907ccd7c3d38d9b292b4e4ccd484b | Remove o último elemento da lista.
Retorna 1 se a operação foi bem sucedida e zero caso contrário. | int removeFim(Lista *p_l, elem_t *p_e){
if(listaVazia(pl)) return 0;
No_lista *frente = *p_l;
No_lista *tras = *p_l;
if(frente->prox == NULL){
*p_l = NULL;
free(frente);
}
else{
frente = frente->prox;
while(frente->prox != NULL){
frente = frente->prox;
tras = tras->prox;
}
free(frente);
tras->... | 1 |
3268dd58b55432c8d9d9ce48c3b8c11b | f2dfd84068321b85dde48416ca9dd07d | Function to calculate the distance between two locations. (Haversine formula) | namespace FrequencyAllocator
class LocationGraph
public double CalcDistance(double lat1, double long1, double lat2, double long2)
{
double dlon = Radians(long2 - long1);
double dlat = Radians(lat2 - lat1);
double a = (Math.Sin(dlat / 2) * Math.Sin(dlat / 2)) + Math.Cos(... | 1 |
7fbc11bcfbf68a3ea8281d51e7073583 | fb34a579a6af554c061dc31ebfb2cc5e | Whether win conditions are fulfilled.
A win occurs when all the letters in guess are in the correct position,
with both words having every letter in common. | gameWon() {
return this.word.split("").every(x => this.guesses.includes(x));
} | 0 |
6945093c8408f5c5cb5bb226363adc41 | a671cdfd6faeeb03ec016ddc6772e998 | Отменить выполнение отчета. | cancelReport(reportId: string, options?: any): AxiosPromise<void> {
return localVarFp.cancelReport(reportId, options).then((request) => request(axios, basePath));
} | 1 |
979685a9554353273ec2cbe12fd5bd70 | 8c0503a4413e4184b4921d2df355472c | 将外部传入的自定义platform转为友盟的platform | mController.getPlatformInfo(LoginActivity.this, platform, new UMDataListener() {
@Override
public void onStart() {
}
@Override
public void onComplete(int status, Map<String, Object> info) {
if (status == StatusCode.ST_CODE_SUCCESSED) {
... | 0 |
bcd90c68a91dfe7dd8f1c13b01a44459 | 3b9445c454b43c652647b10ac57c23d6 | set the buffer to what is currently being displayed | class Biolume:
def display_to_buffer(self):
self.displayBuffer = self.currentDisplay | 1 |
36635aee669a18467ae7823674e94d30 | b65ccd086f39f4d4326436c2d01b0907 | Do nothing. Z motion is not allowed. | class lathe(TormachUIBase):
def on_zero_z_button_release_event(self, widget, data=None):
do_button_release_motion(widget)
self.window.set_focus(None)
if self.moving(): return
self.set_work_offset("Z", 0) | 0 |
73862edde21c6f01e85f4653e15022e5 | b47bccf4e7a896f444508326bfa8467c | WRITING PASSWORD TO FILE AND CHECKING IF THE PASSWORD IS CORRECT OR NOT | void passwordCompare(){
while(fscanf(passwordfile, "%s", word)!=EOF){
checkSHApasswordfile(word);
}
} | 0 |
42e8bea1beaeb050c6378ccac3138aaa | 0352cfd0bba13180079f88903bc79be3 | Verifies if the item has a trasform configured already | class ViewProperties< T extends NativeType< T >, R extends NativeType< R > >
public boolean hasTransform()
{
return hasTransform;
} | 1 |
ce286f9f22cb34a520527b15c6736d9c | c5fb2c65a380b3e79858ccc8cfe02e95 | e.g. login | class Organization
login(form, organizationId, isCreator = false){
const route = isCreator ? '/admin/' : '/';
return form.post('/api/organizations/' + organizationId + route + 'login')
.then(response => {
return response;
})
.catch(err => {
... | 1 |
1eefbc81c36fc58471251da5186d7a59 | 2a3f879a1b7b684f7996688a1905f48c | Include the contacts that meet the specified time condition. | {
for (ContactList::const_iterator it = m_entries.begin(); it != m_entries.end(); ++it) {
if ((*it)->GetVersion() >= minVersion) {
nInOutContacts++;
} else {
nInOutFilteredContacts++;
}
}
} | 0 |
78c20c20efdea69a48ac7144f2337a83 | 1dd0e20fbea8e6f40c256374ccef6d21 | defining getter function for goal and starting location of therobot; | class rover:
def get_result(self):
return self.x, self.y, self.direction | 0 |
481ac525ffbd73459f239fcd2bfee301 | 6515c9049701896a6e1e9a8f0f9b9f48 | Valida que un segment by Agency cumpla con los filtros actuales | {
if (empty($segment)) {
return false;
}
if ($this->flightSegmentName != $segment->flightSegmentName
|| $this->validatingAirline != $segment->validatingAirline
|| $this->marketingAirline != $segment->marketingAirline
|| $this->operatingAirline ... | 1 |
6e59d11000954a0f4a8c6812f5d788a6 | 08b6ddcec322fa62940f62be355835e8 | Add Category invalid case: blank category name | public final void testSetCategoryFailureEmpty() throws Exception {
try {
contestData.setCategory("");
Assert.fail("IllegalArgumentException is expected since category is empty");
} catch (IllegalArgumentException e) {
}
} | 1 |
53ab2d0bf8b8230cc9aaa8a955598d72 | 58992ecc2684c9c978905e9364aa3b89 | 获取浏览器可见区域宽高 | if (document.compatMode == "BackCompat") {
return {
width: document.body.clientWidth,
height: document.body.clientHeight
}
} else {
return {
width: document.documentElement.clientWidth,
height: document.documentElement.clientHeight
}
}
} | 1 |
eb94726e5cf44c0af0d5c3670b76c097 | 2abc5bfc0ef7f313e8abed6f97c6cb32 | 根据type、status和canDeleted获得对当前Personal_CI或II_Instance的操作。canDeleted表示获得的结果中是否包含Delete、Deactivate命令 | {
string owner = "";
switch(type)
{
case "apply": owner = "('User')"; break;
case "approve": owner = "('Supervisor')"; break;
case "mentor": owner = "('Mentor')"; break;
default: owner = type; break;
... | 1 |
a830089ca7213cef0a0275fcea0d44aa | 21caf89df62e2a0a6a369685d5e52689 | Tile all the open internal frames vertically | public class JAbode extends JFrame implements InternalFrameListener
public void tileFrames() {
java.awt.Component allFrames[] = desktop.getAllFrames();
manager.setNormalSize();
int verticalLocation = mainSplitpane.getDividerLocation();
int horizontalLocation = sideSplitpane.getDividerLocation();
int frameHeig... | 1 |
9e94931b405ab4a9c97aff0a323374e1 | 987f20646c297ecc6368b163013acf41 | Метод возвращает адресс устройства, на котором находится Юнит, например /192.168.0.12 | namespace BelicsClass.PLC
public class BL_FAM3Protocol : BL_ThreadController_Base
public class DeviceInfo
public int GetAddress()
{
return GetAddress(0);
} | 0 |
ad8c3f375b30fa5fc52b895ff6cef753 | 5d0d6d2bfc53115c64d68b0d9f306d17 | @brief Deinit streaming data | {
if (bitStream->stream != NULL)
{
free(bitStream->stream);
}
if (sampleStream->stream != NULL)
{
free(sampleStream->stream);
}
return HAL_OK;
} | 1 |
d19dd5cc0b713abe2766ee5cf88d209e | dcb8195b9ced0c6b5ede00d2f1a5280e | Removes duplicates from an array of date strings and then returns a list of the unique dates. | dates = date.split('\n')
date_list = []
for i in dates:
if not len(i.strip()) == 0:
date_list.append(i.strip())
return list(set(date_list)) | 1 |
65a6f10674637e20590a95d070ccfb79 | 543164991eeb044a5a411f78854f1961 | 获得地点信息(不带条件) | {
PointObject pointObject = new PointObject();
pointObject.DataType = 2;
if (placeId != Guid.Empty)
{
Place place = placeRepository.FindByKey(placeId);
if (place != null)
{
PlaceCategory placeCate... | 0 |
d6eccf623cefb7dbf94ce8afc3f5218a | 9eacccfd16260fee8791497e12f548e3 | Routine to automatically determine the filter slide A/D count positions.
This is done by driving the filter slide between the two limits, noting at what position A/D counts
the filter indexer is set. | {
uint8_t index_cnt = filter_len;
uint8_t curr_array_idx = ranging_array_idx;
uint32_t dist_sum = 0;
uint16_t dqf_sum = 0;
while (index_cnt)
{
dist_sum += dist_array[curr_array_idx];
dqf_sum += dqf_array[curr_array_idx];
if (curr_array_idx == 0)
{
curr... | 0 |
2a1f98bf1bb96365e138d9ae95310c8e | 159293ef3361d07f3b556eb3443ad4b2 | Removes the first occurrence of a specific element from the list. | namespace homework8
public class GenericList<T> : IList<T>
public bool Remove(T item)
{
if (Equals(head.Data, item))
{
head = head.Next;
--Count;
return true;
}
Node previous = head;
Node current = he... | 1 |
2d9640a1d881d347e09409b2bacfa774 | f78d42f9fe24cc39a1e41129c1f5044b | 將db讀出之日期(ex:2014/12/29 上午 12:00:00)轉成指定格式 | public class DateUtil
public static String getDbDate(String date)
{
return formatDate(date, DB_FORMAT);
} | 1 |
e7cf14b42a2770b5871d2c02708c5af5 | f429207755ada3788a028aeb9ab1cf78 | 不管高度的设置Mode是什么,直接把View的高度按照宽度适配的缩放倍数进行适配 | public class ViewBindingAdapter
@BindingAdapter({"scale"})
public static void setViewScale(final View view, final float scale) {
if (scale > 0) {
final ViewGroup.LayoutParams params = view.getLayoutParams();
if (params == null || params.width <= 0) {
RxView.globalLayo... | 1 |
e0a524e67d1ae0f52d858f5c96b1492c | a7ecf7e689f0e2ad7cdf64fc48c27db7 | Asettaa annetun flash-viestin, ohjaa selaimen etusivulle ja keskeyttää
actionin suorituksen. | function setFlash ($key, $msg) {
$_SESSION[$key] = $msg;
} | 0 |
8c06fdb20e08745813ebb4417c013440 | 22bf950e5ceb00312fdbe534db77ac1c | Mets à jour la scène en mode "Pick". | const gl = this.gl;
gl.disable(gl.BLEND);
gl.enable(gl.DEPTH_TEST);
gl.depthMask(true);
gl.frontFace(gl.CCW);
gl.viewport(0, 0, this.pickingFB.width, this.pickingFB.height);
gl.clearColor(0, 0, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
... | 1 |
69d07aedf05abc21116c10c4bf196bc2 | 4b1746148d6931269fad29cbec2ce24c | Function for inserting into a non full node. | class BTree
bool insert_non_full(BTreeNode *node, int key, int val) {
for (int i = 0; i <= node->n; ++i) {
if (i != node->n && node->keys[i] == key) return false;
if (i == node->n || node->keys[i] > key) {
if (node->leaf) {
node->keys.insert(node->keys... | 1 |
3f75cc928571595549940db20338a62a | 2c08714c00d2f138107d015a9188d300 | 保持监听,循环接收服务器发来的消息 | while (true) {
try {
byte[] byteRec = new byte[1024];
int len;
StringBuilder strB = new StringBuilder();
String strEnd = "";
while ((len = socket.getInputStream().read(byteRec)) != -1) {
strEnd = new ... | 1 |
063018973ddcf9299cc07ced4dd0e399 | 55f699eb7c1741cf517654f6ed60da09 | Get username from the database | class DB
public function getUsername() {
return $this->username;
} | 0 |
e4f9477b7e4dbbbe9c909de829ca0d02 | 57d153d943f431f3b8259377795e59da | Selects all Triples which have a Uri Node with the given Uri from a Subset of Graphs in the Triple Store. | {
DataTable dt = new DataTable();
String getTriples;
if (graphUri != null)
{
getTriples = "SPARQL define output:format '_JAVA_' SELECT * FROM <" + this.UnmarshalUri(graphUri) + "> WHERE {?s ?p ?o}";
}
else
{
... | 1 |
30ee29661d15e3d4b21c97c9c9c30982 | 7f51de17ab34da5487821b77891897f7 | Retrieve the details of an instanced Destiny Item. An instanced Destiny item is one with an ItemInstanceId. Non-instanced items, such as materials, have no useful instance-specific details and thus are not queryable here. | namespace BungieNetApi.Api
public partial class Destiny2Api : IDestiny2Api
public InlineResponse20022 Destiny2EquipItem ()
{
BungieNetApi.Client.ApiResponse<InlineResponse20022> localVarResponse = Destiny2EquipItemWithHttpInfo();
return localVarResponse.Data;
} | 0 |
228df5d13d4f2a03294eb9bc06025bf8 | 908bb9869a0ea721538aa25583617066 | Get trlRfc value. | if (idComposite == null) {
return null;
}
return this.idComposite.getCompRfc();
} | 0 |
dc98edb537bf8b5dce120b9e9e3f437d | 2af711afafbaaebaeb171e6736d797ce | Post action to delete movie | {
try{
$movie_id=$comment->movie_id;
$comment->delete();
return redirect()->route('movies.show',['id'=>$movie_id]);
}
catch (\Exception $e){
return $e->getTraceAsString();
}
} | 0 |
14b0e099f389cb3bcd1be3ffbb4c767b | 05bf529810080b4d53a1ca3e8fca4c4a | Uninstalls the app with the given id | class CoinConfigurationAppManager
public async Task UninstallAsync(string id)
{
var installFolder = Path.Join(_storageDirectory.FullName, id);
if (Directory.Exists(installFolder))
{
var configurationFile = new FileInfo(Path.Join(installFolder, ConfigurationFileName));
... | 1 |
44ed78da48df47d052ee8c082abc57d7 | d2329b072838262186782bc329768c4f | Check if 'raid_tickets' has a value | class BlobData extends \DrSlump\Protobuf\Message
public function hasTicket(){
return $this->_has(56);
} | 0 |
401403f5373931a4fb81592e155439b1 | d618f811338ca8668983f9ac349d83fb | Méthode permettant de gérer l'événement précédent sur le slider,
le -400 permet d'aller directement à la dernière slide depuis la première car 5 images au total | export class HomePage implements OnInit
slidePrev(object, slideView) {
slideView.slidePrev(500).then(() => {
this.checkIfNavDisabled(object, slideView);
});;
} | 0 |
5fff2af67152478c90bc11c6395d79fe | 7bc1cd855fac6a92c46e1ce092b0e6c3 | default construct, sets coords to [0,0,0] | Coord::Coord() :
x(0), y(0), z(0)
{
} | 1 |
597e97a45dfb2d48d11c2d1d8bcc577e | f275f8d50465de0e4c281e4b0e3d517d | 创建唯一EF上下文对象,存在就获取,不存在就创建 | {
DbContext db = CallContext.GetData("efContext") as DbContext;
if (db==null)
{
db = new RegSysEntities();
CallContext.SetData("efContext", db);
}
return db;
} | 1 |
4f5b54d4aecf0c811a9f2fbe70b08a5f | 068ceadf93b6dfad6b717ea53584ff7e | Statistics about system wide Disk I/O
Returns a dictionary holding named tuples with
I/O statistics for each mounted disk.
Notes | from time import sleep
info = ('reads reads_merged reads_sectors reads_ms'
' writes writes_merged writes_sectors writes_ms'
' io_in_progress io_ms_weight').split()
print(*info[:8], sep="\t")
old = [0] * 11
while True:
disk_l = grep(disk, "/proc/diskstats")
if ... | 0 |
6a2caf452e6c24e07f0f4e6f4c74c994 | 74282ac4263a55d86da239ad874be5a9 | 获取下一级工位的LevelNo | var nxtValue;
var nxtLevel = [];
for (var index = 0; index < wbsProps.length; index++) {
if (wbsProps[index] != null) {
var str = wbsProps[index].split(".");
nxtLevel.push(str[str.length - 1]);
}
}
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.