query_id
string
corpus_id
string
query
string
code
string
label
int64
5c95d924f29ade9e82e4e7e4c5b4bb32
43a3a7d0a79e0f416e38cf6ac3b0c2e1
树型展示缓存策略
public I_CacheStrategy getCacheStrategy ();
0
9abf24b492f2a1a936a3756670e4752b
0b5f59783aa4d4b6b077e697cdec9d36
Draws the background text box on top of given surface
{ float padding = 10.0f; float textWidth = font->MeasureText(text.c_str()).x; float textHeight = font->MeasureText(text.c_str()).y; float boxWidth = textWidth + (padding * 2); float boxHeight = textHeight + (padding * 2); Vec2 boxPosition; boxPosition.x = position.x + offSet; boxPosition.y = position.y...
1
b11c35186f397af784ab304e998dc435
40944d3d1c3435e62cf77c4c1343cb63
Pulse Width Modulation thread function. Pass a pointer to a GPIO_PWM_PARAMETERS struct. Passing as a pointer means the duty cycle can be changed whilst the thread is executing. Its software pulse width modulation so not very accurate!
{ GPIO_PWM_PARAMETERS *pwmParameters = (GPIO_PWM_PARAMETERS *)parameters; assert(gpioIsValidPin(pwmParameters->gpioPin) == true); while(pwmParameters->terminate == false) { calculateDutyCycle(pwmParameters); pulseCycle(pwmParameters); } pthread_exit(NULL); }
1
20a50dc44eb4f8848ee5e42f97b299dc
019dfa1ffb167795ace74fc924dfa639
Стохастический градиентный спуск
class No_Reg(): def SGD_step(self,theta, psi): psi_old = psi*1 psi += self.h * theta * f(theta*psi) theta -= self.h * psi_old * f(psi_old*theta) return theta, psi
1
c45b3aa598dacca671116547f8293dc1
56e77cf3f510fd6de157caf303638453
This method is called when the suppliers tab is selected.This loads the sceen with the active supplier's list.
emit SupplierChanged(); ui->comboBox_SuppList->clear(); for(int i=0; i<database.SizeDistinct("Suppliers","SupplierName");i++){ ui->comboBox_SuppList->addItem(database.GetSupplier("suppliername",i)); } ui->lineEdit_PhoneNumber->setText((database.GetSupplier("phonenumber",0))); ui->lineEdi...
1
0444741be84f769250dcdce8ea0031a6
0d70dff3b63543b5b3035a02e8edf854
显示网络图片 固定宽高
public class ImageLoader public void displayImage(BaseActivity context, String url, ImageView imageView, int width, int height) { GlideApp.with(context) .load(url) .centerCrop() .override(width, height) .into(imageView); }
1
57130b2fec813ab65ebd6acecd7b7fde
2feee4a0835df7b33b13c4ecc766c3db
Checks if two 2D vectors are exactly equal
function equals(v1, v2) { return v2[0] === v1[0] && v2[1] === v1[1]; }
1
a7585edada6c2d22e4d6c836321df879
7f4e4837485e6570f70075e6452d75a0
GET: SchoolClass
{ var appDbContext = _context.Schools.Include(s => s.SchoolType); return View(await appDbContext.ToListAsync()); }
0
63eb473f47cbbe33a0ed9ea5afff14ca
db0fcde9d7d64d2634f4ecd3b3fd4daf
Creates a new symbol information object.
varNameToken: Token, typeText: string, symbolDoc: string, ) { const varName = varNameToken.text!; const sym = new SymbolInfo( varName, SymbolType.MessageOrConstant, typeText, 0, parseInt(typeText, 10), symbolDoc, varNameToken.startIndex, ); this.fi...
1
a7795ca688a0848b5d714768a7ec0f9f
7f37f23de36610a663d0675e7a8c1e80
Calculate Pi based on a MC Approach
double x_coord, y_coord , rnd; double max_rand = 2147483647; int m_score = 0; for (int n = 1; n <= points; n++) { rnd = (double)random() / max_rand; x_coord = (2.0 * rnd) - 1.0; rnd = (double)random() / max_rand; y_coord = (2.0 * rnd) - 1.0; if ((x_coord * x_coord) + (y_coord * y_coord) <= 1.0) m_sc...
1
24dfca2b5fac91dced0733bb06944419
f9f42aea7e80efe8f1848b8510d19516
Adopted from gonum/blas64 - trmv
validateGEMV(Element.F64(mRS), TransA, A, X, incX, Y, incY); if (KL < 0 || KU < 0) { throw new RSRuntimeException("KL and KU must be greater than or equal to 0"); } int M = A.getType().getY(); int N = A.getType().getX(); boolean mUseIncSupp = isIncSupp(); ...
0
0a4e39675e5acc9a201b0371eafabcf2
e6764605ca558927e4dbafe228ac60de
Percorre a árvore de maneira recurssiva pre-fixamente, onde para cada visita de nó, verifica-se se existe um time alocado, caso exista, este é imprimido na tela.
void tree_print_preorder(t_node* root){ if(root != NULL){ if(root->team != NULL){ printf("nome: %s ataque: %d defesa: %d resistencia: %d velocidade: %d\n", root->team->name,root->team->attack , root->team->defense, root->team->resistance, root->team->speed); } tree_pr...
1
9c41ef310da479862ce2de83d016670f
6048f4907e61da92954042aefe7789b5
add a new genre to a Book .
@book = Book.new @genre_list = ['Other', 'Action and Adventure', 'Classics', 'Comic Book/Graphic Novel', 'Detective and Mystery', 'Fantasy', 'Horror', 'Literary Fiction', 'Romance', 'Science Fiction', 'Short Story', 'Suspense and Thriller', 'Biography', 'History', 'Poerty', 'True Crime'] end
0
6f9b239c1579083a4e084b922434e520
d74cb466391fe4b235d40c22b6e3a74f
국가, 지역코드, 배송방식, 무게 입력받아서 배대지별로 요금 출력해주는 기능
request.setCharacterEncoding("utf-8"); response.setContentType("text/html;charset=utf-8"); String bugger = request.getParameter("bbugger"); String side = request.getParameter("side"); String bervarage = request.getParameter("bervarage"); int price = 0; switch(bugger) { case "한우버거" : price += 5000; b...
0
938d0fa951db7f65f73049de91d2d06f
c7895d459963d26195829846f94be7f7
Execute skills for events with two players.
namespace Server.Mobiles public class Player : PlayerMobile public override void OnSkillChange( SkillName skill, double oldBase ) { base.OnSkillChange(skill, oldBase); EventDispatcher.InvokePlayerSkillChanged(new PlayerSkillChangedEventArgs(this, Skills[skill], oldBase)); }
0
3dfba03e6b88def6b2ef7666aed0e59f
31e9dcd675852d49a90485c5663ff199
price of one token (in num euler)
class ETHPair(PairswapClient): def price(self, amount: Ether = 1) -> Token: return self._tokwei_to_token( self._wei_price_in_tokwei( self._eth_to_wei(amount) ) )
0
f1df761bc274ff4a21b3e4397852e618
64ed4e6107bcf2b2af6bb0c4f5487d11
Tests that writing invalid commands doesn't invoke the 'list local files action.
def test_invalid_commands_do_not_invoke_close_function(capsys, sftp): with mock_input("sayonara"): main_loop(sftp) assert "not recognized" in capsys.readouterr().out
0
ed0e9274d82cab4de69352d8c33030fc
b1bbf9fe7e3f0b785b285e7c0ed8bca9
Called from AlarmManager when no alarms remain
public class AlarmManagerService extends SystemService class DeliveryTracker extends IAlarmCompleteListener.Stub implements PendingIntent.OnFinished @Override public void alarmComplete(IBinder who) { if (who == null) { mLog.w("Invalid alarmComplete: uid=" + Binder.getCallingUid()...
0
a36a9f4ce4d91118802793abd7a6edb2
7d350ac263a3d480bba443054cb378c8
Er administratoren også en kontaktperson for området?
{ var arende = _portalSosRepository.GetCase(preKontakt.ArendeId); if (arende.OrganisationsId == user.OrganisationId) { KopplaKontaktpersonTillArende(user.Email, preKontakt.ArendeId, user.Id); _portalSosRepository.DeletePreKontakt(preKontakt.Id)...
0
57fce653dfa2d68e072b458c9f4615a5
d0591806d799bc26547f6fa8dadf81a1
Appends a new complex number to the repo.
{ var complex = _map.MapComplextoE(lComplex); await _context.AddAsync(complex); await _context.SaveChangesAsync(); _log.LogInformation("new complex: {complexId} was inserted ", lComplex.ComplexId); return true; }
1
a1d0c7fd6b6a95976ce280e58fe39b90
5be3e1a8a1214c18eb499ecf34d6024f
Function for single precision floating points. @brief fill_symetric : fill the lower part of the scatter matrix. Because X represents a square matrix.
{ int colx, rowx; for (colx = 0; colx < pages; colx++) { int beforex = colx - 1; int afterx = colx + 1; for (rowx = 0; rowx < pages; rowx++) { A[rowx * pages + colx] = 0.0; } if (beforex > -1) A[beforex * pages + colx] = 0.5; el...
0
86997cba4503eea8ae6ded5f0d5e5a58
ad54b33d805e43b966e03b2d306644dc
# compute the coefficient associated to each edge at different time lags (internal use only)
stopifnot(length(t) / 4 >= lag, is.numeric(C), C > 0, all(is.numeric(t)), is.numeric(lag)) tlag <- rbind(t[(lag + 1):length(t)], t[1:(length(t) - lag)]) w0 <- exp(-1 / C * mean(apply(tlag, 2, function(x){(diff(x))^2}))) w <- exp(-1 / C * apply(tlag, 2, function(x){(diff(x))^2})) return(list(w = w, w0 = w0)) }
1
136ff2e862aef8d2a7f121a58a5799ec
62e3e28c5db8e95d1428b26e94ea6f25
Returns an iterator that gives zipped FASTQC result files.
class TabixReader(BaseReader): def _create_iterator(self): with gzip.open(self._source, 'rt') as f: yield from f
0
0af16ff265e5c119023e96fcc991e84d
6518ce50e3eb174d22ec698b532bd59c
上报页面进入事件
namespace CDSS public partial class Statistics : InfoFormBaseClass private void ShowInfoEnterPage() { CustomEventHandle temp = ShowInfoEnterPageEvent; if (temp != null) temp(); }
1
7a698310066d3bc5fa686eb9bc3d5d42
c8a0946f25eb5d797c8483ce0ae9fece
Hace in/visible los filtros de busqueda
etiqOrigen.setVisible(opt); scrollOrigen.setVisible(opt); etiqDestino.setVisible(opt); scrollDestino.setVisible(opt); etiqTren.setVisible(opt); tren.setVisible(opt); etiqVagon.setVisible(opt); vagon.setVisible(opt); calcular.setVisible(opt); comprar.setVisible(opt); borrar.setVisible(opt); imp...
1
1231207fd1b7598fb67874c4a294d1c2
0d042426afe85e62dbf6d751738ec9d7
Search with "Search ROM" command
uint8_t ow_rom_search(uint8_t diff,uint8_t *id) { uint8_t i,j,next_diff; uint8_t b; if(ow_reset()) { UARTprintf("reset error.\n"); return OW_PRESENCE_ERR; } ow_byte_wr(OW_SEARCH_ROM); next_diff=OW_LAST_DEVICE; i=OW_ROMCODE_SIZE*8; do { j=8; do { b=ow_bit_io(1); if(ow_bit_io(1)) { if(b)...
1
f216f213e0f36103c8878bfa67d4aae8
35f57b2d448d6bc645a62086291a4313
Fit single peak to a spectrum
n_points = 3 ind = peak + 1 x = time[ind - n_points:ind] y = sig[ind - n_points:ind] a, b = fit_line(x, y) n_points = 3 ind2 = peak x = time[ind2:ind2 + n_points] y = sig[ind2:ind2 + n_points] c, d = fit_line(x, y) x_new, y_new = intersection(a, b, c, d) return x_new, y_n...
0
30b46c11a0a9aaee9eb9c76c01222b50
fcc71c72f07aeb178d4cfce6433aca51
Returns the order line statusCode.
public class ASWJoinSalesOrderLineAndSalesOrder extends ASWBusinessObject implements BAPJoinSalesOrderLineAndSalesOrder public String getLineStatusCode() { return getInternalStringAt("LineStatusCode"); }
1
005264cbfaa6eddafdc18de66a13c8af
8b86fb70f4bfa49e7d990554f19d7712
emailSendを設定します。
$data = array( 'email_host' => trim( $email_host ), 'email_port' => trim( $email_port ), 'email_addr' => trim( $email_addr ), 'email_id' => trim( $email_id ), 'email_pass' => trim( $email_pass ), 'email_is_security' => $email_is_security ); $value = json_enc...
1
e5bdcf603d17150ae089ac9b7f60e7a2
fa002ce43ff1655af3e229ded368ba29
Links corresponding keys and doors together by their matching id
class FSM: def prepare_DoorIDs(self): for si, state in sorted(self.__state_db.iteritems(), key=itemgetter(0)): state.entry.categorize(state.index) self.drop_out.entry.categorize(E_StateIndices.DROP_OUT) for si, state in sorted(self.__state_db.iteritems(), key=itemgetter(0)): ...
1
126df4d449fb596f4e3fc61e0ed7ea6f
834db96cbdad2f431c0d52ee382be00d
@method 絶対パスか。 Returns: bool:
class BasePath(ABC): def is_file(self) -> bool: ...
0
6436f71f0316fce399effdea9e95a886
15079184c07f1adbf2647c1837870b0a
Parses a aws_server_config path into its component segments.
try: (pathStr, queryStr) = pathStr.split("?") query = [queryItem.split("=") for queryItem in queryStr.split("&")] except ValueError: query = None segments = pathStr.lstrip("/").rstrip("/").split("/") type = segments[0] resource = None a...
1
72766bcc0ea3f0a6a9cc501b90013ef8
c7ed8db2b06fb45881058069cd7ae4d2
Projects cannot be updated.
namespace BLL.Role public class CTechnologyLeader : IWorkProj, IDevelopmentTask, INotice public bool UpdateProj(Model.ProjectInformation projInfo, Model.ProjectParticipation[] projParts) { throw new NotImplementedException(); }
1
a26698e010239f02483da7e915f8d78c
50832e5fd822b01139570c724542fe14
Tests that symbols relative sizes are proportional also if using uoms.
def test_division(): pc_mks = m_per_pc km_mks = m_per_km pc_sym = Symbol("pc", positive=True) km_sym = Symbol("km", positive=True) s_sym = Symbol("s", positive=True) u1 = Unit("pc") u2 = Unit("km * s") u3 = u1 / u2 assert u3.expr == pc_sym / (km_sym * s_sym) assert_allclose_units...
1
e58cf3b3c762fc101aff11fe46f95216
f6eaec20ca05d5bbd40de91b66c341db
WGS-84坐标转换成GCJ-02坐标,精度在0.000001度及1米内
public class LocationConverter public static Location wgs84ToGcj02(Location location) { return gcj02Encrypt(Double.valueOf(location.getLat()), Double.valueOf(location.getLng())); }
1
6d7b03c18328fa0bde5a05e852b7c2d2
7c8a510adb40f635f75075dffc85377c
Loads the street view house numbers (SVHN) dataset This function is modified from load_data in http://deeplearning.net/tutorial/code/logistic_sgd.py
def load_svhn(is_train=True, batch_size=128): transform_train = transforms.Compose([transforms.ToTensor(), transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5))]) transform_test = transforms.Compose([transforms.ToTensor(), trans...
1
0a34af0ea8a0c25bb455aa37f9b006df
1027f82f037cdb643674d681dce60fd4
选择离 source 最近的目标
function SelectInterceptorFuseTarget(interceptor) local resultIndex = nil local minDistance = interceptorRadius for warningIndex, warning in ipairs(warningsByIndex) do if warning.Valid then local thisDistance = Vector3.Distance(warning.Position, interceptor.Position) if this...
1
902669a1b91b57aaacb22eec4a4385c5
4aac60fd94d7a13070c3009c9f1bb316
Setup return and parameter types
static void param_retstruct(void) { NODE *p, *q; p = tempnode(0, PTR-FTN+cftnsp->stype, 0, cftnsp->ssue); rvnr = regno(p); q = block(REG, NIL, NIL, PTR+STRTY, 0, cftnsp->ssue); regno(q) = R0; p = buildtree(ASSIGN, p, q); ecomp(p); }
1
3361898d346deffef7bc48ec9730927e
bb6902477ae4cf9ed388e778a017dc01
Get inactive users
class UserPeer extends BaseUserPeer function getInactives() { $cond = new Criteria(); $cond->add(UserPeer::ACTIVE, 0); $todosObj = UserPeer::doSelect($cond); return $todosObj; }
1
a77975f88ee839a743f74f63c75a681a
a169e90d51a5562dfb2b84fa71a8882a
检查表管理首页跳转
class AdminController extends CommonController public function index() { $this->redirect('Admin/manage', '', 0, '页面跳转中...'); }
1
bde0ff00ce53efc24a6b83b15de8a2b1
6590b533ad7e189124806f740dcc48f8
设置动物ID
class Animal public function setId($id) { $this->id = $id; return $this; }
1
726e64c5fb8b0b594286decc4ea40637
f01209de390b62db2c57c16d9bcabf0c
@brief 检查窗口队列
if not self.windowQueue then self.windowQueue = { } end window:retain() table.insert(self.windowQueue, window) self:checkQueueNext() end
1
1c2c89135a11c34b064e938b9da604c6
5002f44fcb00289c6a8c0c222071913f
Funcion que calcula las estadisticas de mutantes y humanos
@RestController public class DnaController @GetMapping(path = "/stats") public MutantStats stats() { MutantStats stats = new MutantStats(); long humanCount = repository.countNonMutant(); stats.setCount_human_dna(humanCount); long mutantCount = repository.countMutant(); stats.setCount_mutant_dna(mutantCo...
1
93845110caa8e085dae0543f8d2f3f5f
ec22f56e1116e16d3580ed4385670dc6
Класс виджета структуры BITMAPV5HEADER
class WidgetBITMAPV5HEADER(QWidget): def __init__(self, info): super().__init__() self.form_layout = QFormLayout() self.but = QPushButton("...") index = 0 for i in info.get(): if not isinstance(i[1], CIEXYZTRIPLE_GAMMA): self.form_layout.setWidget(inde...
1
db77e90f07b64f015617d7bb023eb5d7
122b68dee14668b00c33313dfd1c8129
HttpGet for admin panel portfolio assets page, shows all portfolio assets.
{ $portfolios = Portfolio::with('client')->get(); return view('admin.pages.portfolios.index')->with([ 'portfolios' => $portfolios ]); }
1
fc850df4ae7e58012ff448f14ef9bd4b
a70ebf426bf205a6f13b0662459675ed
Sets the protection mode.
class AdaptiveApplicationControlArgs: def protection_mode(self) -> Optional[pulumi.Input['ProtectionModeArgs']]: return pulumi.get(self, "protection_mode")
0
95f264741291ee96228184b7737ef79c
29d05a3b818abbff93eb484828bf4671
Process episode data out of a filename matching ([.\w]+)S(\d+)E(\d+). Unlike pattern1 this process function does not assume any kind of pre-existing directory structure for pulling in additional information. However, it is important to note that the episode's title will not be returned by this method.
ep = EpisodeInfo( seriesname = 'Scrubs', seasonnumber = 1, episodenumbers = [2], episodename = None, filename = 'scrubs.example.file.avi') assertEquals( ep.generateFilename(), 'Scrubs - [01x02].avi')
0
1416a581fa0736a5b610e0a00ce0d070
54cb38dcbdf1d9281b8ddf87782588a9
A better check of mu-plugins to include subdirectories. This is a copy of core function with the ability to check subdirectories. For plugins that do not follow the standard naming convention of `WPMU_PLUGIN_DIR/PLUGIN/PLUGIN.php` the filter hook photonfill_mu_plugin_filter is available.
class PluginOptions extends WordPress protected function hasPluginFilter($hook, $callback = false) { return $this->hasFilter("{$this->getNameSpace()}-{$hook}",$callback); }
0
865068b3427e0fd249ed81fbdd53082e
c480edce6fb02c9cd0ef21a7d3032f27
生成虚拟视点主函数
void ThreeView::generate() { int curr_x = m_curr_point.x(); int curr_y = m_curr_point.y(); int leftBorder = m_curr_image_index - m_range_of_images >= 0? m_curr_image_index - m_range_of_images : 0; int rightBorder = m_curr_image_index + m_range_of_images < m_all_images.size()? m_curr_image_index + m_range_of_images ...
1
a39911cdd57b0ced7272d01075f3ceee
d46b7b6dd473e52d317153968eac96e1
Free an allocated page.
void page_free(struct page* p) { lock_acquire(&page_lock); list_move_tail(&free, &p->pages); list_del(&p->lru); num_used_pages--; num_free_pages++; lock_release(&page_lock); kernel_log("[phys] freeing page %#x\n", p->address); }
1
9c9bd2e6115bdae7ed5910a9b56d1680
c06c18345bdc5e4c2eab61a605467ad4
获得指定时间戳的那年的起始时间和结束时间
{ $year = date('Y', $timestamp); return [ 'start' => strtotime($year . '-01-01 00:00:00'), 'end' => strtotime($year . '-12-31 23:59:59') ]; }
1
b1d0be07f77321a087da9975ca859bbc
7615fd0761770ca29799117bb0bcb8b3
Gets the mapping function that maps list items to their search keys.
abstract class AbstractSort abstract public function getMapping();
1
079d7517254e5ca6d0334c8e6ec8516c
dca6385d5bddd9721e0a4722429e9d64
개설과정관리 시작메뉴입니다.
public class ViewAdministorStudent public void begin() { System.out.println(); System.out.println(); System.out.println("\t\t\t\t\t\t\t\t\t\t교육생 관리로 이동합니다."); }
0
909f1e67ad9d490d71cbe0a1e4b2304d
14df0af46621e3869cceb1f7f086252a
Base64解密(默认采用UTF8编码)
public class GameTool public static string Base64Decode(string result) { return Base64Decode(Encoding.UTF8, result); }
1
5d1e9ee820099067d642010c338350c4
7f515b3d57a835519ddc8743bbd64028
OSPPTokenInfoGetValidAfter() - returns valid after time
{ $validToDate = new DateTime("1970-01-01 01:00:00"); $token = new Token(1, "", new DateTime("1776-07-04 12:34:56"), $validToDate, true); $this->assertEquals($validToDate, $token->getValidTo()); }
0
21da231562b50e75fd47ac90f65ee712
2ce95fe05b941ae7e01141ff14edf17c
<p>Title:addReserveBuy</p> <p>Description:添加预定车位购买信息</p>
int insert(ParkReservation parkReservation);
1
a77eac8d861c45eea0999d738c7ee954
8cf9a1dd38845a3b185c2ed179b19bb6
現在のフレーム時間と押下開始時間の差を取る。
getTimeFromFrameStart(): number { return Browser.now() - this._frameStartTime; }
1
ea272771409d3f7dbb21f3067362774c
5b691303cd2f55248bd633cc1b114810
Prepare the SOAP Envelope for sending.
xml = Builder::XmlMarkup.new :indent => 2 xml.instruct! xml.tag! 's:Envelope', {'xmlns:s' => 'http://schemas.xmlsoap.org/soap/envelope/'} do xml.tag! 's:Body' do xml.tag! 'PreAuthorizePayment', {'xmlns' => "https://test.heartlandpaymentservices.net/BillingDataManagement/v3/...
1
a07f91d412b51042f9fb77e3d7fe58b5
2cb06f2cbddbc1ab2b9ca94991203e50
Shutting down the helper (main thread).
void igt_stop_shrink_helper(void) { igt_stop_helper(&shrink_helper); }
1
08956ba7851177d18bd797593aca3ae7
1f4bc0b5529a8c344869f6fe8c0d0e00
Gets the last cps of the player.
class ClickerState: def get_cps(self): return self._current_cps
1
d0e16aa705cdb31b66b59d0157c07df6
9d27c3bb007e2bd223cb130cf2260cc4
Removes stock from specific portfolio
class StockItem extends Component removeFromPortfolio () { this.props.removeFromPortfolio(this.props.name); }
1
c8e3759628df70bad60714a595d17b83
2d09eed600a8a1145e99cb75c89cd607
the visible rectangle NOT overlapping the taskbar
s32 rtt_window::visible_workarea_end_y(){ s32 end_y=h-wm_member_of.window_border_width; if (scrollbar_h.client_total_length_pixels){ s32 scrollbar_height=wm_member_of.bitmaps[wm_member_of.bitmap_scrollbar_horizontal_background]->h; end_y-=scrollbar_height; } return end_y; }
0
d4dc6caec66fe472b079cceb49d5b8ee
78afc3af5f35f051fe645c1f907b0768
Iterates over the unused items.
class BucketPriorityQueue(Generic[TItem]): def __iter__(self) -> Iterator[Tuple[int, TItem]]: for i, bucket in enumerate(self._buckets): for item in bucket: yield i + self._offset, item
0
ab69ec2a0d6158f69a54a50839202c2a
fd40d44abc475a59eb02c847988eb73a
Create an instance of {@link com.cosmosource.webservice.pojo.media._096.ProductDesc.ReceivePublications.Product.Publication.PublicationNames }
@XmlRegistry public class ObjectFactory public ProteinNames createProteinNames() { return new ProteinNames(); }
0
82416313ccfd0c03fdd82f76fcf02cd1
131ad8e5bd077200ebb28a71da780cff
按忽略重复项的方式将源文件的属性追加到目标属性对象中
public class PropertiesUtils public static void appendByXMLIgnoreDuplicate(Properties dest, File file) throws IOException { appendIgnoreDuplicate(dest, create(file)); }
1
741a0f84982fb95144725659a11a422d
cbeb83dfd958a1f0d040958d71d622d4
pressure_test
{ Serial.print(F("Testing HeatCall ")); pinMode(OUT_HEATCALL, OUTPUT); Serial.println(F("CHECK")); digitalWrite(OUT_HEATCALL, LOW); delay(100); digitalWrite(OUT_HEATCALL, HIGH); Serial.flush(); }
0
3263d18f6de9e3f629c6b14344e88d5d
623ac13404a0eb658c01a86eb8a08b72
AudioSourceを同時に再生する
public class AudioControllerFor2D : MonoBehaviour public void Play2DAudio(AudioClip clip) { Play2DAudio(clip, 1f, 1f); }
0
db2a05e1431cbb3b15df928dd25e8d2f
e117824125bc3397381cb9a3fdad4f20
henkilön etusivulla näytettävä lista projekteista, joihin henkilö ei ole liittynyt
class ProjectsController extends Controller public function search() { $projects = Project::all()->where('owner_id', '!=', auth()->id()); return view('projects.search', compact('projects')); }
0
e458ca6223374f96ecf07dd7cfa2550f
56faf08b06e58f7101b3b710cc3b7c8d
Painel para Edição de Dados do Usuario
{ $this->viewVars['editaCampos'] = array ( 'Usuario.nome', 'Usuario.acessos', '-', 'Usuario.apelido', 'Usuario.aniversario', 'Usuario.ativo', '-', 'Usuario.senha', '-', 'Usuario.cidade_id', 'Usuario.email', '-', 'Usuario.tele_resi', 'Usuario.celular', '#', 'Usuario.Perfil', '#', 'Usuario.ultim...
1
815d342b36ea79e8faf19abd9ed9dbab
9ac7137df829803bd93754b98e164d12
Tests the can rent book valid.
checkout_url = reverse('book-checkout', kwargs={'pk': self.book.id}) checkout_response = self.client.post(checkout_url) rental = Rental.objects.get(book=self.book, active_rental=True) rental.due_date = datetime.date.today() self.assertEqual(rental.due_date, datetime.date.today())...
0
8abdf05495a60a516d167e9ff7c01ab4
e69eb3b041f399239fa13b04d2061916
Convert getitem arguments into internal indexes
class DataIndexer: def get_indexes(self, X, type_of="t", order="raw2ind"): return self.backend.get_indexes(X, type_of=type_of, order=order)
1
fe082bdb3372037cb459a54711e23f44
568ebad2098da1a6f6b334b8d41384c9
print all active accounts - number and balance
void Bank::BankPrintStatus() { while (programIsRunning) { t_account_vec tmpPrintingVector; GetAccountVecReadLock(); for (t_account_vec::iterator it = _accountVec.begin(); it != _accountVec.end(); it++) { tmpPrintingVector.push_back(*(it)); } std::sort(tmpPrintingVector.begin(), tmpPrintingVector.end(), So...
1
32b5b2e3fb12289346f8d2364b49249d
8ab6ad6a65eae44293a766bacbd8b66c
Call on_start on each callback in turn with the given state.
with self._cond: if self.state == self.ST_DONE: return Ellipsis elif self.state != self.ST_FAILED: self.error_cbs.append(cb) return True e = self.error self._run_callbacks((cb,), (e,), on_error) return False
0
bb616e18f91a69daf8ecbd3fb8c85cf3
ead6f33fb0453d88c2adc4998ab45a98
Возвращает рейтинг после добавления оценки
function res_rate($postID, $rating_num, $ratingPoints){ if($ratingPoints > 5){ $ratingPoints = 5;} if($ratingPoints <= 0){ $ratingPoints = 1;} $db = Model_Driver::get_instance(); $prevRatingQuery = "SELECT * FROM `prod_rating` WHERE product_id = ".$postID; $prevRatingResult = $db->sqlQuery($prevRati...
1
d301e17963f3d64563138cd4bbacd2ed
4f86af92d2af25d14fc748fbfcb8c4c6
从指定的表中读取项目(按主键+排序键读取)
{ return this.Select(topN, schema, islock, whereClip, this.PrimaryKeyName, this.TableName, orderKeyNameList, orderByASCList, null); }
1
8a0a4eec52f89d25b07c1962e3a14638
92874e8c2e8f8c231bc938e98d781206
Метод вызывается по нажатию на сцену. Если точек меньше трех - делаем треугольник, иначе выставляем проверяемые точки.
{ var canvas = (Canvas)sender; if (polyline != null) { segment.Points[1] = e.GetPosition(canvas); var distance = (segment.Points[0] - segment.Points[1]).Length; if (distance >= 5) { ...
0
49a11d790587a29a5c8f2d3ab11be718
e6c6741a0ce9d369cf6296bbf955f156
Obter o elemento seguinte que é maior que o elemento fornecido
class BST(object): def successor(self, item): treeNodes = self.inorder() for indx in xrange(len(treeNodes)): if treeNodes[indx] == item: return treeNodes[indx+1]
1
d729d883c75777c64010b7a8758cf7fa
725bd6f1993433cda67c9760b94bbde7
Test for "next" attribute for "category" tag. <p> Complex case, when we first see category with "next" attribute and only then referenced category.
public class XMLEventInitializerTest extends TestCase public void testInitXFormsNext() throws Exception { this.xmlEventInitializer.initXMLEvent(this.xmlEvent, XFormsEventNames.NEXT, false, true, "context"); assertEquals(XFormsEventNames.NEXT, this.xmlEvent.getType()); assertEquals(true, this.xml...
0
5526112a2906c6a129e49e8a20fc786d
adbc533c64d7017a237c24c93abe8fef
Read all the defined entities (YAML-only currently) and update the source entity files to have all the correct methods.
global resolverEntities global nameidEntities _get_entity_values(resolverEntities, config.conf_dir + config.attribute_resolver_activators) _get_entity_values(nameidEntities, config.conf_dir + config.nameid_exceptions)
0
07562fa1fe0922a0beb3c49d492e02ce
27c7acb26eefc9c134259d7db054871d
判断某点是否处于开启列表中
namespace Sinan.Util public class AStartFindWay private bool IsInCloseList(int x, int y) { foreach (APoint p in m_closeList) { if (p.x == x && p.y == y) { return true; } } return false; ...
0
98bd24278dc3db7ce325afabccc2fccb
33d4d3d56e851712240cb04b4e4a1f2c
gets all players which are on the bench
class MatchTeamViewModel(val matchTeam : MatchTeamModel) : MRViewModel fun playingPlayers() : Array<MatchPlayerModel> = matchTeam.players.filter { !it.currentPosition.positionIsBench() }.toTypedArray()
0
6da7f999ee1ad493272d6da438c61041
bdc3016420cef1a1dc97dbdc99306462
тест на недопустимый ввод: форма передаётся в шаблон
class NewListTest(TestCase): def test_for_invalid_input_render_home_template(self): response = self.client.post('/lists/new', data={'text': ''}) self.assertEqual(response.status_code, 200) self.assertTemplateUsed(response, 'home.html')
1
9f3186ba52c014bfb9272656e300d613
8866b276605e9c1ad255b64f53b64230
Test whether all the items from the starting index is returned.
def test_item_all(bear, item, length): result = getattr(bear, item)() assert len(result) == length
0
d3c389281af8282250fcc0b04884b24c
5b5a3f1bd43a7e07ca6c2a9ea8eacd79
Writes information about new word to the file. Returns string representation of this information.
with codecs.open(_FILENAME, "a", "utf-8") as fd: fd.write(data_for_writing + "\n") fd.close()
0
cb7919ac4422eeeeaa1c98b7873da7e7
4a96258335b8869ecddb9b94846764ea
Returns a list of arguments passed to the endpoints. Returns: list
arg_string = "" for endpoint in self.cts_endpoints: arg_string += endpoint + " " return arg_string
0
5f246d4fd598853cbf10efc1cfb06171
abaaa773d9bcec20c6fdd17ebf24dfc5
完成对逆波兰式的运算
int len = postFix.size(); stack<int> operand; int temp = 0; for(int i = 0; i < len; i++) { if(priority(postFix[i])==0) { if (postFix[i] == '#') { operand.push(temp); temp = 0; } else { temp = temp*10 + (postFix[i]-'0'); ...
1
26c307e71b37abb5463bd833da3cacbb
504607df5867647025873eada5b0486e
bgm结束后循环播放
{ float startTime = Time.timeSinceLevelLoad; float defaultVolume = m_BgmAudioSource.volume; while (true) { float diff = Time.timeSinceLevelLoad - startTime; float rate = diff / (m_FadeTimeRateFrame / 60f); m_BgmAudioSource.volume = Mathf.Lerp(1, 0,...
0
0a96335a21042869e768ee52d92c2b9b
1ef6dabd46116aebbbf0d831197257dc
Returns True if the card is the last in the column - False otherwise
class Card(CardInterfaceMixin): def filled_row(row): return all(d < 0 for d in row)
0
6ea910b9922c74a82c10d831b78dbe92
eda2151c58684ab436b27270c6256334
Blocks the calling thread until the internal searcher can see latest documents
public class AccountController public void waitForTask() throws InterruptedException, ExecutionException, TimeoutException { this.elasticSearch.waitForTask(); }
1
30acab1984061b4bea7b2197833db777
d0e6fdf31c90e5a3bc383aaa535a0d52
Returns the HTML markup for the progress bar.
{ $html[] = Html::beginTag('div', $this->options); $html[] = Html::tag('div', null, $this->progressOptions); $html[] = Html::endTag('div'); return implode("\n", $html); }
1
d3df5c5048dea1c069b696d6f84fa4da
05703e4eebc8410bbd15e9651a00cc54
Get the path of the original favicon copy.
public class UrlImageIcon extends LazyImageIcon public String getOriginalPath() { return originalPath; }
1
3a29e2813160710bf6b5192a0bf4cd05
c97edec0b79c18f9c14161cda8600bd4
Special function for transforming the last block or partial block in the stream. The return value is an array containing the remaining transformed bytes. We return a new array here because the amount of information we send back at the end could be larger than a single block once padding is accounted for.
global current_padding global plaintext_string global intermediate_string index = BLOCK_SIZE - ord(current_padding) intermediate_state = ord(modified_block[index]) ^ ord(current_padding) plaintext_value = intermediate_state ^ ord(original_block[index]) intermediate_string = chr(intermediate_...
0
2969a73ff52cf6b5c4ccecdfe0dca5f1
886437c64f33d1a4c4ec310d5ab24bb4
Добавление подчеркнутного текста
class TestEditor(QtWidgets.QFrame): def add_text_edit_file(self,list,st): #ЕСЛИ ФАЙЛ СЛИШКОМ ДЛИННЫЙ ТО ОБРЕЗАЕМ ЕГО def add_n_lines(list): dlinna = len(str(len(list))) n = 1 for i in list.copy(): dd = (dlinna - len(str(n))) list[list.index...
0
d78bc9866a3539612e135649eba1b2a3
5bca4ebb47d0ffdf7efa6037ea01f815
Adds a new int32 parameter to the command's parameters list.
public class KiSql public void addIntParam(int value) { params.add(new Param(KiColumn.Type.INTEGER, String.valueOf(value))); }
1
f914406a8524be677d75dfbe3e423494
52181fb1c2906028894138f019a8c7ee
Retrieve Document Information Filtered by Type
async filter(req, res) { const origin = req.query.origin const destination = req.query.destination const registration = req.query.registration const hour = req.query.hour const date = req.query.date var query = {} if (origin) query["origin.acronym"] = origin; ...
1
cebd05b85e572b27f91690fbfff25427
70aebd5365bfee4023fb8517b27057ef
Return self to allow usage like: with nengo_spinnaker.Simulator(model) as sim: sim.run(1.0)
def _return_self(self, func, *args, **kwargs): return self
1
b4ee46ebcfe88c449ddaef6c5b9cfc51
a1044b62ba18bbf1a9f126534c2c551e
Find the top coefficients (or leaves) of the dyadic tree
class WaveletTransform: def find_origin_path(self, segment, coeff_sum): max_coeff_sum = None origin = None if segment == (0, 0): (sum_1, origin_1) = self.find_origin_path((1, 1), self.data[(1, 1)].coeff) (sum_2, origin_2) = self.find_origin_path((1, 2), self.data[(1, 2)].coeff) if sum_2 > sum_1: max_...
1
b6dabd18e17ce81b8f19f4327ca27be9
db678f7fb32fcb850e30fd30008847cc
Checks the SA(Security Association) formation in SSX for a particular tunnel ip
String getIkeSas( String resourceGroupName, String gatewayName, String connectionName, String linkConnectionName, Context context);
0
4699c3d105b9633c05cddbd889b5aa2f
f1ef435f756389c4b43a2a35bcd7b9c5
删除所有数组中的重复元素,仅仅保留一个 方法七:借助List集合
List<Integer> list = new ArrayList<Integer>(); list.add(1); list.add(2); list.add(4); list.add(1); list.add(2); list.add(5); list.add(1); List<Integer> listTemp = new ArrayList<Integer>(); Iterator<Integer> it = list.iterator(); whi...
1
521a29643c2fedc61c372e4cd4576e16
7fc799701ae2ee31ab11c34478932644
获取猫和狗图片地址
cats = [] dogs = [] for file in os.listdir(file_dir): name = file.split(sep='.') if name[0]=='cat': cats.append(os.path.join(file_dir, file)) else: dogs.append(os.path.join(file_dir, file)) print('总共有 %d 只猫\n和 %d 只狗。' %(len(cats), len(dogs))) return ca...
1