query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
0f0784d512f5ff87b5f3f276506dbf59 | 49c664ab94424a0dffd6e248d641969a | 在玩家单击Enter按钮时等价于点击play button | void CRoomDialog::onEnter()
{
if (theApp.m_roomid == empty_id)
{
for (uint i = 0; i < MAX_SPEAKERS; i++)
{
m_player[i]->load(nullptr);
m_player[i]->play(0);
}
closeCapture();
ShowWindow(SW_HIDE);
return;
}
CString str;
str.Format(L"%llu", theApp.m_roomid);
SetWindowText(str);
str.Format(L"fvi... | 1 |
916dbc3ac73b880511dfa3ecfd455aaf | 8bb15ea8baf7ce1286e7f3f9695abbe0 | ! \brief Start a volume ramp change | {
auxSetVolume( cd_info.volume_id, ( actual_volume | ( actual_volume << 16 ) ) );
} | 0 |
838d7e0dd6494b43a9858ae43568fb40 | 5b92a497d490b70dfb8c10bd5911a53c | Returns the run time sysroot, which is where the dynamic linker and system libraries are found
at runtime. This is usually an absolute path. If the toolchain compiler does not support
sysroots, then this method returns <code>null</code>. | File getSystemRoot(); | 1 |
a270f2f0f60afc09b79d603755dd8857 | 02f51e56784f060ecb25618f0b07f5ff | IP Address for the sender of the message. | class Message:
def get_sender(self) -> tuple[str, int]:
return self.header.ip, self.header.port | 1 |
9e141c464249b3c5d2df311fac0d9378 | d6fb4c39e54667feb3f4a41165f23f53 | Returns the index of the argument associated with the column-name or -1 if not found. This may do a linear search
through the arguments. | public int getColumnIndexForName( String columnName ); | 1 |
93a55564519c9a2069de63ee041b772e | a10af3fed20aa0827720fcdef68824b9 | The following function calculates the size of each expression. | class LogicalExpressionBase(LogicalValue):
def size(self):
return sizeof_expression(self) | 1 |
83f6aa64c3d5b0e4688a6da6a2d36d61 | e6f64fc05880852b86fb442ac9643d79 | 取得槽子的镶嵌情况 | public class TrocManager
public int getSlot(String loc, ItemStackSnapshot item){
if(getTroc(loc,0).isPresent()){
if(ItemStackComparators.TYPE.compare(getTroc(loc,0).get().getItem().createStack(), item.createStack()) == 0
&& ItemStackComparators.PROPERTIES.compare(getTroc(loc,0).ge... | 0 |
cc8d1c1a879b6a27a8aaacd0e38f86c9 | 4828b09d7c5010c24a6cf2fbd7735649 | Trim to outermost zero-crossing points of input signal | function trimZeroes(fourierArray)
{
var tolerance = 0;
var breakPoint = fourierArray.length;
for(var f = fourierArray.length - 1; f > 0; f--) {
breakPoint = f;
if(Math.abs(fourierArray[f]) > tolerance)
{
breakPoint = f + 1;
break;
}
}
trimmedArray = fourierArray.slice(0, breakPoint);
for (var f = 0... | 1 |
e86d4e25b2a726afd090b973dca89cb4 | 7299c246f4b1f72fc6c61e40a1f9d25d | gets the length of the cable | public class EntityDart extends EntityThrowableBase
public double getCableLength() {
return this.cableLength;
} | 1 |
a86b89b95312414e0ae1c1c90019f61b | 8269abe37550dac87457330f25ae4bea | Заполняет test случайными данными | testdata[0].v = rand();
for (int i = 1; i < N; i++) {
testdata[i].v = testdata[i-1].v + (rand() & 15);
}
} | 1 |
f792e112722e2d05b5e1c9c084b0bc75 | 5675a7deb92c7befb4d153a7ac072def | Apply player attributes on first join | public class PlayerEvents implements Listener
@EventHandler
public void onJoinAtt(PlayerJoinEvent event) {
plugin.actionDefaults.updateAttribute(event.getPlayer());
} | 1 |
9539aeb65e94239540d9fe0f553b83b6 | 6dd8fb79170f6fb5a3a27d89fe051bb1 | получает текущую позицию наложения штампа | public class ToolState
public TileStamp getCurrentStamp() {
return currentStamp;
} | 1 |
3b709c4fffe8201454b230f92f9bf338 | fc6b6f3fdce67e94b8c003e5d63599c8 | список id юзеров, состоящих в чате | class ChatDb:
def list(self):
for row in self.db.execute('SELECT DISTINCT chat_id FROM chat_ids'):
yield int(row[0]) | 0 |
b23d64ba7277fceb21cd3e38c5df316c | 32585edae85f0e51ca2e8c60510b31a3 | =============================================================================
Returns the count of bytes disassembled.
============================================================================= | public class DNSRDataTXT implements DNSRDataInterface
public int getDisassembledLen() {
return disLen;
} | 1 |
0f5e6704d83afc3409019015e6a55a2f | 3043c3e926c93e9ff0515a0aeacfe430 | 获取在线的活动,只返回一个 | @Service("activityService")
public class ActivityServiceImpl extends BaseServiceImpl<Activity> implements ActivityService
@Override
public Activity getActivity(int activityType) {
String hql = "from Activity where 1=1 and activityType=:type and startTime<=:currentTime and endTime>=:currentTime and isActive=... | 1 |
586b27365299fa61419e4c0e1539b5ca | 6ae237396a25d2a7e84fff3b0278de78 | Tests whether or not a connection to the DB can be established by
trying to query a table. | try (Statement statement = connection.createStatement();
ResultSet rs = statement.executeQuery("select 1")) {
rs.next();
return true;
} catch (SQLException ex) {
ex.printStackTrace();
}
return false;
} | 1 |
1309e6c9f3c05e17f44803c86be8c0d5 | 2e744ad2f9a7b946c268a4306405367f | 判断是否为合法的mac地址 | function checkMac(mac){
mac = mac.toUpperCase();
if(mac == "" || mac.indexOf(":") == -1){
return false;
}else{
var macs = mac.split(":");
if(macs.length != 6){
return false;
}
for(var i=0; i<macs.length; i++){
if(macs[i].length != 2){
return false;
}
}
var reg_name=/[A-F\d]{2... | 1 |
9a64fdd082b8294d3fb7413aa6e4109b | 1443ad4c9e9d0c47f11875e1440ee6d8 | 查看红包消息返回,打开查看界面 | export class OpenRedEnvelope extends Widget
public async openNormalRedEnvelope() {
const res = await takeRedEnvelope(this.state.rid);
setTimeout(async () => {
switch (res.result) {
case 1:
const v = res.value;
const redEnvelope:RedEnvel... | 1 |
d112ba600b18ac5c1dff83d15eddebc6 | 79953eea76a84ce84e4428ab743ab7a9 | Creates a new result
# noqa: E501 | obj = cls(data.get('name'), data.get('number'), None)
results_dict = data.get('results')
results = [Result.from_serializable(res) for res in results_dict]
obj.result_infos = results
return obj | 0 |
f0a6b35683eae4b156d83c556d3400e9 | 4028302db3614a9502d324c8ea3cfe8b | returns the sketchy shape associated with a given layer | public class Layer
public SketchyShape getShape() {
return _sketchyShape;
} | 1 |
b5157c6ae36a1d8e51a1e58f5b7ab958 | a9e5cbceb8a6b3920805f196c19428e1 | 同步Cube位置 | public class Cube240 : MonoBehaviour, IInputClickHandler
private void OnCubePositionReceived(NetworkInMessage msg)
{
if (!isMoving)
{
transform.localPosition = CustomMessages240.ReadCubePosition(msg);
}
} | 1 |
f8209af2d4c1e459e76377bdb8dbc0bd | 11c58f85dd51da0dda809a7f539c6f34 | Handles a WACK done request. | if (board.getStatus() == WAMBoard.Status.RUNNING) {
int holeNo = Integer.parseInt(pane.getId());
this.client.sendWHACK(holeNo);
}
} | 0 |
28a0ade3347b1db2a8f5f691e5df1492 | ae142fb489159db3c292654826d92dd5 | 将视频帧写入全局缓冲区,供videoProcess用 | int CDecCallBack_DemoDlg::WriteFilePushData(BYTE* pBuffer, int nBufSize, int nId, BOOL bVideo, BOOL bKeyFrame, long lTimeStamp)
{
if (!pBuffer || nBufSize<=0)
{
return -1;
}
EnterCriticalSection(&m_cs);
FrameInfo* pTmpinfo = NULL;
pTmpinfo = new FrameInfo;
pTmpinfo->pDataBuffer= new unsigned char[nBufSize];
i... | 1 |
76d9aeff679cc506f1d1e94200f02a3f | aba35739e466ab69302adb9679ae0613 | Sets up the matrix of possible conversions to all basic datatypes to the mode supplied. | {
switch( iMode )
{
case InterpolationMode.Bezier:
return BezierMatrix;
case InterpolationMode.BSpline:
return BSplineMatrix;
case InterpolationMode.Hermite:
return HermiteMatrix;
case InterpolationMode.Linear:
return LinearMatrix;
default:
return LinearMatrix;
}
} | 0 |
97703afcb655dd8f6a22182cad548ee3 | a948b9ae3fb780c8c37ee655d92f2d51 | 若队列不空,则从队头到队尾依次输出各个队列元素,并返回OK;否则返回ERROR. | {
if (queueIsempty(qu))
{
return 0;
}
int i = (qu->head + 1) % MAXSIZE;
while (i != qu->tail)
{
printf("%d ", qu->data[i]);
i = (i + 1) % MAXSIZE;
}
printf("%d\n", qu->data[i]);
return 0;
} | 0 |
f147d7e50bacb205c639dec1f5aa39f0 | 414e8509d37f2e478f2f4ffb6f83960f | Determines if a IPv4 address is valid.
Does not handle IPv6 addresses. | {
return (bool) filter_var(
$ipNumber,
FILTER_VALIDATE_IP,
FILTER_FLAG_IPV6
| FILTER_FLAG_NO_PRIV_RANGE
| FILTER_FLAG_NO_RES_RANGE
);
} | 0 |
c4432fd668252f9200645588e3affe57 | f12605fef259beb1c759268da5c58bed | 判断该手机号是否已经注册过会员 | {
string sql = "select registerid,mobile from hx_member_table where mobile='" + mobile + "'";
DataTable dt = DbHelperSQL.GET_DataTable_List(sql);
string str = "";
if (dt.Rows.Count > 0)
{
if (dt.Rows[0]["mobile"].ToString() == mobile &&... | 1 |
97203888097003614d7f668b5f2e3e28 | 8cb1beb6e2bae9080e85eb60ab87ed43 | Propagate satellites position at first epoch. | GTime time,
Geph& geph,
Vector3d& rSat,
double& dts,
double* var = nullptr)
{
double t = time - geph.toe;
dts = geph.taun
+ geph.gamn * t;
double x[6];
for (int i = 0; i < 3; i++)
{
x[i ] = geph.pos[i];
x[i + 3] = geph.vel[i];
}
for (double tt = t < 0 ? -TSTEP : TSTEP; fabs(t) >... | 1 |
e3706da1ee57560765af2fb1dc52f954 | 600e40655cbc826d81187af4f57ae3eb | r"""Number of Responses Falling on Band-0 for TTFP. | class appqoepolicy_stats(base_resource) :
def totresponse(self) :
try :
return self._totresponse
except Exception as e:
raise e | 0 |
f4eba430a310ac3653845c27f07c09ae | 7f61448ad6da3ef0f9cb03f40c5be655 | entry point for the whole enchilada | cases like (1) | 0 |
242c66c1b3e30be4cdb5726b1497be1a | b703439011d8e9f15ba82749f14b5da5 | 只需要按num查找出学生信息,再和用户填写的密码比对,一致则登录成功 | public String studentLoginCheck(StudentEntity studentEntity, ModelMap modelMap){
String studentNum = studentEntity.getStudentNum();
String studentPwd = studentEntity.getStudentPwd();
modelMap.addAttribute("studentNum",studentNum);
boolean flag = studentService.studentLoginCheck(stude... | 1 |
baa8176900c57a7fe3e7bfbf06885c5c | 7f3150b49bb417b7ca2b6932717551ec | 相关帖子的打赏记录 | class BookController extends HomeController
public function LoadSend()
{
if (IS_POST) {
$mxid = I('post.mxid');
$page = I('post.page');
$type = I('post.type');
$size = 10;
$start = ($page - 1) * $size;
$list = M('mxsend')->where(arr... | 1 |
3895c0db5b38913caf608aef5909e3b9 | 57a9eaa5593d7f547d078a9bbf283b11 | Tests that a Promissory Note can be created. | data = {
'user': self.user.id,
'amount': 1234
}
response = self.client.post(self.url, data)
self.assertEqual(response.status_code, status.HTTP_201_CREATED) | 1 |
05bb380e51992c339e799dd393d2e7b7 | 05fb94ae70b756c4f9030c238a5ee860 | 清除并复制目录 | function move($source,$dest){
cp($source,$dest);
del_dir($source);
} | 1 |
4fbdaaaec0182883903c1c7242060159 | 51b4b341b67a9bcac4ecb9c4291af732 | NewServer creates a new service server instance | func NewServer(options *Options) *Server {
return &Server{Options: options}
} | 1 |
cbaab49d43ac11794753ca94b5f14560 | 309b8aaf28361b46187f448d29116ef2 | This function updates the Time Elapsed button inside the GUI. | class TimedCounter(QGroupBox):
def update_timer(self,cur_time):
if not self.timer_interrupt_flag:
minutes = int((cur_time-(cur_time)%60)/60)
seconds = cur_time%60
print(f'count_time: {cur_time:d}, minutes: {minutes:d}, seconds: {seconds:d}')
new_elapsed_text = ["... | 1 |
2e5c0104968444fcbb35e173099199bb | 93b0903bd178cccd963d61bd48a43634 | Executes the attack of an Assassin. | public void runAttack(); | 1 |
7160fd96bd51db920cf52949a4f2d4f9 | c5fc06eef65d3948e6b2d1eabcf72e06 | 获取IP总访问量 | public class JltfispStatisticsTotal
public Integer getIp() {
return ip;
} | 0 |
13ccac909a76882c6c651fb1f7f710f1 | 50b709f3208683327f29b75c6830ea0b | Um für das Produkt Edit Formular den Preis im richtigen Format zu erhalten, damit wir das Input Feld für den
Preis entsprechend vorbefüllen können, wollen wir den Preis hier in einen numerischen String mit 2 Nachkomma-
Stellen formatieren. | class Product extends Model
public function getPriceAttribute($price)
{
return number_format($price / 100, 2);
} | 1 |
56f8c11c9a16a13f9c9c2ccb4b8af45c | 0fee12328f2dd42bc8c349abcf830988 | GET: One event. | namespace Microsoft_Graph_ASPNET_Snippets.Controllers
[Authorize]
public class EventsController : Controller
public async Task<ActionResult> GetEvent(string id)
{
ResultsViewModel results = new ResultsViewModel();
try
{
GraphServiceClient graphClient =... | 1 |
db28d549d3322a7b1a67b6b13d439393 | 77e098e5233b0715adc1873b28f68a71 | 如果指针不为空,移走该节点 | List * p;
if (ptr == *begin) {
*begin = (*begin) -> next;
} else {
p =* begin;
while (p -> next != ptr) {
p = p -> next;
}
p -> next = ptr -> next;
}
if (ptr -> next == NULL) {
*cur = p;
}
delete ptr;
} | 1 |
47fead4a9d57843e47b23eccec21b5e1 | e86e965ea2e69cc93007040ebb5fe35d | this is necessary to know how many the player should collect to finish the level | {
var startPoint = playerGroup.GroupBounds.ClosestPoint(levelFinishZone.bounds.center);
var endPoint = levelFinishZone.ClosestPoint(startPoint);
return (endPoint - startPoint).magnitude;
} | 0 |
4cec23d288b6434e491020c5dba686ae | 02d8ac909057f1fd66e9440380001cce | Make the camera shake randomly | if(shaking) {
Vector3 shakeVector = new Vector3(shakeStrength, 0, 0);
shakeVector = MathUtil.Rotate(shakeVector, Random.Range(0, 360));
transform.position = baseCameraPosition + shakeVector;
shakeStrength -= shakeDampening * Time.deltaTime;
if (shakeSt... | 1 |
c50825e2665ecafc924fca3d9fc1325e | 7c8ee376f6919f28d357b374dc891049 | показывает иконку в панели задач | class Sozlux(QtGui.QMainWindow, Ui_MainWindow):
def showTrayIcon(self):
self.trayIcon.setIcon(QtGui.QIcon("sozlux.png"))
if self.trayIcon.isVisible():
pass
else:
self.trayIcon.show() | 1 |
77713e50336111cbdedec021d566abb0 | 6c66facc5ae5a6c9df76844fd1ab142e | Make immutable collection, make empty collection for nulls. | abstract class ImmutableCollection implements
ArrayAccess,
Countable,
IteratorAggregate
public function __construct(array $items)
{
$this->items = $items;
} | 0 |
f281134792d1f4d4f477fb9b3a456dc5 | 522e3779701af437273f2048f28e00fa | fonction pour afficher les options de couleurs. | @SuppressWarnings("serial")
public class FenetrePrincipale extends JFrame
public void choixCouleurs() {
ColorChooser colChooser = new ColorChooser(infos);
colChooser.setVisible(true);
} | 1 |
f552e8564b4766b0003e0b6eeb5f72da | cc80270113feac726ac2c2f1b24b740e | Check that a value is within inclusive acceptable range. | class TestCaseMixin(object):
def assertInRange(self, value, low, high, msg='{0} not in range {1} - {2}'):
self.assertGreater(high, low, "assertInRange() called with low >= high value.")
formatted = msg.format(str(value), str(low), str(high))
self.assertLessEqual(value, high, formatted)
s... | 1 |
0f4921f07e5b7d8a5a7921c1ad3dbb6d | 3c10c6d986c199e4ae4144e0698d416f | Returns the result of interpreting the object as an instance of '<em>Text Label</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | public class AssessmentSwitch<T1> extends Switch<T1>
public T1 caseLabel(Label object) {
return null;
} | 1 |
04ba3c7acf9bb85555ddddfc57931e4d | 7c86fc7e48acf71d06a7c57446c37626 | Get days to be added to shipping time | class ControllerYandexbuyBase extends Controller
private function getDeliveryDays($days, $before) {
$days_arr = explode('-', $days);
$from = intval($days_arr[0]);
$to = isset($days_arr[1]) ? intval($days_arr[1]) : $from;
if (intval(date('H')) > intval($before)) {
$from++;
$to++;
}
return array('fromDa... | 1 |
e71e7da6b6ba3b9134e53192b2703ed0 | 5e44417312e5e40bd2d23e9a90153bb6 | Dictionnary of nodes based by id | class HepReader(object):
def get_nodes(self):
return {node_id: Node(node_id, self.dates[node_id], self.communities[node_id]) for node_id in self.dates} | 1 |
d2ead59ffb2a679f7ca7664bb01d1db7 | 70a46fa6eff4b631bbfc5951df1f1502 | Goal here is to remove the acceptable brackets from the string until we see it
is all okay or finding one corruption | def is_bracket_correct(input_string):
i = 0
a = input_string
if a is "":
return True
else:
if a[0] is "}" or a[0] is ")" or a[0] is "]":
return False
else:
while i < len(a) and (a[i] is "{" or a[i] is "(" or a[i] is "["):
i = i + 1
... | 1 |
bd22ddddf6be1b26fa4d2c1b3b39e342 | c95af73953d161776c3acd147925e306 | Set the 802.11 \'Data\' data frame \'Duration\' field | class Dot11(ProtocolPacket):
def set_subtype(self, value):
mask = (~0xF0)&0xFF
masked = self.header.get_byte(0) & mask
nb = masked | ((value << 4) & 0xF0)
self.header.set_byte(0, nb) | 0 |
ddf7c8e50aef03abbd675452e0112a19 | ff985af65c638644963af5846ad04ebf | Determines how many USB 3.0 slots are on the machine | lsusbusb = subprocess.Popen('lsusb', stdout=subprocess.PIPE)
grepusb = subprocess.Popen(('grep', '-ow', '3.0'), stdin=lsusbusb.stdout, stdout=subprocess.PIPE)
lsusbusb.stdout.close()
wcusb = str(subprocess.check_output(('wc', '-l'), stdin=grepusb.stdout)).rstrip()
grepusb.stdout.close()
return w... | 1 |
0df5681d9eb6665d1c3510f09eef73bc | 4803ee6c008b9b7eb0053c621979a022 | Gets the actual_dead_date of this ResourceModel. # noqa: E501
Actual dead date from resource # noqa: E501 | class InfoDatasetBase(Enum):
def DEAD_ID(self) -> int:
return self._get_property('dead_id') | 0 |
79f9db6e80afd6cd29fdd597fb3bdf55 | 4e8f3e1a45fc3fdc8eb4b11f529d3e0e | このインスタンスに割り当てられた型ごとに独立したユニークインデックスを返す | class BaseUserEntity extends BaseEntity
IndexOf(type){
switch(type){
case IndexType.Domain:
return this.domainId;
case IndexType.Name:
return this.name;
case IndexType.Foreign:
return this.openid;
default:
... | 1 |
f2a649a879a87cbbbb3f6a52f309d451 | 78ebaedfa4988fcf23957c58a34de532 | Parse the properties found in site.properties | {
String cfgFileName = System.getProperty(CONFIG_FILE_NAME,
PROPS_FILE_NAME);
Properties props = loadPropsFromFile(getConfigFolderName()
+ cfgFileName);
if (props != null)
{
for (Object name : props.keySet())
{
_... | 1 |
b7d8e1f3d0f414afd6f0dd33f6fb9504 | ad40ff15a07bdab120355616ab2bed9c | Close 'add from files' dialog | function closeAdd() {
add_iframe_dialog.close();
} | 1 |
181f06347d215612f2c2b1258b651df3 | 893430ad742b75687868f34e696acbf0 | Assert that hash function will return a value on empty string | class TestHashUtils:
def test_hash_password(self):
assert hash_utils.hash_password('') == 'd14a028c2a3a2bc9476102bb288234c415a2b01f828ea62ac5b3e42f' | 1 |
d30ec523488c8302213275c2d2938d82 | f481ce6df36db86e30135640f12e453a | Selects Inspection records by Inspection_SiteId
</summary> | {
int count = -1;
return GetByMaintenanceRecordId(null, _maintenanceRecordId, start, pageLength, out count);
} | 0 |
72596e096975e4865075483224efe6ef | f0c7c19982a8c00766d0380f1d6b8e1c | 根据条件获取,客户信息集合 | @ResponseBody
public List<CustomerVo> getCustListByCondition(CustomerVo customerVo,HttpServletRequest request)
{
List<CustomerVo> custList = null;
custList = customerService.getListByCond(customerVo);
return custList;
} | 1 |
0a37ede42833c15ff4f09ac20a59ccfd | b6e25d0176640fd396b79f3d4e5c9a1c | 返回路由文件所在目录路径 | class ScanRouter
protected function routePath(): string
{
return App::path('router');
} | 1 |
5fc18f1643e5f8a06ba88a07baa0abc1 | 28e95361cdbfed95dfd4d0c89d2d33f7 | Accessor for search field so search terms can be set externally e.g. from Class Viewer | export class ListEmployeesComponent implements OnInit
get searchTerm(): string {
return this._searchTerm;
} | 1 |
20da4e43454f55a4f3b996b6b8cc86fa | d81f670bc21c5fc85e3cc57ddf6b9c82 | 提供一个抽象方法当前类的子类需要提供具体实现类的Dao | public Dao<T, V> getDao(OrmLiteSqliteOpenHelper helper, Class<T> cls); | 0 |
891f41bb293b3d0889af96df1ff09656 | e3903ba8471f86a7fcbce4e595ffd4fa | Updates one entry in the replay memory | class DQNAgent:
def update_replay_memory(self, transition):
self.replay_memory.append(transition) | 0 |
c841a8da33a0b2c6c8f4c582eea20674 | 6148ecc76e6bc0e6f0ee1597f1232db1 | 给定神经网络的输入和所有参数,计算神经网络的前向传播结果,使用了三层全连接神经网络,通过隐藏层实现了多层网络结构,通过ReLU激活函数实现了去线性化 | def forward(network, x):
W1, W2, W3 = network['W1'], network['W2'], network['W3']
b1, b2, b3 = network['b1'], network['b2'], network['b3']
a1 = np.dot(x, W1) + b1
z1 = sigmoid(a1)
a2 = np.dot(z1, W2) + b2
z2 = sigmoid(a2)
z3 = np.dot(z2, W3) + b3
y = identity_func(z3)
return y | 0 |
0b1467207144eac4bdeaa1f9366ba26a | 021de893c29ade1a06de930f88aa040c | 判断给定格式的时间字符串是否为同一天 | public final class DateUtil
public static boolean isSameTime(String time, String timeFormat) {
String now = LocalDateTime.now().format(DateTimeFormatter.ofPattern(timeFormat));
return now.equals(time);
} | 0 |
827f102eae3899a864b45d308c205126 | 83cda715d148bf11cd993a5bdfb7364c | Parses the load commands after we've carved out the module instance.
This fills in the segment table and perhaps some other properties. | mk_load_command_segment_copy_native(mk_load_command_ref load_command, struct segment_command *result)
{
_MK_LOAD_COMMAND_NOT_NULL(load_command, return MK_EINVAL);
_MK_LOAD_COMMAND_IS_A(load_command, _mk_load_command_segment_class, return MK_EINVAL);
if (result == NULL) return MK_EINVAL;
const mk_byteord... | 1 |
2815e4eb03fac2fa3551aa6e8a2db09d | a95180d18dfa7a96aaffbb7c93751c5f | Brings a table on-line (enables it).
Synchronous operation. | export class WordsApi implements Encryptor
public async deleteTableOnline(requestObj: model.DeleteTableOnlineRequest): Promise< model.WordsIncomingMessage< Map<string, Buffer> > > {
if (requestObj === null || requestObj === undefined) {
throw new Error('Required parameter "request" was null or undef... | 0 |
59d2dd5beac058515fef03e73e73e5ea | 27014d4649b1ccdf59a3429446da57a5 | Sets csv result. | $this->result = str_getcsv($this->result, "\n");
if (!$this->result_with_header) {
unset($this->result[0]);
}
} | 1 |
6078c53245e5b767c32c8818e85a45cd | ad88b61892e08c7775b9d77a8f6e6d55 | Tests rollback with OpenMode.CREATE | public class TestDirectoryTaxonomyWriter extends FacetTestCase
@Test
public void testRecreateRollback() throws Exception {
Directory dir = newDirectory();
new DirectoryTaxonomyWriter(dir).close();
assertEquals(1, getEpoch(dir));
new DirectoryTaxonomyWriter(dir, OpenMode.CREATE).rollback();
assertE... | 1 |
29e552131a46ae0ef24c562541b2af7f | 0dd449e3ec3fdb009dfedc86d2f30564 | Compute correlation based adjacency matrix from embedding. | eVal_L = eVal[:nFacts, :nFacts]
eVec_L = eVec[:, :nFacts]
eVal_R = eVal[nFacts:, nFacts:]
eVec_R = eVec[:, nFacts:]
corr0 = np.dot(eVec_L, eVal_L).dot(eVec_L.T)
corr1 = np.dot(eVec_R, eVal_R).dot(eVec_R.T)
corr2 = corr0 + alpha * corr1 + (1 - alpha) * np.diag(np.diag(corr1))
return corr2 | 1 |
26dfed8d28de1603332636d0d4c149e6 | 25d3dc4c2bc7a3b0cd9f6557336200ce | 获得选中文件的完整路径名称。若没有选中任何文件,则将返回空字符串 | class PyQtGui(qt.QApplication, OOGui):
def _getSelectedFile(self):
if self._selectedFile:
return self._selectedFile
return str(self._fileList.text(self._fileList.currentItem())) | 0 |
804032b914220e47ef4c2849f456c221 | e7fd54a187ed12a924a89a04a95f7f1c | *
<div class="optional">optional</div>
The `ReservationAdded` RPC is called by the Service Manager when a
service gets reserved. The request contains session information
and a per reserve call user-data field. | {
var apiVersion = @"2022-11-01";
using( NoSynchronizationContext )
{
var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace(
"/providers/Microsoft.Capacity/reservationOrders/"
+ global::System.U... | 0 |
2c8995896307ff1344294cdf07da8603 | bedff767ddb754eae6e2e68bce8cde08 | 计算词条加权权重boost值。 | text = None
count = 0
if self.link == link and self.text is not None:
text = self.text
else:
text = self.getText(link)
if text is not None:
count = text.count(word)
value = count * weight
return value | 1 |
d2d271c12c9dc6b2ae37f290c281e33f | 8edf5a6950c0846c3538d27e0cd2e7f1 | Creates a new customer profile | {
$form = $this->_formService->getRegistrationForm();
return $this->save($form, $post, array('role' => 'Customer'));
} | 1 |
c884607db27a5bf8864f73f1698256ec | 6361971e9831fd74d9ff4cbd6400802a | isInvalidE164Type returns true if aType is invalid or false otherwise. | switch s {
case Audio, Image, Video:
return nil
default:
return errors.New("Invalid type")
}
} | 0 |
49110fc83f84375ac197a75a33a177bf | 805dff520f3357c5c5ec7d7ebba4f506 | 也可以使用auto | void WingC::testAutoPtr() {
class A{};
std::auto_ptr<A> ptr(new A);
} | 0 |
55ad9af1be5c969521aa408a3360a9f6 | f50dce058b566f87c223d8d509da6aae | @brief Flush the config structre to the config file, the previous config
file content is being overwritten | NVM_API void nvm_conf_file_flush()
{
preferences_flush_the_file();
} | 1 |
994484fb627d80d0deab8f62207018c4 | ceab39876d75671ef6ada60a18162160 | move the most rescently used item to the head | class LRU_Cache(object):
def remove_last_used(self):
removed = self.recently_used_list.get_head()
self.recently_used_list.remove_head()
self.store.pop(removed.key)
self.size -= 1 | 0 |
4df97c3bcf7fdd051ad04fd0eeb4c9e4 | 6f0f5850113c6d7442834d3eaf1e9fd1 | Log that the spcified kvs can be deleted.
(used in selective mode) | {
log_write("\t\tK: %s,\n\t\t\t V:%s \n", key_to_str(key), value);
(void)key;
(void)value_sz;
(void)arg;
assert(value != NULL);
free(value);
} | 0 |
2c0d71db03003d7023fd1990c2870fde | 453778933901a2a8404b0f242fbd7100 | Perform VI according to the Bellman optimality principle | MAX_N_ITERS = 120
iterCnt = 0
threshold = 0.001
delta = 1
while ((delta > threshold) and (iterCnt <= MAX_N_ITERS)):
delta = 0
oldV = np.copy(V)
for row in range(V.shape[0]):
for neighbor_cond in range(V.shape[1]):
V[row, neighbor_cond], Q[r... | 1 |
0ef89383b2ce81b1b4065f802f1b5441 | 17393ac24240c8690117bb92ba56bb8b | 加载swoole内存表 | {
$this->table = new swoole_table(ServerConfig::$swoole_server_table['table_size']);
foreach (ServerConfig::$swoole_server_table['table_column'] as $param_name => $param_value) {
$this->table->column($param_name, $param_value['type'], $param_value['size']);
}
$this->table... | 1 |
c12f5efa8d85c524e790f25560450a59 | 0ec83affcf54dd65dbf0572e6ad50f25 | Load parameters from a numpy file | with np.load(paramsfile) as loaded:
params_list = [(i[0], i[1]) for i in loaded.items()]
params_order = np.array([i[0][4:6] for i in params_list]).astype(int)
params_list = [params_list[i] for i in params_order.argsort()]
L.set_all_param_values(self.net, [i[1] for... | 1 |
6651778c4832e0ded6308362dc37f4d2 | 2ead9ae4920e3d19f5f2a6b8179b0a00 | Handle "buy now" clicks
Don't run if right-click or command/control + click | function AuctionLite:BuyBuyoutButton_OnClick()
if PurchaseOrder ~= nil then
self:CancelQuery();
end
self:CreateOrder(true);
self:AuctionFrameBuy_Update();
end | 0 |
5f651963804361a3ddf96bc542c387a6 | bda0b9a91c49621cc0def7169765d0fc | 将证书编号存入内存中 | void WriteClientCertificateSerialNumber(const std::string cert_sn)
{
WriteKey(
PersistKey::CLIENT_CERTIFICATE_SN,
cert_sn
);
} | 0 |
211132bf588687ce137fc04842c22a4c | a9eb2cc7cf96f401458869bf6a45f30b | Read Pulse Counter value | void ping_read(){
send_pulse();
} | 0 |
02726376d00e21fb14d87964d193ae22 | df449076d6afa4a9ce7d10ee38d8922e | Тип контроллера | class TypeControl extends \yii\db\ActiveRecord
public static function tableName()
{
return 'type_control';
} | 0 |
6aa4e54c83402891436b9ea01d7dab6f | df670a7b4424641dc60bea171c1dbb6d | Set the type of agent to spawn in Holodeck. Currently accepted agents are: DiscreteSphereAgent, UAVAgent,
and AndroidAgent. | void setLinuxRobotType(String type); | 0 |
f32c137f285032f821fc71f9c32c592b | 141f8dc3aba7207264a1b4e1bc96c405 | Registers the event handler to be notified when new data from the MicroPython interface
is received. | @EventName("dataReceived")
EventListener onDataReceived(EventHandler<DataReceived> eventListener); | 1 |
169268f9e356bc5345cfc6d63fd863d6 | 0318e2b1cc8909c453d01ce3ac754ba8 | 获取n小时前的开始时间 | public class TimeUtil
public static Date getCurHourTimeBeforeN(int n){
Calendar ca = Calendar.getInstance();
ca.add(Calendar.HOUR, -n);
return ca.getTime();
} | 1 |
cdd27eb4dad1195e47587b013320e9e8 | c74cdb959c0a23e5e4bc7b37cecf2f8c | Split the nodes of the given list into front and back halves and return the two lists
using the reference parameters. | void FrontBackSplit(struct node* source, struct node** frontRef, struct node** backRef)
{
struct node* fast;
struct node* slow;
slow = source;
fast = source->next;
while (fast != NULL) {
fast = fast->next;
if (fast != NULL) {
slow = slow->next;
fast ... | 1 |
f5577a73eab68acbb85e50a586abf664 | a53bbeb81ab87b08e090c3fbf7ab9824 | Build Default Container
Builds a new application container in the case where none is provided. | namespace Schwab.Report.Common
public static class AppComposer
public static IContainer Build(params DependencyProvider[] dependencyProviders)
{
Container = Compose(dependencyProviders).Build();
return Container;
} | 0 |
c5eb7a257fe1ab824f05440e703be4eb | 9ee2bf8a6e57d5dc24a284c96bb20132 | Gets reconfirm result. | public class PEdorERConfirmBL implements EdorConfirm
public VData getResult() {
return mResult;
} | 1 |
bc08e10bc2ea7e4679e906a0f651c6f7 | 136c61ac10a4ce63109882b3c03c6f4a | 查询师傅已选职业对应的一级类目 | @Select({"select clazz_id from clazz where professional_id = #{professionalId}"})
List<String> selectCidByPid(String professionalId); | 1 |
11b8e70d7eff4d8b23be62e39d4f1f0e | cacb4904a07c65b8176e9360edb5a602 | Converts rowset to the forest. | {
Type treeNodeType = typeof(T);
ObjectInfo oi = ObjectInfo.GetObjectInfo(treeNodeType);
return GetTreeNodesAsForest(oi.GetSelectStatement(), extendingTypes);
} | 1 |
04cbb1104faeb99b1abb4957c90d0d41 | ce6dc7dd16d72655847e1a15f93f7f5d | pick children in reverse because we render the latter ones on top of the former | function reorderBackward(moving: Set<TLShape>, children: TLShape[], changes: TLShapePartial[]) {
const len = children.length
if (moving.size === len) return
let state = { name: 'skipping' } as
| { name: 'skipping' }
| { name: 'selecting'; selectIndex: number }
for (let i = len - 1; i > -1; i--) {
const isMovi... | 1 |
17d220ff6750c5807ae5ac53257bbb60 | 1a93d69add913fa40de5c17874ce779d | Calculates the Lenard-Jones potential contribution from two spins. | class LenardJonesPotential(TwoSpinPotential):
def calculateTwoSpins(self, spin1, location1, spin2, location2):
return self.epsilon0 * P2(dot(spin1, spin2)) | 1 |
b8adcf5e2e1e9a938b3d27a63fdc4e83 | 22ac56543d231563ac8b4ec8d359a7a1 | 多层 | def teststack():
f1 = np.array([[1,0,-1],[1,0,-1],[1,0,-1]])
ff = np.dstack((f1,f1))
fff = np.dstack((ff,f1))
print(fff)
print(fff[:,:,0])
print("---------------")
f1 = np.array([[1,0,-1],[1,0,-1],[1,0,-1]])
fa = np.zeros((3,3,3),dtype=int)
fa[:,:,0]=f1
fa[:,:,1]=f1
fa[:,:... | 1 |
adc4ce913d155fc053e06078299ecfb2 | 059a80035eb67214a3400e2e6b16d4a5 | Calculates empty buffer probabilities of two-machine line
at steady state and records them in array P0.
In each row, for each combination of upstream state i and
downstream state j (1st and 2nd column), it reports the
related empty buffer probability (3rd column). | class TwoLine():
def calc_prob_empty(self):
size_decr = len(self.decr_state)
size_ustates = len(self.u_fr)
size_dstates = len(self.d_fr)
self.P0 = np.zeros((size_ustates*size_dstates,3))
cnt=0
for i in range(size_ustates):
for j in range(size_dstates):
... | 1 |
bb41f10aa50f6721ff76f4f176440875 | 5e31beca9385cc23518dbf00d131874f | 批量修改数据源 | throws Exception {
DataSourceProcess dp = (DataSourceProcess) ProcessFactory
.createProcess(DataSourceProcess.class);
DatasourceHelper dh = new DatasourceHelper();
Iterator<DataSource> it_dts = dh.getDataSources(oldappid).iterator();
Collection<ValueObject> col_newdts = new ArrayList<ValueObject>();
St... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.