query_id
string
corpus_id
string
query
string
code
string
label
int64
844a5e536f6409e14e86bdab2e2415e8
09aa467c92ca9e3ba59174a10b436314
Use put-call parity to calculate put price
double EuropeanOption::PutToCall(double p) const { return p + U - K * exp(-r * T); }
1
724773b0247710d8e95dc26ce74c9615
1e0abea311f256b391e7179e53069290
==============================================DS1302
void DS1307Init(){ TWIStart(); TWIWrite(DS1307ADDRESS | (0 << 0)); TWIWrite(0x00); TWIWrite(0x00); TWIStop(); }
0
203bfdd423ad09e9ee7a5c266a01ac96
f96958e1f3849205ccca9a9988cf988c
根据shoes_id删除shoes
{ $models=ShoeModel::find($id); if ($models->delete()) { return redirect()->back()->with('status', 'se elimino exitosamente'); } }
1
3d71c5807c2b8cb057fd2fceec47103c
28859b6be0fcc0e4b3a10f7fbffe856b
elements that are present on every page
abstract class Page extends BasePage public static function siteElements() { return [ '@user-nav' => '#user-nav', '@logout-button' => '#logout-button', '@navbar' => '#navbar', ]; }
1
d7a925ca879f89ff9e5c15984c24c011
b2f96228c16e41edf9b5e7dde86eed58
Функция изменения издательства
{ $this->load->model('edit_model'); $result=$this->edit_model->Get_author($id); if(!empty($result[0])) { if ($result[0]['author_name'] == $this->session->user){ $this->edit_model->UpdateAd($title,$description,$id); ...
0
e05b0260782dcba5adc72b58611d3a59
234a4fff378f90227857eb6ba86e554f
Set whether batches should be optimized into a single bulk operation. Will revert to batches, if bulk is not supported
class TopicArgs: def enable_batched_operations(self) -> Optional[pulumi.Input[bool]]: return pulumi.get(self, "enable_batched_operations")
0
f0bc6eb3bf0413a8d6f1f0680c2abf53
1ccbaf9b48a9afa850f619cfd1a3d166
获取订单状态,1待发货,2已关闭,3已退款
@Service("orderDao") public class OrderDaoImpl extends BaseDao public int getOrderStatus(String ordernumber) { return getSqlSession().selectOne("order.getOrderStatus", ordernumber); }
1
4bde29d1c9adcbf36008a881aaa7be05
8bb9e2439f11c4119d9c08b2af27f6fd
数据验证前的预处理(max/min value)
String res = ""; if (!StringUtils.isEmpty(value)) { if (maxValue == null || maxValue < 0) { maxValue = 100000; } if (!StringUtils.checkIsPositiveNumber(value, type, maxValue)) { res = "、" + fieldName + ":" + value; } } return res; }
1
d2de2a12117901b65b8fc052b8a9680e
09be61e9e5a5268fa7898ca067eca161
Cég kezelése
{ char valgGrener = 'k'; do { cout << "\n\nMENY FOR GRENER:" << "\n\tN - Ny gren" << "\n\tE - Endre gren" << "\n\tA - Display alle grener" << "\n\tS - Display en gren" << "\n\tQ - Tilbake til hovedmeny"; valgGrener = les("\nGrener: "); switch (valgGrener...
0
cbbf69ad43260a3e6888829e33400647
d16477f037904c76af49a96bf6981bbd
执行原生sql语句,如果sql是查询语句,返回二维数组
class Taglib_Article private static function execute($sql) { $arr = DB::query(1,$sql)->execute()->as_array(); return $arr; }
1
fff7f07826eb0a6e3f2ae512de8ff061
53c4c967a831a7217eabd298ac7e36dd
After blocks are generated change their properties (handles event "controller_action_layout_generate_blocks_after")
parent::alterBuild($build, $entity, $display, $view_mode); if (!$entity->isNew()) { $build['#contextual_links']['block_content'] = [ 'route_parameters' => ['block_content' => $entity->id()], 'metadata' => ['changed' => $entity->getChangedTime()], ]; } }
0
e03424d9998484bd1066e1b5b5b2d708
2cb73ab8a358266153cc1b7b0dae5fb9
Returns the meta object for the reference list '{@link CIM.IEC61970.ControlArea.ControlArea#getTieFlow <em>Tie Flow</em>}'. <!-- begin-user-doc --> <!-- end-user-doc -->
EClass getControlFlow();
0
e30670713a71cc9248a6bac94db35953
dfa645d901e7d798370e9ecc8f34c6bd
Gets the version of the config.xml that was saved at a certain time.
namespace FileBackuper.Model public class ProfileManager public long GetFileVersion() { XmlDocument doc = new XmlDocument(); FileStream fs = File.OpenRead(path); doc.Load(fs); long ver; if (long.TryParse(((XmlElement)doc.GetElementsByTagName("profi...
1
8904de18818cf84536e88cf025ee76b0
2c668a18cdb4a62470f14f51ba425093
Get expected improvement over best posterior mean capped by the best seen reward so far.
def optimizer_EI(optimizer: BaseLearner, X: modALinput, tradeoff: float = 0) -> np.ndarray: try: mean, std = optimizer.predict(X, return_std=True) mean, std = mean.reshape(-1, ), std.reshape(-1, ) except NotFittedError: mean, std = np.zeros(shape=(X.shape[0], 1)), np.ones(shape=(X.shape[...
1
39841dc8190f9b931b45788a1e441f95
b5da6775e22bf296e0aaf056ccec016b
Get boundary indices between non-overlapping triangular windows.
order = triplets[:, 1].argsort() triplets_sorted = triplets[order] s0 = np.concatenate(([0], np.flatnonzero( triplets_sorted[1:, 1] > triplets_sorted[:-1, 1]) + 1, [triplets_sorted.shape[0]])) idxs = triplets_sorted[s0[:-1], 1] return {idxs[i]: order[s0[i]:s0[i + 1...
1
ca1d731c7ab378961eeb849130b4b113
2776fbf894087ce5ea112d271cce8054
Update the DeadPool data of this SlimePlayer. If there is no DeadPool linked, try to get it back from the current DeadPoolTable, and if there is no entry in the table, a fresh one is created.
public final class SlimePlayer public boolean hasDeadPool() { return m_DeadPool.m_poolAmount > 0; }
0
a61a88c17746c0341a8e0a86ed43bbcb
f75093e76f688d239b250dec12f870d1
in case of UPDATE rowid = 0
void Template::setDbRowId(qlonglong aDbRowId) { assert(mDbRowId == -1); mDbRowId = aDbRowId; }
0
f59afe1f0ff1f70b749fe3c376cb2abe
cdcb5a27c54526789bf6bb5207b21da0
Shift the custom highlight on the data grid view to indicate the current step for which evidence is about to be captured.
namespace TestCaseManagerApp.Views public partial class TestCaseDetailedView : UserControl, IContent private void dgTestSteps_LoadingRow(object sender, DataGridRowEventArgs e) { e.Row.Header = (e.Row.GetIndex() + 1).ToString(); }
0
40d598853b56f2bee272a0425cb17706
0b22d0e15582ffb9b5e6d26d1e3faa70
通过车系查询车版本
List<CarModelWebDto> getModelYearBySeries(Integer brandId, String series);
1
322b44fd327505d72e0c0c4f14a87d50
3791f69186f6c10bfbf68bed23c7077e
Paginator for ListPermissionSetsProvisionedToAccount operation
namespace Amazon.RAM.Model public class RAMPaginatorFactory : IRAMPaginatorFactory public IListPermissionAssociationsPaginator ListPermissionAssociations(ListPermissionAssociationsRequest request) { return new ListPermissionAssociationsPaginator(this.client, request); }
0
fb9dd67469863d786e951165f507abdb
280a66be20532fb4efe55222712ade48
@brief Reads the mtimecmp register.
uint64_t neorv32_mtime_get_timecmp(void) { union { uint64_t uint64; uint32_t uint32[sizeof(uint64_t)/sizeof(uint32_t)]; } cycles; cycles.uint32[0] = NEORV32_MTIME->TIMECMP_LO; cycles.uint32[1] = NEORV32_MTIME->TIMECMP_HI; return cycles.uint64; }
1
692410397008bddbf8045d4e4309d912
77ed80959fc729277f6d241c036ffcd4
Turn a list of filepaths into a nested dict
ret = defaultdict(set) for path in paths: dirname, filename = os.path.split(path) ret[dirname].add(filename) return ret
1
e13ae134b8a5ff97599112fd0db95038
e8f90b1da2512adaecf485ed17d9016f
Creates a resolver class instance from a class name.
final ResolverResults resolverResults, final String className) throws ResolverException { if (resolverResults == null) { String message = "ResolverResults must not be null"; LOG.warn(message); throw new IllegalArgumentException(message); } if (...
0
b4475ddd0bca116fe3bc9d5e59adaeb3
44bc778545200503f173154d6bf0e639
Creates an instance of a Vector3.
function VNew(x,y,z) { return new THREE.Vector3(x, y, z); }
1
ae00ab7df6bc4938ded7086c5e67c240
8493f7bf2eba2a8b7876088efc4be43d
Sets the value of addressInfo.
class Location public function setAddressInfo(string $addressInfo): self { $this->addressInfo = $addressInfo; return $this; }
1
5183c242a6d488bd5a957922639b5c94
9adfb9e94f102515125be5e05ae28186
Calculate remaining time
class Process: def remaining_time(self): return self.get_burst().cpu - self.progress
1
8b6288f72f0a1f411a9992e67323dcd1
9fe6127e873cf61895b5408fec09febf
This method handles events fired when the user changes the selection in one of the list boxes
namespace Microsoft.Windows.SdkViewer.Controls public partial class IndexPanel: ContentControl private void OnListBoxSelectionChanged(object sender, RoutedEventArgs args) { OnSelectionChanged(sender); }
1
aa538a067b58a4b98c383cfbb70fa3ea
9cd6532468b3dbf2687d234490744c8c
solo or unsolo a track
local text = " Track And Take " if (isTrackOnly == true ) then text = " Track Only " end local s_w, s_h = gfx.measurestr(text) x = x y= y+2 gfx.x = x gfx.y = y if ( pointIN(x,y,s_w,s_h) ) then gfx.set(table.unpack(COLORS.TrackOnlyButtonOnMouse)) else ...
1
86cb2e7cefb9746dee7a64ed6bc8de7d
f05b8383c66a686f3cc9ebc5d8d60c31
z-score normalize all samples w.r.t. training set
def normalize(train_np): train_np = (train_np - np.mean(train_np,axis = 0))/np.std(train_np,axis = 0)
1
018277ff5d33a31eee228e171405814f
82aa912ff3b98ca8f981bb76dc1c6f71
BasicStatistics constructor.
{ parent::__construct(); $this->time_interval = config('statscenter.time_key_min', 5); $this->statsService = new StatsService(); }
1
bb881b43fa069076726316b9c7294d8e
0fccd10227a91d977bd8ac0c966201af
Checks if the argument has no subjects in it
fun nullSubjectType() { val expression = qSubject.subjectType.eq(SubjectType.valueOf(subjectDto.subjectType!!)) subjectDto.subjectType = null val builder = SubjectBuilder().createBuilder(subjectDto) assertFalse(builder.value.toString().contains(expression.toString())) }
0
241ab0e515a726c7c73af40e223a65de
d6aef113a00e8ef86a8d6aef4b337733
存储圆半径的方法
public class CircleAssetView extends View public void setRadius(float mRadius) { this.mRadius = mRadius; invalidate(); }
1
7e15166a9b6af4fb1b1a22e6c386fee3
d98cd8e49771159168f32e376f07e858
最后一个跟整体是不是有干涉
bool exist_isolation(ll i, vector<vector<ll>> &A) { for(ll j=0; j<W; j++) { bool is_iso = true; for(ll nxt=0; nxt<4; nxt++) { ll ni = i+vy[nxt]; ll nj = j+vx[nxt]; if (!is_inside(ni, nj)) continue; if (A[ni][nj] == A[i][j]) { is_iso = f...
0
5cf6b6513faa9e58af56a2a95fe85a4a
c8bfc51d0c0931f87af28c293c1f2b44
将form 表单中的数组改为“,” 分隔的数据
class Goods extends ActiveRecord public function arrTostr($att) { $value = $this[$att]; if (is_array($value)) { $value = implode(',', array_filter($value)); } $this[$att] = $value; return true; }
1
696b6660ae80dcef4bf18df2c7d36a2b
65105a933aa5012ce8a1b32b33e7598b
Onclick info tab, show content.
productsInfoPanel.setVisible(true); riskInfoPanel.setVisible(false); enterpriseInfoPanel.setVisible(false); bailInfoPanel.setVisible(false); otherInfoPanel.setVisible(false); productsInfoTabLink.add(AttributeModifier.replace("class", "current")); riskInfoTabLink.add(AttributeModifier.replace("class", ""))...
1
bba3934ac6dc3dd4f7e16fd924dab954
0b2887d03b3b98e69daae3965e5e5ded
The function cuts sentences into separated words
def WordTokener(sent): wordsInStr= nltk.word_tokenize(sent) return wordsInStr
1
de1b789da1d7434a389a35a4d6aa97c4
2e9abc309a350027f25a8a25be950398
создание блока с вопросом
self.__question_text = Text( self.__window, width = 50, height = 10, font = ("Arial", 15), bg = main_color, fg = "white", bd = 0 ) self.__canvas.create_window(720, 230, window = self.__question_text, tag = "question")
1
b2fce0a42821ac5d2888c1f9fb43b862
5e52b0760703364920cc43698d6459f9
cacheSize is a function used to expirementally obtain an estimate of the size of the cache.
func TestCacheCapacity(t *testing.T) { t.Parallel() cache, _ := New(context.Background(), Config{ Shards: 8, LifeWindow: time.Second, MaxEntriesInWindow: 1, MaxEntrySize: 256, }) keys := 1337 for i := 0; i < keys; i++ { cache.Set(fmt.Sprintf("key%d", i), []byte("value")) } ass...
0
7e4cb8959f8697914f6539f36f1e7bb4
b4945c750d19f70e28ea3cbe304b6592
Obtiene una lista de tesis relacionadas con un subtema o sinónimo determinado.
namespace GacetaSjf.Model public class TemasModel public ObservableCollection<Temas> GetTemas(int esOrdenamiento) { ObservableCollection<Temas> listaTemas = new ObservableCollection<Temas>(); OleDbConnection connection = new OleDbConnection(connectionString); OleDbCommand...
0
fa7ba6befcaab8e6a81467203e720963
50fcc52d9ec3baf007ba703f77181cbe
Destructor - destroy a #raptor_uri object
static void rids_destroy(rids *r) { bat_destroy(r->data); _DELETE(r); }
0
2a14006ca83e9da6535df2a552b3f141
d9d25fe53338b9ee09fc36d898677c18
compute log-probability of given example
a = 0 b = y[1] for i = 1, classes do a = a + torch.exp(torch.dot(model.w[i],x)) end return (torch.log(a/(torch.exp(torch.dot(model.w[b],x))))) + r:l(model.w) end
1
de4f39feca1b30251760fbd3e9c151c3
2b9aae50d7fcf0d1d24892e35e3993cf
Creating test to assess what happens when nonexistent category is passed to endpoint
public void GetNonExistant() { using (RESTClient restClient = new RESTClient(BaseUrl)) { List<KeyValuePair<string, string>> routeParams = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("CategoryId", "1...
1
6972d4ff6db589e92eb527f33b5a6832
107f5a47f615d335819e0460d4ae5a35
First we will check if an environment argument was passed via console arguments and if it was that automatically overrides as the environment. Otherwise, we will check the environment as a "web" request like a typical HTTP request.
class EnvironmentDetector implements EnvironmentContract public function detect(Closure $callback, ?array $consoleArgs = null) { if ($consoleArgs !== null) { return $this->detectConsoleEnvironment($callback, $consoleArgs, static function ($v) { return \strpos($v, '--env') === 0 |...
1
2decff17b21153f2806ef9a7af9539a7
f8175efda2adf48cc4cdb0f73f14c4f5
Sets updater of referenced attribute
class ForeignKey extends AbstractAsset implements ConstraintInterface public function setOnUpdate($onUpdate) { $this->onUpdate = $onUpdate; }
1
b2f3b3b02096062391cd12c7c7bd97be
1ee14a1c19bece327ea1b787074e7ebb
Prepare the needed data for Favorite widget and forward them to favorites.ftl
postElement.forEach((el, index) => { const favoriteButton = createFavoriteButton(index) el.appendChild(favoriteButton) }) }
0
5f42aed66bed28a11e5fc4d6418f96a7
ecbabd3389a887d01fa01e111a764eef
Ajoute le champ supplémentaires du contact en fonction du type
class ContactType extends AbstractType public function buildForm(FormBuilderInterface $builder, array $options) { $builder ->add('firstname', null, array('required' => false)) ->add('lastname', null, array('required' => false)) ->add('email') -...
0
03bd33983832582ed9f274699901988a
205e03c607f94657ec7d23ba63f75167
根据文件名,从origin_data中的name文件夹下拷贝img_num张图片到save_data文件夹下
number = 1 print u'find ', name, u'total ', len(images), u'pictures' for image_url in images: split_path = image_url.split('.') ftail = split_path.pop() if len(ftail) > 3: ftail = "jpg" file_name = name + "/" + str(number) + "." + f...
0
a0d813ce94b0d946369ce1f55023486c
3ea205e07f9db2036d91c8ec52517f76
서버와 연결 끊기 요청하기
function windowsServerDisconnect() { postMessage({type: "disconnect"}); }
1
c95c47fe8340d41bffb2fcc883b2beab
3b16373a8e80cd9518cbb4a2692b7f5d
Creates a new book in the database, leads to subject creation sequence
namespace Sheep.ServiceInterface.Subjects public class CreateSubjectService : ChangeSubjectService public async Task<object> Post(SubjectCreate request) { if (!IsAuthenticated) { throw HttpError.Unauthorized(Resources.LoginRequired); } var exis...
0
77ed7fcee69d2f466686b72d8261daf6
64ef2e7b194a9af309e6a9bcfd11f5d7
获取客服电话信息的URL.
namespace HotelVp.CMS.Domain.ServiceAdapter public class JsonRequestURLBuilder public static string queryHotelServiceTel() { string url = lmApiUrl + GetUrlFromXml("SearchServiceTelUrl"); return string.Format(url); }
1
b3ddef32b20b3ae531b87355e2ee266e
321cddb7aec4d5630786837255731584
Add two players to game engine.
void GamePlay::addPlayers(char * player1, char * player2) { this->player1 = player1; this->player2 = player2; }
1
c746192efaca602b0c49acb0ed81de9b
1ccf67362fdefa40c41766faa4d68a31
Get the encryption properties for a container group.
@JsonFlatten @SkipParentValidation public class ContainerGroupInner extends Resource public ContainerGroupInner withEncryptionProperties(EncryptionProperties encryptionProperties) { this.encryptionProperties = encryptionProperties; return this; }
0
f5a8778e14c9491b879cbb607224a0b0
f36dbb3c8f9b950a71ece97a834aa850
Filters a sequence of values based on a <see cref="ISpecification{T}"/>.
namespace Specimen public static class ISpecificationLinqExtensions public static IEnumerable<T> Where<T>(this IEnumerable<T> source, ISpecification<T> spec) => source.Where(spec.IsSatisfiedBy);
1
92240345e97c0d4a261e9a65aa19c481
ad3d1f10d6492b746ce286a2b08067b4
The filter to apply to incoming messages. Only applies when the endpoint endpointUri is a receiver
namespace MsgPack.Rpc T GetFilter();
1
c50963e9840c6b58666082de8a9e2271
92b127e593a209fccaeae09faff961c2
Returns data for {@link DistributorTest::testEqualSeparatedAbbreviations()} test.
class DistributorTest extends TestCase public function getAbbreviationsArguments(): array { return $this->dataProvider->getAbbreviationsArguments(); }
1
94578acbdaf9a157f4e3ea33b7710ac4
ccdb0d863aca0b2cfa8449b89d75cd4a
Steps the updater through time
void UUIInProgressBuilding::Step( float t ) { cooldown.Time = Building->TimeBuilding; }
0
617a279a1b1a2ecb4e71d55936ad1ee3
a7b1c668d82ee393f1b71d3db9de0fd7
根据deptId获取医生列表
public ResponseData findDoctorInfo(Integer deptId) { DoctorInfomationRequest doctorInfomationRequest = new DoctorInfomationRequest(); doctorInfomationRequest.setDeptId(deptId); try { ResponseData responseData = publicService.query(ESBServiceCode.DOCTORINFOQUERY, doctorInfomationR...
1
d731ec17a27b3c4ece0347eb4c598f1d
41d2dbac42cae7c9565a34ec1927f0ab
! ! If FIXED_TIMESTEP is defined, the Main loop will use fixed timestep timing. i.e. Monocle::deltaTime will be the same every frame. ! ! If FIXED_TIMESTEP is not defined, dynamic timing will be used. Monocle::deltaTime will be different values every frame. ! However, Monocle::deltaTime will never be allowed to rise ab...
{ UpdateCoroutines(); uint32_t dt = _mainClock.GetElapsedTicks() - _lastFrameTime; _lastFrameTime = _mainClock.GetElapsedTicks(); _mainClock.lag += dt; if(_fixedTimeStep) { if (_mainClock.paused) { std::chrono::time_point<std::chrono::high_resolution_clock> tp1 = std::chrono::steady_clock::now...
1
adfa283342fcddb5dca8dfb3ad215919
2386a47162b8abcd09cb3c92b6b370e2
Scrolls to the given target vertically and horizontally.
{ windowScroller.scrollTop(windowScrollerTargetY + options.menuWindowScrollOffset); if (null !== actualScrollerTargetY) { actualScroller.scrollTop(actualScrollerTargetY); } }
1
a1407e8ba7c79a2dd14e871326745792
373665c02aa90495837a70693ddb8acd
Cap input values as to not exceed a normalized quantity
void MIDIPlayer::normalize() { if (sample > std::numeric_limits<int16_t>::max()) normalized_sample = std::numeric_limits<int16_t>::max(); else if (sample < std::numeric_limits<int16_t>::min()) normalized_sample = std::numeric_limits<int16_t>::min(); else normalized_sample = int16_t(sample); }
1
ff0897465ae573ab5c387689ef8cdea5
f0cbea6b3845a0e93cb297fdbcb093e3
Remove all bulk uploaded images longer than a day old.
for path_ in os.listdir(path): age = osp.getmtime() dt = datetime.now() - datetime.fromtimestamp(age) if dt.days > lifetime: upload_log.info( "Removing %s since it is %d days old", path_, dt.days) shutil.rmtree(path_)
1
4faf54d1c0c8e87a2af267ee425f468c
8464b52146efb6aa05375e6cbc61f75c
This method sets the local name.
class FileReaderResponse extends AsyncResponseStream public function setLocalName($localName){ $this->localName = $localName; }
1
f4c9fa00dadf5cbf0e5d70eb1b48118e
0527eb027d271a5895a4e8030e099fde
Converts the received int characters to actual text string.
{ NotEnoughResourcesMessage.SetActive(false); NoResourcesMessage.SetActive(false); NoPriceMessage.SetActive(false); int tryParseResult; if (int.TryParse(addedChar.ToString(), out tryParseResult)) { return addedChar; } else { ...
0
cf25eb14dde86023e6968a8da1afa7ce
b97cf93322f32d863cf72c9cdbefe754
停车计费处理
{ global $_W, $_GPC; if (empty($_GPC['param'])) { header('location: '.$this->createMobileUrl('tips',array('type'=>'x','title'=>'信息有误','msg'=>'对不起,您请求的地址不存在!'))); exit(); } $param = json_decode(authcode($_GPC['param'], 'DECODE', 'ParkPay'), true); $ded...
1
4c1127b9aa4d7875f86c3747ec4bb7bc
f926cb81a3aa129547e01e3be22f27dc
NOTE: false = EOF
class Parser: def check(self, tokenType: TokenType) -> bool: if self.isAtEnd(): return False return self.peek().type == tokenType
1
f9575fc556688e9bfa51e0de66391894
7b8e2b44de2b35d11419e55d8a798fa1
Starts all the components. Switches colors of RGB LED corresponding to the ADC conversion results. None None
{ uint8_t string1[]="APP ADC RGB"; static uint8_t ADC_was_init = FALSE; if(FALSE == ADC_was_init) { ADC0_single_ended_init(ADC_CLK_DIVIDER, ADC_CONVERTION_RESOLUTION , ADC_CLOCK_SOURCE, ADC_SAMPLES_AVERGAGED); ADC_was_init = TRUE; } LCD_nokia_goto_xy(0,0); LCD_nokia_send_string(&string1[0]); uint8_t adc_...
1
5eb003a3f883c52e490d7ee7f5b2c078
1f2c8d3ed67a0258d5f2cf8c39317104
Test the separator detection.
m = separator.Separator() self.assertTrue(m.delta('(')) self.assertTrue(m.is_final()) self.assertFalse(m.delta('(')) self.assertFalse(m.is_final()) self.assertEqual(m.lexeme, '(') m = separator.Separator() self.assertTrue(m.delta('(')) self.assertTrue(m.is_final()) self.assertFal...
1
69e2081ae5d53b641032bb435b931d4b
3858b742a145c9b25860266868362cfd
An event-handler, fired anytime an error is received via the connected serial port.
namespace BGBLE.BGAPI public class BGAPIConnection private void ErrorReceivedOnSerialPort(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e) { Console.WriteLine("!!!Serial Port Error!!!"); }
1
1f6782d123a1d83d85e8fc26737d2569
e33a582dfb6f1edcabd3f30cfd828215
Program main entry point.
def main():
1
b620f32d2428fd37116527470fb2a436
8e172dec938bf44ac80cdb1392f6db5d
设置水印图片在左上角
if (empty($this->logo)) { return $local_path; } $source_file = SIMPHP_ROOT . $local_path; $target_file = preg_replace('/\.jpg$/i', '', $source_file).'_wl'.File::ext($source_file); $tmpfile = ''; $ulogo = $this->logo; if (preg_match('/^http(s?):\/\//i', $ulogo)) { $ulogo = $tmpfile = File::get_remote...
0
f144e97e8359478ba909a6978ea15e0b
385c44ffa056881a94ff298e1770f972
Truncate the given table. This function will disable foreign keys before operate and enable them after the truncation
public class BaseDestDAO<T> public int truncateTable(String tableName) { return (Integer) sessionFactory2.getCurrentSession().createSQLQuery( "select truncate_table_func(:tableName)") .setString("tableName", tableName.toLowerCase()) .uniqueResult(); }
0
e68b61a9817e2865d446ac9c22cbb26b
4b96d1fc8a7de677fd5811be87a52c02
Removes all looped sounds
namespace GameSystem public class AudioSystem : SubSystem<AudioSystemSetting> public static void StopLooping() { for(int i = soundsLooping.Count - 1; i >= 0; --i) { var src = soundsLooping[i]; soundsLooping.Remove(src); src.Stop(); ...
1
832124d39aacc99aa154941fa0553cb0
b9fb46e1820a814d02b77b913d6c8f9e
修改用户收藏表单
class Collect_model extends MY_Model public function updateUsercollect($condition, array $data) { $this->db->update ( TBL_USERCOLLECT, $data, $condition ); $affected = $this->db->affected_rows (); return $affected; }
1
8cb3d665bf6e0eb654b845b741328175
239282041b8749aa33b0466fa297c5ca
@brief Ping to server and get IP
{ int ping_size; char *find, *ping_buf = (char *)malloc(512); FILE *fp; while(1) { fp = popen("ifconfig wlan0 || ifconfig eth0", "r"); if(fp == NULL) { anyka_print("[%s,%d]it fails to popen!\n", __func__, __LINE__); continue ; } ping_si...
0
35bb662afbf23d54a8128fc2f7e48ff5
6d0598d5ae3ef095f3fb1cd49ba69bec
GET: api/PostVideos
public ActionResult Index() { using(CMSEntities db = new CMSEntities()) { VideoViewModel model = new VideoViewModel(); model.Video = db.Videos.Where(p => p.published == true && p.featured == true).FirstOrDefault(); model.Videos = db...
0
cd4acc1ee9c0126cce3354debd8c6f05
1ee2c572d806f35101dc7d013b615d17
リーダー信号を送信する。
loop { let signal = self.sync.receiver.receive(); if signal.data == FINAL_RESULT { break; } } let round_lost: i32 = if self.sync.is_loser(self.number) { self.sync.current_round as i32 - 1 } else { -1 }; self.sync.senders.send_to(LEADER_...
1
57b11a14e36ffa41e479337e9e9e3cc8
208e9a2ce5ccd7efaa60f3a9e7750c54
Finds the max of a list of numbers and returns the value (not the index) If int_list is empty, returns None. If list is None, raises ValueError
def max_list_iter(int_list): if int_list == []: return None elif int_list is None: raise ValueError max_val = -1000000000000000000000 for i in range(len(int_list)): if type(int_list[i]) == list: for j in range(len(int_list[i])): if int_list[i][j] > max_val: ...
1
c849040f437cb4009c24ac33f19ad394
863779cf7d71681f75dfd651f802e1f7
функция возвращает все издательства в алфавитном порядке
class Publishings extends \yii\db\ActiveRecord public static function all() { return \yii\helpers\ArrayHelper::map(self::find()->orderBy('name')->all(),'id','name'); }
1
f49c1c5a16347e71c9745899273e728c
93bcb02c27bf7354e6c47680fb4d0b3f
Test that no loops where used in the exercise to recursively find the minimum of an array.
class RecursionQ1Test @Test void minIntNoLoopsTest() { checkIfBadStatementsWhereUsed("MinInt"); }
1
6709e24947ec8959c175e802848aaa8f
2c1aade01c958d3041725c31eee8fa11
Função criada somente para organizar o código e atribuir o valor para as variaveis declaradas no escopo da classe.
class MensagemClass{ public function __set($attr, $value){ $this->$attr = $value; }
1
3b1073d85b2cd37f4d132051c9196b0e
64683ba2ba98ba80372d9d671b5417a5
This function reads an array of bytes from the currently active UDP socket, while decrementing the remaining bytes available. UDPIsGetReady should be used before calling this function to specify the currently active socket.
namespace ssbl size_t Socket::Receive(uint8_t **ppData, size_t nBytesToRead) { return pImpl_->Receive(ppData, nBytesToRead); }
0
80730e8c67ceda35521ffbfd99e2d124
7b92174926cfa16752937b1f2ee700b7
Check if an fsspec file-system is local
def is_py_path_local(obj: object) -> bool: from py._path.local import LocalPath return isinstance(obj, LocalPath)
0
0d7466268b819a02c1735299dbbf2269
e2124de3054d4c44f95564bf90d11355
批量移除c集合的元素,第二个参数:是否采补集
default boolean removeAll(IntCollection c) { boolean b = false; IntIterator it = c.iterator(); while (it.hasNext()) b |= remove(it.nextInt()); return b; }
0
aa98a66ce1c1ec4143b87204ca25cc99
78707f852fb65d8d69a15ead686e3cb2
获取android系统版本号 例如:6.0.1
String str = m_ice.getConfigure("common","app_android_version"); return str == null || str.equals("") ? 0 : Integer.parseInt(m_ice.getConfigure("common", "app_android_version")); }
0
6ba19e479342b50cce2f0ee029ec20fa
394fdfb85109bce7cfc301d15bd9a363
Decorator that remembers the return value of a function call.
def call_once(func: Callable[..., int]) -> Callable[..., Any]: @wraps(func) def wrapper(*args: Any) -> Any: wrapper.result = getattr(wrapper, "result", None) if wrapper.result is None: wrapper.result = func(*args) return wrapper.result return wrapper
1
07455d6e3cb7327e73de5d7246deb8cc
4628672e1b7a50f9ca4c75764271e4e3
check that ordering of the fields doesn't affect equality
class TestLDAPAttributeSet(unittest.TestCase): def testEquality_True_Set_Ordering(self): a = attributeset.LDAPAttributeSet("k", ["b", "c", "d"]) b = attributeset.LDAPAttributeSet("k", ["b", "d", "c"]) self.assertEqual(a, b)
1
d8e003d82c5ad35d5d14f5599b0ed526
21fea6bc55a3d7991834a5331f414984
* 隐藏所有玩家准备标示
function GFlowerGameScene:hideAllPlayerStateUI() for i = 1, GFlowerConfig.CHAIR_COUNT do self.playerready[i]:setVisible(false) self.playerCallBg[i]:setVisible(false) self.playerCallAction[i]:setVisible(false) self.playerLook[i]:setVisible(false) self.playerLight[i]:setVisible...
1
c26ec820bea25d7d4490b12ef8c2ef27
dd783296a5743764ba3e130a8c91ce97
Paints the menu item's background when it's not selected and when it's not hot (i.e. the mouse isn't over it).
if (mouseDown) { PaintFlatDown(pevent, CheckState.Unchecked); } else if (mouseOver) { PaintFlatOver(pevent, CheckState.Unchecked); } else { PaintFlatUp(pevent, CheckState.Unchecked); } }
1
85a931aab3606dd91a74d54b5028c880
123a69db395ed343c5f932ce3e954ea6
Lists the user's Team Drives.
prepare_drives_request_res = prepare_drives_request(client, args) http_request_params = prepare_drives_request_res['http_request_params'] http_request_params['useDomainAdminAccess'] = 'true' if argToBoolean(args.get('use_domain_admin_access')) else 'false' http_request_params['fields'] = '*' url_suf...
1
1d9a985491c2b6c2b4844b73c3581aba
1eb9e9ca8a8e1d6e9212f2a99106f244
GetInt32Default returns a int32 or the default value for a given key in values.
func GetInt64(key string, def ...int64) (ret int64) { return tree.GetInt64(key, def...) }
0
6581ce1eba5daa9006d919ff70e3cb55
7e964d147d317637769f84e600de3296
Check if request already exists in canvasser
{ if (!is_int($shipmentID)) { throw new InvalidArgumentException("pickupRequestExists expects shipment id to be an integer. Input was: {$shipmentID}"); } return boolval($this->client->exists(static::pickupRequestPath($shipmentID))); }
1
4a8d3f8d24a79572856340f7be753e9a
2e506b1a2e8867269ceb71a8c32e9c1e
返回已发表文章数量
class Aritcle extends \yii\db\ActiveRecord public static function get_count() { return self::find()->where(['is_hidden' => 1])->count(); }
0
85275f40ef10c42be47fc834a18527b7
f6e3a37f9ff5dae9db71f7bced50aef3
The extra vertical space we have to add to clear the bottom of the menu label, in screen pixels.
namespace StardewEcon.View public class NewsBulletinMenu : IClickableMenu private class MenuDimensions private int DialogueUpperMargin() { return 16 * this.pixelZoom; }
0
7ca1fc0961feb1b96096336a2f046e0b
3569c6dc926888cc1ffae2ded2c8142c
remove all vehicle parking bookings from the table
var myUrl = "http://localhost:8080/bookings/"; $.ajax({ type: "DELETE", dataType: "text", url: myUrl, success: function(data) { $("#resBooking").html(data); }, error: function(res) { alert("ERROR " + res.statusText); } }); }
0
b1e4c3b56d0dfa74c342107db436a25d
3fb425e461b119dd1c52983dad8fdc82
横屏下,显示菜单布局,且5s后自动隐藏
new Handler().postDelayed(new Runnable() { public void run() { finish(); Intent intent = new Intent(); String actionString = getIntent().getAction(); if (Intent.ACTION_VIEW.equals(actionString)) { intent.setAction(actionString); intent.setData(getIntent().getData()); } intent.setC...
0
67dbeed09feee861cf4c1bac7b0e1e9f
7f4cc4e30e3b942f5e0529fd9ea1403e
Inspect the data members of an object of class GRootDCNavigator.
std::cout << " - m_root_data_path: " << m_root_data_path << std::endl; std::cout << " - m_data_list : " << m_data_list << std::endl; std::cout << " - m_out_dir : " << m_out_dir << std::endl; std::cout << " - m_image_list.size() : " << m_image_list.size() << std::endl; }
1
40af938610560997a045152ce7fcbf20
47840ef5250ac72ab9dd27b63a854777
番組選択用のチェックボックスをパネルに追加
selected = self.GetParent().target_web_panel.get_selected_col() categories = self.category_dict[selected].keys() categories = list(categories) self.category_chkbox = wx.CheckListBox( self, wx.ID_ANY, name='categories', choices=categories, style=wx.RA_VERTICAL, siz...
1
809986175d661ed361a8445daa206fb9
18791a1e9b4a9f8881c36c67370e8e5f
运动员导入按钮
function entrance(data) { let entrance = ''; data.map((group) => { entrance += `<li>${group.initial}</li>` }); dom.entrance.find('ul').append(entrance) }
0
6706d798047aa2bc95a00eb025ea24d9
44572104879b95c1b2e6c3f11d2ddd16
Initialization of the death rates vector
def load_death_rates(): g.death_rates = fetch_death_rates()
1
3be9361468b53833c09df713ce4b9507
8ddd831d5486e3c557960e46802569d2
Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack.
namespace ILGeneratorExtensions [PublicAPI] public static partial class ArithmeticOperations [PublicAPI] public static ILGenerator AddWithOverflowCheck(this ILGenerator generator) => generator.FluentEmit(OpCodes.Add_Ovf);
1