query_id string | corpus_id string | query string | code string | label int64 |
|---|---|---|---|---|
1036b356c192fbc0784951fb4758ae30 | 604fe4e6e539b6c6da3a6b2e77aced8a | Assign an application user to a Kandy user | $primaryAppApplicant = $application->primaryAppApplicant;
$coAppApplicant = $application->coAppApplicant;
$primaryAdvisor = $application->primaryAdvisor;
$primarySupernova = $application->primarySupernova;
$appUserModel = new self;
$appUserModel->id_application = $applica... | 0 |
87422026bf97ad1df5c2d297599f4d75 | a62aca280c68616565ea86cbace972e0 | load user_data (persistence for attributes, rooms, devices and scenes) | class RecorderBot:
def load_user_data(self, user_id):
user_history_path = self.path + 'user_' + user_id + '.json'
if os.path.isfile(user_history_path):
with open(user_history_path) as hist_file:
user_context = json.load(hist_file)
return user_context | 1 |
b9b4145419904888ca6e8f81a54f1a74 | 6569555205a53188977ef85c6e8cac58 | Removes modal result. | {
$( '.modal-backdrop' ).remove();
$( '#' + this._options.id ).hide().removeClass( 'in' );
} | 1 |
c098957886fd5e38bccd57c1fe9f0b4b | f58463a97f3b0b0b363719c677aea0fb | Zeitraum umfaßt nur einen Tag | int TagAusDatum(int datum)
{
int tag = datum / 1000000;
int maxTag = TageImMonat(MonatAusDatum(datum), JahrAusDatum(datum));
if ((tag < 1) || (tag > maxTag)) {
throw InvalidDate("Jahr ist ungültig", tag);
}
return tag;
} | 0 |
9f3e7dd0bb5ee0a897886fb411f11d40 | 480c600a5d4cdb6d4023e0e122aa432f | Static method to reverse the elements in the input integer array. | public class ArrayOperations
static int[] reverseArray(int[] a) {
int[] b = new int[a.length];
IntStream.iterate(a.length - 1, i -> i >= 0, i -> i - 1)
.forEach(i -> b[a.length - 1 - i] = a[i]);
return b;
} | 1 |
4e7b5c4b33391ffa7b80fbcc087af964 | ec7ea9268e004b1c576b041af091cd64 | Updates tender line with amounts and exchange rates for company and channel currencies. | {
try
{
CompanyGroup.Domain.Utils.Check.Require((lineId > 0), "The lineId parameter cannot be null!");
CompanyGroup.Domain.Utils.Check.Require((quantity > 0), "The quantity parameter cannot be null!");
NHibernate.IQuery query = WebInterface... | 0 |
5a846526be44e70fec26f6df9c3b89bf | 3a92578e50822111a33e5d5a70b1e444 | Get config filename from namespace | {
namespace fs = boost::filesystem;
fs::path pathConfigFile(GetArg("-conf", "nexus.conf"));
if (!pathConfigFile.is_complete()) pathConfigFile = GetDataDir(false) / pathConfigFile;
return pathConfigFile;
} | 1 |
ff93d1f0e497c43e85f14ac333b79c86 | a3f53798c577ee2325b1dee986dea6b2 | Calculate the normalized Root Mean Squared Error of the measured and
estimated modulous. | class GroupMetrics(object):
def rmse(self, result, ground_truth):
rmserr = np.linalg.norm(result - ground_truth)
return rmserr | 0 |
ccd50a5e7a529d1ec3c82c157283b6ce | de524083612abb130fc397ed4bf51aa7 | Extracts one record from a Firebase snapshot. | var returnArr = [];
snapshot.forEach(function (childSnapshot) {
var item = childSnapshot.val();
item.key = childSnapshot.key;
returnArr.push(item);
});
return returnArr;
} | 0 |
5a21c04842c3414d0ce4211f0bd7c470 | 7637a7a9481dd5f27e8eb00e62fc9756 | Reads the next masked line of characters from the standard input stream | namespace ConsoleAbstractions
string ReadLine(bool mask = false); | 1 |
f3a8393b674b294311937f9f436c2ab1 | d681451cf84a3b98b4b021fcb98a8324 | 순차 레이어의 역전파를 수행하는 함수이다. | def layer_backward(dA, cache, W, b, activation):
lin_cache = cache["lin_cache"]
act_cache = cache["act_cache"]
if activation == "sigmoid":
dZ = sigmoid_der(dA, act_cache)
elif activation == "tanh":
dZ = tanh_der(dA, act_cache)
elif activation == "linear":
dZ = linear_der(... | 1 |
c56c49c18584d87062a78e0780ca689a | 118452ac73668d014778d11fb595f4dd | Filter terms by active language in backend. | class FW_Extension_Translate_Menus extends FW_Extension
public function add_admin_filters() {
add_filter( 'terms_clauses', array( $this, 'change_terms_query' ) );
add_filter( 'parse_query', array( $this, 'filter_query_by_active_language' ) );
} | 1 |
7d990ea12b1f4f3377c44605b2fa95e7 | 9da4cb4a3648a0e790ca4e7305df4a6c | Update a Comment by Ajax | {
$text = Yii::$app->request->post('text');
$postId = Yii::$app->request->post('postId');
$commentId = Yii::$app->request->post('commentId');
$post = $this->findPostById($postId);
$comment = $this->findCommentById($commentId);
$currentUser = Yii::$app->user->identity;... | 1 |
081cce3bb03ee2d77e4ba48eecbe4f7a | 59c003c7ae1c83168d464a6ff0f1b539 | Sets the passport validation required. | public void setPassportValidationRequired(boolean passportValidationRequired); | 1 |
1a6997d645a28d2b39f8fff867097e8e | 8a27ed8fc630e52b73cc2e7cadccd831 | Verifies that <see cref = "Assert2.ContainsKeyAndValue{TKey,TValue}" /> throws the
correct exception when the expected key is missing. | {
return actual.RegisterNotNullAssertion(c =>
{
actual.ShouldBeA<KeyedCollection<TKey, TItem>>(message);
if (!actual.Contains(expectedKey))
throw c.StandardError.DoesNotContain(expectedKey, actual, "key", message);
});
} | 1 |
130400d421635ba06e7f2ef35e551467 | 5bc6ee8da7e4cbc051b2e8c023b94e0a | 根据tagIds获取用户的关注话题. | class PW_Weibo_TopicAttentionsDB extends BaseDB{
function getAttentionedTopicByTopicIds($topicIds,$userid) {
if(!$userid && !S::isArray($topicIds)) return array();
$query = $this->_db->query('SELECT userid,topicid FROM ' . $this->_tableName . ' WHERE userid = ' . $this->_addSlashes($userid) . ' AND topicid IN (' .... | 1 |
3cbecafb1ad600622c384300f7815c8f | 04293617419b3693690a6df4b291dfd5 | 코드관리의 정보를 불러와서 배열로 바꾸어 리턴한다. | Class Code
public function getAllCodes($pdo) {
$result = $pdo->query('strun_code_type');
$listAll = $result->fetchAll(PDO::FETCH_ASSOC);
$resultList = array();
foreach($listAll as $key => $value) {
$temp = array();
foreach($value as $subKey => $subValue) {
$trans_subk... | 1 |
a9f42b2bf7b4de0eeba7e67c0eb139fc | c626507b2e7310a09960f5ddf59762aa | 创建日志记录器,指明日志保存的路径、每个日志文件的最大大小、保存的日志文件个数上限 | func NewLogger(level int, logPath string, logFile string) *ELog {
mkLogDir(logPath)
file := logPath + "/" + logFile
writer, err := os.OpenFile(file, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0777)
if err != nil {
panic("open log file error")
}
infoLog := log.New(writer, "[info]", log.Ldate|log.Ltime)
warnLog := log... | 0 |
528d7da72a0d319bb5b011177baee701 | 80a51aab384509d81415fa5f07a5aba2 | 返回一个账户下未过期的所有游戏 | class AccountHistoryManager implements IAccountHistoryApi
@Override
public List<AccountHistoryInfo> getCurrentGameAuthHistories() {
String currentGameID = ApiFacade.getInstance().getCurrentGameID();
List<AccountHistoryInfo> histories = new ArrayList<>();
for (AccountHistoryInfo info : cache.... | 0 |
eb271cdfe53c95315030f83a276f8119 | 260ecf757741a450e9277446afe39f07 | Get edges which connect to vertex | vector<Edge*> GraphUtils::getIncidentEdges(const class Graph& TheGraph, unsigned int vertex_val) {
vector <Edge*> temp;
#ifdef DEBUG_G
printf("GraphUtils::getIncidentEdges:...\n");
for(int ii=0;ii<TheGraph.m_NumVertices;ii++){
for(int jj=0;jj<TheGraph.m_NumVertices;jj++)
cout<< TheGraph.m_Matrix[ii][jj]<... | 1 |
16b8c62d34f18cb9d3577029b2ba2ee9 | 73041ff4948f5eb22cd2725144fa94fb | Retrieve multiple options from the storage by key.
Items not found in the option will have a null value. | public function getMany($keys); | 1 |
b8e266979463ff4b0c5e608c4c4cebfa | de9cf267d05eece7b7421f77eb9aea43 | ESTABLECE IDENTIFICATIVO UNICO DE REGISTRO DEL HISTORIAL DE ACUERDO | public class Cgg_jur_historial_acuerdo implements Serializable{
public void setCJHAC_RESPONSABLE(String inCjhac_responsable){
this.myCjhac_responsable = inCjhac_responsable;
} | 0 |
a5297b9c282fe5b1afba5928e4adffac | 5c77bdd2a8df5471631708f0003053c2 | 查看所有帖子接口get
v11/form-threads?access-token={cid}
可添加参数筛选/v11/form-threads?access-token={cid}
url可选拼接参数:&sex=0 男生发帖 ,&sex=1 女生发帖 $sex=3则为全部帖子,
&follow=1&user_id={user_id} 关注人的帖子,
&tag={tag} 所有该标签的帖子,
&people={user_id} 该会员发布的所有帖子,
&sort=1 最热帖子排序
若access-token不存在或错误则返回如下
{
} | global $timestamp;
$order = strtoupper($order);
$order !== 'DESC' && $order = 'ASC';
$posts = array();
$sqlWhere = '';
$fid && $sqlWhere .= " AND t.fid IN ($fid) AND t1.judge = 0";
$sqlWhere .= " AND t1.endtime >= $timestamp AND t.ifcheck = 1 AND t.fid != 0 ";
$blackListedTids = $this->_getBlackListedT... | 0 |
e088cac1c75a5af736312ea1bfe39c70 | 1bc86a877c7cb560cb6de6991f301f6c | 随机添加粒子 | export class ParticleSystem extends ISystem
public play(pos: cc.Vec2, pet?: string): void {
let ang: number = 0;
let dir: cc.Vec2 = cc.v2();
let sp: number = 0;
for (let i = 0; i < this.mCount; i++) {
ang = this.mDirList[this.mIndex];
ang += (Math.random() - .5) *... | 1 |
5602da0bc7ed9d433cb883a60f31582d | 0f32d552a6d4ec10b928580fc44c38fe | Creates a popup menu and its related internal structure for the songs
table | myfont = pg.font.SysFont("monospace", 15)
window_args = {"text": "Songs You Can Play",
"font": FONT,
"text_color": (255, 255, 255)}
win = movewindow.MoveWindow(Subrect((50, 50, 200, 300)), **window_args)
bar_subrect = Subrect((25, 45, 150, 23... | 1 |
fb3c89b47f383261bb1407ceef52054d | 61351f36a0459e50b06f4f70739a37eb | Remove tags from payment | {
Schema::table('payment_tranches', function (Blueprint $table) {
$table->dropColumn(['vat_percentage', 'vat', 'total_amount', 'paid_on']);
});
} | 0 |
3b39b0580cc53f7c0af0da5cc93a5c47 | 12f401af9732a7ed5867fceb3cb5191a | Return whether the savefile directory was at all readable. | def isDirReadable(dirToTest):
return os.access(dirToTest, os.R_OK) | 1 |
239b3667ef8894689248448100e83247 | b2cb64c4f28be868c571f7f8b54f1a74 | Submit a new skein application. | public function submitApplication(Array $data = []); | 1 |
085c6514f1886fe5f2e9178fee0dcd91 | 1dbeec9c5d04a20316a1b1ff91bcfda8 | 锁定金额 | {
$balance = $this->db->get_where("balance", array("uid" => $uid))->row();
if($balance)
return $balance->locked;
else
return "0.00";
} | 0 |
65b7fba4c9861b8db57778934fe1d71b | 917f038df8f87e30ca8311e8bf4b0c35 | Função que retorna dados da máquina conforme código | class PartidasModel extends CI_Model
public function codigo($cod) {
$query = $this->db->where("{$this->primaryKey} = {$cod}")->get($this->table)->result_array();
if ($query)
return $this->setAtributos($query[0]);
} | 1 |
369396c5e6de2f8be90ea3bf3fb2b054 | c314026fcc90fc163b356581d23043a5 | Esc to quit | void
Esc_f(CONSOLE *c)
{
text_cursor_off(c);
return;
} | 0 |
67f585a30ac0c957a47815365a67aaca | 060c64040f77b5dced01862606478ff7 | Get all addresses in the subnet. This method is ordered. | log.debug(
"fullIpList: using ipaddr IPNetwork on %s (%s)",
self.id,
ipunwrap(self.id),
)
net = IPNetwork(ipunwrap(self.id))
if self.netmask == net.max_prefixlen:
return [ipunwrap(self.id)]
ipnumb = long(int(net))
maxip = ma... | 1 |
481aa328ac0cdec1980753505a53279e | 7ec3c6adc9d51b32ce03b10e5977b2c9 | Handles the end of the reload phase when there are no more weapon reloadable or the player has decided to not reload anymore. | public class InteractiveWeapon : MonoBehaviour
public void EndReload()
{
UpdateHud();
} | 1 |
884eeedbf78a9021ad50193328f223dd | 0be58e698f146064276ea2466923bfd2 | Function to export the account records in CSV Format
Returns Export Accounts Query. | data = self.browse(cr,uid,ids,context)[0]
context = self.check_sandbox(data.url, context)
con = self.login_salesforce(data.username, data.password, data.token, context=context)
return self.pool.get('account.analytic.account').export_to_salesforce(cr, uid, con,data) | 0 |
65c8768755db38fb0f891b898a89dc92 | 4d2ea59e020786367b126c6c42c937e4 | Extract messages from xrc files. | def extract_xrc(fileobj, keywords, comment_tags, options):
tags_having_translatable_text = ["title", "label"]
joined_tags = "|".join(tags_having_translatable_text)
matching_regexp = r"<({0})>(.*)</({0})".format(joined_tags).encode("ascii")
matching_re = re.compile(matching_regexp)
for lineno, line i... | 1 |
ec088476ee59a188917f03c0f6188c7b | 40313cf4a47c9c9fd19950f5a78f179d | Pretty prints percentage uploaded. | def percentage(consumed_bytes, total_bytes):
if total_bytes:
rate = int(100 * (float(consumed_bytes) / float(total_bytes)))
print('\r{0}% '.format(rate))
sys.stdout.flush() | 1 |
f1d6d7916c6b507ad8c170e76bcc1687 | 923d1669fa3e9de576e6443d8b57e4c4 | creates a new element of the given type as an owned element of this
element | namespace Pasta.Finder
V MakeElement(); | 0 |
2e1cd7c3afdf85c66859a6d750af17fb | f537303bace111e6576f1336b9eaa8c5 | 获取指定用户的朋友圈数据 | List<TfeetBO> tfeetBOList = new ArrayList<TfeetBO>();
String responseStr = HttpUtils.getResponseForGet(wrapRESTFulUrl(API_PATH_GET_TFEET_FRIENDS,uid,lastSqid),genAPIHeader());
Tfeet.TFeetList resTfeetList = Tfeet.TFeetList.parseFrom(Base64.decode(responseStr, Base64.DEFAULT));
List<Tfeet... | 1 |
60aa3545abc6885d955494bab8ed4960 | 4dc1f7d06fb15eaa86a6edb57a0838b5 | Gets current options for approximation | multi_approx_opts_get_fc(const struct MultiApproxOpts * fargs, size_t dim)
{
return fargs->aopts[dim]->fc;
} | 1 |
7fa0e72a8af31cb71a75e54f58e6b36a | d554aa7327bbbf499d1c9eff51cd3e8a | Initialize the Castle.Windsor container. | namespace Gulijiang.KFramework.Castle
public static class Bootstrapper
public static void InitializeContainer()
{
if (isLoad == false)
{
IWindsorContainer container = new WindsorContainer(new XmlInterpreter());
CastleIocHelper.Initialize(container);
... | 1 |
82b78401edb54f0de535db3f50258ff6 | 2d35f6b8ed1a64ae79cf8c33f754dae0 | if the user is already logged in, redirect them to the search page | class TestViews(TestCase):
def test_search_logged_out_user(self):
response = self.client.get(self.search_url)
self.assertEquals(response.status_code, 302)
self.assertRedirects(response, "/index/") | 0 |
e5d06ca6599fb5b38ed1af9f2d565bf9 | 99464c2dc19c71a0cc10c7629a85dd23 | Get a SPARC64 regset. | impl ThreadInfoX86
fn getregset(pid: Pid) -> Result<user_regs_struct> {
Self::ptrace_get_data_via_io(
0x4204 as ptrace::RequestType,
Some(NT_Elf::NT_PRSTATUS),
nix::unistd::Pid::from_raw(pid),
)
} | 0 |
5b00dd93bc0c43de2f07668d0400989e | f75a51eafe639f46c09d9e9c91708c4b | Get dateInc. | class ModPontoPessoa
public function setDtaInc($dtaInc)
{
$this->dtaInc = $dtaInc;
return $this;
} | 0 |
7dac517afb245ba92c3c29ac66797d02 | ea28706c7da90f775c0ad6b03cd7365c | grouping by weeks with year | namespace LINQ
internal class Program
private static void GroupOrdersByYear()
{
var customers = DataLoader.LoadCustomers();
var results = from c in customers
select new
{
YearGroups = from o in c.Orders
group... | 0 |
bea92addca9603d66987cfc54eea9d87 | 65014176b90d839b6fbb9b87f73e3831 | Set timeout for CSRF cache token | class GHR extends GHRCore
public function setTimeout($seconds)
{
$this->params[RequestOptions::TIMEOUT] = $seconds;
return $this;
} | 0 |
d802f4af9725a831cf16fe9d882383d1 | a87d6b452191d06afacdbaecf68bfa86 | Checks the influence details. | public class RunicBoard
public void GetPolesInfluence(out float perfection, out float sublimation, out float stability)
{
Hexagon hexPerfection = new Hexagon(_idPerfection / 5, _idPerfection % 5, null);
Hexagon hexSublimation = new Hexagon(_idSublimation / 5, _idSublimation % 5, null);
Hexag... | 1 |
01ac3ad1473af4b7405f8c3801ed2a7a | c6d81bc7ee92c56e6dbde413e42430d9 | Called when view hierarchy is no longer present, no calls to view should be done after this and prior {@link #viewCreated()} | void onDetachView(); | 1 |
25c454d69c1a0694d68e140c78340e7d | 69c2fefd2c3811dbe18c12380e879580 | 根据截面id查询传感器 | @CrossOrigin
@RestController
@Slf4j
@Api(value = "桥梁controller",tags = "桥梁接口")
@RequestMapping("/bridgeConfiguration")
public class BridgeController
@RequestMapping(value = "/bridge/{id}" , method = RequestMethod.GET)
public Result findById(@PathVariable(value = "id") String id){
Bridge bridge = bridgeServi... | 1 |
0096bed2ec27c75c9e2461394a0f9637 | 3bd7423496f1e418c95301172a3103d4 | add the required amount of copies of the n most fittest
to the supplied vector | {
double sum = std::accumulate(population.begin(), population.end(), 0.0, [](double sumSoFar, Chromosome current) {return sumSoFar + current.getFitness(); });
double dist = sum / (POPULATION_SIZE*CROSSOVER_RATE);
double start = randomZeroToOne() * dist;
std::vector<Chromosome> keep;
std::vector<double> fitnessSum(... | 0 |
8e5587ce9ba3cebe3bcaaa115ac73617 | da56650ebc96118f6e574dc1a5289bdc | 获得广告板的纹理坐标(范围) | print('texture name = ', szImage)
local textureCache = cc.Director:getInstance():getTextureCache()
local texure = textureCache:addImage(szImage)
local size = texure:getContentSize()
local rect = cc.rect(0, 0, size.width, size.height)
local id = texure:getName()
local bigWide = texure:getPixelsWide()
local bigHi... | 1 |
61b3c63a63047642ec9b8f48ba03e8da | 3493ad9d345a8f209449b6937dd625ef | Push the arguments to a function onto the local
variable stack. | int i{0};
for (auto ¶m : _params) {
memory::Stack::instance().setLocalVariable(param, fetchArg(i++));
}
} | 1 |
8faad4b02483fdbf9ff7a41942480d8a | cd42a5716c42b9f2e452f1c267482ecb | 更新一个文章的质量评分。 | class ApiController extends \yii\web\Controller
public function actionUpdatedafen()
{
$id = Yii::$app->request->post('id');
$fen = Yii::$app->request->post('fen');
if (!$id || is_null($fen)) {
return ['status' => 'fail', 'message' => '参数错误'];
}
$model = MyWorker::... | 1 |
a27cf670f0d79056c2252a8a0e01b6c8 | e40e79a05101044861afb5e5ecbd72eb | Dodawanie prostokątów | void SkladowaLiniaKsztaltu::DodadjPunkt(const Wspolrzedne point)
{
_punkty.push_back(point);
ObliczSzerokosc();
} | 0 |
083c59218c2e8bdfff34c290834a737c | c4ec50ae4b7b6de6c9982644cd19742e | Method which returns the index of the smallest value. | int smallestIndex = first;
int smallest = a[first];
for (int index = first + 1; index < last; index++) {
if (a[index] < smallest) {
smallestIndex = index;
smallest = a[index];
}
}
return smallestIndex;
} | 1 |
fd7cf5a2669a2e1f0cca80b3aa2157ec | 472095c91bab0b72a76b6e9ddddb2bfd | Takes a cardioLog id and removes the cardioLog from Firebase. Once
removed, the router pops off of the cardioLog screen to the diary
screen.
cardio log.
for Redux dispatcher. | return async (dispatch) => {
try {
const url = `/api/logs/${id}`;
const config = {
headers: {
authorization: token,
},
};
const res = await axios.delete(url, config);
dispatch({ type: DELETE_LOGS_SUCCESS, payload: res.data });
} catch (error) {
dis... | 0 |
308ebc1adede19376f1cff1e7b929a73 | b62095a9f4975cb5d6b714373baa21b8 | Get the softAP network ID. | public abstract class WifiAdminBase
public int getNetworkId() {
return (mWifiInfo == null) ? 0 : mWifiInfo.getNetworkId();
} | 0 |
9e5303fdc3f6f0c83ec8e0b2e71c40d6 | 77da3f0511fdc304efaac4a64a283cef | 等待,直到锁成功获取 | fn wait_lock(self) -> Result<FlockLock<Self>, FlockError<Self>> {
SharedFlock::wait_lock_fn(
self,
|sself| Ok(sself),
|e| Err(e)
)
} | 1 |
14bc51b802726ab121cb8175297f056e | 9c6fcb2c60c25b4bd4ab76a88604602a | Tests basic functionality of glDrawArraysInstancedBaseInstanceANGLE | #ifndef MAGNUM_TARGET_GLES
if(!Context::current().isExtensionSupported<Extensions::ARB::draw_instanced>())
CORRADE_SKIP(Extensions::ARB::draw_instanced::string() << "is not supported.");
#elif defined(MAGNUM_TARGET_GLES2)
#ifndef MAGNUM_TARGET_WEBGL
if(!Context::current().isExtensionSupporte... | 0 |
77501929918b112f78a7cc753518c274 | 5c8a59c61efeef0eb5dbba355ed7476e | Adds an edge relating source and target.
The weight must be a number, or leave it as default (1.0).
Does not allow duplicated edges (like networkx, and unlike NetworKit).
If the edge exists, the weight is updated.
Does not add two edges like networkx: NetworKit has true undirected edges. | class weighted_graph(metaclass=ABCMeta):
def add(self, e, w=1): | 1 |
d6e033837f2bc24ffcfc5d3eabd7676b | 2c682fd0634480ef1aec5667553d021e | Create the passed directory as a subdirectory within the given base directory, and return the new directory's full name | class AptFacade(object):
def _ensure_sub_dir(self, sub_dir):
full_path = os.path.join(self._root, sub_dir)
if not os.path.exists(full_path):
os.makedirs(full_path)
return full_path | 1 |
0889083fbf1907b30107a6b504405219 | 6841b40fb2b0119ffb307bebbd1b0501 | Determines how MongoDB calculates the distance between two points.
By default, when this option is not provided, MongoDB uses $near semantics:
When provided, MongoDB uses $nearSphere semantics and calculates distances | namespace Nest
public class FilterDescriptor<T> : FilterContainer
where T : class
public FilterContainer GeoDistance(Expression<Func<T, object>> fieldDescriptor, Action<GeoDistanceFilterDescriptor> filterDescriptor)
{
return _GeoDistance(fieldDescriptor, filterDescriptor);
} | 0 |
69db76c78af655c315c682f9c4aa0ac5 | 5ece0c6a297d65f324c5dc87d6c580c1 | Adds multiple hit points. | namespace DnD5e.Creatures
void AddBonusHitPoints(Func<sbyte> hitPoints); | 0 |
42d84af444bfdf582dcc111cdbaa9bbf | 29ccf6328f34cf72a1578ebafae66838 | Return nil if no entry existed
If multiple entries match, return the most recent one | return nil unless session_exists? id
@sessions[id]['lastUpdate'] = Time.now
@sessions[id]
end | 0 |
ccedf9834ec7d38f20fb6965c4cbe5fe | 8f12b94c727812f60f6207d55b6c33be | Setter for <code>NBC_ANAM_1_FULL.S2_TEXT</code>. | @Generated(
value = {
"http://www.jooq.org",
"jOOQ version:3.8.0"
},
comments = "This class is generated by jOOQ"
)
@SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class NbcAnam_1FullRecord extends TableRecordImpl<NbcAnam_1FullRecord>
public void setS2Text(String value) {
... | 1 |
5cb3ea5e1cf1fa004efcb52d7f915e4d | 9daf0c34b2b48efc4cb2c4e2864879a9 | Returns the default fields present on all frames. | class Frame(SimpleDoc, mongoengine.Document):
def filterFieldNames(cls):
return ['_id', 'camera', 'capturetime', 'capturetime_epoch', 'metadata', 'notes', 'height', 'width', 'imgfile', 'features', 'results'] | 1 |
7039f4b9ae7b895af2a11869c337c73e | 7db655adebed5560fad7279d3ebe6115 | 查詢學生技能檢定資料 | {
$student = DB::table('tbl_eyesight')
->join('tbl_student', 'tbl_eyesight.stu_id','=','tbl_student.stu_id')
->join('tbl_class','tbl_student.class_id','=','tbl_class.class_id')
->where([
['tbl_class.school_id', '=', $request->school_id],
['tbl_student.stu_code', '=', $request->student_code]
])
->orde... | 0 |
ad60daf940b1fb1268ad450865faa1d4 | ef3d63cc65b5b3cf10e8d5f6c625f0cb | GSet as an Object that can be JSON.stringified | let items = {};
this.has =function(value){
return items.hasOwnProperty(value);
}
this.add = function(value){
if(!this.has(value)){
items[value] = value;
return true;
}
return false
}
this.remove = function(value){
if(this.has(value)){
delete items[value];
return true;
}
return false;
}
... | 0 |
a0cf70afbf037fa208ce248db20d303f | 8ecb2fc5e31a4309cbf00ddfd9b2c44f | Convert the packed (hex) color list to rgb color list | class LedController:
def convert_color_str_to_rgb(self):
for color_str in self.all_colors_as_str:
rgb_list = self.color_dict[color_str]
self.all_led_rgb_value_lists.append(rgb_list) | 0 |
34d002023d939627a032651a0857f212 | 123e0ceff443392f891c311bc816e350 | Check the plugin setting for custom from addresses | static $result;
if (isset($result)) {
return $result;
}
$result = true;
if (elgg_get_plugin_setting('include_existing_users', 'newsletter') == 'no') {
$result = false;
}
return $result;
} | 0 |
cd1def64eab351e8a560f8f077d73aa8 | e088beae307605b45472ee3ecf6c001c | convert stream badnesses to station badnesses by averaging | bads = 0
for i, group in enumerate(groups):
if i % 50 == 0:
print(i, len(groups), bads)
bads += correct_group(station_locs, station_data, group)
print( numpy.mean(diffs), bads ) | 0 |
5a341d54fa1f038f82e89cc87a2e1108 | 6f36eadf8330dfa4a22a2a74ba28b247 | Fill answer for a given question. Answers are sent when calling {@link #actionContent(Context)}
. | public class CapptainPoll extends CapptainReachInteractiveContent
public void fillAnswer(String questionId, String choiceId)
{
mAnswers.putString(questionId, choiceId);
} | 1 |
a5b9ccc4b3f10cba25cf14455c8d8cee | 4714bde932cf57172a23d72b756c3691 | Takes a variable number of objects, converts them to string and combines them to one space separated String. | def concatenate (*args):
return str.join(" ", map(str, args)) | 1 |
23b89660462583bab85e370782389f49 | 23eca4e9736708af972b7d9f6ac0cd55 | INITCAP | function InitCapFun(id)
function initCap(str) {
str = str.substring(0,1).toUpperCase() + str.substring(1,str.length).toLowerCase();
return str;
} | 1 |
427f9a57a285d1c460a61ac3019d7fb4 | 5a90e5c6ccd917b6504aff95dba9577b | 删除Member,此处为逻辑删除,实为更新IsDelete字段 | {
string sql = "";
try
{
var olts = os.GetObjects<Member>(obj);
if (olts != null)
{
foreach (var item in olts)
{
if (item.ID > 0)
{
... | 1 |
c907e268db2abc9c0c7f37bf89455dbf | 6c2e730c3f365a8b68d1c29f6984465a | 初始化Handle,接受各类handle | {
init_db_handle_funs();
SET_DB_HANDLE(proto_db_get_sprite, db_get_sprite_callback, sizeof(get_sprite_rsp_t) + 212, cmp_must_ge);
SET_DB_HANDLE(proto_db_get_other_user_info, get_other_user_info_callback, sizeof(get_sprite_rsp_t) + 36, cmp_must_ge);
SET_DB_HANDLE(proto_db_get_offline_msg, get_offline_msg_callback, 8... | 1 |
23875fbf629107a19a10e3628a02e536 | 0f89df14ff6d04fb14d125bc66d63369 | Reject labels with double spaces | text = text.strip()
text = re.sub(r"\n{1,}", " \xc2\xb6 ", text)
if text.strip()[-2:] == '\xc2\xb6':
text = text.strip()[:-2]
return text | 0 |
d27b22a7a06933a59ed761572820a50e | 53f78bf92b0bbca3e1eea38d3dba4a6f | Returns the current encoder values | public class MecDrive2
public int[] getEncoderVals(){
return new int[]{motors[0].getCurrentPosition(), motors[1].getCurrentPosition(), motors[2].getCurrentPosition(), motors[3].getCurrentPosition()};
} | 1 |
1ef6514fcda22552b452a4b6989d9afb | 2cb3630cdf6dd69543e5207a0fce933e | 如果key存在,则删除__mydict中对象的key | class Dict:
def __delitem__(self, key):
bucket = self._get_bucket(key)
i = self._find_index_in_bucket(key, bucket)
del bucket[i] | 1 |
db2621ee85985627d94a5b30ed12f080 | 515a0cd7900142c938bda20645508214 | 订阅下行控制命令 | func nackSubCommand(writer io.Writer) error {
_, err := writer.Write([]byte{0x1})
if err != nil {
return err
}
return nil
} | 0 |
169ba47d4e29b7dd3c5583392c424cef | f1026277a4b40dc8c30e05a611b48312 | 各省的行政区划代码和坐标 | doc := fetch(url)
nodes := htmlquery.Find(doc, `//*[@id="2020年7月份县以上行政区划代码_24734"]/table/tbody//tr`)
var province [83] string
var city [66][100] string
for _, node := range nodes {
provinceCityInfo := htmlquery.Find(node, `//td[@class="xl7024734"]`)
if provinceCityInfo != nil{
regionCodePc := htmlquery.Inne... | 0 |
6da0771c0166f59f893f4aa14d53d8ff | 60632e2c69c622cfd38c736edfc52fd2 | Convert an angle from radians to code-wheel ticks. | {
return (int)(((angle / 360.0f)* WHEEL_TURNING_REDUCTION_RATIO + loopShift)* COUNTS_PER_ROUND );
} | 0 |
c41bac882aeb69f57f0bbbc050a66705 | 857f5d9ca4de50b1dfd9bf0e032e67a6 | Gets my cs stats for the game
Returns an array with the cs info
In the order: cs, cs/min | this->write("stats-tube " . tube);
$response = $this->readYaml();
if ( response[0] != "OK" ) {
return false;
}
return response[2];
} | 0 |
e0274f1d8274ece29d2dfd9f2ff268f4 | cf06679a053b4659941a26e1017d8446 | Requests the json from the specified URL, for TV Maze. | RequestQueue queue = Volley.newRequestQueue(MaijieApp.getAppContext());
RequestFuture<JSONObject> future = RequestFuture.newFuture();
JsonTask request = new JsonTask(url, null, future, future);
queue.add(request);
try {
return future.get();
} catch (InterruptedException e) {
} catch (ExecutionException... | 1 |
c5f3aaa3554a547194c7365b6f2b2318 | e1aa949b4cf7e55a113f58b4fd1df407 | Sets the definition of this term. | void setDefinition(FunctionDefinition value); | 1 |
0eec4ac75cf04d7ffb42a3725eb49db5 | ec31eba7e3ef34f8992a2446882d74db | 增加领料单和领料单明细数据 | Result result = init();
if(result.getStatusCode().equals("300")){
return result;
}
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<ufinterface sender=\""+getConfig().getSender()+"\" receiver=\""+getConfig().getReceiver()+"\" roottag=\"storeout\" ... | 1 |
d3b7d84667a1739cc23569566f3c719f | 4cf66365c709bd2470681a4ed56b283f | Return an array of height and width for a popup based on the specified name, if there is one | cmd = ['magick', 'identify', '-format', '(%w,%h)', '-ping', fname]
process = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
if process.returncode == 0:
return eval(process.stdout)
print(process.stderr.decode("utf-8"))
return [0,0] | 1 |
ecbea344ee76f31edef82253a5852420 | 2a5b789a45ac1df5eef9489e1afcaebd | spajamo sva tri reda u pocetni spil. bitno je jedino da red
koji je korisnik odabrao bude u sredini | placingStack("Green", "first", player, in);
placingStack("Green", "second", player, in);
placingStack("Purple", "first", player, in);
placingStack("Purple", "Second", player, in);
placingStack("Purple", "Third", player, in);
placingStack("Red", "first", player, in);
... | 0 |
112bf86a9e1d5e79577397f7b17ca7b0 | 1229b4408d1f0e5564bd3b1b7b60eb9a | Resume pending search on connect | {
Q_UNUSED(aID);
qDebug() << "SearchDialog::clientConnectionChanged - aConnected: " << aConnected;
if (aConnected) {
QTimer::singleShot(1, this, SLOT(startSearch()));
}
} | 1 |
42e0460eaf935d8ca5aa72175f97584a | 233226e6c1c232d3ff19be0421b00579 | This method is used to retrieve the number of pipes owned by the targeted host. | public class Client
public String getCount() throws ConnectException {
return executor.sendRequest(GET_COUNT_COMMAND);
} | 1 |
f3b91ff8ee8213ea6c649efb7fc42ef2 | efeee089403eea72c9358532f1ed0eaa | Private method: _createComponentModule.
It creates the module for the dynamic component. | if outputRoot is None: outputRoot = sourceRoot
hardcoreDir = os.path.join(sourceRoot, 'modules', 'hardcore')
componentDir = os.path.join(hardcoreDir, 'component')
changed = util.readTemplate(os.path.join(componentDir, 'OpComponentCreate_template.inc'),
... | 1 |
c942ce263fc19d7842a0bd82e6c6d72b | 4b3b59f2fcd8b000f1d00df8b3455625 | 서버에서 보내준 확대 좌표를 바탕으로 bitmap을 잘라준다. | protected Bitmap doInBackground(Integer... params) {
data = params[0];
return decodeSampledBitmapFromResource(BaseApplication.get().getResources(), data,
100, 100);
} | 0 |
5515dc8b28814246de14ea2318ef5fe8 | 7b2ad871207b971ae83c6e9ab63b0732 | Displays a message box that contains the specified text and an OK button only when debugging. | {
return Show(owner, messageBoxText, string.Empty, WPFMessageBoxButtons.OK, WPFMessageBoxImage.None, WPFMessageBoxResult.OK, new WPFMessageBoxOptions());
} | 0 |
ddd96641f4adf454aff946e533b7e647 | 3ac49f6fe0abfd2b14be86b7c3918e37 | 通过companyid获取企业建立的分组列表 companyId从HttpSession中取得 | namespace EyouSoft.IBLL.CompanyStructure
IList<string> GetListByCompanyId(string CompanyId); | 1 |
44a2d6e5c9117ac0b3086dc8ec3cc14e | a9061b6b925568baa83b58f4400f1c5f | for purchasing small upgrade, charge applied and money removed from the player | public class ElementalDamageUpgrade
protected void purchaseUpgrade_Air(Player player) {
long playerAccount = player.getMoney();
long upgradeCosts = this.getElementalDamageUpgradePrice_Air();
Utils.setAccountUpdated(true);
player.setAccount(playerAccount - upgradeCosts);
Utils.setElementalDamageUpdated_Air(tru... | 1 |
04c08b07fa7bd26bab5cd66ee5b21e8b | ebba91746a5e003560c33d5b986db851 | Methode die einen Charakter aus der Datenbank löscht | public class SQL_Spieler
public void delete(Spieler spieler) {
dbW.delete(TABLE_SPIELER, COLUMN_ID + " = " + spieler.getId(), null);
dbW.close();
} | 1 |
64b94e3a4f15edd6498383f89ecaabc0 | 564e9b802fbd9ad0a66a461370e1ce5e | Take in a BuferedImage and invert the pixel data | {
int xSize = bi.getWidth();
int ySize = bi.getHeight();
BufferedImage newBi = new BufferedImage (xSize, ySize, 3);
for (int x = 0; x < xSize; x++)
{
for (int y = 0; y < ySize; y++)
{
int rgb = bi.getRGB(x, y);
newBi.set... | 0 |
e7bbb075bac49bbf513413116d740953 | 562b55a5540d00bf8a6fbce8fc59a832 | Clamp value to the range 0..255. | def clamp(x):
return max(0, min(x, 255)) | 1 |
0f034aa7b52da7b389da25d46e1a7807 | 50e37d9c46f0618fcfa381ab5af2615a | Проверяем работоспособность события LogAuthenticationAttempt. | class LogHomepageVisitTest extends TestCase
public function testEventLogged()
{
$listener = new \App\Listeners\LogHomepageVisit();
Log::shouldReceive('info')->once();
$listener->handle(new \App\Events\HomepageVisit());
} | 0 |
0ceacd7a651e9c90930e58c1d89080b7 | 07a2e5fb310c00f592e222394dfd5e1d | @brief TIM8更新中断服务函数 ,中断源如不符合需自行修改 | static void MX_TIM8_Init(void)
{
TIM_ClockConfigTypeDef sClockSourceConfig;
TIM_MasterConfigTypeDef sMasterConfig;
TIM_OC_InitTypeDef sConfigOC;
TIM_BreakDeadTimeConfigTypeDef sBreakDeadTimeConfig;
htim8.Instance = TIM8;
htim8.Init.Prescaler = 0;
htim8.Init.CounterMode = TIM_COUNTERMODE_UP;
htim8.Init.P... | 0 |
6c0109dda2d700ddaa78c3ef7b73bae7 | 5dde3fddf210b60a651add42d807076f | !
Sets grace time after sending TERM to child process, before sending KILL.
Default is GLEXEC_TERM_GRACE_TIME, 0 doesn't time-out | exitCode* p_wait(int mode) {
return k_register_child(mode);
} | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.