query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
97b76c2dd6ee84df1d9b088748cea218 | c8b6141bd5ddd7fbeeecae35b6db8f7e | 是否可以吸收伤害 | export class ActionBase
public get canBeAttacked(): boolean {
return this._can_be_attacked;
} | 0 |
d3cbd4875d19c090c3a25a3ac8528c35 | a4f80ef181f93945e1f6e26b3e4babee | Mirror picker position (on X axis) | class EIOS_META_SCRIPT:
def get_mirror_pos(self,idx):
cmd = 'mirror_pos %i' % (idx)
stat,ret = self.query(cmd)
if not stat:
print('Mirror error: %s'%ret)
ret = 'nan'
return float(ret) | 1 |
6f4155603a0eb3d4bd0107730ed694a3 | e1531bde3007b26772953842a42b4d03 | !
Destroys the scroll bar. | {
NtyGoTop(NULL);
removeAllChildrenWithCleanup(true);
m_pScrollBar = NULL;
m_iItemCnt = 0;
} | 1 |
8321545b09965b23b97fd4cee4ecec1e | 964a30a30318faf4fbfe305b666545b6 | Create a simple <see cref="IIngredient"/> that does not match anything
but requires a quantity of one, thus always preventing a recipe
from being crafted. It displays as an error item in the
ingredients list. | {
return new DaggerfallUnityItem(ItemGroups.UselessItems1, 1) { PotionRecipeKey = recipeKey, stackCount = stackSize };
} | 1 |
ea67cdbee230431dd75dcc9c7b37f877 | f60a86a761aac16aa527170d517a9bce | This method daemonizes the "rrdUpdate" method. | child_pid = os.fork()
if child_pid:
sys.exit(0)
os.setsid()
os.chdir('/')
os.umask(0)
daemon_pid = os.fork()
if daemon_pid:
sys.exit(0)
if self.__pid_file:
with open(self.__pid_file, 'w+') as f:
... | 1 |
b806fc3976c36829e544474152d0e6a4 | 20352070fee133e1c330a19bf39b8ea2 | システム日付を時分秒ミリ秒を0に設定した値を返却する. | public class SystemTools
public static SystemProtos.SystemTime getDataSystemTime() {
SystemProtos.SystemTime.Builder system_time = SystemProtos.SystemTime.newBuilder();
String[] my_date = NewTimeUtils.getAllTime2().split("_");
CommonProtos.Date.Builder date = CommonProtos.Date.newBuilder();
... | 0 |
c3ea531ed738bf55654eb797d164febc | ca1894dfc38bc3f7bcd7f63959ee7e1b | prilikom odredjivanja novog centra izracuna se i za koliko se novi centar
razlikuje u odnosu na stari | bool KMeans::ExistCenterShift(std::vector<st_pointxyz> &prev_center, std::vector<st_pointxyz> &cur_center)
{
for (size_t i = 0; i < m_k; ++i)
{
double dist = DistBetweenPoints(prev_center[i], cur_center[i]);
if (dist > DIST_NEAR_ZERO)
{
return true;
}
}
return... | 1 |
8b65325aa5ecd138439ae99b0de9b299 | 0d9803abef3b2f789d2a2b017a65d357 | 상대경로를 가진 Uri에서 절대경로를 가진 Uri를 구해 반환 | {
Uri uri = new Uri(HttpXapPath() + "/../../" + relativeUri);
return uri;
} | 1 |
eb53f7d7373986b880eede0388c23489 | 5bf8053c795aaaf662ef4dbdcd31a8d0 | 根据 消毒柜(编号)查询手术鞋 的 数量 | class CabinetModel extends DB_Model
public function getCabinetSum($wheres)
{
$where='';
if(!empty($wheres['cabinet_number'])){
$where=trim($wheres);
if(preg_match("/^[0-9a-zA-Z]{3,10}$/", $where)){
$where.=" AND cabinet_number="."'". $where ."'";
}... | 0 |
394f3b8b4c29a20c4b02bf9545a670d5 | 4f35973dfec8e620060dc9de2dc2a3f2 | Formats the specified fields of the snapshot. | const formatted = {};
Object.keys(fields).forEach(key => {
const newKey = key.replace('-', '.');
formatted[newKey] = fields[key];
if (formatted[key] instanceof Array) {
if (fields[key][0] instanceof moment) {
formatted[key] = `${fields[key][0].format('YYYY-MM-DD HH:mm:ss')},${fields[key][1... | 1 |
abf615afa763499dad3195268bd1ed09 | f3fd811a52c41485b499f3b84e7b08fb | Минимальная цена единицы товара или услуги | {
$minPrice = $this->getData('min_price_int');
if (is_null($minPrice)) {
$minPrice = $this->_getResource()->getMinPrice($this);
$minPrice = floor($minPrice);
$this->setData('min_price_int', $minPrice);
}
return $minPrice;
} | 1 |
56c2ff09dbbda53f52c507f19fa5b310 | fcaf28b94675053139e4ceacb038898f | Draws one of three hair styled depending on the value of hairStyle | namespace DontShaveYourHead
[HarmonyPatch(typeof(PawnRenderer), "RenderPawnInternal", new Type[] { typeof(Vector3), typeof(float), typeof(bool), typeof(Rot4), typeof(Rot4), typeof(RotDrawMode), typeof(bool), typeof(bool), typeof(bool) })]
public static class Harmony_PawnRenderer
public static void DrawHairReroute(Mes... | 0 |
3c5415d7f578dbb8123ab3168c80f9c5 | 0b08642feef5e93225b17c4790174ba4 | 创建隐藏物品完成事件。 | namespace UIGianty
[StartupAttribute(StartupType.PREFAB, null)]
public class UIMan : SystemSingleton<UIMan>
void OnHideUIComplete (UIContentType ui)
{
UIEventDispatcher.TriggerEvent<UIContentType> (UIManEvents.UIMan.OnHideUIComplete, ui);
} | 1 |
4a6beb72ee277e0a09fc93a444d7db46 | 749fa04a880e1b5e8ef5ef3a69249ed5 | Return the index of the top panel, according to scroll position. | {
var visualizationContainer = droppedPanel.Container;
currentPanelIndex = visualizationContainer.Panels.IndexOf(droppedPanel);
double previousVerticalCenter = double.NaN;
double currentLocation = double.NaN;
for (int i = 0; i < visualizationContainer.... | 1 |
03d45c8b7b979baa2ccf156e3a3b4c80 | 86443f337bab7097503850c8b64af4aa | Implementation of setting timer's target with unit of 100us | void setTIC100US(uint16_t tic)
{
(*(volatile uint32_t *)(WZTOE_TIC100US) = tic);
} | 1 |
b48b0e7732264e5f20dce380643aff43 | 4ab67e4c6b6325331eaeb427ad6e8f3c | ************************************** Регистрация администратора
URL: /Account/AdminSetup
************************************** | class UserController extends Controller
public function actionCreateAdmin()
{
if(User::isCurrentUserAdmin())
{
$model = new User;
if (isset($_POST['User']))
{
$model->attributes = $_POST['User'];
... | 1 |
1a7dbe2bfea27e955d40af160e45e708 | cc32c314aa95dc6c43354a63477289ad | 自动设置会员等级 | $db = include_database::getInstance();
$sql = "SELECT * FROM ".DB_PREFIX."member where uid='{$uid}' ";
$userdetail = $db->doSql($sql,true);
$levels = getAppInf('vipline');
$myLevels = $levels[$userdetail['typeid']];
if( !is_array($myLevels) || count($myLevels)==0 ) return;
if( empty($userdetail) || $user... | 1 |
15037cb84b88a39dafdd93d299847e05 | 18e79a6967995134ff1d3d4bf332ec95 | save value to greasemonkey/tampermonkey etc. | function saveClose(data){
chrome.storage.local.set(data, function(result){
chrome.tabs.executeScript(null, {file:"codes/svc/inject.js", allFrames: true});
window.close();
});
} | 0 |
c21cf5610da4a40fb291a070b34a9ca8 | 8dd9720a830cd362b707414630353974 | Define the authenticators present in a specific view. | class AuthenticationService implements AuthenticationServiceInterface
public function authenticators(): AuthenticatorCollectionInterface
{
return $this->authenticators;
} | 0 |
b158ed3a33fe1a2a971df96e681e6381 | 8e20d08b139eaad75f868effe9b94e3e | Metoda vraci jmeno vyrobce zarizeni | class GeneratorCistogZraka(object):
def get_proizvodjac(self):
return self.proizvodjac | 1 |
a89b0fe157559635a225ebfaffa7741a | 5a093ee559a98f393c706444e042bb0b | the function change each letter in the tree to be the next following letter | size_t temp=switchletter(c);
if (this->node[temp].exists==false){
this->node[temp].exists=true;
if (c!='\n' && c!='\r')
this->node[temp].nextptr=new Dnode();
}
return this->node[temp].nextptr;
} | 0 |
b86b17369c15a90c94c653be2366e66c | 2cced49f5216eda82a4a56f408739f78 | Очищаем кэш браузера | namespace web
namespace utils
void clearRequired(Browser& webBrowser)
{
webBrowser.clearCache();
webBrowser.clearCookies();
webBrowser.clearHistory();
} | 1 |
529c127f673f09a39965b8b788e6cd60 | f3391a09e6a2dbf5eb7ec0fc412691cf | Сбор данных из датасета Hands Gesture Recognition. | hand_contour, grey, blurred, thresholded = find_hand(img, threshold, blur)
defects, drawing = find_defects(img, hand_contour)
fingers_count = detect_num_fingers(img, hand_contour, defects)
return fingers_count, grey, blurred, thresholded, drawing | 0 |
c233f11c97c8e5ec1ad8d9bc15c7e63f | c08a3fb611b89d5efda46ca1a0719d3a | \brief Allocates a list of doubles initialized by zero | {
size++;
*var = (double *)malloc(size * sizeof(double));
if (*var == NULL)
{
printf("Problem allocating memory for array in d_alloc.\n");
return;
}
else memset(*var,0,size*sizeof(double));
return;
} | 1 |
421bf2d323bf778f904290e11ff45190 | 4d04f0b8b09939b50893a39c3d2733f2 | GET: StatusiZahtjeva | {
var zadaci = db.Zadaci.Include(z => z.Prioritet).Include(z => z.Projekat).Include(z => z.Status);
return View(await zadaci.ToListAsync());
} | 0 |
2c7dae9345b3a0757c8a25bf888e682e | 4b847466fe733fe9c0647f843814d47f | Fills apropiately the pseudo-backbone box list of atoms for
common residuals with hydrogens | static void common_bb_filling(Bboxpt bbox){
int i,index=0;
p3d_poly *poly;
i= natomamino-2;
poly=poly_table[i];
set_atom(poly);
bbox->lpoly[index]= poly;
index++;
i= natomamino-1;
poly=poly_table[i];
set_atom(poly);
bbox->lpoly[index]= poly;
index++;
i=1;
poly=poly_table[i];
set_atom(po... | 1 |
1cdb9b4f9f1ad8bc50525789dc516095 | 1b8603c1303c5827ce48fbb82db0eec8 | Searches for loyalty accounts in a loyalty program.
You can search for a loyalty account using the phone number or customer ID associated with the account. To return all loyalty accounts, specify an empty `query` object or omit it entirely.
Search results are sorted by `created_at` in ascending order. | def search_contacts(Filters=None, SortCriteria=None, NextToken=None, MaxResults=None):
pass | 0 |
d05aa68f204dc9bf123894480f048272 | a5485a4933df461dee91fe764376f2b3 | Is param file exist. | for (Param param : mParams) {
if (param.type == Param.PARAM_TYPE_FILE) {
return true;
}
}
return false;
} | 0 |
0a4c7097ac515b956362faee37df7d69 | b256b2945a5d79212de9c5c1d5ced2b8 | remove some variables because they would interfere with step analysis | process.prod.remove(process.genPartons)
process.prod.remove(process.heavyIonCleanedGenJets)
process.prod.remove(process.hiPartons)
process.prod.remove(process.patJetGenJetMatch)
process.prod.remove(process.patJetPartonMatch)
process.patJets.addGenPartonMatch = False
process.patJets.embedGenPartonMatch =... | 1 |
ecaeb691552506c84560fb6abde79ec3 | 263183037b40e2a1b0b27b25e0f3ece2 | 设计一种方式检查一个链表是否为回文链表。
核心就是找到链表中点,翻转链表,然后判定。
O(n)的时间和O(1)的额外空间。
①找到链表中点 ==》 翻转
②比较两链表 | func isPalindrome(head *ListNode) bool {
if head == nil {
return true
}
slow, fast, prev := head, head, &ListNode{}
prev = nil
for fast != nil {
slow = slow.Next
if fast.Next != nil {
fast = fast.Next.Next
} else {
fast = nil
}
}
if slow == nil {
return true
}
for slow != nil {
slow.Next,... | 1 |
8539e07635b5e7dec2046ea3d474a698 | cfb35110f9f9b80595b0ecea7122c934 | Hack -- Identical items cannot be stacked | public class L2SingularItem extends L2Item
@Override
public final boolean isStackable()
{
return false;
} | 1 |
70db6c7435ba6fbfaebd45266fc2674e | 646bfbb6b044d05670d6099cfe56a4a0 | Send all new comics from username to all subscribers | namespace KPO_laba11_3
public class PostOffice
public void sendNewspaper()
{
foreach(var subscr in subscribers)
{
subscr.update(true);
}
} | 0 |
00d585c5bbbdee321e36879cee1f39e0 | 9d949b33583797a7a1277603ce8de95d | Reads specified number of bits and builds the corresponding integer | {
if (numBits > 32 || numBits < 1)
throw new ArgumentOutOfRangeException();
if (numBits > bitsremaining)
throw new EndOfStreamException();
int numCycles;
if (bitsremaining >= numBits)
numCycles = 1;
else
... | 1 |
36eab85a79553f203ef5f26c4225e20e | b2e2688ca0e6c391bddf0ad7de7d7d5d | A specification for an unformatted boolean item. | class BooleanDefinition(FixedSizeDataTypeDefinition):
def __init__(self, name, aliases=None, description=None, urls=None):
super(BooleanDefinition, self).__init__(
name, aliases=aliases, description=description, urls=urls)
self.false_value = 0
self.true_value = None | 1 |
fee7858a2dcaa1cde8700ea5180e0424 | f8dc6a1e192b330f14c504a1e9268180 | Método que lanza un mensaje que explica el formato para calcular el número de vértices de un polígono. | public class Cliente{
private static int detectarVertices(String linea)
throws IllegalArgumentException
{
throw new UnsupportedOperationException("Este metodo aun no ha sido "
+"implementado");
} | 0 |
ed8cdd518136734907f8e4c711ea6a58 | 025fc570bb6645fe7ef3bb1298bd588e | # computes VQR via primal program | xx.inv <- NULL
pr2 <- 0
try(xx.inv <- solve(crossprod(x)), silent = T)
if(!is.null(xx.inv)){
h <- tcrossprod(tcrossprod(x, xx.inv), x)
vh <- matrix(h, ncol = 1)
pr2 <- as.numeric(crossprod(vh, vg) / trG)
}
return(pr2)
} | 0 |
649f2a4dd88c9b39ffb03ab866920eab | 6c557bcb0c1413fdb4ad34905502dfad | Makes a HTTP POST request to the given templated link relation on the most recently navigated resource. | {
$targetUri = $this->resolveUri($target);
if (empty($targetUri)) {
throw new LocalizedException(__('Target cannot be null'));
}
$uri = $this->joinURI($this->resolveUri($source), '$links', $collection);
return new Request('POST', $uri, null, ['uri' => $targetUri->... | 1 |
7862cc1a516fc2eda0cd9dd1bf61e36f | 664f57a0eb2ba335c077105c9225b4ee | This method will echo the contents of a Java Bean | Object obj) {
Field[] fields = objClazz.getDeclaredFields();
AccessibleObject.setAccessible(fields, true);
for (int i = 0, max = fields.length; i < max; i++) {
try {
Field f = fields[i];
String name = f.getName();
sb.append(" " + name);
sb.append(" : " + f.getType() + " = ");
Object obj... | 1 |
2d941e4e46e212e3a6eba715e788bc5d | 41f34e6b0a3f52485709ef332a056e0c | Metodo evento click del boton btnConfiguracion | public partial class Indicadores_Crear : System.Web.UI.Page
protected void btnConfiguracion_Click(object sender, EventArgs e)
{
mvPaso.ActiveViewIndex = 3;
} | 1 |
dde9ea014fb24be2106241ebb5846623 | 1d68fe9903977e573e0f2aedd9b69b57 | This causes the car to rotate 180 degrees clockwise | void rotate(){
nxt_motor_set_speed(NXT_PORT_B,60,0);
nxt_motor_set_speed(NXT_PORT_C,-60,0);
return;
} | 0 |
653fbbe30c2603b9b9b9ed45113e8f84 | d895b947fdb28d9e968f0f808881819a | Wyświetla kontrolkę CameraDetails w elemencie CurrentControl.
Dodaje zdarzenie opuszczenia kontrolki CameraDetails. | void SettingsDialog::showCameraItemDetails()
{
SourceSettings source = configuringSources.at(ui->lwSources->currentRow());
ui->leTitle->setText(source.name);
ui->leSourceUrl->setText(source.sourceUrl);
ui->leAudioUrl->setText(source.audioUrl);
ui->pbDeleteCamera->setEnabled(true);
ui->pbSaveCame... | 0 |
788f3b7311869fe10cd2baefbeaf3456 | f40fe19845be65c0b961d9403102b5a3 | Affiche un graphe en colonne ou en barre dans le container idContainer
avec pour titre titre et comme données data | anychart.onDocumentReady(function () {
var chart = anychart.scatter();
chart.line(data);
chart.crosshair(true);
chart.labels(true);
chart.labels().fontColor("#ff0000");
chart.labels().fontSize(10);
chart.xScale().ticks().interval(1);
chart.xAxis().titl... | 0 |
63f8392d732b99e2b29ca25c50e7ff7b | 20414b5707e3b907607e6b875df0199f | 安全责任书的添加 | public class SafeleaderAction extends BaseAction
public String save() throws Exception{
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
safeleader.setSsmc(sdf.format(new Date()));
company=companyService.getCompanyByLoginId(this.getLoginUser().getLoginId());
if ("add".equalsIgnoreCase(this.flag... | 1 |
8064aabff6e32d780884d22256daeb3e | ed8bead0c62317e20301fdf7d7589c39 | Switch statement control-flow graph structure. | {
auto in = MakeBlock("Switch");
auto out = MakeBlock("EndSwitch");
in->AddSucc(*out, "default");
PushBB(in);
{
Visit(ast->expr);
auto var = Var();
in->MakeInst<TACSwitchInst>(var);
PopVar();
}
PopBB();
PushBreakBB(out);
{
for (auto& switchCase... | 1 |
3d7c75fe2a7e5531c6e88f724f3cfbf6 | af92768cea52a42ada715a68383f541f | Returns the stylist API styling url | if ( !empty($url) ) {
$url .= ',';
}
if (function_exists('onemozilla_get_theme_options')) {
$options = onemozilla_get_theme_options();
}
if ($options['color_scheme']) {
$url .= trailingslashit( get_template_directory_uri() ) . 'colors/'.$options['color_scheme'].'/'.$options['color_scheme'].'-ed... | 1 |
c7b566b5bef20c6c539233c4b8f5c8bb | ec70e8ff86864c004da1f1f16ea46680 | Generates a JSONSchema from the given element. | def _json2markdown(jsonelement, elementname, jsonparent, parentpath, indenttabs=0):
md = ""
elementtype = jsonelement.get("type", "")
if elementtype == "" and "$ref" in jsonelement.keys():
elementtype = "[{}](#{})".format(jsonelement.get("$ref"), jsonelement.get("$ref").split("/")[-1])
indent = ... | 0 |
f53dc926c07003a5e22f7cae6aba0a53 | bdc60d2eb939ba0963f721039d1ea58f | Redirect the user to the ESGF SLCS Server for authorisation. | public void authoriseAccess(); | 0 |
0153af18f549239dc41e274e991d7f4b | 1e74b121da69a0b467a5fb47cb032091 | Output only. The time when the lake was created. | class Bucket(pulumi.CustomResource):
def time_created(self) -> pulumi.Output[str]:
return pulumi.get(self, "time_created") | 1 |
41fe27540eb7cb5b14574dd9437214cb | 21a8ba3471b9bca841f038597e1985f5 | Sets the value of queryExpression attribute. See {@link #getQueryExpression}
for description on the attribute. | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType")
@JsonTypeName("FacetResult")
@Fluent
public final class FacetResult extends Facet
@Override
public FacetResult withExpression(String expression) {
super.withExpression(expression);
return this;
... | 0 |
2ae6bc2c7b7b29ce1344ce4f15445672 | a695329b0df893973afacc15a76c6894 | 获取指定公司的 Office 号 | public class ProductStructure
public SimpleLongProperty getOfficeId() {
try{
JSONObject jsonoffice = new JSONObject((office.get().toString()));
return new SimpleLongProperty(jsonoffice.getLong("id"));
}
catch(JSONException e){
return new SimpleLongProperty(-1L... | 1 |
6fc5fb75f2ebf4e235785b9b9342239f | 5dc6401121cfb6fec12c1f272f7829a4 | @brief Get Forwarding mode to Analyzer for egress/ingress mirroring.
All register addresses are hard coded
Based on cpssDxChMirrorToAnalyzerForwardingModeGet | (
IN GT_UINTPTR inArgs[CMD_MAX_ARGS],
IN GT_UINTPTR inFields[CMD_MAX_FIELDS],
IN GT_32 numFields,
OUT GT_8 outArgs[CMD_MAX_BUFFER]
)
{
GT_STATUS result;
GT_U8 dev;
CPSS_DP_LEVEL_ENT analyzerDp;
GT_U8 analyzerTc;
if(!inArgs || !outArgs)
return CMD_A... | 0 |
c04ec33a293ebd1e13e53a81e796c4d3 | 3854dac7c923f74f681607fc3e0b9571 | gets the list of current supervisors to populate a select menu (assigning a supervisor to an employee)
and sets up the configuration for cloudinary upload | export class FavoritesPage implements OnInit
ngOnInit() {
this.getListSupervise(1);
} | 0 |
d17576d69e4dacf081e74b36553d7a23 | 635b0272a766b17a0c45a2151afbeb36 | Find the motif with the best score for a given TF and region, allow regions that have been used to be used again (might be multiple sequence differences for a single region) | if len(sequence) > len(adapter) :
a, b = adapter, sequence
else:
a, b = sequence, adapter
assert len(b) >= len(a)
la = len(a)
lb = len(b)
bestm = 0
bestr = 0
besto = 0
for i in range(-len(a), len(b)):
(m,r) = ip(a, b, i )
c = float(m)/float(r)
if m > bestm an... | 0 |
3e1c09f92c965a235241966cab5768eb | 1ed980f1d045da911530d71d64a21665 | @brief Sets GPIO pins as inputs or outputs | {
if(config->direction == KGPIO_Digital_InpUt)
{
base->GDIR &= ~(1 << pin);
}
else
{
base->GDIR |= (1 << pin);
gpio_pin_write(base , pin , config->outputLogic);
}
gpio_int_config(base , pin , config->interruptmode);
} | 1 |
d4a125e97dfecd36250517345e7f03fd | 18e8b16e504b0ab96cf664b526425a0d | @brief computes the squared distance between a point and the box | float CBox::GetDistanceSq(const CVec3& point) const
{
CVec3 near = point;
near = near.Max(min);
near = near.Min(max);
return near.GetDistanceSq(point);
} | 1 |
d609bbf1d78ebe99dc49e1d61745d055 | e0bb2d92e881b5e2186f01a3f15e816d | <p> 向服务端上报'设备需授权'事件 | Map<String, Object> node = new HashMap<>();
node.put("device_send_time", System.currentTimeMillis());
DeviceEvent deviceEvent = new DeviceEvent();
deviceEvent.setEventType("time_sync_request");
deviceEvent.setParas(node);
deviceEvent.setServiceId("$time_sync");
de... | 0 |
e53ae932465ec23dbc7fd43d0c5f6e90 | 0c053f8558407ed3308edac0eaa97fae | Returns the proper idexes form squares that are not filled. If all
are filled return []. | var out = [];
var notFilled = false;
for (var c=0; c < 20; ++c) {
notFilled = false;
for (var r=0; r < 10; ++r) {
if ( !(GRID[r][c].status) )
notFilled = true;
}
if (!notFilled)
out.push(c);
}
return out;
} | 0 |
064cafca7bf6e56a54d7494af927a2f5 | d4862d1bcb07c5090d77ae47712024b5 | 将三维的点映射到平面,并添加了位移 | void DataProcess::mapTo3D()
{
for(int i =0;i<3; i++)
{
keyPoints3D[i].x=(keyPoints[0][i].x-cx)*T/(keyPoints[0][i].x-keyPoints[1][i].x);
keyPoints3D[i].y= -(keyPoints[0][i].y - cy)*T / (keyPoints[0][i].x - keyPoints[1][i].x);
keyPoints3D[i].z = f*T / (keyPoints[0][i].x - keyPoints[1][i].x... | 0 |
efc1d23f6b4841e26ce3740cde32f8af | 19447a1103da9966b85b504725ee6f1a | use numerial method to calculate the trajectory and range of cannon shell
in different firing angle and time step | interval = 0.01
g = - 9.81
rho = 1.225
area = 0.00138
theta_rad = numpy.radians(theta_deg)
s_x = 0
s_y = 0
v_x = u * numpy.cos(theta_rad)
v_y = u * numpy.sin(theta_rad)
m = 0.045
a_x = forceDrag(rho, v_x, C_D, area)/m
a_y = (forceDrag(rho, v_y, C_D, area) )/m +g
x_arr... | 1 |
1ae6799d4c81be5c9589c1904fdbb76a | d8da85085d4d99631ac35e58a79e9899 | get q value for existing game state, otherwise add state to table | class BlackjackAI():
def get_q_value(self,state, action):
Tstate=tuple([state])
if (Tstate, action) in self.q:
return self.q[(Tstate,action)]
else:
return 0 | 0 |
e898ee5c3f6c2b8a0f4e71dbd8c7eeaf | c43fece9c92a9a6b03decb1a17ce8000 | API to Get User Vaccination | class vaccinationController extends Controller
public function index()
{
$vaccination = vaccination::all();
return response()->json($vaccination);
} | 0 |
1e3e898c4b1da0cfad7a9217a79f89f4 | f48c3131f6f67361cf1c0875db2dab9f | UnFollow an artist with it's unique Id by an authorized user | namespace Lib.SpotifyAPI.Web
public sealed class SpotifyWebAPI : IDisposable
public ErrorResponse Unfollow(FollowType followType, List<string> ids)
{
JObject ob = new JObject
{
{"ids", new JArray(ids)}
};
return UploadData<ErrorResponse>(_build... | 1 |
5c16f7d185612c70937d269fd26d2eee | 7f00385d070328bf3f99b344cd0489b7 | Liest einen Integer aus der Konsole aus | public class ProjectUtils
public static int readInteger(){
return input.nextInt();
} | 1 |
9fefa007f75aabbf0ac0711e4cc85d39 | 818e213d9a73e5a1b8e7520e79a5e81d | Calculate the direction the user scrolled, and then
switch the video to the next video or previous. | d = evt.angleDelta().y()
if d < 0:
self.next_page(evt)
elif d > 0:
self.pre_page(evt)
return | 1 |
3566f23ec667ac785e137339556511f8 | 9fdcec22f864b39061b828405257bf96 | Set queue index to device | bool vp_notify(struct virtqueue *vq)
{
iowrite16(vq->index, (void __iomem *)vq->priv);
return true;
} | 1 |
924ffb066afa6cc667db9fb12ebfc4df | 66bc90a27905c38132ba9944f9c0bf2d | Read the VCAP_SERVICES env variable & extract the "demo-certificate" value | cf_env = AppEnv()
credhub_env = cf_env.get_service(label="credhub").get_url("demo-certificate")
credhub_env = eval(unquote(credhub_env))
return credhub_env | 1 |
5458575060279d701a434a399da08e78 | 13dbe34fb7dadcfc5ba75db44a28ac2c | naive implementation which adds the vector representation of all the words together and then divides by the square root of the dot product | s=0.0
tokens = nlp(vec)
Norm = len(tokens)
if(Norm!=0):
for word1 in tokens:
for word2 in tokens:
if(word1.has_vector==True and word2.has_vector == True):
s+= word1.similarity(word2)
s/=Norm**2
return s | 0 |
3beec846e724d686ab07d6568d878fcc | b1405bc8363db4853f04a73dfc59abe2 | Shows the 404 not found page | class ErrorController extends Zend_Controller_Action
private function _show404Page()
{
$this->getResponse()->setHttpResponseCode(404);
$this->render('404');
} | 1 |
26b7b3d0e572b697f2f5074cae2534b0 | 37d033a3c292928f73c81517365c3a2e | Returns whether or not the iterator has wrapped since the last time this
method was called. | class AreaLayoutIterator implements \Iterator
public function hasWrap()
{
return is_array( $this->wrap );
} | 0 |
2437f265d72b91f9b1b4838367d70f1a | dd71411c7cde18ad345abcea0cec320d | Establishes the buffer read size for chunks that are read from the input buffer. | public class ReadableChunkedChannel extends ReadableBufferedChannel
protected void setRemainingChunkSize(int remainingChunkSize) {
this.remainingChunkSize = remainingChunkSize;
} | 1 |
63dfc247043d3ab9d2a0b9d8f0d14dd1 | bcefdae82f77c89035ae64cbe7ef4340 | Executes a SQL statement against the connection object and returns the number of rows affected | namespace PFSQLAnywhereObjects
public class PFSQLAnywhere : IDatabaseProvider, IDesktopDatabaseProvider
public int RunNonQuery(string sqlText, CommandType pCommandType)
{
int numRowsAffected = -1;
SACommand cmd = new SACommand(sqlText, _conn);
cmd.CommandTimeout = _comman... | 1 |
59f430ab4e9237d16d8b40349a400a03 | 557c29b4695fcbce710c91b16379eeb5 | 标准乘法 | void standardMultiplication(float **first,float **second,int dimension){
int i,j,k;
float sum;
float sp[dimension][dimension];
for(i=0;i<dimension;i++){
for(j=0;j<dimension;j++){
sum = 0;
for(k=0;k<dimension;k++){
sum = sum + first[i][k] * second[k][j];
}
sp[i][j] = sum;
}
}
for(i=0;i<dimension... | 1 |
c8cd67b4bf490a7db9183395f5d779e9 | 07a03b433a1dff6ad3538073008edf9d | 이긴횟수, 진횟수, 비긴횟수, 승률을 출력하는 함수 | for i in range(10) :
a = medals[i][1] + medals[i][2] + medals[i][3]
if i == 2 :
print(str(medals[i][0])+" "+ "\t" + str(a) + str((medals[i][1], medals[i][2], medals[i][3])))
else :
print(str(medals[i][0])+" "+ "\t" + str(a) + str((medals[i][1], medals[i][2],... | 0 |
07a4d41ef86c465ebf5be6e7dd6754f6 | 1d948af3545024420b439193d3dc4585 | Recupere la ligne de la matrice d'adjacence de x | class TreeClass
inline int getEdgeIndex(int x, int y)
{
assert(next[x].find(y) != next[x].end());
return next[x][y];
} | 0 |
47219b2441386d8465efea174882e1e2 | 85b91f4cb7cf640152de49386b37b605 | 提交poi信息 | String poiName=poi_txt.getText().toString();
Bundle bundle=new Bundle();
bundle.putString("poi_name", poiName);
if("3dmap".equals(eventActivity.search_map_type)){
Building building=buildingManager.getBuildingByName(poiName);
bundle.putParcelable("building", building);
}else{
Poi poi=poiManager.getPoi... | 1 |
fe6c0d7f4e7d48b97e40438c95e62e6c | 888602a7db1280136ee7aff9490d5499 | 清空房间中所有玩家的麻将数据 | class WarMgr(object):
def clear_player_data(self, pid):
self.room_mgr.clear_player_data(pid) | 0 |
90059b6b51dcec75fe1fef9ad3baa37f | ae1916abf5057c7bde5a350d485ff82f | method for getting access token using .env config and the utility method get_access_token_client_creds (Promise) | class MercadoPago
def get_access_token()
appClientValues = {
'grant_type' => 'client_credentials',
'client_id' => @client_id,
'client_secret' => @client_secret
}
@access_data = @restClient.post("/oauth/token", build_query(appClientValues) , @restClient.MIME_FORM)
if @access_data['status'] == "20... | 0 |
c7ee7d73a5490bacb4a9b6b33fa4b99a | bac63c1c29db975595004a1ac5300d1d | 容器启动后马上执行,且每1秒执行1次 | func run1Second() {
spec := "*/1, *, *, *, *, *"
c := cron.New(cron.WithSeconds())
c.AddFunc(spec, func() {
fmt.Println("===", time.Now().Format(time.RFC3339))
})
c.Start()
} | 1 |
e7284aa0872cc771db1663fb91f2a85f | 6361e95fb0d63e74a31a2ed1a7e00277 | Поиск сотрудников конркетного подразделения | namespace Controllers
public abstract class MinistryBase
protected BindingList<BaseWorker> GetWorkersOfDepartment(string pathToDepartment)
{
string NameDepartment = NameOfCurrentDepartment(pathToDepartment);
int numberDepartments = SearchNumber(NameDepartment);
if (number... | 1 |
c2e5c791935e86e268121cbf0e90a9b5 | f6050d6ea730adfb874bab2ffd8004ac | Configure sb via its constructor and via its properties | public class TestSolrAuthzBinding
@Test
public void testSolrAuthzConfs() throws Exception {
SolrAuthzConf solrAuthzConf =
new SolrAuthzConf(Resources.getResource("sentry-site.xml"));
setUsableAuthzConf(solrAuthzConf);
new SolrAuthzBinding(solrAuthzConf);
} | 0 |
b907b40ebe348540e91916341faa7ef0 | 2784e2988b653c50cbe738078df7eb43 | Create a new register composer. | class LayoutComposer
public function __construct(User $users)
{
$this->users = $users;
} | 0 |
ce6a0c010c7e70064ff0ec3b7aa33931 | 5ebc16f07b4e11779c561c82ed8cd6ea | 將字型大小設定為16 | class SizeText
setFontStyle() {
if (this.imageWidth <= 60) {
this.fontType = Jimp.FONT_SANS_8_BLACK;
this.fontSize = 8;
} else {
this.fontType = Jimp.FONT_SANS_16_BLACK;
this.fontSize = 16;
}
} | 1 |
93b9245e5f018bf91c2440a80997050c | 40db7974239e605459c365bb1e0cd32d | Emit the code to close the try/catch block. | def end_try_block(typingctx):
def codegen(context, builder, signature, args):
nrt = context.nrt
nrt.eh_end_try(builder)
return context.get_dummy_value() | 1 |
439f0e67a7a49954366f35a1cb5b8e5a | f8218916ef3038dde8f8af638ccce427 | 현재 listview에서 확인하지 않은 아이템이 5개 이하가되면 다음 목록을 준비해둘 수 있도록 합니다. | public void onScrollStateChanged(AbsListView view, int scrollState) {
if (!isLoading && lastItem == totalItemCount && scrollState == SCROLL_STATE_IDLE) {
isLoading = true;
getListRaw(true);
Log.i(TAG, "(onScrollStateChanged) getlistraw: went");
}
} | 0 |
2a056013b913a96f0b9dfac8cb0348f0 | 0f372e88de3ad7b3737dc9c213d19976 | 初始化时将面板取消激活 | public class DomeScreens : MonoBehaviour
private void Awake()
{
PanDial.gameObject.SetActive(false);
} | 1 |
9acc9c4b525acf2efa37225cd3d0c087 | f140c0bd1a86ef8bae0b916161b00882 | Report an excepetion that was not expected | class FakeSender:
def expectError(self):
self.expectedErrors += 1 | 0 |
e801d7258bac936f441fc26b43635a34 | ee028af90a0cc7595d3157cfab4a23c8 | Log a FINEST message.
If the logger is currently enabled for the FINEST message level
then the given message is forwarded to all the registered
output Handler objects.
Typically, this method is invoked from a macro where __FILE__,
__LINE__, __DATE__, __TIME__ macros are automatically added
to the function call. | namespace java.util.logging
public class Logger
public virtual void Fine(Supplier<String> msgSupplier)
{
Log(Level.FINE, msgSupplier);
} | 0 |
9b94b86ebbfd64f52a7ec7f399b41ae9 | a26efd3f01be860a3414acc762a8a5b6 | 1从XML中读取要采集的站点配置信息 | try {
File f = new File(XMLPATH);
org.dom4j.io.SAXReader reader = new org.dom4j.io.SAXReader();
org.dom4j.Document doc = reader.read(f);
org.dom4j.Element root = doc.getRootElement();
org.dom4j.Element foo;
for (Iterator<?> i = root.... | 1 |
745ba41d3737dbf9c7d9902e11e4e6eb | 15ac62a5cf88e1fec64b52ffb8baf769 | @brief Writes to an ADXL362 Register. | bool_t adxl345_write_register( uint8_t reg_add , uint8_t reg_value)
{
UCB2I2CSA = ADXL345_ADDRESS;
while( UCB2CTL1 & UCTXSTP );
UCB2CTL1 |= UCTR;
UCB2CTL1 |= UCTXSTT;
UCB2TXBUF = reg_add;
while(!(UCB2IFG & UCTXIFG))
{
if( UCB2IFG & UCNACKIF... | 0 |
593e0172f0798cc2dcc02d8f07e77983 | 28ea2ae43644044f5183d626fc910d1b | 获取指定时间前n个小时的时间 | Calendar ca = Calendar.getInstance();
ca.set(Calendar.MINUTE, 0);
ca.set(Calendar.SECOND, 0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
ca.set(Calendar.HOUR_OF_DAY, ca.get(Calendar.HOUR_OF_DAY) - n);
date = ca.getTime();
return sdf.format(date);
} | 1 |
cc411bd73b6971431d4dcadedc7ef720 | c6298ec1fd6fcecccb8dd37e989a251b | Register an one time handler of a specific event | export class EventsManager
once(eventName: string, handler: Function, target: Object = null) {
return this.register(eventName, handler, true, target);
} | 1 |
0e6ada0296625217fefa00bfec9ae443 | abbc4f1fbbcf59119122d9b6907f78ef | 设置磁盘缓存地址是否在外部存储中,默认false | public abstract class AbstractConcurrentReadCache extends AbstractMap implements Map, Cloneable, Serializable
public void setUnlimitedDiskCache(boolean unlimitedDiskCache) {
this.unlimitedDiskCache = unlimitedDiskCache;
} | 0 |
01292e52ddc33d52a712c2e20a1b442e | 20333f75b3465123e6f9f20bc88ae3f9 | if stack has a selected child,
the new added one should be excluded/hide but not selected. | testAddAndDontSelectChildInADynamicStack() {
this.__stack.setDynamic(false);
this.__stack.add(this.__c1);
this.__stack.add(this.__c2);
this.assertIdentical(this.__c1, this.__stack.getSelection()[0]);
this.assertTrue(this.__c2.isHidden());
} | 1 |
8ab7fc81700c4e9fe87781959a487879 | 98338598e518a42dd704f92699b1b4af | Submits otb_lsms.py to scheduler. | class Workspace:
def submit(self, **kwargs):
return sasoptpy.util.submit(self, **kwargs) | 0 |
264d3f9e9d091cf8372947c2c922bfca | afd0df16de401f4fd401ee04cb7650c3 | Retorna a quantidade de itens que serão exibidos | public class ExercicioEtapaAdapter extends RecyclerView.Adapter<ExercicioEtapaAdapter.ExercicioEtapaViewHolder>
@Override
public int getItemCount() {
return exercicioEtapas.size();
} | 1 |
27e9eebc8bdf8d80d0f3a5cdc92804f8 | 597e5a52901345a55ae8be0c35171844 | 统计各时间段的数据量 | public List<CommonVo> dateHistogramAgg(String interval); | 1 |
54e13c7c6bee2a2bb45fba9808c11329 | f5b7bae1f33574fd659c4c17e4326cb7 | the function fills the combo box that list all the available DAQ devices | {
QVector<DEVInfo> devInfo(pcap->findAllDev());
while(ui->ComboBoxAdapter->count() > 0){
ui->ComboBoxAdapter->removeItem(0);
}
for(int i = 0; i < devInfo.length(); ++i){
QPixmap icon = style()->standardPixmap(QStyle::SP_DriveNetIcon);
ui->ComboBoxAdapter->addItem(icon,devInfo.at... | 1 |
c2cfdd2e64ee50a6ad3f0f2b83d0ba3a | 20e0dd61cd3fcc62afae34bb4ef52a8c | Generate a consolidate report of regression comparison for multiple models. | def summarize_comparison(save_dir):
sim_outerdir = r"C:\Users\Ginger\Dropbox\NatCap_backup\Forage_model\Forage_model\Verification_calculations\OPC_integrated_test\empirical_stocking_density"
emp_list = [r"C:\Users\Ginger\Dropbox\NatCap_backup\Forage_model\Data\Kenya\From_Sharon\Processed_by_Ginger\OPC_veg_9.30.... | 1 |
0de1ae8f11670a3734efeca10220ad56 | 3f547ee5321d5014a19fb71e6a114f20 | Sync over a single resource from Neutron to OpenDaylight.
Handle syncing a single operation over to OpenDaylight, and correctly
filter attributes out which are not required for the requisite
operation (create or update) being handled. | def update(openstack_resource, args):
args = reset_dict_empty_keys(args)
openstack_resource.update(args) | 0 |
db408bb21c297331f74f226a567d3cb8 | c302e051dd1ed64e2b3448d35a05d51f | Get the Docker data root | def get_data_root():
res = info("{{.DockerRootDir}}")
fish.handle(res)
return res["stdout"] | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.