query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
b33d658824dd7a5ec8d14b93a06ab885 | f1438019380b4023083332b8c0d1373c | 根据列指标code查询列指标id | String getIdByCode(String code)throws SQLException; | 1 |
fa525673e5d3f300bdab5136ccffc278 | cc8f810637f9da6426a865a35d6f4679 | The `get_course_runs` and `get_course_runs_for_language` methods should return all
descendants ranked by path, not only children and should respect publication status. | class CourseRunsCoursesQueryTestCase(TestCase):
def test_query_courses_children_aggs_over_aggs_list(self, *_):
data = self.prepare_indices()
response = self.client.get(
(
"/api/v1.0/courses/?subjects_aggs="
f"{data['subject_0_children'][0].get_es_id()}"
... | 0 |
8eddb932659ad99af0509b8296691c91 | dbca21bfe7e7163f3eec39c53b900ce7 | 合并&预处理财务报表数据 | public class Fight
public static List<Compress> merge(List<Compress> list, boolean flag) {
SqlSession sqlSession = MysqlUtil.getSqlSession();
List<Compress> list1 = new ArrayList<>();
List<Compress> list2 = new ArrayList<>();
List<Compress> list3 = new ArrayList<>();
CompressM... | 1 |
605ca92cafe17bf0da202d00873d8cc3 | b6aada7b614dac29a3fcd14271a65bad | 验证a包含b中所有元素 | if(!(a instanceof Array) || !(b instanceof Array)) return false;
if(a.length < b.length) return false;
var aStr = a.toString();
for(var i = 0, len = b.length; i < len; i++){
if(aStr.indexOf(b[i]) == -1) return false;
}
return true;
} | 1 |
6d57bd781f5823f09f036d5cbfa67ba0 | 8087edfd005b73580dcb2464e5816d8f | 将更新的产品数据同步到本地库 | {
var dbContext = new JooWMSEntities();
var localProduct_ = dbContext.LocalProduct.FirstOrDefault(item => item.LocalNum == localProduct.LocalNum && item.BarCode == localProduct.BarCode);
localProduct_.Num = localProduct.Num;
return dbContext.SaveChanges() > 0;
... | 1 |
ae065729f4f4c667330d34b11a48037b | fab7313f47a6a3553de75434a9dda8f8 | 获取 IMSI id码 (默认88888888888) | public class TxNetworkUtil
public static String getIMEIId(Context context) {
TelephonyManager telephonyManager = (TelephonyManager) context
.getSystemService(Context.TELEPHONY_SERVICE);
String imei = telephonyManager.getDeviceId();
return "866007023045618";
} | 0 |
53d76257c4d7986744fc7ac175e5794a | 2947fb561c11d9f0ca78c867bddba065 | Block the chat for a given time | public class ChatClient extends Application implements Runnable
public static void blockChat() {
DatagramSocket aSocket = null;
try {
aSocket = new DatagramSocket();
int serverPort = 6789;
String message = "4block:" + sendToIP;
byte[] send = message.getByt... | 0 |
99f3876d80b1e3259007c419e288a3a1 | 70a29b4b48445bd1f241654b6f53457d | On libère ce qui a été alloué dynamiquement c'est à dire
les séquences (char *), et le nom des fichiers (char *). | void libere_traitement(traitement t)
{
int i;
free(t.chiffrements);
for (i = 0; i < t.nb_messages; ++i)
{
free(t.chemins[i]);
}
free(t.chemins);
free(t.cles);
for (i = 0; i < t.nb_messages; ++i)
{
libere_message(t.tab_mess[i]);
}
free(t.tab_mess);
} | 1 |
8aeeb277ad74039bdb8a925586abb959 | 1321f33eb23c8591a021f5bf240341a2 | 获取需要同步到 ElasticSearch 中的文章数据 | class SynesController extends BaseController
public function actionIndex ()
{
$nd_json = [];
$nd_json['index'] = \Yii::$app->params['es_index'];
$nd_json['type'] = 'article';
$makemd = new Makemd();
$sql = "
SELECT COUNT(*) AS num FROM `article`;
";
$n... | 1 |
069c39a955a6905fa9262654d608616b | d21a330ef1437253d640385dcfa93c85 | Returns the meta object for the reference '{@link org.abchip.mimo.biz.model.party.agreement.AgreementPromoAppl#getAgreement <em>Agreement</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getAgreementPromoAppl(); | 0 |
1d48885b529a085e3348965e7578ffd5 | 5de18d5581307c49a49e7fa19cd9d5f9 | Test case for get_accounts_info
Get accounts information # noqa: E501 | class TestAccountManagementApi:
def test_accounts_id_get(self):
pass | 0 |
29a3433220199bedc0a0e1b0f2b8d4c4 | a0ae0055293c17f137472fd3546c1eb4 | 保存时清空缓存 | export default class Index extends wepy.page
onUnload() {
wx.removeStorageSync('lat');
wx.removeStorageSync('long');
} | 0 |
8c446ace759c351c5d018aec9e30109e | 0b2fb29eb3ad19ae0b4b3789d48bf489 | #Import each sheet in a workbook and output as a list of dataframes | read_excel_allsheets <- function(filename) {
sheets <- readxl::excel_sheets(filename)
x <- lapply(sheets, function(X) readxl::read_excel(filename, sheet = X))
names(x) <- sheets
x
} | 1 |
92b05d3f89aef183ef5fbf9e303c9879 | 30f526f8f0464ce5c4d499e3118214e3 | ==========================================================================
Spawns required number of targets.
========================================================================== | void EnSyatekiMan_Swamp_SpawnTargetActors(EnSyatekiMan* this, PlayState* play2, SwampTargetActorEntry actorList[],
s32 actorListLength) {
PlayState* play = play2;
s32 i;
for (i = 0; i < actorListLength; i++) {
Actor_SpawnAsChild(&play->actorCtx, &this->actor... | 1 |
61ba9f7d75ced47b8614084679d6612e | 4d66930e1084610ddc4f06f90c518228 | 获取当前日期串,格式为yyyy-MM | public class Dates
public static String getCurrentDate(){
SimpleDateFormat sim = new SimpleDateFormat("yyyyMM");
Calendar calendar = Calendar.getInstance();
String lastTime = sim.format(calendar.getTime());
return lastTime;
} | 0 |
45dbc4a8b2589f6e7d97ba254bcd4012 | e7d5f136b8fe0fb700b936571bcc9905 | Функция, которая получает данные с сервера | async function getData(url = '') {
const response = await fetch(url, {
method: 'GET',
mode: 'cors',
cache: 'no-cache',
credentials: 'include',
headers: {
'Content-Type': 'application/json; charset=UTF-8'
},
redirect: 'follow',
referrerPolicy: 'no-referrer... | 1 |
94b3d374bd4166bba2b2d31d81696045 | 25c022bea9b0ad1f533def5b0863ab96 | Set whether the file is attached. | class File
extends AbstractEntity
implements FileInterface
public function setIsAssigned($isAssigned = true) {
$this->_isAssigned = $isAssigned;
return $this;
} | 1 |
e89ab65013d6c23d46ccec846a83b787 | 3dbf9c68df5ae7579ccf1698bac30d8b | Ödeme işlemleri için gerekli sipariş ve ödeme bilgileri setleniyor | def payment(request, methodId):
try:
productId, basketId, size, pieces, sumPrice, categoryId = checkBasket(request, payment=True)
except:
messages.info(request,"Sepetiniz Boş")
return redirect("/")
if methodId == 3:
form = OrderWithPaymentForm(request.POST or None)
else:
... | 1 |
286e7fec36b9b4a71c7a413dce6071c4 | 4e844ffe399e6c4c6e73048ee41a91e4 | 传入一个链表的头节点与结束节点,返回翻转后的头节点 | func overTurn(head *node) (ret *node) {
var beg *node = nil
mid, end := head, head.Next
for {
mid.Next = beg
if end == nil {
break
}
beg, mid, end = mid, end, end.Next
}
return mid
} | 0 |
7230f8c88dbd190b1c91268630b08737 | 87435e11960386fe17aa18fe68fee1a8 | Busca qué propietario está logeado | class ApiPropietarioController extends Controller
public function index()
{
$id= Session::get('nombre_usuario');
return $propietario = Propietario::
where('nombre_usuario','=',$id)
->get();
} | 1 |
13ef8efad7a697348879f0903e3a831d | f7e28100362b7727c4d7b492df0e026c | 获取SD卡上的一张图片 | {
String filepath = null;
WindowManager windowManager = getWindowManager();
Display display = windowManager.getDefaultDisplay();
int w = display.getWidth();
int h = display.getHeight();
Bitmap Bmp = Bitmap.createBitmap( w, h, Config.ARGB_8888 );
View decorview = thi... | 0 |
188758341f4d8a262905c2f3da3db413 | 068a4cedd01643e99ffac6d2150d7f00 | 获取-页眉-高度 | export class DataExportTemplate extends ibas.BOSimple<DataExportTemplate> implements IDataExportTemplate
get pageFooterTop(): number {
return this.getProperty<number>(DataExportTemplate.PROPERTY_PAGEFOOTERTOP_NAME);
} | 0 |
8bd65c118e068e2addb2dcd4b7f7a9f6 | 09db7e39cd3522cfddb95de233a89158 | Calls when QuickBlox application authorize. | export default class OpenPlatform extends BaseApplication
handleAuthorize(): Promise<any> {
return this.base.handleAuthorize.apply(this.base, arguments);
} | 1 |
a6933199f2c808bf20005913d5d3203c | 71e23506d340d9c932a2b9fb5db24feb | litres to gallons | public class Converter
public static double gal2l(double gal){
return gal* 3.78541178;
} | 0 |
1df59384a12af611d101ff1cca8edecf | 72c41c1a2b15aaddd03662cfa51486bb | Retrieves a cancellation token. | public static class DotvvmRequestContextExtensions
public static CancellationToken GetCancellationToken(this IDotvvmRequestContext context)
{
var cancellationService = context.Services.GetRequiredService<IRequestCancellationTokenProvider>();
return cancellationService.GetCancellationToken(context);
... | 1 |
31f24b1148ef9cffca9bce1ac988d356 | 47f774d80056bf231622f4c1a2a846c8 | アラームの通知許可が設定されなかった事をユーザーに伝える | public class AlermSettingViewController : ViewControllerBase
IEnumerator SendAlermSetting () {
#if UNITY_IOS
bool isCompleteCheckPrepare = false;
BluetoothManager.Instance.NotificationCheckPrepare (() => isCompleteCheckPrepare = true);
yield return new WaitUntil (() => isCompleteCheckPrepare);
#endif
if (N... | 1 |
11079616ca35a706c2c81fd0cc51dbbd | 90450d1814abdbbc3bfab3f7a9600634 | 用户中奖追号推送开关设置 | class ShermanWechat
public static function setOnoff($lotteryId, $switch)
{
$url = "https://api.weixin.qq.com/shakearound/lottery/setlotteryswitch?access_token=%s&lottery_id=%s&onoff=%s";
$url = sprintf($url, self::getAccessToken(), $lotteryId, $switch);
$res = self::http_request($url);
... | 1 |
f515b39ccb01c6ffb7f94bcd7e81776b | ba0dfb8f39eadf41f4a9d586bdc04a64 | Be aware that this and unhide_descendants_by_kfids are not symmetrical.
Hiding hides partially contributed descendants, but showing only shows
partially contributed descendants if all other contributors are visible.
If you anticipate needing symmetrical behavior, keep a record of what you
change. | def self_and_descendant_ids
end | 0 |
a95d72528a708bc2f63264991619dae8 | 61b0dac524dad65cc60a6681cda4b766 | The ARN of the state machine.
:attribute: true | class TopicRuleErrorActionStepFunctionsArgs:
def state_machine_name(self) -> pulumi.Input[str]:
return pulumi.get(self, "state_machine_name") | 0 |
77f48ed43c08417fdf4dfb05f85b9619 | 65c61cb68a77f15bf850f148e6afe9b6 | 获取用户要结算的课程和优惠券 | {
$data = DB::table('dx_order')
->where(['user_id'=>$request->user_id,'course_id'=>$request->course_id,'status'=>1])
->get()
->toArray();
if (empty($data)) {
return [];
}
return $data;
} | 0 |
693f1e32e44c9d7c0147f9b28252f602 | 6cdae142a22d4db6ab27cf7da76da5e2 | 查询平台运调度单预警列表 | List<TransOrderDispatchDetailVo> findAllWarningList(TransOrderDispatchDetailSearchVo vo); | 1 |
7eb34b28f6ed465e6183e94347959207 | 50f743e88d1b3d7a7e46331a2fad359d | 1、用已经创建好的对象来初始化新的对象 | function createAnother(original) {
let clone = object(original)
clone.sayHi = function () {
console.log('Hi');
}
return clone
} | 1 |
5659c6d3d7691b51fcf042c3025df26e | 80176a4feab609a66e789700d93fd860 | @brief ina226 读取指定寄存器的值 | {
Int16 retcode = 0;
Uint8 cmd[2];
cmd[0] = regnum & 0x007F;
cmd[1] = 0;
retcode |= ezdsp5535_I2C_write( AIC3204_I2C_ADDR, cmd, 1 );
retcode |= ezdsp5535_I2C_read( AIC3204_I2C_ADDR, cmd, 1 );
*regval = cmd[0];
ezdsp5535_wait( 10 );
return retcode;
} | 0 |
38381f355413654cbd18f274a37702e7 | c6fb110d1f6be4891dd821374475eaa6 | Surface transfer function for visco-elastic soil and an elastic bedrock
Ref: Eq 7.27 of Kramer (1996), consistent with Faccioli, 2005 | psi = ExactPsi(psi0,strain,zeta)
fe = 1/strain + (1/strain)*(1+(zeta-1)*np.sin(psi0)**2)*(1+(1/zeta -1)*np.sin(psi)**2)
fe += (strain**2)*(1+(zeta-1)*np.cos(psi0)**2)*(1+(1/zeta -1)*np.cos(psi)**2)
fe += np.sqrt(strain)*(2 - zeta - 1/zeta)*np.sin(2*psi0)*np.sin(2*psi)/2
return fe/2 | 1 |
4fae553e654e9cf80775cc5ce177ebf9 | 41adc4821e8f5f6c8b71ab0b5e1e68be | Timer handler for AutoSnap | namespace SerialTracker
class UserProfileManager
private void autosaveTimerEvent(object sender, ElapsedEventArgs e)
{
save_active_profile();
} | 0 |
e4b04d47e58a13aaa69156b5bcfaeaa6 | 21216e8344542ebac9c8092a110987ab | spawns the disc and registers it with the game manager | public class DiscSpawner : MonoBehaviour
public void SpawnDisc () {
GameObject newPrefab = Instantiate(disc, new Vector3(SpawnRange(), ySpawn , SpawnRange()), Quaternion.identity) as GameObject;
int randomNumber = Random.Range (0, 25);
if (randomNumber == 1) {
DiscAttributes attributes = newPrefab.GetComponent... | 0 |
c978491ec6fca1cf8faea2f8c37e00c7 | b66d1b0fabe0ab24c145d42aa94cd9ee | Use this to redirect the user to an exteral system where they will login;
in which case, send the user back to the authenticate/validate action together with
other querystring parameters as needed; that will in turn call onCallBack() below | namespace SimpleSecurity.AspNetIdentity.RefApp.Controllers
[Authorize]
//[InitializeSimpleMembership]
public class AccountController : Controller
[HttpPost]
[AllowAnonymous]
[ValidateAntiForgeryToken]
public ActionResult ExternalLogin(string provider, string returnUrl)
{
... | 1 |
2bd7aef776a0f119079f6bb4abbf66e8 | 22f19f6aa7682fa9e992b06adc7b0280 | перевіряє, чи передана кнопка рівня тій, що збережена в екземплярі класу | public class C6_15_Ctrl_Catch : Catch_Controller
private bool validateCorrectWord(GameObject obj){
bool isCorrect = obj.name.Equals(_arrayStringPerRound[_valuetoChangeStrings])?true:false;
return isCorrect;
} | 0 |
6b318edb44b07eba36130501b451b0df | 512778496add890ccd0ac3a6f3eca92a | chop off the characters on the right of each line that are from the last digit | static void printdigitsweep(FILE *fh_out, int slen, int len, char *linein)
{
static int l;
static char lineout[LINEIN_MAX] = { 0 };
if(len >= slen)
{
for(l = 0; l <= len -slen; l++)
{
memcpy(&lineout, &linein[l], slen);
lineout[slen] = 0;
fprintf(fh_out, "%s\n", lineout);
}
}
return;
} | 0 |
0b02840f90031b950dbcff22823c836c | ed0885bee389539f97a24d938e112fc0 | Gets the value of the longValue property.
possible object is
{@link Long } | @Override
@Test
@Category(Draft.class)
public default void test_longValue()
throws Exception {
final SUT sut = this.createNewSUT();
assert sut != null;
} | 0 |
56f9884663b34a0228b57e0d15ca9c7a | 97c388fa78d0e481ab07e0acfed3b279 | Convert list of entry to array, for correct view in json. | {
$output = [];
foreach ($this->entries as $entry) {
$output[] = $entry instanceof ArraySerializable ? $entry->toArray() : $entry;
}
return $output;
} | 1 |
b5e0de943f0e0211d726051102be6ade | 7ef29a6d6824693c215be01bb4eff574 | 截取指定分隔符前的字符串内容。 | public class StringUtil extends org.springframework.util.StringUtils
public static String subBefore(CharSequence string, CharSequence separator, boolean isLastSeparator) {
if (isEmpty(string) || separator == null) {
return null == string ? null : string.toString();
}
final String str... | 1 |
7a80f7ab820dae8dfa422a8f9d1c330b | 9ed014abe9cebdc92d75eaf26b245dd1 | Записывает токен в БД и время его получения | class Laratube
public function saveAccessTokenToDB($accessToken)
{
return DB::table('laratube_access_tokens')->insert([
'access_token' => json_encode($accessToken),
'created_at' => Carbon::createFromTimestamp($accessToken['created'])
]);
} | 1 |
c85938ee0027468f83a11dfe5fa5fffb | 3626a4432f465f11359ba518d892cfd1 | Draws map locations to screen | love.graphics.push()
love.graphics.translate(Config.map.xOffset, Config.map.yOffset)
for __, cell in pairs(self.cells) do
cell:draw()
end
love.graphics.pop()
end | 1 |
982ed862dfa01713975ecf62f64a3c85 | c3733f52c40bd92da6d21defd563884c | 更具xml节点属性获取属性中的值,如果为空时返回默认值 | {
XmlAttribute attribute = node.Attributes[attributeName];
if (attribute != null)
{
return attribute.Value;
}
return defaultValue;
} | 1 |
16684d7f89143ebc1bd0f382745bbe7d | 0180c1ad0aa849925e842911d2d541e1 | Get current background of the altitude title text view | public class CameraConfigStorageWidget extends ConstraintLayoutWidget implements ICameraIndex
@Nullable
public Drawable getCameraColorTextBackground() {
return cameraColorTextView.getBackground();
} | 0 |
d1f3f166d97bd6edc4b4e5218025da80 | c0b8ef6b1829fd3aaa4c5be7da6ba4b9 | 下载报告(一个压缩包内含有多个) | class ReportController extends CommonController
public function rep_down() {
$ref=$_SERVER['HTTP_REFERER'];
if($ref==''){
}else{
$url=parse_url($ref);
if($url['host']!=$_SERVER['HTTP_HOST']){
echo "<script>alert('盗链请求,禁止访问')</script>";
die;... | 1 |
f96ec04a1cad0ae061bbefeee9a353c4 | a83712e93e2ddb240b9acb7435249d67 | 为对应座位适配桌面碰吃杠麻将尺寸,方向等 | public class CellDesktop<TDef> : Component<TDef> where TDef : DefDesktop, new()
public Task s2sSetupDesktop(DesktopInfo desktop_info)
{
var tb_desktop = EbDataMgr.Instance.getData<TbDataDesktopInfo>(DesktopInfo.desktop_tableid);
if (tb_desktop == null)
{
EbLog.Error("CellDesktop.... | 0 |
86ae51de62c3193ef15159dfc9b21f22 | 168f064e2f5395c50a058469b97d3cae | attach "equips" this unit with this object/equipment
When attaching, an order needs to be added to the units order list so the equipment can be used by the player | public class Cleric extends AbstractUnit
@Override
public void equipStaff(final IEquipableItem staff){
equippedItem = staff;
} | 0 |
07b23c3f1e4dbdbd03ac4468fec8667a | a82ee9b9eabb136fc93a77f8d334a256 | in case a param is not set, we assume it is empty | class Responder
def empty_param?(x)
return true if params[x].nil?
if params[x].is_a?(String)
params[x].strip.empty?
else
params[x].empty?
end
end | 1 |
aa3cff63ecbb60bfbefac988189158b9 | 354cf751cef541582a6226d774ce9072 | Select points from a scatter or histogram plot. | def scatter(points, color=None, opacity=None, radius=1., use_cursors=False, fig="gcf", label=None):
points = np.asarray(points)
out = np.empty(points.shape[:-1], object)
out_flat = out.ravel()
for (i, (xyz, c, r, l)) in enumerate(zip(_iter_points(points),
_it... | 0 |
5f43ed4809a3a6f8ac1df62067c58372 | 84dc4ec783337b935d54da92f931c051 | DELETE /entries/:id : delete the "id" entry. | query = request.dbsession.query(Entry)
the_entry = query.filter(Entry.id == request.matchdict['id']).first()
if not the_entry:
return Response("Not Found", content_type='text/plain', status=404)
return {"entry": the_entry} | 0 |
5d386f2b8b94104662e23a1ecf195220 | 012783e76e67c2bfaa3deab5c8e1bf9a | Force a secure connection | export default class CookieBuilder implements ICookieBuilder
public secure(): CookieBuilder {
this.cookieOptions += '; secure';
return this;
} | 1 |
e43469961ed71db715865ff89d18d9e4 | e93584d927adb01296855f2c15d8789a | Method handles all touch inputs on MissionMap, splits into TouchPhases and contains the movement logic | {
touchValue = touch;
switch (touch.phase)
{
case TouchPhase.Began:
TouchBegan(touch);
break;
case TouchPhase.Stationary:
if (isStationary)
{
... | 1 |
697245c519b24084a4456eb45570e391 | 170ec0f25a248d6ad40ac803dc75d380 | ตารางยอดขาย แสดงยอด สัปดาห์ล่าสุด | class Sale extends \Eloquent
public function thisWeek(){
$sales = DB::table($this->table)
->where('created_at', '>=',Carbon::now()->startOfWeek())
->where('created_at','<=',Carbon::now()->endOfWeek())
->where('status','=','1')
->groupBy('trans_id')
... | 1 |
4dc5c37543143f7269221fb8e44dd465 | f32851849af6d4536421a581eab96e1c | This operation will stop backup for a backup instance and retains the backup data as per the
policy (except latest Recovery point, which will be retained forever). | self, resource_group_name: str, vault_name: str, backup_instance_name: str, **kwargs: Any
) -> AsyncLROPoller[None]:
_headers = kwargs.pop("headers", {}) or {}
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
api_version: str = kwargs.pop("api_version", _params.pop("ap... | 1 |
541299e4057dcb090f24c131c743e687 | ec85d576e04511a0a9c4a2f952faa5fe | defines loss function to be used, which is cross entropy | def build_criterion(cfg):
return nn.CrossEntropyLoss() | 1 |
aab1588259ab9a79c26299636541eab8 | 0df11d766868f90221ecd48e8c0ae5f3 | 是否启用了prettier | extend(config, { isDev, isClient }) {
if (isClient) {
config.entry['polyfill'] = ['babel-polyfill']
config.module.rules.push({
enforce: 'pre',
test: /\.(js|vue)$/,
loader: 'eslint-loader',
exclude... | 0 |
c01f101db4583b7b24eca0913d1dd03b | 5a2a19940832463055d666520e37bb22 | 获取格式化实付利息 | public class TransactionInterest implements Serializable
public String getFormatPayablePrincipal() {
if(payablePrincipal!=null){
return FormulaUtil.formatCurrencyNoUnit(payablePrincipal);
}
return null;
} | 0 |
364b22c7bd36b51d1b821d04f46013a9 | 81491e02ebbe3435df1897aabdf865a3 | Allows JS to register a log retriever that can be used by the
electron main process to retrieve current logs. | function initLogger(settingRegistry: ISettingRegistry) {
_settingRegistry = settingRegistry;
} | 0 |
cae7d468069638b2b9a8bda9619bf1ae | 5b1007cf73b5c08d8f3dd6b9fa1c0601 | Indicates whether the device has the app installed which can place phone calls | if (!this._checkPhoneConnect()) {
return;
}
return await phone.isInstalled(phone.currentPhone.id, RUNTIME_PACKAGE_NAME);
} | 1 |
e0458231809613ff212b7ca5d9f1dae2 | 4ba5ea2faff90e274cba41b869e87a74 | Метод получения значения отпуска. | public class Employee
public final int getEmpLeaveBalance() {
return empLeaveBalance;
} | 1 |
09d9dcdcc8b10b8dec46af89f237b8c6 | d98f7810b2e7e1d2de000a70f87c1b46 | Test RemoveArrayElement | {
const bool ELEMENT_DOES_NOT_EXIST = true;
const int ELEMENT_VALUE = 1;
QList<int> commonList(3U);
commonList.Add(ELEMENT_VALUE);
commonList.Add(0);
commonList.Add(0);
const QList<int>::QListIterator POSITION = commonList.GetFirst();
commonList.Remove(POSITION);
bool bElementDoesNot... | 1 |
83d434b858c809998409441538e17b49 | 1f3c386ad1a7afaa5882a9de443e4265 | Grad definition for `BitwiseAnd` operation. | shape_ = P.Shape()
masked_fill_op = P.MaskedFill()
logical_or_op = P.LogicalOr()
logical_not_op = P.LogicalNot()
logical_and_op = P.LogicalAnd()
mul_op = P.Mul()
is_nan_op = P.IsNan()
reshape_ = P.Reshape()
def bprop(x1, x2, out, dout):
x1_dtype = F.dtype(x1)
x2_dtype... | 0 |
bce4021d62ffd443c1e1efb5d9127769 | 28bee0e68886404923f08204017a745f | Stop system after `self.dur` seconds. | class SingularityContainer(ContainerBase):
def stop(self, *args, **kwargs):
self.wait() | 0 |
4c1abf10cc27935b3b37bb26974e4874 | c78d9d09f335f2da4ee511a4d3b849eb | 获取线形图数据个数 | {
$node = $this->get_data(array('form_name' => $this->_metro_line_tbl, 'where' => $where, 'select' => array('count(*) as num')), $database);
return $node[0]['num'];
} | 1 |
0e74d5ed72f40f9da5110d3eec14f034 | b81beaf099d8dd334c0d536979cee608 | Authenticated users should be able to access Team DetailView | class AccountTeamsAdminViewSet(mixins.RetrieveModelMixin,
viewsets.GenericViewSet):
def get_permissions(self):
return permissions.IsAuthenticated(), | 1 |
e15264fed0288b8237deee6e83768c94 | f0e3a212993ca36287df15e252d334a0 | Gets the expression of the token. | public abstract class Expression
public Token getToken() {
return token;
} | 0 |
d00ca8770c07c8c100f06cb25f5678ac | efa51be4c6b8189f0bf4d007a6df03cc | Verifica se il database esiste sul server | {
try {
$this->request('HEAD', sprintf('/%s', $db));
return true;
} catch (NotFoundException $exception) {
return false;
}
} | 1 |
1c26ccde2c5cf94089a39d8cc1bd8614 | 75e8e460224d84cd53cc1654efb78c4b | Fibonacci Sequence (straightforward) ## | def ex_13(): #Fibonacci - generate user defined amount of fibonacci sequence numbers.
def fib(x):
f0=0
f1=1
fibonacci=[f0,f1]
while len(fibonacci)<=x:
fibonacci.append(fibonacci[-1]+fibonacci[-2])
return fibonacci[1:x+1] | 1 |
b8ca1248d253ec2e217ab7babcc36e44 | d564cd06ac0295f31349f6c44ad88515 | Retrieve a single message from Slack | class SlackMessageSender
protected function getMessage()
{
$webhookUrl = $this->webhookUrl;
$settings = [
'username' => $this->botUsername,
'unfurl_links' => $this->unfurl
];
return (new Client($webhookUrl, $settings))->createMessage();
} | 0 |
7c4eaaeddac03c9b91bd5cd2ed63e6f7 | 38c7bbd8248fcd7106b66fe537150f0d | 由 Bean 对象格式化保存为 info 文件 | @XmlRootElement
public class Preferences
public void store() {
try {
JAXBUtil.marshalToFile(this, PREFERENCE_FILE, Preferences.class, Preference.class);
} catch (Exception e) {
log.error("保存Preferences信息出错", e);
}
} | 1 |
5bebab056bf8d74cce7834ff6f4fd0b1 | 2bd13a0c15ee7bd634b29b30decfbe6e | Get all the sprints templates stored in the database | public String allSprints(HttpServletRequest request, Authentication authentication){
request.setAttribute("sprints", sprintService.getAllSprintsByTeamID(memberService.findUserByUsername(authentication.getName()).getTeamID()));
request.setAttribute("allsprints", sprintService.getAllSprints());
... | 0 |
8cbfd5bc0880fa21112974f523e7f8a0 | 39a53b3ece6220d01335bd1054eee62f | Called when we begin parsing the GUI XML. | {
try
{
xui = new XUI(root);
} catch (XUIValidationException e)
{
throw new SAXException(e.getMessage());
}
endOfDocumentReached = true;
} | 0 |
c9b2bb24f7b0aa0696340edad7549fd9 | 30e878671a0807b0baa4aa46dc03df5a | Devuelve una lista con todos los elementos que serían visibles a un
agente | public abstract class AgentOnField implements Steppable,IStrategyMove{
public ArrayList<Int2D> perceive(){
int[][] limits = new int[2][2];
ArrayList<Int2D> allCoordsFromPerception = new ArrayList<Int2D>();
limits = determineLimits();
int lower_bound_x = limits[0][0];
int upper_bound_x = limits[0][1];
int ... | 1 |
3838f0742b58b9ea9abe3c0032cf9106 | 1281da785d857b86aa1c84c9ceffc87f | Validate and set a config key. | public function setConfig(string $name, mixed $value): self
{
$this->validateConfig($name)->config[$name] = $this->filterConfig($name, $value);
return $this;
} | 1 |
7d9dd3326d57ec97b7f1b7630c56c868 | 29ce4ce482dcab741f5edf5973707aed | check if the attribute is logical | if self.left:
left = True
else:
left = False
if self.right:
right = True
else:
right = False
return Logical(left,right) | 0 |
595dcd269845332c26ec875a1745ebe4 | f506e4d6072b06d0f8af8acd42c8dccc | Returns the sentry-trace header from the propagation context. | def _get_opentelemetry_values() -> dict:
_headers = {}
propagator.inject(_headers)
return _headers | 0 |
7e1c47a7dc2d5999c5cf05192991d6d2 | 18824336dae6b4aea4fb2f50be885b0f | IQueryable 转 Pagination - 领域实体转业务模型 | namespace Alabo.Extensions public static partial class Extensions
public static PagerList<TEntity> ToPagerList<TEntity>(this IQueryable<TEntity> source, IPager pager) {
if (source == null) {
throw new ArgumentNullException(nameof(source));
}
if (pager == null) {
... | 1 |
582da75e65682a4d66d4051741a1de91 | ad1a51ef0f3e8b3f45d99eb2bd222ba4 | plpgsql caching: Re-execute function in where clause list. Function drops and recreates AO/CO compressed table. | Datum
ts_timescaledb_invalidate_cache(PG_FUNCTION_ARGS)
{
catalog_invalidate_cache(PG_GETARG_OID(0), CMD_UPDATE);
PG_RETURN_VOID();
} | 0 |
2a9a2f019cae4ecb61f40bfbb3da06de | 7a4bd6377e55024c63ea8f2bdf2b21de | Mark all inputs unused | for socket_name, c in self.__taskobject.inputs.items():
if not c['optional']:
self.__inputs[socket_name] = {'data':None, 'enable':True}
else:
self.__inputs[socket_name] = {'data':None, 'enable':False} | 0 |
15ddf10a504d210311f94e63b9a122e7 | 88299bba838baa523eac0af3b3730ab0 | In this position no castling is possibile | fn castle_h_impossible() {
let game = Game::from_board_with_castle(
Board::empty()
.put(
Position::from("e1").unwrap(),
Piece::new(PieceType::King, Player::White),
)
.put(
Position::from("e8")... | 1 |
5a9cb3ea872112c61bd72d5e4d44d7bd | 8e8bd415c209ab65a421f5fd907d19a1 | Close any lingering old readers | for (Reader reader : readers) {
if (null != reader) {
try {
reader.close();
} catch (IOException ex) {
warn(ex);
}
}
}
} | 1 |
3ad8fcb37578825881eeff3e07f9b08f | d3619255466cd67a20a96046f80a7216 | Returns a list of key letter candidates
for a given list of popular letters. | def key_analysis(letter, alpha, popular):
id = (alpha.index(letter) - alpha.index(popular)) % len(alpha)
return alpha[id] | 0 |
3f1bb143e2423e5767fb520a4e0bf0c8 | a993006c1838ae7ec46c11c9198bb739 | Get the default Thrift server endpoint.
Finds and return the default TCP/Thrift endpoint
if it exists. This is the most common endpoint used
by services for communication, so this method
is provided as a convenience.
Returns:
ServerEndpoint object if it exists, None otherwise. | class RequestContext:
def default_endpoint(self) -> str:
return self._default_endpoint | 0 |
4e017ac82669c927a8dc5a4a150ad02b | b055093a2194d89c4a6024c1b2cb277c | 拷贝日志按钮 | ref_logger_id = self.copyLogger.currentText()
if ref_logger_id == "-":
return
temp_logger = LoggerProperties()
self.control.copy_logger_properties(ref_logger_id, temp_logger)
self._set_dialog_data(temp_logger) | 1 |
248ea0cebc0def91b06bd5aaed29fe6e | 7e7db70fd369b85969bf80c9b1d5b9d5 | Verificar codigo de recuperação de password | namespace PubliEventos.Contract.Contracts
ValidateRecoverPasswordCodeResponse ValidateRecoverPasswordCode(ValidateRecoverPasswordCodeRequest request); | 1 |
cd7d90bdd7947e36882f16c2f33803e8 | ded01fec88ae838de0dfc80313b1d281 | Create the Pac-Man object that the player will control. | Player::Player(int x, int y) {
is_alive = true;
spawn_x = x;
spawn_y = y;
pos_x = x;
pos_y = y;
current_direction = left;
pacman_left.load("/images/pacleft.png");
pacman_left.resize(ofGetWindowWidth() / 28, ofGetWindowHeight() / 30);
pacman_right.load("/images/pacright.png");
pac... | 1 |
50e02b8ec13399a0c8ea7e86f20a1084 | 69c45aba1a9acc434a5eda2c5b4d0c8a | Return the responsible surgeon index, return (n + 1) if unavailable | if self.dim < 3:
return None
return self.nCz + 1 | 0 |
f24067f88c50daaf3ff1e5a71a17003c | 3feb9c3916ed63ba9997a9ae91d0b0e2 | The amount of premium to be paid expressed as a percentage of the notional value of the transaction. A percentage of 5% would be expressed as 0.05. | class CreateSubscriptionRequest implements \JsonSerializable
public function getTaxPercentage(): ?string
{
return $this->taxPercentage;
} | 0 |
470d0dc26d68f95204fc9628906062b7 | 18d5d2d58aa560e17b64bcdc1af64e06 | Check if there are any table links. | public class CmsLinkTable
public boolean isEmpty() {
return m_linkTable.isEmpty();
} | 1 |
112995a831c761a88fd9cec429c0cb59 | c8f0682af0730bc93cffdbf44995d98d | Returns the window size in cells. | public class DynamicLinePlot
public int getWindowSize()
{
return windowSize;
} | 1 |
0beb8c225cb481e523d95b2d453561dd | 74ae87864b8b3e906233dd9859b8d5af | 服务端意外断开链接时调用 | @Component
public class MessageCallback implements MqttCallback
@Override
public void connectionLost(Throwable throwable) {
log.info("丢失了对服务端的链接");
} | 1 |
ecba55b372c8b4ebf491e4f69ff346bf | 77392addeaa3e8523b17a962f84ffd69 | Gets the descriptions
Description about term that is dependent on the languageTag. | public String getDescription(String languageId, boolean useDefault) {
return model.getDescription(languageId, useDefault);
} | 1 |
ce0054c1cd9dff5dda24cd7eefa3f428 | 694aacda89cf1fc4df923b7e7419007b | 同意充值申请 | @Controller
@SessionAttributes({ "nowuser","nowadmin"})
@RequestMapping(value = "recharge/")
public class RechargeController
@RequestMapping("setCharge.do")
@Transactional
public String recharge(int amount,HttpServletRequest request, Model model) {
User nowuser = (User) request.getSession(false).getAttr... | 0 |
b6344abd0269494787cff3ff8a053b05 | a3fad55ab11e93f5f05c03f402e9bf77 | Updates the table with prescription information of logged in patient | public final class Assignments extends JPanel implements IPatientObserver
private void fillTableMedications() {
if ((this.patient != null) && (ClientHospital.tcl != null))
try {
this.lastMedItem = null;
this.taMedicationsInfo.setText(null);
this.tblMedications.setData(
ClientHospital.tcl.getMedic... | 1 |
31c668e9665ed1113eedd26d2ebcb6ac | 3cb74433f5e3c26218c1e3d9da01ebe5 | Compensates the scaling of the parent in order to maintain circular wires
this means that only two axes need to be corrected | {
for (int i = parameters.Count - 1; i > 0; i--)
{
if (parameters[i-1].torsion != 0 || parameters[i].torsion != 0)
{
TelescopeUtils.growParentToChildHelix(parameters[i - 1], parameters[i], shrinkFit);
}
e... | 0 |
3f951acad9dec278cb4f3fbe34c8289a | 51bd9b17d6f2f457e21188065c30c9e9 | Returns a target directory name. Adds (n) to the name in case the directory
already exists. | {
int tryCounter = 0;
string currentFullName = tryFullName;
DirectoryInfo currentDi = new DirectoryInfo(currentFullName);
while (currentDi.Exists)
{
tryCounter++;
currentFullName = String.Format("{0} ({1})", tryFullName, tryCounter);
curren... | 1 |
d59aca02c955ea3744ac21bdb71b55bd | 44b6c900b7bfde812366226434e1a19d | checker to print only rows for relevant specialties | try{
String query = "";
if(specialization.equals("")) {
query = "SELECT person.name as name, staff.id as staff_id, staff.department "
+ "as specialization, person.phone_num as phone, doctor_schedule.days_available"
+ " as availability, doctor_schedule.start_time as start_time, doctor_schedule.en... | 1 |
a0e1f8f088215fe036f3de56c37cd6d7 | 88f4658d7f11fe873a852493f11ccbab | Build the 3x3 rotation matrix | {
C3DTMatrix r = matrixIdentity();
float s;
float c;
if (fabs(ax) > EPSILON)
{
C3DTMatrix m = matrixIdentity();
s = sinf(ax);
c = cosf(ax);
m.flts[5] = c;
m.flts[6] = s;
m.flts[9] = -s;
m.flts[10] = c;
matrixTransform(&r, m);
}
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.