query_id
string
corpus_id
string
query
string
code
string
label
int64
d51e957f9a9ae0ec695cb374206e2f48
66014d349b69dd43c40059f73262b92d
Remove a given member's vote from a given card
const vote = voteState.getIn(['votes', clientId]); if (vote) { return voteState.updateIn(['tally', vote], 0, tally => tally - 1) .removeIn(['votes', clientId]); } return voteState; }
1
4a5c1dfd21d86152f1906f357a6fe8f4
fb5aa8bf9968c899295e41f6f69c254b
<include file='doc\TimeSpanConverter.uex' path='docs/doc[@for="TimeSpanConverter.ConvertFrom"]/*' /> <devdoc> <para>Converts the given object to a <see cref='System.TimeSpan'/> object.</para> </devdoc>
namespace Yobisoft.Core.Time void Convert(ITimeRange range);
0
1d5e4a2d751e7ccdb02bdd32ae5f4eb1
ccd4f63f4857f3f7e0f320389f0de872
Dynamic dependency. This routine applies the suffis rules to try and find a source and a set of rules for a missing target. If found, np is made into a target with the implicit source name, and rules. Returns TRUE if np was made into a target.
static LOGICAL name_dependent_check(int expr) { int e, d; int esptr, dsptr, edtype, ddtype; LOGICAL etarget, dtarget; if (expr == 0) return FALSE; if (dep.esize == 0) { dep.esize = 20; NEW(dep.elist, int, dep.esize); } dep.eavl = 0; for (e = expr; e;) { switch (A_TYPEG(e)) { case A_I...
0
0d1cce989309bce6483d85bdcd367869
8be3a6f488431dbdd42a4c269894bc10
Checks to see if an update is currently being downloaded.
namespace WakaTime public class PythonInstaller public static bool IsDownloading() { return www != null; }
1
0109b59521e314ed5c867ba6b17e2653
bec9c8e329596b6956da5bab38ae1c76
Initialize variable operation properties panel.
public class StatementPanel extends HBox private void initLoopProperties() { statementPropertiesPanel = new LoopPropertiesPanel(); GuiManager.updatePane(this, 1, statementPropertiesPanel); }
0
cfb71c9d7f2132cb8d559eafd2105608
48e91a3fc9d60f77dfb8144b38ab3a7b
同時に検出するマーカの最大数を設定します。 関数は、少なくともi_max_number_of_marker以上のマーカを同時に検出できるようにインスタンスを設定します。 @throws NyARException
public void setMaxMarkerCount(Integer maxMarkerCount);
1
eefbf9f404d255106ade985d71bc7aaf
0ba02c3625691737c92598c20f6ff582
租车最低价
{ $suitid = Arr::get($_POST,'suitid'); $out['status'] = false; if(isset($suitid)) { $price = Model_Line_Suit_Price::getMinPrice($suitid); $out['status'] = true; $out['minprice'] = $price; } ec...
1
f379557eec580220a357cf9f3f579953
fb47e72367b07e99875d01db6fc72c6a
Frees an allocated block, and its corresponding TXs.
DWORD ptrs[_dwords_per_block_]; read_block((BYTE*) ptrs, block); int i; for (i = 0; i < _dwords_per_block_; i++) { if (ptrs[i] != NULL_BLOCK) free_block(ptrs[i]); } free_block(block); return 0; }
1
88a4aca08752a8c7a1060cad4a45759c
45523837be8cdceaa12c70771f494a39
metodo di appoggio che, dopo la morte di un tamagolem, risistema l'ordine delle pietre di quello sopravvissuto
public class RepairManager implements CudManager<Repair>, java.io.Serializable @Override public void restoreDelete(){ UserLogManager.notify(SettingName.LOGINFO, "Ripristinata rimozione di " + this.prevRepair.getState()); repairs.add(this.prevRepair.getState()); }
0
44e2a7b6b0362216529a868db8b67797
f55f9b3710b0f5d92903c5d6118b4083
Create our audit fields as shadow properties
class Helper getAuditProperties(username, isExisting = false) { const now = new Date(); return { ...(!isExisting ? { createdBy: username, createdAt: now, } : {}), updatedBy: username, updatedAt: now, }; }
1
b4631129b44e443ffed4828e9d4887e1
b2fd66f23469048e1f9cca6f440ac2af
判断某个URL的下载的某个线程是否在数据库中存在
List<DownloadThreadInfo> threadLists = new ArrayList<>(); SQLiteDatabase db = null; try { db = mDBHelper.getWritableDatabase(); Cursor cursor = db.rawQuery("select * from threadinfo where url = ?", new String[]{url}); while (cursor.moveToNext()) { ...
1
df71a7d44c1d8b83196479ed01794fed
4fb867c5e039e060e15cf998c40d2fba
use regular expression to check for a valid dollar amount
public class MainActivity extends AppCompatActivity public boolean validAmount(String amount){ boolean match = false; if (amount != null) { String decimalPattern = "(^(-?)(0|([1-9][0-9]*))(\\.[0-9]+)?$)"; match = Pattern.matches(decimalPattern, amount); } return m...
1
3a25840b6b0f2733ce89d555f8615bbd
8da17e9523fb5d871fc26261e9921778
Find an access token by its refresh token.
params = { "oxd_id": self.oxd_id, "refresh_token": refresh_token } if scope: params['scope'] = scope logger.debug("Sending command `get_access_token_by_refresh_token` with" " params %s", params) response = self.msgr.request...
1
c506c54a4756407225f8fbd07d97a78c
1c3735546386d2e18ab8e0603fe0cc30
验证香港居民证件
function CheckHongKongIdCard(cardNum) { if (!cardNum.match(/^[a-zA-Z][0-9]{6}[0-9aA]$/)) return false; var mul = 8, sum = (cardNum.toUpperCase().charCodeAt() - 64) * mul--; while (mul > 1) sum += parseInt(cardNum.substr(8 - mul, 1)) * mul--; var chksum = (11 - (sum % 11)).toString(16); if (chksum ==...
1
a01b953c5f3d40f045f676d9ca0e9c48
1a347efeb90046184c853f4a3abc9167
Decorador para servicios REST que comprueba si el usuario que ejecuta la petición está autenticado. Si no lo está devuelve un 403. Se implimenta ya que para los servicios REST no puede utilizarse el decorador login_required de django ya que hace una redirección a una URL determinada.
def my_login_required(f): def wrap(request, *args, **kwargs): if 'usuario' not in request.session: return redirect('usuario:usuario_acceso_denegado') return f(request, *args, **kwargs) wrap.__doc__ = f.__doc__ wrap.__name__ = f.__name__ return wrap
1
39a9ebb0167f227db7a17947c7c1b45e
9930f1058e4f0f1a8a784f0fea27f3b9
Using the names saved by #save, try to find them now. Since names can change we use Damerau-Levenshtein distance on lowercase versions of all strings.
init(); String last18 = "EBEORIETEMETHHPITI"; String last18sorted = sortString(last18); Set<String> seen = new HashSet<String>(); while (true) { List<Name> list = buildName(16, Integer.MAX_VALUE); String name = ""; for (Name n : list) name += n.name; String sorted = sortString(name); int d...
0
d4ef65b7dd81a2fa032090f74690b17e
32f473a37ebb70176e94731da786aacb
合同签约数排行榜
class SalesModel extends Model public static function countContract($where) { $id=session('USERINFO.id'); $role_id = session('USERINFO.role_id'); if($role_id == 9){ }else{ $where['j.parent_id'] = array('eq',$id); } $where['s.is_default'] = 1; $wher...
1
89b8189001649e22faf139df9565eb79
cdf791f2af3517d050661e8319bc6fe9
Function decorator for every telegram command issued by user.
def decorator(func: CommandHandler) -> CommandHandler: self._check_args(func) self.paths.append((path, func)) self.bot.dispatcher.add_handler(StdCommandHandler( command=path, callback=self._decorate(path, func), )) return func r...
1
9948c8f93a79a1f9d591e23de99c937b
a23f7e1372a6842c09fd09df55ef6591
Sets the telemetry context.
{ this.telemetryClient = new TelemetryClient(configuration); this.telemetryClient.Context.GetInternalContext().SdkVersion = SdkVersionUtils.GetSdkVersion("web:"); if (configuration != null && configuration.TelemetryChannel != null) { this.telemetry...
1
5fa5bd89683128ef0a3c21e50c4aad61
7694c2e4924425f03555b5c0ef4b85dd
The account authentication type. The possible values are `internal` and `saml`.
class ServiceArgs: def auth_type(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "auth_type")
1
a76d50e74a4036e120ecce9d109bf09c
bec54a1acc75c62ad10c0068c9744cb6
Extracts the grid weights for an unevenly spaced grid based off of the algorithm outlined by Fronberger in https://pdfs.semanticscholar.org/8bf5/912bde884f6bd4cfb4991ba3d077cace94c0.pdf
class WeightsNeighbors(Interp): def __init__(self, name , rays_obj): super(WeightsNeighbors, self).__init__(name, rays_obj) self.nsteps = sp.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 0, 1], [0, 1, 1]]) self.nsteps_flipped = sp.array([[1, 1, 0], [0, 1...
0
242ce1f43757f0a59c6e0768d852b14b
b22a85e5b6395293540f556ee4f99885
获取私有成员的方法。
public class AccuracyHelper protected static Object getPrivateField(Object instance, String name) { Object obj = null; try { Field field = instance.getClass().getDeclaredField(name); field.setAccessible(true); obj = field.get(instance); } catch (NoSuchFieldExc...
1
a99a017e848cf61b0e58e97c52369f43
b5b0a206681cae428e84b97cda5329df
Converts data version 8 to version 9.
function updateToV9(): Rule { return createMigrationSchematicRule(TargetVersion.V9, [], cdkUpgradeData, onMigrationComplete); }
1
4563dbbf5b7eb34fea18e33165dece6e
ec9e1d7da83ff5a75ffea2c4023ab3f9
a以上の最小のbの倍数
int B(int a,int b){ return a*b/A(a,b); }
0
239df1141699a9b4dfcf0e69f0aebdaa
1319a60958ef5ceed44aafb5f635ccf0
备份按钮单击事件---执行备份
if (!confirm("你确定备份数据吗?")){ return; } $.ajax({ type: "POST", async: false, cache: false, url: ctx+"/databaseBackup!backUp.do?1=1", success : function(returnData){ var data = returnData.split(","); var flag = data[0]; if(flag == 'true'){ alert('数据备份成功!\r 备份文件的位置:\r'+data[1]); ...
1
8afc738834d608d39262a922aa613648
74848630b5787e40b8312b21f85ddb2d
https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=4767965 http://nghiaho.com/?page_id=671
n = len(bits) l = [2*int(v)-1 for v in list(bits)] fl = np.fft.fft(np.array(l)) fla = abs(fl)[0:(n//2)] T = math.sqrt(2.995732274*n) N0 = 0.95 * n / 2 N1 = len([v for v in fla if v < T]) V = (N1 - N0)/math.sqrt((n*0.95*0.05)/4) p_value = math.erfc(abs(V)/math.sqrt(2)) return [n,...
1
6636558c71ec564da4eba2d642e32893
9d4fe2faaf749c0462d2fe74280f8ee8
Specifies the buffer list to use with this session. Needs a valid buffer list - aftwards imgSessionAcquire can be called.
{ if (pbuffer == NULL) return (false); pbuffer->layer = layer; return (true); }
0
e0b2c05d32a356682bd8cea833423fdb
30f93c154c248b00f17b2dfcf20d576d
Aquest procediment s'encarrega de actualitzar l'hora del joc, obtenint la hora real de la informació pròpia de l'ordinador. l'ordinador.
public class CardioVascularTecnicas extends Activity implements OnCheckedChangeListener, OnClickListener, android.widget.RadioGroup.OnCheckedChangeListener{ private void mostrarHoraActual() { Date d = new Date(); horas = d.getHours(); minutos = d.getMinutes(); }
1
e7ed0c53cbe1db84cef945bad95b3d31
19169de25e3a5c85e880ba2dc7daa4a2
Returns predicted class with probability. Format: (class, probability)
class Predict: def make_prediction(self, np_img): x = np.expand_dims(np_img, axis=0) preds = self.my_model.predict(x) idx = np.argsort(preds)[0][-3:][::-1] percent = preds[0][idx]*100 out = [self.label_names[i] for i in idx] return list(zip(out,percent))
1
ae8fbacc76384ceda5270e5a49987b14
fd5ab1df4a02df98b1d7f72457169455
Проверяет является ли переменная строкой
class Data: def isVarTypeStrL(var): ovar = _get_var_index_single(var) return _stp._st_isvartypestrl(ovar)
1
fd71d08810bbcb82fe1970d4b12359d4
5aee6af4f2661e994391d4bfca9edeaa
Check if given number is a semi prime. A semi prime is product of two (may or may not be distinct) prime numbers
factors = [] factorsum = 0 for i in range(math.floor(number / 2)): if number % (i + 1) == 0: factors.append(i + 1) for l in range(len(factors)): factorsum += factors[l] if factorsum == 1: return True else: return False
0
e2d026c6e4481cb09066a8201071975b
7bdb4c45772fa01e4be51bd76bea429c
向后台发送导入xls 文件请求
context = {} if request.method == 'POST': file_type = request.POST.get('file_type') file_obj = request.FILES.get('file_obj') file_name = "upload/" + datetime.now().strftime('%Y-%m-%d') + '.xlsx' with open(file_name, 'wb+') as f: for chunk in file_obj.chunks(): ...
1
c476f4362bbdd05e7bfbb6a790f6e0e4
36a9359a589c3861abd56920ccd0def9
https://stackoverflow.com/a/51993539
def _get_terminal_size_windows() -> Tuple[int, int]: try: import struct from ctypes import windll, create_string_buffer h = windll.kernel32.GetStdHandle(-12) csbi = create_string_buffer(22) res = windll.kernel32.GetConsoleScreenBufferInfo(h, csbi) if res: ...
1
b52d4f14cf9e30be1c2c0d173a6915c5
b7b06fe922003269b246f1aa047b8217
启动WebService(服务端)服务,提供外部调用
namespace ConsoleApp1 public class Program public static void Main(string[] args) { TestWebService(); Console.ReadLine(); }
0
2882ca8ca98426af53fdbd945178b71d
64fbcab9a666dab254d321ad9fce6b78
修改土壤肥力分级信息
DbOperation dbOp = new DbOperation(4); String query = SqlUtil.modifySql(add, "farm_crop set name=?,rank=?,grow_time=?,rot_time=?,product=?,act_interval=?,product_count=?,pro_id=?", bean.getId()); if (!dbOp.prepareStatement(query)) { dbOp.release(); return false; } PreparedStatement pstmt = dbOp.get...
0
6c456d385f83325f815c99c9c4ee8623
b73e84bb353b15282bd58be16674f589
Set the helicopter's dispose status. In case {@code b} is true, try to remove the helicopter from the pool permanently, and if it is occupied, mark it for removal. In case {@code b} is false, the method should prevent the helicopter from being removed if it has not been already removed.
public void disposeHelicopter(Helicopter helicopter, boolean b);
1
aae0d0d20bf838c3933f945ee9f365ff
e582af1a22d5b7b0ecf1aabc8d3bffb9
Adds an ingredient requested by the recipe fragment.
EditText ed_name = (EditText) findViewById(R.id.edit_add_what); EditText ed_val = (EditText) findViewById(R.id.Ing_ammount); String name = ed_name.getText().toString(); String val = ed_val.getText().toString(); ingredient new_ing = new ingredient(name, val); this.ing_list...
1
93f6214918553ed93653714c8596f00a
a67d658b2592660500eeb6b40ed14241
Convert a user entered amount into how it should be stored in the database. For example, a user may enter '9.75'. This will be converted into '97500'. This gives us a stock market level of accuracy. 0.01 = 100
class Game(SteamAPI): def _calc_price(self, amount)->float: return float(amount) / 100.0
0
55ef1e975ac540187e69b6fcb676b2a6
6e09915141b37898128699bc8bf0cffc
returns the age of the PR in days
let ndays = self.date.num_days_from_ce() as i64; let nseconds = self.time.num_seconds_from_midnight() as i64; (ndays - 719163) * 86400 + nseconds }
0
ea23601632bd40f6e65645fa02264584
6c45cece659d89a8db7b0a39dcdbb268
## Funktion zum Formatieren Qualität ----
x <- NA if (thou==TRUE) { x <- ifelse(is.na(best) | is.na(lo) | is.na(hi) , NA, paste0("(", frmt(lo, thou=TRUE), "–", frmt(hi, thou=TRUE), ")")) } if (thou==TRUE & thouEst==TRUE) { x <- ifelse(is.na(best) | is.na(lo) | is.na(hi) , NA, paste0("(", frmt(lo, thou=TRUE, thouEst=TRUE), "–", frmt(hi, thou=TRU...
0
1ea5f62e36bbc9ed0d817b79f65d6d24
62165c12cd694db9c0ed9a2414999354
自身の単位を度へ変換する
public class CustomUnit public double toBase(final double unitValue) { return unitValue * factor; }
0
a3e4ba6eeeff570dea7acd552011b915
fc1260603bca36ed8d53b8e5a98526b0
Only implemented as a private method in order to stop it being used!
{ BOOST_MESSAGE("It is not necessary to test this method since it is just a getter"); }
0
8e613c1a5987ee51cb5fc9145f8d74e0
3f97f4d437272f6e21ad4f66ffedead9
Compute model gradients w.r.t. inputs.
for idx, layer in enumerate(self._layers): if idx == 0: free_in = inp clamp_in = inp else: free_in = free_states[idx - 1] clamp_in = clamp_states[idx - 1] free_out = free_states[idx] clamp_out = clamp...
1
0fe04cc725235daa113617271f2ea55a
114bc0f1ad86af8b07046ea23d6058b5
List of allowed key lengths for the currently chosen algorithm.
class TestPublicKeyEncryption public static Collection<Integer> keyLengths() { return Arrays.asList(40, 128, 256); }
1
d886eeb6e30fbbf2a387e43f36ae7628
989fcf7d488993ab043c22e120618015
Handler for MoneyEvent. Add money to manager.
public class GameManager : MonoBehaviour public void AddMoney(BigInteger money) { _currentMoney += money; Helper.GetGUIManager().SetMoneyInfo(_currentMoney); }
1
bd89fe2bb5d1fd482f28bf9d1731453b
171ce4c5982349506974300a118ac709
determine whether the character is a vowel, consonant or neither
bool isVowel(char ch) { if (ch == 'a') return true; if (ch == 'e') return true; if (ch == 'i') return true; if (ch == 'o') return true; if (ch == 'u') return true; return false; }
0
f5f950c35b07e17bab37029e6fbe9f19
e931925f024b956bf57b689e070fca40
生成されたテンプレートをディレクトリごと削除する
final class TemplatePod private function clean(string $dir): void { if (!is_dir($dir)) { return; } $handle = opendir($dir); while ($entry = readdir($handle)) { if ($entry === '.' || $entry === '..') { continue; } $path =...
1
3b52caffbb13dbc3f352a2c24e18d343
ea61410ecd9633170ed5d938840b94f9
Returns the language (de_CH => de)
class ComponentContainer extends Container public function getLanguage() { return substr_replace($this->getLocale(), '', 2); }
1
fee2d0912bf023d2af689aa3665cf38f
419c49c25734452f7d0a14234d7cda5e
嘚啵币商城列表(包括自己卖出的列表)
{ $uid = userid(); if (!$uid) { return redirect('/#login'); } $CoinList = Db::name('Coin')->where(['status' => 1,'name'=>['in',config('coin_on')]])->paginate([10,false,[]]); $page = $CoinList->render(); $UserCoin = Db::name('UserCoin')->where(['userid' => ...
0
ccd4a867ffa9c17f488c37696212df29
a2efda6224b824113a7ad158493234bb
An iterator for an array stack.
def __init__(self, vec2d): self.stack = [iter(vec2d)] self.next_ele = None self.next()
1
f88683b539a73a9df82da66ba8f44248
d2c1ef09b9cdda284c675d8ac57a017b
添加计时回调项目
public class YZJTimer public int AddTimeTask(Action callback, double delay, PETimeUnit timeUnit = PETimeUnit.Millisecond, int count = 1) { if (timeUnit != PETimeUnit.Millisecond) { switch (timeUnit) { case PETimeUnit.Second: delay = delay *...
1
e3f7e121ef0526ce70f4bf05e1994383
707de4ca1f7ae839efce4f017ab213f0
Principal function in the program
int main(void){
1
a56d56a88917148f6e5306545c565b53
078a11c823489c5d2075e98001c1dd8f
统计指定站点的文章
{ $request = $this->getLimit(); $node_id = $this->getSiteSession('login_site'); $where = []; $where["node_id"] = $node_id["node_id"]; $where["site_id"] = $this->getSiteSession('website')["id"]; $data = (new \app\admin\model\Article())->getArticle($request["limit"], $r...
0
3462a42b8de0b6e3cac25e2560c5a00c
32214e6726a7bd80cb6a5d874a2ee1da
Compares two given values with given comparison sign
class Processor extends Session public function compareValues($valueA, $valueB, $position = null) { if($position === null) $position = $this->currentPosition; $result = $this->getInstruction($postion)->compare($valueA, $valueB); $this->currentPosition = $position + 1; if($this->currentPosition >= count(...
0
ce452c90addd684a9aac5e9c91fb0edd
00bb317afca674f49976c0797fc2f0bd
A focus change event event handler. This is an example that only logs a message.
namespace MRTK_HKSample public class EyeTrackingBaseEyeFocusHandlerSample : BaseEyeFocusHandler protected override void OnEyeFocusStay() { debugLabel.text = "OnEyeFocusStay"; }
1
60912900fbc724e1f79b19f6555f1f68
35349376f27b30ba8db95776d1c85c45
If the selected element's index value has changed, commit the change in the UI
namespace CAS.UI.UIControls.Auxiliary.DataGridViewElements class DataGridViewLookupEditingControl: LookupCombobox, IDataGridViewEditingControl protected override void InvokeSelectedIndexChanged() { _valueChanged = true; EditingControlDataGridView.NotifyCurrentCellDirty(true); ...
1
a011ac10d8b87096afc62b2ffb48c6de
67cdf24c9c3f911f587e2cde20c6d23d
Проверка, что заданное слово - сокращение для метров
$expected_first_letter = mb_strtolower(mb_substr(trim($_SESSION['word']), -1)) == 'ь' ? mb_strtolower(mb_substr(trim($_SESSION['word']), -2, 1)) : mb_strtolower(mb_substr(trim($_SESSION['word']), -1)); $first_letter = mb_strtolower(mb_substr(trim($this->word), 0, 1)); if(strcmp($firs...
0
4e005ceca378ec54d45da4baebb685c3
23b7cdd4a280e285b35b1e22c198d0ac
ensure we don't accidentally use the same command twice
void MacroCommand::append(CommandPtr cmd) { if (cmd.get() == this) { return; } commands.push_back(cmd); return; }
1
04b3d5f09dc5290c30d6189c718604dc
2a6601c0f10c3dabbb1dab8d63e8aa9a
通过 name 获取表单值,传入 name 或 name 数组,返回一组值,不传入返回全部值
{ $res = \app\admin\model\system\SystemConfig::getValuesByFormNames($formNames); $data = []; foreach ($res as $k=>$v) $data[$v['form_name']] = $v['value']; return $data; }
1
b1f44e064aa70701576cd109dd4c18b0
2afab38ee2a419f20ce03fb1531f1f80
Waits for a signal from another thread, aborting if the operation is cancelled
int x, e, rc = 0; unassert(ctid != &__get_tls()->tib_tid); if (!(rc = pthread_testcancel_np())) { BEGIN_CANCELLATION_POINT; while ((x = atomic_load_explicit(ctid, memory_order_acquire))) { e = nsync_futex_wait_(ctid, x, !IsWindows(), abstime); if (e == -ECANCELED) { rc = ECANCELED; ...
1
db068c3b5e0770a0918b1b08b67bb5aa
39d4abb6eff1904bcfe02d39b43753dc
Retrieve all teamrooms accessible to the authenticated user
namespace Altinn.Studio.Designer.Services.Implementation public class GiteaAPIWrapper : IGitea public async Task<List<Team>> GetTeams() { List<Team> teams = new(); string url = "user/teams"; HttpResponseMessage response = await _httpClient.GetAsync(url); if (r...
1
7d2c84173ca1e14417538afb87b740b9
fc4627f47d27ad790e8551b5035099d1
Set up the $_SERVER superglobal to contain all elements required by the DAV class
class ServerTest extends \PHPUnit_Framework_TestCase protected function setUp() { parent::setUp(); $this->sBackUp = $_SERVER; }
0
a0cc389347c8693cdfb0a74254c5f76e
779595a8ae199e90bcb0e36e2e1bd6d5
获取系统时间戳(东八区)
func GetTimeS() int64 { timeZone, _ := time.LoadLocation(ServerInfo["timezone"]) return time.Now().In(timeZone).Unix() }
1
d83f75f01c67dca46bac560c6c7faf57
453c5cb9f5ca7dfe9f6aa02f061445a0
查询用户当前投标任务所含权限
String businessType) throws LogicException, SystemException { Map<String,Object> resultMap = new HashMap<>(); try{ HTPowerBean paramBean = new HTPowerBean(); paramBean.setModuleBelong(businessType); HTTende...
1
83590c51fed80f2ca0292e749654c730
8d7032734ba83015d87424c2c96ce749
从虚拟路径中创建缓存标记
namespace Ivony.Html.Web public static class HtmlServices public static CacheDependency CreateCacheDependency( string virtualPath ) { return CreateCacheDependency( HostingEnvironment.VirtualPathProvider, virtualPath ); }
1
d31aa1b26cc95a5ed6811ebf9a30d64c
7fc90f1c0c0dd81f67923dbaa997d39c
Generate products recursively given the number of bonds that should be broken and formed, a set for storing the products, a sequence of atoms, of bonds, and of valences. `bond_can_form` should contain a tuple of tuples of bonds that contains all possibilities for forming bonds. Nothing is returned, but formed products ...
brutto = ['', ] molecular_mass = float(mol_mass_entry.get().replace(',', '.')) if unit_var.get(): threshold = molecular_mass / 1000000 * float(threshold_entry.get().replace(',', '.')) else: threshold = float(thresh...
0
fdbdfa1bd8a63e4360b06b76ecffd6c3
98018fd2db7f47e747a306df36f5fe08
关闭没有权限提示框
var html1 = "<div class='fq-contain-dv'>"; html1 += "<div class='imgs'>"; html1 += "<img src='images/withoutPower.png' alt=\"\">"; html1 += "<p>抱歉,您暂时没有相关权限,请联系管理员!</p>"; html1 += "</div>" html1 += "</div>"; $(".fq-contain-in").html(html1); $(".fq-contain-dv").show(); }
0
c0fd3b02822f4bd07c6ce91a2367b9cb
89a2cc9cb7a51c20da734c53d8723d83
Construct a graph-style visualization of the phase diagram.
class PhaseDiagram(Base): def __init__(self, element): self.element = element self.fig = None
0
d539857ab4005f6dc883e0dc68e88ab8
96ea59cef2d888e1cb3ecc43c95d8d86
Remove order data by order identifier.
public function deleteAllByOrderId($id);
1
e68543bd7c1917bdc8166d3941409561
eb32644519ca373bd8e3700f6a532a00
Function for computing average F1 metric
if prec + rec == 0: f_m = 0 else: f_m = float(2 * prec * rec) / (prec + rec) return f_m
1
e031314cd6ffd98257e783ce477a92a8
3c0940f912c0b18ef39cb9ae29885962
Makes the subprocess checkbox enabled.
public class SinceDOP extends JPanel @Override public void stateChanged(ChangeEvent e) { checkButton.setEnabled(true); }
1
18700b0804595b39b2f5d0abdc1caf6e
0653a1384061424b0f21731194d7fb32
获取系统进程使用状态
public class MonitorUtil public static int systemProcess() { Process process = null; int progressNumber = 0; try { process = Runtime.getRuntime().exec("tasklist"); BufferedReader br = new BufferedReader( new InputStreamReader(process.getInputStream(), ...
0
3eca737176ac8807a9a775638ccb457e
8a00022e44eb4abb51977672a61c0e36
Convert GMT to local time
namespace Student public partial class OperaForm : Form private DateTime GMT2Local(string gmt) { DateTime dt = DateTime.MinValue; try { string pattern = ""; if (gmt.IndexOf("+0") != -1) { gmt = gmt.Replac...
1
c9427cc8b0d3864046010fa77f377dcb
f0ed337aad28085f053be318cfdfdbc9
Check if a folder exists - used to remove contents as required
func FolderExists(folderpath string) bool { _, err := os.Stat(folderpath) return !os.IsNotExist(err) }
1
662a5f94018d69044d2b2f7f705eea25
0f7430a28e665adfc7c572ae4b77ed1b
only add if a customer with same id doesn't exist.
public class Bank public boolean createCustomer(int id){ if(customers.size() != 0){ boolean customerExists = false; for(int i = 0; i < customers.size(); i++){ if(customers.get(i).getID() == id){ customerExists = true; } } if(!customerExists){ Customer c = new Customer("", id, ""); boo...
1
8bc9feea74e05cd2026f78c801578cf6
90e7931861189a031823fd0004a11762
Get user_name value. Notes: The name of the user associated with the license This attribute is named `userName` in VSD API.
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "ldapConfigurationSpecDataObj", propOrder = { "anonymousBind", "baseDN", "bindName", "bindPassword", "displayName", "groupFilter", "groupFullName", "groupMember", "groupName", "groupObjectClass", "groupSearchBase", "pr...
1
3c9962471cb61099178f5a1735283704
7fc3ff521f5a28f3dadae669245f217c
Swaps the values of two Cells. Difference with [`std::mem::swap`] is that this function doesn't require `&mut` reference.
if std::ptr::eq(self, other) { return; } unsafe { std::ptr::swap(self.value.get(), other.value.get()); } }
1
680e218f2344830fd8ba5552663d52a4
812a7932594d7b87c2d4f0dfba053b90
Bu fonksyon şehir tablosundaki bulunan tüm şehirleri listeler
function getCity() { global $con; $city_query = "SELECT * FROM city"; $exec_city_query = mysqli_query($con, $city_query); while ($row = mysqli_fetch_array($exec_city_query)) { $city_id = $row['city_id']; $city_name = $row['city_name']; echo " <a href='result2.php?city_id_...
1
833e1e9ef81c1e045164a136ad69fdb3
232b6f86a4cc1c8c034b3a5660ea9c73
Method shows whether the figures are on the same diagonal
{ bool result = false; if (element1.x == element2.x && Math.Abs(element1.y - element2.y) == 1) result = true; else if (element1.y == element2.y && Math.Abs(element1.x - element2.x) == 1) result = true; return result; }
0
55906da02dbc203c8e91a494ea235ee7
e71dafc46b3733679fefa54e08699414
array为待排序的数组,n为数组大小,
void BubbleSort(int a[],int n){ int i,j; for(i=0;i<n;i++) for(j=0;j<n-1-i;j++) if(a[j+1]<a[j]) swap(a,j+1,j); }
1
d68d4377035c01ff4eb8d0988dbaf697
1cfd183ecdeba7fb836574a90dc598d0
r"""Dequeues a tuple of one or more tensors from the given queue. This operation has k outputs, where k is the number of components in the tuples stored in the given queue, and output i is the ith component of the dequeued tuple. N.B. If the queue is empty, this operation will block until an element has been dequeued (...
namespace TensorFlow public abstract class QueueBase public abstract TFOutput [] Dequeue (long? timeout_ms = null, string operationName = null);
1
07e72b34fcab30a9ee61672229eacc93
20856994ea2a2b25a54cbbd15c64ceab
Активен ли статус "премиум".
foreach ($this->price as $price) { if ($premiality === (bool)$price->is_premium) { return true; } } return false; }
1
9e12a9d3ec4a312b44ad8749dc27d62c
e45b92dee23a0aa5a63527083350be3c
@brief Push biases to the accel bias 6500 registers. This function expects biases relative to the current sensor output, and these biases will be added to the factory-supplied values. Bias inputs are LSB in +-16G format.
class CHR6dmIMU(object): def set_accel_bias(self, accel_x_bias, accel_y_bias, accel_z_bias): data = struct.pack('>hhh', accel_z_bias, accel_y_bias, accel_x_bias) self.write_to_imu(SET_ACCEL_BIAS, map(ord, data))
1
88e1de25f8e236a47009b32f17c8421e
94f159253995f747a3eb492abfc5e5e1
Méthode permettant de convertir un objet valeur en entité.
T toEntity();
1
f6896d11c2b4f48832d2deab683f7aa7
2309c283c071a394a741afcdb4cd7321
Retrieve a list with received dtmfs
@dts = "" parent.managed_repository do @dts= Voeis::DataStream.all end respond_to do |format| format_response(@dts, format) end end
0
68b5ecbe56bd74b59ec496124822f0a6
9470f841a9b40f2380081465b3d5193c
Визначає точний час
let time = document.querySelector('h2') let hourHandRotate = new Date().getHours() * 30 + new Date().getMinutes() / 60 * 30 let minuteHandRotate = new Date().getMinutes() * 6 let secondHandRotate = new Date().getSeconds() * 6 time.innerHTML = new Date().getCustomFullTime() document.querySelector('.clock__ho...
1
ff1f0ce20aa3b68beb88321771ef8be8
6209ed0272b31434e8d03f34576b6cbc
use this method to click on Create a Car button
public class PageFactoryCars public void clickSearch() { searchButton.click(); }
0
ec8356f2fe7c5462b2cab3c1fe616c22
d2bf1d0738e70d331472ece5a15c97b7
Get the ID of the suggested item based on total bytes and threshold.
public abstract class DictionaryBase<V> implements Dictionary<V>, ManageableDictionary protected abstract byte[] getIdInternal(V value, boolean p) throws StorageLayerException;
0
a5ec8c04137d1efc89c570e9c11fd39c
22664e48382705cb7e0a72d2a437c75b
지하철 데이터를 받아오는 메서드
String inputScooterList = null; try { Thread.sleep(100); outputStream.writeUTF("Scooter findScooterList"); inputScooterList = inputStream.readUTF(); if (inputScooterList.equals("-1")) { throw new IOException(); } } catch (IOException e) { e.printStackTrace(); new Alert(Alert.AlertType.INF...
0
a2eb92e51279981e2b6a02c2065ab903
ceac736b1c2143751921ddbb06ab1424
将buffer中的网络字节顺序的值转换为主机字节顺序表示的16位有符号整数
{ uint n = (uint)buffer[0]; n |= (uint)buffer[1] << 8; n |= (uint)buffer[2] << 16; n |= (uint)buffer[3] << 24; return n; }
0
f805402aad7310dee25f9c3f5707efb9
d5cf6fd97e1de1884acbc60873e0f262
#################### implementation of function to check changes on the working folder
def check_if_files_changed(projects, folder_path): hash_file = pd.read_csv('hashFile.csv') project_hash = [] for project in projects: hash_temp = check_folder_hash(project, folder_path) project_hash.append(str(hash_temp)) if (project_hash == list(hash_file['hash'])): print ('Files have NOT changed.') ret...
1
9925bd55adff7ed44f71ff89a7b9ef7f
e72d98f51dd42cd9256e32859748f905
Prompts the user for coordinates of the piece they'd like to move and where they'd like to move it to.
puts "Where would you like to move? (row, col)" move = gets.chomp return [move[0].to_i, move[3].to_i] end
0
17f39d31bbea00d3c1132d5303479feb
3f764cb16b2108a13714991f41fcab91
Simulates a short press on the Recent Apps button. # noqa: E501 Simulates a short press on the Recent Apps button. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True
interface TUiautomatorKeys suspend fun recent(): TUiautomatorResult<Boolean>
0
a9dfe09963955662a61c16e447e34c17
79cf68f08529e9a242e776a5798d8a1c
将功放设置为环绕立体声
public class TvAudioManager extends IEventClient.Stub public boolean setAudioSurroundMode(int surroundMode) { Log.d(TAG, "setSurroundMode(), paras surroundMode = " + surroundMode); try { return mService.setSurroundMode(surroundMode); } catch (RemoteException e) { e.printS...
1
048a16963020421581576ad51a58b0c4
5620b9929f779f41968f113d4802afd2
Reset the allow late submission checkbox
function Caldera_Forms_Field_Config( configs, $form, $, state ){ function allowAdvance(){ $submits.prop( 'disabled',false).attr( 'aria-disabled', false ); }
0
c76a1daad00505a2094b4477e8bd1db8
2266449f82b44a97ae676f8e8a828bcb
Modify the tempo and pitch of the track at the same time.
void doubleTempo();
0
c0cf1c2bcaa64dd6cebac79957bb2a40
fff7e5258d1bd814e195bd78c6fe75ff
scriptファイルが存在するかチェック。なければ作る。失敗したらfalseを返す。
val dir = File(context.filesDir, SCRIPT_FILE_PATH) if (!dir.exists()) { dir.mkdirs() } }
0
95147d60caa424c589bcea4abedb8da2
6f940dac59897c3a6873e7cb00ae8eb0
插入新向导锦囊
function insertGuides( inDom, inGuides) { var hGuides = inGuides.hGuides, vGuides = inGuides.vGuides; for (var i = 0, len = hGuides.length; i < len; i++) { inDom.addGuide(hGuides[i], "horizontal"); } for (var i = 0, len = vGuides.length; i < le...
0
9fc16b158e96b490e838855d464aeee3
9bf29340953c01fa11a0e8893c8109ea
adds an object to the list for saving/loading. An object cannot be put into the list twice.
{ auto iter = std::find(m_object.begin(), m_object.end(), obj); if (iter == m_object.end()) { m_object.push_back(obj); } }
1
c70bb74a2f59261ea2df1159d6d49005
38b03f2a75abd5099d08e6282db1359c
Get Today's Current Weather Data - by Zip Code (via asynchronous Internet API call) https://openweathermap.org
namespace WiredPrairieUS.NestAPI public class Nest public dynamic GetCurrentWeather(string postalCode) { return GetCurrentWeather(WeatherUrl, postalCode); }
0