query_id
string
corpus_id
string
query
string
code
string
label
int64
246c5b23fb168392c7577f6cbe7d2cd1
d135c2b9a6018cf8f5a56b57776ceb30
Handles the ButtonClick event of the repositoryItemButtonEdit1 control.
{ CubeXRepositoryDatabaseViewer data_viewer = (CubeXRepositoryDatabaseViewer)sender; RepositoryDatabase new_value = (RepositoryDatabase)args.NewValue; if (new_value != null) { data_viewer.SetRepository(); } }
0
9e3f79b0609ae476b86495e38bd1e107
acda61dba9b68fe34dec71fdcf1c197c
Get's the current true anomaly given the time of measurement. (the current angle)
class Orbit_anomaly(): def get_lambda_na(self,omega,gmst,omegapoint,deltatime): lambda_na=omega-(gmst+omegapoint*deltatime) return lambda_na
0
fcfda3b0b023eae5888b47c4ddfd4888
fdbd742eaccb1594e38da35558d1c9cf
根据考试计划id获取考试计划
Plan findPlanByPlanId(String id);
1
97ee73e6c6067642fef2521e7c0e9f91
5d1fe250c5bc04af9c8008f640423963
仙宗图标选择, 左
if (self.m_type == self.PveStarType) then brushIcon.Size = Size(21, 21); brushIcon.Background = uiSystem:FindResource('pve_xingxing_1', 'godsSenki'); else brushIcon.Size = Size(26, 26); brushIcon.Background = uiSystem:FindResource('renwu_huoli', 'godsSenki'); end end
0
7ba76446ebbf0f5eb7216dc2d135cb76
4cd0c5d929317ea1a2d7b66afd821ea4
Función que permite asignar desplazamientos conocidos a los grados de libertad restringidos
void prepararObjFunc(int* FUNCTION, double* lb, double* ub) { switch (*FUNCTION) { case 0: *lb = -5.12; *ub = 5.12; break; case 1: *lb = -100.00; *ub = 100.00; break; case 2: *lb = -600.00; *ub = 600.00; break; case 3: *lb = -32.00; *ub = 32.00; break; case 4: *lb ...
0
d07b85d1acf5bd9404dda8c2285f5961
7d83732fb24ad17b374ad5199555e55b
Check if both type specifications are integer.
class Typecheck : public Visitor void checkset_arithexpr(Expr* parent, Expr* child1, Expr* child2) { if(child1->m_attribute.m_basetype != bt_integer || child2->m_attribute.m_basetype != bt_integer) { this->t_error(expr_type_err, parent->m_attribute); } parent->m_attribute.m_basetype = bt_i...
1
a936274b292e3ca253df76c88343ff90
5440efc9a675719d8a00777823841767
ビルボード用姿勢セット
namespace AppRpg public class ActorEffBase : GameActorProduct protected void SetBillboardMatrixY( DemoGame.Camera camera ) { Vector3 look = (camera.Pos - BasePos); look.Y = 0.0f; Common.MatrixUtil.LookTrgVec( ref BaseMtx, look ); SetPlace( BaseMtx ); }
1
dbc38e51b43c10f6081acb4605037d94
f17386a1b044712aaa0470a1abf426c2
we want to process search results as long as the dropdown is open
class ProductSpecificSearchResultsDropdown extends Component componentDidMount() { this.props.isDropdownOpenCallback( true ); }
0
0a1d85629c1d61331bc30b1b0ce959dc
41d8349eae9ec2d1c16780ea230caf96
Testea la funcion left_rotate
void test_leftRotation(void){ Node *root = &node60; setNode(0, &node60, &node30, &node110); setNode(0, &node30, &node20, NULL); setNode(0, &node110, &node80, &node150); setNode(0, &node80, &node70, &node90); setNode(0, &node90, NULL, &node100); setNode(0, &node150, &node130, NULL); root = leftRotation(r...
1
e90cab537b0e9f48e59c6e95cd5c0fc5
c3df54a157a30404a152b2e27276a0ee
Returns a dictionary with property id to property name.
class PageSelector(Dictable): def list_properties(self, camel_case=True) -> dict: return self.to_dict(camel_case=camel_case)
0
e5c7c3decd15e43e020b0ed98af009a2
e0e5c90e11fb901a152bb5a636d0e6e5
Update database to version 0.9.0
_deprecated_function( __FUNCTION__, '3.1.0', '\StudioPress\Genesis\Upgrade\Upgrade_DB_2100::upgrade()' ); ( new Upgrade\Upgrade_DB_2100() )->upgrade(); }
0
2858e6fe605bbed375b66dafeb292376
9b5d8fd0c41f22c909a9fdbde6ad2abb
Sets the keystore type. <p> If not specified then the JDK default type will be used (see {@link KeyStore#getDefaultType()}). </p>
public class RabbitConnectionFactoryBean extends AbstractFactoryBean<ConnectionFactory> public void setKeyStoreType(String keyStoreType) { this.keyStoreType = keyStoreType; }
1
943695aabf0fc09e39abdc297871c9b0
355b1a7c2e816a95c743e2102b5dff12
Converts unsigned int to float
public class FP public static float toFloat (int x) { return ((float)x)/65536.0f; }
1
af982a5e0107990c32fc59dded6df158
b68feb5150fa64ade4eb3b8e6ee3238d
Méthode permettant de récupérer TOUS les voyages
class DLAPI(): def pull_all_voyages(self): return self.__dl_voyages.pull_all_voyages()
1
fccdb86d738aef9604cc5811f4b61969
fbb8043a97c9889dbfbcd9392f6c2a46
modify a lock code (re-key a plugin or metadata db)
int setlock(int deviceId, unsigned short code) { int result; result = OmSetLock(deviceId, code); if (OM_FAILED(result)) { printf("WARNING: OmSetLock() %s\n", OmErrorString(result)); return 0; } printf("INFO #%d: OmSetLock() to code: %d %s\n", deviceId, code, ((code == 0) ? "(rem...
1
dc5ca6d1955af324c21274b9e3fd156c
eff3146e43ca527663edeb918792f02c
Setter for <code>NBC_DIAG_SYS_HIS.SHORTS</code>.
@Generated( value = { "http://www.jooq.org", "jOOQ version:3.8.0" }, comments = "This class is generated by jOOQ" ) @SuppressWarnings({ "all", "unchecked", "rawtypes" }) public class NbcDiagElektaRecord extends UpdatableRecordImpl<NbcDiagElektaRecord> implements Record10<Long, Long, Long, St...
1
60cc3c848a15d8f6a9f5f403ca91f960
3c9f8805e869da2b2c09f9181b038037
Writes a value for the <code>radius</code> property as a <code>number</code> value. The <code>radius</code> property specifies the radial limit of the pyramid.
if (jsBase == null) { this.innerRadius = null; this.innerRadius1 = null; this.innerRadius = innerRadius; } else { this.innerRadius = innerRadius; if (isChain) { js.append(";"); isChain = false; } ...
0
3bc13b73d82316670fc9422d68ff8df7
606c46df106f6b33edd87eca1dcdb1ef
Result에 뜬 위도경도들을 DB3에 저장하는 코드
async def main(): df = pd.read_json('snipper_result.json') geocode_name_list = df[['address', 'name']].fillna( '').agg(' '.join, axis=1).values await initSessionAsync() loc_list = [] for loc_name in geocode_name_list: if len(loc_name) > 30: loc_name = re.sub(r'(.*?)', '',...
0
079c15c5af8cb57efc9d94c49beb131a
37f6f5506c7fac87fb6f966fde024425
Convert multi-part geometry of GeoDataFrame to single-part geometries.
check_gdf(gdf) gdf = gdf.reset_index(drop=True) is_mpoly = gdf.geometry.geom_type == "MultiPolygon" if ratios and is_mpoly.any(): union_area = gdf.geometry[is_mpoly].apply(shapely.ops.unary_union).area if (union_area != gdf.geometry[is_mpoly].area).any(): raise ValueError("Ge...
1
5e917b2f4eae5d0f6a3bb3ab3b35905f
b5584c6bcbbecbe1d1fc2c08a42c0c8f
find the nearest date before a given date
class DAT public static function prior($date, $comp) { $one = DAT::toSecs($date); if (! $one) return $comp; $two = DAT::toSecs($comp); if ($one < $two) return $date; return $comp; }
0
dc0198918e7b01d83168e2d5b1ce44de
b87054aedf08f99ea3b32c00ff3e3980
Implementation of ::kxml::logic::distributed::ConsistencyManagerSrv::createUserDist
namespace Microsoft.Protocols.TestSuites.ActiveDirectory.Adts.Samr HRESULT SamrCreateUser2InDomain( IntPtr domainHandle, string userName, uint accountType, uint desiredAccess, out IntPtr userHandle, out uint grantedAccess, out uint rela...
0
7f3f14d9d6a1ee22d342e72eeb910458
e68824181ebffbc59958f7fbcef3de44
设置悬浮窗移动时是否带动画
public class FloatWindow public static class With public With setMoveAble(boolean moveAble) { this.moveAble = moveAble; return this; }
0
d2ec7e4caa8278321b6a7abfcea256a0
b608afd07a723cb9f980d40769d3da2c
Whether the claim specified by the client is necessary to ensure a smooth authorization experience.
ClientRegistration clientRegistration = userRequest.getClientRegistration(); if (StringUtils.isBlank(clientRegistration.getProviderDetails().getUserInfoEndpoint().getUri())) { return false; } if (AuthorizationGrantType.AUTHORIZATION_CODE.equals(clientRegistration.getAuthoriza...
0
7d90271750bdd08c30983c1c759a8524
b81b2300d98b51219e3b8db0987eeb50
初始化指针图片的Bitmap
public class PictureView extends AppCompatImageView private void init() { initBitmaps(); bitmap_index = 0; mBitmap = Bitmap.createBitmap(draw_Width, draw_Height, Bitmap.Config.ARGB_8888); mCanvas = new Canvas(mBitmap); mCanv...
1
a34c7c621efd0f62346fef52ce12ec01
37e5386c935598ef1d72b5902e221a18
This adds a property descriptor for the Replication Factor feature. <!-- begin-user-doc --> <!-- end-user-doc -->
itemPropertyDescriptors.add (createItemPropertyDescriptor (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_Set_reorganize_feature"), getString("_UI_PropertyDescriptor_descript...
0
765616ff04884e0441006467a614b8e9
2d8b4e53efe3afe6f903b06118da593c
Получает строку данных из базы данных MySQL в соответствии с запросом
{ $connect = mysqli_connect("localhost", "root", "root", "readme"); mysqli_set_charset($connect, "utf8"); if (!$connect) { $error = mysqli_connect_error(); $answerDataBase = print("Ошибка MySQL: " . $error); } else { if ($result = mysqli_query($connect, $sql)) { switc...
1
85b25d5eddb2dffd87a561ea5b6ba21e
6a3f1fe95bbb517365b23347d0e80195
GET /educational-records/count : count all the educationalRecords.
def count_records(records) records.count(:all) end
1
c5598765ce62506af9d38e967c14f2a1
ccb17c6db2fe6336e2d8d74e1e96be15
模板1:只有一个标题
public class POIWordUtil public static void addTileOne(CustomXWPFDocument doc,String title){ XWPFParagraph paragraph = doc.createParagraph(); XWPFRun run = paragraph.createRun(); run.setText(title); paragraph.setStyle("我的标题 1"); }
1
f964067b8ca9dfd6ffd30c8a338b7b85
08faa7e3ccfb8821488b53e7ddaa46ad
Clears UI when there is no result returned.
public class GracenoteMusicID extends Activity implements SpotifyPlayer.NotificationCallback, ConnectionStateCallback private void clearResults() { statusText.setText(""); metadataListing.removeAllViews(); }
1
5df9b82dade75c67745b6cfe433847be
6a2b4a3ddfbe782715706fada045ec68
Returns the value of the '<em><b>VId</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>VId</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
String getCVId();
0
9ebd3507adb0a9f8855840f462fcfccb
4fee4fe5bdc70f7ea2bc0ad87ad45439
Dummy function needed to interface to upstream ptp.c/ptp.h files.
void cxgb4_ptp_remove(struct adapter *adapter) { if (adapter->ptp_tx_skb) { dev_kfree_skb_any(adapter->ptp_tx_skb); adapter->ptp_tx_skb = NULL; } if (adapter->ptp_clock) { ptp_clock_unregister(adapter->ptp_clock); adapter->ptp_clock = NULL; } }
0
78360907e670e148b77d7ed2fce24d6a
f4732e4063dfc3d51e77c48d70d1c12f
formula for level using log base 2 (Note:floor rounds down)
unsigned int squaresNeeded(long long n) { return std::log2(n) + 1; }
0
f4c18b2db756b783bb32c46bf715190c
656f4f5051cd3073ac25f392f83a434c
return a subset of GeneCollection object and return a new one without changing the original set
adata, text_file=None): gene_list=[] if text_file: for line in open(text_file,'r'): gene_list.append(line.rstrip('\n')) return adata[:, [(gene not in gene_list) for gene in adata.var_names]].copy()
1
278882d469c1fc604250999ffb6203d0
3b3c2faea631344339805636a65110fc
Σ1 function
def sigma_regularizer1(x): input_size = 25. f_s = tf.math.softplus(x) return - input_size * tf.reduce_mean(1. + tf.math.log(f_s) - f_s , axis=-1)
1
9abe18d00194311f493a088ff7461b0e
40ffbac99b20e8ac4a8826968435b8ac
Find the given render target and place it in the free pool
namespace Engine.Core public class GameEngine public void RemoveRenderTarget(RenderTarget target) { Renderer.RemoveRenderTarget(target); }
0
27dea0059762d476295b4efb6c71a1ff
8d1caaa5d202c92b20c21335b5765041
Checks whether the target exists in the scene or the initial state will set to wander.
return not inst.sg:HasStateTag("lure") and FindEntity( inst, TUNING.WORM_TARGET_DIST, IsAlive, RETARGET_MUST_TAGS, RETARGET_CANT_TAGS, RETARGET_ONEOF_TAGS ) or nil end
1
66ab3b066c12d2a6646a1a990ec3c046
2b0d7fe12379d66d7961f6a7eac87d82
将stream规约成list的2种方式
public class StreamAPITest @Test public void test1() { List<String> list = new ArrayList<>(); list.add("kiki"); Stream<String> stream = list.stream(); Stream<String> parallelStream = list.parallelStream(); int[] array = new int[] {1,2,3,4}; IntStream intStream = Array...
0
79d9055a892ce515f1437764f6e82d6a
e0c1e27cc80771106de78a5d01728022
Make an aggregation of values for each tree data in val_fields Aggregation is done with gr_fields list (first : parent, second : child... etc)
df_grby = grby_rename_agg(df, grby_keys, agg_dict) df_merge = pd.merge(df, df_grby, left_on=grby_keys, right_index=True, how='left') return df_merge
0
481fa7874d402df46a6c392c4861cf91
0da6ec53b382aa94cec0cac2e6dca35e
Метод получение кода положения точки относительно окна по алгоритму Коєна-Сазерленда
{ double k = Math.Ceiling((Math.Sqrt(n) - 1) / 2); double t = 2 * k + 1; double m = Math.Pow(t, 2); t = t - 1; if (n >= m - t) return new Point((int)(k - (m - n)), (int)-k); m = m - t; if (n >= m - t) ...
0
b31d84f7fe2fddaa3f77f21b1a8e50c5
3ab7a8ba1cef9d2ba13fbffd7a759489
Model tuning based on KFold split and GridSearch
print("\nTuning KNN model with GridSearchCV\n") param_grid = {'n_neighbors':[3,5,7,9,11,13,15], 'weights':['uniform','distance'], 'algorithm':['auto','ball_tree','kd_tree','brute'], 'leaf_size':[10,20,30,40,50,60,70,80]} grid = GridSearchCV(KNeighborsCla...
1
702e67ab99b8c7462b80a883e095394d
cee5db9a0dcd046d71dd5563d9d7a312
返回所有未删除的业务类型
List<Business> findAllNormal();
1
636b25c1051d78dc32eb1c941f857bce
2a976dc53105297e873391a0a4974af8
We have to convert nullable value types to System.Nullable
{ if (value == null) return null; return Convert.ChangeType(value, TypeUtil.GetUnNullableType(conversionType)); }
0
a40defb043613f0f6b576c7299d3cd67
c46c4bb649d5011aba3c7f4a104eb8c3
获取玩家报名期间更新战斗信息的冷却时间
function NetworkMsg_Arena:onGetCoolDown(msg) LuaTimerManager.fightArenaCDTime = msg.time ArenaPanel.remainTimes = msg.fight_count end
1
4e4415d48bbdda688e2ca51a83c1c1bb
8be042966d2b7d688d34aac8d31996f3
创建数据表,建表时自动判断是否有id字段,如果没有,自动添加,然后将id设为主键
String dsname, String db, String table, boolean updateIfDuplicate, boolean saveExtendColumn, boolean isAutoIncrement, boolean isUseDefaultId);
0
24a0faad80bffb7739e1b4ce9d136e8b
9f545b2d1da06f9fceb27c5ac77e12d5
判断能否开除
function GuildDataHelper.checkCanExpelGuild(time) local UserDataHelper = require("app.utils.UserDataHelper") assert(type(time) == "number", "Invalid time: "..tostring(time)) local sec = G_ServerTime:getTime() - time local timeLimit = tonumber(require("app.config.parameter").get(ParameterIDConst.GUILD_PROTECT_TIMES_...
1
7ede159553b72ef39fe560080ff8ba8b
64be64d2790d3d5452019f4970895924
UpdateLang updates language sources for the specified state
namespace Cebos.Veyron.Dal public partial class ProcessDAL public void UpdateStateLocalization(StateLocalizationDto dto) { if (dto == null) throw new ArgumentException(string.Format(CultureInfo.InvariantCulture, Resources.NullArguementException, "dto")); using (var ctx = ConnectionMa...
1
fb0e4c67e030bb170bb402f68b79e9f2
3dae4f9b65372af47159a3b0763adc92
Returns true is the stroke has been set or false otherwise.
boolean isSetStrokeWidth();
1
e610ee64bd63b1240fe4c1c58725a992
f375cc0408766fbb075eca064ea2f85f
Method to get Global top 50 tracks
getTopTracksMethod = "user.getTopTracks" formatValue = "json" input_set = {'overall', '7day', '1month', '3month', '6month', '12month'} inputString = "\nInput the time period desired in the following format:\n'overall','7day', '1month', '3month', '6month', '12month'" print("\nInput the time period de...
0
5846877e318c6159d7ddcda3e9c6309c
9b0db2f519cb041eadfd93fad3379fa7
Indicates whether given position is inside the knob.
{ var cornerSize = 11 - offset; var outerLimitLow = (numModules - cornerSize - 1); var outerLimitHigh = outerLimitLow + 8; var invertedOffset = 4 - offset; return (x >= invertedOffset && x < cornerSize && y >= invertedOffset && y < corn...
1
ad191c7ff369d248b9ccf0771bcd2db6
8e7f6a0c2f6a83e45425c72171c6732e
Gets the problem mask.
namespace Unity.MLAgents.Actuators bool[] GetMask();
1
d14095e721902548429e5b6bb9cf28ae
5e131a630f5a5b072606642762cac02a
broken because of a space instead of underscore
class Store def name_with_underscores name.gsub(" ", "_") end
1
ab3bff0cd533d2e64e180db7d07a5f2d
018253002d7f0215dbc67be6d354bbeb
Draw a rectangle, only border.
{ if ((width <= 0) || (height <= 0)) return; int x2 = x + width - 1; int y2 = y + height - 1; pgfx_vline(x, y, y2); pgfx_vline(x2, y, y2); pgfx_hline(x, x2, y); pgfx_hline(x, x2, y2); }
1
8e2d0dcd8a1d219de6a8354d048bd8bc
ed38de31b114a79df9469cdc4e98a73c
ブロックの入力一覧を返す。
public class CreateSuperFileParam public List<String> getBlock_list() { return block_list; }
1
fa3a1913dad92f8313325bb21f46d3af
5a25d34a671db35bff3d346eff763234
根据配送方式分线上线下分别减去库存
$shipping_reduce_way=C('SHIPPING_REDUCE_WAY'); if(empty($condition)){ $return_result = [ 'code' => 2, 'msg' => '参数错误', ]; return $return_result; } $flag=true; $template=M('shipping_goods_shipping_template')->find...
0
f01659ff1c88bf3b837d810364337572
328c6954af0d9823828b9060869abc10
Test checking for new mangas and make sure 'pings' are sent out correctly
class UserAccountModelTests(BaseTestCase): def test_ping(self): u = UserAccount(email="cat@wow.com", username="cat", password='cat') db.session.add(u) db.session.commit() time.sleep(2) last_seen_before = u.last_seen u.ping() self.assertTrue(u.last_seen > last_seen...
0
b3230091259c49fd88581ad358f9c329
84575be97b1403091fe2e5bb0cc3a379
Gets a mutable reference to the value for the specified property.
namespace Jeebs.Reflection public static class ObjectExtensions public static Option<object> GetPropertyValue(this object @this, string propertyName) => GetPropertyValue<object>(@this, propertyName);
0
e6e1e7dfa88c751d404467c797faeef1
a148d6570d45823241ffebc9d26bdb44
파일처리현황 그리드에 값 반영한다.
{ msgImgFile.CurrentCell = msgImgFile[0, 0]; if (string.IsNullOrEmpty(Convert.ToString(msgImgFile.CurrentCell.Value))) { msgImgFile.CurrentRow.HeaderCell.Value = Convert.ToString(msgImgFile.CurrentRow.Index + 1); msgImgFile.CurrentRow.Cells[0].Value = FileName; msgImgFile.CurrentRow.Cells[1].Valu...
1
b039edd0285241ba081d74e43980e432
901fc213449570d17c16ca87db620415
Triggers the rebalance operation.
class EnterpriseBackupMergeBase(EnterpriseBackupRestoreBase): def rebalance_with_ops(self): ops_tasks = self.async_ops_on_buckets() self.rebalance() for task in ops_tasks: task.result()
1
1714b884dfb8395fe9f92d53c680ab5d
25ac58c721dd3aac30da4c2a55466fcd
Import all CSV data to a SQLLite database
namespace beRemote.Core.StorageSystem.SqLite class SqLiteMgr : StorageBase.IDbPlugin public void ImportDatabase() { ImportDatabase(_Com.DBName + ".export"); }
0
f62112b68f0ebebc1699fa4a0c4fb8c8
d0814e6a584e8ab455811056b5f20824
Отобразить список ресурса в зависимости от выбранной категории.
{ switch ($category->prefix) { case 'service': $query = Product::root()->inventory()->category($category)->so(); $view = 'page.product.list'; $is = 'page.service'; break; default: $query = Post:...
1
1c301e45e67013ac864b8ec157a82a37
7ab6d5729e9088274bb1070d508d2b7d
Return true if given product is an application product, false otherwise.
def is_prod() -> bool: return False
0
13bc8b83c808bb3345c33caa42c48b54
6363c38496258e137914af5d86135173
選択されたグループに選択されたオンラインメンバを追加する
var csrfHeader = $('meta[name="_csrf_header"]').attr('content'); var csrfToken = $('meta[name="_csrf"]').attr('content'); var radioVal1 = $('input[name="group"]:checked').val(); console.log(radioVal1); $.ajax({ type : "POST", url : "chat_AddMember", data : { searchNumber : radioVal1 }, beforeSend : ...
1
77f23f6832e0fcb47bbc35863f6ab3e3
1bc160116c21a0f4ab145f654a603b99
Tests the GetSanitizedEventValues function.
expected_dict = { u'my_number': 123, u'display_name': u'log/syslog.1', u'timestamp_desc': u'Content Modification Time', u'timestamp': self._event_timestamp, u'some_additional_foo': True, u'hostname': u'ubuntu', u'filename': u'log/syslog.1', u'data_type...
1
1056bb7eb6d72a60f796468ab6387d87
8fc45dd763e021c5987b419262cc1da5
Test parsing an axis reference.
@DependsOn(FormattingTest.class) public final strictfp class ParserTest @Test @Ignore public void testCoordinateReferenceSystem() throws IOException, ParseException { parse(new ReferencingParser(), "CoordinateReferenceSystem.txt"); }
0
0999052f2834c5e0477411bcdf80354d
003b0defcc7be52ac9e16ce7fea294fe
Returns a delegate base property map from which values will be derived if not found within the local property map.
if (!propertyValueMap || Utils.isEmptyObject(propertyValueMap)) { propertyValueMap = {}; } _.forEach(basicProperties, function (prop) { if (WM.isUndefined(propertyValueMap[prop])) { propertyValueMap[prop] = s...
1
0bc4156ee032157413ef6dfac3dfc5b2
57969ac222664d0364e4ed76524e173f
Swap long endianness and return the swapped value.
int32_t swap_int32 (int32_t val) { val = ((val << 8) & 0xFF00FF00) | ((val >> 8) & 0xFF00FF); return (val << 16) | ((val >> 16) & 0xFFFF); }
1
ea1b1dca16e433e3c761a26af6b9199b
d05213ec82eea269cbf2b991c0a3423a
根据ActionId,获取Action类的路径
public class ALFrameManager extends ALModule public String getBehaviorPath(String id) throws CallError, InterruptedException { return (String)service.call("getBehaviorPath", id).get(); }
1
6c9814a5c06c7e2b613e4c909d9fe3cc
99a0c2306667843d316c61933c878a3b
draw rectangles and Strings in different colors
def drawRects(): rectW = 50 rectH = 100 rX = 150 rY = 0 box1 = pygame.draw.rect(screen, (255,106,106),(rX,rY,rectW,rectH)) rectH += randint (0,40) box2 = pygame.draw.rect(screen, (255,48,48),(rX+50,rY,rectW,rectH)) rectH += randint (5,40) box3 = pygame.draw.rect(screen, (238,44,44),(...
1
44eeaf9a1c3178ee8098d886a864c332
722585b3ea5ed48de0a24f9e2aa2dc09
使用了WinAPI来移动控制台的光标
{ COORD coord; coord.X = x; coord.Y = y; HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); if (!SetConsoleCursorPosition(hConsole, coord)) { } }
1
9af1e813f33ca60754aa6d6186bdfbb3
0bb7a8d4c1add4d47dc88f57966f0b26
测试auth方法,当email错误
class RegistrationTestCase(BaseTestCase): def test_email(self): res=self.client().post(self.full_url('auth/signup'), data=json.dumps(self.data["invalid_email"]), content_type='application/json') self.assertEqual(res.status_code,400)
1
c231edad16115756a9e59f4abf288333
8ee463ea78c9f977c45e58ae2cb4957a
Map Path
class StaticPathMapper implements PathMapperInterface public function mapPath($path, $build, $development) { if (substr($path, 0, 1) === '/') { return $path; } return $this->basePath . '/' . $path; }
1
6e7b9da91ffc3a237c69daf52637d4f0
95872988d4067d01a231e5f2acda3a59
Gets the enabled state of component (wtDisciplinaryEditInput)
namespace ssCaseConferencing.Flows.FlowLearnerView public class ScrnLearnerDetailsDisciplinary: OSPageViewStateCompressed, IWebScreen, INegotiateTabIndexes, IBookmarkableURL public bool inputwtDisciplinaryEditInput_isMandatory() { return false; }
0
f41eed81af0d81b294c91c9c7b2dccb8
40cc917641d7af22ffad7b40ba47700a
检索发货单的付款记录
export class ReviewDetailComponent implements OnInit getPayRec() { let url='/agentOrd/loadAgentOrdPayRec'; let data={ ordno:this.ordno } this.PayRecData=this.submit.getData(url, data); }
1
bf99191d52a72403c4109ab7022d3a25
bb1752a266b72631d4356471784324d3
Returns the document host (used into references...)
public abstract class AaiNode implements IAaiVisitable public AaiDocument ownerDocument() { return this._ownerDocument; }
1
409bc2c5391ea74315ae03672681a509
07ea418cae372e8909639553f37cfff5
Handles submission of form data and posts it to backend
function formHandler(event) { event.preventDefault(); console.log(event); submittedComment.name = event.target.name.value; submittedComment.comment = event.target.comment.value; form.reset(); axios.post(getData, submittedComment, headers) .then ((response) => { console.log(response.dat...
1
49e10a2ca0999de8941b02a79674dfe4
23fc52f01a0cb56b44ac8184fb94a01e
Determines if this {@link PaymentGatewayPluginInvoker} is resolved.
public boolean isResolved();
1
05af97be1121a663f0f04a397be880db
ebfccdb158224062fb47c7e2c20be147
function to determine whether a hand as two pairs
def pair(hand): if hasMultipleCardsWithSameRank(hand,2) == 1 and not hasMultipleCardsWithSameRank(hand,3): return True return False
0
273187c6a208a2374a7c5e338e875e95
f51ab410bbc987e4c2bbd1148f22f119
Give a user a role.
async def add_role(request: Request, user_id: int) -> Dict: return await services.add_role(request, user_id)
1
45414ce84da603ce25b6041026acdfe7
a8389dd891afc0742b91939507f6a864
Description: performing grid search on the logistic regression model parameters.
def logRegParameterTuning(train_X, train_Y, val_X, val_Y): grid = {"C": np.logspace(-3, 3, 7), "penalty": ["l1", "l2"]} logreg = LogisticRegression() logreg_cv = GridSearchCV(logreg, grid, cv=10) logreg_cv.fit(train_X, train_Y) print("Tuned Hyperparameters :(best parameters) ", logreg_...
1
6e73002d412e6b5516be4fa793bf8a39
67acdfbe060aee02e316bc3c4137415e
When the button that corresponds with this code is clicked, everything affected will change to "End!"
function switchGoodEnding(){ state = `goodEnding`; }
0
2f9a206f2fafe01b4864f9d6cda3ff14
1ae7055347b98d6b79af418627bc1a81
Calculates the 'leave-one out' (LOO) predictions for the data, where each data point is removed from the training set and then has its value predicted using the remaining data. This implementation is based on equation (5.12) from Rasmussen & Williams.
loo = LeaveOneOut() scores = [] for train_indexes, test_indexes in loo.split(features, labels): CCDLAssert.assert_equal(len(train_indexes) + len(test_indexes), features.shape[0]) X_train, X_test = features[train_indexes, :], features[test_indexes, :] Y_train, Y_test = np.asarray(labe...
1
e893c465a6ec298360f55d75360a4594
48ef6ac08933fa73a1852e159ff99acf
Creates a Solr index with the given name
void createIndex(String indexName, boolean deleteOldIndexIfExists) throws DataStoreException, IOException;
1
b7f0f247f9b9f901c53b7424abefafaa
70933a27cb76dd7d3b22719b2432db26
Retrieves the actual Relationship-Object in which this is the object of the relationship.
public class Relationship extends JdbcPersistableBase implements ContextAware, Comparable, Deserializable public PersistentKey getToObjectId() { return Uuid.get(getPersistentKey().getSecondaryKey()); }
0
fcffdd75f86390aaf4b9559806039c39
320ed37f8bee1e77a8041b324d1eab8b
set to true to have generated urls use the domain, false to have them use absolute paths without the domain
public class UrlWrapper implements Url, ModelWrapper<Url> public void setCustomUrl(boolean customUrl) { _url.setCustomUrl(customUrl); }
1
79cbd557b7e11bd4efff2cf72ec61ab0
b78de1e8a05f2a0be2fc73060469ec43
Initializes the bit operation execution tables
opTable["stop"] = {0, 0}; opTable["load"] = {2, 1}; opTable["store"] = {2, 2}; opTable["read"] = {1, 3}; opTable["write"] = {1, 4}; opTable["add"] = {2, 5}; opTable["subtract"] = {2, 6}; opTable["multiply"] = {2, 7}; opTable["divide"] = {2, 8}; opTable["jump"] = {1, 9}; opTab...
0
7b96a95f90b687831421bf8cdf3fcecb
f78367ce92b30eb92e217dc747af83b1
Creates a command to disable the ramp functionality
class PowerSupply(_GPIBInstrument): def disable_ramp_segments(self): self.write('RSEG 0')
1
759b9444426265e4a2858721a80f6cc7
ba69830498f2c7f74a7148b85c0b1a55
make an easily read label from a path
{ ssize_t len; char buf[256]; char *s; if (*path != '/') { return(path); } if ((len = readlink(path, buf, sizeof(buf) - 1)) <= 0) { if (errno != EINVAL) { return(path); } strncpy(buf, path, sizeof(buf) - 1); buf[sizeof(buf)-1] = '\0'; len = strlen(buf); } buf[len] = '\0'; for (s = buf + strlen(b...
1
70a50f3230d7dc0c6646e9def6fcdabf
3a3b70d744fb5698cf506787f915c7e1
清除无用的AudioSource
for (int i = 0; i < m_playingList.Count; i++) { AudioSource m_As = m_playingList[i].gameObject.GetComponent<AudioSource>(); if (m_As != null && !m_As.isPlaying) { Destroy(m_playingList[i]); m_playingList.RemoveAt(i); i--...
1
d2482d4bd8b78478421dec5e3d41ca83
1d28e4e99e95f688efd6f5b37d719315
First, create offsets based on the input values to keep the sampled points from being near a integer boundary. This is a result of using perlin noise, which returns zero at integer boundaries.
function offset(height, roughness) { return (rng.rand() * 2 - 1) * height * roughness; }
1
1ce4ff6034ec915b94d5a147e29ac799
ec8260b8f8b62b30df218ec756753a5b
ValidateDriverName validates the driver name
program := domains.Program{ProgramId: "ok", Name: "AP Calculus BC", Grade1: 1, Grade2: 12, Description: "ok"} if err := program.Validate(); err != nil { t.Errorf("Check was incorrect, got: %s, expected: nil", err.Error()) } program.Name = "AP Language & Composition (#2)" if err := program.Validate(); err != nil ...
0
d3e9d9801b48db07a34bf42d5ec6865a
1d8aab7c066420c186f4300cbc6d1852
Muestra los numeros pares del 1 al 100. No toma ni retorna nada.
{ Console.WriteLine("============================================================"); Console.WriteLine("Bienvenido al programa!"); int num1 = 0; int cont =1; Console.WriteLine("Por favor ingrese un numero entre (100) y (200)"); num1 = Conve...
0
c1965a8d74df20f1800061ce72143abc
de2eb95db4beee184cef0e696a9afe3e
Takes desired width or height and source width and height and fills in missing information to maintain correct ratios. If both width and height are passed, they are used as-is
$sourceWidth, $sourceHeight, $newWidth, $newHeight, $flags = self::FIT) { $percents; if(substr($newWidth, -1) === '%') { $newWidth = round($sourceWidth / 100 * abs($newWidth)); $percents = true; } else { $newWidth = (int) abs($newWidth); } if(substr($newHeight, -1) === '%') { $newHeight = round(...
1
1e3b9ed5623492497cf2be602220d19e
0965f45028e6debec4fb9993d2316f84
Подготовка исходящего сообщения c файлом
public void prepareFolderForStorage(IMessage msg) throws ChangeValueException, ReadValueException { String fileId = fileIdF.from(msg, String.class); Integer lastSplitIndex = fileId.lastIndexOf("\\"); IObject fileInfo = IOC.resolve(IObject.class); FileInfoFields.ORIGINAL_NAME.inject(f...
1
8ac4e36d53c2928d72ccbb2662a13290
89037a89484ac3f535987f088d7af3db
Convert confusion matrices of respective classification to an accuracy vector.
def Acc(output,true_label): acc = np.zeros(len(np.unique(output))) for i in range(len(np.unique(output))): acc[i] = float(np.sum(output[true_label==i]==i))/float((np.sum(true_label==i))) return acc
1
498dbc9235a0870e1abebb6f25d8602f
c697b27b5b8999371769b289b1fe7051
Convert from per Second to per Hour
function toH(durationS){ return parseInt(durationS / 3600); }
1
ba3ec50b6f5d9ba057015f2457273ff1
722f744987c2b0dcd196893e319aa688
Called when the device configuration changes.
namespace od void USBDevice::onConfigurationChange() { }
1
b293d98c201c6960e18d9b1e802caaea
e7ebd6415e43b60677ebec91010e5208
获取fundId的方法
public class BindBankCardDto extends BaseDto implements Serializable public Long getFundAccountId() { return fundAccountId; }
0
925e7c1be85a03fbde3a1868cc98b92c
bb238abcd0677c16f656a24f3b3c9695
This will remove all of the special membership provider properties which were required to display the property editors for editing - but the values have been mapped back to the MemberSave object directly - we don't want to keep these properties on the IMember because they will attempt to be persisted which we don't wan...
class MembersApiController extends ApiController protected function _filter_edit_results(&$member) { if (Gate::denies('club-admin') && Gate::denies('view-membership')) { $member->makeHidden("date_of_birth"); $member->makeHidden("access_level"); $member->makeHidden("address_1"); $member->makeHidden("addre...
1
5c11d8995313aa958520b4e97b600dc8
0030ffe618a58dad83e07af4a484668d
Get the id (type) of a ModNPC by class. Assumes one instance per class.
namespace Terraria.ModLoader public static class ModContent public static int NPCType<T>() where T : ModNPC => GetInstance<T>()?.Type ?? 0;
1
583eeaa9336e845b022e3a199e2a3303
79e399395756ee48641d1330bde54296
POST: First/Create
try { await (_employeeService as EmployeeService).TestCreateAsync(); } catch (ValidationException ex) { _logger.Warn("No posts"); return View("Error", new string[] { ex.Message }); } return RedirectToAction("Inde...
1