query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
3ac9b38c0582dbdae8514a1f6a55f3f4 | 43a56684de8b1e8fff51b72c092e0278 | 内部使用的, 用来讲头信息保存到cache中 | class Api
public function _get_response_header_cookie($response_header)
{
$this->cookie = explode(";",$response_header['Set-Cookie'])[0];
$this->CI->cache->save($this->api_name.'_cookie',$this->cookie);
} | 1 |
e3cf9d04496a7cb25b49df2f02c37bb0 | c9d128e1f0b49a0b6348167e13d25f79 | It will do all the basic Configuration and send Default config data to DSS | class SRTIFDistributorImpl(SRTIFDistributor, cc, services, lcycle):
def setDefault(self):
self._reset_configuration()
self.setup(self.attributes['DEFAULT_CONFIGS']) | 1 |
e728910b50e773d953abfc533a3f1ef8 | 425cde8c4d1252e9e7e24a36bfeabcfa | 退出上一次的Needle | {
b_HavingBottle_flag = FALSE;
sys_requestServoPulseWidth = 50;
return FALSE;
} | 0 |
559f918771031ec8b5e5b26b7c4b404e | ec70c2c530e47a36c7bfd01dcdd4cbad | return index of node at specified coordinates with tolerance
or -1 otherwise | public boolean hasNode(double lat, double lon); | 0 |
a211f7ee9f57838b791a7de3d1bbc143 | ce3415c5a0fdf22beb3e76fbacdc257c | Posts a link to the help docs server for my bot | {
string link = "http://github.com/drru97";
help_form helpForm = new help_form(link);
helpForm.ShowDialog();
} | 0 |
4ab1a2e734ae78862ebe0756513199cf | c8b3ff1a1824b260daaee17cd5583273 | 缓冲区半径设置 | public class Math3DRegionFlood extends com.earthview.world.spatial3d.analysis.Math3DBaseObject
public void setSearchRadius(double value)
{
double valueParamValue = value;
setSearchRadius_ev_real64(this.nativeObject.pointer, valueParamValue);
} | 1 |
aa3ea2adec8343d96268845e74fef7bb | 00a97065954ecb62445614b9f3dbf910 | Returns the value of field id_contrato_penalidade | abstract class BaseContratos extends BaseObject implements Persistent
public function getPnv5()
{
return $this->pnv5;
} | 0 |
5d45ff8d40d0217987aa1efab46578be | 8fdbfe4a34ca788ba23aa9b20d06844b | Verifies if the Last Page Link is enabled or not | try {
if (((response.getCurrentPage().intValue()) != 1) || ((response.getCurrentPage().intValue()) == 0))
return true;
else
return false;
} catch (Exception e) {
return false;
}
} | 0 |
abe75744ed68cf8b6f084dbf4e332ac5 | ffad7e5740bf274bb1cecbc87fa38dd6 | 字符串转换为10进制数 | def str2num(s):
return reduce(lambda x, y: x*10+y, map(char2num, s)) | 1 |
c160b94a5a126e11c4609a7176662de0 | 22fe61359b465f98166a4e7c33c572db | Generates Regression Test base on the current test. | UUID processorId = Generators.timeBasedGenerator().generate();
LinearRegressionProcessor regression = new LinearRegressionProcessor(processorId, DEFAULT_NAME, DEFAULT_DESCRIPTION);
regression.addParameter(
Parameter.integerParameterWithIdAndName(WINDOW_LENGTH_PARAMETER_ID, "Time-... | 0 |
96b7a49f00b99e28d3db486ce37b558c | 1395c26cdc1cda9f03f69b1c48c8d73a | Returns the meta object for the container reference '{@link study.Course#getDepartment <em>Department</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EReference getDepartment_Course(); | 0 |
f4c496d0b1885f818d46e470c5d92c35 | e0e7c7618299a8639fa446ece22003c5 | Get amount of free memory within the heap in bytes. | int freeMemory() {
char top;
#ifdef __arm__
return &top - reinterpret_cast<char*>(sbrk(0));
#elif defined(CORE_TEENSY) || (ARDUINO > 103 && ARDUINO != 151)
return &top - __brkval;
#else
return __brkval ? &top - __brkval : &top - __malloc_heap_start;
#endif
} | 1 |
c3cb7217b1c9077ffc4585465d59ad8f | 1e688213bb40c01677e7d89a7bcba7a6 | Read a bandit dataset as specified by name. | def get_uci_data(name):
spec = DATA_SPECS.get(name)
if spec is None:
raise ValueError('Unknown dataset: {}. Available datasets:\n{}'.format(
name, '\n'.join(DATA_SPECS.keys())))
with tf.io.gfile.GFile(spec.path) as f:
df = pd.read_csv(f)
labels = df.pop(spec.label).as_matrix().astype(np.float32)... | 1 |
52aec80d285b987d7ee8f7b11d903f65 | 8de8e58db54013d7833d11c62db63847 | 绿色高亮打印 | class Utils
public static function echoGreenOverride($text)
{
$pad = " \x08\x08\x08\x08\x08";
echo "\r\033[0;32m$text\033[0m$pad";
} | 1 |
6454df90eb6691542b073f6a78e93917 | 83f227f13b6fc7e04329b4144ee346ba | Gets 'Total' sum. | public class X_RH_DriverEvaluationDetail extends PO implements I_RH_DriverEvaluationDetail, I_Persistent
public BigDecimal gettotal ()
{
BigDecimal bd = (BigDecimal)get_Value(COLUMNNAME_total);
if (bd == null)
return Env.ZERO;
return bd;
} | 1 |
61df54e758dcef56cd39dedb8fa96beb | ef3f736945ba776cffb46933fe52247a | jquery封装ajax的方法 | function qjy_ajaxform(obj,callbak){
var data=$(obj).serialize();
var url=$(obj).attr('action');
$.post(url,data,callbak,'json');
return false;
} | 1 |
86630519c970f8493df34701e10f7e0e | 59d19f033256701243e2170425a4cce0 | Get corresponding elements.
- Use CSS selectors.
- Returns a list, not ResultSet Object. | class WebParsing(object):
def get_elements(self, selector):
return [element for element in self.soup.select(selector)] | 1 |
5ba7fac10b1bd08436b68435b16a9438 | 345da1aead7d6795e8c4270083c19668 | 根据维值Id查询出与之对应的公司表中的数据,前台显示公司代码以及公司名称(分页) | @Service("copyService")
public class CopyService
public List<PageData> querypany(PageData pd) throws Exception{
return (List<PageData>)this.dao.findForList("CopyMapper.querycompany",pd);
} | 1 |
2b81a4165ff13d3764e5d6ab084d48f0 | 1f11fbcbf0112eb2aab04b3cc8588bda | переопределяемый метод для определения, числовое ли значение в строковом параметре | {
foreach (char chr in value)
{
if (!Char.IsNumber(chr)) return false;
}
return true;
} | 1 |
b74bdd050e85edb03311ff3db4806b4e | 40a1dc891b4e3bd3f1fc0a86408bc0ab | remove empty string and the closing -- | class BossmailCheck extends Check
function strip_footer(string $msg): string
{
if (false === strpos($msg, '--'))
{
return $msg;
}
$parts = explode('--', $msg);
return implode('--', $parts);
} | 0 |
1e9d0e03f054330ab749d3964b2ddbdd | 7731a65829badca627329dac236b61cf | Junta entidades nomeadas da mesma pessoa | df = pd.DataFrame()
for name in names:
other = get_entity(instance, name)
if df.empty:
df = other.to_frame()
else:
index_names_before = df.index.names
df = df.join(other, how='outer')
if index_names_before != df.index.names:
... | 1 |
ed8120e0fa233700cf6ef27027e7953d | 16b7632d8f75ed23df30cbc241fe95db | 注册带路由中间件, 注册Guard | func RegisterRoute(router *gin.Engine) {
router.Use(middlewares.ServerRecovery(), middleware.GenRequestId, middleware.GenContextKit, middleware.AccessLog())
router.NoRoute(controllers.Error404)
router.GET("/hello", controllers.HandleHello)
router.POST("/test", controllers.HandleTest)
router.POST("/test_validator",... | 0 |
6f64d4965a49e1a3093f24a4793c36eb | a3c62b62a7c058068e16e1ba3a82e2e1 | 返回有权限的系部查询条件 | @Service("departmentService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
open class DepartmentServiceImpl @Autowired constructor(dslContext: DSLContext) : DataTablesPlugin<DepartmentBean>(), DepartmentService
override fun searchCondition(dataTablesUtils: DataTablesUtils<DepartmentBean>): Condit... | 0 |
26a0aaf2ab63f498f54bcc1e19becbfb | 7aed3bf02e2ff89703d925a62af1365c | Save member bill transaction. | {
this.Adapter.BeginTransaction();
DataTable dtInsert = (DataTable)System.Web.HttpContext.Current.Session["InsertParam"];
MemberPaymentClass payObj = new MemberPaymentClass();
MemberRegistrationClass regObj = new MemberRegistrationClass();
int rowsAffe... | 1 |
1d95f6a8241491b049aef16878541ebf | 339db5adc575ec11ee68b49ed9740e0d | resets coin values | {
totalValuePoundsOne = 0f;
totalValueShillingsOne = 0f;
totalValuePenniesOne = 0f;
} | 1 |
494ea73ec4e7780dd7958218fadf1e6b | 2ca1b5fed121edf61400ac86037d177d | 提取文件名部分
opt/data/aaa-bbb.jpg >> aaa-bbb.jpg | function splitNameFile($file_name){
$name = substr($file_name, 0, strrpos($file_name, "--"));
return $name;
} | 0 |
b08496a8a15c5408b1241935e490e592 | e6826e20119aec0393dc239eae9304b8 | Returns the number of related BaseMail objects. | {
$partial = $this->collVictimMailingssPartial && !$this->isNew();
if (null === $this->collVictimMailingss || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collVictimMailingss) {
return 0;
}
if ($partial && !$criteria) {
... | 0 |
7939e642536aa19b2ce27e0845e1aad7 | aa50b8f6fbf8ae6937d0dbf9e33e2869 | 搜索nodes列表及所有子节点中,第一个与value相匹配的节点,如果找不到,返回null | {
if (tnParent == null) return null;
if (tnParent.FullPath == strValue) return tnParent;
TreeNode tnRet = null;
foreach (TreeNode tn in tnParent.Nodes)
{
tnRet = FindNode(tn, strValue);
if (tnRet != null) break;
... | 1 |
1011ec6f99a569d3c35f26f1610430d8 | 951de4be72e8dd1a7fa6b42e8bb905d0 | 向HiveSever2发送查询sql,返回查询结果以及schema信息 | class MySQL2HBase(object):
def __to_hbase(self,host,db,user,password):
cmd ='sqoop import --connect jdbc:mysql://'
cmd +=host
cmd +=':3306/'
cmd +=db
cmd +=' --table express_delivery_status'
cmd +=' --hbase-table express_delivery_status'
cmd +=' --column-family de... | 0 |
f66cd99cffa6698ff4169a945591fdf9 | cff159ac0110fa55af53b96f67698ee3 | Updates user base attack power | void AScaryMazeBaseCharacter::CalculateAttackPower(float DeltaAttackPower)
{
AttackPower += DeltaAttackPower;
ValidateAttackPower();
} | 1 |
6192c93912939a7568a2b7d1442f6d09 | 2f83fede062c862a225daafeb04534c6 | Shows a text-panel if the player needs to reload. | public class ReloadText : MonoBehaviour
void Start () {
} | 0 |
8820134cdba6d2a872788ea9eccc9a6f | dab7225fc0a70629594a229e5a090395 | Run a long running function in a background thread.
(This is recommended for code that could block the event loop.)
Similar to Twisted's ``deferToThread``. | def bgRun( function, args=() ):
thread = threading.Thread( target=function, args=args )
thread.start() | 1 |
5c9eb9e7553e771aaeefaf2c9e796045 | ef3a7e5781140578e900b51ce20884ac | 保存用户的最近游戏记录 用,隔开,数据如,2012,1506,482... | Gson gson = new Gson();
String gameResultsString = "";
try {
gameResultsString = gson.toJson(gameResults);
} catch (Exception e) {
gameResultsString = "";
LogUtils.e("gson.toJson 异常");
}
SPTool.saveGameList(ConstantValue.GAME_LIST, game... | 0 |
71779231312fb02617a45343bb658664 | 3ca9c72924fdfecd81a7e83a2f6506b0 | base 2 counter | def counter(base):
def helper(digit, total):
if digit == 'done':
return total
if digit >= base:
return lambda x: helper(x, total)
else:
return lambda x: helper(x, total * base + digit)
return lambda x: helper(x, 0) | 1 |
d039eddb7978fc05a674e112c3fb275d | e7cca9ca2def25d0e6588271c88672b7 | Set the maximum allowed rating for avatars | {
$maxRating = strip_tags( trim($maxRating) );
if( !in_array($maxRating, self::MAXIMUM_RATING_LIST) ){
throw new \InvalidArgumentException("invalid value '{$maxRating}'.");
}
$this->maximumRating = $maxRating;
} | 1 |
1af144aaf8a16f67cc315b64dc20b113 | ab07b3b2ab67a315c57edfacfa3b28f9 | Generates a mask prediction for a single image. | return (
(obs["mask"].logical_not().float() + 1e-6)
.multinomial(1, generator=self.rng)
.squeeze()
.tolist()
) | 1 |
4efda71e2075a3e45e7736ab70e66fa4 | a59a85d7e62d9722c52823d752bfbd93 | 等待异步操作并获取返回的值. 线程会阻塞在这里,直至promise执行set_value | void await() const
{
boost::shared_ptr<hpx::lcos::local::promise<int> > p =
boost::make_shared<hpx::lcos::local::promise<int> >();
hpx::util::io_service_pool* pool =
hpx::get_runtime().get_thread_pool("io_pool");
pool->get_io_service().post(
... | 1 |
5d068fbd3ce2a2fa4d76d3b9ae78c005 | 9c2894e9016165815a49efb482e24b57 | returns an array of the most recent sensor values for five fingers. | {
FingerVals[] rawfingerVals = dataGlove.GetSensors();
float[] fingers = { 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f, 0f };
for (int i = 0; i < 5; i++)
{
fingers[i * 2] = rawfingerVals[i].sensor1;
fingers[i * 2 + 1] = rawfingerVals[i].sensor2;
}
retur... | 1 |
eadc85b5e04d20363d969e022a425f24 | f5a8421e96e0cd434ad14e3b1c66b659 | 将syncBuffer缓冲区中的数据刷入到磁盘中 | if (mDiskLruCache != null) {
try {
mDiskLruCache.flush();
} catch (IOException e) {
e.printStackTrace();
}
}
} | 0 |
8205d21f7e3d18e81dfa248bd083cd0d | d11f6cd3ecddf055e273fb561424924d | Test performance stats invalid data format function. | class ReadersAndWritersTestCase(unittest.TestCase):
def test_write_table_to_invalid_format(self):
pydatajson.writers.write_table(
CSV_TABLE, os.path.join(self.SAMPLES_DIR, "full_data.json")) | 0 |
caa6ae4fb7a1bb9ef813fdf7e4f4f08f | 0f2424a473e391e6c7c2a4b00cc1fed9 | ..........................
Step 1: Read resume JSON object stored in json file
.......................... | {
$this->resume = file_get_contents(__DIR__ . '/../' . $resume . '.json');
return $this;
} | 1 |
38bd96f470c01ab5a5eab1562b12477f | a00681e93c1011e29e4a87a74d3245d0 | apply power to peripherals | void powerEnablePeriph(void) {
HWREGBITW(PRCM_BASE + PRCM_O_PDCTL0PERIPH , PRCM_PDCTL0PERIPH_ON_BITN) = 1;
HWREGBITW(PRCM_BASE + PRCM_O_CLKLOADCTL, PRCM_CLKLOADCTL_LOAD_BITN) = 1;
} | 1 |
329bca9fd71e124240be375b549fcf64 | 0ec1319e667d4d8760095012859c145f | add settings page to list of WC settings | add_options_page(
__( 'Better WC Profile Pictures', 'bwcpp' ),
__( 'Better WC Profile Pictures', 'bwcpp' ),
'manage_options',
'bwcpp_settings',
array( $this, 'render_settings_page' )
);
} | 1 |
7ad32b75a066f5e5b5285cec9dfd9b08 | 068fa6451a9fa21dddb9acc8147af7d9 | Takes an array and adds the values of the array to the list. | public class Programming_Exercise_27
public static void fillList(int[] arrayList)
{
for (int i = 0; i < arrayList.length; i++)
arrayList[i] = input.nextInt();
} | 0 |
4a5fa4dcfbddf1a8d4088f2de07ffb50 | d6bd64ec6f95f4c4b60118d42475dfe5 | Contact probing consists of broadcasting a special BEACON message,
followed by listening for responses over some time. | ibeacon_payload = self._create_ibeacon_payload()
willbeacon_payload = self._create_named_beacon_payload()
process_command("hciconfig hci0 up")
while(True):
time.sleep(0.1)
self._setup_announce_payload(ibeacon_payload)
process_command("hcitool -i hci0 c... | 0 |
80e3591873149115e2740e37c1979d6b | ff7cfcd70483453783a62e5e4cb4bf37 | Teste que não deve cadastrar um usuário sem nome | response = app.test_client().post('/', json={
"name": ""
})
assert response.status_code == 400 | 1 |
29af1a83f0bfbcf9e0405c0ebf7422b9 | d041c741abad5d88812b729005226386 | Returns the length of the longest read. | def longest_fasta_seq(fasta):
with open(fasta) as fasta_file:
return reduce(
max, [len(s[1]) for s in SimpleFastaParser(fasta_file)], 0) | 1 |
3c15b07574ccd492d8eb5faf60793bf2 | 3e67b9d6bfad7f38b74bf7ff834cfa22 | This method add three point for Team B | public class MainActivity extends AppCompatActivity
public void addThreeForTeamB(View view)
{
scoreForTeamB += 3;
displayForTeamB(scoreForTeamB);
} | 1 |
e1f25e98c0ed8dc7b92762c489be62ac | e16bd03ab6c124945e39c340b6cc7654 | Setrideni vrcholu podle cisla stanice a casu odjezdu nebo prijezdu | {
for (int i=0;i<trc->l_otceps.size();i++){
auto num=trc->l_otceps[i];
if (TOS->mNUM2OD.contains(num)){
auto otcep=TOS->mNUM2OD[num]->otcep;
if (i<trc->l_otceps.size()-1){
if (otcep->STATE_KZP_OS()==m_Otcep::kzpMoving) otcep->setSTATE_KZP_OS(m_Otcep::kzpClosed... | 0 |
7a0168e611b201db6610a88f67cae0ae | fd6f96abb3c75dfccbe3c8d10e5a0523 | The {@link ReturningMapInfoListener} behavior is to set the selected BBox
and close the activity instead opening the {@link GetFeatureInfoLayerListActivity} | public class ReminderAdapter extends RecyclerView.Adapter<ReminderAdapter.ViewHolder> @Override
public void onBindViewHolder(@NonNull ReminderAdapter.ViewHolder holder, final int position)
@Override
public void onClick(View v) {
Intent resultIntent = new Intent();
dou... | 0 |
1608fce88ce556e8615f13f3a1723e6b | c474fee6e55f9bc2dd8e0ce01c4a1bf2 | 接收服务端发来信息的方法,单个套接字监听 | namespace SocketServer
public partial class mainServer : Form
void Receive(IAsyncResult result)
{
Socket clientSocket = result.AsyncState as Socket;
try
{
int num = clientSocket.EndReceive(result);
if (num > 0)
{
... | 1 |
2877ac454a030e637911d19108b6a262 | 655b353d79d5be2925091ae34288d4ac | Get current text editor info | function initializeTextBuffer(buffer)
getCurrentEditor() {
return atom.workspace.getTextEditors().reduce((previous, current) => {
return (current.getBuffer() === this.buffer && current) || previous;
}, undefined);
} | 1 |
a82c28d3c9ab4e0872cec2ef66e63507 | 1a8e18e2170ff93be27db15a90c4e351 | 拒绝时,没有获取到主要权限,无法运行,关闭页面 | public void onFailed(int requestCode, List<String> deniedPermissions) {
if (requestCode == 200) {
Toast.makeText(MainActivity.this,"未获取权限,无法正常使用",Toast.LENGTH_SHORT).show();
}
} | 0 |
94d13b79a1aa8fe3eaec88a92d7da0e6 | 4bf9f48d523feaf9832085ca7651a187 | function that deals with the grab object interaction while the button is pressed | if (OVRInput.GetDown(OVRInput.Button.PrimaryHandTrigger, controller)) {
Collider closest = null;
foreach (Collider col in grabbables) {
if (closest == null) {
closest = col;
} else {
if (Vector3.Distance(transform.po... | 1 |
522a15136dfc3ac3fdb71d369dc1c93f | ac0de5fac6f52b8604acc8f8b7cf2356 | Load thumbnail of a gif image resource. You don't have to load an animated gif when it's only
a thumbnail tile. | interface ImageEngine
fun loadGifThumbnail(
context: Context,
resize: Int,
placeholder: Drawable?,
imageView: ImageView,
uri: Uri?
) | 1 |
0ecd20ded76a6c943720789acf8b1d7a | cef3130685c88158b166cb14b40aa77b | We set up our own progress bar for erase since the erase command does not provide one | class AvrdudeProcess(object):
def setup_erase(self):
self.command += ['-e'] | 0 |
eb187529c894c1dd5fd70b3a71aabab8 | a5d4c30c42bb4033930f3a5baf4e3344 | 按照路径删除数组中的值 | rmValue.forEach((v) => {
arr.indexOf(v) !== -1 ? arr.splice(arr.indexOf(v), 1) : "";
});
return arr;
} | 0 |
39db8736865543c2b9d60b6e7b91cbd6 | 592e4d63030555d3402a1b7a34e51bff | 通过客户Id获取门店Id | public class StoreDao
public int getStoreIdByStaffId(int id) {
String sql = "SELECT store_id FROM staff WHERE id = ?";
int storeId = 0;
try {
PreparedStatement preparedStatement = connection.prepareStatement(sql);
preparedStatement.setInt(1, id);
ResultSet res... | 0 |
221ee3ed0c78f9d2169f2bfa2d02c63b | 409c4e6476173eac048544614ca37fb9 | Set store switcher to registry | class Main(KytosNApp):
def load_storehouse(self, event=None):
log.info("Loading Storehouse")
self.storehouse = napps.amlight.sdx.storehouse.StoreHouse(self.controller) | 0 |
05505f1fd449c9978a87a3a2ee7abe8f | 9172fc1db04a3b28080c43538a73e7dc | Updates the details of a client. | namespace Timesheets.Domain.Managers.Interfaces
Task UpdateClient(Guid id, ClientRequest request); | 1 |
0a23cb362b373b7a4f2d982370570e0c | 044acf7420c26e0e12cb44c955a36c1a | Converts the index of a DataFrame to a simple, one-level index
The target index uses standard SimCenter convention to identify different
levels: a dash character ('-') is used to separate each level of the index. | class ParquetFrame(BaseParquetFrame):
def cast_mi_level_to_str(mi: pd.Index, level: str) -> pd.MultiIndex:
mi_df = mi.to_frame(index=False)
mi_df[level] = mi_df[level].astype(str)
return pd.MultiIndex.from_frame(mi_df, names=mi.names) | 0 |
1754be73b18e140db8e299b936522ffd | be0db032e57d4d066151eff94decaabc | 运用pandas自带的ewma编写的MACD策略 | def get_macd(df):
short_ = 12
long_ = 26
m = 9
df['macd_diff']=(df['close'].ewm(adjust=False,alpha=2/(short_+1),ignore_na=True).mean()-\
df['close'].ewm(adjust=False,alpha=2/(long_+1),ignore_na=True).mean()).shift(-1)
df['macd_dea']=(df['macd_diff'].ewm(adjust=False,alpha=2/(m+1)... | 1 |
e0f678c106935c9b003d63862866a327 | e707ee082dc5c6562a41a7c822181473 | Calculates lexical diversity by dividing the number of unique words by the total number of words | class LexicalDiversity(BaseModule):
def calculate_type_token_ratio(self):
return self.num_of_different_words / self.num_of_words | 1 |
3139cae6b608eb8116eacd1ac33cf124 | b26d3e5434c66f234a52cd023d473fb1 | open file after substituting in the user's home area if necessary | def resolve_path(filename):
if filename.startswith("~"):
filename = os.path.expanduser("~") + filename.strip("~")
return filename | 1 |
50bb4655c331b1eabe652aaeac96cece | 83154516b04073d207a6dedc1e22943a | Soma de 50 elementos de um array | {
int i;
float soma = 0;
for (i=0; i<5; i++)
{
soma = soma + sal[i];
}
return soma/5;
} | 0 |
b58097e9c4091c42c5eff9bfefeb8e75 | 0890312eb816abbdd6241dd7bb8545cb | Добавляет данные в форму | function setData(data, form) {
for (let key in data) {
let input = form.querySelector(`[name=${key}]`);
switch (input.type) {
case 'radio':
let radio = form.querySelector(`[type=radio][name=${key}][value=${data[key]}]`);
if (radio)
radi... | 1 |
c26f0dfc01f499c69af2d795fd585584 | ea4c15af960bb6e48617e7ab50f7c9ee | !
@brief Sends over-the-air a Tunnel Closure Notification frame from the Tunneling server. | {
zclSETunneling_TunnelClosureNotification_t req;
FLib_MemCpy(&req.addrInfo, &gaZclSETunnelingTable[tableIdx].partnerAddrInfo, sizeof(afAddrInfo_t));
req.zclTransactionId = ZbZclFoundationGlobals(gZclTransactionId)++;
req.cmdFrame.tunnelId = gaZclSETunnelingTable[tableIdx].tunnelID;
return ZCL_SETunnel_... | 1 |
5e6fb61b6af244d157b039a9b935b16d | 82ea838d86869a7308c57311da9351b5 | 使用道具默认选中第一个 | public class ItemManager : MonoBehaviour
public void FirstSelectItem()
{
itemList[0].GetComponent<Selectable>().Select();
} | 1 |
964be8292c091bc55ae6519f4a0bc048 | fa3b5118ef5d8696e6183553d5d0ac72 | Metoda zmienia stan gry pomiędzy start/stop po stronie klienta | public class Server implements ServerInterface{
public void setGameStatus(boolean gameStatus) {
this.gameStatus = gameStatus;
} | 0 |
6407583ac0867e592f8a190a9bd9c8ea | 798b6ff8545ff3ed16f01e0c2cd1e8e3 | Checks that the client is authorised.
Used by the internal API endpoints to validate the user making
the request.
This function would implement a role-based access mechanism to
check that the user is authorised to perform an action. Since
those are well-proven, we don't implement any in this proof-
of-concept. | class Store:
def _check_authorized(self) -> None:
self._client.whoami() | 1 |
0a3e906f3f39166d5292c8e186df9100 | 95a734989ed860c4f1c10b55f89e1119 | 根据list并发执行,每个item通过_singleItemHandler回调来做具体的事 | public void doMultiExecute(List<MultiRequestBody> pBodyList, final ResultCallBack<List<Object>> pBack) {
if (pBodyList != null) {
List<Observable<Object>> observableList = doExecuteStyle(pBodyList);
Iterable<Observable<Object>> it = this.iterableReverseList(observableList);
... | 0 |
a19c1a22c366f8a7dcfdf6f0e422205b | df2222c4a8ec63693b551686c88bcd6d | Sets the value of the variable as int | public class CopperCubeVariable extends JavaScriptObject{
public final native JavaScriptObject setValueAsInt(JavaScriptObject v) ; | 1 |
cba45815db05efb327e5c6df9860fc66 | d7d20b2b34e6b9c9de48c7dd874eb0c1 | Tests get_next_authorizations | from dlkit.abstract_osid.logging_.objects import Log
if not is_never_authz(self.service_config):
assert isinstance(self.log_list.get_next_log(), Log) | 0 |
04ae898fa9a0563240b1fcff176e699a | 3484e56c517d4905190de7a03bd11678 | Filter out internal stack frames.
Only include those that are useful to the developer. | let result = "";
if (STACK_TRACE_DEPTH) {
for (let i = 0; i < STACK_TRACE_DEPTH; i++) {
const frame = STACK_TRACE[i];
result += "\n ";
switch (frame.type) {
case ComponentStackFrameType.Component:
const cls = frame.tag as ComponentClass<any>;
const instance = frame... | 0 |
5c3e24b183b72e8378180b542abfe17d | 23195d617a0ce456cb66f165dc827aff | 将技能兴趣标签加入view,自动换行,两端对齐 | public class ActivityDetailActivity extends BaseActivity
private void autoTextView(String[] tags) {
final int containerWidth = container.getMeasuredWidth()
- container.getPaddingRight() - container.getPaddingLeft();
final LayoutInflater inflater = getLayoutInflater();
final Paint... | 1 |
13f2c0830d9fad855e4eb6262733c4f7 | 30c5fef20c537baea95f1ff4ee657121 | 通过courseId找出所有策略 | List<Experiment> getExpesByCourseId(@Param("courseId") String courseId); | 0 |
6face335ff87805ec144245bde9fd866 | 6222807f0de3f5d833f2ea620c4bdef1 | Plot each metric vs. another in a 2D scatter with colors representing lcType | f_dfs = []
for f in features:
f_dfs.append(scoresheet.get_pandas_df(metric=f).stack())
df = pd.concat(f_dfs, axis=1, join="inner")
df.reset_index(inplace=True)
new_names = ['methods_str', 'networks_str']
new_names.extend(features)
df.set_axis(new_names, axis=1, inplace=True)
df['... | 0 |
05d31f7ed78a8e050be3d78f804bda2e | 1807627c77b32cbf974f3089dab3889c | \brief Destructor.
Ensures that the reference counter is consistent.
If there are no other references to the data, the data is deallocated. | wxJSONRefData::~wxJSONRefData()
{
} | 0 |
2706de7917a46a5e65bf3dd93bb5f01c | 0c249b13a96d83fc0daa8788bd92afc1 | 车主端获取订单详情接口 | @FormUrlEncoded
@POST(UrlConstant.ORDER_DETAIL_INFO)
Call<String> getOrderDetailInfo(); | 1 |
0123959dde84c86489274fedd2661453 | 4dd559690d64b2e22324a5d70d1c7d70 | Set thdPromF2Corriente | public class ContratosActivosMoraOV implements Serializable
public void setClaveT24(String claveT24) {
this.claveT24 = claveT24;
} | 0 |
b832997760faeb8cd944ce533f841aa0 | d6d1ab917f08b5682d8d9939c72384f7 | 获取内存中未确认的交易列表 | export default class AschAPI extends API
public async queryUnconfirmedTransactions(senderPublicKey: string='', address: string=''): Promise<object>{
let params:ObjectType ={
}
if (senderPublicKey.length>0) {
params[senderPublicKey]=senderPublicKey
}
if (address.length>0) {
params[address... | 1 |
0079513cba8978ec9a4f3cba68608914 | 0f5dc907bf301b6c4c87dbce7f9a5753 | 为左边的按钮设置文字 | if (leftButton != null) {
leftButton.getTextView().setText(text);
}
strLeftButtonText = text;
} | 1 |
00b8b81c66bbc0dcd1701547fa5c5ca7 | b4f14a9974dd562ba7044c6a02568d1b | Есть ли BlackHero на поле | def check_black_exist(board_dict):
for key in board_dict.keys():
if board_dict[key][0] == "B":
return True
return False | 1 |
52a036932c2df4afc7f64b002e0d0c85 | a89efd8d0bc088316965b58d94331e36 | <p>
Returns the focus owner.
</p>
<p>
<b>Note:</b> This method is accessed in the current executing thread. Such thread may or may not be the event
dispatch thread (EDT). Client code must call this method from the EDT.
</p> | public final class FocusOwnerFinder
@RunsInCurrentThread
@Nullable public static Component focusOwner() {
for (FocusOwnerFinderStrategy strategy : STRATEGIES) {
Component focusOwner = focusOwnerFrom(checkNotNull(strategy));
if (focusOwner != null) {
return focusOwner;
}
}
return ... | 1 |
92db2b79bc004899c0ed0afc9d2d7a1c | 108bbc8147e545236a2d5d6ab900d86b | benennt eine Datei oder einen Ordner um | public class Calculator extends javax.swing.JFrame
private void filebActionPerformed(java.awt.event.ActionEvent evt) {
JFileChooser chooser = new JFileChooser();
int rueckgabeWert = chooser.showOpenDialog(null);
if(rueckgabeWert == JFileChooser.APPROVE_OPTION)
{
String file = chooser... | 0 |
ef2b1aff4166f3b2eb5a668082f4d128 | 203e77f288037c39de96c53bc0dc2ea6 | Add a matching clause to the configuration. | {
$clause = ['field' => $fieldName, 'value' => $value];
if (!empty($table)) {
$clause['table'] = $table;
}
$this->clauses[] = $clause;
return $this;
} | 1 |
da99e589a99006c0f2e7250b0575d212 | 2980d630f6e61515bb3d80bcc35bb267 | 检测流程是否存在正在审批的表单 | public class CommonSearchBO extends CommBo{
public TdWorkFlowInfoForm findTdWorkFlowInfoFormByWorkFlowId(String workFlowNo){
TdWorkFlowInfoForm result = null;
try{
if(workFlowNo!=null){
String strHql="from TdWorkFlowInfoForm as wfif where wfif.workFlowStatus='R' and wfif.workflowNo='"+workFlowNo+"' order by ... | 1 |
755da73518dd953be41b59e81e725e05 | c26444531a6fd781575c38df6e21a22c | Create sentiment dictionaries from two sources. Dictionaries
contain {'word': sentiment_score}. | def load_sentiment_lexicon():
pos_lexicon_dict = {}
neg_lexicon_dict = {}
lexicon = iohelper.read_lexicon2dict('positive.txt', True)
pos_lexicon_dict = dict(pos_lexicon_dict, **lexicon)
lexicon = iohelper.read_lexicon2dict('hownet-positive.txt')
pos_lexicon_dict = dict(pos_lexicon_dict, **lexico... | 1 |
539cf2bf2a42a85adff2702b9186ed69 | a36e100d6d28058b4cf0ac4f302d8610 | If 'fmt' is clustal, reads records from alignment file 'filename'.
If 'fmt' is fasta, reads the records through SeqIO. | self.filename = filename
self.delimiter = delimiter
if method == 'Input':
f = open(filename, mode='r')
self.header = f.readline().strip().split(delimiter)
self.body = f
elif method == 'Output':
f = open(filename, mode='w')
self.... | 0 |
9f1fc54446e120fae6a7f7cfe02c2cd8 | 28e8ff20cd38c52c5ce28e48889c437d | 打开公会副本 | function openBox( p_callback, p_boxId )
local requestFunc = function( cbFlag, dictData, bRet )
if not bRet then
return
end
local openBoxInfo = nil
if dictData.ret.ret == "ok" then
openBoxInfo = {}
openBoxInfo.uid = UserModel.getUserUid()
openBoxInfo.htid = UserModel.getAvatarHtid()
openBoxInfo.u... | 1 |
1bf6491a24dfcdb35cf03aa327bc3404 | ce8275a1103b664bb29722a194b37ecc | Gets the corporate name from identifier. | String getCname(int id); | 1 |
6b99e342018d98da755118482867e6cc | 6f819b2d0e4b094727947300bafb4038 | Sets the extension for the flow definitions. | class Piece_Flow_Continuation_Server
function setConfigExtension($configExtension)
{
$this->_configExtension = $configExtension;
} | 1 |
9603713277e8d547bba1a962cac7739f | 0976704b7c2556846fad6386a120f6d6 | FUNCTION
DESCRIPTION
This function is used to truncate PHB number.
PARAMETERS
RETURNS
void | char i, j, s, k, old_length;
char* x;
j = 0;
k = 0;
old_length = strlen( old_number );
x = strchr( old_number, '.' );
if ( x == NULL ) {
s = old_length;
} else {
s = (char) (x - old_number);
}
for( i = 0; i < old_length; i ++ ) {
if ( *(old_number + i) == '.' ) {
strncpy( new_number + j , CTR_DICT_NU... | 0 |
38342ad71de85de13412a26263bd2afd | edca97cff39f020838407dfab9420e5e | 釣り銭(100円)のストックを設定する。 | public class VendingMachine
public void setCoin500Stock(int coin500Stock) {
this.coin500Stock = coin500Stock;
} | 0 |
74d6b2955d287307d1ced0a224a625f1 | 9a1425bc7f6ae7a766be09877f008585 | この弾のBulletParamのインデックス。 | public class KinkoOrbitalChild : SpecialOrbitalAbstract
protected override void ShotBullets(int index, float launchTime, float dTime)
{
m_BulletAngle[index] = m_AngleSpeed * m_ShotInterval * m_RealShotNum;
} | 0 |
0fc57f79641bb5d0ff3e4959615e33c5 | 997efcc8c9e25dabddfa06d00929fc13 | Converts to HTML tags. | class StatisticsController extends AppController
private function convertHtmlTag($text)
{
$text = str_replace('<', '<', $text);
$text = str_replace('>', '>', $text);
return $text;
} | 0 |
b2f17bed02441c07af947d04f53db9cf | 577ae1cc18bface934a23f0a40a6a491 | Checa se rei preto está em xeque | bool Checkmate(ChessBoard *b){
if (b->KingInCheck && NoMovementsLeft(b)){
printf("Xeque-mate -- Vitoria: %s\n", b->WhoseTurn == WHITE ? "PRETO" : "BRANCO");
return true;
}
return false;
} | 0 |
6186b98dc212ccdfb064abe27208ec51 | 854dfe6f8ebe9bff12f21e1e1300e400 | get all allied neighbours of territory | class Board(object):
def neighbors(self, territory_id):
neighbor_ids = definitions.territory_neighbors[territory_id]
return (t for t in self.data if t.territory_id in neighbor_ids) | 0 |
c7d0d6d3db45494454a61b3f640d0243 | 57bce7348f3f0a118e28d23f04e47c1c | 契約クーポンに紐付くデータを取得する | {
$usageCondition = \App\Domain\Coupon::getUsageCondition($this['coupon']) || null;
$discountText = \App\Domain\Coupon::getDiscountText($this['coupon']);
return [
'id' => $this['id'],
'name' => $this['coupon']['name'],
'image_path' => $this['coupon']['imag... | 1 |
444f98b657342171c9b667c97edc09b9 | 95e8fb5c108d4fb22af63c819c0e8cb6 | Converts from an actual spec to the config structure. | class DiscreteHMMConfiguration(HMMConfiguration):
def _from_spec(self, spec):
self.n_hidden_states = spec['n_hidden_states']
self.model_type = 'DiscreteHMM'
return self | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.