query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
fc052344a751c73d20329e959d8beb06 | c00835082f0153ffddf9a58265dd1381 | Takes the filename of an image already uploaded into the
image directory, generates a thumbnal from it, stores it
in the image directory and returns its name | $image = imagecreatefromstring(file_get_contents($this->base_path . DIRECTORY_SEPARATOR . $filename . $ext));
$width = imagesx($image);
$height = imagesy($image);
$thumb_width = 200;
$thumb_height = 200;
$original_ratio = $width / $height;
$thumb_ratio = $thumb_width / $thumb_height;
if ( $original_rati... | 1 |
3cdb76f1b78db87fdef5c5ea55c6ac7d | e83992b60df4adc5de1a94e95eef3886 | The date and time the poll submission was submitted. | class GetScriptExecutionResult:
def submitted_at(self) -> str:
return pulumi.get(self, "submitted_at") | 1 |
c5de752637349474e3d39b34d1463f6d | 98ce395f20f842fe010e14a9307a733b | test that running task with mark_success param update task state as SUCCESS
without running task. | self.cmd = "../app/test_app par ../test_marker_list/ped >/dev/null 2>&1"
self.file_names = ['ageon.inf']
self.success_expected=0
self.execute() | 0 |
1528b6e73fab51d808a25ffdd5f46d6f | 2d89b874377817014d4aa0b3e9518f9a | 获取排序并修正后的所有Mark拍照点位 | {
List<MarkCmd> markList = this.program.ModuleStructure.GetAllMarkPoints();
if (markList.Count <= 0)
{
return markList;
}
if (!this.program.RuntimeSettings.MarksSort)
{
return markList;
}
... | 1 |
8d4a2d179ca674d470809d9fbc35d2be | be192a23ec53ecb6d6d465e67cae9485 | makes the windows of the building | void display(void)
{
drawBack();
drawBuilding(0.0, 0.0, 300.0, 150.0, Color[DARKGREY]);
drawBuilding(75.0, 0.0, 450.0, 150.0, Color[DARKGREY]);
drawBuilding(275.0, 0.0, 375.0, 200.0, Color[DARKGREY]);
drawBuilding(125.0, 0.0, 500.0, 125.0, Color[DARKGREY]);
drawBuilding(350.0, 0.0, 575.0, 130.0, Color[DARKGREY]);... | 0 |
c3f7ddec3c90847463603487726cd47c | 1af3c6048275c7a667833a1be29b82d3 | Allows Only decimal in stAdQuan -Quantity- text box | {
if (((e.KeyChar < 48 || e.KeyChar > 57) && e.KeyChar != 8 && e.KeyChar != 46) || (blIsCellQty == false))
{
e.Handled = true;
return;
}
if (e.KeyChar == 46)
{
if ((sender as TextBox).Text.IndexOf(e.KeyCh... | 1 |
862900de7b3717be28efe620f73c88e6 | 093c007230f4c0a895826841960992db | 生成阿里云URL | my_domain = 'cvm.api.qcloud.com'
data = {
"Action": 'DescribeInstance',
"Region": 'gz',
"Timestamp": int(time.time()),
"Nonce": random.randint(0, 1024),
"SecretId": SecretId,
}
url_title = '{0}/v2/index.php?'.format(my_domain)
signTxt = generate_signtrue('GE... | 0 |
4fbdfa37fb99db5d4bd69cc4c057f95d | 36d6e20364d9eb04648858d2a4ecd51d | Finalizes SHA-512 hashing. | void sha256_final(struct sha256_ctx *ctx, unsigned char hash[32])
{
uint32_t i;
i = ctx->datalen;
if (ctx->datalen < 56) {
ctx->data[i++] = 0x80;
while (i < 56)
ctx->data[i++] = 0x00;
}
else {
ctx->data[i++] = 0x80;
while (i < 64)
ctx->data[i++] = 0x00;
sha256_transform(ctx, ctx->data);
int k;
... | 0 |
aa5e26bdea11c6011a5b6c4bb23ac357 | c4e55e0ff446f91068d6e6037acf8a6f | Metodo para obtener el numero de veces que se ha respondido la encuesta | public class PlayerHelper implements Serializable{
public int getResponseNumber() {
return responseNumber;
} | 1 |
a4add69e24cdd304a7b3f0b2eae70a20 | a67bbc62d70596804075b23767b23418 | Creates the ftp commands. | dicCmd = {}
for lstSvrs in lstlstSvrs:
for svr in lstSvrs[FIELD_FTPSVR_LIST]:
svr_name = svr[FTPSVR_FIELD_NAME]
ip = svr[FTPSVR_FIELD_IP]
path = os.path.join(strPath, lstSvrs[FIELD_FTPSVR_NAME]+'_'+svr_name+'_'+ip)
XswUtility.MKDir(path)
for log_path in svr[FTPSVR_FIELD_PATH]:
if (bIsFuzzy):
... | 1 |
e9f2e736283ceb0cfea05b91d743bc14 | abb9b9d9fba49b936e23443fd24de311 | ウォレット情報取得 | class Wear
public function getInfoArray($userNo)
{
$userWear = $this->getByUserNo($userNo);
if ($userWear->weapon) $userWear->weapon_info = $this->tab('weapon')->getOne($userNo, $userWear->weapon_idx)->toArray();
if ($userWear->dress) $userWear->dress_info = $this->tab('dress')->getOne($user... | 0 |
b7ff27c27849c7757d11778cfc6c8ca5 | 11e21d61891e766508efb81b5a5011d0 | 生成一个1——1000的数字列表,从中随机抽取200个 | def get_random_list():
list = range(2,8)
random.shuffle(list)
print list[0:2] | 0 |
6b5cbd2a6b5b4674fac957317381f9fd | 448bdb9cb25405a08c0dae28a547be3c | Convert red, green, blue components to a 16-bit 565 RGB value.
Components should be values 0 to 255. | namespace t3d
unsigned short RGB16Bit555(int r, int g, int b)
{
r>>=3; g>>=3; b>>=3;
return(_RGB16BIT555((r),(g),(b)));
} | 0 |
71e1bab8106e8d1fc944aaa7e605667d | c27580cba6f477726e5a3349fa45e82b | Convierte vector a matriz | public class MatrizMath
public static MatrizMath castVec(VectorMath v){
MatrizMath s = new MatrizMath(v.getDim(), 1);
int i;
for(i=0;i<v.getDim();i++){
s.cargarElemento(i, 0, v.leerElemento(i));
}
return s;
} | 1 |
240336338ee6bc82b5e423790fd05b29 | 9d903892385caacc9d42970acb25308a | Metoda ustawiająca kierunek głowy węża, sprawdza czy zmiana jest dozwolona
tj. zmiana ruchu nie może nastąpić o 180 stopni | if (this.direction + newDir != 1 && this.direction + newDir != 5)
this.direction = newDir;
} | 1 |
29f152cfd43737f8577f7f793296ff34 | 303ad91399ea8fe4b78ce4c8a75df8a5 | define the function to solve the initial value problem for the jeans equation using the RK23 method | def Ruth_3(x, dt):
c = [2/3, -2/3, 1]
d = [7/24, 3/4, -1/24]
q = x[0]
Q = x[2]
p = x[1] - d[0] * dt * (Q ** 2 - q ** 2 + q)
P = x[3] - d[0] * dt * Q * (2 * q + 1)
q += c[0] * dt * p
Q += c[0] * dt * P
p += - d[1] * dt * (Q ** 2 - q ** 2 + q)
P += - d[1] * dt * Q * (2 * ... | 0 |
3c5e08dbb4c89f224a95a80ce39cff96 | d33b38386d1a6c1270655fbd99d607e8 | 开始蓄力跳 | function JumpController:HandleJumpStart(_dir, _deg)
self.mHalfTime = MathExt.GetDownTimeByDis(self.mRole.mJump)
self.mHalfDuring = self.mHalfTime
self.mArmature:ActionNow("jumping")
local _during = self.mHalfTime*2/30
local _curX = self.mRole:getPositionX()
local _curY = self.mRole:getPositionY()
local _nextPos ... | 1 |
9ebdb9bfc107d294a6c7ee282626a619 | 1466adbe635116950a90a8bd65f93e94 | Create device-dependent image resources. | void RTAO::CreateDeviceDependentResources(Scene& scene)
{
CreateAuxilaryDeviceResources();
CreateRootSignatures();
CreateRaytracingPipelineStateObject();
CreateConstantBuffers();
BuildShaderTables(scene);
} | 0 |
722aec4ceee4d1f7efb7b6f23c24dcc4 | 630b740a668f7e4369e7e9f924857be5 | Retrieves the title-specific custom data for the user which is readable and writable by the client
https://docs.microsoft.com/rest/api/playfab/server/character-data/getcharacterdata | return Promise.new(function(resolve, reject)
if (not sessionTicket) then reject("Must provide a sessionTicket to call this method") end
IPlayFabHttps.MakePlayFabApiCall("/Client/GetTitleData", request or {}, "X-Authorization", sessionTicket, resolve, reject)
end)
end | 0 |
db4e164807e6dc2e51bdad96fb462665 | aefea0f4e5c41cc2194616f8e394c1f4 | Remove some of the movement in the groundNormal direction by taking the projection of velocity onto ground normal. This is so we don't lose contact too much at higher slope values
Why aren't we using Vector3.ProjectOnPlane() here? | public class PlayerController : MonoBehaviour
protected Vector3 MoveGround(Vector3 wishDir, Vector3 prevVelocity)
{
float speed = prevVelocity.magnitude;
if (speed != 0)
{
float drop = speed * groundFriction * Time.fixedDeltaTime;
prevVelocity *= Mathf.Max(speed - dr... | 0 |
f6b58e57d3ce508eaea9eff2e6f41501 | 7ce41d5a7196e61db46f9ddc68bab450 | Makes a GET call to the LGL API and handles appropriately based
on the HTTP status code | public class AdobeMarketingCloudAPI
public String callGET(String urlname){
String jsonResponse = null;
try {
URL url = new URL(urlname);
URLConnection connection = url.openConnection();
connection.setDoInput(true);
connection.setDoOutput(false);
connection.setUseCaches(false);
connection.setReque... | 0 |
358cc84d88049f21f0a837f8030b9a62 | 2d8ebe216d33e72176cd59d6390a3fce | Input: Full feature set X(n,p) and y(n) with a list of estimators (and their names)
to use for training the first layer of the stacking ensemble.
Return: None, but it does create an inheritable dictionary that contains meta stacked
feature sets: X_stack(n*(k-1)/k, len(e)) and X_holdout(n*1/k, len(e)) for each
of k fol... | def define_stacked_model(members):
for i in range(len(members)):
model = members[i]
for layer in model.layers:
layer.trainable = False
layer.name = 'ensemble_' + str(i + 1) + '_' + layer.name
ensemble_visible = [model.input for model in members]
ensemble_outputs = [mo... | 0 |
242c8c09f9a0b37505d4795b5bfc2a2b | 1a02147a8f45bd47a658449447f0416c | Get the URL to the index page for the model. | class index
protected function get_index_url(array $params = array())
{
$suffix = (isset($params['branch'])) ? '.branch' : '';
return $this->helper->route('phpbb.titania.index' . $suffix, $params);
} | 1 |
86289277ecdc42b3a927c39398da7578 | feb27791edcd7dbb7292c782004830c4 | Shows list of either Niederlassungen, ZSPLn or ZSPn or the vehicle station assignment table. | class tx_seminars_pi2 extends tx_oelib_templatehelper
public function main($unused, array $configuration) {
try {
$this->init($configuration);
switch ($this->piVars['table']) {
case SEMINARS_TABLE_SEMINARS:
$result = $this->createAndOutputListOfEvents(
intval($this->piVars['pid'])
);
br... | 0 |
7791c6a7d2e5d1156cacc0f095397f1f | 89f32939604896c57bec2e9a3c0f4562 | 设置 车辆购买年限 | @Table(name = "biz_car")
public class BizCar implements Serializable
public void setQzbfq(String qzbfq) {
this.qzbfq = qzbfq;
} | 0 |
a7bc9a65ecb43cec1f49356ecf465969 | 72d3f4bca1856b68a50d144c75f3291f | 禁止页面选择文本 | function disableSelect(){
document.onselectstart = function(){
return false;
}
} | 1 |
7a2964a48025ae926aed05f99519c0bb | 83772a65cf19b79263137fce3be03600 | Test to ensure no such tag resolves to false. | event = actions.NfcEvent.DETECT
tag_id = "666"
result = actions.resolve(self.config, event, tag_id)
assert_that(result).is_empty() | 1 |
d26400cfb84868fb7fc3d6ac746e9eac | b2d78ddd640962eb3b8dfa89e0794987 | we don't want var names to overlap with rank or group enums | public class NameChecker private class NameCheckScanner extends ElementScanner8<Void, Void>
@Override
public Void visitVariable(VariableElement e, Void aVoid) {
if (e.getKind() == ElementKind.ENUM_CONSTANT || e.getConstantValue() != null || isConstant(e)) {
checkAllCaps(e);
... | 0 |
3ad909f198764e1335a2e2004796277e | dc2e653839bd148fcd9f2aede7110e34 | 操作页面清空按钮 | class PageClac(Base):
# 点击数字
def page_click_clear(self):
self.base_click(page.clac_clear) | 1 |
91ef8cdbebac06824cb2f4734b98c6af | 725d2dcdba7945a18556352a9fbdfa4d | ページファイル使用率を取得 | Sigar sigar = new Sigar();
FileSystemUsage fileSystemUsage = null;
List<FileSystem> list = Arrays.asList(sigar.getFileSystemList());
double usePercent_total = 0;
for (int i = 0; i < list.size(); i++) {
try {
fileSystemUsage = sigar.getFileSystemUsage(S... | 0 |
7ca2302c619c7c64c68e60b8646af494 | b51b6eee37ef6e9cc35804c8dc0ebfce | Update the current position based on a host message. This is called by
run() when a time:Position is received. | void updatePosition(NMEAInfo _info); | 1 |
650b27965ea51c48b4efc422c133ffe0 | b8d05b72daa88ee7d9212c55c2140dfb | Close a given message socket context, along with the socket itself. Free the
memory allocated by the input queue. | static void rm_queue_msg(struct sess_message *msg, struct sess_context *sess)
{
list_delete(&msg->sess_message_node);
free(msg->msg_buffer);
free(msg);
} | 0 |
70fa236824c7cae9b707298fdab75b07 | c706f376c12744d79848bf0c4e789da2 | Calculates the total binocular decentration of lenses in a frame. Inputs are the A measurement, B measurement and binocular pupil distance in millimeters. | try:
result_in_mm = -(1250000.0 * math.log((20.0 * x) / 116727.0)) / 108221.0
result = round(result_in_mm, 2) / 1000.0
except ValueError:
result = -float("inf")
if result < 0.005:
result = -float("inf")
elif result > 0.045:
result = float("inf")
return result | 0 |
32e9efdac0fa9720bab266f10da2b967 | e3097a2ad90dffb8109731cc3f65a2fc | 获取person表中下一条数列的值 | class DataBaseManager(object):
def getNewIdPeople(self):
self._sendRequest(TablePeopleRequestBuilder().getCountRowTableRequest())
self._connectionObj.commit()
peopleTableCount = self._cursor.fetchone()[0]
return str(peopleTableCount + 1) | 1 |
ae74f38f8657f3cf5bc314694843dc72 | 1e1f9ea1e69d490162adb6cd73d4fc98 | updates all of the hardware input stored in the vehicle object | readAllButtons();
if (Ports.USING_WIN_DRIVER_STATION) {
driverLeftJoyX = driverJoy.getRawAxis(XInput.XINPUT_WIN_LEFT_X_AXIS);
driverLeftJoyY = -driverJoy.getRawAxis(XInput.XINPUT_WIN_LEFT_Y_AXIS);
driverRightJoyX = driverJoy.getRawAxis(XInput.XINPUT_WIN_RIGHT_X_AXIS);
driverRightJoyY = -driverJoy.getRaw... | 1 |
beba6fc6a4739ed9b91ac9e1743a3491 | 236a45391b031738bb60dbf84dbbb2a8 | Initialize an AWS S3 connector for a specific bucket. | self._logger = logging.getLogger(__name__)
self.endpoint_url = endpoint_url
self.session = boto3.Session(aws_access_key_id=os.environ[access_key],
aws_secret_access_key=os.environ[secret_key])
self._s3 = self.session.resource(service_name='s3',
... | 1 |
137260728687e209e788efa898f9b396 | b9bc66a067c6114b9c12037bf9bd619d | Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. | class ObjectAccessControlResponse(dict):
def kind(self) -> str:
return pulumi.get(self, "kind") | 0 |
3e29e7a5e72a6615c0bcc9e8156a3528 | 63b99fcd9eb2481d92ccbbe906c055d5 | Takes in x and y = y(x), and returns k and the Fourier transform
of y(x) -> f(k) along a single (1D) axis
Handles all of the annoyances of fftshift and ifftshift, and gets the
normalization right | def tFT(x, normalize=False):
if normalize:
return np.fft.ifft2(np.fft.ifftshift(x, axes=(0,1)), axes=(0,1)) * np.sqrt(252*308)
else:
return np.fft.ifft2(np.fft.ifftshift(x, axes=(0,1)), axes=(0,1)) | 0 |
8e3931457d29ba46595ad53985881817 | c68c2d2c0a22795f69a4c40f65c5a3c1 | funcion que imprime numeros individuales | void imprimir_int(int n) {
texto_t txt_int = int_a_texto(n);
imprimir_con_nl(txt_int);
liberar_texto(txt_int);
} | 1 |
1b55cd3a60802dca3c20b2be911af796 | e3829312027b679019e7df1b49b7580b | 查询第一个和最后一个记录 | public class GridH2ProxyIndex extends H2IndexCostedBase
@Override public Cursor findFirstOrLast(Session session, boolean first) {
return idx.findFirstOrLast(session, first);
} | 1 |
b625c8f64e5345565f67aa719582d5af | 771eb0620b25df8ac12c7ce0f6124003 | 是否心跳请求 | boolean isHeartbeat(); | 1 |
418f5851ad1c5cddbd5430ad1c3dbd02 | 7c133b059603ce9143a1e376f3149e8f | rend le nombre premier de rang1 nRangDuNombrePremier. Puisque le 1er nombre premier est 2,ie nPremier(1)=2, nPremier(2)=3, nPremier(3)=5... | {
clock_t t1 = clock();
unsigned long long start = pow(10,13);
unsigned long long i;
for(i = start ; i < start+100 ; i++)
{
if(is_premier_iteratif(i))
{
printf("%llu est un nombre premier.\n", i);
}
}
clock_t t2 = clock();
printf("Temps de calcul : %f secondes", (double)(t2-t1) / CLOC... | 0 |
40763ec8e75a580b7b0ddaa202a978e1 | ee80209a54eb01702eefb0e7b1a417e0 | 调整tab头的位置 | var tit_w = parseFloat($("#tab_title").css("width")),
tab_ul = $(".tab_title_ul"),
tab_bl = $(".tab_t_btnl"),
tab_br = $(".tab_t_btnr"),
tul_w = Math.ceil(parseFloat(tab_ul.css("width"))),
tul_pl = Math.ceil(parseFloat(tab_ul.css("left")));
tab_ul.css("width",$(".tab_title_ul li").length*103);
if(t... | 1 |
5bc29da219122662bd1e8473b518a2ca | 4cbc4af5380fe8946f840f78a7d86689 | 由于在构造函数或静态初始化中启动线程并不是好方法,所以提供本方法来启动线程。
这里模拟在使用计算结果前的提前计算,当程序随后需要计算结果时,可以调用 get 方法。 | ThreadTest td = new ThreadTest();
FutureTask<Integer> result = new FutureTask<>(td);
new Thread(result).start();
try {
Integer sum = result.get();
System.out.println(sum);
System.out.println("---------------------------");
}catch (InterruptedE... | 1 |
8f53b3b6a31b6ce46f64c209f8ff83e1 | 89dc3cc0ca3690b2277e5f40ee4faacc | Take data from the write queue and send it over our data channel | static void WriteData_Thread(void const *argument) {
(void) argument;
osEvent evt;
T_SensorsData *rptr;
int size;
char data_s[256];
for (;;) {
evt = osMessageGet(dataQueue_id, osWaitForever);
if (evt.status == osEventMessage) {
if (evt.value.v == 0x00000007)
{
if (SD_Log_Enabled) {
blink... | 1 |
b62afa40c2c96e4c3d97ae00589939da | 5c2df58f7926eb2a99a5aa238f1adc1f | Pega o nome do arquivo sem a extensão. | export class Arquivo
public get nomeSemTimestamp(): String {
return this._nomeSemTimestamp;
} | 0 |
00a2fb758ae7b3657a48a5deb179c7dd | c7a892c4ba6abab512a837e490fefa4a | Perform any cleanups necessary. Called on program termination. | void cleanup(void) {
mexPrintf("MEX-file is terminating, destroying MEX arrays\n");
mxDestroyArray(ClogC_mxArray);
} | 1 |
a44fe921355d6a8a200ff166d67a212e | 03512ef329bca69752ddb8d4f6502dd7 | attempt to login using the saved session in localStorage | const query = qs.parse(document.location.search.slice(1));
let token = window.localStorage.getItem("SP_AUTH_TOKEN");
if (query.token) {
token = query.token;
delete query.token;
const queryString = qs.stringify(query);
let newUrl = window.location.origin + window.location.pathname;
... | 1 |
51e7f48ae9e87e5b2322472d10416a16 | db06dcfec5fabb5896290fa9a50cd670 | This method gets all of the logged faults/events from the embedded target's current event log. | public class TeaServletEngineImpl implements TeaServletEngine
public LogEvent[] getLogEvents() {
if (mLogEvents == null) {
return new LogEvent[0];
}
else {
LogEvent[] events = new LogEvent[mLogEvents.size()];
return (LogEvent[])mLogEvents.toArray(events);
... | 1 |
c8dd939342353cab85de89048aa40c8e | fb615f313e79e3db72c5b6a94bf81efd | true if no transformation is explicitly specified | public class BursaWolfParameters extends FormattableObject implements Cloneable, Serializable
public boolean isTranslation() {
return rX == 0 && rY == 0 && rZ == 0 && dS == 0;
} | 1 |
1bbc2b9d0e76160e1a33c3be60ec7afb | d187bb057e1a6461a323e15fc3899eaa | Only execute the movement when any key is pressed | public class PlayerControl : MonoBehaviour
void FixedUpdate ()
{
if (Input.GetKey("space") == true )
{
move = Vector3.zero;
}
else
{
Movement();
}
FlipSprite();
Animate();
} | 0 |
ce95766b769460398ba748c9b5ae863a | e55e8f38ca0dbbef2f4675ab29c4e2ea | Récupération du header d'une trame | NetHeader header = new NetHeader();
header.mType = input[2];
header.id = Bytes.bytes2long(input, 3);
header.length = Bytes.bytes2short(input, LENGTH_POSITION);
return header;
} | 1 |
3a529958deacd00b11d64c7c6a90e63e | bd127c3e5a2f2e7b15c81a31309046a6 | Probabilities of picking pairs in low-dim space (using Gaussian). | p2_p1 = (
1 + 2 * self.gamma *
(self.M_1 * self.M_1 - 1) / (self.gamma + 1)
)
return p2_p1 | 0 |
06ef35ce79411d0f22c856a86166cad5 | a69bdb607baa96e3cd17f11cdd1118f3 | Returns the position of the seventh point in the path, which is the tip. | ofVec3f Curve3d::getControlPt7() const {
return controlPt7;
} | 1 |
1cacac38e02fcaf207f76e729e4a9d1e | 13a84babfb911ea097f057b364ea50aa | 生成单行文本框的html | {
string required = dr["required"].ToString() != "" ? "required=\"" + dr["required"].ToString() + "\"" : "";
return "<div class='" + dr["class"].ToString()
+ "'> <input id='" + dr["id"].ToString() + "' style='width:" + dr["width"].ToString() + "px;height:" ... | 1 |
fe851f29d8eeb88f93abae662e60a75c | 4872f330c5c998019cd4a728a6d4eb19 | 根据合同编号从业务系统查询授信额度信息 | CashProductsVO cashProductsVO = null;
String personId = paramMap.get("personId");
String creditId = paramMap.get("creditId");
CsCredit csCredit = creditService.getCreditByPrimary(Long.valueOf(creditId));
JSONObject jsonObject = new JSONObject();
jsonObject.put("contractNo",csCredit.getContractNo());
jsonO... | 1 |
63ad86783b728a93796ed724ea0e9987 | e174a4c641179699b9e8540f0f96ed60 | Load the cows which are in milk which calved in a given month,
calculate 10 day weight delta for each cow and average for the group | cm = CowManager(prefs)
cm.loadCows()
cm.heatMap(True)
distanceTraveled = cm.getDistanceTraveledPerDay()
cm.genCSV(distanceTraveled, ["Vaca", "Distancia", "Dia"]) | 0 |
640b9bf25a50a23ad6d5fb144fa64f55 | deb2ee1f5b26dcd4edddc6561c1d10bd | Create an instance of {@link UnRegisterResponse } | @XmlRegistry
public class ObjectFactory
public ModifyPartyRegistrationResponse createModifyPartyRegistrationResponse() {
return new ModifyPartyRegistrationResponse();
} | 0 |
3eea0539b4066568c73831466d8dd3e6 | 100f3db178f2d33b142ce51b4b11e29e | Getter for the peptidesRefList | java.util.List<java.lang.String> getMimBioRefList(); | 0 |
9639978b6b4719826c2aebe6cd274552 | f43f526cd26b67ad70d98ac4bad37102 | 指定エネミーを成長させる | for(int i_enemy = 0; i_enemy < ALL_ENEMIES;i_enemy++){
ENEMY_SIZE = ENEMY_SIZE - 1;
enemies[i_enemy].setRadius(ENEMY_SIZE);
if (ENEMY_SIZE <= 4){
ENEMY_SIZE = 4;
}
}
} | 0 |
d2d857d478415f5f776c247dd6b8a3f8 | 4cb60a5a7674ad2d07b15dc0aab2d9bc | Aggiunge una classificazione al record | class ObraDAO extends Database
public function inserirClassificacao($classificacao){
$query = "INSERT INTO classificacao(idClassificacao, nome) VALUES (null, '".$classificacao->getNome()."')";
try{
$this->PDO->query($query);
}catch(PDOException $e){
}
} | 1 |
0f85328a068128fcab6d27943a3d8709 | 8a9731f7ec4a87eda82a8f23a226f262 | Creates a new matcher given the expected input as a dictionary. | is_map = isinstance(supplied, dict) and all(
isinstance(k, six.string_types) and isinstance(v, value_type)
for k,v in supplied.items()
)
if is_map:
self.cases = {compile_pattern(k): v for k,v in supplied.items()}
self.default = default
else:
self.cases = {}
... | 1 |
3a82249f1af0d57aedd61135d53ce56d | 141bc7159d716349d258f72e6dd74e95 | Constructor: opens connection to PLI controller.
usage for TCP socket: PLI(('192.168.88.1', 26000))
usage for serial: PLI('/dev/ttyS0') | self.conf = conf
self.params = {}
self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self.sock.connect((conf['device_address'], conf['slport'])) | 1 |
742477646aaa34dce2e5fa6911f24008 | e9ca285bf37e2937875d8512b3d4fe1f | 获取触发元素及其选择器 | function getAccordionElements(accordion, element) {
var elements = {},
$element, $trigger, $target;
if (element instanceof jQuery) {
$element = element;
} else {
$element = $(element);
}
if ($element.hasClass(accordion.options.trigger_class_name)) {
$trigger = $element;
$target = $('#' + $ele... | 1 |
853ade9b2848df1d562726013be525b0 | c27c236f7433fbfedca88b425bd47f16 | Handles changing the selected currency type | {
Variables.activeButton = ChangeCurrency1.Name;
if (Frame.CanGoForward)
Frame.GoForward();
else
Frame.Navigate(typeof(SelectCurrency), Variables.currencyCollection);
} | 1 |
877a13a6d846697e3d674a88cb686ce8 | 97d15fed981641bc725b478057afa693 | Задаём рёбрам случайный вес. | class Graph:
def set_weight_random(self):
a = {e: random.random() for e in self.graph.edges_iter()}
nx.set_edge_attributes(self.graph, 'weight', a) | 1 |
158afecc263e3c2897ea37e259d2e2c8 | eaa2493d7706ddf00089d35e35ed59e4 | Selecciona todos los ficheros que se est�n mostrando en la actualidad. | namespace renameFiles
public sealed partial class MainPage : Page
private void BorrarFiles()
{
Debug.WriteLine("Procediendo a borrar " + listArchivos.SelectedItems.Count + " elementos");
while (listArchivos.SelectedItems.Count > 0)
{
Debug.WriteLine("Archi... | 0 |
941909b360dbe8e95a40c00160c68f1f | 13bca97f4dc4ebf25f2670721b7cd6a8 | 将对象添加到缓存中,该对象与指定的文件关联,如果指定的文件被修改,缓存将失效
或者缓存到达指定的时间后亦将失效 | namespace Weikeren.Utility.Cache
void AddFileDepend(string objId, object o, int second, string[] files); | 1 |
df84a2707c58c895bb1a0b7c4f802fb5 | c590af4cfe9b8156673cd8e6cbfc3f9c | Get a maintenance item by id that doesn't exist | class TestItemDetails:
def test_get_item_details_invalid_id(self, mock_requests_get_404):
with pytest.raises(exceptions.NoSuchItemException):
resources.get_item_details(1) | 1 |
d6c2c955cc08b94699fbae3063431e71 | 487fda6e20c73a7c5abd89e266845a50 | Mark category as readonly or not | set readonly(value: boolean) {
this._readonly = convertToBoolean(value);
} | 1 |
93eba048e461f902bcfedc451e6ea19b | 93533ee078bb3d5e9287757f8947f7cd | Изменяем текущий медицинский центр | namespace HCS
public partial class PolyclinicScreen : Form
private void btnCreate_Click(object sender, EventArgs e)
{
string oldName = poly.name;
poly.name = cbxPolyclinics.Text;
poly.description = txtDesc.Text;
poly.status = chkStatus.Checked;
Da... | 1 |
1d1d632a01a0bc3de6114d122fc757a4 | f4b31d26af608979cf91867f3a9c0195 | Test la validité d'un champ | if(values[field_name] === '') {
return false;
}
min_borne = $('#min_' + field_name).val();
if(min_borne === ''){
result = true;
} else {
result = values[field_name] >= min_borne;
}
if(result) {
max_borne = $('#max_' + field_name).val();
if(max_borne !=... | 1 |
54c1941c200b00c429edeeae71be357e | e37e44e926467ba65a7038df532802e0 | test vector from RFC 7748, section 6.1 | BOOST_AUTO_TEST_CASE(hmac_sha256_testvectors) {
TestHMACSHA256("0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b",
"4869205468657265",
"b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7");
TestHMACSHA256("4a656665",
"7768617420646f2079612077616e742... | 0 |
4f407e190b6413c92bbf2b1d5983e12b | 44f1b34c6689787053440c75f2f5c8fe | ツアー名を取得する為のメソッド | public class TourDetailAction extends ActionSupport implements SessionAware
public String getTour_name() {
return tour_name;
} | 1 |
70cc122f877cb10a8bb21db64f3ec838 | 052252277c35faf10d64069ea7ada25b | Gets value from SerializedProperty <paramref name="_property"/> - even if value is nested. Return-Type is object, cast if needed | public static class SerializedPropertyExtensions
public static object GetValue(this SerializedProperty property)
{
string propertyPath = property.propertyPath;
object value = property.serializedObject.targetObject;
int i = 0;
while (NextPathComponent(propertyPath, ref i, out var toke... | 1 |
827e52b907342e265fd82d8271554c47 | 974daf1a0d4b45b4b794d5d0d018820c | 通过name得到MongoDatabase | public class MongoDbUtils
public static MongoDatabase getDbByName(String host,int port,String dbName){
log.debug("=============================MongoDBINFO==========================");
log.debug("host:"+host);
log.debug("port:"+port);
log.debug("dbName:"+dbName);
MongoClient mongoClient;
MongoDatabase db;
... | 1 |
6bce373e0a7c0a0fa38149850f41ce63 | 15526cf52291270d50b483557d5be4c3 | Genero numeri pseudo-randomici per scegliere una frase di risposta casuale | srand(time(NULL));
int randomNumber = rand() % 101;
return randomNumber;
} | 1 |
1d1eabd6b5c75bfd9c99b114bbe1401e | 7919f8d13b94628aa18799c2c78fd136 | 获取结算方式名称 | {
return array(
0 => '未结算',
1 => '已结算',
);
} | 0 |
c5b88c24874289952f32e53a3ac314ae | 520430ec113b1416f86de762344e3ca6 | 修改优秀作品 | class BakeController extends UserbaseController
public function worksedit(){
if(IS_POST){
$data=$_POST;
$temp_status = $_POST['status'];
unset($data['status']);
$data['image'] = $data['all_pic'][0];
$arr = array();
foreach($data['all_pic'] ... | 1 |
69f4d5629cc6f4a2567487789647bc21 | 69cb31e798b4facac75d019e19b57c82 | Fetch raster height in pixels. | export default class Raster extends ObjectManager
async getHeight(): Promise<number> {
let methodName = "getHeight"
return await this.invoke(methodName, this.NUMBER);
} | 1 |
41131a397d0b6b6e26da3cbf2ee447ad | 1cde2f1bdfe2a1d2b838bb28fafac068 | GET: AttributeValue | class AttributeValueController extends Controller
public function index()
{
$values = ProductAttributeValue::orderBy('id', 'asc')->paginate(15);
return view('admin.product.attributes.attribute.value.index')->with('values', $values);
} | 1 |
37dcd998b5718c7b7c5ecc74eecd7b25 | 4d7a81e08ff15082e492d59b1a91d0b7 | Set the attendee in the output event from the corresponding component in
this calendar event. | class BaseWorkTests(CommonCommonTests, unittest.TestCase):
def setAttendeeEvent(self, attendee, ical, run_jobs=True):
calobj = yield self.getAttendeeResource(attendee)
yield calobj.setComponent(ical)
yield self.commit()
if run_jobs:
yield self._runAllJobs() | 1 |
75f90f4365fde08cc5b5096cce5b2c8e | 81b2b4b1f9427ddade07d965f7c1c0f6 | PointCloudの情報をClusterに格納 | {
ClusterInfo->Size = sxr_Cluster[ClusterIdx].Size;
ClusterInfo->NbCluster = sxr_Cluster[ClusterIdx].NbCluster;
ClusterInfo->NbAllocation = sxr_Cluster[ClusterIdx].NbAllocation;
} | 0 |
697a873dde5070e8d6109344b618c925 | 593c0f5a0572a601aed9ad7cd1c4a8d9 | Returns:
a string, the local path of module | class Module extends Page
public function mod_path() { return $this->local_file_path; } | 1 |
f9d18f5141e161b8e87befaf618e6aa4 | 5cf1a94bf3c414f26d085b1c3c39acfc | POST /book_lists
POST /book_lists.xml | @book = Book.new(book_params)
if @book.save
render json: @book, status: :created, location: api_v1_book_url(@book)
else
render json: @book.errors, status: :unprocessable_entity
end
end | 0 |
f28f4033fd4e42d5bd4e0b8a6351e18f | 12bdca8e9d413a88bdd4e127f46882e8 | Tests AverageValue if only NaN Values | public void SelectAverageValue()
{
const decimal averageValue = 28.8663M;
var query = new SqlLam<Product>()
.SelectAverage(p => p.UnitPrice);
var results = Connection.Query<decimal>(query.QueryString, query.QueryParameters).Single();
Assert... | 0 |
be4bbdeac8917e7f84ac65cb41b304d5 | 16f43720dae711aa723b42eea631ce9e | Wrapper for IO.InquireVariable | static void
c_ncvinq (
int ncid,
int varid,
char* varname,
nc_type* datatype,
int* indims,
int* dimarray,
int* inatts,
int* rcode
)
{
*rcode = ncvarinq(ncid, varid, varname, datatype, indims,
dimarray, inatts) == -1
? ncerr
: 0;
} | 1 |
e8488294d71f5dcc4a8b57d40dce60e5 | 7f61448ad6da3ef0f9cb03f40c5be655 | sor | cases like (1) | 0 |
ff552436cef0b5daa2f6c02abd3a8d01 | 4b9e41337f1e5f14b595d8d0d5d5351b | Resolve a hostname and port.
Synchronous version, without -4/-6 preferences. | mock_sync_resolver(const char *m, const char *host, char *portname,
unsigned short *pport, struct sockaddr *sa, size_t sa_len,
socklen_t *sa_rlen, char **errmsg, int max, int *nr)
{
char *mdup = NewString(m);
char *outer_saveptr = NULL, *inner_saveptr = NULL;
char *outer_chunk, *inner_chunk;
char *out... | 1 |
4cd4debc2c7a683dfe6528df603f81d4 | eeeaf318f946132af7a63de69bd38c64 | 向对端发送 Chunked 数据分片 | let totalSize = file.size;
let chunkQuantity = Math.ceil(totalSize / chunkSize);
before(totalSize, chunkQuantity)
for (let i = 0; i < chunkQuantity; i++) {
let start = 0;
let end = 0;
if (i == chunkQuantity - 1) {
start = i * chunkSize;
end = totalSize;
... | 1 |
65d250dc614d0cef381fefdf0a9a80a2 | 05b3280a0abba692e525dd9e41285f75 | 判断两次单击是否相同图片,不相同:恢复默认图片 相同:完成数量加1,记录图片状态 | if (this.state.maxNum == 1) {
this.state.selectedPics = []
if (checked) {
this.onSelect(item);
} else {
this.onDelete(item);
}
} else {
if (checked) {
this.onSelect(item);
} else {
... | 0 |
cf53d438d160d0e24a9f416058bb2d7e | 0f7f9a9b5d5068ad6e5d2c5129f14d81 | 服务端测试 | func TestH(t *testing.T) {
server.GRPCServerInit("")
Getone("1")
} | 1 |
dc54d19848313e6150b27197f02a24bd | 141b6f90cfa88c6f0175aaa85e8423f1 | Metodo que se encarga de agregar las bodegas al sistema | class BodegaManager
function addBodega($BODEID, $BODENOMB, $BODERESP)
{
if ($this->gateway->existBodega($BODEID) == 0) {
$BODEID = $this->gateway->maxId();
$result = $this->gateway->addBodega($BODEID, $BODENOMB, $BODERESP);
if ($result) {
$this->UnsetReque... | 1 |
56bd5fcae048bb6cac5e23be512cebb4 | dbaaefc0dde68d168391d4bf3469c80c | 根据特产id查询特产存量 | @Service
@Transactional
public class ProdService
public Integer findProStockByProId(Integer id){
return prodDao.findProStockByProId(id);
} | 1 |
8302b0f1c494ce357579866adce692b1 | 031e8702b3999f20d175379a12f3aa91 | Academic Registration button click from student home | {
var db = new igraduateEntities();
Advisors advisor = GetAdvisor();
int sem_register = Int32.Parse(ConfigurationManager.AppSettings["sem_register"]);
db.RegistrationPermissions.RemoveRange(db.RegistrationPermissions.Where(x => x.StudentID == id && x.AcademicSession == sem_register));
RegistrationPerm... | 1 |
dde7babb454eaabe8d34746b46eaa49c | b3a65c0f37c3143b1d861c11a5198128 | This part describes the behaviour when using the current camera rotation to compute the angles
for the rotation of the next camera.
This is not used right now because of reason explained at the beginning of this script. | [RequireComponent(typeof(Player_Body))]
[RequireComponent(typeof(Damage_Handler))]
[RequireComponent(typeof(Animator))]
public class Player_Brain : GenericFunctions, IUpdateable
void FollowCameraRotation()
{
if (_followCameraTimer.Counting) return;
_followCameraTimer.Play();
} | 0 |
2228a82fa25af255863171bffdf09672 | bb12764e6c752a42009f2ded3cde8dcb | Play one round of tournament. | def play_cup_round(teams):
play_games(teams, 1) | 1 |
de118512c9184aa7a8a5fdc1fd4ab2e5 | b24c5386cfb1bf881155ad8241f82eaa | Compute the cosine similarity between documents d1 and d2.
Input: two dictionaries representing the TF-IDF vectors for documents d1 and d2.
Output: the cosine similarity. | len_1 = lin.norm(d_1)
len_2 = lin.norm(d_2)
if len_1 == 0 or len_2 == 0:
return -1
return np.dot(d_1, d_2) / (len_1 * len_2) | 1 |
59e8b7b6137c2458fb81f04057293de5 | c5a0b7e9f6761bf23b79e98eaa9951a3 | 将TiledMap坐标转换为屏幕的坐标 | function MapService:GetTiledPosition(x, y)
return self._logic:GetTiledPosition(x, y)
end | 0 |
e23b58f3905624a4af9258d840ab5a73 | 34b6385fb9392777d6d4a51e9d23a642 | AdMobのイベントを受けとり処理を行います. | if event == "interstitialDidShow" then
m_ad_has_shown = true
elseif event == "interstitialDidDismiss" then
end
end | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.