query_id
string
corpus_id
string
query
string
code
string
label
int64
a0e7f8475052ca4d48eca5d33e2a17df
e8a068fb0771b39a497563114a268dcc
you can nest complex nodes (that are like graphs themselves) within other nodes/graphs
public void DescribeNested() { var testData = new SingleChildNode("root", new TwoChildrenNode("child1", new NoChildrenNode("leaf1"), new SingleChildNode("child2", ...
1
711555de9ee147859cb63f60c185caaf
6b2f18fa92b2820aca706ded24a5bed6
Lặp lại bước nhập <USERNAME> và <PASSWORD> đến khi nào đăng nhập thành công hoặc ấn phím [ESC]
int scanKeyboard(unsigned char * base) { int i = 0; int username_pos, password_pos; while (1) { username_pos = read_username(base); clearInput(); if (username_pos > 0) break; } printf("Username: "); for (i = 0; i < username_pos; i++) { printf("%d", username[i]); ...
0
1ea5840cb9dec1ab110d92d1bc9bffce
a2fdf0c5d2ed7f99544ed295b85b83ca
Delete a ParticleEventHandlerFactory given a certain type.
void cGranSim2DDesign::DeleteParticleType(CParticleType *pParticleTypeToBeDeleted) { for (cParticleSources::iterator pSourceIterator = m_ParticleSources.begin(); pSourceIterator != m_ParticleSources.end(); pSourceIterator++) { CParticleSource *pSource = *pSourceIterator; if (pSource->GetParticleType() == pParticl...
0
5f110d94cc06100671f6d6c46aee4b05
e6a8a8ca7801cfc43e6c596d05bec4cc
@brief 获取图层编号
if ( isLayerRegistered( layerID ) ) return LayerIndex[layerID]; return ERROR_UNT; }
1
f4a28b64d6b44ab328c4945d6a3aed50
66928b9e077187f107497d37f09a52dc
<p>smlAble を取得します。
public class Sml020ParamModel extends Sml010ParamModel public SmailModel getSml020AtesakiBcc() { return sml020AtesakiBcc__; }
0
8f632aa1023b4044982b6dbf589cb949
c754fd4d17b6a8935d2b9ccf39453036
Get an associative array of message template strings
function agc_get_message_templates($type) { switch($type) { case 'bp_comm_email': $template = array( 'hhtml' => agc_message_template_generic_header(), 'bhtml' => agc_message_template_generic_body(), 'fhtml' => agc_message_template_generic_footer(), 'header' => array('From: Support <support@mysha...
1
6f51cf7f19415ae4e1728fcd94e82cde
e1e73282e3698189574fcc5ce35da6a3
Getter for <code>storeal.stl_footercustom_blocktitles.id_lang</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.6.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class StlFootercustomReinsuranceRecord extends UpdatableRecordImpl<StlFootercustomReinsuranceRecord> implements Record6<Integer, UIntege...
0
7830e38373169b3b07a910e86ff3f620
04fe71483d4e8ad7c51a085f9776c96f
绑定持仓列表点击事件
appUtils.bindEvent($(_pageId+".fund_table .ce_table tr"), function(e){ var stock_code = $(this).attr("id"); var $this = $(this), $check = $this.find(".input_check"), is_click = $check.hasClass("checked"); var compact_info = {}; var compact_id = $this.attr("data-compact_id"); if (is_click){ de...
1
c5ced58e41f7b69ef824438364296a80
1fc77172b3fb38be1457e3b146b6eac1
生成 周常任务列表
public class OverhaulZzWeekTaskFrgment extends BaseFragment public void getWeekList() { BaseRequest.getInstance().getService() .getOverhaulZzTaskList(year, month, week + "") .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) ....
1
45636d1e2fbf087bbd2bac267d46403d
e777e9685ef7c67a589ff2efd6b3b680
利用荷兰国旗问题优化的快排
const sort = (arr: number[], l: number, r: number) => { if (l >= r) return const p = l + Math.floor(Math.random() * (r - l + 1)) swap(arr, l, p) let lt = l, gt = r + 1, i = l + 1 while (i < gt) { if (arr[i] < arr[l]) { lt++ swap(arr, lt, i) i++ } els...
1
a66529fe364be3abc2caa9a27c38d0ef
9e6a0a42e0c37d21898e954587d416ef
A classifier architecture for mnist data.
import torch.nn as nn import torch.optim as optim from art.estimators.classification import PyTorchClassifier model = nn.Sequential( nn.Conv2d(1, 4, 5), nn.ReLU(), nn.MaxPool2d(2, 2), nn.Conv2d(4, 10, 5), nn.ReLU(), nn.MaxPool2d(2, 2), nn.Flatten()...
1
c3bf1028d999ab864cbe2b49324093b7
9f47675175f94c7673f8c2d98629e51c
Getter sur la largeur des coffres de l'application
public int getLargeur() ;
1
97b4cfb3d469a1666a77e10c85bf3a5a
ee35fb20a7a3090e057f91e018a331aa
Container for molecule search results
self.result_keys = ["MoleculeID", "MolWeight", "nbAtoms", "nbHeavyAtoms", "nbC", "nbO", "nbN", "nbAromAtom", "nbRing", "nbHeteroRing", "Sp3Sp2HybRatio", "nbRotBd", "nbHBdAcc", "ndHBdDon", "nbLipinskiFailures", "TopoPolSurfAir", "MolarRefract", "CombDipolPolariz", "LogP_pred", "AD_LogP", "AD_index_LogP", "Con...
1
2d0ca1776b07530e7c03c74bc8b1488d
1aa1450648640cd8388b469d770b0f00
Print (sub)collections and papers in those collections as a tree.
class SiteCreator(object): def print_structure(self, writer: TextIOBase = sys.stdout): self.walker.walk(self.library, PrintVisitor(writer))
1
cde688cfa399d59a9dbba534ef283852
65b8f490c25c1d63d5a7b125d991f0ee
Convert rotation vector to quaternion.
Vector4d* q, const Matrix3d R) { Vector4d __q; __q(0) = 0.5 * sqrt(1 + R(0, 0) + R(1, 1) + R(2, 2)); if (fabs(__q(0)) < 1e-4) { if (R(0, 0) > R(1, 1) && R(0, 0) > R(2, 2)) { double t = sqrt(1 + R(0, 0) - R(1, 1) - R(2, 2)); __q(0) = (R(2, 1) - R(1, 2)) / t; __q(1) = t / 4; __q(2) = (R(0, 2) + R(2, 0)...
0
fa914160657401f7bd1a7896b7d50f71
8189f0ddbc91aa0ed68c97bdf141bf4f
Render a grid of items.
return Inertia::render( 'GridList/Show', [ 'list' => $list->load( 'items' ), ] ); }
1
b5c4c83c4c05380d115add72f95c6c78
f42f111c7dbe791dc4aa9c143464e548
Puts an UTF8 string into this byte vector.
let cur_len = self.len(); unsafe { self.vec.reserve_additional(4); let mut c_vector = CVec::new(self.vec.as_mut_ptr().offset(cur_len as int), 4); let used = ch.encode_utf8(c_vector.as_mut_slice()); self.vec.set_len(cur_len + used); } }
1
ff44f23b4708269fed6acbafa69e9fb6
c74969fc310e700a98c44cec93abd9c4
Function where products are sent to ongoing
$date = new DateTime(); $orders = Order::find('all', array("conditions" => array("status = 'new' AND ordertime < ?", $date->sub(new \DateInterval("P10D"))))); foreach ($orders as $order) { if (!$order->reminder_sent) { EmailOutbound::sendReminder($order); $order->reminder_sent = true; $order->save(...
0
405f81fc27120822dcaf9188002a76f7
0a654a922f1b106f71d5330373a8079c
Optional. Restricted only. True, if the user is a member of the chat at the moment of the request
export class VKApi extends BaseVKApi public async groupsIsMember(params: MethodsProps.GroupsIsMemberParams): Promise<Responses.GroupsIsMemberResponse> { return super.call("groups.isMember", params) }
1
c06db374a31014f36bfc9535205d7181
670147c771f21531096c25e31d2b7172
RESTful service to show all books
@RestController @RequestMapping("/v1") public class BookController @GetMapping("/books") public ResponseEntity<?> getAll(){ System.out.println("JoinPoint"); return new ResponseEntity<List<Book>>(bookService.findAll(), HttpStatus.OK); }
1
073b95f0c955505821a214ab5349a915
1d4f0ecaa4d484442e018fbf96dc26e2
Enter a parse tree produced by {@link MiniJavaParser#expressionIdentifier}.
public class ECMAScriptBaseListener implements ECMAScriptListener @Override public void enterIdentifierExpression(ECMAScriptParser.IdentifierExpressionContext ctx) {}
0
2543c34bc4ae289f94db524cf9363388
48ce3d6132c3cdb04ef675ecca98d3a4
取队列数目
class queue extends Base public function count() { return count(self::$queue); }
1
84019288c9f2ac325d1814be458f63a0
b1432e9b47499ff850fa0a652e2720de
Verifies that the argument is between low and high.
namespace Microsoft.Azure.Devices.Edge.Util public class Preconditions public static T CheckRange<T>(T item, T low, T high, string paramName) where T : IComparable<T> => CheckRange(item, low, high, paramName, string.Empty);
1
0fa4e6ca7f3297a82a9ff03d1c388b91
cd30633cf912d0bf3d7ee21c17176a6a
Tests error handling for an undefined annotation property edge type (property graph)
def test_annotationUndefined(): flakes(''' from abc import note1, note2, note3, note4, note5 def func(a: note1, *args: note2, b: note3=12, **kw: note4) -> note5: pass ''') flakes(''' def func(): d = e = 42 def func(a: {1, d}) -> (lambda c: e): pass ''')
0
946d1773dae3a17db8816fb1b3cb48bd
82b3457ce2c6d0e82da985580c4f4119
DESCRIPTION Translate the center of mass of the molecule to the origin.
class MarchingCubes(BaseDriver_): def center_molecule(self, struct): mol_com = com(struct) geo = struct.get_geo_array() geo = geo - mol_com struct.from_geo_array(geo, struct.geometry["element"])
1
f19941860c177ac76c07622c11a878d5
41006847c4135d09f12d4f396e86da47
Funktion zur Wiederöffnung geschlossener Punkte
namespace GUI_Treeview_CatiaAnbindung public partial class GUI : Window private void btn_Ergebnisse_Wieder_Einlesen_Mouse_Leave(object sender, MouseEventArgs e) { this.Popup_Ergebnisse_Einlesen_T.IsOpen = false; }
0
d582aac41baebd3dad1ad9707b9ccdfb
667343ca0ddcbac688a4fef140abb0b6
高亮中奖号码
{ char buf[MAX1]={" "}; char ch; int i=0,j=0; FILE *fp, *fd; fd=fopen("allaward_list.txt", "a+"); if(n==1) fp = fopen("first_list.txt","a+"); if(n==2) fp = fopen("second_list.txt","a+"); if(n==3) fp = fopen("third_list.txt","a+"); init_keyboard(); printf("...
1
715942f235cd9610e7bb530e64161555
6ab5060b8badf5b954342357ca6d01b8
Returns the name of the renderer to use for this item
class CollectionSnippetIngester extends AbstractIngester implements IngesterInterface public function getRenderer() { return 'iiif-collection-snippet'; }
1
a4ba55aae6518cf85414d1b369c9ba33
c3a4258ba835e16d018b1c17d12d9cea
Retorna true caso o ajudante já tenha todas as informações para criar a figura.
boolean ehCompleto();
1
403ee0a383c384e9bb9fa8c3ee528aec
f1b1f40d6ad927462518661d8b37cae0
通知服务器领取邮件附件
local player = find_player(msg.guid) if not player then log_warning(string.format("on_sd_receive_mail_attachment guid[%d] not find in db", msg.guid)) return end if player.pb_mail_list and player.pb_mail_list.mails then for i, mail in ipairs(player.pb_mail_list.mails) do if mail.mail_id == msg.mail_id then ...
0
05028ded98bf54fd8e794c936499c61e
0496c4ac5e1403df1cfe14bec5864604
метод для ввода неотрицательного числа
namespace Задание_3 class Program static int Vvod(string s) { while (true) { Console.Write("Введите число {0}: ", s); try { return Convert.ToInt32(Console.ReadLine()); } catch (Exception e) { Console.WriteLine("\a"+e.Me...
0
32fbcb40448bf0d9190095ed7aa4918f
67974f7c2103548dca5b704af5fc4fc9
Maps the arguments to the function for getting Virtual IPs information.
credentials = self.open_connection(parameters) subscription_id = str(parameters[self.PARAM_SUBSCRIBER_ID]) resource_group = parameters[self.PARAM_RESOURCE_GROUP] network_client = NetworkManagementClient(credentials, subscription_id) compute_client = ComputeManagementClient(credentials, subscription_...
1
b141f2529ffefc8aa9084b555758ff3b
74e6d2ff4f2a75ccb8edb6a4acde7dcc
Scales the hat down for the second half of the interaction animation
public class ControllerActions : MonoBehaviour void ScaleDown(){ objectInHand.transform.localScale -= new Vector3 (.5f, .5f, .5f); }
1
569af61c6b9abe2b80e5abcc40e6a366
480f1a824f9f90ae33bafd816bcd7a9e
возвращает матрицу с элементами текущей поделенными на число k
namespace HomeWork_4._3 class Program public static int[,] Multi(int[,] matrix, int k, int n, int m) { int[,] result = CreatMatrix(n,m); for (int i = 0; i < result.GetLength(0); i++) { for (int j = 0; j < result.GetLength(1); j++) { ...
0
de9cdaa7b46e828babf6abdf422e2fb2
f0c7fab9607fcc93136ce470afe5349d
Gets, damages and influences targets within area of effect
namespace CyberLife void GetEffects(BotLifeForm lifeForm);
0
315c2fb1e2b76fed719d781da532ded7
189b2ed3bf7e91b07505f26bf64fa62a
returns the accumulator object, which concentrate all results from a Job.
StateContents<AccumT> getAccum();
1
f4e5b4ee989b0ae7a2d6a8c69e7e4688
bfff5ff5e9db8f7c3305ea5b38558305
initialize the display of the FAQ questions and answers
for (var i = 0; i < optionsArray.length; i++){ $('#quiz-option-display').append("<div class='display-element' id='display" + i +"'></div>") $('#display' + i).html("<img class='home-image' src='assets/images/" + optionsArray[i].thumbnail + "'><h3 class='home-header'>" + optionsArray[i].name + "</h3>"); if (i > 1)...
0
2df35606a48febda97bca63415addb71
874cfa44354db7799656086daf244277
Dump 1- and 2-electron integrals to file.
try: with open(filename, "w") as f: if t == "dens" or t == "mideig": values = 1 elif t == "grad": values = 4 else: print("Unknown type of cube.") return f.w...
0
5c6046ae200a4f82b9a2a75372e297ea
ac46f6ec4045e8a5c18315d6e139aaf1
Test a logged in user can create a competency.
{ $data = Arr::except($this->getData(), 'level'); $response = $this->createCompetency($data); $this->assertCount(0, Competency::all()); $response->assertSessionHasErrors('level'); }
0
b7229c536c58247eb60457e6be686701
e37dc03ecb837ae43637bd9701f55fc6
Tests some basic inputs and outputs of the relu derivative function.
class TestNN(object): def test_relu_forward(self): net = NN(None) relu_forward = net.relu_forward x = np.linspace(-0.5, 0.5, num=12).reshape(3, 4) out, _ = relu_forward(x) correct_out = np.array([[0., 0., 0., 0., ], [0., 0., 0.04545455, 0.13636364,...
0
28bcefa586a140213dffa8dbfca98902
a8fee57ca4f6ef36f3a413c83ddb2486
Splits a curve using De Casteljau's algorithm.
self._curve_points = [] if len(self._points) >= 3: for i in range(-2, len(self._points) - 2): pts = [(self._points[i] + self._points[i + 1]) * 0.5, self._points[i + 1], (self._points[i + 1] + self._points[i + 2]) * 0.5] self._curve_point...
0
6cea6dc5332e58e1a3530926df3c9f8f
2f549b4c81e29e2000fcfacafe27daaa
Instantiates and returns a new instance of the :class:`Player` class with the name *name*. This method is called by :meth:`add_player`. This can be used to supply a custom subclass of :class:`Player`.
class isola_player(object): def __init__(self, name): self.name = name self._game = None
0
fbe8a6f889af7e118ca408667d9051fc
00ebd2e469ae32212016034a9a5a5ca8
Calculate the number of milliseconds based on the specified number of seconds. <br/><br/> rather than Thread.sleep (3250)) seconds.
if (day < 0) { return 0; } return DAY_MILLIN_SECONDS * day; }
0
700555c7ad4e2951307b29e904685b88
b0ea12859357f84c6c732751b8f4a712
Disable "smart vertical resize" for components that can grow in height. Smart resize means that no row can be truncated on e.g. a {@code JTable}. chained calls to other methods (also known as "fluent API")
public class HBox extends JPanel public void setResizeWithComponent(int index) { setResizeWithComponent(getComponent(index)); }
0
961164d30db56b0b1088efd859a212f8
e6ba853540e8db22138340ee1df2170d
Gets crossmatch information for the object
if self.__status: output = dd_info rel = self.GetRelations(name) output.error = rel.error if rel.error == 0: output.error = 0 output.tname = None output.aname = None jtime = None jarea = None output.tlen = ...
1
d74b608de92de45bc1a13631521f4361
582c9579805893a5b58e23c520c4019d
Получает список категорий, к которым принадлежит данный товар
{ $data = false; $conn = Mage::getSingleton('core/resource')->getConnection('core_read'); $query = $conn->select() ->from( $this->getRes()->getTableName('catalog/category_product'), array('category_id') ) ->where('product_id...
1
afce7f2bafd368243e3a37fc72d3d688
564f8a39fb3838cfc8ae33243e2bb2b9
190. 颠倒二进制位, Easy
public class SuanFaSolution190 public static int reverseBits4(int n) { int res = 0; for (int i = 0; i < 32; i++) { res ^= (n & (1 << i)) != 0 ? 1 << (31 - i) : 0; } return res; }
1
91593f0d7f1725a82d995585a2964bc1
de0b39892e7a1bf2abe79cfd266170de
Return encoded raw data of the response.
@SdkPublicApi public class AwsErrorDetails implements Serializable SdkBytes rawResponse();
1
fc4c6830cba3a9cf2b1bbde86cd144ab
979cb1500c4f4386f65a9b8fb5363e1d
The object constructor
function public:constructor() end
1
f4e3f49f30076e23e5bb74ab99fdb93c
ad6cb96d0030b996a0a5c0977b97e1ac
Gets the name of the PircBot. This is the name that will be used as as a nick when we try to join servers.
class AIMProtocol(Madcow): def botname(self): return self.config.aim.username
0
8cfae931f14a99a064a66220d2a68d4f
286a0ad6a8943ea9390cecfa7264c914
Add all files in and below directory dir into zip archive
{ try { string[] filenames = Directory.GetFiles(dir); using (ZipOutputStream s = new ZipOutputStream(File.Create(dir + "\\test.zip"))) { s.SetLevel(9); byte[] buffer = new byte[4...
0
e63e67e3b82ab872ef3bdba4340cc5db
6a9c5ca49a857f7c839ce2f20420d707
! This function sends the PART_INFO command to the radio and receives the answer into @Si446xCmd union.
{ uint8_t l_Cmd = FUNC_INFO; SI446x_Write_Cmds(&l_Cmd, 1); SI446x_Read_Response(pRead, 7); }
0
cd6b53eebacd449ae99a17f4a08ccebb
952599306683055c0ca89c9bd420af4b
Checks whether the <see cref="BoundingBox" /> contains the given <see cref="BoundingBox" />.
{ return (Left < pBoundingBox.Left) && (Right > pBoundingBox.Right) && (Top < pBoundingBox.Top) && (Bottom > pBoundingBox.Bottom); }
0
2bc50c0e9008c65eac973296e415f671
b41a30c10c2c773b7b703dbac37c721a
Returns resources for a given resource set in a specific locale
namespace KProcess.Ksmed.Business AppResourceValue[] GetResources(string languageCode);
1
692caf6ea94be020300e707e06865df0
f0356305da178a3c9bd9d67450314ca3
Returns tuple produced by transforming the fisrt and second elements of this product.
fun <A, B> Try<A>.product2(tb: Try<B>): Try<Pair<A, B>> = tb.ap(this.fmap{a: A -> {b: B -> Pair(a, b)}})
1
b080f3f303e2d0ecc4d1eb255d65f1b3
357efb28b412513e9b37ae9c8d1aad48
Handles the ValueChanged event of the CBPageType control.
{ try { if ( this.ddlGroupTypeList.SelectedIndex > 0 ) { DoSearch(); } } catch ( Exception ex ) { this.SetConsoleErrorMessage( "Unexpected error encountered<br>Contact ...
0
d5e769d4f76af5e1f8e8a7334a85c3b6
b7a24e42dbff4a1340b122d18adc2637
Gets the training engines.
[Route("")] public IHttpActionResult GetEngines() { _logger.Debug(m => m("{0}", LogEventFormatter.Format(SOURCE).AddEvent("getEngines"))); var session = GetSession(SOURCE); var engines = _cxPortal.GetEngineServers(session); var response = new Engin...
1
58b8858ac0a6317dc9258c069526e16d
6c9500c59e84d56d13cfeeed38e74450
Updates the server lists from the txt file
{ global $online_file; global $OnlineServers; $online_data = file ($online_file); foreach ($online_data as $currentline) { list($DNS, $TIME, $LOG) = explode("|", $currentline); $DNS = trim($DNS); $LOG = trim($LOG); if (isset($TIME)) { $TIME = trim($TIME); $On...
1
fe5fe602bf853400ac70a200adc3a110
ec20f0d64671d486960135b66dc19146
Get the vertex that maps to a room shape.
if (room == this.getRoom(0)) { return this.positions[0]; } else if (room == this.getRoom(1)) { return this.positions[1]; } return -1; }
1
538189715d20025a2eed04e9d7c9f958
afc4a834b2fc32f880f8c50736ed24e3
Gets whole part of division, ceiling the result.
{ return Division(leftNum, rightNum, leftNum.DecPrecise > rightNum.DecPrecise ? leftNum.DecPrecise : rightNum.DecPrecise); }
0
df05842c2f11fe1fe62a8e90947413eb
62a36663166a9aca0a09e73803f91742
Create a `TestApp` with a database including a default user
app = create_app('test') app.models = models db.create_all(app=app) db.app = app models.User.create(username='admin', password='admin') models.Entry.seed(10) models.Tag.seed(5) return app
1
fb4bd0607b89944373041d2ba3780d3d
e45bf310bb5701db56fb99969145225e
店铺价格 商品库存改为只读
function goods_stock_set() { $('#txtShopPrice').attr('readonly', 'readonly').css('background', '#E7E7E7 none'); $('#txtStock').attr('readonly', 'readonly').css('background', '#E7E7E7 none'); $('#showSpecTab').show(); var strApp = new Array(); strApp.push('<tr>'); for (var i_0 = 0; i_0 < sp...
1
bdc47657092506cfcdebe43e0389192c
2379475b308319fcdf51d91bef8105f0
Sets Date units or day in BCD format.
{ if ((dow > 0) && (dow < 8)) _writeRegister(REG_DOW, dow); }
0
fe0d9126aa6905e9be58d44f32276ffd
2b39d6dc27a4fe181ae8394960c81bf5
Called when a fling result is received.
public class ArcTabDelegate void onFling(int position);
1
dc7b4a1fb41c366b05e7615c9b6fd3a3
cf8b527cc604a44faf1c9686cd144e69
设置默认发消息压缩方式
public void setCompressMode(int mode);
1
32ff4db81ee3d8e1ec95c75197564fff
407993e791251f4811e2382b22be294c
3. 윤년 여부를 반환하는 메소드
if(isT) { System.out.println(year+"년은 윤년입니다."); } else { System.out.println(year+"년은 윤년이 아닙니다."); } }
0
c3a98f0a7874a65a14ba94573c48ab5f
fee997677831d11e323110de90d1a1ba
Posizione di un corpo celeste relativamente alla stella.
objectVel = np.array([0.0, parameters.celestial_object['velocity_magnitude']]) m = parameters.celestial_object['mass'] retVel = (mass * velocity + m * objectVel) / (mass + m) return retVel
0
1665d792d68b30450b5727383cc97629
fb81620b1594eaeae7d6db3a2422c2ec
Returns e raised to the power of a specified number
namespace System.Numerics static abstract TSelf Pow(TSelf x, TSelf y);
0
6993f8978c4a709cc39a083a87a24845
b6bdeb69a00c14cbea0f12bd72086b25
Get parents until $orgType level. If level is undefined returns a list of all parents.
class PositionPeer extends BasePositionPeer function getAllPossibleParentsByType($type,$version=1){ $treeRoot = PositionQuery::create()->findRoot($version); if (!empty($treeRoot)) { $positionsQuery = PositionQuery::create() ->filterByKind(PositionPeer::HIERARCHICAL); if ($type !== PositionPeer::STAFF) {...
1
f32097cbb8f3e259588d9eee72e59bf9
6b611484ad654805d808aeecb9e9aa45
iBeacon 服务状态变化事件的回调函数
if (newState == BluetoothProfile.STATE_CONNECTED) { Log.i(TAG, "**ACTION_SERVICE_CONNECTED** $status") broadcastUpdate(BLEConstants.ACTION_GATT_CONNECTED) mBluetoothGatt?.discoverServices() } else if (newState == BluetoothProfile.STATE_DISCONNECTED...
0
db2163ced45073ceb2df76ed7456588b
73403c40ab0c329c0e5798e0b8141842
Função para clicar na opção NÃO, OBRIGADO do Pop-Up
namespace TCC_PA public partial class Pergunta2 : Form private void button14_Click(object sender, EventArgs e) { button14.Enabled = false; }
0
bbfb1e084e88b0aa24e99d8281cc771b
9dcfcd8691fea93d365099f0eda02764
Requests a fresh list of realms
class RealmsHandler extends EventEmitter constructor(session) { super(); this.session = session; this.list = []; this.session.auth.on('packet:receive:REALM_LIST', ::this.handleRealmList); }
0
9b8a6a11eac13e90236c738d4a3acdfd
aa9077ee3e68bc02c934976c698f5b8d
显示下载文件模态框
upload(){ var self=this; $("#coverMod").modal('show'); self.set('filename',''); }
0
273f76f2be7adf61311a31cff71e9f4a
2d01beb961dddeeb29cd4b94b2a6cef7
取钱的回调函数
{ remainMoney =(int)(*(double*)p * 100); pthread_mutex_lock(&lock); remainMoney = remainMoney; printf("红包已放入\n"); usleep(100); pthread_cond_broadcast(&cond); pthread_mutex_unlock(&lock); return NULL; }
0
f577ba795da250624f270766e802d40a
5777a4e9dad8b2ad548073a764e49657
返回这个点在src社区内的所有邻居,以生成器的形式返回。
*, add_self: bool=False) -> typing.Iterator[complex]: for delta in ((_CNEIGHBOURHOOD_8, _CNEIGHBOURHOOD_8_WITH_SELF)[add_self]): yield point + delta
1
dd610d11be43ad8ba88fb52efb85b1c5
f8135f8e730fc655d0ccbf898587cb94
如果所有采购单都已经交货
@Service public class PurchServiceImpl implements PurchService private void checkProjectPurchDone(List<Integer> projectIds) { if (projectIds.size() > 0) { List<Project> projectList = projectDao.findByIdIn(projectIds); projectList.parallelStream().forEach(project -> { List...
1
b578153ab3de63a307ebe15aa09b2a48
2e375d5049474a706aea72814cad8bce
exec_user_input method handles the line entered by the user in the prompt_toolkit.
class Base(object): def exec_user_input(self, user_input, *args, **kwargs): if not user_input.strip(): if self.empty_line(): return True else: return False try: pre_return = True cb_return = True post_return = Fa...
1
5302ce1d271207017b0dc9ec8e56472c
93b690fed96c4b54bd31097f8e47d57b
Вычисление градиента численным методом
{ double d2 = 1.0 / (epsilon * 2.0); for (int i = 0; i < vector.Length; i++) { double t = vector[i]; vector[i] = t + epsilon; double g0 = function(vector); vector[i] = t - epsilon; double g1 = fun...
1
0e164c6f637fee41c77b06d8c873d57d
de4b7a65ba0261c1d3b3ed2b4fd74b75
Проверяет длину строки для инпутов
{ if ($this->hasValue($name) !== false) { if (mb_strlen($this->inputs[$name]) > intval($param)) { $this->pass = false; $this->message[$name][__FUNCTION__] = $this->translate($name) . $this->lang[__FUNCTION__] . $param; } } else { $t...
1
33020126735442f135052d0cb96118bd
54be915b775e108b250b32d1317f84df
Encode person keypoints given in coordinates corresponding to an image of given shape into a heatmap.
heatmap = heatmap[0] heatmap[heatmap < 0.1] = 0 heatmap_with_borders = np.pad(heatmap, [(2, 2), (2, 2)], mode='constant') heatmap_center = heatmap_with_borders[1:heatmap_with_borders.shape[0]-1, 1:heatmap_with_borders.shape[1]-1] heatmap_left = heatmap_with_borders[1:heatmap_with_borders.shape[0]-1,...
0
91e8570bdc744c8ed5dff6012f985400
de7a6dfcc8207ec4955213cc817829c4
Transfer everything from the original stack to a temporary one first, and then print the path from the later since all nodes in it are in the right order root -> leaf. Restore the original stack.
Stack *s = NewStack(); StackPush(s, NewTreeNodeWrapper(root, false)); while (!IsStackEmpty(s)) { TreeNodeWrapper *w = StackPop(s); bool visited = w->visited; TreeNode *node = w->node; FreeTreeNodeWrapper(w); if (node == NULL) continue; if (!visited) { ...
0
eb8fbe7ae3a26baadc4051c6cff57629
b82c70312fd6c8bd6c361c69b6213a2f
#Displays the model coefficients and diagnostics for the stepwise polynomial fit without time-series considerations
{ cat("\n----------------------------------------------------------------\n") cat("Fitted Schwartz97 two-factor model:\n\n") cat("SDE (P-dynamcis)\n") cat("d S_t = S_t * (mu - delta_t) * dt + S_t * sigmaS * dW_1\n") cat("d delta_t = kappa * (alpha - delta_t) * dt + sigmaE * dW_2\n") cat...
0
293f75046a57afdd7bdd94e8e9b4a12d
57ca818eb2925f4a6fc2a24b704d5323
Returns oldest item from queue.
try: return self._items.popleft() except IndexError: raise IndexError("The queue is empty.")
1
710a4b4667187999fd214f5db3d779ad
65d2410750220f874d8803cdab44ba3c
如果当前浏览器支持 canvas,则开始渲染要素;如果不支持则移除图层。
this._ctx.save(); this._ctx.setTransform(1, 0, 0, 1, 0, 0); this._ctx.clearRect(0, 0, this._canvas.width, this._canvas.height); this._ctx.restore(); this._layers.sort((a, b) => a.index - b.index).filter(layer => (layer instanceof FeatureLayer && !layer.editing) || !(layer instanc...
0
9ae9c6400137db7d6c1ce074f6fba1c7
f411e419e77c72e43cbd1f1875746e3b
The public address you share with others to receive funds.
class ZxSignedOrder: # pylint: disable=too-many-public-methods def fee_recipient_address(self): return self.fee_recipient_address_
1
c49bfb1b8c79269cfa04299f413b0152
3c1281d8575f72ae5916815ec8c4290d
Strip the food name of all non-alphanumeric characters and make lower case. Used for the allFoods set.
def trim_nutrient_name(temp): temp = temp.lower() temp = list(filter(None,re.split("[;&@\/:,\*\.\(\)\{\}\\%\"\']",temp))) temp = [i for i in temp if not i in STOP_WORDS] if(temp[0] == "fatty acids"): return str.strip(temp[0] + temp[1]) else: return str.strip(temp[0])
0
ccb59d819170bbae8f683397fda207ff
aea4ce0fd116bf32993779c306a61368
未ログイン時でgetリクエストした時のテスト
class ProfileImageEditViewTest(TestCase): def test_not_login_get(self): response = self.client.get(self.url) self.assertEqual(response.status_code, 302) next_page = '/login/?next=%2Fprofile%2FTaro-Tanaka%2Fimage%2Fedit%2F' self.assertRedirects(response, next_page)
1
6ec24c53dcd7e14951828af852cc7e63
c194c0a3dca59d97a9d591f364955389
获取一个Sheet的冻结信息,包括冻结列和冻结行
const frozenStructure = new IadGridFrozenStructure(); frozenStructure.left = this.dt.frozenColumns; frozenStructure.right = this.dt.frozenRightColumns; frozenStructure.center = this.dt.columns; frozenStructure.rightWidth = this.dt.frozenRightWidth; frozenStructure.leftWid...
0
579ebf6c6dca28a1da7188306d2c1d72
105c012a5696ff4323805da093fc71f4
Remove the index key from leaf node.
{ unsigned nr_entries = le32_to_cpu(n->header.nr_entries); unsigned nr_to_copy = nr_entries - (index + 1); uint32_t value_size = le32_to_cpu(n->header.value_size); BUG_ON(index >= nr_entries); if (nr_to_copy) { memmove(key_ptr(n, index), key_ptr(n, index + 1), nr_to_copy * sizeof(__le64)); memmove(value_...
1
108edd6f8cf8e351f3fe9d9549e064c5
dc73c614ffb9b5886a6d09f4f10f008d
Returns the sample with the smallest z-coordinate.
double result = Double.MIN_VALUE; for(Datapoint point: points){ result = (point.getZ()>result)?point.getZ():result; } return result; }
0
9fedbe029e38b410ffcad575adb2041b
7d0e9b78b7c78d8cf7e489c007b1b461
OnUpdate for the Two Second Ticker
{ if(TimCount++ >= 25) { Flags.Scheduler1s = 1; TimCount = 0; } }
0
8f07a42d64cc7b33ea4500dfd205bf55
7d40b1805e70930997424d5291b9ee49
是否支持动态创建类型的sql语句
String querysTypeUpdate[] = {"UPDATE", "INSERT"}; String sqlUpper = strQuery.toUpperCase(); for (int i = 0; i < querysTypeUpdate.length; i++) { String currentSqlType = querysTypeUpdate[i]; if(sqlUpper.indexOf(currentSqlType) == 0) { return false; ...
0
4ce8b71f00a6029ed5294a8b7fdf82aa
98bc3e236835efd6e2f97283e9571561
Splits ``values`` into ``split_count`` pieces.
def split(container, count): return [container[_i::count] for _i in range(count)]
1
1acbcd7cde37f165821118251e6eeda2
f0ab1cc9f64db5b74a406ee666f1544d
Shows a long running system toast notification.
namespace BaiyoAppV2.Mvvm.Windows public class MainViewModel : BindableBase public void ShowToast(string message, NotificationType type) { ShowToast(message, type, TimeSpan.FromMilliseconds(2000)); }
0
20786a9aa2b3f17e3b0c04972a9bc89f
eb4e7d625f7e6005c1999e40527d42ac
Creates a new folder on the ArcGIS server.
class FilesAnywhere_CreateFolder extends Temboo_Choreography public function __construct(Temboo_Session $session) { parent::__construct($session, '/Library/FilesAnywhere/CreateFolder/'); }
0
6fee23bdfe50204ea81444c67f383382
9983590f501c271478c76b6a1c52ce50
Update a payer with Realex using the Remote API.
$transactionRequestType = new AnetAPI\HeldTransactionRequestType(); $transactionRequestType->setAction($action); $transactionRequestType->setRefTransId($transactionId); $request = new AnetAPI\UpdateHeldTransactionRequest(); $request->setMerchantAuthentication($this->merchantAuth...
0
55462e8ba501cd46e928a6e59c8d5ef5
3fb3b2c4731f9807d3d3d11d0e3d9df0
根据状态码获取信息并设置所在行的位置
public class QueryComp extends AbsHComp{ private void getPrecisePositon(Map<PosBean, WinRsBean> map) { try { for (PosBean posBean : map.keySet()) { WinRsBean rsBean=map.get(posBean); if (null != rsBean.getErr()) { String m2 = ""; ...
1
7a03c7ea090755db216a17aad6a183a2
983bcda53c1bedabb3cb1d398a8719e2
Trivial function returns a doubling function that is "closed" over a local variable.
fmt.Printf("%p\n", &x) return func(y int) int { fmt.Printf("%p\n", &x) return x + y } }
0
a2b9c62f80da4fddc3cca273994eeafd
9044e4dee877f2ec7b3dae9450e534e4
Test case for userManagev1userregister User registration.
public void testRegisterUser() throws Exception { mockMvc.perform(post(API_VERSION+"/users") .contentType(MediaType.APPLICATION_JSON_UTF8) .param("username","test") .param("password","test")) .andExpect(status().isOk()) .andDo(print...
1
a9e02dda00b2c02b3b6a54ec31409aad
41be87a160cfd0524d7c164ce9d8b3a7
Poišče festivale glede na podane zahteve.
List<Reservation> result = new ArrayList<>(); for (Reservation reservation : reservations) { if (request.getHotel() != null) { if (reservation.getRooms().get(0).getHotel() != request.getHotel()) { continue; } } if (...
0