query_id
string
corpus_id
string
query
string
code
string
label
int64
95a11083ae52767d39baa850e3ed3646
f68636fda4febdd1e4e46bd25aae2219
函数名:从数据库里面删除指定商家或者币种的已取消订单,不传币种则删除该用户所有已取消订单 函数功能: 输入参数: 输出参数:
bd_info_uuids = xqkj_query.get_tbl_infos('Tbl_BDInfo', 'bd_info_uuid', 'POSITION("{}" IN name)'.format(loginAction.sign)) xqkj_query.delete_info('Tbl_BDInfo', 'POSITION("{}" IN name)'.format(loginAction.sign)) xqkj_query.delete_info('Tbl_BDMerchan...
0
cc88a3db362395193e5cbb0f06d9cf14
0976cf51ec8666ab25e26cbcd13b374c
Depending on the value of the point velocity we turn the characters rotation
if(desiredVelocity.sqrMagnitude>Mathf.Epsilon) { _lookRotation = Quaternion.LookRotation(desiredVelocity, Vector3.up); transform.rotation = Quaternion.Slerp(transform.rotation, _lookRotation, 5f*Time.deltaTime); } }
1
39a7b210a984c8696027c4927cac5613
10b8106023418dc100e9a945501bd1e6
ToInt converts an interface{} value as int and returns a default value in case of error
func InterfaceToInt(value interface{}) int { switch v := value.(type) { case string: tmp, err := strconv.Atoi(v) if nil != err { return -99998 } return tmp case int: return v case float32: return int(v) case float64: return int(v) ...
1
23cb3572a60e3f20a9bebeed235f8999
fbde7835ef97ed28c63150dc138df8bf
以邮件或者短信的方式发送实时告警列表
class SendMsg(object): def sendWarning(self, subject = '', msg = '', subtype = 'html', attachment = [], method = 'email'): try: method = method if method else 'email' if not self.sendList or self.netmanager.alarmManager.modifiedNotify: self.sendList = self.netmanager.alar...
1
20c97330b21cf93028827db9f9cad9f4
e32abc974248009c78220eb5421525d4
Saves the vertex coordinates to a binary file.
with open(filepath, 'w') as outfile: outfile.write('{}\n'.format(len(coords[0]))) with open(filepath, 'ab') as outfile: numpy.savetxt(outfile, numpy.c_[coords])
1
ce998b48e2a07d4e2ca235dc8ea8912a
b30cf1bb0857d79fab0bc2f7e3093c00
Spawn pipes based on interval
if (spawner > 240/SCROLL_SPEED){ spawner = 0; int length1 = (rand()%6)+1; int length2 = (rand()%6)+1; if ((length1 + length2) > 7){ int variation = rand()%3; if (variation == 0){ l...
1
e339ec59535923dfb969d03fe77274c1
0f0243b2b85657680c12fda3d711db52
Show images after they have all loaded
export class ModalCarouselComponent ngAfterViewInit() { $(".picture").on('load', function () { $(this).siblings('.spinner').hide(); }) }
0
10f9a14b05a978aa7f5c1402edf2e781
703f318ee0a759e344934969fff05a68
导入包装类型对照表
{ if (Options.SelectStation == null || Options.SelectProduct == null) { IRAPMessageBox.Instance.ShowErrorMessage( "选项一或选项二没有配置!", caption); return; } string strProcedureName = ...
1
aa5c17946769fa4f798453387da030e2
592bd3a6d0cab55db642e878020dc6f1
Normalize a size vector sequentially
let data = data.as_ref(); self.0.iter_mut().enumerate().for_each(|(i, x)| { *x = data[i].to_norm(); }); self }
1
d8a9e19f99b58f6b2a3b0a654b9183b5
cc000fb453567b5a93c94694fafd73e5
获取val在树中对应的节点,找到返回节点,否则返回null
namespace LDSP.Helper public class UIHelper public static TreeNode GetNodeByValue(TreeNodeCollection nodes, string val) { for (int i = 0; i < nodes.Count; i++) { if (nodes[i].Value == val) { return nodes[i]; } ...
1
bf95ed271ca011886c75b2126406d725
96a0008e20f90be5678ec36f4875ab84
Create and setup QIntegerTextBox txtIdDefinicionCapitulo
$this->txtAlternativaId = new QTextBox($this->objParentObject, $strControlId); $this->txtAlternativaId->Name = QApplication::Translate('Alternativa Id'); $this->txtAlternativaId->Required = true; $this->txtAlternativaId->MaxLength = Alternativa::AlternativaIdMaxLength; $this->txtAlternativaId->PreferredR...
0
b448e8a5c4914a563b121f41380ff8b1
983584eb86c6fabe9e9cbc420b49edc9
YeWuGudingDoing 查询,返回Datatable
{ #region if (!string.IsNullOrEmpty(query.phone) && !string.IsNullOrEmpty(query.Kw)) { return Error("查询参数有误"); } var dt = new DataTable(); return PageDatatable(dt, query); #endregion }
1
2b042d5d1ccedf1a91e2db8776833366
fa7827116e2fa477e0d97e5dc420f10a
Hydrate content type to make more readable in requests
function prepareResults(contentTypes) { var results = _.reduce(contentTypes, function (result, contentType, key) { if(_.isString(contentType)){ var id = contentType; contentType = { id: id } } contentType.name = key; result.push(contentType); return result; }, []); re...
1
8db2a35c23a304abf26f93a144999b69
95f5002ea9e79561461112c379bda2e7
Gets the saml Metadata Url.
class GetServicePrincipalsServicePrincipalResult(dict): def saml_metadata_url(self) -> str: return pulumi.get(self, "saml_metadata_url")
1
6d8610d235d03c954c4aebc71e23fb5f
d7b3100fc7f7c029eebefb79efc900fd
Test method for {@link floatingpointdev.parameters.MidiController#setLearningMidiInput(boolean)}.
void VstChunk::setLearning(bool newLearn) { if (newLearn != midiLearn) setLearner(kNoLearner); else if (newLearn == false) setLearner(kNoLearner); midiLearn = newLearn; }
0
ae366ffe8f4c78b03203f413f80ddf38
290b569f6cacd7b79e13b940c241dc58
Returns the string output from the url.
class Curl extends Base public function __toString() { try { return $this->getContent(); } catch (Exception $e) { \Sledgehammer\report_exception($e); return ''; } }
1
2d3a46e009109e645569858302063716
8045496351d99a00203aa59fe53da50a
链表排序,使用冒泡法
void bubble_sort(kl_pt head) { kl_pt get_node, n; int num = 0; list_for_each_entry_safe(get_node, n, &head->list, list) num++; struct list_head *pos; kl_pt temp_node1, temp_node2; int flag = 1, i, j; for (i = 1; i < num - 1; i++) { pos = head->list.next; flag = 1;...
1
d46fbd44977a3d635c8c52cfc064ed13
c8345ecaafae7c79e95b222f3b6e964c
通过Calendar获得当前日期,显示在View上
public class AddEventActivity extends Activity public void setCurrentDateOnView() { curYear = c.get(Calendar.YEAR); curMonth = c.get(Calendar.MONTH); curDay = c.get(Calendar.DAY_OF_MONTH); year = curYear; month = curMonth; day = curDay; Calendar cal = new GregorianCalendar(year, month, day); dayOfWeek =...
1
3f58c9c0a08e5ff2b45561e5504197c2
3c925a2fba68d3143f70488086d1ce38
服务器端推送消息给客户端的方法
public class NettyServerMap public static void push(String clientId, String msgId, Object data) { if (StringUtils.isBlank(clientId) || StringUtils.isBlank(msgId)) { return; } RecvMsg pushMsg = new RecvMsg(); pushMsg.setMsgId(msgId); pushMsg.setData(data); Chan...
1
b5e756c9d9f263db691854fd29ea2896
9609ebe7a8b1a03a8a9682256303cb50
Set a port's level
if port < 0 or port > 7: raise ValueError('invalid port number %d' % port) if val: self.set_digital_all(ord(self.send_buffer[1]) | (1 << port)) else: self.set_digital_all(ord(self.send_buffer[1]) & ~(1 << port))
1
27f640352e40087ca54a3f84192d1e39
0cd68e2aefcea3a8706c3b0edfb16e97
获取Ingredients的element
class Food{ constructor(){ this.element=document.getElementById('food')! }
0
643939a1596955e839c19e01a73b152a
41634cb1b3602c4600a81fec1a0269df
Calcule la clause SQL IN à partir d'un tableau de valeurs
namespace AccountServer public class Database : IDisposable public static string In(params object[] args) { return "IN(" + string.Join(",", args.Select(o => Quote(o is Enum ? (int)o : o)).ToArray()) + ")"; }
1
0517e8c0b321257572d98cc5e044e2a6
8fd2762612e0804f5f67f6124c39a5c2
Update player data in database in server.
public class MySQL5PlayerDAO extends PlayerDAO @Override public void storePlayer(final Player player) { Connection con = null; try { con = DatabaseFactory.getConnection(); PreparedStatement stmt = con .prepareStatement("UPDATE players SET name=?, exp=?, recoverexp=?, x=?, y=?, z=?, heading=?, world_id=?,...
1
3c139d23c43e7264858bef900e9b4a15
27f2aaa522f4f166c92b57419dcd42a6
通知其他线程已查询完毕
public class HelpUtils implements SearchListener public synchronized void searchFinished(SearchEvent e) { searchFinished = true; searchEnum = searchNodes.elements(); notifyAll(); }
1
9ff281c83c7e4c4ca3e8760469b50101
1862df0c3c443a69bed0dc7a47589893
定义__delitem__方法,用于删除序列中的值
class MyClass(object): def __delitem__(self, key): pass
1
16532e299464434d9b7a35bc09178c3a
01687d2676f2c8d1fc92ca6af0e79f42
Returns the esf partecipant type ID of this e s f partecipant type.
public class ESFMatchWrapper implements ESFMatch, ModelWrapper<ESFMatch> @Override public long getEsfMatchTypeId() { return _esfMatch.getEsfMatchTypeId(); }
0
6f07c78f2fc4ab618e2e9d16cf43ff03
518e2813d680580ccc3b10dd7418f560
<pre> Archives a CustomMetric on a property. </pre>
@javax.annotation.Generated( value = "by gRPC proto compiler", comments = "Source: google/analytics/admin/v1beta/analytics_admin.proto") @io.grpc.stub.annotations.GrpcGenerated public final class AnalyticsAdminServiceGrpc public static final class AnalyticsAdminServiceFutureStub extends io.grpc.stub.Abs...
1
2bebdfe2c7b29afa6dc5ab163240d500
fa97777d810f032f75e8d9ff6ab09b1e
增加合成记录
void addBatch(@Param("produceId") String produceId, @Param("list") List<Concat> list);
1
74fab764966f2a489d9da3a7f7009c9a
49b01c1cece4ffad43970b61e3a7a919
Compter les videos
{ $count0 = videolog::where('video_id','=',0)->count(); $count1 = videolog::where('video_id','=',1)->count(); $count2 = videolog::where('video_id','=',2)->count(); $count3 = videolog::where('video_id','=',3)->count(); return view('home',compact('count0','count1','count2','cou...
1
6b3dd2d39e72531477b02a2e90972c16
b26da80d346eb3ffdb9e00eb96f71dad
Делегирует форматирование аргументов объектам источника сигнала.
bool is_target_method_with_source_args, params object[] source_method_args) { var result = new List<object>(); if (is_target_method_add_self_arg) result.Add(source_method_owner); if (is_target_method_with_source_args && source_method_args != null && source_method_args.Length > 0) ...
0
7104134ccb75388cc7a4af0631f80688
d7452d2bd97de74f84d5e0154bb56063
报号,返回最后一个报号的人的序号
{ for(int i = 1; i <= berthN; i++) { if(b[i].shipOrd != 0 || b[i].timeIn != 0 || b[i].timeOut != 0) return i; } return 0; }
0
747cfaba6c8dc58bf0f6b325a197f58c
2d3feab269de638f98c8c83899829db4
Returns a DML expression that converts Text to an Integer.
namespace SnowflakeDatabaseProvider.DML public class SnowflakeDMLFunctions : BaseDMLFunctions public override string TextToInteger(string t) { return string.Format("TO_NUMBER({0})", t); }
1
152e883e6ae1370af7b8c08defdd2db0
9019f6035dd70c011f42044096022f4a
draw the rectangle about the specified center coordinates
double xCenter = xCoord + (width / 2); double yCenter = yCoord + (height / 2); for (int i = 1; i < width; i++) { for (int j = 1; j < height; j++) { if ((xCoord + i - xCenter) * (xCoord + i - xCenter) + (yCoord + j - yCenter) * (yCoord + j - yCenter) <=(width / 2) * (width / 2)) gl_draw_pixel(...
0
fdb7a848c59f113519a555ac80f338fb
5744e55f98f9e07735ab2d0cd0b51248
run the electron tracking with clone removal to reduce amount of fakes in high occupancy
void FastVeloTracking::mergeClones ( FastVeloTracks& tracks ) { if ( tracks.size() <= 1 ) return; FastVeloTracks::iterator it1, it2; for ( it1 = tracks.begin(); tracks.end()-1 > it1 ; ++it1 ) { int n1 = (*it1).phiHits().size(); for ( it2 = it1+1; tracks.end() != it2 ; ++it2 ) { if ( !(*it2).isValid(...
1
8210a7059c4fd3768c5e38fb58f40dcd
2c00eba9ab3d04e4096c551029aaa6a4
JNITCMSCNT을 등록한다.(INSERT SELECT)COPY
void updateJnitcmstpl(JnitcmstplVO vo) throws Exception;
0
ef3fcb139fd2ceefe6cab018c25dc43d
74796b95e671a63ab964eb8ab8d1e969
Linear Kernel test, orthogonal vectors.
class TestKernelPCA(unittest.TestCase): def test_ortho_all(self): for i in range(self.N-1): self.assertTrue(np.dot(self.Tf_all[:,i], self.Tf_all[:,i+1]) < self.max_sdot)
1
7e83fbfdd76ac3964352e6e9199bb81d
548c61c69544dab59b6d180da092ed0f
@brief This function returns the device handle for given device id
{ int dev_id = -1; for (int d = 0; d < local_ze_device_count; d++) { if (ze_devices_handle[d] == device) { dev_id = d; break; } } return dev_id; }
0
40fda9b84cb9a17183592053e5f02e21
4a48d2a41a739be579f1a54a6dd2ba33
Fetches preferred vertical refresh rate. Returns: An int indicating preferred vertical refresh rate in Hz.
val = 60 if os.environ.get('AV_FREQ_SEC'): val = int(os.environ.get('AV_FREQ_SEC')) elif CONFIG_PATH and self.av.get('AV_FREQ_SEC'): val = int(self.av.get('AV_FREQ_SEC')) return val
0
a6ca95f7605d98ceb713abec301b4e2c
e027386be8e8046b937ec3b768ffec00
Print the given integer's binary representation
void printbinary (int num) { int c; for (c = 5; c >= 0; c--) if (num & (1 << c)) printf (" 1"); else printf (" 0"); }
1
bf893afe70a756c5085a8c291ad77c06
39605f51cc0351a509c82c86352dc096
+ 获取当前登录用户ID,用来记录业务日志
namespace CRM_EasyUI_2016.Core public class BaseController : Controller public string GetCurrentUserId() { if (Session["Account"] != null) { CRM_User_Model info = (CRM_User_Model)Session["Account"]; return info.ID; } else ...
1
e8c45ce95869eedaf6e4243789adace9
626af9911355a0f88e31430ab0f9e139
Questa funzione serve ad eseguire o stoppare una connessione openvpn cliccando sui CheckButtons.
if os.name != 'posix': print("This Access Point module works only on Linux, sorry!") else: if self.access_point_button.text() == "Start server": self.access_point_button.setText("Stop server") self.access_point_server.start() else: ...
0
be94fe8e025225eecbb71c1f16fd05d7
8bdd0731e4d2fbca14a4e825aa3aef85
clear confirm password input after changing password input
var password = document.getElementById('password'); var confirmPassword = document.getElementById('confirmPassword'); if (password.value != confirmPassword.value) { confirmPassword.style.borderColor='red'; password.style.borderColor='red'; }else{ confirmPassword.style.borderColor='green'; pass...
0
b3d2f2d42e28dffec06f129ba402bb1c
e7d80744e44974f9fc6ffcf433e3651c
Check to see if StartBit property is set
namespace Amazon.SecurityHub.Model public partial class Range internal bool IsSetStartColumn() { return this._startColumn.HasValue; }
0
c5d5a98cc7824705afece6478af04dfc
632c7a33273326af465c3ad2577ceaa9
finds the angle between the given vectors in radians
float gameObject::angleBetween(sf::Vector2f vec1, sf::Vector2f vec2){ if (vec1.x == 0 && vec1.y == 0) return 0.0f; if (vec2.x == 0 && vec2.y == 0) return 0.0f; float x = dotProduct(vec1, vec2); if (x <= -1) { return PI; } else if (x >= 1) { return 0; } return acos(x); }
1
21891d9c5d66f790c3247cf748c7b643
fb274be65a50602c9e1e26d5b51b4480
判断该订单是子订单还是主订单(主订单包含多个子订单)
@Service public class OrderService public boolean ifParent(String orderId) { int childNum = orderMapper.ifParent(orderId); return childNum != 0; }
1
11b80bea2a907317b0c967dc8aae90fb
2ba2a648e02a5858ee8d4d347627db5f
TEST: Prepare the data for test given the index.
class BMNDataset(BaseDataset): def prepare_test(self, idx): results = copy.deepcopy(self.info[idx]) results = self.pipeline(results) return results['video_feat'], results['gt_iou_map'], results['gt_start'], \ results['gt_end'], results['video_idx']
1
98896d0909226042d7c42a165c9244c0
42c8b12324058e58a83739527317380f
Command to list Categoria entities ordered by their creation dates
class CategoriaController extends Controller public function indexAction(Request $request) { list($filterForm, $queryBuilder) = $this->filter($request); $pager = $this->getPager($queryBuilder, $request); return $this->render('AppBundle:admin/Categoria:index.html.twig',array( 'pag...
0
2e8264a6512ae6556708ed1efe9a1832
941cfe5af726d7b94c7b5e5b73f66795
Creates an entry. Only entries of 'FILESET' type or user-specified type can be created. Users should enable the Data Catalog API in the project identified by the `parent` parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information). A maximu...
class DataCatalogGrpcClient extends \Grpc\BaseStub public function CreateEntry(\Google\Cloud\DataCatalog\V1beta1\CreateEntryRequest $argument, $metadata = [], $options = []) { return $this->_simpleRequest('/google.cloud.datacatalog.v1beta1.DataCatalog/CreateEntry', $argument, ['\Google\Clo...
1
a27c625120be765c3f9c0f8a1c5fdc3e
720a548cfe2beaa0a1b1fbce05cb22b8
<p>Name of the <a href="ctp:api:type:FieldDefinition">FieldDefinition</a>.</p>
class DIndexDefinition extends DTableElementDefinition public function getName() { return $this->getFieldValue(self::FIELD_NAME); }
0
0d17a7cdd7ab14deef9bde415fdf8329
3c44460597e9fdb2ddcafbf9d85f0776
Método que converte as sub-matrizes 3x3 em linhas de uma matriz 9x9
for (int i = 0; (i + 3) < inputMatrix.length; i = i + 3) { for (int j = 0; (j + 3) < inputMatrix[0].length; j = j + 3) { int sum = 0; for (int k = i; k < i + 3; k++) { for (int l = j; l < j + 3; l++) { sum += inputMatrix[k][l]; } } inputMatrix[i + 1][j + 1] = sum / 9; } } ret...
0
71f1a145f8e31ba46ad653f4fa816da2
2871c9af3eb8a8e24cce216432c36c5c
네이버 검색어 가져오기 ######################################
html = requests.get('https://www.naver.com/').text soup = BeautifulSoup(html, 'html.parser') title_list = soup.select('.PM_CL_realtimeKeyword_rolling span[class*=ah_k]') info = [] for a in title_list : info.append(a.get_text()) N_title = info[:10] client_id = "AcSs8vk1vXfmzpFkSX4h" ...
1
a2edecffdb60792ef4c7412ff21b893c
f7d8723ad3eabb9238af08071b260f2c
{WURZEL}.make
{ wX ( rA() ); wN ( rX()&0x80 ); wZ ( !rX() ); return; }
0
71486e64dbfccce94b5bc217be09040d
15a786adefd5211928dffeba274da46a
Test the HackerNews client.
with open("test_data/hackernews.html") as test_data: mock_get.return_value = mock.Mock(ok=True) mock_get.return_value.text = test_data.read() actual_posts = hackernews.scrape_posts(30) self.assertEqual( len(json.loads(actual_posts)), 30 ...
1
6a68833f945368ae72cdbab6a3c6ceaa
c1efdbe2b9b71b0ac4b0542200ec33c4
Получает тикеры либо из входного файла, либо выдает дефолтный набор
{ if(Ticker.instance) return Ticker.instance else Ticker.instance = this this.ticks = []; this.ticksLength = 0; this.frame = null; this.is = { framing: false, }; return this; }
0
7e91f590caf218e7dd907f0c3138a39f
03f833bd080b298789b4c53a0f745558
接口: 从磁盘读取inode到内存
{ int inode_block; int status; int offset; inode_block = index / FS_INODES_PER_BLOCK + 2; offset = index % FS_INODES_PER_BLOCK; if (inode_block != FS_Inode_Cache_Block) { status = FS_Read(&FS_Inode_Cache, inode_block); if (status != 0) { FS_Inode_Cache_Blo...
1
50bb8bf127304b639d40073048de9802
ad2b74a11a69144a7370fe7878bbc342
## Paginate the GETting of values. Called both from getValues and in ## the as.vector.CrunchExpr method in expressions.R
run_paginated_query <- function(url, max_attempts = 3L) { validate_arguments(arg_max_attempts = max_attempts) data <- list() p <- 1 pb <- progress::progress_bar$new( total = NA, clear = TRUE, force = TRUE, format = ":spin Fetching data... Elapsed time: :elapsedfull" ) pb$tick(0) while (TRU...
1
b1056b77b2c013f4235d498a84c70879
368fbd40b81ee0b3a630e9b5d419aab3
Get Windows-ID
namespace DQS.App.Licenser public class DQSLicenseManager public class ComputerID private static string VideoId() { return Identifier("Win32_VideoController", "DriverVersion") + Identifier("Win32_VideoController", "Name"); }
0
e6f8bf67362838b141b7551a646526af
24a5b1e7c764d8af1e7bf052db0463bb
半角から全角へ変換
namespace BIN.DataAccess.Define public class Public public static string Half2Full(string input) { char[] cc = input.ToCharArray(); for (int i = 0; i < cc.Length; i++) { if (cc[i] == 32) { cc[i] = (char)12288; ...
1
e1bb4ddc34a322455d6e94b1508272c9
8a6fad213ca63792db541645e64b5d63
Estimates the total surface mass density. This includes bulk and disk
coeff_top = 3 * const.c * cosmo.H0 * cosmo.Ob0 coeff_bot = 8 * np.pi * const.G * const.m_p coeff = coeff_top / coeff_bot coeff = coeff.to("pc cm**-3") dm = coeff * integrate.quad(_f_integrand, zmin, z, args=(cosmo))[0] return dm.value
0
3eb2eeec9f5313e83b29d95f43c5a816
0bd21ffcaad1a4d1c1162a5a709f9386
e.g. WORK 17APR20 30.0 P
def parseDate(date): months = {'Jan':'01','Feb':'02','Mar':'03','Apr':'04','May':'05','Jun':'06','Jul':'07','Aug':'08','Sep':'09','Oct':'10','Nov':'11','Dec':'12'} final = [] date = re.sub("/", " ",date) date = re.sub("\[","",date) date = re.sub("\]","",date) datelist = date.split(' ') day = datelist[0] ...
0
165ba391b11bcc2246aa3a09f74624d7
63955ad3111002cdcbb84a69cc8177cc
Return the configured datasets, excluding any datasets that have been deleted.
class BaseAnnotator(StackComponent, ABC): def get_datasets(self) -> List[Any]:
0
9cd77af5254f15e4054d2aed34186da9
16bd89b65035c57ca49af06960561e65
Eventhandler voor het sturen van een chatbericht
function onChat(e) { e.preventDefault(); const input = document.getElementById('chatMessage'); let message = input.value; if (message !== '') { input.value = ''; sock.emit('chatMessage', message); } }
1
3f9413afb2848208c1b7e1ac4df10800
0d37ce0e59ee9159f6996cdc99609281
查询出fans数最多的用户100个用户
List<RankUser> listBest100Users4();
1
da9ca1894d4c2bb3846d0a75c00091d1
e160439b7429209f6ffc0e767c09c01b
Get a single line of text from string.
function get_line($str, $line) { if (is_file($str)) { $lines = file($str); return isset($lines[$line]) ? $lines[$line] : null; } $str = str_replace( array("\r\n", "\n\r", "\r"), "\n", $str); if(!strstr($str, "\n")) return $str; $lines = explode("\n", $str); return isset($lines[$line]) ? $lines[$line] : null;...
1
087d2049b7c8ed00a751fc9e2ee33017
48978c4f96570d7f97f73a645a640269
为数据添加两侧引号
public class BaseWiFiManager public String addDoubleQuotation(String text) { if (TextUtils.isEmpty(text)) { return ""; } return "\"" + text + "\""; }
1
9b47104ac80e1e8cd325267d545ed87d
aedc79435c71b7db4aa2f34d75dcbb77
创建TCP Socket
{ uint8_t buf[9]; buf[0] = ssl; buf[1] = seq; buf[2] = bindOption; if (bindOption) { memcpy(buf+3, (uint8_t*)&localIp, 4); memcpy(buf+7, (uint8_t*)&port, 2); Serial_Transmit(CMD_ID_SNIC, buf, 9, ACK_NOT_REQUIRED); } else { Serial_Transmit(CMD_ID_SNIC, buf, 3, ACK_NOT_REQUIRED); } u...
1
15e482c5e3fab4278fc25cc9ee189fd9
d9af51badaaf9303058950e5f2806807
Remove Custom Attributes from a Customer
class Customer extends AbstractResource public function removeCustomAttributes($custom) { $result = $this->getClient() ->send('/v1/customers/'.$this->uuid.'/attributes/custom', 'DELETE', [ 'custom' => func_get_args() ]); $this->attributes['custom'] = $result['...
1
5165ba92b9fcf88c9baf2347c885a9c0
03e3c5e57fd408b353770059320137a4
Sets the campaign remote service.
public abstract class CacheJsonLocalServiceBaseImpl extends BaseLocalServiceImpl implements CacheJsonLocalService, IdentifiableOSGiService public void setCampaignPersistence( CampaignPersistence campaignPersistence) { this.campaignPersistence = campaignPersistence; }
0
c34b27e730709b568d99523b60caaac0
6a9d67a6d8e2f3dff364a34426c1a1fa
load the csv dataset into dataframe and break into train and test set (80% split)
def load(): data = pd.read_csv("D:/Data Science/dsmlbc4/Courses/Week-8/Assignments/train.csv") return data
0
139f87c2ccb5f87dac9272e98afeeca8
17fb2d02f331d8babeea6c6cd6a99d3e
The method checks the addition and removal of elements in the tree.
self.__test_tree.insert_element(1) self.__test_tree.insert_element(3) self.__test_tree.remove_element(3) self.assertEqual('[ 1 ]', str(self.__test_tree)) self.assertEqual('[ 1 ]', str(self.__test_tree.pre_order())) self.assertEqual('[ 1 ]', str(self.__test_tree.post_order()))
1
56a40c87013cc6f287d5ece21ec430b4
9eb34659d354d90a7d0e6beecc7750c4
Google のレシート検証用公開鍵を取得
def get_public_key(cookie, tokens): url = ''.join([ const.PASSPORT_BASE, 'v2/getpublickey?', 'token=', tokens['token'], '&tpl=pp&apiver=v3', '&tt=', util.timestamp(), ]) req = net.urlopen(url, headers={'Cookie': cookie.header_output()}) if req: content...
0
7245951e954e5ff2d1c692ae0055a7a9
5c8c359ead70d384e29dcc2bc438de1c
Threshold for reporting slow queries.
@JsonDeserialize(builder = LockServerOptions.SerializationProxy.class) @Value.Immutable @SuppressWarnings("ClassInitializationDeadlock") public class LockServerOptions implements Serializable @JsonProperty("slowLogTriggerMillis") @Value.Default public long slowLogTriggerMillis() { return 10000L; }
1
49c32da3f8a3f82211dfe98c2b66e348
28155a6b7acb23474d13de12e5a173fe
指定文本大小单位的名称, 以及和公制单位的转换比率, 然后创建这个单位
public class VUnits public static Unit createConvUnit(String unitString) { return instance.makeUnit(unitString); }
0
ad54ff7cbb4a62eda79318ebc77c84a6
0a7cbac3fef5d8f295836b3a7f644643
Кнопка Отмены закрывает окно
namespace View public partial class DataEnterForm : Form private void ButtonCancel_Click(object sender, EventArgs e) { Close(); }
1
7eceadf5a8f525ecc0bdbcd0422ca1a8
62a5b75628a162d8ec4ed5f9b28decde
触发投币的函数
class Exp: def coin(self,aid): url = coinAdd post_data = { "aid": aid, "multiply": coinnum, "select_like": select_like, "cross_domain": "true", "csrf": bili_jct } res = requests.post(url=url,headers=headers,data=post_data) ...
1
2c62aa9d7d47807ff9bfa43b8c85760a
ce78fab27b4cf2974c79cf0fac8d0d28
Validate that you cannot pass in the wrong king of DTO
class JsonRpc1Test extends JosserTestCase public function testCreatingResponseFromInvalidDTOs($responseDataTransferObject) { $this->expectException('Josser\Exception\InvalidResponseException'); $this->protocol->createResponse($responseDataTransferObject); }
1
3f11bee462980ad5bf9be78cbf3c075a
adebbdaad395a3bec2f7bf0909e9cbe7
Downward rank of a 'task', as defined by the CPOP policy.
crank = partial(cranku, c=c, crps=crps) wf = partial(cwbar, ps=crps) cf = partial(ccbar, c=c, ps=crps) rank_value = 0 if len(pre(c, ni)): rank_value = wf(ni) + max(cf(ni, nj) + crank(nj) for nj in pre(c, ni) ) print("task prior ->", ni) print("rank_value:",rank_value) ...
1
6dedbc6555c42f012d392451774e5cf3
7f61448ad6da3ef0f9cb03f40c5be655
your code here that will run at the beginning of each test run.
cases like (1)
0
526b30a9c2e50bcf3b3b9d7d9beffb1a
197a57ca3217ce76f63826c131776eec
Allows to eliminate a package registered in the system
export class PackageManagerComponent implements OnInit protected removePackage(packageName: string): void { this.usedPackages = this.usedPackages.filter(itm => itm != packageName); this.updatedAvailablePackages(); this.packageManager.setUsedPackages(this.usedPackages); }
1
b76329073fb3387d1bbdcf61d40bcd4b
04b3c8c8085304fe3d42e5ff2392091a
WiFi Tethering test: VoLTE call during WiFi tethering 1. Start LTE to WiFi (2.4G) tethering. 2. Verify tethering. 3. Make outgoing VoLTE call on tethering provider. 4. Verify tethering still works. 5. Make incoming VoLTE call on tethering provider. 6. Verify tethering still works. Returns: True if success. False if fai...
class TelLiveDataTest(TelephonyBaseTest): def test_lte_wifi_switching(self): return wifi_cell_switching(self.log, self.android_devices[0], self.wifi_network_ssid, self.wifi_network_pass, GEN_4G)
0
cbe99bcf39fc5d3768348815d373edc8
d09f49507c938313a4ad37ad7e8ff1e3
7) What is the total number of likes received by males?
int maleCount = 0; try { stmt = connection.createStatement(); rs = stmt.executeQuery(maleQuery); rs.next(); maleCount = rs.getInt(1); } catch (SQLException ex) { System.out.println(TAG + ex.getMessage().toString()); } re...
0
de7ac4b1d18c2e9fae6925543c9d088e
78d81d5dbd471ccbd5970cb6650aeeab
desactivo las llaves foraneas, elimino el registro, y luego las vuelvo a activar.
class AgregarForeingKeyAnimales extends Migration public function down() { Schema::table('animales',function (Blueprint $table){ $table->dropForeign('corral_id'); }); }
0
95e854940ea8450e57dd6df30ca42a98
9ff27ff2cdce26082641af9f3cfa266b
creates constaint handler data for set partitioning / packing / covering constraint handler
( SCIP* scip, SCIP_CONSHDLRDATA** conshdlrdata, SCIP_EVENTHDLR* eventhdlr ) { assert(scip != NULL); assert(conshdlrdata != NULL); assert(eventhdlr != NULL); SCIP_CALL( SCIPallocMemory(scip, conshdlrdata) ); (*conshdlrdata)->eventhdlr = eve...
0
51809171edc99eda84e7242a212d7a13
2e3aaa9b8c7fbd7472d388598671a06e
建立城市和区县的关系
graph = Graph() tx = graph.cypher.begin() statement = "MATCH (a {name:{A}}), (b {name:{B}}) CREATE (a)-[:所属地区]->(b)" for upperPlace in upperList: tx.append(statement, {"A":index,"B":upperPlace}) print "ok" tx.commit() return
1
507152a791b9b5aa183085411817632e
c0847fa32caca8be0be920ac7571d50a
Sets back locators list to it's default value.
public class Search public synchronized void resetLocationList() { locationList = null; }
0
8fb0a1d6984cc85a9aabc2294a9f4c5f
2bdf2770fdc44d066fc33584f2041ee0
Creates the translation matrix corresponding to the (x, y, z) vector and returns it.
public static CoreMatrix4f createTranslation(final float x, final float y, final float z) { CoreMatrix4f result = new CoreMatrix4f(); result.m30 = x; result.m31 = y; result.m32 = z; return result; }
1
420bb98ca13f695e50868ca6222976fb
bd2da5f3e5f138ac74a081826088b35f
Tests pruning of single dense layer without an existing mask.
input_ = torch.ones(1, 5) m = nn.Linear(5, 2) y_prepruning = m(input_) y_prepruning.sum().backward() old_grad_weight = m.weight.grad.clone() assert torch.equal(old_grad_weight, torch.ones_like(m.weight)) old_grad_bias = m.bias.grad.clone() assert torch...
1
36c5b439ff4da094368f0ebb2364d779
e40e17c84ec4dd57c5eb4aa05149c67f
Set SSL preference By default, a SSL connection will be attempted, where it fails, the connection will be attempted over a normal wire. Where this flag is set to true, only SSL connections will be used
public final class DConnectSettings public void setSSL(final boolean ssl) { this.mSSL = ssl; }
1
217824c2f2a829f320be7655f5eff399
8f214bd022d794f9d97727340064e260
e.g. 'B'+'10' -> B10
class StackString(object): def parse_and_get_var_hex(self, vstr): var_off = vstr.split('_')[1][:-1].rstrip('h').split('+') if len(var_off) == 2: res = int(var_off[0], 16) - int(var_off[1], 16) else: res = int(var_off[0], 16) try: the_reg = eval('procr...
0
bd8f7f8ba383634b2be296b88b1781e4
b11a217f7820e52680c96d6d6e521fd5
filter a list of courses by a number of students
function filterArray ($array) { global $semester, $course; $arr_sl = array (); foreach ($array as $key => $values) { if ( $values['Studgang'] == $course && $values['Sem'] == $semester) { $temp_sl = array_slice ($array, $key, 1); $arr_sl = array_merge ($temp_sl, $arr_sl); ...
0
08dad4a86ffc6e5d0174e0d7951add25
5e06f9d4a1e4ae2d6fd7ffdf5491359d
Función encargada de pasar una fecha dada en formato español a formato BBDD
function convertirFechaDB_Form($dateString){ if ($dateString!=""){ $day = substr($dateString,8,2); $month = substr($dateString,5,2); $year = substr($dateString,0,4); $fecha=$day."/".$month."/".$year; return $fecha; } else return $dateString; }
0
66511e1f13945c3e4f95e1337aa848e5
e42a6783e60fe587f8548ee993c86c55
This returns a dict that maps each node ID to its edgeIDs
class MacroStateNetwork(): def node_id_to_idx_dict(self): return self._node_idxs
0
883bdb19482198e8be4b65c1334cee20
53533c395b67fd085967b6ccacbc0ad9
creates a toString
public String toString(){ return "[color="+this.color+", square="+this.square+", damage points="+this.damagePoints+", eaten cubes="+this.eatenCubes+"]"; }
1
e076c33224fa17d026f9392da52467d0
db938f539f4c1085e2bb6c3989548fac
creates a dataframe with new articles that include key_words in abstracts
def get_sentences(df1, search_words): df_table = pd.DataFrame(columns=["pub_date", "authors", "link", "excerpt", "rel_score","title"]) for index, row in df1.iterrows(): pub_sentence = "" sentences = row['abstract'].split('. ') for sentence in sentences: missing = 0 ...
1
6f7e396b45b23a5abaf7bd602b9c08b7
09685c7bf6534de97044d9bb00ff499e
通过小节的标题和之后文字生成 {标题: 内容} 的 order dict
def sections(iterable, is_title=lambda line: line.startswith('#')): result = OrderedDict() title_index = 0 title = (title_index, 'DEFAULT HEADER') result.setdefault(title, []) for line in iterable: if is_title(line): title_index += 1 title = (title_index, line) ...
1
3b31e0e6cd1b92c84f198a5ec9f5fbdd
125f5830cdb000639830556d256b4cf9
Solve the two arguments in AND operation.
reg_left = self.find_reg(self.second_arg) reg_right = self.find_reg(self.third_arg) reg_result = reg_left & reg_right self.place_reg(self.first_arg, reg_result)
1
fc0af307ecac3b38e7ebb85148e602ef
df049261f9bb13325658b8a067081c55
Retourne la liste de toutes les enseignes en base
public ArrayList<Integer> getListeIdEnseignantBDD();
0
e7a74af0337889d04068724e257e319a
547f245327276be3597742d7ed63ca74
Gets the value of the borrowerType property.
public class MiniloanBean public String getBorrowerName() { return this.borrowerName; }
0
4dadeb3df189e4ac5839191014d79e61
49d1c58f79f48a52d541bd6810c75eca
将路由翻译成中文
{ if (isset($this->attributes['node']) && isset($this->attributes['route'])) { $namespace = app()->getProvider(RouteServiceProvider::class)->getNamespace(); @list($ctl) = explode('@', $this->attributes['route']); $ctl = "{$namespace}\\{$ctl}"; if (class_exists...
1
6add5bac8445b5f2f21f27d3924edf99
9a0c961cbda3efe68dd35df81612781e
The attributes that can be used to filter.
{ return array( 'app' => AttributeType::Mixed, 'appId' => AttributeType::Mixed, 'platform' => AttributeType::Mixed, 'token' => AttributeType::Mixed, 'order' => array(AttributeType::String, 'default' => 'pushnotifications_dev...
1