query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
c38f7bdb0fe042d6de05e8792732dcb9 | dd4a698d731b3c051b40fb66fb50be4c | # 1st Step - Outlier Detection
# outliers' condition: those points that are >= 1.5IQR+UQ or <= LQ-1.5IQR. | quantiles <- quantile(v,probs=c(0.25,0.75))
IQR <- quantiles[2]-quantiles[1]
res <- v < (quantiles[1]-coef*IQR)|v > (quantiles[2]+coef*IQR)
return(res)
} | 1 |
aeaac4c95bf99227ed29285908410422 | 9740c6627033f9b98a5d48e9427297fd | Single time-step of the PID algorithm.
Errors are stored in a circular buffer after calculating current-time-step PID components. | double temp_c = 0.0;
switch (eval_state) {
case start:
temp_c = dp[pid_param];
eval_state = positive_eval;
break;
case positive_eval:
if (total_err < best_err) {
dp[pid_param] *= 1.1;
... | 0 |
be0481644b19c5450154dcbd4e90eec7 | 4057fc3d44ddddbb3c1fd61c9bf383bb | @brief WSS insertion enable (TRUE : enable, FALSE : disable) | VO_OSMP_RETURN_CODE enableSEI(VO_OSMP_SEI_INFO_FLAG flag); | 0 |
fa2dc3eee4b80a5aa1760e3674736534 | b99eb00194cb64b70673c878a73cfd20 | Loads all CSS bundles that can be rendered on the current page.
This will include all "default" bundles and any with an ``apply_to``
containing a URL name matching the current page. | {
global $pagenow;
if (
(isset($_GET['page']) && $_GET['page'] == $this->_page_slug)
|| (!isset($_GET['page']) && strpos($pagenow, 'options-') === 0)
) {
ICF_Loader::register_css();
}
} | 0 |
6a2567a1b1974e4a109c2f2a5041cded | 86a889ddf815923e61eea3b504c00360 | Aplica campo como obrigatorio | class HTMLInputElementBuilder extends it.uniroma1.FabbricaSemanticaJSweet.HTMLElementsBuilders.HTMLElementBuilder
isRequired() {
this.inputElement.required = true;
return this;
} | 1 |
f1c66b20cb1be9d7e3ab1742036f1681 | 6ddf79ea3c5fafda471dc72aabf376d6 | Checks if inputs to Factor for Unconditioned Vars is Handled Properly | argc = 1
goal = 'f'
premise = 'b'
ctx, targets = list(), list()
args = r_consts(argc)
ctx.append([(premise, args)])
targets.append(((goal, args), 1))
args = args.copy()
args[R.randrange(len(args))] = r_consts(1, args)[0]
preds = r_preds(3)
ctx.append([(preds[0], args)])
targets.append(((goal, ar... | 0 |
5bf440b3975134482bc96a4e5f2b12c5 | 15b4cd63936eed80547c90854c42cd72 | Returns the meta object for the container reference '{@link uml.packages.PackageMerge#getReceivingPackage <em>Receiving Package</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getReceive_Message(); | 0 |
4cfa7280dc2fcee371829b37314bb38d | 767659f5c26569e16b0e6c47c9917566 | Get the list of blocks to require. | class ConditionalBlock(
SequenceMixin,
MakoTemplateBlockBase,
XmlMixin,
XModuleDescriptorToXBlockMixin,
XModuleToXBlockMixin,
HTMLSnippet,
ResourceTemplates,
XModuleMixin,
StudioEditableBlock,
):
def get_required_blocks(self):
return [self.system.get_module(descriptor) for de... | 1 |
6de93f92655cad74941601311a708e93 | 638077946e772ff430248ee220f4d3cc | Draw static objects in the Matplotlib view.
Static objects are:
- a cylinder for each anchor
- three axes representing the "data" reference frame
- ground plane | sh = self._sh
_offset = 30.
_c = np.array([[sl[2], sl[1]], [sl[2], sl[0]], [sl[1], sl[0]]])
_c = np.c_[_c, [_offset] * 3]
_l = np.array([[0, sl[1]], [sh[2], sl[1]], [sl[2], 0], [sl[2], sh[1]],
[0, sl[0]], [sh[2], sl[0]], [sl[2], 0], [sl[2], sh[0]],
... | 0 |
1d6e609aa6c35428b2334a0078acc181 | 25c575fd9f42bb39297b0536b0d2f5d3 | Read lines to list of Pairs, reversing line parsing. | def parser(reader):
return (map(str, line.split("\"")) for line in reader) | 0 |
caa21e00eff590f18b1c6db319891204 | 23023c5244f4672530b32adbf1cc4ae7 | Multiplies the current fraction object context by fraction object | Fractions operator*=(Fractions& lhs, const Fractions& rhs) {
return lhs = *(new Fractions(lhs.numerator*rhs.numerator,
lhs.denominator*rhs.denominator));
} | 1 |
fd065317ad2db5bae8d3170846450bed | fd028a37a1b43dabf6181d7dd85cb05a | 设置默认网络组的无线过滤的黑名单 | class NGBusiness(NGControl):
def get_groupn_wifi_whitelist(self,n):
NGBusiness.NG_edit_groupn_wifi_menu(self,n)
NGControl.set_mac_filter(self,'Whitelist')
NGControl.wifi_pagedown1(self)
result = NGControl.get_white_mac_info(self)
NGControl.add_NG_close(self)
return result | 0 |
13f4caf5339a064b42dc1650ee21d193 | 4b6d6c0cf19e6b44cd1f258c643b65f2 | Similar to getInstance in Singleton paradigm in other languages | public class MySingletonClass
public static MySingletonClass getInstance() {
if (instance == null)
instance = new MySingletonClass();
return instance;
} | 1 |
ab7856a574b05a3bf3ecadcdf3b8bbab | e975ae0e839c6bfa36b256806e87354d | Метод проверки токена пользователя в социальной сети | try:
r = requests.get(fb_url)
r = r.json()
for att, val in r.iteritems():
if user['screen_name'] == att:
return True
return False
except KeyboardInterrupt:
sys.exit("KeyboardInterrupt")
except Exception as e:
print(e)
pass | 0 |
2f2d11f5ae4a7d0ccf8a253bd817f195 | 55bf78ac794f7200c8373e89cf1e1c03 | modifying recursive depth-first-search slightly to make it a topological sort | void Graph::topological_sort_helper(int u, std::vector<bool> &visited,
std::vector<int> &tp_sorted_list)
{
int u_idx = get_idx(u);
int v_idx = 0;
int v = 0;
visited[u_idx] = true;
for(auto it = adj_list[u_idx].begin(); it != adj_list[u_idx].end(); it++)
{
v = it->node_id;
v_idx = get_... | 1 |
b6d013737a7e9034fbe85afdfc0ce39d | 33199dda9802d62086b8a8b760eba07e | Return JSON response of get_user from the osu! API with the given username. | try:
response = requests.get(github_api_url + 'users/' + username)
response.raise_for_status()
return json.loads(response.content)
except RequestException as e:
raise e | 0 |
15edbd5c77c3f83d7553106f44f7c80f | a1cb9c6e2ddc472a90d57807a902bbbf | get last player kill status, used for calculate winners | {
*ret = VALID_PLAYER(0) ? (ARG_MOB(0)->cpk_deaths+ARG_MOB(0)->cpk_kills) : 0;
return TRUE;
} | 0 |
ba9fa1e88164c1d5aa263e6c09f56b27 | d6b0c34cfa40958ed7c9712b234f492e | Compute a safe stripe size | inline BOOL CPixel::ComputeSurfaceStrideChecked(UINT cpWidth, UINT cbPixel, UINT *pStride)
{
UINT64 u64Stride = (UINT64)cpWidth * (UINT64)cbPixel;
u64Stride = (u64Stride + 3) & ~3;
if (u64Stride <= MAXALLOCSIZE)
{
*pStride = (UINT)u64Stride;
return TRUE;
}
return FALSE;
} | 1 |
a406156c2c06971527572a27c712f96e | 470541056cd9c776235ecd97472b0660 | Update the default threshold, usually * with the maximum of the variables of all
the timesteps | class CoDiR_model(ABC, torch.nn.Module):
#Abstract class that should be implemented (for an example, see CoDiR_image.py)
def update_cur_threshes(self):
TP = self.scores_during_training["TP"]
FP = self.scores_during_training["FP"]
FN = self.scores_during_training["FN"]
th_s = self.thr... | 1 |
2b38dce54f4da7c49f809615b9b3d3f2 | c820c073294338e64b5f59a5452413b7 | 返回住院visit_ID号. | @Table(name = "clc_visit")
public class Visit
public String getRegistrationId() {
return registrationId;
} | 0 |
c7f272003616217bb30705ab95c0c7bf | 4efe1a0581df5d3c673f7f6cdcecaf82 | Set the file descriptor from the file handle | {
jobject fdobj = (*env)->GetObjectField(env, obj, td_fdID);
(*env)->SetIntField(env, fdobj, IO_fd_fdID, (jint) fd);
} | 1 |
c76d6551a37e53963aab3d71f208d71c | 5c3cd08d619ac77a7c443ff5c5ce3533 | Set the menu scene to the specified location. | void BattleMenu::SetMenuLocation(int X, int Y)
{
mCurrentShipLocationX = X + 64;
mCurrentShipLocationY = Y;
mMenuCursor.XCoordinate = X + 64;
mMenuCursor.YCoordinate = Y;
} | 1 |
83a4018ff2ea60c8dbb39ba1fe4f8c03 | 864de0ab7dcfb3ee46366ca6a83bbaae | =============================================================================
DESCRIPTION
This function initializes the pimutex that will be used for protecting
the crit-section portion of time code.
DEPENDENCIES
This function is applicable only for qurt.
RETURN VALUE
None
SIDE EFFECTS
None
============================... | {
#ifdef _NWCP_WIN32
InitializeCriticalSection(mutex);
#else
if(pthread_mutex_init(mutex, NULL))
return CPDL_ERROR;
#endif
return CPDL_SUCCESS;
} | 0 |
27af8ce9a1190c1ded83e0fc073a854e | 5cbea24486ea357cd945b1ecaf608d39 | # change covariate values and see the number of deaths | testCovariatesDtype3 <- function(...)
testCovariates(shinyInput = shinyInput,
data = das3, modelAns = c(1, 14, 13, 15, 23, 25),
doPrint = doPrint, track = track, ...) | 0 |
4a56791b70770b1c1d0cccad20699dee | e2f19a8cd5cfc34423621793cd46fdd5 | Returns whether the stroke will be dashed. | class StrokePanel extends JPanel
public void setDash(boolean d)
{
dash = d;
repaint();
} | 0 |
e2720e1a3fcc95064ba3390519b89a4b | 365cfe2a6815e0264d046fc13b6f273e | Gets the lftipofisccli dac. | public class LfitvendaBCFImpl extends AbstractBaseBCF implements ILfitvendaBCF
public ILfitvendaBCL getLfitvendaBCL()
{
return this.lfitvendaBCL;
} | 0 |
eb85ab882a155bdce69fabed23fd0dc8 | 47dabf32a6fd117e8ddbef16ec78df2b | 向DS1302读一字节数据 | {
i2c_start(DS1307_ADDR + I2C_WRITE);
i2c_write(address);
i2c_start(DS1307_ADDR + I2C_READ);
*data=i2c_readNak();
i2c_stop();
_delay_ms(5);
} | 0 |
afe443640f31f2539b46d49498e91e8d | 7325723fae230b49491945d0a679c246 | Opens (or reopens) the "debug selected" port and listen for connections. | {
_threadEnabled = true;
th = new Thread(() => ListenPort(_port, commands, headers));
th.Start();
} | 1 |
e4889a267f31c12d8228f510ca02405d | 69dc7e1fd190d74806815d5cc5720cf5 | ============================================================
Mark a book as not available, so it is unlisted in the shelves. | namespace WebApplication3
public partial class Catalog : System.Web.UI.Page
protected void False_Available(int id)
{
using (SqlConnection cn = new SqlConnection(ConnectionString))
{
cn.Open();
string query = "update books set available=0 where book_id=... | 1 |
3041d25436f9011b40d4f021d91685e7 | eede0208f98cd8c2e9dd485c00c13bdd | Finds the back text of the FlashCard that is being edited | try {
return slide.getPlaceholder(TextBoxIndex).getText();
} catch (Exception e) {
return null;
}
} | 0 |
957bd220fefbcb3a0857a330ca01f744 | b81455b78d55f7fd3f3ba7a5bbececa4 | Считывает студента с указанными параметрами и добавляет в группу. | namespace Velvetech.TestTask.Web.Services.Interfaces
Task AddStudentInGroup(Guid groupId, Guid studentId); | 1 |
a17a9c11dd99a592f5795a4e69b841ee | c173b154c2ef652cf6aa7234e37d5cde | Returns a quaternion for the rotation implied by the window's cursor position | static Quat arcballRotation(const int x, const int y){
const double dx = x - g_mouseClickX;
const double dy = g_windowHeight - y - 1 - g_mouseClickY;
RigTForm eyeRbt = getPathAccumRbt(g_world, g_eyeFrameNode);
RigTForm arcballRbt = makeArcballRbt();
RigTForm invEyeRbt = inv(eyeRbt);
Cvec2 arcballScreenCente... | 1 |
c56f4683d25987e9d861ebea80cb7404 | 2ebbde5a9899ef23e7ee87a4f80e3d8f | Creates a temporary service key for particular service instance to
retrieve credentials data from. | void createUserProvidedServiceInstance(CloudServiceInstance serviceInstance, Map<String, Object> credentials); | 0 |
b1117c01d67712403231bb7523acf787 | d337892ef77bd87c70e9123ee39365b6 | Add user to Image launch permission | def share_img(img_id, acct_id):
__checkCon()
img_id = __image_id(img_id)
econ.modify_image_attribute(img_id, attribute='launchPermission', operation='add', user_ids=[acct_id])
print 'Done' | 1 |
7eb26b160b56b3e2a4e3278116b1808d | e08b35ce29822f442dc296603cdd8271 | Gets the column width based on the visual column index. | public class Setting
public static int getColumnWidth(int idx) {
return columnsWidths.get(idx);
} | 1 |
ef04b38137d9d548cc7ede06c3f5a8ef | e6540ce99ecee775c7860142d672f890 | 获取类的属性,加工后输出 | public class MainActivity extends AppCompatActivity
private void getMethod() {
Method[] ms = reflectClass.getMethods();
StringBuffer sb = new StringBuffer();
sb.append(Modifier.toString(reflectClass.getModifiers()) + " class " +
reflectClass.getSimpleName() +"{\n");
for(M... | 0 |
6e569c5999e084502186951c9a3af527 | 0aac4a2079d4e2e9e56e4d0dd9dcf7a9 | 根据父节点,查询所有子孙的节点 | List<EasyUINode> findSubTreeByParent(Integer parentId); | 1 |
306235af399348cf9862b0402ffca0fd | 941ce2bfcb94b3135448cc73993df963 | Handles when the Session Start background worker is completed. | {
if (IsLiveSession && IsLiveSessionSuspended)
{
IsLiveSessionSuspended = false;
StartLiveSession();
}
} | 0 |
7c407c95774e81236d3cf889e145be50 | c2e2fd8b36dac5efb1767534ffada235 | Metod som räknar ut medianlön | class Payment extends Controller
private function median(array $array)
{
if (count($array) === 0)
{
return 0;
}
sort($array);
if (count($array) / 2 === 0)
{
return ($array[(count($array) / 2) - 1] + $array[(count($array) / 2)]) / 2;
}
else
{
return $array[floor(count($array) / 2)];
}
ret... | 1 |
cad2fddab7299e6847579bdb32771310 | 5fec103dd8af371f324c8e7e151e124a | 添加翻译按钮、区域以及绑定点击事件 | function addTransliterationOption()
{
var len = arguments.length;
for(var i=0;i<len; i++)
{
var element = document.getElementById(arguments[i]);
if(element)
{
var checkbox = document.createElement('input');
checkbox.id = arguments[i]+'cb';
checkbox... | 0 |
f76331e7f6d7f0e6c2beb40b571b8f66 | 1e6d7a6421a367ba07e5ab35aaee68a7 | Tries to deselect the linked possibility on this objective. This should be called by the
linked possibility.
The possibility must have already been selected. | public void deselect(L g); | 1 |
294780280f4c0b91b50f80c05f16656f | 923e4ca03e40dd42c00854bb99421067 | 读取字典里面的值(并转换为字符串) | public String getString() {
IDict dict = DictManager.createDict();
return dict.getValue(this.getClass().getSimpleName(), this.ordinal());
} | 1 |
5e7704fb69e5e38703e7283f5e67a2f6 | 08d317da0d3f3f66a8fff7bb16f4d9ab | As loop1, but uses numpy to be faster. | class events2IQE_TestCase(TestCase):
def test1(self):
import arcseventdata.arcseventdata as aa
events = aa.readevents( "events.dat", 10 )
import numpy
I = numpy.zeros( 100, 'i' )
Ei = 60.
pixelPositions = aa.readpixelpositions( 'pixelID2position.bin' )
aa.events2I... | 1 |
5e62aff4a8573a41d8c092d3f1f2a4e3 | 134e212659876f343745785e3b2224d5 | Loads the named selection and returns it as a list of strings | def loadFile(name):
directory = os.getcwd()
filepath = directory + "/" + name
data = open(filepath,'r').readlines()
result = []
for d in data:
d = str(urllib.parse.unquote(d))
result.append(d)
return result | 1 |
ced7b64798282652324c8ee63f3fec6a | c1eb87ba438648afdbf842588b61431e | a pseudo-case is selected if all of its individual cases are selected | namespace HtmlToFlowDocument
public class ElementRules
private static bool IsSelected(CompoundSelector compoundSelector, string elementName, string elementId, string[] elementClasses, IReadOnlyList<(XmlElement xmlElement, Dictionary<string, object> elementProperties)> elementHierarchy, ref bool isPseudo)
{
... | 1 |
1596c89fa95d7df4680d35a7c25545ea | 03f6fb5904eb6408793b447368e55539 | Replaces a range of elements from a source array and copies the new data in another array | public static class ArrayExtensions
public static T[] Splice<T>(this T[] source, long start, long? number = null)
{
var len = source.Length;
var c = len - start;
if (number.HasValue)
c = number.Value;
T[] result = new T[c];
while (c > 0)
{
resu... | 0 |
d830ddcebe83504fd92cbddcd2bd9e09 | 818c80fbf9c49336c49ffb6f90cb4d5d | Identification of the modal constants using the Least-Squares Frequency Domain method. | def system_identification1():
np.random.seed(2718)
N = 5000
mu = .02
p = 2
b = [1.]
a = [1, -0.1, -0.8, 0.2]
sv2 = .25
v = gaussian.rvs(size = N, scale = math.sqrt(sv2))
d = lfilter(b, a, v)
F = LMS(mu = mu, p = p)
ff_fb = system_identification_setup(F)
w = np.array([ff_fb(di) for di in d... | 0 |
642ed76c4e75d92d3e30451b16973d55 | 2a64c34baa37cb7c715031ca09236490 | Remove node at the tail of the Doubly Linked List. | if self.size() == 0:
print("List Empty")
elif self.sz == 1:
self.head = self.tail = None
self.sz = 0
else:
delete_node = self.tail
self.tail = self.tail.prev
self.tail.next = None
delete_node.prev = None
... | 1 |
6c1653f598e16cb6e5280a0f082c4cbb | f53dab7903e6429dfdeda9bd7e760165 | Take three bytes in and put out four bytes (usually). | class Encrypt(object):
def three_to_four(self, b0, b1, b2):
bb0 = b0 >> 2 & 0x3f
bb1 = (b0 << 4 & 0x30) + (b1 >> 4 & 0xf)
bb2 = (b1 << 2 & 0x3c) + (b2 >> 6 & 0x3)
bb3 = b2 & 0x3f
return [
self.char_table[bb0],
self.char_table[bb1],
self.char_ta... | 1 |
f04f068b93c307e4d786a43877f9b04d | 6b89d0ff9df7b7fe149f9d52071c1f7c | Takes a string, ie 'created_at_desc' and returns [ :created_at, :desc ]. | data.strip!
space = data.index(" ")
if space
cmd = data[0, space]
param = data[space+1, data.length - space]
param = nil if param.strip.size == 0
else
cmd = data
param = nil
end
[cmd.downcase, param]
end | 0 |
5250bf41b34fa170abcea0079869858e | f999bac47c33c3e156e25601837fafb1 | Возвращает сумму расходов на запчасти за Месяц | class CInvestToCarRepairParts
public function GetTotalRepairPartsCosts ($car=0) {
global $DB,$OPTIONS;
if ($car==0) $car = CInvestToCarCars::GetDefaultCar();
$query = "SELECT SUM(`cost`) FROM `".CInvestToCarMain::GetTableByCode("repairparts")."` WHERE `auto` =".$car." AND `who_paid` =".$OPTIONS->GetOptionInt("... | 0 |
7a19f199c5b36481bd0e7fbef95e573f | fd5a697b3fa0a6305613c586d9527f41 | Add extra functionality (via DT Api) to the DataTable instance
based on his table element attributes. | angular.element($window).on('draw.dt', function () {
var elements = [
'dataTable',
'dataTables_paginate',
'dataTables_info',
'dataTables_length',
'dataTables_filter',
'data... | 0 |
13b394dae9d1644dc5bbe8a0d183a83c | 76f43ff31b9a48e3ca71c1297fd1f0ef | Exit a parse tree produced by CSharp4Parser#additive_expression. | public class ECMAScriptBaseListener implements ECMAScriptListener
@Override
public void exitAdditiveExpression(ECMAScriptParser.AdditiveExpressionContext ctx) {} | 0 |
b15dbd511b26db0644c6236dd62bbb2a | d9424353120c3d83b0cdcc27144fe8f3 | 输入读取,无需回车 | int input()
{
inputchar();
if(ch=='\b'){
if(y>8&&y<79){
y--;
cal_pos();
printchar(' ');
y--;
cal_pos();
}
return 0;
}
else if(ch==13);
else printchar(ch);
return 1;
} | 1 |
e6210e28bfda8979f7595b07fde99450 | 33ce0b1a3522950dc43b04e7624e2630 | 筛选仓库类型 1 为销售,2为供应 | if (isset($request['do']) && $request['do'] == 1) {
$response = loadModel('ptsp_model', 'goods')->set_ty($request);
exit_json_response($response);
}
} | 0 |
9e8c8b0652479e7c85e6f7a3e522917b | a2aa5d57fa6448aa38a9334a7b74de61 | sgd momentum, uses nesterov update (reference: http://cs231n.github.io/neural-networks-3/#sgd) | beta1=0.9, beta2=0.999, epsilon=10e-8):
self.t += 1
self.m = beta1 * self.m + (1 - beta1) * gradient
self.v = beta2 * self.v + (1 - beta2) * gradient ** 2
bias_correction_1 = 1 - beta1 ** self.t
bias_correction_2 = 1 - beta2 ** self.t
m_hat = self.m / bia... | 0 |
a06b6b6377e08d596b9e1505d7e771df | ec677a74455561c26b87b416c15cdfae | シリアライズする際にパスワードを返さないように
パスワードを返したい場合にはnoSafe()を用いる | const { password, createdAt, updatedAt, ...rest } = this.get();
return rest;
} | 1 |
dd128252e732d44831a2dfb8d2c03d58 | 6713eb734538302c7b3cbc9e05f93f84 | @brief Upgrade Sector0 with data sent by master | {
int data_id;
if (m_drv[m_unit].seclen < 64)
memset(m_buf+(m_drv[m_unit].seclen<<1), 0, (64-m_drv[m_unit].seclen)<<1);
if (!find_sector(m_unit, m_head, m_sector, &data_id))
{
m_stat_reg |= status_ID_not_found;
return;
}
m_drv[m_unit].img->floppy_drive_write_sector_data(m_head, data_id, m_buf, 128, m_ddam);... | 1 |
e09dff69d04e0fa348376e0ce604a6c6 | 084764f47aaece5a7a4240f8ff3b51cc | 填单元格内容 | namespace Ipms.Website.Service.WordHelpers
public class WordCOMHelper
public void FillCellContent(int rowIndex, int columnIndex, string content)
{
_WordTable.Cell(rowIndex, columnIndex).Range.Text = content;
} | 1 |
974e9c1acfbec5ae598fde4893ea4d85 | bfcf05fdfbac11b618e5b1ba64a5fa15 | 将键盘的高度存储在sharedPreference | public class MainActivity extends AppCompatActivity implements View.OnClickListener
private void saveSharedPreferencesHeight(){
SharedPreferences.Editor editor = sharedPreferences.edit();
editor.putInt(heightKey, keyboardHeight);
editor.commit();
} | 1 |
d0f372c78379b7d1c798ec9d935d8093 | 514b66be7ae3ca513e2663736da11ea4 | Returns the value of the attribute with the specified namespace and name or null if no attribute exists. | {
if ($n = $this->getAttributeNodeNS($namespace_uri, $localname)) {
return $n->getValue();
}
return '';
} | 0 |
2016c06e7fdfc0b821038a843059d818 | 0b1f1dd845630cc4e80468103866835c | retourne les annonces sur lesquelles l'utilisateur courant peut effectuer une
réservation | class EnregistrementRepository extends ServiceEntityRepository
public function findEnregistrementByUser($user){
$qb = $this->createQueryBuilder('e');
$qb ->select('a.id')
->join('e.article', 'a')
->join('a.statut', 's')
->andWhere("e.utilisateur=$user")
->... | 1 |
c84634f081c7b03a9a617040903e464e | 1b1b15222efcaf5970bff353ab6c1274 | 获取固定框触碰点集合 | function MapView:getTouchArea()
return cc.rect(self.mTouchArea.x, self.mTouchArea.y, self.mTouchArea.width, self.mTouchArea.height)
end | 0 |
cfdbfc98c397be4013598d11c6426fdb | cc4cbc0de8ae84760e65d483f53247b1 | Make sure devices.Lock() has been release upon return from cleanupDeletedDevices() function | namespace OVR
LatencyTestDeviceImpl::~LatencyTestDeviceImpl()
{
OVR_ASSERT(!pCreateDesc->pDevice);
} | 0 |
459b800c3b61e6e8b58eefc76d6c3125 | 7e7b057db87c4c9cbb1ba16c0d614035 | Do the Unix double-fork magic. | def doublefork(pidfile, logfile, cwd, umask):
try:
if os.fork() > 0:
sys.exit(0)
except OSError, e:
sys.exit('fork #1 failed: (%d) %s\n' % (e.errno, e.strerror))
os.setsid()
os.chdir(cwd)
os.umask(umask)
try:
if os.fork() > 0:
sys.exit(0)
excep... | 1 |
e9780cac1fa2b7d25d2740344c364f69 | 5ea9adf22f675a53510a2d0a13266bc2 | (None) -> None
This function is command function for event label.
Window will pop-up after user click event label.
Same layout with 'ADD' window in function 'Add_InputInfo'. | group.empty()
super().__init__(group, text, **kwargs)
self.close_button.kill()
if self.add_button is not None:
self.add_button.kill()
self.close_button = Button(group, 910, 450, button_1,
size=(150, 50), fontsize=50)
self.a... | 0 |
1f70639370d3a5c3688d27a38a5a7939 | cb351350e25698348eb0a5c53fa1e903 | 在图片上画出三维坐标轴 | void Axes(HDC hdc) {
HPEN hPen = CreatePen(PS_SOLID, 1, RGB(0, 255, 255));
HPEN hPenOld = (HPEN)SelectObject(hdc, hPen);
double xe, ye;
int x1, y1, x2, y2;
xe = Xe(-xmax / 3, 0);
ye = Ye(-xmax / 3, 0, 0);
x1 = xn(xe);
y1 = ym(ye);
xe = Xe(1.5 * xmax, 0);
ye = Ye(1.5 * xmax, 0, 0);
x2 = xn(xe);
y... | 1 |
f67987a0f612080074f122cd102bc135 | dd69244058f24610cfc7e4ee0fb55256 | ***********主函数************* | struct student *head=NULL;
creatList(&head);
outputList(&head);
correctList(&head);
avStudent(&head);
sumStudent(&head);
system("pause");
return 0;
} | 1 |
ebb3e8aac89b8e2e81487d141511558d | e5b206607248acdc17e99cfe2d4276da | This method is handle the result codes returned from the Camera or Gallery activities. | public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK) {
switch (requestCode) {
case 0:
Bitmap camImage = (Bitmap)data.getExtras().get("data");
... | 1 |
f28efbb6258323bfbfe6dbd51a0aa27c | b2421a284543238d37a918a479f08bab | Cette fonction vérifier si le mot de passe passer en paramètre est correct. Si le mot de passe est correct la fonction renvoie 'true'
sinon la fonction renvoie false | function verifierCorrespMotDePasse($pass, $v_pass) {
if ($pass == $v_pass) {
return true;
} else {
return false;
}
} | 1 |
17446f94d78a7bcdd0170fb2acfe4281 | ec1c2816542defa87f627f5eac630c4d | Provide a health indicator tied to agent related information if one hasn't already been provided elsewhere. | public class JMonitorActor extends AbstractBehavior<JMonitorActor.MonitorMessage>
private JEventHandlerActor.HealthMessage getHealth(CurrentState currentState) {
Parameter<String> healthParam = currentState.jGet(HEALTH_KEY).get();
Parameter<String> healthReasonParam = currentState.jGet(HEALTH_REASON_KE... | 1 |
70b15276f382534ce378731e49fdbe58 | 564f5b8134daa2db57a5a5975b3b1758 | Adds the multi table. | foreach ($cols as $col) {
$this->MULTI_COLS[] = $col;
}
return $this;
} | 0 |
1edc5a0d6d4fe1a6262ceff23acc95e8 | 084a3fbb96aeb287456f18d51a99ab89 | Sets the other property that the value must match. | class ThingType implements TypeInterface
public function setSameAs(Property\SameAsProperty $sameAs) {
$this->sameAs = $sameAs;
return $this;
} | 1 |
f6ea56fdd51e8e3070e00063484a602e | de6722039eb4ec6cdbb442dbc809b221 | This function issues change read column and reads the data into buffer
specified by user. | uint8_t I2CAccelBufferRead(uint8_t *buffer, uint8_t setting, uint8_t count)
{
uint8_t status,tries,done;
status = 0;
myI2Cpacket.address = 0x19;
myI2Cpacket.data = write_buffer;
myI2Cpacket.ten_bit_address = false;
myI2Cpacket.high_speed = false;
myI2Cpacket.hs_master_code = 0x00;
myI2Cpacket.data_length = ... | 1 |
160b5837184b9441e53771179e3b9765 | bac2ad9bffdf6b3e67fbdedc1cd9a80b | Refresh the blacklist every hour | function init() {
refreshBlacklist();
setInterval(refreshBlacklist, 1000 * 3600);
} | 1 |
0eb450a83bfe5ce17bbccf19c75c88b0 | 87a760bc098f7222e7edc4fe59c71613 | internal function to recursively find the minimum height of a node | {
if(root==NULL)
return INT_MAX;
int h1=findMin(root->left);
int h2=findMin(root->right);
int h3=min(h1,h2);
return min(root->data,h3);
} | 0 |
4a7ec84a7dedb353396017b9d723af4c | 1f5dfd4d52464979c829159c9fad4c57 | Retourne vrai si tous les rois sont sortis du niveau | class AireDeJeu:
def isRoundOver(self):
for i in self.listeDaleks:
if i.isAlive:
return False
return True | 0 |
22fcca2fa1a1c382842652890ac8fa95 | 478bd135217c8d57716cc9df12c4c8d4 | bottom navigatie bar initialiseren | var scroller = {
topptekst: document.querySelector('.topptekst__navigasjon'),
initOffsetTop: 0,
body: document.querySelector("body"),
lastKnownScrollPosition: 0,
ticking: false,
endret: false,
mobilBredde: 764,
};
scroller.initOffsetTop = scroller.topptekst.offsetTo... | 0 |
131b510c5667a378a43b9cee0ca582c5 | 80970376351412f25babaed4e69eb203 | Destructor that stops the active capturing and terminates the thread. | {
if(m_bThreadStop==true){
return ;
}
m_bThreadStop=true;
INFO_PRINT("deinitCapture,wait for thread end");
#ifdef WIN32
if(m_tThreadId){
WaitForSingleObject(m_tThreadId,INFINITE);
CloseHandle(m_tThreadId);
m_tThreadId=0;
}
#else
if(m_tThreadId){
pthrea... | 1 |
90d19e4cee0a2d5078af4cb8ddd7ac78 | 64ec415f78f36d9ef21ef4401f48c22f | Función que carga la unidad de medida desde el perfil | setTipo(event.target.value);
x = unidades.transformar_lista_longitud(x, old_unit.ds_Longitud, usr_unit.ds_Longitud);
old_unit.ds_Longitud = usr_unit.ds_Longitud;
usr_unit.ds_Longitud = event.target.value;
setValor(unidades.transformar_unidad_longitud(total,old_unit.ds_Longitud, usr_unit.ds_Longitud)... | 0 |
e9e625b0e3a7f7ea94c520f0016276c2 | a06c364a19f6aa6cfcf0372b2e2d2b51 | 判断是否是院级或者校级重点。
思路:从social_practice表中获取student_num以及学年(根据start_time来划分),是否是重点,然后根据student_num关键字填入students表中。 | class is_social_practice_great1(FeatureCalculater):
def calculate(self):
sql = "select stu_num,DATE_FORMAT(start_time,'%Y'),DATE_FORMAT(start_time,'%c'),School_key_projects_or_not,College_key_projects_or_not from social_practice"
self.executer.execute(sql)
e = self.executer.fetchall()
fo... | 1 |
e2f285bb9cd9d32ef05c6a02cd3fb42a | 62b2308423704bb248238c92668bb065 | Checks whether the SWA can trigger a new Projector session. | from resources.lib.database.db_utils import TABLE_SESSION
wv_force_sec_lev = G.LOCAL_DB.get_value('widevine_force_seclev',
WidevineForceSecLev.DISABLED,
table=TABLE_SESSION)
is_l3_forced = wv_force_sec_lev != WidevineFor... | 0 |
82d69d4ee7cc353d105faf67270dccaa | 4d15414165ff612840d3cac034d63e43 | 数据输入后点击取消查看数据是否保存 | this.clickedCancel = true;
const target = this.getRowByKey(key);
const dataIndexArray = ['Sid', 'Name', 'Note', 'Pos'];
const isShowMessage = dataIndexArray.reduce((prev, current) => {
return (
(
Array.isArray(target[current]) ?
target[current].length === 0
... | 0 |
bbb6e78e43bee5102744432db1b5c969 | fb41030eac1ed6f90814b0192b481f87 | 判断是否为客服 | public class UserRemote
public static void judgeIsCustomer(String cellphone, String action, TextHttpResponseHandler handler) {
RequestParams params = new RequestParams();
params.put("account", cellphone);
ApiHttpClient.get(action, params, handler);
} | 0 |
ca9042ceb244410f4f14734ba035a543 | 41363330be024fa95a8336b727999e1c | 更行用户数据,返回影响用户行数 | def update_users(username, password, age, uid):
sql = 'update user set username = %s ,password=md5(%s),age=%s where id=%s'
args = (username, password, age, uid)
_count, _rt_list = dbutils.execute_sql(sql, args, fetch=False)
return _count != 0 | 1 |
f89124afea3e598f0b99f97ed0535412 | 5209534243913c9c9428829dfe29a4d2 | 进入曲谱详情页 | let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '../songSheetDetail/songSheetDeatil?id=' + id
})
} | 1 |
8c550331d400559828a41922291852ad | b280773488baa5211dd0670cd2181b28 | 安排指定的任务从指定的延迟后开始进行重复的固定延迟执行。以近似固定的时间间隔(由指定的周期分隔)进行后续执行
所要安排的任务
执行任务前的延迟时间,单位是毫秒
执行各后续任务之间的时间间隔,单位是毫秒 | public class ScheduledTask
public static void scheduleWithFixedDelay(ExecuteTask executeTask,long delay,long period,TimeUnit unit){
scheduledExecutorService.scheduleWithFixedDelay(new ScheduledRunnable(executeTask),delay,period,unit);
} | 1 |
d1dc6c34809a69da84cb7550be41c97f | 23749fe9140f935edd19ced464887b9f | Método que cria uma cópia de uma empresa de táxis | class StCursoEmpresasController extends Controller
public function duplicate($id, StCursoEmpresa $stCursoEmpresa)
{
$stCursoEmpresa=$stCursoEmpresa->find($id);
return view('stCursoEmpresas.duplicate', compact('stCursoEmpresa'))
->with( 'list', StCursoEmpresa::getListFromAllRelationApps() );
} | 0 |
f0294f20b9455f57d5b5fe8598b97242 | 24994afbff0da5461a772e578d2e4e26 | 是否是无符号小数 | {
int64_t _exp = *(int64_t*)&A & 0x7FF0000000000000LL;
int64_t _mantissa = *(int64_t*)&A & 0xFFFFFFFFFFFFFLL;
if(_exp == 0x7FF0000000000000LL && _mantissa != 0)
{
return true;
}
else
{
return false;
}
} | 0 |
0e1f2537024dc5c9fcf66fbe002a70a6 | b8f1c3821a05dd81e94fd2d74e85cbfb | 外出登记的"小时"统计 | class ReportController extends Controller
public function registerHourSum(Request $request)
{
try {
$req = $request->all();
$defaultDay = [
date("Y-m-d", strtotime("-1 day")),
date("Y-m-d")
];
if (isset($req["dayArr"]) && $req["... | 1 |
9156b31d2292d5098974143fcb5b7c52 | 072040390b2f16a550cb807904771e7a | 測試出款缺少回傳商號額外設定 | {
$this->setExpectedException(
'BB\DurianBundle\Exception\PaymentException',
'No return parameter specified',
180137
);
$res = [
'accessToken' => '0.AQAAAUW-9Tu4AAAEk-BNppPGFNwoWODBcOznHwA.skB0dDtyMrW4xCZJw__FGNtL-08',
'expiresIn' =... | 1 |
50f458c5e7dd0c7079b34f3145c57954 | fad91734af290a8205cd64cec9ee63d3 | complete all tasks | public class _MinigamesState : MonoBehaviour
void CheckAllTasksComplete()
{
if (taskStates[0] == true && taskStates[1] == true && taskStates[2] == true)
{
WinScene.singleton.OnGameEnd();
}
} | 1 |
99a13a190a685bf3b1253b4f22bbcd6b | 4e5d51284f7cbe4f4212ceea46f2bf01 | Use the Amazon Mechanical Turk Sandbox to publish test Human Intelligence Tasks (HITs) without paying any money. | export class CreateHITWithHITTypeCommand extends $Command<
CreateHITWithHITTypeCommandInput,
CreateHITWithHITTypeCommandOutput,
MTurkClientResolvedConfig
>
constructor(readonly input: CreateHITWithHITTypeCommandInput) {
super();
} | 0 |
5d29792005871a7258e613cbdfe2c993 | 0e6967ef92e1188c3240ccda86a9d76d | Calculate the gradient of MSE. | class MSELoss(object):
def grad(self, coef):
return self.x.T.dot(self.x.dot(coef) - self.y) / self.n | 1 |
0cbfd0bd3c9d18639c33d3f10547a61f | 93ae9ce79ffc3f46e3c9da585e510cea | Creates an instance of Vault. | {
IVaultClient vaultClient = new VaultClient(vaultServerUriWithPort, authenticationInfo, continueAsyncTasksOnCapturedContext, serviceTimeout, postHttpClientInitializeAction: postHttpClientInitializeAction);
return vaultClient;
} | 1 |
0a03d39cddfe25340056d5fc573cf6d1 | 33ce40a9edeaab6aadd2f5e75478d585 | Converts a defined Amino Acid to string form (for output) | public class AminoAcid
public String toString()
{
return mS;
} | 1 |
bec8891bc25e5446b8c61a6e81362c38 | d8a24755a2e54e8bc4a57e77eed28442 | Set up a job to run on a list of paths. Jobs expect at least one path,
but you may specify as many as you like. | self.pipeline = pipeline
self.path = path
self.list_name = list_name
self.image_list = image_list
self.output = output
self.rules = rules
self.run() | 0 |
8b782362c5a33c752790732e9f44d8ed | f677edae8d8403b858143e5a863028ee | Changes map to whatever address user puts in. Turns address into gps coordinates via Geocode | function codeAddress(inaddress){
var hash = inaddress.split(' ');
var address = hash[0]+' '+hash[1];
var geocoder = new google.maps.Geocoder();
var mapOptions = {
zoom: 18,
mapTypeId: google.maps.MapTypeId.ROADMAP,
scrollwheel: true
};
var map = new google.maps.Map(document.getElementById("map"), mapOpt... | 1 |
b8525b209387ac1397f13d2a4e35a8b6 | 335357405bacb4579c7d04214e035ecd | 缓存登录授权时的state参数信息(clientId也缓存进去,用于有多个微博应用配置时获取正确的clientId) | function retrieve_client_data(params)
local tmp_data = ngx.var.service_id .. "#tmp_data:".. params.state
ts.connect_redis(red)
local ok, err = red:hgetall(tmp_data)
if not ok then
ngx.log(0, "no values for tmp_data hash: ".. ts.dump(err))
ngx.header.content_type = "application/x-www-form-urlencoded"
... | 1 |
2b545f760fc64296a8efe4df21e6dacc | 3b3530965791a887ca05ec8c85dd646e | Get all leaf nodes as a single list. | namespace Lachain.Crypto.Misc
public class MerkleTreeNode
public IEnumerable<MerkleTreeNode> GetLeafs()
{
return GetLeafs(this);
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.