query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
040dce29707482f09ad191127b67c2da | 6b519d6877485314d5d5dce09929ff6f | 建立矩形的類別 | this.x = x || 0;
this.y = y || 0;
this.width = width || 20;
this.height = height || 20;
this.color = color || "blue";
} | 1 |
a881751fdae8bdf058ff20b6a87004e7 | 8bb1287285bf0fc4261e8db00511ddf1 | ライセンス一覧を取得する。
GET /api/licenses を呼ぶ。 | class LicenseApi
def get_licenses(opts = {})
data, _status_code, _headers = get_licenses_with_http_info(opts)
data
end | 1 |
f7db84eb3510c7e7c5041cd152da0660 | 9cc6edd46eb1391e434f6956a2b06dea | Enables URL signing for Google APIs that require it.
Currently only Maps Statics API requires signing for some users.
More info [here](https://developers.google.com/maps/documentation/maps-static/get-api-key#generating-digital-signatures) | if not self._gs_url_signer:
settings = config.settings()
self._gs_url_signer = gcs.URLSigner(
settings.gs_bucket,
settings.gs_client_id_email,
settings.gs_private_key)
return self._gs_url_signer | 1 |
194d0bba2aab0aadef4d98f224dd66bd | 7f61448ad6da3ef0f9cb03f40c5be655 | Shared example for constructor parameter check | cases like (1) | 0 |
c1adf56744d5a45af9b3f34d1598543c | 0c8afca52eb29dd8579148ece5081683 | 红外抓图回调 | JNICALL
Java_com_yado_camera_InfraredNative_getRawBitmap(JNIEnv *env, jobject instance,
jstring path_, jobject bitmap,
jfloatArray tem_, jint colormode) {
const char *path = (*env)->GetStringUTFChars(en... | 1 |
76cfb77340ce93f2176b8c07c6f80e91 | fee0bb97881ea76396887b736507d8bd | Returns if this Rigidbody has the given Constraint. | namespace BepuPhysics.CollisionDetection
public unsafe abstract class NarrowPhase
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static bool IsContactConstraintType(int constraintTypeId)
{
Debug.Assert(constraintTypeId >= 0);
return constraintTypeId < PairCache.Col... | 0 |
ae6f84c9f8fea3cb4d2511bc7f618090 | 29bddcb2067d6216f157f635fbbdc01a | 删除系统用户页面 | {
var request = GetParams<List<string>>();
if (request != null && request.Count > 0)
{
foreach (string str in request)
{
Users entity = new Users()
{
SysNo = int.Parse(str),
... | 1 |
78876320ab9737b560f62ee2c745f0b0 | 2664036c6957825c7c14ea03ec2dcede | Runs the test on a given `algorithm` with a ordered dataset | FormatPrinter.printTestStartMessage(algorithmChoice, MenuController.MENU_OPTIONS[algorithmChoice-1]);
int[] unSortedArray = RandomArrayBuilder.generateRandomArray(arrayLength);
int[] sortedArray = RandomArrayBuilder.cloneArray(unSortedArray);
Sorter arraySorter = SorterFactory.getSorter(... | 1 |
c5bc5e0667a470b15be06dcfdab7d9e0 | ff6ee4edf75223f3af6b79d2c39fdd81 | 国家局数据库查询 | public String doQueryNation1(){
HttpServletRequest request = ServletActionContext.getRequest();
String page = request.getParameter("page");
String limit = request.getParameter("limit");
int pageIndex = ParamsUtils.toInteger(page, 1);
int pageSize = ParamsUtils.toInteger(limit, 20);
DBHelper dbHelper = DB... | 1 |
631b351146df38c3f9089a36c50606e2 | 730bde156d5aa3e62fc2ba5640595c94 | 公司发展相似产品接口 | class Weidengru_index_page_handle(object):
def xin_ke_tui_jian_product_zhanshi_handle(self):
return self.weidr.xin_ke_tui_jian_product_zhanshi() | 0 |
9f26bfce2425088d72a99835574cce9b | 2d8ee7935beba0ffc60cb68fcc59bb4e | get the content of stdout/stderr with the option to set a timeout for reading | parse_return = None
self.transport = self.client.get_transport()
self.channel = self.transport.open_channel(kind='session')
self.channel.settimeout(timeout)
try:
self.channel.exec_command(command)
self.channel.shutdown(1)
fd, fp = tempfile.mkst... | 1 |
661d4fcf76c2e2ff129786afd0232ca4 | 016eb3c24738a6b60b4149dc2b63d4a1 | 根据服务ID查询服务器信息 | $sql = "SELECT * FROM miao_serverinfo WHERE sid={$sid}";
return $this->db->getRow($sql);
} | 1 |
f759d1debd3a1140f75497e731d39933 | 2ebac92d52f71472243ba65fe561eea9 | Test case for watch_namespaced_replica_set
watch changes to an object of kind ReplicaSet | class TestApisExtensionsV1beta1(unittest.TestCase):
def test_watch_namespaced_watch_daemonset(self):
pass | 0 |
3b98826eb2230910e73c1a90daf59abc | 2550761bc4ac1f61bfc7ddd5325a96e2 | Test to get a non existing project. | class TestDB(unittest.TestCase):
def test_getProject_missing(self):
yield self.assertFailure(self.db.getProject(42), Exception) | 1 |
08b7b603a04b8d40029281f6af777802 | b013d946621f45e8d8ecec4eb6dfb52d | Clears an attribute from the entity. | namespace AdvancedPlugin.Utils
public static class EntityHelper
public static void RemoveAttr(this Entity entity, string key)
{
if (entity.Attributes.ContainsKey(key))
{
entity.Attributes.Remove(key);
}
} | 1 |
f279f1608509b254f312c3243178aea9 | 67f1d63e9cbaf53583d2c7799488d03f | VK don't understand specialchars-quotes. Change them to the yolochki | $s=str_replace(".h",",",$s);
$s=str_replace("yh","Ы",$s);
$s=str_replace("yu","Ю",$s);
$s=str_replace("ya","Я",$s);
$s=str_replace("yo","Ё",$s);
$s=str_replace("shh","Щ",$s);
$s=str_replace("eh","Э",$s);
$s=str_replace("sh","Ш",$s);
$s=str_replace("ch","Ч",$s);
$s=str_replace("qh... | 0 |
3833154746d142b8cb97fdb58d86e5b0 | cc67b369a106e1feb1f57c7dc8256b58 | Builds models for batch inputs and returns functions to update weights. | def make_nn_funs(layer_sizes, L2_reg, noise_variance, nonlinearity=np.tanh):
shapes = list(zip(layer_sizes[:-1], layer_sizes[1:]))
num_weights = sum((m + 1) * n for m, n in shapes)
def unpack_layers(weights):
num_weight_sets = len(weights)
for m, n in shapes:
yield weights[:, :m ... | 0 |
c2e6c15a1030eb06ef7bf3589ccbeaf2 | 2bf443fb8eec7b38ac9aba55c10efd83 | 查找某人参与的活动,返回id数组 | $act_id = array();
$activity = Activity::find()
->select(['act_id','act_partici'])
->asArray()
->all();
$classArray = UserMangerModel::getClassById($id);
$departArray = UserMangerModel::getDepartById($id);
$class = $classArray['usr_class'];
$depart = $departArray['usr_depart'];
foreach (... | 1 |
fef29835fc2425d5259a4fb1defe2bdd | 0da516c1906361a557258016d74b7d20 | Creates search expression in IMAP4 language. | std::string result;
if (0 != (attr & MailStore::IMAP_MBOX_NOSELECT)) {
result = "(\\Noselect ";
}
else {
if (0 != (attr & MailStore::IMAP_MBOX_MARKED)) {
result += "(\\Marked ";
}
else {
if (0 != (attr & MailStore::IMAP_MBOX_UNMARKED)) {
result += "(\\UnMarked ";
}
else {
res... | 1 |
9dee18ad177224c4db8d05cb3a37cc35 | fdd4ee9c849aac8a49d1bde5d2ed287a | Escribe los puntos del laser en un fichero de texto como jSON. | global h,x,j,i,y,i2,x2,contgasonvl3,contgasonvl33,contpuntosnvl3,contpuntosnvl33,can3,archivo
archivo = open("partida3.txt", "w")
posix1=can3.coords(x)[0]
posix11=can3.coords(x)[1]
posix2=can3.coords(x2)[0]
posix22=can3.coords(x2)[1]
if(contgasonvl3>0 and contgasonvl33>0):
arch... | 0 |
feb731da3505d13f23f4b01c88d1dd54 | 45d9ba15992a0bdc58ce3991e410d972 | 随从隐藏 | function bowwow:hero_gone()
game.bowwow_following = false
end | 0 |
b3d4874dcba7ac9a11f9960996d05923 | c196639ec5acdb165fc50023577b3a61 | create a canvas 400px by 400px | function setup() {
createCanvas(400,400);
} | 1 |
6cc40e2572d5ac7fdb93df0f51146411 | bec2ba88e532d89ea30d92ed59902dfe | Presents a dialog window and returns that path that was chosen, or null if cancelled. | title: string,
filterName?: 'json' | 'openapi',
saveWorkingDir = true
): Observable<string | null> {
const options: OpenDialogOptions = { title };
if (filterName) {
options.filters = this.filters[filterName];
}
return from(MainAPI.invoke('APP_SHOW_OPEN_DIALOG', options)).pipe(
... | 1 |
8c007a9f765474a68d921566c0284a82 | 344f0ef208d0af7ab2633bab63e86c70 | Deletes the specified EducationSchool reference. | {
School school = await this.DataContext.Schools.FirstOrDefaultAsync(s => s.Id == schoolId);
if (school != null)
{
this.DataContext.Schools.Remove(school);
await this.DataContext.SaveChangesAsync();
}
} | 1 |
909ba750370c17bb850496bb00c4d996 | 8c9634b3424863995e833350607ccfe2 | 查询指定集群的标签
查询指定集群的标签信息。 | const options = {
method: "GET",
url: "/v1.0/{project_id}/clusters/{cluster_id}/tags",
contentType: "application/json",
queryParams: {},
pathParams: {},
headers: {}
};
const localVarHeader... | 1 |
511b7535882c67b3444900119560ed87 | 4a93032ad0d4d7456be01706b7c48ce8 | Создаёт фейковое касание из положения мышки. | if($_drag_n_drop_settings.started == false) return;
_fakeElement = realElem.cloneNode(true);
_fakeElement.style.zIndex = "999";
_fakeElement.style.position = "fixed";
_fakeElement.style.opacity = "0.6";
realElem.appendChild(_fakeElement);
var elemPos = getAbsolutePos(realElem);
_elemPosition.x = elemPos... | 0 |
71037ef976a2994cf81d82a6ad470c23 | ac57cf8b751a1979c8cddb072da79d43 | Tests division with another instance of
SimpleFraction. | inst1 = circle.Circle(42)
inst1 /= 2
assert repr(inst1) == "Circle(21.00)" | 0 |
950dbb3e74c93cd28a377876ad8e93af | 2afe5b6a70afdecd58d24ba641414c77 | y += A'*x
x and y MUST be on GPU already | void dmat_yAx(const dmatrix *A, const double *x, double *y)
{
int k, l;
int m, n, nz;
int *jdx, *rdx;
double *val;
double tmp;
#if PROFILING
PROFILE_START
#endif
m = A->m;
n = A->n;
nz = A->nz;
val = A->val;
jdx = A->jdx;
rdx = A->rdx;
if (nz >= 0)
{
... | 0 |
245d09492d2253272da3313901704496 | cea7791f1988736a8c84ad76da57ea6a | 移除指定索引位置的子项 | namespace Mozlite.Mvc.Templates
public abstract class Syntax : IEnumerable<Syntax>
public virtual void Remove(int index)
{
_children.RemoveAt(index);
} | 1 |
24c7afc4cefa4a5b847589d8e3bd9e92 | 7fab9e7d5d26339e14d22221c0b7771a | Returns: list of bricks | def load_level(level, display):
bricks = []
brick_colors = ['Red', 'Yellow', 'Blue', 'Pink', 'Green']
path = 'levels/Level{0:03d}.bin'.format(level)
level_size = stat(path)[6]
level = bytearray(level_size)
with open(path, 'rb') as f:
f.readinto(level)
for i in range(0, level_size, 3)... | 1 |
c216de174a6a151de6f2e94947b018fc | c3d565f9ae7e3cd985bc7d3a7ef0a24b | 如果ModelBuilding验证错误,则抛出客户端友好异常 | protected ModelAndView doResolveException(
HttpServletRequest request,
HttpServletResponse response,
Object handler,
Exception ex
) {
if (ex!=null && ex.getClass().getName().endsWith(".ClientAbortException") && response.isCommitted()) {
return null;
}
ModelAndView modelAndView = su... | 0 |
f874ea4fd89a99c801cd0523d6b0ee59 | f0ba4c8a1ba8325cd4eded65d66a2619 | GET: InventoryLocations | namespace ELIMS_MVC.Controllers
public class InventoriesController : Controller
public async Task<IActionResult> Index(string search)
{
var items = from i in _context.Inventory
select i;
if (!String.IsNullOrEmpty(search))
{
items = ... | 0 |
97e9775096ea607c0532d62cfd3ed95a | ed90f9218c2fb14bc05bcad73cb3ef73 | Groups Sonos devices, per GROUP_ON_PLAY_DEVICES | class YamahaDevice(MediaPlayerEntity):
def join_add(self, entities):
self._zone.distribution_group_add([e.ip_address for e in entities]) | 0 |
e413d934302fb76854e20e3a2dce254a | 0921faf0ae6a3e3edfbb4a627c072911 | 获取位置所在象限索引; | int nIndex = 1;
int nTemp = (int) ((dDistance * 1000) % (UNIT_LENGHT * 1000));
if (nTemp > 0) {
nIndex = (int) (dDistance / UNIT_LENGHT + 1);
} else {
nIndex = (int) (dDistance / UNIT_LENGHT);
}
return nIndex;
} | 0 |
af1d54c474002e08fcbcfba6ad1bcc7f | ac4b7b5a0d3eb009081ac76e735a8da2 | @brief コマンド送信 リトライ機能付き
コマンドレスポンスが OK になるまでリトライする。 | {
uint8_t first = 1;
uint8_t timeout = 0;
do
{
if (!first)
SDIO_SendCommand(&sdio_cmd);
else
first = 0;
while (SDIO_GetFlagStatus(SDIO_FLAG_CMDACT) == SET);
WiFi_LowLevel_CheckError(msg_title);
timeout++;
}
while (SDIO_GetFlagStat... | 1 |
ead90fc9fdc3c861763dc7ba85921520 | e8f2bd6c7a693aafe118230687e6b0a4 | Define Os Valores Da Tabela Para O Input (UPDATE ACTION) | foreach ($this->dados as $key => $valor):
$places[] = $key .' = :'. $key;
endforeach;
$places = implode(', ', $places);
$this->Update = "UPDATE {$this->tabela} SET {$places} {$this->termos}";
} | 1 |
1ce4888b50f942eb4dbaf2280abeae80 | 1a7ec7447cfebfb02204a470a82750d7 | add a new circle based on the position of the cursor | public class InputManager : MonoBehaviour
public void CircleCreate()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 500, mask))
{
selectionCircle = Instantiate(selectionCirclePrefab, hit.point, new Quate... | 1 |
8a670632e5912755dc03207958d59f23 | 62c3a7afbe4562c8864e333bca42f12a | Returns an address set of all instructions that were disassembled. | namespace SharpDisasm
public sealed class Disassembler : IDisposable
public IEnumerable<Instruction> Disassemble()
{
Reset();
Instruction instruction = null;
while ((instruction = NextInstruction()) != null)
{
yield return instruction;
... | 0 |
febdc383435afb6064bb81019bd8b228 | 4a3e2e0e8ff04e8e3fae5f43e6921ac5 | This attribute is a boolean indicating whether or not the
"select" event should fire when the selection is changed using
one of our methods. A view can use this to temporarily suppress
the selection while manipulating all of the indices, e.g., on
a sort.
Note: setting this attribute to false will fire a select event. | namespace Gecko
[return: MarshalAs(UnmanagedType.Interface)]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType=MethodCodeType.Runtime)]
nsISelectionController GetSelectionControllerAttribute(); | 0 |
731cf8e3898edd9689ede52510ddce84 | 70f47ac0a5f68e77394a9e73ba8afea4 | 加载地区数据成功 | public class PersonEditActivity extends BaseActivity<PersonEditPresenter>
public void onLocalCitySuccess(CitysPickerBean bean) {
mViewLoading.setVisibility(View.GONE);
mCitysPickerBean = bean;
initCityPicker();
} | 1 |
aa6c3e50b95525e232d274a4062ecc77 | cc36ddf34481d04da8a3ce96c98c6f79 | 显示页码按钮 | function pageBtn(totalCount) {
var pageCount = Math.ceil(totalCount / 5);
for (var i = 0; i < pageCount; i++) {
var $li = $('<li><a href="#">' + (i + 1) + '</a></li>');
$NewsoperateList.find(".pagination").append($li);
$li.on("click", function () {
page = $(this... | 1 |
9f0644e0be99b5dd599d0a8788ebcaac | 3112c9642f3309b05a24e0af68fee3fb | Converts Alphabet item to encoded item and validate the same. | if (!alphabet || alphabet.length % 26 !== 0) {
return false;
}
if (!input || alphabet.length % 2 !== 0) {
return false;
}
const alphabetTestArray = alphabet.split('');
for (let letter of alphabetTestArray) {
let letterCount = alphabetTestArray.filter(
(character) => cha... | 1 |
b7b2f598983862b9c4f8329f3d06fe01 | be833ae225fc151963c52c21e3f2f1bc | 设置滑入动画 | val slide = TranslateAnimation(Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 0.0f,
Animation.RELATIVE_TO_SELF, 1.0f,
Animation.RELATIVE_TO_SELF, 0.0f)
slide.duration = 400
slide.fillAfter = true
slide.isFillEnabled = true
v.startAnimation(slide)
... | 1 |
1d972ffbb9c3432a11a9d12667dd2b03 | 0980bf0fbb7cda551f57cc8827644189 | Overrides the default Accept-Language header.
Defaults to a combination of [Locale] default language and country. | class _ServiceActionState:
def accept_language(self) -> Optional[pulumi.Input[str]]:
return pulumi.get(self, "accept_language") | 0 |
04507565bb46f5242e2ca601b75cfe6b | 87bb71cf2bf324b6a07c7f4d77f6e95f | 产品考期变化事件 | function initEvent()
{
$("#changshuoselect").change(changeChangShuo);
} | 0 |
3017df9aa4c02decc0014abf7366d139 | 58ca430156a8d908d3823b1ea2291b5a | Answers Q1. | def q1(onTime, absent):
if onTime:
return('Hello!')
elif absent:
return('Is anyone there?')
else:
return('Better late than never.') | 1 |
5708f1bfd562d31a4a690a2b57ec5599 | 694879a21697603c3e4d4800c4e8d798 | transform selected countries list and send request | export class CountrySelectComponent implements OnInit, ControlValueAccessor
getCountryList() {
this.countryListObs$ = this.httpClient.get<CountrySelectItem[]>('https://next.json-generator.com/api/json/get/VkgTFqnGO');
} | 0 |
9abf7150442312d6e8f9246a5e7209ea | b8f7b91bc2ddabdf6f4969693fb9a3e0 | resizes image so that its width is the second arg, and its height is kept proportional | int w = img.getWidth(null) * h / img.getHeight(null);
resize(img, fileNameStr, w, h);
} | 0 |
4c65da9f12042f6ee85d99fa135c8624 | cef60aefc2728ce4cec171e3e8e56939 | Sets the name of access token parameter which will returns by the
provider. By default it is "access_token" | public class JWTRequestParameterAuthenticationFilter extends AbstractPreAuthenticatedProcessingFilter
public void setParameterName(String parameterName) {
this.parameterName = parameterName;
} | 1 |
301cccfb9015e0a6a2856092a5d1a25e | a70416f36c9b149d86ee4c86e586a01d | Using the PHP language, have the function LetterCapitalize(str) take the str parameter being passed
and capitalize the first letter of each word.
Words will be separated by only one space. | function toJadenCase($string)
{
$words = explode(' ', $string);
foreach ($words as &$word) {
$word = ucfirst($word);
}
unset($word);
$result = implode(' ', $words);
return $result;
} | 1 |
eb9b77bc8bffeea2e7d088d4ca6a5503 | 27a879fd1c2fa1b54e5d602879a0e8fc | Log forgot pass request attempt | {
$attempt = $this->em->getRepository('MegaloSecurityBundle:Attempt')->findOneBy(array('login' => $login));
if (!is_object($attempt)) {
$attempt = new Attempt();
$attempt->setLogin($login);
}
if (is_object($attempt)) {
$attempt->setLastAttempt(time());
$attempt->setNbAttempts(1... | 1 |
48989dce4257558a43cbcb8f0278ad2f | c243591c48fe40a51064766ce08eb2c2 | donne la liste des joueur qui ne sont pas dans notre team | var joueurs = this.joueursSelectionnes
var liste = []
for(var i = 0 ; i < joueurs.length; i++) {
if( LocalUser.data.id != joueurs[i]) {
liste.push(joueurs[i])
}
}
console.log("buildListOfJoueurWithoutCapitaine", liste)
return liste... | 0 |
718bcb89afb1d0ed4e8799eaa47e2feb | e216a70aec49275dd680942db84840bb | Get temporarily filepath by url | $client = new Client();
$tmp_name = sys_get_temp_dir() . '/' . basename( $url );
$request = $client->request(
'GET', $url, [
'sink' => $tmp_name,
]
);
if ( 200 !== $request->getStatusCode() ) {
throw new \Exception( 'T10ns not found' );
}
return $tmp_name;
} | 1 |
f0964c0d6cb8015cde008f7e6ee63973 | 98704e5614a65d7cded0e9808519742d | AXP_Convert_To
This function is called to convert from Native to VHD/Network values. Both
VHD and Network values are stored/transmitted in Big Endian. There is no
assumption about Native. If Native is Big Endian, then this call is a
NOOP.
Input Parameter:
This is an enumeration that indicates the type of data in the... | {
u32 host_value = 0;
if (uu::system::IsBigEndian())
{
return network_value;
}
else if (uu::system::IsLittleEndian())
{
host_value = uu::system::LittleToBigEndian(network_value);
}
return host_value;
} | 1 |
118b3d795926344f5f15a0b64df7b52a | 2229f573dea0161a5ff526bfc5812711 | 验证首页轮播图标识个数 | public class IndexTransPicDAO extends BaseDAO
public Long queryIndexAmount(){
Long result = new Long("0");
result = this.getQueryJdbcTemplate().queryForLong(sqlQueryIndexInfo, new Object[]{"header",0});
return result;
} | 1 |
5dcbdbf1ff177908b83b1a95465002f2 | 6d636d013610ca55a11fc36f6b12c557 | Método para obtener el codigo de mi articulo | class Home_HomeController extends AbstractController
public function get_item_code() {
return "G000";
} | 1 |
8e79ec8f546fdbc9632fc0d42869608d | 6b69f1b8971ef701ff842df8fc55daff | Build the SQL Dump Manager. | {
$connection = (array) $this->connection($builder);
$dsn = strpos($connection['dsn'], ':');
$driver = (string) $connection['driver'];
if ($driver === 'pdo' && $dsn !== false) {
$keys = (array) explode(':', $connection['dsn']);
$connection['driver'] .= (string... | 0 |
12e05020244424a144c94c2d54d213e7 | df01c06590fd18581bd93e1cbfa34914 | Calculate the ∆G'physiological of a reaction. | if self._dg0_prime is not None:
return self._dg0_prime
logging.debug('Aqueous Params = ' + str(self.aq_params))
c_dg0_prime_list = [c.DeltaG0Prime(self.aq_params) for c in self.reactants]
kegg_id_list = [c.kegg_id for c in self.reactants]
kegg_id_and_dg0 = zip(kegg_id... | 1 |
acc502a1e68ea350a1df6b4b8755f4fc | 1e43ae2d3b69b422a837fc930763e210 | Suggest a sensible k-point sampling based on a supplied distance. | def klength2mesh(k_length, lattice):
rec_lattice = np.linalg.inv(lattice).T
rec_lat_lengths = np.sqrt(np.diagonal(np.dot(rec_lattice.T, rec_lattice)))
k_mesh = (rec_lat_lengths * k_length + 0.5).astype(int)
return np.maximum(k_mesh, [1, 1, 1]) | 1 |
e3edbd124f0e88b5f69586fc4cb3de08 | a71d4787e0a7dd06968615b5b0d5e244 | Initialize the margin exclusion zones.
These zone prevent seeds from getting too close to the tile boundary where
they would cause voronoi ridges that are too small, or cause the region to
be clipped by the hex boundary. | const seeds = [{
height: Math.floor(lHeight / 2),
width: Math.floor(lWidth / 2)
}];
while (seeds.length) {
const seed = seeds.pop();
const iCurrentPixelx = seed.width;
const iCurrentPixely = seed.height;
const lpSrc = iCurrentPixely * lWidth + iCurrentPixelx;
for (let k = 0; k < 3; k++... | 0 |
c698697d2654ace38ed0ad6d0d3d2971 | ba10ac5e8e9468ec3c0c3919578ef9f3 | Sets the activity_benchmark of this PersonalPatternDuty. | boolean isSetBenchmark(); | 0 |
51679b04e79119f80cb091c1d1f0129e | 2a547bdba177b1e7562541f545f4fe21 | Prints CSS classes of the element. | abstract class FactoryForms328_FormElement
protected function cssClass() {
$this->htmlBuilder->printCssClass();
} | 1 |
6abe20cf91be7f34c112801790c27c84 | 819275cd3922af3097bb6fcd90ae053c | This view will display the courses of the institute for which the student is registered | class InstructorController extends Controller
public function courses(Request $request)
{
return view('scholar.index');
} | 0 |
677fb0c22b457847c1e09aed26349e76 | e1cf958607bc0d93e413fd7f79babe64 | 从数组中读取access_token和refresh_token
常用于从Session或Cookie中读取token,或通过Session/Cookie中是否存有token判断登录状态。 | class SaeTOAuthV2
function getTokenFromArray( $arr ) {
if (isset($arr['access_token']) && $arr['access_token']) {
$token = array();
$this->access_token = $token['access_token'] = $arr['access_token'];
if (isset($arr['refresh_token']) && $arr['refresh_token']) {
$this->refresh_token = $token['refresh_toke... | 1 |
05bd4160e520abbd5655efd822b4c0a9 | bcf763e5a4a98742d2d9fcff0e2e1e50 | Initializes a web request factory that allows us to mock web responses. | ResponseOrException loginResponseOrException = null)
{
var webClient = new Mock<IWebClient>();
var sequence = webClient.SetupSequence(x => x.UploadValues(It.IsAny<string>(),
... | 1 |
c95873a0523da4e7d3e0efeb78abccd2 | 8b624cbf0d5619445241dc5ea188307c | 基本农田植被覆盖度页面 | class Ecologycompany extends Admin_Controller{
public function ecologyManagerTreePage(){
} | 0 |
916f22acf8846bd7d357ab591a6cb25b | 5f1376f6f0443fd51ada9f02f8a43325 | Проверка защиты маршрута 2 | class RoutesTest extends TestCase
public function testMatchRoute6()
{
$this->assertTrue(self::mainTestData(self::ACTIONS[65][0], "POST") !== self::ACTIONS[65][1]);
} | 0 |
817e6b4678398d0888193cda808a06a3 | d33b4d48ad0f5e559bff71bc5e73ad3f | Формирование доп. соглашений по подразделению на определенную дату | {
OracleConnection connect = new OracleConnection();
OracleDataReader rdr = null;
try
{
if (Request["dpt_id"] == null)
Response.Redirect("DepositSearch.aspx?action=agreement&extended=0");
Decimal dpt_id = Convert.ToDecimal(Request["dpt_id"]);
... | 0 |
41dbb6ce0269069e5f266f82acf38eb8 | 3570495eb0963b8b2a7488b7fc88d061 | Method for making a HTTP 'Put' request to the API. | class ApiService
public async doPutRequest<P, R>(url: string, data: P): Promise<R> {
this.setAuthToken();
const apiResponse = await this.apiInstance.put<P, AxiosResponse<R>>(url, data);
return apiResponse.data;
} | 1 |
fc95454bc0fd9fdfe04df5e7893fbdcb | 00a91915d24ef417a68aea7bb1039fd2 | 求叶子节点带权路径长度之和 | public class HuffmanTree<T>
public double getWPL()
{
var q=new LinkQueue<HuffmanNode<HuffmanData<T>>>();
double wpl=0;
int level=0;
q.enter(this.root);
while (!q.isEmpty())
{
level++;
int count=q.getCount();
for (int i = 0; i < coun... | 1 |
16514b82be68235907d42df6638158eb | b67fd21ec53ac4fe552be2e9fc1622f5 | This method defines the behavior of the object when an agent interacts with it. | void Interract(GameObject interactedObject); | 1 |
a030e6e14cc5cdc0653c7ebe70e852d1 | e80ce4b47a50c88ce84c27c30adb98da | Persists the given {@code location} into the database. | void addLocation(IRLocation loc); | 0 |
be57b910dfdabf82964b42c11c7bf291 | 1edc1f06fe0520fd3de62ec3acb918b3 | Test output for a single condition. ">". | class QueryTest
@ParameterizedTest(name = "{arguments}")
@ArgumentsSource(DefaultArgumentProvider.class)
void queryWithKeyConditionsGtHigh(TestArgument testArgument) {
queryWithKeyConditionsGtInner(testArgument,
RANGE_KEY_HIGH_N_VALUE,
ImmutableSet.of());
} | 1 |
93eca4f6031e598a0619dac5a9f8b650 | c7c7cfc414653f0d45ce15d414552045 | 手のメッシュ表示をトラッキングと同期 | {
var dynamicBonesV2 = GameObject.FindObjectsOfType<DynamicBone_Ver02>();
var dynamicBones = GameObject.FindObjectsOfType<DynamicBone>();
var cloths = GameObject.FindObjectsOfType<Cloth>();
if (dynamicBonesV2.Length == 0 && dynamicBones.Length == 0 && cloths.Lengt... | 1 |
e1ab410c73fc2bb2ee571548f4a542bb | a73ae06081b84a20429d742e354a89fd | Test the CSV based authenticator/metadata provider. | csv_consumer = self.create_csv_consumer(self.good_config_wincr())
tups = csv_consumer.get_account_metadata()
for t in tups:
assert t[0] != ""
assert t[1] != "" | 1 |
9b3cf6463bf97d1572072be3f8422ed0 | 1bc42be48c57722756586bf81d21d2e9 | Convert this to the corresponding BigQuery type and check that. | class IamHelpersTest(unittest_utils.ForsetiTestCase):
def test_convert_iam_to_bigquery_policy(self, name, iam_policy,
expected_result):
result = iam_helpers.convert_iam_to_bigquery_policy(iam_policy)
self.assertEqual(result, expected_result) | 1 |
f96ca1a18f4d69d5b97cf0873e2bf35f | 4c5c2f918b34526d2de0a602b75ce6fa | find in-degrees and keep track of key milestone | void dfs(vector<vector<int>> g, vector<int> &m, int curr, int &counter) {
m[curr] = ++counter;
for (int x = 0; x < g[curr].size(); x++) {
int neighbor = g[curr][x];
if (m[neighbor] == 0) {
dfs(g, m, neighbor, counter);
}
}
} | 0 |
58d265a613b2bf52bb2be2cb4f525cce | af6fadc24394592e46d2bf64f63fa6b3 | ajax 호출일 경우 디버그 정보 출력안함 | if(isDebug()){
if(!$this->_http->isXmlHttpRequest() && !$this->_http->isFlashRequest()){
showRuntime();
showDebugDetail();
}
}
Core_DB::disconnect();
} | 1 |
d548213e35a0ef67df42f6a5942533aa | 16aae7f65eaceb3045f228d41b010990 | Returns the meta object for the containment reference '{@link org.alia4j.language.bp.Root#getLevel <em>Level</em>}'.
<!-- begin-user-doc -->
<!-- end-user-doc --> | EClass getLevel(); | 1 |
f8a586abca3e9baf7374ec2f7693f50a | 967f493ac08d690d72f2d60df2b7a4c2 | 获取所有项目的简要信息:project_header.coffee请求,填充项目下拉列表 | class ZhihuSpiderControlerOnScrapyd():
def getProjectsList(self):
getProjectsList = "http://127.0.0.1:6800/listprojects.json"
res = requests.get(url=getProjectsList)
pprint.pprint(res.content)
pass | 0 |
c4c63e7d8ac035f1924aac79e10e6e7f | d58035685f6372b410e9241143210223 | When the button is clicked change the coordinates and color for the shapes | public class DemoComplexShapes extends PortableApplication
@Override
public void onClick(int x, int y, int button) {
if (shape_type == type_shape.CIRCLE)
shape_type = type_shape.RECT;
else if (shape_type == type_shape.RECT)
shape_type = type_shape.IMAGE;
else if (shape_type == type_shape.IMAGE)
shape_ty... | 0 |
bc9598de7da969fa9cf0591f51ed26f4 | d2568c309184a00e131f2b160f5ce9cd | Opens the modal view that holds the debug panel | this._rowsEl.style.maxHeight = '100px';
this._isOpen = true;
this._controls.textContent = 'Close ARDebug';
for (let [, row] of this.rows) {
row.enable();
}
} | 1 |
b6ccbfb0e91a5d2e6c45e899e8129a85 | 7a5b168da95f7e6dcdf5d1b9dfe1462c | ValidateThingBody Validates a thing body using the 'ThingCreate' object. | namespace Openhab.Client.Api
ApiResponse<string> CreateWithHttpInfo (ThingDTO body, string acceptLanguage = null); | 0 |
c7cc0b6664dafc5f7866393aa3dc657c | 0d214941d8f1c42ad5025ec60e21975c | Conversion de los datos provenientes de archivo excel para el cliente Brasil
de Salvador en DataFrame. | def import_ConsumoCliente():
list_of_files = glob.glob('/Users/pptrv/Downloads/*.csv')
latest_file = max(list_of_files, key=os.path.getctime)
general_df = pd.read_csv(latest_file, sep=";;", error_bad_lines = False)
power_df = general_df.iloc[1:7]
power_df.columns = ['a', 'b']
power_df[['Potenci... | 0 |
d078bd039c80323302f4f0e434197f41 | e94970e2535a92980ffb2bdc6f9ed49c | Test create listener with a missing required field protocol_port | class Zend_Service_Amazon_Ec2_ElasticLB_ListenerTest extends PHPUnit_Framework_TestCase
public function testConstructorInvalidProtocol($proto)
{
$l = new Zend_Service_Amazon_Ec2_ElasticLB_Listener(80, 80, $proto);
} | 0 |
4ffddf4f6e4dac2c8ab17011af8b4e24 | 2eba510dcc01cbd8cff8da74d40d1639 | Purpose: Returns max area of cake after we cut at each horizontal
and vertical position provided in input arrays.
Since answer can be large, return the answer modulo 10^9 + 7. | function MaximalSquare(strArr) {
} | 0 |
78923706ae5b891831c493abea5acdfd | d5bf34758bb97f55d4bc6efd35357643 | 刷新es索引,防止变更数据导致数据显示有问题 | public static void refreshIndex(@NonNull EsClient esClient, String idxName) {
String endpoint = buildEndpoint(idxName, "_refresh");
esClient.performPostRequest(endpoint, Collections.emptyMap(), null);
} | 1 |
6b038420dad432582187fe683a7d049f | 77090b5b813bd658ed800884392ae31b | Map the Python types to the best match in C++ | def map_cpp_type(typ: str) -> str:
type_mapping = {
'bool': 'bool',
'int8': 'int8_t',
'uint8': 'uint8_t',
'int16': 'int16_t',
'uint16': 'uint16_t',
'int': 'int',
'uint': 'uint32_t',
'int32': 'int32_t',
'uint32': 'uint32_t',
'int64': 'in... | 1 |
e39980354b87b59375c13e92536c3da9 | 3450935f0b57825ad1c214b3ba2a3645 | :Description: Find a browser by it's given name. | def get_browser(x):
x = "".join([l for l in x if l.isalpha()])
browser_map = {"ff": "Firefox", "gc": "Chrome", "ucbrowser": "UC"}
if x in browser_map.keys():
return browser_map[x]
else:
return x.upper() if len(x) <= 2 else x.capitalize() | 1 |
db3a7b82384d8234fea659992bf012d9 | 3369a8d18c4d0a1b0c8f761ec9e4a340 | Отрисовка шаблона кафе | export default class CafeListView extends BaseView{
_renderCafes(context){
const cafesContainer = document.createElement('div');
(new CafesContainerComponent(cafesContainer)).render(context);
this._app.appendChild(cafesContainer);
let buttonAddCafe = document.getElementsByClassName(
... | 1 |
dae499f6f124b68aeca4ee08a878ab0e | 46dac995950bdd753fc808c446c3ddaf | This api drops all queued packets for a station. | void CStreamServer::DEBUG_DROP_PACKET(uint handle, uint1 decrement)
{
*(m_multiverse[handle].pseq) = *(m_multiverse[handle].pseq) - decrement;
} | 0 |
40ea26276af8823cb075fb628ffbfd5b | 34f75b103595dafe8ada1f095d9e7fdc | 处理 DocumentComplete 事件. | class EventHandler:
def document_complete(self):
pass | 1 |
5778c6c6b3afdb135de600ee00425422 | 50c93d4a435e975e38eb9fe0360e8a41 | NewTestClient returns a client with a custom send function to use for testing. | func newTestClient(fn roundTripFunc) *http.Client {
return &http.Client{
Transport: roundTripFunc(fn),
}
} | 1 |
ab35f77078d09ab480243e42e21260d8 | 6a4b3670052672c40d0cc9e578498924 | Vie tarjotun mökin takaisin pinon pohjalle. | public class AlustaNopeusViesti implements Viesti
@Override
public void otaVastaanVierailija(ViestiVierailija k) {
k.vieraile(this);
} | 0 |
81e411b916765e7846e6a3525301ec3c | 7f650723c9f6a8c42adaa473b279a6da | JFD_RTP_Piety_EventCanTake | {
if ( !self || !self->client )
{
return qfalse;
}
if ( self->client->ps.persistant[ PERS_TEAM ] != TEAM_HUMANS ||
!BG_InventoryContainsUpgrade( UP_JETPACK, self->client->ps.stats ) )
{
return qfalse;
}
if ( self->client->ps.stats[ STAT_FUEL ] != JETPACK_FUEL_MAX )
{
self->client->ps.stats[ STAT_FUE... | 0 |
4f741c32cfdec6bf3a7dfaa4c283a291 | b6ed0d28b6fb1c00a8ba711b76a151e9 | updateDtUtcを取得します。 | @Entity
@Table(name = "MRS_MERDS_SCHEDULE")
@NamedQueries({ @NamedQuery(name = "MrsMerdsSchedule.findAll", query = "SELECT S FROM MrsMerdsSchedule S") })
@NamedNativeQuery(name = "MrsMerdsSchedule.getByMerchandiseIdChannelId", query = "SELECT S.* FROM Mrs_Merds_Schedule S "
+ "WHERE S.channel_Id = ? AND... | 0 |
512f6c5d24737a6dd6df1577bc9deaeb | 65424ae85b4997dbb5305a8c73bd2884 | 拦截正常的startActivity,替换intent内容,达到启动未在manifest文件中注册过的activity的效果 | public class AmsHookInvocationHandler implements InvocationHandler
@Override
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
if ("startActivity".equals(method.getName())) {
MLog.d(MLog.TAG_HOOK, TAG+"->" + "invoke startActivity");
Pair<Integer,Inte... | 1 |
8b1465555bae7e62103c8e4c9ad852a4 | 8676e689314e6063512a20799d1653e4 | frequency of nucleotides at each position | assert all(self.is_position())
F = np.array([(i==self).sum(axis=0) for i in alphabet])
return F, np.array(list(alphabet)) | 1 |
0e6b514d7c236ac07959a92c645f4ae2 | 08cc117db6d9db7be784484c3ecb15a4 | update state that depends on the current value of "ap" | void QMandalaItem::apcfgUpdated(void)
{
if(mandala->local==this && (!apcfg.value("comment").toString().isEmpty())){
if(mandala->current==this) mandala->setUavName(QString(ident.callsign));
}
emit apcfgChanged();
} | 1 |
503e3d42e475c8810174b2db263d9c22 | 1e9ff6f8555622d15798a37dd3c2e7db | 指定したインデックスに駒が存在するかどうかを判定します。 | namespace Niels.Tests.TestHelper
internal class BoardContextForTest : BoardContext
internal bool IsOccupied(int index, Turn turn)
{
int orgIndex = BoardForTest.TransrateIndex(index);
BoardType board = BoardForTest.GetBoardType(index);
return this.OccupiedBoards[(int)turn]... | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.