query_id
string
corpus_id
string
query
string
code
string
label
int64
42d984231c95821d196be312e784d470
0459967368d5f2516099b7479d41ea55
Gets the learners by teaching group identifier.
namespace Erris.BusinessLayer.LearnerRecord public class LearnerGroupLearnerBL : ErrisMISBaseBL<Entities, LearnerGroupLearner> public IQueryable<LearnerGroupLearner> GetLearnerGroupByLearnerId(int learnerId) { return _LearnerGroupByLearnerId(Context, learnerId); }
0
4ce28bfaf0afaf0e4a6f4ebb5ba45b99
974c5aa1b2afc51e8bc1e77eb99ffcd5
TL;DR rowをkey:value式に変換する
def getTemplateRow( row ): result = {} result['payload'] = row['key'][-1] result['value'] = row['value'] return result
0
92b75342fb93516af51a9ed34cefe649
f24e7c42066d458ee5645beae9504b0c
中央ラインにある図柄のエフェクトを開始する
public class LineEffect : MonoBehaviour void Start () { }
0
6ee94decfa2b9da79141f1f82f5273ca
0cf1926dc99f831a4e64441e5be72d9c
Returns a new [Flow] that combines the two most recent emissions from [this] using [transform]. Note that the new Flow will not start emitting until it has received two emissions from the upstream Flow. Useful for code that needs to compare the current value to the previous value.
var updating = false val transformedProperty1 = Property(transform1(this.get())) val transformedProperty2 = Property(transform2(this.get())) this.onNext { if (!updating) { transformedProperty1.set(transform1(it)) transformedProperty2.set(transform2(it)) } } ...
0
d9c13edcad1f2b1e508bc52182d85993
8446eea8230a574391dcf5e5b2321b1c
Takes a two dimensional array of attempts and returns a one dimensional array with the averages
function findAverageVector(arr){ var average = [0, 0]; var i; for(i = 0; i < arr.length; i += 2){ average[0] += arr[i]; average[1] += arr[i + 1]; } average[0] /= arr.length/2; average[1] /= arr.length/2; return average; }
0
a11b475abb13af4ac23ad366d5adc0f1
5e05a37ddcdc2259c5444ad56610831c
Dediacritize Buckwalter encoded string.
final class FilterPie public static function sbc2dbc(string $str) { return StringPie::sbc2dbc($str); }
0
981f1bed897e64f32e0325bf4d8af535
f285a6e716eb6064ed456dd1f9635fc3
查询指定ID迁移项目详情 查询指定ID的迁移项目详情。
public class SmsAsyncClient public AsyncInvoker<ListMigprojectsRequest, ListMigprojectsResponse> listMigprojectsAsyncInvoker( ListMigprojectsRequest request) { return new AsyncInvoker<ListMigprojectsRequest, ListMigprojectsResponse>(request, SmsMeta.listMigprojects, hcClient); }
0
d3e5555a70008b7b6e43f7249e4dcadf
0e5f387d6d42952e936db165fd2e26b3
加载指定路径的程序集。
namespace CodeArt.Web.WebPages.Xaml Assembly Load(string virtualPath);
1
f040f16d3af569d3a5ec696389f23f1e
840c642b0f50a7dc8359abee5924cfd0
Clears *last error* memory. Call this if you want to repeat your simulations sequentially.
pub unsafe extern "C" fn symbolic_err_clear() { LAST_ERROR.with(|e| { *e.borrow_mut() = None; }); }
1
e503794a848f7244dc1322f2dfdb2287
10f940f88fb0ec58beafcefeb9ac9e2e
获取一个新的、具有相同值的 DataString 对象
namespace System.DataFrancis public static class CreateDataObj public static IData Data(IDirect data, params (string Name, object? Value)[] dataMerge) => CreateDataObj.Data(data.Union (dataMerge.Select (x => x.ToKV())));
0
2125adce895cee4550efc5fca94281e3
836ca78d83ba32a4ead76d8e90c9265d
根据Id是否为0判断是新增还是修改
void updateIsCreateById(@Param("isCreate")int isCreate,@Param("id")String id);
1
255b3a7f536953525642b97a89f46228
c9857543d8ceb1c1c15f41276aaa51d7
更新空闲分区表
int check; char *buff_list = (char *)malloc(SFS_API_BLOCK_SIZE); check = read_blocks(1 + SFS_INODE_TABLE_SIZE, 1, buff_list); if(check <= 0){ perror("write_blocks failed"); return -1; } strcpy(*empty_block_list, buff_list); free(buff_list); return 1; }
0
3f04ab8e1df3bd636fd8547e220e5be5
662e04d0dcf54c07eacdf20a10f2fb67
Edita uma Curtida
class CurtirController extends Controller public function show($id) { $curtir = Curtir::findOrFail($id); return view('usuario.curtir.show', compact('curtir')); }
0
d68af2da7406ba941897e78a1fb3f587
3facf4fda9de538b772e9434ec2730ee
Create the Stocks table if it is not present in database. This can be avoided if table is already created in data base before the application starts. In the table symbol ID from symbol table and time stamp are primary key. Symbol ID is foreign key referencing ID in symbol table
{ $this->createTable('{{%stocks}}', [ 'id' => $this->primaryKey(), 'user_id' => $this->integer()->notNull(), 'main_cat_id' => $this->integer()->notNull(), 'sub_cat_id' => $this->integer()->notNull(), 'sub_cat_2_id' => $this->...
0
a305cf9c35898d7f8aec0532e3ec8607
60a093fcd3b8f8c6c620c98cf164fe25
Make a "position tuple" from the current expat parser state. This is used to communicate the position of the parser within the file to the Python side for generation of meaningful error messages. It is of the form (line, col), where line and col are both PyInts.
class Lexer(): def __get_location(self, t): column = t.lexpos while column > 0: if self._lex.lexdata[column] == '\n': break column -= 1 column = t.lexpos - column return (t.lineno, column + 1)
1
45e7957ce15efaa15e141ef7b3783eb1
dee5d5aeab59db037241e753eb36ad19
Change SysTick exception state to pending.
uint_8 SCB_uint_8GetSysTickPendingState(void) { return (uint_8)GET_BIT(SCB->ICSR,PENDSTSET); }
0
9469034d75732373a76ad92c2fa07260
6300a41e2d0cde220874fdc78920cbc2
Whether to delay ensemble change or not?
public function setDefer($defer = true);
1
8661c8056c7e3d5f08e17a44602e3bb8
ce0adb38b11c057e0f5da521e4136db0
called when the transaction is committed
public void afterCommit();
1
a0f3c5c4302c414853a7f4e2c4427dde
1274617e7908c62d80ac08d1b4bc43d1
Default tensor conversion function for array, bool, int, float, and complex.
def to_tensor(data): if np.iscomplexobj(data): data = np.stack((data.real, data.imag), axis=-1) return torch.from_numpy(data)
1
5eca4f2ecd2dcd60c3343859eec87368
efd95029058d7b1ec8f6cb1dcd340a2d
Loop through the current set of Player objects and collect those Player objects where the x attribute matches the parameter value.
player_list = [] for player in self.players: if player.get_location() in location_tuple: player_list.append(player) return player_list
0
8ace7d13387fddf95384dcf71002b6d3
c5b091fc3531acd9044ee3d9a2e74c5c
add picture to photo lib
class phpsetcopyright function AddPicture($picturepath) { $cur = count($this->picturearray); $this->picturearray[$cur] = trim($picturepath); }
1
b2ea674ceff182f0127733a58c084209
22a26d82a62ea4038edfc894c9dc711d
Test the PpmsSystem constructor raising a ValueError.
sys_image_type = pxe.SystemImageType( name=None, provision_type='Vm') with error.expected('Name is required'): sys_image_type.create()
0
bf14ee831e8f4925f6237ebb18461297
309718e98760a11528b5b6552ac34b5b
метод добавления товаров к компании
class CompOrders extends ATable{ public function create($comp_order) { $db = DataBase::getInstance(); $connection = $db->connect(); $data = $comp_order->getData(); $sql = "INSERT INTO ".self::TABLE_NAME." (id, id_product, price, `count`) VALUES (:id, :id_product, :price, :count)"; ...
1
1358f379a2632044cb124ffdae366619
4998605b96fd140247b1ced447447ccb
Returns the configuration for phpDocumentor.
abstract class phpDocumentor_Core_Abstract public function getConfig() { return self::config(); }
1
ffcb021d56653bf65301f567ec625eb2
977fb7e538596c637aa8a922e888cea9
Prepares this element for removal from its current Cmd. <remarks>1.1.18 Removal occurs atomically when a new fleet is formed via Fleet.FormFleet(ships). If AutoPilot is engaged when this occurs, it will remain engaged until it receives another order from new Cmd. Compounding this issue, AutoPilot can be waiting on Flee...
namespace Pawnmorph.Hediffs void MarkForRemoval();
1
23748956a0364cc6864fc8a51fe3bbd7
5c5e60dbc4b2440dc72182ba6839a15a
Restore the actor's saved position
public virtual void RestorePosition() { if (Source == null) { return; } Source.transform.localPosition = (Vector3)cachedLocalPosition; }
1
137b9a77465ed9b02715b27638b0b628
5d7a976bc1de1ca356f5feb4724b7bc8
将文件中的句子分割成不同长度句子
length := len(fileText) parts := make([]string, n) lastPostion := 0 for i := 0; i < n-1; i++ { position := length / n * (i + 1) for string(fileText[position]) != " " { position++ } parts[i] = fileText[lastPostion:position] lastPostion = position } parts[n-1] = fileText[lastPostion:] return parts }
0
da8289c3ab13a828b8f7a0f69d015d23
f3deb387376bd6760efbe62f1bb06ec6
Этот метод удаляет все атрибуты объекта.
void removeAllAttributes();
1
442baccd927a41b98b8486adbace8cba
3f6c42e4a6b7507e3ec0acf58d4411a5
s의 접두사도 되고 접미사도 되는 문자열들의 길이를 반환.
{ s.clear(); string x; vec_sz maxlen = 0; while(in >> x){ int idx = -1; for (vec_sz i = 0; i < s.size(); ++i){ if (x == s[i]){ idx = i; break; } } if(idx == -1){ maxlen = max(maxlen, x.size()); s.push_back(x); t.push_back(1); } else ++t[idx]; } return maxlen; }
0
4a62d7eca79b96c642846029299e50e9
895253e6c7f7da6f0884272d630c16aa
Truncate search tables
{ $tobalesToTruncate = array( 'affiliate/statistic_affiliate_advertising', 'affiliate/statistic_affiliate_general', 'affiliate/statistic_affiliate_referer', 'affiliate/statistic_merchant_advertising', 'affiliate/statistic_merchant_affiliate', ...
0
8c037f67810ea704cb8224727ebceea5
1f4576477d36ac8fb088bd6989dc8d6b
将集合list2中的元素并入集合list1
namespace PAT.Common.Classes.Ultility public class Ultility public static List<T> AddList2<T>(List<T> list1, List<T> list2) { List<T> result = new List<T>(); result.AddRange(list1); for (int i = 0; i < list2.Count; i++) { T item = list2[i]; ...
1
ac48f582cd28f2160cbf7ab3251b28a0
74c538c983097e55c976ff7520d29f39
Saves the current (normally 'final') weights of 'model' to h5 archive at path project_dir/model/'file_name'. If a model of the same name exists, it will be overwritten. If the directory 'project_dir'/model does not exist, it will be created.
if folder_name is None: print('WARNING: folder_name not given, skipping save') return if not os.path.isdir(folder_name): os.makedirs(folder_name) self.model.save_weights(os.path.join(folder_name, 'a2c'), save_format='tf')
0
d2904c5fff7eb7c849c9eca9a2fbb757
cf3354d82ddd1dcb6e8e9c909d13258a
Cancels shipments via the Web Service API
public class MerchantFulfillmentApi public CancelShipmentResponse cancelShipment(String shipmentId) throws ApiException { ApiResponse<CancelShipmentResponse> resp = cancelShipmentWithHttpInfo(shipmentId); return resp.getData(); }
1
735e19e1ecec76f0dab0fce802455ef4
88ddede3d6445d42a1f13d7224bd37f8
Determine whether to capture operation time from an aggregate response.
namespace NewRelic.Agent.Core.Transactions bool TryCaptureResponseTime();
1
8658522052446ccf8ad3b1fd4d6ab629
b7af7546e83dd88b497fd88e6931a391
Get the reader's type
{ string queryString = "select readerTypeName from [readerType] where readerTypeId=" + readerTypeId; string readerTypeName = DBOperation.ExecuteScalar(DBOperation.CONN_STRING_NON_DTC, CommandType.Text, queryString, null).ToString(); return readerTypeName; }
1
3f9f01352adff6c1b36a0237cfb7209d
1e9396afe29678908c3808d6dcf70324
An encoder that averages sequence inputs.
class Encoder(object): def __init__(self): super().__init__()
0
c48228bcea1cb2518099a1b8b082988e
63c01531929520c6f39b4d39f78cf561
Get all active Ports on current machine
{ IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); IPEndPoint[] ipsTCP = ipGlobalProperties.GetActiveTcpListeners(); IPEndPoint[] ipsUDP = ipGlobalProperties.GetActiveUdpListeners(); TcpConnectionInformation[] tcpConnInfoArray = ...
1
5430e28f097f579cda5ff36040a78d11
75d57767d10cb986e93bc23a0c9a4121
平均TPS计算
try { double[] tpsdouble = ((double[]) tpsField.get(serverInstance)); if (tpsdouble[1] > 20.0) { return "*" + Math.min(Math.round(tpsdouble[1] * 100.0) / 100.0, 20.0); } return "" + Math.min(Math.round(tpsdouble[1] * 100.0) / 100.0, 20.0); ...
0
6597e9401de5fad037a2a096794bd6d6
84002eb97ef8c648b5faed8aed7a9f51
Updates an option attribute definition for the specified product type.
url = MozuUrl("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Properties/{attributeFQN}?responseFields={responseFields}", "PUT", UrlLocation.TenantPod, False); url.formatUrl("attributeFQN", attributeFQN); url.formatUrl("productTypeId", productTypeId); url.formatUrl("responseFields"...
1
62d4c19b28d0b5b8f530db7e165c16fe
c0d6119e33455bf8db86a6e1603304c2
is kept unchanged.
double GetUnchangedBrightness(const double brightness) { return brightness; }
1
8cb5fc2ad8119f3fe4a968b26d4b8bd8
959f73408b87a05a63fb7db3f25a0d5a
GLSurfaceView가 다시 그려질때 마다 호출되는 메소드입니다.
public class OpenGLSample_1_2 extends Activity class GLRenderSample1 implements GLSurfaceView.Renderer @Override public void onDrawFrame(GL10 gl10) { }
1
03fe178f8c72f4a4cfe99982db39f7e9
49d838fe41c1423ba738198ae8f38a27
@brief open alert dialog.
void ItemCardLayer::cbAlertDlg() { if(CGameData::Inst()->isSoundOn) SimpleAudioEngine::sharedEngine()->playEffect(kSndEffect(btnok)); if (m_dlgAlert) { m_dlgAlert->removeFromParentAndCleanup(true); m_dlgAlert = NULL; } }
0
913b03103797855996d0fd9937959bbb
7a0c3393c60c975d12e13f142dc2be51
Core function of the program to draw the filled circle using fans of triangles
double x = 0, y = 1, angle = 90, var_angle = 1/(double)r; clock_t tStart, tEnd; tStart = clock(); while(x <= y) { angle -= var_angle; x = r*cos(angle); y = r*sin(angle); draw8Points(x, y, renderer, sizeX, sizeY); } tEnd = clock(); return tEnd - tStart; }
0
652e4b17477cf0fa87ee869577acf754
ff3527485dbec2ae4ac38f3240034e8f
버전으로 검색
public Tag findByVersion(Integer version);
1
9bbe267bec7b17d99969efba7d7733b3
64fa47ec39e977fc2a2f28b4c0210467
injects in the page the html used to generate the jquery ui dialog prompt when user ponder to finish the edition task.
{ echo Html::endTag('div') . "\n"; $js = <<<JS $(document).on('click', '$this->initElement', function(e) { e.preventDefault(); $.get($(this).attr('href'), function(html) { $('#$this->id').html(html).dialog('open'); }); return false; }); JS; $this->registerWidget('dial...
1
a2d828afc3b958d118e1d1346328b1d7
65f755966511bb11d2b9d3b1123dbd65
按Map对象条件查询所有BusinessActivityParticipate
public List<BusinessActivityRegistrationInformation> findByMap(final Map<String, Object> paramMap) throws DaoException;
0
b8b22b0a1b11c0d2fe34ad90a6239db0
faa9f03cb078fc6eee513768b16f599a
Does the Excel file exist?
full_filename = "%s.%s" % (table_filename, settings.SCISHEETS_EXT) full_path = os.path.join(filedir, full_filename) return TableFileHelper.doesFilepathExist(full_path)
1
81d7eb3dbfc9fd8223bb7de3a5bcf829
15f83a43e07777b9cc32479477fe88eb
Called by the ModelDefaultState when the model gets to the end point
class ProcessListener : public ModelBuilder::Listener virtual void IterationEnd(int iteration) override { }
0
305324407adc883fde1f820466893271
5a5265e246a370120903cbe79ea5858b
LeftHandSideExpression : NewExpression CallExpression
function parseLeftHandSideExpression(state: ParserState, context: Context, pos: Location): any { let expr = parseNewOrMemberExpression(state, context); while (true) { switch (state.token) { case Token.Period: state.assignable = true; state.destructible = false; ...
1
29e032ae6668f2c5892bc01d7fbebe19
459d2f7fa921cc05c3558f8650dc0ea3
no op for this problem
namespace AoC.Day7 class Solver : PuzzleSolver protected override void PrepareSolution() { }
1
a5b67f77e2243d93ad01c89214328076
a43e1684fe88c08e2c6ad15f4c689dbf
Adds new fields to documents. $addFields outputs documents that contain all existing fields from the input documents and newly added fields. <p> The $addFields stage is equivalent to a $project stage that explicitly specifies all existing fields in the input documents and adds the new fields.
class SolrClient public function addDocuments(array &$docs, $overwrite, $commitWithin) {}
0
8bfb28153ffc86ff0334dd33a62fda76
1bd893d6f9d1768b8aa872515e4c41a3
Plot the pca result in 3D.
pca = PCA(n_components=3) tf_idf_weight = tf_idf_train.toarray() embedded = pca.fit_transform(tf_idf_weight) x_min, x_max = np.min(embedded, 0), np.max(embedded, 0) embedded = embedded / (x_max - x_min) fig = plt.figure() ax = Axes3D(fig) ax.scatter(embedded[:, 0], embedded[:, 1], embedd...
1
f663fab95eca08766ea4bbce123d654f
b55f2ee6a137bd76e5caef120b562b1a
<b>Platform Porting API:</b> Draws a straight line between the given coordinates using the current color, stroke style, and clipping data. <p> Related Java platform declaration: <pre> drawLine(IIII)V </pre>
public void drawLine(int beginX, int beginY, int endX, int endY, int colour);
1
21b2c3d2a510665dc5db563326498b76
844b956f8a374f8a407068b047bcea24
First we listen on port 0 which means the OS will assign us a random free port. This is the listener the server will serve on and the client will connect to.
let listener = TcpListener::bind("0.0.0.0:8080").unwrap(); for stream in listener.incoming() { match stream { Ok(stream) => { handle_connection(stream); } Err(e) => panic!("encountered IO error: {}", e), } } }
0
4a3a70bf1db6f8a6cd900dd15557549d
6329aa028a4cf239f9f2e755e90f9f14
表达是否为空白字符 -> ' ' , '\t' , '\n' 都算
public class JavaUtil public static boolean isBlank(char ch){ return ch==' ' || ch=='\t' || ch=='\n' || ch=='\r'; }
1
80c8d8f4673a2435bf2a7892538fd89c
c634bd23a1bedc7e6b5321bb2d70c448
add an article to the view history.
AddViewsById({ id, tag, title, duration }) { const sql = `insert into view (articleId, time, tag, title, duration) value('${id}', now(), '${tag}', '${title}', '${duration}')`; return query(sql); }
1
59365269fe30442f398c7758a6aa3a8b
31e4abc650bab929d90019698cf792e5
按照h264标准配置SPS和PPS共13+3+SPS参数内容长+PPS参数内容长
int SendVideoSpsPps(unsigned char *pps,int pps_len,unsigned char * sps,int sps_len){ RTMPPacket * packet=NULL; unsigned char * body=NULL; int i; packet = (RTMPPacket *)malloc(RTMP_HEAD_SIZE+1024); memset(packet,0,RTMP_HEAD_SIZE+1024); packet->m_body = (char *)packet + RTMP_HEAD_SIZE; body = (unsigned char *)pa...
1
0eb3daef8255de4ad346b01d711af732
8c4eb2d9b80705cf67831d14f288c255
Get Monthly view of calendar for validations
try { val returnList = arrayListOf<View>() val gl = view!!.findViewById<GridLayout>(R.id.calendar_table_layout) val cal = Calendar.getInstance() cal.set(Calendar.MONTH, month) cal.set(Calendar.DAY_OF_MONTH, 1) val dayOfWeek = cal.get(Calend...
1
28b1c915276462d7d4e7cf6606d18651
b3e3ec82407063754e8a8e0c467cf781
This function produces a semi-redundant batch of training samples from the location 'p' in the text file. For instance, assuming SEQ_LENGTH = 25 and p=0, the function would create batches of 25 characters of the text file (starting from the 0th character and stepping by 1 for each semi-redundant batch) as the input and...
max_ix = len(self.text) - batch_size - len_per_section * SKIP start = random.randint(0, max_ix) batchtext = self.text[start:start + len_per_section + batch_size * SKIP] sections = [] next_chars = [] for i in range(0, len(batchtext) - len_per_section, SKIP): s...
1
53dcc6a756f5c4cd972221b77fe287e2
265a84c35b9897c0b432cf9e74f28c10
支付失败显示dialog
public void onGetScoreDeductFailed(boolean isException) { progressDialog.dismiss(); Intent intent = new Intent(); intent.putExtra("payCount",payCount); intent.putExtra("TAG",0); intent.setClass(PayActivity.this,PaymentDialog.class); startActivityForResult(intent,1); ...
1
47e0cff8cc7f1947c249a60432eef0d8
d00bed18f7222f448308fe0d538b74aa
修改当前最中间图片对应按钮选中状态
public class PickBigImagesActivity extends Activity implements ViewPager.OnPageChangeListener, View.OnClickListener{ private void toggleChooseState(int position){ allimages.get(position).isPicked = !allimages.get(position).isPicked; }
0
54c4d367489134f4cb13f275dfaba989
e9e600ea813e1ada0b459b6e514f6587
Simulates thinking for a brief period of time.
{ try { sleep ((long) (1 + 100 * Math.random ())); } catch (InterruptedException e) {} }
1
0839f8889be041d3b74a64910bcefed5
52c237a3e8123076af02f9427cb05dd8
get team name from custom taxonomy
{ $taxonomy = get_query_var('taxonomy'); $tax_object = get_taxonomy($taxonomy); return $tax_object->object_type[ 0 ]; }
0
8fc016bc8d8237506ce42d6f2076f822
2e2bc0be123ad7589ce878e826d56236
Auxiliary function used to abort program execution if a communication error is received. Prints information about the error.
System.out.println("\nERROR: [" + err.GetErrorCode() + "] - " + err.GetErrorMsg()); System.out.println("*** Execution aborted *** "); System.out.println("\nPress <ENTER> key to exit . . ."); System.in.read(); System.exit(1); }
1
6ba05364236b46982f08acc14e5282ad
cca949ff95aa2136a3bced73dbc574f8
Apply menu changers to Menu.
namespace BindableApplicationBar [ContentProperty("Buttons")] public class BindableApplicationBar : Control protected virtual void OnMenuItemsChanged( DependencyObjectCollection<BindableApplicationBarMenuItem> oldMenuItems, DependencyObjectCollection<BindableApplicationBarMenuItem> newM...
1
b1aec2f2fc2aa85a49498032ee59971d
fad58f9f5cabc9199c79f0561ab56b6a
Sort the glyph pair adjustment records by glyph index.
static int CTL_CDECL cmpCIDs(const void *first, const void *second, void *ctx) { cfrCtx h = ctx; unsigned short a = h->glyphs.array[*(unsigned short *)first].cid; unsigned short b = h->glyphs.array[*(unsigned short *)second].cid; if (a < b) return -1; else if (a > b) return 1; else return 0; }
0
e24b1b0342e586725ddbea77926a235e
e4c44ea451b694e307e7233c530f4829
Tests the X matrix (the matrix exponential of the omega matrix)
void testRotationX(float theta, Matrix4 expected){ Matrix4 result = Matrix4::rotationX(theta); assert(result == expected); }
0
7b91cdd21cd5b0812a9f5bdc348f5955
49a294090c79535f1090c4201cd08dac
Gets all related buildings.
{ ObservableCollection<Level> newObjects = new ObservableCollection<Level>(); DataTable dataTable = dataSet.Tables["Levels"]; var query = from dataRow in dataTable.AsEnumerable() where dataRow.Field<int>("ParentId") == building.Id ...
0
b1f3c2a2ef948e692c1e065a55ce8a13
496fbcaaf37f65d305dc3ea7eeb1e5c3
Make a request to the WMS, returns an XML document wrapped in a Python file object.
r = _urllib.Request(url, xml) r.add_header('Content-Type', 'application/xml') r.add_header('User-Agent', 'Clockwork Python wrapper/1.0') result = {} try: f = _urllib.urlopen(r) except URLError as error: raise clockwork_exceptions.HttpException("Error connecting to clockwork serve...
0
c144c1476b1afc3c4d7e7bd77ddfd55c
579555a55e53c578b79b42eef988ad1a
Method to fetch the data of nonlinked dags
Variables modelHeader = new Variables(attributes); Variable classVar = modelHeader.getVariableByName(className); DAG dag = new DAG(modelHeader); dag.getParentSets().stream().filter(w -> w.getMainVar().getVarID() != classVar.getVarID()).forEach(w -> w.addParent(classVar)); dag.set...
0
60918c7492873a11eedb3e5d1f71cb1c
9f8f191b62b0d39154b18c6e5c71b18c
获取分舱信息,包括分舱总设备数,分舱总预警数,分舱内就地控制设备总数 { "num":xx, "alarm":xx, "local":xx }
getDevDistributionData () { let self = this stationOverviewService.getDevDistrition({}).then(resp => { let datas = (resp.code === 1 && resp.results) || {} self.contentCharts.deviceDistribution.zj = (datas.zj || 0) self.contentCharts.deviceDistribution.nbq1 = (datas.nbq1 || 0) ...
0
bb5cf47c94c8e52b92be1dabcdeaf757
b348a44af5989b4b529b49780f36acb1
Enumerates the values contains in the binary tree in in-order traversal order.
{ List<T> valuesInOrder = new List<T>(); if (node != null) { var leftResult = InorderTreeWalkInternal((BinarySearchNode<T>)node.Left); valuesInOrder.AddRange(leftResult); valuesInOrder.Add(node.Value); var rightResult = Inor...
1
c5da0fc162345d737eada43b18d60ffc
abd15c1acbd8c73c3af15fafac3e752b
Generic function for figuring out how much any package amount could payout with various different bonus percents
{ int result = 0; for (int i = 0; i < amount; i++) { result += Random.Range(1, 21) + eachBonus; } return result + totalBonus; }
0
c512ed4d26b377053913f2c2a517168d
c837b1a249545251a7ffb2b8f828c606
function to add new dragon to database
return fetch(`http://localhost:5000/add`,{ 'method':'POST', headers : { 'Content-Type':'application/json' }, body:JSON.stringify(body) }) .then(response => response.json()) .catch(error => console.log(error)) }
1
f72a24d43ba7cf544e1e82d58f422cc2
79ffbf9ed1d1125d5524989b58ab2854
to get the infor weather image uploading is enable or not in orgn for visit
{ string strQueryReadOrgId = "LOAD_LOGIN.SP_RESENDMAIL_NOTONCLOUD_VER"; OracleCommand cmdReadOrgId = new OracleCommand(); cmdReadOrgId.CommandText = strQueryReadOrgId; cmdReadOrgId.CommandType = CommandType.StoredProcedure; cmdReadOrgId.Parameters.Add(...
0
83fe8cc3217896aed454175f7eca912c
e523c4607d3e6acdfc8889897eb4afca
Skips ahead the number of elements requested and returns the elements after that many elements
{ if (start < 0) return (new List<ELEMENT_T>()); return (source.Skip(start).Take(count).ToList()); }
1
deabe49f71c12a3704ece3e96e88092b
df497530ef67087b59427e2fb19171e6
获取内存利用率的topn信息
@Controller @RequestMapping("/rest/monitor/dutyService") public class DutyServiceInvokeController @RequestMapping(value = "/getTopMemory", method = RequestMethod.POST, headers = "Accept=application/json", produces = "application/json;charset=utf-8") public @ResponseBody List<MODevice> getTopMemory(@RequestBody Map<St...
1
bb0e854992f64b43705972b6047ff8f0
d23ddb1250b24856ea271f769acb2f36
Disable automatic reconnection when queries fail due to a disconnect.
class BotFactory(protocol.ReconnectingClientFactory): def allow_disconnect(self): self.stop = True
1
b102810146afb4efe5404bd5252277f6
d6428c59a0281e55e5f06ee2614de774
@brief Write and array of observations to the specified JSON array.
size_t i = 0, ret = 0; jsonobject_p jnode; const char *r, *ptr = (const char*)records; if(o && JSONFIELD_ARRAY == o->type && flds && records && recordsize && recordcount) { for(i=0; i<recordcount; i++) { r = (ptr + (i*recordsize)); if((jnode = jsonobject_formentity((void*)r, flds))) { ret += jsonobject_...
1
01f63209385ff3e3c0a97e69dcc7daed
b94b531303d86e82c9ac0ab36c25bbd9
Creates a rectangle that results from expanding or shrinking the specified rectangle by the specified dimensions, in all directions.
namespace Emotion.Primitives public void ExpandSide(RectSide rectSide, int amount) { amount = Math.Abs(amount); switch (rectSide) { case RectSide.Top: Y -= amount; Height += amount; break; ...
0
4fee2ee757f056ae7930c2e565febf28
799f8cbf0bd282c75c047a365e7dfa49
Loads details about car found at the given URL
com.squareup.okhttp.Call call = carsCarIdGetValidateBeforeCall(carId, null, null); Type localVarReturnType = new TypeToken<CarDetails>(){}.getType(); return apiClient.execute(call, localVarReturnType); }
0
89e47b9fb07ded4e1a65f81a7da9dba6
4c0c2637eae32d013b3c92cd7299af67
load settings from DOM to settings object
el.autoLoadCheckBox.checked = settings.autoLoad; taxRate = settings.taxRate; el.taxSpan.textContent = `${settings.taxRate}%`; switch (settings.fontSize) { case "x-small": el.root.style.fontSize = "10px"; break; case "small": el.root.style.fontSize = "12px"; break; case "norma...
0
b209f7b00abf0df34e749957ab2ccef1
4ac339f80c2295daed4dea93ef83c11d
Add various fields used by the Splunk Django Bindings.
return { "hidden_fields": ['port', 'schema', 'extra'], "relabeling": {'host': 'Connection URL'}, }
0
c8da4fd262b21c4b37f4d17c17eb74eb
8abf2357303f39ae2f35b2f1f2cb598a
Создание копии всех учеников в списке
class ResultController extends Controller public function resultTableAllCopy(Request $request){ $students = Student::get(); return view('layouts.resultTableAllCopy')->with('students', $students); }
0
21ebdea42ad7bb9cee06d891120dc28c
aeefc8db35429f6b2606f9fcce257ff9
Copy requirements files.
class TestRequirements(unittest.TestCase): def test_requirements(self): requirements = pkg_resources.parse_requirements(_REQUIREMENTS_PATH.open()) for requirement in requirements: requirement = str(requirement) with self.subTest(requirement=requirement): pkg_resources.require(requirement)
0
02daf60894d7099735d59342ffdc68af
eaa93a2c89775b9e0f5d9445d98b5e88
Gets a decimal converter
public class ValueFormatters public static ValueFormatter getDecValueFormatter() { return decFormatter; }
1
d92506e27ed4ca32b8b4de4311c4d8ba
51ff930eddcb064330117fc5a104f026
Excludes the specified data member.
public abstract class SelfReferenceEquivalencyAssertionOptions<TSelf> : IEquivalencyAssertionOptions where TSelf : SelfReferenceEquivalencyAssertionOptions<TSelf> public TSelf Excluding(Expression<Func<IMemberInfo, bool>> predicate) { AddSelectionRule(new ExcludeMemberByPredicateSelectionRule(predicate)...
1
72a85dc041e2b0b39165c6545fa05980
8086a2152ce39591fc425dffaec95e09
IP configuration command handler. Provides commands to config IP address mode (DHCP/STATIC) and IP address, netmask, and gateway.
def apply_ip_address (address = None, mask = None, gateway = None, addr_type = None, save_args = True, args = dict ()): result = {} if (save_args): if (address is not None): args["ip_address"] = address if (mask is not None): args["netmask"] = mask if (gateway...
1
f82bb2eb6e683e1b0b78f89ff28c9ef3
230fb50a46968c4fcb773a479b9e9160
获取用户投资排行榜
@ResponseBody public Map getInvestorTopList(HttpServletRequest request) { LogBean logBean = new LogBean(); logBean.setApiName("getInvestorTopList"); Map<String, Object> resultMap = new HashMap<String, Object>(); TreeMap treeMap = new TreeMap(); try { JSONObjec...
1
d8e34010dedf1162c2563ee93a7ac8ba
3c326a05e782cdd076f3fdfa1da0e6e0
GET: ActualizarCliente
{ try { return module.UpdateCliente(item); } catch (Exception ex) { System.Diagnostics.Trace.WriteLine(string.Format("NIVI Error: {0} , NameSpace: {1}, Clase: {2}, Metodo: {3} ", ex.Message, MethodBase.GetCurrentMethod()...
1
c247247990ef6ce67d6718bddb44662d
25ef31e08cc42f8171ab3d3224aa0d0d
This method searches for a room in the list input:a given room_id output:the room with the given room_id
public class ReservationService IRoom getRoom(String roomId){ IRoom foundRoom = null; for (IRoom room : allrooms) { if (room.getRoomNumber().equals(roomId)) { foundRoom = room; } } return foundRoom; }
1
badc6c76178c96f66ecd94e8d1c1bab1
d369289e631d5e7aa10808ffb40f109e
格式化注释到json中
final class Doc public function initializeAnnotationJson(Annotation $annotation): void { $data = $this->getApiAnnotationJson(); $ruleData = $this->getRuleData( $this->annotation[0][$this->rule->getRule()] ?? $this->annotation[1][$this->rule->getRule()] ?? [], $this->rule ...
1
0e6969e8e95fa7d61a4b078124e34a5d
74b22c11f18815aaf0a5c821338b998d
Clear area around clicked zone.
local c_pos = chunk_from_tile_pos(pos) for i = -chunk_radius, chunk_radius do local x = c_pos.x + i for k = -chunk_radius, chunk_radius do local y = c_pos.y + k if (this.list.map[x] and this.list.map[x][y] and (this.list.map[x][y] == -2)) then this.list.ma...
1
b5f31a6fe276ff831bb7aa3c5c4b4d8e
d01e886eba17a1f6ad6d5039f7bb0d3e
Checks if exists simple structure 'IdEntity'.
public function hasId(): bool;
0
c0b9a90acdaaf085472b9a894e3bfa2d
ea3e40f9c8fa63610be5f595b1da92bd
deal with the item with multiple regions but one of them contains others
class TextGrouper(object): def merge_item(self, item): if len(self.areas) == 0: self.areas.append(TextArea(item)) return closest = None for num, area in enumerate(self.areas): if item.props.get('type', None) != None: if area.props.get('type', N...
0
a3f4dea35ab68fe0f3c3f13744934c2c
f90911115f6b0100ef3bdbddbda4ab93
封装从数据库获取的 url和对应的role
map = new HashMap<>(16); List<Map<String, String>> roleAndPermissions = permissionDao.findRoleAndPermissions(); for (Map<String, String> roleAndPermission : roleAndPermissions) { String roleName = roleAndPermission.get("name"); String url = roleAndPermission.get("url"); ...
1
8503728bb0f133e62c33b812f49bcd2c
594fd2fa18d6b1738fa646f99a7735de
弹出循环队列里的元素
class CSqQueue: #循环队列类 def pop(self): assert not self.empty() self.front=(self.front+1)%MaxSize return self.data[self.front]
1
e6e42d03c3a01fe9eaf1895dac06bc75
cb2099e446d478a4b6f902c9e1ebd181
批量新增多个员工在指定时间段内的考勤流水记录
@Insert({ "<script>", "insert into attendes(workerid, hasattend, confid)", "values", "<foreach collection='lists' index='index' item='item' separator=','>", "(#{item.workerid}, #{item.hasattend}, #{confid})", "</foreach>", "</script>" ...
1
ea8b4797518963d9a4f94eeb10c11f6f
a3decc06d20921b909e9fe0603eb4d6c
Покраска блоков плитки в Модели (без блоков АКР-Панелей)
{ string Fullcolorresult = "NONOfset"; foreach (var material in BoxMaterials.Where(m => m.Material.GetType() == typeof(DesignPaper) && m.Material.FullColor)) { if(material.Material.Name.Contains("Ponton")) Fullcolorresult = "A1"; ...
0
b4034e4caad31d682bf7ad6d9509822b
24cba91e37e080f9bd99e6cdaa515f22
================================================================== FUNCTION ORDERED_LIST_LINEAR_DELETE DESCRIPTION Searches an ordered list for a matching item and deletes the item. The match is determined by means of a user-provided compare function. ====================================================================...
listNode* deleteNode(listNode *front, void *toDelete, int(*comparator)(void *, void *)){ listNode *temp = front; while(temp->next != NULL){ if(comparator(temp->item, toDelete) == 0){ break; } temp = temp->next; } if(temp->next == NULL){ return front; } else{ listNode *placeHolder = temp->next; if(t...
1