query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
ea4472786cdddfa4363c4399d16af951 | c91b29ed2d68655f74786e9f197f763e | 项目全景,不仅仅包含项目信息,还包含其他表的联查数据 | @Slf4j
@Service("projectService")
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class ProjectService extends BaseService<Project>
public ProjectAttributeVM findOneWithDetail(String projectId) throws Exception {
Project projec... | 1 |
ec9c43ce4084824425d1e77d650a1877 | 2dad8d0aecbb1e610f58462366b92552 | Разворачивает массив целых чисел | public class Turn
public int[] turn(int[] array) {
for (int index = 0; index < array.length / 2; index++) {
int tmp = array[index];
array[index] = array[array.length - index - 1];
array[array.length - index - 1] = tmp;
}
return array;
} | 1 |
3122bda02f9349cb7f4f4a86546edea8 | 2bda653a8e6e5aa7f928a884f3161624 | Marker requisition action event listener. | class Delete extends \Magento\Framework\App\Action\Action
public function execute()
{
$result = $this->requestValidator->getResult($this->getRequest());
if ($result) {
return $result;
}
$resultRedirect = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);
... | 0 |
e0a1cab3df0076bfbe16d17d6c4ccafa | 004ccedcc5608bdb17dd91ba97405712 | A function to toggle off related checkboxes (apart from the one clicked) | console.log(inputid);
var inputs = d3.selectAll(".container")[0];
for (i = 0; i < inputs.length; i++) {
if (inputs[i].children[0].id != inputid)
inputs[i].children[0].checked = false;
}
render();
} | 1 |
ebf4e42e851727a236df04ab7d9777a1 | d485c55242afd279b6a69a4e951685b7 | 所有Activity应该具有的窗体样式、全局设置、字体、软键盘等应该在这里设置,如果有不一样的窗体样式,则覆盖这个方法
这里给出一个常用的白色状态栏模式 | public class GatheringActivity extends BaseActivity
@Override
public void initView() {
Sofia.with(this)
.statusBarDarkFont()
.statusBarBackground(ContextCompat.getColor(this, R.color.white))
.navigationBarBackground(ContextCompat.getColor(this, R.color.black))... | 1 |
57947f39ecd6ddf5d99a7cde18fd527d | 7f2daf2965785ef6e5753b482163313e | Set whether or not serialized data should include fields that are null. | public class AvroConfig
public AvroConfig setAllFieldsDefaultNull(boolean allFieldsDefaultNull) {
this.allFieldsDefaultNull = allFieldsDefaultNull;
return this;
} | 1 |
875d80862a087716c8fd624570cee656 | 70737197bbac786d81ffe1d17a0f41f2 | Turns matrix from number of instances to percentages | D_array = np.array(np.sum(matrix, axis=0))
P_matrix = np.zeros((N, N), dtype=float)
for i in range(N):
for j in range(N):
if matrix[i, j] == 1:
P_matrix[i, j] = 1/D_array[i]
return P_matrix | 1 |
3dc8df22d91791397cdfbb07bfc02d65 | 0eca7d025660c391cd6dbb8021901572 | css压缩 | class compress extends component
static function js($content)
{
$file = new file($content, false);
if (! $file->hasError() && $file->readable())
{
$content = $file->content();
}
$content = preg_replace('#\/\/[^\n]*#', '', $content);
$content = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $content)... | 0 |
ee1499cbdeb540120d8867f016f46b91 | 496b355a336acfd71097667566e4f7d9 | \brief Send the row address to the NAND Flash chip. | {
MTDDEBUG(MTD_DEBUG_LEVEL3, "send_addr(%#x)\n", addr);
NFC_WRITEW(NFC_FLASH_ADDR, (addr << NFC_FLASH_ADDR_SHIFT));
NFC_WRITEW(NFC_CONFIG2, NFC_ADDR);
wait_op_done(TROP_US_DELAY);
} | 1 |
13f06fbc183ddc53e7366e412d688b29 | 691da2be13c4cdb4746a0835bbf7ca4c | GET: /PayFee/ | namespace MiniMe1.Controllers
public class PaysController : Controller
public async Task<IActionResult> Index()
{
if (HttpContext.Session.GetString("manag") != null)
{
return View(await _context.Pay.ToListAsync());
}
return RedirectToAction("In... | 0 |
6a25cf681e8c240b78347430eee09833 | 6c237a227fbd3cdfd06c7d4e7a61e1b5 | <p>Returns true if the systemId attribute has been set.</p> | def persisted?; !@sys_id.nil?; end | 1 |
63c2de2017dfefec3ba03a4c286d7566 | dedf9c58a4170e0f9d9a4886ea9137a5 | Deletes an existing item variation from an item.
---
- __Deprecation date__: 2019-11-20
- [__Retirement date__](https://developer.squareup.com/docs/build-basics/api-lifecycle#deprecated): 2020-11-18
- [Migration guide](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-items)
---
__DeleteVariation__ returns ... | class ProductVariation(ApiObject):
def delete_product_variation(cls, api, product_id, id):
return api.delete_product_variation(product_id, id) | 1 |
9c157fc8f06f98e1d208aa8ccb46f68b | 13c179b1973e960ff68ad90324eebe2e | With the C{savestats} option specified, L{app.ProfileRunner.run}
should save the raw stats object instead of a summary output. | class ProfilerDataTree(QTreeWidget, SpyderWidgetMixin):
def save_data(self, filename):
self.stats1[0].dump_stats(filename) | 0 |
d0689bdcfd8fb04ca5a9e286408b27a6 | 96b3c678a483dd6745e7c03dc1205c59 | Retourne la liste des représentations attribués à un groupe donné | namespace Star.Web.Api.Controllers
[Authorize]
[RoutePrefix("api/reportGroups")]
public class ReportGroupsController : ApiController
[Authorize]
[HttpGet]
[Route("{groupIdStr}/reports")]
public ReportDto[] GetReports(string groupIdStr)
{
IUniqueIdentifier groupUid... | 1 |
f65480a227c18154e11abbe0e542cf38 | cd44ecf59d54590eaff81ba8d876133d | Create een nieuwe sectie waar de elementen van het bedrijf staat. | class Dashboard::SectionsController
def create
@section = Section.new params[:section]
if @section.save
flash[:success] = t 'messages.created_successfully'
redirect_to dashboard_sections_path
else
render :new
end
end | 1 |
e06060ae2d25863f57800969a34ace71 | 86b9604df18cc18f4169ad9939bee49b | Writer of lyrics | function lyrics2() {
push();
var rms = analyzer.getLevel();
fill(255);
stroke(255);
this.x = random(0, width);
this.y = random(0, height);
pop();
updateText2();
fill(255,153,51);
text(currentText, width/1.9, height/2+80);
fill(255,204,204);
text(currentText, width/1.9+8, height/2+86);
fill(153,255,20... | 0 |
50541ec17825aa6c73faf626a0efba68 | 9f6b329cece4b24fb9a0d6e7f5ba1824 | Test that we detect when DataRanges don't overlap. | ranges = [DataRange(max=0),
DataRange(min=0, max=5),
DataRange(min=3, max=4)]
merged_range = DataRange(max=5)
self.assertEqual(sina.utils.merge_ranges(ranges), [merged_range]) | 0 |
fa0f3182fdff3cca9320287adcfe6563 | bc14ff80c2de1eef1fd0b283258fe2fc | Appends value to 'events' list | class SegmentInfo:
def add_event(self, event_data):
self.__events.append(event_data) | 1 |
b0bd713afa7eb27d022c72701d0d31b9 | db0e5e58a01f2821ba0766fbc492ce03 | Globally initializes cURL given a bitwise set of
the different features to initialize. | curl_global_init(CURL_GLOBAL_DEFAULT);
curlm = curl_multi_init();
curlsh = curl_share_init();
curl_share_setopt(curlsh, CURLSHOPT_SHARE, CURL_LOCK_DATA_DNS);
curl_share_setopt(curlsh, CURLSHOPT_SHARE, CURL_LOCK_DATA_SSL_SESSION);
contenttypejson = curl_slist_append(NULL, "Content-Type: application/json");
... | 1 |
591044f304d181132e990ea7c5d3d8d3 | a6d0607d6b775e53670ac16ae88d925c | True if has "officeholders" element | au.gov.asic.types.nni.OfficeholderType[] getOfficeholderArray(); | 0 |
34a8c5ffc66f8ca2ef3559edd966ed66 | e63b0ab293d7c5f7052938cb5dff1579 | Gets the X and Y coordinates of the top left point of the Farmhouse in Vector2
Form. Allows offsetting the coordinates. | {
return new Vector2(-960f + (10f + (20f * Position.x)), 540f - (10f + (20f * Position.y)));
} | 1 |
59630954843824cbec94bb5af43a0eb8 | 1cf48b6075774c5005462dd5aed9e197 | 发送网络延时检测消息 | {
int lThreadMsgId = -1;
char buf[128] = {0};
MsgData *pstMsgSnd = (MsgData *)buf;
get_process_msg_queue_id(&lThreadMsgId, NULL);
pstMsgSnd->type = NETWORK_SET_MSG_TYPE;
pstMsgSnd->cmd = MSG_NETWORKSER_T_NET_START_PING;
pstMsgSnd->len = 0;
msg_queue_snd(lThreadMsgId, pstMsgSnd, sizeof(MsgData) - sizeof(long) +... | 1 |
36fe7187683463c9b1cde1073cd51217 | 056297c2abb00715d0a2b9274eaf5119 | Mode extension. Valid only for Joint Stereo mode | {
Command command = commandBuilder.createStream(CmdStreamId::StereoModeSet)
.append(static_cast<uint8_t>(stereoMode))
.build();
return commandSend(command);
} | 0 |
4a99dbb4a85a2cc90cff9b463c4a5fce | 726b3ea118a59fa1ce699903e273882e | Metoda koja na klik gumba poziva metodu za brisanje povratne informacije | namespace Rent_a_Car
public partial class frmPovratnaInformacija : Form
private void btnUnos_Click(object sender, EventArgs e)
{
DodajPovratnuInformaciju();
txtOpis.Clear();
} | 0 |
6f66b8b787ee0b6459870d33eb82614d | ef9503bce20179d571948b44f7ee3b24 | 在这里不会结束for循环,而是当等于3的时候,不会往下执行循环里面的内容,所以打印结果中没有数字3 | public class ForDemoTest
public static void main(String[] args) {
show3();
} | 0 |
3413e0d53f299985fe94c07836682e09 | 0e159b3be3ca317549eda5e2dcd35eae | Dispatch default events for the asynchronous payment notifications. | {
foreach ($this->notifyObjects as $object) {
if ($object->is_pending) {
$event = TransactionPending::class;
} else {
switch ($object->type) {
case Transaction::TYPE_INCOME:
$event = TransactionIncome::class;... | 1 |
acf5358af235b97755dc9c0db1e3d2f4 | af935a1165ba7609b66c22133217979d | 编写代码,移除未排序链表中的重复节点。保留最开始出现的节点。
示例1:
输入:[1, 2, 3, 3, 2, 1]
输出:[1, 2, 3]
示例2:
输入:[1, 1, 1, 1, 2]
输出:[1, 2]
提示:
链表长度在[0, 20000]范围内。
链表元素在[0, 20000]范围内。 | if (head == nullptr) {
return head;
}
ListNode* cur = head;
ListNode* pre = nullptr;
ListNode* next = nullptr;
while (cur) {
if (cur->next == nullptr || cur->val != cur->next->val) {
if (pre == nullptr) {
pre = cur;
head = pre;
... | 0 |
f324e3175171db754a1fe25fb4fcad35 | f01772f8c22c5d0853a213ccc93c5d2d | 判断日志类是否初始化成功。 | class OPF_Logger
static public function isReady()
{
return self::$_isReady;
} | 1 |
87809e4cc74910f30e068825bc2c18d3 | a9ebed3c24b0536c1328a0f73e6eb06d | Returns the credential id hash as qrexec argument. | public class CodeCoverageBuilder extends Builder implements SimpleBuildStep
public String getCredentialsId()
{
return m_credentialsId;
} | 0 |
13785488135304f99bc07fc8c6c37386 | 5485687f49c36e175cac67be91f8c606 | 根据业务ID查询已办数据 | List<Map<Object,Object>> selectRecordByBusinessId(Integer business_id); | 1 |
392411e568716d7ca244b998258a4f14 | 345da1af2006fc026e2af27b76379c25 | EntityManager의 변경을 Transaction을 이용하여 DB에 적용합니다. | default void withEntityManager(EntityManagerRunnable operation) {
withEntityManager(em -> {
operation.execute(em);
return null;
});
} | 0 |
9abc8d042de98a73f202ef68c828143c | f4cd5d3c7df14ddc29e9456bf1973c72 | Add selected field to cursor pos in editor | function addAttributeToTextfield() {
var dropdown = document.getElementById("calc_s_select_attribute");
var selectedOption = dropdown.options[dropdown.selectedIndex].text;
var cursorPos = $('#tf_attribute').prop('selectionStart');
var v = $('#tf_attribute').val();
var textBefore = v.substring(0, cursorPos );
... | 1 |
0544355607d578966d1e010951dcf4fb | 4d9be0c190c1531eafcd6786516baf24 | Test not well formed reciprocate payload | func TestParseTitleFail(t *testing.T) {
payload := make([]string, 3)
payload[0] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
payload[1] = "1 25544U 98067A 08264.51782528 -.00002182 00000-0 -11606-4 0 2927"
payload[2] = "2 25544 51.6416 247.4627 0006703 130.5360 325.0288 15.72125391... | 1 |
b712e14ca520c93144b9f0ea83eafb38 | 37dc8b3c14318933d3fe21df975677a6 | Generates a name for an unknown bit in the form UNK_{byte}_{bit},
where the byte and bit values are one-based. | def get_name():
base = str(num.get_and_add(1))
base += "_"
base += str(Random().randint(0, sys.maxsize))
return base | 0 |
e956706a88e4a102e306ad6d6edbb0e8 | ff20eae577a0dc250907205a753fb77c | On button click, gets the information you typed into the prompts. Makes the credentials box section invisible again. | class AddPage(Frame):
def __init__(self, master):
def enter_key(event):
self.encrypt_creds(service_entry.get(), encrypt_pass_entry.get(), username_entry.get(), password_entry.get())
master.switch_frame(ShowSavedServices) | 0 |
28731003e744838896ddee80cb03f3c3 | 724e38517a7c988554bf35028fd144b7 | Deze functie wordt aangeroepen om het hele, onthulde, veld te printen. | int x,y;
cout << endl;
for (y=(maxrij-1);y>-1;y--) {
cout << y+1 << " | ";
for (x=0;x<maxkolom;x++) {
cout << veld[x][y] << " ";
}
cout << endl;
}
cout << " \\";
for (x=0;x<maxkolom;x++) cout << "--";
cout << endl;
cout << " ";
for (x=0;x<maxkolom;x++) cout << x+1 << " ";
cout << endl;
c... | 1 |
a58f4fb75f70bb37f278d405bf7659bc | df945aa71faed922257cd4d70b4f713e | 指定した点から、角度と距離を入力すると新点を出す計算(極座標計算) | public class Scr_Master_Library : MonoBehaviour
public static Vector2 AngleDistanceToVect2(float tAngle, float tDistance)
{
Vector2 tResult = Vector2.zero;
float tPi = Mathf.PI * tAngle / 180f;
tResult.x = tDistance * Mathf.Cos(tPi);
tResult.y = tDistance * Mathf.Sin(tPi);
re... | 1 |
e27c7b3b5de444ba93cea3740302d56a | 2ea92e6f1cfbf020dd033c6980d17b46 | Updates GUI's variables holding information about the last received
recovery packet. | export class SettingsLockScreenElement extends SettingsLockScreenElementBase
private async updateRecoveryState_(authToken:
chrome.quickUnlockPrivate.TokenInfo|
undefined): Promise<void> {
if (!authToken) {
return;
}
assert(a... | 1 |
2d1991ebccdfdfb14085ad50040fba7e | 03cdee30a3fab86a74aa21099d9dfcb2 | Checks whether two line segments intersect. | pt_a = line_seg1[0]
pt_b = line_seg1[1]
pt_c = line_seg2[0]
pt_d = line_seg2[1]
delta = (pt_b[0] - pt_a[0]) * (pt_d[1] - pt_c[1]) - (pt_b[1] - pt_a[1]) * (pt_d[0] - pt_c[0])
n_r = (pt_a[1] - pt_c[1]) * (pt_d[0] - pt_c[0]) - (pt_a[0] - pt_c[0]) * (pt_d[1] - pt_c[1])
... | 1 |
1c6f497f554ca4866bc8aa2ee383e95b | 870d3bd7b8f67e212602bdcd482b4678 | Get Nelson-Aalen estimator of risk
See: www.med.mcgill.ca/epidemiology/hanley/material/ ...
NelsonAalenEstimator.pdf | aaf = AalenAdditiveFitter(fit_intercept=False, coef_penalizer=0.5, smoothing_penalizer=0.1, nn_cumulative_hazard=True)
aaf.fit(bootstrap_dataset, duration_col='days', event_col='kac')
return aaf | 0 |
edcc04630f94a576f8dfba02d8c4e434 | 2b2582bc42822018541434855da577e4 | Initiate pastebin scraper | pastebin = Pastebin(paste_code=lines, paste_name=opts.paste_name,
paste_private=opts.paste_private, paste_expire_date=opts.paste_expire_date,
paste_format=opts.paste_format, username=opts.username, password=opts.password)
response = pastebin.paste()
return response | 0 |
77033188311f9ebed89dbab95efa8956 | 207dafe792f60bfe92477a041db16bb2 | Устанавливает ФИО отправителя | abstract class AbstractPaymentRequest extends AbstractRequest
public function setPayerFio($fio)
{
$this->fio = (string) trim($fio);
return $this;
} | 1 |
cefaddf0ce5fd745f923002d7e564a0e | 26aa68db8b4b6f0e0adbb260311eb1e3 | 获取真实的评价分数 | namespace RunningLoad.Utility
class Score
public int GetScore()
{
return realScore;
} | 1 |
14ee58ff8d16e844154b0f5ac4f0cff1 | c9efb6d5733832fb9d8fbc1ed4a3f5bd | Delete an input for a stream analytics job. | namespace Amazon.MediaLive
DeleteInputResponse DeleteInput(DeleteInputRequest request); | 1 |
48ea74f85ac229cfb2fc87db7f261517 | 2a709ee9091256ed778f963e26bf1399 | 随机获取下一个树结构 | var B_Random_state = BranchrRandom();
if(B_Random_state != null){
var bug = $('#trunk').find('.trunk-node');
var bugNode = bug.last().has('span')[0];
if(bugNode != undefined ){
var bugNode_ = bugNode.children[0].dataset.dir;
if(bugNode_ != B_Random_state){
$("<div />",{class:'trunk-node',css:... | 1 |
a862e3fab0f399f550ae573410e3ec61 | d0b35d8e79049f82b43f2637a27b4080 | Test case for v2_profiles_read | result = client.call_endpoint(
url="/realm/profile_fields",
method="GET",
)
validate_against_openapi_schema(result, "/realm/profile_fields", "get", "200") | 0 |
4c419e06b75f62ece8caaec30f2ad4bd | ec934dc6df6c0684985dcd1de7809044 | function to convert all '(' with ')' and vise versa | for(int i=0;i<s.size();i++) {
if(s[i]=='['||s[i]=='{') {
s[i]='(';
}
if(s[i]==']'||s[i]=='}') {
s[i]=')';
}
}
return s;
} | 0 |
f083a7f3dc42f523204343d43ca8a8c2 | 228b835a6285446ae14631ed81a13ae6 | @brief 获取分区剩余空间大小(字节数) | uint32 DDMemMgr_PartitionGetTotalMem(DDMemMgr_Partition *Partition)
{
return Partition->TotalMem;
} | 0 |
dbedbd71f855894667903d7c72ed85b4 | ca0ba2e2b73e83d98905ceb13f1eded8 | Destroys the current minigame. | minigamePosition = 0;
minigameSpeed = 0;
minigameTimeOfJump = -100;
} | 0 |
acbea8b2274f8d2d6cc88a242e56e956 | bcf6726879117aa9eac49b6508d73ca7 | get pages as a set of their ids for faster lookup | function getPageIds(); | 1 |
1e4f739ac256189f097b6305a37d1641 | f4f6ac269a3b3a1a35f16a73d8135c68 | メール本文にフッタを追加する | namespace mcml
void CMimeData::addMimeFooter() {
m_PostData.append(m_MimeFooter);
} | 1 |
752d0babc934b88665b0dd66559bbb06 | 472d6b7da80de619c401f75e986ce023 | Default value for the task_id member. | class Tasklog(Log):
def __init__(self):
Log.__init__(self)
self.task_id = 0
self.task_name = "" | 1 |
9ca07c632793f082801c7f93e3775d8a | 91bbccee6505f5c391dad9b34e181f12 | Similar to RequestProcessor.readGetResponse(),
but ignores the last "END\r\n" line,
and returns the StringBuilder instead of the String,
to make it simpler to assemble the responses for a sharded multi-get request.
response format:
0 or more items, then "END\r\n" (which is discarded in this method)
item format:
VALUE <... | try {
StringBuffer out = new StringBuffer();
BufferedReader reader =
new BufferedReader(new InputStreamReader(in));
String line = reader.readLine();
while (line != null) {
out.append(line + "\n");
line = reader.r... | 0 |
9c44155ad27bfc8783fe386accd750ed | 6c1e63708d821af2b5cef209d33ceccb | 在baseMetada添加前触发,可以对将要添加的baseMetada、以及所属的DomainMetadata进行操作 | class ModeBase
async addMetadataObserver() {} | 0 |
5c337cf187fd8fd0eea18899a89b1e8e | 9dac34ebe28feb28478b8e8c4bcb9670 | 进行空闲状态下的GPIO输入操作 | void state_idle_GPIO_input()
{
} | 1 |
8331e49bb69ea0e504116b8e6fd57e03 | 231f2763de4c852ed9264e00aa6aba24 | Automatically loads parameters throught PHP get and Post variables | class papaya_dynamic_form extends base_dynamic_form
function loadParams() {
if (isset($this->paramName) && $this->paramName != '') {
$this->initializeParams();
}
} | 0 |
52ed930574314dfbe00e478bf108ba70 | 278263d29148b8ac1cec9230b5440423 | 設定項目をキャッシュ | class SpiderSetting
protected function flush_setting ()
{
cache('setting', null);
} | 0 |
a2004e87c9f71ca1ae55911114e59e26 | a7ee2984e362693e4fc9140221a1eba3 | Wrap the request factory with a BufferingClientHttpRequestFactory so that the error handler can do repeat reads on the response.getBody() | public class KeplerRestTemplate
private ClientHttpRequestFactory buildRequestFactory() {
HttpComponentsClientHttpRequestFactory requestFactory = new KeplerClientRequestFactory();
requestFactory.setReadTimeout(keplerReadTimeoutInMillis);
requestFactory.setConnectTimeout(keplerConnectionTimeoutInM... | 1 |
65a3641bf9598fa99976a85149689ea5 | 9f78d136360f99f474af11a485001534 | Method provided to jump to a locus synchronously. Used for port command options | class TV(object):
def teletext_jump(self, opt=100):
return self._send_command('teletext_jump', opt) | 1 |
b526e97d316bab7268b975e355cf6e82 | 98761a67f97f39cf419f6a5fd9ce1978 | Returns how many pages a given file has stored in the memory (as frames) | {
vector<LinuxPage *> pages = _page_cache->getOrderedPagesForFile(_inode_num);
int index = -1;
int res = 0;
for(int i=0; i<(int)pages.size(); i++)
if(pages[i]->getPageIndex() >= offset)
{
index = i;
break;
}
if(index == -1 || pages[index]->getPageIndex() != offset)
return 0;
res ... | 0 |
23815eb72d3c9804866be0cab7dc90f1 | 2ede43df68f7f050dd70efc2fa0de27e | Collapse navbar and close dropdowns | function closeMenu() {
$('.navbar-collapse ul li a').click(function() {
$('.navbar-toggle:visible').click();
});
} | 0 |
8de371c96902cc62dc65224a39188395 | 2abf0679bb30556996fe2b914c00859d | Pre-concatenate this transform context with the given transform. | impl Transform
pub fn pre_rotate_at(&self, angle: f32, tx: f32, ty: f32) -> Self {
self.pre_concat(Transform::from_rotate_at(angle, tx, ty))
} | 1 |
5c14ef759b54b41a4752e905c817c2f4 | da23d9b0b3dd66606284bd46b101c0b7 | Finds indexes of the min element of two-dimensional array | {
var i_min = 0;
var i_max = 0;
var min = array[i_min];
var max = array[i_max];
for (var i = 1; i < array.Length; i++)
{
var v = array[i];
if (compare(min, v) < 0)
{
i_min = i;
min = v;
... | 0 |
490d487277235977a5667ea1cf60f334 | 3e181de80ae3c43e89de8e53a4ec42e9 | Déploie ou replie le sélecteur | class ExpandSelector(BoxLayout):
def switch_selector(self):
self.do_on_status("")
if not self.selector:
self.selector = self.init_selector(self.selector_height)
if self.selector:
self.selector.path = self.ids.input_selection.text
if self.selector.parent:
... | 1 |
e6fd8adcab9b96f0ca08e5740f3847fd | 3f34364fdfa557102be927859c24774c | Generates the first N prime numbers. | prime_numbers = [2]
next_number = 3
while len(prime_numbers) < count:
if is_prime(next_number):
prime_numbers.append(next_number)
next_number += 1
return prime_numbers | 1 |
a9b7df99680f7ff1215df54e2c92732c | 6d15ce315ec6b2a1aca3054ce567d332 | This method is used to obtain the references for services exposed by
project browser component and Java editor component. | public class Project
public Hashtable getReferences() {
return references;
} | 1 |
066766c8fd76a1e6fc181b4e7071afe6 | d204dbc7b6a3a0f17e2f9fb45cdf866a | Asigna los miembros en un listado a un diccionario. | def arma_agenda(lista_nom, lista_tel):
d = {}
for nom, tel in zip(lista_nom, lista_tel):
d[nom] = tel
return d | 1 |
2e5bc1ce8c2c6371e11a8110457003e8 | 21a8fe250177dfa3e60cf28fd1a8a440 | 说 明: 测量温度、湿度
参 数: 无
返 回 值: 无 | void Save_TempHumToOneNet(void)
{
EdpPacket* send_pkg;
uint16_t hum[1], temperature[1];
int8_t data_string[64] = ",;temperature,%d;hum,%d", data_string_dst[64];
SHT20_read_user_reg();
mDelay(200);
printf("%s %d\n", __func__, __LINE__);
SHT2x_MeasureHM(SHT20_Measurement_RH_NHM, hum);
mDela... | 1 |
115e605a9692acc1f6be89c72fc34bcc | a4d46a6ab4b80ed16cbaa94761d44801 | 字节数组转Opencv图片 | namespace Common
public class SwitchDataTypecs
public static Image ByteToImg(byte[] bytes)
{
try
{
MemoryStream ms = new MemoryStream(bytes);
Image img =Image.FromStream(ms);
return img;
}
catch(Exception ex)
... | 0 |
e73256fa3d4bc939b78b55af07b179f2 | ae43a810ab4f712d222c59b54dd2a90a | Sets wether the action should fail on error. | class DataURI extends Task
public function setFailonerror($value)
{
$this->failonerror = $value;
} | 1 |
d4bdb220f08caaee1a7bdb784b6cfc95 | 644429fec5cb8ce336ac19cca19d1e07 | 寻找最近的小偷 | string SpyCatcher::findSpy(vector<string> file){
string spy = "";
int spyI = 0;
int numberFiles = 0;
for(auto i: file){
for(auto p: peopleL[i]){
if(people.count(p) == 1){
people[p]+=1;
}
else{
people[p] = 1;
}
... | 0 |
5d9ee0e199927c579f5164c98ffacf9e | c96c6f1a57c100611c2211796e49690a | 根据铁塔资源Id获取铁塔资源 | @Controller
public class resController
@RequestMapping(value="getRtuInfoById")
public void getRtuInfoById (HttpServletRequest request,HttpServletResponse response) throws IOException
{
long rtuId =Long.parseLong(request.getParameter("rtuId"));
Rtus rtu = findService.findRtu(rtuId);
Map<String , ... | 1 |
6ce13912d79c578526f93e162eee3bbf | bae7e6af9872e7d0b04466c034234fc8 | This test checks if median is counted correctly when length of array is uneven. | MedianIteratorTemplate<fix16_t, 64> m;
int i = 0;
m.add(data[i++]);
m.add(data[i++]);
m.add(data[i++]);
TEST_ASSERT_EQUAL(m.result(), data[1]);
} | 0 |
f3cf4ad742bf359310fc8f7d944fcdfe | aeddde69ac0acb4ea878e99128bea670 | Returns visible events. | if (!this.offlineEvents.length && !this.deletedEvents.length) {
return onlineEvents;
}
const start = this.initialTime + (CoreConstants.SECONDS_DAY * this.daysLoaded),
end = start + (CoreConstants.SECONDS_DAY * AddonCalendarProvider.DAYS_INTERVAL) - 1;
let result =... | 1 |
ea7f0998636264c865d084764a2f805b | 887e27d556dd068c83954fecc7f4b633 | Option 2. Calculate the theta parameter according to the spread of the solutions around the consensus ranking. | L = np.array([1, -1])
t = (L.T @ theta_hat)/(np.sqrt(L.T @ S @ L))
return t | 0 |
16fbd921d094af2d101bf54cfc9e103a | 0154b70008e37b0b300871a79d7a3654 | Retrieves the temporary storage of the output from renderBegin in blocks. | class Opt_View
public function getOutputBuffers()
{
return $this->_outputBuffer;
} | 1 |
ec0a58c14663795287e33366389011fa | 1f6b7aabeb90b32c9da4f9c460d658f9 | Class for creating a 3D plot for plotting unit cells. | self.shape = np.array(shape)
self.origin = np.array(origin)
self.unit = unit
self.figsize = self.unit * self.shape / 2.54
self._figure = None
self._ax = None | 0 |
e97c05f2a1ad765250963adc796563fa | e9bde5d50d80f73fa08c9499a0a90175 | Test if the start date field is required | super().__init__(*args, **kwargs)
if self.instance is not None:
self.fields.get('start_date').read_only = True | 0 |
8f7de3707305db7e0d214655230eeca1 | e6d27e51b1df6a069d4fe7c1c7c9e431 | check to make sure entered word is made up of available letters | def check_if_valid_letters(new_word, list_of_letters):
broken_word = []
broken_word = list(new_word)
word_is_valid = True
for letter in broken_word:
if broken_word.count(letter) > list_of_letters.count(letter):
word_is_valid = False
return False
if word_is_valid:
return True | 1 |
c34700fded8a17d09e20960ef37a8ef5 | d2b789e24622222b4230658cd8e95e60 | UserList에 가장 아래에 존재하는 User 삭제 | public class UserGroup
public void removeLastUser() {
int lastUser = users.size() - 1;
users.remove(lastUser);
} | 1 |
827b391076470c846217b25803937b0a | 90f6ddf4417e07ebaf6249f0494e68b9 | An interaction model as it would be sent from Django, sans non-enum fkeys | cell = []
for field in cls._meta.column_dict.values():
cell.append(field.format_ajax_value(model))
return {'id': model.id, 'cell': cell} | 1 |
89a389e0363d2c40bdb4e29cead64bcb | 7170caf30312cc924bbe7d25917fb951 | Get url for newest version of Dam Removal Science Database.
Checks DOI for newest version of the Dam Removal Science Database.
Returns download url for most recent version of databases as CSV. | content = None
url = url_prefix + '?site_no=' + site + '&agency_cd=USGS&format=rdb' + '&end_date=' + end_date
try:
r = requests.get(url)
except requests.exceptions.RequestException as e:
print('- Bad URL -')
else:
if r.status_code is 200:
content = r.text.splitlin... | 0 |
092e407f766d48686ae69b6827b1a384 | 5e749b1037cba5f23f156e4e66264452 | 購物車內 個人帳號的所有歷史帳單 | namespace WebApplication1.Models.Service
public class ShoppingService
public IList<ShoppingViewModel> GetUserShoppingHistory(string Account)
{
var user = GetUser(Account);
var userlist = this._ilistRepository.GetAll().ToList().FindAll(x => x.UserID == user.UserID);
var pr... | 1 |
0e76e9a690f26d501fdb60df21acad72 | 0ff09481509e6edf4cfbb6579b56776d | 根据屏幕的宽度,设置小图片的大小 | bmpW = BitmapFactory.decodeResource(getResources(), R.drawable.navibar)
.getWidth();
bmpRealW = bmpW > (screenW / pageCount) ? screenW / pageCount : bmpW;
bmpRealW = bmpRealW*4/5;
offset = (screenW / pageCount - bmpRealW) / 2;
bmpScaleW = ((float) bmpRealW) / bmpW;
Matrix matrix = new Matrix();
matrix... | 1 |
61337d337a21920fa2ed2c0f72fc4d01 | a3537b053b2ab8d9121605fe33b0787e | Resets the total distance traveled by the roomba. | public class AutonomousVars
public void resetDistanceTraveled() {
distanceTraveled = 0;
} | 1 |
e58089785ee90392c5d86f12f41c3c7b | 8c00f2a4265435e127c768378096adf7 | 社区团购商品到货推送 | {
global $_W;
global $_GPC;
$goods = htmlspecialchars_decode($_GPC['goods']);
$fans_res = $_GPC['fans'];
$skuName = json_decode($goods)->skuName;
$send_res = setGoodsGroupSend($goods,$skuName,$fans_res);
show_json(1,"操作成功");
} | 0 |
dcc86964380212504985075fc158c60f | 3e069d6981a0d0dadf1027911c1c9494 | Greps input structure. | Token token;
do {
token = Parser.Scanner.GetToken();
} while (token.Terminal.FlagIsSet(TermFlags.IsNonGrammar) && token.Terminal != _grammar.Eof);
if (token.Terminal.FlagIsSet(TermFlags.IsBrace))
token = CheckBraceToken(token);
Context.CurrentParserInput = new ParseTreeNode... | 0 |
dcc3ff0c5c4cc44ae8653327b1543079 | 578202525cd101f7a8ef3081b2b430e6 | Gets the task ID of the task this worker is executing. | int TaskID(); | 1 |
ff4247c0ae6ffd46c9bb8dec23fb6a3e | 4b34443f349aebd0a338cea567538125 | 上に飛んでいき、画面外に出たら消滅 | export default class Enemy extends Animation
update() {
this.y += this[__.speed]
if ( this.y > window.innerHeight + this.height )
databus.removeEnemey(this)
} | 0 |
6cd824dd18498278ba32850612f7083b | 54ee7986d0f1cf9513577cd2fd0e8d0e | Returns the defltLocSeqId. | public class TRMaterialVO extends BaseVO
public int getDefltLocSeqId()
{
return m_iDefltLocSeqId;
} | 1 |
3d8d5e30475bf6f9437a2b909e226b23 | ae6ddc0cd8c50dd43f76e488e9b8ba54 | 将列表项放入滑动窗口内排列好 | let data = this[`_list_${name}`]();
let node : cc.Node = this._ScrollData[name].content;
node.removeAllChildren();
node.height = 0;
if (! this[`_col_${name}`]) {
this[`_col_${name}`] = 1;
}
let scroll : cc.ScrollView = this._ScrollData[name].getCompone... | 1 |
69a461c55bfc772eb7de367e8e156bfe | b331b508a65d494609ae557d28dd7b64 | 清除填挖方区域 | int i, j;
for(j = 0; j < BOARD_HEIGHT; j++)
for(i = 0; i < BOARD_WIDTH; i++)
if(g_hexaInfo.erase[j][i] == ERASE_BLOCK) {
g_hexaInfo.board[j][i] = EMPTY_BLOCK;
g_hexaInfo.score++;
}
} | 1 |
d3bb3261996e7e97df8db3a9ebb38e88 | 353f07b4f56a8841218e35b2b05d4b7a | After being killed Jerry re-appear after some time | class boss_lady_vashj : public CreatureScript
void EventTaintedElementalDeath()
{
if (TaintedElementalTimer > 50000)
TaintedElementalTimer = 50000;
} | 0 |
533a7ca6f825bdda63fa265f786d98b0 | d041d196c859c815ce981e4c236ec2b6 | Closes the library and discards all unsaved changes. | function FF_closeMyLibrary()
{
trace("FF_closeMyLibrary");
} | 0 |
faff388213979ffe02f51c9f0ff1426f | 80f1a92118d0a8fd0591145ef86b0167 | 名师堂详情页渲染文章摘要块判断逻辑 | function judgment_user_is_lz() {
var user = $('.user_name_0').text();
$('.user_name_1').each(function () {
var div = document.createElement('div');
$(div).addClass('yo_ribbon_top_right');
var s = document.createElement('span')
$(s).text('楼主');
$(div).append(s);
$(... | 0 |
5caa8710bbb507e9b8768b8385914f3e | 2288466c3c771d9c663c708fd1134a4e | The DTS Performance Manager Tasklet. This is a fully defined tasklet. You
should only have to instantiate an instance and use it. If you need to
customize it, you should consider creating a new tasklet and basing your
version on it. | function SampleTask() {
} | 0 |
9ae68578b7a557e150939fa1663443b4 | 979cc13217b870849be98a7f1c79d627 | Sets (as xml) the "coupon_code" element | {
synchronized (monitor())
{
check_orphaned();
org.apache.xmlbeans.SimpleValue target = null;
target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(COUPONCODE$68, 0);
if (target == null)
{
return null;
... | 0 |
92fbb0cf2a588181f5f32ca6dc1d31bc | f52d5bbe866a8a738da50facb62e792c | Factory should detect an MVC page from the options 'action'
and 'controller' | class Zym_Navigation_PageFactoryTest extends PHPUnit_Framework_TestCase
public function testShouldDetectMvcPage()
{
$page = Zym_Navigation_Page::factory(array(
'label' => 'MVC Page',
'action' => 'index',
'controller' => 'index'
));
$this->assertType('Zym_N... | 1 |
93b5fabd9c1827d10e286c31834385a0 | 0284efe8e6628ce05ddc9a3786f00b1f | 进行一级模块的修改(回显查看) | @Controller
@RequestMapping("system/module")
public class ModuleController extends BaseController
@GetMapping(value = "update")
public String update(Integer moduleId, Integer level, Model model) {
model.addAttribute("module", moduleService.get(moduleId));
model.addAttribute("level", level);
... | 1 |
a03a1d81817d8fb0a0c9d1c8fe09ce74 | 4f733911f6832f86aa87f1a5cd6ce908 | 获取平台的用户信息 | SET_PLATFORMUSERINFO(state, res) {
state.platformUserInfo = res
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.