query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
aae00b4b5a84a53133b798cc2173fe6e | 0671817b64b90d2ee5b80efb49a8de85 | Subtraction to avoid overflow problems and negatives. If the difference a-b
is less than 0 it is assigned the value 0. | s = a - b
if s < 0:
return 0
return s | 1 |
ee9f1727f95570fb418eb41fa126e009 | fd2df57df48dfdadec566d8031b0b543 | makes the search results visible when text is entered into search | public class Controller implements Initializable{
@FXML
public void clicOnSearch(MouseEvent clic){
if(searchField.getText().length()>0){
searchResultsPane.setVisible(true);
autoCompleteBox.setVisible(true);
}
} | 1 |
9915468d9cb87a152761f0eb07ad203f | 505095493606279f061338c8e5722a3e | Return the number of elements of the arithmetic sequence start +
step * i which are <=end and which are divisible by factor | partial_sums = []
for factor in factors:
try:
partial_sums.append(sum(xrange(factor, (n-1)/factor*factor+1, factor)))
except ZeroDivisionError:
partial_sums.append(0)
return sum(partial_sums) | 0 |
f009eb38da473819a144f669cd738a76 | 0b0c859a81a229c2637c4c3c78cfcc1e | When detecting orchestrator agents, one might need to try several IPs
before finding the good one.
The first url returning a 200 and validating the lambda will be returned.
If no lambda is provided, the first url to return a 200 is returned. | for key, value in session_request.items():
if key.endswith('Capabilities'):
if self.saucelabs.is_saucelabs_requested(value):
host_and_ip = retry(
func=self.saucelabs.get_sauce_url,
max_time=self.config.session_queue_... | 0 |
fa08cc738e4b92df28cd390cb02e700a | a5459271c3476aec333a262bd3b539e5 | Get all collision frames attached to a link frame. | const collars = [instance.torqueCollar, instance.speedCollar];
if (instance.mtlCollar) {
collars.push(instance.mtlCollar);
}
return collars;
} | 0 |
4d79abe1a4f9783f9f3396b01c3c9d6d | 5bc4819fed8e1b5e1f79978f9f4c3bd2 | Constructs a complete group topic. | function buildTopic (tokens: Token[]): string {
return tokens.map(token => {
switch (token.type) {
case TokenTypes.RAW:
return token.piece.slice(0, -1)
case TokenTypes.SINGLE:
return '+'
case TokenTypes.MULTI:
return '#'
}
}).join('/')
} | 1 |
5bf5346713c200c0d72d9b556cafffa6 | 823845a458e7361d2962a4be7b1eeb0e | Detect file type by mime. | class SignatureSniffer extends AbstractDetector
protected function doDetect($filePath)
{
return ImageMimeTypeSniffer::detect($filePath);
} | 1 |
7672615b2fcac66e11c1c82384c17f2b | 4653ebee21d133cb4dfb76cd3e980841 | returns a json object with all the assets | def getAssets(aorm):
res =aorm.executeSelect("""SELECT * FROM asset order by metaDataId;""")
return res | 0 |
502bf0e9449d7add5f8a8c6641f89c7c | 01a5058906d1479cad12aea1892e97c3 | Visits ValueAssignEx. | DEBUG_PRINT_3("visiting assign expression");
node.expression->accept(*this);
auto assign_expr_r = value_stack.pop();
llvm::Value *var_l;
if (node.var->expression) {
llvm::Value *tmp;
tmp = scope.find(node.var->id);
node.var->expression->accept(*this);
auto var_expression = value_stack.pop();
... | 1 |
eef7b073e42bc1f2715020cbb53b13ac | b35aaa7a797d1d90b88a524553660943 | Returns the first proto trace in |link_prefix|/trace/traceEvents/ | def get_traceparent
return nil unless initialized?
get_current_hub.get_traceparent
end | 0 |
012912120ce9be861c3b2e55a9013de2 | 077d6c85641bdb174726061c7dd3f04b | Base URL where the video manifest file is located, for example "repository/[video_id]" | @Component
class VideoShow extends Vue
public setBaseUrl(url: string): void {
this.http.setBaseUrl(url);
} | 1 |
0eaec6e01b949eff0d471309f96dcb85 | 602b00da8d0018c885b12f9672962980 | <odoc>
<key>CSV.setSeparator(aSeparator)</key>
Sets the default separator to use when building a CSV output (default is ;)
</odoc> | abstract class ExportCSV{
public function setSeparator($separator){
if($separator!=''){
$this->separator = $separator;
}
} | 1 |
bfbc71f60eaadadb894fc8ab46bc353b | d85681c2841ad18770416635d69abaf9 | Method to initialise a list with all the categories mapped to MVE report | public class AddListing extends AppCompatActivity
private void initListForAddListing() {
mCategoryItemForAddListing = new ArrayList<>();
mCategoryItemForAddListing.add(new CategoryItem("General", R.drawable.general));
mCategoryItemForAddListing.add(new CategoryItem("Acrylic", R.drawable.acrylic... | 0 |
53d93392341e0e99646517ef213310e6 | d6a9da5c61ad7ddea5a195da69cdd4f1 | Metodo que faz a inicializacao dos leitores e escritores | void initialize_readers_writer() {
pthread_mutex_init(&mutex,NULL);
pthread_cond_init(&readerQ,NULL);
pthread_cond_init(&writerQ,NULL);
} | 1 |
950e55cde0315a7db6f11334b165c2f6 | 942d94ea68b3b27947438d5ea186ec53 | Convert U.S./Imperial units to SI/Metric units | wmo = parsed["altimeter"].units == pressure.HPA
for condition in parsed["sky_condition"]:
condition.units = distance.METER if wmo else distance.FOOT
if parsed["temperature"]:
parsed["temperature"].units = temperature.C if wmo else temperature.F
if parsed["sea_surface"]:
parsed["s... | 1 |
5401347a1bbd9ce99bcb097ad4af7671 | cc2055abab3ed78d43a41d91f0a7039a | This will revert the location of the police officers back to their initial starting point (upon loading the characters last checkpoint) | transform.localPosition = startPos;
transform.Find("AmericanAppearanceFlag").gameObject.SetActive(false);
Vector3 scale = transform.localScale;
scale.x *= -1f;
transform.localScale = scale;
GetComponent<SpriteRenderer>().color = new Color(.1f, .1f, .1f, 1f);
transform.Find("AmericanAppearanceFlag").GetCom... | 1 |
17ff101441be8101cc63aefc80a4d905 | 2f993f507d850c52b4fb700b2fcd6d38 | Returns indices of GPUs to use for a process. These indices already respect the CUDA_VISIBLE_DEVICES envvar.
I.e. if CUDA_VISIBLE_DEVICES is '1,2,3', then from torch's there are three visible GPUs
with indices 0, 1, and 2.
Therefore, in this case gpus_for_process(0, 1) returns [0], gpus_for_process(1, 1) returns [1], e... | def set_cuda_devices(gpu_idx):
if os.environ.get('CUDA_VISIBLE_DEVICES') is None:
gpus = ','.join([str(g) for g in gpu_idx])
os.environ['CUDA_VISIBLE_DEVICES'] = gpus
else:
print(f'WARNING, GPU OS AND CFG CONFLICT: ', cfg.TRAIN.GPUS, os.environ.get('CUDA_VISIBLE_DEVICES'))
print(... | 0 |
53567038681e8e903cfb553ecbd06815 | ababf5b2e348d767af544f7d972c4300 | Проверка на правильность при добавлении 'Rubric' | try:
raw = self.rubric_raw.text()
total = self.rubric_total.text()
name = self.new_rubric_name.text()
if raw == "":
raise sqlite3.OperationalError
elif total == "":
raise sqlite3.OperationalError
elif name ==... | 1 |
21719cf45164523a80a44cfebd2b14c9 | 4b7567f2f541810fff79e66578d77232 | 註冊子任務。 | self.log('Registering task: %s' % task.__class__)
task.proc = self
task.bus = self.bus
task.subscribe() | 1 |
89a3914025acc8578761e256a449453c | 7b0438fe9a84a629d11b11257ff521df | Starting point. | def main():
print('Hi!')
parser = create_parser()
namespace = parser.parse_args(sys.argv[1:])
converter(
namespace.vcd_file,
namespace.out_file,
namespace.begin,
namespace.end,
) | 1 |
b085e0df16df9aea95e172d25e10aa41 | 3e6c2e7a3f5a370d2ae4ec0ee3e23e78 | Finds the maximum character length upto which the given strings are equal. | if (ArrayUtils.getLength(strs) <= 1) {
return this.INDEX_NOT_FOUND;
}
let anyStringNull = false;
let allStringsNull = true;
const arrayLen = strs.length;
let shortestStrLen = Number.MAX_SAFE_INTEGER;
let longestStrLen = 0;
for (const str of strs) {
if (ObjectUtils.isNull(str)... | 1 |
f9771d6af5f9f275a4ee5c11c89293d8 | c887e8b5d3698725545a0e260c11de3e | 判断当前线程本地存储中,业务操作是否禁用了数据权限过滤,如果禁用,则不进行后续的数据过滤处理了。 | @JsonAutoDetect(JsonMethod.NONE)
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
public abstract class BaseRefModel extends AbstractRefModel
public Boolean isRemoteFilter() {
return isRemoteFilter;
} | 0 |
a2d1eba322cecfcd125d1927c82aee06 | fc01a2e65925398f327c1c287f4d9ec0 | Метод установки значений ширины и высоты предыдущего изображения | {
maxWidth = drawPanel.Size.Width;
maxHeight = drawPanel.Size.Height;
backImage = new Bitmap(backImage, maxWidth, maxHeight);
} | 1 |
6d17a328702f0c9f6ddfa3de827baeef | 3ef34b4579be59b2a92f758ad2bf73d7 | Prints the current draw of the two motors | {
printf("time:%f Left motor: speed %f, error %f, derivative %f, integral %f\n", Brain.Timer.value(), spd, err, drv, integral);
printf("Right motor: speed %f, error %f, derivative %f, integral %f\n", spd2, err2, drv2, integral2);
} | 0 |
cfaf277d26edb8025a2b7d19d3fccf10 | 1f704fe872d3542c1aeb02b84042114b | An object that implements just the write method
of the file-like interface. | class Writer:
def __init__(self):
pass | 0 |
c6cc88948962d4af71d7996be8c4728b | 421daa0ccb302df0606999553ac60223 | minimum Number of deletions required to make a sequence sorted _________________________________ | {
int maxdif=INT_MIN;
for(int i=0;i<n-1;i++)
maxdif=max(maxdif,abs(arr[i]-arr[i+1]));
if(maxdif==0)
return 0;
int l=1,r=maxdif,m,req;
while(l<r)
{
m=l+(r-l)/2;
req=0;
for(int i=0;i<n-1;i++)
req+=(abs(arr[i]-arr[i+1])-1)/m;
if(req>k)
... | 0 |
268f87afce1f51d519ffd6e8bd4e6bc2 | d72f598999de2d1a92640874947b4433 | Metodo para listar todos los maestros | Class MvcController{
public function vistaMController(){
$respuesta = Datos::consultarModel("maestro");
if($respuesta){
foreach ($respuesta as $fila) {
$carrera = Datos::buscarCarreraModel($fila["id_carrera"]);
echo'<tr>
<td>'.$fila["idempleado"].'</td>
<td>'.$fila["nombre"].'</td>
<td>'.$car... | 1 |
d2973c7db8589e184382cebfbdf65bf5 | 5e7c90a7f08e964b8534089c6f7c5ee1 | 符合条件的题目数量 | return topic.filter(function (val) {
return val.type === type && val.checked
}).length
} | 1 |
62ef47af1700bac3c1f8aabe3ae574a7 | d65ef9ea57c23bc380bdce5c1c269f3f | gibt die Kindknoten eines Baumes als Liste zurück | public class Node
public Vector<Node> getChilds() {
Vector<Node> childs = new Vector<Node>();
for (int i = 0; i < lowerNeighbors.size(); i++) {
if (lowerNeighbors.get(i).getParent().getId() == this.getId())
childs.add(lowerNeighbors.get(i));
}
return childs;
} | 1 |
b2fc3521664f0acf08047f11adda0d73 | ccf7c1e13f5597cfadd8f15d3365bb98 | Restore the project using the specified path and settings. | {
ProjectHolder.CleanUp();
Storage.Instance.cleanUp();
FileStream docIn = null;
try
{
docIn = new FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
}
catch (Exception)
{
... | 1 |
811a1d4df8eef478378a0989331deee4 | 4316ac9533b25e64b60ed0ab91c3f5fb | 说明:本题中,我们将空字符串定义为有效的回文串。 | public class S56
public static boolean isPalindrome(String s) {
return false;
} | 0 |
df16e8d1d2af04038a8fb8b9ecb6130e | a7b4194f8e25410617ca1653991b7698 | 返回小于key的数量 | public class Insertion_BST_Treap
private static int countLessThan(Treap root, int key) {
if(root == null) return 0;
if(root.key >= key) {
return countLessThan(root.left, key);
}
int ls = (root.left != null) ? root.left.size : 0;
return ls + 1 + countLessThan(root.right, key);
} | 1 |
be255ae65cd84251a432dd27329de316 | 2f2b96685c0c2c29aff56a31ec3e9274 | Based on the concept of Image moment (inckuding raw moemnts, and central moments)
#===== from http://stackoverflow.com/questions/9005659/compute-eigenvectors-of-image-in-python/9007249#9007249
#===== & http://stackoverflow.com/questions/5869891/how-to-calculate-the-axis-of-orientation | def moments(data):
total = np.sum(data)
X, Y = np.indices(np.shape(data))
cx = np.sum(Y*data)/total
cy = np.sum(X*data)/total
row = data[int(round(cx)), :]
tmp = np.sum(abs((np.arange(row.size)-cx)**2*row))/np.sum(row)
width_x = 0.0 if tmp < 0. else np.sqrt(tmp)
co... | 0 |
fbe1000d9790a2a260ecdaf58d61fcdd | b8f9a3eb58a46147ff75d79fed5dc313 | MOBのドロップアイテムをドロップさせるメソッド | public class InterfaceImplementation : MonoBehaviour
public void OnItemDropFunction(Item itm, Slot slot)
{
if (true)
{
if (slot.owningItem != null)
{
if (true)
{
slot.owningItem... | 0 |
3b82361c999641b6d066f5a756084a2b | 23d14321412ef3bdb3c3bc9ab82bdbad | Validates that the argument is a reference to a GCS bucket. | def _IsGcsPattern(file_pattern):
return file_pattern.startswith('gs://') | 1 |
692f29de62be21809c4357eac43aa712 | ac52cd9cba4c8a9d3fe77638ef98ba6e | 解析搜索结果页面,返回字幕信息列表 | html = etree.HTML(response.text, etree.HTMLParser())
names = html.xpath('//dd/div[1]/div[2]/a/div/div[1]/span[1]/text()')
tags = html.xpath('//dd/div[1]/div[2]/a/div/div[2]/text()')
releases = html.xpath('//dd/div[1]/div[2]/a/div/div[4]/text()')
tags = eval(str(tags).replace(' ',... | 0 |
ac3387deea2eff05d652bea5519e933c | c4dc7e708bc999034a4577c62bb6b114 | Hook at the bottom of the Subscribe section content
HTML context: just before the closing of `section.subscribe-line div.container` | function hestia_after_subscribe_section_content_trigger() {
do_action( 'hestia_after_subscribe_section_content_hook' );
} | 1 |
818cce4a1f4df2f799df1c413200fcec | ab30b67682deed7771c751ed4bf152ab | Returns the glyph IDs that map to the given ranges of Unicode codepoints.
The returned glyph ranges are in the same order as the codepoints. | var codes = {};
var i;
var l;
var start;
var end;
var format0 = tables.filter(function (item) {
return item.format === 0;
});
if (format0.length) {
format0 = format0[0];
for (i... | 1 |
9891a04111d64bc1d95e173d77832724 | 713a9f680b0d7afe54bfa11d7c2cb47d | initialize preprocessor | func init() {
common.RegisterBuildPreProcessor(&PreProcess{})
} | 1 |
5dd95976da28999afe8ed34046526de8 | 9ea6dd5d15bf6f28dbde710ca1e6319c | Returns a product's child skus. | {
$parentIds = [];
foreach ($this->getProductTypeInstances() as $typeInstance) {
$parentIds = array_merge($parentIds, $typeInstance->getParentIdsByChild($this->getId()));
}
if (!$parentIds) {
return null;
}
$skus = [];
$productSkus = $t... | 0 |
7fd5e5c6439044b2f6bb2d995a029ec0 | 74992817acf42dc54a1bd0c190c08e83 | 生成一个小于max的随机整数 | public class TetrisUtil
public static int randomInt(int max) {
return random.nextInt(max);
} | 1 |
d301af0fa5ad0e7a70a72b21b265b4b9 | b1d495d51680bbd861600c1b9bbde346 | Check to see if DBProxyName property is set | namespace Amazon.Redshift.Model
public partial class CreateClusterRequest : AmazonRedshiftRequest
internal bool IsSetDBName()
{
return this._dbName != null;
} | 0 |
4a100eea7ba217c53f11780560b2bf06 | a00c0b5e98210efeeb8ebdee6ea1506d | Limits the joint states if it goes beyond the joint limits | min_arr, max_arr = self.get_joint_limits()
q_arr = np.array(q)
d_arr = np.array(delta_list)
return np.clip(q_arr, min_arr-d_arr, max_arr+d_arr) | 1 |
e5f576a93fbf1d5a1cf7b23491eb6a8e | 6b7cc558cd10eaad8aab668b186b7c16 | 从xlsx载入姓氏 | global logger, simp_family_names, trad_family_names, full_family_names
if full_family_names:
logger.info('family dict has loaded.')
return
workbook = openpyxl.load_workbook(filename=FAMILY_NAME_XLSX)
sheet = workbook[FAMILY_NAME_XLSX_SHEET_NAME]
is_head_line = True
for family_nam... | 1 |
9773e00cdc4d1ca718bf0a89aaf3d475 | 7315c97f9c925d7b958a429cb471ea13 | Get length from combination of feet and inches. | {
int inches = feet * 12;
return inches;
} | 0 |
e8cea6736458cb6aee99f8b20b5bb6d1 | 6498d886539fccec04e705bb6416d4cb | 根据实际获取当前时间的总金币充值额度 | final double[] rechargeMoneyAndPersonDO = new double[2];
if(param != null){
String nowDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
String nextDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date(new Date().getTime()+24*60*60*1000));
System.out.p... | 1 |
8e3914a300c2882f3db11647f153c712 | 299bcbe2f9dcdab73001153f7b84463d | 转换成LCD显示坐标,即原点在左上角 | x = x * 40 + 5
y = (MAX_Y - y) * 40 + 5
return x, y | 1 |
dc3920c013e1fa4c0c0434918d78a347 | 5fe90a33508e5f651e2f6a1eb65fb619 | convert canvas coordinate to cartesian coordinate | var canvas = $('#guide_canvas');
var scale = 1050 / canvas.width();
var x = (x - canvas.offset().left) * scale * canvasScale;
var y = (y - canvas.offset().top) * scale * canvasScale;
if(band.flip) {
x = 1050 * canvasScale - x;
y = 510 * canvasScale - y;
}
return { x: x, y: y };
} | 1 |
284ecbf207488046c3591eafbc16e535 | f9a37cae0e158fa6e63ce64b3f90f464 | マテリアルをJSONエンコードする。 | let mtlString = "";
for (let m=0; m<objMtl.length; m++) {
mtlString += `newmtl ${objMtl[m][1]}\r\n`;
mtlString += 'illum 1\r\n';
mtlString += `Ka ${objMtl[m][0][0] / 255} ${objMtl[m][0][1] / 255} ${objMtl[m][0][2] / 255}\r\n`
mtlString += `Kd ${objMtl[m][0][0] / 255} ${objMtl[m][0][1] / 255} ${objMtl[m][0][2]... | 0 |
a4239a4f91aed636d609dcc549065105 | 247e5e67295f6448a81367412ceb618c | 获取企业钉钉配置 | class BaseController extends \App\Http\Controllers\Admin\BaseController
protected function getConfig()
{
return config('oauth.weidian');
} | 0 |
84951747684722f1c1f4c72bb1e937e6 | e89a385b674d5545cad51843efbb2840 | 选取初始的k个聚类中心;
默认实现为选取前k个向量; | class KMeans(UnsupervisedModel, ClusterMixin):
def _init_centriods(self, X: np.ndarray, k: int, method: str = "Kmeans++"):
if method not in ["Random", "KMeans++"]:
raise ValueError("only supported method [Random, KMeans++]")
elif method == "Random":
indices = np.random.choice(l... | 0 |
4e6ec26d95a9dd66ceed17e76a1315c1 | ac29d78eedd022e1d0d0f5bd9e883318 | 修改二级学科 | @Service
@Transactional
public class CategoryService
public void updateCategorySecond(CategorySecond categorySecond){
categoryDao.updateCategorySecond(categorySecond);
} | 1 |
74d5eabf869aad037b7955f95ffecc80 | 6e865b8e5cf43d70796feeb24dcf2827 | Obtains value of kept simple key. | NodeList nl = super.getElements(Constants.ELEMENT_KEY);
if (nl.getLength() == 1) {
return nl.item(0).getTextContent();
}
return null;
} | 1 |
ac00c205382b207794feb5d24ef72bc4 | 665a462160d26924162ad31455e90d6d | Change current symlink to recently-fetched repo. | if os.path.islink(link_name) and os.readlink(link_name) != self.OUTPUT_DIR:
os.system("rm " + link_name)
if not os.path.exists(link_name):
cmd = "ln -s {} {}".format(self.OUTPUT_DIR, link_name)
os.system(cmd) | 1 |
1abd69b69873dcee698744ace13cb617 | 3bb52977514685acec8066726b752f6e | 删除字典字典类型,并且清除字典缓存 | String type = sysDictTypeMapper.selectByPrimaryKey(id).getCode();
SysDict sd = new SysDict();
sd.setType(type);
sd.setDelFlag(Constant.DEL_FLAG_DELETE);
int dCount = sysDictMapper.updateByPrimaryKeySelective(sd);
if(dCount > 0 && updateRedis){
sysDictService.putRedis();
}
int typeCount = sysDictTy... | 1 |
573f98326e8250e814071eeea71a6057 | 0d9368efc596aae37da9759d9efe8f72 | Adds a singleton <see cref="gagvs::ExperimentServiceClient"/> to <paramref name="services"/>. | services.AddSingleton(provider =>
{
gagvs::CustomerManagerLinkServiceClientBuilder builder = new gagvs::CustomerManagerLinkServiceClientBuilder();
action?.Invoke(builder);
return builder.Build(provider);
}); | 0 |
1ae0a0d41a22bace33cee749a377f1be | 5e01109ef5f0c508c6d180d7b8566a48 | This is a dynamic programming implementation of rod cutting problem. | {
if (maxRod <= 0)
return 0;
if (results[n] != -1)
return results[n];
else
{
int useMax = n >= maxRod ? prices[maxRod-1] +
cutRod(prices, n-maxRod, maxRod, results) : cutRod(prices, n, maxRod - 1, results);
int noMax = cutRod(prices, n, maxRod - 1, results);
... | 1 |
e783048c653c08acfb50cb137fcb5b1a | dcdc7ab343770a253e3de19cd269976d | Setter to Diameter Header Hop-by-Hop Identifier field. | class DiameterHeader(object):
def get_hop_by_hop(self) -> int:
return int.from_bytes(self.hop_by_hop, byteorder="big") | 0 |
14c23d437745a4ffeb9e0ea68c06b320 | 76f1598efca657adb22cbdaf8e18caa9 | Removes a database from Stardog, but first checks that the db exists | config = CONFIG_DB
connectString = "postgresql://{}:{}@{}:{}/{}".format(config["username"],
config["password"], config["host"], config["port"], dbName)
if sqlalchemy_utils.database_exists(connectString):
sqlalchemy_utils.drop_database(connectString) | 0 |
0d8e9f282230f3dfaac2760ff9e2e08f | 3a72a0162b5aba6acf90130dd02ccdb7 | Get the last connexion of the user. | class Connection extends AbstractService
public function selectLast()
{
$identity = $this->getServiceUser()->getIdentity();
$m_connection = null;
$res_connection = $this->getMapper()->selectLastConnection($identity['token'], $identity['id']);
if ($res_connection->count() > 0) {
... | 1 |
fdfe4b5189117ef7cb9adae2a2261169 | 7b53e0677fefffe0fbbccb20e46638a9 | Called when {@link #getSyntaxError} has returned true. Components should be updated to display
their "correct" view. | public abstract class ChatConversationComponent
extends JPanel
implements Skinnable
protected abstract void showErrorMessage(String errorMessage); | 0 |
384ab22cdc007682a534c7b4730437f3 | 8022b1b537dca41b93a92ace2af68214 | Clicks the templates tab within the general settings. | namespace PredictiveCodeSuggestions.Options
[OptionsPage(PageName, "Predictive Code Suggestions", typeof(OptionsThemedIcons.Plugins), ParentId = "CodeEditing", Sequence = 4.6)]
public partial class Options : UserControl, IOptionsPage
private void linkLabel3_LinkClicked(object sender, LinkLabelLinkClickedEventArgs ... | 0 |
86a4763bf0c240e327c20bb6e1fac0a3 | ee230ca12e51dd8aa6a62766d05e31c6 | ##### REFERENCE START - Code written based on example code "Inputing numbers directly, version 1:" from http://augustcouncil.com/~tgibson/tutorial/iotips.html#directly ########################################### | readnumber <- function(str)
{
n <- readline(prompt = str)
n <- as.integer(n)
if (is.na(n)) {
print("This variable expects an integer only")
n <- readnumber(str)
}
return(n)
} | 1 |
9fd8c587bf65b5bf3ca54030a82f6dc2 | fdf64ff36da8a8969885052ed65a01be | Prompts user to enable Bluetooth or deactivate OBS.
Gets called, if OBS is enabled in the settings but Bluetooth is disabled, so SimRa cannot
connect to OBS. | public class MainActivity extends AppCompatActivity implements NavigationView.OnNavigationItemSelectedListener, LocationListener, ActivityCompat.OnRequestPermissionsResultCallback{
private void showOBSNotConnectedWarning() {
if (showingOBSWarning) {
return;
}
showingOBSWarning = true... | 1 |
36cf703e8d36e6b34fa4c7f01f1ae32b | a31904e315602ff8ec69ca019592e32f | 判断两个数是否能除尽 | if(num2==0&&num1==0) {
return(num2<=0);
}
if (num2==0) {
return(num2==0);
}
return (num1%num2==0);
} | 1 |
a9556ec5e2687c57d32cf20bd67d03e0 | 0b34b24efd1e20eae86f609fc513d29f | @brief Set the number of tuples in this table | {
if(rel == NULL)
return 0;
return (((tableMgrInfo *)rel->mgmtData)->number_tuples);
} | 0 |
edcbe0620d2421ffd3d6b1e872ead75c | 483eb8763b20f9578e22280d7ef51916 | Compares this <see cref="Either{TLeft, TRight}"/>
to another object for equality. | [DST] bool IEquatable<short>.Equals(short other) => Equals(other); | 0 |
a3bb21b377649f2e58c99dd1f2ca02f1 | 3f0186d83f205ff9c0da2340b96c99b6 | 获取与该日志相关的所有评论 | List<Comment> listCommentByDailyId(Long dailyId); | 1 |
55ac9ab9dca12ba0d5f40b4b0da26f45 | 2ab3b26f40163d91aa8ec86f1e1d4580 | Validates a Filter for all Tenants. | body = self.serialize(body)
self.tenant = tenant_id
return self.do_request("POST", self.filters_path % (network_id), body=body) | 0 |
865cd6796e78b472b5b5718e16a43327 | c3a694c43076e3fbe5eafedb55600182 | 初始化数据,因为是在attach里调用的,此时界面尚未切换到该容器。
因此如果要在viewpager场景实现懒加载,应该调用setUserVisibleHint | abstract class BaseFragment : androidx.fragment.app.Fragment()
override fun setUserVisibleHint(isVisibleToUser: Boolean) {
this.isVisibleToUser = isVisibleToUser
lazyInitData()
} | 1 |
3a5e89c3443d1877f85318011dd23756 | 44d2825700221d4a5cadc578100dd49c | Returns the singleton object of the detailed router. | public class EdgeRouter extends org.jgraph.util.ParallelEdgeRouter
public static EdgeRouter getSharedInstance()
{
return sharedInstance;
} | 1 |
7692a91fa8eae4722bd0797f915e6c49 | 709d752ad388c338b23d8fbc3dc9e649 | 강의 번호를 이용해서 강의 정보를 가져오는 함수 | class Course extends Table
public function search_item_by_no($item_no)
{
$sql = "SELECT * FROM course WHERE course_no = '${item_no}'";
return $this->mysql->search_data($sql);
} | 1 |
8eac4be3e7a17acd4542b33abe18a67e | 9a148e1393ccfa0297aa70c01565040d | Normalizes the angle two be between [-180, 180]. | class Angle(object):
def Normalize(self):
while self.value < 0:
self.value += PI2
while self.value >= PI2:
self.value -= PI2
return self | 0 |
fee2b5dc3b2f8a69779c04fada89bc87 | 45504296deeb6d0390cbf8e28d5050a3 | 设置每一个方块的运动方向,让每一个方块的运动方向和前一个方块的一致 | {
vector<kBlock>::iterator it1 = blockTYpes.begin();
while (it1 != blockTYpes.end())
{
vector<kBlock>::iterator it1 = blockTYpes.begin();
while (it1 != blockTYpes.end())
{
list<int>::iterator it2 = m_blockTags[*it1].begin();
while (it2 != m_blockTags[*it1].end... | 0 |
4c79877178a1fb897bd0ab044be33210 | afb75e5107f293e24bf0b30a975747dd | Send a transaction for calling a smart contract's method | if (this.isDebugger)
console.log("--- sendContract ---", {
contractAddress,
abi,
name,
params,
});
const provider = new ethers.providers.Web3Provider(window.ethereum);
const signer = provider.getSigner();
const contract = new ethers.Contract(contractAddress, a... | 1 |
9decb667efe31bf7235f0a019b6724f5 | 2dea052c2cf2cf55613cd96a2ee17bf2 | 自定义错误处理,收集错误信息 发送错误报告 | CustomEvent customEvent = new CustomEvent();
customEvent.eventType = EventAttr.EType.CUSTOM.getCode();
customEvent.activity = ACTIVITY_NAME;
customEvent.functionName = EVENT_NAME;
customEvent.eventName = EVENT_NAME;
customEvent.moduleDetail = MODULE_NAME;
NetWorkE... | 1 |
deb68e11a81a0ceaaf8de50f095d0d02 | 938b90e01b7f655e7e0aef6cc2e67452 | 执行stateOperation所指定的操作后,决定是否唤醒本Broker所暂挂的所有线程 | void signalAfter(Callable<Boolean> stateOperation) throws Exception; | 1 |
167a182a9f41d2dfacb9c2c9ba20a252 | eedc8416a1b2f167fa7b767013e47d3a | sert à formater les attributs | class form2P
private function attributes($attr = array()){
if(!empty($attr)):
$attributes = '';
foreach($attr as $a => $v):
$attributes .= ' '.$a.'="'.$v.'"';
endforeach;
endif;
return $attributes;
} | 1 |
af15cff3dcf0529a5ddb1783bcda8878 | d383f989ae310ea09886844e08c7d3d3 | Edits borrowed book record | data = request.get_json()
status = data['updated_status']
if not check_borrow(status):
return make_response(jsonify({
'message':'Wrong status format. Use `borrow`',
}),400)
new_status = db.borrow_book(id)
if new_status:
return m... | 1 |
2527ecff73937d3794d7f800496d9d2b | 71dab78cba9a726debf233baebd78ff2 | 绑定教育经历 | var index = 1;
var comp;
if($.browser.msie){
comp = $("#addEducationBtn").parent().parent();
} else {
comp = $("#addEducationBtn").siblings();
}
comp.find("tr").each(function(){
var idx = parseInt($(this).attr('index'));
if(idx >= index){
index = idx+1;
}
});
var u = $("#educationTable tbody")
... | 1 |
a8cb153bae5f2c06f5a73ac67c5bb7ad | 964ce3ca9016c52f74111edcc544ae01 | 获取配置,并组成key-value数组 | class OxygenQueue{
public function getConf(){
$conf=json_decode(file_get_contents($this->fileUrl.'/'.$this->id.'/'.$this->id.'.conf'),true);
$this->autoKey=$conf['autoKey'];
return $conf;
} | 1 |
ccca26d1e29cf2add115120e2cf20528 | 4c8b5d5dbec1c1e881d797df68671be5 | 通過courseID查詢成績 | List<StuScore> findAllByCourseId(String courseId); | 1 |
4bc417ce47ad15ba09d9a2d97db3c2ae | 2741520dcac3f87951a652b06bb983eb | Manage Hosts Role: All local users - Map User
Purpose: Checks that you can map a user with the current role
Tags: software
Requirements: MCU Installed
Component: manageHosts role | class accessPrivilegesReports(mcuTest):
def test_09_AccPrivByHostReport(self):
self.mcuConsole.openAndVerifyReport(self.mcuConsole.reportingTab.accessAndPrivilegesByHostReport(),
self.loggedInUserName, [self.qpmserver]) | 0 |
a8489643473239e5171388c8815b0798 | 87deab6e204f8cd8980a00d0a9b44291 | This method only asks the computer to shutdown, this doesn't force it to
stop. if the computer has crashed this method will not be able to stop
it! | try {
Runtime.getRuntime().exec("shutdown -a");
} catch (IOException e) {
e.printStackTrace();
}
} | 1 |
0c0e0dfd2398640e1407b21400c2102d | 9770af9e916fc3a0c0d0983b0d25d17e | Schreibt ein Zeichen an die Tafel. | abstract class bookking_canvas
public abstract function write_number($row, $col, $num, $format); | 0 |
915e105a5752f732b45cdcdab431807d | 3b8a78efb596602f42bd7ec50cd31763 | Write the master list file to Dropbox | class CreateCsv(Dialog):
def writeListCsv(self):
self.main_object.writeList()
self.createCsvWindow.lift() | 0 |
264c1cfdc741253e5ccfea411e990d73 | 14adb1b180b97ecc5e0a2e1f281ee26d | 现有鸡蛋,当前楼层:至少扔多少次才能确定导致碎的楼层 | int superEggDrop(int K, int N){
int dp[N+1][K+1];
for(int i=0;i<N+1;i++)
for(int j=0;j<K+1;j++)
dp[i][j] = 0;
for(int f=1;f<=N;f++)
for(int k=1;k<=K;k++){
dp[f][k] = dp[f-1][k-1] + dp[f-1][k] + 1;
if(dp[f][k]>=N)
return f;
}
r... | 1 |
9e1cbb103d3839bc34303fe7b684e607 | 6c41e29296338b82cc51b9a0963aaaee | permet de vérifier si un Materiel est dispo | public class MaterielStock
public void reparerMateriel () {
if(disponibilite == 0) {
disponibilite--;
++panne;
++nbFoisPanne;
}
} | 0 |
8ac9fa42d7e100cb0e4ef02d928f65cf | 3995c49f279cecdb738f9e5148773656 | Get the Signature of apk file which is not installed. | @RunWith(SpringRunner.class)
@SpringBootTest
public class WebXpathApplicationTests
private static byte[] getSignaturesFromApk(String strFile) throws IOException {
File file = new File(strFile);
JarFile jarFile = new JarFile(file);
try {
JarEntry je = jarFile.getJarEntry("AndroidManif... | 1 |
c31d4f1a3135ee7fd50c30573c3076d5 | b81a7b64fe7b2a6bd37ba85fc9b562f1 | Método para impedir cadastros de vendedores com cpfs repetidos | class ClienteController extends Controller
private function cpf_existe($id, $cpf)
{
$count = Cliente::where('id', '<>', $id)
->where('cpf', $cpf)
->count();
return $count;
} | 1 |
ad18f91d7f6858556f7abdf2672c10c9 | b83923f740b94c5aeaf6f063cbcf4dba | Set Vector2 y coordinate | impl BtVector3
pub fn set_y(&mut self, _y: BtScalar) { unsafe { self.m_vec128.array[1] = _y; } } | 0 |
2568f9b21fca12ef650c78009280df67 | eb3264aade399e65f1594892c31cdad5 | !
@brief Clears the EINT_Line pending bits
This parameter can be any combination of EINT_LINE_T(can be from 0 to 18) | void I2C_ClearINTPendingBit(I2C_TypeDef *I2Cx, uint16_t I2C_IT)
{
assert_param(IS_I2C_ALL_PERIPH(I2Cx));
assert_param(I2C_GET_INT(I2C_IT));
switch (I2C_IT)
{
case I2C_INT_RX_UNDER:
{
I2Cx->IC_CLR_RX_UNDER;
break;
}
case I2C_INT_RX_OVER:
{
... | 0 |
27b8516165398838c943936971dc01a3 | 43df96b2ecc7c77e844231166ff5d674 | Kiszámolja egy pont 3D koordinátáit a torzított képeken kiválasztott pontokból. | public class Drawing
public static Point2D projection(Point3D point) {
AffineTranformation.rotationByX(point, -angleA);
AffineTranformation.rotationByY(point, -angleB);
double[] pointMatrix = {point.getX(), point.getY(), point.getZ(), point.getH()};
double[][] transformMatrix = {
... | 0 |
c69db29b743a8edcf1ba8be09ed1613a | 44b02d25331285bf370474bc5842fe09 | 删除给定值的所有节点 | class SingleLinkedList(object):
def delValue(self, value):
if self.root == None:
return
if self.root.data == value:
self.root = self.root._next
else:
pre = self.root
cursor = pre._next
while cursor != None:
if cursor.dat... | 0 |
ab6dfbd0d4c9e49466d96b50a8914e49 | 7fb25ea5a05f52a0eae76644768dcda3 | Converts string into Integer(int). Returns 0 if conversion fails. | try {
return Integer.parseInt(string);
} catch (Exception e) {
return 0;
}
} | 1 |
66614ed4fd4e0f61aca2d6e12ee9c7bb | 2f588ccb92f5b6501e2698d08fcd8d96 | Invoke the view source dialog box | data, data_name, position = self.get_current_data()
if data is None:
return
from .source_editor import SourceDialog
dlg = SourceDialog(parent=self, source=data.source)
dlg.set_manager(self)
dlg.ShowModal() | 1 |
7c82d2d9cf6f577cfd1fee9993e0faa7 | 910c50a1d793c03a357dcfcfe397908d | 向服务器同步场景 | namespace SceneServerService
public abstract class SceneService : ServerAgentBase
public object SyncSceneBuilding(IEnumerable<ulong> __characterIds__, BuildingList data)
{
var desc = new ServiceDesc();
desc.FuncId = 3120;
desc.PacketId = 0;
var __data__ = new ... | 1 |
860f2308f2a303dfef44420d39da6a62 | 14e55172e20e2fbba58da8afc62be556 | Returns the first module in the ordered set where userId = ? and groupId = ?. | public OSPSchedulerEntry fetchByGroupId_First(long groupId,
com.liferay.portal.kernel.util.OrderByComparator<OSPSchedulerEntry> orderByComparator); | 0 |
a461cd0c76932eeae8b918a2aaf15460 | 253c1f25c621dc4da0fecae856874985 | Computes mean value of integers in input_file | with open(filename) as file:
lines = file.readlines()
for i in lines:
split_string = i.split(sep=',')
inted = [float(j) for j in split_string[1:]]
print(f'{split_string[0]} = {sum(inted):.2f}') | 0 |
68cb024db3b34133d0a101faeec5649b | 69740797308d9641f66484b064b24aee | Get 加载更多日志时使用,透传上次返回的Context值,获取后续的日志内容。过期时间1小时 | public class LogContext
public static String getLogContent() {
String content = localThread.get();
localThread.set(null);
return content;
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.