query_id
string
corpus_id
string
query
string
code
string
label
int64
8b051fbe84e72bcd49dd0ae6bba50dbc
0a424452b583832e59b797ae099c0725
先校验密码正确才进行更新
public class UserAction extends ActionSupport implements ModelDriven<User> public String update(){ Map<String, Object> session = ActionContext.getContext().getSession(); if (user.getPassword().equals("")){ String psd = ((User)ActionContext.getContext().getSession().get("user")).getPassword()...
0
862ba2b12b3431d414abda340e6bdedb
ca46e2e30a6bcae932c2e5e8bfa4eb5c
Event handler for camera video device on loaded event.
namespace LiveCameraSample public partial class MainWindow : System.Windows.Window private void CameraList_Loaded(object sender, RoutedEventArgs e) { int numCameras = _grabber.GetNumCameras(); if (numCameras == 0) { MessageArea.Text = "No cameras found!"; ...
1
d08c380ee63a1aff33760aa326a0da5b
5f64486fc43644f2e45700246666c532
タイルに対応したBBox文字列 "minx,miny,maxx,maxy"
const bounds = this.tileBounds(tileX, tileY, zoom); let sb = "POLYGON(("; sb += bounds[0]; sb += " "; sb += bounds[1]; sb += ","; sb += bounds[2]; sb += " "; sb += bounds[1]; sb += ","; sb += bounds[2]; sb += " "; sb...
0
81dd7ffd485b6685a875a0eaebb06b8d
2e393b82310c56939eca341b71ec7264
Presents the generated images in a window. Code referenced from http://hameddaily.blogspot.com/2018/12/yet-another-tutorial-on-variational.html
mean, var = enc(test_input, training=False) latent = final([mean, var]) predictions = dec(latent, training=False) print(predictions.shape) fig = plt.figure(figsize=(4,4)) for i in range(predictions.shape[0]): plt.subplot(2, 2, i+1) pred = predictions[i, :, :, :] * 255 pre...
1
de5e12045564632c298d25a731a09575
78e8e5668c149755d6951c4a2b136e3e
GET: Congres
class CongresoController extends AppBaseController public function index(CongresoDataTable $congresoDataTable) { return $congresoDataTable->render('congresos.index'); }
1
def67552e590af3896f99b3fb0bf4248
9343924d6e4d0b9abe29a6d5731bfd07
Convert string from unicode to native format (required in Python 2).
def u(object): if isinstance(object, unicode): return object return str(object).decode('utf-8')
0
8044189651c6fee6b1229bdce294452f
3899d13803240a52526e867ba8fa829f
Get the read preference for this connection
class MongoCollection public function getReadPreference() { }
1
18e48a848ba0e7b528ac1454dbc044d6
a42badd551834e37633d2c59762e8876
If current playershot is active and not null, follow player shot and emit particles
void UACMGA_Firebolt::EventReceived(FGameplayTag EventTag, FGameplayEventData EventData) { if (GetOwningActorFromActorInfo()->GetLocalRole() == ROLE_Authority && EventTag == ProjectileSpawnTag) { AArkdeCMCharacter* character = Cast<AArkdeCMCharacter>(GetAvatarActorFromActorInfo()); if (!IsValid(character)) { ...
0
4230a2bacf30f30900c54e74621a716d
984dea4af6f487021d4ed94378894b80
SetupDB configura la conexion con el servidor MongoDB
await mongoose.connect(config.Mongo_Atlas, { useNewUrlParser: true, useUnifiedTopology: true }); loggerConsole.info('conexion a la base de datos realizada!'); }
1
6cb9e40c1641f2d56c40ff1d8c03f65c
dbfbba3789da5b84ed586249922ab299
Remove tokens from a Spacy *Doc* object without losing associated information (PartOfSpeech, Dependance, Lemma, ...)
def process_document(doc): doc.processed = True delattr(doc, 'model_sents') doc = filter_invalid_sents(doc) return doc
0
05859d2b5d20556b1371c7f643f17e68
6861298a4045438ed6618b21dd92118d
Swap two bytes in-place in an alignment independant way.
byte src, byte dst[], word pos, word len ) { word t_pos = pos % 8; word bits = 8 - t_pos; ASSERT( dst != NULL ); dst += (pos+len-1)/8; if ( bits >= len ) { *dst &= (byte) ~MASK_B(t_pos, len); *dst |= (byte) (MASK_B(t_pos, len) & (src << (bits - len))); } else ...
0
b8f4cc2e5496a9149e388fa9cc3a62f5
b10f7d8df822f26c41f42f900fc291b6
2. Load all previously emitted events (including those that may not be ack'd on other chains yet)
func queryGet(ctx sdk.Context, keeper Keeper) ([]byte, sdk.Error) { res, err := codec.MarshalJSONIndent(keeper.cdc, keeper.GetEmission(ctx)) if err != nil { panic("could not marshal result to JSON") } return res, nil }
0
82aa5d25f7b84bb969f6b3770fabdce5
825f4333de0dfd729bc05f5618fd3edf
Recursively converts the PHP Pingpp object to an stdObject.
if (is_object($obj)) $obj = (array)$obj; if (is_array($obj)) { $new = array(); foreach ($obj as $key => $val) { $class = get_class($this); $k = $key; $fkey = trim( str_replace( $class,"",$k)); if( $fkey == "connection" || $fkey == "errors" || $fkey == "errorCount" ){ }else{ ...
0
a967769cc7c0a4b18055166d92aa250b
7c233df9d4e6f2d171d46c01d0b5c26b
After save record creates a new table or rename existing table
{ if ($this->isNewRecord) { $this->afterAdd(); } else { $this->afterEdit(); } return parent::afterSave(); }
0
87a515b5171f15fc2bb067ec2aafc117
688c97c954e8a71bb935bfee9090ba3c
Returns the number of sides on the base shape.
@Isolated public class Polygon extends ParticleObj public int getSide() { return side; }
1
122890fb1bc95551c17df336842343f4
52c25e5d3932ae4c9c998287fddc14ee
Check if the valid users CSV file exist
class CSVAdapter: def check_csv_exists(self): return os.path.isfile(self._complete_path)
1
163cd8568cc39cd3a1cc839116f5ec6d
07080e4cc14c63e90f161ab9410f5046
Moves robot by specified horizontal and vertical distances.
def moveRobot(x_inches, y_inches): x = inchesToMeters(x_inches) y = inchesToMeters(y_inches) angular_discount_factor = 0.65; rotation_threshold = 10; theta = angular_discount_factor * math.atan2(y,x) if (math.fabs(theta) > math.radians(rotation_threshold)) and (x_inches > CELL_DIMENSION/4): ...
1
f8c6f1248f7c4af5fb5656944c6c0326
8130f251e4dd639c6498031b696cf3a5
Change protections on kernel pages from addr to addr+len (presumably so debugger can plant a breakpoint). We force the protection change at the pmap level. If we were to use vm_map_protect a change to allow writing would be lazily- applied meaning we would still take a protection fault, something we really don't want ...
void pmap_kprotect(va, prot) vaddr_t va; vm_prot_t prot; { struct pmap *pm = pmap_kernel(); int64_t data; int rv; simple_lock(&pm->pm_lock); data = pseg_get(pm, va); KASSERT(data & TLB_V); if (prot & VM_PROT_WRITE) { data |= (TLB_W|TLB_REAL_W); } else { data &= ~(TLB_W|TLB_REAL_W); } rv = pseg_set(pm, v...
0
66daa9497ca8296948d070abaab2ebee
3d3fd9f5166a939295d47747a3bab565
Setter for <code>storeal.stl_footercustom_reinsurance.description</code>.
{ synchronized (monitor()) { check_orphaned(); org.apache.xmlbeans.SimpleValue target = null; target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(DESCRIPTION$4, 0); if (target == null) { target = (org.apa...
1
c91168f340ae78b8f2a88f8173b3e0ad
f5d84295294aabd389d2240300936cf4
Sets all resources which will be created to be initially selected
Iterator itemsToCheck = getInitialElementSelections().iterator(); while (itemsToCheck.hasNext()) { listViewer.setChecked(itemsToCheck.next(), true); } }
1
07b10dbefa891f6c4a5741b2c84f7894
2073a7a1adf53f7f14795fc3a508cbaf
Create an instance of {@link MonetaryAndCabinInformationDetailsType }
@XmlRegistry public class ObjectFactory public MonetaryInformationType createMonetaryInformationType() { return new MonetaryInformationType(); }
0
b192e032f6e53488f0436958509066bc
4aa9b6a121820036256a2ce8afb15fe6
@brief Verificação de quantos dias um mês especifico, num ano especifico, possui.
{ DiasMesesAnos dma; if (q1(datainicial) == 0){ dma.retorno = 2; return dma; }else if (q1(datafinal) == 0){ dma.retorno = 3; return dma; }else{ dma.retorno = 1; return dma; } }
0
6788dd0b1476fb4b909282fff646db34
da37d4fa8315be462386c9e86705459f
Given Ship_23_1_4, returns 23
{ int i; for (i = 0; i < Num_exited_ships; i++) { if ( !stricmp(name, Ships_exited[i].ship_name) ) break; } if ( i == Num_exited_ships ) return -1; else return i; }
0
48e38a1df201eccaaa6e09a347a7e517
f0b559f2cb29f25743460b4192d1fb21
Load a list of webforms available
class FrontCommsBulkSendModel extends AbstractCoreAdapter public function fetchWebForms($arr_params = array()) { $objForms = $this->getFormAdminModel()->fetchForms($arr_params); return $objForms; }
1
b4b447aa4ebeb5120db6244c3e874139
b370f529aa4661d17a6b7344144a4812
Converts each field value that is a Pytorch Tensor to numpy.
class ToTensor(object): def __call__(self, x): x = torch.from_numpy(x) return x
0
0b708a161cbc2d181d1660db2d93dadb
aa7960032a9e8d8032ff9bb43a4dca1e
Tests that a student is properly retrieved.
class assignment extends TestCase public function testQueryStudentById() { $studentId = 1; $request = $this->get('/assignments/api/v1/students/'.$studentId); $response = $request->send(); $data = json_decode($response->getContent(), true); $this->assertArrayHasKey('data', $...
1
c3b982f64548ba50c74907fb09fce47e
31579fde91f5cf5dc1def2630b288aaa
创建攻击结点
var img1 = queue.getResult("can"); attackImg1 = new createjs.Bitmap(img1); attackImg1.scaleX = attackImg1.scaleY = 0.2; attackImg1.regX = 124; attackImg1.regY = 324; attackContainer1 = new ui.Container.AttackObject1(); attackContainer1.addChild(attackImg1); stage.addChild(attackContain...
1
44830bb4232dca4d21d4c26926d064da
8278395d31b94bb2f1146883299ed783
擦除整个芯片的数据 由于芯片中的数据只能从1写到0所以 写了一次以后就不能写了 要先擦除 擦除成功后的每个字节都是 255
bool ee24_eraseChip(void) { const uint8_t eraseData[32] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF\ , 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}; uint32_t bytes = 0; while ( bytes < (_EEPROM_SIZE_KBIT *...
1
405c5830c7b8355b51a79e417a52f0b6
89fa6abaa7a372b78f6ab2a05f079092
Backs up pivot tables data.
namespace FamilyTree.Backend public class SettingsBackend public bool BackupData(DataSourceEnum dataSourceSource, DataSourceEnum dataSourceDestination) { var result = DataSource.BackupData(dataSourceSource, dataSourceDestination); return result; }
0
26425c9bad3e49d6b52c14897eb5aae7
2436a8efbc10f6d409c3979cf39960b1
获得当前公司的机票政策
{ StringBuilder strSql=new StringBuilder(); strSql.Append("select ID,Date,From_Code,To_Code,StartCity,ArriveCity,Mileage,Fule_Adult,Fule_Child,Line_Number,Share_Line,Company,StartCode,StartAirport,ArriveCode,ArriveAirport,StartTime,ArriveTime,AirRax,FuleRax,FuelAdu,FuelChd,Food,Food_Detail,Direct_Flight,Type,El...
1
7b166c8fed50dcc77e477e8a118b6069
2e1bbb5a8bc52934c0b6a1dd7b5d0d48
Function to get thresholded image using p-tile method
if (img.ndim == 2): mask = img>tol return img[np.ix_(mask.any(1),mask.any(0))] elif (img.ndim == 3): gray_img = cv2.cvtColor(img, cv2.COLOR_RGB2GRAY) mask = gray_img>tol check_shape = img[:,:,0][np.ix_(mask.any(1),mask.any(0))].shape[0] if (check_shape == 0): ...
0
7e3ae64f70674fb04f47c39be7b131e0
7a94da48bafb4fa13b3c6266512b9fac
删除会议成员
delete(e) { let that = this; wx.showModal({ title: '提示', content: '确定要删除这个成员吗?', success(res) { if (res.confirm) { wx.request({ url: requestUrl.requestUrl + '/jXAssociationApp/deleteByIdandUserIdS', method: 'get', data: { asso...
1
f5ef874c13dc6f158a67625c257d50d3
31c21b34a10ff90de7da32d7782efc3d
Initializes memory of symbols used in plotting.
class CustomChart: # noqa: H601 def initialize_mutables(self): ...
0
f3f2999439c17e9419c5d7d4f6c41d11
a08997220e30cdbb2c2ea8d7ec14e8c6
Returns the meta object for the reference list '{@link pivotmodel.EnumeratedType#getContains <em>Contains</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EReference getCompartmentType_Contains();
0
1ec420f356e84ac7a3737a3ecc422d78
fdcf132b455ee1c6219935986568cf1c
Cumulative sum. .. seealso:: :func:`itertools.accumulate`
class GroupBy(_GroupBy): def cumsum(self, axis=0, *args, **kwargs): nv.validate_groupby_func('cumsum', args, kwargs, ['numeric_only', 'skipna']) if axis != 0: return self.apply(lambda x: x.cumsum(axis=axis, **kwargs)) return self._cython_transform('cu...
1
1936bb2edce6113a8bf856f97ca748d2
d4f2b6518cb8b636c94b9516099455c6
Native invoker for Windows.Foundation.AsyncOperationCompletedHandler`1<System.Collections.Generic.IReadOnlyList`1<Windows.Storage.StorageFile>>
{ IAsyncOperationWithProgressCompletedHandler_2_tA4F57F1EBB7F0FE72729C419BC4E8E74147DF40A_ComCallableWrapper* ____asyncOperationWithProgressCompletedHandler_2_tA4F57F1EBB7F0FE72729C419BC4E8E74147DF40A = il2cpp_codegen_com_query_interface<IAsyncOperationWithProgressCompletedHandler_2_tA4F57F1EBB7F0FE72729C419BC4E8E7414...
0
5566bcb1a0b4996e4b64881c993ab35d
cfc91bd5602c591bf184a1bf7196e201
------------------------------------------------------------- 概要:スレッド一覧解析 詳細:subject.txtからスレッド一覧情報を作成する -------------------------------------------------------------
namespace Uzuki.Dialogs.MainWindow public partial class MainWindow : MetroWindow void BoardListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { StatusLabel.Content = "スレッドリスト更新中..."; GetThreadListAsync gt = new GetThreadListAsync(); _2ch.Board board = (...
1
52bc1a73be9ad03601abc4dca3b42e53
bad77efd46b9d3430a89332fb02cb753
======== RETRIEVE ========
class EventController extends RestController public function show(Event $event) { return parent::success(parent::SUCCESS, $event, '1 event was retrieved.'); }
1
cc42534b6a823bdcb08f32cfc467dab2
8f0527d48614aab39bda9d041d771766
Returns the list of pokemon species
class SpeciesList(APIView): def get(self, request, format=None): species = Element.objects.all() serializer = SpeciesSerializer(species, many=True) return Response(dict(species=serializer.data))
0
8a755bf96567fef2fdb77165097b2911
d47e1c27ccbe2f889c0fcd1457c01356
Making sure folder names are not too long when displayed
export class DiagnoseComponent implements OnInit, OnDestroy minimizeBreadcumbPath(pathString: string) { return pathString.length > MAXIMUM_BREADCRUMB_KEYWORD_LENGTH ? pathString.slice(0, MAXIMUM_BREADCRUMB_KEYWORD_LENGTH) + '...' : pathString; }
1
cda5b78385e16acb424e56914e3c720b
d4606b65c38a18b794065b608b6bf2f7
Starts and stops Ray. Uses the ray_configs stored inside ExperimentRunner to decide how to initialize Ray.
self.write_config() no_restart = not restart_ray self.config = commands.create_or_update_cluster( self.config_path, override_min_workers=None, override_max_workers=None, no_restart=no_restart, restart_only=False, yes=True, ...
0
0d392c832e16572c8f3f7353c872c454
091cba54eaca8c2fc8b789b42f7bf443
Set the synchronization scope ID of the given load instruction.
public function setScopeId(int $id) : void;
1
4807beb47420cb415a2d07fddf911cad
e201a1565e02d6525d70d580fbc8be93
获取最后一次构建的时间戳
long getLastToTime();
1
6d58b09e87f60f4182d96304e746a2d5
2128dc878842ff42ff9f6dca6ff81e29
Метод для получения списка заметок с указанным хэштегом
res = get "/search?q=%23#{tag_name}" build_note_array( res.parsed_response['notes'] ) if send(:ok?, res) end
1
eef12a7cee80620d979e18248cccface
9bff75bc71965b4bbaf84f3efe33c508
Enregistre un Diplome
$DB = MyPDO::getInstance(); $SQL = "INSERT INTO ".self::DB." (".self::DBF_DIPLOME.", ".self::DBF_USER.") ". "VALUES (:diplome, :user);"; if(($requete = $DB->prepare($SQL)) && $requete->execute([ ":diplome" => $diplome, ":user" => $user ])) { return true; ...
1
f94563b2a799da88065df6fd0c6dde8d
1a265dce899e7ffa2ec63275ee941b44
Get the contents of a file internally using an in memory output stream.
public function fileGetContents($filename);
0
d3d50944a6db607bf8c2c29f8d9f0612
afde56d508838d65d90a5f10d8028ad2
Is the ANSI92 intermediate SQL grammar supported?
public class AfmDatabaseMetaData implements java.sql.DatabaseMetaData @Override public boolean supportsANSI92EntryLevelSQL() { return false; }
0
42bcaa1b36ca71929362a4746e87faf2
e77f777ca3dcd48c430c971d2475524f
Determine whether the user can view any records.
class CustomerPolicy public function viewAny(User $user) { return $user->isAdmin() || $user->isSupervisor(); }
1
cc18c3899e8994d915c53fd4cd31aaef
0fa3aad2f6c4e5aeba7843c904f90550
Llamada cuando la actual ventana de la actividad gana o pierde el foco.
public class UnityPlayerNativeActivity extends NativeActivity @Override public void onWindowFocusChanged(boolean hasFocus) { super.onWindowFocusChanged(hasFocus); mUnityPlayer.windowFocusChanged(hasFocus); }
1
6e117b4338e666bccca41cdf0e968249
5999150effd65858f6233453b9df62d8
Number of item in tradepile
if(empty()) return -1; int count = 0; DEItem* item = start; while(item != nullptr) { count++; item = item->next; } return count; }
1
2fb4f81112e0fc133f1ec99dcf50e1b3
0431f46f1226568effec4f1a20b34833
handles objects colliding with a particle system so that they can flow around them
{ Rigidbody2D rb = collision.gameObject.GetComponent<Rigidbody2D>(); Collider2D collider = collision.gameObject.GetComponent<Collider2D>(); Collider2D objectCollider = GetComponent<Collider2D>(); if (rb != null) { Vector3 n = FlowForce....
1
d57cdccca68a50eca109323724906289
b1bb61a3281ffd0952d862a814de7f77
insert a sub-string to an exist string at a specific position
function insertAtPos(str, extrastr, pos) { return str.substr(0, pos) + extrastr + str.substr(pos, str.length - pos); }
1
687d475d7b54302205ca8b6702adeeab
e1ad89f23784f13fb33a29bbeced220d
| | Purpose - Kills the 'Current' process and notifies the parent of the death by | list. | | Parameters - the code to return to the grieving parent | | Returns - nothing | | Side Effects - changes the parent of pid child completion status list. | | This function is ONLY called by the 'launch' function ...
void cb_child_is_dead(int pid, int status, gpointer data) { ((app_elems *) data)->childisdead = TRUE; ((app_elems *) data)->childdeath = status; if (gtk_main_level() > 0) gtk_main_quit(); }
0
1e2d2db20287bd7145890949b1ab36eb
990031d21b10dbfbff3b9a29b0af3ec2
Implement the 'ObjectAccessControls: get' API.
def bucket_default_object_acl_get(bucket_name, entity): gcs_bucket = testbench_utils.lookup_bucket(bucket_name) gcs_bucket.check_preconditions(flask.request) acl = gcs_bucket.get_default_object_acl(entity) return testbench_utils.filtered_response(flask.request, acl)
1
0bd6766b158bd3fa6ad2d279928c5ab6
aed5a6408cca154d92c2c47ac6d7ad49
Gets max number of topics to be printed
public class IRCParser implements SecureParser, Runnable @Override public int getMaxTopicLength() { if (h005Info.containsKey("TOPICLEN")) { try { return Integer.parseInt(h005Info.get("TOPICLEN")); } catch (NumberFormatException ex) { } } ...
0
c8b6debcb7e338ce6e4ba720e25fdffb
13eb0743b278f95dcc4821a1f43d40c6
Carrying out a Coalescent Event
class Population(object): def coalesce(self): common_anc_haps = list(self.common_anc_haps()) new_haps = list(coalesce_haps(common_anc_haps)) for node, haps in common_anc_haps: for h in haps: self.haps.discard(h) coalesced = set(get_coalesced(new_haps)) ...
1
1515787650e9a6a440d334d5116a5128
6d892b1dd784147105d8f685567598ac
read todoList from filesystem
function readTodoList(){ BackandService.readAll().then(successReadList, errorHandler); }
0
91ca015fa0b03f0678c441188b4d5f92
86c1df7199af82cd05977cecefb57bef
Creates props the service should pass into children so the service can be called.
constructor(props: T) { this._props = props; }
0
a40ec09ab7651b3eadcc4dc54eee582a
cbd29e37eb0c4c8670438c2dfd3a66f5
自定义送心效果对象
local bufflv = self.level + 1 local customticks = 5 * 20 ActorHelper:addBuff(toobjid, 45, bufflv, customticks) end
0
fea5220c3cf377b87e4e4f92b7da60be
e50976589c8cd3996de94bf5f5477e56
a가 b보다 더 좋은 배치일 경우 true
public abstract class Metric public boolean isFirstBetter(double a, double b) { return MathUtils.isFirstBetter(a, b, isLargerBetter); }
1
257b9d1932a173e2f50a5e110087694b
798bc10e978fd0379ba38458255b54ef
Racunanje broja susednih flagovanih polja
short Field::get_flag_count() { return flag_count; }
0
12bb2dde7325325972216574715e7271
e907c94a9f450a3778c3f2f6835bff82
<pre> Config for the test case. </pre> <code>.google.cloud.dialogflow.cx.v3.TestConfig test_config = 13;</code>
com.google.cloud.orchestration.airflow.service.v1beta1.EnvironmentConfigOrBuilder getConfigOrBuilder();
0
e879195ebddb6b31d4087dc36fa9ebdd
e1cc20e58a5f1bedd1ec787e78c3556b
Signal Handler che gestisce la disconnesione del server, se dovesse avvenire in maniera inaspettata, sfruttando il segnale SIGPIPE
static void sigkillHandler(int signo) { printf("Saliendo..."); unlink(server_pipe_name); sleep(5); close(fifo); exit(0); }
0
4ec072a003b63327c82d67dd1177eef7
37e207f6687b01ff20aaca1a5d6b5db2
Function to create all neccesary data to run analysis on street volume and ticket results. Returns
outdir = find_outdir() notes_train = pd.read_csv( f"{outdir}saved_models/AL05/processed_data/full_set/full_df.csv") notes_test = pd.read_csv( f"{outdir}saved_models/AL05/processed_data/test_set/full_df.csv") notes_train['month'] = [int(m.split('_')[-3].split('m')[1]) for m in notes_train...
0
b4035ac99a4835a87826d664fd6ad45d
514890dccd5ed9a0256693d716ed1f18
checks whether units are adjacent for when attacking
int x = attacker.getX(); int y = attacker.getY(); int tx = target.getX(); int ty = target.getY(); if ((attacker instanceof Worker) || (attacker instanceof Soldier)) { return (Math.abs(x - tx) <= 1 && Math.abs(y - ty) <= 1); } else if (attacker instanceof RangedFighter) { return (Math.abs(x - tx) <= 2 ...
1
2e1b7a9dbf6da9751ae157371c22dcc1
94a3f77d06042abb014d2b74eb1a6719
파일 리스트 중 lnk 파일을 가져오는 함수
def name_split(lnk_files): file_names = [] for i in lnk_files: file_split = i.split("\\") file_name = file_split[-1] file_names.append(file_name) return file_names
0
a421246ab895693f0c00b25b134af9e7
1bd4b1202c8d24c4d4f6d1a4bb0de75f
双输入缩放平移变换层(Conditional scale and shift) 将x1做缩放平移,其中缩放平移量由x2算出来 返回变换后的x1
def scale_and_shift(X, g, b, e=1e-8): return X * g + b
0
37b659f6a8996086fe1a6ccb25a8354a
b10e85d51a992e57ddb39c33737eb23a
@brief 영웅의 특성트리를 초기화하는 비용을 계산함.
{ friendlyCreatureList = new GameObject[PublicLevel.friendlyTypeCreatureNum]; hostileCreatureList = new GameObject[PublicLevel.friendlyTypeCreatureNum]; friendlyCreatureManaCost = new int[PublicLevel.friendlyTypeCreatureNum]; hostileCreatureManaCost = new int[PublicLevel.friendlyType...
0
1a75fb39ad932441712de5c3257c814e
565db65ae5167a7f22d870e83cb950f1
clear specific bit(s) in a USB register
unsigned int addr, unsigned int mask, unsigned int val) { unsigned int data = dw_hdmi->data->dwc_read(dw_hdmi, addr); data &= ~mask; data |= val; dw_hdmi->data->dwc_write(dw_hdmi, addr, data); }
1
faca1f29047f156f0dc5f7eff7bbdfcf
e0405c3743b38f1f64ea06a027b579e8
Gets the value at the specified position in the multi-dimensional Array. The indexes are specified as an array of 32-bit integers.
class MultiDimensionalArray extends AbstractObject implements \ArrayAccess public function offsetGet($indices) { return $this->data[$this->getOffset($indices)]; }
1
9189594f0f44c1732d1cf30e07eb6968
2768590551eba70176c70483dbaf9665
creates a parse handler for parsing GPDB-specific cast metadata
CParseHandlerFactory::CreatePhysicalDMLParseHandler( CMemoryPool *mp, CParseHandlerManager *parse_handler_mgr, CParseHandlerBase *parse_handler_root) { return GPOS_NEW(mp) CParseHandlerPhysicalDML(mp, parse_handler_mgr, parse_handler_root); }
0
1336458c9f4bfb24a952a1f1f5e1ab7e
203be19235e31c7ec4bbaee376babca3
Validation of add correct new contact with full data
data = { 'user_name': 'Artem', 'contact': { 'name': 'Valera', 'messengers': { 'telegram': 'Val', 'whatsApp': '', 'viber': '', } } } result_in_db = { 'telegram': 'Val', 'whatsApp': '', ...
1
52c70be9ae27f9b464ae02375e488e61
02c0f4cb64a8afb571f8542e92234865
Sets Gan. The gift card account number (GAN). Buyers can use the GAN to make purchases or check the gift card balance.
public class User @JSONField(name = "giftcard_balance") public void setGiftCardBalance(final String giftCardBalance) { this.giftCardBalance = giftCardBalance; }
0
d52695a2eb9835f7d3c30cf2faf79604
9d5e08a140ab5a405c3de40789510b8c
Konstruktor der Klasse Database öffnet eine neue mysqli Verbindung mit den verbindungsinformationen aus der Konfigurationsdatei ../config/config.php
<?php class Functions public function __construct($database) { $this->db = new mysqli("localhost","root","it635root",$database); if ($this->db->connect_errno != 0) { echo "Error connecting to database: ".$this->db->connect_error.PHP_EOL; exit(); } }
0
1d65b54e0eb32e6d97f4a248a9b6fa58
3320b40b318c8267de4ab04df473e100
Checks if all items in a 2d list are lists.
def is_list_of_lists_empty(list_of_lists): return not any(list_of_lists)
0
bd5592ef019048b26e5672ee9623de6f
46eed17a353a3b32993120be3160a195
Test to see if a GPS second is a leap second
function dtlHadLeapSecond($ds) { return in_array($ds, [ '1971-12-31', '1972-06-30', '1972-12-31', '1973-12-31', '1974-12-31', '1975-12-31', '1976-12-31', '1977-12-31', '1978-12-31', '1979-12-31', '1981-06-30', '1982-06-30', '1983-06-30', '1985-06-30', '1987-12-31', '1989-12-31', '1990-12-31', '1992-06-30'...
1
c43877c1efdfc545f42ff1e845d20005
cfc3c91d2b7beec8c4f9b258f5148def
Updates an existing Host model. If update is successful, the browser will be redirected to the 'view' page.
{ $model = $this->findModel($id); if ($model->load(Yii::$app->request->post()) && $model->save()) { return $this->redirect(['view', 'id' => $model->name]); } else { return $this->render('update', [ 'model' => $model, ]); } }
1
b150d8867d90ca110401b47962221c9d
592f197c2b73ad481857f72cd2877a08
Filter transmission_events for node-links of interest.
def filter_transmission_events(selected_events, transmission_events): ret = [] for event in transmission_events: organism_group_one = event[1] organism_group_two = event[4] if organism_group_one in selected_events: if organism_group_two in selected_events[organism_group_one]:...
1
c6cd2b5ac9cc32ffe0867615512268fd
d45d56edcf3a1d2e0464bfbc54589b3e
Devuelve el tipo de fila, El ultimo elemento es el de loading
public class TipoFila public byte getFilapreferencial() { return filapreferencial; }
0
351fbed2e66547c299cd594b3360cbc7
a8550a1036dd96b4abd2756bd129ceb8
Gets the desired setting based on the properties of the test step and the known naming convention of the setting.
CTestSetPropertyStep::CTestSetPropertyStep(CTestBookmarksServer& aTestServer) : CTestBookmarksBaseStep(aTestServer) { SetTestStepName(KTestSetPropertyStep); }
0
e5607b61ab5d0a943df9b19dc737e1c0
df16cc52e2a67c962c24812aef88869e
Obtains a new results object. Includes getters appropriate for this RenameItem execution.
class Parse_Users_LinkNewUser_Execution extends Temboo_Choreography_Execution public function getResults() { return parent::getResults(); }
0
36a2d15cba045b61571a42496f196a38
197ddc0050a7b194d2c0d767da29f89d
根据Id来修改用户名,密码,部门编号等信息的处理
int i = userRepository.updateNameById(user.getLoginname(), user.getRealname(), user.getPhone(), user.getAddress(), user.getSex(), user.getUsertype(),user.getOrganusertype(),user.getDuty(), user.getUserid()); return i; }
0
a0fbe890a69d97c054cddb9c697ba501
8e8e7614c9b29b7aa32897ac1991b942
Set the cut levels so that the given percent of pixels in the given region of the image are within the low and high cut values. of image pixels within the cut levels.
scaleBinaryLow(l_uint32 *datad, l_int32 wd, l_int32 hd, l_int32 wpld, l_uint32 *datas, l_int32 ws, l_int32 hs, l_int32 wpls) { l_int32 i, j; l_int32 xs, prevxs, sval; l_int32 *srow, *scol...
0
5567f115ce74e1412fc47aabb5596ef4
ea753868befbb88ccbd0b064828a8f85
数量4を設定する<br>
private static void injectFour(final C value) { four = value; }
1
818079a86f9c96a04810dd4099d0e8cc
7b99fd270eb7c5ff4ee10a485789be07
杀死超时的job,这些被杀死的job后续在collectTerminatedScripts中将会被处理
namespace CSRedis public partial class RedisClient public Task<string> ScriptKillAsync() { return WriteAsync(RedisCommands.ScriptKill()); }
1
6e29a1fcec7fbd07b0b14ebbe93ab21c
a2825d4c6294d2add06777fdf522d3ee
Stop all running containers
@Configuration public class ContainerBean implements SmartLifecycle public void stopContainers() { for ( ContainerManager containerManager : containerManagers ) { containerManager.stop(); } isRunning = false; }
1
1c3dff7d1ea8d2c5536cd6b8387dfddc
c0c39b037c257d089e1fc5d14399790f
Writes the audio input stream memory buffer to an output stream.
public abstract void writeAudioBuffer(AudioBuffer audioBuffer);
1
0d5705c848a1445098a55a3470f95911
241a3e0f88737602a999606415b45b0e
职位验证,包含是否含有职位,职位是否过期,是否可以申请的验证
class controller_resume extends components_cbasepage private function checkResume($resume_id, &$is_show_name, &$is_show_linkway, &$member_info, &$member_expires, &$is_show_resumeinfo) { $service_company = new base_service_company_company(); $service_person = new base_service_person_person(); $service_resume = new...
0
c0e395f98773683130359c2a56c4e33a
b09d4cacf456f579d6fe23b5a81ee20f
Retourne les périodes d'un événement de campagne
class Calendar extends MY_Controller private function _get_event_dates($fields) { switch ($fields['recurrence']) { case 1: $recurrence = 'day'; break; case 2: $recurrence = 'week'; break; case 3: $recurrence =...
1
12bbb7320c41dfdd11fa4933155b3026
68a983879f016785a5913e82b14d01b2
hangi veritabanına bağlanacağımızı söylüyoruz.
class DAO static function connect() { $saglam = DAO::$con = new mysqli("host", "user", "password", "database"); if (mysqli_connect_errno()) { } mysqli_query(DAO::$con, "SET NAMES 'utf8'"); mysqli_query(DAO::$con, "SET CHARACTER SET 'utf8'"); mysqli_query(DAO::$con, "SET t...
1
d6ee2bb025cccf8bd15d83e344924340
0ed8720a9923f0e8f6ebbdb60f83d225
Configures the searchEngine's with a {@link Normalizer}
export class HNormalizer public constructor(scanner: LibScanner, logger?: NormalizationLogger) { this.#scanner = scanner; this.#logger = logger ?? new DefaultNormalizationLogger(); }
0
7412e1f3499f55796df8035f286dde34
948f21c7e36d28f8e52ff220b3535463
Копирование информации о клиенте в форму информации о заказе
namespace UI public partial class ChangeForm : Form private void ChangeForm_Load(object sender, EventArgs e) { var form = Owner; var table = (DataGridView)((Panel) form.Controls["panel2"]).Controls["ClientsTable"]; SurnameTB.Text = table.SelectedRows[0].Cells[0].Value...
0
064122930a7934319bc0e6d7525e4e50
9556397ccaa48ff71fcef5e89da2e7cd
retourne l'identifiant du client en session
class Maison public function getIdClient(){ return (int) $this->idClient; }
0
8472785f0dba6c78554770752797764a
879d60604e12a610f13f96bac10fce17
Test user is redirected to the sites login page
url = settings.MEDIA_URL + self.directory + '/' + self.filename + '/' expected_url = settings.LOGIN_URL + '?next=' + url response_detail = self.client.get( url, follow=True ) self.assertRedirects( response_detail, expected_url )
1
5b7272f8e001b819fed63b884e338aac
62aa18c17f0f063599ffe8eb46bc0242
Print Top N values (sorted by value), -1 means all
if n is None: return sorted(self.iteritems(), key=_itemgetter(1)) return _heapq.nsmallest(n, self.iteritems(), key=_itemgetter(1))
1
41cd6d46a829ea350e716400bee73d08
40fd9e4873abe460a9e276245a473e6a
Gets the offer the best matches the search criteria.
public class ProductSalesDataRec public List<OfferRec> getBestOffers() { return bestOffers; }
0
c91d7ebb8962d1b4783ba1d0cd525c36
699414cf355fd3ab3a54f21c18e32e6e
获取指定父级机构的所有子级机构后 进行排序并缓存
List<Organization>allOrgas = new ArrayList<>(); for(int i = 0;i < orgas.length;i++){ Organization orga = new Organization(); orga.setOrgaCode(orgas[i]); orga.setIsSelected(1); List<Organization>list = this.primaryMapper.getChildOrgaBySuperCode(orgas[i]); ...
0
6b6c4cd3d46e1facd9ea55f45778f536
fbd022e642edfeef55f134d9363dfd3f
根据索引字段生成查询条件 传入的对象中带@IndexAttribute注解的字段有值的都作为查询条件
final Class<T> type = (Class<T>) example.getClass(); return new Specification<T>() { @Override public Predicate toPredicate(Root<T> root, CriteriaQuery<?> query, CriteriaBuilder cb) { List<Predicate> predicates = new ArrayList<>(); EntityType<T> en...
0
47427ee788cb1d00d9af0e6c673a1ac2
17d7f3bff482af03c218a15006c34d2e
集合操作 - 添加元素, 如果元素已经存在返回false
export default class Set<T> add(element: any) { if (!this.has(element)) { this.items[element] = element; return true; } return false; }
1
83f0ba897babf395e8017854d4b947db
0f4ffc1307b0249cbc24776a6bb9813a
Updates image preview window when threshold for image processing has changed
class Ui_confidence_screen(QWidget): def SliderChanged(self, pix_array): i_class = gbl_fmd.i_class slider_val = self.threshold_slider.value() print(slider_val) gbl_fmd.class_list[i_class].threshold = ['binary', slider_val] self.LoadFailedFrame(pix_array)
1