query_id
string
corpus_id
string
query
string
code
string
label
int64
c6259ebfb92dcb90a06648ec49cde36c
5de7b3c8e1880cca088b79e3b3745e96
Gets all resource types.
namespace Axis.DataProvider.Common Response<ResourceTypeModel> GetResourceTypeDetails();
0
ce3967ec358071a0c30511772e97a11c
0d3a680747a971bc84675b3e4060a392
Will wait for SIGTERM or SIGINT
{ int err, local_sig; err = sigwait(&sig, &local_sig); if (err || (local_sig != SIGINT && local_sig != SIGTERM)) { abort(); } logutil_notice("bye"); return (NULL); }
1
6223a7ef07d809243cae849f17c5e08d
8f8c18cb2944f07e1b4bf6980f52beac
<p>处理线程池溢出异常</p>
public class UnCeHandler implements UncaughtExceptionHandler private boolean handleException(Throwable ex) { if (ex == null) { return false; } new Thread() { @Override public void run() { Looper.prepare(); Looper.loop(); } }.start(); return true; }
0
abfe5f250866f7ed63d97612f8f3552a
61519665afa71d2df4cc6ff7f5f7d9ce
ROR Acc
void ROR(d6502_t *cpu) { uint16_t m = IS_ACC_ADDRESSING(cpu) ? cpu->a : read_addr(cpu); m |= get_flag(cpu, FLAG_C) ? 0x100 : 0; set_flag(cpu, FLAG_C, m & 1); m = (m >> 1); set_flag(cpu, FLAG_Z, m == 0); set_flag(cpu, FLAG_N, (m & 0x80) != 0); if (IS_ACC_ADDRESSING(cpu)) { cpu->a = ...
1
f25f5e8027c1aeadab662802807ffa1b
b391887f74a115db55f02db3c2aa1fa5
Pushes a single character onto the end of the string. This simply converts the character to a string and calls fancy_append() on that string.
class FancyText: public Text void append(const std::string& extra) override { Text::append(connector + extra); }
0
9768f42d9e1c0ca8aa68efcf34e147a7
159f80d4f3d67eb41a43f6c92c42ab62
Read a file of genome locations to process. The file may be in BED, Picard, or GATK interval format.
try: for line in inFile: elems = line.split() if ((len(elems) > 0) and (elems[0][0] != "#")): curr_bed = None if (peaksTrack): curr_bed = peak_BED_line(line, track=self) else: ...
1
8f8c2ed9e3b16646871e82ce96044952
b370e4fdad9fb3d61cd6190af9f696d2
Condição para indicar se o saldo é positivo ou negativo usando as cores branca e vermelho
namespace OZiNursing public class Utilities : OZiNursing.DAL.DataAccess public static string GetDisplayStatusColor(double nBalance) { string strClass = ""; if (nBalance < 0) { strClass = " adminred"; } else { ...
0
2861b95c8b6e0f854468f2ccf26028a8
ba9ebec0a000ae7b52c8cfcdfcee72fc
Handle special case of empty tree, otherwise mutate random term
class Mutator: def replace_random_subtree(self, node, verbose=False): if node.children: pos = random.randint(0, len(node.children) - 1) random_symbol = random.choice(self.symbol_pool) random_subtree = self.input.build_tree(Node(random_symbol)) if verbose: ...
0
769392416418abab3fd7abfb7be98b91
225bbb1c9099f89187e6f502fa9a2843
Импорт классификатора из файла модели.
namespace ObcidiaNetwork.IO internal class NnImporter public NeuronsController Import (string pathToFile) { byte[] key = { 49, 73, 39, 75, 39, 37, 60, 35, 50, 43, 50, 45, 50, 46, 50, 47 }; byte[] iv = { 43, 35, 45, 36, 38, 33, 57, 35, 44, 82, 43, 47, 64, 58, 42, 38 }; usi...
1
12c414b66281b576c38d4677f5b96d39
6e255c241fd6cc53bb560c53e076bec9
Return the read-only name property.
abstract class Cundd_Core_Abstract extends Cundd_Core_Endofinheritancechain{ protected function _getReadonlyProperty($name){ return $this->__get(self::CUNDD_READONLY_PROPERTY_PREFIX.$name); }
1
828e74987f5f5d08d7437a4b2f4aeb66
750291f01a38572d0302c84191f46a4b
Set current path to Home in case of relative file path
void GamesHistory::setHistoryFilePath(const QString& historyFilePath_) { QDir::setCurrent(QDir::homePath()); ui->fileChoose->setToolTip(historyFilePath_); }
1
7acfeb7964c94096bf66a36a55fefab9
143ada8e43b6979f0a9395638c0d4c91
get custom lint rules.
return { codeAction: { disableRuleComment: { location: 'separateLine', }, }, config: null, configFile: '', configBasedir: '', customSyntax: '', ignoreDisables: false, packageManager: 'npm', reportDescriptionlessDisables: false, reportInvalidScopeDisables: false, reportNeedlessDisables: ...
0
2bbf67467aa6fce2d419483e4ca8afa3
d03fbac729c496529867995b53c6e9a2
將交易訊號轉換成股票擁有狀況
l_s = '' if (len(positions)) > 0: for position in positions: if position['symbol'] == ticker and position['side'] == 'long': l_s = 'long' elif position['symbol'] == ticker and position['side'] == 'short': l_s = 'short' return l_s
1
7104e0a787b5d23f3ea2395fdf963100
cc674b18fc82e1914572760e8a55ea84
배열을 이용한 점심메뉴 고르기
String[] menu = {"김밥","라면","돈까스","우동","짜장면","햄버거","짬뽕"}; double magic = Math.random(); System.out.println(magic); System.out.println(magic * 10); System.out.println((int)(magic * 10)); System.out.println((int)(magic * 100)); System.out.println((int)(magic * 100))...
1
91b795fe1b30fbabc592087c78704423
8dffd8d129b900fbf6891fe4c7f00ba0
Von-Neumann entropy of density matrix
def _ehs(x: np.ndarray, y: np.ndarray): H = (np.histogram2d(x.flatten(), y.flatten()))[0] return -np.sum(np.nan_to_num(H * np.log2(H)))
0
59ed67f6c15819cb6b441c527f4b7564
60900c630125afc99c0bf3f3720d9786
Detect the presence of an option on a particular element.
public class CommonTask public static ExpectedCondition<Boolean> optionPresent(final String item, final Select select) { return new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver f) { List<WebElement> options = select.getOptions(); boolean returnMe = fa...
1
573d4554040a3ba11dcd11e27fea418d
78d26a7a13da248a6ea6ddf995825fae
Удаление элемента из двунаправленного списка
class UnidirectionalList void Delete_Single_List(Single_List* Head){ if (Head != NULL){ Delete_Single_List(Head->Next); delete Head; } }
0
c96265d6123ad44aabc163aa5f27d4d4
20d5f8ab1fb685651092d4fa2461732f
Assert the Discussions Tab displayed
namespace RallyTeam.UIPages public class ProjectsPage : BasePage public void VerifyDiscussionAddMemberIcon() { _driver.WaitForElementAvailableAtDOM(ProjectsUI.discussionAddMemberIcon, 1); _assertHelper.AssertElementDisplayed(ProjectsUI.discussionAddMemberIcon); }
0
1fe4258e2016e21d0787a2c853159000
0a9ec9d99ea7d2c2d1982ae99b19fdcf
GetAllSeoPositionItemsQuery constructor.
\Lof\SeoPackage\Helper\Product $helperProduct, \Lof\SeoPackage\Helper\DataProvider\Product $helperDataProvider, \Lof\SeoPackage\Helper\Website $helperWebsite, \Magento\Framework\Registry $registry, \Magento\Framework\View\Element\Template\Context $context, array $data ...
1
9bdd977e46f4e3d270063c9f5557cdac
f9c45a9b83c67eddadf9675ac41fa6f1
Perform a binary search on the CurrentPosition vector for the Destination
{ PROFILER_PUSH(); #ifdef PathingDataAnalysis g_pathingAnalysisData->Start(); #endif m_currentPath = std::vector<Vector2>(); IntVector2 startCoord = m_planner->m_map->GetTileCoordinateOfPosition(m_position); IntVector2 endCoord = m_planner->m_map->GetTileCoordinateOfPosition(goalDestination); bool isDestinationF...
0
4bcc5a02ead10bae62e42c8b225177a8
daa1616f9ceb3ae14002f543301aa60f
Visit a parse tree produced by langParser#andExpression.
class Visitor extends Python3Visitor visitAnd_expr(ctx) { console.log("visitAnd_expr"); return this.visitChildren(ctx); }
1
14166de1d15a3d35e065a1e35accba09
1bc57cce0d6d2b418f7ab6240743521c
Initialize topology state.
topology_graph = np.zeros([self.n, self.n], dtype=np.int32) np.fill_diagonal(topology_graph, 1) for i in range(self.n): topology_graph[0][i] = 1 for i in range(self.n): topology_graph[i][0] = 1 self.topology = topology_graph.tolist()
1
1554b0b645aad05d174a927cfc474317
bb90417c7f0eae7a171cc652cb40bb0b
Convert the current time unit to seconds (as an object).
def to_seconds(rt): return rt.to_seconds()
1
5a0b06dfb757411cd7f2f063a668188a
e4ffc4367d41778cd2fd94bd7202aaeb
Called when the no match (sliding the tiles back to their original place) animation finishes.
public class Player : MonoBehaviour private void SlideEnd() { }
1
7036c0091037e2db8412c6305d203913
beeafee7579f3e3774bab181696cc2c8
@brief Finds first parent of @a stmt which is not a loop when statement is in a loop body. which is not a loop statement, otherwise return same @a stmt.
namespace Jitrino{ static Node* findLoopHeaderOnUncondPath(Node* parentLoopHeader, LoopTree* loopTree, Edge* edge) { Node* node = edge->getTargetNode(); if (!node->isBlockNode() || node == parentLoopHeader) { return NULL; } if (loopTree->isLoopHeader(node)) { return node; } Edge...
0
109a650f41b9ecda6eb9b3f96e1d500e
86d7638309f96a581c747768c5683ed7
Give player coins
namespace giantsummon public class Dialogue public static bool TakeCoins(int Value) { return Main.player[Main.myPlayer].BuyItem(Value); }
0
e145eb1dc32fc1dc4396052cb0c5f3f7
3228e6478ba5c5f42fae4faff546b73b
Get the HTML table from the CRAN site for a package, which holds all the dependency info
dfs = pd.read_html(url) assert len(dfs) == 1, 'More than 1 table on page' df = dfs[0] df = df[['Name']] df = df[df['Name'].notnull()] df = df[df['Name'] != 'Parent Directory'] df['date'] = pd.to_datetime(df['Name'].str[14:22]) if start_date is not None: start_date = parse(start_d...
0
bb174e813414bc9b820609ea8bc2c7c1
5452556a5d8ccbece7d30ccb0672c749
Returns the value of the '<em><b>ANCO</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>ANCO</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc --> extendedMetaData="kind='element' name='AN_CO' namespace='##targetNamespace'"
@Entity @Table(name="siac_t_predoc_anagr") @NamedQuery(name="SiacTPredocAnagr.findAll", query="SELECT s FROM SiacTPredocAnagr s") public class SiacTPredocAnagr extends SiacTEnteBaseExt public String getPredocanContocorrente() { return predocanContocorrente; }
0
3bf16b81b5859e694abe7764dbf6b6f9
f7109f1e8c6a026223cdb64552216e74
@brief This function switches the peripheral from P/E mode for Code Flash or Data Flash to Read mode. FLASH_TYPE_DATA_FLASH.
void HW_FLASH_LP_dataflash_enter_pe_mode (flash_lp_instance_ctrl_t * const p_ctrl) { R_FACI_Type * p_faci_reg = (R_FACI_Type *) p_ctrl->p_reg; p_faci_reg->FENTRYR = FENTRYR_DATAFLASH_PE_MODE; if (gp_flash_settings->bgo_enabled_df == true) { if (SSP_INVALID_VECTOR != p_ctrl->irq) { ...
0
b969389cf235989c7e5d9881c04d95cd
1eecba1cfd77a5ea0c8e5b1f349f9acc
examines the video url and return the host
String s = ""; try { int pos = videoURL.indexOf("youtube.com/embed/") + 18; s = videoURL.substring(pos, pos + 11); } catch (Exception ex) { ex.printStackTrace(); } return s; }
0
9ecfa273442bfc1af60a9cb2e2b71320
5770d6dbc54118735f586fda2fc3b855
Goes from so3 parameterization to SO3 element (rotation).
def so3_to_vec(so3mat): return np.array([so3mat[2, 1], so3mat[0, 2], so3mat[1, 0]])
0
43ac9800098c04b44f4f70cd07f126d0
4fe80e36e393994ce0ac69285a51fffe
入参是否是本周
Calendar calendar = Calendar.getInstance(); int currentWeek = calendar.get(Calendar.WEEK_OF_YEAR); calendar.setTime(new Date(time)); int paramWeek = calendar.get(Calendar.WEEK_OF_YEAR); return paramWeek == currentWeek; }
1
f95558a8cb26613f623ea6fd98e95247
0591d7e1a83eb0393733cb0c96f74972
Omogucava cekanje da bi nam bile vidljivije promene tokom testa
class TestValidationFunction(unittest.TestCase): def setUp(self): self.minRange = 0 self.maxRange = 1000 time.sleep(1)
1
bc5108112b3a9dbbfd611602aca08679
fefb33b3e0230a141beb901b528387ac
Gets the value of the processed property.
@JsonProperty("values_processed") @JsonInclude(value = JsonInclude.Include.NON_NULL) public Long getValuesProcessed() { return valuesProcessed; }
1
c4dbfa49fa27971f1dc0f3977bae32dd
db9708d8a37e2ac3f4e35ab578c26a88
Downloads videos and images.
class Collection(QueryableType, FileLockerType): def download_media(self, path, no_meter=False): self.download_videos(path, no_meter=no_meter) self.download_images(path, no_meter=no_meter)
1
294c3e6dd0217926430262ec690571f1
c578b11c11bb945b2c0004ea5b596de1
获取此实例所表示的日期是星期几(中文)
public class DateUtils public static String weekOfChineseString(LocalDate date) { return date.format(DateTimeFormatter.ofPattern("EEEE", Locale.SIMPLIFIED_CHINESE)); }
1
7b47e6ef282d1925fb57901a6fc1d444
2cfbaf66ea6338f872b26f3ff77378bb
Method which clears the list of used magical equipment
void clearEquipmentItems();
1
595256875aecc85c063f2e460a6f6333
ae9e3fc9d09f72625d1a3363f3899b6c
Returns list of all selected units.
class Level: def getSelectedUnits(self): units = [x for x in self.units if x.isSelected()] if units: self.recentUnit = units[0] return units return self.units
1
838dd6ee4f970401c8b7f057c2e47c2c
64368cfc34cac2c7f427092ae7d50739
This routine sets the lock bits. Note that unlocking is only possible by doing a full chip erase, not available from software.
{ #if defined(SEMAILBOX_PRESENT) if (lockMode == dbgLockModeAllowErase) { SE_debugLockApply(); } else if (lockMode == dbgLockModePermanent) { SE_deviceEraseDisable(); SE_debugLockApply(); } else { EFM_ASSERT(0); } #else #if defined(_SILICON_LABS_32B_SERIES_0) if (lockMode != dbgLockModeAllowEr...
1
d1b21872622003158ffddc5ac864f6a4
59491fa313c1184121b50b27533ee7f9
先查 再保存或更新
let result = await this.count({ where: where }) if (result) { return await this.update(values, where) } else { let dt = new Date().getTime() !values.created_time && (values.created_time = dt) !values.updated_time && (values.updated_time = dt) return await this.insert(values...
1
bb5ad5c1b1ab792e201ee0f42fc3c0e4
527640a660b1a11f0f21c0f665ce971f
49. Write a JavaScript program to replace every character in a given string with the character following it in the alphabet.
var translation = []; for (var i = 0; i < str.length; i++) { if (str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90) { translation.push(str.charAt(i)); } else if (str.charCodeAt(i) > 77) { translation.push(String.fromCharCode(str.charCodeAt(i) - 13)); } else { ...
0
3fd7889d80932e2a04d1f08c3dde4b2f
86eae2d66e2dd2680335aa6e88620058
Optional hook; default implementation checks that the input type is of the correct type.
namespace TypeConverter [ComVisible(true), Guid("567C527F-9025-4057-BE42-527554D10ADE"), ClassInterface(ClassInterfaceType.None)] public sealed class TypeConverterAsync : AsyncMFTBase override protected HResult OnCheckInputType(IMFMediaType pmt) { HResult hr = HResult.S_OK; ...
1
04eedc5dfad2d48cd31ea746341293ef
ead78e8e8b6be1ffbdd4cec1af67663a
Logs first index of char in string
{ char[] givenArrayString = str.ToCharArray(); char current = ' '; char prevchar = ' '; int count = 0; char ActualChar = prevchar; int MaxCount = count; int ActaulIndex = 0; for (int i = 0; i < givenArrayString....
0
dcdfb4e5f16c2b827daff91c2685f31e
72b3ec94e8c71286de3194aef5bf5730
Sorting by polar angle and finds nearests
private void SortAngular() { Point avgPoint = AveragePointInside(); Comparison<Point> mycomp = (a, b) => { double a1 = Math.Atan2(a.Y - avgPoint.Y, a.X - avgPoint.X); double a2 = Math.Atan2(b.Y - avgPoint.Y, b.X - avgPoint.X); double angle1 = (a1* (180/Math.PI) + ...
1
ef33a93e13e6e5a75b5401ce326babe3
af1370189dbd3e2a5837331e65a93f66
根据法币单位获取与ETH汇率
if self.market_name == "huobi": base_cur, quote_cur = cur_market_name.split("_") if quote_cur == "cny": if base_cur == "eth" or base_cur=="etc": bitex_acc = bitexService.BitexServiceAPIKey(key_index="CNY_1").get_spot_acct_info() if ...
0
40d7d75f91973e765144a114b149dc33
4bd42175d47963366a297515e8fa6067
function to crop image and save image to disk
def cropImage(app): image = Image.open(app.fileName) left = 900 top = 300 right = left + 2000 bottom = top + 1400 image = image.crop((left, top, right, bottom)) image.save(app.fileName)
1
b705595dc69b29b783e8d2b1a51d723c
f615e786d576fd4042a0f9240db128d3
按照一级分类查找商品
List<Goods> getGoodsByLevelOne(Integer id);
1
9f1cc598c8c3fcf20457acef967e39cf
d2b907189e800a3282c88134f1549502
Takes a list of peptides, generate automatic names for the peptides and write the results to the disk as FASTA files
if outfile is None: outfile = infile else: outfile = outfile infer_peptidoforms(infile, outfile, ipf_ms1_scoring, ipf_ms2_scoring, ipf_h0, ipf_grouped_fdr, ipf_max_precursor_pep, ipf_max_peakgroup_pep, ipf_max_precursor_peakgroup_pep, ipf_max_transition_pep)
0
bb64383eae7ce1394c8d9d7a703ecfc5
0ec41e0b0cf9f4cae5f1532dd96be078
Return the polar angle step used to walk over the elliptical path. The polar angle step is defined by the actual integrator subclass. Returns
class PolarAxes(Axes): def get_theta_direction(self): return self._direction
0
5640f33950221dfb8410383f706f8e9a
ac119156273974ba8f0a01e518d45b5b
如果任务拒绝执行,则放入队列中,留待下次
public class TaskQueue<T extends Response> void addToExecutting(Task<T> task) { if (task == null || task.isCanceled()) { return; } taskQueueExecutting.add(task); }
0
e0552de4f68be9e9b63ce99ec38622d4
f8e00b397d564113404f1c44864acf27
Processes document setting tags (and placeholders).
class VelocityService protected function processDocumentBuilderTag(ContainerBuilder $container) { $dbDefinition = $container->getDefinition($this->getDefault('documentBuilder.key')); foreach ($this->findVelocityTaggedServiceIds($container, 'document_builder') as $id => $attributes) { for...
1
e08fe62c7d5039d8dadda734818169d4
9bbd01bbfda569beb7059648257f9477
ping I2C for an RPU bus manager
{ outw( Cmd + info->mbre_bit, info->io_base ); if ( info->bus_type == MGSL_BUS_TYPE_PCI ) inw( info->io_base ); }
0
e80873a385f63a423d566ae328cd9896
1c09294c13b5a01eb4955727fa1da743
Gets a general error description with parameters and returns it as a throwable exception.
String messageKey = ApplicationException.UNEXPECTED_ERROR; if (e instanceof ApplicationException) { messageKey = ((ApplicationException) e).getMessageKey(); } return handleException(messageKey, describeMessage, e); }
0
ef275f8eaedd14733db640e20a08eaf9
f46d48dfedb4099d3b1354184cb32c0b
Create an instance of {@link KoeretoejSupplerendeKarrosseriTypeStrukturType }
@XmlRegistry public class ObjectFactory public KoeretoejSupplerendeKarrosseriTypeStrukturType createKoeretoejSupplerendeKarrosseriTypeStrukturType() { return new KoeretoejSupplerendeKarrosseriTypeStrukturType(); }
1
504461677117fd29daf956832f7fb19c
525f4c92534de87cbb06bfe38d8b1958
會員進入活動頁時的資格審查
class Ifriendship_activity_ajax extends CI_Controller public function ck_sign_up($id='') { if(CkUrl() && $id!='' && $_SESSION['member']['id']!='') { $DB=$this->rdb; $sql = "select count(id) from ifriendship_activity_sign_up where aid='".$id."' and mid='".$_SESSION['member']['id']."' "; $yn = $DB->get_var(...
1
37a4589654e141396e00f09da8e1b336
045069e759ce56e1b402e3d4244c0e9c
File extension for the file attachment.
public class AttachmentFileWrapper implements AttachmentFile, ModelWrapper<AttachmentFile> @Override public java.lang.String getExtension() { return _attachmentFile.getExtension(); }
1
c7462f07de2aa68c6aca05fd18518b2d
e0116da091f9fe71d8c7d7975683e427
return the number of file with an unknown name in this ``Farc`` file
class GXARCDB(gxapi_cy.WrapARCDB): def get_i_unknown(self): ret_val = self._get_i_unknown() return ret_val
0
7aee54f1b0135a3f656911bc758b2783
edd82af58bc20b23f8f23333f8ef531e
Замена вхождений блоков СБ на блоки АР
namespace AlbumPanelColorTiles.Panels public class MarkAr : IEquatable<MarkAr> public static List<Paint> GetPanelMarkAR(MarkSb markSb, BlockReference blRefPanel, RTree<ColorArea> rtreeColorAreas) { List<Paint> paintsAR = new List<Paint>(); int i = 0; bool hasTileWithoutPa...
1
102152f11a4288a4f2854c74e8d67026
8b6b89306f26bdada14baddb77aab151
ensure the workbench state gets saved when running with the Automated Testing Framework
public static function teardownAfterClassUsingWorkbench(): void { static::$cachedConfigurationForWorkbench = null; unset($_ENV['TESTBENCH_APP_BASE_PATH']); }
0
ccf5a0573cd665d947b8ee804d7bc337
417d0eb8a79909cabf9466390548b105
Bert Tokenizer으로 tokenization한 결과를 sentence로 복원해주는 함수
assert type(encoded_sentence) is list, 'list 인자만 입력 가능합니다/' if self.sp is None: raise ValueError("Load Sentencepiece model before tokenizing") if from_id: return self.sp.decode_ids(encoded_sentence) return self.sp.decode_pieces(encoded_sentence)
1
2f3964746381f29fa91dae22d67033d7
e9027307bde26bb0a7c3f7ed7cc0f32c
Given a Month and Day, calculate the corresponding Julian Date Julian Date = the number of days past 01 January
def jdn(d,m,y): return (1461 * (y + 4800 + (m - 14) // 12))//4 + (367 * (m - 2 - 12 * ((m - 14) // 12)))//12 - (3 * ((y + 4900 + (m - 14) // 12) // 100)) // 4 + d - 32075
1
23e373f30faf501770e4f973f0c1d797
f5e8259784bb6790d884fba4acd75f08
Create a HTML table with the specified column names. The content has the same number of columns as there are column names.
<table class="table table-sm caption-top"> <caption class="small"> Headers </caption> <tbody> ${rows()} </tbody> </table> """.trimIndent()
0
731db47ea641c017c35ffca31431abe8
3097d765f25ee5514bbac34fd54aec41
Raises the <see cref="MediaPlayer.MediaPlayerRateChanged"/> event
{ if ((_currentState != PlayState.Init)) { switch (playbackRate) { case MediaPlayerPlaybackRate.Half: SetRate(0.5); break; case MediaPlayerPlaybackRate.Double: ...
0
f420f901ec7337623e073e010170dcfd
c9c32e31e00026c81fb6c9fa12d994cc
GET /account_payables GET /account_payables.json
class BudgetIncomesController def index end
0
580ba583951d65d3d7f785afbaa2ce71
f17a5578aa02ba33045af521528477b0
判断某 id 商品在数组中是否存在, 存在则返回其在数组中的下标,-1表示不存在
{ var obj = this; var Index = -1; $.each(List, function (index, item) { if (item.goods_id == goods_id) { Index = index; } }); return Index; }
1
e4d4c1b5a333bd600b0c7c3f6889f6ff
a789426e4429f509294d3e058778f6ed
Computes the SHA-3-512 of the <password + salt> concatenated string. Returns a 128 characters long string.
def sha512(*args, **kwargs): pass
0
b301acdc18c3aa6fb63dd0844d437aae
2f1f044af5d8753f15055f2677c52b3c
添加一个cv物体到场景里
var material = new THREE.MultiMaterial( materials ); android = new THREE.Mesh( geometry, material ); if ( sigleObj.modelRotation ) { android.rotation = sigleObj.modelRotation; } if ( sigleObj.modelPosition ) { android.position = sigleObj.modelPosition; } scene.add( android );...
1
6afe4680642cd968d10a93db87b49972
0a14512255978e6b4b0b994bf0f2312c
return features of layer where field=val
if not isinstance(expression, (int, str)): raise RuntimeError('expression must be of type int or str') expression = parse_literal(expression) if isinstance(expression, str) else expression if isinstance(expression, int): feat = self.getFeatureByIndex(expression) e...
1
cb953f44a1d812f2b3bbcef411cc7142
b48eb164eceeb8e0996ee3252f17b074
Represents the text of a ruby annotation .
class RichTextAnnotation constructor (attributes) { this.attributes = attributes || {} }
0
9fab48cbaca76158898a8b1400c5e48e
899e02c6bf523c4376628170cbe5ffd7
After a save, we generate the binary MO file
save() { fs.writeFileSync(this.path + '/manifest.json', JSON.stringify(this.dump, null, '\t')) }
0
f13e3f192d89c4839ea77e598ff29053
a91c932f2292334ac0d718aa9aaab411
Возвращает пересечение элементов двух массивов
{ $result = []; foreach ($array1 as $value) { if (in_array($value, $array2)) { $result[] = $value; } } return $result; }
1
eac2d1047187e94a4a77ee85e9a18c9c
3b86493f9810caf962b6975cac5071b1
curl批量下载文件
class Modules public function CURL($FileURL) { if(!empty($FileURL)) { $CURLHeader = @get_headers($FileURL,true); $CURLHeader['Content-Length']<'524288'&&$CURLHeader['Accept-Ranges']==='bytes'?$CURLFile=$FileURL:$CURLFile=false; $CURL = curl_init(); cur...
0
5c2dcbb18cbbc138e8013a6f67ca51de
ecdfb9b09790145ef12d4e0d4a506ba5
Implements PCA on the provided dataset.
class PCA(object): def __init__(self, dataset, timeout=0, verbose=True): self.verbose = verbose self.dataset = dataset self.timeout = timeout Log.Info("Loading dataset", verbose) self.data = np.genfromtxt(dataset, delimiter=',')
0
85357b8e2c7f221d49b3f5f4be91be41
80b3a91da8552a5bb1e05d35c7ccf65d
method returning the id of the associated que
public class DynamicAssessment extends DynamicQueContainer public Vector getChildQueId(Connection con) throws SQLException, cwSysMessage, cwException { DbQueContainerSpec myDbQueContainerSpec = new DbQueContainerSpec(); Vector vtDbQueContainerSpec = DbQueContainerSpec.getQueContainerSpecs(con, this.res_...
1
040bbd0f23d62695206128c64031b1ef
9c0152a6af9506de2aeedf5d98bd7663
creates calendar event and submits to the DB
function createEvent($conn) { $event = $_POST["event"]; $decoded = json_decode($event, true); $qName = $decoded["Name"]; $qRooms = ""; foreach ($decoded["Rooms"] as $room) { $qRooms = $qRooms . "{$room}"; if ($room != end($decoded["Rooms"])) { $qRooms = $qRooms . ","; ...
1
df9c0a21c13535f38e779c2b194a996b
859635d329e7de450169cf91821635f8
左右会员数据余额迁移
{ $id = DB::table('cp_member')->where('tokenid', '=', $data['token'])->pluck('id'); $data ['arr'] = DB::table('cp_trans_member') ->where('trans_date', '>', $data ['date']) ->where('trans_account', $id) ->where('opp_account',$data['shopid']) ->where(fun...
0
54b69435e9d4c6a6e110ac74ff38b0a2
30104ddf6bf20b00463a99267f621b03
Aggregate the same user's multiple ratings on the same movie by only keeping the highest rating
user_genres_rating = get_user_genre_ratings(ratings, movies, user_id) user_rating_movies_id = get_user_rating_movies(ratings, user_id) result = {} for movie_id in user_rating_movies_id: movie_genres = get_movie_genres(movies, movie_id) r = [user_genres_rating[g] for g in movie_genres] ...
0
16f24506511d088e863ee1e17b549ca6
bf88c0194cc741ef35ca9091669dca7e
Check if diagnostics is enabled from the command line
{ foreach(string arg in Environment.GetCommandLineArgs()) { if(arg == "-d") return true; } return false; }
1
40a5eb9727314e4e8ea2c85db4485e81
9be98b9635bb2db4b6dc3fbd21cfe798
当点击[中文]按钮时
function toChinese() { $("#aHome").attr("href", "home.html?l=cn"); $("#aHome2").attr("href", "home.html?l=cn"); $("#aHome").text("主页"); }
0
7369b1082a53f04c29bc99bda9872b34
440e570377e9878f1a9dafbff3b23fab
将InputDTO对象转换成Json InputDTO对象
public class KeyWordAction extends ActionSupport implements ModelDriven<KeyWord>{ public String BecomeJson(Object cDto){ Gson gson=new Gson(); String json=gson.toJson(cDto); return json; }
1
fc0fdda567be4cdfab6a05fe2852e240
2247db2101f04c7bbe67d306b225c0fa
Gets the allowGuestUsers
abstract class WaffleAuthenticatorBase extends AuthenticatorBase public boolean getAllowGuestLogin() { return _allowGuestLogin; }
1
a367618453fefc3cc9137e383bc9ae6b
e6229435f1040f7efde165b55c2783fc
读取流程信息
namespace LeaRun.Application.Web.Areas.FlowManage.Controllers public class FlowProcessController : MvcControllerBase [HttpGet] public ActionResult ProcessLookFrom() { return View(); }
0
000c67e91d88d74d243ac06821f4cd09
21f6f3e1334c38b8fa99b18c5f5148f6
Returns true if eeprom is enabled
static int32_t PIOS_BMA180_EnableEeprom() { int32_t byte = PIOS_BMA180_GetReg(BMA_CTRREG0); if(byte < 0) return -1; byte |= 0x10; if(PIOS_BMA180_SetReg(BMA_CTRREG0,(uint8_t) byte) < 0) return -1; return 0; }
0
4b82bddb44819dcbcbb05aa56b721586
5350453960644d7c3065a47204d8cb9a
データdを辞書に挿入
class JSONDOA: def append(self, data): self.dict.update(data)
1
a97a0772e99556524d9c31505df1462f
2f50fe1a98822abdbf4a7b81104b1e92
재귀적으로 트리에 있는 모든 노드 값을 오름차순으로 출력
{ if (dummy == null) { return; } IncreasingOrder(ref dummy.left); Console.Write(dummy.data + " "); IncreasingOrder(ref dummy.right); }
1
18a210f73ccec393fb63195450adccd6
31ac21d94e583c40edb2a764679724e2
根据索引获取技能数据
if index < 0 or index > 3: logger.warning("Invalid skill index[index=%d]" % index) return -1 skills = utils.split_to_int(self.skills_id) return skills[index]
1
4415747f0da495d5c0588760e821170c
72ba0ca8cf463866f1dfbaea8b7cb43d
Convert predicted box parameters to label format.
h, w, nh, nw, dx, dy = info_img y1, x1, y2, x2 = box box_h = ((y2 - y1) / nh) * h box_w = ((x2 - x1) / nw) * w y1 = ((y1 - dy) / nh) * h x1 = ((x1 - dx) / nw) * w label = [y1, x1, y1 + box_h, x1 + box_w] return label
1
99e8fa674f7d3979fc927a926f6b57b2
7262c3e9423d988ec51b12b1bd71b6fb
获取指定段落的文本
{ if (source == null) throw new ArgumentNullException("source"); return source.GetTextAt(segment.Offset, segment.Length); }
1
07e7b99864b289bb78c4135eb5aa440c
a67f0616457181f47b0932386a892c75
Display a copy object Box
class LeadboxController extends Controller public function show(Leadbox $leadbox) { $this->authorize('update', $leadbox); $modelStandardFields = $leadbox->fillableAttributesForForms(); $teamBlogs = Blog::whereInTeam(auth()->user()->team()->id) ->get(); $modelSelectableFie...
0
c94b82d115e8ac2baa9ec5bb6db1d3e7
ae0ff3f831060255479d130904fc36b4
七牛云 文件删除,删除多个
namespace XS.Blog.Components.Helper public class QiniuHelper public static void DeleteDatas(string keys) { var client = new RSClient(); var entryPaths = new List<EntryPath>(); foreach (string key in keys.Split(',')) { entryPaths.Add(new EntryPa...
1
a58e4a004a92bcd1a893fb42bda3dc5a
0779fbc1332c2d3c3e9d3a7e9f47dfd0
A function that reads a text file of words and randomly selects one to use as the secret word from the list. Returns: string: The secret word to be used in the spaceman guessing game
f = open('words.txt', 'r') words_list = f.readlines() f.close() words_list = words_list[0].split(' ') secret_word = choice(words_list) return secret_word
1
649b96fb1929e599fba9f9e85274dac8
ec9f9cc3266c5b2881c7b255731ac1a1
保存Error
class SharedService extends BaseService public function savePayError($data) { $config = [ 'A' => ['title' => '项目名称', 'width' => 16, 'data_type' => 'str', 'field' => 'A'], 'B' => ['title' => '所属类型', 'width' => 16, 'data_type' => 'str', 'field' => 'B'], 'C' => ['title' => '...
1
7ea363e7886f491193afe97ddb3971d2
a28bc832174a4147071ded7ee0ccb2c5
Get authorization code for underlying authUrl
namespace Microsoft.WindowsAzure.MobileServices.Internal public abstract class MobileServicePKCEAuthentication : MobileServiceAuthentication public abstract Task<string> GetAuthorizationCodeAsync();
1
23a528e35a070873c9201121be86de63
95d41b5e0ccf3686edc455fab3fb2bcd
表单项管理页面——table表格加载接口
@Controller @RequestMapping("/topic") public class TopicController extends BaseController{ @RequestMapping(value="/loadTable/{id}") public @ResponseBody Object loadTablesData(@PathVariable String id, HttpServletRequest request,HttpServletResponse response) throws Exception { RequestDataForm requestDataForm = getRequ...
1
6de2bb3acdb6a5b261c34c71eb2206f5
0880b6ac954431a935915433376afa81
|------------------------------------------------------------------------------- | | 获取系统的默认的支付方式 | |-------------------------------------------------------------------------------
class order_adminLogic private function getPayMode($mode) { static $modes = []; if ( ! array_key_exists($mode, $modes)){ $tmp = $this->order->payMode($mode); $modes[$mode] = empty($tmp) ? '' : $tmp; unset($tmp); } return $modes[$mode]; }
0
9b9d1bc97bd4a17dc03c8079252af6d7
7886325698cc169870b54020766efb2a
멘션 자동완성 박스 숨기는 기능
function mentionSearch() { getProjectMemberList("mentionSearch"); $('.editable').textcomplete([{ match: /\B@(\w*)$/, search: function (term, callback) { callback($.map(words, function (word) { return word.indexOf(term) === 0 ? word : null; })); }, index: 1, ...
0
7a1361ba6cfa1a476eb0beba9ddbd799
e3ab32e0e13740f3abeea8145d2bc109
日韓単語翻訳結果を1つの文字列で返す
reply = requests.get( url=TRANSLATION_URL, params={'text': text, 'source': 'en', 'target': 'ja'} ).text return reply
1
e9315d6df5bd6415975679355fa97b1a
095849e7cfbbde9c2fd52b3ecb6d5888
Returns a user-friendly name for this <code>CryptoImplementation</code>.
default String name() { return null; }
0
eeaa8ea8e29a31563deb0d11c8efdb57
f0daeb98021b1e88c55d3e6a4f2bf440
Provides an example which shows that pattern variables created by instanceof are also in scope within an expression used in the condition of an if statement, as well as the block, but only when the earlier part of the expression has definitely matched the pattern.
public class PatternMatchingTest @Test public void testIsClassPatternIsTrue() { final Object str = "some text"; assertSame( 9, Match .when(str) .is(ofType(String.class)).then(String::length) .orElse(() -> 20) ); }
0
5cfc78ae4d1ca88083efd2ba23e69f8a
07f4c6fc5645c713e02c6683b37b08d5
根据roleId、用户id判断此用户是否拥有审批权限
boolean checkRoleUserAuthorization(Long userId, UserRole userRole);
0