query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
bbbe67305887467f56a23d96ca3111d7 | c85dda5710f601606152aac97461f7a3 | Return a full set of i, j indices | i_col = np.repeat(np.arange((m - 1) * n), n)
j_col = (np.tile(np.arange(n), n * (m - 1)) +
np.repeat(np.arange(m - 1) * n, n**2))
i_bc = np.repeat(np.arange((m - 1) * n, m * n + k), n)
j_bc = np.tile(np.arange(n), n + k)
i_p_col = np.repeat(np.arange((m - 1) * n), k)
j_p_col = np.ti... | 1 |
d33a3b8a122b3bfe5a816c808140fa1d | d8a32ec37ce0725f522c894dd3a02879 | 图像已获得,唤醒线程处理相关事务 | void onImageReady(); | 1 |
e94b06c3ab71034a71a1dbc105f8d97c | fbdbb0a107812cea74f76d8b6ecb597a | Forms a {PrintNode} style from the computed style passed. | class CSSAgent extends BaseAgent
getComputedStyleForNode() {
throw new Error('Not implemented');
} | 0 |
9332d1fc9e1ed3d44f6be48c8ce8c01e | f1e5d741e4153c4816790815021494ff | extern void initStorageManager(void); => Initializing the storage manager | shadow_init()
{
shadow_allocator = slab_allocator_create("sahdowobj", sizeof(mmobj_t));
dbg(DBG_VM,"GRADING: KASSERT(NULL != shadow_allocator) is going getting invoked right now ! \n");
KASSERT(NULL != shadow_allocator);
dbg(DBG_VM,"GRADING: I've made it ! May I have 2 points please ! \n... | 0 |
41bfb7d229d53a4cc09b684ed17a6d5e | 65d8a525cdf740dd554187849c9a488d | function:分数的乘法 | struct fraction f={0,0};
int c,d;
c=a.numerator*b.numerator;
d=a.denominator*b.denominator;
f=fractionCreate(c,d);
return f;
} | 1 |
dca20ebd87f5e75a4f94b6a2dc9ec5c0 | 610a1812171c8a14c25893e371425fbb | Увеличивает перманентность потенциальных синапсов данной колонки | class Segment(object):
def increase_permanences(self, byAmount):
for s in self.synapses:
s.permanence_increment(byAmount) | 1 |
b99c665bf960e644d84b64e7183ec729 | 9af0eb3442835ce1da41997bbfe75a4a | Get the octave split bit. | if self.config is None:
self.read()
return (self.config[3][2] & 0x06) >> 1 | 1 |
6e9d322a8422581604c9042453b05bee | a32b2417bb3b4fa5354e1cf5d3725ada | Deletes the index and re-initializes a new, empty one in its place. | protected void indexDelete() throws IndexException {
if (isClosed()) {
open();
}
try {
Connection c = store.getConnection();
StringBuilder sb = new StringBuilder();
sb.append(String.format("DROP INDEX %s%s;", tableName,
GEOMETRY_INDEX_SUFFIX));
sb.append(String.format("DROP INDEX %s%s;", table... | 0 |
15ec27ddc2236a955de1e0392f816d1c | bcd687bdc8e787a3f486fa0a4169a04b | Creates a task to remind the AP to login. | cancelAll(context)
try {
val periodic = PeriodicTask.Builder()
.setService(thisClass)
.setPeriod(60 * 60)
.setTag(TAG)
.setPersisted(true)
.setUpdateCurrent(true)
... | 0 |
bbfcfa0cf767f6b1791c39563bdc402b | ed812548c3e6e1ecf4cfb4fdb298d80c | Parse query into array of expressions (expression e.g. 'tag:foo + type:video') | var expressions = [];
var expressionStrs = query.split(',') || [];
for (var i = 0; i < expressionStrs.length; i++) {
var expr = expressionStrs[i] || '';
var clauses = [];
var clauseStrs = expr.split(/(?=[\+\-])/);
for (var j = 0; j < clauseStrs.length; j++) {
var clauseStr = ... | 1 |
f99a369e1019810d54b69020bfbb2c58 | 97143b748425272ffb0cd3adfe428926 | Check whether the date string is yyyymmdd format or not. | def is_valid(strdate: str):
try:
_ = datetime.datetime.strptime(strdate, "%Y%m%d")
except ValueError:
return False
else:
return True | 1 |
3d1f9a640a1d9415a417accfaf3bee3d | a51e711b8b7db7041dbbab58f82b2d5f | Get Operational Status for Logical Port of a Given Port ID (lport-id)
Returns operational status of a specified logical port. | try:
r = do_request(HTTP_GET,
"/ws.v1/lswitch/%s/lport/%s/status" %
(lswitch_id, port_id), cluster=cluster)
except exception.NotFound as e:
LOG.error(_("Port not found, Error: %s"), str(e))
raise exception.PortNotFoundOnNetwork(
p... | 1 |
7c9effab576053c000e6e6664355fc60 | 26a9094cecd1809ead1865348a698803 | A minimal test to replicate the observed client sync failures during fixCommands. No txn used. | A = txnPoolNodeSet[-3]
B = txnPoolNodeSet[-2]
G = txnPoolNodeSet[-1]
for node in A, B, G:
makeNodeFaulty(
node, changesRequest, partial(
delaysPrePrepareProcessing, delay=90))
return adict(faulties=(A, B, G)) | 0 |
82e004f7cc3e2c670a94340be5b1cbc7 | 858f697b392a8e9c075e8c1517352926 | SIGUSR1, SIGUSR2, SIGINT 信号处理函数 | {
switch (iSignal)
{
case SIGUSR1:
{
break;
}
case SIGUSR2:
{
break;
}
default:
{
break;
}
}
return;
} | 0 |
ca56d370675a89865664f054cba38176 | 3459bd6ad2db41b927d1cc70352224fa | check if array of strings is all numbers | foreach ($arrayVar as $tem) {
if ((filter_var(trim($tem), FILTER_VALIDATE_INT)) === false) {
return false;
}
}
return true;
} | 1 |
9fc37fe5351466ea72d4025d6f9e18ef | 0063fe1f396d64b1cdc29ed92d102c0f | This event is fired when the preferences have been written to the server. | class SwitchAccessInterface
onPreferencesChanged(changes) {} | 0 |
d87555da6382e813e3429fddff42e4a8 | 9b8527f3b06828dbc92de40405a85d0b | safe? -> bool
+true+ iff the message's service type is Spread::SAFE_MESS. | class DRbServer
def insecure_method?(msg_id)
INSECURE_METHOD.include?(msg_id)
end | 0 |
92f28dc91cc73677db3c5631987f3934 | b06ff734f0d6e5ff3a08f3c9dc929ff6 | Method to stop elements in a given process group or groups. | class SuperVisor(object):
def stopProcess(self, name):
return self.server.supervisor.stopProcess(name) | 0 |
cbd8d39f10dc88a0b93d64d44fb285fd | 84381c4c76e0980052d649571561acd7 | サブメッシュを設定 | {
if( m_mesh )
{
if( subsetIndex < m_mesh->GetSubmeshCount() )
{
m_currentMeshSubset = subsetIndex;
}
}
} | 1 |
7ddbc44469ea3ff66b3ca3c7e182ed3b | 16b8a3cdc90e1d88e57534168149f899 | Возвращает запрос для получения модели паспортных данных | class Consignee extends D7Model
public function passportData(): BaseQuery
{
return $this->hasOne(PassportData::class, 'ID', 'UF_PASSPORT_DATA_ID');
} | 1 |
4bf3f42923215fd509dd34257fee0735 | 76357e43699704e9fd9c02bc3ef5fba8 | 初始化对战房间当前下注倍率(名牌 暗牌) | if (gameInfo == null || matchStatus == null) {
return;
}
int blindMode = gameInfo.gameConfig instanceof GameMttConfig ? ((GameMttConfig) gameInfo.gameConfig).sblinds_mode : 0;
matchLevel = 1;
if (matchStatus.currentLevel == 0) {
matchLevel = 1;
} e... | 1 |
7724d1d1325ff6409082c16c7738a092 | 6624e8a68c26393a2b098652a5957460 | 是否是数字(包括正负) | if (TextUtils.isEmpty(this)) {
return false
}
val pattern = Pattern.compile("^[-\\+]?[\\d]+$")
return pattern.matcher(this).matches()
} | 1 |
ad0f84f2c1b91c71088ecaf6bba9991a | 8ed7d1baa75c9d4fa689a4daf4b61b8a | 根据手机号查律师认证信息 | @POST("CHAPI/V1/QueryUserByPhone")
Observable<ApiResponse<List<AddAuthEntity>>> queryUserByPhone(@Header("auth") String token,
@Query("p") String phone); | 1 |
373920bb8983fc63c6b6d1853d6a9913 | bcb8cacc811726598b66861629d289cd | POST: api/Korisniks | namespace Server.Services public class KorisnikService
public Korisnik Create(Korisnik korisnik)
{
_korisnici.InsertOne(korisnik);
return korisnik;
} | 1 |
7fbca9cde0bdf506bfbafacfce9d7e59 | 53d98ffe7f1992f116bf90651ba8fc08 | 注册方法,可以判定账号,密码,昵称格式,并将其发送给服务端,
接收服务端返回信息进行判定下步操作 | public class QQServer
public static void loginOrRegin(Socket s){
NetUtil nu = new NetUtil(s);
String uandp = nu.get();
String type = "";
String uname = "";
String pass = "";
try {
type = uandp.split(",")[0];
uname = uandp.split(",")[1];
pass = uandp.split(",")[2];
} catch (Exception e) {}
if ... | 0 |
9bdbb710dda11493c2f5877734909b4c | 1e9b95e28ae56d5dab298a76e633c44e | すべてのサブフォルダを追加 | fun State.addFolder(path: String): State {
val paths = folders.insert(0, path)
val noSubs = paths.filter { p ->
!(paths - p).any { p.startsWith(it) }
}
val task: Option<() -> Unit> = noSubs.contains(path).option({ { scan(path) } })
return copy(folders = noSubs,
dir = path,
... | 0 |
5f6b7aa965c249591de7803ce07067e0 | 64fa47ec39e977fc2a2f28b4c0210467 | Common logic to add another widget to the dialog | {
echo Html::endTag('div') . "\n";
$js = <<<JS
$(document).on('click', '$this->initElement', function(e) {
e.preventDefault();
$.get($(this).attr('href'), function(html) {
$('#$this->id').html(html).dialog('open');
});
return false;
});
JS;
$this->registerWidget('dial... | 0 |
f5b122fa3285a6fce147a49106f2fd92 | b1d15280f991c7e352e0f775e0e3df53 | 返回当前图的所有笔画 | Iterable<InkPoint> getInkPoints(); | 1 |
e23d9d0b394631eda2f3fdbd08981972 | 3dce791267c23d6bcda8005ed412d4b4 | 根据content的id获取nav的id和parid | var k, keyName, data, contentId,
temp = {},
das = [],
ids = [],
query = Xut.data.query;
_.each(contentIds, function(id) {
if (data = query(tableName, id)) {
contentId = data.contentId;
if (-1 === ids.indexOf(contentId)) {
ids.push(c... | 0 |
790f9f83b4ed95dd76f24cc36ce745ab | d6d72f546bea91f52ff99371ae14de9a | user_idからプロジェクトメンバを取得する。 | {
$this->db->select('user.*');
$this->db->join('project_member', 'user.id = project_member.userid');
$this->db->where('project_member.projectid', intval($projectid));
$query = $this->db->get('user');
if ($query->num_rows() > 0)
{
return $query->result_array();
}
else
{
return FALSE;
}
} | 0 |
ad43a0beaef9578651b2e2fdecd40b7a | ea4ba4055a7ef67db64f5f9855d0ce4b | indicates if icon resources have to be find in a plugin context | public final class PluginAnalyzer @AutoValue
public abstract static class PluginMetadata
public abstract boolean accessesContext(); | 0 |
7e6468bd4cec416b64f0c93040f8df4b | 3dff95234451fc0fdccf3459b1bda590 | Getter for <code>authorize_net_requests.currency</code>. | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "CancellationFeeInfo", propOrder = {
"cancellationFeeValue",
"currency"
})
public class CancellationFeeInfo
public String getCurrency() {
return currency;
} | 0 |
0804537617924356609c67923cf8632b | efa4d041a5b402ae18c9bb3462933323 | 查询已经关闭的告警事件 | class MonitorClient(AbstractClient):
def DescribeAlarmEvents(self, request):
try:
params = request._serialize()
headers = request.headers
body = self.call("DescribeAlarmEvents", params, headers=headers)
response = json.loads(body)
model = models.Descri... | 0 |
5fdf31e62eea780411e0fd375e23a976 | c4389a3ae859da1d6b51f21f1c03bea0 | Get current time as string (e.g. 18:03:25) | def get_strtime():
return time.strftime("%H:%M:%S")+":" | 1 |
0f47cbfa84cbcff9c2cb2143a52ed1bc | 86f0bb63e5172388e1077bb0589d7952 | 显示或隐藏右边按钮 | if(mRightButton == null || mRightButtonType == null){
return;
}
if(mRightButtonType.equals(RightButtonType.BUTTON)){
mRightButton.setVisibility(visible ? View.VISIBLE : View.GONE);
}else if(mRightButtonType.equals(RightButtonType.IMAGEBUTTON)){
mRightImageButton.setVisibility(visib... | 1 |
8c775204167a5bee13dbb62c874badf9 | 16395be5dddcbce2664ff06136e228f9 | 类方法节流装饰器 | leading: boolean
trailing: boolean
} = { leading: true, trailing: true }) : MethodDecorator {
let handle = null, previous = 0
const ret :MethodDecorator = (target, key, descriptor) =>{
return Object.assign({}, descriptor, {
value: function value (...args) {
const now = Date.now... | 1 |
553351857900c651db6bf03bc54c960c | 2f2ebb2a7d354532c091c5b7f9566653 | Fix PK for MongoDB. | class CleanFixtureCore:
def clean_fixtures(self):
rex = re.compile(r'^ "pk": \d+,')
for fi in self.args.files:
with open(fi, 'r') as f:
content = f.readlines()
newcontent = []
for line in content:
if not rex.match(line):
... | 0 |
61070f3671f5b789007f76947bedab85 | 1bf6d924be34b8ade07b2df2a244b05c | Función para desactivar un catalogo de detalle | {
if(!$request->ajax()) return redirect('/');
$categorias = Categoria::findOrFail($request->id);
$categorias->condicion = '0';
$categorias->save();
} | 1 |
1e35e65bee0ffdc1663033e4165655c1 | 134450d4ebb49f662c728dd18b77653d | 从数据库中根据账号查询出所有的信息并返回 | class dealRecordDBHelper:
def selectAllRecordsOfAccount(self, tablename = 'klq', account = '华泰'):
if tablename != 'klq':
tablename = 'parents'
if account == None or len(account) <= 0:
print('[ERROR] 账户错误:{0}'.format(account))
return None
sql = u"SELECT * FROM ... | 1 |
9ed46663bca6c31b4d29c32735f176eb | ae7e4dfdd6adf8d3a02284a795c1ca8f | 添加固定时间周期执行的任务 | public class ScheduledThreadPoolTest
public static void scheduledWithFixDelay() {
ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(1);
int initDelay = 1;
int period = 5;
scheduledExecutorService.scheduleWithFixedDelay(new Task(), initDelay, period, Tim... | 1 |
b576696cb237c017a8eefec9ae89f2b9 | c1f6e6e985aa721f5fd8598028da0cb9 | Saves all serializable assets that have not yet been written to disk (eg. Materials) | export class SceneExporter
private static async _RecursivelyWriteAssets(editor: Editor, directoryTree: DirectoryTree, assetsPath: string, outputPath: string, options?: IExportFinalSceneOptions): Promise<void> {
if (directoryTree.children?.length === 0) {
return;
}
if (directoryTree.type === "directory" && dire... | 0 |
a5b849f9e317c5ec892142e08c82149b | e59aaf8fa65f1070a1e9da7a82d0cd48 | Add the relation between two users to the database. | with self.connection:
self.cursor.execute('INSERT INTO Relations_user_group(user_id, group_id, participation) '
'VALUES (:user_id, :group_id, :participation)',
{'user_id': user_id, 'group_id': group_id, 'participation': participation}... | 0 |
1673719e3d65c2394ccf21a130acb5b4 | 6078bcb4ad4c83aa8852c43d6c184859 | 发送拜访邀请 | function invitation (tuid,gid) {
send("invitation", {uid: getUserID(), tuid: tuid, gid: gid});
} | 1 |
f1f9379bad49fa72fc8a666079b33894 | 1bf09a2b3bb352287e8c00b058a22cb3 | reassignReferencedNamespaceId
Iterates over all references in this document, find references to currentNsId and changes them to newNsId.
NodeIds themselves are not altered.
returns: nothing | class MyClass():
def MyReplaceReferenceAndFixNameSapce(self , r , new_name , new_reference ):
rfn = cmds.file( r , q=1 , rfn = 1)
if os.path.exists(new_reference):
cmds.file(new_reference , loadReference = rfn ) ... | 0 |
60aef05e4312845189b7ad778bb2333f | 025bb5d2a55a68fea7636b5fa00571dd | Checks whether a saga state was stored as part of full execution chain.
This includes sagas handles as part of child and parent contexts.
<p>This is used to determine whether a saga state needs
deletion in case the saga is finished, but has already been saved in
possible recursive executions.</p> | if (entity instanceof IStatefulEntity)
return ((IStatefulEntity) entity).isPersisted();
return null;
} | 1 |
473de0840fabe7c16c2369188ddb14d6 | fb6f26de9bc214d070a3d7151a299fad | A place for storing generated data. | function DataStore() {
} | 1 |
cc9549f85109acb2592958b52834f741 | 6e08b4579b0f0474dcb1d16074aab5b4 | Adds the filter actions to the tool bar | public class TrackerHistogramView extends ViewPart
private void defineToolBarActions(IToolBarManager manager) {
manager.add(new FilterMenuCreatorAction(this));
manager.add(new RefreshHistogramAction(this));
manager.update(true);
} | 1 |
613b38b533b9e9e57752183e4715e5a6 | 5e7443ab0dd20b608fd9f0a6ae4f0ed6 | 主页简历模块展示 展示最新的8条信息 | class IndexController extends HomeBaseController
public function index() {
$mbResult=M('ecms_homemb');
$this->newsMb=$mbResult->order('id desc')->limit('8')->select();
$this->display(":index");
} | 1 |
72f0344d3ba336ecda95e75da032addc | ce8229fb8fe6d6edc0361877f3b46419 | Returns the meta object for the reference '{@link de.abilov.meta.scenarios.SCScenario#getStateChart <em>State Chart</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EAttribute getSubStatechart_Id(); | 0 |
835753c0a79df59e5453cc508549c4f5 | 3ecc9ed366f4f39a8ab4012dcbecfb0b | Enable / disable endstop checking globally | class RobotController:
def SetEOM(self, e):
if(e == 1):
self.EOM = 1
else:
self.EOM = 0
raw_cmd = 'SetEOM'
cmd = self._build_command(raw_cmd,[e])
return self.exchange_msg(cmd) | 1 |
580f5107f4e417aacc43e1e3075dbc55 | 7f61448ad6da3ef0f9cb03f40c5be655 | functie care nu intoarce nimic | cases like (1) | 0 |
32cf8e52e96d2e6e6a3d84baaffe9568 | 61026382fc9f34ba0025ae539a7f8bce | 使这些经纬度处于地图的可见范围内 | $x = abs(bcsub($point['lng'],$lng,6));
$y = abs(bcsub($point['lat'],$lat,6));
$z = hypot($x,$y);
if(bccomp($z,0.08,6) < 1){
return true;
}else{
return false;
}
} | 0 |
b9a5765ba7d981ebce4a8bcab623cc16 | c3a61faca68194ee69c0b9ba93d17b67 | Ищет в дереве все узлы, удовлетворяющие
параметрам поиска, и возвращает их в виде списка. | {
var addQuery = GetAddQuery(treeView);
var parametersOut = new Dictionary<string, object> {{"@КоличествоНайденных", 0}};
var sql = GetTreeData_Sql(OrderByField, OrderByDirection, SearchText, SearchParam, "", addQuery[0], addQuery[2], addQuery[1]);
var recCount = ... | 1 |
b63cf997811ba64a77619eb6c7d6fe54 | 92c29a1922b230a0705a860dadba319c | Does this view contain any instances for the given scene? | public abstract class FragmentContainer
public abstract boolean hasView(); | 0 |
df78ab7d51d064d7fd4b9c4e8967c5c8 | e5d0a63fdb2fc25e565018c97b01ceaf | 保存帖子可见权限设置 | public void addPostPermission(Map<String,Object>m); | 1 |
9dae2586a202e44828b7dafa1a9c41d9 | 7a9bf4a83d61143ecec84ba0682dbae4 | Recalculate factors used for delta kinematics whenever
settings have been changed (e.g., by M665). | if (
$this->hasChanged(Entity::SPORTID) ||
$this->hasChanged(Entity::VERTICAL_OSCILLATION) ||
$this->hasChanged(Entity::STRIDE_LENGTH)
) {
$this->NewObject->set(Entity::VERTICAL_RATIO, VerticalRatioCalculator::forActivity($this->NewObject));
}
} | 1 |
37f980372031c2d65ac410bb9da86d2d | 568cd4d4f438e4bce4d8daafb9c0f37c | Returns the recent revisions of the given Wikipedia page as a
Pandas time series. | revisions = WikiRevision.get_recent(c.site)
wikiuser = c.user if c.user_is_loggedin else None
builder = WikiRecentRevisionBuilder(revisions, num=num, count=count,
reverse=reverse, after=after,
wrap=default_t... | 0 |
268e142a377737736ade8f9e991eb6a1 | 60b66f9c8ea9d1d8df824f6653656a69 | 把引思管道序列转换为纵向 digraph | if relations is None:
relations = {
'child': {'ast', 'token'},
'parent': {'in', 'data'},
}
relations.setdefault('parent', set())
relations.setdefault('child', set())
result = nx.MultiDiGraph()
leaf_for_node = {}
leav... | 1 |
e07cf5c0898ad0059f1d7a442b4dca16 | 83be0ab36bef7890e3d3221f71d3c0ea | Takes a DeviceDataLoader (basically a generator) and determine
number of iteration will be required per batch. This is used
to set up a progress bar for the training. | nepochs: int=sys.maxsize,
nbatches: int=sys.maxsize):
for epoch in range(nepochs):
for sample in itt.islice(loader, nbatches):
yield sample | 0 |
c5cae197fc51b7378765f5f238dd33a1 | e9a10917bfe3b0744b6c6d5397df4c81 | for user generated content, add any categories not that not already in the list. | public class EditListItemActivity extends AppCompatActivity implements AdapterView.OnItemSelectedListener, AddCategoryDialog.NoticeDialogListener{
private void updateCategories(String category){
if(mViewModel.getCategorySet().contains(category)) return;
mViewModel.getCategorySet().add(category);
... | 1 |
16189b8ac48ae20e2d06adf17c55e17f | 979e2d0f23ad70af5b7d51ec7cb23fa6 | 己方单体用 (HP 0) 判定 | if target_id == 0 then
return true;
end
local target = AvatarCache.GetAvatar(target_id);
if target == nil then
return true;
end
local target_class = Fight.GetClass(target);
return target_class.IsDead();
end | 0 |
dac903ddf7eab3a97fa59eef63343ddb | b8f2c2721571ea87aa693a5fc33297ba | Returns all dynamic properties and their values | namespace Cebos.Veyron.SharedTypes
public static class DynamicObjectHelper
[ExcludeFromCodeCoverage]
public static Dictionary<PropertyInfo, T> GetAllPropertiesForInstance<T>(this T instance) where T : class, IDynamicObject
{
return GetAllPropertiesForInstance(instance, null);
} | 1 |
184da7867ba72b13c1b54ffa198495f8 | ef8d0c2f6f51b02d9277860344454caa | Gets the theta for a perceptron | y = sigmoid(z)
Theta = self.lower + y * (self.range)
return Theta | 1 |
0a23a2eebf6ff1343e425ca9973da07d | 71a759c965dff0497980130551811ad0 | Sets the alpha value of the glow effect, e.g. setting it to 0 will make it invisible. | public void setAlpha(double alpha); | 1 |
61952c6730016855712b186a99342bc8 | 7b740f98e2f47647b73785f67a637ef3 | Setear el mínimo y máximo de caracteres alfabéticos en mayuscúla que tendrá la cadena final | MaxCharacters = maxCharacters;
MinCharacters = minCharacters;
_pattern = "^[a-zA-Z]{" + minCharacters + "," + maxCharacters + "}$";
} | 1 |
b3f5fca5f0bfabcc7b03dec044180d3b | 82228ee0ef7211c92b87d0f59396dc84 | GET: CarRents/Delete | namespace CarRental.Logic
bool DeleteRentData(int id); | 0 |
a8742269b7296280940c5433a93d2d80 | fee8ab5793708cc255fbe55ce2ac9701 | Adds MacBook to cart. | class SwagDetailsPage
addToCart() {
this.addButton.click();
} | 0 |
671a904664df0936da5e94aafa2c816a | e5457523b4253e9b452d9b3005e2c139 | A method which is called once a database connection has been established and accepted by Iridium
In subclassed Iridium cores this method can be overridden to perform tasks whenever a
connection to the database has been established - such as setting up indexes for your
collections or seeding the database. | public abstract class DBDatabaseDriver implements Serializable
protected void attachDatabase(DBDatabase db, Connection conn)
{
} | 1 |
8ace52d24fd621efe3d213fff4f2cecc | 0e586dda39d325c2143548dd7ea5dfd3 | 删除大类时删除小类和小类对应的公式 | String sql = "DELETE FROM tb_itsystem WHERE id = ?";
String sql3="DELETE FROM tb_itsubsystem WHERE id=?";
getSimpleJdbcTemplate().update(sql, systemId);
getSimpleJdbcTemplate().update(sql3, systemId);
ReturnValue ret = new ReturnValue();
ret.setRetCode(ReturnCode.SUCCESS);
ret.setRetDesc("删除系统大类成功!");
r... | 1 |
088f54d5557f319f8fb96859ac99ec4f | 158f5d5ad7d89d63fba8c6cc6c45f771 | Update each element in a list | def applyToEach(L, f):
for i in range(len(L)):
L[i] = f(L[i]) | 1 |
5be0fbade2ffa72ab234b878d05e7673 | 3346b297db3b43ca78d7149aeea2427b | 从本地加载vampire预处理阶段得到的稀疏矩阵 | def load_sparse_csr(filename):
loader = np.load(filename)
mat = csr_matrix((loader['data'], loader['indices'], loader['indptr']), shape=loader['shape'])
return mat.todense() | 1 |
63e9f1541e536e26032bdbe65288bd2d | e58e8c530c734e8485c9362d68fc8135 | 将List按照时间倒序排列 //取出数据中的时间戳,由String转换成Date | Collections.sort(allList, new Comparator<MDataMap>() {
public int compare(MDataMap o1, MDataMap o2) {
String hits0 = o1.get("create_time");
String hits1 = o2.get("create_time");
if (compareTime(hits0, hits1) < 0) {
return 1;
} else if (hits0.equals(hits1)) {
return 0;
} else {
re... | 0 |
de86bdaa56b5e23175a85e6bbf0bb30b | dd7ed7ec87779863acf8d8bad15f73a5 | 设置AP不可用 | if(ifApEnable()) {
try {
Method method = mWifiManager.getClass().getMethod("getWifiApConfiguration");
method.setAccessible(true);
WifiConfiguration config = (WifiConfiguration) method.invoke(mWifiManager);
Method method2 = mWifiManager.... | 1 |
b484286580f2d57bb04e5663f6f8b094 | 69cbf47e9626f87df8c73d100248b061 | 获取视频主题列表接口 | class topic_getVideoTopics(unittest.TestCase):
def a(self):
data = {
"pageIndex":1,
"pageSize":10,
"type":1
}
TopicApi.getVideoTopics(data,self.token) | 1 |
71c34e630e2dcdaddfb303b3c0e8da60 | dd84ae7243edbb1400432688835a2948 | Loads the essays for each project
returns a dictionary with the following format {project id: [essay 1, 2, 3, 4]} | class EssayPipeline(object):
def findEssayIdx(self, X):
self.clean = me.CleanEssays()
self.clean.cleanEverything(X)
self.essay_idx = self.clean.essay_idx | 0 |
4982035fa8caea3270f031885b5dedff | 5f0c1ce68ca63e5803038edf4f49db75 | コメント投稿失敗時に呼ばれます。 | interface CommentView : MvpView
fun showError(message: String) | 1 |
45e35e383986ec0dbd5836a9e0607963 | a4ca978c285bb45baae9f64b6da5a865 | 查询当前儿童的接种记录 | @RequestMapping(value = "date")
public @ResponseBody
String date(HttpServletRequest request, HttpServletResponse response,ChildVaccinaterecord childVaccinaterecord,
Model model) {
List<ChildVaccinaterecord> list=childVaccinaterecordService.date(childVaccinaterecord);
String data=DateUtils.formatDate(new Date(... | 1 |
7df8c95dd46aa2e14141d13059a70c1e | 4d90c560b47485de133fcda502024a0e | https://github.com/bitcoin/bitcoin/blob/2bd9aa5a44b88c866c4d98f8a7bf7154049cba31/src/wallet/coinselection.cpp#L495 | let selectPointer = 0;
let selectedAmt = new Fixed8(0);
while (selectedAmt.lt(requiredAmt)) {
selectPointer += 1;
if (selectPointer > availableInputs.length) {
throw new Error(
`Insufficient assets! Reached end of unspent coins! ${availableInputs.length}`
);
}
selectedAmt = sel... | 1 |
f6483edf55f30fed23b1ffe0a502d41b | 43de16ba22e49f3fcdcee16647012e42 | 获取商品图片改为相对路径 | $hashMap = commFun::computeMachineHash ( $pPicPath ) ;
$replaceStr = str_replace( UPLOAD_FILE_PATH, '/css/picture/', $pPicPath);
$retStr = $GLOBALS['GOODS_URL_PICTURE'][ $hashMap ].$replaceStr;
return $retStr;
} | 1 |
026b5e0b90e07ade81e9c879fb7700c0 | 8e38aab405821e41431e0820f1bfdeae | 创建高德地图中的自定义位置 | mBaiduMap.setMapType(BaiduMap.MAP_TYPE_NORMAL);
BitmapDescriptor bitmap = BitmapDescriptorFactory.fromResource(R.mipmap.station_position);
OverlayOptions option = new MarkerOptions().position(point).icon(bitmap);
mBaiduMap.addOverlay(option);
final InfoWindow currentInfoWindow = ... | 0 |
5ae3513554139ccdb5c3ff35a13bcf46 | 3044156ad6a8c58df91bdc3520324f80 | Sort shared memory. | {
players = sharedMemory->players;
torps = sharedMemory->torps;
context = sharedMemory->context;
status = sharedMemory->status;
planets = sharedMemory->planets;
phasers = sharedMemory->phasers;
mctl = sharedMemory->mctl;
messages = sharedMemory->messages;
uplink = sharedMemory->uplin... | 0 |
3e5f06c14be0356247406b406e2e9452 | aec4d70b5b558d6bbcf05924e36d4015 | Delivers the tresor. | def treasure_draw(command_id, seq_id, user_id, conn, data):
logger.debug("treasure_draw[command_id=%d]" % command_id)
defer = GlobalObject().remote['app'].callRemote("treasure_draw", user_id, data)
defer.addCallback(store_user_response, user_id, seq_id)
return defer | 0 |
912953a06f4ec07f15b5b51b61dc20c4 | 0163a6eec2d857e85ca96fe8ed590bcb | Adds a command object.
If a command with the same name already exists, it will be overridden. | public class Terminal extends Service
public void addCommand(TerminalCommand command) throws TerminalCommandException {
if (registry.contains(command))
throw new TerminalCommandException(String.format(ERROR_DUPLICATE_COMMAND, command.getKey()));
addOrReplaceCommand(command);
} | 0 |
999e17f41f376189bb9aa15044772d7f | 83cead132419b259d4882c0665a5729f | 笛卡尔坐标系控制变量函数 | void track_controller(path_t *path, interpolation_t *inp_data, pps_feedback_t *ppsFeedback, fp32 *vx_set, fp32 *vy_set, fp32 *wz_set)
{
static float Vx_to_control;
static float Vy_to_control;
static float Wz_to_control;
static float global_ex = 0;
static float global_ey = 0;
static float global_etheta = 0;
stati... | 1 |
6228dd41995327b6f9ce2ab83b94e904 | 9b9324edb24edf271393959897ef5665 | Функция която връща повтарящите се думи от подаден текст и тяхния брой | text1 = text.split()
text2 = []
symbols = ",.-!*"
for En in text1:
for symbol in symbols:
En = En.replace(symbol, '')
if len(En):
text2.append(En)
text3 = " ".join(text2)
text3 = text3.lower()
text3 = ... | 1 |
a7b9b5f4a6bea95341380d19f039f278 | 8d2f2ecbdfa0668ea67aa67f36e9c884 | compare numberA and numberB of operands for equality | if (a.negative != b.negative)
return false;
if (a.integer_len != b.integer_len)
return false;
if (a.decimal_len != b.decimal_len)
return false;
for (int i = 0; i < a.integer_len; i++)
if (a.integer[i] != b.integer[i])
return false;
for (int i = 0; i < a.decimal_len; i++)
if (a.decima... | 1 |
705f877c1b91d919a1597577d26c566f | 2ab554b5505f0f9ec8be719c8a5f8134 | Run a job described in job_description | class JobManager(base.Manager):
def execute(self, job_id, resume=False, force=False):
headers = self.api.credentials_headers()
address = '/job/execute/%s/%s/%s' % (job_id, resume, force)
resp, body = self.api.json_request('POST',
address,
... | 0 |
2347d5d5c3777413031f6432c624e717 | cf6e26482d0c5aa6441cd20943a8e411 | Function Name: TransmitShiftReg_Enable
Enables the Shift Register.
void.
void. | {
u32 ReadVal;
Xil_AssertVoid(InstancePtr != NULL);
Xil_AssertVoid(InstancePtr->IsReady == XIL_COMPONENT_IS_READY);
Xil_AssertVoid(XDp_GetCoreType(InstancePtr) == XDP_RX);
ReadVal = XDp_ReadReg(InstancePtr->Config.BaseAddr, XDP_RX_DTG_ENABLE);
XDp_WriteReg(InstancePtr->Config.BaseAddr,
XDP_RX_DTG_ENABLE, R... | 0 |
c5a04e7fda12075974760ea52dd5b10c | cb80411dbd291bef243fffcbc98b2b54 | \
Given the /y of a data point on the Lambert grid, compute
the Latitude/Longitude location on that same grid.
x - x position, in kilometers
y - y position, in kilometers
lat - latitude of data value, in degrees.
lon - longitude of data value, in degrees.
RPGCS_LAMBERT_ERROR if Lambert_init hasn't been called to
initia... | def NOWrad_to_lon_lat(xpoints, ypoints, xMin=0, yMin=0):
lats = 53 - (yMin + ypoints) * .0180
lons = (xMin + xpoints) * .0191 - 130
return lons, lats | 1 |
9ac61e107eba0950231c9d5e7ec62055 | a704b9cae66b4cdbde429b7e67838891 | Co-rutina que permite el aumento de velocidad por una cantidad finita de tiempo. | public class Viaje_Minijuego_GameController : MonoBehaviour
void IncreaseDifficulty(){
Time.timeScale += incDifficulty;
} | 0 |
74310634b984c9afcf461edd1318fd23 | 8571d8a78bc0794c16a4677aa24f163d | k线主题样式 | class KPoint(Style):
def __init__(self, stock, time, index, k_data):
self.stock = stock
self.time = time
self.index = index
self.k_data = k_data
self.origin_k_data = k_data | 0 |
5c35b726735cbd72045f7e98a6fd6be4 | 70b792d994ce244362d99934db302ac2 | Returns the numeric Unicode character code of the character at the specified index. | {
if ((index < 0) || (index >= Value.Length))
{
throw new StringIndexOutOfBoundsException(index);
}
return Character.CodePointAtImpl(Value, index, Value.Length);
} | 1 |
82ce292ccbb74f28f5b86dcfd1e25fe2 | 38e5ca37755002bd6f3d5d6a52e7408d | !
\brief Update the state of the problem given the new solution vector. | ho_ = args[DOF_IDS::ho];
hf_ = args[DOF_IDS::hf];
nh_ = (unsigned int) args[DOF_IDS::nh];
dy_ = (hf_ - ho_) / (double) nh_;
uSolutionsMatrix_.resize(nl_, std::vector<double>(nh_));
} | 0 |
38b49bbd8567f1eda5d95656fcce9219 | 85a05e17bb3c974f7177f6441359cf39 | 内存空间位示图初始化 | bool initMemZ() {
headZ = new ZoneNode();
lastZ = new ZoneNode();
headZ->prior = NULL;
headZ->next = lastZ;
lastZ->prior = headZ;
lastZ->next = NULL;
lastZ->dsp.begin_address = 0;
lastZ->dsp.length = MEM_SIZE;
lastZ->dsp.state = FREE;
lastZ->dsp.taskId = 0;
return true;
} | 0 |
044c7281fae9f421e39e6056c66a11a1 | b34106e914583875be757c585feed2b0 | Register share scripts.
Registers the scripts needed to share. TODO: Separate scripts to files and differ register/enqueue. | class Envoy2014
public static function registerScripts()
{
$template_url = get_bloginfo('template_url');
$url = $template_url . '/js/';
wp_register_script('envoy', $url . 'envoy/envoy.js', array('jquery', 'envoy-simplemodal'));
wp_register_script('envoy-fluid', ... | 0 |
948577f956bbfbd82243ac1f9df2085a | 1626330de20a4a9d31599d39108a4356 | ルートディレクトリに移動する | if (chdir(self::$SAVE_DIR) === False) {
$this->_writeLogFile(__LINE__, '作業ディレクトリへの移動に失敗しました。');
return False;
}
$this->_writeLogFile(__LINE__, '作業ディレクトリへの移動に成功しました。');
return True;
} | 0 |
797f3dadca7d37cac3cacb5ae33344c8 | a324bb6f55c3e0625b59ffe824b54dfd | Load the specified aggregate function 'name' into the current connection.
Follows the sqlite3 API (which see). | lua_settop(l, 2);
assert(lua_type(l, 1) == LUA_TUSERDATA);
luaL_checktype(l, 2, LUA_TSTRING);
struct dbuserdata *ud =
(struct dbuserdata *)lua_touserdata(l, 1);
sqlite3_stmt *stmt = NULL;
int rc = sqlite3_prepare_v2(ud->db, lua_tostring(l, 2),
-1, &stmt, NULL);
if(rc != SQLITE_OK) {
lua_pushboolean(l, 0);... | 0 |
e83282f4d15a85472cabb956bf4e1b2b | ff46f4bbf0342393e2913cfbda6ac7aa | @brief キャッシュディレクトリが書き込み可能かチェックする | function dir_writeable($dir) {
$writeable = 0;
if(is_dir($dir)) {
if($fp = @fopen("$dir/chkdir.test", 'w')) {
@fclose($fp);
@unlink("$dir/chkdir.test");
$writeable = 1;
} else {
$writeable = 0;
}
}
return $writeable;
} | 1 |
18d1b1d5339dea1dcb29ae1f4f8074a3 | 6f7e1fcda1f85af09337b38f8f429fd6 | Метод для передвижения персонажа по нажатию кнопок WAD | switch (input)
{
case 'w':
if (jumpable) {
player->isJump = true;
clearPlayer();
playerJump();
Sleep(50);
playerJump();
Sleep(50);
playerJump();
Sleep(50);
player->isJump = false;
UpdatePlayerPos();
}
break;
case 'd':
if (!player->isJump)
++player->leg->posX;
UpdatePlayerP... | 1 |
35d4c73467a3726c8e870430fd8e6831 | 56dff5c79e22b5557d8775e442a1fdc7 | Get SCSI disk geometry for a given LUN. | int osd_get_physical_drive_geometry(const char *filename, UINT32 *cylinders, UINT32 *heads, UINT32 *sectors, UINT32 *bps)
{
return FALSE;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.