query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1ebed43310bcfb6bf2cbbcf5c0dc4975 | 3a58352bdbe91bf31057706c51192f4a | {@code GET /statuts} : get all the statuts. | namespace QuestionnaireHackathonWCF
public class Service1 : IService1
public List<Statut> GetStatuts()
{
using (var context = new Dwarf_BDDEntities())
{
var myquery = from s in context.Statut
select s;
var liststatuts = my... | 1 |
aab09ce6e0c4789e7224dc1fa03280ef | 68720a49743033881875ce88a5fabc0d | Visit a parse tree produced by {@link ApexParser#nonWildcardTypeArguments}. | void exitNonWildcardTypeArguments(@NotNull javaParserParser.NonWildcardTypeArgumentsContext ctx); | 1 |
2acef4fd96c2de4ef755d1a52aaec18e | 26ecbcc2e47ad30c2ca93a7288951d09 | 選取贈品 | {
if (this.giftListBox.SelectedIndex < 0) { return; }
var config = GiftTable.GiftListEx[this.giftListBox.SelectedIndex];
config.title = TextManager.CreateText();
TextManager.SetText(config.title, this.titleTextBox.Text);
config.desc = TextManager.Creat... | 1 |
552fd4c4cb5cbad737fdeb06be0067df | d511d0372589d4355cacbbef4f610ecb | !
Returns the maximum level of detail parameter.
\sa setMaximumLevelOfDetail(), minimumLevelOfDetail(), levelOfDetailRange() | eLogLevel LoggerImpl::GetVerboseLevel() const
{
return llVerboseLevel;
} | 0 |
923feb12737ef1d37a013f197a5507a5 | 0d2e90378a85af7a577c79f16c41d169 | 如果文件带有后缀名则去掉 | if string.isEmpty(filename) then
return filename
end
local ex = string.match(filename, ".+%.(%w+)$")
if ex then
return string.format(".%s", ex)
end
return ""
end | 0 |
822394c593c1bc0d82302ed72339b284 | 5c1ed86d75a7f1a013c10056d8dee885 | Gets the Requirement's totalHours. | public function getTotalHours(); | 1 |
40ba12538f4900abc34f5162abf444a4 | 21a4fa2cbfc9aef1a105c714a4ed5778 | Try to fetch all of the elements on the stream.
This implies that the stream needs to rewind itself to its first element
in the case that there were already elements read from the stream.
Thrown when the stream is not able to {@link Stream#rewind()
rewind} itself.
Thrown when an error occurred while this stream was try... | public abstract class AbstractStream<T> extends BaseStream<T>
protected abstract T expand() throws Exception; | 0 |
7bc29d8d8af6b5a16ecce18618a74c05 | 5f4d5c8366a87fb5d8c62619b9bb594c | Store egresados basic info. | class EgresadosController extends Controller
public function show($id)
{
$user = User::findOrFail($id);
return view('admin.egresados.show')->with('user',$user);
} | 0 |
7054f4f524db23d0a5be4c47b1c0a379 | 85854fcce67660f5ac322ab4c8db2d0d | Pearson correlation of the flattened array. | def calc_pearson(dataset):
data = dataset.flatten_array()
print(data.shape)
corr, pvalue = sut.calc_pearson(data=data, verbose=True)
return corr, pvalue | 1 |
5cb863fe65d205c25dc8f2c46324c2bf | 8418dd27c4c5cd81b0a63cff5745a5c2 | Sets return type from cellular noise calculations
Default: Distance | class Source
public function setReturnType($returnType) {
$this->returnType = $returnType;
} | 0 |
016b6698c4714d3197057ccb83acc46d | 42b37b049be252121a63a228393b6b90 | Generates the patch document. | namespace Dolittle.AspNetCore.Generators.Documents
OpenApiDocument GenerateFor(IDebuggingHandler handler); | 0 |
58be3da3f5c1e742227765cc2c6b32e7 | c184a386ec6bef95466f0d0fdb067348 | Clears the settings cache for the given user group | if(is_null($group)){
$this->memcache->flush();
}else{
$group = MODULE_NAME.':y:'.$group;
$this->_clearGroup($group);
}
return $this;
} | 1 |
8a3e5319141c2a943f208f63c7431a5a | 9254b9155ccb11a4579a105e4d6addfd | Test that shifting an empty list returns an index error. | def test_kth_from_end_alt_empty_list(empty_ll):
with pytest.raises(ValueError):
empty_ll.kth_from_end(10) | 1 |
6bd4622e30f14dc22bae3d8a73835a71 | 98ca263456ce07a2cc2367f05cddadbe | 修改状态为提现成功通知 | void readyWithdrawalFailureNotice(List<Withdrawal> withdrawalList); | 0 |
b649b3c258149f41e2d94f9137f398e1 | d276e08bfd804d34c85d1eefca5e2972 | 能否审核不通过 | namespace SCG.eAccounting.BLL.Implement.WorkFlowService
public class ExpenseWorkFlowService : GeneralWorkFlowService, IExpenseWorkFlowService
public virtual bool CanVerifyAndApproveVerifyWaitApproveVerify(long workFlowID)
{
return false;
} | 0 |
cb4e92a304ce7e5d29728d20c23ee762 | 9aead6859fe8a9af345ea9fd7a01c049 | Read a 2D array of bytes. | namespace TeslaTest
[TestClass]
public class ByteDeserializationTest
[TestMethod]
public void ReadByte2DArrayTest()
{
List<List<byte>> values = new List<List<byte>>()
{
new List<byte>() { 0x01, 0x02 },
new List<byte>() { 0x00... | 1 |
6fe6f7390e6ebe80155a45812c412075 | d0114f5007e4458230a4ea0042e6aeb6 | 编辑联系人验证 | function validate(){
$('#editfm').bootstrapValidator({
excluded: [':disabled'],
fields: {
loginname: {
validators: {
notEmpty: {
message: $.i18n.prop("message.notempty")
},
regexp:{
regexp: /... | 1 |
e89ce0417d9a720b5524a0c2cf482e10 | 795e1464feaf440b7702a87d615b3609 | Set properties for the calculator.
New property values are not guaranteed to take effect until the next call
to an initialise method.
<p>No general properties are defined at the interface level here, i.e.
there are only properties defined by child interfaces and classes.</p> | IMPL fromSystemProperties(); | 0 |
db95dcac9076a98010449b5f9840d16b | f235697c12ae69183511d567107ec881 | Retrieve the Jurisdiction that levied the tax | Place getJurisdiction(); | 1 |
4c40d1bd8e4363f5b15b709b4c06dc12 | 98645b040f9428c11e60b7a05f0264e6 | Gives the Arduino object to the specified client | def arduinoCom(spot):
ser = serial.Serial('/dev/ttyACM0', 9600)
ser.write(bytes(spot.encode("utf-8"))) | 0 |
f2d0ccb6afce6cb62fdce07c4e22498f | e6e6fcb8acade777aacd2b8b8c4bb0b7 | 调整字典顺序,按照关键词频数从大到小进行排序;并选取频次大于x的关键词 | class topic:
def filter_keyword(self):
if len(self.kwDir.values()) < 10:
return
tuList = sorted(self.kwDir.items(), reverse=True, key=lambda x: x[1])
new_kwDic = {}
for i in range(10):
new_kwDic[tuList[i][0]] = tuList[i][1]
self.kwDir = new_kwDic | 0 |
fa96876183314af3ae4c07b2aaeed975 | 3aeec79930eae9524e263479cafc9a7d | Check if dialogue variables match current Global + Player + NPC variables. | function _M.CheckDialog(self)
TalkInProgress(self)
end | 0 |
3992c1981526f34afa3e8646d22d8409 | cf5626ab401390112afa809f9ee9605b | display info on one record member, for shoProbeNames | static void
isdn_tty_show_profile(int ridx, modem_info *info)
{
char v[6];
sprintf(v, "\r\n%d", info->emu.mdmreg[ridx]);
isdn_tty_at_cout(v, info);
} | 0 |
97eb799856028f99e85b237fad3e5635 | 5679d55dc632a9e3e74c38e0351fb318 | 在 Java 8 中获取今天的日期,只有日期,没有时分秒 | public class DateTest
@Test
public void test1() {
LocalDate today = LocalDate.now();
System.out.println("Today's Local date : " + today);
} | 1 |
f5ad5d87ca8028ffafc18fdb378ea54c | 3937b096490daab1d0d7ae2676caa442 | ulozeni celociselne hodnoty do konfiguracniho souboru | void MISC_SaveCfg (void)
{
int j;
myFile_s *ff;
ff = MY_FOpen (MOUSE3_DAT, 0, "wb", true);
MY_FWrite (m3Opt, 1, sizeof (m3Opt), ff);
MY_FWrite (&m3HiPoc, 4, 1, ff);
for (j = 0; j < 10; j++)
{
MY_FWrite (&m3Hs[j].jmeno, 14, 1, ff);
MY_FWrite (&m3Hs[j].bodu, 4, 1, ff... | 1 |
50c7a43028e29989e8e63dab74bebdcb | 8410c93ecb232f2f05af6c54ffe4289a | Determines whether the application identifier represents
the PICC Master Application or not
the PICC Master Application; <code>false</code> otherwise | public class OTA2ApplicationSpec implements Comparable<OTA2ApplicationSpec>
public boolean isAdminApp() {
return adminApp;
} | 0 |
af9698c08897cccb7139274aab596c71 | ac99237a13df1a6de8f7d5a9272c899d | Store validity booleans for each table column, so we can
check that each of the possible commands is accompanied by
the arguments needed for that command.
Used to handle external commands from Prosp, required for automatic observing
until I replace this with an RPC call. | class OnlineShop_Framework_Impl_CartCheckoutData_Resource extends \Pimcore\Model\Resource\AbstractResource
public function init() {
$this->validColumns = $this->getValidTableColumns(self::TABLE_NAME);
} | 0 |
6079d374d36412efc0b5ee06b49a2563 | 03a9eb7fd6e7c9a2e5e7a2a3801c7d8b | 升序排列。 | public class ServiceUtil
public static void asc(List<? extends Orderable> list) {
Collections.sort(list, new Comparator<Orderable>() {
@Override
public int compare(Orderable o1, Orderable o2) {
return o1.getOrder() - o2.getOrder();
}
});
} | 1 |
bf10d21a746d5730bceac48bb0ef2c8a | 3e64973013e03623d785d64828c80985 | 通过filepath查询book信息 | fs.readFile(`${filepath}`, 'utf8', function (err, data) {
if (err) {
console.log(err)
} else if (data.length === 0) {
cb([])
} else {
cb(JSON.parse(data))
}
})
} | 1 |
73a0b7c26ee13eb7093ec3583d434bb3 | d9d3ee542433a78fb53f31245982398c | <p>
跳转到测试主页面
</p> | @RestController
public class DemoController
@RequestMapping(value = "/toIndex.html")
public String toTestPage() {
return "/index";
} | 1 |
34be629b2dfd7c6f71fe667a6d5e78df | 90ebbe27236bfae6eb98e5221b642d83 | Set 付费模式。取值范围:<br><li>PREPAID:预付费,即包年包月<br><li>POSTPAID_BY_HOUR:后付费,即按量计费。 | public class ExpansionNodeConfig extends AbstractModel{
public void setInstanceChargeType(String InstanceChargeType) {
this.InstanceChargeType = InstanceChargeType;
} | 1 |
4fbf33c80348ab92fefd4f7746b2bc07 | 880d1028772cd3ea77d9bece0040c7e1 | add email links | $base = $this->modx->getOption('site_url');
$splitBase = explode('//', $base);
$domain = $splitBase[1];
$domain = rtrim($domain,'/\\ ');
$html = $this->emailText;
$html = preg_replace('@(?<=href|src)\s*=\s*@', '=', $html);
$html = str_ireplace('google.com/undefine... | 0 |
c7c207f21eacffe05a9dcb4362e6d258 | d65e2b68aef42b74b8a4c4bdc0720230 | 根据ID集合查询列表集合(异步) | namespace Hzdtf.Service.Impl.Standard
public abstract partial class ServiceBase<IdT, ModelT, PersistenceT>
where ModelT : SimpleInfo<IdT>
where PersistenceT : IPersistence<IdT, ModelT>
public virtual async Task<ReturnInfo<IList<ModelT>>> FindAsync(IdT[] ids, string connectionId = null, BasicUserInf... | 1 |
219dcb90791924674f5dd1ef5769af88 | 3b59ecc74adfb107bcf2eec6df8d05e7 | Check that keywords can be searched for | DB.init()
assert DB.add_keyword("HEJ")
assert not DB.add_keyword("HEJ")
assert DB.delete_keyword("HEJ")
assert not DB.delete_keyword("HEJ") | 0 |
d163d82360724dc59a2d8e5895188d4a | 8f8154f129979f13ae19471d658c07d1 | addアクションのGETテスト(作成権限あり)用DataProvider
#### 戻り値 | class CalendarPlansControllerAddTest extends WorkflowControllerAddTest
public function dataProviderAddGet() {
$data = $this->__getData();
$results = array();
$results[0] = array(
'urlOptions' => array('frame_id' => $data['Frame']['id'], 'block_id' => $data['Block']['id']),
'assert' => null, 'exception' => '... | 0 |
d1f114340dace2da48fbc4a84b2b50a9 | d942827552877f2798749e9234295adc | Get the populated fields for the current context. If no
context has been established using {@link #openContext},
returns {@code null}. | Map<String, String> optionalContext(); | 1 |
fd75435e5b9fd23b7f56cebac9ed9173 | 9d4f87328ec070efb1cbd0dcbc3b782d | Rename client's tab | class MultiTemplate(BoxSizer):
def OnRenameTab(self, event=None):
index = self.Tabs.GetSelection()
return self.SetTabName(index, rename=True) | 1 |
4360d5cea12acdecc2efec80530d7471 | 8022f12b03b6fff512fe7b3cef915d9f | Sets the name in the current project as the moving data set filename | class DataMover(object):
def setInputFile(self,fname):
self.inputFile = fname | 1 |
552e37d03797e38d6ae5ade7d11a81d7 | ee9b87e7102b29cf4c6e9060c8e45097 | Parses the the rule SingleType according to the following production rule:
<p>
[48] SingleType ::= AtomicType "?"? .
</p> | T visitSingleAP(XQueryParser.SingleAPContext ctx); | 0 |
cc62bf5915983815f439ac3457495fa3 | 0895eba36dd82b31938729aa8bd0ec80 | 获得vip级别对应的能购买的pvp挑战次数 | local vipLevel = vipdata:getVipLevel()
if vipLevel == 0 or not vipdata.vipItems then
return 0
end
for i=1,vipLevel do
if not vipdata.vipItems[tostring(i)] or tonumber(vipdata.vipItems[tostring(i)]) ~= 1 then
return i - 1
end
end
return math.min(vipLevel, table... | 1 |
9f346d6102c84c3d47dff4df8ed54f8f | 18c94bbe122c053a5c27a13a74f5bfd3 | 通过filters获取单个api error code信息 | new_code=''
codes = []
if 'code' in rst:
for i in rst['code']:
if re.match(self.rule['code'],i[0]):
codes.append(i[0])
if codes:
codes.sort()
codes.reverse()
if l... | 0 |
d040305eb17ea85f87edfb84b2d7b003 | 67b9719d27bf00173d8d6fae162c92c6 | Toggles a {@code menubar} visibility. | void enableMenu(final boolean a_enable); | 0 |
c257c93df8d78516193f2e70bb341dbe | 7c304ba8d9266207a7d7982707096bb7 | Mutliplies the radius and gravity param of a body by a given factor. | {
m_x *= factor;
m_y *= factor;
m_z *= factor;
} | 0 |
c3bdf52ad2cdc1a17fdbf94aef1351af | 6d4f65e35dc86bbfb268e09ff2f92ed6 | Returns the relacion usuario consejo with the primary key. | class Valoraciones extends \yii\db\ActiveRecord
public function getProfesional()
{
return $this->hasOne(Usuarios::className(), ['id' => 'profesional_id']);
} | 0 |
dfdfa3b354d58fe7b20e047aad8b07f7 | 5c9ee71fa9198541ab8a88c13d5b9b1f | Applies damage to himself. | {
AddDamageFloater(damage.ToString());
((IDamageable)this).CurrentHealth -= damage;
if (((IDamageable)this).CurrentHealth <= 0)
((IDamageable)this).Die();
} | 1 |
2c089dbe21375c1c281b954a5267ecf7 | 79ceb172bf2a6ad007520f88504f8365 | Get PHP version of PHP module. | {
if (self::isHHVM()) {
return 'HHVM';
} elseif (self::isPHPDBG()) {
return 'PHPDBG';
}
return 'PHP';
} | 0 |
0fe213c4567f33cc3fb665e00cde7d2e | 3537e331c511b6a31fcd847140107dc6 | Allow users to save events to a personal Events array. | {
if(!$this->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY'))
{
throw $this->createAccessDeniedException();
}
else {
$em = $this->getDoctrine()->getManager();
$parametersCollection = $request->get('eventData');
... | 1 |
904f27912ea0aedb97e2ffcc6a049363 | cdbcf75a5006f2b9a38b09783c1065ae | 判断指定的double值是否是有穷的<br /> | int isFinite(double dbl)
{
union
{
USHORT rgw[4];
ULONG rglu[2];
double dbl;
} v;
v.dbl = dbl;
return (~v.rgw[3]&0x7FE0) || 0==(v.rgw[3]&0x0010) && (~v.rglu[0]||~v.rgw[2]||(~v.rgw[3]&0x000F));
} | 1 |
0bcaa0ad8811a7b34ea74dac6ea68e85 | aec47a43a2998baa83816db2c518c4bf | Clear the canvas and redraw the blocks | function resetCanvas(e) {
var canvas = document.getElementById("canvas");
$("#scaleButtons").css("display", "block");
$("#uploadBlock").css("display", "none");
$("#previewImage").css("overflow", "scroll");
image.style.display = "block";
canvas.setAttribute("width", preWidth);
canvas.setAttribute("height", preHei... | 1 |
d2595989be510756583c98422d0aafb6 | 64ebe97fa4413cf28be3512fcb16f964 | 给定出生日期毫秒数,返回当前年龄 | @SuppressWarnings("all")
public class TimeUtil
public static int getAgeFromBirthTime(String time) {
return getAge(stampstoTime(time, "yyyy-MM-dd"));
} | 0 |
c5564425eb2240822e897078ffa60c32 | f3eaa31b04bc7afca3a144bb75288fab | Debug procedure to test stuff in all images in a list of file names. | def test_file(file):
name_list = get_name_list(file)
if STATUS.UPDATE:
if not STATUS.UPDATE_ALL:
STATUS.UPDATE_ALL = len(name_list)
STATUS.UPDATE_NOW = 0
else:
STATUS.UPDATE_ALL += len(name_list)
for name in name_list:
if file != 'NameList.txt':
... | 0 |
6a71b8a447f2ee8c17aaa0f7d6e808ce | 6374a3dd9afb48046bdb6b661e8cbdeb | user watch or unwatch a pet | class TopcoderApiController extends AbstractApiController{
public function put_watch($userId,$id, array $body) {
$this->permission('Garden.SignIn.Allow');
$schema = ['watched:b' => 'The category-watched status for the user.'];
$in = $this->schema($schema, 'in');
$out = $this->schema($sch... | 0 |
1ff5ce1c9360240f7dceb2d8be916155 | dbdca0489be97feb6b9d4490a1b17c4d | Returns getter and setter accessors of the property. | function accessor(name) {
return { get: defaultGet(name), set: defaultSet(name), configurable: true };
} | 1 |
96b3fc06ad961aca253b4792446e532e | 0229478cdd99b33ead3aac39ada04192 | returns allocation if defined, otherwise, allocation set target | sm_ifalloc(void * ptr, size_t size){
if(!ptr)
return sm_malloc(size);
else
return sm_realloc(ptr, size);
} | 1 |
f44ed38efb0323e319fced6713e93af4 | 7f61448ad6da3ef0f9cb03f40c5be655 | Bad Things: aka Vomit, Pit, Flames==================================== | cases like (1) | 0 |
cfe8ef8150b44eadde73769644cf34aa | fd2b2310bdc0f4d51f4df6f318407924 | 检查登录web界面,判断是否会显示向导页面
输出:有则返回True,没有则返回False | try:
login = driver.find_element_by_xpath('//div[@class="bigbigword"]/span')
time.sleep(2)
if username in login.text:
return True
else:
return False
except:
return False | 0 |
0841793b7fe5d1a15067db1d7053c79c | c5435a84a214d06cb53efd0eff3dab7b | Compute the segments length and removes the segments which are shorter than a tolerance. | {
var len = points.Count;
var markers = new int?[len];
int? first = 0;
int? last = len - 1;
int? index = 0;
var stack = new List<int?>();
var newPoints = new List<Vector>();
markers[first.Value] = markers[last.Value]... | 0 |
cf7b22911fdf47725fcc6e6baf8077a9 | cbf91924635215a73c8c3921e3f41e41 | Shows the mesh in the scene. | public class MeshViewer : MonoBehaviour
public void ShowMesh()
{
meshData = parser.Parse(OBJFile);
if (isFlatShaded)
{
meshData.MakeFlatShaded();
}
meshData.CalculateNormals();
meshFilter.mesh = meshData.ToUnityMesh();
} | 1 |
eb77a2a06d972cd24391fbcbf9ee83e8 | dca4ef6b04db62a1356d186792458e60 | Determine what Player is aiming at | void OriginAimbot::FindTarget(void)
{
float aimVector[3];
target = BAD_TARGET;
VectorClear(targetAngles);
int ax = 0;
vTargets.SortTargets();
int nTargets = vTargets.size();
if(!nTargets) { return; }
for(int tx=0; tx<nTargets; tx++)
{
cl_entity_s * ent;
float oaim[3];
float vecScreen[3];
float angle[3... | 1 |
d2fc194da0cdbe42450b66f4ddd40170 | 2e2c9d76db5f096cd6365fe9ad1ea3e5 | <p>Gets the signer's certificates.</p> | public class VirtualJarInputStream extends JarInputStream public static class VirtualJarEntry extends JarEntry
@Override
public Certificate[] getCertificates() {
final CodeSigner[] signers = getCodeSigners();
if (signers == null) {
return null;
}
... | 1 |
34aa4329a3613be04ee0ca1e9bebd371 | 67e7cc842b300acae7e9538f9bea2481 | Reads from log and clears it | func ClearLogs(){
logs.Info(readAll(""))
} | 0 |
b4853395e9a30f1027d51218f8473778 | 03774ea820c0ce9623df533086ead176 | Test computation of segment tick mappings. Check integers, list and
function types. | outlist = ['sea', 'river inlet', 'moat',
'sea', 'moat', 'moat']
list = ["sea", "river inlet", "", "sea", "", "moat"]
preset = ["moat", "internal boundary"]
[intlist, converter] = segment_strings2ints(list, preset)
for i, k in enumerate(intlist):
ass... | 1 |
5f1b890fd3fc36d8db13a31e9e8ea56a | bbf853b53f8d987034720dac76f8c819 | Read one integer from the selected inferior's memory. | def read_int(int_addr):
mem_area = fins_instance.memory_area_read(fins.FinsPLCMemoryAreas().WORK_WORD, int_addr, 1)
return int.from_bytes(mem_area[-2:], 'big') | 1 |
8f1c403904404366e77176ccda8a6170 | 87a7489b30881d7d9c730168b09bb9d2 | 处理非ajax异常 | {
if (filterContext.HttpContext.Request.Headers["X-Requested-With"] == "XMLHttpRequest")
{
#region Ajax
filterContext.Result = new JsonResult
{
JsonRequestBehavior = JsonRequestBehavior.AllowGet,
Data... | 1 |
b97cd79cc73c899119576025d05b84f5 | 2e7e768222456f446b2fd22550039c04 | Serializes the given object into json. Returns the json string if
successful. If serialization fails, then returns null | @Nullable
String getJsonString(@Nullable Object o); | 1 |
80b268b9f58ae5934d6d736eefbcd78f | ccedc67321f91effb7edc5da0bf59c79 | Decodes the method specification | {
var method = _type.GetMethod(name, parameters);
if (method != null)
{
_tsMethodDeclarations[method] = spec;
}
return this;
} | 0 |
f257ecaa198ce0f59158344379de6fbc | 39a85c0f544280228647b76f0de5b256 | Равно ли число float нулю с заданной точностью? | function isFloatEqZero(num) {
return num == 0;
} | 0 |
80d61b917bfec3e6b5245178a1088544 | 234782b487c2381667c705ec914a069f | <pre>
将指定的二维码图片文件以指定编码方式进行解析
</pre> | public class QrcodeUtils
public static Result decode(InputStream inputStream) throws IOException, NotFoundException {
return decode(ImageIO.read(inputStream));
} | 0 |
5bde5d59b490bf16354f922b2c982fce | d9b9a64c553e88d0d1f4ee2d7ecce802 | 由日期字符串得到该日期为那个月的第几天 | Calendar c = Calendar.getInstance();
int year = Integer.parseInt(str.substring(0, 4));
int month = Integer.parseInt(str.substring(5, 7)) - 1;
c.set(c.YEAR, year);
c.set(c.MONTH, month);
int i = c.getActualMaximum(c.DAY_OF_MONTH);
return i;
} | 0 |
01e289f0dc4a78a459b7c2348164ab3d | 679a671d210a7a1fa01badf415e2c61a | Signs-out of Chat MEme | {
CurrentUser = null;
Authenticated = false;
return (await webClient.GetRawResponseAsync("signoff")).IsOkAndTrue();
} | 1 |
9328faa5e7b9cda2fc31f6cc58615183 | d0ca2b7a105ed883cd714e78c285a251 | demande l'image vaisseau (Singleton). La creer si besoin | public abstract class SpaceShip
protected abstract Image getImage(); | 0 |
d96f9edd0252ae323b0b9d11ac24e8ce | 813635525bf6d951ad7926e98159ba6d | 结果页得分分布图 | function ech1(name_every, fen_number) {
var scoreChart = echarts.init(document.getElementById('score'));
var option1 = {
color: {
type: 'linear',
x: 0,
y: 0,
x2: 0,
y2: 1,
colorStops: [{
offset: 0, color: '#F9FAFC'
... | 1 |
b954bfb2fabb95bd42cae03282defd03 | 86503eb384ad59c8da2f128af8fd9b4d | 定义特征提取器函数,检查给定单词的后缀 | k=self.root
for i in word:
if i not in k:
return False
k=k[i]
if 'end' not in k:
return False
else:
return True | 0 |
1449137a6c84ae30a3c14427baded07c | a6604b23d15d5e1d10b9b5aa54281f44 | 1.判断是不是左括号 | int IsLeft(char c) {
return c == '(';
} | 1 |
a9e2595e878e53f92341efd45eef73e8 | fa4fe0d3308bf3a8bf060f05b87c7db1 | Enter a parse tree produced by {@see sdpParser::ipvfuture()}. | public class ExtractedIRIBaseListener implements ExtractedIRIListener
@Override public void exitIp_v_future(@NotNull ExtractedIRIParser.Ip_v_futureContext ctx) { } | 0 |
8d7ae1b81ce7da68d8aed7a0da25aca3 | 058984c16a724513c64ef2559fe11642 | 用于SemanticKITTI数据集打印每个节点的预测标签 | output = output.to("cpu")
oLable = np.array(output[:,6], dtype="int32")
oBox = np.array(output[:,:4], dtype="int32")
oP = np.array(output[:,4] * output[:, 5], dtype="float")
boxes = []
for i, box in enumerate(oBox):
boxes.append(BoundingBox(*box.tolist(),label=CONST.classes[oLable[i]] + ... | 0 |
026793f026845de6479768d27eca946b | ae7636ed80e61af336780b27a04abf09 | Determines if a path exists between two cells. For a path to exist, they must be
neighbors and they must not have a wall between them. | namespace POESKillTree.TreeGenerator.Algorithm
public class DistanceLookup : IDistancePathLookup
public bool AreConnected(int a, int b)
{
return GetShortestPath(a, b) != null;
} | 0 |
92121efaa9ae8734ba9ddf75de0095c5 | e3d79ae646e6068f35fbc3d76a4f3136 | This method is used by the server to encrypt the server's secret
key with the client's public key. This is a safe way to transfer
the server's secret key. | class Encryptor
@Throws(IOException::class, GeneralSecurityException::class)
fun encryptSessionKeyUsingPublicKey(sessionKey: ByteArray): ByteArray {
val pkCipher = Cipher.getInstance(ASYMMETRIC_ALGO, JCE_PROVIDER)
pkCipher.init(Cipher.ENCRYPT_MODE, publicKey)
return pkCipher.doFinal(sessionK... | 1 |
f3d324234426a6f551c3d40e8b7e2d37 | ca5a92447f7d0465e87877893682a319 | 摄像头ip有效性验证 | def testCamera():
if(len(CAMERA_ID)!=len(CAMERA_IP)):
print("error")
exit()
for i in CAMERA_IP:
cap = cv2.VideoCapture(i)
if cap is None or not cap.isOpened():
print('Warning: unable to open video source: ', i)
return False
return Tru... | 1 |
b40b6c04ae8cab12407392ac7e1d22cb | 11159d9ccb55ed4671866e2d567413ae | This forces the tests to run in a single thread. This is
required for use of the mocks as we run mocked binaries. | def serial():
env.PARALLEL = False | 1 |
d84089c5419732469a11639cc9e212e2 | 0b8e9111cdb911dc0809c4ba2299ba6c | 判斷tfrecord文件是否存在 | def _dataset_exists(dataset_dir):
for split_name in ['train', 'test']:
output_filename = os.path.join(dataset_dir, split_name + 'tfrecords')
if not tf.io.gfile.exists(output_filename):
return False
return True | 1 |
24a5c2a27c5cc0fd374187845f491650 | 171c1741f394f511122dd3767f6c71dd | Redirect any non-API calls to the Angular application
so our application can handle the routing | namespace CalculatorDemo.Angular5
public class Startup
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.Use(async (context, next) =>
{
... | 1 |
9cb18989a1341d5ad09fc2bfc224c6fc | d4dc30c212d34a1803df8a16a3540808 | returns a tuple containing the time interval over which the
reconnection rate is calculated | def getIntervalTime():
return http.HTTP_INTERVAL | 0 |
1e299788eabba9c6b21e1068255aa4ab | 1436aaa30a1a85032d961b727b5f1fd4 | 初始化四个方向向量 | {
for(int j = 0; j < yres; j++)
for(int i = 0; i < xres; i++)
{
directionVec[j][i][0] = - ( j / (yres - 1.0f) - 0.5f);
directionVec[j][i][1] = ( i / (xres - 1.0f) - 0.5f);
}
} | 0 |
5c3b40b2d1b6bdce2ef2d7bfdf498956 | 35c1481dbaccff8426acbfb52ccd6ef2 | Checks to see if this function failed to run previously | bool EpicFmsWiFi::infailure(void) {
return _failure_declared;
} | 1 |
e97178a32821d0e2eaadab8e7322acdc | e2b7111eec0e50b3ec5b1b7ff98bb8c7 | 获取每个月的最后一天时间 | try {
Date nowDate = sdf.parse(month);
calendar = Calendar.getInstance();
calendar.setTime(nowDate);
calendar.set(Calendar.DAY_OF_MONTH, calendar.getActualMaximum(Calendar.DAY_OF_MONTH));
return calendar.getTime();
} catch (ParseException e) {
... | 1 |
d9dee35b479c3105e0791fe26a70566f | 38f96d436f983d8609f5848edc51da4b | Writes the current value to the output, using the specified format.
IF this extension cannot write the value, returns false, otherwise true. | {
if(value != null)
{
IFormattable f = value as IFormattable;
if(f != null)
{
Write( f.ToString( null, FormatProvider ) );
}
else
{
Write( value.ToStrin... | 0 |
a0fdb04dcceb0c3c09a3d9c897128a66 | cfb17ff4256ee39a33ac45be54ad6c35 | RSA key pair is generated and stored securely. | class Job(ABC):
def rsa_key_pair(self) -> Optional[RsaKeyPair]:
pass | 0 |
72f6095f34521756e69e7228031cc6cf | 23f1a7aa08dacaa872eb7c536f52ce1e | https://www.hamayanhamayan.com/entry/2020/06/06/230814 | using DD = long double;
int N;
cin >> N;
vector<Point<DD>> s(N), t(N);
for (int i = 0; i < N; ++i) cin >> s[i].x >> s[i].y;
for (int i = 0; i < N; ++i) cin >> t[i].x >> t[i].y;
if (N == 1) {
cout << "Yes" << endl;
return;
}
bool res = false;
for (int x = 0; x < N;... | 1 |
4d0dac7f658d4733d28b72433cbb1073 | 8f50deab8e8be467923b6c72cc711bae | 在绘制管道的时候,应该根据不同的方向 绘制不同的管道 | class Pipe
drawPipe() {
ctx.drawImage(this.up_pipe, this.posX, this.up_height * 3);
ctx.drawImage(this.down_pipe, this.posX, 362 - this.down_height);
} | 1 |
eedeafc9aa1d72b94faffd2974c5884b | 0fa523db2da75d24a67885e2c9343e0c | Adds name to the class stack, for the duration of the block | push_class (array_t * v)
{
STACK_INC;
v->ref++;
sp->type = T_CLASS;
sp->u.arr = v;
} | 0 |
8bbf909bf7322cab94e4468ed2311809 | ffb80856762ea08971ceb3e80fbd3418 | Deletes the given entities in the database using a transaction. | namespace Helium.Service
public abstract class RepositoryBaseClass<TEntity, TKey> : IRepository<TEntity, TKey> where TEntity : EntityBaseClass<TKey>
public void Delete(IEnumerable<TEntity> entities)
{
HContext.RegisterDel<TEntity, TKey>(entities);
HContext.Commit();
} | 1 |
8ee0f09ac604c765a60b83618c5d4c8e | 084e948db1ca5b0f408685e67cc231d4 | クエリ文字列から指定されたキーを削除する | public class RequestHelper
public static string RemoveQueryParam1(string url, string key)
{
return
Regex.Replace(url, "[?&]" + key + "=[^&]*[&]{0,1}",
o => (o.Value.StartsWith("?") && o.Value.EndsWith("&") ? "?" : "") +
(o.Value.StartsWith("&") && o.Value.EndsWith("&") ? "&" : "")
);
... | 1 |
0dd5b1e89b9a5accf177524dfd425b94 | d7932abec30f6dc1dc799e00282dbf8e | Broyden-Fletcher-Goldfarb-Shanno approximation of the Hessian. | n = len(x)
H = np.zeros((n, n))
ei = np.zeros(n)
for i in range(n):
ei[i] = .5 * epsilon
g1 = approx_gradient(f, x + ei, epsilon)
g2 = approx_gradient(f, x - ei, epsilon)
H[i, :] = (g1 - g2) / epsilon
ei[i] = 0
return H | 0 |
f25c613717ea8e257ce0f88be8ea196c | 5de7778678331599e94b8f9118379235 | Permanently removes this stored procedure from the database. | resourceGroupName: string,
accountName: string,
databaseName: string,
containerName: string,
storedProcedureName: string,
options?: coreHttp.OperationOptions
): Promise<LROPoller<coreHttp.RestResponse>> {
const operationOptions: coreHttp.RequestOptionsBase = this.getOperationOptions(
... | 1 |
5ca9e3c1a242d77d339e6175dc906f1a | 8e4514ea16e05d0035e13a23b3c96c43 | 有ID记录获奖者,并移除列表 | @Service
public class RecordService
public int add(String awardId, List<Integer> memberIds) {
return recordMapper.batchInsert(awardId, memberIds);
} | 0 |
a35f83bd28fa3edbf54ae6cf68a6f45a | 51ed248d47700b05f8872032efd2d41d | возвращает всех авторов | $data = [];
$sth = DB::getInstance()->query('SELECT * FROM `authors`');
while($row = $sth->fetch()){
$data[] = $row;
}
return $data;
} | 1 |
711b78b5f391f6e2e1b00bf5db531387 | b263d59f630f1d7181958414a5fc3c05 | Converts a timestamp string of the format '02:14.667' to an integer
representing the total number of milliseconds from 00:00.000 | def stringTS_to_int(time_stamp):
t = int(time_stamp[0:2])*3600 + int(time_stamp[3:5])*60 + int(time_stamp[6:8])+float("0."+time_stamp[9:12])
return (t) | 0 |
30536d096b0cfe355b6ec9fab676094f | 82b8a5c0a2dd717d6cfe26e8af340d65 | #15 Get the biggest dimension - width or height. | if (any(dat4plot$VALUE > 0, na.rm = T)) {
return(max(dat4plot$VALUE, na.rm = T))
} else {
return(0)
}
} | 0 |
451f9e37de18f279f743eece5984576b | 5b63c264f4c2d14c5b5ead80b7af09cc | Makes a new table that is a copy of the table parameter (does not modify the original table),
but with rows removed from the table that have missing values in the column with label col_name | def drop_nonserious_rows(table, column_name):
for column in table.labels:
encode_nans(table, column)
full_df = table.to_df()
start_idx = table.column_index(column_name)
tbl = table.select(range(start_idx, table.num_columns))
df = tbl.to_df()
na_df = df.notna()
full_df = full_df[np.ar... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.