query_id
string
corpus_id
string
query
string
code
string
label
int64
e129a0165043ddb461a11b61f7565aca
daa8b4853022202bf6c20d42cab11378
获取项目与对应爬虫的名称及数量
public List<Map<String, Object>> countSiteByCrawlerName ();
1
16e566fc0fe0333f92906f1d8e4b3d61
b6bc06be3407954837d93fca08618425
read the data into adjacency matrix and initialize some variables
cout<<"lolol"; int e = 0; isWeigthed = false; char * line = NULL; size_t len = 0; ifstream fp; cout<<"okok"; fp.open("inn.txt"); fp>>n; adjList.reserve(n); cout<<n; int start, end, weight; while (!fp.eof()) { e += 1; fp>>start; fp>>end; we...
0
53d89453cf4b9616fbd1fcf3d02976a9
db459e5d4d700f2972a78ab3b4c144ef
Area used to handle any third-party plugin conflicts
$options = aioseo()->options->noConflict(); if ( aioseo()->license->isActive() && $options->has( 'localBusiness' ) ) { return $options->localBusiness->locations->business->areaServed; } }
0
bb9114f3ed3bfa7f235766a1a0401d0b
93fdda35a6559d0c6adda20d6f9d814a
inverse Hammer-Aitoff projection
x_ref = make_3_tuple_array(x_ref) rf = 298.257223563 a = 6378137. b = a - a / rf if x_ref.shape == (3,): x_ref = x_ref.reshape((1,3)) x = x_ref[:,0]; y = x_ref[:,1]; z = x_ref[:,2]; lat = np.arctan2(z, np.sqrt(x**2 + y**2)) h = z / np.sin(lat) d_h = 1.; d_lat = 1...
0
5cd65981a2e5de378c4af0066345ee86
cc1e932cfe773312db88ba31c21369d3
Returns the meta object for the containment reference list '{@link de.tu_bs.cs.isf.mbse.recipe.Recipe#getWorkstep <em>Workstep</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getWorkItem();
0
5954cc645b985b721ad8daf10f181f98
ca98ea8322c5057f82b78f90908a75c1
认证推广收益
function calPromoterInviterEarnings(promoter, invitedPromoter, income, charge) { var royalty = globalPromoterCfg.invitePromoterRoyalty[0] var royaltyEarnings = (royalty * income).toFixed(2) var updatePaymentBalance = require('../Pingpp').updatePaymentBalance var INVITE_PROMOTER = require('../Pingpp').INVITE_PRO...
1
b7822c76ae5b76e0704c18a519c3d9b1
bbed7da274ce9ea0a2d4773013399a1f
This function is the entry point for the ``oTree-Launcher``.
def launch(project=None, logLvl='info'): app = QtGui.QApplication(sys.argv) window = FoundationUi(logLvl=logLvl) window.show() if project is not None: window.loadProject(project=project) sys.exit(app.exec_())
1
5f7f19d5db0a3d68231c8b82e1066e80
3e54082665997ede6614b8e5d68bdc9c
Creates a new Vacation model. If creation is successful, the browser will be redirected to the 'view' page.
class VacationController extends Controller public function actionDelete($id) { $this->findModel($id)->delete(); return $this->redirect(['index']); }
0
5941e8047db48a651daa88cd502d09d9
f32a32fc2e0fdddd8996e08289ccc849
Returns the name of the role from the agreement text.
String roleName = ""; try { int start_index = configRoleName.indexOf("*"); int end_index = configRoleName.indexOf("<"); if (start_index < 0) { start_index = 0; } else { start_index = 1; } if (end_index < 0) { end_index = configRoleName.length(); } roleName = configRoleName.substr...
1
e88e78aac1d1b76caaab1afc6252de63
e5611d0d62382724c9b0d88bfab33d8e
Creates a deep regression model.
class RegressionModel(nn.Module): def __init__(self): super(RegressionModel, self).__init__() n_feature = 1 n_hidden = 20 n_output = 1 self.net = torch.nn.Sequential( torch.nn.Linear(n_feature, n_hidden), torch.nn.ReLU(), torch.nn.Linear(n_hidd...
1
bdd2953fa7053501485bbc729e550c05
ce1514bc356c527c88892ea63906c5f2
Получить объект, который преобразует типы soap полей
class FieldDef(): def check_SOAP(self, tval): ptype = self.type_def() return getattr(self, ptype)(tval)
1
ed7b3b5e10f5ab9dbc8afbd705da04bd
d27c21232c4aaf85369f0344d0a15b01
Returns a queue with the postfix expression.
public class RegExpMatching private static String postfixOf(String exp) { String postfixExp = new String(); Stack<Character> oper = new Stack<Character>(); for(int i=0;i<exp.length();i++) { switch(exp.charAt(i)) { case '0': case '1': postfixExp...
0
aa5df7c847e8e54e172feb59c71dbf1b
28b65fcc0be4f2af7c7261c45ff92f3a
binary to hex conversion routine
{ bHex = bHex & 0x0F; if(bHex<=9) { bHex += 0x30; } else { bHex += 0x37; } return bHex; }
0
20f1aa2bb75ab3e2aa9f70420c6df7e5
0c8b13cd2f97756f9241aff98f5288ef
convert antenna name to number
chandict = {2412: 1, 2417: 2, 2422: 3, 2427: 4, 2432: 5, 2437: 6, 2442: 7, 2447: 8, 2452: 9, 2457: 10, 2462: 11, 2467: 12, 2472: 13, 2484: 14} return chandict[freq]
0
49d62772c34c824178bb4878c1c01174
8c7b71949f0a02e1730386ab264238c8
Lay ra danh sach Ten + Chuc vu tu danh sach Id staff
namespace BUS public class busChucVu public List<dtoChucVu> LayDanhSachChucVu() { return daoChucVu.Instance.LayDanhSachChucVu(); }
0
b7e711d8f0e1aef4e62adbcf7b5fbe46
accd80154784a01d68c748c3640e0b39
上传文件到临时目录,并上传到云COS(针对视频)
public class CrmVideoAction extends StrutsEntityAction<CrmVideo, CrmVideoManager> public ActionForward add(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { LazyValidatorForm videoForm = (LazyValidatorForm) form; FormFile file = (FormFile) videoForm.get("file"); ...
1
0a46c04c962ba28d7ed43f8e0698aaed
a9c35456b747698da2e749ba1d392140
한 점이 주어지면 desList에서 그 점에 가장 가까운 목적지를 구한다.
bool GisMath::gisDistToPoint( XYF4& pSrc, const vector<XYF4>& coordList ) { if ( coordList.size() > 0 ) { return gisDistToPoint( pSrc, coordList[0] ); } else { return false; } }
0
318002448d0d9090965d521779d0a27b
15394f60d860e9a0adbb09e595fd0cbc
Compile multiple raw profiles into a merged one so that authority-check is more efficient.
profiles = list() for result in results: profile = dict() profile["profile_name"] = result[0] properties = result[1] if properties is not None: for prop_key in properties: profile[prop_key] = properties[prop_key] ...
0
9e00c64498feadefed8d65c8b2f73eb0
8aab6810cc656860deeeaa775a0f5bbc
获取jenkins的主机地址
URL getJenkinsEndpoint();
1
b2f518c43b0319cecd65a5a40c8c2158
c423f40ca87a9f7e831f98be304c79ea
Construct a basic plane mesh along the XZ plane.
pub fn create_plane<'t>(texture_path: &'t str, transform: Transform) -> Mesh { let mut textures = vec![]; let mut uv_coords = vec![]; if !texture_path.is_empty() { uv_coords.push(UVSet::new( 0, vec![ glm::vec2(0.0, 0.0), glm::vec2(1.0, 0.0), ...
1
921d957bc5b9071dee72cb64c6a4d6cf
8df8eeac7362710679797ff06496dfe4
add the process to the queue for the io with the appropriate priority
{ pcb* temp; temp = (pcb*)malloc(sizeof(pcb)); L->num++; if(L->head == NULL){ L->head = newpcb; newpcb->next = NULL; return; } temp = L->head; if(temp->next == NULL){ if(temp->io_time <= newpcb->io_time){ temp->next = newpcb; newpcb->next = NULL; } else{ newpcb->next = temp; L->head = n...
1
b5e5468c262044cd5d05c7b4820f9bf1
bca79211e0def736c81453b525fe5f55
Get an XML representation of the given ITsString.
String toXml();
1
9c00d5cb4f145f479d0edbe2e566083f
6aded260b28c194fb881c6577dc22476
生成模拟数据(只有本地模式,才会去生成模拟数据)
public class UserVisitSessionAnalyzeSpark private static void mockData(JavaSparkContext sc, SQLContext sqlContext) { boolean local = ConfigurationManager.getBoolean(Constants.SPARK_LOCAL); if(local) { MockData.mock(sc, sqlContext); } }
1
f70258be7a5126f01a31f01a35529685
b178b01b57f612cb52d4fa0f82d73540
Put Value v at address addr. The lowest-level canvas-writing operation.
raster_put( r, x, y, v ) register struct raster* r; register int x, y, v; { register u_long* p; register int leftshift; if ( x < 0 || y < 0 || x >= r->width || y >= r->height ) return -1; p = RAS_ADDR( r, x, y ); switch ( r->depth ) { case 1: if ( v ) *p |= raster_bitmask[x & 31...
1
6c6cc72439fdc68caaf1719e75d4e2d1
a1f7ddc3d7a7dcc340e3e6c26f02451b
will return null if not in database
TypedQuery<Candidate> query=em.createQuery("SELECT c FROM Candidate c WHERE c.email=:email ",Candidate.class); query.setParameter("email", email); if ( query.getResultList().size()==0 ) return null; return query.getSingleResult(); }
1
9b2db51aa56f4f4e4b61a9dd20be6325
46832f762deed16aed499eb902ec7472
using passing arguments/parameters but no return value
function ourFunctionWithArgs(a, b) { console.log(a - b); }
1
e5be303c93cb5f044da2543654ee2f6b
252cbe7da8c49044d21ac2f3331dcdf6
Insertion d'un enseignant dans la base de donnée
public void add(String nom, String prenom, int idUniv, String passwd, Connection conn) throws com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException;
1
2b704d16e3f7f2c083edb826d473fd5e
6a8198ab6d7ebcb4e6d17f6c0fe74342
Removes all vector form the vector, but don't trims the capacity of the vector.
CSL_VectorRemoveAll(CSL_Vector* vector) { if (vector->items) { nsl_free(vector->items); vector->items = NULL; } vector->size = 0; vector->allocated = 0; }
0
970bbd87da25bc68dc82efba5294b48b
9dfd50cde6882641dc1bf38829981068
P/L
class SymbolsController extends AppController function lossandgain($filterType = 'gain') { $this->layout=''; if($filterType == 'gain') $orderBy = ' id DESC '; else if($filterType == 'loss') $orderBy = ' id ASC '; $shareStatusList = $this->Symbol->find('all', ar...
0
148e9d45f4b15ae5eae2d5fcf86b070b
129e938f07f4b3a4d0019f1dbdcee882
Gets (as xml) array of all "BGseY" elements
{ CE[] ret = null; try { Type[] t = this.getField(29); ret = new CE[t.Length]; for (int i = 0; i < ret.Length; i++) { ret[i] = (CE) t[i]; } } catch (System.InvalidCastException ) { throw new Exception(); } catch (NuGenHL7Exception) { throw new Exception(); ...
0
73985c9c1bc639f86887b26654a22cc5
403f2ba14c833b8e0c0d58c3c712bb9b
converts a string of space separated keys to an array of keycodes which can be used to check their states
function convertKeyboardState (s) { return { up: elem(UP, s), down: elem(DOWN, s), left: elem(LEFT, s), right: elem(RIGHT, s) } }
0
7c4d7fe4325cf93b2b37a6a58db1fc7f
f7ad04ea7cb49fccfd626f55a9dd4058
Return the list of paramters we can take derivatives w.r.t.
return [ 'sample', 'means', 'log_stds', 'std_param', 'normalized_means', 'normalized_log_stds', 'x_mean', 'x_std', 'y_mean', 'y_std', 'dist' ]
1
b8d04b7b0627e4116132a52c9cc660f2
ad3dc94c080dce458cf0b37685871bff
Pre-calculates the needed transform for the given frame.
void setupFrame(OriginalFrameInfo* &frame, TransformG t, PointCloudT::Ptr cloud_ptr) { frame = new OriginalFrameInfo(cloud_ptr); frame->setCameraTrans(t); }
0
6219e4f1a0caacb7e2dc63d640d62884
1e3bb61fda0750f19754eba8179a673a
支付成功后处理,清空订单和购物车
@RestController public class OrderController @PostMapping("/order/success") public String success(@RequestBody String xml){ System.out.println(xml); XmlHelper xmlHelper = XmlHelper.of(xml); Map<String, String> prepareResults = xmlHelper.toMap(); System.out.println(prepareResults.toSt...
1
2e15a87073fb9e3c823c8eb3f446b78c
4746edad7a01cc0d90d5cd4737a20534
Test if a boot time software SMI happened. This function tests if a software SMM interrupt happened. If a software SMM interrupt happened and it was triggered at boot time, it returns TRUE. Otherwise, it returns FALSE.
VOID EFIAPI TriggerRuntimeSoftwareSmi ( VOID ) { InternalTriggerSmi (RUNTIME_SOFTWARE_SMI_DATA); }
0
6f63119f547c49cc3a986d8c96a6c8bb
1c1c5e65eaf69acef191c99bcb31aaf5
Returns the meta object for the attribute '{@link at.jku.weiner.c.parser.parser.TypeQualifier#getType <em>Type</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Attribute_attributeType_feature"), getString("_UI_PropertyDescriptor_description", "_UI_Attribute_attributeType_feature", "_UI_Attr...
0
b37280762ad4bf5ce077c486e121822f
4d1211906cfbe48ccbb9cb8b1857ba2c
根据会员ID和时间范围查询自动投标记录列表
return userAutoBidDAO.listByLoanAndActivatedTime(loan.getRate(), loan.getAmount(), loan.getDuration(), creditService.getUserCreditByUserId(ap...
0
7a60f376d679900f73f4854c4891b4a2
a4191050ca0ec594b31fde000c25bd0b
Uninstalls combobox listeners that update decoration states.
for(ActionListener l : namesCombobox.getActionListeners()) namesCombobox.removeActionListener(l); for(ActionListener l : mjpegUrlTextfield.getActionListeners()) mjpegUrlTextfield.removeActionListener(l); for(ActionListener l : resolutionsCombobox.getActionListeners()) resolutionsCombobox.removeActionList...
1
e2906157652e90c009534c611c642af6
c04e4d5c7b1cd70a2888bd3687fd203c
*** 如果Domain Model Type等於View Model Type, 則不需要再做兩個物件的Property Map, 直接取得Domain Model對應的Column資訊 ***
{ Type sType = ObjectContext.GetObjectType( source.GetType() ); List<string> sourcePropertyNames = sType.GetProperties().Select( p => p.Name ).ToList(); List<string> modelProperties = modelState.Keys.ToList(); ignoreProperties = ignoreProperties ?? new List<string...
0
4b273ba4d6ee3bc30f9f674fd54dedde
133bdfd589727d439a3c776dae9161ca
sets time by using a DateTime formated string like "1979-01-01 00:00:00"
{ if (is_numeric($date)) { return $this->setFromTs($date); } if (is_object($date) && get_class($date) == 'VADateTime') { return $this->setFromIso($date->getAsIso(true)); } if (is_array($date) && array_key_exists('date', $date)) { $date = $date['date']; } if (preg_match('|\.|', $date)) { retur...
0
6de6b596f017c9e3594f90b90257fafa
5c4794feccb513c0c0038f5b846cc592
iniの値を文字列型で取得します。
namespace x360ce.Engine public static class SettingsConverter public static string FromIniValue(string iniValue) { var index = 0; var type = SettingType.None; return TryParseIniValue(iniValue, out type, out index) ? ToTextValue(type, index) : ""; }
1
8bdd6abd44ecfe41cf3bb3101eac0d3e
e0c08d2ed4fb1f82b0ec88bb11085987
Create a dictionary holding the character's equipment as the Character class holds it
class User_Character extends ArrayType public function GetEquipment() { if (empty($this->_info['equipment'])) { $list = Env::Get()->db->Get('game')->Query(' SELECT slot, item_template FROM character_inventory WHERE TRUE AND guid = :guid AND bag = 0 AND slot <= 18 ', array( 'gui...
1
160150f6e531a9993fff1efa4863dafe
33c96a682615ea05ddad450073f91bed
Drops the tables defined in the given database.
class Db extends PDO public function dropTables($aDrops, $aVals = array()) { if (!is_array($aDrops)) { $aDrops = array($aDrops); } foreach ($aDrops as $sDrop) { $this->query("DROP TABLE IF EXISTS {$sDrop}"); } }
1
e8c9468da9f5c49c2ab8c5faac777156
cf79bd8c6d90383cc3ed1ec84eaeac01
The BGP IP address on the Alibaba Cloud side.
class ConnectionBgpConfig(dict): def local_bgp_ip(self) -> Optional[str]: return pulumi.get(self, "local_bgp_ip")
1
2e5e21bef775f5a4fc3ba77667a35644
2987b6f2a3eb87f87458df499038ff24
이미지를 행을 분리시켜주는 함수
def transform_image(image): arr = [] for i in range(0, len(image), 28): arr.append(image[i:i+28]) return np.array(arr)
1
245e34b947c99ba745c06b6e79761869
885821369fe8ad087949cc8afd0a8e8f
Cette méthode met à jour un rapport de visite,
namespace HelpDeskManager.Wcf public partial class HelpDeskManagerService : IHelpDeskManagerService public virtual void UpdateVisitation(BOVisitation boVisitation) { boVisitation.Update(); }
1
9ee2d44dab3e6999f1769a893454eb94
5e48f25c2094303a93574f982b36d269
获取 司机编号2.
public class DriverMessageParam extends BaseParam{ public String getDriverid() { return driverid; }
1
1f1c92cac26198023338834d529d4e19
ee76645bb5a41e894c6845824a7128d2
Realiza Delete na tabela Formacao
class CreateFormacaoAcademicaTable extends Migration public function down() { Schema::drop('formacao_academica'); }
1
b0e82b8f828c0df7d60819e833fd4b22
15d5bf1498a5e85bcb2c7eff977efe2f
Read in metadata file (excel), creating: dict of {doc_id:patient_id} dict of {patient_id : [gold labels] }
with open(metadata_file) as in_file: header = in_file.readline() header = header.replace('"', '') header = header.strip().split('\t') sample_index = header.index('external_id') + 1 study_index = header.index('study') + 1 sample_to_study = {} for line in in_fil...
0
289dfa563830ce4ae24c1f86fdd37bb1
b47ca6930ac6131bb8bca06ed374a9a1
Hook handler: prevents fees category removal.
var i, isChecked = event.target.checked, isCharge = Utils.isValidEquals(category.type, 'CHARGE'); for (i=0 ; i < vm.bankOperations.length ; i++) { if (!Utils.isValid(vm.bankOperations[i].subCategory)) { vm.bankOperations[i].category.checked = false; } } if (!isC...
0
8366d17031745fd97b6e7987381a14a6
fedcb89f4fdcfcc597b69de1392b110d
For a particular API, generate the non-dispatchable-object wrapping/unwrapping code
class Parse: def generate_wrapper_api(self, api): prefix = self.prefix if prefix=="Trader": global methods_trader if prefix!="Cos": f=file('../_KSApi_%s/_KSApi_%s.cpp' % (prefix,prefix), 'w') f.write(u'/*\n'+__doc__+'*/\n') f2=file('../Run/KS%sApi....
1
fafacad2961acea97613ffc5ab147c22
24ba997c81e873567fd18e33ce70bdbe
16进制字符串异或
public class CyDataUtil public static int xorStr(String[] str){ int s = 0; int length = str.length-1; for(int i = 0;i<length;i++){ s^=Integer.parseInt(str[i],16); } return s; }
1
580716e0141ca80251457200fc108c32
4af217bc79a9d9d1031dba8151554d0f
display user who are in some way faulty
for s in all_subjects: if not s.is_valid(): print(s.userId + ': ' + str(s.is_valid_verbose()))
1
3f1c8ca185ec01f4cda0d45056c1e4a6
532fbcf25796e346223347c3f9e33a97
Возвращает количество секунд оставшееся до завершения суток
LocalDateTime max = LocalDate.now().plusDays(1).atTime(LocalTime.MAX); long seconds = ChronoUnit.SECONDS.between(LocalDateTime.now(), max); return seconds; }
1
a4b33fda6ff3be82fc70fde5d14bb335
f062262286dbdf0dd6e1961b6824a90a
Gives a brief introduction to the user and prompts them for a city to use as their starting location.
print('Hello! Let\'s explore some US bikeshare data!') while True: city = (input('\nPlease enter the city you are interested in (Chicago, New York City or Washington): \n')).lower() if city in CITY_DATA: break else: print('Please enter one of these Cities: Chicago...
1
6ae7004b91fce94d64966cef4b3edffd
c0d938479a27d135f77f55592995dd48
所有科室的设备数量
public List<Map> getdeviceCount(Map<String, Object> paramMap);
1
e1b947fe3db2ca84089e647c29aa8cc4
99d3c5e9fe51148db3bd4543f9fc9241
建立資料陣列 (公用)
class MessageModelTest extends DatabaseTestCase public function generateUserContent() { $this->usersContent = array(); $this->usersContent[0]['ixUser'] = 1; $this->usersContent[0]['sUsername'] = 'admin'; $this->usersContent[0]['nStickerType'] = 1; $this->usersContent[0]['sDes...
1
3e3e1fb47069d0b54d46057b07ac47f9
b3f65d60dc7c6ca6db4f33406cded20e
## Calculate the angular offset between two unit vectors
kut <- function (v1,v2){ acos(sum(v1*v2)/(sqrt(sum(v1*v1))*sqrt(sum(v2*v2)))) }
1
3b3c42d952bff472afa33ed226230b42
89c4a7e8c37248564414e1999166b1e2
sets the actual environment limit so an environment with size of 30x30 actually only goes from 0 to 29.
public class Model extends Observable public void setLimits(int xLimit, int yLimit) { this.xLimit = xLimit - BALL_SIZE; this.yLimit = yLimit - BALL_SIZE; xPosition = Math.min(xPosition, xLimit); yPosition = Math.min(yPosition, yLimit); x1Position = Math.min(x1Position, xLimit); ...
1
789c3c2c557599e700a33ee1d8555183
1e9008d0c947f47267aca3792d2da4ce
Provides the number of zero bits preceding the highest-order ("leftmost") one-bit this value, or 32 if the value is equal to zero.
{ var uintVal = (uint)value; if (uintVal == 0u) { return 32; } int numOfTrailingZeros = 0; while ((uintVal & 0x1u) == 0u) { numOfTrailingZeros++; uintVal >>= 1; } ...
0
00b8d56966c7806d99578609a6249979
eba9cac30b34180c532419707bb69889
美食修改执行控制器
$f_id = $request->input('f_id'); $prefix = config('database.connections.shop.prefix'); $sql="SELECT img_group FROM " . $prefix . "recipe_food WHERE f_id= ? "; $old_group = DB::select($sql,[$f_id]); $f_name = $request->input('f_name'); $water = $request->input('water'); $potassium=$request->input('potassiu...
1
845d403aa1f889964ffb400e74542fc6
94a57a60033d58fe0a2c8670b9534fab
remove the '#'
function trim(s) { return s.charAt(0) === "#" ? s.substring(1, 7) : s; }
1
c5644c2c50032c4cf95c1d3312916e59
e011301fa7361536cae206919a7aace9
Sets or updates the best score value in the local storage.
if (currentScore > bestScore) { bestScore = currentScore; bestScoreText.text = bestScore.ToString(); PlayerPrefs.SetInt(Const.BestScoreBall, bestScore); } }
1
9f64b890fa1393caf7e88aebfd42ff8f
c681c16e2abc71f43e9c1182662fb9ad
OR A,n8
namespace gb void Cpu::or_a_d8() { or_a(read_operand()); }
1
4dce4ea0e6eec444089de34611339c3d
0242f14394f349b15829f6d24a6d4e4b
Tests fetching nested bean declarations if none are defined.
public class HibernateFetchingIntegrationTest @Test public void testLazyFetching() { FetchingAppView fav = new FetchingAppView(); Set<OrderDetail> orderDetalSetLazy = fav.lazyLoaded(); assertFalse(Hibernate.isInitialized(orderDetalSetLazy)); }
0
72b2cec97a4f992bd04d4d142209bbe2
23f37e3ecb9856d159cc7ae8395d947c
Handles the mob's turn of combat, assuming the mob still has hp remaining from your attack.
monster.guard = 0 self.creatureattack(monster,player) player.trash = player.trash + player.hand player.hand = [] self.drawcard(5,player) player.energy = player.maxenergy player.guard = 0 self.turn += 1 player.endturneffects() monster.endturneffects() self.removestats(player) ...
0
3c2401534fa430f749f6319e60763f38
7f61448ad6da3ef0f9cb03f40c5be655
https://onlinejudge.u-aizu.ac.jp/courses/lesson/2/ITP1/all/ITP1_3_C
cases like (1)
0
59995c7b3953c5d71fdafa08f0defd44
0fe58db89efd8add55fe5867a7cc4a73
监听生成平台事件,如果有该事件,则执行DecidePath方法
class MultiProcessExecutor(framework.BaseExecutor): def on_execute_message(self, message): if message.name == "DECIDED_MESSAGE": self.on_pre_action(message) self._process_pool.apply_async(run_process, (self, message)) elif message.name == "IDLE_MESSAGE": try: ...
0
caab9c7a2855e4a437b870d5030d391f
0aec056d076b3d85383447049782f451
Set all the PIOs interfacing the sensor to user mode
{ PioSetModes(PIO_BIT_MASK(PRES_SENSOR_POWER_PIO)| PIO_BIT_MASK(PRES_SENSOR_SPI_MISO_PIO)| PIO_BIT_MASK(PRES_SENSOR_SPI_CLK_PIO)| PIO_BIT_MASK(PRES_SENSOR_SPI_CSB_PIO)| PIO_BIT_MASK(PRES_SENSOR_READY_ACK_PIO), pio_mode_user); PioSetDirs(PIO_BIT_MAS...
1
2b5cb30df92d23d95ad4e089164f1683
e3470f254afa5eac21afe46684fe0d1a
BLOQUEAMOS ALGUNOS MODULOS PARA EVITAR ACCESO PERMITIDO A VENDEDORES: ESTE METODO SE EJECUTA AL LOGUEARSE PARA PINTAR EL MENU
Menu.setApplicationMenu(null); modulos = new BrowserWindow({ width: 1200, height: 1000, icon: __dirname + "/icons/favi.png", webPreferences: { nodeIntegration: true, nodeIntegrationInWorker: false, webviewTag: true ...
0
bdfb0ceeccb98bfc5be89aa783cffa75
e4d437616f064eb3fc1af2b382761b85
Handle the GUILD_EMOJIS_UPDATE event.
data = payload['d'] gids = await self.user_storage.get_user_guilds( self.state.user_id) for guild_id in data: try: guild_id = int(guild_id) except (ValueError, TypeError): continue if guild_id not in gids: ...
0
5315ce9cb5c2e7a5d5ffd3b86714a519
1ab247ddd399a27db2fd0fc869140c38
replaces all numbers with their written equivalent
public class Main extends Application public String[] convertNumbers(int[] numbers) { String[] numWritten=new String[15]; int j=0; for(int i=0;i<numbers.length;i++) { if(hashMap.containsKey(numbers[i])) { numWritten[j]=hashMap.get(numbers[i]); ...
1
bfa17a5080723e2fac5295d6c51813ce
3da562044c678fec33744430f4b83ba0
double型の変数2つをintに変換するためのメソッド
class GA(): def cal_int(self,x_bin): x1 = x_bin[:11] x2 = x_bin[11:] x1 = int(x1,2) x1 = x1/1000 x1 = x1 - 1 x2 = int(x2,2) x2 = x2/1000 x2 = x2 - 1 return(x1,x2)
0
aa53b6e32c234482e8b951ee975e8d8b
b37c36df0e5bedd964aceaedde02e89a
Find progress status by configuration
path = os.path.join(dirpath, conf.statusfilename) f=open(path,'r') lines = f.readlines() f.close() if lines[-1].split('::')[0]=='okay': return (True,"") elif lines[-1].split('::')[0]=='fail': reason = lines[-1].split('::')[2] return (False,reason) else: raise ...
1
7c2e952c33f26b99fd44d2e2f737017e
35d180e1f7fc2758b7c9f23eec33dc96
Redefine an already defined class method
a = A("instance_param") a.classMethod("classMethod sentence") a.classMethod("changing classMethod sentence") A.classMethod("classMethod sentence") A.classMethod("changing classMethod sentence")
0
09be6a773bc85d52613d07e024603e94
6f073422ccc35d5316b8be3c4f058a71
根据areaid查询areaname
class ManagerAreaService extends Model{ function queryAreanameByArea($area){ return M("ManagerArea") -> where("area = $area")-> getField("areaname"); }
0
cf5c530d138b001706890d466311f5c6
e62d2fce66216b2c4dc9cf6f263bdbbf
Outputs one or several downsampled and cropped snapshot of given coordinates
class X264Codec(media_attrs.VideoStreamInfo): def snapshot(self, start: float, height: int) -> str: try: if 0 <= start < self.duration and 0 < height <= vargs.VIDEO_HEIGHT: outpath = f"{tempfile.mktemp(dir='/tmp')}.jpg" self.tmpfiles = outpath c...
0
2bdb62c52beaea066f89169f8991cfc3
8b01d36fa587fe61d3631e1fac0c436f
切换到新打开的tab页面,#同时关闭原有的tab
class Uis_tools(start_uis_test.Global_unit): def move_to_new_active_tab(self): driver = self.driver driver.switch_to_window(driver.window_handles[-1])
0
9369341a1f1a3b3d277cbf7d41a5d00e
c607ce4d941901b066faee7d1094cd16
when a button is selected, deselect all others
var buttons = document.getElementsByClassName(className); for (var i = 0; i < buttons.length; i++){ buttons[i].classList.remove("selected"); } }
1
08dc7efec99ebbdfaa3f339eae7ce9c8
b6f9dbaf7fb7e5c4ce980b01acfc3228
Select the next student
var nextStudent = student.next(".student"); if (nextStudent.attr('id') !== undefined) { var id = nextStudent.attr('id'); student.find(".studentInfoOverlay").removeClass("isOpen"); var node = $('#' + id); if (node.length) { node.attr('id',''); } document.location.hash = id; node.find(".student...
1
d8ea4d55a694045af8434a25b7f8bc1c
ccea073df70c21ff010c68f228790cba
Notify callback function for `set_plane'.
public class App3D extends AppD public void setShowPlaneSelected(JCheckBoxMenuItem cb) { GeoPlane3D p = (GeoPlane3D) getKernel().getXOYPlane(); cb.setSelected(p.isPlateVisible()); }
0
7fea9a75b4b723c5a0612c82eb4a7d2d
a8c0ec68bbc2b3785a885859595866a2
批量创建记录 <p> 注意:该方法并不标注为事务性,由调用方决定隔离级别。 建议{@see org.springframework.transaction.annotation.Isolation.READ_UNCOMMITTED} </p>
BulkResponse bulkSave(List<T> list);
1
167088702bab47d113e541fbb00071b1
cea90f1767555bbd5ef5168d3f56928c
Render a form to update an existing placeapi.
class PlacesController def update @place.update(place_params) head :no_content end
0
2c25927f3f73377a01a6a34a15b1ea8b
956f81f07e2e0c750b06c86cec631dea
Register instances of Prometheus metrics with the given registry.
func registerMetrics() { prometheus.MustRegister(proxy_roundtrips_total) prometheus.MustRegister(proxy_roundtrips_latency) prometheus.MustRegister(proxy_service_node_status) }
1
ea2e2edd75209907ee00bb2b40bc9c87
fc24de696a87b00bdd34fe523dd252d3
Street name type like ST, LN.
public final class CitizenAddressAttributes public String getAbbreviatedStreetType(){ checkNLoad(); return abbreviatedStreetType; }
1
3746f56726d5b73ca2ac43e56e5df53f
6ee6fa53eab0ddbe7c2fb5905c26c9e0
使用梯度下降算法优化参数w和b
lr = 0.01 initial_b = 0.1 initial_w = 0.1 num_iterations = 1000 [b, w]= gradient_descent(data, initial_b, initial_w, lr, num_iterations) loss = mse(b, w, data) print(f'Final loss:{loss}, w:{w}, b:{b}')
1
e6cb6f426e6840038edbec63a4cef72a
b46e2795886b955a8ce8d4342cf60e09
Funzione che deseleziona il draftpawnvfx
export class PositionFormComponent implements OnInit,AfterViewChecked noDraft() { this.position.active = true; }
0
aa3b79dccdbcf738d7cc7682dbde3c74
4c290a29350fd466988d05b0a51a60be
Inicializa las tablas en modo resposinvo
public void onCreate(SQLiteDatabase sqLiteDatabase) { sqLiteDatabase.execSQL("create table " + TABLA1_NOMBRE + " " + "(ID INTEGER PRIMARY KEY AUTOINCREMENT," + "NOMBRE TEXT," + "CARNET INTEGER," + "EMAIL TEXT," + "CARRERA TEXT,"...
0
14c019369c3fb7023b549d5aec7e6b49
be3b7c4f266322308893fa797ad6f376
단어 태그, 작성자를 추가한다.
public class ManagerService public int addTag(String tagName) { Connection conn = getConnection(); int result = new ManagerDao().addTag(conn, tagName); if(result > 0) { commit(conn); } else { rollback(conn); } close(conn); return result; }
0
827d6b5b4d324f5b8fe4acc9d30278b9
6f0db270b4d0dd1d4ee8b824e3b92504
Calculates the sum of all prime numbers between the two params.
int end, beginning; scanf_s("%d", &beginning); scanf_s("%d", &end); beginning = abs(beginning); end = abs(end); if (end < beginning){ swap(&beginning, &end); } allPrime(beginning, end); return 0; }
0
830754e2a7f8d89c61a0f0e5fa78bfda
692f02f51f28fcf542600171b811064d
DB에 멤버 테이블을 생성하는 메서드
String constraint = ifNotExists? "IF NOT EXISTS ": ""; db.execSQL("CREATE TABLE " + constraint + "'USER_INFO' (" + "'_id' INTEGER PRIMARY KEY ," + "'UID' INTEGER NOT NULL ," + "'LOGIN_NAME' TEXT NOT NULL ," + "'LOGIN_PWD' TEXT," + ...
1
248e0c89b5655495621dd8f686164af5
7f61448ad6da3ef0f9cb03f40c5be655
Index method
cases like (1)
0
3e362871cfb0187b1b317a5750398cd7
be04858f6dc9d5c319b9c53112f28f85
Turns on the LED on the top of the Arduino Nano (pin 13)
def pulseOn(): GPIO.output(11, GPIO.HIGH)
0
8c6f9891046b4ecb231e1ff7f8e51651
3bd507f2615d77bcf7fb93ad3ff1ca9a
Combination send/receive a dictionary to/from the kernel using the specified ioctl.
{ switch (fd) { case FD_STDOUT: return (int)com_tx_block(debug_iface, buf, (size_t)len); case FD_STDERR: return (int)com_tx_block(debug_iface, buf, (size_t)len); case FD_DLNK: return (int)com_tx_block(data_iface, buf, (size_t)len); default: return 0; } }
0
b1eaeb82d9fe68819f444e3f7aece70a
4dde85c0767715ad89f2074cb1e30910
Returns dummy context features.
def dummy_inputs( key, config): return { "input_ids": jax.random.randint( key, (config.train_batch_size, config.max_seq_length), minval=0, maxval=10), "type_ids": jax.random.randint( key, (config.train_batch_size, config.m...
1
b274bf328a21bd4efe419f8a238d92ec
cedb95dae9835751c87430989d013b05
Compute 3D points for plotting one ellipsoid.
res = int(np.ceil(math.sqrt(n))) theta = np.linspace(0,2*np.pi,res) phi = np.linspace(0,np.pi,res) x = model[3]*np.outer(np.cos(theta),np.sin(phi)) y = model[3]*np.outer(np.sin(theta),np.sin(phi)) z = model[3]*np.outer(np.ones(res),np.cos(phi)) X = x + model[0] Y = y + model[1] Z = z...
1
fbd16f57a0819451b354705da3f79235
35ea1c8e0be20c9742b1f62884723d5e
Set the public key we should use when talking to the given destination address (including port).
def setpubkey(rpc_connection, pubkey): pubKey = rpc_connection.setpubkey(pubkey) return pubKey
1
27aca95c2492296c394c6a51e2d16b4f
a18292331ea33d796b4a6e9a00f42e4e
该方法是通过24降水对3小时指导报的数据进行调整 假定24降水的格点数,经纬度范围与3小时的是一致的
GridModel gridModel = new GridModel(); DecimalFormat df = new DecimalFormat("###.0000000"); String description = gm.getDescription(); String parameter = gm.getParameter(); String year = gm.getYear(); String month = gm.getMonth(); String day = gm.getDay(); String batch = gm.getBatch(); String timelimit...
0
8586ce8fdd2b5ee5455c97c20f18199a
c72371044feb94b205df3ef3330fc48e
Configure UART0 with a baud rate of 115200 bits/s, no parity, 1 stop-bit, and 8-bits of data
initUART0(void) { ROM_FPUEnable(); ROM_FPULazyStackingEnable(); SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); GPIOPinConfigure(GPIO_PA0_U0RX); GPIOPinConfigure(GPIO_PA1_U0TX); SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); UARTClockSourceSet(UART0_BASE, UART_CLOCK_PIOSC); GPIOPinTypeUART(GP...
1
2d9a3ed588ede1cdc01d6a2861e61434
6b8cb20895c23eca60ada7a13a7b0f6f
NOTE: Taken from http://stackoverflow.com/a/6940314
def which(program): def is_exe(fpath): return os.path.exists(fpath) and os.access(fpath, os.X_OK) and os.path.isfile(fpath) def ext_candidates(fpath): yield fpath for ext in os.environ.get("PATHEXT", "").split(os.pathsep): if ext: yield fpath + ext fpath, _ = os.path.spli...
1