query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
bf05a34e1aa33f00b8613608e55a85f0 | 340aacb494f2913d37577f530a28fbaf | Compare the retrieved properties with the validating properties supplied by the caller. | namespace ReactiveValidation.Validators
public class EqualValidator<TObject, TProp, TParam> : BaseSyncPropertyValidator<TObject, TProp>
where TObject : IValidatableObject
protected override bool IsValid(ValidationContext<TObject, TProp> context)
{
var propertyValue = context.PropertyValu... | 1 |
2cf9c771df257c81b072354a6dba1fe0 | 10f25be89bc9d7e8d6a045db8f659c2d | 插入数据,使用@Options返回主键存入到lessonUser 的Id字段 | @Insert("insert into people(address,role) values(#{address},#{role})")
@Options(keyProperty = "uId", useGeneratedKeys = true, keyColumn = "u_id")
int addUser(People user); | 0 |
2d49332952174ad566510aa831ece5ef | d33a8b652258a566cd828bb6658aefef | Called by the connection if it cannot re-establish the connection. All services are deleted | {
object[] connections = null;
lock (this._persistent.SyncRoot)
{
connections = new object[this._persistent.Count];
this._persistent.Values.CopyTo(connections, 0);
this._persistent.Clear();
}
foreach (SharedMemoryConnection sharedMemoryConnection in connections)
this.ConnectionFailed(re... | 1 |
94fc964d2d84ef1b98c5b61b9ab2dca2 | d0c927e17abcc40f2f447879f15d5255 | Extract fields values from a View form.
Fields beginning with is_ are casted to boolean | {
$view->vars = array_replace($view->vars, [
'value' => $form->getViewData(),
'checked' => $form->getViewData(),
]);
} | 0 |
3bb248c6cb1c3bd31c74315d678bb730 | a82edd44c1114086857ffa2cf3da2e73 | 加载资源组,带加载完成回调 | class LoadManager extends egret.EventDispatcher{
public load(groupName: string,priority:number=0): void {
RES.addEventListener(RES.ResourceEvent.GROUP_COMPLETE,this.onResourceLoadComplete,this);
RES.addEventListener(RES.ResourceEvent.GROUP_LOAD_ERROR,this.onResourceLoadError,this);
RES.addEventL... | 1 |
8251e0fa673c990e68a4146f0c7d09cd | 6b4d13e0bcac67030e4c0aec297c00e7 | Records access to a file by changing its modification time.
<p>
Recording access is also a form of locking against concurrent deletion by the clearing mechanism. | fun touch(openReadOnly: Boolean): Unit {
if (isReadOnly || openReadOnly) throw IOException("Read only")
lastModified = System.currentTimeMillis()
} | 1 |
a4a4dd1f9aab3b62f9f4f0e128aff767 | f4cae89893903602fd42364cf9885709 | Checks if point is inside the rectangle (including borders) | {
return point.x >= cornerTL.x && point.x < cornerBR.x &&
point.y < cornerTL.y && point.y >= cornerBR.y;
} | 0 |
3a77ce4f5197152967347d4c21ba2046 | 388ab31b81d33555980dd662025ba247 | Returns the class that needs to be assigned to an element. | class Cases extends ListNode
public Class getElementClass() {
return elementClass;
} | 1 |
a17e8b44457f0cb43db9d00f7a6bebe0 | dede57071c37d2772e303052417dbac3 | 获取知识点分页 | class KnowledgeModel extends Model
public function getknowledge()
{
$count = $this -> where('id>0') -> count();
if(!empty($count)){
$page = new \Think\Page($count,5);
$page -> setConfig('prev','上一页');
$page -> setConfig('next','下一页');
$showPage = $page... | 1 |
f7150419b07059d682d30fc0a8e0f755 | aa21be2f354bd320fe3297e7ee5485eb | Initialize HTML for the plot | self.figure = plt.figure()
self.canvas = FigureCanvas(self.figure)
self.toolbar= NavigationToolbar(self.canvas,self.canvas)
self.grid.addWidget(self.canvas,self.gridParams.plotrow0,
self.gridParams.plotcol0,
... | 0 |
19057f4b1659fdda2a5d111727f3ed55 | 83872fc183913d04ead5c5d8ff9cbc13 | Returns true if the path is in the directory. | class elFinderVolumeXoopsD3diary extends elFinderVolumeDriver
protected function _inpath($path, $parent) {
return $path == $parent
? true
: in_array($parent, $this->getParents($path));
} | 1 |
19b0cfeca4567b40008442cd204a05a1 | 390180174c0655d7bed3f8493e620d04 | 校验申请人是否重复提交了相同类型,相同内容的工单 | public HttpResult<Object> addOrderApply(OrderApplyDto dto) {
HttpResult httpResult = new HttpResult(true);
SysToDoList s = sysToDoListService.checkApprove(dto.getId(),dto.getType(),dto.getReceiverId());
if(s != null){
httpResult.setSuccess(false);
httpResult.setMessag... | 1 |
2e51e9de4327939c1e8060b579b4bc0a | 950dbc49c45267cbdf616d9bc6a7fc5e | Test case for get_all_ancestor_types
# noqa: E501 | class TestAttributeTypesApi(unittest.TestCase):
def test_resource_attribute_type_resource_find_attribute_types_get(self):
pass | 0 |
305585c54d3a8bc8a450ce84207bb07c | d6d7736c709ee4cb08c2ba693d928bd3 | 获取该NPC上可接的所有任务 | class NPC extends egret.DisplayObjectContainer implements Observer, Dialogable, Displayable
rule_all(missions: missionList, self: NPC) {
for (var index in missions) {
var fromId = missions[index].getFromID();
var toId = missions[index].getToID();
if (self.id == fromId || self... | 1 |
2dbf093cc07dede351518ae148170642 | 38f21fd2317b1edfb40e9d49533624c1 | Custom argparse "type" for epsilon. | if opt == 'radian_fraction':
return ('%f' % val).rstrip('0').rstrip('.')
else:
return super(AffineInitializer, self)._format_arg(opt, spec, val) | 0 |
035bd3667e09c303679f4361c955bb87 | 656d6ff79ae8ff7a9b7eda8509fec63d | 更新缺陷类型 | @Controller
@RequestMapping(value = "/quality/defectsInfo")
public class QltDefectsInfoController
@RequestMapping(value = "{id}", method = RequestMethod.PUT)
@ResponseBody
public Map<String, Object> update(HttpServletRequest request, @PathVariable("id") Integer id, QltDefectsInfoVO bean) {
Map<String, Object> res... | 1 |
fd41479be40d94067d637a2a802f8846 | cf4446f96167a6b47e664593a486b600 | 与えたコンテンツがYouTubeのiframeの埋め込みリンクを含むかどうかを判定する | {
$problemRegex = "#^http://youtube\.com/get_video\?video_id=.*$#i";
$matches = array();
preg_match($problemRegex, $this->_filtered_url, $matches);
if(sizeof($matches) > 0)
{
return true;
}
return false;
} | 0 |
dd5c22ebaaee2954d20ff2ecf163d44e | 8596da2189383f45e8af39fdcacdef8d | The xml configuration generator when state is deleted | class HarvestManStateObject(dict, Singleton):
def generate_system_configuration(self):
self['@PROJECTS_ELEMENT'] = ''
return CONFIG_XML_TEMPLATE % self | 0 |
bbc7f29e23cf86a308b82ef42410ec74 | d2c3305e643d7fc55d5a3f1a0ba0f39a | Fetch the item's "anchor" option. | public class Anchorchildren extends XulElement{
public String getAnchor(){
return _anchor;
} | 1 |
7da7b86331209e1dc4d8b5090ccdaadd | 3048ffed0e2d29fd441116fb19fa895e | <include file='Windows.xml' path='doc/member[@name="Windows.CreateMutexA"]/*' /> | namespace NanoByte.Common
public sealed class AppMutex
public static AppMutex Create([NotNull, Localizable(false)] string name)
{
#region Sanity checks
if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
#endregion
if (!WindowsUtils.... | 0 |
f9f04abcb53666952222060c73b7d195 | eacaf6c5596119ee8d3628faacb11708 | Добавляет запись в базу,
если прокси прошел проверку и не имеет дублей в базе.
Возвращает кол-во затронутых строк | namespace CrawlerApp.DAL.Interfaces
bool AddRecord(DataModel model); | 0 |
a779c8d14e55c823df73d179fd1a56d7 | 63cb1c8a0fc06bd4d391a036f133f6d3 | compute wave frequency using dispersion relationship | if sigma == 0.:
return 1/np.sqrt(mu_r*ct.mu_0*epsilon_r*ct.epsilon_0)/wavelength
else:
return solve_frequency(wavelength, mu_r, epsilon_r, sigma) | 1 |
359ab04499635e3c66e312a990f90b52 | 4b316765e3f34e42cb159648a5a24e55 | final array element contains NULL | void f2(void) {
const size_t ARR_SIZE = 4;
long a[ARR_SIZE];
const size_t n = sizeof(int) * ARR_SIZE;
void *p = a;
memset(p, 0, n);
} | 0 |
b428f52e55782faa5e522850b1288286 | b2906d19325ea60bd4738f84800c0694 | Test the reading and writing of 64-bit unsigned integers | a := uint8(5)
b := uint16(10)
c := uint32(20)
d := uint64(40)
buf := new(bytes.Buffer)
if err := encoding.WriteUint8(buf, a); err != nil {
t.Fatal(err)
}
if err := encoding.WriteUint16LE(buf, b); err != nil {
t.Fatal(err)
}
if err := encoding.WriteUint32LE(buf, c); err != nil {
t.Fatal(err)
}
if err :... | 1 |
49dbd232804e0156c1d2aa8f387315e8 | c788ec8f3ed4d8e8cd54b82f357cd7e9 | Tests if the current Melange application is running locally. | if (getSeleniumServerHostname() == null ||
getSeleniumServerHostname().isEmpty() ||
getSeleniumServerHostname().equalsIgnoreCase("localhost")) {
PSLogger.debug("Local selenium server");
return true;
}
return false;
} | 1 |
81a52c6f251cd40f1eac60cdec43f12f | bd57432f5cdab7e8fce98b4d79175be0 | Purge comics from the DB that don't have a corresponding file. | class MWCPurge(MWCommand):
def __init__(self, file_list = None, **kwargs):
c = {"file_list":file_list}
MWCommand.__init__(self,type=mt.MWC_PURGE, content=c, **kwargs) | 0 |
a9ec8806bb4aee1d33df8d8570bc5142 | c0ac4fb0bb3bb60fad7fc7f4d1ca1109 | whether to keep results in memory or write to disk after each timestep | class ReinforceAgent(Agent):
def set_learn(self, learn):
self.learn = learn | 0 |
8c5cc8c4c3ab029ade85ecbe954335b7 | 7c5a9413c0fd5f58c9f582c9b9518bc0 | Computes the distance between two GPS coords | @Service
public class DistanceService implements GpsCoordinateDistanceCalculatable{
public double distanceBetweenCoordinates(double lat1, double long1, double lat2, double long2) {
int earthRadius = 6371000;
double deltaLatitudeRadians = (lat1 - lat2) * Math.PI / 180;
double deltaLongitudeRadians = (long1 - long2... | 1 |
114f717ef05aaf0079f8471f2d165131 | 07fe05a267101b6d697533afead83676 | Taking the input string from the text field and using the other classes in calculating the result,
before displaying the answer in the text field | public void onClick(View v) {
double initialValue;
double finalValue = 0;
double inter = 0;
if ((user_input.getText().toString().equals(""))) {
Toast.makeText(getApplicationContext(), "Please Enter a Value to Convert", Toas... | 1 |
f40200db7963b16da5f87b62c859d11e | 617b5ad254f05773fb0bb7d995d4b80b | Load non-minified files if 'SCRIPT_DEBUG' is set to TRUE, otherwise, use minified files in production | function themify_minified() {
return defined( 'WP_DEBUG' ) && WP_DEBUG ? '' : '.min';
} | 0 |
692647b7d8ace681eeb98a7852107ffd | 7171f405651b8346ac032ae98ed57c1a | controller for cross-centre model copying in admin | {
$ctmake = DB::table('ctmake')->whereNull('deleted_at')->get();
$ctmodels = DB::table('ctmodels')->whereNull('deleted_at')->get();
return view('admin.ctsubmodels.create', compact("ctmodels","ctmake"));
} | 0 |
937cab834354f3020c7c52466855758f | 4e1b949643d14e53218d52101cdaf803 | Funcion que muestra la vista de verificación de código y le pone la clase hide a todos los demás containers | function mostrarPanelCodigoSinReset() {
pnlInformacion.hide();
pnlRegistro.show();
txaComentario.reset();
} | 0 |
d254b32dada2c0d29b9c7157c271edbd | 982086af0d6e1ddb045a304811b579b7 | 按时间段获取监控日志统计信息(1:本日;2:本月;3:本年;4:全部) | namespace SmoONE.Domain.IRepository
IQueryable<AttendanceLog> GetByStatisticsTime(string UserID, DateTime Date, StatisticsTime Time); | 1 |
60e3db2c52e3f3d766651062d61495bf | 6b4d0ece26339f21d8a50d041e02fe09 | Converts this string into a 64 bit integer, or long. | namespace Nop.Core
public static class DataParseExtensions
public static Int64 StrToInt64(this string expression)
{
return StrToInt64(expression, 0);
} | 1 |
fff99a57103aecffecaf2f0669774a7a | d1362e590048b2ccf936537ecfce4347 | Count ranks and suits. | public class Dealer
private void countCards(Card[] playerCards){
int[] cardsNum = new int[13];
int[] cardsSuit = new int[4];
for(int i = 0; i < 13; i++)
cardsNum[i] = 0;
for(int i = 0; i < 4; i++)
cardsSuit[i] = 0;
for(int i = 0; i < 5; i++){
... | 1 |
916b414213761aee21b2c7daae0583fa | eb7ada8620f482d66a2f23511db53ab2 | Number of tasks in the queue, which are *not* marked as causing
any kind of error. | class Flow(Node, NodeContainer, MSONable):
def num_unconverged_tasks(self):
return len(self.unconverged_tasks) | 0 |
6d691cb0b6a03ff1f0847354aadc2263 | 83b1bdfc470b6bab1f634a9ffc7003ca | Imposta i dati di intestazione della fattura | {
if($_SESSION['imprimeDoc']==='on'){
$this->Image("../images/".$_SESSION['logo'],10,12,36,18);
}
$this->SetFont('Arial','B',14);
$this->Cell(150);
$this->Cell(30,20,utf8_decode('FACTURA Nº: ').utf8_decode($this->datosPresupuesto['NumFactura']),0,0,'R');
$this->Ln(25);
} | 1 |
76bad558f1d1e848a7b8a1a22f5916fc | c31c6855eea3fc165eab233b86883d54 | MongoDB文件存储服务 | class Log2MongoDB(Thread):
def __init__(self, logfile, mongodb, db_collection):
super(Log2MongoDB, self).__init__()
print "Store file: {} to mongo collection: {}".format(logfile,
db_collection)
self.mongo_instance = mongodb
se... | 1 |
26d0e36a9ef59c3c3502fc23133f5b75 | c2162065dbaf7c363941215b56532abc | <pre>
Output only. The timestamp that the revision was created.
</pre>
<code>
.google.protobuf.Timestamp revision_create_time = 7 [(.google.api.field_behavior) = OUTPUT_ONLY];
</code> | java.lang.Object ref = revision_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
revision_ = s;
return s;
} else {
return (java.lang.String) ref;
}... | 0 |
5722414d6bb1d897301d1b5a5f48d7d2 | 3e78ca90ed91adc09cefc68c266923f0 | Unit test: compute the SHA256 sum of the specified string and compare it
to the expected result. | TEST(FXCRYPT, Sha256TestB1) {
static const char kInput[] = "abc";
static const uint8_t kExpected[32] = {
0xba, 0x78, 0x16, 0xbf, 0x8f, 0x01, 0xcf, 0xea, 0x41, 0x41, 0x40,
0xde, 0x5d, 0xae, 0x22, 0x23, 0xb0, 0x03, 0x61, 0xa3, 0x96, 0x17,
0x7a, 0x9c, 0xb4, 0x10, 0xff, 0x61, 0xf2, 0x00, 0x15, 0xad};
... | 1 |
6754e815b56e4ad9e0d7d42dbc129673 | e5333885ce33ecf3ac696c4c823ba62e | Indent a value by `n` `character`s | def indent(s, n):
addline = 0
if s and s[-1] == '\n':
s = s[:-1]
addline=1
s = " "*n+s.replace("\n", "\n"+" "*n)
return s +'\n'*addline | 1 |
69c74beb501386e13cd4cb889c2c89c4 | a0a0cf9ecb0d7a980deb69f104044d7f | Compute the qth percentile of the data along the specified axis. | class TimeSeries:
def evaluate_quantile(self, q):
return np.percentile(self.states, q=q, axis=0) | 1 |
e6f23e7e94ab9f404958c7f8b6ff60f9 | 264662759341364d83305c7bd594e4b0 | newNetworkPolicyController creates a controller for Kubernetes Network Policies | controller := &Controller{
istioClientset: istioClientset,
configStore: store,
routeCache: cachev3.NewSnapshotCache(false, cachev3.IDHash{}, logger{}),
pushChannel: make(chan istiomodel.Event, 100),
}
return controller
} | 0 |
5849068ad5e4966af0d4101cba60a828 | c1f0af133630377a9769ed9b67a0137e | при наэатии на изображение music-block | $('#audio').attr({ src: mp3 });
$('.music_player #img').attr({ src: img });
imgplayer();
} | 0 |
eee5de8276b8ade5cc206dd240b5870a | bb4a9fed894382d8cfdf8cb34adcdc88 | Initialize a dictionary that will contain the metadata. | class BIDSMetadata(dict):
def __init__(self, source_file):
self._source_file = source_file
super().__init__() | 1 |
7e21d3904bab4680f04e2e1b6240ee08 | 645c1924ff81251ce1736b1cf0bbf9c9 | 根据棋盘坐标,返回棋子,若没有棋子,则返回null | export default class Chessboard
getChessmanByRowAndCol(row, col) {
return this.chessmans[row] ? this.chessmans[row][col] : undefined
} | 1 |
c0f92d19121f593d0a530f6d3e0969f1 | bc24279cf01ec4ef8e899f2af16af7fc | <pre>
1. 개요 : 구매신청서 상세정보리스트
2. 처리내용 : 구매신청서 상세정보리스트
</pre> | @Service("HRML0010Service")
public class HRML0010ServiceImpl extends EgovAbstractServiceImpl implements HRML0010Service
@SuppressWarnings("rawtypes")
public Object processSEARCH00(Map searchVo) throws Exception {
Map<String, Object> returnMap = new HashMap<String, Object>();
returnMap.put("dsTR_MONEPL", dao.proces... | 0 |
a1224eca242371f18ed343f3144df4ad | 56307e546637d5e652669a977d7d804c | Setup WebRTC events handlers | const _this = this;
this.webRtcSignalingAll = firebase.database().ref(config.FIREBASE_DB_WEBRTC_SIGNALING+"/"+this.deviceIdentifier);
Rx.Observable.fromEvent(this.webRtcSignalingAll, "value")
.subscribe(function(snapshot){
const evt = snapshot.val();
... | 1 |
6a6047579fda5a7df03d40d57237042b | ef9f5c1ebb4fe1d55215703e91ab72f0 | Вернуть поле на котором происходит передвижение объекта | public class Hunter implements Actor
public Field getField()
{
return field;
} | 1 |
f406dd908f422844520b4fa35e59ba34 | 479976184d227691ff50f488c63b3ef2 | 根据resourceId删除gas_merchant_resource表数据 | @Service
@Import({
ShellmerchantDataSourceConfig.class
})
public class ShellmerchantTestBase
public void updateGasMerchantResourceByResourceId(long resourceId,GasMerchantResourceDO gasMerchantResourceDO) {
GasMerchantResourceDOExample exam = new GasMerchantResourceDOExample();
exam.createCriteria().andResou... | 0 |
423e8435ef6ef67f48cdc2b8c37e8de4 | 1ab58a9881ecb1db8321b6d86a545353 | Updates the state of the motor according to how much time has elapsed | decimal fraction = ((decimal)CurrentState.Percentage / 100.0m);
_millisOn = (int)(fraction * (decimal)_dutyCycleInMillis);
_millisOff = _dutyCycleInMillis - _millisOn;
} | 0 |
162515f6314b66b36861d1c707f528e7 | 7314edc6325674d076b42355963e600d | Expect the dictionary to contain a given key. | def test_response(response, key):
try:
assert response[key]
except KeyError:
pass | 1 |
29ec23b97af4465a1d232dc92bc52805 | b799a3e11e81924845a082db79898359 | Talkerが作成したルームを取得 | namespace Gs2.Gs2Chat
public class Gs2ChatRestClient : AbstractGs2Client
public IEnumerator GetRoom(
Request.GetRoomRequest request,
UnityAction<AsyncResult<Result.GetRoomResult>> callback
)
{
var task = new GetRoomTask(request, callback);
if (_certificateHandler != null... | 1 |
ea822bdb9a9948633b5ec885805931ce | 84d4a8fb4fc073354dd79f5e63452c81 | Clears the cache for all personas.
<p>
The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
</p> | public void clearCache() {
if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
CacheRegistryUtil.clear(NguoiDung2VaiTroImpl.class.getName());
}
EntityCacheUtil.clearCache(NguoiDung2VaiTroImpl.class.getName());
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LI... | 1 |
9c7fbab24d044dcf49926118b2604e7e | 5e0445438eb801a685fc0d0d146468b9 | Sets most suitable Virtual User index by current player index | local index = targetIndex
if keybox:GetValue() ~= 0 and input.IsButtonPressed(keybox:GetValue()) then
local bestDelta = math.huge;
for i = 1, # players do
local player = players[i];
if player and player:GetIndex() ~= localPlayer:GetIndex() then
local local... | 1 |
46103933c45e15745954797f66e6615f | 01ad962baebd0f546b1862076ec8b642 | This function unpacks the QMI_CAT_SEND_TR response
message to a user-provided response structure. | BYTE *pMdmResp,
struct QmiOmaDmGetSessionInfoResp *pApiResp )
{
enum eQCWWANError eRCode = eQCWWAN_ERR_NONE;
static struct qmTlvUnpackerItem map[] =
{
{ eTLV_RESULT_CODE, &qmUnpackTlvResultCode },
{ eTLV_OMA_DM_GET_SESSION_INFO, ... | 0 |
f8a5ed16862e3b6fff0843f2ab959cca | 652934a39b329fe82b8da317a4ada8dd | Marks a task as done and returns the done message. | char *str = make_str_done(id);
Message *msg = make_message(DONE, str);
free_str(str);
return msg;
} | 1 |
515a273c7082ac660ab22f2aa5b9b7e8 | c7bbbec88d4dbde78af2a7787fe67450 | Save data from main renderwindow (the contour one) to a PNG-file | void gr_ContourSave(w, client_data, call_data)
Widget w;
caddr_t client_data;
caddr_t call_data;
{
A_HistWind_t *histWind=(A_HistWind_t *)client_data;
if(plotctl == NULL)
return;
if(plotctl->method == INTERNALPLOT)
{
gr_Dsplbegincontour(NULL, client_data, NULL);
}
else
gr_PlotContour(histWind, SAVEPLOT);
} | 0 |
de5563eab623b0f11db9bb59505ba165 | 94d98e086dca4c1f29e94c0e8ead1707 | 重新添加hkc service到target项目中 | public ModelAndView addHK(HttpServletResponse response,HttpServletRequest request,ProjectBase project){
ModelAndView modelAndView=new ModelAndView();
String id=request.getParameter("id");
String typeId=request.getParameter("typeId");
modelAndView.setViewName("jsp/smartadmin/project/addHKProject.jsp");
Map<St... | 0 |
d4276a86bd366bdc11be8d76f5c8ac03 | 06d139566c3f6075441ab8b122833192 | Extend the canvas of an image. Mirror boundary conditions are applied. | xs_fill = int((xs - 1) / 2)
ys_fill = int((ys - 1) / 2)
extended_val = np.pad(matrix, ((ys_fill, ys_fill), (xs_fill, xs_fill)), 'constant', constant_values=default_value)
matrix = None
return extended_val | 0 |
318aed1162aefc5478b12d47f8bcceca | a48676540a69064bf1ac65d6e107cd31 | Validates whether a particular device
supports the parameter-shift differentiation method, and returns
the correct tape. | super
if multiple_derivatives? then raise Jinx::ValidationError.new("Multiple derivatives not supported by caTissue") end
end | 0 |
adaf64d81558a003329bff767794570c | 23f1830d04e5ca85bf7bb7ebf8aee8e6 | donne l'index pour placer une vue entre deux element en fonction de la position du curseur | let slideCoordinates: number[] = [];
let total = 0;
for (let i = 0; i < this.slides.length; i++) {
let slide = this.slides[i] as HTMLElement;
slideCoordinates.push(total);
total += this.getSlideWidth(slide);
}
let index = 0;
slideCoordinates.reduce((p, n, i) => {
if (Math... | 1 |
eea7643b20276ae82deadf536ee2ff97 | f1789e3d6684215b9f48f05adefcad19 | Parses the formated value as float. Needed for values like:
x xxx,- / xx,xx / xx'xxx,xx / -xx.xxx,xx | {
$string = (string) $value;
if (strpos($string, ".") !== false && strpos($string, ",") !== false) {
$string = str_replace(".", "", $string);
$string = str_replace(",", ".", $string);
} elseif (strpos($string, ".") === false && strpos($string, ",") !== false) {
... | 1 |
9bad854e7ec6cb8eac1b92959d652d38 | 5d8e75fc1cef6ca302ea10f5b32bfb7f | Return the item at location (x,y) | class CarcassonneMap:
def get(self, x, y):
coord = (x, y)
if coord in self._map:
return self._map[coord]
return None | 1 |
297d2f4f273f1426dbe7fe0519e34738 | c42d9af90d323b9e9acd7260d6451b27 | 把VDOM 转换成 真实DOM | function render(vdom){
let type = vdom.type;
let props = vdom.props;
let children = vdom.children;
let element = document.createElement(vdom.type);
setProps(element, props);
children.forEach(child => {
let childEle = null;
if(child instanceof VirtualDOM){
childEle = r... | 1 |
511fcf0ec72d4a54efcc841fca181a37 | 9f8d3fc1614d324ce41e6786a4dbb4e5 | fit latent field and calculate Laplace approximation at locus | if not self.icdf_is_setup: self.setup_iCDF_grid()
idx = np.floor((ltrue-self.lt0)/self.dlt).astype(int)
idy = np.floor((z-self.z0)/self.dz).astype(int)
lobsl0z0 = np.zeros(len(ltrue)).tolist()
lobsl0z1 = np.zeros(len(ltrue)).tolist()
lobsl1z0 = np.zeros(len(ltrue)).tolist... | 0 |
e0cc7d6b4335d1d838c73936d3f1b9a8 | 025f805d52e5fe2423a6a7c22187eeb6 | Replace fields in message (enclosed in single braces) | const params = JSON.parse(JSON.stringify(parameters))
params.shift()
const repl = { ':other': parameters[0], ':values': params.join(', ') }
return message.replace(/:other|:values/ig, match => repl[match])
} | 0 |
af2fcd29daed2b4031a520a6b7e65fa2 | 75df0424cb02b6f9def05b9b250d038d | Retorna si se tratan de la misma linea | Integer i;
for (i = 0; i < lineas.size(); i++) {
if (lineas.get(i).getId() == l.getId()) return i;
}
return i;
} | 0 |
e928d1d11505268faa42f70302cfe66b | 9433c2e482b2dedf5959b4de77d8924b | fbxから特定のAnimationClipの情報を取得する | public class EmoteSwitchV3Editor : EditorWindow
private AnimationClip GetAnimationClipFromFbx(string fbxPath, string animName)
{
var anims = AssetDatabase.LoadAllAssetsAtPath(fbxPath);
var animObj = System.Array.Find<Object>(anims, item => item is AnimationClip && item.name == animName);
var... | 1 |
df7e6b6827142c19032d832efa929df6 | 1c92fa1b5b5c4c55c2f5cec142dfdc46 | Verify that a nesting of unordered list, block quote, block quote, with
the maximum number of spaces (plus one for the first) allowed, works properly,
with no block quote characters on the second line. | source_markdown = """>
+
> > list
> > item"""
expected_tokens = [
"[block-quote(1,1)::>]",
"[BLANK(1,2):]",
"[end-block-quote:::True]",
"[ulist(2,3):+::4: ]",
"[BLANK(2,4):]",
"[end-ulist:::True]",
"[block-quote(3,1)::> ]",
"[block-quote(3,5... | 1 |
4f34b626dd52c24100251ef674804f14 | 5953ea3e80d598bdd7306ec39da7b781 | 从redis的优先级队列中取一个元素 | class Bll_House_UpDown_RedisCount
public function dequeue($queue)
{
return $this->redis->rPop($queue);
} | 0 |
2d93c07fd77003af540c9b7f2b7ff845 | ccb7152a9fe96412eb5cba7c8426b3ce | We're looking for attribute_name="foo". Specifically:
Check that the next n chars == attribute_name=" and then,
Capture chars in a string until a " appears. | int sc_scan_attribute(char **string)
{
char c, done = 0, text[SCANNER_STR_SIZES];
int n;
c = gobblespaces();
if (c != '(' || ((c = input()) != '(')) return (-1);
thisfile_column++;
text[0] = text[1] = '(';
for (n = 2; !done && (c = input()) != 0 && n < SCANNER_STR_SIZES; )
{
tex... | 0 |
e2aa3db5c57e6ce2be9a523b4f39aff0 | e3f2a6237b9b10339c9f8ce93f599a2c | fl_set_object_lcol(ptr_flobject, colr)
Defines the label color of a flobject. | mx_color_reset (type)
int type;
{
struct UC_attributedatabag attr;
struct NCL_fixed_databag e;
int i, n1, color, rscol, status = UU_FAILURE;
UM_int2 ifnd, ifl;
UM_int4 nclsub;
UU_KEY_ID nkey;
UM_f77_str ncllabel;
union {
double junk;
char label[NCL_MAX_LABEL+1];
} ncl;
i = type - 1... | 0 |
461e62ac5d49a6f7b9ed885ae7519b42 | d190c031e014dfe9edea493e7883cf2d | #694. Number of Distinct Islands | function solution(map) {
let islands = [],
visited = [];
for (let row = 0; row < map.length; row++) {
for (let cell = 0; cell < map[row].length; cell++) {
if ( !map[row][cell] || cellVisited(`${row}${cell}`) ) {
continue;
} else... | 0 |
2b926c2eca3cbf90a8cf48df6fa128b7 | 05e5098fc3e4f28115039c95c43da519 | 获取预约条数 | public MessageVo getReserveNum(){
int count = reserveService.getCount();
return ResponesUtil.success("success",count);
} | 1 |
87d59b6d01d457704d9a06388f3edc5d | 570a405da2fff07f151e13fcf0112060 | Inicializa a estrutura apontando para a primeira caixa.
Requer o numero de bolas como parametro da primeira caixa. | class FilaCaixa:
def __init__(self):
self._fila = [] | 0 |
b43eb4c1a56750ffa96960f5b1d25600 | 0fd89e8ae636d3b809e8f60d26792e52 | Returns the meta object for the container reference '{@link reqtify.Section#getDocument <em>Document</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "ResourceContainer", propOrder = {
"account",
"allergyIntolerance",
"appointment",
"appointmentResponse",
"auditEvent",
"basic",
"binary",
"bodySite",
"bundle",
"carePlan",
"claim",
"claimResponse",
"clinicalImpres... | 0 |
ac35b78c531be6ecfda39a6d62dc33c7 | 154c6a059566161a401211de81f64d85 | Reverse point. | class Line(Mesh):
def reverse(self):
pts = np.flip(self.points(), axis=0)
self.points(pts)
return self | 1 |
87dfda9907c03f716129eeff41820399 | 72415c212b39319961ef73798b2f9a64 | Deactivate duplicate final results.
Each result form should have one final result for each candidate. If there
are multiple final results for a candidate deactivate them. | class Submission(models.Model):
def cleanup(self):
if self.result:
self.result.delete(False) | 0 |
d9cfc0b9375c1e876c5275429e7c0505 | 84f119e6e7395101c158d26e9b1d23fe | read all pending responses from serial port | try:
if self.serial.inWaiting():
resp = self.serial.readall()
log.warn("Unknown/unparsed serial response: %s", resp)
except SerialException:
self.reconnect() | 1 |
34005da36ed563b89d19cb09f7ab9a72 | 2790d7bd1fb0fb98e15992acffa24797 | 根据id启用车辆 | @Controller
@RequestMapping("/useCar")
public class UseCarController
@RequestMapping("getOneCarById")
public String getOneCarById(@RequestParam("carId") int carId,HttpServletRequest request){
Car car = carService.getCarById(carId);
request.getSession().setAttribute("car", car);
System.out.println(car.toStri... | 0 |
d040309d4deb9f3bcee81ac08923c0c7 | ab5dba1c8f09efdfc02a5b1e7ace7b2f | 把T转换成R | def T_to_R_canonical(T):
return T_to_R_specific(T, T_to_root(T)) | 1 |
ebc159b398b39c46e9a2c0d0d51fa265 | e1a9f90094a52360ae6d48f03ad08852 | 询问用户是否真的要将号码从黑名单中移出 | {
int mode = BlackListDAO.getInstance(getApplicationContext()).getMode(incomingNumber);
return mode == 0 || mode == 2;
} | 0 |
5b6f95e0a31aede941c6e2e27de4a239 | 30efddbbaf0f640e015677634079ac8c | Gets the languageId property value. The language culture string. Read-only. | @Entity
@Table(name = "book_languages", schema = "KunderaExamples@hbaseTest")
@IndexCollection(columns = { @Index(name = "languageId"), @Index(name = "language") })
public class Languages
public String getLanguageId()
{
return languageId;
} | 1 |
faaee0e937a966cc6f45f37b640333cb | 067aafdeab31b28562b1eec993b8ef54 | 使用File提供的函数获取当前路径 | {
FRESULT res;
res = f_getcwd(ff_fname, 256);
printf("f_getcwd result : %d\r\n", res);
if(res == FR_OK)
printf("current directory : %s\r\n", ff_fname);
} | 1 |
6d52be07a9df3e44a14d8d922444c706 | e26e02319a7552377bf7daf48465ec4d | tkinter GUI: Prompts the User to choose one/some Files
Returns a list of all file-paths | pass
root = Tk()
ftypes = [('jpg file',"*.jpg")]
ttl = "Title"
dir1 = 'C:\\'
root.fileName = askopenfilename(filetypes = ftypes, initialdir = dir1, title = ttl)
print(root.fileName)
return root.fileName | 0 |
ab176506041fcd4c580afbeef47774f4 | 60e91f594c20b7cf09da06531a191bf8 | Initializes the console, the pause overlay, and the soundbar. | namespace CandyRush
public class CandyRushGame: EngineCore
protected override void Initialize()
{
GraphicsManager.Instance.EnableSprites();
InputManager.Instance.EnableMouse(Content.Load<Texture2D>(ContentContainer.Engine, @"Content\\pumpkin"), true);
FileIO.Instance.Crea... | 0 |
f7360edec68cf03fb714d719b7ae3b82 | 08a7312cd8a2c82ea30ea6523647ddce | 根据游戏类型id和平台id分页查询游戏 | namespace Game.Data
public class PlatformDataProvider : BaseDataProvider, IPlatformDataProvider
public PagerSet GetGameTypeItemList(int pageIndex, int pageSize, string condition, string orderby)
{
PagerParameters pagerPrams = new PagerParameters(vw_GameTypeItem.Tablename, orderby, condition, pag... | 0 |
63d851f2e17a3b8d93fff8c28741c831 | 966e0ea9380d5c149c91f1db7a75f511 | Streams batches of examples from tfds, with pure-python preprocessing. | batch_images = np.empty([batch_size, IMAGE_HEIGHT, IMAGE_WIDTH, IMAGE_CHANNELS])
batch_steers = np.empty(batch_size)
d_size = 0
while True:
i = 0
for image_path, _, _, steering in dataset[d_size:d_size+batch_size]:
image_raw = load_image(IMAGE_DIR_PATH, image_path)
... | 1 |
562374cbd7fa834ef9635eb210e881a2 | 0c03e4f0b5bb8dcad8c934eee5dc5e19 | 员工登陆页面 | $must = array();
if($this->get_data['page_now']) $must['page_now'] = $this->get_data['page_now'];
$res = get_api_data('employee/employee_login_list',$must);
$this->data['login_list']=$res['results']['records'];
$this->data['pager']=$res['results']['pager'];
$this->data['url'] = 'company/employee_login_list'... | 1 |
d15bc098a437ab1a65004227c4f6f3d1 | 7336c377e721c46c8047ede672f9bd56 | 校验七牛云存储时必填字段 | {
if(!$this->isSubjectSet()) {
throw new \Exception("缺少必填参数subject");
} else if(!$this->isTotalFeeSet()) {
throw new \Exception("缺少必填参数total_fee");
} else if(!$this->isOutTradeNoSet()) {
throw new \Exception("缺少必填参数out_trade_no");
} else if(!$this-... | 0 |
ba98c8c5a74fa5df432aa046e6b540d8 | 156ec670b68e4059708856b2b05cac6e | @brief 保存添加好友的请求 | void MainWindow::onGetAddFriendRequest(const AddFriendRequest* request)
{
this->addOneFriend(request->getSrcUserName(), request->getIconIndex());
} | 0 |
fd4936924aedad31652fe8d84efd243c | 075bf11b361252f591bec3ae5ffdf165 | 当前Android系统版本是否在( IceCreamSandwich) Android4.0或以上 | @SuppressWarnings("unused")
public class DeviceUtil
public static boolean hasICS() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH;
} | 1 |
d659c0614b0710964032526b3ea23fe8 | 7ec4da2d4d805a9780a87b31d4b6c21d | Set wind speed in km/h | void Weather::setWindSpeed(int w)
{
ws = w;
} | 1 |
f9579d5d55a324f9a9d73f26df610e22 | 5f021b7987c1031aa509c9d79f272869 | Удаление пользователя по порядковому номеру из списка пользователя сессии | {
_safexClient.DeleteUser(new DeleteUserRequestInformation
{SessionKey = sessionKey, Id = new List<int>(pIdList)});
} | 1 |
6e70c1d2271a059ce20492305aa44eda | f8b40a7c79f254127d63f65fa1ffb36d | Inception block with 3d Convolutions, inspired by Fig6 of the original inception paper. | def inception_block(A_prev, filters):
F1, F3R, F3, F5R, F5, FPP = filters
C1X1a = K.layers.Conv2D(
filters=F1,
kernel_size=1,
activation='relu',
padding='same',
)(A_prev)
C1X1b = K.layers.Conv2D(
filters=F3R,
kernel_size=1,
activation='relu',
... | 0 |
99ccebbb22230793328ae11776919634 | 8c6b594b8a5fa1d15a125bbb23544d6c | Not implemented, do not use! | namespace Wm4
bool Intersector<Real,TVector>::Find ()
{
assert(false);
return false;
} | 1 |
36045059b7bc9c3ee7101db6cd69cf55 | 9e90b54877d34cf2b9c3aadff0d64ae1 | <para>
Starts the case execution identified by the given id manually.
Performs the transition from state
<code>ENABLED</code> to state <code>ACTIVE</code>.
</para>
<para>
According to CMMN 1.0 specification, the state <code>ACTIVE</code> means that the
<seealso cref="Stage" /> or <seealso cref="ITask" /> related to the... | public class WorkflowApi
public void workflowWorkflowManualStart(Integer docnumber, Integer workFlowEventId) throws ApiException {
workflowWorkflowManualStartWithHttpInfo(docnumber, workFlowEventId);
} | 1 |
b093eed0c7348d2c679f3387fbfc21bc | 34632e07a7248790596bfdb4b1b66067 | Create an Access Control List. | func NewAccessControl(ac, dac []string) AccessControl {
return AccessControl{
AccessControl: ac,
DisableAccessControl: dac,
}
} | 1 |
c06fa6c87f9c61b16925871c5d4de459 | 3b554cd8658ae508fb165e775978a2c7 | 그리드 일자 문자열 가져오기 | {
var dt_raw=$('body > main > sections > section:nth-child(2) > dayview > subheading > t').html();
var dt_arr = dt_raw.split(",",3);
var dt=dt_arr[1];
dt = dt.replace("rd", "");
dt = dt.replace("st", "");
dt = dt.replace("rd", "");
dt = dt.replace("th", "");
... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.