query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
44db9cc1f508a777a61857186e276a36 | 08a857dd6c01cf1ba0502caeddcfccd9 | Add Active Class Slider | class Slider extends Component
checkSlides() {
if (this.$clonedFirst.hasClass(this.options.activeClass)) {
this.$firstItem.addClass(this.options.activeClass);
}
if (this.$clonedLast.hasClass(this.options.activeClass)) {
this.$lastItem.addClass(this.options.activeClass);
}
} | 1 |
079449e479ac975915bd998555c2e2f6 | 62a80684a6bf86545fde71890e96a0e1 | Copies values from a dense vector to this dense vector | {
_n = v.size();
_p = new double[_n];
for(int i=0; i<_n; i++)
{
_p[i] = v[i];
}
} | 1 |
38045801ff0fb5b0c4b83a4ed33c8d08 | 28ebc648135b6488224e8ab3a5870ab1 | Retourne si la liste est en selection | if (this.isListSelected === true) {
return true;
} else {
return false;
}
} | 1 |
20b011cadc29cdcd100d2dab6e8e683b | 4cea08e845e1e6ffd88408b4b894d392 | 获取根据关键字搜索单曲 | function getSearchMusic(keyword) {
return axios.get(`${baseUrl}/search?keywords=${keyword}`);
} | 1 |
f97ab50a2b28d7ce9b6dd4231ab2cc0f | 47e4576eed017dda72689c4cb34eb7f9 | Creates a new TabelAppointment model.
If creation is successful, the browser will be redirected to the 'view' page. | class ListAppointmentController extends Controller
public function create()
{
} | 0 |
4290133661b128bf2a8fcc4998db4397 | 8d26622871f4fe8a49ee5a10b19f52a3 | 일직선 위일 경우 base와의 거리 비교. 먼 점이 뒤로 오게 정렬 | bool cmp(const pair<int, int> &a, const pair<int, int> &b)
{
if (a.second == b.second) {
return a.first < b.first;
}
return a.second < b.second;
} | 0 |
4572d72b2e19a35b7a56613a5f87f83e | 1ada598de754b71017db1ff80995c175 | GET: Embalajes | export class EmballageService
public getEmballages(): Observable<any> {
return this.http.get(API_URLS.EMBALLAGE_API);
} | 1 |
546b9e8123827e4fb598a044ea13820d | 6410e673d9cca7a573a092dda275e06e | Metodo para traer datos de la venta con detalles | {
$venta = venta::find($id);
$pila = array();
foreach ($venta->detalle_venta as $value) {
$arrayName = array(
'nombre' => $value->producto->nombre,
'cantidad' =>$value->cantidad,
'observacion'=>$value->observacion,
'valor_producto' =>$value-... | 1 |
858fbe2bb5c57c3a6d6324c780cf9b19 | 3ae8c666653d39901018b4978278a86c | Aggregate all users to businesses who have been rated by them | function getAllBusinesses() {
let rawData = fs.readFileSync('business.json');
let businesses = JSON.parse(rawData).Businesses;
let results = [];
for (let i = 0; i < businesses.Categories.length; i++) {
for (let j = 0; j < businesses.Categories[i].Category.CategoryData.length; j++) {
... | 0 |
f192602e61ac72809e61b256b8526f0c | e112eebb97dc92c21f1f07334dd07835 | Возвращает значение свойства user_param | class AppserverNode extends AbstractNode implements SystemConfigurationInterface
public function getUser()
{
$this->getParam('user');
} | 0 |
9e593eba8eeb9284131d4e74e5a58ac6 | f9cf11dc4cecd18797d258aa6549a1ad | Checks if the array is sorted. Returns silently if so, throws AssertionError if not. | public abstract class TestUtils
public static void assertSortedListEquals(char [] array, int... elements)
{
assertEquals(elements.length, array.length);
Arrays.sort(array);
assertArrayEquals(newArray(array, elements), array);
} | 0 |
3c9fd9883b1b8520ba74ad52d7fbe825 | fce1e6310191328646f8198295c11bfe | 处理拉取到商品列表之后的业务 | const { templateInfo } = this.state;
const { groupId, goodsStatus } = templateInfo.goodsList[ind].defaultParams;
const userInfo = authorization.getUserInfo();
getlistShopGroup({
groupId: groupId,
status: goodsStatus,
shopId: userInfo.shopId,
}).then((result) => {
if(result.st... | 1 |
d8df030d7a96c77249ef9c8c608f490e | 3ed0a57c04808ac0a4e52ff060bd9f5a | CreateOrder accepts the create order request and stores order details in the DB. | @Service
@AllArgsConstructor
@Transactional
public class DefaultOrderService implements OrderService
@Override
public OrderDto create(CreateOrderRequest createOrderRequest) {
Objects.requireNonNull(createOrderRequest);
Objects.requireNonNull(createOrderRequest.getOrderItems());
Set<OrderItem... | 1 |
1b24c209c418f269fbb374b928142872 | e30ce7ccae65afccb038a40cbd1c496a | Merge column values from {@code event} with {@code prevEvent}. | @Nullable String newValue = Preconditions.checkNotNull(value, "eventLocale");
if (Objects.equal(this.eventLocale, newValue)) return this;
return new ImmutableCruisePlannerEventMessage(
this.method,
this.shipSailDate,
this.cruiseBookingID,
this.guestID,
this.firstName,... | 0 |
787db4b3e6272d603ff81c4f18d1e9b1 | 20352ded4e4d53cf95573812430cca67 | 功能:正常工作模式轮训函数 | {
workStep = 0;
PORTA = 0xFF;
PORTB = 0xFF;
if(sleepFlag || ledTime)
{
workStep = saveWorkStep;
if(!sleepFlag)
{
workStep++;
}
else if(!workStep)
{
workStep++;
}
sleepFlag = 0;
saveWorkStep = workStep;
if(workStep >= 6)
{
workStep = 0;
ledTime = 0;
saveWorkStep = 0;
gotoSlee... | 1 |
50f8e069d264d10d6e14180d1652aa84 | de3dc37bddc2d624ce63d0b781b83eb0 | onClick callback for dismiss button in first run layout | public void onDonePressed() {
SharedPreferences sharedPreferences = getSharedPreferences("FirstRun",MODE_PRIVATE);
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putBoolean("FirstRun",true);
editor.commit();
finish();
} | 1 |
3490a2c81e5a74f848bebef9c344bbf2 | b60af75ed47550eefad2cd0b0b495859 | Add an interval schedule job to check all hackathons | with app.app_context():
print("Scheduling...")
apsched = BackgroundScheduler()
apsched.add_job(run_check, 'interval', seconds=60)
apsched.start() | 1 |
4e2822d35a22d6f8f2d88583c3ee90c3 | f42d9d7f57ab545c502219877146595c | Get All data for table BANKBRANCH | class bankController extends Controller
public function index()
{
$bank = bank_detail::select('bank_details.id','bank_details.bank_name','bank_details.ifsc_code','bank_details.micr_code')->get();
if($bank) {
return response()->json([
"message" => "Data Found Successfully"... | 0 |
fd66f15a452ca98aa890f7eb055fc049 | 3cff5fd16ecaeb12142302f46916784e | Android手机上删除所选图片 | for (data in adapter!!.dataList) {
if (data.isSelected) {
try {
val file = File(data.image)
file.delete()
} catch (e: Exception) {
val toast = Toast.makeText(this, e.message.toStri... | 1 |
2490835da104fc071768a8c489f2c4db | 2355671d826e05e0948612ad336f33ab | Show a dialog allowing axes rescaling | namespace CmrHisto
public sealed partial class CmrHistoMain : Window, IDisposable
private void ShowYAxisScalingDialog(object sender, RoutedEventArgs e)
{
new ScalingDialog(false, this.mYAxisScale, this.YAxisPid, this.mOriginalDataSet != null) { Owner = this }.ShowDialog();
} | 1 |
3e520f4e9fbb609640ad641bdf9eb4f3 | 17f2fdcc73ecb4ccfe7f5c0d002e8f59 | A list of `static_nat` blocks as defined below. This represents a `1:1 NAT`, doing static mapping to both send/receive to/from the Internet. This is only used when `plan` is not `standard`. | class _PoolState:
def allow_nat(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "allow_nat") | 0 |
93f87f7bedf961d4b643675f08304849 | 2e6b471b6e32e2378aa97b1068c912d8 | get faq with answers | class Admin_model extends CI_model{
public function faq(){
$this->db->order_by('id', ' DESC');
$query = $this->db->get('faqs');
return $query->result_array();
} | 0 |
247bfb6a4796752a6b24633c3f186941 | c3e08f597b2ab5f32328b70f93c239ec | 自动攻击状态 | public class BattleCharacterController : BattleObjectController
protected virtual void UpdateAutoAttack()
{
if( !IsAutoAttack || IsRestrictAction || IsDead || IsSpecialDamage || condition.IsImmobile ) return;
if( Targeting.TargetObject == null )
{
IsAutoAttack = false;
... | 1 |
570be80ed063f6516083fc1ae78e887e | 54df56ca777dadde336bafe671b05bfd | Create or updates the fe_users record based on the LDAP values | {
$eloquentUser->name = $ldapUser->getFirstName() . " " . $ldapUser->getLastName();
$temp = $ldapUser->dn;
if((strpos(strtolower($temp),"staff") !== false)) $eloquentUser->is_staff = true;
if((strpos(strtolower($temp),"student") !== false)) $eloquentUser->is_student = true;
i... | 1 |
24d8cc273b17fdec6f8cbcb099ae84b5 | 5933b9f7d2b402e8902667c43ea67b11 | 上拉返回桌面 | Log.d(TAG, "returnHome");
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.addCategory(Intent.CATEGORY_HOME);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
LauncherApp.sApp.startActivity(intent);
} catch (Exception e) {
Log.e(TAG, "返回... | 1 |
b35339b6bf1a232f1fb2adcc155a6ee7 | 917814bd3752f60ceff4df2176eb9a8a | History stack for the dataviz component. | function Historic() {
this.undoEvents = [];
this.redoEvents = [];
} | 1 |
12d7557423ae1473a612f6dfc5048fb5 | 9b3677d71d1a83832aaf6c60924a9266 | stores all statistics in the supplied argument | void ReportSummary::SetStatistics()
{
m_nActionWords = m_pStartStruct->GetAllActionWords( ONLY_THIS_REPORT );
m_nFailedActionWords = m_pStartStruct->GetAllFailedActionWords( ONLY_THIS_REPORT );
m_nErrWarning = m_pStartStruct->GetAllErrors( LogStructure::ERR_WARNING, ONLY_THIS_REPORT );
m_nErrError = m_pStartStr... | 0 |
e6e3c2ba1339e28105c34b33e854d1ab | f99230f75059f6f3789601aa25779043 | Find number of spaces in a sentence | var sentences = [];
string = string.replace (/[ ]+/g," ");
sentences = string.split(' ');
return sentences.length;
} | 0 |
20115a8bc91e7a2c3937a8882e9a38a7 | c70aa446a53ce19ba1b1ee7a8a85b267 | 根据pipelineId 查询所有告警规则 | List<DevopsCiPipelineRecordDTO> queryByPipelineId(Long ciPipelineId); | 0 |
95545184298a349cf7ee33d800d9d36e | f8e994dcc95bb50d00a8777f0257fbbd | Close on click. | class VictoryState(State):
def on_click(self, event):
if event.button == 1:
self.sound.stop() | 0 |
c5b2d9fb5bb28762befb153527bcb40b | 04bc2745839704b99f2fa193137470da | Hides the gauge when the minigame is finished | {
if (!Validate("MinigamesUITimer")) return;
if (alarmSfxSource != null) alarmSfxSource.Pause();
timerTween.Pause();
} | 0 |
318ca9b487e0063d807b151514f71170 | 3e7bb4ab89d6983e6ec03c0ae426c04d | Checks to see if a file was selected in the form post. | class Input extends \Illuminate\Support\Facades\Input{
public static function hasFile($key){
return \Illuminate\Http\Request::hasFile($key);
} | 1 |
952688b0ec0348ea36654f02ac115e07 | f0d45f1220d377f7f7de4ee5d576c662 | checks if link is displayed only to authenticated_users | class AuthTest(TestCase):
def test_welcome_username_linked_to_profile_page(self):
profile_url = reverse('profile_view')
expected = 'href="{}"'.format(profile_url)
self.assertContains(self.profile_login_response, expected) | 0 |
7420ea28a7f39a7ca8f0138c134d2fe8 | e39ee99424f599c543391a161b53ab80 | コンテナが空ならば真となる | class PageContainer
get isEmpty (): boolean {
return this.namesCache.length === 0
} | 1 |
d1efc17d2c83feb7d21fd8351ecb2f10 | c54cf54258e26326323e6fcf038e4c5a | 是否快速查询(只有 status, page的组合) | @Component
public class BaseController extends AbstractController
protected boolean isFilteQuery() {
String isFilte = getRequest().getParameter(HTTPParam.f.name());
return StringUtils.isNotBlank(isFilte);
} | 0 |
7eeda25f509f52bfb8cdf2ace0bada14 | b41d8225e28dc3c341f176be9614cb03 | sum of leaf node | if(root==nullptr) return 0;
int result = root->data;
int childCount = root->children.size();
for(int i=0; i<childCount; i++)
result += sumOfNodes(root->children[i]);
return result;
} | 0 |
868cc1f654e0188f61f04b778f670010 | c830106d60097c71312b0bf9e80fa471 | Returns true if the given baud rate is one of the valid rates. | namespace Microsoft.Robotics.Services.Sensors.Gps
internal class GpsConnection
public static bool ValidBaudRate(int baudRate)
{
foreach (int validRate in baudRates)
if (baudRate == validRate)
return true;
return false;
} | 1 |
c63d2e4929900fd6883e8482e4387729 | e2eea7cdc1e41d4c6f0a8ef15a72a9e3 | Disconnect tag with post | class PostController extends Controller
public function destroy($id)
{
$post = Post::where('id', $id)->with('tagged')->first();
$post->untag();
Post::where('id', $id)->delete();
return redirect()->back();
} | 1 |
166c14421d9552bf70f3ac30aabbdf60 | 4f429eaa7c84990864cfa83d84253619 | Installs the snap onto the system. | internal_timeout = timeout
if internal_timeout is None:
internal_timeout = 3600
return self._do_install(internal_timeout, force, 1) | 1 |
f026c901c95edf6b8c232b43d6d2addf | 46f8618e34c550a831df22eabc91019e | writes onedimensional array to the chosen XML file | void writeFile(int outArray[], int outArraySize, string fileName)
{
ofstream outfstrm;
outfstrm.open((char*)fileName.c_str());
for (int i = 0; i < outArraySize; i++)
{
outfstrm << outArray[i] << endl;
}
outfstrm.close();
} | 0 |
3aae1a807da6d3f95d5874375df8967d | 0ed66a502972c5ceaba140499c799a16 | Get Max Attack Range. | float Weapon::GetMaxRange
(
void
)
{
return maxrange;
} | 1 |
06080004f729b64d49c8270fadb4f637 | 80ebbd75869dbafe16fd2cd7b16cdc37 | Returns the number of related Ventadetalle objects. | {
$partial = $this->collVisitadetallesPartial && !$this->isNew();
if (null === $this->collVisitadetalles || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collVisitadetalles) {
return 0;
}
if ($partial && !$criteria) {
... | 0 |
c8576bdaee041959a6dfa23340cadad8 | 239545c535d2767f84745af40784763e | Detect whether or not the mouse pointer click within the bounding box of the anchor points | if (clickedInsideBox) return true;
var west = parseInt(boxDiv.offsetLeft, 10),
east = west + parseInt(boxDiv.offsetWidth, 10),
north = parseInt(boxDiv.offsetTop, 10),
south = north + parseInt(boxDiv.offsetHeight, 10);
var betweenWestAndEast = ((west + edge... | 1 |
2ffaab69512639fcd108b488c5a357a1 | 7bda10d0434bf3a77e6bc8dc8aa67328 | _buildWorkload_
Build a resubmission workload from a previous
workload, it loads the workload and truncates it. | for i in range(NUM_FAKE_WORKLOADS - 1):
yield workload.train_workload(i + 1, num_batches=1, total_batches_processed=i)
yield workload.validation_workload(i) | 0 |
2e458e0f612fb6142aedda685d1c952a | 02b4f524f006d1b55f18e879d1b2a474 | Create a cart for customer ID provided | function createClientCart($clientId) {
$response = array();
global $conn;
$stmt = $conn->prepare('INSERT INTO "shopping_cart" (user_id) VALUES (:user_id)');
$stmt->bindParam(':user_id', $clientId, PDO::PARAM_STR);
try {
if(!$stmt->execute()) {
$response["error"] = $stmt->error;
return $response;
... | 1 |
a420bd237c996119ee67bc199acfbc17 | 9800ef5f16622f38702aef6cff303609 | 颜色值渲染器 | function Color() {} | 0 |
a7caf677e89c98e11ed5a306110460cb | 4340216c4d067ab5c3cc30b1f938902a | 复制目录到另一个目录 | {
try
{
if (aimPath[aimPath.Length - 1] != System.IO.Path.DirectorySeparatorChar)
{
aimPath += System.IO.Path.DirectorySeparatorChar;
}
if (!System.IO.Directory.Exists(aimPath))
{
... | 1 |
172f784068e2755246ce544b0dc07c57 | 4eaa80aca7c859ab50c553ae90ad5891 | @brief The executeUnitTest() function is global to CoreLib
This global extern "C" function can be resolved and executed
after being loaded via QLibrary. | static CmdH_Result_t CommandFunction_unittest(uint32_t argc, char** argv)
{
UNUSED_ARGUMENT(argc);
UNUSED_ARGUMENT(argv);
CmdH_SendLine("Start unittest");
UnitTestList_Run();
CmdH_SendLine("Unittest finished");
return CmdH_Result_Ok;
} | 0 |
749cbdb8c853d5c92ed4f4a1d24af5dc | 33b485c33c99b27bab5ee5d4a15ffbd0 | Returns a 0 valued LCS variable | std::string typeSig = type->typeSig();
if (typeSig == "Int") {
code->emitOp(LDC);
code->emitInt(0);
} else if (typeSig == "Nat") {
code->emitOp(LDC);
code->emitInt(0);
} else if (typeSig == "Real") {
code->emitOp(LDC);
code->emitReal(0.0);
} else {
... | 1 |
034b1d445696e11372dc161ca1c8cfe8 | 9e809a0197b82eef5558a6aac7d65211 | divides files evenly into seperate threads | text = codecs.open(f1, 'r', encoding='utf-8')
res = [];
for x in xrange(0,no_threads):
res.append([]);
count = -1;
for line in text:
count+=1;
ctn = line.encode('ascii', 'ignore');
repls = ('\n' , ''), (' ' , ''),('^', '');
txt = reduce(lambda a, kv: a.replace(*kv), repls, ctn);
txt = txt.r... | 1 |
f4c88f7a1f14556c3a35e2d87cec2c77 | 31af3fbfb9e0541fd0324414b5722818 | cookieCacheFilePath はクッキーを保存するファイルの絶対パスを返す。 | class Redis implements StorageInterface
public function getUserCookiesFilePath()
{
return null;
} | 0 |
b2d6235c7834efe5241204b9cfa2f37e | 0988daeb94e7d4dd879f3e19ffefadb2 | Initialize soft parser | {
int tokens = 256;
size_t size = 256;
jsmn_init(&s->parser);
size = sizeof(jsmntok_t) * tokens;
s->tokens = flb_malloc(size);
if (!s->tokens) {
flb_errno();
return -1;
}
s->tokens_size = tokens;
s->tokens_count = 0;
s->last_byte = 0;
s->multiple =... | 1 |
4180e8148e27a2b7b92365953cb1c74c | 5b5c25a06b9a9a61b5faefda0e2e7fe1 | https://leetcode.cn/problems/put-marbles-in-bags | pub fn diving_board(shorter: i32, longer: i32, k: i32) -> Vec<i32> {
if k == 0 { return vec![]; }
if shorter == longer { return vec![shorter * k]; }
let k = k as usize;
let mut res = vec![0; k+1];
for i in 0..=k {
res[i] = shorter * (k - i) as i32 + longer * i as i32;
}
return res;
} | 0 |
fc1a4615ccecefd217418bf01873f32b | a5af8a61af05c35f6adf54491af28de6 | 获取一个由不可见变为完全显示的透明度渐变动画 | public class AnimationUtils
public static AlphaAnimation getHiddenAlphaAnimation(long durationMillis){
return getHiddenAlphaAnimation(durationMillis, null);
} | 0 |
069fd521b784b7e6535a8bf8acb2acb0 | 9716ed8f3fd74b3eaac6d9f1d294c697 | 如果车辆空闲状态,是否关闭链接 | public class DefaultState extends NetStatus
@Override
public boolean closeAp() {
return true;
} | 1 |
6f6a3f2cae3e0f3c21a1c60343e07299 | d1abb840aa6bb5b439654860bcc12156 | Test item retrieval failure for nested containers | class Formagic_Item_Container_Test extends PHPUnit_Framework_TestCase
public function testGetItemFail()
{
$container = new Formagic_Item_Container('testContainer');
$container->getItem('n/a');
} | 0 |
b7cbc650e98336c625f333ffb75aa0f5 | e198e0abb46ba3512caf5a342f681cb7 | This UI tests ensures that the 'proceed' button is disabled by default | cy.get("#app-overlay-wrapper > div > div > div > div.modal-container__container > div > form > form > footer > button")
.should("be.disabled");
} | 1 |
694b912a0e519b1e42080c191c6d4b4a | 9e788ba2def46615dcb21a9d5830994b | 下载媒体文件 | @Service
public class GadApiTemplate extends GadClientTemplate implements GadBECBApiService,
GadChatApiService, GadJsApiAuthService, GadLoginApiService, GadScheduleApiService,
GadToDoApiService, GadWNMApiService, GadABUIApiService, GadABDIApiService,
GadTraceService, GadFileStorageService, GadDi... | 1 |
79258224cfe05dd571be73ac0ab2d00d | 38e5ca37755002bd6f3d5d6a52e7408d | Computes the function_id, instance_id and dimension_idx from the given problem_index. | ho_ = args[DOF_IDS::ho];
hf_ = args[DOF_IDS::hf];
nh_ = (unsigned int) args[DOF_IDS::nh];
dy_ = (hf_ - ho_) / (double) nh_;
uSolutionsMatrix_.resize(nl_, std::vector<double>(nh_));
} | 0 |
6152b7aa9aace8b35d968f7f764fa954 | a262585fef566c9005cfcfa61ca335ac | Move the ship of a player to a new position. | class Ship(ShipDescription):
def move(self, x, y):
self.validify()
return library.shipMove(self._ptr, x, y) | 1 |
7f04d2a3a5d7fc798d8d01cd502ab63b | ae72624a7ff753b0ec74b98e9dd9ad3c | Check if a spatial reference system is in the database. | populate_spatial_ref_sys="all"):
if populate_spatial_ref_sys in ("empty", "wgs84"):
query = "SELECT InitSpatialMetadata('%s')"
query %= populate_spatial_ref_sys.upper()
else:
query = "SELECT InitSpatialMetadata()"
return self.query_generic(query) | 0 |
7805e110eb3f2d463cbf132784bb1b84 | f8c267255aa0986409679ad4c509a817 | Setter for Nodes::_contentType property | class ContentItemModel extends ServiceModel
public function setContentType($content_type) {
$this->_content_type = $content_type;
} | 0 |
a4b280ae5f155d4c5e8fcf7350c87caf | ca1caea610beb2ac98a7a58bbbceefb5 | Define the k-point mesh for the relax calculation. | from numpy import dot
from numpy.linalg import inv
if self.relax: deformation = dot(inv(output.cell.T), input.cell.T)
for count, k in zip(self.kpoints, self.multiplicity):
if self.relax: k = dot(deformation, k)
yield count, k | 1 |
921c00dc2343ae583b6796800c518e02 | 94a9c815320f2bdfe7b81084f7a10457 | Render localized text describing the recurrence rule of an event | lo = Locale.parse(locale, sep="_")
tz = get_timezone(evt.timezone)
if evt.end:
if evt.whole_day:
return format_interval(evt.start.date(), evt.end.date(), "yMMMMd", tzinfo=tz, locale=lo)
else:
if evt.start.date() == evt.end.date():
fmt = lo.datetime_for... | 0 |
8908083fca39050b92921188771554a8 | 20c4d3b8048ded0ded0613bba7d0d89d | determine position on boundary of rectangle | int pos_rectangle(double conf[2], double pos[2], double *alpha)
{
double s, theta;
s = conf[0];
if (s<0.0) s = 0.0;
if (s>4.0*LAMBDA + 4.0) s = 4.0*LAMBDA + 4.0;
theta = conf[1];
if ((s==0)||(s==4.0*LAMBDA + 4.0))
{
pos[0] = -LAMBDA;
pos[1] = -1.0;
... | 1 |
3f6899202321355f545435eacc4d5e1d | 1bb537075819685071b025c136c6a05b | 获得一个适当的表格。如果当前不存在,会自动创建 | namespace Test
class HandleTable
private Table getTable(Document doc)
{
doc.Activate();
Selection currentSelect = testWord.Selection;
while (currentSelect.Tables.Count == 0)
{
currentSelect.GoToNext(WdGoToItem.wdGoToLine);
}
... | 0 |
5e299c4444c53ef4269eae3316d918f9 | 3cd47e41a466532c7e2aa58b6d24f700 | 设置私人聊天的列表函数 | def private(*args):
global chat
online_indexs = userlist.curselection()
online_index = online_indexs[0]
if online_index > 0:
chat = userlist.get(online_index)
if chat == '-------Group chat--------':
root.title(user_name)
return
pri_title = user_name + '-... | 0 |
2417e1c2b161d2d0b636312d739e6e38 | 86f06eaf0485f91bb91ae548415ac16d | Check a list of items with exponential falloff | dull = [0.147,
0.33,
0.474
][0] ):
m, n = len(lst1), len(lst2)
lst2 = sorted(lst2)
j = more = less = 0
for repeats, x in runs(sorted(lst1)):
while j <= (n - 1) and lst2[j] < x:
j += 1
... | 0 |
0bb2c24603fa948c2a3fd0f0ba3bab82 | 0458cdcd0800a6f0a7afa28ffaa24563 | метод для получения названия строительного материала | {
$query = "SELECT * FROM spr_zd_material WHERE id='" . (int) $material_id .
"'";
$res = $db->query($query);
$material_kolvo = $res->num_rows;
$ar = $res->fetch_assoc();
if ($material_kolvo == '1') {
return $ar['title'];
} else {
return "[Неизвестный материал]";
... | 1 |
afcd6387531757484ef1cea99cedd57d | 4b4d8e1823356cd715e2cb442a76a34d | PMTから字幕パケットのPIDを返す | public abstract class MpegtsPacket extends MediaPacket
protected boolean analizePmt(ByteBuffer buffer) {
int position = buffer.position();
buffer.position(position + 5);
if(!analizeHeader(buffer, (byte)0x02)) {
buffer.position(position);
throw new RuntimeException("ヘッダ部の読み込み時に不正なデータを検出しました。");
}
int da... | 0 |
ef5cd7c3280fa89f197e6f2f3a2578eb | 8f52dd9e0845afc532027f50ab278e0b | Hash an entire subtree recursively, returning an Output object. | tree_entries = []
tree_to_process = {'.': []}
indexEntries = read_index()
for entry in indexEntries:
splitted_path = entry.path.split('/')
filename = splitted_path.pop()
if len(splitted_path) == 0:
tree_to_process['.'].append(entry)
else:
previous ... | 1 |
82be18ef750393ed91916cfd87ceaeac | 83ee0e2ff8893835db60a8748093e70b | Destroy an existing stickybits instance | class Instance extends StaticRepository
public static function destroy($mix_instance, &$error = NULL) {
return repository('instance')->destroy($mix_instance);
} | 1 |
46420b3e7097c89f7dd4d525469fa7b3 | 9cce4ae1cca6b8473177f46b9537490a | Lists all Historial models. | class HistorialController extends Controller
public function index()
{
$historial = historial::with('user')->orderBy('updated_at','desc')->get();
return response()->json($historial, 200);
} | 1 |
a8f40e30aa84e60a499b6abec2172549 | ccc6e793db5a91dafccd77be34de0b3f | Function for extracting images from
html source. This function will look
through the html code supplied by setHTML()
and find any file that ends in one of the
extensions defined in $obj->image_types.
If the file exists it will read it in and
embed it, (not an attachment). | class image
public function __construct($image, $source = 'upload', $dir = false) {
$this->imageFile = false;
$this->image = false;
switch ($source) {
case 'param':
if (array_key_exists($image['type'], $this->imageTypes)) {
$this->imageFile = $image;
$size = getimagesize($this->imageFile['... | 0 |
a186647052f75be65b93a72fb6fd35f2 | f58079fb4722e11ed7e4c8d9e4fd8123 | Sets the value of the {@link AppointmentForm#validProperty()}. | boolean validValue = true;
editorValue = value;
switch (currentProperty.getDataType()) {
case NUMERIC:
validValue = ApplicationUtilities.isNumric(value);
break;
case EMAIL:
validValue = ApplicationUtilities.isEmailAddress(value);
break;
case MAIL_LIST:
validValue = ApplicationUtilities.isEmai... | 0 |
2b6b747dc7fad52ecb352d3b2738c5b1 | e4913a2be4695ccd4c3f3d5a6b4cb09d | Have the player begin walking either left or right. | if(allowWalk == true) {
if (EZInteraction.isKeyDown('a')) {
moveLeft(2);
} else if (EZInteraction.isKeyDown('d')) {
moveRight(2);
}
}
} | 1 |
b1eb7d86a62a4f35c99c02b2a60fa685 | c090806363ff36bbaa4270ffe6e2cdde | Return the uncertainty. | class NDUncertainty(object):
def unit(self): | 0 |
e10c3ca70b23eb6c28c9b45042a46af2 | 1b34882bd11fd719a15feddf91247ff2 | Apply the histogram equalization in a neighbourhood of each voxel. | class Equalise(HistogramFilter):
def __init__(self):
super().__init__(3, name='histogram-equalise') | 0 |
3c79a8db788a0558809f55740a28cceb | 1ed431e6ae04c239e6fed0782977149e | Initialize a GatewayAuthenticationKey object from a json dictionary. | class Key(DataStructure):
def fromDict(self, inDict):
keyDict = inDict.get(DataFields.Key, None)
if keyDict is None:
inDictlooksLikeAKeyDict = False
for attribute in self._attributes:
if attribute in inDict:
inDictlooksLikeAKeyDict = True
... | 1 |
f96b28d60847eae70fd5cbaa1158f1bc | c95ec582a5fe119758c511785947c90a | Removes element from the front of list | public T removeFromFront(); | 1 |
90dc37737e58df54cfb8b953a63f0111 | 01133660971ed27be7450588381a019e | update the edge data. does not draw lines. | public class BasicNetworkEditEventHandler extends NetworkEditEventAdapter implements ActionListener, org.cytoscape.attributes.MultiHashMapListener //TODO: dont need MultiHashMapListener
public void updateEdge() {
double x1 = startPoint.getX();
double y1 = startPoint.getY();
double x2 = nextPoint.getX();
double ... | 0 |
fccc25a9a4626034f7ace9e85173c79d | 18e9b7edf54243db90726accdfe7b2a5 | 获取主线关卡进度 | $globalInfo = globalInfo();
$curHatchInfo = $this->getCurHatchInfo();
if (empty($curHatchInfo)) {
return 0;
}
$progressKey = $this->getProgressKey($curHatchInfo['name'], $globalInfo->getUuid());
$curProcess = bean('redis')->get($progressKey);
if (isset... | 1 |
e7fd6d292c2bf58e150809cf5e8a2a19 | f3cbfd26d6f035736d53c65cb67f418d | 将itemModel核心模型转换成ItemDO数据对象 | @Service
public class OrderServiceImpl implements OrderService
private OrderDO covertFromOrderModel(OrderModel orderModel){
if(orderModel==null){
return null;
}
OrderDO orderDO=new OrderDO();
BeanUtils.copyProperties(orderModel,orderDO);
orderDO.setItemPrice(new Doubl... | 0 |
64ac0f7ccdec7df600f74c4970851f1a | 41a4ea87a12fa8a2d8e8c17059228ed0 | Deletes a limit bandwidth rule for a QoS policy.
For full list of available parameters, please refer to the official
API reference:
https://docs.openstack.org/api-ref/network/v2/index.html#delete-bandwidth-limit-rule | class OmsAsyncClient(Client):
def update_bandwidth_policy_async(self, request):
return self._update_bandwidth_policy_with_http_info(request) | 0 |
a752e223ad84a1630a5b9eb69fb15c90 | d2d0c7c5cf784891292ce834a3f908c5 | Quickly generates a fake site url. | string generateRandomUrl() {
int randomLength = rand() % 10 + 3;
string link;
link.append("www.");
for (int i = 0; i < randomLength; i++){
link.push_back(genRandomAlphabet());
}
link.append(".com");
return link;
} | 1 |
ea35c4b49c97096b166b48c9dde8d37a | a90994a7e8d951ad1545c4ca51db2766 | Abstract method to be overriden and defined by an inherriting class.
Used to launch the application under test. | abstract class TestCaseSeleniumAbstract extends PHPUnit_Extensions_Selenium2TestCase
abstract public function createApplication(); | 1 |
871a0c8fa3774a93ef757b69d9049a09 | effb7ff1087d65a1cb203fa67ea41da0 | 检测是否跨域 | function isCrossDomain(url) {
var here = parseURL(window.location.href);
var target = parseURL(url);
return target.hostname !== here.hostname
|| target.port !== here.port
|| target.protocol !== here.protocol;
} | 1 |
67f43d64cf9c20517b864a8321e28ba4 | 993556cf52a126ab86ec9ee9685ef426 | Safe call due to opt-in of one annotation and propagation of another. | lint().files(
kotlin(
"""
package androidx.fragment.app
open class FragmentActivity {
}
"""
).indented(),
kotlin(
"""
package androidx.appcompat.app
... | 0 |
b6b608182a0ff4b6f1ba5b4efe0fd50c | 54aaf38e49b1eeb08c79ad3faac6ad7a | This method notifies to the observers that a player can do another worker move | public class Game extends Observable
public void toPlaceWorker() {
notifyTimeToPlaceWorker(getCurrentTurn().getCurrentPlayer().getNickname());
} | 1 |
e530901e24f229b9a58d8aa6c6086bb5 | ff8c761f985561744e0c81ce14a95ed3 | Gets the "sdkmessageid" element | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DeleteBatchProductRequestType", propOrder = {
"action",
"messageId",
"originalMessageId",
"uploaderAccount",
"serviceDate",
"schoolId"
})
@XmlRootElement(name="DeleteBatchProductRequestType")
public class DeleteBatchProductReques... | 0 |
56c4fe5eafd187d419c86f5cd9ac4c72 | d5ca8d25ba3251e54eb128d8981b720b | Write data to the buffer of I2C slave device. | {
__IO uint32_t temp = 0;
__IO uint32_t Timeout = 0;
Timeout = 0xFFFF;
I2Cx->CR1 |= CR1_START_Set;
while ((I2Cx->SR1&0x0001) != 0x0001)
{
if (Timeout-- == 0)
return 1;
}
SlaveAddress &= OAR1_ADD0_Reset;
I2Cx->DR = SlaveAddress;
Timeout = 0xFFFF;
while ((I2Cx->SR1 &0x0002) != 0x0002)
{
if (Timeout... | 1 |
749e5b078c65625387871c5f8b023c9f | b1806de450fa829245dc6c44ff6ff7ed | 取消单个优惠券的sku | $result = parent::delete(array('pid' => $pid, 'sku' => $sku, 'order_type' => $order_type));
return $result;
} | 1 |
038f608705ac4bf8c686a1378b7916a2 | 4982d9cab46d886194374015818010e5 | バネの変化量(初期位置からのずれ)を設定する。 | void hhPhysics_Delta::SetDelta( const idVec3 &d ){
delta = d;
if ( delta != vec3_origin ) {
Activate();
}
} | 1 |
c4987ecd1e13bb10353a609b8527cafe | 9e829e3bb857b39aa97803114dff0a84 | Reads in the ln(evidence) and uncertainty for a run multinest chain. | def load_multiple_emcee_runs(file_prefix, file_run_list, file_suffix, nBurn=0, dSteps=1, flatten=False):
chainarray = np.array([mu.flatten_emcee_chain(np.load(file_prefix + run + file_suffix), nBurn=nBurn, dSteps=dSteps) for run in file_run_list])
print('r = ', gelman_rubin(chainarray))
if flatten is False:... | 0 |
7fa655f832182b920f4af75dfe9c6847 | 74b2a5261d9bfa6d83efd81d747867a3 | Funcion que busca la informacion de una caracteristica que esta relacionada a un producto | class OS_Features extends OS_Common
public function get_feature_product($id_feature, $id_product)
{
try {
$f_product = $this->select("feature_product", array("*"), "WHERE id_product=$id_product AND id_feature=$id_feature");
return $f_product;
} catch (Exception $e) {
$this->get_exception_err... | 1 |
74eaed46668620cd188a8663047e1f45 | 2c16ed03755464f0b243d2209b3d32bc | the reduction of the HP of the enemy tank and the destruction of the tank when the HP is equal to zero | public class TankDamage : MonoBehaviour
IEnumerator ExplosionTank()
{
Object effect = GameObject.Instantiate(expEffect,
transform.position, Quaternion.identity);
Destroy(effect, 3.0f);
hudCanvas.enabled = false;
SetTankVisible(false);
yield return new WaitForSecon... | 0 |
92d9cbeca24f6e35af573e9920efdfb6 | 9375318efe25febfe734728bcfc95498 | Sends a request and arranges for handler to be called with the
response when it comes in.
A call to request_timeout_check() will result in pending
responses that have been waiting more than timeout seconds to
call the handler with a REQUEST_TIMEOUT error. | class ClientHandler(object):
def request(self, msg, callback=None):
self.reroute.append((msg, callback))
self.stream.write(msg) | 1 |
7afd7d4e660b7e4f342e05a575addea0 | 0d0adf8756ea3320d5735fcccf05c75c | Generate n rows of random 24-hour times (seconds past midnight) | years_splits=(2010, 2014, 2015, 2016), seed=987, **kwargs):
random.seed(seed)
resulting_splits = []
for i in range(len(years_splits) - 1):
year_start = date(years_splits[i], 1, 1)
year_end = date(years_splits[i + 1], 1, 1)
current_samples = []
for current_day in date_... | 0 |
e96e9790d189dc430ff40f51d3ea9bfa | 30a0bd4a741f2bedd973bb9f17e56838 | 获取活跃门店 | $model = new ActiveGoods;
$criteria = new CDbCriteria();
$criteria->order = 'id ASC';
$count = StoreActive::model()->count($criteria);
$pager = new CPagination($count);
$pager->pageSize = 30;
$pager->applyLimit($criteria);
$data = StoreActive::model()->fin... | 1 |
5e440c3eeecf051412f4011d21508801 | 9d6f8e1c299c0a3b9af66faa87815609 | ! \brief Pair with a device where the address is already known. | Device* pDevice)
:
m_pDevice(pDevice),
m_DynamicDataSupport(false)
{
memset(m_addresses, 0, sizeof(m_addresses));
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.