query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
029f8396db1b66ffb10ab6864f70e169 | 3d211a086444d67c7d803eee03a81f4f | 原子减指定的整数,如果没有就默认创建0 | class Cache{
public function decrement($key, $num=1){
if (!is_int($num)){
throw new WrongParamException("decrement number must be a integer, [{$num}] given");
}
$res = $this->_adapter->decrement($key, $num);
if ($res && isset($this->_cache[$key]) && is_numeric($this->_cache[$... | 0 |
a1f4cf2efd7f2d11b13bb4ea1252765e | 81543acad733a172b691612397c70ee9 | @brief CylinderFaceAttribute析构函数 | namespace M3D
EllipseAttribute::~ EllipseAttribute()
{
} | 0 |
2487f0e0adc4e77deecf9afadbf5ac27 | b4a5468a848d295b4bbf17939ed2d5b2 | Initializes Character Damage to 0 | m_fAttackFront = m_fAttackRear = m_fAttackRight = m_fAttackLeft = 0;
m_fAttackFrontDamage = m_fAttackRearDamage = m_fAttackRightDamage = m_fAttackLeftDamage = 0;
cumulativeFade = 0;
fAttackFrontMem = 0;
fAttackRearMem = 0;
fAttackRightMem = 0;
fAttackLeftMem = 0;
} | 1 |
2efed65d615777112ce7548d1dc337ea | 49eed09cfb53f42a02a8de2f8d904d9e | 获得所选择行的某一列的值 | function getVal(obj, selector) {
var theRow = $(obj).parent("tr");
return theRow.children(selector).text();
} | 1 |
3e63c1e9bb166cf2924497d1558da39e | e529739c7ada6aaaca1e888869483f4f | Convert the UNICODE string into an ASCII string. | VOID
AsciiToUnicode (
IN CHAR8 *AsciiString,
IN CHAR16 *UnicodeString
)
{
UINT8 Index;
Index = 0;
while (AsciiString[Index] != 0) {
UnicodeString[Index] = (CHAR16) AsciiString[Index];
Index++;
}
UnicodeString[Index] = 0;
} | 0 |
a3edd961e1a58cd30fe534833dd6d9b5 | 9c1faaf880916bfa6d36df46b7a43350 | 根据得分获取一条对当前得分的评语 | function getStringByScore(score) {
switch (score) {
case 1:
return '失望';
case 2:
return '不满';
case 3:
return '一般';
case 4:
return '满意';
case 5:
return '推荐';
default:
return '';
}
} | 1 |
4bc48f04b7f544b2a4d06706f0c8c704 | 86156fc015ee4fd21eae9356f5c869b4 | Gravity in the world coordinate system | @SuppressWarnings("serial")
public class World2D extends JPanel
public double getGravitation() {
return gravitation;
} | 1 |
b173f7010d494d4ac4bf562ba9874a94 | b990d785d39c626cbf984b6fb1cbf358 | The reference of the RouteFilter resource. | class GetLocalRouterFilterConditionArgs:
def name(self) -> str:
return pulumi.get(self, "name") | 0 |
fab52ef0337e6fa64c2ec25042f53bb6 | 3e0ede9bd09dfc17df8b3c6947d081c2 | Fonction pour afficher les agences qui sont dans la base | class AgentsController extends Controller
public function index(Request $request)
{
$agents = Agents::orderBy('id','DESC')->where('statut',0)->paginate(10);
return view('agents.index',compact('agents'))->with('i', ($request->input('page', 1) - 1) * 10);
} | 0 |
49ec909cbff5d64592519753c41881de | ed9410fea0e09d4d9e0ee42d7249c724 | Calcula a potencia atravez da recursividade | public class Conversao
public int potencia(int numero, int nrpotencia){
int resultado=1;
for(int i=nrpotencia; i>=1; i--){
resultado*=numero;
}
return resultado;
} | 0 |
ce8d7b8bac72d06e2e812164df7fe504 | ccf03bad32b2a4baaec5bd0d523786ae | Route the pointer released event to the gesture recognizer.
The points are in the reference frame of the canvas that contains the rectangle element. | class ElementProxyReceiver extends EventDispatcher
releasePointerCapture(data) {
} | 0 |
5073a6033747bb62f797f8509c38f523 | d366f8cbe7a25c8697ac25e0ca2e2649 | Get tracking by Invoice Number | class MpesaController extends Controller
protected function getInvoice($invoiceNumber)
{
return Booking::where('booking_id', $invoiceNumber)->first();
} | 1 |
738b1d5c9fdffb919af81d3ba32f9dd4 | f7bede678a9449859d022dcd8524d6b0 | Ritar upp figurerna i listan i fönstret w | for(int i = 0; i < array.size(); i++){
Figura f = (Figura) array.get(i);
f.draw(g);
}
} | 1 |
839fc7912b12cb43717c986ab3cceabd | 37bdc2955981e49b14d0ff82e93274e3 | Функция показа страницы авторизации | class AuthController extends Controller
public function signinPage( Request $request )
{
if( Session::has("auth") )
{
Router::redirectNow("/");
}
return View::main( ["tpl" => "signinPage"], [ "title" => "Authorization" ]);
} | 1 |
a8fb41ecf4c6c33e042cd69e8247cea9 | 3c5a72dadeecfb8c48b6677b67baa219 | Loop until we get to the first 'data begin' marker in the file. | class RawParser :
def JumpToDataStart (self):
size = struct.unpack ('i', self.fbuf.read(4))
self.fbuf.seek (size[0],0)
return | 0 |
124118683efc963ed797c20e68cbe6d1 | bc97201c4d7e25872bc452982bd0caeb | Merge .env data
(we don't want to go through the .env to json conversion)
Note that comments will not be preserved. | public class EnvironmentWriter implements IEnvironmentWriter
@Override
public void merge(InputStream stream) throws IOException {
EnvironmentUtil.merge(this.env, stream);
} | 1 |
25e703d9d3e31a8d35c6995df133a654 | ab7768a890cde68c6c1351d480d24e26 | Checks that context names does not contain dots. | def is_root(name, names):
dots = name.split(".")
return not (len(dots) > 1 and dots[0] in names) | 0 |
0fe14095ab491d4e792204fa32ecad05 | 80a8d7a4dbdfa2db0b15e6a52cb33268 | Basic constructor, set options | parent::__construct();
$this->getOptions = array_merge($this->getOptions, [
'valuemapids' => null,
'editable' => null,
'selectMappings' => null,
'sortfield' => '',
'sortorder' => ''
]);
} | 1 |
3cdecd435a81b68ec995d53475c87aa8 | ac2ee8f35e3f2923073b4b7342245438 | Modifies an axis intensity by reference. The idea being that an ANN should not be able
to jump from one side of the wheel to the other to keep a human behavior.
This is done naturally with a keyboard or joystick, so this function enforces
this gradual change of value. I checked with a script to make sure this rate
is s... | if (this._intensity != value){
this._intensity = value;
this._change = false;
}
} | 0 |
9ff96d8314a21533856064380f2ba979 | 4fba19c63f01dd00115eb913b17147b5 | Decorator that turns off signal handlers when loading fixture data.
Taken from the Django documentation:
https://docs.djangoproject.com/en/dev/ref/django-admin/
#loaddata-fixture-fixture | def perform_test(self, *args, **kwargs):
with warnings.catch_warnings():
warnings.simplefilter("ignore")
test(self, *args, **kwargs)
return perform_test | 0 |
f25de2e1410a9b078a1be2c0f17e749b | 84d1a9d55ed7a3ee611ff3182e72937c | Factory a new access point configuration with an auto-generated
identifier. The identifier is generated using
{@link java.util.UUID#randomUUID()} | @JsonbTypeAdapter(ElementConfigIdAdapter.class)
public class ElementConfigId extends Scalar<String>{
public static ElementConfigId randomConfigId() {
return valueOf(UUID.randomUUID().toString());
} | 1 |
67edca9b6391b4b0fbf6025311658f9e | c3b49b037a81e724d4d4466286712669 | 初始化飞机配置集合 | public class PlaneModuleTest{
@BeforeClass
public static void init(){
PlaneTempletCfg.init();
PlaneQurlityTempletCfg.init();
} | 1 |
5c1b490b0c3e5d3021e806069b3806d3 | 874e50c3e9ec6f61fe683efd19620da5 | Insert the command into the database for later processing. Returns the
jobID which can be used for checking the status of the job. | logger.debug("addJobRecord() started.");
Integer newJobId = this.databaseService.getNextId();
Map<String, Object> paramMap = new HashMap<>();
paramMap.put("id", newJobId);
paramMap.put("state", JOB_STATE_WORK_IN_PROGRESS);
paramMap.put("submitter_username", aJobSubmitterN... | 1 |
f49463fa329cc68ba5544d23269a46c3 | efa532aba691ace978ff0d0cd26392a9 | Create PDO instance and schema to test against | class Base extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$schema_sql = file_get_contents(TEST_SCHEMA_SQL);
\Illuminate\Database\Capsule\Manager::connection()->getPdo()->exec($schema_sql);
} | 1 |
4df31a961b432318c85ef716dd57fdcb | b7ae6be4b90c90f3d25269c32fc92476 | GET: continentes | {
$continents = Continent::where('user_id', '=', Auth::user()->id)->orderBy('name')->paginate(8);
return view('continents.index')->with('continents', $continents);
} | 1 |
bd9358b5404b636d45f33ae1155d9dbb | d91211efa3173b518b24b047775f50ab | Read an RGBA colour as 4 bytes | c = self.read16(_CDATAL)
r = self.read16(_RDATAL)
g = self.read16(_GDATAL)
b = self.read16(_BDATAL)
return (c, r, g, b) | 0 |
23406dd297462b377917707292db1fdc | 3ce1c7630cb71af650a875c38fc9a57b | if ?signup=true in query, start with signup view | class UserController extends \BaseController
public function getSignup() {
if (!Auth::check()) {
return View::make('user_signup');
}
return Redirect::route('/');
} | 0 |
06fddaa7eb20c772bb14ed750e525039 | 1d7b15f5137af477add675701f1fa248 | Determines whether a room is in the management list by looking for its name. | public class CardProperties
public static boolean isRoom(String target) {
return isIn(target, rooms);
} | 1 |
0441e32c861703d7614d2abdbeb2218e | ec672c67ac389556bfd69e4e1fcf18df | Change the date of an event | class core_calendar_rrule_manager_testcase extends advanced_testcase
protected function change_event_startdate($datestr, $timezonestr = null) {
if ($timezonestr === null) {
$newdatetime = DateTime::createFromFormat('Ymd\THis', $datestr);
} else {
$timezone = new DateTimeZone($tim... | 1 |
200787aa2f71705f2dd1f5a53d646efb | 1065d99912aa617a05bcc67947861de9 | Returns controllers namespace based on version from request. | class ISourceAssetVersion(IVersion):
def get_controller(request): | 0 |
2950a6847dee410bcfaac2bf2bf95da5 | d052e8352d1679995e384600352a6076 | Obtiene el nombre completo del usuario | class User extends Authenticatable
public function getNombreCompletoOUsername()
{
return $this->getNombre() ?: $this->username;
} | 0 |
d4ae279ba19cc7a05581ea2ee8db4da4 | 755694a0b0118de5d8c528c29c8c6938 | 添加一个新闻分类,跳转到添加页面 | @Controller("adminNewsController")
@RequestMapping("/admin")
public class NewsController extends BaseAdminController
@RequestMapping(value = "/newsSortAdd", method = RequestMethod.GET)
public ModelAndView addNewstSort(HttpServletRequest request)
{
ModelAndView mv = new ModelAndView("admin/newsSortAdd");
Map<Strin... | 1 |
fae4cbae439edae380cdbb89c5530b94 | 43d12cd12bbba7346fb3687f8d71b9b8 | <p>Überprüft, ob eine Regel (Rollen/Resourcen-Kombination) bereits geladen wurde.</p> | boolean hasRule(String name); | 1 |
a396ff5da14b0a633d2ac7548fc0b943 | 3e0c27fa10e904348a19acad270f2cad | 進行插旗 | export class MainView extends eui.Component
private playFlagAction(): void {
if (this.mMcFlag) {
this.mMcFlag.play(-1);
} else {
this.mMcFlag = MovieClipComponent.produce("mc_flag");
this.kGrpFlag.addChildAt(this.mMcFlag, 0);
this.m... | 1 |
8a0a1fbd51d35141ab1f8aaf7e03db47 | b47b90f8b60324afce76c0d18d540f19 | 查询提交给我的修改报告申请 | @Controller
@RequestMapping("lawAdjustReportCtrl")
public class LawAdjustReportController
@ResponseBody
@RequestMapping("submitReport")
public TeeJson submitReport(LawAdjustReportModel lawAdjustReportModel, HttpServletRequest request){
TeeJson json = new TeeJson();
try {
String submitIds = lawAdjustReportModel... | 0 |
e08763c34941cfde33fa0fdfbe3bff6a | dbe55a5376403a994586b1aabf393482 | Returns the minimum offset between the generated leaves for a given level of detail. | int getMinOffset(); | 1 |
97aef96c017570ad0263c855e28a9dd6 | e64f076a285ba8061868f7b49711c552 | @brief This function handles DMA stream for Service RX UART | void DMA2_Stream1_IRQHandler(void) {
HAL_DMA_IRQHandler(UartHandle.hdmarx);
} | 1 |
bff6ee1669730e38a81404030e839d79 | 6fd6bd899ff6e9c339652bca2d2c21e0 | move the tetromino to right, check for edge and blockages | {
undraw()
const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)
if(!isAtRightEdge)
currentPosition +=1
if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))
currentPosition -= 1
... | 1 |
69b2d1070a2ffd6a98aa115039a1b5f1 | 88f211f27c9b9d12aa7c7313cc7fd4c7 | Set the speed range of the particle
If one of the values is negative it will be automatically set to 0 | class ParticleSystem private constructor(parentView: ViewGroup, private val mMaxParticles: Int, private val mTimeToLive: Long)
fun setScaleRange(minScale: Float, maxScale: Float): ParticleSystem {
mInitializers.add(ScaleInitializer(minScale, maxScale))
return this
} | 0 |
51ea581ed82d36cf1e85735f9eb9b97a | bed02760b5dab24f1dc1fc362a75c5f5 | # optional function that displays the data and the best fit line per specified interval
# Note: temp plots like these can only be illustrated if there is only one feature per one label. | x = result[,1]
y = result[,2]
plot(x, y, col = "blue", xlab="Measured binding affinity", ylab=paste("Predicted binding affinity"))
prline = lm(y ~ x)
abline(prline)
new.x = data.frame( x = seq(from = range(x)[1]-2, to = range(x)[2]+2) )
lines(x = new.x$x, y = predict( prline, new.x, interval = "pre... | 1 |
1f29cd0e9e0279014fd514363435978a | 63867885c6b19e7404d6f5b803942899 | Sampling from a normal distribution. | class NormalRandom(object):
def _sample(self, shape, dtype):
return tf.random_normal(
shape=shape, mean=self.mean,
stddev=self.std, dtype=dtype, seed=self.seed) | 1 |
a096a8383fe90a168d258aeb48daaf57 | 5d7b56adeb36346d7f60393a6b182ec9 | CAN transmit error count. | {
uint8_t errCounterValue;
uint32_t saved_cs_state;
if (!(channel < CAN_CHANNELS_MAX))
{
ErrCodesSetError(ER_CODE_CAN_INVALID_CHANNEL, ER_PARAM_SEVERITY_CRITICAL, TRUE);
}
if (!( (counter == CAN_ERR_COUNT_RECEPTION) || (counter == CAN_ERR_COUNT_TRANSMISSION) ))
{
ErrCodesSetError(ER_CODE_CAN_INVA... | 1 |
9773b2d73bad862ba7778ba5515e1994 | fe114508924442fc1d95f81b3aa72ce3 | This pair returns an array of strings that contains the data types for the inputs. | public abstract class AbstractFunction
public abstract String[] getParameterDataTypeNames(); | 1 |
7bec36cecb8a127fb98861a737f64dae | 95fcd8cb760b0d7a80c90079fc70c134 | Parse built years from XML | years = []
for date in self.dates:
d = dict(zip(self.date_header, date.split(',')))
if d['year'] == '':
continue
years.append(d['year'])
return list(set(years)) | 0 |
a1bb1a7450cbbd2ea48644429fb9146b | d764d134c4cd5cab5c8d8ebc04b099ca | Strips the package name from a fully qualified class name. | def simple_name(class_name: str) -> str:
return to_packages(class_name, include_class=True, is_internal=True)[-1] | 1 |
e91d6940b3c07ac6a75fe65582214415 | b41b912c054621c6566e3fbed3c55b48 | Opens the outputfile.asm and gets ready to write into it. | {
if (strlen(gpGlobals->sOutFileName) == 0)
{
char* pExt;
strcpy(gpGlobals->sOutFileName, gpGlobals->sInFileName);
pExt= strrchr(gpGlobals->sOutFileName, '.');
strcpy(pExt,".aaf");
}
if (gpGlobals->bDeleteOutput)
{
HRESULT rc = deleteFile(gpGlobals->sOutFileName);
gpGlobals->pLogger->Log(kLogWarn,
... | 0 |
97f9a0e5fb8a2f7ea504ed2969cdb103 | 2ebc5f2dacf2e49c01afacd7841a0ef1 | Gets the total request asynchronous. | Class Config
public function getTotalRequest()
{
return $this->totalRequest;
} | 0 |
818881abf2209dca3a728f9462097f52 | 1a0ed53b720d48a35435bb4a613bb1b6 | Retorna EntityManager do Doctrine | class BaseController extends Controller
protected function getEntityManager()
{
return $this->getDoctrine()->getManager();
} | 1 |
75d0c2a52de8c8d4a527ead4a326fe32 | f7c91da62141ec36c5dc30fdc8704696 | This method returns all the puzzles for the classic sudoku version. | public abstract class BaseGameActivity extends BaseActivity
public Rational[] getNewPuzzle() {
return generator.generatePuzzle();
} | 0 |
14f60280e7ce82ad74ce1ba252d7ae3c | 6f773c995c942b163faafe2172cfb0d7 | Suggestion de livres par Google | q = request.args.get('q')
precision = 'y'
query = {
"sort" : [],
"size" : 75,
"suggest" : {
"text" : q,
"simple_phrase" : {
"phrase" : {
"field" : "author_title.shingles",
"size" : 2,
... | 0 |
e6ea71cb25aab9828fefae6f46e06fa8 | b8ea8ec2ce6d4fcf1ee06772d72240e2 | 创建一个子弹,并将其加入编组 | class Weapon extends egret.Sprite{
private createBullet():void{
var bullet:egret.Bitmap = new egret.Bitmap(this.texture);
this.setBulletPos(bullet);
this.bullets.push(bullet);
this.bulletsContain.addChild(bullet);
console.log("create");
} | 1 |
7b136d3b55f3abeba0e412994fa8489c | 1232a9e2c2d9ca6bea5399aa83f08441 | 接收ManagerCenter中的任务数据, 并对其数据进行处理, 然后在返回给ManagerCenter | @Slf4j
public abstract class AbstractBaseDataflowJob<T> implements DataflowJob<T>
protected abstract void processJobData(List<T> taskList); | 1 |
19dff8391ddefe184db7a728c93ef257 | fb83a2af1606e56e6d647c6e153617da | Get a specific credential from the specified Client. | public class WebAuthn(
private val client: CDPClient
) : Domain
@ExperimentalCoroutinesApi
@ExperimentalSerializationApi
public suspend fun getCredential(authenticatorId: String, credentialId: String):
GetCredentialReturn {
val parameter = GetCredentialParameter(authenticatorId = authenticatorId, creden... | 1 |
da114cbeae35fec44a73ca8ecbad084b | 01be87894eb8c8288b5c8a78a9389283 | 获取舒张压(mmHg)(舒张压的测量值,计量单位为mmHg) | @Table(name = "OUTPATIENT_INFO")
public class OutpatientInfo
public void setSbp(String sbp) {
this.sbp = sbp == null ? null : sbp.trim();
} | 0 |
73daebf5611e4d5404e3cac89e7032d3 | 0bc34c0a67b02e2c0f02c62bb09f77da | 企业登陆,加密ID并跳转到系统选择页面。 | @Controller
@RequestMapping("/jspSkip")
public class JspSkipComtroller
@RequestMapping("/chooseEnterprise")
public String chooseEnterprise(){
return "login/chooseEnterprise";
} | 0 |
3b0f7344abd406ea807afe574ac56e00 | 88205592890f551ac0b66d397e61c8ab | salva la posizione dell'elemento selezionato nella lista | function selezionas(ele){
sto = document.getElementsByClassName("sto")
for(i=0; i<sto.length; i++){
console.log(sto[i])
if(sto[i].classList.contains("selezionato")){
sto[i].classList.toggle("selezionato")
costo = costo - Number(sto[i].getAttribute("costo"))
}
... | 0 |
2f7b042bac1a2556dd5edaf3d059ffc2 | aa74c51a699815b02be07808ebdbd393 | Hent mottakerens e-postadresse | public class MailSender{
public String getTo(){
return to;
} | 1 |
0af8fea1ef88e4c7ff9e288095210cfe | f9fa036cad34c1d9b6b24e65f2d30d84 | 转移订单 | class TransferDatabase{
public function TransferOrders()
{
$tables = array( 'tp_order','tp_order_goods' , 'tp_deliver_doc' ) ;
$this->clear( $tables ) ;
$db= new DbClass() ;
$sql = " insert into ".DIST_DB." .tp_order
( order_id , order_sn , user_id , order_status... | 1 |
9a774a79885395064ea4c3ca235a75a9 | c6c8847c6c83f131e9c3977f88ace32d | Return a new agenda containing appointments
that are overlaps between appointments in this agenda
and appointments in the other agenda.
Titles of appointments in the resulting agenda are
taken from this agenda, unless they are overridden with
the "desc" argument. | if not isinstance(overlap, ZoneBase):
raise TypeError("Expected overlap to be type ZoneBase.")
center_zone = ZoneFragment(self)
other_min = overlap.min_corner
other_max = overlap.max_corner + Pos([1]*len(other_min))
result = []
for axis in self.axis_order:
... | 0 |
f11a87678b3ef7df340f6376d37c3a28 | 6c41af786cfb916cbeb15581634e837c | Fonction : Compare 2 champs
Retour : True si égaux, false si différents
Exemple : Pour comparer une confirmation de password avec un password
'repassword' => array(
'message' => 'Le mot de passe et la confirmation du mot de passe doivent être identiques !',
'on' => 'create', // Limit validation to 'create' or 'updat... | class Validation
public static function validateMatch($fieldname, $input1, $input2) {
if ($input2 != $input1) {
Messages::create('error', "$fieldname confirmation doesn't match $fieldname.");
return false;
}
return true;
} | 1 |
a375419bda408c5bb4c5c65a7f1142f1 | 994354093acaeac0e94610744b864abd | 判断是否和矩形区域相交 | class ptRect(object):
def colliderect(self,Rect):
clr = self.clip(Rect)
return (clr.width != 0 and clr.height != 0) | 1 |
6ad8b1bde3f3867ca89cd095ad13faf3 | b3764dfcd03f8abf8a1066ee1572817e | Displays information about the currently selected <see cref="Spell"/>. | namespace Sulimn.Scenes.CharacterScenes
public class CastSpellScene : Control
private void DisplaySpell()
{
if (GameState.CurrentHero.CurrentSpell != null)
{
LblName.Text = GameState.CurrentHero.CurrentSpell.Name;
LblTypeAmount.Text = GameState.Current... | 1 |
f57b1a232b25d0edf51255ce87c872ec | 199f59bd55660a21ca18b4132e949558 | 加载扩展的运行器 | if (type == null) {
throw new IllegalArgumentException("Extension type == null");
}
if (!type.isInterface()) {
throw new IllegalArgumentException("spi only support interface ");
}
if (!withExtensionAnnotation(type)) {
throw new ExtendLoadExcept... | 1 |
174f9b249452f9cd295e6c0bb183b24a | ce7b59e7be35c2ee7a636584d2b6c9e2 | 是否含有标志清除的 | namespace ExermonDevManager.Core.CodeGen public class Block
public bool hasCancelFlag() {
return hasBlock<CancelFlag>();
} | 0 |
b2095f1382f68a6355a587f4c4419ca1 | b2c6d5ad5a80237f1a0c75c0e02775b2 | Makes all of the pieces on the board visible. | {
mouth.SetActive(true);
eyes.SetActive(true);
for (int i = 0; i < extras.Count; i++)
extras[i].SetActive(true);
for (int i = 0; i < pieces.Count; i++)
pieces[i].SetActive(true);
} | 1 |
a624f9fda10cb10df4a0901b6abb9298 | 4aa450921e024ca2bff6c7d6eeb52081 | Converts x close to zero to exact zero | {
if (x < 0.0)
{
CS2_ASSERT_MSG(x >= -EPS, "x=%.12f", x);
x = 0.0;
}
return x;
} | 1 |
5eea9db2d9ee3aa57d1a628149440532 | 0e95314555676319f5e739aa1c9b4d8f | Função para conveter segundos em horas | double Unidad::segundo2Horas(double sec){
return sec/(60*60);
} | 1 |
035696ee5c8af5ffeff394346ec8dc5f | 205e03c607f94657ec7d23ba63f75167 | Save Images from found super_img matches | number = 1
print u'find ', name, u'total ', len(images), u'pictures'
for image_url in images:
split_path = image_url.split('.')
ftail = split_path.pop()
if len(ftail) > 3:
ftail = "jpg"
file_name = name + "/" + str(number) + "." + f... | 1 |
26976a4d2363a1a47d2f2eaf790c4b8d | f3cc0f12e063d34b9b41ee034c7ceb66 | Получение информации о стандартных колодах | return {
Card("ACE","HEARTS"),
Card("TWO","HEARTS"),
Card("THREE","HEARTS"),
Card("FOUR","HEARTS"),
Card("FIVE","HEARTS"),
Card("SIX","HEARTS"),
Card("SEVEN","HEARTS"),
Card("EIGHT","HEARTS"),
Card("NINE","HEARTS"),
Card("TEN","HEARTS")... | 1 |
bde7def638895a03c3003ab32c7d5dee | 63e759eabc3d15ea4af342f855748ebc | Load topic id related to topic name | func LoadPredefTopicId(topicName string) (uint16, bool) {
return PredefinedTopics.LoadTopicId(topicName)
} | 1 |
018a1dfd6b611172ef836acb58714b80 | b996daaa7b95c6c869dddd1618d3cd3e | Get the info about ability to renew associated document. | public abstract class ProtocolDocumentBase extends ResearchDocumentBase implements Copyable, SessionDocument, KrmsRulesContext
public boolean isRenewal() {
return getProtocol().getProtocolNumber().contains(RENEWAL_KEY);
} | 1 |
5f8fb335a6f98e52f5e11fa9e1cdf76e | 4936b734a7eb1f4ad18a137fc3919e71 | 从阿里云获取指定RDS实例的慢查询日志 | public class RdsClient extends JdcloudClient
public DescribeSlowLogsResponse describeSlowLogs(DescribeSlowLogsRequest request) throws JdcloudSdkException {
return new DescribeSlowLogsExecutor().client(this).execute(request);
} | 0 |
d375d27b5e73508a8daf83675ce1ca86 | d6ab46dd4c7e8b6970caeeaa66c71737 | Gets the ammunition manager that provides the weapon with new ammo. | public class Equipment
public int getAmmo() {
return c.getEquipment().getID(EQUIPMENT_AMMO);
} | 0 |
670df5bce8864ef38620e8a9607eccdd | bdd683010d063b90a1060b4012102cf6 | Sets the byte alignment for portable executable file sections. | class ElfSection(object, TransformableMixin):
def set_align(self, addralign):
self._addralign = addralign | 1 |
57e7f5766e11d4678d5686b90ecea490 | 445cc6094213d665245fb21de6f440f3 | Makes the singleton method (class method) typed | if not cls._singleton:
cls._singleton = super(OneOnly, cls
).__new__(cls, *args, **kwargs)
return cls._singleton | 0 |
e1c407f7c435a16ca424c8c4899098b1 | a8bc7cc25362b7781d4836dfc7c5001e | Get UDF File Entry. However we do NOT get the variable-length extended
attributes. | ret = self.pycdlib_obj.get_record(udf_path=udf_path)
if not isinstance(ret, udfmod.UDFFileEntry):
raise pycdlibexception.PyCdlibInternalError('Invalid return type from get_record')
return ret | 1 |
d9219c1fb54c404e17b8c2b7f46213c4 | f8f0b3eff06fda4c464a405c2577b47f | Returns a range from (and including) the specified TimePoint untill the end of time | namespace RyujuEngine.Units
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static TimePoint At(in TimeDuration durationFromZero) => new TimePoint(durationFromZero); | 0 |
08e51c6a27f4480711d5b4506c056957 | ddcc18a75b980caf81b768285181f4b8 | Un-normalise | class Driver:
# initialise with hyperparameters, data
def _denormalize(self, value, scaler):
return scaler.inverse_transform(value)[0][0] | 1 |
5436c1e8e761303189ae3f0f61e8e600 | 5fce837a1358309a2023c73bac91e15e | 返回SQL的永假SQL(向现有查询中添加1=2的过滤) | {
if (string.IsNullOrEmpty(whereSQL))
{
whereSQL = " (" + addSQL + ") ";
}
else
{
whereSQL = string.Concat(new string[]
{
whereSQL,
" ",
opSQL,
... | 0 |
77dfae1555f83ca99146099672569cba | b6f5aec1007b970db3e891e77caf3ad2 | Permet de créer un carré. | void buildSquare(Object * object, GLfloat * vect)
{
object->nbVertices=4;
object->nbIndices=6;
GLfloat l=0.3;
GLfloat vertices[]={-l+vect[0], -l+vect[1], 0.0, 1.0,
l+vect[0], -l+vect[1], 0.0, 1.0,
-l+vect[0], l+vect[1], 0.0, 1.0,
l+vect[0... | 1 |
c4ffb2b083a2db5a8f9eab55d3324e37 | 58a83fef4ed9cd12a22daf55063652c9 | 创建Actor,收到消息就打印“Hello World!” | {
try
{
ActorRuntime.RegisterActorAsync<MyActor>((context, actorType) => new MyActorService(context, actorType)).GetAwaiter().GetResult();
Thread.Sleep(Timeout.Infinite);
}
catch (Exception e)
{
throw;
... | 0 |
b262d8d9284b84a598645fa8a21dd106 | b7b4a5276b8530e6d421e9d16b52ee07 | 通过技能名字查找技能 | KmSkillNode* KmUseSkillList::FindSkill(PSTR Name)
{
KmSkillNode* Skill = (KmSkillNode*)GetHead();
while (Skill)
{
if (strcmp(Skill->m_Skill->m_Name, Name) == 0)
return Skill;
Skill = (KmSkillNode*)Skill->GetNext();
}
return Skill;
} | 1 |
28a1619841f930934917e7f865b73916 | b94037f5798416396d14dd28c0f18c39 | Tells the view to display the user deletion panel. | public class ViewController
public void TaskDeleteView() {
this.helpinghand.setContentPane(new TaskDeleteView(this.currentUser,this));
this.helpinghand.repaint();
this.helpinghand.revalidate();
} | 0 |
0ae3d670d75f798c638081c29c737648 | 61f50ce3bfde34b20f376798fbb49405 | Registers the app or service to receive the broadcasted beacon message | public class MldpTerminalActivity extends Activity
@Override
protected void onResume() {
super.onResume();
registerReceiver(bleServiceReceiver, bleServiceIntentFilter());
} | 1 |
6fea04ca85af1ae68e44d3c755dd4993 | cbf8e1b0635e379c2c051c979ac596b4 | 配置微信跟踪日志 | {
Senparc.Weixin.Config.IsDebug = true;
Senparc.Weixin.WeixinTrace.SendCustomLog("系统日志", "系统启动");
Senparc.Weixin.WeixinTrace.OnLogFunc = () =>
{
};
Senparc.Weixin.WeixinTrace.OnWeixinExceptionFunc = ex =>
{
var e... | 1 |
96f8c2364e0949ce7c6c70e9175768f7 | ddf6f30d32f418f1e68b3a706718a351 | 根据DataReader得到SchoolInfo | namespace WHC.MVCWebMis.DALMySql
public class Information : BaseDALMySql<InformationInfo>, IInformation
protected override InformationInfo DataReaderToEntity(IDataReader dataReader)
{
InformationInfo info = new InformationInfo();
SmartDataReader reader = new SmartDataReader(dataReade... | 0 |
5adac3fe2243c01372c42b38047040b4 | 6187fab9dd8f1ded2c531b4370e2ce84 | 客户库存上报查询 | function fnsearchyc(odata) {
$("#cgl-contlist").find(".alllist").html("");
$("#loading").show();
$("#zhezao").show();
$("#nono").hide();
$.ajax({
type: "get",
url: "/webapi/distributor/" + fnurl().distributor_id + "/customer/" + localStorage.retaler + "/prepayinventorys",
dat... | 1 |
d6b4d1d8ea1a22e1d7d398e5074170d3 | 066dfc1eb49a66480e32c8d06447eeda | This overrides the default RubyGems ListCommand behavior of doing a wildcard match. This caused problems
when some gems (ActiveRecord-JDBC) caused exceptions during a remote list, causing a remote list
of other gems (activerecord) to fail as well | class AppSpec
def gems_optional_list
self.gems_optional.map{ |g| g.is_a?(Array) ? g.first : g }
end | 0 |
7013dd56f77f3fb90b8f5b9963cd0246 | be03253b9fc35068294761f93f141fc0 | Disable printout of all source and target sentences | namespace goos
void Interpreter::disable_printfs() {
disable_printing = true;
} | 1 |
71a8505aae988f22aad63458e9d530f6 | 3338800f4718bb42c7b471928a90b386 | Get a timewarp applied to the animation. | public class AnimationTimeline
public class TimewarpContainer
public ITimewarp GetTimewarp(int timewarpIndex)
{
return _timewarps[timewarpIndex];
} | 1 |
55e2794c311901a5fda577bb8adba10f | 5ba8620badb744873a5b9f7889dcd209 | 基于Http上下文异步处理
捕获action中的异常,
如果异常为UtilityException,则Http上下文的Response响应类型为由异常转换后的ErrorMessage的Json信息
如果不为UtilityException,则Http上下文的Response响应类型为Code=-1,Message为内部错误的ErrorMessage的Json信息 | namespace iS3.Server.Filters
public class ApiErrorHandleAttribute : ExceptionFilterAttribute
public override void OnException(HttpActionExecutedContext actionExecutedContext)
{
base.OnException(actionExecutedContext);
String errorMessage = actionExecutedContext.Exception.Message;
... | 0 |
040fbdbaf651c916fa017dd5dd1ca98e | 99a9d4db4c81e73e9fd5ae2a03b15149 | Gets a list of assemblies that should be scanned for views embedded as resources. | namespace Mono.Addins.Database
string[] GetResourceNames (object asm); | 0 |
9a3fee756f0d52031be841191007895a | 6024a14ce43d0c287cf9d3905c8374c9 | 验证商品参数中的商品ID及数量 | class store_goods_onlineControl extends BaseSellerControl
private function checkRequestCommonId($common_ids) {
if (!preg_match('/^[\d,]+$/i', $common_ids)) {
showdialog(L('para_error'), '', 'error');
}
return $common_ids;
} | 0 |
c2a15487ccaf18ca300779c25d6a9df5 | 54cd0465f9b7c96404fa55f7a958ac21 | bet額の決定 | def bet():
gameData = []
allGames = G.allRunningGames()
for game in allGames:
p1Total = allGames[game]["p1Amount"]
p2Total = allGames[game]["p2Amount"]
print(p1Total,p2Total)
if p1Total == 0:
p1Ratio = "無人下注"
else:
p1Ratio = round((p1Total+p2Total)/p1Total*0.98,2)
if p2Total == 0:
p2Ratio = "無人下... | 0 |
d1686da9e6011a2d14509bed484282e2 | 1bb9ab8d0d7800485b2b6b3766d6895e | Return distance between two vectors (any dimension). | function VecDist(a, b) return VecLength(VecSub(a, b)) end | 1 |
ad39db08b406bec35ef5cbe835ab5ab7 | 9f716955e83d1f696558ee8f25412470 | 根据传入的日期字符串"XXXX-XX-XX",返回该季度最后一天 | public class DateUtils
public static String getLastDayOfQuarter(Date date) {
Calendar cDay = Calendar.getInstance();
cDay.setTime(date);
int curMonth = cDay.get(Calendar.MONTH);
if (curMonth >= Calendar.JANUARY && curMonth <= Calendar.MARCH){
cDay.set(Cale... | 1 |
98ce328746ff4ccb448a5c0d3682b217 | 15abd4a3ab227d71f725a8c1cf5947a8 | Сохранить (обновить) опции в файле JSON | if self.params.user and self.curr_profile:
fn = f'{self.get_profile_dir()}/options.json'
if not os.path.isdir(os.path.split(fn)[0]):
os.makedirs(os.path.split(fn)[0])
self.options.save(fn) | 1 |
9961a5fe4224e2c5a3993e69f700e191 | 9bd90565274bd68da1d9c806eef4375f | Show left-side navigation.
Sliding animation is CSS's responsability. | function handleAccordion() {
var $target = $(this);
var $parent = $target.parent();
if ($parent.hasClass('accordion-heading')) {
$target = $parent;
}
var $list = $target.siblings("ul");
$target.parent("li").toggleClass("acco... | 1 |
39873f4c8a16dd182b513c0996f23a81 | d7c445a8084101911b69b1fef86efae9 | Devuelve una conexión desde el pool de conexiones con el usuario y la contraseña especificados | public class DataSourceImpl implements DataSource, LifecycleComponent
@Override
public Connection getConnection(final String username, final String password) throws SQLException {
return poolingDataSource.getConnection(username, password);
} | 1 |
62ccca4c1f88745e45ac3a21b0feb3ae | 9af828445ecf0b1bba3e679145504495 | Tests valid host IDs | hostnames = [
'battlemidget.lol',
'www.battlemidget.lol',
'localhost',
'localhost.localdomain',
'_underscores-is_ok',
'double--dash_is_ok'
]
for hostname in hostnames:
assert utils.is_valid_hostname(hostname) | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.