query_id
string
corpus_id
string
query
string
code
string
label
int64
6dc349bfa5b83360a4c18ba48a46b357
49012d2e983e3d762db69230d853b595
查找书籍,通过作者或者书名
List<BookEntity> getBookByBookNameAndAuthor(BookEntity bookEntity);
0
c4cbb66655e5ef8a92429d96b8244b03
0511707d96b61fa6cdc31dce40cf9cbf
Insert TD at tail of ED's list.
{ TABLE_OID *new_entry; new_entry = (TABLE_OID*) malloc( sizeof *new_entry ); if ( new_entry == NULL ) return NULL; new_entry->ind_list = init_ind_list(); if ( new_entry->ind_list == NULL ) { free ( new_entry ); return NULL; } new_entry->pObjid = i_oid; new_entry->length = l...
0
bd7ec2ef5b0e4d65a784122a8cbc1b7c
253ae01ec71416dc81364c57ff9243d7
如果sheet名存在了就不新建了
function getNewSheet(sheetName) { var newSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName(sheetName); if (newSheet !== null) { SpreadsheetApp.getActiveSpreadsheet().deleteSheet(newSheet); } newSheet = SpreadsheetApp.getActiveSpreadsheet().insertSheet(); newSheet.setName(sheetName); return ne...
0
f2a3aa6cb3ae2c2ea4b90d8d06e4a520
013bef2fff3063cbc2f0a38189ef122d
Checks if a variable is traversable. <pre> {# evaluates to true if the foo variable is an array or a traversable object #} {% if foo is traversable %} {# ... #} {% endif %} </pre>
function is_iterable($var) { return (is_array($var) || $var instanceof \Traversable || $var instanceof \stdClass); }
1
865feb56271a0f2130dcdd9fddb7eb38
890020bc7ea7be8e68c93a10979e54fb
Helper function to add current location to the parameter array
if (m_locationNum == MAX_N_LOCATIONS) return; m_location[m_locationNum] = loc; ++m_locationNum; return; }
1
62dcddd3448cc546a5bf01d935db1bac
5f170c72e287311d4d6b9fdbb4bed855
Logs an error using the specified resource string and other error details. If the message has an error code prefixed, the code is extracted and logged with the message. If a help keyword prefix has been provided, a help keyword for the host IDE is also logged with the message. The help keyword is composed by appending...
namespace Microsoft.Extensions.Logging public static class LoggerExtensions public static void LogError(this ILogger logger, EventId eventId, Exception exception, string message, params object[] args) { logger.Log<object>(LogLevel.Error, eventId, null, exception, (s, e) => string.Format(message,...
0
2f38f5ffad9e36bcff69b30d312153c9
584f31b79f025c2dc443a5bb80cd5506
线段两端位置的列号相等则为垂直的
public class LineUtilTest @Test public void testVerticalPoint() throws Exception { Point p = LineUtil.verticalPoint(p10, l1); assertTrue(PointUtil.coincide(p, p01)); p = LineUtil.verticalPoint(p10, l1); assertTrue(PointUtil.coincide(p, p01)); p = SegmentUtil.verticalPoint(p00...
0
f17463527b9f1be99d393d074c1c3b3f
0566481741787d3841925b9ede832c90
获取workStatus属性的值。
public class WorkUnifiedPlatformTaskNewEntityShow implements Serializable public String gettask_status() { return task_status; }
0
e2a337f62b9da02cd859f4ae00b3f31a
5943eb50a742ee4f3d13dd06fe6e79b0
Tests that a transform animation with one keyframe works as expected.
{ OwnPtr<CCAnimationEventsVector> events(adoptPtr(new CCAnimationEventsVector)); FakeLayerAnimationControllerImplClient dummy; OwnPtr<CCLayerAnimationControllerImpl> controller( CCLayerAnimationControllerImpl::create(&dummy)); OwnPtr<CCActiveAnimation> toAdd(createActiveAnimation(adoptPtr(new Fa...
0
e11200d4a3697a622318407ec1976683
f4dc10021c70e38cf91cb468898dd066
将样式转换为json对象
function convertStyleToSymbol(style) { let { borderStyle, borderWidth, borderColor, borderTransparency, fillColor, fillColorTransparency, fontColor, fontSize } = style let symbol = { strokeStyle: {}, textStyle: {}, fillColor: '' } borderColor = changeColorFormat(bor...
1
e0355feac6579c4abe12351df56d7b93
a9604aac6cbdca3fb0e9217ac6dbcf5e
Returns all unique metadata categories that belong to the attribute.
global $wpdb; $table_name = $wpdb->prefix . 'mp_product_attributes_terms'; $cache_key = 'associated_categories_' . $att_id; $results = wp_cache_get( $cache_key, 'mp_product_attributes' ); if ( false === $results ) { $results = $wpdb->get_results( $wpdb->prepare( " SELECT term_id FROM $table_name ...
1
20419685d9d0a6e2c274b2891efeeeee
9d653ecad99859bc1654d710ca3ee6a4
対象のカテゴリーの服のidを配列でとりだす
result = [] equip_slots.each_with_index {|e, i| result.push(i) if e == etype_id } result end
1
e7afb5c857330c004bc1acec5e2a2c37
bb10ad6d9f427be2ad8f445f8053996e
Test that one can not access the versions all view without auth.
url = reverse(viewname=metadata_view_name) response = api_client.get(url) assert response.status_code == status.HTTP_401_UNAUTHORIZED
1
5cbadd437294b18785f3553c422b9ca5
5da0c903e2ff5f1f697b4bd95d9044ed
Shrinks or lengthens an array to a new length. Interpolates when more data points are needed.
class blend(object): def shrink(self,a,b): if isinstance(b, np.ndarray): if not len(a.shape) == len(b.shape): raise Exception, \ 'input arrays must have the same number of dimensions' a = self.shrink(a,b.shape) b = self.shrink(b,a.shape) ...
1
6b301863da2d92e2672a5f3defd4b3eb
df42529d6037f50319b68673797b6945
Construct a HMAC deterministic byte generator.
void* key, uint keylen) { if (outlen == 0 || outlen > 64 || keylen > 64) throw new ArgumentException(); for (uint i = 0; i < 8; i++) ctx.h[i] = iv[i]; ctx.h[0] ^= 0x01010000 ^ (keylen << 8) ^ outlen; ...
0
c2d9b69a7ddf1ac41542781377f49926
ee105459c52d6e27c74691d8c84c30bc
2.Удаление книги автора.
class AuthorsController extends Controller public function destroy($id) { $author = $this->author->find($id); $books = $author->books()->select('id')->get()->toArray(); DB::table('books_users')->whereIn('books_id',$books)->delete(); $author->books()->delete(); $author->delete(); ...
0
1b1c33637b6db83f83cd1eda20274aa8
5f233d395a93f2b2ed61b765b885969f
Mostrar productos del carrito
class ControladorCarrito extends Controller public function index() { $cart=Cart::content(); return view("carrito")->with('cart',$cart); }
1
3e0cca6bb3d809b955ab1f824e99336c
00283e4d0430d438001a52617770a91f
Assemble the schur complement matrix from the block matrices stored in #m_blkMatrices and the given local to global mapping information.
const char *funcname = "FilterSchurBlocks"; int *listrow; listrow = new int [nblks]; if (!listrow) MemoryFail (funcname); int *piablkstr = pablkstr->GetIa (); int *pjablkstr = pablkstr->GetJa (); int i, iblk, nlistrow, j, jjblk; for (i=0;i<_nlistschur;i++) { iblk = _listschur[i]; nlistrow = 0; for (j=piab...
0
9c631a733ea234a9d4dc8f736dfd5e8b
19b63f8f869963defbe5935c0d9e9c18
## soft thresholding operator
St <- function(z,lam){ p <- pmax(abs(z)-lam,0)*sign(z) return(p) }
1
fc913e78ce0b8e65bd77200e31ce778c
e7268a82b319f0e0dc26012308efbabe
Removes a single cream from a coffee - if one exists
public class IceCreamCone public String removeScoop() { String flav = flavorStack.pop(); return flav; }
0
fce1393750d7550d130eca586a54e991
fd3184155ff016263dd0369ef132185e
Assigns a new Floating IP to the specified Droplet
return restTemplate.postForEntity( API_URL + "/floating_ips", new HttpEntity<>(floatingIPRequest, httpHeaders), FloatingIPResponse.class).getBody(); }
1
1c34abc796fa95e6d4978c0d821532f1
1c64d214b96bb33c4c00f61f2701aa45
Assert show_terms_of_agreement loads.
if (this.isManaged_ || this.state_ == LoadState.LOADED) { this.showContent_(); } else { this.startTermsViewLoading_(); } }
0
28afeb66e09109468714fb39964cef13
119513584302a0d74382f1206984ae1c
get_instruments takes the curve object, the instruments DataFrame and market_data DataFrame and returns a list of tuples, where each list element is the (instrument period (as a QuantLib object), instrument rate (as a QuantLib object)). The function takes the all instruments listed in the instruments file and filters f...
display_matrix = curve_instruments.reset_index() display_matrix.set_index(["maturity_date"], inplace=True) display_matrix = display_matrix[["instrument", "yield","expected", "delta", "dove", "central", "hawk", "fra", "yield_buffer_1...
0
d929d2883f0b6e0b6232eb4f89cfac8b
0b6afe402f53238ed8bc6b9791f21fd4
Returns the array/abutment bounding box of this template.
class Layout get boundingBox() : geom.Bounds { return new geom.Bounds(); }
0
ab5b1b8d621e638b56c66b0355195e07
516868f371bf0a747892c52e92ed212e
一定時間ごとに画像を切り替える
function changeIMG(){ if (cnt == 2) { cnt=0; } else { cnt++; } document.getElementById("gazo").src=img[cnt].src; }
0
01d6a9798ea99014945fe1e8fdb01e43
2fc68691ddd117a90ddd10061735fa6e
Appends the page number
{ stringstream sstr; sstr << "Page #" << ( in_current_idx + 1 ) << "/" << in_total_number << "."; in_info.text( sstr.str() ); in_info.display(); refresh(); }
1
3c06d54f84a42d5990840e8095385074
c2666775c64a39d6b46afe54b2ef150c
# first remove template prefix (if it exists)
class D_View_Source function map_name($templateName) { if($templateName[0] == '/') { return $templateName; } if(substr($templateName, -4) != '.tpl') { $templateName .= '.tpl'; } $tpl_hash = md5($templateName); if(isset($this->found[$tpl_hash])) { return $this->found[$tpl_hash]; } else { if(str...
0
2a93ec6386824d3ad39341b98048f625
757dacf094833940003ff89da14ae63a
Remet à null le cache des Bonuss liés à la collection
class BonusCollection extends BaseCollection public function resetCacheTypeBonuss() { $this->cacheTypeBonuss = null; }
1
8a791e81cc850ca485bf458ecd30d1b1
06f2dc73546554ea7df7944dc49e084a
Parse the MPD intermediate representation into a regular Manifest.
class ManifestInterface(object): def convert_manifest( self, allowed_mediatypes, namespace_name, repo_name, tag_name, content_retriever ):
0
9dd071124e76eeb6a6e74f63a1b21b57
aa88f92d56a060fcc9046d29de1679c2
批量硬删除流程处理意见
public int HardDeleteByNos(String appCode,String[] nos) { if (StringUtils.isNotEmpty(nos)) { return flowProcessvarsMapper.HardDeleteByNos(appCode,nos); } return 0; }
1
f401335df23266efdaca9858b9ea2423
2d6223a3ad6db85bac711547ab86bef8
Returns dot-accessible versions of pure dicts (& lists).
class DotReadableDict: def __getitem__(self, key): return getattr(self, key)
1
b16a043a133b00477bae09d02d167aa0
3ce5372e620d6a772e7bec811d7e4caf
系统类型转换为数据库类型
namespace BOMExportServer public class DEDataConvert : DABase public object ConvertToSystem(DBDataType type, object obj) { switch (type) { case DBDataType.Char: return Convert.ToChar(obj); case DBDataType.Varchar: return Convert.ToS...
0
f873ea3fa23e06e917fca0caa8c3fa14
b8ecd9ff0d0ad3800857bf538d4652a0
设置页面变化探测器,用于探测抓取页面的变化,如果有变化就立刻抓取,没有变化则继续探测。 默认是探测整个页面是否发生改变。
this.domChanged = false; this.MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; var that = this; var obs = new MutationObserver(function(mutations, observer){ mutations.every(function(mutation) { if ((mutation.addedNodes.length...
1
29a526e6ae317c81fdc3f7305b4410e6
3d67229407bb6653c368be32114a2003
Returns the principal angle in radians that a given point on the cartesian plane makes with respect to the positive x axis with the origin as the vertex.
def yaw_angle(p): return np.arctan2(p[1], p[0])
1
3516b102200ae9528e1d6a25f5f92b7d
9a1f47596491cc969946a573fdaf0e90
it returns the sudoku resolved as a single string
class SudokuPuzzleMaker: def create_solved(self): self.solved_puzzle = self.solve(self.constraints, self.candidates) self.solved_puzzle.sort() return self._to_string(self.solved_puzzle)
1
6570dc1e9b0b82fd41e9de219690b100
86ee0dfb6847175f01ca5e046a903510
设置网易云请求的请求头部
class ExoSourceHelper private fun setHeaders(headers: Map<String, String>?) { if (headers != null && headers.size > 0) { for ((key, value) in headers) { if (TextUtils.equals(key, "User-Agent")) { if (!TextUtils.isEmpty(value)) { try { ...
1
be3861d0a659fbe061ccbd3c90d1a1f7
b2d6a3433bf66fd87c6f1af3edd346bb
自定义外键的序列化和反序列化的方式
var _this = _super.call(this, model) || this; _this.parent = _this.model.relation(parent); _this.foreignKey = foreignKey; _this.ownerKey = ownerKey; return _this; }
0
604f1216f990e996905fdbbd4b81941a
18795093ac19982fd13673ca2a616dae
Configure LED1-8 GPIOs for output
int main(void) { nrf_gpio_cfg_output(LED_0); nrf_gpio_cfg_output(LED_1); nrf_gpio_cfg_output(22); gpio_init(); while(true) { } }
0
ea8142abb2c351e5f14035d946d70444
99e2cb445829e542dd8fe81c5d09a9ca
获取音乐下载路径
String fileDownPath = ""; if (type == ResType.PICTURE) { fileDownPath = getPicturePath(userName); } else if (type == ResType.VIDEO) { fileDownPath = getVideoPath(userName); } else if (type == ResType.MUSIC) { fileDownPath = getMusicPath(userName); } return fileDownPath; }
1
92a15952200e987dbf1912dc3590bd2f
fce05b8fc9619ecef34769533bbedcc2
Laver et antal nye, tomme linjer
class StrBuilder: def newLine(self, num=1): for n in range(num): self.code += '\n' return ''
1
fbd195e4fd4c7742832d2bd99969546e
cec7b6fd16361ca861bfd9351571db7b
Set up empty gene models.
public abstract class AbstractModelFeatures extends AbstractDto implements IModelFeatures public void clearGeneModel() { }
0
e2dca78f0aa950d0e198131298535026
7d7ffd9a0e7fff28b3d92c8d4663336d
Kiểm tra đối xứng của mảng số nguyên
namespace _4.SymetricArrays class Program static void Main() { int n = int.Parse(Console.ReadLine()); bool[] symetric = new bool[n]; for (int i = 0; i < n; i++) { string[] currentArray = Console.ReadLine().Split(' '); symetric[i...
1
e972b8aa41abf2017cf15ecc9035e7df
7de15ca61468080688bd68a676531ea9
Gets the name from property descriptor based on DataMember attribute.
{ if (propertyExpression == null) throw new ArgumentNullException(nameof(propertyExpression)); return GetMemberInfo(propertyExpression).Name; }
0
789bd4a493548143ab5f1edb89ea369d
90464169a0ca3b27534382779afd5aff
+---------------------------------------------------------- 设备表迁移 +----------------------------------------------------------
class HardwareManageController extends AdminController public function upload() { if($_REQUEST) { $upload = new \Think\Upload(); $upload->maxSize = 1024*1024*100 ; $upload->exts = array('xlsx'); $upload->savePath = ''; $info =...
1
fe196f422eb9dfc0cce38e326bfff631
cba341273f20ee7a142b06d7ab918b7b
获取备付金信息
wx.request({ url: app.data.local + 'stuser/matchbond', data: { }, method: 'POST', header: { 'content-type': 'application/json' }, success: (res) => { this.setData({ deposit: res.data.data.bzj }) } }) }
1
374890179b6970414eca21205cf54664
1d5bd5f9351cc281864d5ce04cceec1f
Активные задания для заказчика
class OrderController extends Controller public function getActiveOrders() { $userId = auth() -> user() -> id; $user = User :: with([ 'active_orders.charger_connector_type.charger', 'active_orders.charger_connector_type.connector_type', ]) -> find( $userId ); $user -> active_orders -> ea...
1
066b32fcc959fbf713a23c8bd473fbbb
526906333545e6cfc811678eee09ef9d
@brief Create interface elements between the computational elements
void TPZCreateApproximationSpace::CreateInterfaceElements(TPZCompMesh *mesh, bool betweencontinuous, bool multiphysics) { TPZChunkVector<TPZCompEl *> compelvec = mesh->ElementVec(); int64_t nel = compelvec.NElements(); for (int64_t el=0; el<nel; el++) { TPZCompEl *cel = compelvec[el]; if (!c...
1
7b11c0f69594d0390eee53cdd35662f5
64d8accfb6ce91d45f4e684bc54adeab
GET /ressources GET /ressources.json
async function Index_ressources() { server.get('/bdd', async function(req, res){ res.send(bdd.listPoints); }); server.get('/ob', async function(req, res){ res.send(ob.listPoints); }); server.get('/ff', async function(req, res){ res.send(ff.listPoints); }); server.get('/fftm', async function(re...
0
2515c8cef054a3e13889215d740a566a
fae90cc621560e330a6fc9718550fd6b
Get the limitted nama barang text for ecommerce.
$good = (isset($goodData)) ? $goodData : ''; $strLimit = 16; if(mb_strlen($good) >= $strLimit){ $good = mb_substr($good, 0, $strLimit) . '<span class="fade">……</span>'; } return $good; }
1
a6b998ac6df83e43acd0803eff134021
13bebb412cb8580a821dbb0e3dc90092
Returns a cypher statement representing a property list
props=[]; Object.keys(properties).forEach((k)=>{ val = properties[k] if (typeof(val) != 'number') { val = '"' + val + '"' } props.push(k+":"+val) }); return props.join(',') }
1
5b522852b6ca438b8c37e0abd3aa492a
872812e33d11574e5961af2aae312192
解析md文件
if (!md) { return {} } const lines = md.split(/\n+/) const data = {} let nowApiName = '' let nowApiUrl = '' let nowApiAllMD = [] for (const l of lines) { if (nowApiName) { nowApiAllMD.push(l) } if (/###.+/.test(l)) { if (nowApiUrl && nowApiAllMD.length) { data[nowApiU...
1
f9eaec36899f36e66eba6827d4f8cf09
3a98d6ff8a1a3bd0f929a9c86b547fe4
This function gets the channel information. When output, the exact size of the returned response.
static ngx_int_t nchan_channel_info(ngx_http_request_t *r, ngx_uint_t messages, ngx_uint_t subscribers, time_t last_seen, nchan_msg_id_t *msgid) { ngx_buf_t *b; ngx_str_t *content_type; ngx_str_t *accept_header = NULL; if(r->headers_in.accept) { ...
0
4bf2aca1c8ea7f3a2bf51a45acb8e0a0
c27cc6b3ff6cd29edb86ed66625f9217
注册消息处理Handler类(原型模式)
namespace Senparc.WebSocket public class WebSocketConfig public static void RegisterMessageHandler<T>() where T : WebSocketMessageHandler, new() { WebSocketMessageHandlerFunc = () => new T(); }
1
4ede5381a88f06af45c30c932f55a198
26a94916e55fbc130570eadd8acb0fbc
Returns license information by its ID. API Group: Light
url = 'https://api.github.com/licenses/' + key params = self.__reqp.Get('GET', 'licenses/:license') params['headers']['Accept'] = 'application/vnd.github.drax-preview+json' r = requests.get(url, **params) return self.__response.Get(r)
1
b393eeebf1bf7e874160144bb274d9c1
3dec974c7bc0c236a4f20da524a051f6
The date, in UTC, before which the schedule can invoke its target. Depending on the schedule's recurrence expression, invocations might stop on, or before, the end date you specify. EventBridge Scheduler ignores the end date for one-time schedules. Example: `2030-01-01T01:00:00Z`.
class AccessReviewScheduleDefinitionByIdArgs: def end_date(self) -> Optional[pulumi.Input[str]]: return pulumi.get(self, "end_date")
1
d31b5e47fa8d3b5de2f0f1ffd3e3aa98
c4c7acdd2a94c5df5a500ee56e02448b
Returns true if the passed node is selected, else false.
public class Controler public boolean nodeSelected() { return (selected != null && selected instanceof ViewNode); }
0
fadba8badeb5f4befa66b7fc5534b006
9331da7a08075a5cb0f7c8595d7f10b9
Sent the command to move down for a given channel.
self, num: int = 1, log_api_exception: bool = True ) -> Optional[bool]: return await self.__remote_multiple( "CH_DOWN", num, log_api_exception=log_api_exception )
1
580c72a43acbb8a0d079c22195d04271
d3b0c7521af460d797d2a78a7a2d129d
see ObjectEnvironmentRecord.SetMutableBinding
ecma_completion_value_t ecma_op_create_mutable_binding (ecma_object_t *lex_env_p, ecma_string_t *name_p, bool is_deletable) { JERRY_ASSERT (lex_env_p != NULL && ecma_is_lexical_environment (lex_env_p)); JERRY_ASSERT (name_p != NULL);...
1
d532b579d329226eee8462afa17b858e
22a5f3ad5966ffd58ed93971ca3d172e
Repositions and rotates the Arrow according to the given Position and forward Direction.
float angle = Quaternion.FromToRotation (Vector3.forward, direction.normalized).eulerAngles.y; DrawArrowMarker2D (position, angle, size, colour); }
1
94caa9b30f4e06ea601e6b70933347dd
ee2d6f6d6b24e81a3c863ed686beb281
playerElementの点数と手札を更新
pointBoard.innerText = modePoints === 'win' ? parseInt(pointBoard.innerText) + countRemainingOrOpenCard * 42 : parseInt(pointBoard.innerText) - countRemainingOrOpenCard * 42; finishResult.innerText = ' ' + pointBoard.innerText; }
0
46176b4d927bcf087dc179b8dff6c779
b144bc6ff0d4f7b0a02c910f5fc6bfd2
Returns a list of pull requests for a specific ISSUER. This method returns a list of standardized PullRequest objects.
def pull_requests(config, args): return config.repo.pull_requests(state=args.get("state", "open"))
0
c9ddc344dad034d6df75bd8a56a265ec
f60a14debf176ba0934b529f24836c7c
Funcion que utiliza el metodo de Newton para buscar el cero de la funcion derivada, correspondiente al alcance maxim
def newton_mathod(f_func, f_derivative, x0, epsilon): x = x0 k=0 cont = True while(cont): print("k={} x={} f_func(x)={} f_derivative(x)={} f_func(x)/f_derivative(x)={}".format(k, x, f_func(x), f_derivative(x), f_func(x)/f_derivative(x))) prev_x = x x -= f_func(x)/f_derivative(x) ...
1
f3ff34223f901d3a972a7748c5535911
7e4b2646fd25b984bf712d30567daefc
Get name corresponding to the canonical name
if (canonicalName == null) { canonicalName = getName(); } return canonicalName; }
0
c0f62cd103faee9fd1b1b3d2fa992da7
f12df0d201611364cbd48684b969cd25
递归删除cache中所有子节点
{ $result = $this->where('parent_id', '>', 0)->where('code', $key)->delete(); $this->clearCache(); return $result; }
0
8e97d9e363da497fa25ec143ec2f2d6f
ec01f33095d39d1afd4af52e324138cd
Measure of corner response.
def corner_detector(img): cimg = corner_harris(img, method='k', k=0.01, eps=1e-06, sigma=3) return cimg
1
ce6e7526e8cb24619acbcb97391aa621
b7bb3b8d548b04b3619a717e6945a1b2
Verifica se o objeto retornado é da classe esperada.
abstract class AbstractValidator implements ValidatorInterface protected function isCorrectObject($data, $type) { if ($data instanceof $type) { echo get_class($data) . "\n"; echo $type . "\n"; return true; } return false; }
1
88f09f8830940fb9f02b00a9a0af33ba
94fe33f473a55058a149c8e36ce8e191
生成硬件唯一的UUID
public final class DeviceUtils public static String getUUID(Context context) { String uuid = SharedPrefUtil.get(context, "UUID"); if (TextUtils.isEmpty(uuid)) { uuid = String.valueOf(RandomNumber(899999999) + 100000000); SharedPrefUtil.put(context, "UUID", uuid); } ...
0
74a84eeb975103cf82dc34eafccc3cdb
cb80fa5197e57a51e1a46c2f4377ab32
Changes the wind gust direction.
if (wind != null) { _fieldWind = wind; } else { _fieldWind = Wind.TON; } }
0
7ee6662e2971e5f6581f69147bcd1346
06a648868146c7d5c521f24c37b9d158
Replaces all sections of the path that are not identified as endpoints with the ENTITY_SUB value. This makes for a normalized view of the path so we can reliably compare /api schema paths with their endpoints Eg: /app_instances/XXXXXX-XXX-XX-XXXXX/storage_instances --> /app_instances/_ENT_/storage_instances
class FindEndpoint extends Util createPath(value) { return this.paths.base + value.replace('{externalId}', this.externalId); }
0
290f3825f9e7c6aad8f36410e8331697
7b49daeea38d792e92f9790b3f4731a2
通过视图获取数据
namespace QuickORM.BLL public class BaseBLL<T> where T : BaseEntity, new() public DataTable FindByView(string viewName, string condition, string sortField, bool isDescending) { return baseDal.FindByView(viewName, condition, sortField, isDescending); }
1
3ca4f1c8f2f7b2fd8e21eed888301782
8d503effb7d91f74679d9d5704a808e9
Получает скидку для переданных купонов
export class PrivilegesService getDiscount(offer: Offer, promoProduct: Product, quantity: number): number { return this[`${offer.offerType}`](promoProduct, quantity, offer.parameters); }
1
4861405a9a80b553dddb9051d5db466f
826e09d42fdb085a06dd5ac4a9a67cb2
validating the required db format, fails if entered locale format cannot be parsed to required format
export class TNSTextToSpeech private isValidLocale(locale) { var re = new RegExp("\\w\\w-\\w\\w"); return re.test(locale); }
1
5cf87398072757e2d835dd37668e3702
b0f999cdf0754565a165ee60e517b762
Recursively iterate through all objects in the pipeline and set a given parameter.
class BaseParameterDict(SyncedParameters): def __setitem__(self, key, value): if isinstance(value, Parameter): self.track_object(value) elif isinstance(value, list): for item in value: if isinstance(item, Parameter): self.track_object(item) ...
0
5ef6c64dced981f9666d665585298ee5
b1ac54822d96e81111774d0750b12c62
Helper function to get the pageX/pageY of a MouseEvent or TouchEvent
function getPageXY(evt){ evt.stopPropagation(); evt.preventDefault(); if(evt.type.search("mouse")>-1){ return {x:evt.clientX, y:evt.clientY}; } else if(evt.type.search("touch")>-1){ var touches; if(evt.type == "touchstart" || evt.type == "touchmove"){ touches = evt.touches||evt.targetTouches; ...
1
cbecf0442fbc72a27da437c76b1973a6
e95e6f51fce4c1e6c70bbdb25838318d
修改期中考试时间
namespace Tellyes.BLL public class TempExamTimeInfo public bool ModifyTempExamTimeInfo(Model.TempExamTimeInfo tempExamTimeInfo) { return new DAL.TempExamTimeInfo().Update((object)tempExamTimeInfo); }
1
4717572b0b5f13ba8d0326e706220b76
80cae069af29a303d98b31205b3f4dcf
Выполняет печать (переправку пользователся на открытие документа) выписки создания запроса
namespace STCLINE.KP50.Interfaces [OperationContract] Returns PreparePrintInvoices(List<PointForPrepare> finder);
0
9b24d4ac171fcb8de65635e6ac272fb6
edd5bc49628a84bd2d2c982d6d575bcd
Get the current/last byte read. Suitable for debugging JSONT_ERR
uint8_t jsont_current_byte(jsont_ctx_t* ctx) { return (ctx->input_buf_ptr == 0) ? 0 : *(ctx->input_buf_ptr-1); }
1
f4b45390c2c6df8f6d22877ee0b91ba4
06375b12fd7ea78712626956010f58a4
Imprime registros de vacaciones
class VacacionController extends Controller public function index(Request $request) { $persona_id=$request->get('Buscador'); $datos['vacacions']=DB::table('personas') ->select('persona_id') ->join('vacacions','vacacions.persona_id','personas.id') ->groupBy('persona_id') ...
1
9c3315fda374513ca4dcd0c33c648462
a9e030069f351fd4492fbd10113e5b1a
Metodi lisää uuden solmun annetulla arvolla AVL-puuhun.
public class AVLTree public int insert(int k, String i) { IAVLNode newNode = new AVLNode(k,i); IAVLNode current = root; if (this.empty()) { this.root = newNode; return 0; } while (current != null) { if (current.getKey()==k) { return -1; } else if (current.getKey() < k) { if (cu...
1
0d51f127d87c82b30ed4ddcbe3a8a20e
672a60c0d5d5a35b62b5ec4a0dd8e0e5
Gets the alert dialog to enter a comment when a trade is accepted.
public class AlertMessage public static AlertDialog.Builder getConfirmDialog(String message) { AlertDialog.Builder builder = new AlertDialog.Builder(activity); builder.setMessage(message); return builder; }
0
a2b7c7b37babf01f319e2807bb07eaa9
55da9988eb5bb1c46d1ce3ad0ba3056c
по введенному индексу, выбранному субъекту РФ, выбранной террит. пр., заполняет список городов
class SiteController extends Controller public function actionSubjectslist($id){ $groups = Region::find()->where(['district_id'=>$id])->orderby(['name' => SORT_ASC])->all(); if($id == 1){ } echo '<option value=" ">Выберите регион...</option>'; if(!empty($groups)){ for...
0
224b11379bc9489663687f7f8a255ab6
6f9ed3f117374154158623cd19d298b0
=============== addToMineVehicles Function adds a vector pointer to the master vector of mine vehicles ===============
{ if ((mv) && (mlist)) { mv->Prev = mlist->TailPtr; mv->Next = NULL; if (mlist->TailPtr) { mlist->TailPtr->Next = mv; mlist->TailPtr = mv; } mlist->NumVectors++; } return mv; }
1
e85d6950cd59c05ac9ab0f073f48adb3
ccf3511a09660e15d9db56bdfb4e218e
기존사용자 로그인 성공시 비번오류 및 잠금해제 초기화
{ try { DB::start_transaction(); $original_common_text = new \Original\Common\Text(); $new_username = $original_common_text->random_text(25); $new_password = $original_common_text->random_text(32); $query = DB::update('users_login'); $query->set(array('username' => $new_username, 'password' => $n...
0
0fe694baa4de49f7383bc9498cc8f7b5
311e5b1e77e6692b5fd0e3bee5b47147
Gets from the invoker the piece of saga data that has been determined to be relevant for the invocation, returning null if no such saga data has been set
{ Saga saga; InvokePreGetHooks(type, id); saga = sagaStore.CreateSaga(type, id); InvokePostGetHooks(saga); return saga; }
0
607abd0a8cebb5f2e22556766830e204
5eb31ee20a8dc70ee14f26998e8c4329
根据课程id获取课程时间列表
public List<Time> get_time_by_subject(Integer subjectId);
1
a33c6603c4293eb162c334e8624ab2ad
509afaffad2cb2b07ae9f557909b991c
similar to reload <
class InitRouter reload () { this.hashUrl = this.location.hash.substring(1) || '/'; this.routes[this.hashUrl](); }
1
055333ee7ddf477044f3d2d061dd209e
89ba5eac506b400993b10e07db319f8b
Add City Modal method
public IActionResult ConfirmAdd(int id) { City city = cityDAO.GetCityById(id); return View(city); }
0
decd688644d788f0f6523db986a8c1a7
5ff3bac3ede0673e07cc8a0a28dda0db
Parse array. Array elements are separated by comma.
{ if (null === $value) return null; if ('{}' === $value) return []; return explode(',', substr($value, 1, -1)); }
1
92c0789d14c0d5fee8477eb17d718a05
d5078c74c1d1bc91ced008268637b75b
put this actors center at the center of another actor
float otherCenterX = other.getX() + (other.getWidth() / 2); float otherCenterY = other.getY() + (other.getHeight() / 2); centerAtPosition(otherCenterX, otherCenterY); }
1
45075c9098803b074443231865c8a0b4
7d76acf4c2ac25b251d1edcd454b22a0
Permet de supprimer un tuple.
{ var toRemove = tuples.FirstOrDefault(l => l.Item1 == left && l.Item2 == right); if (toRemove != null) tuples.Remove(toRemove); }
1
c609a739bfaaad95c0fd7a8a913e4948
b9dd25e5ea595cfb17493a6370bf80e3
Business method to get the list of work flow escalation details.
$ATHfullname = $params['ATHfullname']; $Dieticianfullname = $params['Dieticianfullname']; $Memberfullname = $params['Memberfullname']; $mobile_number = $params['mobile_number']; if ($params["center_id"] != 0) { $condition = "vlcc_centers.id = " . $params["center_id"] ...
1
4aa19a56e1f13988711b984ae0489bea
36580066b4ca769845367057b0bb8cd7
Returns a value indicating whether this rectangle contains or intersects a rectangle.
namespace Nez.Maths public bool Contains( RectangleF value ) { return ( this.X <= value.X ) && ( value.X + value.Width <= this.X + this.Width ) && ( this.Y <= value.Y ) && ( value.Y + value.Height <= this.Y + this.Height ); }
0
00f3b381f46f6b04c6c8125628b9cdad
620901dda4f64e503d49ed326ae7de5c
陣列深度複製
export default class ArrayHelper public static DeepCopyArray(array: any[]): any[] { PreCondition.DeepCopyArray(array); return PostCondition.DeepCopyArray(array.slice()); }
1
0f40990fb9a912b7bf130353e47d3ac7
70a4e19571343f960b5a9c8aa043accf
Store the final wallclock time and the time at which the run failed.
class HelloWorld(Application): def failure(self, time, shared): print ('[node %d] failure @ (%d, %2f)' % (self.__node_id, time[0], time[1]))
0
06eac8cb04dc6e8da697af26bddcc7e1
6ee133e8295165f0a75a74f9c555ce30
获取当前学生的所有学时信息并渲染到表单上
class StudentCourse extends React.Component{ loadStudentCourse(){ $.get("http://127.0.0.1:8888/studentsc/findAllWith",({status,message,date})=>{ if(status===200){ this.setState({ "studentcourse":date }) }else{ alert(message) } }) ...
1
1ceffb0c5a422f53b902aad68c95f18a
96eb97fb4264dffb7bb464d61b68f1f8
16进制字符串转ASCII
function hex2asc($str) { $str = join('',explode('\x',$str)); $len = strlen($str); for ($i=0;$i<$len;$i+=2) $data.=chr(hexdec(substr($str,$i,2))); return $data; }
1
9f01cac5825c6a24dab3caf9651d9b77
89cb26fa058c1adff01911f5d8572fca
return score(player) > 21;
def is_score_bust(score): if score > 21: return True else: return False
1
b0862e9fadb1419452732c04f0559864
76e750e0612fc82c38db6c7292614637
Get RX status (Enabled\disabled) unit - (IN) Unit number. port - (IN) port number enable - (OUT) 1- Enable 0- Disable SOC_E_xxx
isis_port_3az_status_get(a_uint32_t dev_id, fal_port_t port_id, a_bool_t * enable) { sw_error_t rv; HSL_API_LOCK; rv = _isis_port_3az_status_get(dev_id, port_id, enable); HSL_API_UNLOCK; return rv; }
1
60bcbb264e9555652eb57219265062a7
ed198ae181be0b1a7efff09cc6b3d373
Returns whether a tree item is checked or not.
public abstract class TreeDomain<ID extends Serializable> extends BaseDomain<ID> public static class NodeState implements Serializable{ public boolean isChecked() { return checked; }
1
add9e8462494c86abb79b0d19c261c1a
54f16fa4e8bf2f3366008faba392690e
Rl := Rx XOR Ry
func addRxRy(v *vm.State, o vm.Opcode) error { x := o.X() v.Regs[x] = add16(v.Regs[x], v.Regs[o.Y()], &v.Flags) return nil }
0