query_id
string
corpus_id
string
query
string
code
string
label
int64
7b451905e3f57ab0c2c066b92958b9e9
02c0befd29c57330f8606b95defb4a07
串口发送数据,并在Console显示日志
namespace monitor public partial class form_main_program : Form private void send_data(byte[] information) { string str = Encoding.ASCII.GetString(information); if (serialPort.IsOpen == false) { serialPort.Open(); } serialPort.Write...
0
0a0096a4e94a2fdf437e50fa2aed3248
34307067e1c3e5ff35caf81c698479df
单个任务 PATCH 请求
for i in tasks: if i['id'] == id: task = i if len(task) == 0: abort(404) args = self.reqparse.parse_args() for k, v in args.iteritems(): if v != None: task[k] = v return {'task': marshal(task, task_fields) }, 201
1
0e8a3524a97282d7249ed82f65d48006
ea55c585c0af4f24a4d4061f3184ad18
w zaleznosci od tego w ktorej jestesmy cwiartce wywola funkcje porownujaca dla odpowiedniego przedzialu
class Application(Frame): def angle_side(self, P_1, P_2, P_3, i): predznak = 0 k = (P_2[1] - P_1[1]) / (P_2[0] - P_1[0]) fun_org = k * (P_3[0] - P_1[0]) + P_1[1] if i == 1: if k >= 0: if fun_org <= P_3[1]: predznak = -1 el...
0
69357933df652e58664ccdc02383546a
72160447a72987bb25d8eed06c3a9855
@brief Service called by the User Application to retrieve the Active Firmware Info.
static void fw_action_send_get(void) { DPRINTF(">> %s()\n", __func__); resetReceivedReportsData(); myOta.fw_numOfRetries = 0; zpal_feed_watchdog(); if (JOB_STATUS_SUCCESS != CmdClassFirmwareUpdateMdGet(&myOta.rxOpt, myOta.firmwareUpdateReportNumberPrevio...
1
a5452cbc92e690a8ec34bf5467111bb7
3354835679cb52511854e84feb91674b
Test that flipping restart-required log-enable works.
host3 = DockerHost("cali-host3", additional_docker_options=CLUSTER_STORE_DOCKER_OPTIONS, post_docker_commands=POST_DOCKER_COMMANDS, start_calico=False) host3_hostname = host3.execute("hostname") host3.start_calico_n...
1
e3e7aa5bcb9551f3d3d27b1fb7ada051
70a48abc742107536f453db4730a887c
<para>Gives the possibility to ignore parts of the marshaled data and store the original data.</para>
Contract.Requires(marshallingInformation != null); if (marshallingInformation.UnmanagedType == System.Runtime.InteropServices.UnmanagedType.CustomMarshaler) { this.Traverse(marshallingInformation.CustomMarshaller); if (this.stopTraversal) return; } if (marshallingInformation.Unma...
0
b1bdbbc38ab33599ed6503d7b50dbe28
b4301947748b7924d9124ef0278694c6
统计所有宝石的等级
class TreasureVo extends BaseClass implements IFObject public getSuitLevel() { let level = 0; for (let data of this.suitInfos) { if (this.isInLayStone(data.type)) level++; } return level; }
0
e8bf5f3c85e1666f07deadfc5fac6b1d
e043e54eca8be606da4911d4cfd4e19e
删除数据表EXCEPTION_LOG中的一条记录
@Service public class ExceptionLogService public long delete(String openId) { Query query = new Query(); query.addCriteria(Criteria.where("_id").is(openId)); DeleteResult remove = this.mongoTemplate.remove(query, ExceptionLog.class); return remove.getDeletedCount(); }
1
a722be8470146038dee72c2c029edba7
1e0745c49989bbd2c5d2ced619929787
Produces an <see cref="IEnumerable{T}"/> with tuples of names and values of the given enum in a typed, LINQ-friendly fashion.
{ if (type == null) throw new ArgumentNullException("type"); if (!type.IsEnum) throw new ArgumentException("Type provided must be an Enum.", "type"); ArrayList list = new ArrayList(); Array array = Enum.GetValues(type); foreach (Enum value in array) ...
0
e692c180c016413a097b146e7cb8738e
01a8236203d5d7bbb7cfe33557e59cac
Рисует левую часть пирамиды.
public class Paint public String leftTrl(int height) { return this.loopBy( height, height, (row, column) -> row >= height - column - 1 ); }
1
fa9c366c9df4726b27432415bfd1aed4
a39622f5982bd8693703d3badc37d23a
Starts the WCF service.
{ if (m_host != null) { throw new InvalidOperationException("Server already started"); } m_host = new ServiceHost(m_instance); var pipeUri = GeneratePipeUri(m_currentProcess.Id); var httpUri = GenerateHttpUri(m_currentProces...
1
694cc7069f73a9b300fb877dc52cf78b
d0c2795a5a8ddfb1c87aa69d27645cf3
recupera quantidade de OS por estado
global $con; $arr = []; $sql = "SELECT stato, COUNT(*) AS cnt FROM questionari_compilati GROUP BY stato"; if($result = mysqli_query($con, $sql)) { $cr = 0; $tot = 0; while($row = mysqli_fetch_assoc($result)) { $arr[$row["stato"]] = $row...
1
ce9e5dc246fe0e748dd10b5dc48c7ecf
68e6a41c711f0faf4be5778de8bc3f04
Assesses whether drivers without transaction support can proceed
class MsSql isTransactionSupported() { return true; }
0
9b00e3b6a66f2b7eccdcba9f96dd8265
716642f6ad2acc6f10c44833aef37785
examService.findBy_course
List<ExamVO> getExam(Integer courseId);
1
059fac50ffbcd37875d65e9a233d0e39
050d18b310053161e75b9b2f5d0e638f
obter Emprestimos atrasados de Biblioteca
@Named(value = "queryBean") @RequestScoped public class QueryBean public Collection<Exemplar> getExemplaresEmprestados() { return null; }
0
f437afd7f3c493687e526d476e724f65
83745c78b332339197ef2f787b930a60
信息素衰减
void Map::reduce_pheromone() { size_t size = matrix_pheromone.size(); float k = 1 - evaporation; float eps = 0.00001f; for (size_t i = 0; i < size; i++) { for (size_t j = 0; j < size; j++) { if (i != j && matrix_pheromone[i][j] > eps) { matrix_pheromone[i][j] *= k; ...
1
cea4e8a28eea982aa411fbea80847577
6561586c7f26f6a94c43a42b368fa701
Check to see if InferenceSchedulerArn property is set
namespace Amazon.LookoutEquipment.Model public partial class CreateInferenceSchedulerRequest : AmazonLookoutEquipmentRequest internal bool IsSetRoleArn() { return this._roleArn != null; }
0
fc771d2c49a030ed0fbc6085a5028aa6
d3ed2d0856fdc02845babf97c2673668
Sets flow timeout to default value (30 seconds). Returns: Nothing.
class VersionedProcessGroup(object): def default_flow_file_expiration(self, default_flow_file_expiration): self._default_flow_file_expiration = default_flow_file_expiration
0
a3db30ad0df5e2bcb735629e16fb8563
408bbfcebdcbeed2626c88c11c328c74
Invalidate an existing cached object by cache prefix.
{ if (string.IsNullOrWhiteSpace(prefix)) { throw new ArgumentNullException(nameof(prefix)); } if (cache is not IExtendedDistributedCache cacheExtended) { throw new Exception($"Selected distributed cache not implements {nameof(IExtendedDistributedCache)}."); } return cacheExtended.RemoveBy...
1
f78aecbdc8012e195921f24edf6ac01e
79b127958962c9982c54df50fd5c0a6f
Get the mode of the HMC5983 to Table 10-12 for the meaning of the value.
class DRV2605: def mode(self): return self._read_u8(_DRV2605_REG_MODE)
0
68edeb8902a6a90f098152164450bba5
e000e6c529cc0ab170141cb6ea3c3667
repo_dir: the directory of the repo to validate dir_maps: A dictionary that includes each directory information. k: normalized path to the current directory. Root/repo directory is represented by '.' v: A list includes 2 sub lists: 1. a list of dependencies 2. a list of direct owners approvers_input: comma separated ap...
self.versioning.traverse_directory(repo_info, repo_path) (added, new, modified) = self.versioning.get_status(repo_info) return (repo_info, self.messageBuilder.build_status(config.default_status_msg, added, new, modified))
0
dc73608188484642bd12791640c0bd9f
5fd42f5de1109e2ed8b15045cf4d4ddb
获取文件名(无后缀)
namespace JW.Framework.V1.IO public static class IOHelper public static string GetFileName(this string fileName) { return Path.GetFileName(fileName); }
0
e06c222c86d4bfcdc2bc46c7792d86fd
182d5657fad1c6e8b692ee5ec5f87a0b
Вычислить контрольную сумму массива с применением алгоритма SHA256
{ byte checksum = 0; for (var i = 0; i < result.Length - 1; i++) checksum += result[i]; return checksum; }
0
6ca0104621e9ba4a8e4bb8d943fd56a5
cc40e6d32abb2c16fb91bd032a1582d6
rebuild the message according to the msg-code and then send it to the center server.
class diameterTwistedServer(diameterServer): def send_request(self, msg_name, session_id = None, origin_state_id = None): reactor.callFromThread(self.factory.triggerMessage, msg_name, session_id, origin_state_id)
0
ce80799fd24d9e6f379154551a0dff50
4181f461aed063fc9a4c81726e818c75
Method that shows a toast after deleting a task
export class EditListingPage presentDeleteToast() { let toast = this.toastCtrl.create({ message: 'Post Deleted', duration: 3000, position: 'top' }); toast.present(); }
1
ff0119ba1b616b24f64e62786ce1aa96
872e81ee2c5748cd369213b58917dccc
Zwraca referer, lub stronę główną jeśli brak
if (!is_null(self::$referer)) { return self::$referer; } $storage = new MrClay_CookieStorage(array( 'secret' => UserConfig::$SESSION_SECRET, 'mode' => MrClay_CookieStorage::MODE_ENCRYPT, 'path' => UserConfig::$SITEROOTURL, 'httponly' => true )); return($storage->fetch(UserConfig::$entry_referer...
0
5c8b195ce364064089286d1be186abb6
4015fc21df90762cfecd8f22dd6746f1
获取图片默认加载动画-Drawable对象
DisplayImageOptions options = new DisplayImageOptions.Builder().showImageOnLoading(R.drawable.add_persion) .showImageForEmptyUri(R.drawable.add_persion) .showImageOnFail(R.drawable.add_persion) .cacheInMemory(true).cacheOnDisk(true).build(); return optio...
0
a0b2d7f6b1851d398b50a3920259b5f3
badfbc97d3d0c7398cdeb36ca8b53b1c
查询且减少尝试次数
public class RedisLock public boolean tryLock() { if (this.retryCount > 0 && this.retryIntervalMillisecond > 0) { do { if (this.lock()) { return true; } try { Thread.sleep((long)this.retryIntervalMillisecond); ...
1
6c3fe7828100a61a43bcd4cfdc8d11dc
f4da6e1a14fdb1baf969914448d417f1
\brief Tworzy obszar, w którym znajdzie się bryła pojazdu
double HNx = Nx - Hx, HNy = Ny - Hy; double HMx = Mx - Hx, HMy = My - Hy; double car_width = 1.2, car_length = 2.2; double safe_margin = 0.3, side_margin = car_width / 2.0 + safe_margin, front_margin = safe_margin, back_margin = car_length + safe_margin; return InRectangle(HNx,...
1
a350b51082639970faf0aee9122cd569
44247bc7fb5c7ed2f5a7bf12f794c27f
Чтение объекта примитивного типа из формата атрибута XML
{ var type = X3DBaseReader.GetEnum<X3DPrimitiveType>(element, X3DTOK.X3DTOK_TYPEID); X3DPrimitive<TY> res = null; switch (type) { case X3DPrimitiveType.LineLoop: res = new X3DLineLoop<TY>(); break; ...
1
d747811dde8e1f72c20e9c9ee6829d57
7a1ae449a1133f7a896acf6c71623aac
根据文件标志获取视频信息
@Service("videoService") public class VideoServiceImpl implements VideoService public Video getByFileName(String fsFileName) { return videoDao.find(Video.class, String.format("{'fsFileName' : '%1$s'}", fsFileName)); }
1
391755051d1cf74bc98a1089601d64ce
1b017055c253e09437946ade935fb3b6
Save grayscale frame into video output file
class WriteVideo: def add_frame(self, im): assert np.shape(im) == self.frame_size, "Added frame is wrong shape" if self.grayscale: im=cv2.cvtColor(im.astype(np.uint8), cv2.COLOR_GRAY2BGR) self.vid.write(im)
1
25b5ee7b093abe79eb5da45f70be04bd
8d27215e1095c445fcc548e4e9137edd
左端の位置を返します
public abstract int getLeft();
1
f76ecc0a7e2643256cf7b8da15f10677
6212fd9efe5b43046ef044baa1f483b8
Set the value related to the column: ROOMDININGDIM
public abstract class BaseProperties implements Serializable public void setRoommasterbeddim (java.lang.String _roommasterbeddim) { this._roommasterbeddim = _roommasterbeddim; }
0
623bd7da83c3ab518ca1c423fffc8799
aaa37e6711df1d10c7b0730924dd1bda
Loads value from register.
{ if(rInReg) { copyValue(rInReg); } else { Error.printError(ERROR_NULL, FILE_BITREG); } }
1
e2cc31394d013890ca8345b3fdbc1497
4b46fec5bc6925a054c15f35fcdceed3
10. An indication of Pass or Fail is given out after the three marks are entered.
public class GradesFinal public boolean getPassFail() { passFail = (getFinalGrade() >= 60); return passFail; }
1
1fc467d23ad5bddc89e140cf668a2cc2
4531507803fd97d278b76913e14c5f08
============================================================================== Untuk me-refresh timeline setiap beberapa detik sekali (thread terpisah!) ==============================================================================
class Body extends Component componentDidMount() { setInterval(this.fetchRapchatData(), 30000) }
1
3605c19c00e94a5e83e4c730565265c0
5c65980eab29bebc0661492947a15eaf
Creates or sets up test database name, loads fixtures and mocks ``SMTPConnection`` class from ``django.core.mail``.
class TestSMTPConnection(object): def __init__(*args, **kwargs): pass
0
9bc7654b6c18d67f6d19586b8cf596e3
c35fdac31bc8aec62cdc842892ae277c
平台介绍
class Api extends Controller public function aboutUs() { try { $wherePlat = [ ['id','=',1] ]; $info = Db::table('mp_plat')->where($wherePlat)->find(); if(!$info) { return ajax('data not exists',-1); } } catch (\E...
1
5d8b6aba9dc21bcc84b19b13c0e909af
cb98fc55cd2de05b1d453a920b6adfbc
Initalize the registration form group with form controls defined in the component
this.registrationForm = this.fb.group({ firstName: ['', Validators.required], lastName: ['', Validators.required], userName: ['', Validators.required], email: ['', [Validators.required, Validators.email]], password: ['', [Validators.required, Validators.pattern(Config.passwordPol...
1
353d5e33918938548534587a03ca8ea1
375d419b7ab8ce3c43cdc7a1a891c391
Sends the proposal to the customer
function handleOnSendProposal(msg: string) { client.write(msg); }
1
9b8b2f9826ef1f233c0ffcd3f134754d
102c8fd3185ca4091dc43de31d4c24f4
Al iniciar la vista, se cargan los bookings, mediante un servicio
export class BookingComponent implements OnInit ngOnInit() { this.upcomingd = true; this.getbookingservice.getbookings().subscribe(response => { this.mybooking = response; }); }
1
beb530750b08510df1107f2c95fbcd23
35cff31c98bbc2114bc40db5f1abefc0
Example use of the TensorFlow image model in a ML.NET pipeline.
namespace Philips.Chatbots.ML.Models public class NeuralTrainingEngine : AbstractTrainModel<NeuralTrainInput, PredictionOutput> public override EstimatorChain<KeyToValueMappingTransformer> TransformAndBuildPipeline() { var fText = $"{nameof(NeuralTrainInput.Text)}Featurized"; var tra...
0
3a18cd9ad85674dd4d0167e225deb634
94c087256d4c39c41429bfeba99c38a7
send a command to the M0 core do not wait for acknowledgement when this is called from ISR context, since the acknowledgement will be delivered using the same interrupt mechanism that is still handling the previous interrupt request, so it would deadlock.
static smartcard_core_error_t ttl_send_cmd(smartcard_core_params_t *coreParams, smartcard_ttl_cmd_t *ttlCmd, smartcard_ttl_resp_t *ttlRespPtr) { assert((NULL != coreParams)); assert((NULL != ttlCmd)); assert((NULL != ttlRe...
0
d8b9fc622caf7f12c4de3eeb14aee15c
048ccc33c9e7a648fffad75d0df1b010
已进场车辆
public Map<String, Object> carEnter(Map<String, Object> params);
1
0b29ba7b3cfcc3f034db457666773b6b
90b1ba59fe9bd406bdcc54100f7c3342
Reindex plugins from system
{ $process = $this->getProductFlat(); if ($process) { $process->reindexAll(); } return $this; }
0
4ed186e8bec14e67ae18564280c2019c
87eee3b75cce4ea88eb9446ad9ef6e93
Freeze the iterator, cannot be reused.
public function freeze();
1
f600a26ad62d2aa35ab5c18404eeb998
f0bcca21ffb8840f7c605b3c69d84ffc
Projede všechny chyby z daného řádku a vrátí je všechny v jedno řetězci odděleny novým řádkem
{ StringBuilder strb = new StringBuilder(); foreach (string str in errors) strb.Append(str + '\n'); return strb.ToString(); }
1
bfa795450a2e588b0f1aaddf234b1c0d
0ad5b45b1121a31bae8f49c1a8f1edfc
Hook for mallinfo
namespace class MallChecker : public EmptyTestEventListener void OnTestStart(const TestInfo& ) override { printf("OnTestStart\n"); ini_info_ = mallinfo(); }
1
88617b1e0135cdfc660a985d3a6147d6
207df1a365282e7a386dc389e9c6743f
レベル選択画面で決定したレベルを取得する
function getLevel() { return $("#sel option:selected").val(); }
1
0848f1cc46064b0962c3d24b81177a9d
6c5359f1004995e88fd7f5d6694cc738
Entity under test must be an runtime exception.
resp = PyralRallyRespMock(errors=['error1', 'error2']) ralint_obj = ralint.Ralint(PyralRallyMock(resp), {}) self.assertRaises(RuntimeError, ralint_obj.get, 'DummyEntity')
1
be09a9b022507312c770b2967c5f1df7
e95ce17baa2fcfc8d5a7eb4faa5d5fe3
Prints a victory message after player defeats a monster or boss
print("") print("***********************") print("***********************") print("*** ***") print("*** PLAYER %d WINS ***" % player) print("*** ***") print("***********************") print("***********************")
1
e556578747736273a2aa07c4432c8c29
feb0ae411fa41461e9068eebddf77574
广播帮会消息
function GameViewLayer:onBroadCastPlay(str) self._scene.mIsBroadCasting = true self.mLbBroadCast:setString(str) self.mLbBroadCast:move(self.mNodeBCInit:getPosition()) self.mImgBroadCast:setVisible(true) local actMove = cc.MoveTo:create(DisplayConfig.DURING_BC_ONCE, cc.p(- self.mLbBroadCast:getContentSize().width, ...
1
3e94b66c251735adc8764fdb62016001
a20d876b4920ad8d3d4710c036c2df8b
get the current clean machines
class Model(object): def machines(self): return self.state.machines
0
5eeaaee114596b4f40ea46763e6c8151
a67be634c0e6209891540dbe831b4e66
三方征信1查询黑名单
start_time = time.time() MysqlClent.update(MysqlClent.get_conn(), 't_rap', 'is_exe = "Y"', 'id = 2699') requesturl = baseUrl + "/v5/creditbanks" LOGGER.info("白条_央行征信_查询请求地址:【{}】".format(requesturl)) params = dict() params["VerifyCode"] = verifycode params["account"] = account params["id"...
0
37468d84bf852b3e70a517461ac84af1
90a8976ae92c1dfd9b052cfb9d81008e
The method takes the incoming get bulk requests and split it into subrequests.
class SnmpRequestHandler extends ClientHandler implements SnmpDefinitions private void splitBulkRequest(SnmpPduBulk req, int nonRepeaters, int maxRepetitions, int R) { for(Enumeration<SnmpMibAgent> e= mibs.elem...
1
950dc69892af4fe85581062b8939d61b
245011463ff51f912e00eb7fb4e1d7f1
校验输出脚本的大小
public class DtoSizeTool public static boolean checkScriptSize(ScriptDto scriptDto) { if(calculateScriptSize(scriptDto) > ScriptSetting.SCRIPT_MAX_CHARACTER_COUNT){ LogUtil.debug("交易校验失败:交易输出脚本大小超出限制。"); return false; } return true; }
1
fe4c5b955bcf2f33eaa0f88303ae32c4
e76ec6c11cd7b471e93eb92ddf8f0a58
用于对模型效果的展示,展示模型在训练集和测试集上的效果。主要针对于提升树模型,返回训练集和验证集上 评价指标的值和在训练集的模型。
def model_score(model, model_name): y_pred = model.predict(X_test) r2 = r2_score(y_test, y_pred) rmse = np.sqrt(mean_squared_error(y_test, y_pred)) mae = mean_absolute_error(y_test, y_pred) print(model_name + " model R^2:%s" % r2) print(model_name + " model RMSE:%s" % rmse) print(model_name ...
0
1e90759d6511a317e086c48c92638676
02444a29e1f80f52cd738072940dd417
Generalized rotation based on center of rotation
self.translate(Vector(-rotateAbout.x, -rotateAbout.y)) theta = math.radians(theta) RotationMatrix = Matrix(math.cos(theta), -1*math.sin(theta), math.sin(theta), math.cos(theta)) NewPoints = [] for vector in self.points: newvector = RotationMatrix * vector ...
1
1d3654c461f18c6725dfb44df185bad6
db1d56e02326277e59a47c7f9639e9ce
Update URL if the tab changed.
class Application(tk.Frame): def callback_tabChanged(self, *args, **kwargs): if self.initiated: self.updateUI()
0
21aa3474307611227883f7ceee3dd657
81571dec12e93d4a58433dfe947aaa51
Sequencer detection routine.
{ static const UCHAR seq[] = { 0x00, 0x00, 0x01, 0xB3 }; static const UCHAR gsc[] = { 0x00, 0x00, 0x01, 0xB8 }; static const UCHAR psc[] = { 0x00, 0x00, 0x01, 0x00 }; if( memcmp( data, seq, 4 ) ) { return 0; } int len = 4; while( len < size - 4 ) { if( !memcmp( data + len, gsc, 4 ) ) { break; } if( !...
1
782d99e9d9ec60ec38b79630b0176b0f
1ebb0304ccd6ace67793f19238b18521
价格相似度
def sim(theUser,Now): diff=0 for a in theUser.favoriteDishes: if a not in Now.favoriteDishes: diff+=1 return float(1)/(1+math.sqrt(diff))
0
5fb6cdd627ab2cc4fc797bbfc5890a6d
fdcb9a11b578e85bfd231b8b1c77fed0
update the json_assignmentlist object so that it does not contain the deleted assignment
const sql = "UPDATE assignment_files set is_deleted = 1, date_deleted = datetime('now') WHERE id = $id "; const params = { $id: id }; return new Promise((resolve, reject) => { var local_callback = function (err) { if (err === null) { resolve(this.changes); ...
0
66f696ec5069f5e2bf8f1ba0d69142e5
bcd476b0d85af3ba6b0a026c9ee4dfd5
The GOST2001-GOSTR3411_94 signature transform klass.
xmlSecTransformId xmlSecMSCryptoTransformGost2001GostR3411_94GetKlass(void) { return(&xmlSecMSCryptoGost2001GostR3411_94Klass); }
1
44e57f89c1643f01d03b9c0dd20a28b5
b79daf2b46c4e8016cedeb8be1574886
通过RUNID获取发起人姓名
@Service("approvalExpenseService") public class ApprovalExpenseServiceImp implements ApprovalExpenseService @Override public String selectrnameByRid(int rid) { return approvalExpenseMapper.findrnameByRid(rid); }
1
57007577064161925ae4ae1ed62aec18
d448ff79fc7da24cfacb55b6f266bed5
Redirects to /home if already logged, forwards to the connection page otherwise
{ $identity = Yii::$app->user->identity; $steamConnected = empty($identity->profile->steam_id) ? false : true; if ($steamConnected) { return $this->goHome(); } return $this->render('connect'); }
1
e062c6a7c74734c40c38895e87d980e1
4b11da408df523c3dc234d8e03d9e7dc
申请一个SocketAsyncEventArgs结构。
namespace ZdCache.PorterBase public class TcpSocketServer : SocketBase private SocketAsyncEventArgs CreateNewSAEAForAccept() { SocketAsyncEventArgs acceptSAEA = new SocketAsyncEventArgs(); acceptSAEA.Completed += new EventHandler<SocketAsyncEventArgs>(Accept_Completed); r...
1
e3e9dc676bedf496bfa1c6e6cdac6aae
659499f59d1c6385b51e145555875d2b
Attempt to figure out the server protocol, hostname and username.
{ curi_status status = curi_status_success; if (status == curi_status_success) TRY(status, offset, parse_userinfo_and_at(uri, len, offset, settings, userData)); if (status == curi_status_success) status = parse_host(uri, len, offset, settings, userData); if (status == curi_status_success...
1
c9493a4dc1c894ac7b53fd51e3911b2b
0df9a3c30fea0876b1a01cab3f182291
求事物的频繁项
candidate_1 = [] for transaction in data_set: for item in transaction: if not [item] in candidate_1: candidate_1.append([item]) candidate_1.sort() return list(map(frozenset, candidate_1))
0
9c3fe08f0566074afefda6974961f8ff
0ba36141112906b5fbc2229e1cfaa6bd
creates a new left child of Position p storing element e, return the left child's position. If p has a left child already, throw exception IllegalArgumentExeption.
Position<E> insertBefore(Position<E> p, E e) throws ExceptionPositionInvalid;
0
b43594526850216084288aa3b8929c70
75af0a398caaf16c5d627165cd241596
Calculates and returns the refractiveIndex
Pd = prepare_quantity(Pd, u.hPa, 'Dry atmospheric pressure') e = prepare_quantity(e, u.hPa, 'Water vapour pressure ') T = prepare_quantity(T, u.K, 'Absolute temperature') val = __model.radio_refractive_index(Pd, e, T) return val * u.dimensionless_unscaled
1
acbd31586fc05ce6431c2f66d978624f
323e92288de2bbe9977e65de4ed2734b
Dump internal dict-object to JSON using the builtin `json` module.
class Hashable(FieldMixin): def to_json(self, encoding=None): od = self.as_dict(include_private=True) rendered_json = json.dumps(od, ensure_ascii=False, default=serialize_nonstandard) if encoding: rendered_json = rendered_json.encode(encoding) return rendered_json
1
7a564811ba5255c78ea51f5b37f8be63
a1379fcd9744db7a7d77e347a6be7f8d
ページ権限一覧
class PermissionController extends Controller public function index() { $permissions = Permission::orderBy('permission_slug')->paginate(20); return view('auth.permission.index', compact('permissions')); }
1
5428640ccb7b047dcfba2c5e1243f6be
b406d10773318ab0966137a5ad03b02a
Caches the electronics types in the entity cache if it is enabled.
{ typeEntityType = null; typePredefinedType = null; if (entity is IFCObject) { IFCObject ifcObject = entity as IFCObject; if (ifcObject.TypeObjects != null && ifcObject.TypeObjects.Count > 0) { IF...
0
6bbcb1359f4badffb2d23c6886fb213c
780030126fd89bc63b1fbc15ff130ec6
Herschaalt de afbeelding zodat deze past binnen de huidige afmetingen van het panel
public class CardButton extends JButton @Override public void componentResized(ComponentEvent e) { JButton btn = (JButton) e.getComponent(); Dimension size = btn.getSize(); if (size.width > size.height) { size.width = -1; } else { size.height = -1; } Image scaled = image.getScaledIn...
1
76908b49690fe408e7950bf1dc7bc16e
67f71a8a191adc7034cc85f41b7b6516
Returns the counter of created packets from this type
class SenderReportPacket extends _1.RtcpPacket getPacketCount() { return this.buffer.readUInt32BE(20); }
1
e578631293ec3d0fb16c197b4d137c20
612926f7bbd6ac836e5bc5e9e71f7ec8
歌手列表页面解析
res = requests.get(url=cf.url_singerlist, headers=cf.headers_singerlist) res.encoding = res.apparent_encoding data = BeautifulSoup(res.text, 'lxml') d = data.find_all('ul', class_='container')[0] d = d.find_all('a', href=re.compile('/artist/.*'), title=re.compile('.*')) result = [[i['title'], r...
1
14001daf9466e801189503fe5aa44f13
c1cf363c3eb38416758d6cc3a7d7d280
Find the scan-beam points to the left of a cubic Bézier segment.
public static int ScanbeamPointsToLeftLineSegment(double x, double y, double x0, double y0, double x1, double y1, double epsilon = double.Epsilon) { var u2 = x1 - x0; var v2 = y1 - y0; var ua = (u2 * (y - y0)) - (v2 * (x - x0)); var ub = y - y0; ...
0
0ea3b69870fe7d1fb863e523d811bee0
1849f261b9a939cdd1559ba910a558eb
Check link is expired or not.
@Component class SendMail fun linkExpires(token: String): Boolean{ return concurrentHashMap[token].safeUse() }
0
17e6f451ddb1141b9c762e32d6210cd9
8c5e470cf4f074276ec8e5dbc9c38666
更新头条用户状态到数据库
@Service public class WxWallUserBizImpl implements WxWallUserBiz @Override public void updateWxWallUserStatus(WxWallUser wxWallUser) { baseDao.update(wxWallUser, "updateWxWallUserStatus"); }
1
2a53f8bc28b589375c32dc6405a82b15
30be78a297b4068e1cc464d569d7d98c
开发模式下,忽略权限检查
public void beforeMethod(JoinPoint joinPoint) { if (devModelConfig.isDevModel()) { return; } HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest(); User currentUser = (User) request.getSession().getAttribute(Con...
1
0fed8ab575f93632a499771745c93cd0
18de88c87363d3e86f4c44e251c47608
审核商户后记录商户审批意见,审批人等
{ $id = I('get.id'); $audit_status = I('get.audit_status'); $map['id'] = $id; $data['audit_status'] = $audit_status; $result = D('Merchant')->where($map)->save($data); if ($result) { $this->success('审核成功', U('Merchant/index')); } else { ...
0
fda47437cea30752ccc2cf94f75ebb24
e2ea7d02a5ef186df7971ef925c30c03
判断该股票能不能进行买卖交易,如果停牌(即相应交易日没有数据),或涨跌停(注意ST股是特殊情况)
class Stock: def isStop(self): return self.todayStart == 0 or self.yesterdayEnd == 0
0
82818eda412aec4744e39321c9d4808c
b44033f6da685c8fb9f58951d0c61080
判断是否是预约商品,如果是预约商品返回详情
if '暂无定价' in body \ or '403 Forbidden' in body\ or '此商品暂时售完' in body: return False return True
0
50057de24d0449e1ba439c10de0b0abd
635d5ea3ec8b5b4c569c5351b9adbd23
Get a summary of a character's reputations.
{ $this->setUserAgent('Opera/9.22 (X11; Linux i686; U; en)'); return $this->fetchCharacterReputation($character, $locale, $realm, 'html'); }
1
36df65268933aa702abf54121fc94a78
bf75dd4a1f9beee5b774c764efab17b7
функция, проверяющая наличие значения в массиве по ключу
foreach ($array as $key => $value) { if ($keySearch === $key) { $result = TRUE; break; } else { $result = FALSE; } } return $result; }
1
93a4b9e9aaaa3625d2a8a062aa91a7ee
1306e0758dbf3672d0df9d79f3e49e6a
Function to delete a given CourseAlert identified by the courseAlertId. As this table is a Leaf table and not linked to any sub-table. Safely delete it.
SQLiteDatabase db = this.getWritableDatabase(); String whereClause = CoursesTable.COLUMN_ID + " = ?"; String[] whereArgs = new String[] { String.valueOf(course.getId()) }; long rows_affected = db.delete(CoursesTable.TABLE, whereClause, whereArgs); db.close(); return rows_affected; }
0
588f05bcfa4a590a32a33eaa3e2f883d
497f2478ba5a3e785d84b109fd5dea64
通过周 和时间字符串 得到 时间戳
str = strings.ToLower(str) arrTmpMap := make(map[string]int64) arrTmpMap["seconds"] = 1 arrTmpMap["minutes"] = 60 arrTmpMap["hours"] = 3600 arrTmpMap["days"] = 86400 _timeNow := time.Now().In(loc) for key := range arrTmpMap { if strings.HasSuffix(str, key) { number, err := getFormatInt(str, key) if err ...
0
db2e17d23b6dd71a7ae768d3d4b90590
c40b8217d7004e085b4300304ee9f921
Check the cluster level to decide whether to join the network
def join_etcd_cluster(): hostname = socket.gethostname() os.environ['ETCDCTL_API'] = '3' os.environ['ETCD_NAME'] = hostname cluster_ready, host_node_seen, host_node_info = get_cluster_node_info(hostname) start_mode = '' if not cluster_ready: start_mode = 'new' else: if not ho...
1
af5b057b49e6b63be3cabae765ba681b
13f8672f1cfe4f0b58de83c824a510a7
设置拆分相关数据
getSplittinDetails(data) {return ajaxRequset({url:'/API/AccountDetailHandler.ashx?action=GetSplittinDetails',data}).then((res)=>res)}
0
9a10e1c15a78ffc414424d78aa41b8d7
c8262ac308b3e2dcd275f50991f56d68
Called after the Contextual Search panel's animation is finished.
public void OnSearchEnd();
1
e4f165044b7f928435763361ca3871d8
86a7056bff867bf74048b0eb243de393
fills the mismatch count array (howmany sequences with m mismatches to a given sequence exist) ; for width=2
{ int iIndex; for (iIndex = 0; iIndex < NO_OF_CHARS; iIndex++) iBadMatchArr[iIndex] = -1; if(optionsArr[3] == 0) { for (iIndex = 0; iIndex < iSize; iIndex++) iBadMatchArr[(int)pPattern[iIndex]] = iSize - iIndex - 1; iBadMatchArr[(int)pPattern[iSize - 1]] = iSize -1; } else { for (iInde...
0
619eb5dd6f0370266290dcf32e791b4d
b2e03948ba7ad174f57ba59b0472d362
gets the all the fields that contains numeric values
def getNumericAttrs(df): return __getNumericHelper(df, True)
1
4649e68b754b3a93adceca6c055cc478
651ef837d9ce55262649fb6e15307113
代理程序管理页面划入划出检测
class Homez_test(unittest.TestCase): def test_leak_manage(self): shou_Ye(self.driver) see_more_count = self.driver.find_element_by_css_selector('.wordStyle') ActionChains(self.driver).move_to_element(see_more_count).perform() self.driver.find_e...
0
b6c18becd51b8c38ae1b1fda50af329f
5edc1e8e313dc54f89e0d5247b1e4680
Возвращает пользователей указанной беседы.
namespace Messenger.DataLayer.SQL [SuppressMessage("ReSharper", "InheritdocConsiderUsage")] public class ChatsRepository : IChatsRepository public IEnumerable<Guid> GetChatMembers(Guid chatId) { using (var connection = new SqlConnection(_connectionString)) { Logge...
1
5625bc3b7d287fa628cdb37f8682aa72
fcfb2777579accf9771681da9908a1d6
Add a pattern matching an optional, but singular element: E.g. "a?" denoting zero or one instances of the character "a".
namespace Stringier.Patterns public static partial class PatternExtensions [return: NotNull] public static Pattern Maybe(this Char @char) => new CharLiteral(@char).Maybe();
1
0b478a56bed042d1a4785f07f4862376
0f5ee6dc60fd853aa0725ba33260cbd0
call the connection monitor to disable heartbeats
namespace GraphQL.AspNet.Apollo internal class ApolloClientConnectionKeepAliveMonitor public void Stop() { _timer?.Change(Timeout.Infinite, Timeout.Infinite); _timer?.Dispose(); _timer = null; }
1
539f0aae4cb7ea48cd065adcf6d50a83
1f8a447d17e0ec13d7e831efe72d0332
Creates new file containg (year, low, perc) records from input file, perc is the percentage of increase/decrease of income after applying 'social taxation'.
output = open(output_filename, "w") repeated_donors = set() donations = {} with open(input_filename,"r") as f: for line in f: fields = line.split("|") CMTE_ID, Name, zip_Code = fields[0], fields[7], fields[10][0:5] Transaction_DT, Transaction_AMT, Other_ID = fields[13], fields[14], fields[15] if(check...
0
8ae4e76b14f124a7c83b3d83ff734df1
28e2e99d74755e1b39e44e36cf821f60
Find the MIDI channel to use for this MUS channel. MUS channel 15 is the percusssion channel.
{ int a = ((midi / 12) - 3) * 17; int b = midi % 12; switch (b) { case 0: return a; case 1: return a + 1; case 2: return a + 3; case 3: return a + 4; case 4: ...
0
a6f1636ac68f36b643375fe86c02f39c
20d2a91ff9538cc266d29769b1df2f32
Returns the arrlstUserLevel.
public class UserLevelManager implements ISyncCatch{ public static Map<String, UserLevelBean> getUserMap() { return userLevel_Map; }
0