query_id
string
corpus_id
string
query
string
code
string
label
int64
2a26c3202aa34b426f40301ba3bf9dd6
c0cf1a1c773c068d0e1c788b865f2591
调整检索条件的开始索引,以避免请求的开始索引大于总件数。 同时通过返回值来判断后续检索是否应该继续。 总件数 分页响应
if (count == -1) { isQuery = false; count = 0; return true; } else if (count > 0) { start = end; isQuery = end < count; end = count - end > batchNum ? batchNum + end : count; } return isQuery; }
1
4ba1bbc6ac96c456d85ebf9daa838af9
f20e14a9b286bdbe964dcb5eb6ad7f33
перебор элементов списка с конца
public class DoubleLinkedList public void reverseIteratorAll(){ Node tmp=null; for(tmp=tail;tmp!=null;){ System.out.print(tmp.val+" "); tmp=tmp.prev; } }
1
73e66938472bf48bfecfa0c0645f9433
0dd449e3ec3fdb009dfedc86d2f30564
uses a polynomial function to further normalize the pearsons correlation matrix
eVal_L = eVal[:nFacts, :nFacts] eVec_L = eVec[:, :nFacts] eVal_R = eVal[nFacts:, nFacts:] eVec_R = eVec[:, nFacts:] corr0 = np.dot(eVec_L, eVal_L).dot(eVec_L.T) corr1 = np.dot(eVec_R, eVal_R).dot(eVec_R.T) corr2 = corr0 + alpha * corr1 + (1 - alpha) * np.diag(np.diag(corr1)) return corr2
0
a3090bba872c65dcb69568e7fee3d586
76f0dbd2aae58ec324ddcc3c667c852e
Get :math:`h(x)`, the hidden network for :math:`q(z|h(x))`. Returns: Module: The hidden network.
return (n_hidden(module, init_module) ** (1 - 1 / q)) * dist( module, init_module, p=p, q=q )
0
3315301394353725a8b69307d9871e70
5a490ebc5e0c4899b42faa556ccf6f5d
Get trace id from span context.
md, ok := metadata.FromIncomingContext(ctx) if !ok { return "" } values := md.Get(metadataKeyTraceID) if len(values) < 1 { return "" } return values[0] }
1
2dde8cdd5d2a509c4a469cb877f93794
cc04641674b3a556fd7e2a82d9830363
list of faces after changing ace to low
for(var i=0; i<cardase.length; i++) { if(cardase[i]==poker.Club_Ace || cardase[i]==poker.Diamond_Ace || cardase[i]==poker.Heart_Ace || cardase[i]==poker.Spade_Ace) cardase[i] -= poker.Ace_Become_One; } return cardase; }
1
f771d4abaa3c13de56b50d4a9c5fae04
4fec8d059f4fd8282450fca543ade50f
Updates a list of key value pairs. key value pairs; pair with null value, will be deleted
{ $mutexKey = $this->getArrayMutexKey($keyValuePairs); $this->acquire($mutexKey); $result = $this->storage->replaceItems($keyValuePairs); $this->release($mutexKey); return $result; }
1
f7c36bad1f4872930fbbdff319c34934
d3d838a0374551c338022796166918c1
Returns a list of states (represented as a string of possible tic-tac-toe moves) that immediately follow from the parent sequence.
def successor_fn(state): possible_states = STATE_SPACE[state] return possible_states
1
e9899816a86305a4e41cbc73ca09dc85
707ebb1a68fc929a8d6702e18ecce41c
Returns a list of Thread objects for the relationship.
class RelationshipResource(CRITsAPIResource): def get_object_list(self, request): return super(RelationshipResource, self).get_object_list(request, RelationshipType, False)
0
33f7fbe18261a0ccfbe3ade04ac34b19
cdbd4cb11e7e70a93a8ad24c80688226
Increment the number of rows read.
{ if (_readCount == 0x7fffffff) _readCount = 0; _readCount++; }
1
a8b0b0015962d27fd79dc7659d3df5ce
fe697c277141cd1387d0396ff51c2006
日付単位でログファイルを作成する。
{ CurCreateDate = DateTime.Now; string filename = FilePrefix + "-" + CurCreateDate.Year + "-" + CurCreateDate.Month.ToString("00") + "-" + CurCreateDate.Day.ToString("00"); if (File.Exists(filename + ".log")) { int i = 1; while (Fil...
1
7ff1a52057b382543dc19c47e76096df
699dda47b592d7a7fe7461ddfbb161da
获得指定TopicId对应的seedid
namespace Discuz.Data DataTable GetTopSeedIdListNew(int seedtype);
0
f71508277ee1cbfcacd358ed40bbfe85
2f1b1dfb5702f124bd376fd6f1fb996e
Transforms a local date into timestamp in secs.
{ $dateTime = new \DateTime($localDate, new \DateTimeZone($timezoneName)); return $dateTime->getTimestamp(); }
1
7ee412a76aba8f2c849143e55490af03
e5e1e7308278a72b97b6da4255bf1b01
Contact a client.
class ClientContactController extends Controller public function show(ClientContact $contact) { return response()->json($contact); }
0
e13c8e26dd13a501ef08b8afb16c623e
cd7d6b583775d4a333ab86b8ff8daeaf
员工互评_资产新增页面跳转
public ModelAndView page(HttpSession session) throws Exception { return new ModelAndView("asset/assetRepairManage"); }
0
b614096bf383db1d78e74d9c5746135c
b4ae91f86b8a061d976e40dfaf6b2584
数据读取完毕后,返回给客户端回复一个消息
public void channelReadComplete(ChannelHandlerContext ctx) throws Exception { ctx.writeAndFlush(Unpooled.copiedBuffer("hello 客户端",CharsetUtil.UTF_8)); }
1
2a2a66111daec81dfa1bd65f49119146
1f8a570db96d0f87e5b07bae444d3471
Moves an existing powerup to a new spot on the map and updates its power
{ if (powerup == PowerUp.Empty) return; isPoweredUp = true; var sound = new MediaPlayer(); sound.Open(new Uri(System.Environment.CurrentDirectory + "/Resources/PowerUp.wav", UriKind.Absolute)); Application.Current.Dispatcher.BeginInvoke...
0
b663390f4a2747d8a7ce2c3063bb6a7a
bb0ea2dd2c718a5dd65433e90e5f5032
Updates destination image to extract edges via Canny edge detection.
{ Mat src, src_gray; Mat dst, detected_edges; int edgeThresh = 1; int lowThreshold = 100; int const max_lowThreshold = 100; int ratio2 = 3; int kernel_size = 3; src = img; dst.create( src.size(), src.type() ); cvtColor( src, src_gray, CV_BGR2GRAY ); blur( src_gray, detected_edges, Size(3,3) ); C...
1
67daf9394cbfd75415c855d206ed9be6
6cd568ec8da5407d440da8ec57ef4807
Gets the arguments for starting a business service with environment information
@ToString @EqualsAndHashCode(callSuper = false) public class ServiceEnvironmentType extends JsonDocPropertyHolder implements Nameable, Cloneable public @NonNull Collection<String> defaultProcessArguments() { return this.defaultProcessArguments; }
1
88d28b040efbd6901f41ce0515769053
928136e14a1ac5dff979add62d929a41
Check whether the analysis or all analyses on modules have been preserved.
function checkanalyses() { if (aResultIsEmpty()) { return false; } return true; }
0
a8a1c80c74b53a87705a5799bd927800
7b969f9ebce8199f46ec923c0c63c8f5
利用可能なメッセージダイジェストアルゴリズムを調べる
function testAlgos() { $data = "hello"; $file = "demo.php"; foreach (hash_algos() as $v) { $r = hash($v, $data, false); $r1 = @hash_file($v, $file, false); $r2 = @hash_hmac($v, $data, 'key', false); $r3 = @hash_hmac_file($v, $file, 'key', false); printf("%-12s %3d %s<br/>", $v, strlen($r), $r3...
1
9332ac8aa23967e2f093fe09c62167a3
06796228b20896056e39a257467a73b9
Get the abbreviation for this artifact.
public String getAbbreviation();
1
1fb96a6880001734bb53d79bf99ccb67
7fa58f8c98528a49011792863ac991fc
check wheather the parsing is in process
class modParser public function isProcessingElement() { return (boolean) $this->_processingElement; }
1
385dcca805e16501ced671e59bde7d54
bdb64ed2d186c6e5f50ce320199a3a78
Вывод хеша
void Hash_print(HashTable H) { printf("H->TableSize: %d \n", H->TableSize); for(int i = 0; i < H->TableSize; i++) { if(H->TheCells[i].Info == Legitimate) printf("H->TheCells[%d]: %d \n", i, H->TheCells[i].Element); else printf("H->TheCells[%d]:\n",i); } printf...
1
a4ebebd367a7b3398bf13dadace00031
0d962e5386c0c0358b1123cf8fd8447e
Returns BuildPipelineForm containing the build pipeline to display.
$this->imageAPIOptimizePipeline = $imageapi_optimize_pipeline; $this->imageAPIOptimizeProcessor = $this->imageAPIOptimizePipeline->getProcessor($imageapi_optimize_processor); return parent::buildForm($form, $form_state); }
0
e317a5d156d27048f4acf0b6bd1df6ad
fd21d057e3bf50a2ec0985a1f0283afe
Creates the EZKO forms folder (if doesn't exist) and returns path to that folder
public class WebBonitaConstantsUtils public File getFormsWorkFolder() { return getFolder(webBonitaConstants.getFormsTempFolderPath()); }
0
4fdb95c52e5edb18b6fd9597578c8703
e676e6059cd894d4a1948a518462bf64
Fill dest with neighbor nodes from the grid
{ vector<int> boid_grid_coord = boid.GetGridCoord(); int i = 0; for (int x = -1; x < 2; x++) { for (int y = -1; y < 2; y++) { for (int z = -1; z < 2; z++) { int row_x = boid_grid_coord[0] + x; int row_y = boid_grid_coord[1] + y; int row_z = boid_grid_coord[2] + z; row_x = row_x < cell_num...
1
de97e3654a97c058a3c18494f3ab02c2
d7c4e399cf48547bc9068ccb311301ba
This method was generated by MyBatis Generator. This method returns the value of the database column t_transfer_order.BANK_CODE_VALUE
public class TTransferOrder public String getBankCodeValue() { return bankCodeValue; }
1
e974b6739ba763d6bc7dae114a02f8ef
46dc251ac412189c825e2c3544f02f1b
点击窗口的时候,发送closeApp信号,程序终止。
class Example_EmitSignal(QMainWindow): def mousePressEvent(self, event): self.c.closeApp.emit()
1
0f0db94242180d73f677b3df0a4b8078
f6e541529286e19d7816b390a16f3b36
Возвращает длину списка ходов.
class Calculation(QObject): def count(self, result: list) -> int: return len(result)
1
61a502473e9b3d9cb52c8bb7cfc6b292
67f83f423c2e6a6f3e5d96c863e8763d
whether the current topic is kafka compact topic or not.
class TopicArgs: def compact_topic(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "compact_topic")
1
a8d305ca85161b13c0e84309b7009826
326119749fd00d57e38e98b713530469
Cause a Breakpoint exception.
fn test_breakpoint_exception() { x86_64::instructions::interrupts::int3(); }
1
163a6a9a4374aeb12b9378ae832dbfc2
6360abf4b43af4808a827c19389f6938
Задает метки с датой на графике
export class LineGraphComponent implements OnInit setPlotLines(data) { for (let intervention of data.line.interventions) { if(intervention.timestamp && intervention.labels){ this.chart.xAxis[0].addPlotLine({ value : intervention.timestamp, color : "#E51C30", width : 3 ...
1
9363f0340d43af4d442359d4fa199fe0
aedcbd56a0484b62d1206fab3b60c7ba
Fungsi untuk cetak informasi gadget
writeString("G:"); writeData(gear+48); if (dead) { writeData('D'); } else { writeData('N'); } writeData(cBtn + 48); if (star){ writeData('*'); } moveCursor(0b10010000); writeString("INFO: "); writeString(cString); moveCursor(0b10100000); writeS...
1
f94ccd1200d655ab24489200c2fa0283
94ac3e5a24cb89f4b08c4674bb7b6d09
Free an allocated bvarith64_buffer
{ if (buffer->data != NULL) visual_mem_free (buffer->data); buffer->data = NULL; }
0
3011d59ceddb087cc5fe95292c78c7a9
10d01803bba6c9f0305d619ddb1dcaf0
Save the NextSegmentRule.
public void saveNextSegmentRule() throws Exception { Calendar tomorrow = Calendar.getInstance(); tomorrow.add(Calendar.DAY_OF_MONTH, 1); nextSegmentRule = dao.getNextSegmentRule(NEXT_SEGMENT_RULE_ID); nextSegmentRule.setActivationDate(tomorrow.getTime()); nextSegmentRule.setCommand(AbstractWorkflowRule.COMMA...
1
b7b4b5d84df0c8690772688da7cb9c5b
74e1e67bf7ed8550b8ea9f43bfe908a6
Register and enqueue admin specific styles and scripts
if ( ! is_admin () ) { $asset_path = get_stylesheet_directory_uri() . '/built/%2$s/%1$s.%2$s'; wp_register_style( 'galliano-webfont-fjalla', 'http://fonts.googleapis.com/css?family=Fjalla+One', null, null ); wp_register_style( 'galliano-fontawesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/cs...
0
152f3b38393b920cafac9e53d2cc1811
78547a4861832c5bd5b1603de3d868fc
@brief Dialog procedure of Transfer Status pane.
{ event = event; QString txcnts; QString rxcnts; QString errcnts; QString timecnts; if(comm->transstatus == true) comm->transtime+=10; txcnts.sprintf("%d", comm->txcnts); rxcnts.sprintf("%d", comm->rxcnts); errcnts.sprintf("%d", comm->errcnts); timecnts.sprintf("%dms",comm->transtime); ui->ui_txcnts->setText...
1
3e0496224344f21aefdb20cd431e3845
f75846817722d73b98a0105358503f41
calculate the age of the user by asking for their birthdate
class ViewProfile extends CI_Controller protected function getAge($birthDate){ $birthDate = explode("-", $birthDate); $tdate = time(); $age = (date("md", date("U", mktime(0, 0, 0, $birthDate[2], $birthDate[1], $birthDate[0]))) > date("md") ? ((date("Y") - $birthDate[0]) - 1) : (date("Y") - $birthDat...
1
d5fbb8c7408713548512454f8a2b8372
9113736f267aa4e904594b890e3a8fad
获取操作系统,浏览器及浏览器版本信�?
Map<String,String> map = Maps.newHashMap(); String browserDetails = request.getHeader("User-Agent"); String userAgent = browserDetails; String user = userAgent.toLowerCase(); String os = ""; String browser = ""; if (userAgent.toLowerCase().contains("windows")) { os = "Windo...
1
ad9194cf1feb88c6f3c8ad5cdc73d986
2a98caa3795c1ff24c74468855c20de5
Cancel a batch of scheduled events on the transport.
public function cancelBatch();
1
8a21428172207bb268f0cdedd31acd5b
698d819b49ada79318db4056e551102f
Retrieve the horizontal radius.
class Ellipse implements IGraphicsObject public final float getRadiusX() { return radiusX; }
1
6f5b7cc6e1b8a23f1d880b080f5157ad
93dec58d4ab8ade911633ce8ad5c11b2
Get inputted group names and corresponding label
class MainWindow(Gtk.Window): def _get_entered_groups_names(self): names_list = [] names_boxes = self.group_names_input.get_child().get_child() for box in names_boxes: names_list.append( (box.get_children()[0].get_text(), box.get_children()[1].get_text())) ret...
1
745e713741e68eab2a33a5920afc3f59
a0bfb820ea5308b4fbe525104c20db9a
go through the list in reverse so it check at the first place the objects that the user see in foreground. foreground objects are at the end of the list //// il parcourt la liste à l'envers pour que ce soit dans le même ordre que le dessin. c'est à dire que les object en avant plan sont à la fin de la liste
class Object: #this is a generic object: the player, a monster, an item, the stairs... #it's always represented by a character on screen. def send_to_back(self): global objects objects.remove(self) objects.insert(0,self)
0
b977043a8883aafbf69519e5702a8ec0
aaa98473b346fdb253464f1d7ec2aa9c
Implementation of randomblob(N). Return a random blob that is N bytes long.
{ size_t i, n = nbytes; int fd = random_get_fd(); int lose_counter = 0; unsigned char *cp = (unsigned char *) buf; if (fd >= 0) { while (n > 0) { ssize_t x = read(fd, cp, n); if (x <= 0) { if (lose_counter++ > 16) break; ...
0
201ed52ff670abf34a3b578aaf12d5ce
2f19e8ed33dd142edb0bdaabe6d17950
#根据基础概率 获得所有的条件概率
def compute_condProbs(countDict, N): model = {} for k,v in countDict.items(): if len(k) ==N: pregram = generate_preGram(k,N-1,"") pregram=pregram[::-1] sum = 0 i=0 for key,value in countDict.items(): if key[:-1] == pregr...
1
4469aa2bb40ad5e40217929bab54d619
cbebd863f8bf4a8c69272c86628162b2
Individual api calls to perform cross layer equalization one step at a time. Pairs to fold and scale are found automatically. 1. Replace Relu6 with Relu 2. Fold batch norms 3. Perform cross layer scaling 4. Perform high bias fold
class Model_Simple(PyTorchTaskRunner): def forward(self, x): if (torch.isnan(torch.std(x)).cpu().item() != True) and (torch.std(x).cpu().item() != 0.0): x = (x - torch.mean(x)) / torch.std(x) else: self.logger.debug("Skipping input normalization due to std val of: {}.".format(tor...
0
e8a321d77d342582c3a59f16521c4ac9
df2eca204017aae7b388869fc66948d5
Получает текущую мощность двигателя
public class Engine public double getPower() { return power; }
1
58588c59bd5046f102983e26eb600dfc
415c273fc744d9b5574f9bf8e9f1c537
配资配置
{ $A = $request->input('caution_money'); $B = $request->input('multiple', 1); $Y = $request->input('duration', 0); $data = $this->fundingConfig($A, $B, $Y); return PublicController::apiJson($data); }
1
e598f97f4485b719cb0360e52c230a45
83f2a8728f08fa0eae609571e42fb314
metodo para agregar un colaborador a la lista de los YA seleccionados
public class HistoryPersonsSearchUI : MonoBehaviour public void AddSelectPersonnelItem(Personnel personnelT) { currentSelectPersonnels.Add(personnelT); AddSelectItem(personnelT); }
1
29ddf98455a766ef7cb28a87694737d5
00e564aac9ec4208b2560c996c462d97
Gets the photon reduction ratio. This is a number between 0 and 1 that specifies the percentage of global photon hits to throw away. This is used only when both {@link #computeGI()} and {@link #computeCaustics()} are true.
public float getGamma();
0
d6f9771f10bc8a97555568e04f78221a
55d311ca89f2db79d8464b9b14b2c0ec
Get the value of labelFont
public class LegendLabel implements Serializable public String getFontStyle() { return fontStyle; }
0
4828e4ed9a5e0357b283e981ab5dda1b
aeaf12f47e0ee586ff28fd2ad0680953
Helper function to convert from nanoseconds to hardware ticks. This uses fixed-point arithmetic to retain precision. Note that only 32-bit frequency values are supported.
func nanosecondsToTicks(ns int64) timeUnit { return timeUnit(ns * 64 / 1953125) }
1
41ed82d73472b6fc9e7b6425385dc29d
01dc824f2cec8afbfa8edcbc3a1d6ca0
Returns a JSON-serializable object for compatibility with django.core.serializers.python.Serializer. Obviously this is not strictly a string, but it's closer than the collection of attrs instances returned by the default implementation.
class Collection(object): def __repr__(self): return self.to_str()
0
51f8b99f39570d6854d75d0abe938b95
65c6e8b7157ccd289c9427199d009542
Makes user member of group
throwIfNotDefined(groupId, 'groupId'); throwIfNotDefined(userId, 'userId'); let postBody = null; let pathParams = { 'groupId': groupId, 'userId': userId }; let queryParams = { }; let headerParams = { }; let formParams = { ...
1
0283f694420a6f60cd7818a340513386
5b12760e4a72c8b4e6c135511d9c35ee
@targets: the list of strings representing the names of the target columns @table: the string representing the name of the table from which target is to be selected @conditions: the dictionary for which every column indicated by key should be equal to its corresponding value
int Frontend::select_from_table_where(char relname_source[ATTR_SIZE], char relname_target[ATTR_SIZE], char attribute[ATTR_SIZE], int op, char value[ATTR_SIZE]) { return SUCCESS; }
0
3021528665ac182f5aa6b66518ba82ac
15728f39ad9f3963d7a9653584ca4079
如果缓存里有了,则直接请求验证它的正确性
async checkResponseCache (ctx, next) { const cachedResponse = await redis.get(ctx.path) if (cachedResponse) { ctx.body = JSON.parse(cachedResponse) } else { await next() } }
0
471187cc81402caad67cdbe8ccb9a3ea
8b7ce98592aa2bf8bb7a5367d41d9b73
Fonction qui enlève toutes les balises html dans du texte
class GameControler(threading.Thread): def remove_html_tags(self, text): import re clean = re.compile('<.*?>') return re.sub(clean, '', text)
1
447c94a3849cf8e36aea53ece92cb159
38aa5b7182f387069f4d0d225ba749e9
Ignore trailing zeroes
def _filter_trailing_zeros(seq): return seq[:next((len(seq) - i for i, n in enumerate(reversed(seq)) if n != 0), 0)]
1
21d4f94630fd4a87de47bb4012d0c2f3
ccfb4c4dc6e816abeccfccf19441fd5b
如果是云信的demo password会进行md5编码,如果是开发者自己的应用可以引入其它方式 甚至可以转到开发者自己的应用服务器,拿到真正的accid 与password,可以异步操作,但此时 user相关数据(user目录、image目录以及日志等)并未创建
public class AppDelegate extends Application{ @Override public void onCreate() { super.onCreate(); final AccountManager am = AccountManager.get(this); if (sAccount == null){ sAccount = new Account(getString(R.string.docflow), ACCOUNT_TYPE); } if (am.addAccountExpl...
0
1f527c99016411c38f40ecdec6d416b7
be0c189e34541e302adeab9004275967
Get dateNaissEleve.
class Eleve extends \projetBundle\Entity\Eleve implements \Doctrine\ORM\Proxy\Proxy public function getDateNaissanceEleve() { $this->__initializer__ && $this->__initializer__->__invoke($this, 'getDateNaissanceEleve', array()); return parent::getDateNaissanceEleve(); }
1
bdb1043211331394ba86dc4ef85f61b0
9394e4b432310dbb2568ed30e8cc745b
Custom close method. Shows save dialog first
void DialogAddDiagnosticCategory::saveClose() { }
0
bd7f26b49bfee0aab1dfc13b177c3ce5
644d499696be7d15e0d46ccadc589660
Returns a list of addresses of memory cells that constitute the public memory. segment_offsets should be the dictionary returned by relocate_segments().
def addresses(base): yield [base] for disp in [0, 0x1, 0x100, 0x10000]: yield [disp] for disp in [0, 0x1, 0x100, 0x10000]: if disp > (2**base.bits)-1: continue yield [base + disp] yield [base*2 + disp] for offset in regs[base.bits]: if offset n...
0
968e5d6162f8d04a749fcc92db6e31a8
abe3d6653651835a4f5d85dfc24da159
Test creating new ssl cluster but not providing a keystore will fail validation.
class RedisStorageAdapterTests(object): def test_sentinel_ssl_fails(self): with pytest.raises(redis.SentinelConfigurationException) as exc: redis.build({ 'redisSentinels': ['a', 'b'], 'redisSsl': True, })
0
a8a83112269fbb7fc16bbcb36d184a9e
63e9179eb57d9fc5d5fafbbe949ffa4b
This function is used to Click on Place of Issuance DropDown Field and to select Element from the Drop Down
public class AdministeredObjectsPage private void selectInDropDownField(String itemInList) { WebDriverCommands.click(By.xpath(OVERLAY_WINDOWS_DROPDOWN_BUTTON), ConstantsClass.TIMEOUT_3_SECONDS); Utilities.waitTime(ConstantsClass.TIMEOUT_1_SECONDS); WebDriverCommands.click(By.xpath(String.format(...
1
8d03443712111621c600e211e74fc3a5
6b948c8ef2334121526eb696ed1ff72a
Setter of the component responsible of the keyphrase selection.
class EvaluatorC(BenchmarkComponent): def set_reference_keyphrases(self, reference_keyphrases): self._reference_keyphrases = reference_keyphrases
1
ba9908d7773ce2f4eb376f6679c0435a
4937f38da1d9389f4ee913f34e5172cc
修改详情图片
class System extends Admin public function updimage(Request $request) { $id = $request->param('id'); $title = $request->post('title'); $photo = $request->post('photo'); $sort = $request->post('sort'); $data = [ 'pic' => $photo, 'sort' => $sort, ...
1
d0a383d1179de5cf2e7179f7a8db690c
980fdde75a1c488763113b13190fd941
Checks whether euclid algorithm throws the correct exception when is invoked with wrong arguments.
try { new OperationCheckResult(" "); fail("IllegalArgumentException expected."); } catch (IllegalArgumentException iae) { } }
0
fa9c752b2475c3a89ea5c28290f9baf5
244ad1ac337bf7b3186725ec8f3ebe31
Test that user cannot initialize a Card with invalid suit the code is expected to throw ValueError
class CardTest(TestCase): def test_card_init_valid_card(self): card = Card("6")
0
a3a1cd8bd1f3ef7e9b6553d76f4f0813
d4bda23c784bd0e046e35074f51fbc06
获取最矮的ul
function leftLI(){ function minLI(){ var lis = $('.list li'); var min = Infinity; var obj = null; $.each(lis,function(i,el){ var h = el.offsetHeight if(h<min){ min = h; obj = el; } }) return $(obj); }
0
24a9eaa61f90ebd74878d0862c85ca29
2d96b48969e19c27ac69433ae44599d6
Returns the first non-empty Filter from the argument list.
public final class ObjectUtils @SafeVarargs public static <T> T firstNonEmpty(T...o) { for (T oo : o) if (! isEmpty(oo)) return oo; return null; }
1
ffd622080999deaa238e0e1a81f25bdf
dbd1d2ac5cc7a7324b4f6b4a2ed99331
! Returns the sampling mode to be used for this texture.
export class Tw2SamplerState GetFilterMode() { return this.minFilterNoMips in Tw2SamplerState.FilterMode ? Tw2SamplerState.FilterMode[this.minFilterNoMips] : 2; }
1
d46f46a8f01394afc053469582380f52
443a8ba79c435558d48749eacd9fe15d
Add product to group
class Group extends \Magento\Framework\App\Action\Action public function assignProducts($groupedProduct, $childProducts) { $associated = []; foreach ($childProducts as $key => $productId) { $linkedProduct = $this->productRepository->getById($productId); $productLink = $this->...
1
420e2aaebcda9f7ab175656bfe0faaf6
840fad3410bebb0b370c07f064b17cfc
Return the index of an item for placement in the lead slot on the index.
if self.shelves: for shelf in self.shelves: if self._item_fits_shelf(item, shelf): return (0, shelf, False) if self.rotation and self._item_fits_shelf(item, shelf, True): return (0, shelf, True) return (0, None, False)
0
4fb70ee1ce9369124d8e0e714a837309
d3b66bf0ab9c2bbe7ccf3168be541aa1
Returns whether or not this Request can log provenance information to clients.
boolean isRequest();
0
2ad5be8efcad256ea7e0e8893ea1dabe
b75438756fdc7e0a0e980cbc003012c2
是否配置预约提醒
final class GeneralConfig static boolean isRemarked() { return false; }
0
6d2a64591467ed0144587ff8a9720ef5
0b68c3979de856073a611f8d59b6fe50
簡素な漢数字をアラビア数字に変換します。
def kansuji2arabic(kstring, sep=False): tt_ksuji = str.maketrans('一二三四五六七八九〇壱弐参', '1234567890123') re_suji = re.compile(r'[十拾百\d]+') re_kunit = re.compile(r'[十拾百]|\d+') transunit = { '十': 10, '拾': 10, '百': 100, } def _transvalue(sj, re_obj=re_kunit, transdic=transunit): ...
1
6ad814e127db5202314c1757a40fed36
336b4f3d2ba706ec554c684928ee2c84
Return true if point Q lies on our curve
public boolean isPointOnCurve(EcPoint q);
1
c9fd3ac9cbe67ac0a7da2f1e49410a7e
78d7d5e80f716bae4d7bffb1f2a265f9
Order by task assignee (needs to be followed by {@link #asc()} or {@link #desc()}).
namespace org.camunda.bpm.engine.history HistoricTaskInstanceQuery orderByTaskAssignee();
1
c01d5a1c091c8a145a31399d39d26d1c
d1c9994d458786d392fee96dab8cb862
Remove snapshot from database
@GET @Consumes(MediaType.APPLICATION_JSON) @QueryParams(keys = "command", values = "deleteSnapshot") @ExceptionParser(ReturnVoidOnNotFoundOr404.class) ListenableFuture<Void> deleteSnapshot(@QueryParam("id") String id);
1
05aed8d12109f5c0a1cd4a5fbe2cdfb2
47de6bde65019d8f7b2fdeb700611dab
更新排行榜 只显示前三 不足前三时 有几个显示几个
if (rankList.length >= 3) { let lists = rankList.splice(0, 3); let dom = `<div class="second"> <div class="avator" style="background: url(${lists[1].img}) center/100% no-repeat"> <div class="tip">2</div> </div> <span class="txt1">奖855元</span> <span cla...
1
bd618624097fabec0d06ac07f6b578c4
c100bcc6232568216d1e9e1d20ff58ec
Detects there is any active seo plugin
$icmsModule = & icms_getModuleInfo($moduleName); $icmsModuleConfig = & icms_getModuleConfig($moduleName); return !empty ($icmsModuleConfig['seo_inc_id']); }
1
21dcc11f15ec92128786a2b8161eb7d3
4df657f320a892ca13772f7282b53580
Returns a python type according to a java type
def to_python_arg(java_arg): arg = None for val in java_arg.__dict__.values(): if val is not None: arg = val break return arg
0
6ca4d6c9fc998f07af7b7ebe6e08932b
a514e67fb67380d495f9614f5d3b1c5d
FIFO queue holding all JSON configurations that need parsing and processing
debugFifo = fopen(debugFifoName, "r"); int fd = fileno(debugFifo); int flags = fcntl(fd, F_GETFL, 0); fcntl(fd, F_SETFL, flags | O_NONBLOCK); if(debugFifo != NULL) fifoOpen = TRUE; else fifoOpen = FALSE; size_t chunk_pos = 0; size_t json_chunk_capacity = 1024; char *json_chunk = mall...
1
e055a52349122d97f3f9b5412e2487ab
01db258bf5c69e4a43b8d9302193ca55
Reads all published projects or all archived projects
class Skarabee extends \yii\base\Component public function getAllProjects($sinceDate = null, $types = null) { $parameters = array(); if(!$sinceDate) $parameters['LastModified'] = $sinceDate; if(!$types) $parameters['RequestedPropertyTypes'] = $types; $results = $this->doCall('GetProj...
0
2c53ca6aca211463bafcd00b074d1f6c
c834673f08d8c007de9b70d5f80bc6f9
Can Import Listings
class USER_KEYSTONE extends OC_User_Backend public function hasUserListings() { return true; }
0
73467ec1ad7610955a989a3e680e8051
79b96a409db0367340854381a4d51893
2. 得到某个类的静态属性
@SuppressWarnings("rawtypes") public class ReflectUtils public static Object getStaticProperty(String className, String fieldName) { try { Class<?> ownerClass = Class.forName(className); Field field = getDeclaredField(ownerClass, fieldName); if (field == null) { throw new IllegalArgumentException("Could ...
1
793769b68e96886d080089756a64e926
a0d7d5bc6c3af1811ecc5ec511aa7905
Returns a copy of the integer array in descending order.
public class ArrayUtility public static void sortArrayDescending(int[] arrayN) { sortArrayAscending(arrayN); reverseArray(arrayN); }
0
577340052cbeccf177e5a1a683f2bb44
7ecdffa98339724c11e40a2d50047c91
Add match table with current round in match report.
def reportMatch(winner, loser, is_tie=False): current_round = getCurrentRound() try: conn = connect() insertInto(conn, 'matches', (current_round, winner, loser, is_tie, False)) finally: conn.close() return
1
9533c117f93cb2e0296cede227313f43
f23ff4e6b9ae85f8305aa7c22dc5518d
Returns the meta object for the containment reference list '{@link org.jabylon.properties.PropertyFileDescriptor#getReviews <em>Reviews</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_IModelDescriptor_crossReferences_feature"), getString("_UI_PropertyDescriptor_description", "_UI_IModelDescriptor_crossReferences_f...
0
20bc5fba974350ee86b427e8de580ccf
e78168f5655b3fc44422ad4d15b226c0
根据部门和人员ID,为部门添加关联人员
void insertPersonnelRelation(Map<String, Object> map);
1
e0aa6131302d0005ecb61ad62f89ad88
c03903ec24327503321e0385274b4f51
通过私钥创建 keystore
KeyStore keyStore = KeyStore.getInstance("JKS"); keyStore.load(null, null); KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM); keyPairGenerator.initialize(2048); KeyPair keyPair = keyPairGenerator.genKeyPair(); PublicKey publicKey = keyPair.g...
1
8ce37bda2b49ffd4d3cf0762867d61d8
90a7c8fc3256265d227a2272343fe080
Plotting Feature Importance Table of CatBoost
fig, ax = plt.subplots(figsize=(15, 15)) plot_importance(self.model, height=0.5, ax=ax, max_num_features=64) plt.show()
1
2d8ece7a9bf641dfd018e55c69ccde72
aafa37d8034fda319ccbe84649f6e209
获取将要修改的线路信息
$lineId= $this->get('id'); $type=$this->get('type'); $supplier = $this->getLoginSupplier(); if(is_numeric($lineId)){ if(empty($type)){ $res=$this->user_shop_model->get_user_shop_select('u_line',array('id'=>$lineId,'supplier_id'=>$supplier['id'])); if(empty($res)){ echo '<script>alert("您没有权限...
1
d0e3b9dfcd345c5ac3b760db2753acd9
efb9d2d0e92866da18f8f6dbfaa24121
Return k nearest points to central.
with torch.no_grad(): x = x.transpose(2, 1).squeeze(-1) batch_size, n_points, n_dims = x.shape _, nn_idx = torch.topk(-pairwise_distance(x.detach()), k=k) center_idx = torch.arange(0, n_points).repeat(batch_size, k, 1).transpose(2, 1) center_idx = center_idx return torch....
1
b8ca68013ae14c1d33a9dde935f308c3
2795908efb98cdea98026ebe5d474710
This test passing means the module doesn't crash when an invalid event handler is called or when the event handler execution fails.
self.machine.events.add_handler('test_event', self.event_handler1) self.advance_time_and_run(1) self.machine.events.post('test_event') self.advance_time_and_run(1) self.assertEquals(1, self._handler1_called) self.assertEquals(tuple(), self._handler1_args) self.ass...
0
b9387378f2b622df5c8fd8092182acb1
0b1bfb205d1f8fc6cb3ac876f9affcf9
Returns a new HrWithholdingsQuery object.
{ if ($hrWithholdings instanceof HrWithholdings) { return $this ->addUsingAlias(HrPayrollswhitholdingsPeer::PAYROLLWHITHOLDING_WHITHOLDING_ID, $hrWithholdings->getWithholdingId(), $comparison); } elseif ($hrWithholdings instanceof PropelObjectCollection) { if ...
0
50b3656e44b7c1d68d6e14cf0b2fb51d
0c7fdce99fa6af0dca8aadaee6de9c63
测试获取所有Office的方法
class OfficeController extends Controller public function all() { return Office::orderBy('name', 'asc')->paginate(20); }
1
3224b76a7878ffaf32abf40dd1108418
e9d49d87b8ff9544f383ec64d03158d3
Set whether a representation should be stored.
public function setStore(bool $store): void { $this->store = $store; }
1
3959116a8192c2e150de58664d5812b3
f766a728a09f92d191641795c94fd6df
清除redis中保持的最新房源列表
{ $listKeys = RedisClient::instance('main')->keys('*activity::IndexPage::hotlist*'); if (!empty($listKeys)) { $ret = RedisClient::instance('main')->del($listKeys); } }
1