query_id
string
corpus_id
string
query
string
code
string
label
int64
cc5979ed9afa54241e187dbc17fefad8
e601a4e8535aa9ad29b078952f44e22a
Conta o nrº de palavras numa string
{ int i = 0, j = 0, contador = 0; while (*source != '\0') { if (*source != ' ') { *dest = *source; dest++; } else contador++; source++; } *(dest) = '\0'; return contador; }
0
926f2b33bdb3a9cd048de76952bce49b
97275d9a374d2406a2b7ae8b4c707185
获取指定分类的子分类信息
{ if (empty($cid) || !is_numeric($cid)) { return []; } $map = [ 'parentid' => $cid, ]; return self::getInfoByMap($map); }
0
a7512ab2aa88f7bac5cafda001dd457e
32d5587dcc2fb618645ef88a568fa9f5
Simula o abastecimento de combustível.
{ this.tanque = this.tanque - ( (m / 1000) / this.consumo); }
0
e06bd1f3d3450698e881af4263cd6ffb
e038d131e80fe48a1e1c17d8e837ab37
NewCell - returns a new cell
func New() hash.Hash32
0
2353bc31e850fc051e1dedec474fc536
b6b6266d13f2f3548af5e635b4e3e86c
Create a nav component view.
{ var html = CreateElement(); html.Attribute("data-role", "navbar") .Attribute("id", component.Id); component.Content.Apply(html); html.Attributes(component.HtmlAttributes); return html; }
1
38bedfbda4153905939627beedbfd4d6
7f61448ad6da3ef0f9cb03f40c5be655
From http://docs.plone.org/develop/plone/forms/schemas.html#id8
cases like (1)
0
d47c42820cdf52eb0101bd0356443fd7
f71ded7580df3b0645312295244a46ad
Create a context and verify teardown happens as expected
std::weak_ptr<CoreContext> ctxtWeak; { AutoCreateContext mainContext; CurrentContextPusher pusher(mainContext); AutoRequired<Creator> creator; std::shared_ptr<CoreContext> ctxt; ctxt = creator->CreateContext(0).first; ctxtWeak = ctxt; creator->Clear(true); ctxt = creator->CreateConte...
1
8f8f92e8316eb94db7e30baeed3b1fc3
ecca39d5da9843b78987dab3b41e2c01
Estimate the min and max longitudes within $distance of a given location.
$earthRadius = 6378.137; $d_lng = 2 * asin(sin($distance / (2 * $earthRadius)) / cos(deg2rad($lat))); $d_lng = rad2deg($d_lng); $d_lat = $distance/$earthRadius; $d_lat = rad2deg($d_lat); return array( 'lat_start' => $lat - $d_lat, 'lat_end' => $lat + $d_lat, 'lng_start' => $lng-$d_lng, 'lng_end' => $lng ...
1
c7298cc13d9e05bf491014cdb0ce0f7e
ca82b84227931a7ce3f99c4de1b6575c
根据信息来创建物体,并且计算该物体新产生的不可达点,并添加进去
{ SceneBlock block = getBlock(oinfo.x, oinfo.y); if (block== null || !block.isResolved() || block.addObject(oinfo)) { if (_model.addObject(oinfo)) { recomputeVisible(); return oinfo; } } return null; }
0
ebff1c85c4fc8e66e50d33d8777118a1
d0edd893e211309b6b34cf687bb07029
Returns a randomly generated secret key.
def create_secret(): return pyotp.random_base32(length=api_settings.SECRET_KEY_LENGTH)
1
c9f0d4adc2b4fb4ea3769ed5fcba1a9c
c05db9ce121ed4208ba0002f30feb5da
Saves current memory to file.
class Engine: def save_file(self, filename): assert(exists(split(abspath(expanduser(filename)))[0])) with open(abspath(expanduser(filename)), 'w') as f: f.write(str(self._working_memory) + "\n")
1
e91962c4b7079f80167e2ef6e324b444
ab44931252e50bcae8e26728cf63c091
反转整个组顺序
function applyMirror(_keyNum, _shuffleGroup) { const style = JSON.parse(JSON.stringify(_shuffleGroup)).map(_group => _group.reverse()); applyShuffle(_keyNum, _shuffleGroup, style); }
1
181e8f028ff5477014359a0ee9c84c6f
5a65a5580669d9d5b9f49d5169c87248
Returns the Command for this Message, indicating the type of message this is. The fields that are supported by this message, and how they are set and interpreted, depend on the type of message. See the AMPS Command reference for details.
BaseCommand getCommand(BaseMessage msg);
1
42d6c6822b2187ee75c1879ec1948100
fe01fbbd06ad86a876ed97dab98c9187
Returns the nguoi tao of this nghe nghiep.
public class CapNhatKetQuaWrapper implements CapNhatKetQua, ModelWrapper<CapNhatKetQua> public void setNguoiTao(java.lang.String nguoiTao) { _capNhatKetQua.setNguoiTao(nguoiTao); }
0
3cbe082fb41c191ed7ef1076d1fc2b4e
a06466be2a8c0d9a7431a97887d95405
Compute in a parallel way a distance matrix for a 1-d input array.
def pairwise_parallel(f, data1, data2=None, normalize=False, device='cpu', backend="loky", n_jobs=-1, dtype=torch.float32): from joblib import Parallel, delayed symmetric = False if data2 is None: data2 = data1 symmetric = True if normalize: self1 = torch.tensor([f(d, d) for d in...
1
d1e184fe65f03bd6090f95a067e30201
e1891de301a6ec299d47ca4a76ffdf87
\brief Get C compiler.
class CFlags: ## Machine type. def get_cc(self): return self.compiler_cc
1
9b4a9329987976843a7f738ada57df5d
d52b2ecb4efcbdd28fd295032b6a19d1
사용자에게 Vector3D 값을 입력하도록 요청. 마우스 혹은 키보드 입력 가능함.
public class _script_PlayerMovement_v01 : MonoBehaviour public void OnInput_Movement(InputAction.CallbackContext context) { m_Movement = context.ReadValue<Vector2>(); }
0
42571035ff2108159a5f92d6dd8ce1c3
5a81deb58070e1533d2356584fe40b70
get the number_of_days we stayed at the lodge
double NumDays::getDays() { return days; }
1
5dd89a82d29424700e2e2f483d7f4cbe
7f1e0d1c085234de3fc86d32f2a3f50a
@brief AWD combination mode IRQ handler.
{ HAL_StatusTypeDef tmp_hal_status = HAL_OK; uint32_t tmpAWDHighThresholdShifted; uint32_t tmpAWDLowThresholdShifted; uint32_t tmpADCFlagAWD2orAWD3; uint32_t tmpADCITAWD2orAWD3; assert_param(IS_ADC_ALL_INSTANCE(hadc->Instance)); assert_param(IS_ADC_ANALOG_WATCHDOG_NUMBER(AnalogWDGConfig->WatchdogNumber));...
0
e9c87d44bf155e3e83da50c155b9961b
ef3cc83dbae878b4bdfb67ad7c7e8959
callback function for handling the lasso event, called from on_release
class maskMaker: def on_move(self,event): if not event.inaxes: return self.xm, self.ym = int(event.xdata), int(event.ydata) if self.x != 0: self.lm.set_data((self.x,self.xm),(self.y,self.ym)) draw()
0
34ed9bd1ba7227356e0ceab08c92bfbd
cc3bc114fd1105c2bde9b62567b64fe7
Filters a collectino of <see cref="FieldInfo"/> to only those that are not backing fields for properties
namespace TypeGen.Core.Extensions internal static class TypeExtensions public static IEnumerable<FieldInfo> WithMembersFilter(this IEnumerable<FieldInfo> memberInfos) { Requires.NotNull(memberInfos, nameof(memberInfos)); return memberInfos.Where(i => i.IsPublic); }
0
ccf0c7fdf4f7af00f721b3c6a83aa490
b1e5ccb57a7f2c3b14f9c63097ab905b
Parses a file as a ZIP file and returns an event generator. This method will first test if a ZIP file contains the required paths using plugin.CheckRequiredPaths() and then extracts events using plugin.Process().
class CompoundZIPPluginTestCase(test_lib.ParserTestCase): def _ParseZIPFileWithPlugin( self, path_segments, plugin, knowledge_base_values=None): session = sessions.Session() storage_writer = fake_writer.FakeStorageWriter(session) storage_writer.Open() file_entry = self._GetTestFileEntry(path_segme...
1
53a27776e646ae50bc91f969323907d2
e9a701f8a3862a067845e2180a872f01
Generate a unique base 36 value
class UrlSafeBase64Generator def call(_session) SecureRandom.urlsafe_base64(32) end
0
f342c041098739e8459cebfce94e93dc
62f50b35f63a655d4cddcc1654bd8cb4
identify indices of array where binary values are True and contiguous e.g. array = np.array([False, False, True, True, True, False, True, True, False, True, True]) returns [(2, 3, 4), (6, 7)] if partial=False (9, 10) is not part of the result because it is not clear that contiguous block has ended otherwise (9, 10) is ...
mask = np.concatenate([[False],mask,[False]]).astype(np.int8) dmask = mask[1:]-mask[:-1] start = np.where(dmask>0)[0] stop = np.where(dmask<0)[0] return np.array([start,stop]).T
0
df7acf08d11c205891729c31ed89d1ea
159df87ce6e65f06c693dd382f551a7a
Efectua el cambio de escena de world a second menu
public void startMenu(ActionEvent event) throws IOException { Scene secondScene = new Scene(loadFXML("SistemaHotel"), 670, 430); Stage newWindow = (Stage)((Node)event.getSource()).getScene().getWindow(); newWindow.setTitle("Sistema Hotel"); newWindow.setScene(secondScene); ne...
1
b4e984085a5379963ba9c3f7d14479c5
62c201bab2f3e5478db49baec3a392f4
Returns client for issuing requests in the {@code "file_properties"} namespace.
HttpDownloadClient getClient();
0
cc0b649db8278402d1660167408018a7
b7ced408a86eb7685ef17aae5847dda7
подгружаем способности выбранного покемона
if (ChoosedHero.Data.AbilityFuncName != null) { for (var index = 0; index < ChoosedHero.Data.AbilityFuncName.Length; index++) { var ability = ChoosedHero.Data.AbilityFuncName[index]; var value = ChoosedHero.Data.GetAbilityValue(index, ChoosedHero.Level); SetAbilityActive(ability, value, active); ...
1
56f4ec58750c42ef58cbb31025644b82
9bac42d7750dfa2a495806693de64ef7
Returns a canonical empty releasable iterator.
public static <T> CloseableIterator<T> emptyIterator() { return (CloseableIterator<T>) EMPTY_ITERATOR; }
1
49ff1b80b89331cd4e3348a2a6e8c1bf
9c081dcdf08c5ba376b90c583624857c
Assesses a collision between two planes.
namespace Aardvark.Base public static partial class GeometryFun [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Intersects(this Plane2f p0, Plane2f p1) { var hit = p0.Coefficients.Cross(p1.Coefficients); return !hit.Z.IsTiny(); }
1
b64378d27d75096e79ca9e2f50f8af36
8b256eb0ebfc7436622951eafe498dc4
将键值对加入到scope中 如果为函数,key不要加参数和括号
void set(CacheScope scope, Object key, Object value);
1
75823f3f34331520e71c0d7a2511de9e
685fe76b6ff3b66f2d43bfbe5b771b0b
Return a list of references to catalogs, collections, items or other kind of resources.
class IZCatalog(Interface): def __call__(query=None, **kw):
0
6edc4da51d0d1b1523b0c327c0a163be
8cc755b2c4fd8bd212a4614ba6351acd
Constructs a new dimension.
class Dimension(object): def __init__(self, value): if value is None: self._value = None elif isinstance(value, dtypes.DType): raise TypeError("Cannot convert %s to Dimension" % value) else: self._value = int(value) if (not isinstance(value, compat...
1
29f2420e82bb90c21624e33575627b2d
d2bf3018e1afd8ea3b9a7e1a0028915d
Show Android Native Toast if we are on an Android device
void UMobileNativeCodeBlueprint::ShowToastMobile(FString Message, EToastLengthMessage Length) { #if PLATFORM_ANDROID AndroidUtils::CallJavaCode<void>("com/Plugins/MobileNativeCode/NativeUI", "showToast", "", true, Message, (int)Length); #endif #if PLATFORM_IOS [[IosNativeUI Singleton]showToast:Message.GetNSString(...
1
736ca32b00f86ba90aeb47a7370da7a2
e48863f15c1af2d7d3284894c7196c61
解析微博/评论内容,得到所有@的用户名/
a_list = selector.xpath('.//a') at_users = '' at_list = [] for a in a_list: if len(unquote(a.xpath('@href')[0])) > 14 and len(a.xpath('string(.)')) > 1: if unquote(a.xpath('@href')[0])[14:] == a.xpath('string(.)')[1:]: at_user = a.xpath('st...
1
17a867d95f7d3a1c8a5c075bbd3a0487
8de2ec2e087ce5ab5fe1d095e46633b8
This function gets the hole map for the terrain.
TerrainHoleMap &CommonTerrainBlock2::holeMap() { return *pHoleMap_; }
1
365f6e73ca94a5f269288d32f8f1bc58
78799fab08b97078cc1fca7b1b5f4d2b
Gets all relations of the OrganizationEntity as a list of IEntityRelation objects.
namespace AW.Data.RelationClasses public partial class SalesOrderHeaderRelations public virtual List<IEntityRelation> GetAllRelations() { List<IEntityRelation> toReturn = new List<IEntityRelation>(); toReturn.Add(this.SalesOrderDetailEntityUsingSalesOrderID); toReturn.Add(this.SalesOrderHeaderSalesReasonEnt...
0
e440bb745934b6deb7445307a7094e5b
389378106316e3bf2f857205c021699b
Method to parse the data from a ROMdb json.
this._dbid = as('number', json.dbid); this._title = as('string', json.title); this._slug = as('string', json.slug); this._language = as('string', json.language); this._thumb = as('string', json.thumb); this._addDate = asDate(json.add_date); this._views = as('numbe...
1
832a1720d01bb87bf11155dcadd90eee
dd077c6534beb20bd1f2332924373ea3
Loads bullets before shooting
{ for (int i = 0; i < noOfShots; i++) { MakeBullet(); transform.GetComponent<Animator>().SetTrigger("ShootBullet"); yield return new WaitForSeconds(0.25f); } }
0
447355239142b2b244f36392ddb2654a
cef5149c1836207f05140a9419622669
returns the number of headers
class CsvHeader public function getNumHeaders() { return count($this->cells); }
1
fcd5a16c5c651810280f1c42e5fb8932
7867635b82c715e98472bd5af1c532bd
Search for a tree element in which the (pos,len) pair butt up against, or NULL if there are none. Returns the node next to (pos,len) for success NULL for not found. status is filled with -1 for error (overlap found) 0 for no butt (inbetween free blocks) 1 for butt with left end 2 for butt with right end
int ccn_btree_lookup(struct ccn_btree *btree, const unsigned char *key, size_t size, struct ccn_btree_node **leafp) { struct ccn_btree_node *node = NULL; node = ccn_btree_getnode(btree, 1, 0); if (node == NULL || node->corrupt) return(-1); return(ccn_btree_looku...
0
8c67a93debdc3c106899dd5aaf3867b0
a72fb9697edc6458a7be63c093c0c5ba
2)快速转置
n = len(matrix) for i in range(n): for j in range(i + 1, n): matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j] for i in range(n): matrix[i] = matrix[i][::-1]
0
54f395a1238598dc1600ab965db6a52a
c3b1a56a5ca8fbbfc3211f87468785f0
得到空余床位
namespace HIS.ZYNurse_BLL public class OP_Bed:BaseBLL public DataTable getBedNotAssign(int dept_id) { try { DataTable nobeddt = new DataTable(); string strWhere = @"select aa.room_no,aa.bed_no,aa.name1,aa.name2,aa.name3 from ( select a.dept_id,a.room_n...
1
b50c8c3608ca56b653ad0754bcfcd424
ea923428988dedb6142120f817ccdb96
Get the text of a notification, localized and filled in with parameters.
public String format(TemplateContext templateContext, Object data, Map<String, Object> parameters) { if (parameters.isEmpty()) { return webInterface.getL10n().getString(String.valueOf(data)); } List<Object> parameterValues = new ArrayList<Object>(); int parameterIndex = 0; while (parameters.contain...
1
8ba99589394092e2c6edff15fbfd363c
8f57e97dcc18d2b8434aad474e034941
Validate all information for enclosure groups
logger.info("Validate Tbird Enclosure Group") navigate() total = len(eg_obj) not_exists = 0 for n, eg in enumerate(eg_obj): logger.info("{2} No: {0} --- Total: {1} {2}".format((n + 1), total, '-' * 14)) if not TBirdCommonOperationEnclosureGroups.verify_enclosure_group_exist(eg.name, ...
1
3265628bfd82ca1ae99185db3c574303
c51770b7eedfadd63fde1be49324f553
Call an external API endpoint to get posts
@HiltViewModel class PostViewModel @Inject constructor(private val postRepository: PostRepository): ViewModel() fun makeGetRequest(){ postRepository.makeGetRequest() }
1
f36237db87e21c7c87c611fcc33b51ed
3ca9ff1114822c5a6a0c04e5903674de
Set the minimum and/or maximum number of register stages on the link.
this.lowPort = lowest; this.highPort = highest; this.nextPort = lowPort; }
0
7a851b089d9233eccc0ab64e2aeb9800
d67081376e0cf18685b82825a8477e57
NewInMemory returns in-memory scheduler.
for n := 0; n < b.N; n++ { NewDefaultScheduler(c, i, l) } }
0
8d1d002744301577cd003332b90d8a8e
d67becae6381a4740351024ffdb81346
Listen to the previous song in the queue
class PithosMprisService(dbus.service.Object): def Previous(self): pass
0
c396656cdcdb5b5b3340e3d591ed0a66
84d0b5d6a7d4cb807d736f816bfe8787
通过反射,设置Fragment下的Menu的图标一直显示
public abstract class TitleBarFragment extends KJFragment protected void setMenuImage(Drawable drawable) { if (outsideAty != null) { outsideAty.mImgMenu.setImageDrawable(drawable); } }
0
a795ef6b3a85f8eee2946b37673843d7
ae316a1c11857e7d1b7e5bb480788335
Given the memory range and cache type, programs the MTRRs.
MtrrLibPostMtrrChange ( IN MTRR_CONTEXT *MtrrContext ) { MSR_IA32_MTRR_DEF_TYPE_REGISTER DefType; DefType.Uint64 = AsmReadMsr64 (MSR_IA32_MTRR_DEF_TYPE); DefType.Bits.E = 1; DefType.Bits.FE = 1; AsmWriteMsr64 (MSR_IA32_MTRR_DEF_TYPE, DefType.Uint64); MtrrLibPostMtrrChangeEnableCache (MtrrContext); }
0
2d34fd6dcd2e05856534cbee70aa7317
efa98998d7293d6cea4e2a787f4e1404
Update the user input array
for (i = 1; i <= 19; ++i) { userInput[i - 1] = document.getElementById('i' + i).value; } }
1
dd39864a6f9007279ebe5a0f8e3c1795
adaf0c1738713f5abcbf827ca20a2d11
A utility function to clear the stdout
{ HANDLE hStdOut = ::GetStdHandle(STD_OUTPUT_HANDLE); COORD coord = {0, 0}; DWORD count; CONSOLE_SCREEN_BUFFER_INFO csbi; if(::GetConsoleScreenBufferInfo(hStdOut, &csbi)) { ::FillConsoleOutputCharacter(hStdOut, (TCHAR) 32, csbi.dwSize.X * csbi.dwSize.Y, coord, &count); ::FillCons...
1
78e6af0a93aad3c426833f3c6098c625
dd5edcd2aab6d37bdc4a66608a11610b
Helper function that returns the number of the column in the GraphSimulLayout result where the Step that contains our DataHolders is located.
public class QResultIterator implements GetResult, AutoCloseable public int getColNumber() { return colNumber_; }
0
8302bcf702fb6972ef9cf732a33d3393
a9169c23ea429249907e201fe6692b68
Get the approriate view resource for displaying results.
class App_Application_Resource_View extends Zend_Application_Resource_ResourceAbstract public function getView() { if (null === $this->_view) { $this->_options = $this->getOptions(); $this->_view = new App_View($this->_options); } return $this->_view; ...
1
2cd3c3b13d069f48b143d551c8cc9101
54ae44ede1b65e0e53594f15a37612db
Gets the tracks found on the \"Best New Releases\" smart playlist
const headers = new HttpHeaders({ Authorization: 'Bearer BQDTGRGaAyE5XKKyB-ofU9ajmuPQq-88MQS1WnxwAAwQZt5oreeWNulNlW-akKhb44D_Z7G15sV_CTHafgo' }); return this.http.get('https://api.spotify.com/v1/browse/new-releases', { headers }); }
1
e5015d3a63da21ac0a250d1aa75171ee
97e0088e57b8872fe0f77834154705b1
Uses the file's mime-type to determine if the file is an SVG or not.
class File extends Model public function isSVG() { return (strpos($this->mime_type, 'image/svg') === 0); }
1
47b7ca9dde5c8ffaa9e8226197641295
b391f720bbeb6a32c22378e3c470525c
assign functions to keycodes
config[SCROLL_DOWN] = 40; config[SCROLL_LEFT] = 37; config[SCROLL_RIGTH] = 39; config[SCROLL_UP] = 38; config[SETTINGS] = 112; config[SETTINGS_FILTER] = 113; config[MAIN_MAP] = 27; setTexts(); }
1
23464bfcbffb45c6aa7afd6ac11ad85a
7290c5bf593931f6c939f2b1dffff7c6
加载离线瓦片数据
function loadServer(c, textRender, geoRender) { try { var ds = __g.dataSourceFactory.openDataSource(c); var fdsNames = ds.getFeatureDatasetNames(); if (fdsNames.length == 0) return false; __fds = ds.openFeatureDataset(fdsNames[0]); var fcNames = __fds.getNamesByTy...
0
5cbceb80e7e89a9ab4f113b2f1c98c14
78671f35c5252f056c2e8e8521c43f42
Default database is always first in the list
class DbSimpleFactory: def default_database(self): return list(available_database_factories.keys())[0]
1
6b000d8f61dafb928da06eea610caabb
0d0f03a84fb0d0683c16791c9f79f225
Get Specific Company from Akaunting
{ CompanyAPIRequest companyAPIRequest = new CompanyAPIRequest(company_id); Call<CompanyGetResponse> call = apiInterface.getCompany(companyAPIRequest.getRequestBody()); call.enqueue(new Callback<CompanyGetResponse>() { @Override public void onResponse(Call<CompanyGetRe...
1
605a157f46b10736eb0b59af0ab67427
7e19f39eb5e91dd19889c97b24188fdf
重新提交离线充值申请
public String addApply(Model model) { Subject subject = SecurityUtils.getSubject(); try { subject.checkPermission("recharge:rechargeOfflineApply:add"); }catch (Exception e) { model.addAttribute("error", "您没有权限查看"); return "error"; } return ...
0
51d0668a986fbeb5ba554383139576d3
b584f9a49d9658f7a99149a830001bf7
Gets the set of the numbers of the cities
int quantity = getCount(); List<String> result = new ArrayList<>(quantity); for (int i = 0; i < quantity; i++) result.add(getPosition(i).getCity()); return result; }
0
08553c1e4849864ac7526592477276e5
898bc4102e96ad597a0ea93fa4094bdb
Generates code that converts a Dart_Handle to a C variable. For a single argument in a function.
java_class_only = called_by_native.java_class_name or self.java_class.name java_class = self.java_class.full_name_with_slashes if called_by_native.java_class_name: java_class += '$' + called_by_native.java_class_name if called_by_native.static or called_by_native.is_constructor: first_param_...
0
7f184df1ea7482719159385d2c5aa03b
6c901fcaf34fbdcc6dd2f4d32a970669
Returns the value of the '<em><b>Counter unit</b></em>' attribute. <!-- begin-user-doc --> <p> If the meaning of the '<em>Counter unit</em>' attribute isn't clear, there really should be more of a description here... </p> <!-- end-user-doc -->
Identifier getCounter();
0
c20119cb76963f96a0a314771f37c157
0dbdb05f3fec34e94e3e45af989f399c
Test streamlit.data_frame_proto._marshall_table.
tfxio = parquet_tfxio.ParquetTFXIO( file_pattern=self._example_file, column_names=_COLUMN_NAMES, schema=_UNORDERED_SCHEMA, telemetry_descriptors=_TELEMETRY_DESCRIPTORS) self.assertEqual( { "int_feature": text_format.Parse( "...
0
46988f4a6f3d54d0a93eb3277d6d207c
5624d2e0b2f6b0ff2745bb3d6145a626
Timeseries data for user jobs (asynchronously)
public class ReportsApi public com.squareup.okhttp.Call reportsUserJobTotalsAsync(DateTime startDateUtc, DateTime endDateUtc, String xChronosheetsAuth, final ApiCallback<ApiResponseListJobTotalsReportItem> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; Pro...
1
56fa9b9397f7570a66b4725747e3b067
f8d3f7865494c13ffc6626f062614e51
根据subtype获取类型
@Entity @Table(name="EX_MONITORED_VETO_CONFIG") public class MonitoredVetoConfigEO extends AMockEntity public static BaseCode getCodeBySubType(CodeType subType) { for (BaseCode b : BaseCode.values()) { for (MonitoredVetoConfigEO.CodeType codeTypeb : b.getType()) { if (cod...
1
634d0200750a2ea9618a85426042a59a
bf177407f682dd990d3f9490dcc4ee0f
Shuffles the deck and then deals to the players' hands
class Deck(object): def deal(self, player_count): self.shuffle() self.hand_size = len(self.reference)/player_count self.hand1 = self.reference[0:self.hand_size] self.hand2 = self.reference[self.hand_size:self.hand_size*2] self.hand3 = self.reference[self.hand_size*2:self.hand_size*3] self.hand4 = self.refer...
1
c093b09d253f88c9fd591d69006d7c78
66f881689512bd163190e99e128754e3
This sets up the basic aspects of the GUI so that it has a specific size and title, also so that it can't be resized at all.
class GUI(tk.Tk): def _prepare_gui(self): self.title("Gauntlet") self.geometry("640x480") self.resizable(width = False, height = False)
1
391ab50519c240df476d753f0b100ea4
09e622398fff7c2e5010fbbdb6653a6e
Get the current chromedriver version.
def get_version(): outstd2 = os.popen('chromedriver --version').read() return outstd2.split(' ')[1]
1
9f82b70724d83e17732ef8b2cfbff43e
4bb5ad26df387145445993fafb676c66
Maps a list of [JsonSerializable] into a [JsonArray].
public class JsonUtils public static <T> JsonArray toJsonArray(final Collection<T> list, final JsonSerializer<T> serializer) { return toJsonArray(list, createBuilder(serializer, new TypeToken<T>() { }).create()); }
1
21176e671061c1c31bc823cdb1778ee5
f3ae98eb0db2f0b44c6bb00f2e7a03bf
Makes the controls menu visible/invisible
{ if(m_IsControlsVisible == visible) return; m_IsControlsVisible = visible; this.updateControlsVisibility(animation); }
1
5acb63ce8c7078274cc5fcd3ee89be45
695e4a2d6beb08647356af74bbcf7946
根据Group_ID,选择TreeView的CheckBox状态
{ GridGroupRowInfo info; info = e.Info as GridGroupRowInfo; info.GroupText = " " + info.GroupText.TrimStart(); e.Info.Paint.FillRectangle(e.Graphics, e.Appearance.GetBackBrush(e.Cache), e.Bounds); e.Painter.DrawObject(e.Info); Recta...
0
71c85b10bf166b657b89b6b372916ef8
440ea7a643c45b27456361eefbbddcab
goToGoodsPropertyList 商品属性列表页
class GoodsPropertyAction extends AdminAction{ public function index(){ $this->redirect(U('Admin/GoodsProPerty/specListPage')); }
1
b27e214bb36d533e30b930c4ebefac49
40f0bba354fa8c3a39bf983ae3170e14
Удаление существующего параметра продукта
namespace RapidSoft.Loaylty.ProductCatalog.WebServices.Interfaces [OperationContract] ResultBase Remove(RemoveParameters parameters);
1
1cd5971f425251790d20897bcbdb7190
e67501178eeafb97102f2dc3c6d828c2
\brief Convert the tid of a vtrans into a pair of original transaction tids.
def tcFromlId(lId): t = [] l = lIdLookup(lId); t.append(tIdLookup(l["t1id"])) t.append(tIdLookup(l["t2id"]))
1
4f4b8bc2e6d2070f5f9014c25f937845
4bd35eed6ef85ca542f94fdfe611604e
Функция для получения информации о PC пользователя
{ Dictionary<string, string> pcInfo = new Dictionary<string, string>(); ManagementObjectCollection components; components = GetWmi_ClassData("Win32_SystemEnclosure"); pcInfo.Add("PC Manufacturer", GetWmi_SingleValue("Manufacturer", components)); pcInfo...
1
049f752a56c547c438e12b7c86e8b4f9
0916e93a5441fc9cba6b954387a0dd33
Load associated address and owner by selected parcel.
{ if (string.IsNullOrEmpty(serviceProviderCode)) { throw new DataValidateException(new[] { "serviceProviderCode" }); } try { if (parcelPKModel != null) { RefAddressModel[] addressList ...
1
26f7ac7886b1f93c6853d9bdd67be25d
477c877bbca814ee7597332d0cc697b3
获取个人设备锁列表
namespace Api.Controllers public class KjxController : DataCenterController [Route("api/kjx/gatewaylistLock")] public SysResult<List<locklist>> gatewaylistLock(local param) { T_SysUser user = GetCurrentUser(GetSysToken()); if (user == null) { SysRe...
1
cd6e40310ce783619aeaa6820d864132
71a3fabce9e773fc1bfdc7f5aa018c9a
<p>Computes the bounding coordinates of all points on the surface of a sphere that have a great circle distance to the point represented by this GeoLocation instance that is less or equal to the distance argument.</p> <p>For more information about the formulae used in this method visit <a href="http://JanMatuschek.de/L...
{ double angle = distance / earthRadius; double minlat = lat.rad() - angle; double maxlat = lat.rad() + angle; double rightangle = ProjectionConstants::PI / 2; if (minlat < -rightangle) { double overshoot = -minlat - rightangle; minlat = -rightangle + overshoot; if (minlat > maxlat) { maxlat = minlat; ...
1
e9ccf39f59d07e330016b5e2f6614c6e
f0a338c59bb4aeb3c15fedbeadacb213
Throws an error when the user passes invalid cloudDiscoveryMetadata
try { new CloudFilesTransporter(RACKSPACE_USER, RACKSPACE_KEY, array( 'container' => CF_CONTAINER, )); $this->assertTrue(false); } catch (Exception $e) { $this->assertTrue(true); } try { new CloudFilesTransporter...
0
bfcd15217d611e178fdf67506aff19f5
386fe32fb153ea6e89516b2baaae9bd0
changes the ships coordinate on Y axis to the parameter given
public class Player public void updateY(int change){ positionY +=change; }
0
71e8bce075929124a3febb93b8f2fbe0
b44a7a832ee7277e367c51298de7df2b
Returns the number of passengers using the modality when issue was triggered.
public class SecurityCheckReceipt public int getNumberOfPassengerScanned() { return numberOfPassengerScanned; }
1
dec04a716d836c4486ccfe3c19620261
bca6fb004607263473fba1d3f115c6a4
Creates the change skin button.
{ HeaderButtonContainer buttonContainer = new HeaderButtonContainer(); SingleLineMethodCall newMethodCall = new SingleLineMethodCall("entityChangeHistory.refreshGrid"); buttonContainer.AppendChild(new IconButton(EntityChangeHistoryIdentifiers.RefreshButtonId, newMethodCall, ButtonIconCssClass.Refresh)); b...
0
1a1724ef3802262efb02404c3e20c690
8e69e947998e1d4a267354dd2820816a
奖励明细
function BindReward(id) { var rows = $('#tabWage').datagrid('getSelected'); $('#table_Reward').datagrid({ url: '../service/EasyDataSources/JiXiao/bo_GetReward.ashx', queryParams: { action: "post", id: id, y: rows.Year, m: rows.Month }, width: '100%', height: '100%', fitColumns: true, striped...
1
a7a86a783120acc0da90f70ef76590fd
d9903094b56df25a76cb1e2d0db6d6ad
This function returns the number of available generators
class DSSDLL: def generators_next(self): result = self.dssObj.GeneratorsI(ctypes.c_int32(1), ctypes.c_int32(0)) return result
0
90638e258fe668bd9205e03aa01b0a4d
033f56453d9469ac7ec09f46c9644cfa
从缓存中获取某一项,如果没有命中,即调用CachingMissItemCallBack中获得值并将其加入缓存中,默认为10分钟过期
namespace Never.Caching public sealed class MemoryCache : ICaching, IDisposable public T Get<T>(string key, Func<T> itemMissCallBack, TimeSpan ts) { if (string.IsNullOrEmpty(key)) throw new ArgumentNullException("缓存的key不能为空"); object obj = this.cache.Contains(key) ? t...
1
38e6118204e519a2d73ea84a8a039b21
7876958330add3698605e25223dc41d1
窗帘停止
static void CLOSE_CURTAIN_OPERA( void ) { CLR_CURTAIN_FORWARD(); Onboard_wait(5); SET_CURTAIN_REVERSE(); Onboard_wait(5); }
0
246d58976986e19514789e9eb459cd0b
191e570c28bc5289a6f955fee93bc6ac
Responds with NOT MODIFIED
class ActionResultTestController extends Controller public function notModifiedAction(): NotModifiedResult { return new NotModifiedResult(); }
1
c06e844e278f1363fd79dcfe9f0420bd
b234aba8d01de5568af118e847f7bf2c
如果元素使能被关闭,则不产生此元素UI
namespace AhDung.WinForm public class WaitForm : Form, IWaitForm protected override void OnVisibleChanged(EventArgs e) { base.OnVisibleChanged(e); if (this.Visible) { AhDung.WinForm.WinFormHelper.DisableCloseButton(this); } }
0
5f6a82545709bb8783ce1c515be8029b
29bb9dc5e6135577e9019e3aa3a21b5a
统计某个用户尝试过的题目的id集合
String sql = "SELECT queid FROM question WHERE userid=?"; Object[] obj = {userid}; List<Map<String, String>> lists = db.query(sql, obj); List<Integer> result = new ArrayList<>(); if (lists == null || lists.size() == 0){ return result; } for (Map<String...
1
0504e8dec66907fcc5c0a6feb0357a84
7faf01a570abe033185b9823bf807357
generate a state string based on the current input
func generateStateString() string { b := make([]rune, 10) for i := range b { b[i] = letters[rand.Intn(len(letters))] } return string(b) }
0
7cd75c37d3a559ab2c91c3d28d258a42
2c69f73e2036bd11815832e20e49afc1
列番号に対するPropertyInfoを返却する。
public PropertyInfo GetProperty(string name) { if (name == null) { throw new ArgumentNullException("name"); } return this.GetPropertyImpl(name, BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public, null, null, null, null); }
0
7f257b8b94d371576db1ee4116f895d7
14cd66038c294d43025f5231436fb977
Contains the scrubbing options, such as whether to scrub, obfuscate, etc.
{ $this->plugins = $plugins; $this->min_weighting_before_spam = (double)$min_weighting_before_spam; $this->check_usernames = (bool)$check_usernames; $this->check_emails = (bool)$check_emails; $this->check_ips = (bool)$check_ips; $this->log_blocks ...
0
6ab2b1c1246ae48c7967ab92a12bf4d5
e15212b6ed7ea5197e7e637e3e21f3df
- input: - data. An array of shape (N,D). The layout of the data array and the coding used is described in the hadout. - returns: - the predictions for your data, a numpy array with shape = (N,)
class OneLayerWork: def predict(self, data): result = np.dot(self.W_with_bias, data.T) return result.argmax()
0
556d98f5f48a1a0f0514f3f2d13982c8
14585bd0b20bf47c149c5743c588cc98
Does a cache check on a list of speckle object placeholders. It will populate the original list with any objects it can find in the cache. If none are found, the list is returned unmodified.
logging.debug("Loading an object list") try: with open(largeobjectslistFilename, 'rb') as f: objectListCache = pickle.load(f) cacheAge = datetime.now() - objectListCache['dateStamp'] logging.debug("Cache timestamp: %s" % objectListCache['dateStamp']) logging.debug("Ca...
0
16a9561c95efbaffb632429901857e47
6cc9937e67694f313eb75b4cdfb8d5a4
A scheduled job object. Note that all date and time values in the scheduled job object are stored as standard date/time values, as used by the 'DateUtils' module.
class ScheduledJobView extends ScheduledJobViewData function __construct() { parent::__construct(); }
0
d0a068835b7c51e8507fda9737f04852
eb8133a4cd79c8f4db5334908f172dd0
Updates description of an existing Maniphest task.
class Tasks(ObjectMixin): def update_description_task(self, row_id: int, raw_message: str) -> Task: column_names = self.column_string.split() parsed_message = Tasks._parse_message(raw_message) update_dict = { column_names[1]: parsed_message.description } db.update(sel...
1
ec6c41435e4fc0f6641e0ac87ecc4925
17a97dc4cca1c01dbf49da5e0548f51c
Include required AJAX files
require_once( CF_PLUGIN_DIR . 'classes/ajax.php' ); require_once( CF_PLUGIN_DIR . 'classes/shortcode.php' ); require_once( CF_PLUGIN_DIR . 'classes/widget.php' ); }
1
34eeb6e8adda032c158ca6122b2c41d7
9d6b2b79507ca9960054bc72bb8bfda6
Starts the agent's active tree.
namespace Dmm.Task public class ActionTree public void Start() { CurrentAction = _head.GetChild(ActionState.Default); if (CurrentAction != null && CurrentAction.Action != null) CurrentAction.Action(); CurrentState = ActionTreeState.Running; }
1