query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
876774eaf851b672b155bebde13bf1db | 5e6055501f1640c65b27f0586f58de5d | Based on an assessment number, returns the actual test name | class GetData:
def get_test_name(self,row):
return self.data.get_cell(row,1) | 0 |
4e5b8d2eee97359cfc5439a5e20cccc2 | afde37bc06b7222bb56077ea29ca7efe | Function to find candidate name from their value (position on list) | ind = -1
for i in range(len(arr)):
if(name.lower() == arr[i]):
ind = i
break
return(ind) | 0 |
f40f914d6078dd3e53575e1e0f0f35f9 | 91fd0d6e218f7b28a7aef698a6564438 | Attaches the listeners for the SSL dialog. | bEchoKeyPassword.addListener(SWT.Selection, this);
keyPassword.addModifyListener(new ModifyListener() {
public void modifyText(final ModifyEvent e) {
dialogChanged();
}
});
keyAlias.addModifyListener(new ModifyListener() {
public void m... | 1 |
aa7ebbf71797c4372ec9a41bceb90b74 | ebfcdc72b7b35fcad38aeb305263eb1e | Set the hacp. | class HistoPrepPaie
public function setHacp(?float $hacp): HistoPrepPaie {
$this->hacp = $hacp;
return $this;
} | 1 |
571267daeb7d1f7c42ae6c472cbb983d | 7d485d4f06a01e349883518236ae95e1 | 根据部门id查找出部门的详细信息(包括上级部门),返回字符串,由级联部门的id组成 | {
String parentid = StringUtils.checkNullString(this.getRequest().getParameter("parentid"));
DepInfo parent = depManagerService.getDepByID(parentid);
String depType = parent.getDeptype();
String msg = "";
if(parent!=null)
{
msg = parent.getDepfullname() + ',' + parent.getDepdns()+','+depType;
}
this... | 0 |
9d8317bdd65f4b29d82ec285b80b595b | c9236b9b8d536d19836f9b4e545d3c04 | This examples shows how you could check that the initial
size of an object is correct. | {
SampleClass p1 = new SampleClass(11, 21, 32);
Console.WriteLine("p1: x={0}, y={1}, z={2}", p1.x, p1.y, p1.z);
SampleClass p2 = new SampleClass();
p2.x = 55;
Console.WriteLine("p2: x={0}, y={1}, z={2}", p2.x, p2.y, p2.z);
} | 0 |
516f733ef12765efa25e540df52f23c3 | d472708d216afd3452fa6be543998591 | Opens a Joke Window | {
try
{
window.OpenNew(filename);
}
catch(Exception e)
{
window.Message = "Unable to open file\n" + e.Message;
}
} | 0 |
206afe65cd284922d000910bc31e2b76 | ab232d0479259a6f58de2c665a6fa06a | @brief Frees a portal. | {
if (index < (g_numportals * 2))
{
return g_portals + index;
}
else
{
return (NULL);
}
} | 0 |
abf4cc08c41fc608d4a64b2da7b16de1 | 896c1bef1fc67c2193c720967bde5726 | Update the performance counters of the hypervisor. | long totalMemory, long freeMemory,
long totalSwap, long freeSwap,
long totalMcp, long freeMcp,
long totalGpuMemory, long freeGpuMemory,
int load, Timestamp bootTime, String os); | 0 |
9a7cb0a53d130a630c191c09930bc2d5 | 064b498aae3d9ca4beb1374d8b03d15d | Enhances a classfile. | {
int i;
u1 cp_tag;
for (i = 0; i < class->constant_pool_count - 1; i++)
{
fprintf( fp, "\n\n\t[%d] ", i+1);
cp_tag = ((struct cp_info_t*) class->constant_pool[i])->tag;
switch(cp_tag)
{
case CONSTANT_Class:
fprintf( fp, "CONSTANT_Class_info");
fprintf( fp, "\n\t\tClass name index: ... | 0 |
ba8e4c5017a17bb03807c4b5572a4991 | 4f15b66fddcf0794b9a65526efad0b01 | n.b., finds a floor region that fully contains the box | public class Octree : MonoBehaviour
private void FindSmallestBounds()
{
FindSmallestBox();
Vector3 offset = _region.min - Vector3.zero;
_region.min += offset;
_region.max += offset;
int high = (int) Mathf.Floor(Mathf.Max(Mathf.Max(_region.max.x, _region.max.y), _region.max.z)... | 1 |
92d18066a2555329ed77518fdb3b0187 | ce4e188b286ea51cfb4b2b92f6bc5319 | Suppression multiple d'un genre_categorie | class ServiceMetierCtGenreCategorie
public function deleteCtGenreCategorie($_genre_categorie)
{
$this->_entity_manager->remove($_genre_categorie);
$this->_entity_manager->flush();
return true;
} | 0 |
b3f2f3da1a370ce15b3567d298194197 | 33f51f311b56b0af9ac5c5e1776a30b2 | Finds a function definition that follows or contains the given line number. | preceding_defs = [d for d in defs if d.a <= region.a]
target = None
for d in reversed(preceding_defs):
is_closure = False
block = view.substr(sublime.Region(view.line(d).a,
view.line(region).b))
block = dedent(block)
if len(block) ==... | 0 |
3f6b75f149cef3a27a4718b6a8443081 | 4f6ba8ba1ff3e4a80d983819dca01f81 | ur"""Rate (/s) counter for mcmp4vidbytes. | class mediaclassification_stats(base_resource) :
def mcmp4vidrate(self) :
try :
return self._mcmp4vidrate
except Exception as e:
raise e | 0 |
e6e61c464535a39b1fc42ab7d1daa08c | 74749fc553d3f642111b7b5bd08f10a7 | 패배 로그르 통해 플레이어의 승패 결과를 설정합니다. | public class PlayStateManager : MonoBehaviour
void OnGameEndNtf(Packet.GAMESEVER_NTF_GAMEND pkt)
{
if(pkt.Result == (int)NetworkManager.TcpError.Win)
{
appManager.gameEndMessage = "Win";
}
else if(pkt.Result == (int)NetworkManager.TcpError.None)
{
appM... | 1 |
cb2c704450b9a38a33b2a18ea81edaf2 | 6b096b6c72ae209722e9988ef4bcd29d | 根据方法描述符来获取参数数组 | class Dispatcher extends Component
public static function fetchArguments(\ReflectionMethod $targetMethod)
{
$args = [];
if ($methodParams = $targetMethod->getParameters()) {
switch (self::convention('PARAM_SOURCE')) {
case self::REQUEST:
$vars = $_REQU... | 1 |
1d11a4a72268849c59d6f3f461bfbedb | ffa6d98c9f5ec16e30902e3520b48119 | Returns an iterator that will yield the results, each as an
instance of the Response class. Throws BadPacketException if
this data couldn't be extracted. | class NewResponse(ClientResponse):
def __iter__(self):
return self.iter_content(128) | 0 |
58072ad7eab4728538c391de59564f71 | 0690bb1264dc5318e5c85604b150c2db | 递归实现序列化:树 => 数组 | class Codec:
def serialize(self, root):
def doit(node):
if node != None:
result.append(node.val)
doit(node.left)
doit(node.right)
else:
result.append(None) | 1 |
c502c54a1fcce79025417f1842bf639a | 9319e82a0d9dcef397733f49612513f6 | Отметка о кэш попадании при записи данных (то есть обновлении данных) | class AccesRecord extends AbstractRecordLBox
public function isCacheOn() {return false;} | 0 |
981d4f3a3a6b74a145d46ff810b8ac5d | 94f4df086c272bc68e402c6a877165b4 | 统计几个字节数组总长度 | namespace InOutTerminal.Interface.ACS.RalidACS.sdk
public class RalidCommonCls
public int ByteSum(int start, int bytesCount, byte[] bytedata)
{
int tempsum = 0;
for (int i = start; i < start + bytesCount; i++)
{
tempsum = tempsum + bytedata[i];
... | 0 |
7b6be44cbeb724480c9034f80ba991fb | e9b8f4a1719df1b9d7d5ef8dd9dceb2f | number of output neurons only depend on the dimension of the image and
because of that, the function will only get the image dimensions to calculate
number of neuron in the network. | @Service
public class DatasetService
public int getOutputNeurons() {
List<double[]> resultBinaryList = createResultDatasetBinaryList();
int outputNeurons = resultBinaryList.get(0).length;
return outputNeurons;
} | 0 |
1f50f3f360fc5fea394ade416a8c3d9c | 280e46f47b5526dcf1d8a3db92f13f5d | 去除时间中的秒 | Calendar instance = Calendar.getInstance();
instance.setTime(date);
instance.set(Calendar.SECOND,0);
instance.set(Calendar.MILLISECOND,0);
return instance.getTime();
} | 1 |
9708b4317bb13fa6e80c3e9ffe56515e | 4d2092a11c83a27dc17455505500c9f4 | 沿用上期计划 | {
ProductionScheduleMaster newPlan = new ProductionScheduleMaster();
newPlan.ProjectId = targetPlan.ProjectId;
newPlan.ProjectName = targetPlan.ProjectName;
newPlan.CreateDate = DateTime.Now;
Login login = CallContextUtil.LogicalGetData<Login>("LoginIn... | 1 |
b6fd48ece72fd9ac578f4db06ce3d636 | ea2d600fd6c5e39de5a921d4b9dba514 | 根据id值集合查找医嘱服务项目物品AggDO数据集合 | namespace iih.ci.mr.nu.generalnursingrec.i
public class IGeneralnursingrecCrudServiceImpl : IGeneralnursingrecCrudService
public GeneralnursingrecAggDO[] findByBIds(String[] ids, FBoolean isLazy)
{
#region "缓存处理"
if (ch.IsCached("findByBIds"))
{
return ch.findBy... | 1 |
7406b9dac3a2bca668a30bcdcf30f4a8 | e46a4bb4bf479b7d8380063fd8763872 | Returns the FIRST OCURRENCE of a common element | lnode* find_occurrence(llist* list, void* search, compare_op compare)
{
compare = data_compare;
if(list->head == NULL) {
return NULL;
}
else {
lnode* current = (lnode*)malloc(sizeof(lnode));
current = list->head;
do {
if(compare(current->data, search) == 0) {
return current;
}
current = current... | 1 |
b09e6d9dfa0c020546e01f70995c3ed1 | e0b136a90781898f9cc7642f59f2e2a4 | Metodo que permite insertar el listado de los desplazamientos. | ResultSet resp = null;
ManejadorDatosPermiso mdPermiso = new ManejadorDatosPermiso();
try {
resp = mdPermiso.listadoPermiso(desplazamiento, paginacion);
} catch (SQLException ex) {
ex.printStackTrace();
}
return resp;
} | 0 |
5c1c8836875ccdb23d2898c2f842e616 | f604734ceae3d886fbc8ff3bff0d233a | Makes a REST call to Hopsworks for deleting
the contents of the featuregroup but keeps the featuregroup metadata | String featurestore, String featuregroup, int featuregroupVersion)
throws JWTNotFoundException, FeaturegroupDeletionError, JAXBException, FeaturestoreNotFound,
FeaturegroupDoesNotExistError {
LOG.log(Level.FINE, "Deleting table contents of featuregroup " + featuregroup +
"version: " + featuregroup... | 1 |
ca8a632b7a0a0597984204c0039aef45 | 9e024dcd61a02864694d6b2ca3acb10c | Get the TagParser object, create new if not exists | {
if (! $this->defaultTagsParser) {
return $this->defaultTagsParser = new DefaultParameterTagsParser($this->getDocBlocksArray());
}
return $this->defaultTagsParser;
} | 1 |
0e752ac05ae9fe184d016a9eb98ae4d3 | 66a72ec3ad962467d0d5717f58313927 | 友盟统计---App安装 | class TestController extends ApiController
public function installCount()
{
$Installcount = D('Installcount');
$status = $Installcount->installcount($this->client_plat,$this->client_version,$this->client_sign);
if($status){
$this->returnCode(1,'安装统计成功');
}else{
... | 1 |
07fa2557dd8831962196b3a282df6b75 | c289614c0e78f4271b814c20817fd0f1 | Returns index to data of the cell, which is first layer below given coordinates.<br> | public int getLayerIndex(); | 0 |
a32240353f6d38a8fe0340d5eb544278 | 487f9049e0e6d11f583a3849370524d3 | 处理"/stu/"的GET请求,用来获取学生列表
还可以通过@RequestParam从页面中传递参数来进行查询条件或者翻页信息的传递 | @Controller
@RequestMapping("/admin")
public class StudentController
@GetMapping("/students")
public String list(Model model){
List<Student> students = studentDao.getAllStudents();
model.addAttribute("students",students);
return "student/list";
} | 0 |
d205e20cef2f199b5694744355b90978 | 7953c30beb874b460bdd4c70316261e7 | Updates select fields of a `Registration` resource, notably `labels`. To
update other fields, use the appropriate custom update method:
* To update management settings, see `ConfigureManagementSettings`
* To update DNS configuration, see `ConfigureDnsSettings`
* To update contact information, see `ConfigureContactSett... | namespace io.fusionauth public class FusionAuthClient
public Task<ClientResponse<RegistrationResponse>> PatchRegistrationAsync(Guid? userId, Dictionary<string, object> request) {
return buildClient()
.withUri("/api/user/registration")
.withUriSegment(userId)
.withJSONBody(request)
... | 1 |
934564f881d23b5bb3b5a86b029a5f2c | 74c7455a5747aa4579ada31378b3dba1 | Helper method for the tests. Provides an explicit wait. | class TestHogwarts:
def wait(self, timeout, method):
WebDriverWait(self.driver, timeout).until(method) | 1 |
afae8eb45d7b543d55b998c7a92bf3b3 | 89eb15eb5d64d20b9588d6573bb2a48d | you must be authenticated if you want to accept an invite | def active_invitation?
invitation_token.present? && invitation_accepted_at.nil?
end | 0 |
c4a516876b05d4126de3a4a315f2ac25 | 86bae4398946ddf84feef415dae5631d | タブの初期化を行うメソッド | {
ResultCodes ret = ResultCodes.Success;
_EnableAxisChg_TabPage.Text = "有効軸切替";
_LanguageChg_TabPage.Text = "地域";
_CysCheck_TabPage.Text = "CYS";
_SystemFile_TabPage.Text = "システムファイル";
_FileOption_TabPage.Text = "ファイル";
_Mainten... | 1 |
aa80097ee586d69991745997384bc7f6 | c19729049c2b758b53946a0005415356 | verifies that Node constructor can produce Node with specified string value, and that the value is retrievable | class NodeTest extends \PHPUnit\Framework\TestCase
public function testGettingValue()
{
$node = $this->getMockForAbstractClass(Node::class, ['foo']);
$this->assertEquals('foo', $node->getValue());
} | 1 |
b1bf5c6fa57d42f4fd9e071585c8899c | ff481db306bc493e5f6fc1baff89c481 | Logical Router List | export class VpcClient
public neutronListRouters(neutronListRoutersRequest?: NeutronListRoutersRequest): Promise<NeutronListRoutersResponse> {
const options = ParamCreater().neutronListRouters(neutronListRoutersRequest);
options['responseHeaders'] = [''];
return this.hcClient.sendRequest(options... | 1 |
4268a802030ab8e172b93a1fc840da93 | 40df4355bd259c5da1b0109afa288175 | Shows the dialog that gets the column and rows. | final boolean insertAtFirst) {
Bundle extras = data.getExtras();
final int appWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID, -1);
if (LOGD) d(LOG_TAG, "dumping extras content="+extras.toString());
final AppWidgetProviderInfo appWidgetInfo = mAppWidgetManager.ge... | 1 |
b7cb6ace4881b7f30ee04ddfbef964d4 | f443542109494c8561bb79689b70353b | 添加新元素 | function AddElem()
{
TurnToPage(1);
document.getElementById("divCheckElem").style.display = "block";
} | 0 |
83daf7f373dcc016f2c1230dc90e73eb | f473d626d2f23372bb7bc78e5f391de7 | 隐藏雷达 | {
if (m_RenderableRadarModel != null)
{
for (int i = 0; i < m_RenderableRadarModel.ChildObjects.Count; i++)
{
if (m_RenderableRadarModel.ChildObjects[i] is LayerModel)
{
LayerModel model = m_R... | 1 |
9238d8bdeba3ce64bc72a440b9706b88 | 720e3a2c03f3e5b338c45f385f81d3ee | para eliminar el scrollbar de un jscrollpane | function scrollBarEnd(){
$(window).unbind("scroll");
} | 0 |
39198cfba4557800b43b86ba8aac8385 | 2faf3f9a83cfc5ec2525bdcd16aa3434 | コードが続くかどうか | {
bool rtn = false;
if (Utility.GetTokuisakiFromDataTable(tCode.PadLeft(7, '0'), global.dtTokuisaki).TOKUISAKI_CD != "")
{
return true;
}
else
{
return false;
}
} | 0 |
9a604d642262d7249bd4161b427b7014 | b3ac849c3b6c6353edc9190bfb867aeb | ImportPriceBook的幫助器方法。判斷哪些欄位為空或不合法的輸入值,並返回所有不合法輸入值(包括空值)的欄位名稱序列。 | {
string errMsg = string.Empty;
if (string.IsNullOrEmpty(tempObj.CustId) && string.IsNullOrEmpty(tempObj.GroupId)) errMsg += ",Customer|Group) ID empty";
if (!string.IsNullOrEmpty(tempObj.CustId) && !string.IsNullOrEmpty(tempObj.GroupId)) errMsg += ",Customer&Group ID empty";... | 1 |
f8e330e9de65a466fec49480182a883d | a670ccd9f0679937abbc0a59987aaa99 | Получение списка сотрудников с фильтрацией по гендеру. | {
$queries = \Request::query();
if (isset($queries['gender'])) {
$employees = \DB::table('employees')
->where('gender', strtoupper($queries['gender']))
->get();
} else {
$employees = \DB::table('employees')
->get();
... | 1 |
0958cf57e7ad843d4546809c9f6091bd | 0771ef49a47a3899bc47ffc2683acf34 | 仮想要素(セル)のIDの再構築を行う。
ローカルIDに構成要素(セル)+連番を設定する | public class LangTableData
public void ResetGenerateID()
{
int id = 1;
foreach (var kvp in rowDatasById)
{
kvp.Value.SetCell("id", id.ToString(), false);
id++;
}
} | 1 |
d69dd46e7bb186faada58a6c9dd6256b | 867363a1731a6a2687b9b0d117a2dc69 | This method is executed when the user cancels the notification-dialog that shows up when he wants to archive the
career. This method just closes the notification-dialog. | public class EditEmployeeController extends Observable implements Initializable
public void onCancelButtonClick() {
close();
} | 0 |
4544a5226b3661dadbd2b31b12f7ed37 | 0dbd91e11c044cd95e2e53873925d610 | Metoda sprawdza czy automat jest pusty. | public class RobotDAO implements Map<String, Robot>
@Override
public boolean isEmpty() {
return this.size() == 0;
} | 1 |
a9a0b3b8a1714da7c5e6d9180ff327c1 | 6481a5d7b9bb95129b5a2f1cf8fc2769 | Interface to ray_defaults(); set photon mapping defaults | {
pyr_levels = 6;
harris_k = 0.04f;
harris_thresh = 100.0f;
harris_cell_size = 18;
lk_num_iters = 5;
lk_win_size = 10;
seed = 1234;
samples = 1200;
errorThreshold = 0.5f;
medianFlowThreshold = 0.5f;
pFx = 723.106140f;
pFy = 723.781128f;
pCx = 512.f;
pCy = 512.f;
... | 0 |
59cc37bb8432a1b94b9986e2df90f154 | 4fa3fc2dbd17dc2a7184c530b47a7cdc | Gets a full category path to the specified category id. The CategoryBasic returned would be this category with ParentCategory defined. | class AllegroWebAPI
public function GetCategoryPath($Options) {
$this->checkConnection();
return $this->_client->doGetCategoryPath(
$this->_session['session-handle-part'], $Options['category-id']
);
} | 1 |
3c3766550f2b45344b0d398b3603a69a | cfb39143d37b587944697173e2bdef3f | 删除编码类型按钮单击时间响应 | if (btnType == TYPE_BTN_DELETE) {
List<GoodsBean> selectedAll = mAdapter.getSelectedAllDrugListDelete();
if (selectedAll.size() > 0) {
popWindowDelete();
} else {
showToast("请选择要删除的商品");
}
} else {
requestEventCo... | 1 |
f2b2e9433772fa78d04f357e3dbb65f0 | 0fffda2ed8660091c490ce686fca37cf | Inserts a time series into the database.. | class Timeseries(Resource):
def post(self):
data = request.get_json()
try:
TimeseriesSchema(many=True).load(data["values"])
return {}, 201
except marshmallow.exceptions.ValidationError as e:
return {"error": f"Something is wrong: {e}"}, 400 | 0 |
ad3b6858f4468b4fad12f7a3e018c825 | 44c0bb6ab9665d0596497a3d6a6a656c | Print scoreboard changes to DOM | function updateScoreBoard() {
$('#matches').text(matches);
$('#remaining').text(remaining);
$('#missed').text(missed);
} | 1 |
5930c03c786d60208f7185d7853beda0 | f92691b79ae665abae36a7315f6efde7 | Returns the total for the ChargeableRateInfo | public class Billing implements Copyable
public final float getTotal() {
return total;
} | 0 |
9d6342771d304d0d98869fca5e2506d9 | b514bec610297b5fc41a76aabdbba580 | 배열과, 인스턴스변수를 생성하는 method | class calc_class:
# 클래스 변수: 자료저장
def __init__ (self,a,b): | 0 |
6fdcafe0f946cb0547167894ec4ddb90 | 75fd0fc5bccf7eaee81873f02b08343a | 访问者给宠物狗喂食 | public class Dog extends Animal implements Swimming
@Override
public void eat() {
System.out.println("狗啃骨头");
} | 0 |
53c4fe1a5afc12475718707d64f76038 | ab0a8833b2d6d7bbf1c3163c5905436c | Device type and device ID for where the data in the buffer resides. | class ProtocolBuffer(ABC):
def __dlpack_device__(self) -> Tuple[DlpackDeviceType, Optional[int]]:
pass | 1 |
704d067ddd7033fde6d2ad449cea2d54 | 3429c291e265a7fc50c77f6c2ca3ae2c | Test that valid app names are accepted | class TestExtensionName(TestCase):
def test_init_with_valid(self):
self._test_init("valid") | 1 |
25b774583777020a6523628c456589cc | 0f7897ee456bcf56e2d24f7f836ea0d3 | Updates a purchase order's tracked submitted feed Id. | namespace EIS.Inventory.Core.MwsChannels
void SubmitSingleProductPriceFeed(MarketplacePriceFeedDto priceFeed, string submittedBy); | 0 |
20a48c827e4ad9c3a2c7e700e47b8315 | 130a8db4bbb56de60bd407673e8d9df3 | 本地路径非空,表示存储卡找到最新版本的安装包,此时无需下载即可进行安装操作 | public class UpdateService extends Service
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
if (android.os.Environment.MEDIA_MOUNTED.equals(android.os.Environment
.getExternalStorageState())) {
updateDir = new File(Environment.getExternalStorageDirecto... | 0 |
3e163ef907ae58442af39116daa87210 | 799230aac040db5bc5429de63cb21bdc | Construct a new CsvFile instance | class Csv extends \Common
public function __construct(Controller $section)
{
parent::__construct($section);
} | 0 |
415153b7f729083153e55e50d27de81e | 1e22022e282425727622659a55f49a60 | elava ao quadrado os resultados das subtrações de y | let subtracoes = [];
for(let i = 0; i < eixoY.length; i++){
subtracoes[i] = eixoY[i] - entradaY;
}
return subtracoes;
} | 0 |
cab237b44b18586f76b570f604642124 | c9de436c3649d0990ff1df6efa954175 | 使用原生response对象响应数据 | class Spider handleData(data)
transformResponse (res) {
return Buffer.from(res)
} | 0 |
df0febf0051f9e1b015145f9c9248f1b | 4b5ec97c55727c480d0805d43143a75d | 返回计量单位,按类型 | export default class PrintTask extends Component
returnUnit(item) {
return (item.type === 6 || item.type === 8) && this.returnCustonValue(item) !== '' ? item.unit : '';
} | 1 |
dd52b65b256089be84896a6594d51cf5 | 04782dceb11b7c238c52cabde9fb623e | !
\brief Get DECT settings from target | declination = readDeclination();
inclination = readInclination();
sampleRate = readSampleRate();
pulseWidth = readPulseWidth();
nMotors = readNMotors();
phaseOffset = readPhaseOffset();
useCalibration = readUseCalibration();
gain = readGain();
averageRate = readAveraging();
for (... | 1 |
921a64bd370500c5ebc528f9cc245eb5 | 76f8a6d6804cda7d79c5a6ccb18516b1 | 创建以i为根节点的子树,同时把树的根节点的地址返回出去 | BTREE create_tree(DATA a[], int i, int size){
if(i >= size){
return NULL;
} else {
return (init_node(a[i], create_tree(a, 2*i+1, size), create_tree(a, 2*i+2, size)));
}
} | 1 |
719fe4bacd05a5530b30d544f578dd7f | 0c0d84a8396f04a9bdedf6a68506a06c | 如果斜着走 | if (snakeX[0] == snakeX[1]) {
snakemove(1, 0);
} else if (snakeY[0] == snakeY[1]) {
snakemove(0, 1);
}
} | 0 |
76e02b516ff28c74cd9ccad12dd6a2ed | 46c47c0826dae1aea8a949e73544365b | Turn off the remote. | class BraviaRC:
def turn_off(self):
jdata = self._jdata_build('setPowerStatus', {'status': False})
self.bravia_req_json('system', jdata, log_errors=False) | 1 |
5043f7ddbf7f689b76c57d8bf97482ef | 77d2bcb58925a097512d53306c536b2e | Returns the currency balance, fraction is delimited with a period (.) | {
parent::__construct($reader, $options);
if ($reader === null) {
return;
}
$this->_balance =
((($tmp = $this->_reader->readUInt16BE()) >> 8) & 0xff) +
(float)("0." . ((string)($tmp & 0xff)));
$this->_reader->skip(2);
} | 1 |
d06bcb4760812267ceb7924f4ffacc68 | ec1dda4e9c3d0f73f3e8f53712eccbfd | This transformation modifies the input circuit by preparing a Bell State. | circuits = []
qr = QuantumRegister(1)
if final_measure:
cr = ClassicalRegister(1)
regs = (qr, cr)
else:
regs = (qr,)
circuit = QuantumCircuit(*regs)
circuit.h(qr)
circuit.barrier(qr)
circuit.tdg(qr)
if final_measure:
circuit.barrier(qr)
circuit... | 0 |
e8b0ea2660979029fa48fbe6fe670f74 | 9cd3caceb1619674a1e2f2bd56f9bf4d | Adds potential owners to given task instance, optionally removing existing ones | class UserTasksAdministrationBPMApi
def add_excluded_owners(id, t_instance_id, body, opts = {})
add_excluded_owners_with_http_info(id, t_instance_id, body, opts)
return nil
end | 0 |
26e196ddfb6058316ab8dcadf9e11593 | f7edde8049877f2d4a57f2e57ee30225 | Creates a triangle at the given location | class PathUtils
fun createTrianglePath(path: Path, x: Float, y: Float, canvas: Canvas) {
path.moveTo(x, 0f)
path.lineTo(x * 2, y * 2)
path.lineTo(0f, y * 2)
path.close()
canvas.clipPath(path)
} | 1 |
15af30bb30afced7c305692af9ace44b | 59ffc253c24e050baaa51f0650ce36c0 | 3. 删除一个无头单链表的非尾节点(不能遍历链表) | namespace Sobey.PointToOffer.DeleteNodeInList.UnitTest
[TestClass]
public class DeleteNodeTest
[TestMethod]
public void DeleteNodeTest2()
{
Node<int> head1 = new Node<int>(1);
Node<int> head2 = new Node<int>(2);
Node<int> head3 = new Node<int>(3);
... | 0 |
a54f87b0a0a7ccb8dd808c25236ca765 | c0d444914955552ade45233d8d87bab2 | Sets the value of the mailOnError property. | m_mailSettings = mailSettings;
if (LOG.isDebugEnabled()) {
LOG.debug(Messages.get().getBundle().key(Messages.LOG_MAIL_SETTINGS_1, mailSettings));
}
} | 0 |
168dde00436b3720942632e33842a80e | 4e55e27273f2013b274f9e062b8d51cc | 小鸟上升的操作 | bulletMusic.play();
clearInterval(birdDownTimer);
speed = 10;
clearInterval(birdFlyTimer);
birdFlyTimer = setInterval(function(){
birdImg.src = "img/up_bird1.png";
speed -= 0.5;
if (speed <= 0) {
clearInterval(birdFlyTimer);
birdDownTimer = setInterval(birdDown,30);
}
birdImg... | 1 |
dd5321f9905d965bba53ec05d6299e91 | 77efdcd78a48bd78071b9da86a13754c | Validates if the description is less than 256 characters | class Lists
public function check_description($description = '')
{
$description = get_string($description);
$result = FALSE;
$length = mb_strlen($description, 'UTF-8');
if ($length >= 5 && $length <= 2000)
{
$result = TRUE;
}
return $result;
} | 0 |
83efebfa8b50c55a05b6ad7d4c8f91cf | 0bd8ca1da0ef060a06dcd8bb50b0e940 | Checks if a hotkey has already been registered as a Local or Global HotKey. | {
if (!SupportedHotKeyCodes.Contains(keyCode))
return false;
m_hotkeys.Add(keyCode, false);
return true;
} | 0 |
56fcab44ca08a2601adbf3ada5e9d486 | a0663ea92a0dffa9686a5f131a15227b | Computes coefficients for the positive maximal curvature value. | xs = np.log(rhos)
ys = np.log(etas)
x1 = xs[0:-2]
x2 = xs[1:-1]
x3 = xs[2:]
y1 = ys[0:-2]
y2 = ys[1:-1]
y3 = ys[2:]
a = np.sqrt((x1-x2)**2 + (y1-y2)**2)
b = np.sqrt((x2-x3)**2 + (y2-y3)**2)
c = np.sqrt((x3-x1)**2 + (y3-y1)**2)
A = 0.5 * abs((x1-x2)*(y3-y2) - (y1-y2)*(x3-x... | 1 |
fe02a32ff0acd89e47fb8bdc9d569356 | 330b765d25ab13dccc57d9aaf04ff0db | Forget that a JIT context is owned by a ResourceOwner | {
if (resourceDisplay == this)
{
resourceDisplay = null;
}
} | 0 |
e1e06c7bb96887a746d96dc5684be99f | 9caf55ac1a5049037aa263e884fef657 | setParent()
Params:
- GameObject newParent : the parent object this script is to be attached to
Desc: Sets the object this script should move when path is followed. | {
parent = transform.parent;
if (!parent)
{
Wayfinding();
rigid.isKinematic = false;
}
else
rigid.isKinematic = true;
} | 0 |
1bb94ddb9f1efff9b17031c87a3fa09f | c67b7e9ee35db0dcbbffa5e3b0aab460 | Get all ids in the given data set. | id_list = []
for r in self.get_all_data(table=table):
logger.info("Id %s found.", r['id'])
id_list.append(str(r['id']))
return id_list | 1 |
73065e5f6fc32632d46b00543326d9e1 | 8a112c7340b626c9f8f412727b1bb7be | Enable verbose logging for all sub modules. | lvl = config.get_ygg_loglevel()
config.set_ygg_loglevel(lvl)
os.environ['YGG_SUBPROCESS'] = 'True'
lvl = config.get_ygg_loglevel()
config.set_ygg_loglevel(lvl)
config.cfg_logging()
del os.environ['YGG_SUBPROCESS'] | 0 |
64f6c04dd61715fa1ea2059407d5915b | 3d5a72b9d0db27163333f1038ad67ddb | Gets the fetch max wait ms. | default VertxKafkaComponentBuilder fetchMaxWaitMs(int fetchMaxWaitMs) {
doSetProperty("fetchMaxWaitMs", fetchMaxWaitMs);
return this;
} | 0 |
24baee8472e092392c940cb4071760f5 | f6f4dac4dd83a1bda10db1631e57226c | Sets <code>value</code> as the attribute value for FileExtension. | void setFileTag(Integer value); | 0 |
1753cbb309ceb8042e9e41f91fd74b16 | f5acec960d738270b915bf21e70175d2 | Get current huge page size | {
t_accelfuncConf *accelfuncConf;
accelfuncConf = acceleratorFuncConf(acceldev->enginetype, acceldev->accelfunc);
if (accelfuncConf)
return accelfuncConf->nbHugepage1G;
else
return 0;
} | 0 |
049d70c9b2b105e56ba4a6e97ed49b4d | 2af9b4f06cd70c08e0145481e7963065 | 描述一副扑克牌的类,总共54张包括大小王 | class DDZ:
def __init__(self):
self.total_cards_id = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,
19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,
36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53]
self.card_dic=dict([(0,'方片3'),(1,'梅花3'),(2,'红桃3'),(3,'黑桃3')... | 0 |
c75affb70d097d11e19d31415e31c072 | 7fbbf45bd32c1636a7a49ede85e5344e | DynamoDBのTimeToLive時間を返却 | namespace NStruct.NoSql.Redis
TimeSpan GetTimeToLive(string key); | 0 |
3a96aa3431c5507c9da15dd58dca22fd | 7a51be45085e5171120ba61db1f0dd7d | Set accessor for persistent attribute: fk_usuarol_usua_usua_id | public abstract class Jer_usuario_rolBean implements javax.ejb.EntityBean
public abstract void setFk_jerusuarol_usu2(
co.com.telefonica.atiempo.ejb.eb.UsuarioLocal aFk_jerusuarol_usu2); | 0 |
a01f821730a3b99409fbfd0236767463 | 05004b600019476196e158fc2829a46c | Permet de mettre à la jour status d'activation d'un des modules. | class Module extends DB
public function actionModule(): bool
{
$g_module_name = Request::post('module_name');
$g_xml = simplexml_load_file('../../module/'.$g_module_name.'/module.xml');
if (Request::post('active') === 'true') {
$g_xml->active = 'false';
$g_xml->saveX... | 1 |
fcf7c1715fe3446ca9529fbeb0ce25c6 | 57bbc49f518a6e9d66f2108a04f3186d | lottery calculate 6 random numbers (between 1 and 20) | numbers = (1..45).to_a
random_numbers = numbers.sample 6
@lucky_numbers = random_numbers.sort
end | 0 |
c78cbc58f56aa355ef28bd0e82e5517a | 2400888e278811507a48a1cb3cfd349b | Performing operations to remove extra spaces | namespace LibraryManagement.BUS
class BorrowerBUS
public String RemoveExtraWhitespaces(String name)
{
Regex trimmer = new Regex(@"\s\s+");
name = trimmer.Replace(name, " ");
return name;
} | 1 |
61471cd3fa6002594a3b20e6f0dbcbd4 | e3eb8bd56ea8364374605ac768b59f20 | 根据商品找对应的渠道、推送者 | public List<Map<String, Object>> queryPushlistChannelByProductId(Long productId); | 1 |
88a8eabed997f683e1a6f77f0a86d06f | 85919f3c3bf7a22b8f93e7d6c6e8d6b5 | Get the modification time of the database file of a q-gram database object. | time_t tcqdbmtime(TCQDB *qdb){
assert(qdb);
return tcbdbmtime(qdb->idx);
} | 1 |
b7ad1e50fc75c0fbd0d9d42445a170b1 | e7dc2013993b2743141b81ded0d19b14 | Computes the rank-based discount for a pair. | pos_count = len(pos_ranks)
neg_count = float(total - pos_count)
if neg_count == 0.0:
return 1.0
trans = self._transformation
fprs = [1.0 - (rank - i - 1) / neg_count for i, rank in enumerate(pos_ranks)]
return 1.0 - sum(trans(fprs)) / pos_count | 1 |
71b2fd199d1c429238e8ef01a2efbcbd | fcb8d3fe569be86bb89a592cddfdf009 | OV2640切换为RGB565模式 | {
SCCB_WR_Reg ( OV7725_COM7, 0x80 );
delay_ms(50);
OV7725_IDCode = SCCB_RD_Reg(OV7725_VER);
if( OV7725_IDCode != OV7725_ID ) return 0;
if(OV7725_IDCode == OV7725_ID)
{
SCCB_WR_Reg(OV7725_COM4 , 0xC1);
SCCB_WR_Reg(OV7725_CLKRC , 0x01);
SCCB_WR_Reg(OV7... | 0 |
cefa9f10f9347016c0d1a8febb11b3f4 | 723157b53434cedf8e62e12311ccb9f8 | Проверка на возможность смещения фигуры вниз | {
if (CurrentFigure->position.GetY() + CurrentFigure->GetY_Size() > Y_SIZE)
{
return false;
}
for (int x = 0; x < CurrentFigure->GetX_Size(); x++)
{
for (int y = CurrentFigure->GetY_Size() - 1; y >= 0; y--)
{
if (CurrentFigure->Matrix[x][y] != EMPTY_CHAR)
{
if (GetChar(CurrentFigure->position.GetX(... | 1 |
b44db74aaa362026981a1586932d55f8 | d454afb93c81e97688b15a70cfdf5d6a | Define si se genera la contabilidad | public class BaseCustomerSupplierDto extends ArchiveDto
public void setIsGenerateAccount(boolean generateAccount) {
isGenerateAccount = generateAccount;
} | 1 |
663a2bca76e411bcba849d598ffd6ed6 | 27098b2d8c510b026b29fd64bf2add61 | Tests the behavior of the virtual static group with a static group based on
the uniqueMember attribute. | {
PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();
try
{
tx.begin();
List<UserGroup> instances = new ArrayList<>();
UserGroup grp1 = new UserGroup(101, "First Group");
UserGroup grp2 = new U... | 0 |
a5e0890ca6d481b1620de86563821bb8 | 0d0641f6d8770711de9f1871581b1372 | Tests correct and not correct accusations | class GameSolutionTest
@Test
public void testAccusation() {
Solution theAnswer = board.getSolution();
String person = theAnswer.getPerson().getCardName();
String room = theAnswer.getRoom().getCardName();
String weapon = theAnswer.getWeapon().getCardName();
Assert.assertTrue(board.checkAccusation(person, room... | 1 |
88670590fc89e88c160759266113055f | 36ef91a5b3c2186f8ca54fe4e8a44c53 | Updates a ProductUnit | class ProductController extends Controller
public function editProductUnit(Request $request)
{
$product = Product::find($request->id);
$product->unit_id = $request->unit_id;
$product->save();
return response()->json([
'success' => true
]);
} | 1 |
537df8e7bb4138febb0797c333c8ae6b | e7e7c5b3827efed1523f784cf8cc1121 | 返回图中是否有负权环 | for (int k = 1; k <= V; ++k)
for (int i = 1; i <= V; ++i)
for (int j = 1; j <= V; ++j) d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
for (int i = 1; i <= V; ++i)
for (int j = 1; j <= V; ++j)
if (d[i][j] < 0) return true;
return false;
} | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.