query_id
string
corpus_id
string
query
string
code
string
label
int64
e80c324f221a92800118677f29a5d3bf
fca24d18f33b4ce45a56b55ad60e2055
Tests how BitWriter treats a non-complete bit stream.
let mut uper = UperWriter::default(); let v = ExtensibleStruct { range: 145, value1: Some(146), value2: Some(146), value3: Some(146), value4: Some(146), value5: Some(146), value6: Some(146), value7: Some(146), value8: Some(146), val...
0
4c71c3519ed71d79f0ab611c9998298b
9872706a5a47b8f5c248ee563bf70a35
Function to convert {@link VisitorCriteria} to a {@link Specification}
@Component @Transactional public class GuestService{ private Specification<Guest> buildSpecification( Map<String, Object> searchParams) { Map<String, SearchFilter> filters = SearchFilter.parse(searchParams); Specification<Guest> spec = DynamicSpecifications.bySearchFilter( filters.values(), Guest.class); r...
0
69d99c41160409db7be07632ee8e1a32
33dea74a5ea2e880d7237c1b0d60e5bd
根据model生成tree控件
boolean showLink) { Collections.sort(treeModels); TreeRepositoryBuilder builder = new TreeRepositoryBuilder(); TreeRepository repository = builder.build(treeModels); StringBuilder buffer = new StringBuilder(); List<?> topComponents = repository.getTopTrees(); for (int i = 0, len = topComponents.size(); i...
1
145f5e24221107ab9eb5922831f48c2a
e379244cf54a03f2d34369f3275e02dd
Returns a list of remotes for a given repo
class Repo def remotes Remote.find_all(self) end
1
054ee58cd0d68f15f94d993c57bc8cfe
292f6b5314e2a8a5ae86e4f50010df9f
Create the dictionaries used to convert letters to and from an integeger representation (0 based)
class text_gen: def int_mapping(self): self.char_to_int = {} self.int_to_char = {} for i in range(self.num_classes): self.char_to_int[self.unique_char[i]] = i self.int_to_char[i] = self.unique_char[i]
1
b5a65ac4876ef70981c9acd50296c362
7ac14e59c777c35222d04a4fe748e20f
查询指定设备的消费金额和消费笔数 deviceNo 设备编号 createDate 消费日期
AnalAmountDTO pageAnalAmount(Long userId, String deviceType);
0
ba3aac7f46907413d4d5a49f2ee016b4
75ef0ce229ba2225ec9ca0ab6d81139b
分页获取订单仅退款原因。 根据排序字段从大到小排序。
@Service public class IRefundCauseServiceImpl implements IRefundCauseService @Override public Map<String, Object> findAll(Map<String, Object> param) { Msg msg = null; int page = 0; int size = 0; String types = null; Map<String, Object> map = new TreeMap<>(); try { ...
0
30bdd60b47a15e590a1ed840b9271145
9b07a6627a6cbf77825161efbaf5d6ea
Test checkpoint of an ensemble trainer.
class Interrupted(BaseException): pass class InterruptAfterKthModel(Monitor): def __init__(self, k): super(InterruptAfterKthModel, self).__init__() self.remains = self.k = k def end_training(self, has_error=False): self....
1
fedcea19b9f61fca38b31554791d7f0a
768672f4e77b7bc70626a10a7939b879
Gets the time in seconds a session is allowed to be inactive before timeout.
public class SessionModelImpl implements SessionModel public int getMaxInactiveInterval() { return maxInactiveInterval; }
1
15c38c4ba9f1d229ced19d441d5cb24c
76c7c975ccbaeb3e20877271a0990571
Remove all sensor from device list directly.
{ $yreq = self::_updateDeviceList_internal(false, true); if($yreq->errorType != YAPI_SUCCESS) { $errmsg = $yreq->errorMsg; return self::_throw($yreq->errorType, $yreq->errorMsg, $yreq->errorType); } return YAPI_SUCCESS; }
0
b7c83cbfc21dbe9c25975cfc198045e0
b84894492aa6e02f59e9dec450deb96e
Specify against which fields the timestamp search will be executed (defaults to 'all').
public sealed partial class EqlSearchRequestDescriptor<TDocument> : RequestDescriptor<EqlSearchRequestDescriptor<TDocument>, EqlSearchRequestParameters> public EqlSearchRequestDescriptor<TDocument> TimestampField<TValue>(Expression<Func<TDocument, TValue>> timestampField) { TimestampFieldValue = timestampField; re...
1
98a0be8e84e30f2f122d5e7bb6ad3a25
bb4908a78c7be21cd7d5ba731c2b6e4d
Remove dots from Gmail email addresses
class ImdbSentimentTextModificator: def email_remover(self) -> None: self.processed_review = re.sub( r'([a-z0-9+._-]+@[a-z0-9+._-]+\.[a-z0-9+_-]+)', "", self.processed_review)
0
96ce4382174c0c54cfac934e535c8a1d
52577a9de08ce1da68a4b36bd3af4e4d
Implements the QUIT command. This command should ask the user to confirm the quit request and, if so, should exit from the play method. If not. the program should continue as usual.
{ if(command.hasSecondWord()) { System.out.println("Quit what?"); return false; } else return true; }
0
67c874bae0f4f4c6602557fcb9d99123
e371887b8fdd3f48d1ab50bdefa57a63
PHPプログラムを実行する。
class Rhaco{ function phpexe($php){ return eval($php); }
1
3b3a2edf77a9345fe9c4c692d661c2c1
9795f375195d0aa2f34115d897d6ccfe
Tests for nil "ZipCode" element
class TestAddress{ public function TestZipcode(){ $this->TestZipcodeOK(); $this->TestZipcodeNOK(); }
0
ed8d34defca65bd46b8c9559afb06902
8a625781a11a9213807b076023515f86
Wrap the contra library with a promise, and convert the promise functions into callbacks
for (var p in obj) { if (typeof obj[p] === "function") { obj[p] = thenify(obj[p]); } } }
0
02df40032b9c24b4158f8f9ae75ed8dd
1d185630b16b75e02b0f1589b5e42ff0
拼接艾特CQ码
function addAt(uid) { if (c2c) { return; } const cqcode = `[CQ:at,qq=${uid}] `; addStr2Textarea(cqcode); }
1
cc7da3b4ef5dbe85b1d2a0d9a9ea6092
8c5a92420d5f063f120ffd08cccab93d
sets different colors for different squares when hovered.
public class MonochromeTile extends Tile public void handleMouseHover() { setOnMouseEntered(e -> setFill(new ImagePattern(new Image("woodSquareHover.png")))); setOnMouseExited(e -> setFill(new ImagePattern(new Image("woodSquare.png")))); }
1
dbe85b00f6cc170830b45020ceca2ef8
ba7059d7d37d32ea419526cc2d43da1c
Returns the Aphia attributes for an AphiaID.
def aphiaAttributesByAphiaID(id): validateAphiaID(id) url = wormsURL() + "AphiaAttributesByAphiaID/" + str(id) return doGet(url)
1
0d0bda2be9ef3b7bdafe0bcca0b90d35
bc8747dd0ec2ef8aff0264d6287b013f
@brief Adds a user to the company
class CompanyHasUser extends AbstractCompanyService public function addCompanyHasUser(array $data) { $em = $this->getEntityManager(); if(isset($data['company_team_id'])){ $companyTeam=$this->getCompanyTeamInArrayByCompanyAndGroup($data['company_id'],$data['company_team_id']); } ...
1
9c56666853f801964d99ae8ca323476d
7c1a9a7a79435872d2cdb6bbc2b3cb53
Re-enable post mic audio path
udpPort.send({ address: '/subscribe', args: [ {type: 's', value: `/ch/${HOST_MIC_CH}/mix/on`}, {type: 'i', value: 3} ] }); udpPort.send({ address: '/subscribe', args: [ {type: 's', value: `/auxin/${HOST_TALKBACK_AUXIN_CH}/mix/on`}, {type: 'i', value: 3} ] }); }
1
057f34782fed3c0c4dc49649579e293e
c71a1515364d1e6832123c94fb45b7c9
keyに対応した文字列リストをKVSから取得する。
function getKeyList( pKey, pFieldsName, pTranslate, pCondition ) { var condition = " and aoactive = 1 "; if ( a.hasvar("$sys.workingmode") && a.valueof("$sys.workingmode") == a.FRAMEMODE_SHOW ) condition = ""; var sql = "select " + pFieldsName.join(", ") + " from keyword "; sql += " where keytype = (sel...
1
641e6e17064998e31ee3a54b1dd75f0f
329581657dae3a7bb1732c98fde0c279
Función que eliminará el pedido y todas sus lineas
[HttpPost] [Route("borrarPedido")] public HttpResponseMessage BorrarPedido(ObjGeneral nombre) { if (!ProcesadorPedido.ProcesoBorrarPedido(int.Parse(nombre.opcion))) { HttpResponseMessage responseError = Request.CreateResponse(HttpStatusCode.NotFoun...
1
84b8d65d671788c1cafdacd24c47dde5
bfeecc03f82497d864124d0908ba7d0a
put the displaystring for a thing in square brackets
{ string s = p->getTitle(); s = "[" + s + "]"; p->setTitle(s); }
1
3cc599b2811ccd1939053c70d4dbd74a
b178cec2d8c1e9edf6c24794bc04f2b3
Set the value of Product Title
class Product implements ModelInterface, ArrayAccess, \JsonSerializable public function setTitle($title) { $this->container['title'] = $title; return $this; }
1
56fee9554b46e600c5486d30353e06bf
75eeb4f3560d0bddcf0bff7984142361
Retorna o pai de um nodo.
int Pai(int posicao) { if (posicao == 1 || posicao == 2) { return 0; }else if (posicao == 0) { return -1; } return posicao/2; }
1
047be6196898fadb076255cbedb408c7
906b93345334a7286509d8e579b72153
Função para criar o centro do personagem
player.xPos = (LARG_TELA / 2); player.yPos = (ALTR_TELA / 2); player.velocidadeX = 0; player.velocidadeY = 0; player.raio = raioPlayer; player.status = 1; }
1
ccc376db481b26b5ac0f6575cde921a7
716d36adfef0040e22e41b5eaadabafa
リスト内で選択されているアイテムを削除する
namespace xCh5_1_2_11 public partial class Form1 : Form private void button3_Click(object sender, EventArgs e) { if (textBox3.Text == "") listBox1.ClearSelected(); else { int ndx = Convert.ToInt32(textBox3.Text); listBox1.It...
0
db79844f66e43e31030e02b8551371f6
24d646b7fd3a2aadcd5365df1496ed74
Теси доступности кнопки log in
{ if (!CheckEmpty()) { BtnLogin.IsEnabled = true; } else { BtnLogin.IsEnabled = false; } }
1
c88442031b97786dadd780858512fc29
472af556208d6c803137bc22aef8295f
Returns mini-batch of observations at `t`. Returns: numpy.ndarray: observations at `t`.
class VectorizedObservationStacker(object): def get_observation_stack_t(self): return self._obs_stacks[:, -self._history_size:, :].reshape(-1, self._history_size * self._observation_size)
1
72e77c985ff6f3582447ed4c5d3d917a
446c08cb9e26b5d386ff4c7a5e35c213
多条件查询类似于sql and
List<User> users = userQuery.list(); QueryBuilder<User> builder = userDao.queryBuilder(); Query<User> query = builder .where(UserDao.Properties.Name.eq("Jim"), UserDao.Properties.Sex.eq("男")) .build(); List<User> list = query.list()...
1
f96accc4e5c6e1508b2d2431c94a1ce7
64088602952ad7df31878110983e2377
显示牧场升级弹出框
{ if (!UILayerManager.friedTeaLayer.getChildByName("upGradeview")) { UpGradePotCtrl.upGradeview.bgUI.name = "upGradeview"; UILayerManager.friedTeaLayer.addChild(UpGradePotCtrl.upGradeview.bgUI); } UpGradePotCtrl.upGradeview.bgUI.visible = true; UpGradePotCtrl.upGradeview.bgUI.x = configs.GameCo...
1
54407b952496a33df67f34038c9de580
2027db97e81e3b2f234ce105fc815624
向 erp 上传医院信息
@ResponseBody public Map<String,Object> uploadToHRO(HttpServletResponse response,HttpServletRequest request,@RequestParam MultipartFile[] uploadFile) throws Exception{ EhrUser user = RequestUtil.getLoginUser(request); try{ String storageUrl = FileUtil.confirmFullPath(user.getCompanyId().toString(), Jabav...
0
4ec019d761632b5cbec521eb1e7a4514
dcbf5bbed4e78931cf517e9789f85559
认球超时
class TeamFollow extends Model public function fail($endTime,$teamId) { if (time() > $endTime){ return Db::table('tp_team_found')->where('team_id',$teamId)->update(['status'=>3]); } }
1
8aab5911d935f20be8af527744aea465
b81c802e0710ae3a68fd53d8e9597e3d
first remove whitespaces
string removeLeadingSpaces(string line) { string new_line; int n = 0; while (isspace(line[n])) { bool space = true; if (isspace(line[n])) { space = true; } else { space = false; } n++; } for (int i = n; i < l...
0
6b83812e49de5f562009508aebe0adf9
0131a79066f1b79bb7a6f7c24647e0a2
Summary: 点击不保存按钮 Returns:
class BaseFilesBase(Base.Base): def click_save_btn(self): elements = self.get_elements_by_xpath("//span[text()='保存']") for element in elements: if self.is_displayed(element) and self.is_enabled(element): time.sleep(self.operation_wait) self.click_element(eleme...
0
9e4d4bc5cb19d2206c1c5a02cd91229a
6f3fd715eae14733cb082cec90a31ea4
Adding field 'FeatureLayer.enable_geometry_simplify'
class PostGISSchemaEditor(DatabaseSchemaEditor): def add_field(self, model, field): super(PostGISSchemaEditor, self).add_field(model, field) for sql in self.geometry_sql: self.execute(sql) self.geometry_sql = []
0
3d70356dfc609324e336c47441ca286c
183a0ee9033ce7e41c4c9e41b2ee4f02
Lädt alle IDs eines Objekt-Typen. Wird benutzt falls im Query keine Parameter gesetzt sind.
{ this.IdsQuery = new IdsQuery { Values = values, Type = types }; }
0
7d8c0f4bf7ef1614c2d09e07de28c368
d2e9e618cd63154dee3ff71e50896354
Método que notifica que el servicio (API) con el que se comunica no está disponible por cualquier razón.
class HttpService static public function return_service_unavailable(){ http_response_code(503); exit(); }
1
903df9a6f09d2e5201fe029ac80400b3
bcbe6b1245bdc2d335ff1f5b25793275
@brief Save group model after form submission
class CCAdminControlPanel extends CObject implements IController public function DoGroupSave($form) { $this->selectedGroup['name'] = $form['name']['value']; $ret = $this->SaveGroup(); $this->AddMessage($ret, 'Saved profile.', 'Failed saving profile.'); $this->RedirectToController('editgroup', $this->sel...
1
781b616d3d0442d3dac2d3b4cf5b5986
0763d741393f533eabcbbb5cd663739f
正则匹配,看页面是否有搜索结果数据
re_name = re.compile('>(.*)</a></h3>') re_url = re.compile('style="text-decoration:none;">(.*)</a><div') names = re.findall(re_name, response) urls = re.findall(re_url, response) for name, url in zip(names, urls): name = name.replace('</em>', '').replace('<em>', '...
1
197b133175b701a956e8ddedc005b3e5
2d783c0e6abc69c6ced0b04569f49be8
入力データのタグ化 タグフォームに入力されたデータのタグ化を行う
class TagAction(generics.GenericAPIView): def post(self, request, *args, **kwargs): form = TagInputForm(request.data, request.FILES) if not form.is_valid(): return Response({'Detail': form.errors}, status=status.HTTP_400_BAD_REQUEST) cld = form.cleaned_data is_valid, error_me...
1
08bc9f8cc9221d9f7d9a8457fc59a616
482f7224228db35373ae04ef1d50ce31
Recursively merges a map of options into a map of defaults
for key, value in real_values.items(): default_value = default_values.get(key) if (default_value and isinstance( value, dict) and isinstance(default_value, dict)): _deep_merge(value, default_value) for key, value in default_values.items(): ...
1
3795639c158a5d81acbcf45dfe87de3c
75c97f1aef7a3986c4ef68ea74d478ab
Returns the least key in the map.
Node min_key();
1
ad33e1453fe0d2fe66402c85c140f2d3
656cbf7844c33dc398d8f94760ed86a1
Test case for data_context_connectivity_context_connectivity_serviceuuid_delete
class TestTapiConnectivityController(BaseTestCase): def test_data_context_connectivity_context_connectivity_serviceuuid_end_pointlocal_id_capacity_total_size_delete(self): response = self.client.open( '/data/context/connectivity-context/connectivity-service={uuid}/end-point={local-id}/capacity/total...
0
a25a4828506a18b96f0d1c2f772ec964
ceb9733d8335bf87ea56278138b6e895
Return the pixels per second, modified by the zoom level
public class SmoothScrollTimer extends Timer public int getSpeed ( ) { int fps = 1000/this.getDelay(); return pixelsPerFrame * fps; }
0
17a3ece3f85d554d91f702e3131c328a
ec2dca09f2c2844e2e5795816af8210d
Returns the value of the '<em><b>Outgoing Links</b></em>' reference list. The list contents are of type {@link berk.BerkLink}. It is bidirectional and its opposite is '{@link berk.BerkLink#getSource <em>Source</em>}'. <!-- begin-user-doc --> <p> If the meaning of the '<em>Outgoing Links</em>' reference list isn't clear...
EList<SequenceFlow> getOutgoing();
0
e8119443add175a44a7fc76181da8edb
3bf390f697304a7dde72a1529e0c2f44
A * B^T
void ABT(gsl_matrix_complex *A,gsl_matrix_complex *B,gsl_matrix_complex *C){ gsl_complex alpha; gsl_complex beta; alpha=UNIT; beta=ZERO; gsl_blas_zgemm(CblasNoTrans,CblasTrans,alpha,A,B,beta,C); }
1
c7c82c2c39a5526bd9ab307246227c3b
46937947b36549656870490d50149ba1
Atualiza o preço de um produto aumentando 10%
public class Produto public void calcAumentoPreco() { precoFruta *= 1.1f; }
1
b580fa6e69cd7933518b5d436af06020
3cc4424d0721ca64acc187ea31c56083
Initializes a new instance of the form.
DisplaySetup displaySetup = null, ElementClassSet classes = null, string autoFillTokens = "", int minuteInterval = 15, SpecifiedValue<FormAction> action = null, FormAction valueChangedAction = null, PageModificationValue<LocalDate?> datePageModificationValue = null, PageModificationValue<string> timePageModificat...
1
f8c02051c370fde2da70fe0d20cfccf1
29d80251f1626a1c82090ec2e44c54c0
Calcula el rendimiento en kilómetros por litro (km/l)
def calcularRendimientoAutomóvilKmLt(kmRecorridos, litrosGasolina): kmLt = kmRecorridos/litrosGasolina return kmLt
1
803303c4496bca31d69de5ae0fa971df
435602faf26adb812d518d26b909e692
以表格形式打印数据库某张表
def mysql_table_select(db,table): try: conn = MySQLdb.connect(host=config.mysql_host,user=config.mysql_acount,passwd=config.mysql_pass,port=int(config.mysql_port),charset="utf8") cur = conn.cursor(cursorclass = MySQLdb.cursors.DictCursor) conn.select_db(db) cur.execute('select * from '+table) results = cur.f...
0
b719ee7952224d0737d545df5431665a
360426568cad443d00528b10b5ac4ddb
Given an array of bytes representing a BFast file, returns the array of data buffers.
public byte[][] getBuffers();
1
438cdea6bff91b42a2d4ae693527fcb9
3cba4635bfa653959c0c40890d116e49
功能:数据保存成excel
namespace BodDetect public class Tool public void DataToExcel2(DataGridView m_DataView) { SaveFileDialog kk = new SaveFileDialog(); kk.Title = "保存EXECL文件"; kk.Filter = "EXECL文件(*.xls) |*.xls |所有文件(*.*) |*.*"; kk.FilterIndex = 1; if (kk.ShowDialog()...
1
ad98352e4cda21b6dbfcdbefb3f8bd69
874089626ad4883cd48e40652aa00dcd
Metodo para validacoin del campo apellido Materno, solo debe aceptar letras
namespace Registro public partial class FrmAgregarAlumno : Form private void txtApellidos_KeyPress(object sender, KeyPressEventArgs e) { if (!char.IsControl(e.KeyChar) && !char.IsLetter(e.KeyChar) && !char.IsWhiteSpace(e.KeyChar)) { e.Handled = true; ...
1
3baa6ce5b2d3eb8d0b518bc7d4caf47f
8a4b5e5451ac6fd477f68a7e349f75bf
Возвращает предка для узла с номером num
public class carFrags extends Fragment public int getParent(Side[] parents, int node) { if (parents != null) { for (Side nd : parents) { if (nd.getNextNode() == node) { return nd.getPreNode(); } } } return -1; }
1
7f5360e3904d921bfa4c086efbdd16b2
f72a31c23a1d1c35f3dcea8e4a7a3065
See Sattolo's algorithm at https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle
def knuth_shuffle(x): for i in range(len(x) - 1, 0, -1): j = randrange(i + 1) x[i], x[j] = x[j], x[i]
0
90aab934d9cf4c548e6dc586109eb1b3
243479b2771a4df638090bf2af1ae6ab
Starts a process and optionally redirects its input/output/error streams to specified PHP streams.
class Process public function __construct(callable $function, bool $redirect_stdin_stdout = FALSE, int $pipe_type = 2, bool $enable_coroutine = FALSE) { }
1
c8249bd487f7ef573fec0d5a13d85a63
4af17c3309994480acb5bb8f3a12a2cf
Computes the maximum flow between <paramref name="src"/> and <paramref name="sink"/>.
public class MaximumFlowNetwork public int fordFulkerson(int[][] graph, int source, int sink) { int u, v; int maximumFlow = 0; for (u = 0; u < noOfNodes; u++) { for (v = 0; v < noOfNodes; v++) { residualGraph[u][v] = graph[u][v]; } } whil...
1
c0bee903f92e9f4e6e63b9c6f9112152
aa10e3bb4ddf7cccbef72b95b35d249b
Checks if a button is pressed for a specified Player.
def is_pressed(player, button: Button, refresh_input=False): return any_pressed(player, button, refresh_input=refresh_input)
1
aea44d1743fc5663eaee6c8c2235517c
cfbe0afafca216f3395e727d67e8d1aa
根据用户的行为数据分析并发送自动任务
if ( $daemon === true ) { $job_slug = "{$behavior_id}::{$env['session_id']}"; $job = new \Xpmse\Job(["name"=>"XpmsnsUserBehavior"]); if ( $job->isRunning($slug) ) { return ["code"=>503, "message"=>"任务正在运行", "extra"=>["slug"=>$slug, "data"=>$data, "env"=>$env]...
1
504074e27a5994bac6d473dd283ba4eb
f3e246e203871664ed14f5efefbd879d
Returns the field name for the client code.
public function getClientColumn() { return defined('static::CLIENT_COLUMN') ? static::CLIENT_COLUMN : 'client'; }
1
b33bbe578a0303fa46feb5864e5b4b7d
bb7dac3582a3fd856a30f720b2343103
Adds a new MultiValue to set the IReadOnlyCollection&lt;DateTime?&gt; specified by <paramref name="expression"/>. By default this MultiValue is not required. The elements will be converted to DateTime? and stored in a collection of type List.
{ var obj = new NamelessMultiArgConfig<TClass, string?, IReadOnlyList<string?>>(false, NoConversionNullable, List); config(obj); return AddMultiValueCore(expression, obj); }
0
6872305af503c3f5f1f61bebd515b382
432e93fcafcbb2cc4c9ec832910e23a9
Returns a string representation of this <code>IllegalTypeException</code>.
@SuppressWarnings("serial") @SuppressFBWarnings(value = "SE_BAD_FIELD", justification = "EqualsVerifier doesn't serialize.") public class RecursionException extends MessagingException @Override public String getMessage() { StringBuilder sb = new StringBuilder(); sb.append("Recursive datastructure.\n...
0
fc268dc00111d4a8580016e513754162
31ba4f6127f371050fc54f05c53594c8
Add random suffix to given project names
suffix = "_" + category_name.lower()[:3] project_path = os.path.dirname(os.path.abspath(__file__)) database_path = os.path.join(project_path, 'Database\SuffixDatabase.json') suffix_dict = None object_name = str(object_name) if not os.path.isfile(database_path) or not os.access(database_path, os....
0
c0d25c5c3556a7895a79730ec38f463e
cae8db95bac5590e16f0dac6528c930b
converts integer to base62
if (i < 0): raise ValueError('Value %r for i is negative' % (i,)) r = 63 e = 1 while (r < i): e += 1 r = 64**e - 1 rv = '' while (e > 0): e -= 1 d = math.floor(i / 64**e) rv += cls.base64_map[d] i = i % (64**e) retu...
0
b60de6b5a12d4a862841b0d5a48b24b6
96543c14bfa5e37e311e7fbac09252ad
Test that a user can't log in if they haven't registered
response = self.register('Philip', 'Sterne',3, 'nikesh@email.com','FlaskIsAwesome', 'FlaskIsAwesome') self.assertEqual(response.status_code, 200) self.assertIn(b'Please use a different email.', response.data)
0
89a87b8c5c985794e87d648c2e1571b4
39b732031cfe1e6e37ddb3928523cbed
Broadcoasts the custom data update of a floor item to all room users.
{ if (!CanUpdateData(obj)) { return false; } if (obj.GetComponent<SharedObject>() != null) { string objData = obj.GetComponent<SharedObject>().GetConfig(); List<int> ids = AllUsers(); int ...
1
86d8d6430303365eb21ff3c293b41226
1d33c16dfa972a349c5b02e4b89bb1a1
Throws n dices and sums all the values. Can be configured for many kinds of dices. Defaults to 6 sided Dice
private fun throwDicesAndSumValues( numberOfThrows: Int, generator: Random, diceFirstValue: Int = DICE6_FIRST_VALUE, diceNumberOfSides: Int = DICE6_NUMBER_OF_SIDES ) = List(numberOfThrows) { generator.nextInt(diceFirstValue, diceNumberOfSides + 1) } .sum()
1
92090f1e5c81127a6eaf4abaf53f4d4f
c95a652e98508ccefcc06b11328bb642
Initialize the ATL module
void InitMFC() { InitModule(_hdllInstance, DLL_PROCESS_ATTACH, NULL); AfxOleInit(); }
0
573541ee07e5e0ef8b6d68a394a9bdac
387ab01917d7472fc1f8894b6cef5e27
指定した型のオブジェクトを全部取得
public static class ExtendTools public static T[] FinSceneObjectsOfTypeAll<T>(this GameObject obj) where T : UnityEngine.Object { return Resources.FindObjectsOfTypeAll<T>(); }
1
2d5d9d7130cbd06e07b4296b6896e9c1
1d426dad13d4a1009320ea19e82571e3
获取当前Id-Token, 如果不存在,则立即创建并返回
String idToken = getTokenNh(); if(StrUtil.isNotBlank(idToken)) { savePastToken(idToken, getTokenTimeout()); } String newIdToken = createToken(); saveToken(newIdToken); return newIdToken; }
1
55d5199363fc096db40708c177e86194
7ef090ac0646863a1d9a95fd035050ba
Helper function that converts 3 digit number to list of digits
def split_digit(num): num.split() return [int(num[0]), int(num[1]), int(num[2]), int(num[3])]
0
fd573f370c9f09578acbd01877a35b4c
6dd7fe03a1ad41a7a786b20b91533ef3
显示完成样式
public class SlidDemoFragment extends SampleSlidFragment implements OnSlidListener @Override public void completeVisible(SlideDirection direction) { textView.setBackgroundResource(R.color.color_14c7de); textView.setText(mTitle); LogUtils.e(":"+mTitle); }
1
0463eeb10bfbdcc0a8387db017520025
5aacc21859e3f8269aaba6172c049e78
Entry point for booting BlueJ
{ File blueJLibDir = Config.getBlueJLibDir(); File startupProject = new File(blueJLibDir, STARTUP_PROJECT); extension.maybeOpenProject(startupProject); }
1
500d52c06a8c354c66b3f16c9aca67f0
e384b51e349be18f62accee4b58bf7ae
removes hours, minutes, etc.
@AllArgsConstructor public class DateOps public DateOps trimHmsMsPart() { zonedDateTime = zonedDateTime.truncatedTo(ChronoUnit.DAYS); return this; }
1
3c189e2673ab7da88d4feb34fe4d9419
1c65056593022f52762e05315f2b3693
Return the gate sequence for the given circuit. Compound gates/instructions will be decomposed to either standard gates or customized unitary gates.
if isinstance(box, (Bra, Ket)): dom, cod = (1, 0) if isinstance(box, Bra) else (0, 1) spiders = [X(dom, cod, phase=.5 * bit) for bit in box.bitstring] return Id().tensor(*spiders) @ scalar(pow(2, -len(box.bitstring) / 2)) if isinstance(box, (Rz, Rx)): return (Z if isinstance(box,...
1
bb2269a92b67dadf07b8c7afb03f2ea0
e4cadf6a64d5e2541f6bb7ea6a25f1bf
Güvenlik Anahtarı verir
class Hayvan(object): # Class Oluşturduk def yasVer(self): return self.yas
0
0ea5a48fddbf87f0797bdb16e39dccb1
7fc9af68909b719f8415c200b8bb3691
"+++ <name>" with optional trailing whitespace
def long_syntax(name: str) -> str: return '--' + name
0
27fc70061ed7ff64766c29eca9547d17
bbec56044aaf92c47bb7876c5e5a4c68
Получает значение уравнения плоскости в указанной точке.
namespace Geometry public class Line : Geom public double GetValueOfLineEquation(Point point) => a*point.x + b*point.y + c;
0
e931adb89e4af302437d0cec1129467d
ba6bf316e581199946d8c6d62594fdd1
Total height of the Cardholder's screen in pixels
class App get renderHeight(): number { return this.standardLength * 12; }
0
21ef141f9fd8ee2a3d41a0e75ec30e41
fc3735bc637078409838a3658718bf5e
Returns the formal neighbour count of this atom.
actualNum = atomNum - 1 actualOther = atomOther - 1 return self.bondedToActual(actualNum, atomOther)
0
0a61c337f577550c4ffa2b2b618326b9
4d98e7562bdafe44ff1ef9dd19d25806
@brief Player deploy any weapon.
function SWEP:Deploy() self:SendWeaponAnim(ACT_VM_DRAW); end
1
5ed6b40aea1301d70456776adf30f165
2dda5e37afaf8c931dc12e16911f778e
Сравниваем точки по углу и расстоянию
{ if (a.dist == b.dist) return b.pay < a.pay; else return b.dist < a.dist; }
0
acf3ac2872c08de7edf6a287cfd38c00
82d68abd09c30d19ef6d88cfb707f0f2
Get the disturbances applicable to the specified traveling path
def path_constraints(self, states, controls, f_par): paths = np.ndarray((self.prm['n_path_con'], self.prm['n_nodes']), dtype=cppad_py.a_double) return paths
0
e2af902460ff74064f2a60b4c960bba2
6b236073511fb88f58a6fa0940643268
Pauses graph when activity is paused.
def pauseGraph(): global pause pause = True
1
1ff895acf1d664f41b8f3e1a6b5734e3
bf0407a84d78faf6d678f29eeb109ff1
現在DBに書き込まれている詳細情報をIDをキーにしてjson形式で取得する。 編集確認から戻ってきた場合sessionに退避した入力値から復元する。
$raw_query = Conn::queryArray(" SELECT id, jsonSessionData FROM ".SESSIONTABLE." WHERE id = ".goodInt($id)." "); if (isset($raw_query)) { return json_decode($raw_query['jsonSessionData'], true); } else { return NULL; } }
1
31525dd630f832e4f7f8dc530b4c685f
c1b009244ce24552fec7b90e80c3cae5
will enable or disable OK button based on the length of username.
@Route(path = ConstantActivityPath.BINDING_USER) public class BindingUserAcitivty extends TgBaseActivity @Override public void afterTextChanged(final Editable editable) { if (editable.toString().trim().length() != 0 && editable.toString().trim().length() < MAX_STRING_LEN) { isUserna...
1
0c667eb7cf98c4643f8540a04593097d
f99342ead6315bcde09540c065c61cb2
根据单个职称id查询关联员工数量
@Service public class HjWorkersInformationServiceImpl implements IHjWorkersInformationService public Integer selectzhiliaoqiquan(Integer projectId){ return hjWorkersInformationMapper.selectzhiliaoqiquan(projectId); }
0
45c08f0cb3862abfb42c5931c7166392
cc31958c684ac046da84ede00286cfb7
This changes all the labels and buttons to french
public class OfferController implements Initializable{ public void changeLanguage() { fromLabel.setText(MainController.prop.getProperty("fromLabel")); untilLabel.setText(MainController.prop.getProperty("untilLabel")); nameLabel.setText(MainController.prop.getProperty("nameLabel")); infoLabel.setText(MainCon...
1
6083be357eb30880daf59be8299b97ea
aac31047e8f63a1495fb57bc576b2842
Allows/Disallows human controlled shooting based on Argument.
public class EnemySpawner : NetworkBehaviour public void ToggleShootBack() { doShoot = !doShoot; }
0
8a13725e75087cd54a97247ce64932ad
0ad254e52037b283d8fe605623efd10f
运费查询
var goodsWeight = $("#goodsWeight").val(); var insuranceMoney = $("#insuranceMoney").val(); var sendCityCode = getAreaCode("sendArea", "city"); var sendRegionCode = getAreaCode("sendArea", "district"); var receiveCityCode = getAreaCode("receiveArea", "city"); var receiveRegionCode = getAreaC...
1
68a77ba18db227fb3527573d3dee4853
0b021a415f1551f369775021b94e898a
跳转到个人信息页面
@Controller public class UserController @RequestMapping("/toInfo") public String toInfo(){ return "info"; }
1
454f93eb62a7641d5cb17de97ebb41de
444b12eb1b620fc0fa9c1dfc0b241380
Очистка таблицы базы данных со словарём частых слов
namespace TelegramBot public class UserDictionary public void ClearUserDictionary() { words.Clear(); }
0
7115047bb0ce7fe240d7734d5bfc1a9c
a2a25066df4eb2d87336a4c1f12f2d53
remove leading 0s so can compare
while a[0] == '0' and len(a) > 1: a = a[1:] return a
1
0e43b9a6a2191c6d9e5e903fb54802a7
29fb45932942c0e4e94fbe78adf15033
Xét vị trí tương đối điểm với đường tròn: nếu nằm trong - trả về -1; nếu nằm ngoài - trả về 1; nếu nằm trên - trả về 0
double dx = p.x - c.x, dy = p.y - c.y; double Euc = dx * dx + dy * dy, rSq = r * r; return Euc < rSq ? 2 : Euc == rSq ? 1 : 0; }
0
b701e185078606f7230231f165b3b39e
23f17ee94f9dc32ce9c84cb312f2feb4
客户端发送取消准备消息
function mt:req_cancel_prepare(playerid,cb) global.player:call("CS_OP_ROOM",{gameid=gameid,op=14,param1=playerid},function(resp) local ec = resp.errcode if ec == 0 then if cb then cb() end else global._view:getViewBase("Tip").setTip(errc...
1
20b1db661f739dd35085504d18668ec3
d1210bddd636e61e0959dd71e982597d
Get a list of Neighbourhoods in a give Force
namespace Police public class Neighbourhood public static IList<Neighbourhood> GetNeighbourhoods(Force f) { return GetNeighbourhoods(f.ID); }
1
8739b1d90252688a73eec0daa5e86270
f05a30896469418ec636ed8bcb44e4cb
Given the string representing the user's personality type and the result set from getting the user's basic matches (getBasicMatches), return an array containing only those matches that have at least one personality type letter in common with $usertype The $matches should be multi-dimensional associative array when pass...
class Pokemon extends BaseModel public function findByUserTypeAndName($name, $types) { $allpokemon = self::findByUser(); $almostwantedpokemon = array(); foreach ($allpokemon as $pokemon) { if (strpos(strtoupper($pokemon->nickname), strtoupper($name)) !== false) { $alm...
0
f602def9a5f1a7c601f7cb6852da643d
36359dc8fa08bf362812b26375e4fe00
图像平滑操作1,邻域平均法,直接采取该点周围的8个点的平均值作为结果
{ Mat dst(srcImage.size(),CV_8UC3); for (int y=2; y<srcImage.rows-2; y++) { uchar* srcR = srcImage.ptr<uchar>(y); uchar* dstR = dst.ptr<uchar>(y); int br,bg,bb; for (int x=2; x<srcImage.cols-2; x++) { br=0; bg=0; bb=0; ...
0