query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
981977934efa31cd757fcafe7399fda6 | 38c618efb5d2ef25d4c13b61b670f3b8 | Blacklist the currently selected ID to ensure it never shows up again | {
if (!$this->getId())
{
return false;
}
return self::removeFromBlacklistById($this->getId());
} | 0 |
d89d978ea0998204041cb83d8588527a | d4a7b1d741cba2e603afb2c0d9467126 | Determines if this object redirect is one that requires a routing rule.
need to be replaced (which can only be done via routing rules); and secondly (most importantly), S3 does not handle object redirects for
collections (ending in a slash, e.g. <code>foo/bar/</code>) anyway. | switch (statusCode) {
case HttpStatusCodes.STATUS_CODE_MOVED_PERMANENTLY:
case HttpStatusCodes.STATUS_CODE_FOUND:
case HttpStatusCodes.STATUS_CODE_SEE_OTHER:
case HttpStatusCodes.STATUS_CODE_TEMPORARY_REDIRECT:
case HttpStatusCodes.STATUS_CODE_PERMANENT_REDIRECT:
return tr... | 1 |
cd1a23eb1c7561f42698eb23c727c456 | b71bcae321ca35e2c43e999947e8260d | vip商家发布商品的获取规则接口
tmall.item.vip.add.schema.get
获取vip商家发布商品的规则 | public class TicketApi : PddCommonApi
public async Task<GetTicketSkuRuleResponse> GetTicketSkuRuleAsync(GetTicketSkuRule getTicketSkuRule)
{
var result = await PostAsync<GetTicketSkuRule, GetTicketSkuRuleResponse>("pdd.ticket.sku.rule.get", getTicketSkuRule);
return result;
} | 0 |
ab9a29f23826fa4868e5722bd60c6a0d | 1d603828d481342b2884449ad4dcec94 | Метод разрушения кирпича. Удаляет кирпич на холсте. | var hit = scene.pickWithRay(this.rayHelper.ray);
if (!hit.pickedMesh || !hit.pickedMesh.brickClass) {
return;
}
else {
Brick.deleteBrickById(hit.pickedMesh.brickClass.id);
UI.Audio.clickRemove.play();
}
} | 1 |
fee3c2e88d4573466680c98c1dcd7bbe | b17997e15cc300e96da01c6261336c0f | 获取我关注的好友的话题列表 | @GET("my/following")
Call<TopicsPageData> getFavoriteMembersTopics(@Query("p") int page); | 1 |
15ce5056c40f0f0200c90c55b4d09d82 | c08678f32eead79970e11ee56e39f390 | Takes a regex string and tries to fix all the known errors from the text comparison output | def correct_typos( the_string ):
for typo in known_typos.keys():
if typo in the_string:
correction = known_typos[ typo ]
the_string = the_string.replace( typo, correction )
return the_string | 0 |
7a5981bbb32529b764b3b77f624263bd | 45268e8f64e5b433e91a15b8017eb5bb | 关闭NpcShop | namespace SagaMap.Scripting
public abstract partial class Event
public void NCShopOpen(ActorPC pc)
{
if (pc.UsingShopType != PlayerUsingShopType.None)
return;
MapClient client = GetMapClient(pc);
Packets.Server.SSMG_NCSHOP_CATEGORY p = new SagaMap.Packets.... | 0 |
ca5911e942368a0e1f0b1e1fccaefb10 | 83aaace00a2425cbc7cad40ea08f064c | iterate through the submit annotation todo list and post annotations | export class AppComponent implements OnInit
postAnnotation() {
if (this.textSelection !== null) {
this.postingAnnotation = true;
this._annotationService.postAnnotation(this.textSelection);
this.textSelection = null;
setTimeout(() => this.postingAnnotation = false, 500);
}
} | 0 |
371e9894ef2844df35cc5267a0bb49a5 | a2985f5d931fed87fd56aa2f3676a677 | This method sets an error message in the label. | public class IncorrectPasswordFrame extends CommonPanel
public void setErrorPane(String displayable) {
errorPane.setErrorText(displayable);
} | 1 |
9ecc4a067012602e7035c3082a0798fd | c6cd2927ef616616f95783bd0823956c | SSM parameter where the bootstrap stack version number can be found.
Only used if ``requiresBootstrapStackVersion`` is set.
- If this value is not set, the bootstrap stack name must be known at
deployment time so the stack version can be looked up from the stack
outputs.
- If this value is set, the bootstrap stack can ... | result = self._values.get("stack_instance_control")
assert result is not None, "Required property 'stack_instance_control' is missing"
return typing.cast(builtins.str, result) | 0 |
ccc1dbb6a494c4adc5825089b9268ef8 | 840f2d0a2693c1716eff7fc3c8ac495d | Set DRAM timings based on engine clock and memory clock. | {
if (ENABLE_LPDDR3) {
uint32 tmp;
ABHN_DPE_Program_MRW_AFTER_FREQ_SWITCH(_inst_,
0,
1,
0x2,
MR2_value);
ABHN_DPE_Program_MRW_AFTER_FREQ_SWITCH(_inst_,
1,
1,
0x1,
MR1_value);
tmp = HWIO_INX (_inst_, ABHN_DPE_DRAM_TIMING_16 );
tmp = (tmp & ~(HWIO_ABHN_DPE_DRAM_T... | 1 |
419c8a2503bf1436c5c37b56fa8d704e | 3bf0219a6238ea769feffc603dae00d1 | Dodaje spółkę na podstawie określonych danych. | namespace eFaktura.Abstractions
Task CreateCompany(CompanyEntity companyEntity); | 1 |
6475cba8b6a43dec6da4b7dfc0efd326 | e20cd32a426a1e3fe49741b08bda9d7e | 预先加载Web应用必须的类 | {
require(HEI_PATH.'/core/Controller.php');
hei::trace('Controller Class Loaded', array('core.WebApplication', 'debug'));
require(HEI_PATH.'/core/Model.php');
hei::trace('Model Class Loaded', array('core.WebApplication', 'debug'));
hei::set_app($this);
$this->default_... | 1 |
e13c85f5bbcbb56c1319145d952e4989 | 05a28c4cc2460c922de7c5a7444c3ddc | Método que inicia el tablero del J1. | var t = document.getElementById("tablero");
var trs = t.getElementsByTagName("tr");
var tds = new Array(trs.length);
for (var i=0; i<trs.length; i++)
{
tds[i] = trs[i].getElementsByTagName("td");
for (var j = 0; j < tds[i].length; j++) {
tds[i][j].innerHTML = ' ';
}
}
tablero = [['-','... | 1 |
af467bf2adb5b22c8e583c799f5a0548 | 855846b6eb2460192dda184522e5dbd5 | Aid to generating full aliases. Recursively gets and sets the parent alias, eventually creating, caching and returning
an alias for itself. | if (!($entity instanceof ContentEntityInterface) || !$entity->hasField('path')) {
return NULL;
}
if ($entity->path->pathauto != PathautoState::CREATE && empty($options['force'])) {
return NULL;
}
if ($entity instanceof RevisionableInterface && !$entity->isDefaultRevision()) {
retur... | 1 |
cf540a5890706920313f6d4f859a6d86 | f7e78db1d2b039105043a0b9755ccb12 | 判断结束时间是否小于系统现在时间 | {
boolean flag = false;
SimpleDateFormat ft = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try
{
Date end = ft.parse(endTime);
if (d.before(end))
{
flag = true;
}
}
catch (ParseException e)
{
e.printStackTrace();
}
return flag;
} | 0 |
05c4b3dcd976f10670c88aef5775c94c | 777c08ab93313e4ca4ee940b4253e298 | Adds each presentation's information to an sqlite3 database | conn = sqlite3.connect(self.databasepath)
cur = conn.cursor()
images_added = 0
for dict in dict_array:
cur.execute('SELECT * FROM data')
db_columns = [description[0].lower() for description in cur.description]
dict_columns = [column.lower() for column ... | 1 |
21898eb7e207c8d94d1d0c3bbf5aec43 | a56ac4b239edd487b0949474a6b63a55 | Positional arguments and Keyword arguments | def fun_2(*args, **kwargs):
print(args)
print(kwargs) | 1 |
7ae5aae6ce67347fb9c6e70ec5b56f09 | 789c3438eb1fc2d23e779366c275cf45 | Загрузка слайда | var mediaType = images[index].data('mediaType'),
mediaSrc = images[index].data('mediaSrc');
screen.fadeIn(settings.fadeIn, function() {
mediaBoxWrap.show();
content.css('visibility', 'hidden');
preloader.show();
getMedia(mediaType, mediaSrc);
pagination.find('li').eq(index).addClass('active');
... | 1 |
088795def2f8b0ea15daf489c4857c41 | c851fe72a50b84ba4ba92ddaba849dac | Repeat the action while movement button is hold. | public abstract class MainAppState extends AbstractAppState implements AnalogListener, ActionListener
@Override
public void onAction(String binding, boolean keyPressed, float tpf) {
if (!keyPressed) {
roboticArmApp.wasMovement = true;
}
} | 0 |
68bc0a5470649918ac301d77191f50bb | 1f6f2bb7fb2d983b71cc29cfdfcce1ed | Loads a file from Github. | class Gist(object):
def get_file(self, filename):
url = 'http://gist.github.com/raw/%s/%s' % (self.id, filename)
return self.gh.load_url(url) | 1 |
95af99208dce9b5165e451777a799c18 | 960052c04417cc634798d4a7187024b7 | Timer para cargar datos al Datagridview | namespace Kwit_E_Mart
public partial class EmpleadosForm : Form
private void EmpleadosForm_Load(object sender, EventArgs e)
{
CargardataGridViewEmpleados();
} | 0 |
013bf5cff7803ff8c035a13a0e6dc7a9 | be91b6bf9ab709c728dd48233fa73604 | Производит выстрел из пистолета | public class Weapon : MonoBehaviour
void Shoot()
{
RaycastHit hit;
if (Physics.Raycast(bulletExit.transform.position, bulletExit.transform.forward, out hit, range))
{
Debug.Log(hit.transform.name);
Health target = hit.transform.GetComponent<Health>();
if ... | 1 |
3a6c05746c6987982ec0c803799de085 | 5926782e727ef027515519f0b9e66f59 | Construct perturbation potential to violate the symmetries | void constraints(void)
{
vdPowx(DIM, trK, 2.0, ham);
cblas_daxpby(DIM, -1.0, KT2, 1, 2.0/3.0, ham, 1);
cblas_daxpby(DIM, 1.0, RSCAL, 1, 1.0, ham, 1);
writeSingleFile(ham, "ham.tsv");
} | 0 |
46c3f5a8892629744982c95f0a44ba4f | 61be08a0e762b6a3199caffab96eb50d | Import layout database from gds file. | xsd_layer = PagLuxembourg.main.current_project.getLayer(xsdtype)
if xsd_layer is None:
return
progress.setMaximum(gml_layer.featureCount())
progress.setValue(0)
self._importLayer(gml_layer,
xsd_layer,
self._getFieldM... | 0 |
533df260ae4b2270b3aec91f90296c3b | b86e7cd982ca1ce195b56a16515c7556 | Función para chequear si un campo se ha llenado con espacios en blanco,
por medio de una expresión regular | function esUnCampoVacio($valor)
{
return empty(trim($valor)) ? true : false;
} | 0 |
9b9ccd10c36bb4e88e91358434e54a35 | cda5d0c6aa9f275831e38c4026f0cfbd | Metodo principal de la aplicacion muestra el menu y espera a recibir
solicitud de parte del usuario hasta que el decida terminar el programa | int opcion;
do {
menuPrincipal();
opcion = elegirOpcion();
switch (opcion) {
case EXIT:
break;
case STRING_INVERTED:
String cadenaInvertida;
System.out.print("Ingrese la caden... | 1 |
9e627ef42cea61e1ddec589ae2805c04 | 48fcf04367ec385d2e6e12fb0c99e517 | Returns the {@link Warehouse} id of the relationship. | class Part
public function getWarehouseId()
{
return $this->warehouse_Id;
} | 1 |
76b80c3ffdd1cd427fcd8d06c865f4e7 | b33eed34ab9ccd1179f848f205626e4c | 根据组织ID重新统计指定类型文件大小(非线程安全) | @Override
public ApiResult recalcSizeUnsafely(String companyId, FileSizeSumType sumType) {
if (StringUtils.isBlank(companyId))
return ApiResult.failed("未指定组织ID", null);
CompanyDiskDO cd = companyDiskDao.selectByPrimaryKey(companyId);
if (cd == null) {
log.info("找不... | 1 |
9eab3f73ea2e0cca24ed2349541fb5c6 | ca301da4f6afae1418e58f04e7fe0ee4 | Get the path to a child's socket | String childSocketId(); | 0 |
b90883d9e49f8c57416695529d3f3244 | 483e852e2a368e284faef7ae905cdc50 | Upon clicking GROUP, goes to activity listing groups. | public void onClick(View v) {
Intent intent = new Intent(v.getContext(), GroupScheduleHistoryForm.class);
intent.putExtra("groupName", list.get(position).getName());
context.startActivity(intent);
} | 0 |
98a41db22f3a571af4eb210330186f7f | e3b0c93f44d9fa3820e883a2dcf2dff3 | Sets the current operator identifier. | public abstract class ProfileEJBBean implements javax.ejb.EntityBean
public abstract void setOperatorID(java.lang.Integer newOperatorID); | 1 |
41fec4cf6ea16802246246bb81a1cd57 | efeb87e25e5ea90086baa7e5e2a391d4 | 5.交易员都在哪些不同城市工作过? | public class TraderTest
public static void test1(){
Trader raoul = new Trader("Raoul", "Cambridge");
Trader mario = new Trader("Mario","Milan");
Trader alan = new Trader("Alan","Cambridge");
Trader brian = new Trader("Brian","Cambridge");
List<Transaction> transactions = Arrays.a... | 1 |
ef4b040fe20904d89fb2844988ee34a3 | ae09bf31226e8a1d313d58cf9d007a0a | Test de recibir daño. Verifica
que la vida restante luego de
recibir un ataque sea la correcta
para la combinacion de vida inicial
daño recibido, y valor de defensa. | namespace Test.Library
public class DwarfTests
[Test]
public void Test7()
{
Dwarf20.Curar();
Assert.AreEqual(Dwarf20.Health, 170);
} | 0 |
59476b205de1ee4523e237550ad5c5a1 | f284bece6dabaabf6bb4005ad34862f3 | 广度优先搜索(层序遍历) | export default class Graph
public breadthFirstSearch(): void {
this.clearVisited();
for (let i: number = 0; i < this.nodeList.length; i++) {
this.depthTraverse(i);
}
} | 0 |
4d160e560f5861ce7110617ed0c8e4a4 | 7d13b242c982b558818d6d008dc2cd1a | Stops the message manager. Call this to safely close the application. | {
jassert (! isTimerRunning()
|| MessageManager::getInstanceWithoutCreating() == nullptr
|| MessageManager::getInstanceWithoutCreating()->currentThreadHasLockedMessageManager());
stopTimer();
} | 0 |
cb57865b6561b6dc2da8790427dbe6d0 | 36631eadca2cce03be0a863f965394b9 | Print a single link | function printLinkEntry( $name ) {
?>
<tr bgcolor="<?php echo ac(); ?>">
<td align='center'>
<a href='links_list.php?n=<?php echo $name; ?>'
style='text-decoration:none'>
<?php echo getGameName( $name ); ?>
</a>
</td>
</tr>
<?php
} | 1 |
da28b4971017e0cba65ff4c0b021bab8 | 774d67ebf2a72a7a0b3a46fe533dbd12 | This API is used to delete an auto-scaling group. Make sure that there are no `IN_SERVICE` instances in the group, and there are no ongoing scaling activities. When you delete a scaling group, instances in the status of `CREATION_FAILED`, `TERMINATION_FAILED` and `DETACH_FAILED` are not terminated. | public class AutoScaling extends AWSQueryConnection
public void deleteAutoScalingGroup(String autoScalingGroupName) throws AutoScalingException {
Map<String, String> params = new HashMap<String, String>();
params.put("AutoScalingGroupName", autoScalingGroupName);
HttpGet method = new HttpGet();
makeRequestInt(... | 1 |
17fa5f0d0549d21a398911e315f073bb | 729f42dec09eb097f3b2e3f7a256c6e5 | Constructs and returns the algorithm currently chosen to handle finding all possible paths in a graph. | function getRandomAlgorithm(); | 0 |
e0922daf73827f637e27ff94accfbcca | 0ba321ba4176fae55325fdef25b9ba30 | Retrieve the key for the selected row | {
int[] selections = Grid1.SelectedRowIndexArray;
StringBuilder keys = new StringBuilder();
for (int i = 0; i < selections.Length; i++)
{
keys.AppendFormat("'{0}',", Grid1.DataKeys[selections[i]][0]);
}
return keys.ToString(... | 1 |
ebb6f36c34b9c98f605a73de0aa215bd | 8c559fc402410d232e8e427607d25f02 | Function to compute stresses and viscous strains using the
effective stress function algorithm. | int elemIndex, const double time, TacsScalar scale, int n,
const double pt[], const TacsScalar X[], const TacsScalar Xd[],
const TacsScalar Ut[], const TacsScalar Ux[], const TacsScalar Psi[],
const TacsScalar Psix[], int dvLen, TacsScalar *dfdx) {
TacsScalar rho = stiff->evalDensity(elemIndex, pt, X)... | 0 |
74a8ca91041bde168d247702850ff03b | 00fff397785f6155d572b55f6a6bc813 | convert commitString into keyevents | public boolean sendTextEvents(String text, long delay) {
Log.v(LOG_TAG, String.format("Sending text events for %s", text));
KeyEvent[] events = mKeyCharacterMap.getEvents(text.toCharArray());
for (KeyEvent event : events) {
if (KeyEvent.ACTION_DOWN == event.getAction()) {
if (!mD... | 1 |
bfbbac7a504ec46a85d77622f5683e82 | e1d7cba39a4c48657287c96e782ae7cd | Test that a anonymous user can not access resource protected by
require(in_group(...)) | class TestUsers(TestCase):
def test_anonymousaccess(self):
c = Client()
response = c.get("/optional_resource")
self.assertEqual(response.status_code, 200)
self.assertEqual(response.content, "AnonymousUser") | 0 |
b626e20f74a2cdd7ba96cf7f3e504307 | 8447dec5d9a972bfba96f919302095b9 | Set whether or not a notification should be automatically generated for this activity.
Set this to `false` if the app already generates a notification for the event. | @ConnectScope
class NotificationBuilder
NotificationBuilder setAutoCancel(boolean autoCancel) {
builder.setAutoCancel(autoCancel);
return this;
} | 0 |
4260732dfb24001fa020f80c9fe3e41a | 8299f67b24283d1da648b9384755b3d8 | Aborts the operation to write to the blob. | namespace Microsoft.WindowsAzure.StorageClient
public abstract class BlobStream : Stream
public virtual void Commit()
{
throw new NotSupportedException();
} | 0 |
7632ef315327c78bb44276414238ca49 | de4aa8fbab32ba8f2248bd9df55601c2 | 找回交易密码获取验证码 | {
if (checkClick(v.getId()))
{
HttpParams httpParams = new HttpParams();
httpParams.put("phone", phoneNumber);
httpParams.put("type", "ZHZF");
HttpUtil.getInstance().post(this, DMConstant.API_Url.GETMOBILECODE, httpParams, new HttpCallBack()
{
@Override
public void onSuccess(JSONObject res... | 1 |
3068fa219ff5c193f1c211c73005b433 | 676f215dc1b614dea00f5098d9abb443 | 表示帐户密码是否已过期,已过期的需要阻止登录或要求修改密码。 | {
return Clover.Config.WebSiteConfig.Config.UsePassWordStrategy && (model.PasswordLastUpdateTime == null || DateTime.Now.Subtract(model.PasswordLastUpdateTime.Value).Days
> Clover.Config.WebSiteConfig.Config.ChangePasswordPeriod);
} | 1 |
f1ba18a02a00963d8ed394b2e5b16acd | fa112d1b45bf9349351c10e412ec0456 | Fungsi untuk membuat tombol aksi pada tabel | if(document.querySelector("#button"+data.id.toString())){
counter++;
}
else {
counter = 1;
}
if(document.querySelector(".btn")){
document.querySelector(".btn").remove();
}
let button = document.createElement("button")
let header = document.getElementById("title"+data.id.toString());
button.setAttribute("... | 1 |
5d2d9d016f2e01186b15695d214b978a | b984b1759a640d4eb418132b6948c38b | returns the BTreeNode that will replace current in deletingNonLeafCase | int cessor = 0;
int deletion_for_merge = 0;
if (cur_node->child[cur_node_pos]->cnt_key >= cur_node->child[cur_node_pos+1]->cnt_key){
if(cur_node->child[cur_node_pos]->cnt_key > min_keys){
cessor = overrideWithPredecessor(cur_node,cur_node_pos);
deleteValFromNode(cessor,cur... | 0 |
24cf469e3c05f2188da0790001edffa9 | 9cf0fc4b631103fcaaf6ed8a887dac65 | Sets all maximum goals. | Grades bOs = (Grades) boulderOSSpinner.getSelectedItem();
Grades sOs = (Grades) sportOsSpinner.getSelectedItem();
Grades bWorked = (Grades) boulderWorkedSpinner.getSelectedItem();
Grades sWorked = (Grades) sportWorkedSpinner.getSelectedItem();
user.getAnnualGoal().setHighestBould... | 1 |
e5e0a41ff21aeff7a994dc0c4d1b3867 | 3a73dc5acf3a319e70070a05caa34c25 | Notify the triangle renderer that the Window size has changed. | void GLFWwindowresize(GLFWwindow*, int w, int h) {
GLResize(w, h);
} | 1 |
f59e5bbe361912b3187aeeaadba60b42 | 30168e8e79cb8843fdc87a68cbefba43 | LC_0008 | int main(int arg, char *argv[]) {
cout << "LeetCode 378. Kth Smallest Element in a Sorted Matrix, C++ ...\n\n";
Solution sol;
vector<vector<int>> matrix {
vector<int> { 1, 5, 9},
vector<int> {10, 11, 13},
vector<int> {12, 13, 15}
};
int k = 8;
int r = sol.kthSmallest(ma... | 0 |
18f394b42ab38eaddc975af9813a3930 | 92a5821d0fd1f07ec59f2f372c2bc2fb | e.g. Urgent | @Entity
public class TicketData implements Serializable{
public void setUrgency(String urgency) {
this.urgency = urgency;
return;
} | 1 |
e5484bd2bf840ce477c61b9dff77ec3a | d2d734336808f253d6534db2a26252be | Returns a collection containing all the known test steps. | public class DocInformation
public Collection<StepInfo> getSteps()
{
return steps.values();
} | 1 |
3f019b8a0cb455e983e76a88017aa888 | 7f61448ad6da3ef0f9cb03f40c5be655 | Do the actual work. | cases like (1) | 0 |
47e2ae8b1a911c951864d4b2ac6b6d69 | 927f1860e2fd1c75b64e7d535cee70e9 | Calculate nDCG | class NDCG(EvalMesure):
def __init__(self, p = None):
super().__init__()
self.p = p | 0 |
171886bf2541dbb2227990f1512a6ae7 | d2953a99213ade7f1fd860c83113fd8a | Returns array of Xmlify test arrays | {
return [
'Empty string' => [ $this->getXml('xmlerr_0001.xml'), ],
'XML declaration only' => [ $this->getXml('xmlerr_0002.xml'), ],
'Root end tag missing' => [ $this->getXml('xmlerr_0003.xml'), ],
'Attribute redefined' => [ $this->getXml('xmlerr_0004.xml')... | 1 |
e2746307a1de31189c706925c0ed571e | de5ec14cd37851d265b7c4c9d66987c1 | Filters the variables that will be set on the View template.
template hence the key will be the name of the variable available in the
template. | params.require(:template).permit(:name, :body,
template_variables_attributes: [
:template_id, :name,
options_attributes: [
:text, :template_variable_id
]
]
)
end | 1 |
904581fa93e700a84c709e183b1c3460 | 026c6cad915ffeb8807b77cb6e4d7dd7 | 5.实现根据员工姓名查询员工完整工号功能。 | String selectNameByEmpId(@Param("employeeId")Integer employeeId); | 0 |
c409fe4dcc223c488e901817062b5472 | 78aeb69f53708d32bce0402d65c0071e | Returns the sizes of the communities as a map from node id to size | Map<String, AtomicInteger> getConnectionSize(); | 0 |
cbb00797f5d31097fa6aff22c1d28fd4 | fad84a838d9eb0548c870fe06238241b | Cancela la edición y ejecuta una acción diferida si el usuario accepta la confirmación
de perder los cambios. | if (!this.editando) {
return true;
} else {
return new Promise((resolve) => {
if (this.modificado) {
this.mensajeService.descartarCambios().then(confirmacion => {
if (confirmacion) {
resolve(t... | 1 |
084a95009b4c85ff9c5e740a22c6bb0f | c1a3a12d65adf30e3632ef4be8900254 | Mixes some list of values using another list of values. | def _even_mix(list_a, list_b):
total_len = len(list_a) + len(list_b)
increment = total_len / len(list_a)
result = [None] * total_len
i = 0
for e in list_a:
result[int(i)] = e
i += increment
list_b_copy = list_b.copy()
for i in range(0, len(result)):
if result[i] is No... | 1 |
26a81099d2e6983d9067a8b34c82ff10 | a1cdbbc4d0988de8cf71dd8b5a8bd208 | This function is called by the RS485 driver when a requested read
completes. | static void handle_int_read(int sub_dev_nr)
{
sub_dev_t *sub_dev_ptr;
sub_dev_ptr = &sub_dev[sub_dev_nr];
sub_dev_ptr->DmaLength += 1;
sub_dev_ptr->DmaFillNext =
(sub_dev_ptr->DmaFillNext + 1) % sub_dev_ptr->NrOfDmaFragments;
data_to_user(sub_dev_ptr);
if (sub_dev_ptr->DmaLength == sub_dev_ptr->NrOfDmaFragme... | 1 |
412aea97ff040eac6571610055a377ea | c832b5855215f3e124643ea9fdde190f | 处理IotGetMqttInfo()返回的数据 | {
m_loginInfo.clear();
QXmlStreamReader reader(data);
while(!reader.atEnd())
{
if(reader.isStartElement())
{
if(reader.name()=="ret")
{
m_loginInfo.insert("ret",reader.readElementText());
}else if(reader.name()=="message")
{... | 0 |
06113aa635c5a6244d72b0c7ba5d8e86 | a5a3b6bc54215731db126a0749659493 | Returns the name of the member. The search will be carried out in the following order: <br />
返回成员的名称。将按照以下顺序进行寻找:
<para>
- <see cref="DisplayNameAttribute"/> <br />
- Name
</para> | namespace Breeze.Lib.Base.NBase
[Serializable]
public class NDisplayNameBase : NBaseModel
public override string ToString()
{
return this.DisplayName;
} | 0 |
956e9767ee0de44719e1d4ecc6d274aa | 09bffe832641f6178c06948d22af1647 | Get adjacency list of graph | public class CityGraph
public Map<Vertex, LinkedList<Vertex>> getAdjList() {
return adjList;
} | 1 |
b75a0af1e79fef8ab3597167f49b4b7e | 2a02bbd78131e06cb3dfdd7b03795bc7 | Source: https://stackoverflow.com/a/3663505 | def chunks(l, n):
n = max(1, n)
return (l[i:i+n] for i in range(0, len(l), n)) | 1 |
237fa88582c833e1cd8f90e447d8ac5c | 99cd732d819eaa3f4606b526165e0587 | Funcion que permite consultar los espacios permitidos para cursar por el estudiante | $cadena_sql = $this->sql->cadena_sql("consultarEspaciosCursados", $this->datosEstudiante['CODIGO']);
$resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, "busqueda");
return $resultado;
} | 1 |
a1716b04c86b3d07dd119303bb225c3b | c51e5cfab81adbbff25e79dc1f199154 | Які продукти купляли усі покупці? | class HomeController extends Controller
public function getBuyProd()
{
$products = Sales::where('user_id', Auth::user()->id)->get()->groupBy('product_id');
return view('home.buy', compact('products'));
} | 0 |
4df479eab8ae26e71c1bfb0a69ff9958 | 9d0a14f5bf533ddd213375d21dad8a9b | GET: Zwierzeta | {
using (var dbContext = new DbContext())
{
var usterki = dbContext.Usterki.GetAll();
return View(usterki);
}
} | 0 |
5fcac9098cbd71ff29f89df826ff768e | afa1ee5dd9481cf74c2f40162e291d36 | initialize the pins for all 3 phototransistors | void init_pins2(){
pinMode(trigPin1,OUTPUT);
pinMode(echoPin1,INPUT);
pinMode(trigPin2,OUTPUT);
pinMode(echoPin2,INPUT);
pinMode(trigPin3,OUTPUT);
pinMode(echoPin3,INPUT);
pinMode(trigPin4,OUTPUT);
pinMode(echoPin4,INPUT);
pinMode(trigPin5,OUTPUT);
pinMode(echoPin5,INPUT);
pinMode(trigPin6,OUTPUT);
pinMode... | 0 |
4f477354f2a32f042fb6c105ec71e962 | 773e055c7349ef44a1b202832b9a8dad | Assign a delegate to the pool.
PoolDelegate<T> | namespace CookBook.Pooling
public class Pool<T> : IPool<T>
public Pool<T> AttachDebugger(IPoolDebugger<T> debugger)
{
Preconditions.CheckNotNull(debugger, "debugger");
if (debuggers == null)
debuggers = new List<IPoolDebugger<T>>{ debugger };
else debuggers.Add(debugger);
return this;
} | 0 |
cc5a970d5b1cf138fdcafc0cf8af1646 | 798ec60b0878aab4785eae8161075f06 | Nothing to do here, since RawScriptBasedMapping has no cache, and
does not inherit from CachedDNSToSwitchMapping | namespace __sanitizer
void MemoryMappingLayout::LoadFromCache() {
} | 1 |
041d650817959b205c2277f1acae66de | b753311c3551309f18a0eee70cdc153e | Loop through all handles. Upon detection of a handle signalled by poll,
its corresponding event handler is fetched and invoked. | {
size_t i = 0;
for(i = 0; i < noOfHandles; ++i) {
if((POLLRDNORM | POLLERR) & fds[i].revents) {
EventHandler* signalledHandler = findHandler(fds[i].fd);
if(NULL != signalledHandler){
signalledHandler-> handleEvent(signalledHandler->instance);
}
}
}
} | 1 |
f91ad9fa86ec88400dbf136a36bfcd3f | 7d12c2f295ba890f0e5047fbd5ba5e90 | 售后延期确认 | @Controller
@RequestMapping("/storeback/ordermain")
public class OrderMainController extends BaseController<OrderMainModel, OrderMainQueryModel>{
@RequestMapping(value = { "/confirm" }, method = { org.springframework.web.bind.annotation.RequestMethod.GET })
public String confirm(@RequestParam("uuid") String uuid,Model... | 1 |
830a2fa6ca758e384c005590d7929114 | 898e65a03257c755744c17023b3a5fa5 | Builds hashmap containing movie id as key and movie name as value | def name_id_mapping():
movie_names = {}
file_open = open("ml-100k/u.item", "r")
for line in file_open:
line = line.split("|")
movie_names[int(line[0])] = line[1]
return movie_names | 1 |
2021f28f0bea5bbf2cfcfa3b57d662c4 | 3944bfdbccdb99dd7df709866908f1c0 | Create a changeset
Allows one or more functions to be passed, which will each represent a change
in the result. | res = []
for func in functions:
ret = func(data)
if not isinstance(ret, list):
raise TypeError
res.extend(ret)
return res | 1 |
09b340c8f28ef0f6e38b6ed54b776fc2 | bc1a882b0e572e6bd96a2a26305a1197 | Si presionamos izquierda o derecha aumentamos/disminuimos el puntero del array
para ir seleccionando distintos modulos
cada que se selecciona uno nuevo se llama a la funcion de para cambiar el modulo activo
y ejecutar una animacion (o blink) | this.actual += cambio > 0 ? 1 : -1;
this.desde += cambio;
if (this.desde <= 0) {
this.desde = 0;
this.actual = 1;
}
this.ejecutarCallback();
} | 1 |
d7a6fa7bf459c935ebe338b55775b3db | e44ae0620d621e83ac46d2c657144238 | 获取当前日期。 <br>
获取的日期格式为yyMMdd | @SuppressLint("SimpleDateFormat")
public final class DateUtil
public static String getCurrentTimeYYMMdd() {
SimpleDateFormat sDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String date = sDateFormat.format(new Date());
return date;
} | 0 |
e00c44224960828bca0640a856d052dc | 707dc13ef36b82b9b825b04e21367d34 | https://stackoverflow.com/a/12514470/1013828 | var i = haystack.indexOf( needle, offset );
return i >= 0 ? i : false;
} | 1 |
9e96bdeac32228791b614916b3ab67a1 | 8c17addfb1f0001b6e4761340904970e | 获取GPS可见卫星数 | public class GPSInterface extends PlayerDevice
public synchronized byte getNumSats () { return numSats; } | 1 |
a2ab6ec9732521cf58ec21da96924e3f | e8b03bcd625df08b3f871e531ff95cf1 | Ratings for Review, switches star image according to a new start rating passed in. | public class VotingPageActivity extends NoBackPressActivity
public void changeImage() {
++changeDrawingCounter;
previousRating = 0;
String playerName = playersNames[changeDrawingCounter];
changeDrawing(drawings[changeDrawingCounter], playerName);
addStarAnimationListener();
... | 0 |
94d9bb8945b626dbbc4dd73d72dd96b4 | aa25197b19032055ee48914a1e04745c | 地震回数に関する情報を構造化する | def count(code, state_datas):
code = base.format_stockcode(code)
states_waves = split_waves(state_datas)
wave_datas = []
for states_in_wave in states_waves:
wave_data = count_wavedata(code, states_in_wave)
if wave_data['type'] != 'x':
wave_datas.append(wave_data)
return... | 0 |
3985bb89ccb86f9db270552929504ba8 | 339411a57645ea9f317903efd8b15db8 | 网络图片文字识别 根据图像路径
用户向服务请求识别一些网络上背景复杂,特殊字体的文字。 | namespace XiaoYueStartUpForWpfApp.core.control_station
class ImgRecognitionControl : GeneralControlStation
private string TextImageRecongnitionUsual(string getImgPath)
{
string ownerUri = "https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic?access_token=你获取的ak";
Encoding encoding ... | 1 |
0d49b4a02952e87b7de95ec874d8a701 | 6fb65b5ed63b3bc80be6311328ae83ce | # Função para fazer a máscara de pixels | if( (alpha < 0) || (alpha>1)) stop("alpha nao pertence ao intervalo [0, 1]")
rgbcol <- t(col2rgb(col)[-4,])/255
colhex <- rgb(rgbcol, alpha = alpha)
return(colhex)
} | 0 |
e6f3b25396b4d4be859ccef19ee8d8dc | b55979b444d0fdb14b2990ac4ef2eb70 | return the coordinate of a cell which has lots of number can be placed | max_constr = -1
optimal_cell = (-1, -1)
for row in range(grid.shape[0]):
for col in range(grid.shape[1]):
if grid[row, col] != 0:
continue
row_constraints = np.count_nonzero(grid[row, :])
col_constraints = np.count_nonzero(grid[:, col])
... | 1 |
24fd4c14f0a7d9e5b641e13fac248dc8 | 070034aab1c6410aeedf379c29dbbffc | Обработчик события, возникающего при нажатии кнопки открытия .tsp файла | {
var saver = new Saver();
if (openFileDialog.ShowDialog() != DialogResult.OK) return;
try
{
var fileLoadedEventArgs = saver.OpenFromFile(openFileDialog.FileName);
FileLoaded?.Invoke(this, fileLoadedEventArgs);
}
... | 1 |
8ee24c51f8517fa52f649de9cc4a50ac | e016be02a0783426ad1081cf4f339861 | Removes the commits given after the one from the argument. | public class Tree implements Serializable
public void commitCommand(String[] args) {
commitFromStage(args[1], false, null);
Stage.clear();
Stage.clearRemoved();
} | 0 |
305c17bf391b016fd682474a80ac164f | 3c999382d85913794637de4d1258a43a | Gets input for the brainfuck program | class BrainfuckInterpretCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("select_all")
if not self.view.sel()[0].empty():
self.code = re.sub(r'([^><\+\-\.,\[\]])', '', self.view.substr(self.view.sel()[0]))
if self.code.count('[') != self.code.count(... | 1 |
d28c8213d1ff260a122f94960a29389b | ea5702263819aa6c91155320697fdce3 | find end of jpg trailers | namespace jpgd
void jpeg_decoder::find_eoi()
{
if (!m_progressive_flag)
{
m_bits_left = 16;
get_bits(16);
get_bits(16);
process_markers();
}
m_total_bytes_read -= m_in_buf_left;
} | 1 |
2fbfcfb0b03914f22c01e50fa16e255d | 7c49c316d3121bbd79d9adb01beec24e | Details lists runs. | {
$runs = [];
if ($testCase !== null) {
$runs[] = $this->titleLineFrom(
TestResult::RUNS,
'RUNS',
\get_class($testCase)
);
$testResult = TestResult::fromTestCase($state->testCaseName, $testCase, TestResult::RUNS);
... | 1 |
2552a9cec48aa0f1d58583b41266422e | d5813ca43689aa194ec2b995cdc16b1f | 类似于pairs(),不同的是spais会对键进行有序遍历,类似于下面的table.sortedEach | function bcAM_pairsByKeys(t, f)
local a = {}
for n in pairs(t) do table.insert(a, n) end
table.sort(a, f)
local i = 0
local iter = function ()
i = i + 1
if a[i] == nil then return nil
else return a[i], t[a[i]]
end
end
return iter
end | 1 |
355ded783d6c380ae4d506be685ad675 | a9608ef6f3b489b48942852cdcc8b4e5 | Определяет является ли функция библеотечной, пользовательской, либо вообще не является функцией | type_of_function determine_type_of_function(
const char function_name[MAX_LENGTH_OF_FUNCTION_NAME], const int number_of_lines,
const char source_code[MAX_NUMBER_OF_LINES][MAX_LENGTH_OF_STRING]
)
{
type_of_function answer = no_function;
for (int i = 0; i <= number_of_lines; i++)
{
int pos_comment = search_sub... | 1 |
e5bcc93a04eb425b4dede0af5aa897f1 | 4583a106808b778fdde0d4306bba2f8a | Get a grid source by identifier. # noqa: E501
This method makes a synchronous HTTP request by default. To make an
asynchronous HTTP request, please pass async_req=True | local_var_params, path_params, query_params, header_params, body_params = \
self._get_sources_id_prepare(source_id, **kwargs)
return await self.api_client.call_api(
'/api/v2/sources/{sourceID}', 'GET',
path_params,
query_params,
header_params... | 1 |
fc090997d8327f0f3e30abd60db2ef5d | d855a262e415a5955e6ade814be3ab80 | Function Name : DispPaymentConf
Summary : Displays the payment conformation message
Input Parameters : Payment Id
Output Parameters : Payment cofirmation string
Return Value : string | {
if (payId > 0)
return "Payment Successful, Payment Id is : " + payId;
else
return "Payment Unsuccessful, please check if you have any bills to pay";
} | 1 |
9cd34cc0637e75167f5e5fc0b8f7ea63 | 4ca6b59dbb79792776cb06f7248b972e | Determines whether the file system has been initialised. | bool FileIO::isInit() const
{
return m_isInit;
} | 1 |
86e7e85c8f70f8231799921606b52d66 | 95771326bd10c0950ad8f3f38b638236 | Initialize a SoftLayer virtual machine. | self.initialize()
if len(self.__ports) != len(self.instance_settings.port_settings):
self.__ports = self.__create_ports(
self.instance_settings.port_settings)
if not self.__vm:
self.__create_vm(block)
return self.__vm | 1 |
0699cfb26eb8ddcd85e9cdbf61fa1262 | 6706ede4f1103619d630a4383838df52 | enable 4 LSBs as outputs | void setup() {
*PORTDDRB = 0x00;
*PORTDDRB |= 0x0F;
*portB &= ~(LOWER_NIBBLE_MASK);
} | 1 |
38f127980f311febbb2a204c1ea995ff | 8c52b3341cd66c0a851a26453e735d55 | Méthode pour récupérer les infos d'un top player | {
$query = 'INSERT INTO `topplayers` (`pseudoPlayer`, `photoTopPlayerName`, `photoTopPlayerPath`, `idCharacters`, `idNationality`)
VALUES (:pseudoPlayer, :photoTopPlayerName, :photoTopPlayerPath, :idCharacters, :idNationality)';
$pdoStatement = $this->pdo->prepare($query);
$pdoState... | 0 |
4c13879bd2348eea28c15b7f70667444 | 3167a58d40e914f9d2b3fb6fde1064de | 将InlineShape转换为Image | const value = this.get(field);
const image = SVGFill.parseImage(value);
const backRect = {
x: 0,
y: 0,
width: this.screenWidth,
height: this.screenHeight,
};
const backVerties = vertiesMap(
rectToVerties(backRect.x, backRect.y, backRect.width, backRect.height),
th... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.