query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
558dbb6afa4d6dc47417fded1b898bb9 | 756f5670df2b8d33c94d5c145d91e1d8 | Método responsavel por listar todas monografias | class MonographController extends Controller
public function index(Request $request)
{
$monographs = Monograph::orderBy('id','DESC')->paginate(5);
return view('Monograph.index',compact('monographs'))
->with('i', ($request->input('page', 1) - 1) * 5);
} | 1 |
ae5f0e2091ed2acbd93cc7c896ee6845 | 3c6312f419f448f1ec6790c9672ae0ab | Updates existing job request and switches windows | selected=RequestBox.getSelectionModel().getSelectedIndex();
if(selected==-1) {
System.out.println("cannot select a non-selected index.");
return;
}
try {
String path="/gui/TimeOffRequestModifier.fxml";
Stage st = new Stage();
Scene scene = new Scene(FXMLLoader.load(getClass().getResource(path)));... | 1 |
ef7000e8398d65ff0995d58dbb9c290e | a0b5aeb35b966040fbae46fe63d4141d | Método para abrir o plano anual desejado. | public String abrirBoleta(String codigoAlfresco)
throws FuncionJudicialException; | 0 |
705780c28fa7c3995330acc0cbb943db | 6f0148c6c23a807ded9f2df7aa381576 | Read the statistic information (metadata) of the index, e.g. the number of offsets and intervals in every row. | {
stats = null;
if (String.IsNullOrEmpty(indexName)) throw new ArgumentNullException(nameof(indexName));
string url = indexName + "/stats";
RestRequest req = new RestRequest(
_Endpoint + url,
HttpMethod.GET,
_AuthHea... | 1 |
99b64aadaea9a14331e23fac6bfb9f3d | f8182be5f68337e7dfa98be849103ded | 将String型格式化,比如想要将2011-11-11格式化成2011年11月11日,
就StringPattern("2011-11-11","yyyy年MM月dd日") | public class DateUtil extends DateUtils
public static String StringToString(String date, String newPattern) {
DateStyle oldDateStyle = getDateStyle(date);
return StringToString(date, oldDateStyle, newPattern);
} | 1 |
9ac8ca3c0afff17bd868004baa033794 | ece4d7dead36f0479726eadf1d3879d6 | 仅下载文本文件(任何后缀名),succeedCallback返回参数any,errorCallback返回无参数 | function TextFileRequest( path, onLoadFunc, onErrorFunc ){
FileRequest(path, (request)=>{ onLoadFunc(request.response)},onErrorFunc, 'text');
} | 1 |
24608e787e0c3c22a80cf71bbbc47c53 | 5dc3ba7b39057a5ac0498c9b033fa4cf | # Fun. to calculate GC-content (%) | def GC(s):
s = s.upper()
n = s.count("G") + s.count("C")
nn = s.count("N")
denom = len(s)-nn
if denom==0:
return 0.0
else:
return 100.0*n / denom | 1 |
b4ecb981d38e5120f03a0ba205a3d263 | bd9571b8f6660ee2b5dc9a7ce3f52a56 | returns the mean correct predictions for the given confusion matrix | fn = _false_negatives(cm)
fp = _false_positives(cm)
tp = _true_positives(cm)
return 2.0 * tp / (2.0 * tp + fp + fn) | 0 |
53419ccd3fc253e8673b238bbd830e15 | c68fbeccb9ff4d2bd4aabb129a7f822b | Return the Country/Carrier/Connection Type for the provided IP address.
If any errors occur or if the IP address is not listed in the database, it will return null. | @Slf4j
@Component
public class IpSelector implements InitializationRequired
private String getConnectionType(String ip) {
try {
InetAddress ipAddress = InetAddress.getByName(ip);
ConnectionTypeResponse response = this.connectionReader.connectionType(ipAddress);
if (null != re... | 1 |
27cbe529ec0f172d41a0aff5b9667a51 | d4f3c4180348f3b7ab21b6290be8d1a0 | 获取点击列所对应的input数组;参数为点击表头项的索引值; | let arr;
switch (index) {
case 1: arr = this._tianarr; break;
case 2: arr = this._diarr; break;
case 3: arr = this._xuanarr; break;
case 4: arr = this._huangarr; break;
}
return arr;
} | 1 |
036e4c5c5a0550e9ba267cc002dd9675 | 0353b15d31a9bd3e42e777eaa2a2292a | 功能:获取《栏目》信息(通过id获取相应字段值)
参数:$col -> 字段名 $id -> 栏目编号 | class Publicmidmethods extends Publicaction{
function obtainonecolumnbyid($model,$column,$id){
$list = model($model)->where('id',$id)->field($column)->find();
$value = $list[$column];
return $value;
} | 1 |
d444d251c0c7c9771d91db48fc1fa6ec | 5f51ca8650cff520aab543a359c76253 | Test that adding a weight for a counted item or a
count for a weighed item throws the proper exception. | with self.assertRaises(InvalidMaximumError):
self.parameter.maximum_item_count = 0
with self.assertRaises(CollectionLengthError):
self.parameter.minimum_item_count = 1
self.parameter.maximum_item_count = 2
self.parameter.value = good_dict | 0 |
89fceeb6c6a95ff9da31cd87e9171ecb | abf4d5a1d5b6ebe3575b8c4be1ba88b0 | 学生通过学生id获取图书 | namespace TextbookManage.Services
public class ReleaseStudentBookService:IReleaseStudentBookAppl
public IEnumerable<ReleaseBookForStudentQueryView> GetStudentBookByStudentId(string studentId, string storageId)
{
return _impl.GetStudentBookByStudentId(studentId, storageId);
} | 1 |
ac8b0df24bb9faac71050edc7f512d24 | 3348913809d6e587d4be3e9c43aee0c5 | Create a recurring application charge. If the charge was successfully
created, then this will return a +confirmation_url+ where the shop owner
may either accept or decline the charge.
Otherwise +nil+. | {
return new RecurringApplicationCharge([
'activated_on' => '2022-09-20T12:00:00-00:00',
'billing_on' => '2022-09-28T12:00:00-00:00',
'cancelled_on' => '2022-09-30T12:00:00-00:00',
'capped_amount' => "100",
'confirmation_url' => "https://jsmith.mys... | 1 |
6853db15b33b913f92a59d1db1dc8bdf | 8539b648b9a33719b6c27b063882d6fc | List overall uploaders | class UploadController extends Controller
public function index(Request $request)
{
$upload = Upload::with(['tbluploadtypes'])->get()->sortByDesc('id');
return view('admin.upload.index', compact('upload'));
} | 0 |
8f2c1a94f0dd14c294b6c3a4c07121a7 | 0b88ce26614efe3c89e0469d188875a6 | Used to describe the organization to user relationship such as "Employee" or "Contractor". | class AuthorizedOrgsDesc(pulumi.CustomResource):
def authorization_direction(self) -> pulumi.Output[Optional[str]]:
return pulumi.get(self, "authorization_direction") | 0 |
6fb5c6cca0efd27941706b19898172b8 | 03526730036bde728927afe48076ef86 | Sets a player's death count | if (player == PLAYER1)
_player1Deaths++;
else if (player == PLAYER2)
_player2Deaths++;
} | 1 |
7e4965687bee554272395a74e9be2e0c | 0c486c4a5caedf3ca1786e9cf76aa301 | Gets the login name of the user who created this entity. | public abstract class AbstractAuthorEntity extends AbstractEntity
public abstract String getCreatedBy(); | 1 |
8c0c3def0e9f1f70be412c6c957e98b6 | e74661025257c9f36019aef42199b047 | Quantize-dequantize the tensor, using the saved encoding for this tensor | class TextEncoder(object):
def decode(self, tensor):
raise NotImplementedError | 0 |
fbd3c3d5e35a37f0226c42fd63372f83 | 8bc6ffbba5a7fbd7cab0e4b4e7df71e0 | initialise the L3G4200D
normal mode and all axes on to control reg1 | void Init_L3G4200D(void)
{
I2C_Init(I2C_1);
I2C_WriteAddr(I2C_1,L3G4200_Addr,CTRL_REG11, 0xE9);
I2C_WriteAddr(I2C_1,L3G4200_Addr,CTRL_REG22, 0x00);
I2C_WriteAddr(I2C_1,L3G4200_Addr,CTRL_REG33, 0x08);
I2C_WriteAddr(I2C_1,L3G4200_Addr,CTRL_REG44, 0x00);
I2C_WriteAddr(I2C_1,L3G4200_Addr,CTRL_REG55, 0x03)... | 1 |
4bd80168d460ce02c60a6446a37794e6 | 4b8d0323aadbbba75f2a5404be3a85f5 | 将笛卡尔坐标转化为canvas的坐标 | function windowToCanvas(x,y){
var bbox = myCanvas.getBoundingClientRect()
return {x:Math.round(x-bbox.left),y:Math.round(y-bbox.top)}
} | 1 |
b44417a4d5a922687005af16ec964056 | c25e395c4f75a2f2280fd7cbcbb91338 | Test case for assetServerGetSecurityIdentitiesForUser
Retrieve security identities for a specific user.. | {
ApiResponse<PIItemsSecurityIdentity> localVarResponse = GetSecurityIdentitiesForUserWithHttpInfo(webId, userIdentity, selectedFields, webIdType);
return localVarResponse.Data;
} | 1 |
651c770b89bd54b855f1c0c32493ead5 | 7f7b8524722e8b8ba4ffb8f3f608e223 | {
data:
{
"token":"token"
}
}
Esta vista muestra al usuario que envia el token, los ejercicios pendientes por hacer que tiene. | {
$user = Auth::user();
if($user == null){
return Redirect::to('/');
}
$exercises = Exercise::paginate(10);
return View::make('exercise.index')
->with('exercises', $exercises)
->with('user', $user);
} | 0 |
617a91afb1521b91d9bb7d3831c95b3b | 3df48072da50d43d7f9d41e3332eb4f1 | function to cal real X from pixel and Z distance in centimeters | def calcYCM(pixelY, distZ):
yCm = (pixelY - 240) * (distZ - 10) * 0.0021
return -yCm | 0 |
1c6d60530a5c84fad3de7a4a9c0737c1 | 0b4f20e5c7f7e7d1870381a4d7719933 | 将一个位写入当前流中的当前位置。 | public class BitOutputStream
public void writeBit(int bit) {
if (bit < 0 || bit > 1) {
throw new IllegalArgumentException("Illegal bit: " + bit);
} else if (debug) {
output.print(bit);
} else {
digits += bit << cursor;
cursor--;
if (cur... | 1 |
cae5af295a087d42acc5785b8d32151d | 4fd6635393a25af2c229a00efe53d49e | Atualiza a animação de andar do zombie verificando a velocidade dele | public class EnemyController : EnemyFunctions
private void UpdateAnimations() {
Anim.SetFloat("Speed", (new Vector3(Agent.velocity.x, 0, Agent.velocity.z)).magnitude);
} | 1 |
339a940303f5fc8ec94241af858ea957 | f8f9863eefe8442513e9c7bf8987a60c | LoginManager constructor. | class LoginController extends AbstractBaseController
public function __construct(Environment $twig, ManagerInterface $sessionManager, Flash $flash, Config $config, UserServiceInterface $userService)
{
$this->twig = $twig;
$this->sessionManager = $sessionManager;
$this->flash = $flash;
... | 0 |
2903c50b83a978f5f118aca811efd397 | b896c85927745b6b4ab79d2c15319c36 | also set the profiler name to Controller/Action or /url | namespace AspectCore_APMDemo
public class Startup
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseHttpProfiler();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMvc();
... | 0 |
f9ad4fc34bbd0dae3f3a4276fbf71803 | 678ba94fe16d8bbbf67117f267c31989 | Describes how good the model is at predicting the positive class when the actual outcome is positive | true_positive = _get_number_of_true_positive(pred, y)
false_negative = _get_number_of_false_negative(pred, y)
return true_positive / (true_positive + false_negative) | 1 |
217a89a6ffc0633c8a2e00e89d41a355 | 672ce7fd7dcce30722d4b72d552fc290 | Saves a new ignite config file. | self.current_file = file_name
if ext:
with open(file_name + "." + ext, 'w') as configfile:
self.config.write(configfile)
else:
with open(file_name + ".ini", 'w') as configfile:
self.config.write(configfile) | 1 |
42ee94f25fd69bb00437ff4df79ed484 | 738d13a5113c5ddff3c36cb5b602d8ac | 翻页加载用户学习历史记录 | var param = {"pageIndex":index,"busId":busId_session,"userId":userId_session};
ajax_fetch("POST",paramMap.getStudentRecords,param,function (result) {
if(result.success){
var newsStr = "";
$.each(result.data.studentRecordList,function (index, item) {
var course... | 1 |
29def304860290690958b8776ba17ef5 | daa263ff897514ea56fdfb1f60f8b1d5 | Terminates a socket by deleting its data entry and deleting it from the two connection lists. | void terminateConnection(int index)
{
close(connectTable[index]);
connectTable[index] = -1;
} | 0 |
59cce1c35473981a76159af6b3d04fed | f11f867a31e78c5939911f6e7c7a8b9a | Return the current VBE video mode | static int GetCurrentMode(void)
{
vmRegs.eax = 0x4F03;
VideoBiosCall(&vmRegs);
return vmRegs.ebx;
} | 1 |
2d7478305d4090a32d8222d45054db6d | 8502791b910e9e8012ba49f53d60c29e | Deze method laat de eerstvolgende notificatie in de wachtrij op het scherm zien (als die er is) als op dat moment
nog geen notificatie actief is. | boolean notificationAvailable = false;
if(notificationQueue.size() > 0) notificationAvailable = true;
if(notificationDisplayed) {
boolean currentNotificationStatus = checkCurrentNotification();
if(!currentNotificationStatus && notificationAvailable) displayNextNotificatio... | 1 |
e8a27f48cd050141765731acd7a98f7a | 330a100c98cc69bd191618e28a5d640d | Unit test for crawler.save_article. | class CrawlerTestCase(unittest.TestCase):
def test_retrieve_articles(self):
raise NotImplementedError | 0 |
1c829711454c5e817d3023f8532881c4 | cde186efc5d5d94a6e15270e108c7f11 | Hakee työntekijän nimen perusteella tämän työvuoron | class DBFunctions
public function db_getIDOfGuteTatbyName($name) {
$db = self::db_connect();
$sql = "SELECT idGuteTat FROM Deeds WHERE name = ?";
$stmt = $db->prepare($sql);
$stmt->bind_param('s',$name);
$stmt->execute();
$result = $stmt->get_result();
$dbentry = ... | 0 |
3254b89a833bacef8f55cb9272d13e55 | 94b2dacf44a01b20d766db49cbf5a248 | set staffBtn background colour when hovered over | void MenuButton::callbackHover() {
this->setColorText(204, 102, 0, 255);
} | 0 |
8cc52f8d6ebeeb291e0fe7f814805529 | bfc959fb74095cdd23bd3a0709fe80da | 接地をブール値で返す関数 | bool TrajectoryMaker::groundIsSet()
{
return groundSet;
} | 1 |
310ae5f7cf791573909fc0ae62148748 | fd892f8d865b475976393f1fe24d02da | 从指定位置开始,截取4个字节转为float | {
byte[] b = ByteArrayLib.Get4ByteArray(source, start, type);
return b == null ? 0.0f : BitConverter.ToSingle(b, 0);
} | 1 |
c9f5a092b0a725b4a8d7758782f4a8ae | 61606c0fd1c92a88aa9b8ee6627188b0 | Exit a parse tree produced by {@link FunLaParser#sdataExp}. | public class tptpBaseListener implements tptpListener
@Override public void exitFormula_data(tptpParser.Formula_dataContext ctx) { } | 0 |
471c9a45a49eb948d163b307745d126e | a951374da9c058642ab641358439c320 | Produce an iterator returning the required individuals. | public ExtendedIterator listIndividuals(); | 1 |
9a36a87e54d75b5d808b30b7c499e37b | 47c63724e61855aa98a797dce6663042 | Changes this literal to a positive literal | interface AbstractVariable
operator fun unaryMinus(): AbstractLiteral | 0 |
84ef4816fcbc7d35ddf37c90a55b29ef | 707ddf5bdd6883cd20b471d60d72a367 | 微信菜单创建--AJAX | $session = Yii::$app->session;
$session->open();
$jsons=$_POST['json'];
$connection = \Yii::$app->db;
$number_id=$session->get('number_id');
$command = $connection->createCommand("SELECT we_appid,we_appsecret FROM numbers WHERE number_id='$number_id'");
$post = $command->queryOne();
$u... | 1 |
9111676d4c8da40807f1369ab9556131 | 90817a225137d5cd922d6f18355faf26 | Process Authorization response Intent | protected void onHandleIntent(@Nullable Intent intent) {
credentials = AuthService.getInstance(getApplicationContext()).getCredentials();
resultReceiver = intent.getParcelableExtra(KEY_INTENT_RECEIVER);
int queryType = intent.getIntExtra(KEY_INTENT_QUERY_TYPE, CHECK_INTERNET_CONNECTION);
... | 1 |
5d439f3ff878153965d882765aa155ca | 340e2a363689eac3eb8135154d582f59 | Checks if the index is at the edge of the board. | {
return x==0 || y == 0 || x == (gridSize.x-1) || y == (gridSize.y-1);
} | 1 |
b244a7d7b39a7c96177b064a36ab28c0 | 752845695f14d0959f6f1e088bcce781 | This script will select candidates for Planet 9 from the DECaLS DR2
Tractor catalogs. | def main():
user = getpass.getuser()
if user == 'frenchd':
inFilename = '/Users/frenchd/Research/GT_update2_files/FinalGalaxyTable13.csv'
inFilename_altNames = '/Users/frenchd/Research/GT_update2_files/FinalGalaxyTable13_altNames.csv'
outFilename = '/Users/frenchd/Research/GT_upd... | 0 |
c4405bff2eeb2a39c319c264777c4d51 | 3b7c1bf986274b546bbd3a6c4cbde408 | Use global settings for determining browse page limits. | $this->browse_msg['prefix'] = "";
$this->browse_msg['suffix'] = "";
$this->browse_msg['active'] = "<li class=\\\"active\\\"><a>%PAGE</a></li>";
$this->browse_msg['unactive'] = "<li><a href=\\\"%URL\\\">%PAGE</a></li>";
$this->browse_msg['divider'] = "
";
} | 0 |
c03511ddf9726ded9902cfb6ec294722 | f252ce7e47e181886389dc11e3932d52 | Total size of the index chunks of the database when in storage (in bytes) | public class IndexDefinition implements Aggregate.AggregateMapper
public int getBlobSize() {
return blobSize;
} | 0 |
a34042e45a2345fce70d57305f6f2940 | 304e4c18ff4ce53edaa337ebd4206ad9 | retorna numero de questoes vinculadas a uma materia | Integer getNbQuestionFromTheme(Integer themeId); | 1 |
0ddbf3ee6edf5fa3cbeb4fde29cd0564 | abee5a6c2ad3afd6f6f2bb88ef9b6512 | This method does all of the actions for going to the second skystone
It goes to the skystone and moves it across the alliance skybridge before navigating | void secondGreen(){
turnRightDist(146,40);
forwardMove(225,30);
turnLeftDist(80,40);
sleep(200);
moveMotorTarget(FrontClaw, -1000, -100);
forwardMove(250,30);
moveMotorTarget(FrontClaw, 1000, 50);
sleep(600);
backwardMove(125,30);
sleep(600);
turnRightDist(140, 40);
forwardMove(60,30);
sleep(200);
mov... | 1 |
f47724473ee4c74c4077e845f5f90720 | 15adb092a441a40620fbf17c5ae3e50c | 得到所有的单位名称 | namespace udm
unsigned int UdmDfiConfig::getUnitNameList(std::vector<std::string> &unit_names) const
{
if (this->unitlist == NULL) return 0;
return this->unitlist->getUnitNameList(unit_names);
} | 1 |
0e255aef55df212fe7bd34c0ab9a903e | 9540ea4dfed80d8421426f0eb6756317 | function greets user and prompts user to enter a difficulty level | print ("Play again?")
response = input("yes or no")
accept_yes = ['y', 'yes']
accept_no = ['n', 'no']
if response.lower() in accept_yes:
difficulty()
elif response.lower() in accept_no:
print ("Thank you for playing.")
else:
print ("Sorry I did not understand your... | 0 |
f3f5bd1e0391a202ddbdbc8d7d87e386 | 1db9e4ae012dfa39b399946bfd4b0719 | Rotate tree nodes for RL Case.
https://en.wikipedia.org/wiki/File:Tree_Rebalancing.gif | child = root.left
if child.bf == 1:
root.left = child.right
child.right = root
root.bf = 0
root = child
else:
grand_child = child.right
child.right = grand_child.left
grand_child.left = child
root.lef... | 1 |
95c7234208bc72b91ee942c342559b1a | 89c2995d533169d932c224eed0bf425a | Return the newY value of this motion. | public class WindowMoveEvent extends GwtEvent<WindowMoveHandler>
public int getNewY() {
return newY;
} | 1 |
e486be04c087825082ae7ebe3e495816 | e6601309a872e5d3dd048cac296a073c | Takes serialized directionResult object string as input.
Returns directionResult object. | parsed_content = forwarded_string.split(" ", 1)
parsed_content_cmd = parsed_content[0]
parsed_content_parameters = parsed_content[1]
parsed_content_parameters = parsed_content_parameters.replace(" ", "")
parsed_parameter_content = parsed_content_parameters.split(",")
if len(parsed_parameter_content) != 3 or ... | 1 |
91b6667784b30aac5eea588c6f1010fb | e20c6b1e0b5d5cc6c02771b93720ddac | 检测附加祝福值奖励 | local iconId = 301104
local number = 0
if table.nums(self._mail.att) == 0 then
return
end
if self._mail.tId == 2 then
local viplevel = self._modelMgr:getModel("VipModel"):getData().level
if viplevel >= 13 then
local desLab1 = self:getUI("bg.scrollView.append.desLa... | 0 |
b3ba34f6821ccf866b9dfb695a10e98a | fdc1a6ee94f33df22756f53af0cda872 | 传一组元素,默认点击第一个 | public class TestScript extends AutoAllInOneTestCase{
public void clickByTexts(String... texts) throws AutoException {
for (String text : texts) {
this.findElement(By.byText(text)).click();
this.sleep(500);
}
} | 0 |
5c97231d6cd6483c40bf15ecb916d009 | 64af3c0368163087fc1a878ca3d126c6 | Returns the number of files in the object | public class FileObjectWrapperCollection
public int getFileCount() {
return files.size();
} | 1 |
41e0ce6bed4e8336dbf39bb98ed7c9a1 | 025629741484a8013d3ef70b8a88678e | Генерация токена доступа с большим временем жизни для постоянного взаимодействия с api | def get_access_token():
payload = dict(
exp=datetime.utcnow() + app.config['ACCESS_TOKEN_LIFE_TIME'],
groups=['access_token'],
)
return _create_token(payload=payload) | 1 |
1e738519453897642b4d84541697a29d | b8ac21fbae39e43ba355a89d244ce33a | @brief Get Steps per Degree. | int32_t lsm6dsm_pedo_debounce_steps_get(lsm6dsm_ctx_t *ctx, uint8_t *val)
{
lsm6dsm_reg_t reg;
int32_t mm_error;
lsm6dsm_mem_bank_set(ctx, LSM6DSM_BANK_A);
mm_error = lsm6dsm_read_reg(ctx, LSM6DSM_PEDO_DEB_REG, ®.byte, 1);
*val = reg.pedo_deb_reg.deb_step;
lsm6dsm_mem_bank_set(ctx, LSM6DSM_USER_BANK);
... | 0 |
72d810b9e5f57554c2adcc56dcba0bdd | 6d5f6928c6bf521874f7cd8c3fa9939d | graph -> bool : determine si le graphe est connexe | lstmp = [0 * self.nombre_sommets() for _ in range(self.nombre_sommets())]
for lst in self._matrice_adjacence :
for i in range(len(lst)) :
if lst[i] != 0 :
lstmp[i] = 1
return lstmp == [1 * 1 for _ in range(self.nombre_sommets())] | 0 |
9104d1c9ee118cca8c94d522681da3a0 | 33b3800988579ed9c6509628da5551eb | Get info about current scoped variable with given name. | String getVariable(Long iid, Long scopeId, String varName) throws ManagementException; | 1 |
8e9c14fe400f5ca9ad5b3167eea75302 | 9d6f5faa7d127f378d723c67b8d30a4a | Convert 3-vector in axis-angle representation to unit quaternion | {
if (axis_out && angle_degrees_out && q)
{
if (q[3] >= -1 && q[3] <= 1)
{
a3real3 tmp;
a3real3Set(tmp, q[0], q[1], q[2]);
a3real3Normalize(tmp);
*angle_degrees_out = a3acosd(q[3]) * a3realTwo;
axis_out = tmp;
}
else
{
*angle_degrees_out = a3realZero;
a3real3Set(axis_out, a3realZero, a3... | 0 |
30524cc1d76977327a029dd4d4fb1e8d | 657312a985c7904fa6cfd208d5e94e2f | Choose the best strategy state depending on the state of the game | {
auto square = INVALID_SQUARE;
auto iter = _strategy.find(state);
if (iter != _strategy.end())
{
std::vector<int> best_moves;
double action_max_value = 0;
for (auto action_value : iter->second)
{
if (action_value->value > action_max_value)
{
best_moves.clear();
best_moves.push_ba... | 1 |
cdf7b67b400b62b57b2b6b3acc40ce24 | da9e2f4cf6797aa2b1169f995cc84b56 | Parses either a JSX element, JSX Fragment or JSX self close element | function parseJSXOpeningFragmentOrSelfCloseElement(
parser: ParserState,
context: Context,
inJSXChild: 0 | 1,
start: number,
line: number,
column: number
): ESTree.JSXOpeningElement {
if ((parser.token & Token.IsIdentifier) !== Token.IsIdentifier && (parser.token & Token.Keyword) !== Token.Keyword)
re... | 1 |
b1a5bfccae93ccf2be05405fdc2653eb | deb7dc0b9fcb80a2d4b17196afe42467 | Generates a random phone number in the format of: (###) ###-#### | def random_phone_prefix():
operator = random.choice([1, 2, 3])
if operator == 1:
number_segment = random.choice([133, 149, 153, 173, 174, 177, 180, 181, 189, 199])
elif operator == 2:
number_segment = random.choice([130, 131, 132, 145, 146, 155, 156, 166, 171, 175... | 0 |
52935954da7694bd1e541307a6419511 | fe46e1454b26b63f898b8f0782ced147 | SkipShortDB skips tb during -short runs, and notes the DB dependency. | if testing.Short() {
t.Skip("skipping test in short mode")
}
const (
instances = 30
iterations = 30
)
path := tempfile()
defer os.RemoveAll(path)
var wg sync.WaitGroup
errCh := make(chan error, iterations*instances)
for iteration := 0; iteration < iterations; iteration++ {
for instance := 0; instance ... | 1 |
2835f3bbb4288df560afb77f83dbb20b | 262dc753664de0d7b93723095b9869f2 | 获取输出列表中的输出obj个数 | def dig_output_size():
global pvt
if "Dig_output" in pvt:
return len(pvt["Dig_output"]) | 1 |
c79991cf90ab777a36befb6626fad07d | 42181e23ab019646c0d9103826a44d0a | 结束指定的activity(class方式) | public class ExitUtil
public void finishActivity(Class<?> cls) {
for (Activity activity : activityList) {
if (activity.getClass().equals(cls)) {
finishActivity(activity);
}
}
} | 1 |
8791350b7840418d898b6d6242d114d9 | 9acfd9315a580e71cd2cedd1694795f4 | Turn towards a point | void RobotClass::pointTo() {
} | 1 |
5a494018b6c3d1a3c421ed80a48dd0bd | 84cf6d01191d0f923f1de28b203fd1e3 | If a file has a sample exception that has made it to the driver, this file is done,
mark it as ingested and save the state | log.debug("last state callback result %s", self.state_callback_result[-1])
last_state = self.state_callback_result[-1]
if filename in last_state and last_state[filename]['ingested']:
self.fail("File %s was ingested when we expected it not to be" % filename) | 0 |
e71e44fee475762cc1854fc39572d405 | 2d88e6d31138941d3de6e84cc588293c | Checks the whether current user can create duplicate component | panel = new CreateComponentGeneratorPanel();
DialogDescriptor dd = new DialogDescriptor(panel, "Create component...", true, DialogDescriptor.OK_CANCEL_OPTION, DialogDescriptor.OK_OPTION, null);
panel.setDialogDescriptor(dd);
Object result = DialogDisplayer.getDefault().notify(dd);
if (result != NotifyDescript... | 0 |
6829d834e07c82f1355fd2392d4aceb1 | ea1e80c7a18966962b31859b5344c106 | Get rid of substrings with patterns specified by the regular expressions. | m_list_erased=[]
if isinstance(m_object, str):
pass
if isinstance(m_object, list):
m_pattern=re.compile(m_expression)
for m_line in m_object:
m_list_erased.append(m_pattern.sub('',m_line))
return m_list_erased | 1 |
ab937b3b68ffc797190c69989f3c7e53 | bb6e08e89b1408ab637ef74e4c19e5d1 | Requires the given argument to be zero or higher. | public static partial class Requires
[DebuggerStepThrough]
public static void NonNegative(double value, [CallerArgumentExpression("value")] string? paramName = null)
{
NonNegative<double>(value, paramName);
} | 1 |
4bb2eb0a44fc0190a23a6d32558e6fdc | 5bae852b76b8105e679bce2cac2e8aa9 | 大カテゴリが選択されたら既存の中カテグループと中カテはクリアする | if(this.select_category_ids[0] == true){
this.select_category_ids[0] = false;
this.select_category_ids_preporty[1] = false;
this.select_category_ids_preporty[2] = false;
this.productDefault['result']['categoryList'].forEach((val, idx, array) => {
t... | 1 |
df1a5fbed3de627d852b2e337a7ac0f4 | 0d7eb0ec3401b419c9523c891ce3fd51 | 1秒的时候, 我们杀死cmd | func main() {
begin:
cmd := exec.Command("./print/print")
cmd.Stdout = os.Stdout
err := cmd.Start()
if err != nil {
log.Println(errors.WithStack(err))
return
}
cur := time.Now()
fmt.Println("==========================start success======================")
for {
if time.Now().Sub(cur) > time.Second*5 {
l... | 0 |
8ac6a507c2802549a41f52316911f51f | 39ae731522bc186199062ce34cd09606 | The getter for finished processes. | class Queue
public function getFinished()
{
return $this->finishedJobs;
} | 1 |
317ba9aeba740bc5417132b5cc668967 | f26ac630db80a1e6ba353c92ececa7fa | Accessor for the virtual 'binary_version_ids' attribute. | class DefectsDBIDsNamesMixin(object):
def virtual_defect_ids(self):
if self._virtual_defect_ids is None: self._populate_virtual_defect_ids()
return self._virtual_defect_ids | 0 |
bb2dab2cdfb2d0f1f77ffb00a09a46bb | 6513120cda2468fe10125fd261a6561f | Finds the first instance of a given value | long int &comparisons)
{
int count = 0;
comparisons = 0;
do{
if(array[count] == value){
return count;
}
count++;
comparisons++;
}while(count < ARRAY_SIZE);
return -1;
} | 1 |
752765c00722c7abfd3bdc842b6b46e3 | 66ae2e42535c7afe50ab34763ddcf3a5 | sayHello | JNIEXPORT void JNICALL Java_HelloJNI_sayHello(JNIEnv *env, jobject thisObj) {
cout << "Hello World from C++!" << endl;
cout << "THIS IS TODAY" << endl;
return;
} | 1 |
c5d83b1a5173bbf99d4b22e178415b22 | 5181ca134dcfb8b434207408d7c42b5a | Generate provider template from its stub | {
$module = Modules::findOrFail($this->getModuleName());
return (new Stub('/route-provider.stub', [
'NAMESPACE' => $this->getClassNamespace($module),
'CLASS' => $this->getClass(),
'LOWER_NAME' => $module->getLowerName(),
'MODULE... | 1 |
0249774147c5676538ff822a7f16e690 | 5f10ee6e17c88eab4e1b4635f2994324 | ************************生成6+1球号码********************* | var ziXuanCode = "";
var LotteryNumber = "";
var ball1;
var temp = "";
for (var j = 0; j < 12; j++) {
var obj = GetBallObjectZ2ZhiF(1, j);
if (GetBallStateZ2ZhiF(obj)) temp += parseInt(obj.innerHTML.trim(), 10) + ",";
}
temp = temp.trim();
ball1 = temp.lastIndexOf(",");
temp = temp.substring(0, ball1);
Lo... | 0 |
7675cdcf03367e95c1cccea373bd3679 | 94c3d980c24118a0d5eeb31df99e4f0a | Gets the last marked location that can be used for "Back" or "Cancel" buttons
from subsequent pages. | class RedactedPage
def confirm_complete
@browser.dl(:class, 'final').wait_until_present
@browser.dl(:class, 'final').dd.a.href
end | 0 |
2f4c63115f5b83fc55601d45f33d3660 | 7f61448ad6da3ef0f9cb03f40c5be655 | 如果是测试版 | cases like (1) | 0 |
a25dac2b829b9fd1a509f2ebc6d26268 | 12842b405a760a66604e1d663d744ee3 | 根据CSS中不同的字体名返回不同的字体实例 | {
return gCache.FirstOrDefault(f => f != null && string.Equals(f.FontName, fontName));
} | 1 |
c95b34a3d094a3ace88e23705a5e08d7 | 870a84d1547242e87c760ec6092e30c9 | Return the function used to compare scores. | class SsdModelInferencer(detection_model.DetectionModel):
def score_converter_fn(self):
return self._score_converter_fn | 1 |
bb69d476a4dc609d2ce1c7c2c3c9ea6b | ddaed972f59d37b421f6a7080f63b70b | Mark history report as invalid | export class Solver
public async report(id: string): Promise<void> {
const payload = {
id: id,
action: "reportbad",
...this.defaultPayload
}
const response = await fetch(this.res + utils.objectToURI(payload))
const result = await response.text()
... | 1 |
397faf1890a2a802914dd7db35eef41f | 9b85af12c2ec68b153cbed32f1d023aa | Initialize the NetWM module | _eventManager.registerModuleListeners(self._get_listeners())
screen = Wnck.Screen.get_default()
if screen:
i = screen.connect("window-stacking-changed", self._on_stacking_changed)
self._handlerIds[i] = screen | 0 |
a8d898f8bf008d29b414341cc2fe545d | a450cfc74122dde1062bfee32a2a4e97 | Does not clone the function, but just returns the same function
again. | function replicate(x)
return new(x, function()
return replicate(x)
end)
end | 0 |
c64589ad23d8be164ff697ab6f0065ac | 9bfe295bd27c7e4beba7df4484dfc041 | Calcule l’anomalie vraie et le rayon vecteur des comètes périodiques rapportés à l’équinoxe J2000 à partir de l’anomalie moyenne
des comètes, ainsi que de l’excentricité et du périhélie des orbites des comètes. | super().__init__( jad )
d= self.d
self.N = (125.1228 - 0.0529538083*d) % 360
self.i = 5.1454
self.w = (318.0634 + 0.1643573223*d) % 360
self.a = 60.2666
self.e = 0.054900
self.M = (115.3654 + 13.0649929509*d) % 360
self.related()
E_0=self.... | 1 |
d8f798ee159d248f5422c5bc5bb61c34 | 8718bbf6ca012e42f828d89d0eee5183 | 判断参数配置表中的参数属性值(日期)
若存在,返回参数属性值
若不存在,返回null | try {
return getDateFromMapNotNull(map, fieldName,pattern);
}catch (ParamIllegalException e){
return defaultValue;
}
} | 0 |
0895254fa7d84fe18d69bdd3ac72650e | 1f6a3188348f52d88365b005d93a5459 | Builds and returns proper suffix for file based on height and width. | {
Filename imageFilename = new Filename(filename);
return imageFilename.BaseName + "-w" + size.ToString() + imageFilename.Extension;
} | 0 |
42d286dc22876e15fd4146e52fcc96a5 | 1e61dccec19d1e0a28265370daad4dde | 将网络图片下载到服务器 | @GET
Observable<ResponseBody> downloadPicFromNet(@Url String fileUrl); | 0 |
c0a1d894a4b912085e2eff5d951af77e | bdd3ef66c70fbf2b2346a0dbcb992433 | Sets the rotation y factor. The factors are used to determine how many
radians to rotate the view for each pixel of mouse movement. The view is
rotated factor * 0.01 radians for each pixel of mouse movement. The default
factor is 1.0. | if (0 < argZoom) {
this.zoomYFactor = argZoom;
}
} | 0 |
c2f7713309637372a98cd344f8481c5d | 8ca58ac255a9b78e8bef725ad0d7db81 | Parses the decibel values from a headphone measurement PDF. | if isinstance(fname, str):
with open(fname, 'r') as f:
text = f.read()
else:
text = fname.read()
return re.findall(r'[0-9]+(?:\.[0-9]+){3}', text) | 0 |
913471859aca03eb8270269e116573ce | 49d6089df7d9abe22106ca343079a82f | 将图片文件名解析,并生成文件原有的路径和文件名 | filepath, tmpfilename = os.path.split(file_url)
shotname, extension = os.path.splitext(tmpfilename)
return filepath, shotname, extension | 1 |
7fe69204f898beda2059fdca9f3ba63d | 8470b8d0c31448677396a0d3cae96b84 | renders all the hidden fields. | namespace RSToolKit.WebUI.Infrastructure.Register
HtmlString RenderHiddens(); | 1 |
1d247b351927dc692cd459a211991d9a | 2c7e1040394c9769263ba9a2300255c0 | 全局成就读取最新获得的版本号和数目 | local label = ""
if type == QAchieveUtils.TYPE_HERO then
label = "魂师"
elseif type == QAchieveUtils.TYPE_INSTANCE then
label = "副本"
elseif type == QAchieveUtils.TYPE_ARENA then
label = "斗魂场"
elseif type == QAchieveUtils.TYPE_USER then
label = "其他"
end
local completeNum = 0
local totalNum = 0
for _,achie... | 0 |
a155fa5190a9efea2d2072f526517e6f | e1405dc3455b6bcde327d2aff7525af3 | 给定top出来的结果,指定pid,提取相关的进程 | {
process *scan = process_root, *result = NULL;
while( scan)
{
if( scan->pid != pid)
{
scan = scan->next;
continue;
}
result = scan;
break;
}
return( result);
} | 1 |
0447b5ca487f3a76e7253c4c074cbddb | 3c848e834787ce83fcec008508770da0 | Processes requests in the channel concurrently | for {
select {
case req := <-reqChan:
go run(op, req)
case <-quit:
return
}
}
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.