query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ce70e687956b10c5e9d1e823ea64c7e1 | b4426e05090413acf10f4ddc2a17dce0 | /**
* Writes the map and all manually added files to the specified directory.
*/ | {
if (m_modulesFinished == 0)
throw new InvalidOperationException("No modules were successfully finished, nothing to write out.");
var result = new List<string>();
Directory.CreateDirectory(directoryPath);
foreach (var file in Files)
{
... | 1 |
5ab62b5a551b6c805332d75cfe16bf0c | 3337058345437f1e2afac67338ac37f0 | Функция удаляет все лишние пробелы | function clean($what) {
$what = preg_replace('!\s+!', ' ', $what);
$what = trim($what);
return $what;
} | 1 |
086730ee8da102726d954c2b0820ec63 | 8c54694b4646f8bb2952abe7a7d4336c | Getter del nombre del cliente que se clickeo en la tabla por ultima vez | last_sale_id = sales.get_item_id_sold_last()
last_buyer_id = sales.get_customer_id_by_sale_id(last_sale_id)
last_buyer_name = crm.get_name_by_id(last_buyer_id)
return last_buyer_name | 1 |
be0375be503da535b8cb3dad91b898dd | acb48541d178048e08aae315f690cbdc | Returns true if an algo of this type may be contained into the type of algo container passed as parameter | public abstract class MTType
public boolean isKnownToContainOnlyMTypes() {
return false;
} | 0 |
648e475e9351551b441e5169fb79785b | ae6a517f618bb8bd63a7c90ad1f91d0a | Set a delegate to be run when the Trim state variable changes. | public class TrimmedQuadrupole extends Quadrupole
public void setTrimCurrent(final double newCurrent) throws ConnectionException, PutException {
getTrimSupply().setCurrent(newCurrent);
} | 0 |
32de1b6fe395578583206094eadb7981 | e33c098e8f9421e187455aea8839b4ed | Set 存储方式,0-常规存储,1-归档存储,默认为0 | @Table(name = "arc_family_criminal")
public class ArcFamilyCriminal
public void setArchiveType(Integer archiveType) {
this.archiveType = archiveType;
} | 1 |
c5564177640fcbeb7536571f1eba44e6 | 6bde272142d507a3c1dc7f7c3c0d006b | Returns the last buy sell products in the ordered set where title LIKE ?. | public List<BuySellProducts> findByLOCATION(long location, int start,
int end, OrderByComparator<BuySellProducts> orderByComparator,
boolean retrieveFromCache) {
boolean pagination = true;
FinderPath finderPath = null;
Object[] finderArgs = null;
if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_PO... | 0 |
459aadc769a362633a8e63bc644fd9ed | 82666a8638a75f3e387451f7ed2296a9 | Check whether this folder has new messages. | st = os.stat(mailbox_file)
mailboxsize = st[stat.ST_SIZE]
readSinceLastWrite = st[stat.ST_ATIME] > st[stat.ST_MTIME]
has_new_mail = False
if mailboxsize==0:
has_new_mail = False
elif readSinceLastWrite:
has_new_mail = False
elif mailboxsize != new_mail_infos[mailbox_file]["ma... | 1 |
7362bc9bbabc7e63001a686a0481aec0 | eb1b989eace0f4852caa379c5b770557 | Đổ dữ liệu ra form | foreach ($form as $name => $filed) {
if (isset($data_arr[$name])) {
if ($filed['type'] == "select") {
$form[$name]["value"]["select"] = $data_arr[$name];
} else {
$form[$name]["value"] = $data_arr[$name];
}
... | 1 |
98617e405618328731d2c78b4cf5fe99 | 525e6dd0b097e8747f0481c0b2fe2e25 | Show S3 buckets. | s3 = boto3.client('s3')
response = s3.list_buckets()
print('Existing buckets:')
for bucket in response['Buckets']:
print(f"{bucket['Name']}") | 1 |
ef48d2b833ed5672024815eb997ef0bf | 59dbf0b3d7ea39b0d118568363246433 | -----------------------------------------------------------------------------
Purpose: We have stats data from Steam. It is authoritative, so update
our data with those results now.
----------------------------------------------------------------------------- | namespace steam
void CSteamAchievements::OnUserStatsStored(UserStatsStored_t* pCallback)
{
if (m_iAppID == pCallback->m_nGameID)
{
if (k_EResultOK == pCallback->m_eResult)
{
}
else
{
}
}
} | 0 |
4eba062ad70f1f66a17cb8a3af9451ae | 6116df6b873ac344a7d76a55c587b80d | If we are in a layout traversal, defer notification
by posting. This ensures that the view tree is
in a consistent state and is able to accomodate
new layout or invalidate requests. | mViewFlags |= FLAG_LAYOUT_REQUESTED;
mLastHeightSpec = -1;
mLastWidthSpec = -1;
if (mParent != null) {
mParent.requestLayout();
} else {
GLRoot root = getGLRoot();
if (root != null) root.requestLayoutContentPane();
}
} | 0 |
a043c94aa67b39922991ac278f1566e4 | 95f643da697efc75a535444ed1ad85eb | 如果是Model类直接返回 | public boolean modelGetterMethodGenerated(Method method, TopLevelClass topLevelClass, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, ModelClassType modelClassType) {
return false;
} | 0 |
ecfe2ce3379e5bc87fb16c4aea27d8f5 | 227d04fbc38fc021c86e88dee9bee318 | Tab페이지별 엑셀Sheet 추가 | IBS_InitSheet(sheet,initSheet);
var sheetid = sheet.id;
var idx_div = document.createElement("div");
idx_div.id = sheetid+"_index_div";
idx_div.style.backGroundColor="#FF0000";
idx_div.style.width = "100%";
idx_div.style.height = "24px";
var input_current = document.createElement("input");
input_current... | 0 |
b29d3c45f191790495ad919e930fc971 | 07cbffe6f54162177f9a3ee00cd62987 | Exit a parse tree produced by {@link CypherParser#oC_NotExpression}.
@param ctx the parse tree | public class GrummBaseListener implements GrummListener
@Override public void exitNot(@NotNull GrummParser.NotContext ctx) { } | 0 |
24226505eceb30149ac67f48ade009f4 | 6fb5c31ba22eae25c5d168959f7e22bf | 根据cid查找cname | for (var i in responseData.data) {
if (id == responseData.data[i].id) {
return responseData.data[i].cname;
}
}
} | 0 |
dd754ad4768d7d2ffe5cd2b4149d5800 | 527743d1dbdb25e2ddb9e731152f3fa2 | 문자열로 입력받은 숫자가 주어진 진법으로 표현이 가능한 숫자인지를 판별한다. | function is_n_num($str, $n){
if($n == '2'){
return is_bin($str);
}else if($n == '8'){
return is_octal($str);
}else if($n == '10'){
return is_dec($str);
}else if($n == '16'){
return ctype_xdigit($str);
}else {
return fals... | 1 |
5a6b35cdfb6f47ed0f2bfd852118fabc | 9010b2c21ce5268c0631b2961eee2364 | decrements the vector by a scalar | class Vec2{
static subtractScalar(out, scalar) { out.x -= scalar, out.y -= scalar; } | 1 |
68a57d3a2b2fa59bf6c44bad3dc4c1af | 444800a36bdf1df6f52877c9116acfa2 | 玩家手动接受某个任务 | function submitAndAskTask(npcRoleID: number, taskID: number, npcExenstionID: number): void {
Global.Log.Info("自动接受任务(npcRoleId:%d, taskId:%d, npcExenstionID:%d),并继续下一个...", npcRoleID, taskID, npcExenstionID);
const taskData = Task.getTaskDataById(taskID);
const nextMainTaskId = Task.getNextMainT... | 0 |
85e942498f4913ac1c5f2e7065f1cc27 | 2daa2bfdf4eca1da0b7427b1627a73f8 | *************************** CODE **************************** | void getMultiFeature( faceAligner *aligner,
const Mat &input_image,
Mat &shape,
Rect &face_rect,
Mat &feature)
{
int face_size[] = {300, 212, 150, 106};
vector<int> facesize( face_size, face_size+sizeof(face_size)/sizeof(int));
i... | 0 |
92ada494a84027e2e9c457e6b5b7c92d | 4a8c3110733ace80cd2923c9269d0f1e | Wait for keystrokes before printing debugging info and rebooting. | EFI_STATUS status;
Print(L"Press any key to continue:\n");
status = gBS->WaitForEvent(1, &(gST->ConIn->WaitForKey), 0);
if (EFI_ERROR(status)) {
PrintInfo(ERROR, L"WaitForEvent error: %r\n", status);
Halt();
}
EFI_INPUT_KEY key;
status = gST->ConIn->ReadKeyStroke(gST->ConIn, &key);
if (EFI_ERROR... | 1 |
d3b6fd4e074887c81b6b97e78605917c | 620cfef61f45f2a9b4735ca3092c375e | Loads the current scene. | string prevSceneName = GetPreviousSceneName();
string sceneName = prevSceneName != null ? prevSceneName : SceneNames.Start;
LoadScene(sceneName);
} | 0 |
c6094367fefe2ba026d5cc9a1239cd54 | 4ce048d20d281b52850728aa28c5cf28 | Number of turns the stagger effect lasts for, if applied. | public class BlockingPoint: Hitbox
public float GetStaggerDuration(){
return _staggerDuration;
} | 1 |
f83330125354674a2b388e0412901e5b | 81f22478375fa1b629e7dc9ab7c6ad21 | 寻找最佳SARIMA模型 | dataset = dataset.astype('float32')
best_score, best_cfg = float("inf"), None
for p in p_values:
for d in d_values:
for q in q_values:
order = (p,d,q)
try:
mse = evaluate_arima_model(dataset, order)
if mse < best_score:
best_score, best_cfg = mse, order
print('ARIMA%s MSE=%.3f' % (o... | 0 |
c40465eada054fb60287ab5b863e9f6d | bed655fb3d1e540d8903cdd7c08d4f2c | Calculates the coverage (in percentage) of the pack. That is, calculates
how much of the pack's container is filled with rectangles | if (!this.coveragePercentage) {
this.coveragePercentage = this.coverage.reduce((acc, cur) => acc + (cur > 0 ? 1 : 0), 0);
}
return this.coveragePercentage;
} | 0 |
f5386f216dc12d8a1c23f98db9dfa777 | 5e10adae884708a2835087d891e81199 | 根据手指移动速度判断是否要swipe | public class DoubleScaleImageView extends AppCompatImageView implements View.OnTouchListener, ViewTreeObserver.OnGlobalLayoutListener
private boolean isMove(float x, float y) {
return Math.sqrt(x * x + y * y) > mTouchSlop;
} | 0 |
15ef5c46eb33b80c298a4ecba67f1662 | f4e6d002dbbbbe40c2afda08ea7755ad | Reads a GN-written file containing list of file names and returns a list.
Note that this function should not be used to parse response files. | def readlist(listfn):
with open(listfn, 'r') as textf:
return textf.read().splitlines() | 1 |
b7da224c1667f2ac5e4e6d25b158c585 | b8d2bc12235f9850375ce87741cf1ef6 | Carga en la variable lista todo el contenido del fichero Json | listaObjetos = new ArrayList<>();
ObjectInputStream ois = null;
FileInputStream fis = null;
try {
fis = new FileInputStream(RUTA);
while (true) {
ois = new ObjectInputStream(fis);
listaObjetos.add(ois.readObject());
}
... | 0 |
3aaeb015fbd04b661715d061f6dc0c38 | 4cdd10d86b152902f5266dbee1697dfd | Specifies whether the "disable account" feature is available for this user. | public boolean isDisabled(boolean initialAccount, String userId, LDAPConnection ldapConnection)
throws LDAPException; | 1 |
93749bc95bcb9d629001cc8cc6f22df8 | 729f4efe7cd3eb6a92703e48d691b45a | Save template item | {
using (var f = new ItemTemplateUITypeEditorForm(pgItemTemplate.SelectedObject))
{
if (f.ShowDialog(this) != DialogResult.OK)
return;
var item = f.SelectedItem;
pgItemTemplate.SelectedObject = item;
}
... | 0 |
d44c2445c702ac88092ad90805bae4f0 | 79821105728fa302bb36db7984540702 | Check object code at given position. | Optional<Region> r = lookup(position);
if (!r.isPresent()) {
return false;
}
Region region = r.get();
int regionAbsX = (region.id >> 8) << 6;
int regionAbsY = (region.id & 0xff) << 6;
int tempZ = position.getHeight();
if (tempZ > 3) {
tempZ = tempZ % 4;
}
GameObject o... | 1 |
39c294421ff2d754d5bfca79d6119e5f | b54bdde6d4f4aee87127497cd4a49808 | Get the facialHair value. | @Entity
@Table(name="AVATAR")
public class Avatar implements Serializable
public HairColor getHairColor() {
return hairColor;
} | 0 |
68acde492a928c4ba6f16ee7ce51f004 | dbc774d99044a47954b8bb78f65a1a22 | Fantasy default player scoring stats. | def scoring_weights(default_player_scoring_stats):
return pd.Series([1, .75, 1, .5, 1, .1, 1], index=default_player_scoring_stats) | 1 |
8e10b7786d1d3ceb6b2790480f422270 | 239f19913bb86ba5de6f0c409a8ed614 | Load a new scene when there's none loading right now and the player passes the loading theshhold | public class SceneChanger : MonoBehaviour
public void LoadScene() {
if (nextScene != null) {
SceneManager.LoadScene(nextScene);
PauseManager.UnPauseGame();
}
} | 0 |
63cdbb14cd20157ddba290e61509c300 | 9cb547578e2064d8380aa2cf514072d5 | for choosing a random destination host for the packet | rt_num = random.randint(0, len(self.names)-1)
while rt_num == dead_one:
rt_num = random.randint(0, len(self.names)-1)
self.showIPRoute(rt_num) | 1 |
3f06fdc7501e1999714250e1f5a9cb39 | ed71352c6302b48d17190ae2f3b8d863 | Merge two sorted linked lists without recursion. | class MergeSortedLinkedLists
public Node merge_sorted_list(Node headA, Node headB) throws Exception {
Node other = new Node();
Node tail = other;
while (true) {
if (headA == null) {
tail.next = headB;
break;
}
if (headB == null)... | 1 |
b15e87ea16b6995786bb0b7ba2c7a443 | 987d200d7ddb3e798fdd29cc92e8b76f | Adapto los pesos de todas las neuronas vecinas que son afectadas por la neurona ganadora | void updateNeuron3D(dataVector* v, somNeuron* winner, somNeuron* n, somConfig* config){
double h = neighborhood_function3d(winner, n, config->sigma);
updateNeuron(v, n, h, config);
} | 1 |
0f9005885cce1f231ebbd4d3b4ef07fa | 3a230be9452e6052795ecd38279cf8f8 | Deletes a UPnP port mapping with the given information. | namespace CREA2014
public class UPnPWanService
public void DeletePortMapping(UPnPPortMapping portMapping)
{
DeletePortMapping(portMapping.RemoteHost, portMapping.ExternalPort, portMapping.Protocol);
} | 1 |
6c1d19a65a6ed1513c189fb3efe910dd | f847550b5b9cc1734d85e032dc679f50 | 获取记录的历史语言,如果没有记录历史语言,则取浏览器设置的语言 | function getBrowerLang() {
var currentLang;
currentLang = navigator.language;
if (!currentLang) {
currentLang = navigator.browserLanguage;
}
return currentLang;
} | 0 |
728180426ffc06186d9ab76e5d304ae9 | dda22c778d35d220492254afbe64dd79 | Add a prefix to facet requirements. Serves to
limits facet sets to smaller subsets.
eg. all facet data starting with 'R' | if isinstance(field, str):
self._facet_fields.append(field)
else:
for name in field:
self._facet_fields.append(name)
return self | 0 |
b0421cd0c75ce5a904b4e12581187598 | a5d9b61d8f6650d2874f61dc0a14d9c5 | This endpoint retrieves the list of Bookmakers. | def get_book_makers(driver):
bookmakers = driver.find_elements_by_class_name('provider-cell')
bookmakers = [bookie.get_attribute('class') for bookie in bookmakers]
bookmakers = [bookie[27:] for bookie in bookmakers if 'hidden' not in bookie]
return bookmakers | 1 |
08c5a3101360dbc30362001ceea46cc1 | b6a9b8725dfcf14aa3dccd310b35aa23 | Exchanges the keys with the values in a map | for (i in 0 until array.size()) {
put(array.keyAt(i), array.valueAt(i))
}
} | 0 |
0f134db91f139b848b758972948eda44 | 97117cad454f68811365ebea4dd59221 | Check if <charname> has a value | class ProfessionUserInfo extends \DrSlump\Protobuf\Message
public function hasCharname(){
return $this->_has(9);
} | 1 |
f44190f313006979e4736f92d45d4bc7 | b3aeb3f2b280b20cfc9cd96eaad8a746 | 最終ログインの時間更新 | try {
$param = array();
$sql = "UPDATE c_login SET";
$sql.= " modified = CURRENT_TIMESTAMP ";
$sql.= "WHERE";
$sql.= " login_id = :login_id";
$param["login_id"] = $login_id;
App::$db->ExecuteNonQuery( $sql , $param );
} catch (PDOException $e) {
cmnLogOutput( "db error : " . print_r($e, true... | 1 |
e596a8111b247724f5c23b7b022f0d43 | 31065fc567767058606dca0b072e765c | 根据用户输入的小车id,获取当前小车执行任务的id | class OrderModel extends Model
public function get_id( $driver_id )
{
$where['driver_id'] = array ( 'eq' , $driver_id );
$where['status'] = array ( 'eq' , '1' );
$id = $this->where( $where )->getField( 'id' );
return $id;
} | 0 |
fbbc37c04c8ea227fcfe1f3f3fc2b624 | bce5db24cbfdcbe4f7da40ae089325f4 | Create or return the aggregate instance to use
Also loads it if null | class ZtChart_Model_Monitor_Aggregate
static public function factory($identifier, $throwException = true) {
if (null === self::$_loader) {
self::$_loader = new Zend_Loader_PluginLoader(
array(
'ZtChart_Model_Monitor_Aggregate_' => realpath(__DIR__ . '/Aggregate')
... | 1 |
29a5ebd10f87c28aa2a46ea558738f5b | 4d44159107720ae5a0355e12160f1712 | Determines whether to allow deployment as unpiloted to a system or sector. | namespace NewsGator.Install.Common.Utilities
internal static class Server
internal static bool ValidSPServerRoleForDeployment(SPServerRole role)
{
return !(new int[] {0, 3}).Contains((int) role);
} | 0 |
292635be7cd261c5e0136cb269b39187 | dcecd80566c46703a356f5d732b16368 | 根据I18N文件夹,加载该文件夹下面所有的I18N资源数据 | t := &I18nTranslator{}
t.defaultLocale = defaultLocale
dirPath, _ = filepath.Abs(dirPath)
if _, err := os.Stat(dirPath); os.IsNotExist(err) {
return nil, err
}
t.dirPath = dirPath
if err := t.loadFiles(); err != nil {
return nil, err
}
return t, nil
} | 1 |
86ed7fc8de0e997d568fe35097841113 | 0deda21295d387f1ed89c6b7ad70ad64 | Gets the computed bench f2. | @Entity
@Table(name = "COPQTCTD")
public class CoastDown extends BaseAggregateRoot<Long>
public Double getComputedBenchF0() {
return computedBenchF0;
} | 0 |
65e37c5ad781aa0989fc10a0b54868c7 | 3e8f976a752a6c6511a05bbba8b69494 | 检查是否选中了棋子 | class GameLogic:
def isCheckerSelected(self):
return self.selectedChecker is not None | 1 |
b8567441fc06bd6f6cf5814ebc81803d | a3cc2cbb4d392843504f72f00fd88e82 | <pre>
Supported location_ids used for deciding in which locations Pub/Sub topics
need to be created. If custom Pub/Sub topics are used and they contains
'{location}', the location_ids will be used for validating the topics by
replacing the '{location}' with the individual location in the list. The
valid values are the ... | public String[] getLocationHints(); | 1 |
ac95a6e29cfc992ed87de767311849a0 | c755806a647e752b44c1b673b424287d | 格式化4位字符串 例如 1 格式化为0001 | namespace com.yuzz.dbframework static public class AdobeUtil
public static string FormatZeroCodeString(int getCode,int length) {
string getFormatCode = "000000";
try {
getFormatCode = getFormatCode.Substring(0,length - getCode.ToString().Length) + getCode;
} catch... | 1 |
813ff7e7d95b1f6cfa5dcc94a7c5b957 | 589f4ce23ea21698f9d4118b3c990673 | This method retrieves the value of the specified descriptor in the language specified | public String getDescriptorValue(String _descName,String _langCode) throws ITSException; | 1 |
aefc1ae308720911d9796ffb400ba6a3 | 7f61448ad6da3ef0f9cb03f40c5be655 | **************************** Item Left **************************** | cases like (1) | 0 |
d10e2e19c82897848f2df672e94cdb65 | b6df649168dfb3d943f0b0eadc63c219 | This helper function searches the Animal table for an unadopted animal with a specific id, then performs a try/except (IndexError) | database = sqlite3.connect("database.db")
c = database.cursor()
c.execute("""SELECT AnimalID FROM Sightings WHERE Asid = ?""", [Asid])
existingId = c.fetchall()
if existingId == [(None,)]:
sm.update_sighting_AnimalID(AnimalID,Asid)
database.commit()
database.close()
else:
return "Animal is a... | 0 |
179b0586b42cc81822673b266d90f5f1 | 6be8a74fc180461ae490377535a592db | Returns the position of the window, as last specified by the window manager. This position does not include
window decorations but is the top-left position of the first usable space of the window.
@return Position, relative to the top-left corner of the terminal, of the top-left corner of the window | namespace OpenTK.Core.Platform
void GetPosition(WindowHandle handle, out int x, out int y); | 1 |
0ab5f9c7257ab52139f35eb805a6afb2 | 82d71bb0667bd1277afa26a910f1e4dc | ERROR HANDLING | const status = error?.response?.status
console.log('===================== Server Error =====================')
console.log(status, error?.response?.data || error)
if (status === 401) res.redirect('/signin')
else if (status === 404) res.redirect('/404')
else if (status === 403) res.redirect('/404')
else ... | 1 |
7d459a71b61fc91726079dc75b25582d | 636b9f3a65a69fd20d2c84a2705d2ec2 | The alias of the remote cluster containing the leader index. | public class clusterinstance_stats extends base_resource
public String get_clviewleader() throws Exception {
return this.clviewleader;
} | 0 |
ee405651fb0f6bf8967f9004f6a0bad7 | 1da7e648144347f3861c72628490c2d9 | Поддтверждение "фейковый" платежей доходности торговой сессии | class Deposit extends Controllers_Frontend_Base
public function result()
{
if($transaction_id = $this->robokassa->check_signature($this->input->post()))
{
$data_db_where = array(
'id' => $transaction_id,
);
$transaction = $this->transactions_model-... | 0 |
01febbf05b0485c8b2554fab572d8d67 | 0e4e3b217523a8b710f5e195b910e00e | Set the value of Second Surname | public partial class IndividualType
public IndividualType SetSecondSurname(string secondSurname)
{
SecondSurname = secondSurname;
return this;
} | 1 |
c9f07ec169a8aeb49e0e5b744381d706 | 7ea376a1d52b2ac0779dcf5c304caf3b | Set the id attribute name. | class Syo_Db_Orm
public function setNameId($nameId='id')
{
unset($this->vars[$this->nameId]);
$this->nameId=$nameId;
$this->vars[$this->nameId]=null;
} | 1 |
6e54feb41b57950558a3b5fb601d38c7 | dc1b3da6403d78ee39f60e58095a2fa6 | ! \brief Update the frame image.
Draw the new frame image in the proper label. | rval, frame = self.vc.read()
frame = cv2.cvtColor(frame, cv2.COLOR_BGR2RGB)
image = QImage(frame, frame.shape[1],
frame.shape[0], QImage.Format_RGB888)
pixmap = QPixmap.fromImage(image)
self.label.setPixmap(pixmap) | 1 |
39144f1a2f9b740f7f943272a020e2c9 | bf25b2560667aa7e9437fde8b7771e1b | Возвращает список символов, прочитанных из файла.
(для считывания смайликов и разрешенных в нике символов) | self.file.seek(0)
text = self.file.read().lower()
text = re.sub(r'([^\s\w]|_)+', '', text).replace('\n', " ")
words = text.split()
return words | 0 |
2eedd1f4f55f9597b479a9620146b4cf | b4f2f59c9bc6ed76412f504283a805f5 | Multiple shooting solver using forward sensitivity analysis on the matching conditions of shooting parameters | x ,y, eo, PEo = initCorrection(mc[:,0],mc[:,-2])
mc[:,0] -= eo
mt[:,0] -= eo
mc[:,-2] -= PEo
mt[:,-2] -= PEo
minSC, maxS = curveMatch(mc[:, 0], mc[:, 2])
fdFunctionC = inter.UnivariateSpline(mc[:, 0], mc[:, 2], s = maxS)
fdNoiseC = maxS
minST, maxS = curveMatch(mt[:, 0], mt[:, 2])
... | 0 |
828aa72c62619cd476e5975bd64569b3 | 7c5b85b9504016047c7148ce964c5dcf | update mmedicine by ID
Update a mmedicine entity by ID | public class DbHandler extends SQLiteOpenHelper
public int UpdateMedicine(medicines m, int id){
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(COLUMN_medicineName, m.getMedicine_name());
values.put(COLUMN_Dose, m.getDose());
... | 1 |
5975ac4ff0ddcfcfd027f73097559550 | ab8a3c66a3bfdb8a01d2e3d9408f97b9 | Set and overwrite all existing errors | class Form
public function setErrors($errors, $firstOfEachOnly=true)
{
if(!is_array($errors)) {
throw new \Exception(
__CLASS__.'::'.__FUNCTION__.' - The value passed to errors is not an array ['.(string)$errors.']'
);
}
foreach($errors as $name => $errorList) {
if($firstOfEachOnly === true) {
$... | 1 |
4e632230af3754f2dbb65208450fa25a | 4ab7dee9464ce766a1f744fd8881e5a1 | An edge is a tuple of nodes. If the nodes don't exist, create
them. | class UWGraph():
def add_edge(self, x, y):
if x == None or not y: return
self.edges.add((x, y)) | 0 |
8e93078ef649b0255216eec5651f4cd3 | 7a4f07224246691e876dccb06cb328e0 | 查询我的收藏总数 | Integer queryTotalCollect(); | 1 |
57f4833594017d518c05ebea6a0c5e4f | 887ec2000257801bb866c7060903fa0c | Returns the max age of the authorized request | let maxAge = null
if (req.body.maxAge) {
maxAge = new Date(Date.now() + req.body.maxAge)
}
return maxAge
} | 0 |
9af074b35facc61006f8a588a5e33745 | 9cbe51e2a5048e0b3dbca7925e634403 | Validate that user exists and password is correct. | public class ClientCommunicator
public ValidateUser_Result ValidateUser(String userName, String Password) throws ClientException
{
validate_user_params = new ValidateUser_Params(userName, Password);
return (ValidateUser_Result)doPost("/ValidateUser", validate_user_params);
} | 1 |
06684679fc1a3a82881ec66af087f61e | 9df72ab84d85ba8b205b4b7343288e43 | Used by the derived type to incremenet the message counter | WSF_EXTERN bool WSF_CALL MessageContext::incrementRef()
{
if(axis2_msg_ctx_increment_ref(_msg_ctx, Environment::getEnv()))
return true;
return false;
} | 1 |
6b76d6e38c7307cb928f2b441d44b3ed | 1ad75c00c20926dc541e82b33a8dee9c | Check that node depends on unique nodes | class pipelineConfiguration:
def checkUniqueNodes(self, data):
if 'unique graph nodes' not in data: return
allowedAttributes = {}
allowedAttributes['delete files'] = (bool, False, True, 'isDelete')
allowedAttributes['evaluate command'] = (dict, False, True... | 0 |
291961dcbfdcbed147cf207a6e39e2aa | f60d551b5944756113bcf98020ed8817 | Build URL command to get XML statsList from Steam Community for game | {
return $this->buildUrl( "/ISteamUserStats/GetGlobalStatsForGame/v0001/", [
"gameid" => $appid,
"format" =>"json"
]);
} | 0 |
4d04cf34e2a99a68168d08e6c950e283 | 5dc5aaee4eff7cf7905439b5155dd896 | Checks to see if the group exists on the linux file system so that we don't try to create
groups that already exist. | class Host(Model):
def group_exists(self):
return AzureTools().group_exists(names.group_name(self)) | 0 |
ae47e77f935fd832634c263fa78ad34e | 0d45cf04e153cee6b427e4a525940573 | OpenCart in Modal | function appOpenCart() {
app.openCart(JSON.stringify({
}))
} | 0 |
a1cb320b65db1bc263000b087e813cc8 | e300037dad757e7b7cdc2d3128e66c3e | Checks to see if a certain variable has been assigned | class IBSSmarty extends Smarty
function is_assigned($tpl_var)
{
return isset($this->_tpl_vars[$tpl_var]);
} | 1 |
a3a0962920fee527af056caa90c43bb4 | 5b9c088c201738fa69fe827ab6c8cadd | Чтение конфигурации из файла. При его отсутствии - создаём и читаем снова. | namespace RSSReader
internal static class CommFunc
public static RssConfigure ConfigLoad()
{
if (File.Exists(XML_PATH)) {
return XmlSerializer.Load<RssConfigure>(XML_PATH);
}
var result = new RssConfigure();
XmlSerializer.Save(result, XML_PATH)... | 1 |
6b5a3141ff13e9871d3d62f16894733b | 11363317d0492411984a46ab1ebbc69e | Find best chromosome in a given population | Chromosome *SelectBest(){
if(sizePopulationA == 0)
return NULL;
unsigned long long min = ~0x00;
int index = 0;
for(int i = 0; i < sizePopulationA; i++){
if(populationA[i]->Fitness() < min){
min = populationA[i]->Fitness();
index = i;
}
}
return pop... | 1 |
3510a5863611239bfd398d62eb4f4dc6 | 9711aa646891ef06d3ec7bf8c05696a0 | Sets 工作时间段 | {
logger.debug("setTime2()" + starttime);
DateTimeUtil dt = null;
if (starttime == null || "".equals(starttime))
{
starttime1 = null;
}
else
{
dt = new DateTimeUtil(starttime);
starttime1 = String.valueOf(dt.getLongTime());
}
if (endtime == null || "".equals(endtime))
{
endtime1 = null;... | 0 |
220b876a585daae4793d70bfaca9a45b | cf1546ce9268a14cf4cf74e3adbd83de | Save settings and go to start menu | public class OptionsController : MonoBehaviour
public void SaveAndExit()
{
PlayerPerfManager.SetMasterVolume(volumeSilder.value);
PlayerPerfManager.SetDifficulty(difficultySilder.value);
levelManager.LoadLevel("01a_Start");
} | 1 |
500ccce95f95dbf4e155c027a1abd624 | e6a13210795e1b1200f4826671f446ed | Gets the right gearbox's raw value | if self.mrGbMS == nil then
return 0
end
return mrGearboxMogli.mrGbMGetNumberHelper( self.mrGbMS.Ranges, self.mrGbMS.CurrentRange, self.mrGbMS.ReverseActive )
end | 1 |
dcc036c282c60d7cfcbb779d33cd1285 | 7e777817c8d0a7d2a0d50fe51b954e51 | Copies the value of `other` for `entityId` to this component. | class Entity
def reset(other)
self.url = other.url
self.attributes.replace(other.attributes)
self
end | 0 |
d483aa8b8ece8cb3d712575a23235ecc | 6a1bcea7af08efd6b2c7a4c4f9ed93fe | Converts datetime with timezone to datetime without timezone if USE_TZ is False | new_time = pd.to_datetime(time)
if new_time.dt.tz is not None:
new_time = new_time.dt.tz_convert(None)
return new_time | 1 |
325ea181580a96ceb751bf3edf6e1746 | 409f73ce7783ea90a14ee11348c8cd96 | 设置本地能够存储的最大日志数目
Set the maximum number of reports allowed on disk before old ones get deleted. | class Logs
public static function setLogMaxSize($size)
{
if (is_numeric($size)) {
self::$_logMaxSize = $size;
return true;
}
return false;
} | 0 |
91d695d7ecbcfd7f0e56377822137ce3 | 4509ba62726811dd573470755eae6522 | loop through the BPClass and update all the cell numbers | {
if (R__b.IsReading()) {
R__b.ReadClassBuffer(MyCellMgr::Class(),this);
} else {
R__b.WriteClassBuffer(MyCellMgr::Class(),this);
}
} | 0 |
68ca5405c165e1af58ef60ce3fe69c07 | 7b56f339075c87d53a439f5132c78128 | 获取nacos服务地址 | @RestController
@RequestMapping("/order")
public class OrderController
@GetMapping("/address")
public Object getAddress() {
ServiceInstance choose = loadBalancerClient.choose("provider-user");
return choose.getUri();
} | 0 |
7e1ee93928cfd7c72373636476035fef | ddf2f512fbea34e422064562e1f279dd | This function load the data of all "command operands number" to a List that is behaving like a row of big table | protected void loadAndFormatData()
{
setUpdatableCharacteristics(getCommands(),
CommandInformationTableColumnInfo.getColumnNames(),
null,
... | 0 |
d9a5891ae40a1ab02ecdcab06534b72b | 0ccfd58e414feb4117f988ab315fe128 | ● バッファを確保して文字列をコピーする ( ワイド文字列 ) | public class RingBufferTest extends TestCase
public void test_wr_string_s() throws Exception {
for (int i = 0; i < ITNUM; i++) {
StringBuffer str = new StringBuffer();
str.append("Hogehoge").append(i);
assertEquals(ReturnCode.BUFFER_OK,this.m_string_s.write(str.toString()));
... | 0 |
bfd855e6c8fd8d80e580b4fb3dc5b65e | 8a289a39ff38a187a4a28a08ad9fbcdd | 捨て牌を評価して評価値を返す | if(isTadadori(_sashite)){
return (gcaValuePKind[gPieces[_sashite.tottaKoma].kind]
+ (gPieces[_sashite.tottaKoma].isNari ? gcValueBeenPromoted : 0)
+ (_sashite.isNaru ? gcValueDoPromote : 0));
}
if(isFuTori(_sashite)){
return (gcaValuePKind[gPieces[_sashite.tottaKoma].kind]
+ (gPieces[_sashite.tottaKoma].is... | 1 |
96d4d5dce8775fb8b41d2342cb757442 | f4fe7bb9161c0318fadafcd0031a9937 | 寻找下一个中心,根据每个单独簇类中最远的节点。 | init_node=np.random.choice(len(fdata))
init_sample=fdata[init_node]
center_list=[init_node]
while len(center_list)!=ctype:
distance_np=[]
if len(center_list)==1:
max_dis=((fdata-init_sample)**2).sum(axis=1)
else:
for i_node in center_list:
... | 0 |
b28400faba760e61060a320f2f9a3b11 | 7746f744c1e8ec541b2477fd82e6a958 | Suppress deprecation warnings that can occur when Python
compiles awscli. This is the normal behavior of the aws
utility and prevents the logout unit tests from failing.
https://github.com/techservicesillinois/awscli-login/pull/75 | def suppress_unwanted_warnings():
logging.getLogger('googleapiclient.discovery_cache').setLevel(logging.ERROR) | 0 |
85d6ad4fdf5efc9805483e4bffa4613f | 646d047d9ba425b0029abe9367c85f46 | Gets the option that is currently selected in a dropdown or the
first option selected in a multiselect field. | public abstract class BasePage
protected WebElement getSelectedItemFromDropdown(WebElement elem) {
return new Select(elem).getFirstSelectedOption();
} | 1 |
3b0f84596a0bdcf246b4cb746af84d71 | 667318ff768880eea3d574c23ac4e47e | Returns, but does not remove, the TokenTree at the top of this stack | class Parser(object):
def top_token(self):
return self.tokens[self.token_index] | 0 |
834ca16ce17af3d40f7919e24083064a | 08a4e210064252b02ec2117f514e8dc5 | Get the total number of turns taken by the robot. | public class Board
public int totalTurns() {
return counter[0] + counter[1];
} | 1 |
f9e1faf1f09b36554eada52653d6a55d | 729c2fa58887426ef4a7ec25c9103e22 | @brief
Enable the throttle system into RUN mode. This is needed
To be done via flight control to prevent unintended HE startup | public class PickettUpper extends Subsystem
public void throttleMode() {
liftMotor.changeControlMode(TalonControlMode.PercentVbus);
liftMotor.set(0);
} | 0 |
432589062b1b24fd70766955c8f42224 | 1be1b046204c1bd04a04a0832b72af02 | Discard one's hand and forfeit interest in the current pot. | public class GameController implements Observer, IEventVisitor
public void discardSelected() {
this.getTrainerPlaying().discardSelectedFromHand();
} | 0 |
9e8543ed0334a1d26ccfcc67a21278b1 | 509baea5fd75cc7b3439fbc4f9c799aa | 通过Yahoo查询汇率,网站不支持CNY/HKD需要通过美元转换 | {
$apikey = "baidu api key";
$url_param = [
'fromCurrency' => $from,
'toCurrency' => $to,
'amount' => $money
];
$currency_support = ['AUD', 'CAD', 'CHF', 'CZK', 'DKK', 'EUR', 'GBP', 'HKD', 'HUF', 'JPY', 'NOK', 'NZD', 'PLN', 'SEK', 'SGD', 'USD'];
if (in_array($to, $currency_su... | 0 |
b5e615f7ef96c90097d3eeeec5d71203 | bffc2afe33276e3fb302d8e5e6ba5f3e | @brief Handles reception of the @ref CTSS_NTF_CURR_TIME_CFM message. | static void ctss_notify_time(struct ctss_env_tag *ctss_env, uint8_t conidx)
{
struct gattc_send_evt_cmd *cur_time = KE_MSG_ALLOC_DYN(GATTC_SEND_EVT_CMD,
KE_BUILD_ID(TASK_GATTC, conidx), prf_src_task_get(&(ctss_env->prf_env),0),
gattc_send_evt_cmd, sizeof(struct cts_curr_time));
cur_time-... | 0 |
725d14e190633b56c1d14e399cabcc31 | 6457518926f07ff05c10431e6752a2ac | Staker cannot redelegate while having active stake | ExtBuilder::build().execute_without_relay_init(|| {
assert_noop!(
Call::Issue(IssueCall::request_issue {
amount: 0,
vault_id: dummy_vault_id_of(),
griefing_collateral: 0
})
.dispatch(origin_of... | 0 |
f977eeb8a3b14396263c594bc7f8d653 | 5edf867c20a7b75f4d089e387c15df64 | sets the number of points the player has | class Canvas: JPanel()
fun setPoints(newPoints: Int) { currPoints = newPoints } | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.