query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
f14932fceec0b02916f890abb2170443 | b77c5e10e6ba2c62b904fde6adbb914c | Whether or not to display most read widget | def display_most_read_posts_widget?
Integral::Post.published.where(locale: I18n.locale).count > 10
end | 1 |
e058e2936b5f01be4aa65a9b91086c9c | 14e9c5ee63397779b2ec6c3b4972e306 | 计算目标方法所匹配的切点集合 | @Component
public abstract class AopConfiguration implements IUtilGson, IUtilLogger, IAopLoggerHandler, ApplicationListener<ContextRefreshedEvent>
protected void pointCutMethod() {
} | 0 |
7eaa6ca654a6fa354f516052fd9c8ca1 | 7edeef221f751713f653ccb13a0d42d0 | GET /user works. | def _user_index(request):
work_data = _get_paginated_data(request, 'work', 15, 1)
network_data = _get_paginated_data(request, 'network', 15, 1)
context = {
'works' : work_data['items'],
'networks' : network_data['items'],
'work_bottom_item' : work_data['bottom_item'],
'networ... | 1 |
204c96eab243df521fac3f1c5e5f8cc5 | fa8b5d697f78d954e81e7b44342fc614 | 分页查询历史短信信息 | @Component("SmsHistoryDAO")
public class SmsHistoryDAO{
public List<SmsHistory> findByTime(int page, Timestamp startTime, Timestamp endTime) {
try {
if(startTime==null && endTime==null){
String queryString = "from SmsHistory order by smsSendTime desc";
return sessionFactory.getCurrentSession().createQuery(... | 1 |
1dfc63e2611fa0f57f8070e3738cca60 | 09c362d37267bb7a0335097a7d863cc9 | bytes.Equal 判断两个切片的内容是否完全相同 | func equal(a, b []string) bool {
if len(a) != len(b) {
return false
}
for i, v := range a {
if v != b[i] {
return false
}
}
return true
} | 0 |
a8352d0f6c5a6c470950517c8c886427 | 9289a405d5889767a9f74c1baf7f096a | Main control function, takes user keyboard inputs and runs the relevant functions to make the drone do what you say | class MyDrone(Tello):
def get_keyboard_control(self):
speed = 30
if self.get_key("LEFT"):
self.left_right_velocity = - speed
elif self.get_key("RIGHT"):
self.left_right_velocity = speed
elif self.get_key("UP"):
self.for_back_velocity = speed
el... | 1 |
0ffde35674ec1a2473c83ec61bbb1cca | ba5e52575d507b61cbc56823ec983a82 | 从字节缓冲区中读取字符串集合 | {
long off = GetField_Long("string_ids_off");
long count = GetField_Long("string_ids_size");
for (int i = 0; i < count; i++)
{
byte[] data = GetBytes(off + i * 4, 4);
long StringIndex = Byter.To_Long(data);
... | 1 |
78e82ddfb3bbb2da949973c140c0aa73 | a14333fd785e3db9add9224a33cb31a0 | request构包, 通过oneShot方式请求AIIn方法. | let temp: any = this.aiDic[type];
if (temp instanceof Function) {
temp = new this.aiDic[type]();
this.aiDic[type] = temp;
}
return temp;
} | 0 |
f0746c65da64b1a0e916852fa595d2ea | 4f479bb9a658d419b4c9b4d0bb41256d | init the default config filepaths | if not hasattr(self, 'default_config_file_name'):
self.log.critical("No config filename found")
else:
self.config_file_name = self.default_config_file_name | 1 |
b5d469ebbc42b6aec7432b6b715971d1 | f76cbb624e9f5936b04621b49dca71b2 | Promises to read data from stream and returns buffer. | function read_stream(stream, len) {
return new Promise(resolve => {
let cursor = 0;
const result = Buffer.allocUnsafe(len);
stream.on('data', (data) => {
cursor += data.copy(result, cursor);
});
stream.on('end', () => {
resolve(result);
});
... | 1 |
a7cbb0a6633b24748fa1bbbed10a73b0 | c6ec1ca1c552a4ff8d78f94e3b6c13f0 | Test get SA recommendation data. | class TestRecommenderCB(ProductBasedRecommenderFixture):
def test_recommend(self, test_recommendation_quality=True):
super().test_recommend(test_recommendation_quality=False) | 0 |
3aa1812f1883507a5a579e3f75f42556 | 0a608be9e3745b14b41c1de6a2ef6893 | 公募基本表新增页面跳转 | @Controller
@RequestMapping(value="/peopleBasicQueryAction")
public class PeopleBasicQueryAction extends ModelAction<PeopleBasicQuery>{
@RequestMapping(value = "/toShebaoxq")
public ModelAndView toShebaoxq(SheBaoInfoQueryQM qm) {
ModelAndView mv = new ModelAndView();
mv.setViewName("peopleBasicQuery/sheBaoxqInfo")... | 0 |
25715514a0e5437838d51ce7d5ca393a | 0098e300a0f2640fdb3a934cc44646bd | Squared Exponential kernel, also known as radial basis function or RBF
kernel in other works. | class squared_exp_noise(gp_kernel):
def __init__(self, ndim=1):
params_0 = [1.0, 1.0]
super(squared_exp_noise, self).__init__(ndim, params_0) | 0 |
952b7de5247f9df74420203ee09b6109 | b382ee168186b273fb0cbc346468d063 | Get the auto power of a remote reference channel | {
ASSERT((ch >= 0) && (ch <= 7));
uint16 data[3];
uint32 value = 0;
data[0] = 0 | (START_BITBOS)
| INPUT_CONFIGURATION(SINGLEENDED)
| MSB_CHANNELID_BITPOS(ch);
data[1] = LSBS_CHANNELID_BITPOS(ch);
data[2] = 0;
if (refmV == 5000)
spi->EnableSPI(false, 8, 2000000, false, false);
else
spi->EnableSPI(fal... | 0 |
09870099475391704c8ba85909e70ce2 | c4d0b444bd5613cfbbe53cdbb38d195e | parseIssues creates and returns an issues struct with information on possible vulnerabilites. | issue, err := issue_model.GetIssueByID(ctx, issueID)
if err != nil {
if issue_model.IsErrIssueNotExist(err) {
return nil, false, nil
}
return nil, false, err
}
if err := issue.LoadDiscussComments(ctx); err != nil {
return nil, false, err
}
comments := make([]string, 0, len(issue.Comments))
for _, comm... | 0 |
a5a57c97b2f2aabb8dd13e796d209be5 | f9b8914df3395c72c1995f2c204ea5f2 | 验证token跟userId是否一致 | boolean checkToken(String token, int userId); | 1 |
bf14d9a40871c3237bed9444d7f772c4 | f6d454145fb1d92a278b03e5bc6b7917 | this method clears the category field for more input | function clearCategoryForm(){
$("input#categoryId").val("");
$("input#categoryName").val("");
} | 1 |
6f0fdbc45e09bbabc9d1ddb53bf4f082 | d7b5aaff197ba9d463bb95fff57d1419 | 获取当月的最后一天是礼拜几 | function getLastWeekDayOfMonthNum(year, month) {
let date = new Date(year, month + 1, 0);
return date.getDay();
} | 1 |
89816c5a18da665e574fa00693165dd0 | c4bc8ed041b8343bddeead74b9fa7caf | Get a map of line number to the index of its first character | line2citem = {}
for line_number in xrange(decompilation_text.size()):
line_text = decompilation_text[line_number].line
line2citem[line_number] = lex_citem_indexes(line_text)
return line2citem | 0 |
ab5c35e03e64813f1092739526575de9 | 8351ce0a974682974179173d036b400c | 空白で空いている自分に最も近くの味方フィールド | {
FieldComponent[] blees = (FieldComponent[])UnityEngine.GameObject.FindObjectsOfType(typeof(FieldComponent));
FieldComponent closest = null;
float closestDist = 0;
foreach (FieldComponent blee in blees)
{
if (closest == null)
{
closest... | 1 |
23a3db800c2d7b369037a1d77a7b0d06 | 0d0bbfdd6a827f8133872752c7ca26d7 | Altera a ordem no qual os cenarios sao ordenados. | if (ordem.trim().isEmpty()) {
throw new IllegalArgumentException("Erro ao alterar ordem: Ordem nao pode ser vazia ou nula");
}
switch (ordem.toLowerCase()) {
case "nome":
this.ordenaPorNome();
break;
case "apostas":
this.ordenaPorApostas();
break;
case "cadastro":
this.ordenarPorCa... | 1 |
f39329e2c3668df31a3e3a41c5025ff7 | e9dd63882ce10fba7b3b934b5f69cd87 | Kills off the connection threads if there are any hanging around. | class ThreadedMolerConnection(AbstractMolerConnection):
def shutdown(self):
for handler in list(self._connection_closed_handlers.values()):
handler()
super(ThreadedMolerConnection, self).shutdown() | 0 |
d973e2367380aa357e72373270df5914 | 1882528e73ff21897bbbda9efaf72b90 | 使用 ugram 模型计算 str 得分 | def score_str(decrypt):
data = ""
for i in range(2,len((decrypt[2:])),2):
temp = None
try:
temp = bytes.fromhex(decrypt[i:i+2]).decode("ASCII")
except Exception as e:
print(decrypt[i:i+2])
raise e
if temp:
data += temp
score_table = {'e': 12.70,'t': 9.056,'a': 8.167,'o': 7.507,'i': 6.966,'n': 6.... | 0 |
cadb2168855366c9b841df66b931b84d | 095eb36046d7ab96f22289e449979cd9 | 生成订单索引表数据 | Map<String,Object> esOrderMain = new HashMap<String,Object>();
if(dataType.equals("update")){
esOrderMain.put("BIN_ESOrderMainID",erpOrder.get("BIN_ESOrderMainID"));
}else if(dataType.equals("insert")){
String orderNo = binOLCM03_BL.getTicketNumber(ConvertUtil.getString(e... | 1 |
e040b5b5f190c76c199bc81c6bd4b59c | e2c34c204f09f74a9a740aff0986393a | 功能:从文件中读取加密后的硬件信息并进行解密 | StringBuffer sb =null;
ObjectInputStream objis=null;
CipherInputStream cis=null;
InputStreamReader isr=null;
BufferedReader br =null;
try {
sb = new StringBuffer();
objis = new ObjectInputStream(context.getAssets().open("ubsdk.dat"));
Key key = (Key) objis.readObject();
Cipher cipher = Cipher.ge... | 1 |
e5a8a2b522823d85e971b34ea79bfd81 | 26c37187f3910f16f7445f18feea8cca | Apply the Savitzky Golay filter on each band. | zsel = self.values
for idx, row in enumerate(zsel.T):
zsel[:, idx] = sp_sig.savgol_filter(row, nnb, polyorder)
return zsel | 1 |
b7a05f1adf40807df2728f9e9fe96e56 | bd7a8064788c44890a1312a307f368cd | Constructing Inverted Index of the format {"WORD1":[DOC1,DOC3,...],"WORD2":[...]} | ind_inv = {}
for doc in docs:
for word in docs[doc].split():
ind_inv.setdefault(word, set())
ind_inv[word].add(doc)
print(ind_inv)
return ind_inv | 1 |
24febaacf7ead1a87f4a30af334aee40 | 056331fd6df5c4080e6ee38d497afe18 | 根据接口表printInterfaceId查ticket记录 | @RunWith(SpringRunner.class)
@SpringBootTest
public class LoginTicketDaoTest
@Test
public void selectByTicket() {
try {
LoginTicket loginTicket = loginTicketDao.selectByTicket("3bdf98666b984cb2941d84d21c1a712d");
assertNotNull(loginTicket);
System.out.println(loginTicket)... | 0 |
1310edef3eab47b3b2e5bae089b72566 | 63d2e0243a1126d261774dbb7a24c340 | A service that places elements connected to existing ones
to an appropriate position in an _automated_ fashion. | success_thresh=0.01,
completion_bonus=0):
self._success_thresh = success_thresh
self._completion_bonus = completion_bonus
self._prev_box_pos = None
self._picked = False
self._placing = False | 0 |
3059bb86fb26d823c18f35a27a04d926 | adf1be2ba856c1afd2b64e82cb3cb0e6 | Checks the building limitations of all buildable cogs in the menu to update their state. | public class FreeFormBuildingMenuManager : MonoBehaviour
void Update()
{
} | 0 |
3508e34997a30784c3de58e58e0476fd | c25f27236806663ab445a154d305c1bd | Concrete factory to create normal mazes | int main() {
maze_game factory;
enchanted_fairy_maze_factory* fairy_maze = new enchanted_fairy_maze_factory();
factory.create_maze(*fairy_maze);
futuristic_dystopian_maze_factory* future_maze = new futuristic_dystopian_maze_factory();
factory.create_maze(*future_maze);
return 0;
} | 0 |
e25199ed0f7fe76adc694f0e5263d9d2 | 63ffb3fb183296fa58bc93b666a01e8c | 現在のVIEW_KEYが本Activityのものかを判定します.<br>
※画面遷移中かどうかを判定するのに使用する. | ActivityManager am = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
ComponentName cn = am.getRunningTasks(1).get(0).topActivity;
String currentPackageName = cn.getPackageName();
if (!TextUtils.isEmpty(currentPackageName) && currentPackageName.equals(getPackageName())) {
return true;
... | 1 |
4b9e968d7372c98c696f5a7c8db101ec | 18e67c4f0a665d1f4db96e3879096035 | 获取cookie免登陆,从yaml文件中读取cookie | class Config:
def read_cookie(self):
self.config.read(self.conf_path,encoding='utf-8')
cookie = self.config['cookies']
return cookie | 1 |
ca185f5c408ff660004bd54f8bb639cc | 5f3da472e7aac1552c6612c83efe1ef9 | Delete a collection based on ID and call the callback | export class CollectionCtrl
public destroy(req, res) {
Collection.find({ _id: req.params.id }).remove(function(err) {
if(err) { return CollectionCtrl.handleError(res, err); }
return res.status(204).send('No Content');
});
} | 1 |
0dde7a94111a75597b1d95dd4c4386b7 | ccb6fc59c73f41c33f2dcfaf73016d59 | Return the name of a client module. | class pam_auth
public function get_name($module)
{
return app::get('pam')->getConf('module.name.'.$module);
} | 1 |
bc8855b12e42a00693f9a0248dcc0fc6 | cbb42bd164f9d1a66ed69dd024943690 | 根据仓库名取得仓库实体 | @Service("ckService")
@Transactional
public class CkServiceImpl implements CkService{
public Ck getCkByName(String ckName) throws Exception {
if(ckName != null){
return this.ckDao.getCkByName(ckName);
}else{
throw new RuntimeException("仓库名不能为空!!");
}
} | 1 |
41137cccdbd757780844d85d5d3ce3d8 | c6f932c2cf6f2a388b331bdd090900b0 | Sets log level for current logger. | class SetLogLevel(Function):
def __init__(self, *args, **kwargs):
Function.__init__(self, *args, **kwargs) | 0 |
a85ed8537082c067b22b70204124755a | 43ff83e3ac865975b24a9279712e0cc0 | 通过apk文件路径获取版本号 | public class MyTools
public static String getApkversion(String path) {
File f = new File(path);
if (!f.exists()) {
return "0.0";
}
PackageInfo packageInfo;
try {
PackageManager packageManager = ExceptionApplication.getInstance().getPackageManager();
... | 1 |
c0da82bb79f1cc1f39a7232af0d45d5f | bc931f301f54ee0b5260d0ec474c4d5b | 添加盘盈单 | namespace LotteryData.Business.Domain.Managers.PL3
public class PL3_Manager : LotteryEntityManagement
public void AddPL3_ZuXuanZouSi(PL3_ZuXuanZouSi entity)
{
this.Add<PL3_ZuXuanZouSi>(entity);
} | 0 |
8982557bd33ef4aa240db679a46004a9 | a492b5707cfb6f440185e5434f512c6b | Replace the original classes with ones and minus ones | def setTrainingData(training, index):
newData = training
for i in newData:
if (i[-1] == index):
i[-1] = -1
else:
i[-1] = 1
return newData | 1 |
e922137c3a3f9af1b40c09a60eacfb67 | 46b405676b59985e976b8adfeee55848 | Filter the query on the addeddate column
Example usage:
<code>
$query->filterByAddeddate('2011-03-14'); // WHERE addeddate = '2011-03-14'
$query->filterByAddeddate('now'); // WHERE addeddate = '2011-03-14'
$query->filterByAddeddate(array('max' => 'yesterday')); // WHERE addeddate < '2011-03-13'
</code>
Values can be in... | abstract class OrderReturnQuery extends ModelCriteria
public function filterByDateAdd($dateAdd = null, $comparison = null)
{
if (is_array($dateAdd)) {
$useMinMax = false;
if (isset($dateAdd['min'])) {
$this->addUsingAlias(OrderReturnTableMap::COL_DATE_ADD, $dateAdd['m... | 1 |
0c22d4e44d14a43ea25367966735564f | 0b6274531bcaa7692f5550fe93d1e7f1 | Read and preprocess data with LabelEncoder, MinMaxScaler
and IsolationForest. Return x_train, x_test, y_train and y_test. | def preProcess(arr, config):
X, Y = splitLabel(arr)
d = {}
d["trainX"], d["testX"], d["trainY"], d["testY"] = train_test_split(X, Y, test_size=config["testSize"])
scaler = StandardScaler().fit(d["trainX"])
d["trainX"] = scaler.transform(d["trainX"])
d["testX"] = scaler.transform(d["testX"])
... | 0 |
933d7e3d59776e808fd045a893a59ce5 | eac8640902d1b9ce082e2c0748a2dee9 | auditsyslogpolicy that can be bound to vpnvserver. | public class DdsClient
public SetAuditlogPolicyResponse setAuditlogPolicy(SetAuditlogPolicyRequest request) {
return hcClient.syncInvokeHttp(request, DdsMeta.setAuditlogPolicy);
} | 0 |
6c3a54c46e1105690f830e29771772a8 | 557f1998334ed463e9b2b060ec23d725 | Test Case to validate the Abstract BaseLogger class LogToOperations method
public void LogToOperations(string message) | {
if (ConfigurationData.MustLogOperationalPerformance)
{
Operation operation = new Operation();
operation.Timestamp = DateTimeHelper.Now;
operation.Message = message;
OperationsLog.Add(operation);
}
} | 0 |
4d7300c6002b4cebb721acd7332093b1 | 3aa2ab72502c334fc81b3080b3d20b1d | Activates or deactivates the special Nitro particle system. | [System.Serializable]
public class BoostScript : MonoBehaviour
void SetEmission(bool isEmitting) {
isActive = isEmitting;
particles.enableEmission = isEmitting;
} | 1 |
8adc10d7ccce32e7a68fa6d926aa852e | 39b6fe7179bae8440d85634c5d5d0a24 | Cycle old log messages upwards. | void
G_Log_New(char msg[64])
{
unsigned int i;
for (i = 3; i >= 1; i--)
{
strncpy(g_log[i], g_log[i-1], 64);
}
strncpy(g_log[0], msg, 64);
} | 1 |
7743079e4ab1d43dc14c53de9e7982a1 | 6a27a0c137831214a9090fe1fc03b696 | para que no siga saliendo conectado | public class ConnectThread extends Thread
public void run() {
mbtAdapter.cancelDiscovery();
try {
mmSocket.connect();
} catch (IOException connectException) {
try {
mmSocket.close();
} catch (IOException closeException) { }
return... | 0 |
570284e76921d8edcd57536dd20b9191 | 770482824ab2491e728547cc58bc7cf9 | Generates photon timings for S2s. Returns a list of photon timings and instructions repeated for original electron | onsite_angle, horizontal_angle_1, horizontal_angle_2 = angles
yield from [ (onsite_gate, (qubits[0], qubits[4]), onsite_angle),
(onsite_gate, (qubits[1], qubits[5]), onsite_angle),
(onsite_gate, (qubits[2], qubits[6]), onsite_angle),
(onsite_gate, (qubits[3], q... | 0 |
39eece6a612f192657d496b9816b87fa | 8f10c621c0229752e98bcadcd2b0b0bc | Check if needle exists in haystack memory | {
for($i=0; $i<sizeof($haystack); $i++)
{
if($haystack[$i] == $needle)
{
return true;
}
}
return false;
} | 1 |
d154972a0c83f4805c678f54ce2697f8 | 1002297b122afd712e80d7148be67115 | Exchange the standard and shadow register set values (for the EXX instruction) | DWORD dest, result;
int src = 0;
if (s->flags & SRC_RM) {
DWORD ptr;
src = (DWORD) modrm_calc(thread, s);
}
if (s->flags & DEST_REG) {
dest = thread.Exx[s->ndest];
thread.Exx[s->ndest] = src;
result = thread.Exx[s->ndest];
}... | 0 |
3c7850aafb26db694d26a018bbd692e9 | 63d4aed89020f70009b08e8424dbb72c | 定义了rabbit-channel的消息输入通道 | @Configuration
@IntegrationComponentScan
public class MqttConfig
@Bean
public MessageChannel mqttInboundChannel() {
return new DirectChannel();
} | 0 |
6506fe4b5ec1d3e4be9871d5c186bfdf | 1c6c05c9959e2612ca4beb7f9d99c461 | the main method of the engine that recomputes each vertex projection during each frame | {
if (a_frameOnly) return;
register unsigned int i, numVertices;
numVertices = m_vertices.size();
for (i = 0; i < numVertices; i++)
{
m_vertices[i].computeGlobalPosition(m_globalPos, m_globalRot);
}
} | 1 |
f7d892ac9a469b9310aa2948667678a4 | 3a55d2640619fc346bb138a7be182749 | Auction Cancellations List | class AuctionController extends Controller
public function index($id)
{
$auctions = Auction::where(['is_delete'=>1, 'product_id'=>$id])->with([
'product'=> function($q){
$q->select('id','product_name','category_id');
},
'product.category'=> function ($query){
... | 0 |
d53bd6230cf45d466ce17e473b3cc352 | 6eb2b22400645a28df1cec64ac7f1277 | 유저의 고유 ID를 이용해 유저 정보를 가져오는지 테스트 | with self.client:
response = self.get_one_user("suzan")
data = json.loads(response.data.decode())
self.assertEqual(response.status_code, 200) | 0 |
c566751a90137bbd02dc3b54ee25f900 | d00e61031158bf3b1186dd85872ab070 | 当字符串为""时,返回null. <br>
<br>
<b>示例 </b> <code>
<br>DataUtils.nullToEmpty(null) 返回 null
<br>DataUtils.nullToEmpty("") 返回 null
<br>DataUtils.nullToEmpty("abc") 返回 "abc"
</code>
输入字符串 | public class StringUtils
public static String nullToEmptyStr(String str) {
return StringUtils.equalsNull(str) ? "" : str;
} | 0 |
1f4acc739c080b539590904c19f52522 | 8a034c37671debc242c902ee76967d62 | 将图片转成canvas | function convertImageToCanvas(image) {
var canvas = document.createElement("canvas");
canvas.width = image.width;
canvas.height = image.height;
canvas.getContext("2d").drawImage(image, 0, 0);
return canvas;
} | 1 |
4a6d32acc5ab95c40b61dfbd94ce14a3 | dd6d1caa98beb03c3bd746a5c1fc7b48 | 将日期格式化,格式为 yyyy-MM-dd HH:mm:ss
日期 | String dateFormat="ss mm HH dd MM ? yyyy";
return formatDateByPattern(date, dateFormat);
} | 0 |
8904ca0eadaa755adea31040e8e65a95 | 008d850c8a12f2bfa98d8eeb58e47ca9 | Initiates the asynchronous execution of the ListProtectedResources operation. | namespace Amazon.Inspector
IAsyncResult BeginListTagsForResource(ListTagsForResourceRequest request, AsyncCallback callback, object state); | 0 |
5d5cbf7e788e22cac39dee48ee7e9c9d | 61f920765dd0bb88cda721f70cb99e26 | Get the custom static methods. | class CustomerAnalytics implements ModelInterface, ArrayAccess
public static function getters()
{
return self::$getters;
} | 0 |
4ae137bf74d9114c904955a8447126af | b370857103abac0689b4716fde433fd0 | Método que recupera as piadas de acordo com a categoria selecionada | export default class App extends PureComponent
async getRandomJokeByCategory(category){
await axios.get(`https://api.chucknorris.io/jokes/random?category=${category}`)
.then((joke) => this.setState({joke: joke.data}))
} | 1 |
d92c49c839393ec66db7ebc73290a746 | 49195c2a81897adbf8d8489e90f0d7e5 | Test new SinglyLinkedList remove method, which will remove the first
node with a given value, it does NOT return the removed node | class LinkedListTest(unittest.TestCase):
def test_remove(self): | 1 |
4293bcb98d1064c5f9cbfa625f236f4d | f75d11974013fc657f7bf87387851328 | Check if the specified directory is a submodule prefix | workdir = File.join(@basedir, name)
command = "#{@git.shellescape} submodule init 2>&1 && #{@git.shellescape} submodule update 2>&1 >/dev/null"
result = ""
success = false
Dir.chdir(workdir) {
result = `#{command}`
... | 0 |
40ad06d8427faf4d2458e3d16530e077 | 8d0db60cbd73234cdca967837018d3bc | In the case that the column name contains a start or end character such as "[", "]", "` ",
it removes them. Use when calling GetSchema for example | namespace MembershipReboot.Dapper public class Utilities
public virtual string EscapeTableName(string tableName) {
if (string.IsNullOrWhiteSpace(tableName)) return tableName;
return tableName.Replace("[", "[[").Replace("]", "]]");
} | 0 |
f4d0893d900bfe5f33acf8f96a208a0c | 4f575b87a7127b22934191111ecc7399 | Accesseur du Timer connecté sur le slot de mise à jour de la liste des capteurs | public class Robot
public ArrayList<Capteur> getCapteurs() {
return capteurs;
} | 0 |
086e4968db7fa204fef53285b58a12b9 | 2e03f82621d7a612bc42631872cbba54 | Creates a cell, gives it a value, and applies a style if provided
@param row the row to create the cell in
@param column the column index to create the cell in
@param value The value of the cell
@param style If the style is not null, then set
@return A new Cell | namespace BForms.Utilities
public static class ExcelHelpers
public static Cell CreateTextCell(int columnIndex, int rowIndex, object cellValue, Nullable<uint> styleIndex)
{
Cell cell = CreateTextCell(cellValue, styleIndex);
cell.CellReference = GetColumnName(columnIndex) + rowIndex;
... | 1 |
b939d59bc8a0c3975b3925581cda74ee | aefa31122cbf8c23c760e7cbc9c13a62 | Gets the bargeInAllowed property value. The bargeInAllowed property | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "PortInEligibilityResponseDetail", propOrder = {
"portInAllowed",
"ospCarrierId",
"currentTMUSBillingSystem",
"targetTMUSBillingSystem",
"numberToBePorted",
"portInAvailableDate",
"lineStatus"
})
public class PortInEligibilityResponseDeta... | 0 |
0544f177c39645d1c873e54036a5f87f | 80be8e81cf8219e3353db842b5347b49 | 最近列表是否显示App+ | public class LauncherDelegate extends LatteDelegate implements ITimerListener{
private void checkIsShowScroll(){
if (!LattePreferences.getAppFlag(ScrollLauncherTag.HAS_FIRST_LAUNCHER_APP.name())){
start(new LauncherDelegate(),SINGLETASK);
}else {
}
} | 0 |
a668f91df6a690916e3d35fe5bf9169a | 5e03cc2a091952127bac61c5e7db623b | Pause the current thread for a period of time, in millisecond. | try {
Thread.sleep( ms );
} catch( InterruptedException e ) {
Thread.currentThread().interrupt();
}
} | 1 |
bf144d7654141c7e109371b58371d39b | 1c2b77ec0ef55837fa643b702a1db8ff | Sets the <see cref="Changeset"/> property to the specified value and
returns this <see cref="DiffGuiCommand"/> instance. | namespace Ascon.Pilot.Server.Api.Contracts
DChangeset Change(DChangesetData changes); | 0 |
617656638e661926e84a1d21ba21d620 | 7a14ceb8807080e1915b17549ad21de8 | Creates an instance of Locator. | class Locator
public function __construct()
{
$cwd = getcwd();
$rootpath = $cwd;
$docroot = preg_replace("!${_SERVER['SCRIPT_NAME']}$!", '', $_SERVER['SCRIPT_FILENAME']);
$basedir = preg_replace("!^${docroot}!", '', $rootpath);
$proto = empty($_SERVER['HTTPS']) ? 'http' : 'https';
$po... | 1 |
76d0f340e4752ebea855f05f61683bcd | 6cb5d77fdb4a02d285afae0484f3c2b7 | 发送单图文消息到WX | WXTextObject textObject = new WXTextObject();
textObject.text = text;
WXMediaMessage msg = new WXMediaMessage();
msg.mediaObject = textObject;
msg.description = description;
SendMessageToWX.Req req = new SendMessageToWX.Req();
req.transaction = "text";
req... | 0 |
53c14f4d60e0de94c4c6188a0216f397 | 2b9ecfb53d09a9210581605fc41f3610 | Convert hero card to WeChat response message. | {
JSONObject heroObj = new JSONObject();
if (hero != null)
{
heroObj.put(RESULT_KEY, Constants.REQUEST_SUCCESS);
heroObj.put(HERO_ICON_KEY, hero.getIcon());
heroObj.put(HERO_SHT_ICON_KEY, hero.getSht_icon());
heroObj.put(PHYSIC_KEY, hero.getPhy... | 1 |
30e4077e1ca18efab94a0677a4c82ff3 | 8c8a25429b9e1cea616d1ff1e71307e0 | Refresh statistics obsolescence after partition gathering. | void CStoreVacUpdatePartitionRelStats(Relation partitionRel, TransactionId newFrozenXid)
{
Assert(partitionRel->rd_rel->parttype == PARTTYPE_PARTITIONED_RELATION);
TransactionId frozenXid = newFrozenXid;
Relation pgclassRel = heap_open(RelationRelationId, RowExclusiveLock);
Relation pgPartitionRel = hea... | 1 |
ca0b3be35bea9bdfb854380068b7bab5 | b73aa03563ac3aa98e586de53d284206 | 把每一部电影的汇总评分数据放入itemState | export default class MovieItem extends Component{
render(){
var movie = this.props.movie;
var actors = [];
for (var i in movie.casts){
actors.push(movie.casts[i].name);
}
return(
<TouchableOpacity style={styles.item} {...this.props}>
<View style=... | 0 |
10df084bbb07dee9da931512f4e14eb9 | 0b2f0ba199b5e8cc61eaa018df7afc2c | Returns the parsed ID field if valid, otherwise returns 0 | namespace Sage.SalesLogix.Migration.Script.VBSParser
public sealed class Parser
private object ParseFieldIDID()
{
return ParseID();
} | 0 |
1d7e9a207f8cd9641dff563da9c9d1c6 | 3431722a17a2900ef00b057622e33bfa | Adds one message for this package. | namespace NuPlug
void Add(string packageId, SemanticVersion version); | 0 |
afe6ef5e4fe2933bd0969d4029055c4a | 73d09d067f0e18ddc1d92fc0dfdf7a08 | Stockを経由してBoxを取得する | class Product extends Model
public function get_box()
{
return $this->hasOne('App\BoxPart', 'part_id')->select([
'part_id',
'box_box'
]);
} | 0 |
1e53be1724b5fdb0b5f6f8bd7599634b | a28822627e98079a9a2d155192edddce | @brief Generate the binary format of the Remoter frame. | static uint16_t SIRC12_BinFrameGeneration(uint8_t SIRC12_Address, uint8_t SIRC12_Instruction)
{
while(SIRC12_Send_Operation_Completed_f == RESET)
{
}
SIRC12_Send_Operation_Ready_f = RESET;
SIRC12_Framebinaryformat = (SIRC12_Address << SIRC12_INSTRUCTION_BITS );
SIRC12_Framebinaryformat = SIRC12_Framebin... | 1 |
76fe5619f14531e65d2726e50c7b5a37 | 3d1389391fe24aa1895ab159044d1a8a | 获得所有注解的类型集合 | List<Class<?>> classList = new ArrayList<>();
for (Annotation annotation : clazz.getAnnotations()) {
classList.add(annotation.annotationType());
}
return classList;
} | 1 |
72b71afff22f38ac7fe4f3c0e828336a | 82eb5e4103507b4faabd80731225fe8e | 根据游记的id获取游记的评论 - 通用 | interface ApiService
@FormUrlEncoded
@POST("Travel/getcommentPlan${Constants.END_BASE_URL_v2}")
fun getcommentPlan(@FieldMap params: MutableMap<String, Any>): Observable<BaseResp<AllCommentBean?>> | 1 |
81c4b8535fe2eb3874ac5cf1ed563dff | e049bcd14e6e939e27cd8e3d56418307 | @brief Turn on Transmit LED | void TX_L(uint8_t Pin_Num_TX)
{
GPIO_Set_Low(Pin_Num_TX);
} | 0 |
2645fc0194aded95fe06a70634fad450 | 0ac203c105809a5c9327e22870a8f46d | 判斷是否符合ICD criteria | if row['DSTRBCD1'] == 80.0:
return True
if row['DSTRBCD2'] == 80.0:
return True
if row['DSTRBCD3'] == 80.0:
return True
if row['TRTCD1'] == 10.0:
return True
if row['TRTCD1'] == 30.0:
return True
if row['TRTCD1'] == 50.0:
return True
if row['TR... | 1 |
a04e50d81bedb4628109a9a2f76c1e76 | 7d1df6381ce7dc55201e95517a038444 | Calculates the work and env sizes based on the number of locals and
lexicals. | static void calculate_work_env_sizes(MVMThreadContext *tc, MVMStaticFrame *sf,
MVMSpeshCandidate *c) {
MVMuint32 jit_spill_size;
jit_spill_size = (c->body.jitcode ? c->body.jitcode->spill_size: 0);
c->body.work_size = (c->body.num_locals + jit_spill_size) * sizeof(MVMReg... | 1 |
0c7bf5db985ed5a47c2d93451a4919c6 | acd0d6c477df2489757919b6b0970494 | 获得某propertyValueId下的list(分页) | public List<Propertyvalue> getPropertyvalue(@Param("propertyValueProductId")int propertyValueProductId); | 0 |
b62cfc525cb1ffa9ec5ff9fc728ed54c | e0f25aef3ed1571986b1a1c472bdb046 | Train the autoencoder just based on reconstruction error | class TrainerVariationalAutoEncoder(TrainerAutoEncoderBase):
def train(self):
super(TrainerVariationalAutoEncoder, self).train() | 0 |
d26814838cfba52e44672ff82a37a0cb | 6300bd979ffe21861a3a2283e2d6bcd2 | The function determines the
result on the first
roll of the pair of dice. | def first_roll_result(sum_dice):
if sum_dice == 7 or sum_dice == 11:
return "win"
elif sum_dice == 2 or sum_dice == 3 or sum_dice ==12:
return "loss"
else:
return "point" | 1 |
fec19b118686ccaaf3b38c4e2fe234ec | e0dcaea24ccfcee621a86b3e62efcc85 | 缓存位置信息汇报消息 | LBSService service = getRpcProxy(LBSService.class);
Boolean response = false;
try {
response = service.reportLocation(lidto);
LogCatLog.e(TAG, "response=" + response);
} catch (Exception e) {
netWorkExceptionHandling(e, context, callBack);
}
... | 0 |
22b375ff7636f4ff08732b9982c5dc91 | cf6bbee7316c3f247e35e943519c4a06 | Tests the in operator works with the query expression query method | func TestInSQLizer(t *testing.T) {
t.Run("Single", func(t *testing.T) {
s := getScope(t)
fv := &query.OperatorValues{Values: []interface{}{12345}}
fv.Operator = query.OpIn
queries, err := InSQLizer(s, s.Struct().Primary(), fv)
require.NoError(t, err)
require.Len(t, queries, 1)
assert.Equal(t, "query_mode... | 1 |
743d1d12dd4f29794cf85156cf34c947 | 65c89be4ad95c460b49f705f22c12da9 | 減速が終わるまで待機する処理 | {
if (cooldownAccelerate > 0)
{
cooldownAccelerate -= Time.deltaTime;
}
if (cooldownAccelerate < 0)
{
cooldownAccelerate = 0;
readyAccelerate = true;
}
} | 0 |
3c2e6a328bca31b757845f21e0d91756 | 008acecf4d14d5608e83c0d4dd8ff1bc | Handles the AgeAtDeathLabelClick event on Patient banner. | MenuItem menuItemDOB=gridMain.ContextMenu.MenuItems.OfType<MenuItem>().FirstOrDefault(x => x.Name == "ViewDOB");
if(menuItemDOB==null) { return; }
MenuItem menuItemSeperator=gridMain.ContextMenu.MenuItems.OfType<MenuItem>().FirstOrDefault(x => x.Text == "-");
if(menuItemSeperator==null) { return; }
int i... | 0 |
ea3f8295ce028bd389f11c78205c7944 | 054471b1ce9e07910288ea3a8cdb5d71 | Get recipientRef value | class ChronopostStructRefValue extends ChronopostWsdlClass
public function getRecipientRef()
{
return $this->recipientRef;
} | 1 |
cdb5c88ae165c09ebd4db4ae13dca9d1 | ccb120418e61ec9d11cc56f89903ca4b | function to start serial connection with iRobot Create2 | global create2
try:
create2 = serial.Serial(path, baudrate = 115200, timeout=10)
print "connected to Create2, beeping now, press CLEAN on the Create2 and restart node if no melody is heard."
time.sleep(0.03)
except serial.SerialException:
print "Fa... | 1 |
8ccae0112dcbd6e2c278cd2da31d7b38 | 1fbf398bf27f252fb0ad3bd84b160e2d | Makes a REST API call to delete a tenant by its UUID | class FusionAuthClient
def delete_tenant_with_request(tenant_id, request)
start.uri('/api/tenant')
.url_segment(tenant_id)
.body_handler(FusionAuth::JSONBodyHandler.new(request))
.delete()
.go()
end | 1 |
6210bb8b66193aa3c91c82546e968988 | d8cbd8c46cede66dc9c78c856124a47c | UpdateUserByOpenID : retrieves User by OpenID, Update session_key. | @Service("sysuserService")
public class SysUserService implements SysUserManager{
public User getUserByOpenId(String openid) throws Exception {
User user = Jurisdiction.getSessionUser() == null ? null : Jurisdiction.getSessionUser().getUser();
if(user != null && user.getOPEN_ID().equals(openid)){
return... | 0 |
0bb2992fe5ddcbacd3c3fb7fdc530a50 | 4cae2d574fa50bad7189f39213042933 | 获取还没有填写题目的题号 | async getNoSubmited (userId) {
try {
return DB.instance('r').query('select * from task where task_id in (select task_id from student_task where user_id=' + userId + ' and is_submit=0)')
} catch (e) {
throw new Error(e)
}
} | 1 |
c6f5974467f0e2c644f1502eedc73c7b | 6641e64c9ccb03aa5829cce38d1c63dd | * affiche les coordonnées du curseur sur le canvas * // | public class Carte
void curseurRender(GraphicsContext gc) {
int x = (selectionne.rang%50 - rangcorner%50)*taillec;
int y = (selectionne.rang/50 - rangcorner/50)*taillec;
gc.drawImage(curseur, x, y);
} | 0 |
c525206a7524d7ec07545bb02dbeebe6 | 68f5724f7efddc9186e48bfba9a4c17a | MySQL用に文字列をエスケープ | function dump_escape_string($str)
{
return mysql_real_escape_string($str);
} | 1 |
8ccfe6e898ff96b844b8e27d73038578 | f703e2afdcd73fd6e8bebac92cc2651b | System.Object System.Version::Clone() | namespace System
[ComVisible(true)]
[Serializable]
public sealed class Version : IComparable, ICloneable, IComparable<Version>, IEquatable<Version>
public object Clone()
{
if (this._Build == -1)
{
return new Version(this._Major, this._Minor);
}
if (this._Revision == -1)
{
return new Versio... | 1 |
d4e247f6327441f2187f9604799ac4d2 | edeb7fdbf29ea60498d9855bded0cf2c | refresh the information we have by pulling down a listing of all
nodes from Rackspace | class VMList(ComputeAPI, CustomList):
def update(self):
res = self._GET('servers/detail')
self.clear()
self.extend(VM(self.token, i) for i in res['servers']) | 1 |
ab2163c86111e0829651c38c895bb34f | b1a17d0bc74159e8a468181f6b60f7a0 | Returns the value of the '<em><b>Element</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Element</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc -->
extendedMetaData="kind='attribute' name='element'" | E getElement(); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.