query_id
string
corpus_id
string
query
string
code
string
label
int64
8d1dfa8530f367443df43359408e7a4c
b5f727dbe694c6f6ff56c51f4accf850
~~~~~~~~~ 批量删除友情链接 ~~~~~~~
class IndexController extends BaseController public function actionBatchDel(){ Yii::$app->response->format = Response::FORMAT_JSON; try{ if(!Yii::$app->request->isAjax) throw new MethodNotAllowedHttpException('请求方式不被允许。'); $ids = Yii::$app->request->post('data'); ...
1
d065e955e8b14f588f6612d5b1026c7a
d2c738ca03b89bd6116ff37cf71a806b
sort the recurring candle by descending & get the most recurring candle
def sort_one_candle_peaks(peak_df, invert=True): assert isinstance(peak_df, pd.DataFrame) assert peak_df.index.name is None df = peak_df.copy() df['sn'] = range(len(df)) for row in df[df.index.duplicated()].itertuples(): try: if df.type.iloc[row.sn] != df.type.iloc[row.sn + 1] ...
0
5dded7b999cd43d07dc122a403e9bac8
aeefe32959f739d2a642a9bd1e713105
重启android设备
os.system("adb reboot") while True: serial_list = [d.serial for d in adbutils.adb.device_list()] if serial_list: break time.sleep(1)
1
597395d28a77181cafe6e72f0339ce62
057406a436a00f01c01ee03928fd4e17
Kollar om man är på samma position som en nyckel.
namespace KnightTour class Position public bool comparePosition(Position other) { return (this.x == other.x && this.y == other.y); }
1
219b9984b919829568b8d306a94d689e
58e06ee1adc4d558a937ca17db937637
角度 --> 弧度
angle(start: any, end: any) { let _X = end.X - start.X, _Y = end.Y - start.Y return 360 * Math.atan(_Y / _X) / (2 * Math.PI); }
0
65054ad8c715b2f2acf8e68c0f36e67e
45b7c9e8a7f2c086135c4a50b3a4d2ef
Load a page of data into the Data buffer for reading data
{ if (MoveToPosition(-m_iBufferSize)) { if (Seek(m_iTopOfPagePos)) { return ReadPage(); } } return false; }
1
64dce3071e128c2f260a468726bba33f
9275ca5af5aba30afae7fc6a19c9d4ee
Updates the I_xx value when it changes
namespace Nucleus.WPF public partial class XtoZZControl : LabelledControl public void RaiseXValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { PropertyChangedCallback handler = XValueChanged; if (handler != null) handler(d, e); }
0
068f826f01ff6f0462651c69001b668e
58ec170e6aff7efb6bedfdf4c1fa94ac
Declines a job offer.
class AutomatchCommunicator(): def _decline_offer(self, pname, msg): self.manager.decline_offer(pname, msg['matchid'])
1
46dff0f2a6397696425848b7515c2497
21a4d986ce789413482aa4c52aac4082
Pre-Process the data prior a delete operation.
namespace Consultation.Bus [Serializable] public partial class B_ExaminationNote : BusinessBase<B_ExaminationNote> partial void OnDeletePre(DataPortalHookArgs args);
1
258fac4d9d8b68fe411621729a6f1066
275fbeacbc29e5d4a68dd3abca378b76
计算掉落池掉出来的物品列表
abstract class World public function getDropsPool(): array { $drops = []; foreach ($this->config('item.drop') as $sprite_name => $count) { $loop = min($this->config('drop.count.' . $sprite_name, $count), 63); for ($i = 0; $i < $loop; ++$i) { $drops[] = Sprite:...
1
a8994ee4bc4326bb21d8b8c6fa841f76
6af1310ee98899dd51c7692267647137
The ID of the selection bet on.
public class CriteriaBetTypeEvent public String getIdBetType() { return idBetType; }
1
4b4508bfb6969cd58d4cdd55bc522475
8f8dc95c70ed65dc378564e93f39414b
Creates a list of tags matching the passed filter.
namespace Frapid.WebsiteBuilder.DataAccess IEnumerable<Frapid.WebsiteBuilder.Entities.TagView> GetFiltered(long pageNumber, string filterName);
1
490d135bd4af991ae7532a9e69928e9a
d03c8ec6261a5d94bc4141ca825473eb
通过address查找FolderManifest
function resolveByFedAddress(address){ return StellarSdk.FederationServer.resolve(address) }
0
ed6bb9a21c328df3d327a5016ac5759d
5d3c24344f879e6ca3d2d0e42452bb99
获取用户密码时解码
class Member_model extends CI_Model public function get_decode($code) { $code = str_replace(' ', '+', $code); $this->encrypt->set_cipher(MCRYPT_BLOWFISH); return $this->encrypt->decode($code); }
1
6f22ef76b30b9c9575e98242d4d7488c
f3edc7f6f1eb6916ab992d243f350586
コンボボックスにEnterが入力されたら、確定させる
namespace KyoeiSystem.Application.Windows.Views public partial class MST34010 : WindowMasterMainteBase private void UcLabelTextBox_PreviewKeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { Update(); } }
0
bf9812126911bdfa297535dca215f157
8f8a9abd7d27ba62f429d711c9f16624
根据vipNo删除购物车所有数据
return new Promise((resolve,reject)=>{ dbpool.connect("delete from shop_cart where shop_ID=?", [params],(err,data)=>{ if (!err){ resolve(data); } else { reject(data); } ...
0
516b95105bbd4818013fdb94a1ecf74e
a55888331b0bd1543a8943231c19ce13
无线频段测试:5G
class TestSSID(unittest.TestCase): def test_230_set_ssid_band_5G(self): log.debug("230") tmp = SSIDBusiness(self.driver) tmp.change_AP_Freq("5GHz") result = tmp.check_ssid_band(data_basic['DUT_ip'],data_login["all"],data_basic['sshUser'],1,5) result1 = tmp.ssh_iwconfig_ath_Fre(da...
1
ce0a9762aab35a9b1d47c967f4653a57
e39551794e7b6bd07d23618291f561c1
Wrapper for wp_dropdown_categories to easily add new dropdowns.
function mf_generate_dropdown( $tax, $selected ) { wp_dropdown_categories( array( 'show_option_all' => ( $tax == 'post_tag' ) ? 'Tag' : ucwords( $tax ), 'taxonomy' => $tax, 'orderby' => 'name', 'selected' => $selected, 'hierarchical' => true, 'hide_empty' => false, 'name' => ...
1
e4345bdceffaa3bb69ea687eecef2dc3
22afaeba21901a26e596ca4cf1789884
Fetch file segment asynchronously.
{ return GetStreamAsync (index, offset, count, false, cancellationToken, progress).GetAwaiter ().GetResult (); }
1
a1f19a2213c7487b837a799d371989bd
a645de7ea33b611d74283183a001ea2d
# Nitrogen Flux from Microbial SOM to Passive SOM
internal_fluxes[["N_fw->N_slo"]] = function( C_am ,N_am ,C_as ,N_as ,C_bm ,N_bm ,C_bs ,N_bs ,C_fw ,N_fw ,C_acw ,N_acw ,C_bcw ,N_bcw ,C_srfmic ,N_srfmic ,C_mic ,N_mic ,C_slo ,N_slo ,C_pas ,N_pas ,N_ino ,t ) { c_cont = C_fw n_cont = N_fw cn_rat_new <- rneww1_2(c_cont ...
0
5dd493e5c7328da1fd8658684a434c40
b6fce02f248b68e5d0d0d490b528641b
Meldet, ob es sich bei einer Tabelle um eine <i>PREMIERE Content Information Table</i> handelt.
public boolean isICS();
0
d23916cb6f744bf199146f80f2caf0e9
6897ad439197c8ab307543489efc93c6
从链表中删除并返回头结点的游标
{ Position head = GetHead(plist); Position p=head->next; if(p!=NULL) { if(p==GetTail(plist)) plist->tail = p->previous; head->next = p->next; head->next->previous = head; plist->size--; } return p; }
0
ef73874f8884f730d27d0040f5e9fc5b
7a99b41b271c6078bf4a70e2eec1d0df
Sets the error information object for the current logical thread of execution.
public class Procattr public static native void errfnSet(long attr, long pool, Object o);
1
3f9f7e85c0094c7e6c3ef44444ff2afe
480ec30be91114605da28ffa903d4e7c
Removes sequences from the marker gene files at the level from species, genus, family etc.
for file in os.listdir(filepath): filename, ext = os.path.splitext(file) if sequence in filename: filename = filename.replace(sequence, "") new_filename = filename + ext os.rename(os.path.join(filepath, file), os.path.join(filepath, new_filename))
1
f6f893d3114abb305d3c55085ffee9e2
05b27d459449c02af05d9278d295bb24
Teste default, onde o número de elementos deve ser o mesmo que o número de componentes
rng = np.random.RandomState(0) n, p = 100, 5 X = rng.randn(n, p) * .1 tga = TGA().fit(X) assert_equal(tga.components_.shape[0], 5)
1
9d48fb37863f2badcb313cf054f7bb66
130f7fd6b4d1c949fe9412d309eb49fb
GET_MAIL_NO_PROCESS
switch ($mode) { case 'pc': $updColumn = 'f_pc_mail_ok_flg'; $condColumn = 'f_pc_mail'; break; case 'mb': $updColumn = 'f_mb_mail_ok_flg'; $condColumn = 'f_mb_mail'; break; default: } $db = array(); $commonSqlPart = "" . "FROM " . " tbl_member m " . "WHERE " . "...
0
7d62a9e71c2255cbb27937ecab5f11ad
90e1bb4cfd854027a96016a8c0213628
Adds a new bone in the hierarchy of the given control rig asset
{ if (bone == null) { return false; } if (bone._meshGroup != _meshGroup) { return false; } int boneID = bone._uniqueID; if (!_childBoneIDs.Contains(boneID)) { _childBoneIDs.Add(boneID); } if (!_childBones.Contains(bone)) { _childBones.Add(bone); } bone._parent...
1
6b574ccb982c3644adb97a4a10d04cca
0d41195a4fa98a15b415da5f228c61a8
Load the migrations manager and inject the config
class MigrationManager public function __construct(Config $config) { $this->config = $config; }
1
076f77b605ec930a6d65b7f57760a0a9
d77e8a2151dabc3155601ca268f2d67b
Returns a new object of class '<em>Project Repository</em>'. <!-- begin-user-doc --> <!-- end-user-doc -->
Project createProject();
0
9302bf713a153d470286ed3846f2fcb6
9fe5ddf8495df695c93550ef5a88937c
该函数求解距离,函数体内自带角度获取,需要传入Imagprogress函数处理过的data
function calc_trajectory_progress(data) local ret_value = check_progress_dict(data.x,data.y) if ret_value ~= nil then return ret_value end if tolerance_check > 1 then local z1 = 1 while (z1 < tolerance_check) do ret_value = check_progress_dict(data.x,d...
0
953bcca7448e7d79510637810c696765
692bb20f59fe2ad9b4397b812c9b06cb
Method handeling the press event on a keypad button
public void keyPressed(KeyEvent e) { if (e.getKeyCode() == KeyEvent.VK_1) { controller.getButtons()[0].doClick(0); }else if (e.getKeyCode() == KeyEvent.VK_2) { controller.getButtons()[1].doClick(0); }else if (e.getKeyCode() == KeyEvent.VK_3) { controller.getButtons()[2].doClick(0); }else if (e.getKeyC...
1
290e10199e15bae12cec88d4c3af1fed
aa75d3513897a86be1cfd5978d1c5d66
Extract youtube url from item of search result
query = urllib.parse.quote(title) url = "https://www.youtube.com/results?search_query=" + query response = urllib.request.urlopen(url) html = response.read().decode("utf-8") m = re.search('watchEndpoint":{"videoId":"([\d|\w|-]+)', html) if not m: print("Couldn...
1
0c7a9bf2330c7fbc9b45d44173a98a9b
408244888df6427eec26792f4690f645
如果Bean实现了BeanNameAware接口的话,Spring将Bean的Id传递给setBeanName()方法
@Service //@SuppressFBWarnings(value = { "BC_UNCONFIRMED_CAST_OF_RETURN_VALUE" }) public abstract class BeanAware implements BeanNameAware @Override public void setBeanName(final String beanName) { this.beanName = beanName; }
1
eb98b165bc89ec1916844114c3020131
90a4505405abba3b07bc4ff925fe3f4c
Gets the "feet" element
public class CharacterInfo public double getNumFeet() { return numFeet; }
1
f46d983e82f5809f58ddb15feff8132a
490c293dfbf88694e333bf2c8a4a67dd
Creates grid and sets all pieces in their homes
for (let row = 0; row < 8; row++) { for (let column = 0; column < 8; column++) { if ((row === 0 || row === 2) && column % 2 === 1) { this.grid[row][column] = new CheckerPiece("b"); } else if (row === 1 && column % 2 === 0) { this.grid[row][column] = new CheckerPiece("b"); ...
1
2b82040227950670cd202fd97ed41429
fceca6581eb3f04f8f8645e39e113e1e
Check if a stair exists between the two cells
public class PassageMap public boolean hasPathBetween(int x1, int y1, int z1, int x2, int y2, int z2) { if (!localMap.inMap(x1, y1, z1)) return false; if (!localMap.inMap(x2, y2, z2)) return false; if (passage.getValue(x1, y1, z1) != PASSABLE) return false; if (passage.getValue(x2, y2, ...
1
d8d63c4d27437959f92585766014527e
5bf3876ab7d9d1fdabf1e197880e697f
Copy metadata (=DICOM Tags) from one image to another
source_image_annotations = WholeImageAnnotation.objects.filter(annotation_set=annotation_set_id, image=source_image_id) destination_image_annotations = WholeImageAnnotation.objects.filter(annotation_set=annotation_set_id, ...
0
1afcac65e8d48d1960f6265e18d15e98
d953bfb7fbff82a1543b773fdddc7618
First method that deals with handling requests, this one is for dealing with multiple clients trying to make requests at the same time.
listen_socket = self.listen_socket while True: self.client_connection, client_address = listen_socket.accept() self.handle_one_request()
1
e5d996fae947dd535ac84d69c9d5872c
74c5e40f1a33da5037517398b175fd55
Check if value is nil (null or undefined).
isEmpty (value) { return value == null }
0
4aded85a4e08eab1a35b3326b95768c1
2bfb4f27fcc83f3af7f1c0b0d645fa56
爬取一天数据实现(子类必需实现的方法)
class GrabHuangjia(GrabBase): def fetch_get(self,date): print("爬取一天记录数据:%s" % date) records = None url = "%sxyft/kaijiang?date=%s&_=%d" % (self.domain, date, int(time.time() * 1000)) _headers = copy.deepcopy(self.ajax_headers) _headers['Referer'] = 'https://www.1396r.com/xyft/kai...
1
f89c7bb69b2553a14a65584b1c2b64d3
9914c421cca8e3908128f1913e352666
Github 监控任务
func init() { hydra.OnReady(func() { once.Do(func() { hydra.S.CRON("/task/scan", services.Scan) hydra.S.CRON("/task/clear", services.Clear()) hydra.CRON.Add(fmt.Sprintf("@every %ds", conf.ScanInterval), "/task/scan") hydra.CRON.Add("@daily", "/task/clear") }) }) }
0
2d8c0eed7c102657e9293ddddda16468
e5e1e6f74c65972cd318366b3385446e
获取搜图模式状态
function GetSpiderOpMode() return GetGlobalString(SpiderModConst.OpModeVarName) end
1
c75af6b164334dbd9203412fc3ea0c9b
540bad8214a004f84aa0e792c04b4882
Hauptnavigation innerhalb des Programms (rückwärts)
global menuButton1, menuButton2, menuButton3, tkinterFenster, selectionMarker, selection, menuListMoves, menuListSpecial canvasTextfeld.delete("all") menuListMoves = Button(tkinterFenster, text="Moves", bg="#fff", bd=0, fg="#000", font=("Press Start 2P",...
0
597f24e1de297a2dfaf82a78324a6b79
15782c572b3eacda8a26c0df2ebcd5c3
Get the 'Offer_Id' element value.
class Claim public function getOfferId() { return $this->offerId; }
1
d3c26915a61d7822a3f01b4d6c9e1fe5
daac96d9a2b7c447ca5fa96d230d711f
Toggles subscription to fanclub news
class User def toggle_subscription! self.unsubscribed = !unsubscribed save end
1
00ceb00014521fbed133ee86e7bc5a25
8b8be016383203eefb7bf44aba13348e
Функция отправки email-сообщения: Обратный звонок
{ $mail = new MailAssistant($view,$request->all(),'Интернет-магазин Tree&Toys','Интернет-магазин Tree&Toys - обратный звонок'); $res = $mail->send(config('setting.mail-toy')); return true; }
1
d9167b7f54fe47b56aa6adcdd074d38f
8f26ee64bf08d089a3dcf519579cc2ac
Creates a list of Shape objects from the selection.
namespace DPPaint public sealed partial class MainPage : Page, ICanvasPage private void ShapeList_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { foreach (var added in e.AddedItems) { int index = ShapeList.Items.IndexOf(added); if (ind...
0
96d71e3a9f61b2b7e8d23def5a6a5450
efd7862fc39f3196e9219207946a7afa
The YARN endpoint address used by this endpoint.
class BasicEndpointGroupArgs: def endpoint_address(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "endpoint_address")
1
5640c1691899d9a5a36e7e33dc274ca4
ba1dbd30645a8df7348301417ca07fff
Надо ли скрывать подписки
class Professio_BudgetMailer_Block_Subscribe_Mini extends Mage_Core_Block_Template public function isSignupHidden() { return Professio_BudgetMailer_Model_Config_Source_Account::HIDDENCHECKED == Mage::helper('budgetmailer/config')->getAdvancedCreateAccount(); }
1
77af01b2420b00afd5675f4b17526e10
ca7f80ce9c207f4669dd5fa98b6e3871
Implements in-place TOS = TOS1 / TOS.
SC_FUNC void os_div(void) { stgwrite("\tsdiv.alt\n"); code_idx+=opcodes(1); }
0
3b649f03b39c2afd36b975916ff33cdb
ea9f234734a48dc96c4a3bdc072a0d85
visual test for synthetic graph generation
int main(void) { int ctr = 0; binary_dag g; unbounded_dag_generator ugen; ugen.reset(3); ctr = 0; while (ugen.next_dag(g)) { if (++ctr > 10) { break; } to_dot(g, std::cout); } ugen.reset(4); ctr = 0; while (ugen.next_dag(g)) { if (++ctr...
1
b1165b64a5160ba25bf574c473f06637
5c8df73c4ff6c3fbdfd1a6fcd5921bed
GET: api/Candidate
{ var candidates = Context.Candidates .Include(obj => obj.Email) .Include(obj => obj.Phone) .AsNoTracking(); var candidate = await (from a in candidates select new { ...
1
aaa97e0047510e3db22cb28442c4093f
14bc4b957bd07075ca877a6a9fe95d95
Test that setting an attribute that doesn't exists fails.
with mock.patch("bluebottle.clients.middleware.settings", Mock(spec_set=[])): p = TenantProperties() with self.assertRaises(AttributeError): p.foo == 1 self.failIf(hasattr(p, 'foo'))
1
f600720f58f23a599c39db7800eee187
92f6a254ebdf4c8c5f83d0e94a11dc09
创建一个任务,它在指定的 <see cref="T:System.IAsyncResult" /> 完成时执行一个结束方法函数。
{ var tcs = new TaskCompletionSource<TResult>(); beginMethod(arg0, arg1, Callback(endMethod, tcs), null); return tcs.Task; }
1
ecab305088581d382ca7b90100432673
80b94af6f1646afc0e431d74778d0791
获取当前Activity屏幕方向,true竖屏,false横屏
Configuration mConfiguration = context.getResources().getConfiguration(); int ori = mConfiguration.orientation ; if(ori == mConfiguration.ORIENTATION_LANDSCAPE){ return true; }else if(ori == mConfiguration.ORIENTATION_PORTRAIT){ return false; } r...
0
c927fbee7ecc19c6a5b1aec52e14e9cf
c63edc0670d8404aebe22ac4ce53edf1
更新电梯的经纬度
$lng = $this->request->post('lng'); $lat = $this->request->post('lat'); $data['lon'] = $lng; $data['lat'] = $lat; $res = Db::name('runmen')->where('id',$this->rid)->update($data); if($res === false){ $this->error('更新失败'); }else{ $this->succ...
1
edf3903e0e46e666c5e469cb13db42ed
79f438cddbafaf8f5b76babc1e552a8f
Fitness calculator for the TWS GP.
super(TWSFitnessCalculator, self).__init__() self._features_extractor = features_extractor self._classifier = classifier self._training_docs = training_documents self._chunk_size = len(self._training_docs) / self.k_fold self.logger = ProjectParams.logger
1
c3b8d69f97a829f84091ae9745e23b8a
6e55d46c6af3c99dd7516bfe9719a2ab
Finds novel transcripts, builds their attributes
self.query_transcript = query_transcript self.n_edges = len(query_transcript.exons) + len(query_transcript.introns) self.edge_matches = [[] for i in range(self.n_edges)] self.transcript_matches = [] self.full_matches = [] self.partial_matches = []
0
37a6df5f9f2794d903f0fe9d2ce8a7c2
01bcb2ae7f054d136e5b024ff00c9096
@brief Deletes the address associated with your current Tox ID.
{ try { $response = $this->http_client->post('clean/address', [ 'headers' => [ 'Content-Type' => 'application/json', 'Authorization' => 'Token ' . static::TOKEN, 'X-Secret' => static::SECRET, ], ...
1
6fb4bfdfaacf113d09ed792abd2ee859
1dd4f88a1868f78f84e7c844162e03c6
Test ping between 2 PODs
static void kernel_pingpong(void) { int outbox; struct message msg; msg.clusterid = clusterid; assert((outbox = mppa_open(RQUEUE_MASTER, O_WRONLY)) != -1); for (int k = 0; k <= (niterations + 1); k++) { uint64_t mask; mask = 1 << clusterid; assert(mppa_write(sync, &mask, sizeof(uint64_t)) != -1); assert(m...
1
6f8a448f98fb72253c604f56dbd8a4c3
d09d296a84675b088fb0b099733c2c3b
Uploads the package from the temporary directory to a repository.
class RsyncReleaser(Releaser): def process_packages(self, temp_dir): pass
0
4b027d6836f38ce0b455a88a9491962f
3dc141ffadfdebd44fc72387dc5f4737
返回链表中某个键的索引,类似于index()方法
class SingleLinkedList(object): def getIndex(self,data): if self.isEmpty(): raise Exception("out of range") node = self.head num = -1 while node.p_next: node = node.p_next num+=1 if node.data==data: return num
1
103b944e8ea7dd2a84afc3bc07ebd76a
a0aa4e2151e3686e7b9682c8fd7abb8a
Текущее состояние клеточного автомата.
public CellState getCurrState();
1
c5c52920c416fcb6b987541e841ced49
84c607b536d28c807d555f8f030b8eeb
This method generates the call of a method Example : $this->methodName($args)
public function makeCall($receiver, $caller);
0
f1c9c282c7383c4c37ff49bc21ac2d7e
a29132dbaf7a7792f9351ae1a83d0385
Creates a new Grade model. If creation is successful, the browser will be redirected to the 'view' page.
class ViewGradeController extends Controller public function create() { }
0
4b576b92644d72c215b29d6c58f464a3
6f83b00b055076dbdf2554cefa36f516
Provides the standard 0-input Object interface to the dF MATLAB function.
class UnaryFunction0DFloat: def __init__(self): pass
0
e805036b9a92f0143383c14d407a6ea4
e27df61ff70026f2793a662a505e3782
Valida el campo IdCuentaObservacionSubTipo.
{ var errores = new List<ErrorModel>(); if (this.ImpuestoCausadoEnElEjercicio != null) { errores = this.ValidarCampoFormulario25(this.ImpuestoCausadoEnElEjercicio, resx.ImpuestoCausadoEnElEjercicio, 0, 12); } return errores; }
0
7df541b003a4e799c8aea8f7ff37fb7d
e951cc2d210773723f9c71a4b70643c0
reads numbers from the text file called input_filename and inserts first quarter of elements into one queue and the rest into another queue using NEW INSERT. Then merges the two queues using EFFICIENT MERGE and calcualtes the time to perform all these operation and finally performs DeleteMin10.
{ std::ifstream inStream; inStream.open("students.txt"); if (!inStream) { std::cerr << "Cannot open file for reading\n"; return; } size_t minutes = 1; while (!inStream.eof()) { std::string name; size_t group; inStream >> name >> group; if(i...
0
2bda1587c6661af2e915c352b4e97459
50da0ecdeaf1d95ed40419c30c5efd2f
获取钱包账户(不存在则创建)
namespace Oldmansoft.ApplicationService.MoneyBag.Services public class TradeService private Domain.Wallet LoadWallet(IWalletRepository walletRepository, Guid id) { var wallet = walletRepository.Get(id); if (wallet == null) { wallet = Domain.Wallet.Create(i...
1
9cfce7d943a931840ee02da502b10af9
0b23fe2af75520d4e2752e3e9afeb8e0
Evalua el potencial de Lennard-Jones de forma analitica.
double V_LJ (double r){ double V=4.0*(1.0/pow(r,12)-1.0/pow(r,6)); return V; }
1
4857ccf33d9f15bd77b72cbc8b214626
eba4784910e7a5239a52747d2d5f21bf
Test adding multiple stereotype attributes
class StereotypesTestCase(TestCaseBase): def test_getting_stereotypes_unique(self): cls1 = self.factory.create(UML.Class) cls1.name = "Class" cls2 = self.factory.create(UML.Class) cls2.name = "Component" st1 = self.factory.create(UML.Stereotype) st1.name = "st1" s...
1
6b567b47d660974194d32e005f521032
4a3f69aadc78e2436605e8705a2dc839
Возвести число в указанную степень и вывести результат.
{ int m, n; int a; int div; printf("_\n"); printf("Основание: "); scanf("%d", &a); printf("Степень m: "); scanf("%d", &m); printf("Степень n: "); scanf("%d", &n); if(m<1 || n<1) { perror("Не натуральное число!"); return 0; } if(m>n) div=m-n; else { perror("Показатель меньше 0!"); return...
0
069590216e582293726b1d2802b09089
804a8174c7214d1a5e18e5499ad0a328
Este metodo verifica que se hayan seleccionado los comboBox de las categorias y partidas.
try{ if(yes&&cbJornadas.getSelectedIndex()!=0){ yes = false; rellenarPartidos(false); yes = true; } }catch (Exception e){ System.out.println("Parse exception"); } }
0
20d544cfd8430b0748164a8a5b66e042
660786d7c15a43d165ed07c5a8677351
<p> Gets last day of current year </p>
public class LocalDateTimeTool public static LocalDate getNextYearLastDay() { return LocalDate.now() .plus(1, YEARS) .with(temporal -> temporal.with(DAY_OF_YEAR, temporal.range(DAY_OF_YEAR).getMaximum())); }
0
95fcbd78af62d08b9777071230715f10
68b5f66119686e385f3e87222e445b17
25 max unique
class Twitter void postTweet(int userId, int tweetId) { map3[userId].push_back({ts++, tweetId}); if (map3[userId].size() > 10) map3[userId].erase(map3[userId].begin()); }
0
f008319b5388214e1c2431ecfc87d620
996c54d1bb57d138538c1c1fdca231b9
implements auto-complete for player names
class PlayerAutocomplete(TagAutocomplete): def __init__(self, name): super(PlayerAutocomplete, self).__init__( name, Copy.opponent_tag_placeholder) self.append_class(self.AUTOCOMPLETE_PLAYER_CLASS)
1
6478a7c1d80828c4359c3794f795ad30
a8faecb8af9142abed5328386c37672f
Creates a seatHold with the given SeatId and customer Email.
namespace TicketService.Contracts.Interfaces SeatHold FindAndHoldSeats(int numSeats, string customerEmail);
0
d983fcc2b12893d5475b22b87c7bbe52
3c50a25e97a8d1694fe41fd24d390b21
Returns the index of the clients login/session info if they are known. Returns -1 if they are unknown
namespace pot_sem2 [OperationContract] int ObtainClientIndex(String name);
1
f64f4d07bd4fed0e3b0ab44babe28faf
d754a8ae81f77b2e94303a2f76b3e255
Checks that <see cref="RepositoryBase{TContext, TData}.QueryAsync" /> correctly checks the parameters.
{ $repository = $this->getFullRepository(); $repositoryReference = $this->createRepositoryReference(); $this->await($repository->createIndex($repositoryReference, $this->createIndexUUID(), $this->createConfig())); $this->await($repository->addItems($repositoryReference, $this->create...
0
201297dc96363fc0873c24cd0b34b89c
9e01860f8989215d21cefb7960191fbc
returns the dockage amount due to foriegn material within the intake
float Ticket::calcForeignMaterialDockage() const { return (this->calcGrossBushels() * (grainPtr->getForeignMaterial() / 100)); }
1
8e89222881a37c96fd31c3e4bd13cb3c
b258d3db982da6eec4fba976dc7f4912
@brief Update unknown distance values to a default high number.
PUBLIC AUD_ERR_T aud_CodecCommonCalibUpdateValues(SND_ITF_T itf) { return HAL_ERR_NO; }
0
35db7f4cb18c81b5226961eb68135112
ef8fa95242cb3db6a5d2b28205184350
初始化body宽高
initWidthHeight () { var windowH = document.documentElement.clientHeight; var windowW = document.documentElement.clientWidth; if (windowH > 736) { windowH = 736; } else if (windowH < 568) { windowH = 568; } if (windo...
0
015ff5ae1f6d6d6ba67c80b417f8c07f
bfc7a38dad5be745a573b6098d6915d9
Executa todas as instruções, em ordem, assim como imprime na tela a descrição.
{ this.carregarEntrada(); this.processeEntrada(); System.out.println("Lista de Tokens: "); for(int i = 0; i < this.listaTokens.size(); i++) System.out.println(this.listaTokens.get(i).toString()); System.out.println("Programa encerrado."); }
1
49d4d6793611f1006dec723af419ce90
1335d12abd20701e936576e711f7a167
Get the names of the files that matched at least one of the include patterns, and matched none of the exclude patterns. The names are relative to the basedir.
class FileList public function getFileNames() : array { $file_names = []; foreach($this->fileNames as $f) { foreach($this->inclusiveFilters as $filter) if(!preg_match($filter, $f)) { continue 2; } foreach($this->exclusiveFilters as $filter) if(preg_match($filter, $f)) { continue 2; } ...
1
cc3537920cc1b6b2bc5d1316b75e3a4f
aa2984b6392ce3ba2061c501ec3df782
计算广义表的深度
{ int ldepth,rdepth; if(bt==NULL) return(0); else { ldepth=Depth(bt->lchild); rdepth=Depth(bt->rchild); if(ldepth>rdepth) return(ldepth+1); else return(rdepth+1); } }
0
7bc6c61a060827fcd0c097157e27a8c2
56e2da4b57ff94cfc1c27cc236ac5f69
更新指定接入策略的应用对象 该接口用于更新指定接入策略的应用对象。 Please refer to HUAWEI cloud API Explorer for details.
class Client extends BaseClient public function update(array $params) { return $this->httpPostJson('v1/file/ad/app/update', $params); }
1
d9d88e16739d3fc328b171d4ebe1e74a
e2dc3217a64abc810a1b894f36215a31
Returns client spark version.
@JsonFlatten public class BigDataPoolResourceInfoInner extends Resource public String sparkVersion() { return this.sparkVersion; }
1
15ffbdde8f425e6d3039595e65d13550
a3a44a78fd7959499a8c2b50c61a7486
添加新节点, 将新节点放到链表头部
class SingleLinkList: def add(self, new_elem): new_node = Node(new_elem) new_node.next, self.__head = self.__head, new_node
1
a9a404b31f51315c815105f24a5ef0e1
92508d81c9659739b4e36947800c6873
Provides information about segni
class MySeptimaSearchProvider(QtCore.QObject): def definition(self): return { 'singular': 'Kortforsyningen, lag', 'plural': 'Kortforsyningen, lag', 'iconURI': "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48IURPQ1RZUEUgc3ZnIFBVQkxJQyAiLS8vVzN...
0
73717b13c3697283c8100ac55c4a9df8
f4b5c4b05ebb4f57492be284dac9c8a7
Applies pixel tranformation to only a subset of all pixels. This was we don't need to iterate through the whole set.
public class AbstractColorTransform implements ColorTransform private void transformHelper(int[][][] image, int row, int col) { int[] value = new int[3]; for (int i = 0; i < transformationMatrix.length; i++) { value[i] = (int) ((image[row][col][0] * transformationMatrix[i][0]) + (image[row][col]...
0
00eff46c8e07d275862c85ba30314787
a041a420e1a673ed353ce098767f2e4c
@brief Returns true in case the input argument corresponds to a PAD BEL
return ((input[0] == '[') && (input[2] == ',') && (input[4] == ']') && (input[1] >= 49) && (input[1] <= 56) && (input[3] >= 49) && (input[3] <= 56)); }
0
32da6f0b285d482f043b9e4ace16b9c8
dc6ea38662708946541fafff404ebcb6
使用插值法算出某个工况点的效率插值总值
class TurboCalculation(object): def calculate_efficiency_sum(self, design_point): eff_sum = 0 a_len = len(self.base_point_list) - 1 b_len = len(self.base_point_list[0]) - 1 for x in range(0, a_len): for y in range(0, b_len): base_point_a = self.base_point_list...
1
f765f95a2f48aaa9c953795121d08ee1
d8a625ddf6a392574014fde13f69ae37
解码方法:JPEG->YUV
{ u_short Status, Temp,Quality; s_int JpegByteCount, RawByteCount; s_int i, LengthForSend, LengthForRecv; s_short Width, Height, Format; s_int RawLength, RawWidth ; s_short RetErr; MSG_FATAL("A8L_DecodeJpegViaFIFOBase",0,0,0); RetErr = A8L_GetJpegInfo( JpegBufferPtr, JpegLength, &Width, &Height, &Format ,&Quali...
1
ee0396bb3437839631817159f1199457
59c6fd5011683bb53927ea0e68ad37d1
pを中心とした指定範囲の座標を抽出する。
{ double minX = 0, minY = 0, maxX = 0, maxY = 0; GridHelper.getInstance().getMinXY(ref minX, ref minY); GridHelper.getInstance().getMaxXY(ref maxX, ref maxY); double minx = Math.Max(minX, source.X - distance); double miny = Math.Max(minY, source.Y - di...
1
7782ac350460347b804ee5c1fb325289
6c8c9f7a6a79c219f65443298596b478
Sets the instance of <see cref="IFailurePolicy"/> to <see cref="AbandonMessageFailurePolicy"/> for the message pump builder to use.
{ Contract.Ensures(Contract.Result<RetryPolicy>() != null); return () => { return (int retryCount, Exception exception, out TimeSpan retryInterval) => { retryInterval = TimeSpan.Zero; return false; ...
0
f264149d7f5fa5867c2cc1973fa1f0cd
569905b496cc373923cd89b337fd068f
Tests construction of multimaps passing initializer lists as parameters.
void test_init_many() { struct int_map b, c, d; int_map_init(&b); int_map_init(&c); int_map_init(&d); for (size_t i = 0; i < 100; i++) { int_map_set(&b, i, i); } for (size_t i = 0; i < 1000; i++) { int_map_set(&c, i, i + 1); } for (size_t i = 0; i < 10000; i++) { int_map_set(&d, i, i + 2);...
0
e337c9766796c5731905e11bd64ef287
996cca503855d415101da6fa24fc505e
筛选出指定文件(删除其它),递归操作
def delete_file_helper(path, filekw, filetype): files = os.listdir(path) for each_file in files: if each_file.split('.')[-1] == filetype and (filekw in each_file): os.remove(os.path.join(path, each_file)) msg = '文件 {} 被删除,该文件的路径为: {}'.format(each_file, os.path.join(path, each_fil...
1
0f824997a072bb11ce292da140808e2a
f9da360a553a629b9bf25ff97be61cf7
# This code can be used to write a file of Hits in basic text format, useful for GO analysis
if(length(grep(".txt",outputname))==1){stop("name of output file should not contain .txt!")} S <- numofsubj i <- indexofstudy dat <- read.table(paste(pathtofile,filename,sep=''),sep = "\t", header=TRUE, fill=TRUE,row.names=NULL) if(individFile==TRUE){ peakFile <- file(paste(pathtowrite,outputname,i,".txt",s...
0
2c38ccd9d39ef370b26df3ab82992793
e5a9a3a74ac826e9e80c08f7a1a4fd1f
Builds and returns a string that represents all condition objects, in multiple lines
condition_objs_arr = [] for condition_obj in self.condition_objs: condition_objs_arr.append(self.buildConditionObjString(condition_obj, prefix=prefix, getNestedInfo=getNestedInfo)) return '\n'.join(condition_objs_arr)
1
b9a4a9cafacb23868f0100e30995e858
d3ae05d6c1f1abd4cfcde9e3e6e6c54e
Write the value of taxes paid by the entity in the entity data.
class CreateCustomerRequest extends CustomerRequest public function setTaxIdData($value) { return $this->setParameter('taxIdData', $value); }
0