query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
d8da694e3f17a94cc4975693d83531b0 | 30731db3dd2501f56bcf74668609fd4a | Called by timer. Turn LED0 on and off by timer intervals | __interrupt void Timer_A0 (void)
{
LED1_OUT ^= LED1;
LED2_OUT ^= LED2;
} | 0 |
a88bf676922d11e37e952200ec5a122b | 8b74040dd0e975a7f003a73d3e55e238 | Wrapper for the Labbrick dll library (vnx_fmsynth.dll). | VBLIB_DLL_API int fnVblib_dll(void)
{
return 42;
} | 0 |
0d015f8b70d067113de93cd6e629e405 | 71bac33150b4910ef6ef3fb12d34c2ee | Gets (as xml) the "taskIdentifier" element | @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = {
"taskXml"
})
@XmlRootElement(name = "CreateTask")
public class CreateTask
public JAXBElement<String> getTaskXml() {
return taskXml;
} | 0 |
9bb0fb632f3eb378ed78fb894cfcd938 | 873b94eeb225d091d7f31d6e677a01b9 | Keep a visible timer running to show that the main thread is active | G_END_DECLS
namespace WebKitEmbed
void Browser::tick() {
uint64_t tid;
pthread_threadid_np(nullptr, &tid);
assert(tid == g_Once.tid);
gtk_main_iteration_do(FALSE);
} | 0 |
25d08cd5ae96de9c13e98b1df7cea389 | 4fb2af35281858158e69681f86e65102 | calculate new position of the cursor, based on the direction
and have it be constraint to the bounds of the numpad | def change_pos(pos, direct):
if(direct == 0):
flip=check_border(pos, direct)
if(flip == None):
pos -= 1
else:
pos = flip
elif(direct == 1):
flip=check_border(pos, direct)
if(flip == None):
pos += icon_heigth
else:
po... | 1 |
cda02f1d8483d489215437974e60ac41 | 023e7a29684e7e335a8086f5105818a0 | Construct one-element tree. | simple_unary_tree (int nonterm, int tok, AttributeSet *attributes)
{
Node *node = new_nnode (nonterm, 1, attributes);
set_child (node, 0, new_tnode (tok, new_attribute_set (0)));
return node;
} | 1 |
c37876efb9a68b16cc65ac701f534325 | f396073caeb0716b35d1b1e11aef8692 | Method putting structure on the map depended on structure type, automaton type and mause clicked coordinates | double mousePosX = _panel.getMousePosition().getX();
double mousePosY = _panel.getMousePosition().getY();
double x = _scaledImage.getWidth(_panel) / _XNumber;
double y = _scaledImage.getHeight(_panel)/ _YNumber;
int posX = (int) Math.floor(mousePosX/x) ;
int posY = (int) Math.floor(mousePo... | 1 |
c8a7dc295ea94b6456e92f71f10860a0 | ee483d14a8f4f200a5cd9aa7daa2245a | This method converts the message metadata in to a header. | string supportInfoPhoneNumber, string supportInfoText, string supportInfoUri, string language, Guid requestId)
{
LogManager.LogTrace(string.Format("SE.GOV.MM.Integration.Package.BusinessLayer.Handler: incoming getMessageHeader with RequestId: {0}", requestId));
var messageHea... | 1 |
87eacf834b172f94e1a34efb04f76407 | b5dba273190da9d14c208148ebd1a820 | takes list of regex patterns and print all matches list | for i,name in ipairs(tests) do
if name:match(patt) then
print()
print(name)
print(('-'):rep(70))
run_test(name)
end
end
end | 0 |
380294a29df71ca6b02c782b63dd4cb3 | 59d4ac2f9899a7e05220f496f8bf4df8 | \brief Proces zákazníka | class ZakazniciPresenter extends BasePresenter
public function renderEdit($id) {
if (!$this->getUser()->isInRole('admin'))
$this->redirect('sign:in');
$this["pridatSmlouvu"]["id_zakaznik"]->setValue($id);
$this["pridatZbozi"]["id_zakaznik"]->setValue($id);
$this->template->id... | 1 |
a83e8854fcf4f7838ced224b7f77b8c4 | 8ecd5b0c16610ef720a3fd9670eee307 | Load a config from a YAML file, and use it to dynamically create a new subclass of
:class:`~approxeng.input.Controller`. This new class will be immediately available for
use elsewhere in the library, in particular it will be picked up when searching for
matching controllers to use. | with open(yaml_path) as file_handler:
data_dict: dict = yaml.safe_load(file_handler)
return class_factory(**data_dict) | 1 |
172488fb10295a4da34659cfe4718d9e | 5f69387807ca922b3d0535e0af9e4f6b | urlsafe_b64decode without padding. Returns result as UTF-8 encoded string. | def decode_base64_urlsafe(text):
return base64.urlsafe_b64decode(text.encode('utf-8')).decode('utf-8') | 1 |
4d41fae0f4aeed973b6f20cb62e9f196 | 7a3ab464de817efcc1b8aba6fa007504 | Computes force matrix, taking advantage of upper triangular symmetry | n = self.n
full_array = np.zeros((3*n, 3*n))
full_array[np.tril_indices_from(full_array)] = self.fcs
full_array = full_array + np.tril(full_array, -1).T
return full_array | 1 |
7a6c3d009a2c3d6804eb08eee06fa225 | 29ec2bc0862588ad5492b27fb551b120 | <p>Gets the ID of a downloadable object providing the content for a specified puzzle resource.</p>
corresponding downloadable object for.
puzzle resource. | String getStreamContentId(ContentId contentId); | 1 |
8af316fc931c36bbdd6afa139d607dd5 | 9a98cba48f685dec26bd83bcf538b931 | Metodo para realizar las acciones del sub menu de proyectos | var accion = e.target.id,
id = e.target.parentElement.id;
var xhr = new XMLHttpRequest();
if (accion === "actualizar") {
Swal.fire({
title: 'Ingresa un nombre para el Proyecto',
input: 'text',
showCancelButton: true,
... | 1 |
6de128a8d9376cd6058040eac5c58aa0 | f146c208a5b6011ef3ab08661a595b6b | Соответствует ли вся строка указанному шаблону | {
return CharUtils
.Matches(map: content.Content, template: Content, "", strict: strict);
} | 1 |
c5521129e7d207dba068d32b6a07f28a | 665ffde5b8391701537ea30a7b8d4d2a | Get the last node that is accessed by the specified node.<br>
<br>
For example:
<blockquote><pre>
tree.next.calculateSize()</pre></blockquote>
In the previous statement, "<code>calculateSize()</code>" is the
last accessed node. | if (pathCache == null)
getPathFromStartNode();
return pathCache.size() - 1;
} | 0 |
7c464aae1d90e6588b73a876d55afe1f | ffa39e76cea4173f5abb474756f2251d | Convert a path of points to an array of lines | if (xypts[0] == xypts[-1]).all():
xypts = xypts[0:-1]
linesegs = np.zeros((len(xypts), 4), dtype=np.float)
linesegs[:, 0:2] = xypts
linesegs[:, 2:4] = np.roll(xypts, -1, axis=0)
return linesegs | 1 |
4b10576d3c76454e5bc31f85e5240b25 | 4274992659d2a2c5496aaf2b1d36aad2 | Sample value from an arbitrary distribution. | if self.disc_distribution is not None:
variate_index = self.disc_distribution.rvs(size=1)
return self.values[variate_index]
if self.inverse_cdf is not None:
rand_uniform = uniform.rvs(size=1)[0]
rand_variate = self.inverse_cdf(rand_uniform)
ret... | 1 |
5f66edcb20f6969e4c8ff4242999d863 | e8c05809fbf52a522cc66301dbd434e1 | если есть post-данные, то сохраняем или создаем нового юзера. | {
if ($this->request->isPost()) {
$user = new Users();
$user->assign(array(
'name' => $this->request->getPost('name', 'striptags'),
'profilesId' => $this->request->getPost('profilesId', 'int'),
'email' => $this->request->getPost('email'... | 1 |
85adf10fd98e2647d45373d6564a0e73 | 01ed427061f32d6cced7195bd7b7efad | Called after PrepareForTermination, all derived classes must reset each of their effects
so they are ready for reuse when Spawned again.
<remarks>This method is only for preparing for reuse. Stopping effects should be handled by PrepareForTermination.</remarks> | namespace ZitaAsteria.World.Effects
public abstract class AbstractCompoundEffect
public virtual void Reset()
{
_elapsedLifeMS = 0;
} | 1 |
86708889023d73ce2da6308b9fe070c5 | 2b202b3b6a9f19242e7f466d350f2428 | 選択中のクエストインフォを表示
ObjectCencerAreaより呼ばれる | {
if (id != -1)
{
this.WriteMessage(Protocol.TYPE_SELECT, SelectProtocol.AREA_SELECT, SelectProtocol.SELECT_CREQ, id);
}
} | 0 |
814fb4b75fc3d63e387f5ea45bd40ec2 | a9d47eb3d53fd022fcff4bc57721adfa | リストの最後尾を抜き出す(破壊的) | {
void *ret;
CHECK_PARAM_POINTER_RETURN("list", list, NULL);
ret = _edata_list_last_remove(list);
return ret;
} | 1 |
9b77592284c61088e8af653fa96a476e | cdb47d2fddeb82c2df8e110adbe056c9 | Append the main elements to a wrapper element. | public function appendTo(Element $wrapper); | 1 |
77b88142b9d3a8a9b852d9bbb4ca444a | e6e45a40ee045317c14c148cb72d6d5e | Add a ssh key to a project | project_ssh_keys = textwrap.dedent("""\
me:ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwqx8+h4c6K0ipqLqXt1y4ohpbk6PxDdWzprGxNFrsir/QrOy6iQBAyvlbAb/kM5RaNkjliakfmNEMBH3/tmhBIEmSAsZ0dfhwBof0Hm+bRFI475ik/p7QKSpPXf2nCgG3QF75jfLrk+4R6P+0w3zxbq63LxrB7umUxTA2tGMqgNIW0OQ/w2mfl4DfFTTXQeJ4/Gu6grpl1+Mi7RwtV9RPE5UuveXpcj7ht... | 1 |
7f3aadc5221ae0b0ae782f86dda7d116 | 299ea89d7b3a39482f36ed377449aff8 | Clear form using FormControl class. | e.preventDefault();
this.validateForm.reset();
for (const key in this.validateForm.controls) {
if (this.validateForm.controls.hasOwnProperty(key)) {
this.validateForm.controls[key].markAsPristine();
this.validateForm.controls[key].updateValueAndValidity();
}
}
} | 1 |
9e260b13a9e3a3f8b272b065861701c2 | c29199709de04caaa762ae848b1f3a82 | Created a version of the board that contains the color in control of each space
instead of the Stack object in that space. | void Board::calcBoard(colour side)
{
int *b[8];
if(side==white)
{
for (int i=0; i<8; i++)
b[i]=(int*)this->whiteControl[i];
}
else if(side==black)
for (int i=0; i<8; i++)
b[i]=(int*)this->blackControl[i];
for (int i=0; i<8; i++)
for (int j=0; j<8; ... | 1 |
524acf43721dd8f82ae13c3f84639f99 | 30d07fddaf9f10ff8c4ed43f02c64962 | 添加一条新帖(返回1表示成功,0表示失败,下面类似) | opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cookies))
opener.addheaders = [('User-agent', 'Opera/9.23')]
urllib2.install_opener(opener)
url = 'http://weibo.com/aj/mblog/add?__rnd=%s' % random.random()
formdata = {"text":content, "pic_id":'', "module":"stissue", "l... | 1 |
4b0bfe053d1d909941e5f27246534b24 | 99081e9e51cc5cc5edb5f17880e431dd | ページネーション用のオフセットを最終ページに設定します。 | namespace Sakura.AspNetCore
public void GoToLastPage() => PageIndex = TotalPage; | 1 |
fc330699177752593b9b7c1f567d6055 | 5379c5ee2e18000e4be75971b912b65b | Count up how many times a ray intersects the polygon, even or odd tells
you whether inside (odd) or outside (even) | int checkInObject(vector<vec4x3> &mesh, double voxel_center[3])
{
int countIntersections = 0;
int num_mesh = int(mesh.size());
double dir[3] = { 1,0,0 };
double vert0[3], vert1[3], vert2[3];
double *t = new double;
double *u = new double;
double *v = new double;
std::unordered_set<double> hashset;
f... | 1 |
ef0a66b830efccf9034e6a0b8c080c65 | 7b413b986090e836852c913dbaf93924 | This converts the array of messages to a new conversation | temp_conversation = ["Start"] + [""] * (len(worksheet.col(0)) - 1)
j = 1
for i in range(1, len(worksheet.col(0))):
conversation_dict[i]['content'] = cell_parse(conversation_dict[i]['content'])
temp_string = ""
for word in conversation_dict[i]['content']:
for key, value in... | 1 |
d5f27fd6a5085ecd9670d345e6702e0a | 6bc0e7d8ec94639e71960173c08911f0 | +---------------------------------------------------------------------------------+
| PROJECT : GSM-PS (6147) MODULE : CMH_PSI |
| STATE : code ROUTINE : cmhPSI_GetStopBitOverSrcID |
+-------------------------------------------------------------------... | void ftm_gsm_ber_compute_BSIC_from_SCH_block( BSIC_T *BSIC_result_ptr, byte *SCH_block)
{
BSIC_result_ptr->PLMN_colour_code = (byte) (((( SCH_block[0] & 0xFC ) >> 2 ) & 0x38 ) >> 3 );
BSIC_result_ptr->BS_colour_code = (byte) ((( SCH_block[0] & 0xFC ) >> 2 ) & 0x07 );
FTM_MSG_HIGH( "BSIC: PLMN_Colour_Cod... | 0 |
58efd51954bcdf6c37bc961137d64256 | fc64477a8fcd24504707e2ad4ad28b9d | 显示压缩结果 | class CompressActivity : BaseActivity(), OnPictureCompressionListener
private fun showSaveSuccess(isSuccess: Boolean) {
if (isSuccess) {
tv_compress_hint.text = getString(R.string.save_hint)
}
isSave = isSuccess
} | 1 |
bae1e65f2f1e3a6a48310e83b8e90631 | e0a195cd202420049b0ac3ad1e3db988 | Function Name: PWM_Right_LED_Green_WriteCounter
Writes a new counter value directly to the counter register. This will be
implemented for that currently running period and only that period. This API
is valid only for UDB implementation and not available for fixed function
PWM implementation.
None
Side Effects:
The PWM ... | void PWM_Freq_WriteCounter(uint32 count)
{
PWM_Freq_COUNTER_REG = (count & PWM_Freq_16BIT_MASK);
} | 0 |
139eb84ea18b23a891cf8daca346247e | ff41635fc8dc214c12f308b599b32e5d | Modulo para poder visualizar los soportes adjuntados por el tutor | class FichaApoioController extends Controller
public function show($id)
{
$modId = Modulo::findOrFail($id);
$nome = Curso::select('nome')->where('id',$modId->curso_id)->first();
$modTipo = ModuloType::where('curso_id',$modId->curso_id)->get();
$ficha = FichaApoio::findOrFail($id);
... | 1 |
d56b0400f6da86a0c82a3625211e0af4 | 1a75c1a36d69d2566c93aec76cbcf58f | 判断单个文件是否包含断点信息 | @RestController
@RequestMapping("/netdisk/openapi")
public class FileController
@PostMapping("/fileHasBreak")
public Result fileHasBreak(String appId,String businessId,String businessType,String filemd5){
try{
ValidateUtils.validate(appId, "appId");
ValidateUtils.validate(filemd5, "filemd5");
ValidateUtils.... | 1 |
d78e1e8fc4f45226c7562df609574d88 | cd07f9048b4a51db137458b4183098a4 | 如果没有使用letter_box,box中的预测值在处理前后是没有改变的 | image = np.zeros((100, 70, 3), dtype=np.uint8)
bb = ia.BoundingBox(y1=40, x1=10, y2=50, x2=40, label=None)
image_drawn = bb.draw_on_image(image)
expected = bb.draw_box_on_image(image)
assert np.array_equal(image_drawn, expected) | 0 |
1886d43479ff46c89459dc5077a8c135 | a4b0b66d2ed5d4ba4ab8f1db7da86a6f | Generates a 3D rotation matrix from a Quaternion. | namespace RoboDKHelper
public class Matrix
public static Matrix FromQuaternion(double[] qin)
{
double qnorm = Math.Sqrt(qin[0] * qin[0] + qin[1] * qin[1] + qin[2] * qin[2] + qin[3] * qin[3]);
double[] q = new double[4];
q[0] = qin[0] / qnorm;
q[1] = qin[1] / q... | 1 |
e0019f652c42358ced8e1cc99d86c9c7 | 476f26e5d8fd8298556530a044ffb075 | update the y-axis label | export class LinePlot
setYLabel(text: string) {
let horizontal_offset = 2;
this.svg.append("text")
.attr("transform", "rotate(-90)")
.attr("y", horizontal_offset)
.attr("x",0 - (this.height / 2))
.attr("dy", "1em")
.style("text-anchor", "middle")
... | 1 |
27c354840dae652b1bad4924f3b88ace | f7c5fbfbce2e87c9b30b6fb3e1a6dbf3 | 计算输入年月剩余天数 | def title4():
string=input("年-月-日:")
nian=int(string.split('-')[0])
yue=int(string.split('-')[1])
ri=int(string.split('-')[2])
days=0
for i in range(13):
if i < yue:
if i in [1,3,5,7,8,10,12]:
days+=31
if i in [4,6,9,11]:
days+=30
... | 0 |
8e61ada6d72d877d243d9ce45b00284d | 31215cc867fe5dfa90f325e350aa82df | Stops the server, sets all the controls back to initial state | {
stopServer = true;
gameList.IsEnabled = true;
mapsList.IsEnabled = true;
maxPlayers.IsEnabled = true;
port.IsEnabled = true;
secureVAC.IsEnabled = true;
autoRestart.IsEnabled = true;
enableLog.IsEnabled = (bool)aut... | 1 |
211c7ac90d1dada7c89e8f18abee2ab5 | 811dc56c208314e350bfe0e1804a85f8 | ————————————将双链表有选则的合并———————————— | {
LinkList *L1, L2, *r, *r1, *r2, *p;
L1 = NULL;
L2 = NULL;
p = L->next;
r = L;
while (p != NULL)
{
if (p->data == 0)
{
r->next = p;
r = p;
}
else if
{
if (L1 == NULL)
{
L1 = p, r1 = p;
... | 0 |
31fabe967a45fd65277dd81873dd1d46 | 0fc4f42ae62c7030a9f223f478a40560 | vrati pole moznych stavu zakazky | {
DataTable dt;
if (DueDate == null)
{
var query = (from s in DatabaseAccess.DB.Stateks
join r in DatabaseAccess.DB.Rezerwacjas on s.Statek_ID equals r.Statek_Statek_ID into joinedShipsEmpty
from r in j... | 0 |
8cd5d5b4db890c0658a37fd464e96b8f | 7739b4a421bc065790c3112233eb29b2 | Validates that the MSR data read from the card is valid | uint8_t TEMP_1_2[8] = {0};
uint8_t TEMP_3_4[8] = {0};
uint8_t TEMP_5_6[8] = {0};
uint8_t TEMP_7_8[8] = {0};
memcpy((uint8_t*)(TEMP_1_2), (uint8_t*)(temp_results + 4), 4);
memcpy((uint8_t*)(TEMP_1_2 + 4), (uint8_t*)(temp_results + 12), 4);
memcpy((uint8_t*)(TEMP_3_4), (uint8_t*)(temp_results ... | 1 |
9120e6fa10021b57844fa68a2b123ee4 | 1026cca335a65bbb86f9c121129d5cb6 | 取消设置为默认地址 | class AddressesController extends Controller
public function setIsDefaultToFalse()
{
return Address::query()->whereIsDefault('1')->whereUserId(Auth::user()->id)->update(['is_default' => 2]);
} | 1 |
84075a6d8c53b0fec41385a7621dbbb4 | 7e7a6bbdef7d00936ee8ac78625f3c29 | This method generates place locations. | class PongEnvironment(EnvironmentTemplate):
def gen_placecells(self, min_spread=0.2):
N = None
num_tries = 1000
locations = [self.random_location()]
while True:
new_loc = self.random_location()
count = 0
while min([self.calc_dist(new_loc, l) for l in ... | 1 |
4fba851a39803a7b76a4a9b089e0f79c | 3da8206256efcddacbb6a72e29372b6d | Calculates the median of a sequence of doubles. | namespace Ubs.Math.Core.Services
public class CalculatorService : ICalculator
public double Median(double[] input)
{
Console.WriteLine("Calculating median on thread {0}", Thread.CurrentThread.ManagedThreadId);
if (input.Length == 0)
{
return 0;
... | 1 |
fadf5beddf490b2373a104bbd480ebb3 | 1e99059e3e9fe5af8c83a91be937f7f2 | Tests the API endpoint to cancel oco order | def testCancelAll():
method = "/orders"
body = {
'product_id': PRODUCT_ID[0]
}
deleteHelper(method, body=body) | 0 |
721b6f4eab4a37095db7a3a91b0ded4e | 8213cb7fa0cc306e9ade9b9cd39e962b | Set/delete a locator at the current playback position | var videoloc = val.videoloc || {};
var pos = videoloc.pos || [];
var videoId = request.videoId;
var videoPos = request.currentPos;
var existing = pos.find(element => element.videoId === videoId);
if( !existing ){
existing = request;
pos.push(existing);
} else {
... | 1 |
0c18c0330a84087cdf19ad0a8c370bf5 | a26bafa264641d27fab9425b63f585e6 | !
\brief
This function sets the parameters for resize operation | if (NULL != resize && NULL != resize->buf) {
free(resize->buf);
resize->buf = NULL;
resize->w = 0;
resize->h = 0;
resize->src_w = 0;
resize->src_h = 0;
resize->scale_x = 1;
resize->scale_y = 1;
resize->ialpha = NULL;
resize->ibeta = NULL;
resize->xofs = NULL;
resize->yo... | 0 |
1f5798276a4d8239f1bbbe63a1d2ac5f | 94d5479251f5e3f42ba99dd506f4fa81 | 检测图片格式及大小 | function checkImage(obj) {
var maxsize = 3 * 1024 * 1024;
var imgFile = obj;
var pattern = /\.(gif|jpeg|bmp|jpg|png|JPEG|BMP|GIF|JPG|PNG)$/;
if (!pattern.test(imgFile.value)) {
alert("系统仅支持jpg/jpeg/png/gif/bmp格式的图片!");
$(obj).val("");
imgFile.focus();
$("#preview_image_di... | 1 |
5125bc1fd1fb1cb81a575f87cea0f1ec | c017a2c1e7d956af64fa5fb98ea1f835 | Get the window through which the user controls the transition to and from fullscreen. | public class ScreenManager
public JFrame getFullScreenWindow() {
return frame;
} | 1 |
6ebc90d23dbb3e37d2fb863ed8a22b90 | b901bef987be75d00ad956c8bc00eb21 | A room that adds something to the player's inventory | class Room:
def add_item(self, item):
if hasattr(self, 'inventory'):
self.inventory.append(item)
else:
self.inventory = [item] | 0 |
cee9518f242efeb2b35f5c2144372519 | 59e7949d52bd7b3db8ecb39643f67c96 | Verify we are flushing writes correctly by copying the file, and then reading it. | vf.leaseWhite((int) completeFile.length());
int pos = 0;
int numChunks = ((int) completeFile.length() / vf.getChunkSize());
byte[] chunk;
while (pos < numChunks * vf.getChunkSize()) {
chunk = new byte[vf.getChunkSize()];
raf.read(chunk);
raf.se... | 1 |
93464ba15dd850877606d3e1ab73deb2 | 0e20a434599fb1c646a431255870c6cf | For a particular prompt type, displays the representative prompt and response terms. can also display representative prompt and response utterances. | String queryPrompt(String languageCode, String promptCode); | 0 |
a347e330157bd6247ff01c6077648341 | 51a2a55e43c59ad213ad5a3166b07c05 | Initiates the asynchronous execution of the SetReceiptRulePosition operation. | {
options = options == null?new AsyncOptions():options;
var invokeOptions = new InvokeOptions();
invokeOptions.RequestMarshaller = CloneReceiptRuleSetRequestMarshaller.Instance;
invokeOptions.ResponseUnmarshaller = CloneReceiptRuleSetResponseUnmarshaller.Instance;... | 0 |
2be4a7adbb5d309d4e08620fae3f252b | 4a4cb7103e37302346f79ca68f542388 | liczy ilosc obiektow na liscie | if (root == null) {
return 0;
}
int licznik = 1;
Node<V> tmp = root;
while (tmp.getNext() != null) {
tmp = tmp.getNext();
licznik++;
}
return licznik;
} | 1 |
cdac1448ff1fe12bea4880705748ae84 | 082b78485203ea2ba801ca3acebdddd7 | Aplicado filtro de balance de colores a una imagen | {
Mat salida = Mat::zeros(img.size(), img.type());
Vec3b color;
for (int x = 0; x < img.rows; x++)
for(int y = 0; y < img.cols; y++){
color = img.at<Vec3b>(x,y);
float B = color.val[0];
float G = color.val[1];
float R = color.val[2];
if (B ... | 0 |
25323389c1b1615cdac9923168ce7913 | 0f363968acc7fbe5e68824325e15e8c3 | 上传字符串到OSS | if not _check_ali_oss_conf():
print("没有阿里oss相关配置")
return
if not key:
print("上传文件名不存在")
return
ali_oss = _get_ali_oss()
if ali_oss.put_object(key, text):
url = ALI_OSS_END_POINT.replace("https://", "").replace("http://", "")
return "https://" + ALI_OSS_BUC... | 1 |
66afced06c60ca742f31d6a066e03662 | 4ec433279a7a1b8e7a0d2f34601dd53c | @brief Finalize the link.profile collection to destroy. | void graphd_islink_finish(graphd_handle *g) {
graphd_islink_handle *ih = g->g_islink;
if (ih != NULL) {
graphd_islink_group *group;
graphd_islink_type *tp;
graphd_islink_job *job;
graphd_islink_intersect *ii;
cl_enter(g->g_cl, CL_LEVEL_VERBOSE, "enter");
job = NULL;
while ((job = cm_hnex... | 1 |
f18fd339d22349e487c2032e0aec26aa | f00e88ff03f48d8c575e22f4b0b5d1a9 | Get the total number of results available in the MongoCursor. | class muMongoCursor implements Iterator{
public function count( $all=false){
return $this->oMongoCursor->count( $all);
} | 1 |
ae35689754f4adbb47f0d1a9b4a409fc | 1249d905c847e50d0af0a1a0e74ff3a2 | A word that has been given attributes by an annotator. | class GoldWord(Base):
def __init__(self, word_id, feature_id, value):
self.word_id = word_id
self.feature_id = feature_id
self.value = value | 1 |
3ce63b9af4f4ff4cdbd4f609335a68f6 | 2b741beab82ead3df55a8fd912e190a1 | Set up listner to make sure the correct locale is used. | SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);
String lang = settings.getString("app_language", "");
Locale locale = getBaseContext().getResources().getConfiguration().locale;
Locale myLocale = new Locale(lang);
if (myLocale == locale)
... | 0 |
cd430c36ec6c81189a10d9829d69cbcc | ef6511039dd897f661c35b615c987b4e | 计算三角形垂心
返回:高的交点 | {
Circle tmp;
double a, b, c, c1, c2;
double xA, yA, xB, yB, xC, yC;
a = dist(t.t[0], t.t[1]);
b = dist(t.t[1], t.t[2]);
c = dist(t.t[2], t.t[0]);
tmp.radis = a * b * c / triangleArea(t) / 4;
xA = t.t[0].x, yA = t.t[0].y;
xB = t.t[1].x, yB = t.t[1].y;
xC = t.t[2].x, yC = t.t[2].y... | 0 |
52eb9088d39fc24d2a4e3da3c18460fe | 2dbbf045678743ec10eda8bbd75082b4 | Test case for getParameters_0
. | class BuildTypeApiTest extends \PHPUnit_Framework_TestCase
public function testDeleteAllParameters0()
{
} | 0 |
160d8342cab0dac05a0f054b6c5759df | 8af4c02bde6768adc3e4a7213923e543 | Asks user to enter their name. | def greet_user_get_name():
ret = pyip.inputStr("Welcome to 20 questions, what is your name? ")
return ret | 1 |
c2abc21963b05673ebab2a6e1993be22 | 321e360defc85cd14c98a11b270d20b3 | Gets the current description and adds the new feature onto it | namespace GIS.KML
public abstract class Base<T> where T: Base<T>
public void AddDescription(string text)
{
StringBuilder sb = new StringBuilder(300);
sb.Append(this.description).Append(System.Environment.NewLine).Append(text);
this.description = sb.ToString();
... | 1 |
6f77ea1d12404a11fc409015af6138b1 | 92921ec762674bda16ad0edd5ca3a985 | a², 128 bit input, 256 bit output | void PQCLEAN_MCELIECE348864F_SSE_vec128_sq(vec128 *out, const vec128 *in) {
int i;
vec128 result[GFBITS];
result[0] = in[0] ^ in[6];
result[1] = in[11];
result[2] = in[1] ^ in[7];
result[3] = in[6];
result[4] = in[2] ^ in[11] ^ in[8];
result[5] = in[7];
result[6] = in[3] ^ in[9];
... | 0 |
d25df74b24fefd409d64cd4c6a1dd38e | f612fb7305dc496d2d4a194105002e3e | Checks if resultpeps gets uniques, and also that input peptides
were not unique to start with. | public class QuantDataset implements Serializable, Comparable
public int getUniqePepNum() {
return uniqePepNum;
} | 0 |
b95b454a2dbabe833abe84812b2428fd | 6545892ae252523a7151c5d2cb75bd2d | @brief Read camera ticks from image meta-data
Meta-data reporting must be enabled | {
QCam_Err err;
unsigned long imageWidth;
if (!m_isInitialized) {
return 0;
}
err = QCam_GetInfo(m_camera, qinfImageWidth, &imageWidth);
if (err != qerrSuccess) {
return 0;
}
return imageWidth;
} | 0 |
207957bebbadb7135b4e8484671ee243 | 3cf5019f1b87281297893b665686d1b8 | 获取年、学期 | $entrance_year = date('Y',$entrance_time);
$now_year = date('Y');
$now_month = date('m');
if ($now_month > 8) {
$grade = $now_year - $entrance_year + 1;
}else {
$grade = $now_year - $entrance_year;
}
if ($now_month >= 3 || $now_month <= 9... | 1 |
8378afeee628ac19cdb5e90ba775fe83 | 9574d924fe648e19263d0f09fdaa8ad3 | GET: EXM_ExamHistoryDetail | namespace MVC_SMS.Controllers
public class ExamMarksTablesController : Controller
public ActionResult Index()
{
if (string.IsNullOrEmpty(Convert.ToString(Session["UserName"])))
{
return RedirectToAction("Login", "Home");
}
var examMarksTables =... | 0 |
8ab192e5be6b01b678ccf9611a98e861 | b245d4ea90e05c2c6c2fd45c9ae42872 | Check for duplicates before adding to list | public class RadioCheckBoxActivity extends AppCompatActivity
private void checkList(String text) {
for (int i = 0; i < data.size(); i++) {
if (data.get(i).equals(text)) {
data.remove(i);
return;
}
}
data.add(text);
} | 0 |
87cbad6e67580e472cf43c620766c0b6 | d177bd2b010327f3bd7cb7f4236199cf | Compute information about traversals through graphs. | def getGraphStats(G, verbose=False):
edges = G.number_of_edges()
triads = nx.algorithms.triads.triadic_census(G)
desirable_triads = sum([triads[x] for x in ['021C', '111D', '111U', '030T', '030C', '201', '120D', '120U', '120C', '210', '300']])
triangles = triads["300"]
most_in = sorted(G.in_degree, ... | 0 |
464929444ccbd29ba38e160167a8e837 | 1625ece54e751904c3cca53e3cf9d8c7 | Returns the number of seats booked on the ticket. | class Ride
def booked_seats
self.ride_participants.pending_or_confirmed.sum(:number_of_seats)
end | 1 |
005a4dc194db8ecd89bda24cd9241f0d | 545de3ead6f8a149d90e30f586a82268 | resets move tiles when switching selection between units | {
selectedPiece = null;
if(moveCells != null)
{
foreach(GameObject obj in moveCells)
{
Destroy(obj);
}
}
} | 1 |
c03bb1fda424732184374035eed7e85b | 3be32ea5461350b6a24b10c740802eb1 | 시나리오 명령 취소 | public class SceneCommand : AutoCommand
private void CancelSceneLoad()
{
if (mScenenNotice != null)
{
SceneManager.UnloadScene(mScenenNotice.SceneIndex);
SceneManager.sceneLoaded -= OnSceneLoaded;
FStatics.Reclaim(mScenenNotice);
mScenenNotice = null;
... | 1 |
b6cd0c2c502b4275ad27343d88463032 | f055ae4a542b0946b375d7f3da0fcbf4 | Test case for createContactAttachmentByFileName
. | class SupplierInvoiceApiTest extends \PHPUnit_Framework_TestCase
public function testSupplierInvoiceCreateHeaderAttachmentByinvoiceNumber()
{
} | 0 |
e5a1daedc17cf36cecdf05d46bce5ac2 | d103c412f51a835adfd3edef90978070 | 支付宝同步通知, 成功跳转到订单详情页 | class TradeLogic extends ApiBaseLogic
public function alipayNotify($request) {
return front()->payNotice($request['out_trade_no'], $request['trade_no'], "aliapp");
} | 1 |
9d75c8a3ac36b47ff004f8cb1021216e | 2619fbb670f454e3b01daa55b6ec9b72 | @brief RX Buffer Size
Shows how many bytes are in the RX FIFO ring buffer | uint8 SPI_WiFi_GetRxBufferSize(void)
{
uint8 size;
#if(SPI_WiFi_RX_SOFTWARE_BUF_ENABLED)
SPI_WiFi_DisableRxInt();
if(SPI_WiFi_rxBufferRead == SPI_WiFi_rxBufferWrite)
{
size = 0u;
}
else if(SPI_WiFi_rxBufferRead < SPI_WiFi_rxBufferWrite)
{
... | 1 |
6013b128f4bd3f7fac59905d2107b7c1 | 1b0e26b65a7fa1ddef10e21b8e73d286 | Create an RGB representation of a gray-level image. | def gray_to_rgb(image):
w, h = image.shape
ret = np.empty((w, h, 3), dtype=np.uint8)
ret[:, :, 0] = image
ret[:, :, 1] = image
ret[:, :, 2] = image
return ret
pass | 1 |
743871cbc5ec564306134ef394ec1b42 | 72986f2d14f7285987d732a1dafef514 | int: The depth of the count-min sketch
Note:
Not settable | class DBN(Model):
def k(self):
return self._k | 0 |
02688577fac6f27554fed500a3f5e979 | 28044703ce467e368c0fd292abf0ae23 | Attaches a description to the Network, that will be visible when exporting to a JSON file | namespace Macademy
[Serializable]
public class Network : ISerializable
public void AttachDescription(string _desc) { description = _desc; } | 1 |
40afb6c974fffefabcbe20116a85a3f4 | 426b69179c507732158cd0ec0b636458 | Выполняет запрос на обновление остатков на складах | { global $options;
$dbp = $options['db_prefix'];
$prod_type = array();
$prod_qty = array();
$sql = "SELECT value FROM `${dbp}core_config_data`
WHERE path = 'cataloginventory/item_options/manage_stock'";
$config_manage_stock = DB_Result(DB_Query($sql)) ? 1 : 0;
foreach ($request['products'] as $prod)
{
$p... | 1 |
f596d49d6f7d91fa69b7bf3604418b1f | 2e9ecd9963dc16ee465649b346715119 | Quotes the input, does not insure it has not already been quoted | function enquote(input) {
return '"' + input + '"';
} | 1 |
52262c8b62baa993ca0a9ef0d44138ee | 3ef4fe37020c4b97bb7114a0201171d3 | 预约单--付款 | {
$uid = intval($this->input('uid'));
$schid = trim($this->input('schid'));
if (empty($uid) || empty($schid)) {
msgBack("参数传输有误!");
}
if (empty($this->_user['id'])) {
$this->_user['fromurl'] = url('Guahao', 'step3', array(
'uid' => $uid... | 0 |
4487f115381c6744fb874b01c6bcb5b5 | 4fb3f5e593e84bca9a0422d2cecf25b6 | Create a secure server socket. Opens a key store specified in the
node-java.xml configuration file, using the credentials and alias
specified therein. | public ServerConnector createSecureConnector(Server server, String name, int port, Integer idleTimeout,
String sslKeystore, String sslKeystorePassword, String sslKeyPassword,
String host, String sslKeystoreType, String sslKeyAlias,
String trustStore, String trustStorePassword, St... | 1 |
714a1a2e2c04678b39b38250a678230c | 9c01fff5cd52c6a00b5a80d812534169 | 将scada数据转换成为所需要的json数据 | def jsongeshifanhuishouji(lists):
jsons=[]
for l in lists:
js={}
js['name']=l[0]
js['timestamp']=l[1].strftime('%m-%d %H:%M')
valuestr = fuckpython(l[0],l[2])
js['device_value']=valuestr
jsons.append(js)
jsonstr=json.dumps(jsons)
return (jsonstr) | 1 |
d80dd7da5173182eb0e21204e624f246 | a3ae39d64d319f5e3d0e82b807b62733 | 获取秒杀利润 | {
$attr_data = json_decode($goods->attr, true);
sort($attr_id_list);
$goost_attr_data = null;
foreach ($attr_data as $i => $attr_data_item) {
$_tmp_attr_id_list = [];
foreach ($attr_data_item['attr_list'] as $item) {
$_tmp_attr_id_list[] = intv... | 0 |
d6dd607049e78ecf5b347129c440aeab | c6653088674a3800d98e8774577c19f6 | 检查并填入一个数 | if num in range(1, Sudoku.GRID_NUM + 1) and self.__actived_grid >= (0, 0):
if self.__puzzle_sudoku[self.__actived_grid[0]][self.__actived_grid[1]] == 0:
self.__answer_sudoku[self.__actived_grid[0]][self.__actived_grid[1]] = num
self.__actived_num = num
... | 1 |
65c21c7434c5d1cf15438bd39b093557 | 13d1068247b215507d83eb2f7cb0a415 | This function allocates a new parser.
The only argument is a pointer to a function which works like
malloc.
A pointer to the function used to allocate memory.
A pointer to a parser. This pointer is used in subsequent calls
to SomeLife_Parse and SomeLife_ParseFree. | cesar_interpretatorParserNewSSD (pANTLR3_COMMON_TOKEN_STREAM instream, pANTLR3_RECOGNIZER_SHARED_STATE state)
{
pcesar_interpretatorParser ctx;
ctx = (pcesar_interpretatorParser) ANTLR3_CALLOC(1, sizeof(cesar_interpretatorParser));
if (ctx == NULL)
{
return NULL;
}
ctx->pParser ... | 0 |
fc9fb9a5247a1d629faac8a059416e02 | 7991b30fd49bb1b628695208130f1aae | Saves check points in the specified directory. | void saveCheckPoint(String code); | 0 |
3aba6667d181eba611e212b207895e4d | 594b43e138486b4109ccf2a4f1cf4e99 | Get bbox of contour as `xmin ymin xmax ymax` | return (
self._x1, self._y1,
self._cx1, self._cy1,
self._cx2, self._cy2,
self._x2, self._y2) | 0 |
70033a33b11479e0a33199bc76ebb55b | 0e7b6a485114a64ba7d10831f7227d65 | Deletes a discount usage history entry | {
var discountUsageHistory = GetDiscountUsageHistoryById(discountUsageHistoryId);
if (discountUsageHistory == null)
return;
if (!_context.IsAttached(discountUsageHistory))
_context.DiscountUsageHistory.Attach(discountUsageHistory);
... | 1 |
334d8f61041a1b2afdb3aaca3c230b19 | 71b1ba4d1033fb84492a8c456d34f29c | 匹配域名,深度验证,验证对象中的model值 | function checkModel(obj, model) {
const newParam = {}
for (let val of model) {
if (typeof val === 'string') {
newParam[val] = obj[val]
continue
}
if (obj[val.frontName] == null) {
if (val.default) newParam[val.backName] = val.default
if (va... | 1 |
2cb149865381f7ebfc5a2f0d954cdf4a | 5f6d19bfdaf2c9ce3a79622193fbfd2c | 转换为消息模板实体 | if( dto == null )
return new MdmMsgConfig();
return new MdmMsgConfig() {
Id = dto.Id,
APT_TYPE = dto.APT_TYPE,
APT_REMIND_DATE = dto.APT_REMIND_DATE,
UDF1 = dto.UDF1,
UDF2 = dto.UDF2,
... | 1 |
59ab951baa4090d3903c551e49778639 | 94edf32626012ef386fbf0b4e83dc46e | \brief 构造zXMLParser | class AccessInterTaskParser : public ZSingleton<AccessInterTaskParser>
AccessInterTaskParser()
{
cout << "AccessInterTaskParser init" << endl;
} | 0 |
7bdf94cf7de5e19194af978dc9ed8968 | 903ce8b5c267650d58763f0c003ff7f1 | Age returns the age in years of someone on planet given their age in seconds. | func Age(seconds float64, planet Planet) float64 {
return seconds / planetSecondsInYear[planet]
} | 1 |
ba813f65ebd1599d8acbe92a4134bd97 | 5406e1cd2aeb0de25e97ab63da09312c | Создаем приемный день, если он отсутствует в таблице с днями | @Service
public class DAODayService implements DayService
@Override
public Day createDay() {
return createDay( LocalDate.now());
} | 0 |
ece212b3563aca367359259b2f57fc88 | d26485bd1692fb494f9b5cbd530ad5b7 | Multiplies a list of matrices from the left. | if len(mat_list) <= 1:
prod = mat_list[0]
else:
prod = reduce(np.matmul, mat_list)
return prod | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.