query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
7278e18a5ad1a533b095b58a2bf2ffaf | b51258e500703aeea0dd1575849d39a0 | Creates an array with n amount of identical objects. | T[] instances = (T[]) new Object[n];
for (int i = 0; i < n; i++) {
instances[i] = buildANewInstance();
}
return instances;
} | 0 |
b79fbf987f5fa311fdafe32ed3fcc4af | 776e9273b6593c04e32d819fe9d1d562 | When the timer expires, the question is marked as attempted. The control moves on to the next question. | Intent nextQuestion = new Intent(this, timeLimitedCongratulations.class);
nextQuestion.putExtra("passedCurrentScore", currentScore);
nextQuestion.putExtra("passedMaximumScore", maximumScore);
startActivity(nextQuestion);
} | 0 |
d8b87040ffa569398aad3c345c42c3c7 | 51392733eb25d3507ce816024545b842 | 点击判断是否与箭头指向关卡一致,一致则开启游戏,不一致则移动箭头 | function determination(arrowDirection){
if (isLevelTwo == false) {
if (direction === `${arrowDirection}`) {
answer = true
}
else {
answer = false
}
}
else{
if (numO... | 1 |
9949315d6de9d8dd8cf739b7faf53692 | 7d171aa402680f29478fc29a611b066a | Called when the AllowHovering dependency property changes. | {
if (EnableHover)
{
Dispatcher.InvokeAsync(() =>
{
var size = (int)(DotSize * _hoverDot.GetDpiScale());
MoveWindowWrapper(_hoverDot,
e.Location.X - (int)(size / 2),
e.... | 0 |
70c8e312ce4a8f06b3f892608800e145 | 4c83c0961539f751514daa3ae479cb58 | Получаем минимальную цену на семена | function getMinPriceBySectionID($sectionID)
{
$catalogID = 26;
$arSort = ['PROPERTY_PRICE' => 'ASC'];
$arFilter = [
'IBLOCK_ID' => $catalogID,
'SECTION_ID' => $sectionID,
'ACTIVE' => 'Y',
];
$arSelect = ['ID'];
$arTopCount = ['nTopCount' => 1];
$rsProducts = CIBlockEl... | 1 |
490e446b6122631b0a77a9e62047ed78 | be9bd2e5a1ea071666b258230b6e53f7 | helper function: convert int indirection level to string | char*
eh_etree_straddr (int dim, char* buf, const etree_addr_t* addr)
{
if (dim == 3) {
sprintf (buf, "[%08X %08X %08X %02d-%c]",
addr->x, addr->y, addr->z, addr->level,
addr->type == ETREE_INTERIOR ? 'I' : 'L');
}
else {
sprintf (buf, "[%08X %08X %08X %08X %02d-%c]",
addr->x, addr->y, addr->z,... | 0 |
1fcd796cf0ee06106fb8b77f372682fb | 6f84627477ba4e8d1c1b9d5cfe4bc896 | Debe ser llamado cuando no se vaya a usar el controlador
De-registrar listeners | public class SkillsPresenterImpl extends BasePresenterImpl implements
SkillsPresenter
private void unRegisterListenersPanel() {
if (!areListenersRegistered) {
return;
}
btnBackHandler.removeHandler();
tabPanelHandler.removeHandler();
areListenersRegistered = false;
} | 1 |
713b97cf0e6d98b03005b7c50eb50b30 | c87e739b60575214b34bb90940fe2997 | Check whether there still some pin tries (max 3) | {
if (GetPIN())
return TRUE;
RSP_DATA.w_rspcode = 'C'*256+'N';
return FALSE;
} | 0 |
c9f5841686f0495528c3c77918cdafcb | 6d3e8a39b6d4468d22bedfc346e713d5 | Initialises all the variables used by the checker | void initialise(){
found_tag_e = 0;
found_tag_dot = 0;
found_tag_minus = 0;
found_tag_plus = 0;
found_tag_multiply = 0;
found_tag_divide = 0;
found_tag_num = 0;
} | 1 |
da06d151e3d06c3cbf17e2914e62c0a2 | 611f69af0db8841437e264412a6196e2 | Creates the widget buttons and defines where they are displayed. | public class AnnotatedElementAnnotationsSection extends
ElementPropertySectionBase<AnnotatedElement>
@Override
protected void createButtons(Composite composite) {
Composite buttonComposite = getWidgetFactory().createComposite(
composite);
GridData buttonData;
buttonData = new GridData();
buttonData.verti... | 1 |
01b357be8bd3b1c055fde5387700670f | 8f596b52854399665d143498abe7cb0b | 跳转到上一年 | prevYear() {
this.setYearMonth(this.data.currentYear - 1)
} | 1 |
6af85a61c5834cedd2d5b9e8c9b0c2e0 | 8dd18f9b0bb30b19f2b696d7b88e37b5 | Getter pentru lista id-urilor tuturor utilizatorilor. | abstract class ilWaitingList
public function getUserIds()
{
return $this->user_ids ? $this->user_ids : array();
} | 1 |
fb5e9db02bbffb8c11419ba986ebf9a6 | aba36b0e0fee426510e649943d6a079c | 设置赛季开始时间 | public class GameModel
public void setStartTime(long startTime) {
this.startTime = startTime;
} | 1 |
d08a9ec6109f96c960d8ea0db2742072 | f66f5b0ac61de491a821fb248ef10e53 | Function to easily implement low pass filters.
The base parameters are for low pass filtering of
photometry signals | class LowpassFilter(object):
def __init__(self, fc=1.0, state=0.0):
self.fc = fc
self.tc = 2.0*math.pi*self.fc
self.state = state | 1 |
29a84e7c95253b33fe70f0140e0077ec | 18737771ecbafd3d8162147eb1ec93b1 | Determines whether the current <see cref="decimal"/> is a positive number. | namespace Mpcr.Core [DebuggerNonUserCode]
public static class ClrExtensions
public static bool IsPositiveOrZero(this double value) {
return value.IsValid() && value >= -_zeroEpsilon;
} | 0 |
5766691688c4bd08444302262f34e3f9 | ea9aaf96535c684aa00455c781a6d10f | Añade una nueva papeleta/voto | if votesCantons==[]:
newParty={}
newParty["Name"]=party["Name"]
newParty["Cont"]=0
votesCantons.append(newParty)
elif votesCantons!=0:
can = True
for nameParty in votesCantons:
if nameParty["Name"]==party["Name"]:
can= F... | 0 |
4f6d9d39386347bd33471e9f8f57f72d | c637eb2f6047fd05a93903bc63a19d95 | 获取某个省份下所有区域当月目标 | public String getProJianChengByPro(String province) throws ServiceException {
try {
return addressDAO.getProJianChengByPro(province);
} catch (DaoException e) {
throw new ServiceException("AddressServiceImpl.getProJianChengByPro()->"+e.getMessage(),e);
}
} | 0 |
4f011a004a75064aafa83302635d6c79 | 636950cf9ffee6792d39423d5eb8ec84 | Preprocess the band data. | if srate != fbank.srate:
raise ValueError('sample rate mismatch')
bands = len(fbank.b_i)
xsize = len(data)
subbands = np.zeros( (bands, xsize) )
for filt in range(bands):
tdel = np.round(fbank.tdel[filt])
sig = np.r_[data, np.zeros(tdel)]
if discard > 0:
y... | 1 |
01edaf3c21d687f3df0974fb947b8387 | a53769840d10fb585eafdc410103f475 | Action to be overriten in child | class Action:
def execute(self):
pass | 1 |
31d8f34fe7b8551ac42fdb5cc2318064 | b5e4f3e03f59ccdbb6ff8ddc73fabc05 | Tests the loginlog relation | {
$model = UserSetting::findOne(1001);
$query = $model->getUser();
verify($query)->isInstanceOf(ActiveQuery::className());
verify('Should be hasOne relation', $query->multiple)->false();
verify('Query result should be valid User model', $model->user)->isInstanceOf(User::class... | 0 |
edb71820e95967e33808d58ef30526e1 | e80699b7dc5880c2a45664b054f1edad | 根据订单状态传入值筛选出不同的订单数据 | public List<Order> selectOrderByStatus(String status, String userID, String shopID) {
List<Order> orders = orderMapper.selectOrderByStatus(status,userID,shopID);
if(orders.size() != 0){
for (int i=0;i<orders.size();i++) {
Order order = orders.get(i);
Lis... | 1 |
dadb73037019887569eb1be703b13433 | 91e0e8d548cbc01e690eb7458cc0c344 | Get all parsed data. | class FileParserService
implements FileParserInterface, HasErrorsInterface
public function getData()
{
return MyHelperService::arrToObj($this->parsedData);
} | 1 |
a3a1d81610e27000ebc9b6e118def6b9 | b7f469e24006071cd15ef7191fd5ee7e | Set UniProt protein name | public class Protein extends AbstractChemicalEntity
public void setPrimaryGeneName(String primaryGeneName) {
this.primaryGeneName = primaryGeneName;
} | 0 |
8f54a96824bfe2f731a32dbd7ad01e1f | 1344b2aa721ff61ca7311fdf5c021f06 | Shows the blocks moving from their previous to new position | [System.Serializable]
public class Block_Moving: BlockData
IEnumerator MoveBlock()
{
transform.position = localPosition;
while (transform.position != destination)
{
transform.position = Vector3.MoveTowards(transform.position, destination, moveSpeed * Time.deltaTime);
... | 1 |
36b9d3aa6d224a59381a743d8754f295 | 79533f7ba6f4fab817c6fa69009f0fd3 | Find the latest commit ({@code segments_N file}) and load all {@link SegmentCommitInfo}s, as
long as the commit's {@link SegmentInfos#getIndexCreatedVersionMajor()} is strictly greater
than the provided minimum supported major version. If the commit's version is older, an {@link
IndexFormatTooOldException} will be thro... | if(index == 0)
return appendEntries();
if(index <= context.getCommitIndex())
return CompletableFuture.completedFuture(index);
if(context.getClusterState().getActiveMemberStateList().isEmpty() && context.getClusterState().getPassiveMemberStates().isEmpty()) {
l... | 0 |
a5cd3877f3afc0802c6a1cd0446676dd | 6c3ca3fc0661e38ea34cd1fce4005755 | make a discretized tensor divergence operator for a cylindrical grid
|Description_cylindrical| | dr = DMatrix(self.nr, self.R, False, self.nsp)
drr = DDMatrix(self.nr, self.R, False, self.nsp)
dtt = DDMatrix(self.ntheta, self.theta, False, self.nsp)
radii = linspace(self.r1, self.r2, self.nr, endpoint=True)
dr = dr.todense()
for (row, r) in zip(dr, radii):
row /= r
... | 1 |
9a1ae85af96c56b1262fdabef1b2c009 | 1b98817bd5cb19122754fdc702b3ac89 | Returns new geometry whose coordinates are translated along axes. | namespace DotSpatial.Topology
IMatrix4 Translate(double x, double y, double z); | 1 |
46c1e0304905cb828895e0489f4f1d2f | e21d56296327ea38504ff46a241ab7b4 | 指定日期的限时特价列表 | $list=$this->special->getSpecialByDate($date);
foreach ($list as $k=>$v){
$v->showname = $v->spu_name;
$v->price = floatval($v->special_price);
$v->price_d = floatval($v->price_d);
$v->image =str_replace('https://fenithcdn.oss-cn-shanghai.aliyuncs','h... | 1 |
83c5c3a7379b0ade224ddb6d8c32139c | 59666c9275988277f5cd7863d7d27ac0 | Set WM8731 bypass enable. | void setI2CBypassEnabled(char enabled) {
writeBit(devAddr, 0x37, 1, enabled);
} | 1 |
bc350346e0c0ae8e8668dd73d55cdb53 | 742786703f1b1983fc63b9f7264f899a | Calculates the score for the height difference between the highest and lowest column. | if (thisPark.getAltitude() > park.getAltitude()) {
if (thisPark.getAltitude() - park.getAltitude() >= HIGHEST_ELEVATION_DIFF) {
return POINTS_HIGHEST_ELEVATION_DIFF;
}
if (thisPark.getAltitude() - park.getAltitude() >= LOWEST_ELEVATION_DIFF) {
... | 0 |
c792b6911cafa1af06a3a2bcce458546 | d0a603dcd66d5cc0df863bfa8f8885df | 我的房源列表接口:
0.登录校验 @login_required
1.获取登录用户的所有发布的房源
2.响应数据 | username = ''
user_id = session.get('u_id')
if user_id:
username = User.query.get(user_id).name
houses = House.query.order_by(House.id.desc()).all()
return jsonify(code=200, username=username,
houses=[house.to_dict() for house in houses]) | 0 |
fafc2ff59bdd98cf636df714591643de | f415019f46e6a3fd655cec71d878d435 | Test if getting acf image field return expected results | $plugin = acf_helper();
$expected = array(
'key' => 'field_foo',
'label' => 'Foo',
'name' => 'foo',
'type' => 'image',
'instructions' => '',
'required' => 0,
'conditional_logic' => 0,
'wrapper' => array(
'width' => '',
'class' => '',
'id' => '',
),
'return_format' => 'array... | 1 |
40e0ef9108953466b53fe2091d62ee0d | 1e1595017345582ba343ae93f164ddc0 | Hide the car hire options when the car hire checkbox is unchecked | namespace MTHeyzzenFlores
public partial class Form2 : Form
private void cmbCars_SelectedIndexChanged(object sender, EventArgs e)
{
if(cmbCars.SelectedIndex == 0)
{
btnOK.Enabled = false;
}
else
{
btnOK.Enabled = tru... | 0 |
b9526f28e13244ac197ec9d21d14a102 | 4555dd97fa581a1877bb20ac420eb92b | Add columns with text features which is transformed by using tf-idf | num_docs = data.count()
cleaned_data = clean_text(data, 'text_entry')
tokens = cleaned_data.select('_id',
func.explode(func.split(cleaned_data['text_entry'], ' '))
.alias('token'))
tf = tokens.groupby('_id', 'token').count()\
.w... | 1 |
f022a5e6f86d4aa58d71ccc7bf0b82b0 | c91058f31ab12959f79363be2a3ba4c6 | Function that creates the design matrix of argument x, which is an array.
Argument n is the polynomial degree. | def _make_design_matrix(x, knots, spline_degree):
data, row_ind, col_ind = __make_design_matrix(x, knots, spline_degree)
return csr_matrix((data, (row_ind, col_ind)), (len(x), len(knots) - spline_degree - 1)) | 0 |
586218d181cf0b5f4719c8de9acdcf8f | 27745df5b1d89a120a4ac57b068fb5e7 | 1 定义一个函数func(filename) filename:文件的路径,函数功能:打开文件,并且返回文件内容,最后关闭,用异常来处理可能发生的错误。 | def readfile(filename):
try:
fileHandle = open(filename,'rd')
text = fileHandle.read().splitlines()
fileHandle.close()
return text
except IOError as error:
print ('Read file Error:'+str(error))
sys.exit() | 1 |
0e1b951fa367450bce2537cda1921e81 | a9abcb2f31b2e3f449a504a3c3764845 | Give processes time to finish and kill them if they are stuck | if processMax is None:
processMax = self.processMax
while len(self.processList) >= processMax:
newList = [process for process in self.processList if process.is_alive()]
self.processList = newList
time.sleep(self.sleepTime) | 1 |
5842400041a5d940a745347a593db27c | 3e6c81d2f98b239e80a63edabefd9a40 | 自己不能回答自己的问题 | class ShowController extends UserController{
public function answer()
{
if(IS_POST){
$where = array(
'solve'=>0,
'asid'=>I('post.asid',0,'intval'),
'uid'=>array('neq',session('uid'))
);
if(M('ask')->where($where)->find()){
$model = D('Answer');
if(!$model->create()) $this->err... | 1 |
a1b923e4816c4c4db7ad6e4a2f5a7bd6 | 54086201a85047ecddac66a016597650 | The name of the stack group. The name must be unique in a region. | class GetStackInstancesInstanceResult(dict):
def stack_group_name(self) -> str:
return pulumi.get(self, "stack_group_name") | 1 |
4f93d8f9361aa134a8ba33d694af7e2d | c1d48d316d951e3a72afcf3289990cd8 | Tests check_validconnectionoutput to see if correct errors
are raised in 1st line. | temp_directory = self.useFixture(fixtures.TempDir()).path
lines = 5
sev_level = constants.LOW
conf_level = constants.LOW
output_filename = os.path.join(temp_directory, "_temp_output")
output_format = "invalid"
with open(output_filename, "w") as tmp_file:
... | 0 |
071f7723793055493ca967d5f3c311db | 1662911d385f97cbe36dacb1c3cf04b7 | Log profile connection event by incrementing an internal counter for that profile.
This log persists over adapter enable/disable and only get cleared when metrics are
dumped or when Bluetooth process is killed. | mMetricsLoggerWrapper.logAction(context, PROVISIONING_ACTION, provisioningAction);
mMetricsWriter.write(DevicePolicyEventLogger
.createEvent(DevicePolicyEnums.PROVISIONING_ACTION)
.setStrings(provisioningAction)
.setTimePeriod(AnalyticsUtils.getProvisionin... | 0 |
44332a84b6ff3674d7d18a8c8ed86bbf | 1c53c51a1d5763e20867e7b6082e9344 | Load the RSEM gene results file into a dict of dicts. | tsv_file.readline()
tsv_file_dict = {}
for line in tsv_file:
line = line.rstrip()
tsv_line_item = line.split("\t")
tsv_gene = tsv_line_item[1]
tsv_transcript = tsv_line_item[7]
if tsv_transcript not in tsv_file_dict.keys():
tsv_file_dict[tsv_transcript] = ... | 0 |
cb84d0e49de0ed31831722ff15c970d3 | 3ff094dc19b6fc96224e9bca9ef93bdc | Return shadingEngine nodes from a list of mesh or facet | def get_engines():
_engines = []
_meshs = cmds.ls(type="mesh")
for _mesh in _meshs:
_mesh_sgs = cmds.listConnections(_mesh, type="shadingEngine")
_engines += _mesh_sgs
return list(set(_engines)) | 1 |
67f0328f0b2b800b1ebdb690916d9b22 | ac512bb89d2757d9647f0d2bb73198aa | returns the checked out element from the checkout operation at the given directory
If the path is not a valid checkout directory, returns None | return_type = CheckedOutFile(self.context)
qry = ServiceOperationQuery(self, "GetByPath", [decoded_url], None, None, return_type)
self.context.add_query(qry)
return return_type | 0 |
f440f2167674da1690c0262fee4f088d | bbb1a5fad9507c7632cc8bd31a271b01 | Process MSG_BKUP_TXN_BEGIN_GETGXID message | void
ProcessBkupBeginTransactionGetGXIDCommand(Port *myport, StringInfo message)
{
GlobalTransactionId gxid;
GTM_IsolationLevel txn_isolation_level;
bool txn_read_only;
uint32 txn_client_id;
GTM_Timestamp timestamp;
uint32 txn_global_sessionid_len;
const char *txn_global_sessionid;
gxid ... | 1 |
971a71844e4a6472fcaa1258b863bdc0 | 6aeef8ed02b22e1deaa4a18c4d3d0f9f | assumes binary trees rooted at left(i) and right(i) are max-heaps but heap[i] might be smaller than its children | if (isLeaf(i))
return;
int l = getLeftChild(i);
int r = getRightChild(i);
if (heapArray[l] > heapArray[i] || heapArray[r] > heapArray[i]) {
if (heapArray[l] > heapArray[r]) {
swap(i, l);
maxHeapify(l);
} else {
swap(i, r);
maxHeapify(r);
}
}
} | 1 |
d2f744662e76679631fdcd7384ec4def | 4df6ecae71e569297265d185146fd6f4 | ======================== ReRun =========================================
Function description
ReRun test. | function testAgain()
{
var value = dojo.byId("failed").value;
rulenum = value.substring(2);
return_value =validationForRuleSelection(rulenum," test again.");
if (return_value == 0)
{
return
}
console.log(rulenum);
var uri = "/raxakapi/v1/checkRule/V-"+rulenum+"?ip="+profileRunIP;
... | 1 |
ae3ba1a0950d798af75fe3875dcc49c2 | c3190440882dc5f28adc1eb7ce250044 | 创建一个int的切片,长度为5,容量为10 | func main() {
var arr [5]int = [...]int{10, 20, 30, 40, 50}
slice := arr[1:4]
for i := 0; i < len(slice); i++ {
fmt.Printf("slice[%v]=%v ", i, slice[i])
}
fmt.Println()
for i, v := range slice {
fmt.Printf("i=%v v=%v \n", i, v)
}
slice2 := slice[1:2]
slice2[0] = 100
fmt.Println("slice2=", slice2)
fmt.... | 0 |
56da5b6b3a41f2fdc7526d0fcebf28de | 1fcffd00bd53933557692c41e29376fc | Creates a new <code>CellStyle</code> for the given <code>Workbook</code>,
with the given attributes. Moved from <code>StyleTag</code> here for
0.5.0. | VolantisProtocol protocol, MCSAttributes sourceAttributes,
boolean generateDefaultId) {
TableCellAttributes tableAttributes = new TableCellAttributes();
if (sourceAttributes != null) {
tableAttributes.copy(sourceAttributes);
}
Styles styles = tableAttr... | 0 |
253c52cdcc170cdc7bcb4958061f2d63 | 907ed1e688c559e3bf9553584b9ed429 | クラス(インスタンス)のフィールドの値を取得する | if (!isset(static::$_fields[$classname])) {
throw new \RuntimeException('class ' . $classname . ' hasn\'t been inflated');
}
if (is_null($fieldnames)) {
return static::$_fields[$classname];
}
elseif (is_string($fieldnames)) {
return empty(self::$_fields[$classname][$fieldnames])
? null
: self... | 1 |
b2d5342d6afae45e62330c6294e293b9 | cc4c9ba7f5724dc16ef55b6aa80d00dc | Get End Date from String date foramt (format could be YYYY / YYYY-Qn
YYYY-MM ) | class StatsHelper extends AppHelper
public function getDateEnd( $key)
{
$date = isset( $this->request->query [$this->dateKey( 'endQuery', $key)])
? $this->request->query [$this->dateKey( 'endQuery', $key)]
: date( 'Y-m-d');
return $date;
} | 0 |
546c12bb955019f8d225c44a198e3aba | 6470d1d25acbbffff161162d2ca646f0 | Method for handling Spine element missing. | export class MediaComponent implements OnChanges
errorHandler(): void {
this.handleMissing();
} | 0 |
c4ba08c3014e866339d3dfedf4cad92c | 0049270ccf67740d963f413ef970e326 | Go through every standard level model and write its collision grid list pointer | {
u8 *ByteHdr=(u8*)FileHdr;
for (int i=0; i<FileHdr->LayerCount; i++)
{
sExpLayerHdr *LayerHdr=(sExpLayerHdr *)&ByteHdr[FileHdr->LayerOfs[i]];
switch(LayerHdr->Type)
{
case LAYER_TYPE_TILE:
switch (LayerHdr->SubType)
{
case LAYER_SUBTYPE_ACTION:
LayerList.push_back(new CMkLevelLayer3d(... | 0 |
09085a52dbe8db556ab12e659c4ef98b | 1d2eb4fc1dc1edcc8f249d7e14e0b1b6 | click event for filtering the playlist. | var searchvalue = $("#searchinput").val();
var playlisttoshow = [$(`.main-playlists`).find(`.${searchvalue}`)];
if (searchvalue == "") {
getallplaylists();
}
if (playlisttoshow.length >= 1) {
for (let index = 0; index < playlisttoshow.length; index... | 0 |
aae6491fca26152c7c79954867668b27 | 591c19bdfdf5937a50ca6a211d04c782 | 获取dialog中确定按钮控件,从而外部就可以再定义其样式了 | class FollowDialogue(base_frame_view.BaseFrameView):
def ok_button(self):
id_ = 'com.jiuyan.infashion:id/dialog_tv_ok'
return text_view.TextView(self._dialogue, id=id_) | 1 |
eb00dbc42a1d8f40d0124ff0dde4ecbb | 5a022f621d4c40494dae08dbfcf603e9 | @brief Returns the threshold that determines wheather the pixelvalues
are shown. | @SuppressWarnings("rawtypes")
public class Tile extends Control
public double getThreshold() { return null == threshold ? _threshold : threshold.get(); } | 1 |
c3c6d3f1e0952f6a1f9e229ba214abe2 | 890380409c4024fa997d0744333071d8 | Takes a list of module codes
e.g. ["MATH1234","COMP1234"]
and generates a url from which to pull
timetable data and returns this url | class Helper:
def gen_url(self,id_list):
base_url = 'https://www.itjuzi.com/company/{}'
url_list = [base_url.format(id[0]) for id in id_list]
return url_list | 0 |
30f9cd11877c6c34a550453a147fda09 | e65b027813965bd036bba9273eb4be66 | Does this JVM support {@link java.util.LinkedHashSet} and {@link java.util.LinkedHashMap}?
<p/>
Note, this is true for JDK 1.4 and above; hence the deprecation. | boolean isJava8Compatible(); | 0 |
eefa5922616d2b42f8eae7517812f02c | 293cc47894a069bb4f443b3b39bd427c | Test request ajax view if ajax request. | class TestAjaxListTagsView(TestCase):
def test_non_ajax(self):
response = self.client.get(self.url)
self.assertEqual(400, response.status_code) | 0 |
a3886652fbd817d075d4616d2d0ca546 | 4c50c35f01c0f09fbea72f588ed9480d | Parses skill level up, champion kill, and position data
of specified participant from JSON match details | if m.g['kxwt'].get('stats', None) == None:
m.g['kxwt']['stats'] = {}
m.g['kxwt']['stats']['mana'] = match.group("mana")
m.g['kxwt']['stats']['max_mana'] = match.group("max_mana")
m.g['kxwt']['stats']['hp'] = match.group("hp")
m.g['kxwt']['stats']['max_hp'] = match.group("max_hp")
m.g['kxwt']['stats']['movement'... | 0 |
1b9a697995dc846b9bd0636ec6425c4b | 8274d27789d2720f5a467ac176e99cd8 | Returns the portlet ID of this portlet. | String getPortletId(); | 1 |
c07f240390e8387390e38514b94c2880 | 74971fcbb7384c30d3d998ec29e97827 | returns the length of the 'pseudo-intersection' of list A (short list) and B. duplicates are counted, hence 'pseudo' intersection | unique_set = np.unique(np.concatenate([a,b]))
pairs = itertools.combinations(unique_set, 2)
count = 0.0
for i, j in pairs:
unknown = False
try:
first = np_index(a, i) - np_index(a, j)
secnd = np_index(b, i) - np_index(b, j)
except:
unknown = T... | 0 |
a7ef53664006977974687ad9e0a2538f | e86489de736971329b0a56ddcc694844 | 开启TCP管道线程 | {
pthread_t *id = &threadId;
int ret = pthread_create(id, NULL, (void *)tcp_thread_entry, NULL);
if(ret != 0)
udp_printf("create android tcpServer pthread err\n");
} | 1 |
a89fc30cd91471d1bdbae05db5524456 | 8b26ddc4c9354220cf28123367058d7e | Check for data being ready for transmission to client | bool
nrf24_Communication::hasData()
{
return nrf24_dataReady();
} | 0 |
e82910bbe4aa826fb527e10b0942d2ed | e372869c9fef51ea4d55412118db9a18 | Change the max rows of a group. | class Partition
public function maxRows($noRows)
{
$this->maxRows = $noRows;
return $this;
} | 1 |
6c0ad18db72140e7a34131f738a7efcf | 3aa7eb3ae6af9de8a7551d68f421b3c8 | Put a binary file to the server. | class RESTClient:
def upload_file(self, binary: typing.io.BinaryIO):
return self.do_request('post', '/actions/upload_file', data={'field_name': 'binary'},
files={'userfile': ('example_filename', binary)}) | 1 |
3faa49edb5ddfc2d05bf0c5650fb9882 | 6b00e87e35115d1e0eb0f8ae54f1cce1 | Destroy the sound manager. | void SoundManager::selfDestruct(void)
{
if (getSingletonPtr())
delete getSingletonPtr();
} | 1 |
6cb1c1c5511dfe57f5c91c23fb49241a | aa89438dafcd95ec8dde5a2a756af1a9 | Send a message to the server, with acknowledgement | AckMessage res = null;
try {
ObjectOutputStream out = new ObjectOutputStream(new BufferedOutputStream(s.getOutputStream()));
ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(s.getInputStream()));
out.writeObject(tm);
out.flush();
... | 1 |
cac455c09421e5a6a5a77853752f8321 | 006acfc852e7217f2a7f5ed15d8b5eba | Iterator转换为Map,转换规则为:<br>
按照keyFunc函数规则根据元素对象生成Key,元素作为值 | public class IterUtil
public static <K, V> Map<K, V> toMap(Iterator<K> keys, Iterator<V> values, boolean isOrder) {
final Map<K, V> resultMap = MapUtil.newHashMap(isOrder);
if (isNotEmpty(keys)) {
while (keys.hasNext()) {
resultMap.put(keys.next(), (null != values && values.hasNext()) ? values.next() : null)... | 0 |
2fb33914fe9df75818fc17afb79b9b8b | 00f7e548087947b90439fe66932e11fa | Returns True if user is an artist | def isArtistChecked(id):
shelf = shelve.open('checked_artists')
try:
return id in shelf.keys()
finally:
shelf.close() | 0 |
a6d1c09de09f377e6b5ab08a1029a1ed | e0999ae811b9ec198d4fac5f87422def | Removes bounding boxes that have too much overlap
with other bounding boxes that have a higher score. | if len(detections)>0:
eval_func=max if isinstance(detections[0].det_score, Iterable) else abs
i=0
while i<len(detections):
j=i+1
while j<len(detections):
iou=box_iou(detections[i].bounding_box,detections[j].bounding_box)
if iou>threshold_iou:
i... | 1 |
0a4d436bacacc6e34ff1a6b083ec5382 | 1583e0a5c7fdc18bad2ed54ba0078467 | 计算多个止损策略结合回测的结果 | if not results:
print("没有可分析的策略回测输出结果,请检查results文件夹。")
return False
results_df = pd.DataFrame(results)
for bookid in results_df['order_book_id'].value_counts().index:
top10_results_bysharpe = results_df[results_df['order_book_id'] == bookid].sort_values(by=["sharpe"], ascending=False... | 0 |
81535d996c8bb9c36959e4fb3cd1c5b9 | ec5628169d1dc98738cffc24ab6ac6d6 | Fill the array with the integers from 0 to a.length - 1. | init_a(size_t n)
{
for (size_t i = 0; i < n; i++)
a[i] = i+1;
} | 0 |
400d156b261343ea3ac021d7cce3222f | 290a95974b7ac14cc579042b86dde81f | Increments the amount of games the player has played. | def incrementPlayerMatches():
global playerMatches
playerMatches=playerMatches+1 | 1 |
6596e29bf95fd2d2e90f1bbfd3ddb2c6 | 5984d384f751762bbdf73babced2101f | get optional parameter (e.g. article title) | class ArgsParser(private val args: Array<String>, private val template: String)
fun option(index: Int) : String {
if(index in 0 until optionParams.size)
return optionParams[index]
return ""
} | 0 |
266951698801fa00d4c0783308be3b3e | 7aa3584ba6d29158e5feaa22a8754ad9 | Get htMoteur2. | class Appareil
public function getDateRgMoteur2()
{
return $this->date_rg_moteur2;
} | 0 |
8653f15be9b1301156d80f3720f83a1e | 9634ecb25f80e362c66c63704de9afd0 | Returns the value of the '<em><b>Colour</b></em>' attribute.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Colour</em>' attribute isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | public Color getColour()
{
return colour;
} | 1 |
330b62aa885a2d5e3bbd277dc43850e1 | 8b8e033c733e203c61f1ad4b0e5f0126 | complex 1x1 convolution | void AB(gsl_matrix_complex *A,gsl_matrix_complex *B,gsl_matrix_complex *C){
gsl_complex alpha;
gsl_complex beta;
alpha=UNIT;
beta=ZERO;
gsl_blas_zgemm(CblasNoTrans,CblasNoTrans,alpha,A,B,beta,C);
} | 0 |
bd897c8e8565d00e4e36e3fdacacdf83 | 2d6588477dece1823871749eddb40f76 | 查询放款数据,不做分页 | List<Loan> QueryInitLoan(); | 1 |
a96d8c39094ef5968e93cc859777118b | 2b9c4b3ef19c8d75097633a35e68ed9f | Sets the return address for the block | class MailMessage
private function _setReturnPath($return_path)
{
$this->_headers['return_path'] = $this->_normalizeAddress($return_path);
} | 1 |
20769d36cab9756ff071ef01f1270184 | e2790a9798c28a78eb72b8d549980bf5 | Save full model in self.sess by tf.train.Saver, all vars must have been initialized.
Default save path = self.config.out_path/self.config.model_file_name | class CorefModel(object):
def save(self, saver):
print('saving path ' + join(self.opt['model_file'], 'model.max.ckpt'))
saver.save(self.sess, join(self.opt['model_file'], 'model.max.ckpt')) | 1 |
9996f5fd3bb34c7b71aaa00f97e4e1f4 | e825c13172b852bd6c54a67dc5c9a38f | @brief 查询城市是否存在 | int is_city() { return 1; } | 0 |
3db47170c7d85fa5a6f32efe3bfa3eff | 03a950bf249f09b3cbd4575b015bed06 | Determines whether or not the supplied SQL exception was caused by a duplicate row being
inserted into a table with a unique key. | public function isDuplicateKey(databaseException $exception); | 1 |
4233a08734b5552711eae933478563f0 | 76a97279e656a00f25b2640ca72a070d | Метод знаходження факультету з найбільшим числом студентів | {
$select = $this->getDefaultAdapter()->select();
$select->from("facult");
$select->where ("id=".$this->facultId);
$rows = $this->getDefaultAdapter()->fetchRow($select);
return $rows;
} | 0 |
5a2daed9a05a164322768614283a6f67 | 6096dfc97006b0678606baab8f9113f0 | Notify about changed property count. | namespace OpenHome.Net.ControlPoint.Proxies
public class CpProxyAvOpenhomeOrgMediaServer1 : CpProxy, IDisposable, ICpProxyAvOpenhomeOrgMediaServer1
public void SetPropertyUpdateCountChanged(System.Action aUpdateCountChanged)
{
lock (iPropertyLock)
{
iUpdateCountChange... | 1 |
5a6231822f06eaec57c40de186d001da | 41e52d0945e3419f46821d68d1bcd347 | Take a character and turn it into an id for storage | class Vocabulary(object):
def char_to_id(self, char):
if char in self._vocab:
return self._vocab[char] | 1 |
44d799f40a3add008dc5a9ff60048fa2 | 38e16dd1d318d72663cd358001ab654a | 导出-会员层级 | class UserLevelController extends BaseController
public function export()
{
return $this->userLevelService->export();
} | 1 |
5fc7a47047a5d6daefa2bc092e52dc9d | 7e51efb975529b577b824ae538d42b73 | We rotate the character to have the same rotation of the camera | public class PlayerChar : MonoBehaviour
void RotationUpdate() {
RaycastHit hit;
Physics.Raycast(camera.ScreenPointToRay(Input.mousePosition), out hit);
Vector3 mousePointOnGround = hit.point - hit.point.y*Vector3.up;
rotatable.transform.rotation = Quaternion.LookRotation(mousePointOnGr... | 0 |
12df3832a9861c83800ef70c718c70b3 | ff0410b7f09f868e4529e494252cf479 | I2S out PCM数据预留处理接口,此接口会被audio库调用。如果需要,请实现此处理函数 | static enum mad_flow output(void *data, struct mad_header const *header,
struct mad_pcm *pcm) {
struct Sound* sound = data;
unsigned int nchannels, nsamples;
mad_fixed_t const *left_ch, *right_ch;
int i;
nchannels = pcm->channels;
nsamples = pcm->length;
left_ch = pcm->samples[0];
right_ch = pcm->samples[1];
... | 1 |
eba413cfefbe1545826cda11897e1b66 | 1f0da9867c135f6e3e37ba33f758ac57 | 获取风格样式的横幅图片url | function getPicByStyleIndex(src, index) {
const styleName = [
'image/resize,m_fill,w_200,h_200,limit_0/auto-orient,1/quality,q_90/format,jpg/interlace,1/watermark,text_bWFya2Rvd24gYmxvZw,type_ZmFuZ3poZW5na2FpdGk,size_12,t_100,shadow_100,color_ffffff,g_se,y_10,x_10',
'image/resize,m_mfit,w_600,h_600,limit_1/au... | 1 |
94b67c674540ba9293d9031ce32859e1 | 6a175ce08962b55d15caaf8853d33cb8 | Retorna lista de artigos por veiculo | $rows = $this->database->table('article')
->where('race', $raceId)
->order('changed DESC')
->limit($paginator->getLength(), $paginator->getOffset());
$articles = array();
foreach ($rows as $row) {
$article = $this->getArticle($row->id);
$article->repository = $repository;
$articles[] = $artic... | 0 |
5df880d75d1174b0c639f50ad1706476 | 15a9fed03f18e462c1112e2a51a54514 | Sort list categories by order field | class catv_fm_admin_lists extends WP_list_Table
function usort_reorder($a, $b)
{
$orderby = (!empty($_GET['orderby'])) ? $_GET['orderby'] : 'post_date';
$order = (!empty($_GET['order'])) ? $_GET['order'] : 'desc';
if (property_exists($a, $orderby)) {
$result = strcmp($a->{$orderb... | 1 |
265be90ba53cac26d14435f702ba76f0 | 1234b89f9ba0ed94636de3f4d8a5d5d0 | make a copy of all the vm_entrys.
Needed to Duplicate Process (fork). | uvm_copy(uint64_t * pgdir)
{
uint64_t *newpgdir = vm_init();
if (!newpgdir)
return 0;
for (int i = 0; i < 512; i++)
if (pgdir[i] & PTE_VALID) {
assert(pgdir[i] & PTE_TABLE);
uint64_t *pgt1 = P2V(PTE_ADDR(pgdir[i]));
for (int i1 = 0; i1 < 512; i1++)
... | 1 |
61ef0c8589dc39c3b20139dcbff34fd2 | 539bfae6b210f69ef33e46dafd85445e | Rolls a specified number of dice with the specified number of faces | function rollDice(diceSize, count) {
var results = [];
for (var i = 0; i < count; ++i) {
results.push(getRandomInt(1, diceSize));
}
return results;
} | 1 |
b4e2a1b211da7ffb2d272d989182ea98 | 20df9fb5287b137759a95615b83e6597 | 求N个数字的最大公约数 | function math_ngcd() {
var arry = Array.prototype.slice.call(arguments);
var a = arry[0];
for (var i = 0; i < arry.length; i++) {
if (arry[i] == 1 || arry[i] === 0) {
return 1;
}
a = math_tools.gcd(math.abs(arry[i]), a);
}
return a;
} | 1 |
892014ecb807c628acfdcb7de02551f4 | 5354833e0758aef59f6e661273eaa8d2 | GET: Timetables/Create | {
if (string.IsNullOrEmpty(Convert.ToString(Session["UserName"])))
{
return RedirectToAction("Login", "Home");
}
ViewBag.ClassID = new SelectList(db.ClassTables, "ClassID", "Name");
ViewBag.ProgramSessionID = new SelectList(db.ProgrameS... | 1 |
25882599e3424da77e82b1d0c8f5434a | a452362abee61c336c6b511d3b54d3b0 | Utilizando Linq obtengo el total
de la venta sumando el producto de las cantidades
por el precio de cada producto | {
double total = 0.0;
for (int i = 0; i < records.Count; i++)
{
total += ((double)(((RecordInCart)records[i]).Price) * (double)(((RecordInCart)records[i]).Quantity));
}
return total;
} | 0 |
ccf70ca95c3eab7e2189e1240e86ea6d | a1d671bac95977a25c1e4fea5fc807bf | 非惠商户布局组件并注册事件 | function HamBunFilling() {
this.register();
this.init();
} | 0 |
171bee0ecb965395ea6bff5aa9f434c6 | 6bd9c6b6217d9ddfcd8e328d8c928f5d | 用户列表调用(发送获取userList的请求) | function request_userList(obj) {
return ax.get('users', {
params: obj
})
} | 1 |
0a0667b8947da74c56c92b1f8425a796 | 881eee07c946daaf39d44ebf146cf73b | Takes an arbitrary string `serialized_call` and attempts to find a cached value
in Redis for it based on an md5 hash of the value as the keyname.
Failing that, passes `serialized_call` call onto the function passed as `external resource`,
takes the result and caches it in Redis with an expiration of `ttl` which default... | impl<H> WasmExecutor<H>
where
H: HostFunctions,
pub fn uncached_call(
&self,
runtime_blob: RuntimeBlob,
ext: &mut dyn Externalities,
allow_missing_host_functions: bool,
export_name: &str,
call_data: &[u8],
) -> std::result::Result<Vec<u8>, Error> {
self.uncached_call_impl(
runtime_blob,
ext,
al... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.