query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
6bdcdfe8a2feeced2a641a9539cf10ed | 399c12c8de8839e0149becb80d4fbd82 | Show Add Item Input Block | final class Item extends AbstractCrmController
public function addAction() : string
{
return $this->createForm(new InputDecorator());
} | 1 |
19d66c8af2444724e44a109c0b4ad92d | fb3bbb4e8f7e273504ebac1767d8d595 | Scores for each variable in the given clause how many clauses would
be satisfied if the variable value were flipped. Returns a list of
variables indices with the highest score. | counts = {}
for p in variables:
counts[p] = 0
for c in clauses:
for s in c:
if abs(s) in variables:
counts[abs(s)] = counts[abs(s)] + 1
max_key = 0
max_value = 0
for key, value in counts.items():
if value > max_value and key not in model:
max_key = key
max_value = value
return max_key | 0 |
cfcc45b5aab5112c8c4ad90b00016dc8 | ba8594986ba93d3adf5d423261878f77 | Displays a form to edit an existing bookCategory entity. | class CategoryController extends Controller
public function editAction(Request $request, Category $category)
{
$this->checkAccess($category);
$deleteForm = $this->createDeleteForm($category);
$editForm = $this->createForm('AppBundle\Form\CategoryType', $category);
$editForm->handleRe... | 1 |
bdcb40c15b92494e495b06d5ab697aa3 | b921fe9349f8f219f0e374fabcd8e0c6 | Returns the set of unique words contained in an e-mail message. Excludes
any that are in an optionally-provided list.
NLTK's 'wordpunct' tokenizer is used, and this will break contractions.
For example, don't -> (don, ', t). Therefore, it's advisable to supply
a stopwords list that includes contraction parts, like 'don... | assert len(args) > 0
s = ' '.join(args)
return set(w for w in s.split()) | 0 |
ff9a740d4ee3b4cc2d2488e692b93110 | 4555679c035f47269911925082e0fb20 | 根据id查询adminRole信息 | TbAdminRole selectByPrimaryKey(Integer id); | 1 |
35b32e2ca708cacfa786a64195d090a0 | b3c49f5bbe2ccb2fbd89a4cecc1dd79c | Gets the definitions of scoring in this ladder. | namespace DotNetNuclear.Modules.InviteRegister.Components.Integration
void AddScoringDefinitions(); | 0 |
2161fcc302e17292f70d21950ea56d4a | fc9cd42f647cc51f7ef49b76d555348e | Sort the list of pages in accending order by pgno. Pages are connected by
pDirty pointers. The pDirtyPrev pointers are corrupted by this sort. | int CHugePageManager::SortByPhyAddr()
{
unsigned int i, j;
int min_index;
struct hugepage tmp;
uint64_t phy;
for (i = 0; i < m_Page_Numbers; i++)
{
phy = m_ptable[i].physaddr;
min_index = i;
for (j = i + 1; j < m_Page_Numbers; j++)
{
if (m_ptable[j].p... | 0 |
ab6435731f42f041c910d0ee260d7491 | cf633df41e0c2407ff909f7daf6b479e | Returns the current source for the LED Feedback | class FSL10_synthesizer:
#uses serial class to interface
#All functions here use commands which must be sent as STRINGS encoded as BYTES
#b'str' encodes 'str' into bytes; bytes(str) encodes variable str into bytes
#all string commands are SCPI commands as per "Communication Specs for Programming" ... | 0 |
4c8a78c0ecd23fb4f44978face755589 | 82b74e6a15e2694bbcd777bdce486186 | Custom matrix vector multiplication function | vec3 *vt = new vec3[n];
for (uint i = 0; i < n; i++)
vt[i] = m * v[i];
return vt;
} | 1 |
0c9187f7a237ef768e7e42dc91540081 | b9cf37d939803deb4f342f1b4220262b | Pobieranie usługodawców z potwierdzonym kontem. | namespace PortalUslug.Repositories.IRepository
IQueryable<ServiceProvider> GetAllServiceProviderIsConfirmed(); | 1 |
f44d9bbfb20c464077cffa31c7ef964c | 8ea392e79b8e8912ba034962d365f8cc | 获取当前时间,秒数 | @SuppressWarnings("unchecked")
public class DateTimeUtil
public static long getCurrentSecond() {
Calendar c = Calendar.getInstance();
int hour = c.get(Calendar.HOUR_OF_DAY);
int minute = c.get(Calendar.MINUTE);
int seconds = c.get(Calendar.SECOND);
long currentSeconds = hour * 3600 + minute * 60 + seconds;
... | 1 |
e30b78c76a40c76302883613d755768f | 949d7ca5f00724a8afb778c016e28ae7 | Clean up table if error in parsing. | void cleanup()
{
int i;
printf("\ntktable.count=%d\n", tktable.count);
for(i = TK_IDENT; i < tktable.count; i++)
{
free(tktable.data[i]);
}
free(tktable.data);
} | 1 |
863a9e53271b7463e4c120a43a3aa03c | 2cc9d22431f11bbd2d11b8e03c960e72 | 保存用户信息
返回-1表示操作失败
成功返回影响的行数 | int SaveUserInfo(USER_DATA_BASE *userInfo){
g_DM.saveUserInfo(*userInfo);
return 1;
} | 0 |
bbe8377f7debd83fe0448cfc85711504 | ddd468b571115463f44ff07e5f1dc5b1 | # Implement the RELU function.
#
# Arguments:
# Z -- Output of the linear layer, of any shape
#
# Returns:
# A -- Post-activation parameter, of the same shape as Z
# cache -- a R list containing "A" ; stored for computing the backward pass efficiently | def relu(Z):
A = np.maximum(0,Z)
cache = Z
return A, cache | 1 |
8eb1a696a261390320e8a721e7470a50 | 1cd4a010e7af6c148c108d5d7705eef7 | Проверяет габариты посылки | {
$errors = [];
if (Request::get('sending_city_key') == '')
$errors['sending_city'] = 'Виберіть ваше місто!';
if (is_null(Request::get('sending_warehouse')))
$errors['sending_warehouse'] = 'Виберіть ваше відділення!';
if (config('app.post_products_weight_valid... | 0 |
e700a1777d4abadaa51156f2bcad185a | 3184dc9debcd575b1d14c0556ab7261c | 今後のために、ユーザーとESが必ず紐づくようにDBを設計しているが、
管理者側で作るESはユーザーではない所から情報を持ってきているためダミーユーザーを作成することで対応している | class ESHandler(StreamHandler):
def __init__(self):
super().__init__()
es_.create_index('userlog') | 0 |
702ceef896b9a1f5d1e7ee553006d12f | c9484512cc046d15dbc7c859feaec184 | I serialize RDF graphs in NTriples format. | {
if (segment == TripleSegment.Predicate) throw new RdfOutputException(WriterErrorMessages.GraphLiteralPredicatesUnserializable(this.FormatName));
StringBuilder output = new StringBuilder();
output.Append("{");
foreach (Triple t in glit.SubGraph.Triples)
... | 0 |
c870ba2ed50d9ffdf8f4215c6c9aa1e5 | 449a662fce7a1d252862dca1aca64f47 | 現在のノードに隣接しているノードへのリンクを取得する。 | public class FlowDiagram extends Canvas
public Vector<Relation> getNodeNextRelation(Node nd) {
if (nd == null) {
return null;
}
Vector<Relation> rv = new Vector<Relation>();
Enumeration<Element> enum11 = this._elems.elements();
while (enum11.hasMoreElements()) {
Object item = enum11.nextElement();
if... | 1 |
7e13d67b4bbe66c03e5dfed54ef2ef79 | 3f89394c228aaa1749ba0ef201368878 | Buffer is "in use" if ownership transferred to raw connection or TLS until a future event. | static VALUE
rb_io_buffer_internal_p(VALUE self)
{
struct rb_io_buffer *data = NULL;
TypedData_Get_Struct(self, struct rb_io_buffer, &rb_io_buffer_type, data);
return RBOOL(data->flags & RB_IO_BUFFER_INTERNAL);
} | 0 |
2cfd95ffcd0c35e1c503f6620a133fa5 | 70cc6947d676d6199edc2e0c7bebe934 | r"""Convert from bytes/unicode/str to a bytes object. | def str_to_bytes(x): return x if isinstance(x, bytes) else str(x).encode('ascii') | 1 |
436e19a44052872a9aedc502e1b0f29c | 6d0a11ac266f411d2b0536898abfb1c3 | 根据条件查询版本与岗位中间表 | public List<WsMidSup> doGetWsMidSupListByContion(Map<String, Object> params) throws Exception; | 1 |
f31fdae99aa19efe925c51810d634b9d | 7216735f5245830081d7e706f35cd7c6 | 预览错误 | void onPreviewFailed(); | 1 |
219810dccf89121ece0597035b861293 | 48c19d7a0566cdcf02aa64356a7d5695 | Establish as start date the lastest out of the proposed and the joined date | export class Login implements OnInit
onClickDateStart() {
this.dtMinDate = this.dtStart;
if (this.dtEnd < this.dtMinDate) {
this.dtEnd = this.dtStart;
}
} | 0 |
0fcef0e9fb4d45644ae66be9b3d4cabd | 50fb046bddfeb13ac1394601584c81e1 | Saves the Contents. Invokes Export() if Contents is empty. | namespace Zero
void Exporter::SaveAndBuildContent()
{
Editor* editor = Z::gEditor;
editor->SaveAll(true);
} | 0 |
c939c466382041214e0adfe51130d3d1 | 430c64f9665026dc4282fdb93f0345cf | finds the vector Rj based on the power iteration method | d = A.reduce_vector(grb.types.FP32.PLUS_MONOID)
n = A.nrows
r = grb.Vector.sparse(grb.types.FP32, n)
t = grb.Vector.sparse(grb.types.FP32, n)
d.assign_scalar(damping, accum=grb.types.FP32.DIV)
r[:] = 1.0 / n
teleport = (1 - damping) / n
tol = 1e-4
rdiff = 1.0
for i in range(iterm... | 1 |
94831db6cd5f5d278f014a92da39f73b | bfa82b3bf2f84dae0a435ae956bb9ec3 | # 您或您的配偶是否单独或共同控制艾德证券期货之其他保证金账户35%或以上之表决权? | class FusionBase(BaseEntity):
def partner_5p(self):
return self[FUSION][PARTNER_5P] | 0 |
6fea0f15f54620d23e0d0faf5cd7ab1d | da91285431fd6f6501a2b08235b717c0 | 親プロセスからのメッセージを受け取ったときのコールバック\n
これは、サブプロセス | crit_enter(semid, CR_SHM);
fprintf(stderr, "[%i:%i] Palin %i %s\n", shmp->sec, shmp->ns, getpid(), msg);
crit_exit(semid, CR_SHM);
} | 0 |
40c9297066b92190aa4a2ff215713ce6 | dc2d551342b0d6b1d291e642d2bbdaa7 | Start TicTacToe game with RL Agent. | def start_my_tabular_agent_granular():
getMod().start_agent("data/shapes/character/MyTabularRLRobot.xml", GranularMazeEnvironment) | 0 |
8510e12027b1a09fac94558228d10ecb | 88ade7c9bfe85dc490b0d52e62a38c36 | Turn the date into a string of the form
day month, year | class ShortDate(object):
def __str__(self):
return self.dateObj.strftime('%m%Y') | 0 |
d1a32c685f1917c053fda7c42354884b | d120912e14c6728d78b1afb577490aa0 | Creates PolynomialExpansion object to expand the scaled features in polynomial space | def genPolyFeatures(myX, p):
newX = myX.copy()
for i in range(p):
dim = i + 2
newX = np.insert(newX, newX.shape[1], np.power(newX[:,1], dim), axis=1)
return newX | 0 |
6d5bb30733f50b8286a52015a912ee8a | 07841eaaf62357e9e332e1cdaa8837c9 | Assert the select has an expected option. | public function assertSelectMissingOption( $field, $value ) {
return $this->assertSelectMissingOptions( $field, [ $value ] );
} | 0 |
a0988a8e2b7f53429b8ca89badda8259 | 7c75b2a309ebd6fd4aa89f8c5ddde35a | Activación de una tarea suspendida por evento esporádico | if (CTASKID === taskId) {
TASKS[taskId].deactivationTime.push(new Date().getTime());
updateStorage("TASKS", TASKS);
if (f != null) {
f();
}
}
} | 0 |
3c06172be50555f0ac6b044e467ca9aa | beb84afe53c1d0b416fd672ecec43f41 | Data de nascimento<br/>Formato: 'yyyy-MM-dd' | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "DadosCredenciamentoPessoa", propOrder =
{ "tipoOperacao", "idEvento", "dataHoraOcorrencia", "dataHoraRegistro", "cpfOperadorOcorrencia", "cpfOperadorRegistro", "protocoloEventoRetificadoOuExcluido", "contingencia", "codigoRecinto", "cpf", "documentoEstrangeiro... | 1 |
ae4a2b9ac4a3767373f5c0574c69f371 | 75e4c9180a920885049d1fec10062c68 | Set the fonts bounding box. | namespace Dt.Pdf.Text
public class SimpleTrueTypeFont : BaseFont
public override PdfRectangle GetFontBoundingBox()
{
return new PdfRectangle(this.simpleFont.BBox0, this.simpleFont.BBox1, this.simpleFont.BBox2, this.simpleFont.BBox3);
} | 0 |
80613b22ddfcca5fe51793a9486b192d | debd9924571cb42870c95fa7d88862d9 | ----------------------------------------------------------------------------
Count Leading Zeros | namespace Microsoft.Online.Metrics.Serialization.BitHelper
public static class BitAggregateMagic
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static int CountLeadingZeros(long x)
{
if (x < 0)
{
return 0;
}
x |= x >> 1;
... | 1 |
6bcba3a8a1e5d002ee6afbbd9cd3486c | f313064ce1a0634a47f06e755c9b1f49 | Write out prefs and recent_projects files | {
try
{
OutputFormat outformat = OutputFormat.createPrettyPrint();
outformat.setEncoding( "UTF-8" );
XMLWriter writer = new XMLWriter( new FileOutputStream( getTempProjectsFile() ), outformat );
writer.write( ProjectsExporter.toDocument( Activator.get... | 0 |
cbd75e58d791a184782c2e8fb581cef4 | 38b0d8ce64125607541cc77d193bd990 | Update the number of lives the player has | void Game::updateLives() noexcept {
lives_--;
} | 1 |
9cde660b56a3533e8503264db61a0d0e | b97c2370349114a40b41c0fbe2dbb628 | リソースの記述内容から行の定義辞書を初期化する | namespace PirateX.Core
public static class I18NResource
public static void Init()
{
if (string.IsNullOrEmpty(_defaultPath))
_defaultPath = $"{AppDomain.CurrentDomain.BaseDirectory}{Path.DirectorySeparatorChar}i18n{Path.DirectorySeparatorChar}i18n.csv";
if (!File.Exist... | 1 |
49a2a1c7273132329987076d0f434137 | 3bd1859cdec867de5b07d56e29566d7c | Assigns the teacher to the class | {
if (Session["UserId"] != null)
{
Teach teach = new Teach();
teach.CourseID = Convert.ToInt32(TempData["courseID"]);
teach.TeacherID = id;
prometheusContext.Teaches.Add(teach);
prometheusContext.SaveChanges(... | 1 |
86be7e8e7d88abe1d40aa90cf287a84a | fb3ec95b0b4388f4ee7127b09cd9c17c | Consulta o backend para saber se há críticas sendo geradas ou não. Consulta Status de Críticas no momento.
e retorna as criticas | {
$sql =
"SELECT
FROM_UNIXTIME(c.time, '%d-%m-%Y %H:%i:%s') AS data_e_hora,
c.id AS chat_id,
d.name AS departamento,
CONCAT(u.name, ' ', u.surname) AS atendente,
SUBSTRING_INDEX(SUBSTR(c.additional_data, (LOCATE('\"key\":\"nomeContato\"', c.additional_data) + 29)), '\"', 1) AS nome_do_contato,
SUBSTRING_INDEX... | 1 |
bd52e00d14f1f0740216a86ac0252574 | e65511712050e1a578a259b304042531 | Find checksum by multiplying the number of codes
that have duplicate characters and the number of codes that have
triplets of characters | letters = {}
for char in code:
if char in letters:
letters[char] += 1
else:
letters[char] = 1
tmp_letters = sorted(letters.items(), key=itemgetter(0))
sorted_letters = sorted(tmp_letters, key=itemgetter(1), reverse=True)
checksum = ''
for i in range(5):
checksum += sorted_letters[i][... | 0 |
500dc12a95d4ed2282063de318eb2e04 | e177a75a5986a43b160f3784df8be1ce | 文件名去后缀 | public class MyUtils
public static String fileNameRemoveSuffix(String fileName){
if(fileName.contains(".")){
return fileName.substring(0,fileName.lastIndexOf("."));
}
return fileName;
} | 1 |
7742852122a52d71aeaee1fc9915217e | 0ccc24c37b62ab8b31291946d9d86a1c | Resets the value in the spinbox after each click | void value_update_callback(GtkSpinButton *s)
{
} | 0 |
574c00f641eb3a9b2302f74ac460f248 | 33db4d0ad8c15c95957fdb8b8bde16f7 | 同步单个设备 | @Transactional
public class DeviceSync
@Transactional(rollbackFor = Exception.class)
public void deviceSync(String corpid, String accessToken){
try {
Long deviceServiceIds[] = {15L};
for(Long deviceServiceId : deviceServiceIds){
JSONArray jsonArrayOneTypeAll = new JSONArray();
... | 0 |
bd2396e02a6df848249ada319f5cec27 | 188ac5dd936abb779b024cbcb8b17dfd | Finish logging threads and flush buffers. | this.finalRundown = true;
final CountDownLatch latch = new CountDownLatch(1);
TimerTask finalTask = newBackgroundProcessor(false, latch);
timer.schedule(finalTask, 0);
try {
boolean done = latch.await(Math.min(this.periodicFlushMillis, StructuredLogger.MAX_WAIT_ON_... | 1 |
7f400e2be4edf3d5cfb4b7119bd66baf | 668cdf94b7becc9cd40201a7136af0a8 | 有密钥时刷新密钥值 | public class PrimaryKey
public synchronized static boolean refresh() {
String appId = null;
InputStream is = null;
boolean result = true;
System.out.println("Primary key config start...");
try {
is = new PrimaryKey().getClass().getResourceAsStream("/ds.properties");
Properties dbProps = new Properties()... | 0 |
4f0a18f82c64a225efd55e7f517be84d | 9a3794c15d7122d3945b10cca515f9e1 | Animate player sprite | if (self.powerupState == 0):
if (action == "idle"):
if (last_held_direction == "right"):
changeSpriteImage(self.playerSprite, 13)
elif (last_held_direction == "left"):
changeSpriteImage(self.playerSprite, 0)
elif (ac... | 1 |
b88c786247d94a7d0ce76f3c3b1d4ec4 | bbbf97bf9a601c1d02866d1cfae7ed8b | 功能函数,简单的通过参数true/false来控制成功失败。 | function fun1() {
return true;
} | 0 |
e681e427b5450c8a52eb56f25922981a | fa1d62aa18a7fd2b0431b1462bf3ba28 | Find all the words that match a string of letters. | public IActionResult Find([FromQuery]string characters)
{
if (string.IsNullOrWhiteSpace(characters))
return BadRequest("Missing characters");
var words = _wordService.Find(characters);
return Ok(words);
} | 1 |
0cae09535f581ea9b19d7626745aea22 | 8bf2d24690531846894b730102f29b94 | 将String转换为float,若抛出异常则返回0 | public final class StringUtil
public static float toFloat(String s) {
if (s == null || s.isEmpty()) {
return 0;
}
try {
return Float.parseFloat(s);
} catch (NumberFormatException ex) {
return 0;
}
} | 1 |
0d38d73c1b45784bb6cfe5737c9b3b49 | 2e29b839503678793da2436d0fb5b279 | Method to retrieve Qual Code when Qual Description in hand | {
var CodesList = SqlServer_Impl.GetBandC_QualCodes(_QualCode, (_Category == "Category Selection" ) ? "" : _Category );
gvQualCodes.DataSource = CodesList;
gvQualCodes.DataBind();
SetBehavior();
} | 0 |
a384a39f7f33b72b8506a648268c9f8c | b64a0c0a2a2b60997e6904800cba7bf9 | ! \brief Returns the line number for the given point. | namespace SilverNote.Editor
public class TextRenderer : ContainerVisual, IDisposable
public int LineFromPoint(Point point)
{
var hit = VisualTreeHelper.HitTest(this, point);
if (hit != null && hit.VisualHit is TextLineVisual)
{
return ((TextLineVisual)hit.... | 1 |
3a648cbc3d3589c72d857b2d821c5022 | b9d866fc0c4295e6c5898ffcb03dc1e6 | attributeGroupsUpdateSingle function, post to update a single attribute group | def worker(req):
attr_group = req.params()['attr_group']
name = req.params()['name']
description = req.params()['description']
subgroup = req.params()['subgroup']
attr_group.name = name
attr_group.description = description
attr_group.subgroup = subgroup
attr_group.sa... | 1 |
2948f8da4fb2a090a585e276fffe81cd | 9963c989cdaf89f620e3ec2cb6d42a25 | Clear an employee's direct deposit information | grossPay = 0.00;
overTimeHours = 0.00;
overTImePay = 0.00;
regularPay = 0.00; | 0 |
4f8909370f496d57d112b4e8f42517a9 | 39fac4e7536ae43ce690a543b39e1d19 | This method returns the active collection name. | public abstract String getCollectionName(); | 1 |
dd6f99dfaf475a7ccaa5636422bf3ff7 | c87892aaf0fb715ab716797d6e36d359 | 添加 「属性-属性选项值」 或者 更新 「属性-属性选项值」
以提交的数据为主,如果数据库中有,提交的数据没有,则删除数据库中的数据
如果数据库中没有,提交的数据有,则新建新数据并且删除数据库中和提交的不一致的数据 | class GoodsAttrValue extends common
public function save($runValidation = true, $attributeNames = null)
{
if($this->isNewRecord){
if(strpos($this->value,',') !== false){
$transaction = Yii::$app->db->beginTransaction();
try{
$volist = explode... | 0 |
dd601b37056887588b4df04669015c91 | 78c755a5c6be244b6c7a505bd7be7c82 | 重启ha函数 | local queue = connect_queue
connect_queue = nil
for k, v in pairs(queue) do
connect_slave(k, v)
end
for name, address in pairs(globalname) do
skynet.redirect(harbor_service, address, "harbor", 0, "N " .. name)
end
end | 0 |
437dfdddc9535080e757eea7a380b65c | 729267ff08f6d64eba8d76465e223fbd | 无条件转换到T | namespace WinD.Common.Extensions
public static class ObjectExtensions
public static T To<T>(this object value)
{
return (T)value;
} | 1 |
f605d83c42f1fc7fe862e99e8e79b440 | 8893eb6acaadb96c770586e34a0d120b | Parses cell. | class Cell(object):
def _parse(cls, data, header):
if not isinstance(header, cls.Header):
raise TypeError("The given header object has the wrong type.")
if header.cmd is None or header.link_version is None:
raise ValueError("Fields of the given header object are invalid.")
... | 1 |
25fe777d4740148b9e51a666da8f2500 | 7ea937368293ddb88842957a77a752c3 | 获取总时间,以毫秒为单位,比较第一帧和最后一帧的时间得到 | export class TimeLine extends EventDispatcher
get total(): number {
this._total = Math.floor(this._startTime / 1000 * this._frameRate);
return this._total;
} | 0 |
bef4d033b7aa2829af2aba1dfcd647d9 | 7610a4a60f06b2ad23153ddf647a10aa | Get the Check Fee label. | class LightningChargePayment extends PaymentDefault
public function getLabel() {
return parent::getLabel();
} | 0 |
f5881c14235d759ee068fef906d2b5d7 | 7d55dff02844806d0ea11b4d5015fd46 | 店名を検索する (ShopNameTable) | public class SearchActivityController extends ControllerBase
private ArrayList<ArrayList<Object>> searchShopName()
{
DataDbOpenHelper helper = new DataDbOpenHelper( g_context );
SQLiteDatabase db = helper.getWritableDatabase();
String shop_name = ((EditText)g_activity.findViewById( R.id.searchShopNameEditText ... | 1 |
49b03df27a4caa67ee2d10f635cde834 | c1930e51c471811e8552ff460e67d0f5 | Handles the correct Execution of the Chosen Normalization | namespace IsHoroshiki.BusinessServices.Integrations.Queues
Task<SaleCheck> ExecuteNormalization(IntegrationCheck check); | 1 |
3c584b2beceb9a5b7bc56be71d6c7745 | a629bc9be3dbbd3c4dcfcea7fc801fcd | 文本框键盘事件处理 | namespace mes
public partial class Form1 : Form
private void txt_KeyPress(object sender, KeyPressEventArgs e)
{
#region
TextBox textBox = sender as TextBox;
char a = e.KeyChar;
textBox.SelectedText = "";
string text = textBox.Text.Trim();
... | 1 |
4ae06d69dd906aa271add298b190d138 | 96b96f7d7c5aae8620ee59bd3eead6a4 | return true if there are app parser decoder events. These are
only the ones that are set during protocol detection. | for (int i = 0; i < frameSize; i++) {
Frame698.Parser parser = getParser(i);
if (parser == null) return false;
}
return true;
} | 0 |
79e992d8aa65da1346138f62a4d11ca5 | 7a968f10ffaffaeb80ab35294d9b2e41 | Depending if the tCase argument is passed we either set the case of the
given string or we get it.
Those functions can be expanded for other text cases. | class TableMaker
function setCase($newCase) {
$newCase = strtolower($newCase);
switch($newCase) {
case 'l': $this -> tagCase = 'strtolower'; break;
case 'lower': $this -> tagCase = 'strtolower'; break;
case 'u': $this -> tagCase = 'strtoupper'; break;
case 'upper': $this -> tagCase = 'strtoupper'; break... | 1 |
3166ee97724726cf93380814f925e31f | 8ee8a1e05a7653a3cd33e35fb233e845 | 添加用户到标签 | $cust = $this->get_one_row('customer' ,array('shop_id'=> $this->shop_id, 'buyer_nick'=>$buyer_nick),'*');
if(empty($cust)){
return return_result_format('对应记录不存在或者当前所选择店铺已切换!请检查');
}
if(is_numeric($attr_id)){
$label = $this->get_one_row('vz_user_tag_att... | 1 |
553596dca71428c29e64ab4b3b1e57bf | 71de30807c137e893d61988f2602a6e0 | 生成前端json配置文件函数 | let buildPath = `${__dirname}/build`
data.forEach((item, key) => {
try {
let result = {}
for (let key in item) {
result[key] = item[key]
}
if (!fs.existsSync(buildPath)) {
fs.mkdirSync(buildPath)
}
fs.writeFileSync(`${buildPath}/${key}.json`, JSON.stringify(re... | 1 |
840dee5af7a007affc949f613610f25d | 6d88d2e8450f2bfe26a4a95a3a4f5720 | do not subtract anything from null timestamps | fun java.util.Date?.normalized(): java.util.Date? = if (null == this || 1L > time) null else this | 1 |
6072dce9a648459a248aebb07ec784cb | f9f25ad620823e4273e055f210bee81f | Method invoked when the user decides to exit without saving any data. | public class TeleprompterActivity extends AppCompatActivity
public void showConfirmLeaveDialog(){
new AlertDialog.Builder(this)
.setTitle(getString(R.string.teleprompter_dialog_dont_save_title))
.setMessage(getString(R.string.teleprompter_dialog_dont_save_body))
.... | 1 |
121aa783a4cdcdac9a34d86d2922855c | 25da0561b8ca8e005aadc148c1c68b5c | Сериализует данные по поледним статусам в бин файл | {
using (var writer = new StreamWriter(EdgesOverSimulationFile, true))
{
foreach (var edge in bSystem.AllEdgesOverSimulation.Where(x => x.Created == i))
writer.WriteLine(edge.ToStringKsenia());
}
using (var writer = new StreamWr... | 0 |
f2fc8a8b3573b7881bcc22723f97a3a7 | d62d1196e8c3869d76fc75e10826f0bb | Función para validar el ataque del jugador | answer = question_data.answer
response = player_input(question_data)
if response in answer:
print("Has acertado!")
protagonist + question_data.exp
return True
else:
print("No te rindas! Intenta de nuevo!")
return None | 0 |
ce252d623a8a436742bb539f68160aac | 1e0342cebf23371501e315b24324b7ff | Calculate number of rows to draw based on number of days
in the month and day on which the month starts. | $firstday,
$section_id) {
$IsMondayFirstDay = IsStartDayMonday($section_id);
$Extra = $IsMondayFirstDay ? 1 : 0;
$rowcount = ceil($dayscount / 7);
if ($rowcount * 7 - $firstday + $Extra < $dayscount) {
$rowcount = $rowcount + 1;
}
if (!$IsMondayFirstDay && $firstday == ... | 1 |
721a989a457c9fb0ff697df59954d221 | fb337d0458fef78a0634f4b9dac6ff0d | 永久删除连锁店 | class ConfirmAction extends CommonAction
public function foreverdelete() {
$ajax = intval($_REQUEST['ajax']);
$id = $_REQUEST ['id'];
if (isset($id)) {
$condition = array('id' => array('in', explode(',', $id)));
$rel_data = M(MODULE_NAME)->where($condition)->findAll();
... | 1 |
92288b09aa9a9229acbfa2c42dd1c07d | df7b824ef80224cab1ebe666683323f3 | Prevent rendering of title | public class ExclusionUIDisplayColumn extends DataColumn
@Override
public void renderTitle(RenderContext ctx, Writer out)
{
} | 1 |
c076658202c18c91f7e1e064fb5275e9 | 5c9cab5c1f7c50f13060462495cfa899 | Invert the normals of the select object/component | {
if (Element != nullptr) {
Element->Inverse_Selected_Normales();
Element->Refresh();
}
} | 1 |
a904cb534b03c4f9447ff3d864f1cbac | bbafb3ef3b98bab9f7e6a6a8a70c5232 | Returns a copy of a keras model. | class QBrain:
def __copy_model(self):
path = (os.path.dirname(os.path.realpath(__file__)) +
'/../../../assets/save/ai_model' + str(self.__id))
self.__model.save(path)
print('Just saved model', self.__id, '!')
return keras.models.load_model(path, custom_objects={
... | 1 |
68436d565790445c745824bcd54eaab2 | d65d1e7bdc9f564d11b60080bc11362e | Check if the device stream is operating at an acceptable rate. | def check_output_settings(device=None, channels=None, dtype=None,
extra_settings=None, samplerate=None):
parameters, dtype, samplesize, samplerate = _get_stream_parameters(
'output', device=device, channels=channels, dtype=dtype, latency=None,
extra_settings=extra_settings,... | 1 |
e89bf157affcc363a4f5d0f792d6173e | 05958cb5469ecc24482fb9e407ee1443 | выбор цвета фигуры | if(id=="red"){
document.getElementById("green").style.borderColor="black";
document.getElementById("blue").style.borderColor="black";
document.getElementById(id).style.borderColor="yellow";
document.getElementById(id).style.borderWidth="10px";
}if(id=... | 1 |
733e83ea36adb6d61aecf7d5dc465aac | e6b2c222344f930f72f446eb29a84403 | Mostra a schermo delle informazioni addizionali di debugging nel gioco. | void debug(){
} | 0 |
aaab273addd96345eb5428feda883a86 | 853c4790683f997c57cc90499e5fdd18 | Get users arround range of a given user. | public List<Integer> randomUsersAroundLevel(int amount, int level); | 0 |
37021cf1f7d7dba5fa21f95cd1eef3a6 | 52b10bbc9a7768d15b1354516dbad9b5 | 출금 계좌 변경시 숫자만 입력받게 하기 | namespace WindowsFormsAppPersonalProject
public partial class frmDepositExtension : Form
private void txtNewPwd_KeyPress(object sender, KeyPressEventArgs e)
{
if (!CommonUtil.NumberCheck(e.KeyChar))
{
e.Handled = true;
}
} | 0 |
50d4f597be4582e7a5e120cea2c7f38d | ea2319d10401f29565c1e38b9c21729f | 查询还有一个月优惠券过期的uid | @Service("cms.actCouponServiceImpl")
public class ActCouponServiceImpl
public PagingResult<CouponUserUidVo> getOneMonthExpireCouponUidByGroupSN(ActCouponRequest request){
return actCouponDao.getOneMonthExpireCouponUidByGroupSN(request);
} | 1 |
330af8468e650a204e57edd1a2aa8362 | 407a3ec831ef3bef58feb34ada9252d3 | 1.4 函数的返回值可以是一个函数 | n := 10
str := "hello"
return func(x int) int {
n += x
str += string(36)
fmt.Println("str=", str)
return n
}
} | 1 |
9af24c9f1f43c36b08d9c39722b84725 | 8340cb7ff6f6d0a31e002f29cda2cefc | Creates an assignments and adds it to the current block | addBranch("AssignmentStatement");
analysisLog("assignmentStatement..");
if (aCurrentToken.type == "ID") {
var id = aCurrentToken.value;
var type = getaVarType(id, st.cur);
if (type == undefined) {
aErrors++;
analysisLog("<span class=\"error\">ERROR!</span> ID ... | 1 |
7fe2cad60256cb3f41e21d66f6d41950 | 737581d56f38eb543c85e8e5bc3e3bb3 | Reenqueues all erroneous tasks | class DetGroupAnalyticsService
def requeue
cs = @client.settings
cs.removeJobsDgFail(@detGroup.id)
enqueue()
end | 1 |
fb1b656b78f0483beccbdf3894dbfc34 | b50386e647462b7b9dd7073eb8e38735 | Vorlage für Kunde, der Kontaktangaben ergänzen soll | {
parent::buildForm($builder, $options);
$builder->add('businessName', TextType::class)
->add('companyRegister', TextType::class)
->add('vatNumber', TextType::class)
->add('addresses', CollectionType::class, array(
'entry_type' => AddressCustomerT... | 1 |
8e56f6fdc18a0a16635655050db15f42 | 7f61448ad6da3ef0f9cb03f40c5be655 | 函数的文档说明: | cases like (1) | 0 |
9da8365b01db176b0f3c83ee6c025df5 | 2395700eda963e408ec34247dd8bc1ff | get student lesson attendance details from database (lesson attendance) | {
$date=$request->get('date');
$sectionid=$request->get('sectionid');
$classid=$request->get('classid');
$attend = DB::table("attendence_list")
->where("dates",$date)
->where("class_id",$classid)
... | 1 |
f0edc31aff37e12ba005c875ad448726 | 7e4c030957a9c8d492896d82899eed26 | Reads the first line of an {@code id_rsa.pub} file and parses it to a {@link PublicKey}. | throws IOException, NoSuchAlgorithmException, InvalidKeySpecException {
final String tag = "ssh-rsa";
if (!rsaPublicKeyText.startsWith(tag)) {
throw new IllegalArgumentException("Only support 'ssh-rsa' format!");
}
int startPos = tag.length() + 1;
int endP... | 1 |
688617239bdc6a36501c6769706593cb | 354731aa99d34692468923ad47fe5f1e | Make sure all data is there in case user skips steps and goes straight to sign_and_certify | class AuthData():
def validate(self):
if ((self._skey['_ci'] == None) or (self._skey['_text'] == None)):
raise Exception("Invalid Skey ci or text")
if (self._pidxml_demographics == None and
self._pidxml_biometrics == None):
raise Exception("Payload (demographics/bio... | 1 |
e8fff0acbda1fd91ba2be0ae2e63b8b5 | c180bf15d0e416725f2ac24a4e63e85e | Spravanie nahra loptu do daneho bodu s danou rychlostou | def tik(t):
pozice_hada[0] += t * rychlost_hada[0]
pozice_hada[1] = rychlost_hada[0] + rychlost_hada[0] * math.sin(pozice_hada[0] / 5)
if pozice_hada[0] < VELIKOST_HADA // 2:
rychlost_hada[0] = abs(rychlost_hada[0]) | 0 |
e1f7ea2290cf381f6818343ffcc2e733 | 95e51397282374627be8c24bd307e294 | Given a worksheet, a column name, and a row index,
gets the cell at the specified column | {
int row = Convert.ToInt32(cells.Substring(cells.IndexOf(",") + 1, (cells.Length - 1) - cells.IndexOf(",")));
int col = Convert.ToInt32(cells.Substring(0, cells.IndexOf(",")));
return ws.Cells[row, col];
} | 0 |
290e32ae1b9228f55aae16097c7adc7f | 4f4233ae0ce1d69dc3381d431182dade | This is a recursive method that ensures the user consciously chooses to save or not to save their work before exiting | cout << endl << "Do you want to save the board (y/n)? ";
bool validChoice;
char choice;
do {
pw::takeInput(choice);
choice = (char) toupper(choice);
if (choice == 'Y' || choice == 'N') {
validChoice = true;
} else {
cout << "Invalid choice, try aga... | 0 |
2ba28b33f47e058ecdef9bf131f58cfe | 7e8671d636b756cece8a6e2327d027b3 | 選択された処理ステータスを条件に物件問い合わせ情報を取得 | class dao_api_request extends PMS_Model
public function get_data_list_for_object_id($p_tenant_id, $p_object_ids, $p_delete_flg = '0', $p_for_update = FALSE)
{
log_message('DEBUG', __METHOD__.' start');
$info = '-->'.__METHOD__.'-->';
$info .= 'テナントID:'.$p_tenant_id;
$info .= ',削除フラグ:... | 0 |
677d9fe5ffbafdd9d3964a6c32ea3a75 | 6d271b729383a4624356733da9b0a622 | Raises an event to notify listeners that command state has changed. | namespace Atlassian.Presentation
public abstract class DelegateCommandBase<TParam> : ICommand
public void NotifyCanExecuteChanged()
{
var ev = CanExecuteChanged;
if (ev != null)
{
ev(this, new EventArgs());
}
} | 1 |
087a8cf6833011709f868513a03ae660 | 6de64343424fb5e1ce5019a0c334b96d | Is phone vibrate for file transfer invitation. | export class Common extends Observable
hasVibrator(): boolean {
return true;
} | 0 |
4316682a2b3ee141ceebc46af0417353 | f90630b615db26601b3443fdbc263eaa | Executes migration to create the table for Microsoft SQL Server based caching | {
await Context.ExecuteAsync(@"
CREATE TABLE DB_MIGRATOR_HISTORY(
CONTEXT_NAME VARCHAR(256) NOT NULL,
MIGRATION_ID VARCHAR(256) NOT NULL,
CLASS_NAME VARCHAR(1024) NOT NULL,
DESCRIPTION VARCHAR(4000) NULL,
APPLIED_ON TIMESTAMP WITH TIME ZONE NOT NULL,
PRIMARY KEY (CONTEXT_NAME... | 0 |
914d4126ed3d4e14ae22259cafc4ba6e | 73a2a5727d960a10979b575e9c7775e7 | 有未完成的订单记录 | require_once(DOC_PATH_ROOT."/Lib/Pages/pages.func.php");
$currentPage = isset($_GET['currentPage']) ? $_GET['currentPage'] : 1;
$singlePageRecordCount = 2.0;
$sql = "select count(*) count from orderDetail where orderCategory=0 and orderOwnerID=".$_SESSION['id'];
$totalRecordCount = Pag... | 1 |
16eeb62b6ba5371d3a62d5051272b3ca | 9efc92aceee8cbb6b198460ec4ac2ad4 | <pre>
Inserts a slate.
</pre>
<code>.google.cloud.video.livestream.v1.Event.SlateTask slate = 14;</code> | {
$params = array('postBody' => $postBody);
$params = array_merge($params, $optParams);
return $this->call('insert', array($params), 'Google\Service\Tasks\TaskList');
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.