query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
9acd1e6905d0c010acc3b1a0cc7c1e30 | aab1573a09824779d1773786d67a1fce | Set the licencie plan social. | class AttestationAssedic
public function setLicenciePlanSocial($licenciePlanSocial) {
$this->licenciePlanSocial = $licenciePlanSocial;
return $this;
} | 1 |
131df3411927da2f77315bc9e88fb240 | ead5aa5cdd48345f4c6edf731178debc | =======================================
创建服务端 TCP 套接字
======================================= | int tcp_server(int port)
{
int serfd;
int flag = 1;
struct sockaddr_in sin;
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(port);
sin.sin_addr.s_addr = INADDR_ANY;
if ( (serfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
GetLastSocketErrorMsg(LOG_FA... | 1 |
9fd5dacfa1984d8553901c8e312341e0 | f6dcc1dd787ef68cfe69d9986edee87a | Returns whether this Geometry is identical to another Geometry.
This method will only return true if the geometries are of the same type, with the exact same coordinates,
in the same order, and with the same SRID.
This is different from the concept of spatially equal; if you need to check for spatial equality,
please s... | class BaseSpatialPandas(object):
def equals(self, second_geometry):
return _call_function(this=self, op='equals',
second_geometry=second_geometry,
null_value=False) | 1 |
88e7590c456a4608ebfc48bb4274937c | aabdc1b6f7a741c92a3f1d5bf1d14fd7 | Get a list of purchase order types.
} | class OrdersApi extends base_1.BaseAPI
getOrdersTypes(options) {
return exports.OrdersApiFp(this.configuration).getOrdersTypes(options).then((request) => request(this.axios, this.basePath));
} | 1 |
7151df56ad79a8127ee9463ad9c99502 | c5b12b2fa96a46fb51d164d9d94494aa | <para>
Returns a value between -1.0 and 1.0 representing the direction
of the the joystick in the vertical axis.
</para>
<para>
See the <c>JoyX</c> command for more details on using joystick
axis commands.
</para> | {
if (m_bJoystickSet)
{
return (float)m_joystick.Y / (float)short.MaxValue;
}
else
{
return 0;
}
} | 1 |
350f771c5e54e10bf1c0735895e0a5b8 | 2c0e541b2ee3cf7859261d72e7c8410e | 根据key获取流程定义的最新版本 | @Service
public class FlowUtilService implements IFlowUtilService{
public ProcessDefinition queryProcessDefinitionLatestVersion(String key){
return repositoryService.createProcessDefinitionQuery().processDefinitionKey(key).latestVersion().singleResult();
} | 1 |
f47a3b65bda2e502394c6818e56aacea | dfa57d8a59cc0e2ca98a82c068ac05d2 | 通过initUI函数:显示窗口的大小和标题 | class Signup(QWidget):
# 对这个类的理解,就是封装了一套方法,用来来窗口进行设置(通过传参,这个参数就是实际窗口)
def __init__(self):
super().__init__()
self.resize(800,600)
self.setup_ui() | 0 |
fd9b29018b1d90220fe93012f97db388 | 35ae3e2a403418f5b28b5e07e41479bd | Create the source-side (UIM) hanshake receiver. | {
struct rmnet_nss_ctx *ctx;
ctx = kzalloc(sizeof(*ctx), GFP_ATOMIC);
if (!ctx)
return -ENOMEM;
ctx->rmnet_dev = dev;
ctx->nss_ctx = nss_rmnet_rx_create_sync_nexthop(dev, NSS_N2H_INTERFACE,
NSS_C2C_TX_INTERFACE);
if (!ctx->nss_ctx) {
kfree(ctx);
return -1;
}
nss_rmnet_rx_register(ctx->nss_ctx... | 0 |
406eadab73f2dcd798c2e491fc21ba08 | 935c8a4ddc33a9dd35e1fe492135c3a7 | Creates relations between all selected entities. | namespace AlexanderDevelopment.ConfigDataMover.Lib
public static class NtoNRecordManager
public static void CreateRelationships(List<Entity> records, IOrganizationService orgService, ILog logger)
{
if(records.Count > 0)
{
var metaData = getRelationshipMetaDataFromReco... | 1 |
fde1e03799e499456425c1140546c141 | 457b1b4eca58c23bea771fc84220d062 | the method shows to the admin the heat map of a specific user. | def heats():
return render_template('heats.html', getOption=getOption, __=__,
lang=getFullLanguage(getOption('currentLanguage'))) | 0 |
6c383c44b19973a7cd30c722971693f6 | 2d85e5550bff492f78f2fe0ed472f05f | Tworzenie testowego partnera. | Partner createPartner(); | 1 |
ebea613d5542cc849ffb0ba3221f29c4 | 89428737b56d0c4878ed2eac0a69a5a8 | Devuelve una lista con los damnificados existentes en base de datos | def all_victims():
response = {'status': 'success'}
response['victims'] = V.vicList
return jsonify(response) | 1 |
c40e3dce2f00bad3ee7d3c170a6dab9b | d184daf5d7f30546839c08c8a291584c | Выбор пути к файлам для вложения | namespace ReportBuilder.XMLparts
public class Inserter
public void insertEmbededFiles()
{
var sel = wordApp.Selection;
foreach (KeyValuePair<string, Attach> entry in attaches)
{
string tag = "<%" + entry.Key + "%>";
bool fileExists = File.E... | 1 |
fc719278c899a6964a1a59c3e205f4bc | 43ccc2660d8a0756a1ace59dc6c3e5d7 | Create confusion from a list of aligned labels. | self.conf_matrix = ConfusionMatrix(num_classes=num_classes, normalized=normalized)
self.reduced_probs = reduced_probs
if ignore_indices is None:
self.ignore_indices = None
elif isinstance(ignore_indices, int):
self.ignore_indices = (ignore_indices, )
else:... | 0 |
e99f045dabb93a11a6140caa9d37b5bd | 2fd9957e836f09890bb1dbee1af712cb | Transforms the given properties of the given object into "reactive properties". E.g.:
```javascript
var object = {
}
variable.transformProperties(object, ["a"])
```
Is equivalent to the following:
```javascript
var a = variable(1);
var object = {
get a(){
return a.value;
},
set a(v){
a.value = v;
}
}
``` | return function(object, propertyName) {
if (typeof typeFunction !== "function") {
typeFunction = getDesignTypeFunction(object, propertyName);
}
if (typeFunction) {
class_transformer_1.Type(typeFunction)(object, propertyName);
}
};
} | 1 |
492cf8ea62bfca0560a39ae61eafc0ec | ba4afac88a7d88960820d239397c69e4 | Two triangles pointing towards each other and overlapping. The test
checks whether the function recognizes this. | {
using SimpleMesh::Line;
Vector3d o(0,0,0), x(1,0,0), y(0,1,0), z(0,0,1);
Triangle3d xy(o, x, y);
Triangle3d yz(o, y, z);
BOOST_CHECK_SMALL(norm(Line::intersection(xy, yz, 0) - Vector3d(0,0,0)),
1e-6);
BOOST_CHECK_SMALL(norm(Line::intersection(xy, yz, 1) - Vector3d(0,1,0)),
1e-6... | 0 |
da330bd52290bfc1b0a0ed01f34809d3 | 9ac2532be46e6af998be25bdc27214bb | function that allows the user to delete his database search | public class SongContainerSearch : MonoBehaviour
public void DeleteButton()
{
Debug.Log(databaseID);
musicList.databaseID = databaseID;
popUpPanel.SetActive(true);
} | 0 |
7a1ed93dec1c578f0a1f2efe811cedb3 | d42b087b20afd1cf80a7fd63729f139a | 根据id获取元素并输入值 | public class TAction
public boolean inputById(String id, String value) {
if (flag) {
try {
this.driver.findElement(By.id(id)).sendKeys(value);
return true;
} catch (Exception e) {
System.out.println(e.getMessage());
return false;
}
} else {
System.out.println("flag is false, function is ... | 1 |
c2a3fc002faea1321f99eaeb6bcfd4c9 | e57bc0356e15d78b757817d7ef7c7d11 | returns $returnvalue if the $comparitor is equal to the value | public function getComparatorValue(); | 0 |
c61ec83e9d31957248c8966d8d3dff40 | 9e698de97c8b100252cae5eda2531243 | 在loss得到之后,但在反向传播之前。可能可以进行loss是否为NaN的检查。 | class PrecisionPlugin(CheckpointHooks):
def post_backward(self, model: "pl.LightningModule", closure_loss: Tensor) -> Tensor:
closure_loss = closure_loss.detach()
model.trainer._call_callback_hooks("on_after_backward")
model.trainer._call_lightning_module_hook("on_after_backward")
return... | 0 |
09131e91ab9791588fadc0df3ea168f3 | 49758780ec2580a98c5714dc55416861 | lua table 元素去重 | for k,v in pairs(t) do
if cb(v) then
t[k] = nil
end
end
end | 0 |
c27899fd53b9fb480fde479711b66e9f | 34c47c1aca41d846d5f54b1d6fa57004 | Deletes all associations older than given amount of seconds. | $this->checkStorage();
$tn = $this->getTableName();
$date = new DateTime("now-{$olderThan}seconds");
$date = $this->getPDO()->quote( $date->format("Y-m-d G:i:s") );
$this->getPDO()->exec("DELETE FROM $tn WHERE date <= $date");
} | 1 |
cf37227a99a7e4232700b015f8673756 | 683cb62eac1253c1d65a9320aa720a65 | 割付ブロックデータを使用済みに変更する処理 | PRIVATE void resetBlockUsed(Device device, Metadata* metadata, u16 blockIndex){
seekToPartitionBlock(device, metadata->blockFreeStart);
Size byteOffset = blockIndex / BYTE_BITS;
seekDevice(device, DEV_SEEK_CURRENT, byteOffset);
Size currentDeviceOffset = deviceOffset(device);
u8 bitmap;
readU8(d... | 0 |
0b7a83c107e47adbbabeaa68f9d3cd2a | 7d66f767dfdd10b07bc9b04d9d283229 | Lists monitoring information related to SAML Authenticators of the environment. | namespace VMware.Horizon.RESTAPI.Api
ApiResponse<List<SAMLAuthenticatorMonitorInfoV2>> ListSAMLAuthenticatorMonitorsV2WithHttpInfo (); | 1 |
d95d2eb91f65b7f2e1b1062f3f04a51f | 564c19bd79026b10a6c31146a7065cda | Display the specified im. | {
$image = Image::find($id);
if (!$image) {
return back()->with('danger','image not found. It\'s either missing or deleted.');
}
return view('system.images.show', compact(['image']));
} | 1 |
db382a7534ccd866ce00567b325f0a2f | 8a9e28eccf064b6de202ec86ed5cf714 | funções para trocar os produtos na seção Destaques | {
$produtos = session('produtos');
foreach ($produtos as $struct) {
$idComparacao = $struct["id"];
if ($id == $idComparacao) {
$aux = $struct;
break;
}
}
$key = array_search($aux, $produtos);
if ($key !== fal... | 0 |
107bbcc5c16838dec684bd19851a366f | ddb5a68c8ab0dbc2a6238a391fdbb8c0 | 通过BasicCampus的id删除BasicCampus | int deleteBasicClassroom(Assist assist); | 0 |
214708ae42fe4174e01548afe5f3dd9f | 81f2b680de836a73b08b9717d46d8787 | Emits code to initialize the QName constant pool in the constant pool static initializer. | ConstantPool toConstantPool(ConstantPoolFactory factory); | 0 |
b7b00785b7140ebc141a149a919273ff | 400fc56df5c316bdb532a7e56cb0072b | Wait until animation is done and trigger Breadcrumb resize | function resize() {
clearTimeout(timer);
timer = setTimeout(recalc, 100);
} | 0 |
288b87f8c4cf6999b5ce818e7f7a02cd | 6e740413a48e0b1913448eeee42c1de8 | Faz a soma de quatro BigDecimais. | public class BigDecimals
public static BigDecimal add(BigDecimal v1, BigDecimal v2) {
return v1.add(v2);
} | 0 |
5c49f8b2156d4db7c319622cac9d79c7 | f6a0bb1ffc7d09ecedade734a3c359b8 | Fields are renamed before updating index_together. | class SchemaTests(TransactionTestCase):
def test_index_together(self):
with connection.schema_editor() as editor:
editor.create_model(Tag)
self.assertEqual(
False,
any(
c["index"]
for c in connection.introspection.get_constraints(connec... | 0 |
9f13d45c0baa4878de79792dfef63948 | 13a407437dfdedb326bfb0c80f0723d2 | Lisätoiminto-ikkunan käynnistäjä
Tarkastaa oliko käyttäjän syöttämä salasana oikea.
Avaa lisätoiminto-ikkunan, jos oli oikein.
Muutoin kertoo virheestä. | List<Account> accounts = AccountLab.get(MainActivity.this).getAccounts();
for (int i = 0; i < accounts.size(); i++) {
Account account = accounts.get(i);
if (username.equals(account.getUsername()) && password.equals(account.getPassword())) {
Intent intent = new Int... | 1 |
8f68c76cda73856af50a1ee03a03e2cc | 4c77b7dd4736ce9288c431b94ab2521a | r"""Calculates the sum for each element :math:`x_i` of the input tensor :math:`x` with the respective element :math:`y_i` of the input tensor :math:`y`. | def reduce_sum(ctx, x, n_outputs=-1, outputs=None):
return F.ReduceSum(ctx)(x, n_outputs=n_outputs, auto_forward=get_auto_forward(), outputs=outputs) | 0 |
0dc2676168b01acdc49a03480867085b | a40f9b4f989f0dd45c231ff6bc382dca | Implementation of CALL_PAL MFPR_ASN opcode. | {
void *drcontext;
instrlist_t *bb;
instr_t *jmp_back;
instr_t *instr;
byte *end;
app_pc code_cache;
drcontext = dr_get_current_drcontext();
code_cache = dr_nonheap_alloc(PAGE_SIZE,
DR_MEMPROT_READ |
... | 0 |
8bba378563862a809ae3170e6d88fd2d | d6e4f7276bd2241cb34650a64cce5e69 | 更新用户,以user_id为条件,更新其它字段 | class User(BaseModel):
def update(cls, id, *condition, **kwargs):
if 'email' in kwargs.keys():
kwargs.pop('email')
super().update(id, *condition, **kwargs) | 1 |
740bd2249751b0375ae95f7b20af555b | 4a8aefa4a5fe0d61284dce061c398cd3 | Recupera todas las facturaciones utilizando EntityManager | @Stateless
public class FacturaPersistence
public List<FacturaEntity> findAll()
{
TypedQuery<FacturaEntity> query = em.createQuery("select u from FacturaEntity u", FacturaEntity.class);
return query.getResultList();
} | 1 |
828f0bf024245a3a0c7140c4d07a600d | 693f2e3d4ca7e5236094f24511a082da | Add the info for plants that have IDs in the CEMS data but not EIA data | class PlantsSteamFerc1TableTransformer(Ferc1AbstractTableTransformer):
def transform_main(
self, df: pd.DataFrame, transformed_fuel: pd.DataFrame
) -> pd.DataFrame:
fuel_categories = list(
FuelFerc1TableTransformer()
.params.categorize_strings["fuel_type_code_pudl"]
... | 0 |
01c76994488257b5561cb8cae4c15e4a | 59ad966a60ae2549cd107b7cff0e9a73 | 根据父级id递归获得所有子级菜单 | @Service
@CacheConfig(cacheNames = "sysUserMenu")
public class SysUserMenuServiceImpl implements ISysUserMenuService
private List<SysUserMenuDto> getChildMenu(Map<Long, List<SysUserMenuDto>> map, Long id) {
List<SysUserMenuDto> menus = map.get(id);
if (menus != null) {
for (SysUserMenuDto dt... | 1 |
22bdd97541cdef2226c7f7ff410b3028 | 3bda038721da9818f629c803c4a7d9dc | Display the blocked users | class AdminController extends Controller{
public function blockUsersAction()
{
return $this->render('AppBundle:Admin:blockUsers.html.twig');
} | 0 |
58a1bc244e02d44bb14b4456fb67c4f4 | 5c35a31a3a83acfa15a949ea45f4b618 | --------------------------------------------------------------------------
Display the Filter Panel
-------------------------------------------------------------------------- | {
showFilterPanelImgBtn.Visibility = Visibility.Hidden;
showButtonRect.Visibility = Visibility.Hidden;
filterCanvas.Visibility = Visibility.Visible;
isFilterAnimationRunning = true;
Storyboard showPanel = (Storyboard)Resources["showFilterPanelStoryboar... | 1 |
cbf7cbee97b18ad98b4c4e830f5cc276 | 76d31f5a6bca602728555ec847c85899 | 先从loggerMap查,没有再利用反射获取logger | Logger log = null;
if (loggerMap.containsKey(className)) {
log = loggerMap.get(className);
} else {
try {
log = LoggerFactory.getLogger(Class.forName(className));
loggerMap.put(className, log);
} catch (ClassNotFoundException e)... | 1 |
b18bc2eb11cc0fec34457ad221ecb804 | 830965f6bf03d64f8677a85d9a6e0da1 | fastparquet doesn't have a nice method like PyArrow, so we
have to copy some of their logic here while we work on getting
an easier method to get a list of valid files.
See: https://github.com/dask/fastparquet/issues/795 | def metadata_from_many(file_list, verify_schema=False, open_with=default_open,
root=False):
from fastparquet import api
if all(isinstance(pf, api.ParquetFile) for pf in file_list):
pfs = file_list
file_list = [pf.fn for pf in pfs]
elif all(not isinstance(pf, api.Parque... | 1 |
66ee1bb22f11f07b7821200fea06b1ef | 947189a85bcbea2e6d733302810bb6d9 | 根据礼包生成激活码 | Log_Base::save('np','gencodeAction:'.var_export($this->body, true));
$nums = intval($this->body['nums']);
$user_name = trim($this->body['user_name']);
$user_mobile = trim($this->body['user_mobile']);
$user_card = trim($this->body['user_card']);
$use_day = trim($this->body['use_day'])... | 1 |
8131b58a1e9bc3d588690a666e1a5ae1 | d7210e6023a58972860801578bb2aff8 | Turn off GPRS. | void m26_gprs_deactivate() {
m26_send_command(command_at_qideact);
vTaskDelay(10 / portTICK_PERIOD_MS);
m26_get_line(5000);
m26_get_line(5000);
} | 1 |
ff718f3b8c9b0e9986b39d345aba9eb4 | 09e988963aaf3706f3b139d09b5e45f8 | timeToStart | {
return ($this->Game->started_at > 0)
? $this->Game->started_at + $this->start_delay * 60
: Timing::strToDate($this->Game->start_datetime) + $this->start_delay * 60;
} | 1 |
d781f8343225dac37ab708493370b4f0 | 46305c5ce26e9cd6ba85cec391c75c40 | Lukee tekstitiedoston rivi kerrallaan ja yrittää lisätä tarvikkeen. | public class Hallinto
public void lisaaUusiSana(File tiedosto, String sana) throws IOException {
this.kirjaaja.lisaaSana(tiedosto, sana);
} | 0 |
3d65957d4d39d09189122fd8b1ea1fda | c11ebe9c0ee79a469dd1ad6422fb0fc3 | 设置某个索引项为启用状态 | {
if ($id)
JYDB::update("HOS_USER_INDEX", "ID='" . $id . "'", array(
"STATE" => 1
));
} | 1 |
78bcf73d734ec77475e3b70badb4bbc2 | 5d4484023cd077a18c4c131979ce5bf5 | Поиск платежей за период времени с постраничным выводом | SearchRequest request,
RequestOptions requestOptions = null,
CancellationToken cancellationToken = default)
{
return SearchAsync<ResultsResourcesPage<AdvancedPayment>>(
"/v1/advanced_payments/search",
request,
reques... | 1 |
4d0bc65f2a74b6523828107c56c1e9ac | 6c85ecd3c1f7f7bbf2065864a00ef2a1 | クォート文字を考慮して文字列をSplitする | export class Splitter
split() {
let target = this.escaped_text.replace(REPLACE_HIRAGANA, '@');
this.replacement_hash.forEach((value, key) => {
target = target.replace(key, value);
});
return target.split('@').filter((item) => item.length >= 1);
} | 0 |
8d8b9e14716e9931fea14579b8114e75 | e7791e2cf8d073efede0fcf79c45cb36 | We don't need to do anything for temporary tables, because they have
no root to unlock. | namespace NHibernate.SybaseAdsDriver
public class Ads10Dialect : Dialect.Dialect
public override bool? PerformTemporaryTableDDLInIsolation()
{
return null;
} | 1 |
9c1cd32029478ead675a70290baf4274 | 9bb8d7204e638f4c0d28bff2c6018aee | Runs a test conditionally. | class Tests(object):
def test_if(self, condition):
if condition:
return self.test
return lambda x: x | 1 |
ee33f97157beb65acdc6528d91e26409 | af9db1d3ae9a77905785a717f97fed79 | save sequences of an experiment into a fasta file
with the header identical to the sequence (for easy reloading of rdp taxonomy)
input:
expdat : Experiment
outfilename : string
name of the output fasta file | def taxtoseq(expdat,fixtax=False):
newexp=hs.copyexp(expdat)
newexp.seqs=newexp.tax
if fixtax:
newtax=[]
for ctax in newexp.tax:
cstr=''
cctax=ctax.split(';')
for clevel in range(7):
if len(cctax)>clevel:
cstr+=cctax[clevel][3:]
cstr+=';'
newtax.append(cstr)
newexp.seqs=newtax
newexp.... | 0 |
e78205bafe3754dec2f372f338647f08 | 89d4cb01ebfa193a804cc33cd30a9188 | 原邮箱验证获取验证码 | @FormUrlEncoded
@POST("passlove/register/sendCheckCode")
Observable<SendCheckCodeBean> getSendCheckCode(@Field("mail") String email); | 1 |
b0882d9421a1282bdf65233c185f2096 | d9b2d9957fce6db5fd7cd550a248ee95 | Construct a new ViewRect. | : mNumCols(num_cols)
, mNumRows(num_rows)
, mOriginX(rect.GetX())
, mOriginY(rect.GetY())
, mWidth(rect.GetWidth())
, mHeight(rect.GetHeight())
{} | 1 |
f361b7c9c1d6d3a511324fd4fd7f66e3 | 6793b9d42d891ca84069ea3c612fb921 | @brief 그룹이 존재하면 참을 리턴한다. | namespace SongBook
public class Database
public bool IsGroupExist(int number)
{
bool exist = false;
string sql = string.Format("SELECT * FROM ConfigGroup WHERE Number='{0}'", number);
SQLiteCommand command = new SQLiteCommand(sql, m_dbConnection);
SQLiteDataReader reader = command.ExecuteReader();
whi... | 1 |
0f9f34226eb74dfab63197d18e7651b9 | 47a93d80993714e1672517a3a97c97b5 | The character associated with the key, if this is a keyboard event. | namespace xtd namespace forms class key_press_event_args : public event_args
char32_t key_char() const {return key_char_;} | 1 |
fa0f4d4e4e96121d9cad0383f1dac34e | ca5bdc27f33fc62630138fe887186482 | 显示卡牌详情 | function p.ShowCardInfo(view, card, cardIndex,row)
local cardBtn = nil;
local cardLevel = nil;
local cardTeam = nil;
if cardIndex == 1 then
cardBtn = ui_list.ID_CTRL_BUTTON_ITEM1;
cardLevel = ui_list.ID_CTRL_TEXT_LV1;
cardTeam = ui_list.ID_CTRL_PICTURE_TEAM1;
cardLevelPic = ui_list.ID_CTRL_PICTURE_1;
elsei... | 1 |
616afecae881370d31ff3a0c072dcceb | e3ecfd4f78eeb73646c1f764321ea5b0 | Import csv from file. | {
return $this->importCsvFiles(array(
array('\Shop\Model\CsvSchema\Delivery', 'delivery'),
array('\Shop\Model\CsvSchema\Payment', 'payments'),
), 'utf-8', $params);
} | 1 |
d02181ebd1d254c87361402b9aeee2f0 | 098c242daf12b421fee3f1e1c3885b19 | Apriori Pruning com base no minimum support | def Apriori():
Lk_1 = getL1()
while True:
Ck = apriori_gen(Lk_1)
if len(Ck) == 0:
break
N = [0] * len(Ck)
nc = 0
for c in Ck:
for d in D:
if set(c) <= set(d):
N[nc] = N[nc] + 1
nc = nc + 1
... | 1 |
a5116d1022bbe86085e8365f0b58171d | 4aa3570972061fa075c7162cb6071ff0 | Returns the forward and reverse depth for this base | int[] depths = {-1,-1,-1,-1};
for (int i=0; i<4; i++) {
if (snake_head.moveTo(DIRECTIONS[i]).inBounds(mazeSize)) {
if (opponent_depth.get(snake_head.moveTo(DIRECTIONS[i])) != null) {
depths[i] = opponent_depth.get(snake_head.moveTo(DIRECTIONS[i]));
... | 0 |
c0af69abfac6ae9b0416425fab5d20bd | a705ca54f9e3b98fad66a91f73e67419 | 메모 이미지 삭제 | @Component
public class AdminUtil
public void deleteImg(String path) {
File file = new File(path);
if(file.exists()) {
file.delete();
}
} | 1 |
ca14a0bffd67421749d90da2dae097a0 | a25ae684da1f599e4f083108e6ad4ed6 | encodeCharacterANSI encodes for ANSI SQL.
Only the apostrophe is encoded | function encodeChar(char, charCode) {
if ((charCode >= 0x1 && charCode <= 0x8) ||
(charCode >= 0xB && charCode <= 0xC) ||
(charCode >= 0xE && charCode <= 0x1F) ||
(charCode >= 0x7F && charCode <= 0x84) ||
(charCode >= 0x86 && charCode <= 0x9F)
) {
return "&#" + charCode +... | 0 |
8fb38c8723e93df156b602f8bce5739c | 8a3fceb2604ab8c10bcb68837566d3b1 | Sets the image of this River. | public void setImage(BufferedImage file); | 1 |
258c25cad12a234044b3bdaced76d3ca | 64a50075baf8ebd7bd61f812b3904ee7 | Forwards a packet_in to a specific destination. [Taken from the IntentReactiveForwarding App] | class DVRouter(basics.DVRouterBase):
# NO_LOG = True # Set to True on an instance to disable its logging.
# POISON_MODE = True # Can override POISON_MODE here.
# DEFAULT_TIMER_INTERVAL = 5 # Can override this yourself for testing.
def handle_data_packet(self, packet, in_port):
dst = packet.dst
if dst in self.... | 1 |
cc4a0c962fd6e3e9b992cbb0898e32e6 | 3842cd609d99801024c904c647c844b8 | # returns the filname without the path | unique_par <- function(fnames) {
unique(gsub('\\..*', '', fnames))
} | 0 |
9aaa1f8b99f72c507cc3d0e5a7a54dcf | 7498395a2617d8eed6a396f1da061f1d | Sort fitness values of particles in archive | {
int i;
for(i=0; i<POPULATION; i++) {
printf("fitness[%2d] = %d\n", i, fitness[i]);
}
} | 0 |
850434578e6ddd25a759dbb43b64852e | 1a9011cb4ecfc93daa95c0767a1f3af5 | fills table with random numbers in [lo, hi]. | void fill_it( int anArray [], int size )
{
int num ;
int looper;
for ( looper = 0; looper < size ; looper++)
{
num = (rand () + time (0) ) % 51;
anArray[looper] = num;
}
} | 0 |
101f4293a25fe79b82eb0fb642c0551e | cabebf5e59fa5b39b04ab664b3659c2e | This method returns xml file name of object. | class Event:
def get_xml_filename(self):
return self.__xml_filename | 1 |
7969a99d4467693ae74111c0d3e8ac99 | c58b37c730fe692e9fdb9106d3951579 | Map the <code>E</code> object to itself. In other words, a "no op." | public class MapperAdapterFactory extends AdapterFactoryImpl
public Adapter createEObjectAdapter()
{
return null;
} | 0 |
c8ca41b6e890d80a7cf667649ea3a787 | cfd8b1eab08b71f7dba33376d0ea25f9 | Test DELETEing a resource for an endpoint that doesn't support it. | class WriteAPIendpointMethodsTests extends extensionPropertyAbstract
private function endpointDeletionWrongEndpointId($request) {
$endpoint = $this->createSampleEndpoint();
$wrongId = $endpoint->getId() + 1;
$this->endpointDeletion(false, $wrongId, $endpoint->getService()->getId(),$request, 404, $endpoint->... | 1 |
d73d5faac77fe0a5d7d8cd9559641b3f | 7db526ef81e8b69b88d2f25539acd811 | 获得若干节点vertices间相互连接的边数 | class TwoLayeredDigraph:
def cross_num(self, vertex_a, vertex_b):
res = 0
for adjacent_vertex_b in vertex_b.adjacent_vertexs:
for adjacent_vertex_a in vertex_a.adjacent_vertexs:
if adjacent_vertex_b[0].pos[0] < adjacent_vertex_a[0].pos[0]:
res = res + 1
... | 0 |
f1d2f396cdaa95a46ec0d42c3bacd8da | 48869a0bf7c66d8c4d62173b7f5af3e1 | the difference between the two wavelengths for which filter
transmission is half maximum
..note::
This calculation is not exact but rounded to the nearest passband
data points | class Matching(BeamInfo):
def f_lower_bound(self):
f0 = pi*self.w1*self.w2/self.wavelength
return u2m(f0) | 0 |
73d9dfa8a0f06362ef87735a8eca23b3 | 38196e4931111e12f3cc3a70fa163ecb | 用來讀檔案,將檔案以byte的形式讀近來再針對溢位做處理,最後用Integer陣列來儲存。 | public void fromBytefileToBytearray() throws IOException{
InputStream is = new FileInputStream("d:\\myclass\\lmlTest.txt");
byte[] b = new byte[is.available()];
is.read(b);
System.out.println(Arrays.toString(b));
is.close();
} | 0 |
554f955c278515cb5b98c3e811aab7ac | 69458536c045084f58e3a46307a607e6 | نامه های پیش نویس شده | namespace Eli.Models
public class EliManagerDB
public List<String> getAllReportNames()
{
List<String> list = new List<String>();
list.Add("רשימת מטופלים");
list.Add("מטופלים עפ''י גורמים מממנים");
list.Add("תשלומים עבור גורם מממן");
... | 0 |
a32603cdd5fd84d3f0e2928595909f27 | 52fb17d2bbba5ffde54428e0696b74b5 | Determines if completion confirmation is necessary, and either completes schedule items or returns Json indicating a confirmation is required. | public JsonActionResult ConfirmResourceAssociation(int id)
{
using (CustomerRetrievalContext retrievalContext = new CustomerRetrievalContext())
{
bool isConfirmationRequired = true;
Resource.TimeOffPolicyBundleAssignment.TimeOffPolicyBundleAssignmentManager timeOffPolicyBundleAssignmentManager = new R... | 1 |
d01ee2ace322694c854feb85b2c7f436 | ecd645747655f228bbec3a1d042dcf21 | 搜索所有机位信息 | @Service
public class Position2Service
public List<Position2> getAllPositions(){
List<Position2> position2 = p2m.selectAllPosition2();
return position2;
} | 1 |
2ed747890e3d5f8f0d81828b172b8299 | e1e5bc48048cc57b4bce8af82624aea2 | Returns the value of the '<em><b>Contract</b></em>' reference.
<!-- begin-user-doc -->
<p>
If the meaning of the '<em>Contract</em>' reference isn't clear,
there really should be more of a description here...
</p>
<!-- end-user-doc --> | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "bankHeaderType", propOrder = {
})
public class BankHeaderType
public RefType getContract() {
return contract;
} | 1 |
83224aa2fa5a099c0408d52c0c0b8dd4 | 3b119bbe6639b9a043e7ccdd00416e5c | Algorithm for Metropolis-Hastings (importance sampling): change one coordinate at a time per MC cycle | int x, int y,
double delta = 1.0)
{
double E_xy = E(x, y);
double theta_save = theta[x][y];
theta[x][y] += delta * (2 * std_rand() - 1);
double E_xy_trial = E(x, y);
bool accepted = false;
double dE = E_xy_trial - E_xy;
double w = exp(- dE / T);
if... | 1 |
be17521d50b64d279984086f6e6b5934 | 46e89a2656a0ff8f3197a3a6389bdc91 | Returns a copy of the internal one-dimensional array. | public final class IntArrayList
implements IIntListEdit, ITsFastIndexCollectionTag<Integer>, Serializable
public int[] internalArray() {
return items;
} | 0 |
ab22869e3e09cab04bc343af445f919f | 798899e7a7cf5f5511b1fcc97f8720c0 | Divides pixels of two images. The operation is executed for each channel. If using integers, an integer division is going to be applied.
<para>If using 8-bit values an overflow might happen.</para> | public abstract class CLIJxOps
public boolean divideImages(ClearCLBuffer divident, ClearCLBuffer divisor, ClearCLBuffer destination) {
return Kernels.divideImages(clij, divident, divisor, destination);
} | 1 |
5a6506b73ed200a250d1964b595b9cd0 | e5c3691489179b4cc6823fd5b8d4e3d9 | Gets the group by ID with permission check. | namespace SmartHub.Api.Controllers
public class GroupController : BaseController
[HttpGet("{id}")]
[ProducesResponseType(StatusCodes.Status200OK)]
[ProducesResponseType(StatusCodes.Status400BadRequest)]
public async Task<IActionResult> GetById(string id)
{
return Ok(await... | 0 |
af6e835a37907bdfc7b08eda9eff4e0f | 88f7b5c9f819c7dd7fc0c298c25744e3 | Obtiene todos los mensajes de la conversación | namespace AeccApp.Core.Services
IList<Message> GetConversationMessages(); | 1 |
667de846a716fef838a9bd506e3ec0fc | c41382648b9eda499d74c451968c15f7 | Temporarily render this test component until there's a proper mechanism
for testing this. | function setupRenderingTest(hooks, options) {
upstreamSetupRenderingTest(hooks, options);
} | 0 |
63a6f0c88fed7de5699c71765d027cac | 12c2f99cc021d7885e5e5ad86a955c5b | Getter of the default language of the device.
@brief Language::getDefaultLanguage | {
String prefLangStr = PreferenceManager.getDefaultSharedPreferences(context).getString(SP_USB_HID_LANGUAGE_KEY, "en_US");
if(prefLangStr.equals("null")){
prefLangStr = Locale.getDefault().toString();
}
KjsdUsbHidKeyboardLangType.Language language;
try{
... | 1 |
bae6c1b9aec16cc877cabfb7b27432fa | e7978d49b2786dbe52d589713c7fa747 | Uninstalls a package that contains sub packages where a snapshot of a sub package was deleted | {
SubscriberServiceApiClient subscriberServiceApiClient = await SubscriberServiceApiClient.CreateAsync();
string snapshot = "projects/[PROJECT]/snapshots/[SNAPSHOT]";
await subscriberServiceApiClient.DeleteSnapshotAsync(snapshot);
} | 0 |
d64f50e24cb12d256198d6a70f263969 | 4991659dc52d6d177bb8753a42e561cd | 将sql.Date 转化成 util.Date | if (null == t)
return null;
return new java.util.Date(t.getTime());
} | 1 |
6212343eec7c70e9c5575f7a8e4416b8 | 0d552305c1e4145b6906e7df0f44a49f | Get author social links | $author_id = get_the_author_meta('ID');
$author_badge = get_field('profile_social_media', 'user_'. $author_id );
foreach($author_badge as $item):
echo '<strong>';
echo '<a href="' . $item["profile_link"] . '">';
echo '<i class="fa fa-' . $item["profile_icon"] . '"></i>';
echo '</a>';
echo '</... | 1 |
b70448db0380715326f29afe5d92e71f | edb88b28da177e22844834b324e52cc1 | Рекурсивный просмотр папок на предмет файлов, отвечающих маске. игнорирует ошибки | def search(path, mask):
for adress, dirs, files in os.walk(path):
for file in files:
if re.search(mask, file):
output = (f'{adress}\{file}').replace('\\', '/')
yield output | 1 |
96c6cfd4a945f57309a3c678400dda5c | f083f989664fb5d439ad10e004935df8 | 弹出选择联系人方式的dialog | public class Guide3Activity extends BaseGuideActivity
public void selectContact(View view){
startActivityForResult(new Intent(this, SelectContactActivity.class), 0);
} | 0 |
c19b4e873c8ad15b7d345ba56a1be15e | 2a5bb49d1edc5725a886c3b71332f323 | compute loss using ridge regressor | def compute_loss_ridge(y, tx, w, lambda_):
err = y - tx.dot(w)
loss = np.sqrt(np.mean(err**2))
return loss | 0 |
f258f387f3bf819632234a3b5e37eef2 | 31b6538cfd91f31d558cec965dd8e708 | returns color information for the entire eye - used when we are dealing with a simple eye | void qdr_eye_outer_color_reset(Qdr *qdr, int index)
{
if(eye_index(qdr, index, 0, 2))
return;
qdr->eyes.eye[index].enable = 0;
} | 0 |
64db474069b6990d07ef499925d4f027 | b5eba9716f2eb58f56325d6d9485cb4f | Setter for the attribute num_gen_layers.
Note, this method can only be called for a network, that has not been
build yet.
The first layer will be considered to be a fully-connected layer. All
following layers are transpose convolutional layers.
Note, that this method will override all kernel sizes and filters that
migh... | class BaseTransformerBuilder(BaseBuilder):
def n_layers(self):
return self._n_layers | 0 |
9e9a6cdc0ea6465c0f96ec6dde35a25b | aad94d16d6ddc22abc5cd0c89c905efd | Returns the cluster's (average) precursor m/z | public class MSnSpectrum extends MassSpectrum
public double getPrecMz() {
return precMz;
} | 1 |
7c896d2c291a2099bee79e6b9dbb1840 | 5bb3d731b3cc7a5bc20f4b1bd3858280 | Retrieves the Grade field
Units: % | public class ReportCard
public String getGrade() {
return mGrade;
} | 1 |
061140a90821800c37f035b5ecccfa87 | 5c8aaa665a8855fbea41bbbdc994c7f6 | Returns the maximum number of entities to update. | int CGameSpecific::GetMaxEntities(void)
{
if (!this->m_bReady)
return 0;
return NUM_ENT_ENTRIES;
} | 1 |
ae6d49ab747e038684559c8db1f91bc8 | cda654fb28a612ba1479abb8ad6038cf | Get 该笔交易需要调用的智能合约中的函数名称 | String getTokenName(Web3j web3j, String contractAddress, String fromAddr); | 0 |
61bf17c314a9d00902040a74f71bdafc | 147b0f9e2f3063ad8005bd0d48d097c4 | 设置投资计划起始日属性值 | public class Pojo3010120 extends Pojo_XXXX implements Serializable
public void setBEGIN(String BEGIN){
this.BEGIN=BEGIN;
} | 1 |
a921ea9c20659394aebe62dd5593f318 | ec498ce33ee7a350acc7c2c210296b6a | Quotes shell arguments. | def quote_argument(arg):
return shlex_quote(arg) if is_string(arg) else str(arg) | 1 |
3dfc35181d1dff00707380e0bf35e829 | 80a5b1a3ab83b127a1aeca9ab4a04be9 | 返回给定文件的最后修改时间. | public function mtime($path); | 1 |
09caf5c61cfd633e1c608e1cc96db50c | 568734502d0c031a7feb2d224a76bc39 | Setting this option will forward a flag onto the {@link RecognizerUtteranceListener} implementation.
<br/>The developer can then opt to record again the user voice as a second chance if there is no match. | void enable(boolean useSpeechDetector); | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.