query_id
string
corpus_id
string
query
string
code
string
label
int64
557617a2dd436850a474103840ccb97e
3ec88b9199133bad77befe0fdc1bf1e4
<p> Creates a batch inference job. The operation can handle up to 50 million records and the input file must be in JSON format. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/creating-batch-inference-job.html">Creating a batch inference job</a>. </p> Provide a valid value for the f...
try { String endpoint = getRestEndpoint(); Transport transport = config.createTransport(); endpoint = endpoint + "job/" + jobInfo.getId() + "/batch"; String contentType = getContentTypeString(ContentType.CSV, false); if (charSet != null) contentType = ...
0
6b463d8000765492c61529713b044094
178aabd99a6b54e57675653d0a370ea3
Private slot to switch the status monitor thread to On.
class VcsStatusMonitorThread(QThread): def checkStatus(self): locked = self.monitorMutex.tryLock() self.monitorCondition.wakeAll() if locked: self.monitorMutex.unlock()
0
4e31d9b810eddce8c5ae8956c109d906
e426937d557bab1395227340dea1dab9
converts hkl (U31,U32,U33) to colour in cubic stereographic triangle
def hex_to_cube(h): x, row = h z = row - ((x + (x & 1)) >> 1) return ( x, -x - z, z )
0
db1f10b8ae6556d0b6c54135a25f5678
134a91d308d501b837a2deb32e45765e
停缴参保人详情
class Retires extends Common public function detail(){ $where = [ 'U_ID' => $this->_loginInfo['U_ID'], 'PREPAY_ID' => input('post.prepay_id'), 'IS_LOCK' => '1', ]; $info= db('Retire')->where($where)->find(); $info = array_merge($info, getCItyNam...
1
c4024cdb77dec11202af384ae5359bb7
ad194b338629304728b360c61ede4bbc
Gets the node settings object.
public static function GetSettings($Obj);
1
715b7e4f63df44ceba7bb0046f40ada4
be10017a7e4f1d5b9b1611622a8de8d2
sorts an Integer ArrayList aList to find the smallest value. changes all of aLists elements to the smallest value.
public class CollectionsMethods public void allSmallestElement(ArrayList<Integer> aList) { Collections.sort(aList); int smallest = aList.get(0); Collections.fill(aList, smallest); }
1
1984bccdb3349556394e36681c2f2545
8c45d22f21943de80565202691a32983
Returns whether the value of the '{@link org.switchyard.tools.models.switchyard1_0.spring.ThreadsDefinition#getMaxPoolSize <em>Max Pool Size</em>}' attribute is set. <!-- begin-user-doc --> <!-- end-user-doc -->
boolean isSetMaxQueueSize();
0
f60b7db839d7e45b0663b69a67f9000b
38337104e5ceeada8592a4b3d7a538ff
Inits chat online users web part functionality
$.ajax({ url: 'https://spravka.000webhostapp.com/consultant/class/load_users.php', type: 'POST', cache: false, error: function(){ }, success: function(html){ $('#users_in_chat').append(html); var guest_count = $('....
1
482ba58fdad8a7e4c05ea2fd12203717
09f8d44babb29d528f17c91c61681e89
使用KV键值对的简写访问仓库信息
public class LocalRepositoriesPool public RepositoryInfo getRepositoryInfo(String key) { lock.readLock().lock(); try { return repositoryInfoOf(getRepositoryDef(key)); } finally { lock.readLock().unlock(); } }
1
05594308d7520ee8502411125276eed6
6d2d094e725d7e7a8bf0027fbfb17d12
GET: PaymentRequest
{ ViewBag.PayMethod = new SelectList(db.PaymentTypes, "PayTypeID", "TypeName"); return View(); }
1
cd00ecd5638488470386cae44de02b74
5b097e9e643b1153dcbdc8f80ec78bf3
Generates a Replay version of the current module. Returns null if the module has no data.
public abstract class Module public ByteBuffer getModuleInformation() { return null; }
0
81b5a33e4ad0c3d04434e286e462ddc5
d675a875877a5053ef860ffa7c60ec31
go back up in crumbs
crumbsBack(state, data) { state.crumbsIndex -= 1; if (state.crumbsIndex == 0) { state.crumbsIndex = 1; return; } console.log("队列:", state.crumbsCache, state.crumbsIndex); state.crumbs = state.crumbsCache.slice(0, state.crumbsIndex); console.log(state.crumbs); co...
1
3c60f85fcba714011ee89373cc13646a
5d7d7df052b9c2c3742cab4c4f5c275e
() -> None Clears the contents of the zip folder.
class FSCache: def clear(self): if os.path.exists(self.folder): shutil.rmtree(self.folder)
0
4ca62e02ed00dfe0dc9c02bfa22260a7
80e052a2aa487c0aeeca4be0b417bc59
D2H
function d2h(d) { return d.toString(16); }
1
8f46a28b53d70ddfdc9194bb49bc086f
424887d2716860a3ce6ea21ee90b09fa
Adds a configured test logger, based on Serilog, that collect logs.
namespace AutomateIt.Logging public class TestLogger : ITestLogger static void ConfigureServices(IContainer container) { using (var scope = container.BeginLifetimeScope()) { ILoggerFactory loggerFactory = scope.Resolve<ILoggerFactory>(); loggerFactory...
0
2e6d481b865a598ada3915135b960db4
68e4b6672d31de1ad74391f0c71e0030
获取 权限所有者类型。 <p> 1:用户;<br /> 2:角色;
public class SysPermission implements Serializable public void setOwnerType(Integer value) { this.ownerType = value; }
0
db60ddf47db47a17ea0cab3b3d563450
7c7fef9de7a3742b128ecd00fde6cff8
Given two postags, give the log transition probability of P(tag1|tag) Please refer the `foundation of statistial natural language processing`, Chapter 10
class HMM: def tlprob(self,state1,state2): if self.transition_PD == None: self.transition_model(self.train_data) return self.transition_PD[state1].logprob(state2)
1
47bc0e133b9c7f07b9f56d23027fb32a
10c5c125deacfd2bf842e67c51c6e227
Get translation in given language or in any of fallback languages
function get_trans( $key, $view = '' ) { $l10n = App::getInstance()->getLocalization(); $view = ( $view ) ?: get_view_name(); return ( isset( $l10n[ $view ][ $key ] ) ) ? $l10n[ $view ][ $key ] : ''; }
0
521d1137591e98edd4ffdbcd461d7276
79e571c7082ecb9481308149d3783d4b
Check to see if looker is looking at the targetPos Shamelessly stolen from: https://answers.unity.com/questions/503934/chow-to-check-if-an-object-is-facing-another.html
public class CameraController2 : MonoBehaviour void LookAtTarget() { Quaternion targetRotation = Quaternion.LookRotation(targetPos - transform.position); transform.rotation = Quaternion.Lerp(transform.rotation, targetRotation, position.cameraLookingSmoothTime * Time.deltaTime); }
0
02ed577fb6e5c46ee2e3f863bddfe6cd
891f49141f9e84251a92e0e11c4cacb5
域名转换为ip
u32 getipbyname(char *domain) { struct hostent *host = net_gethostbyname(domain); if(host == NULL) return 0; u32 *ip = (u32*)host->h_addr_list[0]; return *ip; }
1
5a8f1c627a572c6dab91621040f179ea
3d946ce5c3fff15c3429fc636c5a8161
fonction utilisé pour convertir (0,1) du fichier texte en type boolean(true,false)
result = [] temp = map(int, s.split(",")) for itm in temp: if itm == 0: result.append(False) else: result.append(True) return result
1
3a011a40a1ceaf34357afbfc88264e8b
a2b298e019fb9076f96499bf8c2637a3
Prompt the user to confirm deletion of location items(s)
namespace StageBitz.UserWeb.Inventory public partial class InventorySharing : PageBase protected void btnDelete_Click(object sender, EventArgs e) { if (!StopProcessing) { DeleteLocation(false); popupDeleteLocation.ShowPopup(); } }
0
c7f9876409514c9108a0ed5a2375340e
d35a5072687c2dbc3b49f8fdc1466293
checks every shortest path to every coin on the map, and chooses the minimal path with the minimal steps to get there
class CitiesMap(vararg cities: City) : ArrayList<City>() fun getShortestPath(): CitiesPath { val permutations = this.generatePermutations().map { CitiesPath(it) } var smallestLength = Int.MAX_VALUE var resultPath = permutations[0] permutations.forEach { val length = it.length...
0
7122058157e5351d8c47fe01ad5632b2
b4753b72fbdbde2be77570903c1f828b
This function get an index in form (a, b, c) then it returns equivalent position in 1d
int coord_to_pos(const coord* c) { return 3*(c->x+1) + (c->y+1); }
0
dfcd455cc826570cb3688cacfe76d07e
078215021f0033ceb6e56012c2aca795
Invierte el signo de la fracción
class Fraccionario def -@ Fraccionario.new(@x * -1, @y) end
1
27724cced034b9d7ed590edeaa3f6d20
7f61448ad6da3ef0f9cb03f40c5be655
into format accepted by model.fit
cases like (1)
0
91dad93581cddd2b93dedb407db1b9f9
370ba44d32499feef28016b646b275ea
Target CRF level. Must be between 10 and 36, where 10 is the highest quality and 36 is the most efficient compression. The default is 21.
@Deprecated public class HttpContentCompressorFactory @Deprecated public static class Builder public Builder compressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; return this; }
0
67de41bc0abcf55788517255f67ae4ac
22e6f68227d9947e219b0330c3bb43ff
将Java对象List转换为JSON字符串,使用Gson API
public class GsonTools public static <T> String getJsonListObject(List<T>list){ if (list != null) { return gson.toJson(list, new TypeToken<List<T>>() { }.getType()); } else { return null; } }
1
5911b616691fdc59b5771d1e0b318259
027af4ac956092e3bba1dcbcd9c83287
Check meas units Check which measured units are accessible from SQL database
public class ItemStorage extends javax.swing.JInternalFrame public ArrayList<String> getUnitMeasures() { ArrayList<String> arrayUnitofMeasure = new ArrayList<String>(); try { db.getConnection(); Connection conn = db.connection; String UnitofMeasure = "select UnitMeasu...
1
f7f006eef1a5cf321a74dcb6a457f128
6c54d298a31c781d2f86645ef40d9fc7
Check rooms state on given <paramref name="currentTime"/>
namespace nanoFramework.CoAP.Samples public class ObservableServer private static int GetRoomTemperature() { int temp = (DateTime.Today.Second < 15) ? 25 : DateTime.Today.Second; return temp; }
0
272c17a67f081e5cb8091e7bb5bee445
4503bba9ad7f8fbfc385c8888022c93e
通过商品id获取商品图册
$goodsId = I("goodsId"); $sql = "SELECT img.* FROM ".$this->tablePrefix."goods_gallerys img WHERE img.goodsId = $goodsId "; $rs = $this->query($sql); return $rs; }
1
50fc07b20b55175ccd2cef3041732cf4
9d2f785cf9a3111185aa664d173749f5
Returns how many links a crosslink have x,y current crosslink coordinates
uint8_t i, amount = 0; if (b->head > b->tail) { for (i=b->tail; i < b->head; i++) { if ((b->aer[i].coordinate.x == x) && (b->aer[i].coordinate.y == y)) amount++; } } else if (b->head == b->tail) { } else { for (i=b->tail; i < MAX_AER_TUPLES; i++) { if ((b->aer[i].coordinate.x == x) && (b->aer[i].coordin...
1
642f621020acc37955052ea48804890f
134e29ba213801a348a16d350c9d0020
computes idiosyncratic risk
market_caps, risk_aversion, cov_matrix, risk_free_rate=0.02 ): mcaps = pd.Series(market_caps) mkt_weights = mcaps / mcaps.sum() return risk_aversion * cov_matrix.dot(mkt_weights) + risk_free_rate
0
80f23dd7e5dc4e4d0765f92d117cdb86
c2ce0a12d5777e2bc14e11373bb0333e
处理数字确认键,仅处理ATV和DTV,如果有之前有数字键按下,立即切台。
{ char vcNumberKeyCode[10] = { 39, 30, 31, 32, 33, 34, 35, 36, 37, 38 }; char cData; int iIndex; for (int i = 0 ; i < strlen(pcNumberString) ; i++) { cData = vcNumberKeyCode[pcNumberString[i] - '0']; iIndex = g_viRemoteBufferIndex[BUFFER_INDEX_KEY]; g_vcRemoteBuffer[BUFFER_INDEX_KEY][iIndex] = 0x00; g_vcRe...
0
c65b493ba73959ab202da9cc474c44c9
4076f19dc89a15461526e94c8c342b11
Converts camel case to title case.
class Str public static function camelToTitleCase($input) { return ucwords(self::camelToRegularCase($input)); }
1
f4b2066a70277e5cb5dcce83504b84ac
bbef5308de733182172c3deeff6f9b1e
Read inputs from Google Sheet
attempts = 0 success = False while not success and attempts < 5: try: self._first_names = self.sheet.col_values(1)[1:] self._last_names = self.sheet.col_values(2)[1:] self._user_ids = self.sheet.col_values(4)[1:] self._b...
1
ea47528bba75d5fb02256c1f43c7af9c
2a07517ec8912ca03df51e24a92eb1ac
## Earth rotation angle (IAU 2000 model).
function era(days) { return 2 * Math.PI * ( ( 0.7790572732640 + 1.00273781191135448 * days ) % 1 ); }
1
fa15db7251042734b9b8da8f815debc7
851c3cf7ae67a478a400cac389add993
Calculate cumulative win/loss for each round.
ranked = sorted(self.players, key=lambda x: x.num_pairs, reverse=True) wl = 'win' if ranked[0] is self.user else 'loss' self.winloss[wl] += 1 return ranked
1
1bd30b14dc89bd6d1fc1059e3059b884
6cef649ef1583e0e0042e1adf553e19a
Set if even one utm value in _GET will overwrite all utm values or not.
class Config: def get_overwrite() -> bool: return Config.overwrite
0
3de7c3b96a130bb2f29256f72e732782
2a479ec4c316c35a5d6e8cef7db6d880
メッセージボックスにエラー出力をしてfalseを返す
namespace BitmapViewer public partial class ImageWindow : Form private bool error_return(string fmt, params object[]? args) { MessageBox.Show(String.Format(fmt, args), "error", MessageBoxButtons.OK, MessageBoxIcon.Error); return false; }
1
ffc83c2a402c26f74f2289dbb8bd2fe9
de6c76198492ac078450a68faa441a95
Returns the 16-bit sum of a range in a byte array.
byte result = 0x00; for (int i = begin; i < end; i++) { result += bytes[i]; } return result; }
0
6ac04fbae1fbec05755a96c53876701a
35ab2e0940373e6efa571fb400b4af7a
Change existing user password (requires old password)
return User.changePassword({ id: currentUser._id }, { oldPassword: oldPassword, newPassword: newPassword }, function() { return safeCb(callback)(null); }, function(err) { return safeCb(callback)(err); }).$promise; }
1
a2f9db7325a0a547e020da6bb8d0b275
cf7c6a0e84b84d4b4a93559132717afb
Add excitation to subsystem.
if not self.simulator.realtime: self.setRealTime(True) self.simulator.subsystem = "tkinter" self.simulator.realtime_extra = [tk]
0
b437aad633c12be93ec9dcd141c95674
01e401b25cb15e6b4c10dbdc3877f373
! Threadsafe setter of the progress message
void SLApplication::jobProgressMsg(string msg) { SLApplication::_jobMutex.lock(); SLApplication::_jobProgressMsg = std::move(msg); SLApplication::_jobMutex.unlock(); }
1
c26d5e9d144e04c4371709220229c550
6dc0748d69932a84a654bcff14a26dc6
Downloads the complete list of engagements from the portal
ObservableList<Engagement> getFilteredEngagementList();
0
55b02c44f324e94966664f8118431df4
dfde36ba6580dffe2b2e3c5da12441c5
Choose connection type.
if (net_type == "airplane_mode"): self.driver.set_network_connection(ConnectionType.AIRPLANE_MODE) elif (net_type == "wifi_only"): self.driver.set_network_connection(ConnectionType.WIFI_ONLY) elif (net_type == "data_only"): self.driver.set_network_connection(C...
1
c3dc236c24e36d12f2381a451c95ce9e
918280e25966a6460359d8ade9a6785d
查看变电站基本信息
@ResponseBody public ReturnEntity<WtStationBaseDto> operatorManage(String id) { ReturnEntity<WtStationBaseDto> re = new ReturnEntity<>(); WtStationBaseDto baseDto = portManageService.findStationBaseDtoByStationId(id); if(null==baseDto){ re.setReturnCode(ErrorCodeEnum.ERROR_06.getCode()); return re; } ...
1
ec7346867a4cd3970913c0a8ac28a516
0bb3965a6a669cf3b2ec05c41a44613b
处理Shelf_Module子类的反序列化
{ this.moduleId = Utils.parseInt( element.getAttribute( "moduleId" ) ); deserializePart( element ); }
1
e575e5857256a8c11b41a5518abe1953
ac90dd3a7e84aed02364fdef9c3ff80f
Set Cumulative Level. Level for cumulative calculations
if (CumulativeLevel != null && CumulativeLevel.length() > 1) { log.warning("Length > 1 - truncated"); CumulativeLevel = CumulativeLevel.substring(0, 0); } set_Value("CumulativeLevel", CumulativeLevel); }
1
975233f2f2ffdf110d2ee0ddc1152e3d
4333095d87c2bddc4bc535193280d43f
This event handler is called each time the memory plugin sends output packets.
{ bool dataReceived = data.Data != null; if (dataReceived) { cbmcOutputString.AppendLine(data.Data.ToString()); cbmcOutputStream = new CStreamWriter(); cbmcOutputStream.Write(encoding.GetBytes(cbmcOutputString.ToString())); ...
1
5762da30205ef49d1c6e5a82df9eb725
3c8f7fa365333016e776b5820c48bea6
유니코드를 글자로 바꿔주는 함수
var cCode = str.charCodeAt(0) - 0xAC00; var jong = cCode % 28; var c = (cCode - jong) / 28; var jung = c % 21; var cho = (c - jung ) / 21; return { "cho": cho, "jung": jung, "jong": jong } }
0
db17c0f673de2f206643d53d09caafca
6ff94ede4c5736bd892ad4cf60af5ea2
Sets the value of the negativeAmortizationLimitMonthsCount property. allowed object is {@link String }
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "EXAM_LoanAcctInfo_Type", propOrder = { "examFirstPymtDt", "examFinalMaturityDt", "examLastInstPaidAmt", "examPastDueDt", "examPayDueDt", "examMaturityDt", "lastPmtDt", "examAmtPaidToDt", "examN...
0
6170d1bdc188fa0fe732ada58086361d
dedfaa774bc7ea277fd2fa6234983b7b
A simple estimate (via Newton's Method) of scale for an algebraic map.
diff=cScaleS tol=0.001 deltaW=min(xV[1::])/2.0 wPrev=xV[1:]-deltaW wPrev=np.append(xV[0],wPrev) uPrev=np.interp(wPrev,xV,yV) wFor=xV[:-1]+deltaW wFor=np.append(wFor,xV[-1]) uFor=np.interp(wFor,xV,yV) uDer=(uFor-uPrev)/(wFor-wPrev) uDer=np.append(uDer,np.zeros(1)) while di...
1
30d2d0609ab9d1dfdc57bc1bce69235b
262980ca50cd77d2bcc66dc3514cad0a
me muestra los botones de guardar si tengo al menos un detalle
@ManagedBean (name="AdmonServDependencia") @SessionScoped public class AdmonServDependencia extends Siigem{ public void mostrarBtnGuardar(){ this.renderBtnGuardar = false; for( dto_AdmonServicio servicio : this.servicios ){ if( servicio.isAgregado() || servicio.isModificado() || servicio.isEli...
1
3a52d7b6d6fb5225f768a7fac66a4c8f
79d9292a9645bf86190198cfd0a1ed93
Returns active user list (excluding adminstrative user connection)
public class ApplicationBean implements Serializable public NodeInterface[] getActiveUsers() { List activeUsers = this.app.getActiveUsers(); return (NodeInterface[]) activeUsers.toArray(new NodeInterface[0]); }
0
80c86fa3df28c7d63ab2f3f9b79dc940
68f8e1760c88d73b76b9a8384bc57038
<p> This operation creates a revision for a data set. </p> Asynchronous callback handler for events in the lifecycle of the request. Users can provide an implementation of the callback methods in this interface to receive notification of successful or unsuccessful completion of the operation. API Documentation</a>
java.util.concurrent.Future<CreateDatasetResult> createDatasetAsync(CreateDatasetRequest createDatasetRequest);
0
2f25c1a34b8296708c78c0f5807706fe
e56eaf702b53c3da7e610c3d2a0d9159
分页直接获取所有的试卷信息。
{ int row = int.Parse(context.Request["rows"].ToString()); int page = int.Parse(context.Request["page"].ToString()); string SQL = "SELECT [ID],[名称],[修改时间],[修改人],[启用]FROM [CNGTZ].[dbo].[TK_试卷] ORDER BY 排序 DESC"; string rows = "{\"total\":@总数@,\"rows\":@行对象@}"; ...
1
e05e1d1713d001c8c6b25eec8d00cdf7
48f19ea2686a0bd571c8b67f2da56d56
Delete the addition from the addition list
void LESOCodeTable::RollbackAdd() { if(mAdded != NULL) { Del(mAdded, true); mAdded = NULL; mLastDel.les = NULL; mCurStats = mPrevStats; } }
1
c4d94c4567d91f3ec3f53738bb716bfe
67b82a43af9373f81899d43aa64455ed
判断酒店是否存在,清除脏数据
async.map(shopBaiduList.contents, function (itemShopBaidu, callback) { Shop.findOne({code: itemShopBaidu.code, status: 0}).exec(function (err, shop) { if (shop){ ...
1
f2e0cca97cb6db52c0bcbf585ed7c017
811418282071ca2b7b2666a8b9a223f5
!---------------------------------------------------------------------------------------------------------------------- @brief Disables and clears all NVIC interrupts and sets up interrupt priorities. Peripheral interrupt sources should be enabled outside of this function. As this should be the first interrupt-related ...
{ int i; register rt_uint32_t idx; const rt_uint8_t *priority; priority = dm365_default_priorities; davinci_irq_writel(~0x0, FIQ_REG0_OFFSET); davinci_irq_writel(~0x0, FIQ_REG1_OFFSET); davinci_irq_writel(~0x0, IRQ_REG0_OFFSET); davinci_irq_writel(~0x0, IRQ_REG1_OFFSET); davinci_irq_...
1
d9acadf1eea130ddaa3681c1e0cf7af8
2e5183ae1255f70c8ad41d7aa436e50d
平均精度を計算する
def accuracy_me(self, y_true): y_point = self.forecasts["point"] me = mean_error(y_point, y_true) return me
0
8bde61d7f3e1924520f4ecdc9f643684
2c413b4ebad3727024e2e7b4e5786cc9
对当前用户以及当前拿到的任务节点进行匹配,看是不是当前用户可以执行的任务
namespace sDev.CoreFunction.Auth public class SystemManager public static bool CheckNodeUser(string nodeId, DataRow taskItem) { bool b = false; if (nodeId == null) { b = true; } else { if (taskItem != nul...
1
3e0e894a9eb225d0516731bdf607fdbd
e85743b0be79d0c3800902e3e473f60c
Exit a parse tree produced by the {@code registerType} labeled alternative in {@link SqlBaseParser#statement}.
public class SqlBaseBaseListener implements SqlBaseListener @Override public void exitBaseType(SqlBaseParser.BaseTypeContext ctx) { }
0
744d042f8d0a6853baaccb16306c3fba
aff755e52cda89bcfff85e27de6a6f58
dummy read of ADCR (only the low byte) to clear the interrupt flag
void adc_interrupt(void) { adc_ring_fill(&adccfg); }
0
e479e40ac738eae5462e0159602db51b
8b0c2c2d1427e2a0b9cf3b4ba3101384
To be used after each timestep has been passed, appends a single 1 to represent the bias.
def add_bias_unit(X): return np.concatenate((np.ones((X.shape[0], 1)), X), axis=1)
1
011956cb64400c09ce659e0ffc7d90d7
572dc3066b6ff1984ccd146a8c6af313
DynamoDBからtodosの一覧を取得
{ $todos = Todo::select('id', 'title', 'content', 'created_at')->orderByDesc('id')->get(); $todos = TodoResource::collection($todos); return $todos; }
0
75ec25da10da41c72c1d19c07279f3ff
55712f2e51cc2670e923b18bad44e2b9
加载一个常量
public class PoCMethodVisitor extends MethodVisitor implements Opcodes void loadConst(int i) { switch (i) { case -1: mv.visitInsn(ICONST_M1); break; case 0: mv.visitInsn(ICONST_0); break; case 1: ...
1
d6ab8a30d955b5bbfcdf40af1f680f78
48ffd902c4468d6fcc179ee30a70a1f5
更新用户获得的总学分
class SummaryScore extends Model public static function updateUserScore($userId) { $user = User::where('id', $userId)->first(); $userScore = DB::table('score_histories') ->where('user_id', $userId) ->sum('score'); $user->score = $userScore; ...
1
c9e2c4586e5553030db46ed8cd725535
48ff69b221cb144483eb52e7aaaa294c
注册Controller对象
public abstract class BaseControllerFragment extends BasePresenterFragment protected void registerController(String key, Lifecycle controller) { if (!TextUtils.isEmpty(key) && controller != null) { controllers.register(key, controller); } }
1
0dec7417b0a1ac29c89a66ca10997144
ea72153c3fb77d10fefd8a3d9b7d5e7d
ミスナール体感温度Tmの計算
public class evaluate : MonoBehaviour public void CalculateTAM() { double angle; Frame frame = provider.CurrentFrame; int tamIndex = 0; foreach (Hand hand in frame.Hands) { if (hand.IsRight) { foreach (Finger finger in hand.Fingers) ...
0
90b05eec7648b6a0e62809b46096464b
6335e4470b36834a3594cf0c736cbc51
simple half function
def a(x): return x / 2
1
4f8f6a68975bfd497d3ab17dd7afc709
a43a54e520e82c2026e8ba40f78f43e3
Get the width column index
public class MetaDataColumn public int getWidth() { return this.width; }
0
9c85325740220e0967548696f6b40b18
4bc426a14f7a26bc953791f32fdeb382
builds a hash with the environment
env = '' allowed.each do |var| next unless ENV.key?(var) env << "#{var}=#{ENV[var]} " end env.strip end
0
6bd5b343893bdc1273faacfddd6ac046
5ed85cf5abb5570c23d01310182a2a6a
Sets the {@code ondragstart} event handler.
@JsxClass(domClass = SvgElement.class) public class SVGElement extends Element @JsxSetter({CHROME, FF, FF68, FF60}) public void setOnmousedown(final Object mousedown) { setEventHandler(MouseEvent.TYPE_MOUSE_DOWN, mousedown); }
0
66d9953f136361e29fb2d96cccbd17c0
288ff7b909d2a0cebab2cf0678b54a31
AddAlias - adds a postini alias to an existing email address
if not session.get('user_id') : return redirect( url_for( 'login', redir='mails' ) ) db = get_db() cur = db.execute('SELECT address FROM mails WHERE id=? AND target_id ISNULL', [mailbox_id]) mailbox = cur.fetchone() if not mailbox : flash ('The mailbox you\'ve asked to add an alias t...
1
4e8578cf0b7992a4966f4952ab7b94cb
f1243aa3b5c8df5c6f3c4163b92c501a
Create an unsealed Configuration object from a Properties
{ if (desiredProperties.Contains(ConfigSectionName)) { JObject configSection = desiredProperties[ConfigSectionName]; if (configSection != null) { return HandleNullValues(configSection); } } ...
0
27024ff9bfc715cc016bc7d7a9275d45
0e6ad1f21601d4dd6b20ce4a4e1991bd
\internal \brief Common EIC line interrupt handler The optional callback used by the interrupt handler is set by the eic_line_set_callback() function.
static void configure_eic_callback(void) { extint_register_callback(button_read, BUTTON_0_EIC_LINE, EXTINT_CALLBACK_TYPE_DETECT); extint_chan_enable_callback(BUTTON_0_EIC_LINE, EXTINT_CALLBACK_TYPE_DETECT); }
0
62adde66bec9653878a66fe3a8b08673
c37351dd1958231791c11b923cc66959
leetCode第3题 获取字符串的最长子串,且子串中不含重复的字符
public class LongestSubString public static void main(String[] args) { String str = "abccbda"; System.out.println(lengthOfLongestSubstring(str)); }
1
f32fe5384bb88f40bcd347d0b7e9010d
03984968c39e0397d337ad941227f16c
Initialize UART0 with receive interrupt
void UART0_init(void){ ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_UART0); ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA); ROM_GPIOPinConfigure(GPIO_PA0_U0RX); ROM_GPIOPinConfigure(GPIO_PA1_U0TX); ROM_GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1); ROM_UARTConfigSetExpClk(UART0_BASE, RO...
1
337dc235717dcf27ee7e54f89b127b61
079be5007969d18c39f62df0f8bdd39d
Leave 2 lines for info.
func init() { fmt.Println("") fmt.Println("FiC monitor daemon") fmt.Println("nyacom (C) 2018.05 <kzh@nyacom.net>") }
1
73acff84c99edeccd674537d6286db52
14af40854c2d4f87ca79c2ea72609e15
The SG-specific error type. Understands that `ENO` is a common prefix for standard errors, like `ENOENT`.
class UnknownError(RPCError): def __init__(self, msg): super().__init__(msg, 2)
0
61abed34cf5e97b4845d85d3ad246060
bea6a163df426acc34d66f7cacf3996d
Verifies that diagnostics will be reported for all invalid object initializer definitions.
public async Task TestNoDiagnostic() { var test = @""; await VerifyCS.VerifyAnalyzerAsync(test); }
0
d50824803129d3ebf9fd1c3ecc814adb
bca2e55993faab3e5c6eb902f9a82930
'''根据给出的文字,生成诗句'''
def writePoetry(): turtle.penup() turtle.goto(400, -150) turtle.pencolor((255, 255, 0)) potery = ["但\n愿\n人\n长\n久\n", "千\n里\n共\n婵\n娟\n"] coordinates = [(300, -150), (200, -150), (100, -150)] for i, p in enumerate(potery): turtle.write(p, align="center", font=("STXingkai", 50, "bold")) if (i + 1) != len(potery)...
0
2d2e877e08bb20f1a412966834d4aeaf
24b2e0be6272f1f57af5511ad7dce091
返回最大值,和第二值
def max2(x): m1, m2 = (x[0], x[1]) if x[0] > x[1] else (x[1], x[0]) for index in range(2, len(x)): if x[index] > m1: m2, m1 = m1, x[index] elif x[index] > m2: m2 = x[index] return m1, m2
1
25dc1a7da83efb9031f891669b473a08
5e2890802a37d62548609b7db51c3905
Создаём игру, и подписываемся на её события
class GameWindow: def create_game(self, my_name, access_token, game_id): self.my_name = my_name self.access_token = access_token self.game_id = game_id handlers.register_game_events(self)
1
a62bf1611a9010b14ab7084aa2274d93
886fc15889ea3d60f93d0febebda64a0
设置发表该评论的用户的出生日期
public class User public void setBirthDay(String birthDay) { this.birthDay = birthDay == null ? null : birthDay.trim(); }
1
7a754c20d445e6385214cc8bf63c8adc
8010077cc6d640079f25536dc9772a8d
Formats information about the plugin as HTML, which is displayed within the PluginDialog window.
public final class ExportUtils public String getAutoexportInfo() { String pluginName = "AutoExport Plugin"; String pluginVersion = "(unknown)"; String pluginUrl = "http://could.it/autoexport/"; final Plugin plugin = this.pluginAccessor.getPlugin("confluence.extra.autoexport"); if...
1
e53f44db156f9bdb91511fb8567f6e5b
1d1425942a55203c3dc952b1371f2904
UI界面是有拉伸的,这个方法将屏幕坐标换算成UI坐标
float resolutionX = canvasScaler.referenceResolution.x; float resolutionY = canvasScaler.referenceResolution.y; Vector3 viewportPos = Camera.main.WorldToViewportPoint(pos); Vector3 uiPos = new Vector3(viewportPos.x * resolutionX - resolutionX * 0.5f, viewportPos.y * resolutionY - resolutionY * 0...
1
15f7e932021e120bdf761aa34d4c734a
160c8914ae68b6681ba19cba2576f125
The number of times a health check must pass for a backend Droplet to be marked "healthy" and be re-added to the pool. If not specified, the default value is `5`.
class BackendServiceArgs: def health_checks(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "health_checks")
0
04dab5e639e485698d8717637baa6822
897a21582f8895d38d819dc23c921817
Terminates the error processor thread.
{ if (Interlocked.CompareExchange(ref error, ExceptionHelper.TERMINATED, null) == null) { Terminate(); Drain(); } }
1
b825fbf8704680b652a01bbfc07d7cb6
4e783ce7e9a327eade84daf8b083121b
metodo per inviare un file attraverso una socket
{ TcpSocket sock; if (!sock.connectTo(domain, port)) { std::cout << "Failed to connect server for send file" << std::endl; std::fflush(stdout); return; } FILE *fp = fopen(filePath.data(), "rb"); if (!fp) { sock.dissconnect(); std::cout << "Failed to open file ...
1
72c5107c949901caba0b810942f7e7c9
3ae8c6d88e8066829f733d088c83ff2f
Call this method when a player finishes a multiplayer game. This will report the result of the game to the Skillz server, and return the player to the Skillz portal.
{ await new PlayFabUtil.SynchronizationContextRemover(); var requestContext = request?.AuthenticationContext ?? authenticationContext; var requestSettings = apiSettings ?? PlayFabSettings.staticSettings; if (requestContext.ClientSessionTicket == null) throw new Pl...
0
77a6e45680174625bcb9dc6672571f2a
5021c622ce4082458d52b1ffce5b9cb3
Perform a module-specific refresh operation. The typical/intended use to to synchronize registers that may be altered by the FPGA (i.e. shadow copies are stale). For TLO common carrier derived modules, this typically executes CommonReg.Command.Field( CommandBF.CmdAbort ).Write( 1 );
{ int32_t ret = IS42S32800J_ERROR; if(IS42S32800J_ClockEnable(Ctx, pRegMode->TargetBank) == IS42S32800J_OK) { (void)IS42S32800J_Delay(1); if(IS42S32800J_Precharge(Ctx, pRegMode->TargetBank) == IS42S32800J_OK) { if(IS42S32800J_RefreshMode(Ctx, pRegMode->TargetBank, pRegMode->RefreshMode) == IS42S...
0
12c387075c35e40ed872b9e50a94c327
f417cfd05d9550a5a96a77197c4ae1c9
根据基地id查询管理员列表
List<Manager> selectByCommunityId(String communityId);
1
0f7a7aae1e26146cd6d6c142dfb14bae
0ce03d9e8cfbca0c5da6822e73cc0ff4
Tells if the given type is within the Java sources being compiled.
ma = re.match(r'([\w<>]*)', cls, re.I | re.M) if not ma or not ma.group(1): return False if cls in java.system_class: return True if cls in java.class_reflect.keys(): return True if cls in java.extra_class: return True if cls in config.properties.keys(): r...
1
7a9c568177e36db699c9ba305cd61448
822ffc587da8e209c28208edb3be01aa
The string to insert into the Dockerfile.
class WorkflowArgs: def dockerfile(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "dockerfile")
0
6ba332e04cb970c016933df021b5ff76
2545da3be6301da327ecc91d6f569397
toggle display of the right sidebar drawer
toggleSideMenu (state) { state.drawer = !state.drawer }
1
8d0119b9dfbb17ca6fc42b713f9282ed
a18897d48cc9099a0041b378d2e96b45
Remove the host from the group model.
class FlashArray(object): def remove_host(self, host, pgroup): return self._request("DELETE", "host/{0}/pgroup/{1}".format(host, pgroup))
1
5ada7a4a118fd39605e3073d52ba4705
cb1862fc38c502ef5551c135e8219666
Sets the color of the placeholder.
{ Color[] data = new Color[1]; data[0] = Color; Texture.SetData<Color>(data); }
1
69dc40f6ae39f791099ddce9c971c7ab
551501ded95e4205fbba1bb880174e4b
画像の一部分におけるDifferenceHashを取得する 座標・大きさは画像に対する%指定なことに注意
def dhash(image, hash_size = 8): image = image.convert('L').resize( (hash_size + 1, hash_size), Image.ANTIALIAS) difference = [] for row in xrange(hash_size): for col in xrange(hash_size): pixel_left = image.getpixel((col, row)) pixel_right = image.get...
0