query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
8d02f826d77f18801ff1239d7eeaf289 | c5ecf134c129e2a6ee481a2bf03a8856 | 方法名以set开头,并且方法名的第四个字母为大写</li> <li>方法的参数个数只有一个</li>
待校验的方法对象
false 不是setter方法 | public final class UReflect
public static final Boolean isSetterMethod(String _methodName) throws Exception {
UFormat.checkEmptyParam("UReflect", "isSetterMethod", _methodName);
return _methodName.startsWith("set");
} | 0 |
ad08f5114c0fe0dba02ea42c39bc8b9e | 2a0b14ab90aa4090d8af5273cc3e53ff | Saves the data of a list of TVShow objects to a file
for every saved show, it saves the name, and next season's number and
the release date/release period in separate lines. If the next season
hasn't been specified, it saves only the name and the word undefined at the next line | {
qDebug() << "Entered, show=" << show->name();
QByteArray xmlContent;
QXmlStreamWriter xml(&xmlContent);
xml.setAutoFormatting(true);
xml.writeStartDocument("1.0", true);
writeTvShowXml(xml, show);
xml.writeEndDocument();
if (show->dir().isEmpty()) {
qWarning() << "Show dir is n... | 0 |
37b7bef3b0d61406db1c91099cbc2329 | ed7da903c4f0a5fc4744388b3ba9e55a | =====================================
管理者向け自動返信メールの終了用HTMLの取得
===================================== | $adminBody="「".$subject."」からメールが届きました\n\n";
$adminBody .="===========================\n\n";
$adminBody.= postToMail($arr);
$adminBody.="\n===========================\n";
$adminBody.="送信された日時:".date( "Y/m/d (D) H:i:s", time() )."\n";
$adminBody.="送信者のIPアドレス:".@$_SERVER["REMOTE_ADDR"]."\n";
$adminBody.="送信者のホスト名:"... | 0 |
8947d0b060b31f21589438f13fba2038 | 48817af145e0f80741866c6ed64e9121 | マウスボタンを押下しながらの移動を処理する。 | namespace Ragnarok.Presentation.Control
public partial class MovableWindow : Window
protected override void OnMouseMove(MouseEventArgs e)
{
base.OnMouseMove(e);
if (!IsMovable)
{
Cursor = FixedCursor;
return;
}
var w... | 0 |
c65b313b3f603e4ada0a17e0c2963b4e | ab12cbf1412b7d401c73999a8c796243 | Генерация строки для записи в excel | {
string s = "";
s += MakeWord(name);
s += MakeWord(adress);
s += MakeWord(place.okrug);
s += MakeWord(place.rayon);
s += MakeWord(form_of_incorporation);
s += MakeWord(submission);
s += MakeWord(tip_uchrezhdeniya);
... | 1 |
cb80268f2221aa4dfedde038eb62037c | 2aa44681dc4270d6ea7bae30ed97dea6 | 有备选地址时,跳转到地址列表页;没有时,跳转到地址新增页。 | let {type} = e.currentTarget.dataset;
if (type) {
wx.navigateTo({
url: '/pages/addressList/addressList?addressId=' + this.data.shippingAddress.addressId
});
} else {
wx.navigateTo({
url: '/pages/addAddress/addAddress'
});
}
} | 1 |
1886317833d7c5c12dd0977ae62f8089 | 108f8352e364523613f335b9f0037d94 | 遍历excel文件目录,导出lua配置表 | fileList = os.listdir(path)
for filename in fileList:
pathTemp = os.path.join(path, filename)
if os.path.isdir(pathTemp):
getData(pathTemp)
else:
if os.path.splitext(pathTemp)[1] != ".lua":
continue
convertLua2Js(path, filename) | 0 |
ce70fba42ec33208b6ed50b0f48d2275 | 8366f3b39db1c164a9acc5684431f875 | Valide un option entre 1 et 2 puis retourne l'option saisi et valide. | int value = 0;
boolean isInt = false;
do {
try {
value = scan.nextInt();
if (value != 1 && value != 2) {
throw new IllegalArgumentException("Please enter 1 or 2!");
}
isInt = true;
} catch... | 1 |
c39241d5f097c0a39d81ffb6d1833de1 | 8cdbba380dfd801ae631d48cace6c5a5 | Add the Album to the shopping list | let isCartEmpty = $cartContainer.hasClass('empty');
addAlbumLi(shoppingCartDetailId, albumId, albumTitle, albumPrice, albumQuantity);
updateTotalNumItems(isCartEmpty, albumQuantity);
updateTotalPrice(albumPrice, albumQuantity, true);
$cartContainer.removeClass('empty');
} | 1 |
eea3e3f2f1df492026b6b66c5e57b70e | 56fb2f0f125cb3aa9c593b8f0286cd80 | Returns a list of all custom data identifier ids | public class CustomData
public String getCustomDataID(int version) {
String ret = CUSTOM_DATA_ID_HEADER + String.format("%04d", version);
BBData[][] data_set = { mRecentParts, mRecentAssalt, mRecentHeavy, mRecentSniper, mRecentSupport };
int size = data_set.length;
for(int i=0; i<size; i++) {
BBData[] recent... | 0 |
9dda47871bbe1d199842c4702e0fc54d | 87ff80eae43e192bff25a48cae8ab877 | 宣传信息统计页面 | def scuInforPage(request):
infor=models.Information.objects.filter(genre='news')
return render(request,'information_notification/testInfor.html',{"Infor":infor}) | 0 |
a42ac0bf914e3a9a27b774229fe98f1e | 04db46f762025fc3da9b0607f086c113 | Write CSV header for landmarks file. | pass
pts = landmarks + 1
header = 'version: 1\nn_points: {}\n{{'.format(pts.shape[0])
np.savetxt(filename, pts, delimiter=' ', header=header, footer='}', fmt='%.3f', comments='') | 1 |
00e6187d988ac0c615ada6e638ee8c89 | 0647ad142cc8e85dc385236c92381c2f | Returns init object provided with constructor. | class ObjectifyObject(object):
def copy_inited(self):
return self.__class__(
*self.__init_args__,
**self.__init_kwargs__
) | 1 |
fa777f4a38358b848609993a9c870c9f | fe8c9251147fffb601136cd8e99d808a | 设置工具栏自适应 | AutoSizeConfig.getInstance()
.setCustomFragment(true)
.setOnAdaptListener(object : onAdaptListener {
override fun onAdaptBefore(target: Any, activity: Activity) {
}
override fun onAdaptAfter(target: Any, activity: Activi... | 0 |
b9aded63ef24f98a75ee74973453fcda | aad7f3c408c9f544f8a7c00d0d800195 | Получает объект файлового блока по элементу родительского поля | export class FileBlocksManager
public getByGeFile(geFile: GeFile): FileBlock {
const filesContainer: HTMLElement = mClosest(
'[data-files-container]',
geFile.getFileBlock().getFilesContainer()
);
return safeWeakMapGetter(this.fileBlocks, filesContainer);
} | 1 |
5ccf1266f5d69cf2ad95be600c1834c7 | 6fdcd953ff21872a78961818b4e8f1a3 | 获取注册最大时间 | Integer getRegTime(); | 0 |
f17928b4c3f01e39803bf87e083061c5 | 5d00c03bb7be0e07bd05838c43d6aeb7 | sort the project by last edited time | @Path(ServiceConstants.REST_API_PROJECT)
public class ProjectService extends RestBase implements FrameworkConstants, ServiceConstants, ResponseCodes
public Comparator sortByDateToLatest() {
return new Comparator() {
public int compare(Object firstObject, Object secondObject) {
ProjectInfo projectInfo1 = (P... | 0 |
d33c6ffe66e4c3b094426e67aa69ab15 | 790d1d419725be39631e30d62b94e230 | Returns the number of responses received during the crawl, whose HTTP status code indicated
success (2xx).
success (2xx) | class GroupResponse extends LegacyAbstractResponse implements GroupResponseInterface
public function getNumberSuccess()
{
return $this->numberSuccess;
} | 1 |
6830f757af9ae874bfb60aaf3d2575e4 | af8f93054d3df49df799b5ac63686670 | Hides the product specification div | if (elDetail !== null) {
document.getElementById(elDetail).style.display = 'none';
elDetail = null;
}
} | 1 |
ee83642ca7f1298e26424277c5211d26 | 0cdb7fbc4930cfb2f3706e3edf9ffc61 | シャッフルしたindexを無限に返すgenerator。 | class DataGenerator(keras.utils.Sequence):
def __iter__(self):
self.__iter = 0
return self | 0 |
95965a31c52428286ab8a9f6263f0d64 | 2a64aed0173ed939517dca8a6a3d39c3 | Function to close the special store | public class mainMenuScript : MonoBehaviour
public void CloseSpecialStore()
{
effectsSource.clip = confirm;
effectsSource.Play();
storeMenu.SetActive(true);
specialStoreMenu.SetActive(false);
} | 1 |
82140599fac9e983e2aa66bdf267403e | 629599f760eec4f0d958244ac78f536a | Assign all of the entry ids in the table. | result = db.session.query(func.max(Entry.entry_id)).one()
max_id = int(result[0])
query = "SELECT setval('entries_entry_id_seq', :new_id)"
db.session.execute(query, {'new_id': max_id + 1})
db.session.commit() | 0 |
9a3092b000a3a76ef56162a5f4902691 | 506ef0bf9e94ca24d7372a31606b0954 | replace newlines to spaces | void replaceNewLine(char buffer[]){
int len = strlen(buffer);
for (int i = 0; i < len; i++){
if(buffer[i] == '\n')
buffer[i] = ' ';
}
} | 1 |
8efcc3a7e5ff28ba607f31e0a61e46e6 | 8942d1710d0a30519e94e15c32413e95 | Unique PayPal Customer Account identification number. Character length and limitations: 13 single-byte alphanumeric characters. | class PaymentAccount(): # pylint: disable=too-many-instance-attributes
def account_id(self):
return self._account_id | 0 |
d94fbb73400da14f21be01a66333336e | 1fe9d8934f6404eec2fed991c968b745 | 绝对值的平均值 | float total = 0.0f;
for (int n = 0; n < inArray.Count; n++) {
total += Math.Abs(inArray[n]);
}
if (float.IsInfinity(total)) {
return float.MaxValue;
}
return (total / inArray.Count);
} | 1 |
017d0cfae9b13bc272676cfb2df826bd | 88c855f56a97df6c5439e0c86a854eda | https://stackoverflow.com/a/23088000/1870799 | def progress(iterable, prefix='', suffix='', decimals=1, length=50, fill='█', printEnd='\r'):
total = len(iterable)
def print_progress(iteration):
percent = ("{0:." + str(decimals) + "f}").format(100 * (iteration / float(total)))
filled = int(length * iteration // total)
bar = fill * fil... | 1 |
0b81a8bfd0d5a4dc4b6a86a2eaed4f6b | 422cc60ee1f745dc5e64243864c25d20 | Show the funds out text. | {
if (amountManager == null)
return;
bool hasEnoughETH = tradableAssetManager.ActiveTradableAsset is EtherAsset
? TransactionFee <= (tradableAssetManager.EtherAsset.AssetBalance - amountManager.SendableAmount)
: TransactionFee < tradableAssetManager.EtherAsset.AssetBalance;
... | 0 |
092d16ef5d0fa5be321acf666c3e2720 | 3ea5e469f5ac1f14e64c6edb782984d2 | Output the message after a portfolio has been created. | let msg1st = '\n # ===================================\n',
msg2nd = chalk.green(' # Project initialization finished!\n');
console.log(msg1st + msg2nd);
} | 1 |
537aedf5b76dcbc42c3c7d1475d03de5 | 744a0b949653ab93bc178d08d58c40b2 | Gets the list of role colours from a list of roles. | $list = array();
foreach ($rids as $rid => $value) {
$role = user_role_load($rid);
$list[] = $role->name;
}
return implode(', ', $list);
} | 0 |
0dcb2b09fa7afac9f78978fd7baf7897 | b6510ced92575510bb68a66589351350 | Resource가 생성된 경우 데이터를 state에 넣어주고 모달을 닫는다 | export default class ConstructionManagement extends Component
setResourceData(resources) {
Object.keys(resources).map((key, index) => {
resources[key] = JSON.parse(resources[key])
})
let success = pop(resources, 'success')
alert('결과를 확인해주세요. \n' + JSON.stringify(resources))
... | 1 |
a4bc1f01e2d5818935820eccdf74b16d | ab7e9e49e667b2d7bb64b34fbfa7bbba | Getting all recent chats | return Message.find({ chatId })
.select('author body createdAt')
.sort('-createdAt')
.populate({
path: 'author',
select: 'profile.firstName profile.lastName',
})
.exec();
} | 0 |
dbe193c72e5ac4fecf605f0806187e93 | 06963b7176c3976acf0493e5f07cc481 | 查询问答召回数统计列表(知识点粒度,日报) | List<KnowledgeMasterCount> getKnowledgeMasterCount(Map<String, Object> params); | 1 |
6b92565ee4ecc3a2579c8f3c5da0ac6c | ad6f8545745b91436739ca307240d559 | Change the field to not being actively set: TargetAmount (HISTORIC_CONTRIBUTION.target_amount) | @XmlRootElement(namespace ="http://bp.comverse.com/data")
@XmlAccessorType (XmlAccessType.PROPERTY)
public class PaymentDistributionObjectData extends BaseObjectData implements Serializable
public void unsetAmount () {
this._AmountSet = false;
} | 0 |
b034e72ede8bde8aa2caff0efe4b84eb | 5211793b0b51a5ab9fa8468ae9948cb2 | Vende um item para um personagem. | {
SendObject(Controle.Actions.UNEQUIP);
Send(_selectedCharacter._name + SPLITTER + itemId);
int count = sck.ReceiveBufferSize;
byte[] buffer;
buffer = new byte[count];
sck.Receive(buffer);
byte[] formatted = new byte[count];
for (int i = 0; i < count; ... | 0 |
dcc48a6ba3dbdde5e0fb187688afea27 | 18aaebb30c1c5625b03a9d8919412c0e | Check if the entity is a bundle of an entity type.
TRUE if the entity is a bundle of an entity type. | public class ItBundle extends java.util.Vector
implements XMLElement, Formattable, UdInformable, ItElement, HTMLable, RTFable, WordMLable
public boolean isItBundle() {
return true;
} | 1 |
3347e4a4ddc34f3a7cfb07b2a72b64ff | 52d23fe31ce5c4fad6a17747ad3f6d5d | @brief Initialise the system tick timer, interrupt every 1ms | __weak HAL_StatusTypeDef HAL_InitTick(uint32_t TickPriority)
{
HAL_SYSTICK_Config(SystemCoreClock/1000U);
HAL_NVIC_SetPriority(SysTick_IRQn, TickPriority ,0U);
return HAL_OK;
} | 1 |
1d56a6ab0a03b42d5cffa55a4e9a70b3 | 1da9f4253d36092ea3930cb0bc959151 | 转发视图 | @Controller
public class forwardController
@RequestMapping(value = "/forward.do",method = RequestMethod.GET)
public String forward(){
return "forward";
} | 1 |
741cf333ed1933f5c014c73e7ef58104 | d624713fe1d48e177f9b157059a5b622 | This adds a property descriptor for the View Method feature.
<!-- begin-user-doc -->
<!-- end-user-doc --> | itemPropertyDescriptors.add
(createItemPropertyDescriptor
(((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(),
getResourceLocator(),
getString("_UI_Map_mapDesc_feature"),
getString("_UI_PropertyDescriptor_description... | 0 |
d82a77b77d0e86fc4e69d37195a7a5f2 | 069611035cc5fa63c65c9b2d0d0b9285 | load image from file and resize to 32x32 | throws IOException {
BufferedImage image = ImageHelper.resize(ImageIO.read(new File(imagePath)),150,150);
load(image, txtPath);
} | 0 |
4d7857f57b2c16060e1fed486c9fcb11 | 3e7e1fac55a4cd87f2b69749cc04866b | 大盤 | namespace BitflyerApi
public class BitflyerClient
public async Task<Board> GetBoard()
{
string json = await m_apiClient.Get("/v1/board?product_code=" + PRODUCT_CODE.ToString());
try
{
RawBoard _board = JsonConvert.DeserializeObject<RawBoard>(json);
... | 0 |
41cec5030fe43aa8638f2a94043d5282 | a03039ba4c8228c3a8eebb9d5530e3aa | Handles actor-char attachment to title. | class TitleCreator
private function attachActors(array $values)
{
$insert = array();
foreach ($values as $value)
{
$insert[] = array('actor_id' => $value['id'], 'title_id' => $this->model->id, 'char_name' => $value['char_name']);
}
$this->model->saveOrUpdate($inse... | 1 |
6bd5bf4dbcd91fec68b7bc60cf52c34c | d003e1f076361113ebda45f80024116b | 单个盘口委托买和卖分别N次 | def buy_and_sell(signals,context):
N=len(signals)
every_stock= context.portfolio.portfolio_value/N
holdings = context.portfolio.positions.keys()
for stock in holdings:
if stock not in signals:
order_target(stock, 0)
for stock in signals:
order_target_value(stock,every_sto... | 0 |
2229befb3628bde9aa1d7f4c58ea2db5 | a1f750bf217ca4be1f3b8d55f8854f5b | Property setting access control.
Controls write access to email fields. | class WPForms_WP_Emails
public function __set( $key, $value ) {
$this->$key = $value;
} | 0 |
015406547b008aafaf979d0c94541f3c | 0f0e54fa1142ef02dd1c2e5b6bf699d4 | Set the time the task was last executed | export class TaskEntity extends AbstractEntity<TaskDocument> implements ITaskEntity
public set lastProcessed(lastProcessed: number) {
this.document.last_processed = lastProcessed
} | 1 |
214a937f8f0915c879bab54d22f602ef | feada34141e623f8d845db3698f74376 | get megamenu from oauth. | {
$query = [
'agentid' => $this->app[ServiceProviders::Config]->get('agentId'),
'access_token' => $this->app[ServiceProviders::AccessToken]->getToken()
];
$response = $this->getClient()
->setMethod('GET')
->send($this->buildUrl(
... | 1 |
25b89c7ef8b61f1d7d50fd87abc67878 | 50f5c34d67a7953374ea5ad411db9bb5 | Starts at a given coordinate and changes the cluster to the replace char | class AsciiImage
public void replace(char oldChar, char newChar) {
for(int y=0; y<height; y++) {
for(int x=0; x<width; x++) {
if(getPixel(x,y) == oldChar) {
setPixel(x,y,newChar);
}
}
}
} | 0 |
68278f42e794b48f0cc98176a3a3dd40 | fa6a9779878e8e064ab9913c5d4dfbe6 | Writes prediction to mongoDB | class model
protected function save_predictions($records) {
global $DB;
$DB->insert_records('analytics_predictions', $records);
} | 0 |
0da9e23964dfd7b087891e4757698d22 | a126acf869b55db442701c074a20b165 | <b>转发到登录界面</b> | HttpSession session = getSession();
session.setAttribute("gotologin", "login");
session.removeAttribute(Constants.USERINFO);
return "login";
} | 1 |
69a337f68658225d960f2eacb31ca2a7 | e14b94e43eb9e700e6264a8131f35eff | Add contours to 1D incident photon flux signal axes objects. | theta_ndx = tuple_in[ 1 ]
dset = None
core = self.dmgr.GetCore()
ds_range = config.get( 'fluenceDataRange' )
if theta_ndx >= 0 and ds_range is not None:
dset = \
self.dmgr.GetH5DataSet( self.fluenceAddr.dataSetName, self.timeValue )
if dset is not None and core is not None:
... | 0 |
f1ab0c5cc287377bd6022c3412cb9897 | c6ec454bf30da369e0e8c57d5ece8d39 | Selects a random ID from the ordered list provided.
The selection is favored towards higher skill values. | def random_select(ids):
idx = np.random.choice(len(ids))
return ids[idx] | 0 |
5470acf9c1b452d574c9633eb9100c34 | b29e5f3f531dcab27dc10b98390064d6 | To swap the colors of two nodes | class RBTree
private function flipColors($node)
{
$node->color = self::$RED;
$node->left->color = self::$BLACK;
$node->right->color = self::$BLACK;
} | 0 |
37efa664ff5aeaea9d9b82711a65ed0e | a6a5c01060068cfdf0d2202726a4015c | Gets the recipient names associated with an email address.
This function performs a `GET` to the `/v2.1/accounts/{accountId}/recipient_names` endpoint.
Retrieves a list of all of the names associated with the email address that you pass in. This list can include variants of a single recipient's name that are used for s... | impl Accounts
pub async fn recipient_names_get(
&self,
account_id: &str,
email: &str,
) -> ClientResult<crate::Response<crate::types::RecipientNamesResponse>> {
let mut query_args: Vec<(String, String)> = Default::default();
if !email.is_empty() {
query_args.push(... | 1 |
c10ad5c3b8edbb8310b1f6b36e2d9309 | b052464f924d17623353de82c934876b | 从Json格式中读取服务调用参数,并组装成ServiceCall对象
一个参考片段如下 | {
switch ($this->config['param_mode']) {
case '1':
if (!is_array($params[0])) {
throw new \Exception('Invalid params');
}
$class = strtr($this->config['request_message_format'], [
'{service}' => $service,
... | 1 |
962ea9dc2c6049836e3138589f82c4ff | d0fad8c34f80e136537610621102fe03 | 代理店コード(agentCode)の取得 | namespace Unkou
public partial class S04_0103 : PT21
private void btnGridRow_Click(object sender, C1.Win.C1FlexGrid.RowColEventArgs e)
{
try
{
base.comPreEvent();
this.errorClear();
FlexGridEx grd = sender as FlexGridEx;
... | 1 |
9a8e32458b498d60edd158c607c25eac | 5258c40eabab0d731adc91ffd74cc8a7 | 设置标签的背景色 | public class TagConfig
public TagConfig setBgColor(int bgColor) {
ConfigManager.getInstance().setBgColor(bgColor);
return mInstance;
} | 1 |
b27f2cc869e40e3fbd6e447713b05fce | 2d41f724885a386fee6898f7126f605f | export all flows to xml | results = ET.Element('results')
delays = ET.SubElement(results, 'delays')
jitters = ET.SubElement(results, 'jitters')
for flow in net.flows.values():
flow_d = ET.SubElement(delays, "flow", name=flow.name);
flow_j = ET.SubElement(jitters, "flow", name=flow.name);
for target in flow.targets.values():
target_... | 1 |
798b5be3d7f69679d89ca474a0d9d686 | 015c1cbfc2c78d4c8a12dab2552cfd84 | Parse a raw asset name. | static ansi_t*
wfront_parse_name (
__CR_IN__ const ansi_t* str
)
{
ansi_t* ptr;
ansi_t* val;
val = str_dupA(str);
if (val == NULL)
return (NULL);
ptr = val;
while (*ptr != CR_AC(NIL)) {
if (*ptr == CR_AC('#')) {
*ptr = CR_AC(NIL);
break;
}
... | 1 |
a0136df5dae093b11dd849d93d950703 | ece42eb48e347b9386b5ccc73ed45335 | Wrap the open set in a read-only view | namespace EaslyController.ReadOnly
IReadOnlyInnerReadOnlyDictionary<TKey> ToReadOnly(); | 1 |
ce4de55e00ca29f42f63d59bd707e84f | de974dfca03b9e8b3eb0672a292e1094 | Sets the value of the isTask property. | @Entity
@DynamicUpdate
@DynamicInsert
@Cacheable
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Synonym(grant="ALL")
public class AssignmentSet extends BaseEntity
public void setTaskAssignment(boolean isTaskAssignment) {
this.isTaskAssignment = isTaskAssignment;
} | 0 |
e2f98ce17de4c7e99572a74fa06eb1e4 | c8768a33d51cdcf80c4911e6bd84cfc1 | criei um validador personalizado para não permitir criação de duas categorias com mesmo nome | public void validateUniquenessOfCategoriesNames(){
Category cat = new Category();
cat.set("name", "Deportes Acuaticos");
cat.saveIt();
Category cat2 = new Category();
cat2.set("name", "Deportes Acuaticos");
cat2.save();
assertEquals(cat2.isValid(), false);
... | 1 |
c31367bbde3f14fd81747fd41c55a5e6 | 6245b726eb7483803c5b85b225cc5c15 | Gets results from persistent storage. | {
$storage_endpoint = $this->settings->get('storage_endpoint');
$results = [];
if ($storage_endpoint) {
$client = Drupal::service('http_client');
$response = $client->get($storage_endpoint);
$body = $response->getBody();
$results = json_decode($body->getContents(), TRUE);
for... | 1 |
8566c6866f2a588eb08f2b419126c58b | d113606b2bc8467649cccc5ae6b80542 | registra a função de ativação do plugin no hook apropriado | class Activation extends AbstractHookProvider
public function register_hooks() {
register_activation_hook( $this->plugin->get_file(), [ $this, 'activate' ] );
} | 1 |
cbddd106de94cdf2c4f386443a2b56d0 | 96af608790c48c229294441c809456b9 | test that two objects from sibling hierarchies export correctly with materials | let mut g1 = Group::new().transform(Matrix4x4::rotation_y(PI / 2.0));
let mut g2 = Group::new().transform(Matrix4x4::scaling(2.0, 2.0, 2.0));
let s = Sphere::new().transform(Matrix4x4::translation(5.0, 0.0, 0.0));
g2.add_child(s.shape());
g1.add_child(g2.shape());
g1.refr... | 0 |
86687079c628f371dcf41f83043e6828 | f1b5f3a4680f0267ccaae138725d2c1d | @brief 打开默认的配置参数文件 | bool LoadConfigFile(char * szProgramPath)
{
char config_file_path[300] = {0, };
#ifndef _WIN32
char delimiter = '/';
#else
char delimiter = '\\';
#endif
const char* pszAppName = strrchr(szProgramPath, delimiter);
if (nullptr != pszAppName)
{
int folderlenth = strlen(szProgramPath) - strlen(pszAppName) + 1;
st... | 1 |
b6cc66eaf58c772c96e4c4be990aaa9e | be4e4ac7a6a77965202e341d5e0a6a52 | 这里返回的是剩余延时,当延时为0 时,此元素延时期满,可从take()取出 | public class WorkDelayed implements Delayed
@Override
public long getDelay(TimeUnit unit) {
return unit.convert(delay - (System.currentTimeMillis() - origin),TimeUnit.MILLISECONDS);
} | 1 |
561d5aae3401eb33c7741fe5c3c2fd4e | ac1510fae624c15d55595de3e30f71bb | Get remote path for canary files to be uploaded. | software_release_root_path = os.path.join(
self._cls.slap._software_root,
hashlib.md5(self._cls.getSoftwareURL().encode()).hexdigest(),
)
return os.path.join(software_release_root_path, 'bin', 'caucase') | 0 |
69aceae54fd8e1ebdb3d9a82ef06bb4f | 78b711f55ce1da6ac0ca9eb878e53bf9 | The minimum time in seconds that a session must be idle before
it can be swapped out of memory, or -1 if it can be swapped out
at any time. | public int getMinIdleSwap() throws RemoteException; | 1 |
d4301a4303b8ab49ef22299c3f77cf15 | eb2f5b287d75ceebe3482cd9b6d12134 | Get the max instance quantity in the given item. | namespace Pathoschild.Stardew.Automate.Framework.Machines.Buildings
internal class MillMachine : BaseMachineForBuilding<Mill>
private int GetMaxInputStackSize(Item? item)
{
if (item == null)
return 0;
return this.MaxInputStackSize.TryGetValue(item.ParentSheetIndex, ou... | 1 |
21b4b57c6e3eaafde41af18492529120 | f011582605d3bb52ba9c281cdc3a1ad1 | On each controller action, we reconnect to Cyclos using the cyclos session token saved | record_class_name = record.class.model_name.name.underscore
controller.session["#{record_class_name}_credentials"] = record.persistence_token
controller.session["#{record_class_name}_credentials_id"] = record.id
end | 0 |
24f1f2f53d9b2f351772bfa38963fc72 | ec8fb10768cf3f5700a50fed99ca44ce | 普通用户组成员 | {
return $this->belongsToMany('App\User', 'group_member', 'g_id', 'u_id')->wherePivot('status', GroupMember::STATUS_NORMAL)->withPivot('id', 'role')->withTimestamps()->where('user.status', User::STATUS_NORMAL);
} | 1 |
5139450dc0565d10f8b552ee62ba9663 | 245255395a589cdd5b9be966f82a126a | получение значения поля login с подрезкой пробелов | {
global $br;
$new_login="";
$login_len=mb_strlen($login);
if ($login_len>60) die($br."Error: Too long filter fio name '".htmlspecialchars(mb_substr($login,0,60))."'...");
for ($i=0;$i<$login_len;$i++)
{
$c= mb_substr($login,$i,1);
$ord_c = mb_ord($c);
if ( (($ord_c>47)&&($or... | 0 |
d8866df0e37eaaaece2d2c3209d57b28 | da075bfe4a820f1850255c4b8bbc1f44 | 【汇总】[根据配件名称和品牌统计库存]Grid的Cell的双击事件 | namespace SkyCar.Coeus.UI.PIS
public partial class FrmStockOutBillManager : BaseFormCardListDetail<StockOutBillManagerUIModel, StockOutBillManagerQCModel, MDLPIS_StockOutBill>
private void gdGrid_DoubleClickCell(object sender, DoubleClickCellEventArgs e)
{
SetGridDataToCardCtrls();
} | 0 |
4d2cbff5e5af0cfb67dea86dd867632f | 3b7af3b7b4dae3967fbc0bef3529919a | 在某个事件类型前面添加一个新的事件监听器 | {
if (isset($this->bind[$event])) {
$event = $this->bind[$event];
}
if ($first && isset($this->listener[$event])) {
array_unshift($this->listener[$event], $listener);
} else {
$this->listener[$event][] = $listener;
}
return $this;
... | 1 |
91584514a892e513374ebdaacb2d1ce2 | 55dd3c2ae7dd9c9bc50ec4294ba2145b | 数组中包含mid 根据mid唯一修改 | if (l == r) {
tree[ind].sum = tree[ind].mmax = tree[ind].lmax = tree[ind].rmax = y;
return ;
}
int mid = (l + r) / 2;
if (x <= mid) {
modify(ind * 2, x, y, l, mid);
} else {
modify(ind * 2 + 1, x, y, mid + 1, r);
}
UP(ind);
return ;
} | 0 |
0f03ff43b7d6f0527c968de5673f1707 | b6e24f3ba016bbc49484a6c0868f7e64 | Recorre el tablero de izquierda a derecha, de arriba abajo y se fija si es
posible hacer algun movimiento o si en alguna posicion hay algun GANADOR. | moves = [Movimiento.CAE, Movimiento.DER, Movimiento.IZQ, Movimiento.GIR]
moves_posibles = []
for i in moves:
if self._tablero.movimiento_valido(i):
moves_posibles.append(i)
fijar = self._tablero.puede_fijar()
if fijar and move == Movimiento.FIJ:
... | 0 |
339539adaf5df5f8e368f9a2f225b9e2 | 735e787616c2b30077c0bc3565829a43 | 功能:随机生成邻接矩阵 | {
int[,] matrix = new int[LENGTH, LENGTH];
for (int i = 0; i < LENGTH; i++)
{
for (int j = 0; j < LENGTH;j++ )
{
if (type == AdjacentMatrixType.DAG)
{
matrix[i, j] = j > i ? random... | 1 |
160a573601695a502661871ef0d92aa8 | 387d90a6bde3a2a3ebcb2ac16730aa9e | Delete a product tag link permanently. | namespace Infoplus.Api
void DeleteItemProductCodeTag (int? itemProductCodeId, string itemProductCodeTag); | 1 |
2c8df1545cd747515c902247dc0b2f87 | 4702084981458807437fbffc44ae1d17 | Sets the value of the address1 property. | public class X_LBR_FactFiscal extends PO implements I_LBR_FactFiscal, I_Persistent
public void setAddress1 (String Address1)
{
set_ValueNoCheck (COLUMNNAME_Address1, Address1);
} | 1 |
4b0165ead049aa01662353fa27fdbc72 | 55472b01ec06b5ca5b255dc88c5131ab | Main dancing links solver. | class DancingLinks
int h() {
int ret = 0;
for (int i = R[0]; i; i = R[i]) {
vis[i] = false;
}
for (int i = R[0]; i; i = R[i]) {
if (vis[i]) {
continue;
}
ret++;
vis[i] = true;
for (int j = D[i]; j != i; j = D[j]) {
for (int k = R[j]; k != j; k = R[k]) ... | 0 |
f24284dba80b3cec40a4147dee75ba55 | 415d8ef520495c4962a15cb42a2720d1 | Creates test JSONComponents. | self.comp_name = 'test_component'
self.default_concentration = 0
self.component = Component(name=self.comp_name, mechanisms={}, parameters={}, parameter_file=None,
mixture=None, attributes=[], initial_conc=self.default_concentration) | 0 |
cf55b5db1a7743f501c68b6308e862d0 | 3a21a5d5f8824f88b35587d75f9dd2bc | Returns a list of extra libraries to scan before the standard ones | if values.size > 0
@exclude_libs ||= []
@exclude_libs += values.flatten
else
@exclude_libs || (@project.parent ? @project.parent.eclipse.exclude_libs : [])
end
end | 0 |
5560bc0c0e67beb176f62f6151dd1e01 | 762de257515f00deea465863f2ba1736 | open case file in external reader | static bool forth_FILE_IN_OPEN(const char *pFilePath)
{
if (pFilePath == NULL)
forth_ERROR(err_SYS_MEM);
external_fflush(stdout);
FILE *fp = external_fopen(pFilePath, "r");
if (fp == NULL)
return FALSE;
PBYTE pBuf = external_malloc(MASS_STORAGE_BLOCK_SIZE);
forthSetFileInput(fp, pBuf);
forth_SET_E... | 1 |
3251400515f1503415f04b8e1599c884 | 88fbfd4d1f62211dc90d9bd48dc9a392 | Test Response Header setter and getter | {
$response = new Response();
$headers = $response->getHeaderLine('Accept');
$this->assertSame('', $headers);
$response = $response->withAddedHeader('Accept', 'application/json');
$response = $response->withAddedHeader('Accept', 'application/xml');
$result = $response... | 1 |
b2c9c5fa5289ef6c119d9a1ea47597cd | 1973c3333bf56baf87fa5a273a2823fc | Colapso day -> month: debe haber valores hasta el último día del mes | public class HelperDateTest
@Test
public void validateAddMonthDate() {
assertEquals(HelperDate.addSubtracMonth(FECHA_TEST, 1), "21/05/2016");
} | 0 |
2ece6c5414fa38f2561c74b07a2183aa | ad38cc8a8afb0d9b046ab97a76ea14db | Returns the manufacutuerID of the inventory item | public class items
public int getManufacturerId() {
return manufacturerId;
} | 1 |
bb52e2c55186ecf9fe5e8bb72cfd0e3b | 296d4272327ea3d89406db4f60dfe895 | 将商品加入商城中 | void addGoods(); | 1 |
ab8344ae0c24107b6e6d8e17ed5354b9 | 9b13516f9846b86c0efca2a4e71c1704 | Fix-up URL when page rendered from search engine cache or translated page | {
global $OLD_BASE_URL;
if (is_null($OLD_BASE_URL))
{
$rows=$db->query('SELECT * FROM '.$table_prefix.'config WHERE '.db_string_equal_to('config_name','server_name').' OR '.db_string_equal_to('config_name','server_port').' OR '.db_string_equal_to('config_name','script_path').' ORDER BY config_name');
$serv... | 1 |
b90a3f816cf71cb0ac411ecd1849616c | af1326efd0560c4557d9b207463b7702 | Upload a new image using a URL. | var thisPromise = self.metaService.createImage(self.draftWallEntry.wallentry, url, url != null, $form);
thisPromise.addCallback(function(data) {
promise.emitSuccess(data, url);
}).addErrback(function(message, status) {
p... | 1 |
fe76da71467b2f11b87360472c157e89 | 9daad804f2a83fa74a890e1044150997 | Metoda koja pronalazi najbliži objekt kojeg dodiruje zraka(ako postoji) i
poziva računanje boja | public class PRTree
private void isciNajblizjeBox(double[] vektor, MyHeap2 rezultati) {
boolean manjseInBox = (manjse != null && manjse.isVectorInBox(vektor));
boolean vecjeInBox = (vecje != null && vecje.isVectorInBox(vektor));
if (manjseInBox){ manjse.isciNajblizjeBox(vektor, rezultati); }
... | 0 |
34a6b5a239906bead9063f7ced3d5a47 | 8fb914aaec45b0880159ada217c6dcb8 | Compute the ratio of lines that the old function and new function definition have in common. Changes in
whitespace are ignored. | cnt_1 = sum([len(line) for line in lines])
cnt_2 = sum([len(to_chars(line)) for line in lines])
return cnt_1 - cnt_2 | 0 |
c16ecf310bd7f0cf3920f9de67c87417 | bfe930befedfcb12a766472401d4cc93 | POST /vendor_brands
POST /vendor_brands.json | class VendorsController
def create
vendor = Vendor.create!(vendor_params)
render_serializer scope: vendor
end | 0 |
56fff57baafd107f32ec1529fc8ccdcf | 678df107a846298881b45978ddae2989 | Método que asigna los íconos a cada Tab | for (int i = 0; i < tabLayout.getTabCount(); i++) {
int icon = 0;
switch (i) {
case 0:
icon = R.mipmap.ic_info_white;
break;
case 1:
icon = R.mipmap.ic_map_white_24dp;
break;
... | 1 |
d52fcfa6d3299e2da74200d1e407e497 | 078bed2d42938292af3e038a840ea24b | resets form field after user submit | function reset() {
document.getElementById('myForm').reset();
} | 1 |
7ad57dc1102683b9b7ce2aae30045bc5 | 93b2e52a2b83b61d6d03768c45d0039d | Returns a description of the translator to enable users to choose
the translator they need. | public abstract class TextTranslator extends Translator
public static String getFilterDescription() {
return "Text Document";
} | 1 |
597f2939b9c9b689239f3579d5945efd | 1cd04b14c9bfb3e87041b9d3216ef068 | 返回sys_GroupTable实体类的ArrayList对象 | public class Man280ParamModel extends Man120ParamModel
public List<LabelValueBean> getMan280GroupList() {
return man280GroupList__;
} | 0 |
d95f905a3e5ef35ef336ec905dd6dd2f | 33ba2681d0758c63ec5d7c53ca31e1c4 | 術の時、属性相性によってダメージ量を変化させる処理 | function getHurt(skillHurt, atker, target){
const randFunc = WorldUtils.getWorld().randFunc;
const hurtAvoid = getHurtAvoidProb(atker, target);
let value = skillHurt * (1 - hurtAvoid);
let critProb = getCritProb(atker, target);
let rvalue = randFunc();
if(rvalue <= critProb){
value = val... | 0 |
639274504cd12452be759539758ba0cc | 0014581564799850f4c504c32c21f0f5 | 弗洛伊德算法 | public class Alg extends Graph{
public static void AlgF()
{
start();
for (int i = 0; i < N; i++) {
for (int u = 0; u < N; u++) {
for (int v = 0; v < N; v++) {
if (d[u][i] + d[i][v] < d[u][v]) {
d[u][v] = d[u][i] + d[i][v];
... | 1 |
e724b1fdae6ff774e5f96cc99d23cca5 | 6612b2a5258f9029b6e2ed56f707bf5d | 判断是不是字母行,通过key比较,这里是NameValuePair对象,其他对象,就由你自己决定怎么判断了. | public boolean test(String key, Object value) {
return !key.equals("name");
} | 0 |
3272a05728c43d8a7f948fce7f54477f | dbddd3140d2880029d54e331e1953493 | 绑定KeyUp事件 | bind(el, binding, vnode) {
el.addEventListener('keyup', () => {
el.value = el.value ? el.value.toUpperCase() : el.value;
});
} | 1 |
ef5753db4098adf597867baa226c2366 | 6c372554aa3a1851fad50561118a7ecf | Compute the efficiency gap expectation over many simulated elections.
This uses the same estimator as `get_efficiency_gap`,
but computes the efficiency gap over many simulated elections. | U = self.regret_consensus
R = self.voter_regret_median
return U / R - 1 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.