query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
a7169e9b8f6e6deb4bca3357b28731f0 | 565beff76a2d14265e49fdfef45dad59 | \internal
\brief Interrupt handler for Timer Counter F1 Compare/CaptureA
This function will handle interrupt on Timer Counter F1 Compare/CaptureA and
call the callback function. | {
adc_cb_args_t args;
if ((NULL != g_dcb[1].p_callback) && (FIT_NO_FUNC != g_dcb[1].p_callback))
{
args.event = ADC_EVT_CONDITION_MET;
args.unit = 1;
args.compare_flags = adc_get_and_clr_cmpi_flags(1);
g_dcb[1].p_callback(&args);
}
else
{
adc_get_and_clr... | 0 |
5477f8cfcb780c4cb1b607cf99207239 | 39f7e9d8870bb4a6a3bd56c883a58312 | Called by GDB to write memory on the target | class UdkGdbStub(gdbserver.GdbHostStub):
def write_memory_impl(self, address, size, data):
return self.udk.write_memory(address, 1, size, data) | 1 |
14488f48da00e200c0272faffe3d3f4b | 6c91412b1d7bf209c6c6b7e4ccffd6b3 | Actualizamos la información general de la tienda | {
$validator = Validator::make(
$request->all(),
[
'name' => 'required|min:2|max:255',
'overview' => 'required',
'address' => 'required',
'city_id' => 'required|exists:cities,id,deleted_at,NULL',
'zip_cod... | 1 |
94e2e0ca598e75ff4f9a57f2357ca465 | 68d9824b1eaf7ddaee4535f1c1b2e8ab | Converts a dictionary to list of field types. | class _ArtifactConverter(object):
def convert_dict_to_fields(cls, values):
fields = []
for key in values:
fields.append({"name": key, "type": "string"})
return fields | 1 |
6e276bad0eec495e271a9b1bfdb7e46e | 570702773d8511d91a5eb89dbe065313 | REGISTRATION | function registrationForm() {
return `
<div class="container-register">
<div class="title">
<i class="material-icons lock">lock</i> Register
</div>
<form action="/register" method="POST">
<label>
<div class="input">
<div class="input-addon">
... | 1 |
58f0f2fd354fde0cc2dbeb701e0a1328 | 7296faa5bfa3219c9437e822d3ae8be9 | 执行命令,如果命令或子命令抛出异常会自动捕获异常并将错误消息返回在res中 | class Handlecommand:
def exec_comm(self):
comm = self.checked()
if comm:
status, ret = subprocess.getstatusoutput(comm)
if status == 0:
self.res_msg['status'] = True
self.res_msg['msg'] = ret
return self.res_msg | 0 |
024a57af268bb77db12676e2914bd7cb | bbcdc5b952f35418334cbe7efe56aedc | Gets the verificacion telefonica. | public abstract class Individuo
public String getTelemovel() {
return telemovel;
} | 0 |
42b9930630089c327cd5aa5d49f840d6 | dd30bf5e1e747bc1de057500515205d6 | 创建复选框字段 | {
var name = dataField.GetName();
var prop = dataField.GetProperty();
var desc = prop.GetTitle();
var canSort = prop.CanWrite;
var field = new CheckBoxField()
{
HeaderText = title,
DataField = name,
... | 1 |
199de6c7ed18d24903d81fc867098f7a | 956ecd205c953e32f391661163ca093e | Gets whether scrollbar is vertical. | export class ScrollBar extends UIComponent
get isVertical(): boolean {
return this.slider.isVertical;
} | 1 |
c5501f473786e6771322dae032918d94 | d076b695acb148a156b5e32317eed09d | Получить асинхронно объект сообщения | namespace ImagineCommunications.BusClient.Abstraction.Interfaces
Task<object> GetMessageAsync(IBigMessage bigMessage); | 1 |
84d1f60cd1a7f77cc23cb5e16752d6a9 | f092eff2ac4814df58b41e297ffcb56c | display initial settings form | {
global $tpl;
$this->checkPermission("write");
if (!$a_omit_init)
{
$this->initMediaObjectsSettingsForm();
$this->getSettingsValues();
}
$tpl->setContent($this->form->getHTML());
} | 1 |
3d0155acb6d73fe56f306f8b3fada683 | 3e9fb4bad4aedf03a46b98862cf6911c | Reverse sort, orders values from highest to lowest.
@brief Reverse sort, orders values from highest to lowest | std::vector<double> values_to_sort = values ;
std::sort(values_to_sort.begin(), values_to_sort.end(), std::greater<double>());
return values_to_sort;
} | 1 |
44db729c7e4345d3b90f709e9ee6146f | 721cd9556db33278e4e976243c765c45 | 获取学校生源分布情况 | class Students extends MY_Controller
public function sourcetrend(){
$config = array(
'error' => false,
'debug' => false,
'log' => false,
);
$this->load->library('EXT_Server', $config, 'oServer');
if(! $aResult = $this->oServer->getData()){
... | 1 |
1c65be2908971b521644da94301d14ee | 05bd55341bd401baed7ba6d972a31c89 | 进行过滤,避免脏话 | public class FilterProfanity extends ForumMessageFilter
private String filterProfanity(String str) {
if (str == null || "".equals(str)) {
return str;
}
String lower;
if (ignoreCase) {
lower = str.toLowerCase();
}
else {
lower = str;
... | 1 |
5d1b939ea3f9f8098bc861ccea4c1b43 | c0ac6117a8277e2b7efa297904e69a00 | This function is called when a point is dropped. | if self._drag_data["is_poly"]:
self.poly.set_vertex(self._drag_data["id"], [event.x, event.y])
else:
self.points[self._drag_data["id"]][0] = event.x
self.points[self._drag_data["id"]][1] = event.y
self._drag_data["item"] = None
self._drag_data["id"] = ... | 1 |
186a91e983e25c8357af4cb76c2a635e | 5ced7543913c820fde3028265b1b21fa | 3. Принимаем и обрабатываем ответ сервера | function parseAnswer(response) {
stopAjax = 0;
$('#loadingMessage').hide();
switch (response.code) {
case 'SDGE001':
case 'SDGE002':
case 'SDGE003':
case 'SDGE004':
case 'SDGE005':
case 'SDGE006':
byebye();
break;
case 0:
break;
default:
... | 1 |
2a637200a016f8589e1d2b2715761f8b | 9f69470a74397c12d6c55c31afcb4823 | 转动关节。它将两个刚体钉在一起,或者把一个刚体钉在场景上。
可以设置马达参数、 角度限制和其他参数,来决定两个刚体之间的相对运动。 | RuntimeObject *object,
RuntimeScene &scene,
float xPosRelativeToMassCenter,
float yPosRelativeToMassCenter) {
if (!body) CreateBody(scene);
if (object == NULL || !object->HasBehaviorNamed(name)) return;
b2Body *otherBody =
static_cast<PhysicsRuntimeBehavior *>(object->GetBehaviorRawPointer(n... | 1 |
66f95429210258b1bf8e2fe69f0e04af | 0810e44c7df81153cd51189f01740d34 | This case tests whether a heritage item created successfully. | self.create_itemattribute()
ItemAttributeCount = ItemAttribute.objects.count()
url = reverse('itemAttributes') + '/testdatatype1/testitem1/testattrtype1/value1_create'
data = {}
response = self.client.put(url, data, format='json')
self.assertEqual(response.status_code, st... | 0 |
18d0bf77126b41d70bb86a083cb0f63d | 6771939a783ab553890ce6326600f5ac | 設定IsPlaying為true,代表遊戲正在進行中 | public class GameStateManager : MonoBehaviour
public void Play()
{
Time.timeScale = 1f;
StartCoroutine(CoPlay());
} | 0 |
00f89f2cce7f77bb8e7d43cdb15b3000 | 8c7b3c4edb88606cae818a242c18b429 | Méthode permettant de supprimer un athlète. | export class DataserviceService
public deleteSportById(idSport : number) : Observable <Sport>{
this.router.navigate(['validation']);
return this.httpClient.delete<Sport>('http://localhost:8080/api/sport/' + idSport + '/sport-suppr')
} | 0 |
3f4bd2c5e3bf187b33181fb4206aba17 | 4482042ce8ff7ef7a5fe67bc1af29129 | Convert Model time to UT time. | def ut_to_string(ut):
return datetime.datetime.fromtimestamp(int(ut)).strftime('%Y-%m-%d %H:%M:%S %Z') | 0 |
27f9fc27e654d2924d9d5f7cba21b563 | 6bd6fda92bb1db711d800013b7d70178 | modifie la référence du scolaire stocké dans la collection | class Sensor
public function setCollection(\simkesd\SmartClassroom\SmartClassroomBundle\Entity\Collection $collection = null)
{
$this->collection = $collection;
return $this;
} | 0 |
6a3402d04336a1fa92698a30870287e5 | f10f40e67023a62922c48798f8621cf8 | lista los recursos obtenidos por determinado cliente | @Stateless
public class FacadeAdministracionBe extends FacadeBean
public List<RecursoDTO> consultarRecursosXUsuario(Long idUser) throws ExceptionDAO {
List<RecursoDTO> lsRecursoDTOs = new ArrayList<RecursoDTO>();
for (Recurso iteraRecurso : recursoDAO.consultarRecursosXUsuario(idUser)) {
RecursoDTO recursoDTO = ... | 1 |
434378659e3c3a92fd8e9f45efa35191 | c00c51ed8058826bec660f83cb3b1b13 | State objects position. This is index of the current slide in presentation | class SlideContainer extends HTMLElement
get currentIndex() {
return this._currentIndex;
} | 1 |
d44af42dfa8d15b3ac1e24d933d30c88 | 2fedb0fe9d0130461610e31f0bf29b38 | Метод для установки цвета стрелки | public class BackArrowView extends View
public void setArrowColor(int arrowColor) {
if (arrowColor != mArrowColor) {
this.mArrowColor = arrowColor;
mPaint.setColor(mArrowColor);
invalidate();
}
} | 1 |
0de627d7cd8647dd47568d3c457e1ca8 | 471db1fe67a8b253595e083a53c196eb | a. membuat matriks berisi 0 dengan ukuran tertentu | def newMat(numRow, numCol):
mat = []
for i in range(numRow):
mat.append([])
for j in range(numCol):
mat[i].append(0)
return mat | 1 |
73e1d4ae031779ced4d5aa1bb2217ed0 | cd75fa67720b8711abf9d19cd8d1ab45 | convert raw yaw counter value to degrees | class servo:
# =======================================
# Public class attributes
# =======================================
# Control table address
def tick_to_deg(self, tick):
deg = tick*(180/(self.ticks_per_turn/2))
return deg | 1 |
8d5770eae9da4758de1398d8cfcad644 | 7a578ef63b80d935e803697d16403d00 | 检测aJson是否能转换成aClass对象 | public class JsonUtils public static class ExtJsonConfig extends JsonConfig
private boolean validateClass(Class<?> clazz) {
return getToJSONStringMethod(clazz) != null;
} | 0 |
f959decd03be9720d6094a53aee5dc56 | 8f37ff53ef8db3bb7b6740edaa0bd6f5 | Getter for the gRPC stub used for the Table Admin API. | if (this.azureClustersStub) {
return this.azureClustersStub;
}
this.azureClustersStub = this._gaxGrpc.createStub(
this._opts.fallback
? (this._protos as protobuf.Root).lookupService(
'google.cloud.gkemulticloud.v1.AzureClusters'
)
:
(this._protos ... | 0 |
8c30e853b37ee77b3f5e28ff8181584c | 160edc83fcfaed0ccc9555e19054d300 | Updates a player's nickname, team and link | self::setPlatform( $platform );
$postdata = array(
'time' => (time() + self::$time_correction),
'ident' => self::$api_ident,
'player' => $player
);
$data = array();
self::$postUri = sprintf( self::$baseURI, self::$platform, 'playerupdate' );
self::$postfields = self::getSigned($postdata);
if(sel... | 0 |
74a2268bc6e02bc51ce0806d8ce9e870 | 62c3dcede4ec577e3af45822cb9d50f4 | 2要素タプルのシーケンスの各要素を展開して関数に渡すPartitionです。 | namespace LangExt
partial class Seq
public static void Iter<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>(this ISeq<Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8, T9, T10, T11, T12, T13, T14, Tuple<T15>>>> self, Action<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> f)
{
... | 0 |
96b8abab41cee6ad51f332e2e73b581d | ca2ab98c067cab4f58fce79631cdf6de | URI(s) of Apache Kafka broker(s) | class KafkaHarness(object):
def bootstrap_hosts(self):
return ["{}:{}".format(b.host, b.port) for b in self.brokers] | 1 |
836daa3955e8903015cb1c3499823568 | 5eee1f5e2dea43cbabee58d00492a66f | Allows user to save an item to dislikes | class UserDislikeItem extends UserActionItem
protected function build()
{
$this->request = $this->client->createRequest(RequestInterface::POST, 'actions/u2i/dislike', null, $this->getAll());
} | 1 |
5329970ea16b47e35d69ac666c24c719 | e7d18f740a3e9d195688ac32d93ed6c3 | Obtains a list of attributes that can be read. | class AutoGetSet extends GetSet
public function getReadableAttributes($instanceOrClass) {
return array_merge(
parent::getReadableAttributes($instanceOrClass),
$this->getPropertyAttributes($instanceOrClass)
);
} | 1 |
54ad2c28eac23fb2cbd34061247b3fa2 | d8fcb276b299c11bc0f09bd069375122 | !
@brief This API is used to enable or disable auxiliary Mag
in the sensor. | static uint16_t bma4_set_aux_interface_config(struct bma4_dev *dev) {
uint16_t rslt = BMA4_OK;
rslt |= bma4_null_pointer_check(dev);
if (rslt == BMA4_OK) {
rslt |= bma4_set_mag_enable(0x01, dev);
dev->delay(BMA4_AUX_COM_DELAY);
rslt |= bma4_set_advance_power_save(0x00, dev);
dev->delay(BMA4_AUX_CO... | 1 |
ab4f6ac5e46f003f312eef7dc00ab858 | 8bdd7293f33e3f8bc0eea65d0723d094 | <para>Creates a new <see cref="PropertyTree"/> for a set of given target values, represented by a given <see cref="SerializedObject"/>.</para>
<para>Note that the targets all need to be of the same type.</para> | [NotNull] Func<TObject, TKey> pivotOn)
where TObject : class
{
if (source == null) throw new ArgumentNullException(nameof(source));
if (pivotOn == null) throw new ArgumentNullException(nameof(pivotOn));
return new TreeBuilder<TObject, TKey>(sour... | 0 |
7d6e39df8bf5e302479e2af9098a291d | 4ffd899b5ae75ba0689263ba35bc2616 | Applies an aggregator across multiple coordinates. | def coord_reduce(layer, callback, memo, exclude_wrap_coord):
local_vars = {"memo": memo}
def callback_wrapper(coord):
local_vars["memo"] = callback(local_vars["memo"], coord)
coord_each(layer, callback_wrapper, exclude_wrap_coord)
return local_vars["memo"] | 1 |
40a7f96fb62d8c014e26099c399ead79 | 7973bc6f0333f8b2d226d9572ac794f0 | Assert Equal. Evaluates the statement and raises error if
the evaluation result is NOT EQUAL TO value. | class Equal(STL_Formula):
def __init__(self, lhs='x', val='c'):
super(Equal, self).__init__()
assert isinstance(lhs, str) | isinstance(lhs, Expression), "LHS of expression needs to be a string (input name) or Expression"
assert not isinstance(val, str), "value on the rhs cannot be a string"
... | 0 |
ca81ab4848af37034db6dff26bd2ba7d | bddbd6eaf1c1d1ddda474ad17ca042ac | Runs if AJAX succeeded.
If login info is correct: update the site and go to the main page
If login isn't successful: print an error message on the login page. | function do_login() {
$('#login-button-done').hide();
$('#login-ajax').show();
$.post("/login/ajax", $('#login_form').serialize(), validate_do_login, "json");
} | 0 |
45d3af7665997bd4d5542773e0a3777e | ba689e0911dbb58f6647ab109586b020 | 添加显示 ti电量 n个信息体(TI_Obj)和 一个信息体单元(Ta)函数 | namespace TCD.System.TUIO
void addTuioObject(TuioObject tobj); | 0 |
d80da2e017fc1e0aa5fcf9610f3ca695 | a4ef381b897e6825948f65040c7dd69f | 将脚本源代码编译为中间代码,以提高执行速度 | namespace Microsoft.ClearScript.V8
public sealed class V8Runtime : IDisposable
public V8Script Compile(string documentName, string code, V8CacheKind cacheKind, out byte[] cacheBytes)
{
return Compile(new DocumentInfo(documentName), code, cacheKind, out cacheBytes);
} | 1 |
cbadfc8a81e42d363f6764dff787e421 | 09cf42a3700cb2a63b7420074b83d77c | 新增一个内存池对象到内存池管理栈中 | BOOL VMemPool::vmPoolAddObject(DWORD dwObjTypeSize, DWORD dwObjPoolSize)
{
if (dwObjTypeSize == 0 || (dwObjTypeSize & 3) != 0 || dwObjTypeSize > SIZE_MAX_OBJECTTYPE || dwObjTypeSize * dwObjPoolSize > 1024 * 1024 * 100)
{
char szError[1024];
sprintf(szError, "VMemPool::vmPoolAddObject invalid parameter, ObjTypeSiz... | 1 |
863f0d6977c8aacca3fc4558b6008e1a | 58db1a69b1ffb4115573a4abdd02885f | @brief Register a Dai into audio system. | {
ER erReturn;
if (AudioLockStatus == NO_TASK_LOCKED)
{
return E_OK;
}
dai_close();
if (bAudioClkEn == FALSE)
{
pll_disableClock(DAI_CLK);
pll_disableClock(ADO_SCLK);
}
gpio_close();
if (AudioDeviceObj.uiI2SCtrl == AUDIO_I2SCTRL_SIF)
{
sif_clos... | 0 |
380a456918a114130ce39b3420413fb0 | 41d024a319361404d9f10d9b80b831f6 | ==========================================================================
罗列用户所有存储空间 | @RestController
@RequestMapping("hos/v1/")
public class HosController extends BaseController
@RequestMapping(value = "bucket/list", method = RequestMethod.GET)
public Object getBucket() {
UserInfo currentUser = ContextUtil.getCurrentUser();
return bucketService.getUserBuckets(currentUser.getUserId()... | 1 |
0f4ccdef76d33de452508b92842310ef | acc54b2d2700a15982af7862ab1f6389 | Converts a hexadecimal string to a decimal string | int hex2dec(char* hex)
{
int len, i, dec, p;
string hex_digits = "0123456789ABCDEF";
len = strlen(hex);
for(i=0; i<len; i++)
{
switch(hex[i])
{
case 'a':
hex[i] = 'A';
break;
case 'b':
hex[i] = 'B';
bre... | 0 |
a68a112211fcb33bce1fb60bd8dcad70 | 885d645220c7c63f3c47a278e20f6a37 | No names are generated for native libs | impl<'a> Build<'a>
fn file_stem(&self) -> String {
#[cfg(target_os = "windows")]
{
format!("{}", self.lib_name)
}
#[cfg(not(target_os = "windows"))]
{
format!("lib{}", self.lib_name)
}
} | 0 |
46c6226842d99fb5e51389665aa3f293 | 1fbf82c8ed391366514e333b4d5ea835 | Risponde ad un messaggio di handshake | const char* channel;
if (!json_get_string(&channel, msg, "channel")) {
log_info("recv handshake: missing channel");
recv_handshake_error(client, msg);
return;
}
if (0 != strcmp(channel, "/meta/handshake")) {
log_info("recv handshake: wrong channel");
recv_handshake_error(client, msg);
re... | 1 |
b72fd1b456b4b313d82f1133616d7167 | b07b45437f2f669f28680003ec6c6acc | Normalises a confusion matrix | with np.errstate(divide='ignore', invalid='ignore'):
normalised_array = result_list[:, 0] / result_list[:, 1]
return normalised_array | 0 |
dd1bb536ac39922395388e2ed6eb804e | ecc1a8e4f6ffeb325b8a7be45fcf5b4e | Sets the name of the namespace to which this funcion belongs. | public void setNameSpace(String nameSpace); | 1 |
3d60d77c460ea1b356749b15a930582e | 7292aa9da92298a276aba0358cf2c08d | A wrapper class for a Loan which is used to calculate the
repayment schedule for a given Loan over a given Term. | self.cf = pd.Series( data=cf_amounts, index = cf_times)
self.time_type = time_type
self.cf_times = cf_times
self.cf_amounts = cf_amounts
self.daily_payment_schedule = self.getCouponPaymentSchedule()
self._IRR = None
self._mcAuleyDuration = None | 0 |
5456ee9a2fba59d4ce2ec8c70e7be01f | 7d8fc47dd218542eb5f58e4fc863b822 | Only the review's author can edit their review. | pk = kwargs.get('pk', None)
if pk:
instance = Comment.objects.get(pk=pk)
if request.user.id != instance.created_by.id:
return HttpResponseForbidden()
return super(CommentViewSet, self).update(request, *args, **kwargs) | 1 |
6afc1fc927455c2da658065a022fe373 | da60be44dfbbe512ad0e2c038cf82bd5 | Remove expediente. | $this->db->trans_start ();
$this->db->delete('t_expediente_general', array('id' => $id));
$this->db->trans_complete ();
$this->db->trans_status();
return true;
} | 1 |
bdd8719d1032d4965daee4f408c69f71 | 1b876ae78e46972b3271a94a0cca590c | transposes a 2d array of arbitrary elements without numpy | list_2d_transpose = []
for j in range(len(list_2d[0])):
list_2d_transpose.append([])
for i in range(len(list_2d)):
list_2d_transpose[j].append(list_2d[i][j])
return list_2d_transpose | 1 |
eddbcbca50a3e31c7c0e2a27b05874f9 | e18570bd52175e76ce284d29306b965f | Get the value associated with the input key.
NOTE: returns None if the value is None AND also returns
None if the key does not exists. | def keyValueOrNone(dict, key):
return key in dict and dict[key] or None | 1 |
701492d225a7905030024f5595fbd29c | f6fb942e9d0322e0d7a3fcb077e85cd0 | Visit a parse tree produced by {@link HiveSqlParser#assignment_stmt}. | public class Ada2005BaseVisitor<T> extends AbstractParseTreeVisitor<T> implements Ada2005Visitor<T>
@Override public T visitAssignment_statement(Ada2005Parser.Assignment_statementContext ctx) { return visitChildren(ctx); } | 0 |
7fe0ed2d8b5458c679ddb306c28d3ec0 | 544aac5965b7f667550c852eb1805db4 | 获取当前报表查询器的JDBC Connection对象 | public class IReportCompiler implements Runnable, JRExportProgressMonitor
public it.businesslogic.ireport.IReportConnection getIReportConnection()
{
return iReportConnection;
} | 0 |
c0b02393997ce6e6fb364a00358b0047 | 3331fded1f8d29dc7f0c9dc4767e79d3 | SetInt16 encode INT16 to the payload buffer. | {
p_encoded_data[0] = (uint8_t) ((value & 0x00FF) >> 0);
p_encoded_data[1] = (uint8_t) ((value & 0xFF00) >> 8);
return sizeof(uint16_t);
} | 1 |
73864dbbc2b6336fe98de5567aa37148 | 4670a6264196d23287169edc312021a3 | 申请分期场景附加验证 | $form = $this->appForm;
$appModel = $this->primaryAppApplicant;
$coAppModel = $this->coAppApplicant;
$errorCount = 0;
$totalCount = 1;
$errorList = [];
$tmpModel = new AppForm(['scenario' => 'complate-rate-check', 'id_application' => $this->id_application]);
... | 1 |
a4029372abd53269516453046ef93c5c | 95ba36b1f050f551ac4468bc493c109f | Test attribute "compactionForceTimeout" | db := newTestDB(t)
db.DisableCompactions()
var (
app = db.Appender(context.Background())
ref = storage.SeriesRef(0)
mint, maxt = int64(0), int64(0)
err error
)
for i := int64(0); i <= 120*7; i++ {
ts := i * DefaultBlockDuration / (4 * 120)
ref, err = app.Append(ref, labels.FromStri... | 0 |
568226908977392944d1fd8dfa9d66d2 | c99f7af7e206e0bf38fedba2dccc38fe | Example of forcing authentication with a certain provider.
Be aware of malicious redirects though.
http://blog.codeclimate.com/blog/2013/03/27/rails-insecure-defaults/#offsite-redirects | def github_authenticate(scope=nil, options={}, &routes_block)
github_constraint(scope, options, routes_block) do |warden, scope|
warden.authenticate!(scope: scope)
end
end | 1 |
60c5849db51406800bcf1121a60247f0 | dbdd8fe3cd5225d08ed0438330ed7b4b | POST /api/v1/clockwork_database_events
POST /api/v1/clockwork_database_events.json | @clock_event = ClockEvent.new
@clock_event.user = current_user
@clock_event.event_type = current_user.next_event_to_log
if @clock_event.save
redirect_to clock_events_url, notice: 'Clock event was successfully created.'
else
redirect_to clock_events_url, alert: 'Clock event was NOT succes... | 0 |
1828cfcde1f5f74d893b23397bfe7086 | dce8a43c0f9b647230044086429a8735 | 数字和属性值之间有一个空格,冒号和属性值之间也有 | $value = $this->getAttribute($attribute);
if (preg_match_all('/\s/', $value)) {
$this->addError($attribute, '不允许有空格');
}
} | 0 |
a775346032c1830cdce0eea55fdc0c1f | 747ebe08f5425322b50814b7864f0702 | GET: UserChannel | public IEnumerable<IChannel> Get()
{
var userId = _am.Authenticate(HttpContext).Id;
return _cm.GetSubscribedChannels(userId);
} | 1 |
388c4e3dfcb22f48798f4fd124504ee5 | 1270e5231ae10970fae0345456de5830 | The tag referencing a state | class States(Base): # pylint: disable-msg=R0903
def __init__(self, sname, abbr):
self.sname = sname
self.abbr = abbr | 0 |
98d4c286353104184d8a32ff5ad4a2c2 | 92293266f86ff28ee9682a35c8ba7072 | 得到所有的新增未上门原始客户数据 | public List<Ys_custbase> getCustombaseAll(); | 0 |
c0e9bb915b944b5c1b736c5fc8e052b8 | d6ab99722090b11c06483110a2d9a5f3 | Comprueba si un artículo existe | class ArticuloController extends Controller
public function existeArticulo() {
if (!isset($_POST['id_articulo'])) {
$existe = ArtArticuloModel::where('nombre_articulo', $_POST['articulos'])->count();
} else {
$existe = ArtArticuloModel::where('nombre_articulo', $_POST['articulos'... | 1 |
63a98f7cca107e6401970e79e50e80a5 | 49136626a9e9c5db8c4007af484bb928 | Sprites are 8x8 or 8x16 | public class GlobalSprites
public static int get16Sprite(){
return 16;
} | 0 |
b0c7eb1089cb949683fa24ef39ba0743 | fb9eb072e5616ca16b585b410692dcd8 | Process face information | msg = face_info()
msg.face_count = int(len(result.faces))
for face in result.faces:
msg.id.append(face.tracking_id)
msg.x.append(int(face.pos_x))
msg.y.append(int(face.pos_y))
msg.size.append(int(face.size))
msg.conf.append(int(face.conf))
if face.direction is... | 1 |
84980f280867ccd3be6c38c570223c4c | ab327ba92767d3efccc6ed95fe9f3782 | Display a listing of the Subindustry. | class SubindustryController extends AppBaseController
public function index(Request $request)
{
$this->subindustryRepository->pushCriteria(new RequestCriteria($request));
$subindustries = $this->subindustryRepository->with('industry')->paginate(25);
return view('subindustries.index')
... | 1 |
1b8cfa6ff2920008d680caa16b0e229a | 0e895f18d68bd945399b036162e72b2f | @brief Appends two strings. | static char * strapp(char * front, const char * back)
{
char * result = NULL;
if (front == NULL)
{
if (back != NULL)
result = strdup(back);
}
else
{
result = (char *)malloc(strlen(front) + strlen(back) + 1);
sprintf(result,"%s%s", front, back);
free(fr... | 1 |
b5b0060408b9acf867ef8d1fe8dd18db | f4c63c907f20109424b0b6d9c747d710 | 跟进客户数排行页面 | class Statistics extends Base
public function client()
{
$initYear = 2016;
$thisYear = date('Y');
$thisMonth = date('m');
$statistics = new statsModel();
if (request()->isPost()) {
$data = input('post.');
}
if (!isset($data)) {
$data['y... | 1 |
fa0a453bee0eb46817cfbb03e0309036 | 5d28ff96612bbdb28098061aa5ae04e5 | Returns the total duration (in seconds) of all the directions | class Session(COMObjectWrapper):
def duration_all(self) -> float:
return self._iv8obj.durationAll | 1 |
681f7c13a3cde95266e0ea0f9a6296e8 | 71fc4f0d3494aa787c775e826785d3f3 | Set the identifier generation strategy. | {
_builder.Alter = m => m.IdStrategy = new IdentityKeyGeneration(m, m.HiloSettings);
return this;
} | 1 |
776aa62b3c7c1d30734c5d1765103ca0 | f029143981a62b6b6cbe9589c6d935c0 | Get the spam rules model. | class ModelRepo:
def get_spam_classifier(self, type: ModelType = ModelType.SVM) -> Pipeline:
return self.__models[type] | 1 |
d5dadd8a438a2f29973fc45f165618ce | ed5252f17c03fbf00a5cdb0220187cd2 | 水平净距分析 | {
var results = Global.cons.DelHCCD(hd1.ToString(CultureInfo.InvariantCulture),
hd2.ToString(CultureInfo.InvariantCulture), qy.ToString(CultureInfo.InvariantCulture), bid, zywid, fywid,
Global.searchlen);
if (results == null)
return;
... | 1 |
2f73bdd2923a37b9696acb300eb03cf8 | f39e996fbddd141a9c8b9abc4b1617a6 | 修改当前一级分类下的open数据为false | @Service
public class ZtreeServiceImpl extends BaseService implements ZtreeService
@Override
public void setIsPatrentFalse(String id) {
this.ztreeRepositories.setPatrent(false,id);
this.ztreeRepositories.setLeafePid(id,ZtreeEnum.rootId.getEnumName());
} | 0 |
35b09510fa124eb2ede45b3e2dc0b3ae | c9267b562bc6af5083b4bb761d077185 | Richiama il metodo corretto per l'analisi degli header | namespace Tool_Importazione_Leghe.ExcelServices
public class XlsServices
private void AnalyzeSyntaxAndExcelContent(CurrentModalitaExcel currentModalita, Utils.Constants.TipologiaImport currentTipologiaImport)
{
} | 0 |
e369f5b854a38a8e2046e9838bc82d7f | 693ae5980ce987b13eaca9924252f766 | Sends a generic message packet to server | {
if (MxmNetworkManager.Instance.NetworkClient == null)
{
MxmLogger.LogFramework("No client present on host");
return;
}
NetworkWriter writer = new NetworkWriter();
writer.StartMessage(msgType);
msg.Serialize... | 1 |
b9273d3ff6dd56aa75245b273fba2982 | da87510846feec015e8170748c0d5a63 | Used when Aliens are all dead | public class Server extends Thread
public synchronized void notifyAlienKilled() {
levelManager.getCurrentLevel().hasOneEnnemyDestroyed();
for(Entity entity : entitiesManager.getEntityListSnapshot()) {
entity.setNotifyAlienKilled();
}
} | 0 |
33b1892c10f7bf2e6cebb73c5604f2e5 | da45375e89e3f5132a5ac3ff969e4f49 | Returns the required prayer level to use the prayer. | public int getRequireLevel(); | 1 |
6904aeb4b2fa0f333fc66b1c97fbd70d | 01f5f1879e9bcf23993116c5e7519ca0 | 根据item属性返回其关键属性值,
propValueList是当前类目cid下的所有属性及属性值 | @Service
public class TaobaoCatServiceImpl implements ITaobaoCatService
@Override
public Map<TaobaoItemCatPropVo, List<TaobaoItemCatValueVo>> findCatPropDetail(
long cid) {
List<Map<String, Object>> list = taobaoCatMapper.findCatPropDetail(cid);
Map<TaobaoItemCatPropVo, List<TaobaoItemCatValueVo>> vMap = new Ha... | 1 |
6faf6f68d4c4df296eba05bbd98948fc | 3b79331797ed20a86cbb71197f9039b1 | Metodo per creare il pannello dove si inseriscono le informazioni sul cliente prenotante. | shell = new Shell();
shell.setSize(340, 286);
shell.setText("New customer");
Utils.centerDialogOnScreen(shell);
Label lblGuestId = new Label(shell, SWT.NONE);
lblGuestId.setBounds(33, 42, 61, 17);
lblGuestId.setText("Guest ID");
text = new Text(shell, SWT.BORDER);
text.setBounds(167, 42, 100, 23);
t... | 1 |
a56b06ebf41bb74d96c18d5fbc067376 | 6917826b03e093bb73afb565b404e3d4 | 通过昵称和电话查询用户的id | String findId(@Param("name") String name, @Param("email") String email); | 0 |
3aedc76bbf6f2beb2b5c08f70ad19c0e | 4ea10bc4906b9c7d9e3675ccf4051460 | Makes a dialog block input to other UI elements (excluding other dialogs) | public class TextEvents : MonoBehaviour
IEnumerator block(string[] opt) {
if (opt [0].CompareTo ("t") == 0)
DialogueManager.main.block_input = true;
else DialogueManager.main.block_input = false;
yield return true;
} | 1 |
ccbe09497538d36033b4436fcf95b1d0 | e84edad8d0f62b257c70ded1f741493c | 获取当前虚拟坐标, 精确到小数点后3位 | public class CalculateUtil
public static Double get3Decimal(double inNum) {
return (double) Math.round(inNum * 1000) / 1000;
} | 1 |
c12b047f082e80d3b35fec9e13773cd0 | ef3be955053c57bedaaa423c1ab2b553 | Returns default layer input gradient. | data = inputs[0]
grad_data = outputs[0]
grad_data.reshape(data.shape)
grad_data.data[...] = np.zeros(data.shape, dtype=np.float32) | 0 |
7808c41dab364afe8f98d2b8533dbdb6 | bcb90e4aacb6e3e1a9c38fa7bc42e1b3 | Returns the result of interpreting the object as an instance of '<em>Refinement Measure Relationship</em>'.
<!-- begin-user-doc -->
This implementation returns null;
returning a non-null result will terminate the switch.
<!-- end-user-doc --> | public class DrlSwitch<T>
public T caseInfElemRef(InfElemRef object) {
return null;
} | 1 |
594efee5f7aedde9fdc268d9f15b699d | 2d342b645817ef7e1413f9d39cb055db | A get method that retrieves the number of comparison
data points found. | int SList::getComparisons() const {
return this->numOfComparisons;
} | 1 |
73ceac3165ae54eafd62abdec60471d5 | 28256e8bae62d427efd2296833aa9af7 | API возвращает список последних файлов, загруженных на Диск. | [Obsolete("Use the universal file endpoint instead.")]
public ActionResult<ListResult<File>> GetRecentFilesObselete([FromRoute] [Range(0, 1000)] int limit = 100)
=> GetRecentFiles(limit); | 1 |
07848a8b983ef4ba13cbdef41d35b5f4 | 56bee6d0e4f0eab36accbb3de24aec0c | test that when we merge in new untranslated strings with existing translations we manage the encodings properly | posource = '''#: prop\nmsgid "value1 value2"\nmsgstr ""\n'''
proptemplate = '''prop = value1 \
value2
'''
propexpected = '''prop = value1 value2\n'''
propfile = self.merge2prop(proptemplate, posource)
print propfile
assert propfile == propexpected
propfile =... | 0 |
30f6382320ffe2bb40fe80a1c681677e | 9f9e5ac8f0352a6cdf2e0233d20bdcbe | Remove Discount | class DiscountController extends Controller
public function destroy($id)
{
try {
DB::beginTransaction();
Discounts::where('id',$id)->delete();
DB::commit();
} catch (\Exception $e) {
DB::rollback();
return response()->json([... | 1 |
d43192968f19aaf9736d564340893980 | edaebe8bcd46c3cc2879a5eb70f0fbf5 | Get a report data set page # noqa: E501
Retrieve a report data set page # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | namespace com.ultracart.admin.v2.Api
System.Threading.Tasks.Task<ApiResponse<ReportDataSetPageResponse>> GetReportDataSetPageAsyncWithHttpInfo (string datasetUuid, int? pageNumber); | 1 |
731b83399c7f68d5cede1ab1176750f0 | 957482265d44752d6c2859bcc8c3614f | tests that a &str Eq's an equivalent String | fn ec_strings() {
let dsl = strings::dsl();
let examples = vec![
vec![(
vec![strings::Space::Str("OFJQc>BLVP>eMS".to_string())],
strings::Space::Str("OFJQc/BLVP/eMS".to_string()),
)],
vec![(
vec![strings::Space::Str("OFJQc<BLVP<eMS".to_string())],
... | 0 |
d0ada773012efdde495befaa835d1f3e | 879e77fa14e67308f8cc635b5481e133 | does the list exist? | class Plotter:
def exists(self, name):
return name in self.listnames() | 0 |
2304459fbc0026eee92e1ca967c68067 | a250c6a4a2aa9e865256cd73f72e9f21 | Выполнить опасное подключение. Может вернуть исключение в случае неудачи. | class MySqli extends mysqliBase
#[\ReturnTypeWillChange]
public function real_connect($host = null, $username = null, $passwd = null, $dbname = null, $port = null, $socket = null, $flags = null)
{
$this->connectionAttempted = true;
return parent::real_connect($host, $username, $passwd, $dbname, ... | 0 |
fca867c76096bb81eada9e5a01cd1831 | 64763e43faf796e3814c2f3c420c7057 | Validate int (or uint) field, that it is a number and is in range [bottom,top], giving message in label if not (clearing if so) | namespace Sirenix.Utilities.Editor
public static class SirenixEditorFields
public static int RangeIntField(string label, int value, int min, int max, params GUILayoutOption[] options)
{
return SirenixEditorFields.RangeIntField(label != null ? GUIHelper.TempContent(label) : null, value, min, max,... | 0 |
7d990dcb8f0a87b9d3d0c46c714d6b23 | 43aa81749bab8468cdc9db7811234dea | Dumps statistics for the node to the log. | public class PrimaryTrafficGenerator
public String[][] logStats()
{
return PrimaryTrafficGeneratorNode.logStats(registeredNodes);
} | 0 |
adfc5bc54832de2183e8cdcf99404846 | 909cb9a89c254efe6381d57f48c876ca | Clears the GUI of movie fields for adding. | namespace CinemaProject
public partial class MainGUI : Form
public void SetMovieDetailsBlank()
{
lblMovie.Text = "";
lblMovieDesc.Text = "";
lblMovieDirector.Text = "";
lblMovieDuration.Text = "";
lblMovieProducer.Text = "";
lblMovieTit... | 1 |
d6c6481c0059b76099be7d4f4ef8508a | 03b9e1de6935e52ec8f06230d25e5777 | Separate the nx2 matrix in two lists. | output = [[], []]
for i in range(0, len(array)):
output[0].append(array[i][0])
output[1].append(array[i][1])
i += 1
return output | 1 |
a9d12d08ff901f72c3df11214c9b75b5 | 0bb01dcb371db68c0c945eb4a7551d31 | 初始化画板,获取canvas节点对象,设置画板的宽高,线条宽度,样式 | if (typeof opt.ele === 'string') {
this.dom = document.getElementById(opt.ele)! as HTMLCanvasElement;
this.ctx = this.dom.getContext('2d')!;
this.dom.width = opt.width || 0;
this.dom.height = opt.height || 0;
}
const { left, top } = this.dom.getBoundingClientRect();
const selfSty... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.