query_id
string
corpus_id
string
query
string
code
string
label
int64
29e4148affd174974ed894922f91f4ef
784b13bfcf44e63832760d008d258ca6
Modifie un type de formation
{ $resMedia = $this->createMedia($media['type'], $media['path']); $datas['id_media'] = $resMedia ? $resMedia->id : null; $resCat = $this->add($datas, 'categories_formations'); $this->setPrimaryKey('id'); $dataUpdate = [ 'id' => $resCat->id, 'id_media' => $resMedia->id ]; $this->setTable('...
0
2489b54a69fd49801aac81d714285b7f
74b575a256acaf24c4d309825cfea739
Gets a single encrypted block without validation and padding removal (much faster than Get)
{ if (Context == null) Context = new BlowfishContext(Key); return BlowfishEngine.Encrypt(block64, Context); }
1
5ff444c06d53c065e9090551dd74f5ab
7efa29436f3b448a92ea46ab95acd383
Evaluate the ensemble model with k-fold validation:
losses = [] kf = StratifiedKFold(n_splits=cv, shuffle=True, random_state=self.a) for tr_idx, va_idx in kf.split(self.x_train, self.y_train): tr_x, va_x = self.x_train.iloc[tr_idx], self.x_train.iloc[va_idx] tr_y, va_y = self.y_train.iloc[tr_idx], self.y_train.iloc[va_idx]...
1
8ab505103c4109c1d33953cfe8ca0399
5118ad574600db36d2dafd34fcfe14d3
Randomly generate 10 numbers to select 10 Kingdom cards Add those cards to the supply with the appropriate amount Add the Treasure and Victory cards to the supply
int main(void) { srand(time(NULL)); int number_of_players = 2, kingdom_cards[] = { adventurer, council_room, feast, gardens, mine, remodel, smithy, village, baron, great_hall }, random_seed = 2, choice1 = 0, choice2 = 0, choice3 = 0, hand_position = 0, bonus = 0; struct gameState game_state, saved_gam...
0
dfb01d8bcc23a6f11ded12bf1d4aa3cb
ad7ac136c569dbded8d1ff3f5e62ac7a
对每一个LDA类别根据中心词进行过滤,去除一些无关的词语
wordvec=[] for w, c in allw.items(): if c>3 and c<len(articlew)*0.6: wordvec.append(w) ll = [[(word in f and f[word] or 0) for word in wordvec] for f in articlew] return ll, wordvec
1
62ea54fa5d3f0d8c389299ccb8603633
a01eeefccbc6cb3a86c04c1380e9b51d
Enable/disable replanning
class MoveGroupCommander(object): def allow_replanning(self, value): self._g.allow_replanning(value)
1
1a59c080cc204149cddcb6e02f6793eb
4ca8da26b32a67b055ee327f1f68cd8e
Find an existing service binding matching the given parameters.
namespace Pulumi.AzureNative.AppPlatform.V20230501Preview public static class GetBinding public static Task<GetBindingResult> InvokeAsync(GetBindingArgs args, InvokeOptions? options = null) => global::Pulumi.Deployment.Instance.InvokeAsync<GetBindingResult>("azure-native:appplatform/v20230501preview:get...
1
d72dd942a5235b6d9437ea10231b68a0
9db9605c0085ba1122c0e22eebe6a565
Returns a random 64-bit integer.
namespace XorShiftPlusAdditions public partial class XorShiftRandom [ExcludeFromCodeCoverage] public long NextInt64() { long _; ulong temp_x, temp_y; temp_x = this.y_; this.x_ ^= this.x_ << 23; temp_y = this.x_ ^ this.y_ ^ (this.x_ >> 17) ^ (this.y_ >> 26); _ = (long) ...
1
b42a0f52bb7c1008358741f1b1772e7c
4e57f6c3e98606fc20b9c8b33769b472
is the current time between 9:30 ET and 4:00 ET
now = TWTime().now.hour if now >= 9 and now <= 14: return True else: return False
0
7cd3411f749b4a931cf50ad7969dc8d5
f343e1668447eb5dfe66c862e7c60381
Indique si on est au dernier intervalle de temps, donc si la fonction suivant() va renvoyer le premier intervalle.
public boolean estDernier();
1
eba4bb122e57cd9de521ea59bdcd7efc
16ee1385df2ba5eca1919c0eb7c5a9a7
获取我发送的站内信
{ Showapi_Res_List<NewIMReceiveMailBodyEntity> res = new Showapi_Res_List<NewIMReceiveMailBodyEntity>(); try { var result = new List<NewIMReceiveMailBodyEntity>(); var memberid = _PrincipalBase.GetMemberId(); var allnum = 0; ...
1
522eae4eca9f1f29258e8e7f86b6dbaf
bdff534a3a5e58f7510ad9473428a6b7
===================== FS_LoadedPakNames Returns a space separated string containing the names of all loaded pk3 files. Servers with sv_pure set will get this string and pass it to clients. =====================
const char* FS::LoadedPakPureChecksums( void ) { static char info[BIG_INFO_STRING]; searchpath_t *search; info[0] = 0; for ( search = fs_searchpaths ; search ; search = search->next ) { if ( !search->pack ) { continue; } Q_strcat( info, sizeof( info ), va("%i ", search->pack->pure_checksum ) ); } return ...
0
55560d2e127961ea54856c6ecd28bea6
92112fb89f96f677e09c58f500ed9e28
Cria um dataframe com a parte de sazonalidade
def get_season(p, df, dt): if (p.Lat > -23.45) and (p.Lat < 23.45): if (dt.month > 4) and (dt.month < 11): return df[np.logical_and(df.index.month > 4, df.index.month < 11)] else: return df[np.logical_or(df.index.month > 10, df.index.month < 5)] else: if (dt.m...
1
a18ed29a7d76558ce1729d5180a63b50
78250168a249d4bbbb5a1644fcb0fb7e
Returns the proper Token value depending on the value tier
namespace OWWeb.Models public class RankHistory private Models.Tier GetTier(short? competitiveRank) { if (competitiveRank == null || competitiveRank == 0) return Models.Tier.Unranked; else if (competitiveRank >= 4000) return Models.Tier.Grandmaster; ...
0
53eca91ea46f6c338e561951cbd5a100
20c8fc9b7091aca9d52f5ebb8990ec0e
Returns the hole in its specified JSON format
namespace Plasticore public class Holes public override string ToString() { if (HoleSize == HoleSize.NoHoles) return ""; string quantityString = ""; if (Quantity > 0) quantityString = string.Format("{0} ", Quantity); return string.Format("[{3}{...
0
c91903fac81a22e01a78cbb872eac221
1cc4a3fc4515f2c69cd019b68fbda9d2
マイク、スピーカ情報の取得
switch (type) { case 'camera': await navigator.mediaDevices.getUserMedia({ audio: false, video: true }); return; case 'mic': await navigator.mediaDevices.getUserMedia({ audio: true, video: false }); return; default: throw new AgoraError('引数が間違えています'); } ...
0
6b1aba0d61ca5c58e21e9e5bec7d4898
efa54ed8b1a00da1cb27176b129c19a7
Broadcast seed to all neighbors but sender
packet_header *header; packet_seed *data; int i; if (network_on) { header = &p_header; data = &test_seed; header->player = wConsoleNode; header->type = NET_SEED; data->num = num; #ifdef IMPLEMENT_ME for (i = 0; i < network_on; i++) if (i != mas...
1
d0af55b24d8949a59f254d1cc2e846fa
47cf2e88f43308f18da2fe3e73295b7a
하루 게시물 수 조회
public List<BoardDTO> getArticlesByDday_1(Map<String, Object> map);
0
a9a7c8fa6a6926ef51307d24c561c1c9
d2c1229615742b4b1d5fdd485f32725a
shows deactivate account page
class Connect_IndexController extends ConnectAbstractController public function accountDeactivatedAction() { $this->_helper->layout->setLayout('login'); }
0
8aa8d9eafbe111a1d4c352e07fb25349
b66ca8284dfca1a55bfe634192fa119f
test qui verifie que l'enseignant a bien été ajouté
include 'bdd.php'; $requete = $cnx->prepare("INSERT INTO enseignants(nom,module,email,password) VALUES(:nom,:module,:email,:password)"); $requete->execute(array( 'nom' => $nom, 'module' => $module, 'email' => $email, 'password'=>$password)); return 1; }
0
84c64e1967575682db5065e4967253dd
4929e6bce93dcd5436179b5e21dced2e
Matrices must have same number of rows to be horizontally concatenated.
namespace Elsheimy.Components.Linears internal static partial class MatrixFunctions public static double[,] ConcatVertically(double[,] matrix1, double[,] matrix2) { var columnCount = matrix1.GetLength(1); if (columnCount != matrix2.GetLength(1)) throw new InvalidOperationException(Properties.Resou...
0
36af5b5be90ef63a5867e789ef4df2ff
ddc2b34372145ac1547e6a7e11620da8
お問い合わせへの返信履歴を全て取得
{ $sql = 'SELECT * FROM ' . MYNETS_PREFIX_NAME . 'c_send_messages_history ORDER BY c_send_messages_history_id DESC'; $history_list = db_get_all_page($sql, $page, $page_size, $params); foreach ($history_list as $key => $history) { $history_list[$key]['c_member_ids'] = explode("-", $history['c_member_...
1
6bae1b7fc933adfb84c90f33d84a1b23
3455cf7f889bebb9c19d585ad701356e
should be able to retrieve closed posts for a community if administrator
user = make_user() foreign_user = make_user() foreign_user.update(community_posts_visible=False) community_owner = make_user() community = make_community(creator=community_owner, type=Community.COMMUNITY_TYPE_PRIVATE) community_owner.invite_user_with_username_to_community...
0
e63d963532fda15b728513e520daa08e
b90e578baf6763ef47e9b5ea9c296266
Formats Cart Product Breakdown
$output = ''; $account = \Drupal::currentUser(); $session = \Drupal::request()->getSession(); $cartSession = new \Drupal\commerce_cart\CartSession($session); $CartProvider = new \Drupal\syncart\Controller\CartProvider($cartSession); $cart = $CartProvider->getCart($account); if($cart) { ...
1
46ce737616b30d95860a75ad90d832f4
f46d3e9f343ae0d313a4083c4261e818
Refresh the scan chain twice. Once to write out the new values, and a second time to read them back.
if (!FSScanPosRead()) { ParseIndex(); WriteIndexSerialization(); } if (!FSElutionIndexRead()) { ParseElutionIndex(); FSElutionIndexWrite(); } }
0
fac1c9452cf76ae093d3a6e7cd8bc5fa
30d954f83c91451374eff851a74d46e6
Returns a pixel coordinate (x,y) as a tuple when provided with a longitude, latitude coordinate and a geo_transform (affine transform)
prosrs, geosrs = self.getSRSPair() ct = osr.CoordinateTransformation(prosrs, geosrs) coords = ct.TransformPoint(x, y) return coords[:2]
0
067d006e80718c2db9cb374223bb5b21
34720504c086f4bcc8ee42394a821eba
Set professional/academic information of member
user.name = name user.cgac_code = cgac_code user.title = title self.session.commit()
1
59b9ef43369e3305be01db01b18dd33b
46a2dc49c7457bff9a564e445feb75c8
Reconnexion au compte parent
public class HistoricActivity extends AppCompatActivity public void backAccountPage() { getIntent().putExtra("pseudo", this.pseudo); finish(); }
0
843abc4d8208287cdcf45b4f79c2ed4d
4110b6d9f97e6ff2b93d42fed46273f8
Remove predicted words that are not in the gold set. This means that extra words in the corpus that will not be evaluated on are not considered in evaluation.
result = {} for word, freq in self.ordered_stats.items(): if self.mean_freq + 3 * self.dev < freq or \ freq < self.mean_freq - 3 * self.dev: result.update({word: freq}) return result
0
1f67a3ae1f7a455918bc519ebba38b5a
a0f657f563ef6e4aeb89c6fbc19f52d5
Read client messages.
class Client(QObject): def read_msg(self): buffer = "" data = True while data: global BUFSIZE data = self.server.recv(BUFSIZE) buffer += str(data.decode("utf-8")) while buffer.find(self.delim) != -1: msg, buffer = buffer.split(self....
1
3ec57aea64439ed56b24842a5c4d3eaf
3f1a91a6e3dd1c261d997156934ab2ed
Parses a file with a list of ip's, one per line
class CMDParser: def _read_ip_file(self): filepath = self.cmd_options['ip_file_parse'] ip_list = [] with open(filepath, 'r') as f: for line in f: line = line.strip('\n') if line in IP_RE.findall(line): ip_list.append(line) ...
1
8fe5bb1c0682344f2166663b77b63fb5
b6d5cbe08cf43d35fd4680186b8cb812
Called to initialize the manual start process. Public function defined in zstart.h
void SrAuto::Start(){ PrepareNewMessage(0x00, MSG_Set_All); SetMsgToAutomate(SR_AUTOMATE_TYPE_ID); SetMsgObjectNumberTo(0); SendMessage(SR_AUTOMATE_MBX_ID); }
0
43f694ab5e1e43e030fb79d5e8d7c522
cdb66d534f01b925e17c5712f6e6411d
取得該畫面的DataObject Class <<必須繼承改寫>>
public class N_EMP_QUIT01MDataContent extends DataContent public Class getDataObjectClass() { return N_EMP_QUIT.class; }
1
c7697369548484d68380a4d6428686f2
b51e614ef5c5641112d6a380cc8c8f1d
\brief Gets the maximum position in radians that the simulation will allow for the joint. \author dcofer \date 5/9/2014
double r_h = diameter_/2; double b_h = pitch_/(2.0*M_PI); double curvature = CalcCurvatureHelix(diameter_, pitch_); return spec_.max_joint_angle_velocity() / ( 2.0*spec_.link_length_body()/std::min(1.0/curvature, radius_of_circle_) ); }
0
8cf31c7a6df149fc0f11fb83222184b8
1d34eb1a3cc7216accd488ac442375e5
根据复合key提取对象字段内容
public class RedisCluster extends Redis public List<Object> hmGet(String key, Object... fields) { log.info("hmGet key : " + StringUtils.join(fields, ",")); try { if(complexObj) { byte[][] fd = new byte[fields.length][]; for (int i = 0; i < fields.length; i++) { fd[i] = SerializationUtils.serialize...
1
6fac49be7c61a6ef50b25f95b2807b60
ac48df4dd2f18cc7197e5d61abfd153c
Create an instance of {@link ConfirmOrderResponse }
@XmlRegistry public class ObjectFactory public OrderResponse createOrderResponse() { return new OrderResponse(); }
0
81aba4178237110ddc497551170500b2
16edb54db08c52f2d91d2bc0975615e5
Returns the object with the settings used for calls to getPackage.
namespace FactSet.Protobuf.Stach.Extensions T GetPackage();
0
196362e055c84083990401cda7e9998b
2219f132c11ef04ba42f0d91318f65cc
获取俱乐部约战当前房间数
function DataAPI:getJuNowCnt() return kFriendRoomInfo:getNowCount() end
1
174827a6a48fa43e70b3ef35ec8f9057
6d9c0d0bac6a136280824e6e328cc0fd
傳回實體但不要自動初始化
{ T entity = new T { Id = id }; dbset.Attach(entity); return entity; }
1
35a382e6d1ebed7c1edad69d6ed56181
0b07a991840082f16a406f200ee663b5
Execute 'module release' entry function
VwUndoAction::~VwUndoAction() { ModuleEntry::ModuleRelease(); }
1
7089e74d4594003b92f6ad2e3e12cc80
88c855f56a97df6c5439e0c86a854eda
https://stackoverflow.com/a/37697840/6254393
def progress(iterable, prefix='', suffix='', decimals=1, length=50, fill='█', printEnd='\r'): total = len(iterable) def print_progress(iteration): percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total))) filled = int(length * iteration // total) bar = fill * fil...
1
5cc5ff5b3fe4fecdf17a66d6b47ecf16
5d2ffd326390a03d34b7b48fc25f4831
Metoda koja provjerava da li je broj objekta neparan
if (number % 2 != 0) { return true; } return false; }
1
5a9e0a458803e1e845f619c944667503
f096b952ce20e440f595ec3a9f3e2647
Check local storage is empty or not.
namespace Zapp.Sync Task<bool> IsEmptyAsync();
1
0a292c6781ed04f4d67593a88d11796e
d01876bb7673fa63bf1efa2e4f3da524
initializare spatiu liber
void initSpace(int sx, int sy, int dx, int dy) { int i, j; for (i = 0; i < Height; i++) { for (j = 0; j < Width; j++) { space[i][j].cur = &graph[i][j]; space[i][j].isPushed = false; space[i][j].isPoped = false; space[i][j].from = NULL; ...
1
0e392a82f136fd107a03acf86d458f76
293c1a82043efdf82ccbe939306b7b91
@brief SORGQR wrapper
def magma_sorgqr_gpu(m, n, k, A, ldda, tau, dT, nb): info = c_int_type() status = _libmagma.magma_sorgqr_gpu(m, n, k, int(A), ldda, int(tau), int(dT), nb, ctypes.byref(info)) magmaCheckStatus(status)
1
a3c5238b1615c562d3ecc08292eed42f
626ce09f51153b16f4d190ca7e314fec
Standard unity method. Set all necessary fields and subscribe to events from the input controller.
namespace MagicLeap [RequireComponent(typeof(ControllerConnectionHandler))] public class ControllerTransform : MonoBehaviour void Start() { _controllerConnectionHandler = GetComponent<ControllerConnectionHandler>(); if (!_controllerConnectionHandler.enabled) { ...
1
999805c1b50a8538a08767e2773095fe
71ac3237707010fbb41db491e78cd035
Returns data to edit an existing document. Returns configuration data for editing a document, plus the current `DocumentEdit` object that can be altered and sent back This method provides access to only to the response body. To access the full response (for headers, for example), `getDocumentDataForEdit$Response()` ins...
updateDocument(authorization: string, documentId: string, body: CoreapiCreateDocumentRequest, options?: any) { return DocumentsApiFp(configuration).updateDocument(authorization, documentId, body, options)(fetch, basePath); }
0
7a07c2b3f80ecc6e3f958079553fb33a
4273a446ed2da18309253864164e2c67
Given a list of non-empty arrays, return a list sorted in increasing order by the last element in each tuple. e.g. [[1, 7], [1, 3], [3, 4, 5], [2, 2]] yields [[2, 2], [1, 3], [3, 4, 5], [1, 7]]
function sortByLast(nestedArrays) { }
1
d7b568ecb1378cf066cdc357c8c1ebd7
e9defd80e6c363a958b9e99e8af02190
实体状态机改变(当准备技能时)
{ if(m_StatusInfo == null) return ; m_StatusInfo.State = StatusState.Add; m_StatusInfo.SkillType = SkillType; EventCenter.DoEvent(NDEventType.StatusCG,m_SceneID,m_StatusInfo); }
1
bc2fb570da817c93e9d2cf66c914ad59
098c158d9bdadd8857e5cf3532810abe
Equal returns true if the two UUIDs are equal.
if want.Sec != actual.Sec { return false } if want.Nsec != actual.Nsec { return false } return true }
0
7e6b431bd647b3bea045b870cf7df379
9372da7638046a7dfddd6a57c96aec12
Initial RDKit setup.
MiscUtil.PrintInfo("\n%s (RDK v%s; %s): Starting...\n" % (ScriptName, rdBase.rdkitVersion, time.asctime())) (WallClockTime, ProcessorTime) = MiscUtil.GetWallClockAndProcessorTime() RetrieveOptions() ProcessOptions() DrawMolecules() MiscUtil.PrintInfo("\n%s: Done...\n" % ScriptName) MiscUtil....
0
a0c6f0b9511815e7c6e87a6be9b7c0a0
fe3a0fa2cc5fab592f07a947c3c13890
judge whether a string matches the pattern of a word or not
flag = True if re.findall(pattern="[a-zA-Z]", string=string): print("Invalid") flag = False return flag
0
c01ae7e13ad30c64c32bc4c7c623a5c8
c69d3aa903e2274a45dab9c912fd5008
Displaying resolved reports page
$reports = Report::paginate(); if(Auth::user()->hasRole('user')) { return view('report.view', ['reports' => $reports]); } return view('admin.report.view_all', ['reports' => $reports]); }
0
aab2798ae4cf077751c47080bc09bef8
03e90a6e93ae1af540c2ae9898bcff00
Support single host, one or more GPU training. Parameter distribution can be either one of the following scheme. 1. CPU is the parameter server and manages gradient updates. 2. Parameters are distributed evenly across all GPUs, and the first GPU manages gradient updates.
class MultiShareAdaptationV1(TrainerMultiAdaptation): def __init__(self, cfg,require_parameter=None): super().__init__(cfg,require_parameter)
0
2ace7f58d0a7fa3b8e4e37a4cfdc29a7
436065e7e7d48fdb9a7f2684cdeb1449
https://play.golang.org/p/XgrEodVwB6
func ClosingAChannel() { phrase := "I'd rather be fishing.\n" words := strings.Split(phrase, " ") ch := make(chan string, len(words)) for _, word := range words { ch <- word } close(ch) for i := 0; i < len(words); i++ { fmt.Print(<-ch, " ") } fmt.Println("The loop still prints because closing only closes t...
1
db5612e7918a56168e4ff18a9c670eab
6e81a1cc716cec6cc73dbcd43b932867
Losuje dodatkowe liczby, które nie dają poprawnej odpowiedzi.
{ var result = ""; var wors = im.Solution.Split(' '); foreach (string x in badWords) { foreach (string k in wors) if (k.ToLower() == x.ToLower()) result = result + "" + x; } List<s...
0
54dcff8d1987b426494a4b25b796b224
f36a439e4c6e05d0b1312184ad308b0c
Print an unsigned integer to the console as a decimal number.
void console_print_dec(uint32_t n, screen_color_t back, screen_color_t fore) { char a[32]; uint16_t count = 0; while (n) { uint32_t temp = n % 10; a[count++] = temp + '0'; n /= 10; } for (uint16_t i = count - 1; i >= 0; i--) console_putc_color(a[i], back, fore); }
1
d10e81b8ed9ac41149b92c52fc04f69a
7de1d06dd288212d797a6668010e09d8
Description 判断字符是否为单字节字符
assert len(uchar) == 1, "uchar 只能是单个字符" if u'\u4e00' <= uchar <= u'\u9fa5': return True else: return False
0
21cb445a77169a28cc62698d6df666c6
bc7dfd0e88cf89d2ff6568b7978ae9eb
Check the system dependencies and run conpy test suite.
def task_check(): return dict( actions=['python check_system.py', 'python -m pytest ../conpy/tests/test_*.py'], )
1
c85d77fc2394668ad5b6b5a2b8321044
f19deab5ed621236f1c2bb155c22d360
查询是否完成任务
int getTaskComplete(int levelId,Long uid);
1
c1b5234d55f820d2f9a0ab99b9d6254b
556fd7285b9e5288a7e05a2087acf8c5
Returns the value of field 'bibId'.
boolean isSetBiblCit();
0
a1b20e2ed0a4a8ad45084d3b350d5f61
b9d58f13990b0c6c89947af8122a858d
获取页面完成任务链接
class Constant public static getTaskUrl():string { return Constant._baseURL+"index.php?m=game&f=index&v=getTaskList"; }
1
777b5a3d5ed866fca6b9da90c0befa9d
a84bdf1550a0a1b5224211b405d0072a
Deletes all by access profile ID.
{ $query = SK_MySQL::placeholder( "DELETE FROM ". $this->getTableName(). " WHERE `profile_id` = ?", $profile_id ); SK_MySQL::query( $query ); }
1
93dce5affeeb154631cc45887783456d
9926cc5e9d7f46ae4125ed1d02a78a4e
get balance function returns the balance of the passed in account number
namespace Teller public class TellerController private double checkBalance(int accountNumber) { return aDatabase.returnAccountBalance(accountNumber); }
1
178d749a93ff4aa3d4fe43842fd6b570
9db91ba639c70b479a3bb39ad743ebf9
Check that correct stub code is produced when there are multiple stencils
def test_single_stencil_literal(dist_mem): _, invoke_info = parse( os.path.join(BASE_PATH, "19.4_single_stencil_literal.f90"), api=TEST_API) psy = PSyFactory(TEST_API, distributed_memory=dist_mem).create(invoke_info) result = str(psy.gen) print(result) output1 = ...
0
50295ade2d26f64fc9c6b3f16e314f08
cf70818007ffdcb68f5410017bd0331a
Get AI player information by id.
{ rAssert( id - MAX_PLAYERS < static_cast<int>(mNumRegisteredAI) ); return mRegisteredVehicles[ id - MAX_PLAYERS ].mVehicle; }
1
4fa32fe63b431474bf7d162edbf80150
6cb3677c0312240e2addd2994a21f5c4
returns true if the point resides int the texture rectangle
{ if ((x >= 1 && x <= texmodel.XMax) && (y >= 1 && y <= texmodel.YMax)) { return true; } return false; }
1
75a21e82cd817aebb14e7c453ca6aac0
4dcaf28768eb31d544098498cd2a376c
Учитывая массив целых чисел, верните наибольший разрыв между отсортированными элементами массива.
n = len(array) result = 0 d = {} for i in array: d[i] = 1 for i in range(n): current = array[i] while current in d.keys(): current = current + 1 result = max(result, current - array[i]) return result
0
c0630816116c8777e039c254c4644af4
a01d5c2e3fcd3dab2b162d7e9b1791b3
Test for retrieving a comment for a given file ID.
assertTrue("the corresponding comment should be retrieved", item.getComment(0).equals(comm1)); assertTrue("the corresponding comment should be retrieved", item.getComment(1).equals(comm2)); }
0
4529b990910e66f5c5d0bb28ec025a18
3751d3b88211f95123f9d774499ab10b
Function to test if <c>this</c> octagonal envelope intersects <paramref name="other"/> octagonal envelope .
{ int thisWidth = Tex.Width; int thisHeight = Tex.Height; if ( sr.HasValue ) { thisWidth = sr.Value.Width; thisHeight = sr.Value.Height; } int otherWidth = otherEntity.Texture.Width; int otherHeight = otherEntity.Texture.Height; if ( otherEntity.SourceRectangle.HasValue ) { othe...
0
5de4c11b7303c4ea2e29eff38ef6c6c2
230b0b74595b9374179c5be76f4c500a
Automaticka metoda, ktera prevede datum z defaultniho formatu DB do formatu pro CR.
class Utils static function toDBDatetime($original_dt, $original_format) { if(!$original_dt) return null; return Datetime::createFromFormat($original_format, $original_dt)->format('Y-m-d'); }
0
02a3bad68a46b086b9a6cd8dedbee5ae
ce7c694fd16ded2ae10910d11b134127
TO Ventilation constructor TOVentilationController constructor.
class VentilationController extends Controller public function create() { $serre = Serre::all(); return view('ventilation.create',[ 'serres' => $serre ]); }
0
166285883f3fe8ad08ec42ca1abcd71a
465b67fad2220b96c6e7d352a8fd8709
Check permission for CRUD operation on portal user record.
security = getSecurityManager() portal = getToolByName(self, 'portal_url').getPortalObject() return security.checkPermission(permissions.USE_LINK_MANAGEMENT, portal)
0
adc3484cdf34481a8367bf9377bda361
1920c6c249fcc7f666f9731b9d3dd8c4
跳转到地图管理编辑页面
class b2c_ctl_admin_order extends desktop_controller public function tomap() { $this->pagedata['finder_id'] = $_GET['finder_id']; $this->singlepage('admin/order/map/index.html'); }
1
e3ad90577fd261b4155be9f260e97e44
e277e7044432d84a8dd6c9b7c8435c92
Tells whether the StatusEffect is suppressed in a certain way or not.
boolean isEffect();
0
d388d137c13d427dc1df7dbffe6c5fae
8eaedc48874b76208f15069f5ea0be05
Ensure that URL is actually a GitHub URL.
function validateGithubURL(url) { return githubURLRegex().test(url); }
1
739005b554b235449e8a16bdeb5a64a1
13a6af35ba689afd842adf98a778f253
Constructor de la clase SecureResponseHandler. Realiza la autenticación y establece la información de usuario y acceso.
class Authenticate public function __construct(Guard $auth, ResponseFactory $response) { $this->auth = $auth; $this->response = $response; }
0
10a25b905ae85b235cbadd9aa6c4c5eb
5689b7b385cb180b246d786cb87a6016
method for inserting text to end of listbox
class ScrolledList(tk.Frame): def append(self, text): self.listbox.insert(END, text)
1
2ab13c9e29171fe7401ebfbd1ac96e38
13d537ba6dee59d2a3d108dcd8fb20eb
Se valida que el (nombre - marca) no se repitan
boolean resultado = true; if (contadorMarca==0) { resultado = true; }else{ for (int i = 0; i < contadorMarca ; i++) { if (nombre.equals(this.historialMarca[i].getNombre())) { resultado = false...
1
edc46f4ad7903a84d09f3c13f6cbf7b5
29282e35ab41824f2f0d364583c26288
! Adds a callback which is called after dragging is finished.
this EventTriggerListener listener, EventTriggerListener.PointerEventDelegate call) { listener.EndDragEvent += call; }
1
12845cecd9d69fbebd17bb363ec8f89e
b84b7820085071fd48280c1f85eae298
@brief Función de establecimiento de periodo de comparación para el módulo CCP1 como la configuración del temporizador asociado, la frecuencia del oscilador principal, etc.
void ecompare3_setPeriod(uint16_t period) { CCPR3H = make8(period,1); CCPR3L = make8(period,0); }
0
1801f916a8b562faf5cf11458462be18
6653b05d16094ec57a7f6b52ef2586bb
Does rotation curves have been computed?
{ if( rotationHistoryIndex == -1 || rotationHistoryIndex == 0 ) return false; return true; }
0
0027d9df3f5e1507a17bc9ce56652d61
2d2d0ff9da4bd0409e1e976b0b0d0a35
Run Bandage in parallel
int _tmain(int argc, _TCHAR* argv[]) { parallel_invoke( [&] { Reader(); }, [&] { Reader(); }, [&] { Reader(); }, [&] { Reader(); }, [&] { Writer(); } ); return 0; }
0
cc1fb9c1ecc65eb58149d16fad750a83
2c82a6998628a7296f61220f0d739cbe
Called when we successfully close the current worksheet and want to display the user home screen (i.e., worksheet list).
App.openHomeScreen(); var sidebar = (OS_IOS) ? App.Sidebar : App.HomeController.sidebar; sidebar.closeSidebar(); }
1
521da29af1becd6e320ff5821631fc58
be7ebc0e3b9e7bd6fd39c97c35ccbc8c
Returns a list of test hooks from a given list of test modules.
def list_tests(module): base_dir = _module_test_dir(module) return os.path.listdir(base_dir)
0
0db4c2603f2c4dd4ced16230e6b2fcd9
d863d385b01745968814d913023f45d6
Returns the 'rationale' property;
String getRationale();
1
5fe38bdb5d06cdd4b7a8ea67923c2375
5693edd2db6da454fc4c1539c54ff929
Converts the OMS port id into the original one provided.
( QtiTelephonyService_RILOEMSlotIdentifier RILOEM_slot_id ) { uint8 slot_id = QCRIL_UIM_INVALID_SLOT_INDEX_VALUE; switch (RILOEM_slot_id) { case QtiTelephonyService_RILOEMSlotIdentifier_SLOT_ID_ONE: slot_id = 0; break; case QtiTelephonyService_RILOEMSlotIdentifier_SLOT_ID_TWO: slot_id...
0
fd0e8b74f8f5d1064ccbc218f522b05b
5c2b7b2f4945694d4c0b649612f21345
Gets an array of entity permissions. The permissions for the provided entity type.
$entity_type_id = $entity_type->id(); $plural_label = $entity_type->getPluralLabel(); $admin_permission = $entity_type->getAdminPermission() ?: "administer {$entity_type_id}"; $permissions[$admin_permission] = [ 'title' => $this->t('Administer @type', ['@type' => $plural_label]), 'restrict a...
1
5c684970cd41251ce2e4d2e36c7362fb
69ea540a49bc47d5ac1fd1579d28eb21
Gets the average fulfillment time.
{ if (iNumTimes == 0) return -1; return iTotalTime / (double) iNumTimes; }
1
5e7239a88547881f47420fe93b9095b0
356adb6e2f1de7010dd304f456f118ed
Creates the list of predators for the first level.
{ Pendulum pendulum = new Pendulum(8, -17, random, 4, 2.4, 1.8, false, 0); spritePopulation.Add(pendulum); Platform platform = new Platform(8, -11, random, false, 2, false, 0, 0); spritePopulation.Add(platform); pendulum.AddChild(platform); ...
0
13f65b781fc7344152e5e3e3734c779b
b0cf14c76fea76285c69c2bbee351346
Set the Wholesaler Number
public class ATLAutoPremakeVO extends BaseVO public void setWslrNbr(String strWslrNbr) { m_strWslrNbr = strWslrNbr; }
1
f1e79e768494506f2ed98adf01e220e4
ff92be1bdf1e38630ad36f6335325a83
Function called after we have told the dealer that we have received the player token successfully. Get ready to receive the hand size from the other player.
class DistributedUnoGame(DistributedMinigame.DistributedMinigame): def d_wasDealed(self): self.sendUpdate("wasDealed", [])
0
f9e5d68f8e10ade64e464afc937a525c
3dcc4bd2a9735820ad958c7d104bd8e5
Chatworkへ送信するメッセージを生成する
{ foreach ($array_params as $key => $value) { $params[$key] = $value; } $params["random_id"] = $this->random(); $attachment = $this->getAttachment(); if ($attachment !== null) { $params["attachment"] = $attachment; $this->attachment = null;...
1
0c7fe5c5837dc7d2a3b8d7631d6d28ac
c650c9465e17356a24d4e4046fe4d1e4
@brief If called simply flash the blue LED to indicate an error.
void Error_Handler(void) { BSP_LED_Init(LED_RED); BSP_LED_Toggle(LED_RED); while(1) { } }
0
b3cef4ec3e90ad72a3f6a433e374a76c
eb031892a8d6786f04b5b1448de20870
Verifica a existência de um valor, e utiliza outro caso necessário.
class Mail private function getValue($input, $alternative) { if (empty($input)) { $input = Config::get($alternative); } return $input; }
1
5673dcd06e919c17062d89e4924675ee
685a9fdb18d3a19be8d3a8e1b65eca89
Calculates a bitrate to start the encoding process based on the target filesize and the length of the output video. The following formula is used to calculate the bitrate (Mb/s): target size (kB) / video duration (s) / 1024^2 * 8
total_bit_rate = self.dest_video_size * 8 / 1024 / duration video_bitrate = total_bit_rate - DEFAULT_CONV_OPTS['origin']['audio']['bitrate'] if video_bitrate < _MIN_VBITRATE: raise Exception( 'Can not compress origin file to limited size, filesize=%.1fMB, limited=%.1f...
1
e418622207375cda27f7b6b2f5b87dc8
66a909acb2d113febe51d95dbf610441
Set OnLocServiceCharges value
class VehicleAvailVendorInfoType extends AbstractStructBase public function setOffLocServices(array $offLocServices = array()) { foreach ($offLocServices as $vehicleAvailVendorInfoTypeOffLocServicesItem) { if (!false) { throw new \InvalidArgumentException(sprintf('The OffLocServi...
0
f06a083d186a48bfe0aad2a3efb3a078
6da8bf06f74e0ebb0fcad054ac4cf471
Returns the HTML code for a breadcrumb listing. Fill with crumb() and divider() elements (see below in this class.)
def breadcrumbs *crumbs content_for :breadcrumbs, content_tag(:ul, (raw(crumbs.compact.join("\n"))), class: "breadcrumb") end
0
e083a8b69c449f21c02f17f0336462a5
f4f57c30e71a919296fcc5a21a3db38d
根据header的MIME判断是否为html文件
switch (body.getHeader().getBodyPartContentType()) { case BodyPart.TYPE_TEXT: case BodyPart.TYPE_HTML: return true; default: return false; } }
1
1a5f226cd2623a5f6b571130dfc94369
5417eebae5580c8c759232199d957265
Sets media ref and updates parentage
void CBaseClip::setRefMediaId(ID id) { m_refMediaId = id; }
0