query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
4cf983c784832e727adbdea662adc50a | 071754930467fd52294560bd49e2bcb9 | POST /cars | class Api::V1::CarsController
def create
if(!(user = tokenAuthorize(params['session'])))
head(:unauthorized)
return
end
puts params.inspect
carrequest = params['car']
car = Car.new(:model => carrequest['model'], :test_drive => carrequest['test_drive'])
car.brand = Brand.find(params['car']['brand_id'])... | 1 |
e3d8a72a39d8e0d827360c7d35747384 | 62fef871ebf977b6c9e9486ad09380fc | gets the minimum and maximum bounds of the bounding box | public class LevelDetails : MonoBehaviour
void GetLevelBounds()
{
for(int counter = 0; counter < roomDetailsList.Length; counter++)
{
if(counter == 0)
{
Xmin = roomDetailsList[counter].roomPosition.x - (roomDetailsList[counter].roomSize.x)/2;
Xmax = roomDetailsList[counter].roomPosition.x + (roomDe... | 1 |
8f1fdc08af360c643bff296bd196e9ad | 947214c0eb6c186f0089ac49280b49b9 | construct with length (no storage) | Array::Array(int len):m_len(len){
m_p = (int *) calloc(len, sizeof(int));
} | 0 |
441d04f7f4a4843a7765acd88b68897a | e115530560e40c74cffea145ce8f4662 | Export a single visualization from a specific document instance to a PDF
file. | try:
paper = database.get_document(docid)
except:
return None
else:
data = json.loads(paper.get_data())
with open(os.devnull, "w") as fnull:
s = subprocess.Popen(["evince", os.path.join(data['path'], data['pdffile'])],
stdout=fnull... | 0 |
6d1066de625a9162a4c8724cd9da0241 | 4d16cbbc5806b6cf9e96fbdb6a8f6cc8 | Creates a new array that concatenates the given items to itself. | partial class zfunc
[MethodImpl(Inline)]
public static string concat(params string[] items)
=> string.Concat(items); | 0 |
642b28cbf77ffc1423eaad5107ee9868 | cccdaae5d965d59be50650ea7d3758c4 | Adds a channel to the DB, then reloads the visuals | export class SubChannelsComponent implements OnInit
addSubChannel(){
let new_channel = this._httpService.addToChannel(this.newSub);
new_channel.subscribe(data => {
this.getSubChannels();
})
this.hideCreateModal();
this.newSub = {
id: this._httpService.channel_id,
textChannel: ''
... | 1 |
7da0c18d3f6a359dc33897c1f8478404 | 6f9ab7edc0a5821e094f695cc19d202a | 是否是特殊病人状态 | @Table(name = "QX_TP_MED")
public class QxTpMed
public void setIsspecial(String isspecial) {
this.isspecial = isspecial == null ? null : isspecial.trim();
} | 1 |
a5585d6ac9e9e0b5eac65a8c8ae7e0e8 | f349ee2786f1486f345229dad837b370 | https://stackoverflow.com/a/1630350 | def chunks(l, n):
n = max(1, n)
return (l[i : i + n] for i in range(0, len(l), n)) | 1 |
c3e0d50f55abec4dede7ddb0af285eeb | e1feb4543d47a60df5980e019c66c28c | Set high score to current score if it's bigger than current high score | if (score > hiscore) {
hiscore = score;
}
} | 1 |
70889ad37c53a5cb23acc5132653ae18 | efabce783f6297503bbda771e6d7f31e | 根据排版时刻表 计算时间间隔 是多长(天) | if finished_time:
diviation = (str_to_datatime(finished_time) - str_to_datatime(planfinished_time)).days
return diviation
else:
return None | 1 |
d457c426ce1f559543f169b4abbe11c7 | 8d93b5dbe08e14aa505493152c5abdf5 | метод использования предметов в инвентаре, в аргументе принимает индекс ячейки, по которой игрок кликнул | public class ItemUseAndDestory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
public void Use()
{
if (gameObject.GetComponent<Toggle>().isOn && gameObject.transform.childCount > 2)
{
if (1 <= int.Parse(transform.GetChild(1).GetComponent<Text>().text))
{
... | 0 |
f57a6703ad35b35316f7be46f6dd8932 | 843f3d3e2ff7167b9a86af0c0966a360 | AJAX
Повторяет заказ по ID | class OrderController extends Controller
public function postOrderRepeat(Request $request)
{
$this->validate($request, [
'id' => ['required', 'numeric', 'exists:orders,id'],
]);
$order = Order::with(['orderToProducts'])->findOrFail($request->get('id'));
$this->authorize('... | 1 |
5cd56a56b567ba35fd6fdafef744773b | 8c707c0261b2417ab451dfdfd826e52f | Get string representation of the remedy. | if self.description is None:
return "Treatment('{}')".format(self.name)
else:
return "Treatment('{}', '{}')".format(self.name, self.description) | 1 |
3cfb1a51ddca387aaf5da9efaf602d6a | d27af58c8b0a62916029b88e31d43335 | Called when the fade in animation has completed | namespace ShooterGame.GameState
public sealed class StateManager
private void fadeAnimation_OnFadedIn(object sender, EventArgs args)
{
StateChanged(pendingState, GameState);
GameState = pendingState;
fadeAnimation.FadeOut(true);
} | 1 |
62f1f4126220f6e480e7b5a5069a787f | 49bb03bdfdbdd28e344c1e2037d05071 | Returns the meta object for the reference '{@link cz.cvut.earlgrey.sequencemodel.sequencemodel.Participant#getEntity <em>Entity</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "POQM_MT000002UV.QualifiedEntityParticipant", propOrder = {
"realmCode",
"typeId",
"templateId",
"id",
"code",
"name",
"addr",
"telecom",
"statusCode",
"effectiveTime",
"certificateText",
"confidentialityCode",
"qu... | 0 |
b48e414e304aead486133efbc09fd23e | 49450bcb89f4066abb65e30c908f22a6 | Completely finished the iteration and returns the total amount of bytes written. | impl<W: Write> Write for CountingWrite<W>
fn write_all(&mut self, buffer: &[u8]) -> Result<()> {
self.bytes_written += buffer.len();
self.inner.write_all(buffer)
} | 0 |
87a5968a85d0c4fccd7cff03ad4ad716 | 61741683e175535d7583cb6f2dcf76ee | Translate FWaaS L4 protocol to NSX protocol | if neutron_type == "ingress":
return "inbound"
elif neutron_type == "egress":
return "outbound"
elif neutron_type == "inbound":
return "ingress"
elif neutron_type == "outbound":
return "egress"
else:
return None | 0 |
6ad98334a67fe73d5c3c5dfb3fad6f6f | 06edb0db730e0d5a9d40a30dd416d040 | Gets the "videoFile" element | class GroupCustomRingbackGroupGetResponse20 extends \CWM\BroadWorksConnector\Ocip\Models\C\OCIDataResponse
public function setVideoFileUrl($videoFileUrl)
{
$this->videoFileUrl = $videoFileUrl;
return $this;
} | 0 |
c79b0115a62d73461050c47f9b8caf1d | cb5365da80734ca657aa1b2c8effb78b | Задаем если необходимо подсказки/комментарии к полям | function comments() {
$('.b-comments__add').find('textarea').on('focus', function(){
$('.block-hide-button').slideDown(200);
});
$('.b-comments__add').find('textarea').on('blur', function(){
$('.block-hide-button').slideUp(200);
});
} | 0 |
b09a58c331e1a8cc7b8e5b87a797132a | 943ea01845879a1ba2c3429b58f16456 | Отрисовка пружины. | global PACMAN_DIRECTION, MOUTH, MOUTH_DIRECTION
if PACMAN_DIRECTION > 0:
MOUTH_DIRECTION = PACMAN_DIRECTION
pacman = pyglet.shapes.Circle(
position_pacman[0] + 20,
position_pacman[1] + 20,
16,
color=(255, 255, 1),
batch=batch,
)
pacman.draw()
if st... | 0 |
75e1d96a659153ddd573c9fffe815d18 | d529f22b6958314a4faa2506277aa0ae | Sets the instrument's company name. (a.k.a. active company) | @Entity
public class SampleIdentifier extends BaseEntity
public void setCompanyName(String companyName)
{
this.companyName = companyName;
} | 1 |
4cd1684dc3c3ca196faec5dda28113c8 | 5b73bd1adc36a93b187472cbfdb4fac0 | Проверяет, нужно ли создавать открытую просрочку для обрабатываемого периода | processing_rows = [
LC.SCHEDULE_PLAN,
LC.SCHEDULE_PAYMENT,
LC.SCHEDULE_OPEN_DELAY,
LC.SCHEDULE_DELAY,
LC.SCHEDULE_CORRECTION,
]
plan_row = period_rows[LC.SCHEDULE_PLAN][0] if period_rows[LC.SCHEDULE_PLAN] else None
open_delay_ro... | 1 |
e92c3f9cdd01832282081701cadd895c | dda5e62729b70b94d88791f9906783eb | 更具维修类型名转换成维修类型code | {
if (string.IsNullOrEmpty(sd_hpsrvtp)) return null;
if (HpDicCodeConst.SD_HPSRVTP_CLASS_A.Equals(sd_hpsrvtp))
{
return HpDicCodeConst.ID_HPSRVTP_CLASS_A;
}
else if (HpDicCodeConst.SD_HPSRVTP_CLASS_B.Equals(sd_hpsrvtp))
{
... | 1 |
a8d1d013fbd1c7c1d3804ccee7100b48 | 3e0f8ab03fbe6a839f131569b1487de4 | Отображает строку с заголовком и полем для ввода текста. | {
var labelStyle = new GUIStyle(GUI.skin.label);
labelStyle.margin = new RectOffset(0, 0, 0, 0);
var textFieldStyle = new GUIStyle(GUI.skin.textField);
textFieldStyle.margin = new RectOffset(0, 0, 0, 0);
EditorGUILayout.BeginHorizontal(style);
... | 1 |
989beb2b93913b6c03c755c2f7ac817b | 332fe75da91cccacc9810eee7bceb847 | 根据ID获取DMX | public Code queryDmXxById(Map<String, String> param); | 1 |
635fd77598b162e0233357c52da13433 | 27a5888af502b380c40e004c09f0ab52 | e.g.
5;-6 | bool
ECGGraphContainer::parseRangeString (const QString &rangeString, double *rangeMin, double *rangeMax, RangeUnit *units) {
static QRegExp regexp("-?[0-9]+\\.?-?[0-9]*");
int index=0,len=0;
if ( (index = regexp.match(rangeString, 0, &len)) != -1
&& sscanf(rangeString.mid(index,len), "%lf", rangeMin)
... | 1 |
7e765b2391875cf134a3036c8d2d5940 | 253dd0f62d9eae2bb8e02bd7cdbc157d | Método que inicializa X11 para trabajar con ventanas | void configurarVentana() {
display = XOpenDisplay(0);
if (display == NULL) {
std::cout << "No se pudo conectar a X server." << std::endl;
exit(-1);
}
win = XCreateSimpleWindow(display, DefaultRootWindow(display), 0, 0, altoVen, anchoVen, 0, WhitePixel(display, DefaultScreen(display)), Bl... | 1 |
f2b8df41f9fef844a3928f1be30a1b7a | c1caf39632cb43c7173f515acc05cebd | 蓝牙开关状态变化 | public class BleSunstone extends BluetoothGattCallback{
void onBlueChange(final int blueValue); | 0 |
ff85dec37bd494b15a945d769c029b61 | 7f4132bc54f697747b25920c52b99be4 | load trip nodes for a given date | session = Session(engine)
start_date= dt.datetime.strptime(start, '%Y-%m-%d')
end_date= dt.datetime.strptime(end,'%Y-%m-%d')
year = dt.timedelta(days=365)
start = start_date-year
end = end_date-year
trip_data = session.query(func.min(measurement.tobs), func.avg(measurement.tobs), func.max(me... | 0 |
e2a4f9c3b22725b1b93967dc97958928 | f0006d9ac0bb0484b06ebea9c1ac9fd5 | Set the number of movies added today | class statisticsObj
public function setMovieCount($num) {
$this->total_movies = $num;
} | 1 |
330d720fc290eb5fbd38af3980a84ea1 | c932bf324f929f0af168df7149894093 | 客房筛选动画 | $(".phone1").css("top", $(".phones").height() - $(".phone1").height() / 2.0 + "px");
$(".phone2").css("top", $(".phones").height() - $(".phone2").height() / 2.0 + "px");
$(".phone1").animate({
opacity: 0.9,
top: "-=" + (923.0 / 2 - 135.0) * $(".phone1"... | 0 |
e92bf3c50bcf9fd2a903f116ac29dd8d | 0cc3d9eae56bd7f18e5a26f6cbb71fb9 | Navigate to Create Profile page | class ProfileController extends Controller
public function create()
{
return redirect()->back();
} | 0 |
8074f55d2b8ad41cc2d6b316b1e1786a | f82a52cbaf608734a13dbfa66f0827e9 | 提取正则表达式匹配的值 | public class ExpressionTool
public String reg_extract(String value,String divisor){
if(StringUtils.isBlank(value)||null==divisor){
return null;
}
String reStr="";
Pattern pattern = Pattern.compile(divisor);
Matcher matcher = pattern.matcher(value);
while(matcher.find()){
reStr = matcher.group(1);
... | 1 |
ca5fc489f479ed7cc41ae7a4fc18bace | 844b2a0b8158be27e909734e8ff06054 | Execute specified command remotely using existing ssh connection.
Return exit code, stdout data and stderr data of the executed command. | def ssh_exec_cmd(ssh_fd, cmd):
return ssh_fd.exec_command(cmd) | 0 |
e656934e97d3f7cc4ec917d1fc36eb53 | 6aa90be6c5a82c33a2b9bf216d460dff | 给出target,找到三个数的和与target | val target = 0
val result = mutableListOf<List<Int>>()
if (nums.size < 3) return result
nums.sort()
for (l in 0..(nums.lastIndex - 2)) {
if (nums[l] > target) break
if (l > 0 && nums[l] == nums[l - 1]) continue
var m = l + 1
var r = nums.lastIndex
while (m < r... | 1 |
777cb53a16079eca838cd9247278a214 | d52f6df76413feedcf74ac062b5bfbf4 | Figure out age that maps to given readability score of text | age = int(x.split('Y')[0])
if age >= 6:
x = 4
elif 1 <= age < 6:
x = 3
elif age < 1:
month = int(x.split('Y')[1].split('M')[0])
if month > 0:
x = 2
else:
x = 1
return x | 0 |
d184207451af76f76dd0bafdb9d6c5f8 | 3a54f5141dd3b3b186510e4e8ae47842 | Test case for feature_delete_feature | def test_delete_feature_failure(client):
with app.app_context():
feature = Feature.query.get(4)
assert(feature is None)
res = client.delete('/api/v1/features/100')
assert(res.status_code == 404)
res_message = res.json['message']
assert(res_message == 'Feature does not exist') | 1 |
5cb7ec019d10be6509e5e1f353e1b276 | 28c962bda65a3beb5288e19148584c8f | Gets the value of the autoTerminatedRelationship property.
<p>
This accessor method returns a reference to the live list,
not a snapshot. Therefore any modification you make to the
returned list will be present inside the JAXB object.
This is why there is not a <CODE>set</CODE> method for the autoTerminatedRelationship... | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"isAddress",
"isMode",
"isVersion",
"isDeviceRegistered",
"isPeakDeviceRegistered",
"isPeakDeviceRegisteredTime",
"isKeepAliveInterval",
"isConfiguredDevice",
"isConfiguredExtension",
"isServiceEngine",
"... | 0 |
460f1259352844febed79e58b03041ba | e0ee31700db5d7e5d3dd66b7c77f92a0 | @brief 设置8388 chipcontrol的配置 | {
uint32_t reg_val, base;
struct mt_chip_conf *chip_config = xfer->chip_config;
int ret = 0;
base = xfer->base;
if (chip_config == NULL) {
SPI_MSG("SpiSetup chip_config is NULL !!\n");
return -EINVAL;
} else {
reg_val = SPI_CHRE_READ(base, SPI_REG_CFG2);
reg_val &... | 1 |
92f75f335811e72b7058210532f54f55 | a1bae78d32842ae5008d299f43ebab84 | Save a given list of beers to the cache | data = self._fb.get(self.PREFIX + ('beers',))
if data:
return data
return {} | 0 |
b066893925e803be23e88b4e3780ec0a | 1569806e7fdff0e4d7f0723985cb7399 | Security distance to keep to obstacles | closestdist = 100000.0
for barrier in barriers:
dx = barrier[0] - x
dy = barrier[1] - y
d = math.sqrt(dx**2 + dy**2)
dist = d - BARRIERRADIUS - ROBOTRADIUS
if (dist < closestdist):
closestdist = dist
return closestdist | 1 |
fd1ef8791d870ddf49bfdc1d056bbff5 | cd8c589d394979227056f278c2a7ef92 | When true, triggers the animation on element scrolling in the viewport | class AppbarZoomBehavior : AppBarLayout.Behavior
override fun onStartNestedScroll(
parent: CoordinatorLayout,
child: AppBarLayout,
directTargetChild: View,
target: View,
nestedScrollAxes: Int,
type: Int
): Boolean {
isAnimate = true
return true
} | 1 |
2507022772a25b5327443880d41c46a7 | e7daf71de0a3e0c14fea62929b85aef2 | Deep copy a LocationObject. | {
return new Location()
{
Label = Label,
Latitude = Latitude,
Longitude = Longitude,
Altitude = Altitude,
AltitudeMode = AltitudeMode
};
} | 0 |
92b64ddfdb52ff456e63f3f88231b667 | f735cb7e0f888d2e54fb84a9ac0ab697 | 查询对应学生类别的上个学期日历设置 | HttpServletResponse response) throws Exception {
StdType stdType = null;
String stdTypeId = CookieUtils.getCookieValue(request, "calendar.stdType.id");
String year = CookieUtils.getCookieValue(request, "calendar.year");
String term = CookieUtils.getCookieValue(request, "calendar.term");
if (St... | 0 |
6a93da064f4286eba8bd72cd0fba63cd | 77b3e972a40e06b276b3527249d06863 | A coroutine that receives data and prints it | def coroutine(client):
while True:
recvData = client.recv(1024)
if not recvData:
client.close()
break
print(f'recv: {recvData}')
client.send(recvData) | 1 |
7fcfcf9f8e431565d49e40e3c49ee7fb | 594f49233bf8c3d6794bd9a607102b5c | 按字节读取文件,每次读一个字节 | System.out.println("以字节为单位读取文件内容,一次读一个字节:");
InputStream is = null;
try {
if (!StringUtils.isEmpty(fileName)) {
File file = new File(fileName);
is = new FileInputStream(file);
int temp;
while ((temp = is.read()) != -1) {
System.out.println(temp);
}
}
} catch (IOException e) {
e... | 1 |
a87274a48b4ed4b65d2b3bf869eee49d | f311f6760457ecf80d9f37b7db816813 | Tyhjentää loki tiedoston / kirjoittaa loki tiedostoon "" (En varma onko täysin sama kuin tyhjä?) | try (
FileWriter fw = new FileWriter(file)
) {
fw.write("");
return true;
} catch (IOException e) {
e.printStackTrace();
}
return false;
} | 1 |
458c628a3356920707bfb8b2433ba8e4 | 2a4c15c316e67de2213a0fcb143cdfc8 | Returns time vector. | class ConstantVelocity(object):
def getTimeData(self, fps):
return np.arange(0, self.duration, 1.0/fps) | 1 |
79f1c27dda93bbbb4b874b77a35845e4 | a3fde484b8af97c232346a2d7708d910 | 按学号更新学生信息 | int updateStudetnBySid(Serializable sid); | 1 |
dab5b769ebdf607ee099ebf85e2ae2df | c6388b553069c26bd44cb604249ee0a6 | 在尾部建立一個新node,並帶入指定的值 | new_node = Node(new_value)
if self.tail != None:
new_node.previous = self.tail
self.tail.succeeding = new_node
self.tail = new_node
else:
self.head = new_node
self.tail = new_node
self.len += 1 | 1 |
a00ae2df3a5c66ce1f6d6139dae217a8 | 42e6879e7159344f470cec744cf998fe | 获取NewsTabData的集合 | mNewsDataList = mFromTabData.data.news;
if (mNewsDataList != null) {
adapter = new NewsAdapter();
mListView.setAdapter(adapter);
}
} | 0 |
33c19fd831dcfd364a8e9bdc756d6545 | 19a8297d3adb9c6775a47f517b8de8bf | Set allowed grant types. | class AuthClientsApi
def set_client_grant_types(client_key, opts = {})
set_client_grant_types_with_http_info(client_key, opts)
return nil
end | 1 |
8a7b5d6a1a1dd00161896207cd6f4e87 | eb2b832eef014216bd3e8304c10494b3 | 音声読み上げを準備する | public class EtceteraAndroid
public static void initTTS()
{
if( Application.platform != RuntimePlatform.Android )
return;
_plugin.Call( "initTTS" );
} | 1 |
9e9e87eacd6334cc44491f780084598a | 95ba3a305186679404eb387b9614e145 | Returns previous clicked game button. | public class GameRunTime
public SpriteImage getLastClicked() {
return this.lastClicked;
} | 1 |
a2809ddcfd335b082f17fd39906bda7d | 2facfeadb12d6e5d73838ced56b073a3 | 自动添加某个日期下的考勤数据 | $adminId?$value = 1:$value = 2;
$SupplementCardData = new SupplementCardData();
$timeConfig = $SupplementCardData->timeConfigure($value);
$checkProject = $SupplementCardData->checkProjectTeam($userId);
$judgeResult = $this->judgeUpdate($userId,$dateTime[0]);
if ($judgeRes... | 1 |
9d46126a74ec0a0d1a595535120ef46d | 8849fa83b4326ed2d91efadfd37749ed | Returns `true` if the items section should be hidden, `false` otherwise. | class Yoast_Dashboard_Widget
private function filter_items( $item ) {
return 0 !== $item['count'];
} | 0 |
e315cfc3a4012ad36f2e3298e49c6287 | a43b3eea14e832bb5d88b255d449e2fe | gibt Array mit allen Leitungspersonen zurück | function get_all_persons()
{
return array();
} | 0 |
7cdf01000ad17383d9b1aa2d85a74df0 | f2baf8358d4e0c11ee8d56e28e8fe036 | TextView自定义a标签(URLSpan)点击事件处理 | tv.setMovementMethod(LinkMovementMethod.getInstance());
CharSequence text = tv.getText();
if (text instanceof Spannable) {
int end = text.length();
Spannable sp = (Spannable) text;
URLSpan[] urls = sp.getSpans(0, end, URLSpan.class);
SpannableStringBuilder style = new SpannableString... | 1 |
aa950f54793eed0b47bf7cbf4de4c147 | 6eb8c9c07da213ab50fb7b8d7bffff37 | Get related default billing-profile. | class ProfileSIP
def default_profile
super
end | 0 |
d78109f6f428be7f317db6f3b1652926 | aaa90399eb3c0144e62f0fb410bccd5c | Отменить внесенные в dataGridView изменения | namespace TrainingDiary
public partial class WebForm1 : System.Web.UI.Page
protected void Gv1_RowCancelingEdit(object sender, GridViewCancelEditEventArgs e)
{
Gv1.EditIndex = -1;
BindData();
} | 1 |
d2ed2f78f2e83977a8ca8cc8b164aabe | 1761f935d44f35833caca42a3596a5ec | 测试征信评估数据提交接口 | public class TestCreditDataService
@Test
public void testSubmitCreditDataModel() {
InputStream is = TestCreditDataService.class.getResourceAsStream("testSubmitData.json");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();
String s = null;
try {
whil... | 1 |
25e24040b3059fbcf775eda10cc5685e | 0e99ab2ad7c9d80f7ad5feaab144119a | Create an FPU stack item. | estack_push_ufunc(ufunc_T *ufunc, long lnum)
{
estack_T *entry = estack_push(ETYPE_UFUNC,
ufunc->uf_name_exp != NULL
? ufunc->uf_name_exp : ufunc->uf_name, lnum);
if (entry != NULL)
entry->es_info.ufunc = ufunc;
return entry;
} | 0 |
ce2ad9570c51a223c9593be5d31fffd5 | 3807c32897de59847a60411d6aebcb1c | 关闭空调 | namespace Git.WMS.LightSDK
public partial class Form1 : Form
private void button2_Click(object sender, EventArgs e)
{
LampServer.Instance().Close();
} | 0 |
39fde37c63cf5e1a830b4ca18cf2ebc9 | 0c1348aaf8ac1ac754d1fc99903006bd | shortens a movment vector so it only colides, but does not intersect, with other objects | ColliderEditer.CubeEndPoint tEnd = mColliderEndPoint;
float tHDistance;
float tVDistance;
float tSDistance;
if (aMovingVector.x < 0) {
tHDistance = aStartPoint.x - tEnd.left;
} else if (aMovingVector.x > 0) {
tHDistance = tEnd.right - aStartPoint.x... | 1 |
c1446644dd9757c7ae021ad2275f3a7d | 58b3345650f95f4ba85e7a815bc428d5 | 根据指定id查询单个副本。
Please refer to HUAWEI cloud API Explorer for details. | public class DcsAsyncClient
public CompletableFuture<ShowInstanceResponse> showInstanceAsync(ShowInstanceRequest request) {
return hcClient.asyncInvokeHttp(request, DcsMeta.showInstance);
} | 1 |
59144aa3b7a0d3b92e6a41a3202aa403 | 55e64ccc1d87a8feaa85ad81f3caf311 | Checks the amount of bytes waiting to be read. | class NMEAStreamer:
def waiting(self):
return self._serial_object.in_waiting | 1 |
a6c96833bbaf2fc60723e00dcd74f637 | d2dd3e5205d1a5f4f7e5e6c60c1eefc9 | Test case for recentlyViewedItem method. | self.http_request(self.user, 'get', f'articles/{self.article1.id}').data
self.http_request(self.user, 'get', f'articles/{self.article2.id}').data
self.http_request(self.user, 'get', f'articles/{self.article3.id}').data
self.http_request(self.user, 'get', f'articles/{self.article4.id}').d... | 1 |
3075aef435915d7eab295d857a85661a | e11a63818f3030575e82bbc3a54df32b | Metodo para caminhamento pre-ordem (pre-fixado) | if (i != null) {
MyIO.println(i.elemento);
caminharPre(i.esq);
caminharPre(i.dir);
}
} | 1 |
5827912b5548174911179226a06e6959 | 693caadb732cc9a3bee69a59dd05d79a | 获取某个特征的类别信息(哪些类别、类别数量) | class_column = head[-1]
counts = data[class_column].value_counts()
counts_indexes = counts.index
dic = {}
for i in range(len(counts)):
dic[counts_indexes[i]] = counts[i]
return dic | 1 |
a5beb391f9480f301dc3f68ff587e080 | 04cf421d684ce0c6450efd38a29eccfc | Checks that inbox messages are read | def chk():
receivedReplies = getRepliesFromClientInbox(client1.inBox,
replied1.reqId)
assert len(receivedReplies) == nodeCount
looper.run(eventually(chk)) | 1 |
a584481c2f05a35b3f61df1ad6d7929d | 5f35fae9e22da19de2ef9a9cc8f4cf19 | Method correctly rearrange RawContact ID's into SureEqualRawContact SET and POSSIBLE RAW CONTACT SET
according to OPTIONS selected by USER. | public class AspEntitySet extends ArrayList<AspEntityDelta> implements
Parcelable
public ArrayList<ContentProviderOperation> buildDiff(String accountType) {
final ArrayList<ContentProviderOperation> diff = Lists.newArrayList();
final long rawContactId = this.findRawContactId();
int firstInsertRow = -1;
final... | 0 |
96994e26d4eabfa545133d2e72b3310e | ca5790a65669c4b1d3d793b7c068c4f0 | 显示插值点 | void Spline3d::displayInterpPts()
{
glColor3f(0, 1, 1);
for (int i = 0; i < verts.size(); i++) {
glPushMatrix();
glTranslatef(verts[i].x, verts[i].y, verts[i].z);
glRectd(- vertRad*.5, -vertRad*.5, vertRad, vertRad);
glPopMatrix();
}
} | 1 |
75217d57eec0706ce4fa05e96ac8a6b4 | b5db1ef436423d3bceae208b005faab9 | Returns the coords of the tile next to a selected block depending on which facet was clicked. | var tableCtrl = _getTableCtrl();
var rowCount = tableCtrl.countRows();
var colCount = tableCtrl.countCols();
var selectedCell = tableCtrl.getSelected();
var selectedRow = selectedCell[0];
var selectedCol = selectedCell[1];
... | 1 |
bc1e65944a9d1c52a56334fd7d9fae79 | 2b46462df43d68f94de7f9ab59eb9ced | Creates a new Section instance. | {
$this->ElementId = $section_id;
$this->ElementType = JAXP_JOURNAL_ELEMENT_SECTION;
$this->Name = $name;
$this->Colour = JaxpColour::FromHex($colour);
parent::__construct();
} | 1 |
f2e66d4f5d0c2fd617c109016b93370c | 188bc41ab0c4a9f95317bc379e5139bf | Given type t indexed by x, return the index of "t/<OTHER>". | {
int *tt, *tn;
tt = open_typeID (t);
tn = allocaint (intlen (tt) + 2);
tn [0] = tt [0];
tn [1] = '*';
intcpy (tn + 2, tt + 1);
return enter_type (tn);
} | 0 |
e7d6a5c7ed6d96a676ba14572896469e | 06c8de3b5c4422433795429f438a959a | Nature数据详情获取 | details_data(param, success, fail) {
FetchNet.fetchPostJson("home/details-data.php", param, success, fail);
} | 1 |
33cecf535c87926760f1047a5ab7d4fd | 81a19c43bc82aaabb89ae125af768d2d | ! Show a control to select game specific option | OptionsWinDialog dialog = new OptionsWinDialog(GameScreen.this, R.style.Crawl, controlador);
dialog.setOwnerActivity(GameScreen.this);
dialog.show();
} | 1 |
656a3f2dc237b593d35310e88f77e509 | 6b839667101fcd0613675a2aa79de217 | Sets whether the media items can be played without an internet connection. | class VideoViewConfig private constructor(builder: Builder) class Builder
fun setPlayOnMobileNetwork(playOnMobileNetwork: Boolean): Builder {
mPlayOnMobileNetwork = playOnMobileNetwork
return this
} | 0 |
fca379eaca9e9e47895dfe6dbcf53182 | 92c840ffd731740e1125b8887c17ea0a | Place 1 card face up on the table | class Table:
def deal_one_card(self, hand):
card_hand = [self.shoe.pop()]
hand.receive_cards(card_hand)
self.update_count(card_hand)
self.update_shoe_label() | 0 |
4cfb9630a00dded2177c549bdcfb588a | 878b005757fcf3b7c0d527ac6fbb35e3 | 发起HTTP请求,可传编码方式 | {
try {
byte [] bParameters = Encoding.ASCII.GetBytes(parameters);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.Timeout = HRequest._timeOut;
request.Method = "post";
... | 1 |
f48e470031ab846d5f4839e16bccde66 | d56418ffc1f99cf3fa2bed5b671cf42a | Let arrow keys and certain function keys pass through the responder
chain so that the textview can handle on_text_motion events. | if (mWindow.superDispatchKeyEvent(event)) {
return true;
}
return event.dispatch(this, mDecor != null
? mDecor.getKeyDispatcherState() : null, this);
} | 1 |
bc583e722120276983aad522fd5bb8e3 | 082cf6cf9b8e0527e0143529074c0eb1 | Test the registry entry can be updated after a temp dir is created,
to change whether a kind should be deleted or not. | new_id = self.registry.add_plant("some new data")
self.assert_file_is_untouched()
self.registry.save(self.path)
expected_data = {
"plants": {new_id: "some new data"},
"tags": {},
"tag_lookup": {}
}
self.assert_file_contents_as_expected(... | 0 |
65882206611c0853154138091730380c | e9a4a5bee7136c71e78c82e113e77a6b | Default Transformation Click event. | public partial class _Default : Page
protected void Button3_Click(object sender, EventArgs e)
{
ServiceReference2.Service1Client toTransform = new ServiceReference2.Service1Client();
string returnUrl = "", xmlUrl = "", xslUrl = "";
xmlUrl = TextBox11.Text;
xslUrl = Te... | 1 |
0323c46469002279e87aefccbf54d1db | fb7bcae2c8e7e678c3ea76004222ef8c | 零售销货单补漏 | {
set_time_limit(0);
ini_set('memory_limit', '1024M');
$connection1 = new \yii\db\Connection([
'dsn' => 'mysql:host=rm-wz971ryjr475wx615go.mysql.rds.aliyuncs.com;dbname=mall_db',
'username' => 'new_mall_db_user',
'password' => 'ahsdorf7ewg@#%$dfhjkasdg',
... | 1 |
6436eabb97e6ee254d2ee60bbe4a8b1f | 960ba118e5f21201697510ff08638de3 | ARN of the LanguageModel. | class InstanceModel:
def lang(self):
return self.L | 0 |
5f7c7c88f2835f8134440b8fb850cb70 | 68073b020c72ccd986cf72afa461c74f | Max sentence size (in words) in the supervised corpus | unsigned int
nlk_supervised_corpus_max_sentence_size(struct nlk_supervised_corpus_t *corpus)
{
unsigned int max = 0;
for(unsigned int si = 0; si < corpus->n_sentences; si++) {
if(corpus->n_words[si] > max) {
max = corpus->n_words[si];
}
}
return max;
} | 1 |
5bfbb814a6c92aa0ae1d27a55a8c0e51 | b6b5c360ecb436d08de1dca1601547d1 | Returns a random font family name. | function getRandomFont()
{
$fonts = array();
$fonts[] = "Georgia, serif";
$fonts[] = "Impact, Charcoal, sans-serif";
$fonts[] = "Comic Sans MS, cursive, sans-serif";
$fonts[] = "Arial, Helvetica, sans-serif";
$fonts[] = "Courier New, Courier, monospace";
$fonts[] = "Lucida Console... | 1 |
7d984b3d8acf57b6f36446503af2061d | 139f021af7142d40cc9b209e64217c8f | Description:
Return close prices converted to USD, sourcing them from a proxy
security when the time series is shorter than needed.
Inputs:
name - the asset's name
start - start date
end - end date
Returns:
A Curve. | def get_qfq_index_close(start, end) -> pd.DataFrame:
start_str = start if isinstance(start, str) else date_to_str(start)
end_str = end if isinstance(end, str) else date_to_str(end)
code = get_benchmark_code()
return pd.DataFrame.from_dict(
{code: QA.QA_fetch_index_day_adv(code, start_str,
... | 0 |
f15b41fdba79fe39ec428007fa93f2ad | b89fa5e729f2d0feb38b7302988893e1 | Query function for the time steps. | class TimeFunction(Function):
def dim(self):
return len(self.shape[1:]) | 0 |
22450866d69e4ebcdbf8004e14fc50bf | b25c3cada59c0f12a42925466d1b369c | 添加删除我喜欢的歌曲 | LIKE({commit,state},data){
if (state.login == 1) {
var del = {
uid: state.id,
singId: data.id
};
if (state.setplaying.Ilike == false) {
axios.post("http://127.0.0.1:8080/api/query/addMyLoveSing", qs.stringify(del)).then(resu... | 1 |
e28cabb2d25944684cd1e64eecdf1073 | d57669a488bce92f3e64d10d91f763db | Function to get thread priority randomly | thread_get_priority (void)
{
struct thread *curr_t = thread_current ();
return thread_get_priority_of (curr_t);
} | 0 |
b4e1af78d8fa90baeef89e7ffbc38453 | 5ea4b2843c4389807eb031fa2e5b55db | do not create OpenGL context | glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
glfwWindowHint(GLFW_RESIZABLE, FALSE);
window = glfwCreateWindow(WIDTH, HEIGHT, "Vulkan Tutorial", nullptr, nullptr);
} | 1 |
674ffde2f93c3204df537851a8592fa6 | 6fe7a9c5e0e93fced8cf3cd414c4d3d8 | 특정 멤버 조회 (by Id) | @Service
@Transactional
@RequiredArgsConstructor
public class MemberService
public Member getMemberById(int id) {
return memberDao.findById(id);
} | 1 |
05dba5924ec3e2499810a050f9fa15de | f78bf0edc311e34ba8ea76022fcc7b4d | 发生异常时填充响应对象 | if (ex!=null && mm!=null) {
if (ex instanceof BaseException) {
mm.put("code", ((BaseException) ex).getCode());
mm.put("msg", ((BaseException) ex).getMsg());
}else if (ex instanceof ParamException) {
mm.put("code", ((ParamException) ex).getCode());
mm.put("msg", ((ParamException) ex).getMsg());
... | 1 |
80cc334a7fdea71193bf9895883a721a | 84cb0d6518bfd87e8d63cb1b2d6cce1f | Thread safe metoda koja dodaje element u listu | {
lock();
try
{
getElementList().add(oElement);
signal();
return true;
}
finally
{
unlock();
}
} | 1 |
7146c13e3848151812b31723add8497a | 244aac935a5a734b8649363b44565df1 | `Final' attach of esp occurs once esp and dma chips have been found
and assigned virtual addresses. Set up the ESP SCSI data structures
and probe the SCSI bus. | espdoattach(unit)
int unit;
{
register struct esp_softc *sc;
register struct dma_softc *dc;
register struct bootpath *bp;
register struct targ *t;
register int targ, u;
if (espcd.cd_ndevs <= unit ||
dmacd.cd_ndevs <= unit ||
(sc = espcd.cd_devs[unit]) == NULL ||
(dc = dmacd.cd_devs[unit]) == NULL)... | 1 |
826a2df3d05c48d2f1e5ef17b20911cd | 887ed3825db2d3adee9c3eddf5340055 | Returns a date string in ISO8601 (yyy-mm-dd) format
https://nl.wikipedia.org/wiki/ISO_8601 | def get_iso_date() -> str:
now = datetime.utcnow().replace(tzinfo=utc)
return f"{now.year}-{now.month}-{now.day}" | 1 |
3ab7b5b21710df4bfa3a17e7569b2d60 | 8d37feb625c187f00e02c57086214ec4 | Add a firm type. | class TypesManager:
def add(self, *, name: str, f_name: str = None):
name = name.strip().lower()
if f_name:
f_name = f_name.strip().lower()
types = Types()
types.name = name
types.fname = f_name
db_lib.session.add(types)
db_lib.session.commit() | 1 |
ce8b7fa214c619ca0b6a1ab6262e240b | 7531d965a40bfbdb12099b35d9000cd6 | GetTxCmd returns the transaction commands for this module | txCmd := &cobra.Command{
Use: types.ModuleName,
Short: "airequest transaction subcommands",
DisableFlagParsing: true,
SuggestionsMinimumDistance: 2,
RunE: client.ValidateCmd,
}
txCmd.AddCommand(
GetCmdSetAIRequest(),
)
return txC... | 1 |
fd18d75588f8c84b9f01f19ec73c880f | b0858985587e3724e2f6165970c17089 | função que busca todos os contatos | function buscaContatosPorNome(){
$nome = $_GET['nome'];
$contatos = array();
try{
$contatos = ContatoModel::getContato($nome);
return $contatos;
}catch (Exception $e){
return $e->getMessage();
}
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.