query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Filter locations by query | filterLocations(query, venues) {
return venues.filter(venue => venue.name.toLowerCase().includes(query.toLowerCase()))
} | [
"function filterByDistance() {\r\n //filter by Distance will only show \"pins\" within 1 mile of users location\r\n }",
"function filterPlace () {\n const data = { amenities: listIdAmenities };\n getPlaces(JSON.stringify(data));\n}",
"function querySearch (query) {\n if (query.length ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a function for getV3ProjectsIdTriggersToken | getV3ProjectsIdTriggersToken(incomingOptions, cb) {
const Gitlab = require('./dist');
let defaultClient = Gitlab.ApiClient.instance;
// Configure API key authorization: private_token_header
let private_token_header = defaultClient.authentications['private_token_header'];
private_token_header.apiKey = 'YOUR ... | [
"postV3ProjectsIdTriggers(incomingOptions, cb) {\n const Gitlab = require('./dist');\nlet defaultClient = Gitlab.ApiClient.instance;\n// Configure API key authorization: private_token_header\nlet private_token_header = defaultClient.authentications['private_token_header'];\nprivate_token_header.apiKey = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
void PutSubscriberProperty (string, Variant) | PutSubscriberProperty(string, Variant) {
} | [
"PutPublisherProperty(string, Variant) {\n\n }",
"onPropertySet(room, property, value, identifier) {\n room[prop] = value;\n }",
"function sendPropertyToTTS(thng, property) {\n console.log('[TTS] Sending property update');\n\n evrythng.thng(thng.id).read().then(function (thngRead) {\n\n var ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gives the path between [p_orig] (excluded) and [p_dest] (included). | function build_path(p_orig, p_dest){
var res = new Array();
if(p_orig.x == p_dest.x){
if(p_orig.y < p_dest.y){
// Vertical path, going downwards.
for(var y = p_orig.y + 1; y <= p_dest.y; y++){
res.push({x: p_orig.x, y: y});
}
} else {
// Vertical path, going upwards.
f... | [
"function destPath() {\n // Remove preceding slash '/'.\n return window.location.pathname.slice(1) + window.location.search;\n }",
"function ipPath(fromNet , toNet){\n var ret = [];\n if (!SPTree)\n updateSPTree();\n if (!SPTree[fromNet][toNet]){\n showTitle(\"No path available from ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a 'presongs objects' promise for search result | function searchTermPromise(searchTerm){
//sends request and receives an array of presong objects
return fetch('http://localhost:4000/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body: JSON.stringify({q... | [
"singleFetch(predicates, options){\n return new Promise((resolve) => {\n this.prismic.getResults(predicates, options)\n .then((content) => resolve(content))\n .catch((error) => console.error(error));\n });\n }",
"function searchAllProducts() {\n let all_products = new Promise(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes the department with matching ID; throws error if wrong type/number of arguments were provided. | async function deleteDept(deptId) {
//validates number of arguments
if (arguments.length != 1) {
throw new Error("Wrong number of arguments");
}
//validates arguments type
if (!deptId || typeof (deptId) != "string" || deptId.length == 0) {
throw "Invalid Department ID";
}
let... | [
"removeDepartment(departmentId) {\n return this.connection.query(\n \"DELETE FROM department WHERE id = ?\",\n departmentId\n );\n }",
"async function removeDepartment() {\n const departments = await db.findAllDepartments();\n\n const departmentChoices = departments.map(({ id, name }) => ({\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
lets creat a pet from a function, name, species, behaviour | function createPet(name, species, well_behaved) {
return {name, species, well_behaved};
} | [
"function Pet(petName,age,adopted,markings,breed){\n this.petName = petName;\n this.age = age;\n this.adopted = adopted;\n this.markings = markings;\n this.breed = breed;\n}",
"function petInfo (pet) {\n\tconsole.log([name] + \" is a \" + [age] + \"-year-old, \" + [gender] + \" \" + [species] + \".\");\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ENHC0051710:Setting HTC Reviewer(AP Clerk Offshore) Value based on the subsidiary of the vendor selected | function setHTCReviewer(vbRec,vbSubs,vbOwner,k) {
var f3 = new Array();
f3[0] = new nlobjSearchFilter('custrecord_spk_sr_ap_clerk_subsidiary',null,'anyof',vbSubs);
f3[1] = new nlobjSearchFilter('isinactive',null,'is','F');
var col3 = new Array();
col3[0] = new nlobjSearchColumn('custrecord_spk_senior_apcle... | [
"function SetAPClerk(vbRec,vbSubs,vbOwner,k) {\t\t\t\n\tvar f3 = new Array();\n\tf3[0] = new nlobjSearchFilter('custrecord_spk_sr_ap_clerk_ons_sub',null,'anyof',vbSubs);\n\tf3[1] = new nlobjSearchFilter('isinactive',null,'is','F');\t\t\t\t\t\n\tvar col3 = new Array();\n\tcol3[0] = new nlobjSearchColumn('custrecord_... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Counts the column offset in a string, taking tabs into account. Used mostly to find indentation. | function countColumn(string, end, tabSize) {
if (end == null) {
end = string.search(/[^\s\u00a0]/);
if (end == -1) end = string.length;
}
for (var i = 0, n = 0; i < end; ++i) {
if (string.charAt(i) == "\t") n += tabSize - (n % tabSize);
else ++n;
}
return n;
} | [
"indentation() {\n var _a\n return (_a = this.overrideIndent) !== null && _a !== void 0\n ? _a\n : countCol(this.string, null, this.tabSize)\n }",
"function countPreviousSpaces(str, pos) {\r\n var spaces = 0;\r\n // check the characters before the pos one at a time, break wh... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Return true if the specified `filePath` is contained in `relativePath` and false otherwise. | function inRelativePath(filePath) {
return filePath.startsWith(withSlash);
} | [
"function isInSrcDir(_filepath){\n var filepathRelativeToSrcDir = path.relative( srcDir, path.resolve(config.base,_filepath) );\n if( filepathRelativeToSrcDir.substr(0,2) !== '..' ) { // file is in srcDir\n return filepathRelativeToSrcDir;\n }\n return false;\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns number of followers after going through all pages | async function getFollowers(login) {
let response = 0;
let followers = 0;
let page = 1;
let done = false;
while (done === false) {
response = await fetch(githubFollowers(login, page))
.then(res => res.json())
.then(json => {
return json.length;
});
followers += response;
... | [
"async function getFollowing(login) {\n let response = 0;\n let following = 0;\n let page = 1;\n let done = false;\n while (done === false) {\n response = await fetch(githubFollowing(login, page))\n .then(res => res.json())\n .then(json => {\n return json.length;\n });\n following +... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert the given transaction blob to a transaction hash. | static transactionBlobToTransactionHash(transactionBlobHex) {
if (!Utils.isHex(transactionBlobHex)) {
return undefined;
}
const prefixedTransactionBlob = this.toBytes(signedTransactionPrefixHex + transactionBlobHex);
const hash = this.sha512Half(prefixedTransactionBlob);
... | [
"static hashTransactions(transactionDatas){\n let data = [];\n transactionDatas.forEach(transaction => {\n data.push(JSON.stringify(transaction));\n });\n\n // use sha256 to create a merkle tree\n let tree = merkle(\"sha256\").sync(data);\n\n // return the merkle root\n return tree.root();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Triggers on change to a parameter in a selector, selectorNum is the selector | selectorParameterChange(event, selectorNum) {
var rulesets = this.state.rulesets
// The id is the index of the selector
rulesets[this.state.currentRuleset][selectorNum].parameters[event.target.id] = event.target.value
this.setState({rulesets: rulesets}, () => {
this.updateDa... | [
"function sel_change(v, check, F, objs) {\n if (v == check) {\n sel_enable_objs(F, objs);\n } else {\n sel_disable_objs(F, objs);\n }\n}",
"onSelectionChange(func){ return this.eventSelectionChange.register(func); }",
"onSelectionEdited(func){ return this.eventSelectionEdited.register(fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create new date time segment | constructor(dateSegment = '', timeSegment = '') {
this.dateSegment = dateSegment;
this.timeSegment = timeSegment;
} | [
"function createDate() {\n theDate = new Date();\n }",
"_addDate() {\n const valueLink = this.props.valueLink;\n const value = valueLink.value || {};\n const slots = (value.slots || []).slice();\n const start = this.state.start.getTime();\n const end = start + this.state.duration;\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
funcion para crear el xml | function createXMLConciliacion( root, params )
{
var nodes;
var xml = "";
if( root )
xml += "<" + root + ">";
for(var i=0; i<params.length; i++)
{
nodes=params[i];
xml += "<element>";
for( theNode in nodes )
{
xml += "<" + theNode + ">" + nodes[theNode] + "</" + theNode + ">";
... | [
"function generateXML(){\n\t\t\t\tconsole.log(\"###### FUNCTION generateXML START\");\n\t\t\t\tvar xml2Send = '';\n\t\t\t\txml2Send += '<?xml version=\"1.0\" encoding=\"UTF-8\"?><simpledc xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dct=\"http://purl.org/dc/terms/\" xmlns:geonet=\"http://www.fao.org/geonetwo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Removes folder with sets from one archive | removeUploadedSet(dir) {
return removeDir(this.uploadPath + '/' + dir)
} | [
"function folderCleanUp() {\n DriveApp.getFoldersByName('test1').next().setTrashed(true);\n DriveApp.getFoldersByName('test2').next().setTrashed(true);\n}",
"function removeTestDuplicateFolders() {\n var folderName = 'duplicate folder';\n removeFolder(folderName);\n}",
"resetFolders(){\n // clear fol... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns an array containing the indices of this._docs where active is true, randomly ordered using their weights, i.e., the document with the highest weight is most likely but not guaranteed to come first, and the document with the lowest weight is most likely but not guaranteed to come last. FIXME | documentOrdering() {
var docs = [ ];
for(var i in this._docs) {
if(this._docs[i].active) {
docs.push(i);
}
}
var docs = docs.sort( function(a, b) { return (Math.random() * this._docs[a].weight) - (Math.random() * this._docs[b].weight); } );
... | [
"static fetchFreeIndex(){\n\t\t//There are no used indexes yet, so return index 0\n\t\tif ( referenceCount.size === 0){\n\t\t\treturn 0;\n\t\t}\n\n\t\tlet indices = Array.from( referenceCount.keys() );\n\t\t//Sort the usedIndices array ascending (or descending?)\n\t\tindices.sort(function(a, b){return a - b});\n\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`_encodeObject` represents an object | _encodeObject(object) {
switch (object.termType) {
case 'Quad':
return this._encodeQuad(object);
case 'Literal':
return this._encodeLiteral(object);
default:
return this._encodeIriOrBlank(object);
}
} | [
"function encodeExtensionObject(object, stream) {\n\n if (!object) {\n ec.encodeNodeId(ec.makeNodeId(0), stream);\n stream.writeUInt8(0x00); // no body is encoded\n stream.writeUInt32(0);\n } else {\n ec.encodeNodeId(object.encodingDefaultBinary, stream);\n stream.writeUInt8... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Registers the provided binding (prop + bindingIndex) into the context. This function is shared between bindings that are assigned immediately (via `updateBindingData`) and at a deferred stage. When called, it will figure out exactly where to place the binding data in the context. It is needed because it will either upd... | function registerBinding(context, countId, prop, bindingValue, sanitizationRequired) {
var registered = false;
if (prop) {
// prop-based bindings (e.g `<div [style.width]="w" [class.foo]="f">`)
var found = false;
var i = getPropValuesStartPosition(context);
while (i < context.len... | [
"function Binding(value){\r\n\t\tthis.value= value;\r\n\t\tif(value){\r\n\t\t\tvalue._binding = this;\r\n\t\t}\r\n\t}",
"updateTagIndexForBinding(binding) {\n this.removeTagIndexForBinding(binding);\n for (const tag of binding.tagNames) {\n let bindings = this.bindingsIndexedByTag.get(tag... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get a sidenote's length | function ebSidenoteConverterSidenoteLength(sidenote) {
'use strict';
var length = sidenote.innerText.length;
return length;
} | [
"function length () {\r\n return this.node.getComputedTextLength()\r\n}",
"function getLength(string){\n\n\n}",
"static get length() {\n return 0;\n }",
"len() {\n return quat.length(this);\n }",
"get collectiveSongLength() {\n let time = 0;\n SongManager.songList.forEac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Build the member expression that reads from a global for a given source. | function buildBrowserArg(browserGlobals, exactGlobals, source) {
let memberExpression;
if (exactGlobals) {
const globalRef = browserGlobals[source];
if (globalRef) {
memberExpression = globalRef
.split(".")
.reduce(
(accum, curr) => t.memberExpression(accum, t... | [
"MemberExpression() {\n let object = this.PrimaryExpression();\n\n while (this._lookahead.type === \".\" || this._lookahead.type === \"[\") {\n // MemberExpression '.' Identifier\n if (this._lookahead.type === \".\") {\n this._eat(\".\");\n const property = this.Identifier();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : invitePeopleSeesion AUTHOR :Juvindle C Tina DATE : March 26, 2014 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : invite user to join the seesion PARAMETERS : | function invitePeopleSeesion(){
var sessionid = seletedSessionId.split("__");
var url = getURL('Console') + "action=getUserNameForInvitation&query={'MAINCONFIG': [{'sessionId': '"+sessionid[1]+"','user':'"+globalUserName+"'}]}";
$.ajax({
url: url,
dataType: 'html',
method: 'POST',
... | [
"function inviteMember(current_user, invite_user, list_id) {\n if(confirmInvite(invite_user)) {\n\tif(list_id) {\n\t var result = null;\n\t var xmlhttp = null;\n\t if (window.XMLHttpRequest) {\n\t\txmlhttp=new XMLHttpRequest();\n\t } else {\n\t\txmlhttp=new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Clears the callback in charge of hiding the component after timeout | function clearHideTimeout() {
if (timeoutID === null) {
return;
}
window.clearTimeout(timeoutID);
timeoutID = null;
} | [
"hide() {\n\t\tlet _ = this\n\n\t\t_.timepicker.overlay.classList.add('animate')\n\t\t_.timepicker.wrapper.classList.add('animate')\n\t\tsetTimeout(function () {\n\t\t\t_._switchView('hours')\n\t\t\t_.timepicker.overlay.classList.add('hidden')\n\t\t\t_.timepicker.overlay.classList.remove('animate')\n\t\t\t_.timepic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send an `is_complete_request` message. Notes See [Messaging in Jupyter]( Fulfills with the `is_complete_response` content when the shell reply is received and validated. | requestIsComplete(content) {
let options = {
msgType: 'is_complete_request',
channel: 'shell',
username: this._username,
session: this._clientId
};
let msg = messages_1.KernelMessage.createShellMessage(options, content);
return Private.hand... | [
"async complete(result = \"unknown\") {\n if (!PaymentCompleteEnum.includes(result)) {\n throw new TypeError(\"Invalid argument value: \" + result);\n }\n if (this[_complete]) {\n throw new DOMException(\"Response already completed\", \"InvalidStateError\");\n }\n this[_complete] = true;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns section that belongs to the given subsection | getDisplayedSection(displayedSubsection) {
/* Returns the section that the user is currently viewing. */
return this.state.courseSidebar.sections.find((element) => {
return element.id === displayedSubsection.section_id
})
} | [
"getNextSubsection(section, subsection) {\n if (!section || !subsection) {\n return\n }\n\n // If not the last subsection in section, return the next subsection in section\n if (!isLast(section.subsections, subsection)) {\n const nextSubsection = section.subsections[subsection.position]\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Does the jQueryspecific responseText checking on the xhr for errors | _handleErrorResponse(xhr, callback) {
var response = xhr.responseText;
if (_.isString(response) && response !== "") {
try {
response = JSON.parse(response);
} catch (e) {
response = {
error: e
};
}
}
callback(response, xhr);
} | [
"function handleXhrError(response, ioArgs) {\n if(response instanceof Error){\n if(_ldc) _ldc.hide();\n if(response.dojoType == \"cancel\"){\n //The request was canceled by some other JavaScript code.\n console.debug(\"Request canceled.\");\n }else if(response.dojoType == \"timeout\"){\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
downpayment value: downPercentage assetValue | calculateDownPayment() { return this.getVariable().getPercentDown() * this.getAsset().getValue() } | [
"get percentage() {\n return this._percentage;\n }",
"bankSalery(){\n if( this.bankLoan > 0 ){\n let deduction = (this.payBalance * 0.10) \n this.payBalance = this.payBalance - deduction\n if(deduction > this.bankLoan){\n this.bankBalance = this.ba... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the thumbnail src. | set src(aValue) {
this._logService.debug("gsDiggThumbnailDTO.src[set]");
this._src = aValue;
} | [
"async updateImageSource() {\n const source = await this.getThumbnailURL();\n this.getImage().setAttribute('src', source);\n }",
"function setPicture(){\n\n\t\t\t\tvar sizes = new Object();\n\n\t\t\t\telement.find('source').each(function(){\n\n\t\t\t\t\tvar media, path, num;\n\t\t\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
jobStatsMenuToggle function that scales map with job stats menu | function jobStatsMenuToggle(){
$('.jobStats').toggleClass('jobStatsHide')
$('.item4').toggleClass('select')
if($('.map').hasClass('mapWithoutList')){
$('.map').toggleClass('mapWithoutAnything')
} else if ($('.map').hasClass('mapWithoutAnything')){
$('.map').toggleClass('mapWithoutAnythin... | [
"function jobListMenuToggle(){\n $('.sidebar').toggleClass('sidebarHide')\n $('.item1').toggleClass('select')\n if($('.map').hasClass('mapWithoutInfo')){\n $('.map').toggleClass('mapWithoutAnything')\n } else if ($('.map').hasClass('mapWithoutAnything')){\n $('.map').toggleClass('mapWithou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Map an array of effects through a change set. | static mapEffects(effects, mapping) {
if (!effects.length)
return effects;
let result = [];
for (let effect of effects) {
let mapped = effect.map(mapping);
if (mapped)
result.push(mapped);
}
return result;
... | [
"map(mapping) {\n let mapped = this.type.map(this.value, mapping);\n return mapped === undefined ? undefined : mapped == this.value ? this : new StateEffect(this.type, mapped);\n }",
"function Transition(id, asets, bsets) {\n var i = 1, j = 0, n = 8, interpolated = interpolateSets(asets,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines if the given character can be part of a mention's text characters. | function isMentionTextChar(char) {
return mentionTextCharRe.test(char);
} | [
"function stateMentionTextChar(stateMachine, char) {\n if (isMentionTextChar(char)) ;\n else if (alphaNumericAndMarksRe.test(char)) {\n // Char is invalid for a mention text char, not a valid match.\n // Note that ascii alphanumeric chars are okay (which are teste... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns a single event based on the eventid | function getEvent(eventid)
{
var defaultTestEvent = {
'eventid': '01',
'title': 'Success Through Failures',
'eventLocation': 'Atlanta',
'start': moment('2016-07-22'),
'attendees':[
{
'firstName': 'John',
'lastName': 'Smitty'
},
{
'firstName': 'Sue',
'lastName': 'Mee'
}
]
};
//p... | [
"getSingleUserEvent(db, user_id, id){\n return db\n .from('events')\n .select('*')\n .where({user_id, id});\n }",
"async function get_event_id(tournament_name, event_name, token) {\n let variables = {\"tourneySlug\": tournament_name};\n let response = await run_query(t_queries.EVENT_ID_QU... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
================================= Simplified API access Ensures this instance is linked to a tradfri client and an accessory | ensureLink() {
if (this.client == null) {
throw new Error("Cannot use the simplified API on devices which aren't linked to a client instance.");
}
if (!(this._accessory instanceof accessory_1.Accessory)) {
throw new Error("Cannot use the simplified API on lightbulbs ... | [
"Xe() {\n return this.runTransaction(\"updateClientMetadataAndTryBecomePrimary\", \"readwrite\", t => er(t).put(new Fs(this.clientId, Date.now(), this.networkEnabled, this.inForeground)).next(() => {\n if (this.isPrimary) return this.sn(t).next(t => {\n t || (this.isPrimary = !1, this.Oe.enqueueRetry... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main worker method. checks all permutations of a given edit length for acceptance. | function execEditLength() {
for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {
var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;
var addPath = bestPath[diagonalPath - 1],
removePath = bestPath[diagonalPath + 1],
... | [
"function execEditLength() {\n\t for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n\t var basePath;\n\t var addPath = bestPath[diagonalPath - 1];\n\t var removePath = bestPath[diagonalPath + 1];\n\t var oldPos = (removePath ? removePath.newPo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
=========================================================================================== Functions calculates the angle for the middle of a slice | function midAngle(d) { return d.startAngle + (d.endAngle - d.startAngle) / 2; } | [
"@computed\n get sideCenterAngles() {\n const sideSum = this.windowDimensions.width + this.windowDimensions.height;\n const topBottom = this.windowDimensions.width / sideSum * Math.PI;\n const leftRigth = Math.abs(topBottom - Math.PI);\n return { topBottom, leftRigth };\n }",
"calculateRotation() {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redirect to enrolment page | function enrol() {
console.log("In enrol(): " + tournament.id);
window.location.href = "../enrolment/enrolment.html";
} | [
"function online_course() {\n window.location.href = \"../onlineCourses/online_courses.html\";\n}",
"function lockAndLeave()\n{\n let payload = {sId: selected ,round , user};\n console.log(\"POSTING-->\", payload, \" TO /engage\");\n post( \"../engage\", payload ); // it should be ../\n window.locat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
timeSelection a function to find out what time span button was pressed (and sends the information to another function that will make the spotify api call) once one button is clicked, the others will not have a click feature and the clicked button will change color. | function timeSelection(button_id) {
/* get the button and change the color to show it is selected */
let selected_button = document.getElementById(button_id);
selected_button.style.background = "black";
selected_button.style.color = "#cfe8fa";
/* change the unselected buttons colors */
i... | [
"function onMouseDownEvent()\n{\n let clickedTime = calculateClickedTime();\n let minute = (30 * clock.indicators.m.angle) / (Math.PI + 15);\n let hour = (6 * clock.indicators.h.angle) / (Math.PI + 3);\n let threshold = 0.25;\n\n if((clickedTime[0] < minute + threshold) && (clickedTime[0] > minute - threshold... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
represents a music item | function MusicItem( id, name, playlistId ) {
this.id = id;
this.name = name;
this.playlistId = playlistId;
var type = id.substring( 0, 2 );
this.getTypeName = function() {
switch ( type ) {
case 'tr': return 'track';
case 'ar': return 'artist';
case 'al... | [
"function Item () {\n\tthis.name = \"\";\n\tthis.relatedItems = [];\n\tthis.relationTypes = [];\n}",
"getItem(a) {\n if (!a) {\n return null;\n }\n\n if (a[0] === 'txt') {\n return this.state.textTrack[a[1]];\n } else {\n return this.state.mediaTrack[a[... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
28.Writ a function called createMatrix which takes in two whole numbers, n and m, and creates a twodimensional array with n columns and m rows. All of the values inside of your array should be 0. | function createMatrix(n, m){
let arr = [];
for (let i=0; i<m ;i++) {
arr[i]=[];
for (let j=0; j<n; j++) {
arr[i][j]=0;
}
}
return arr;
} | [
"function createZeroMatrix() {\n\t\tvar rows = arguments[0];\n\t\tvar cols = arguments[1];\n\t\tvar m = [];\n\t\tfor(var r = 0; r < rows; r++) {\n\t\t\tvar row = [];\n\t\t\tfor(var c = 0; c < cols; c++) {\n\t\t\t\tvar col = 0;\n\t\t\t\trow.push(col);\n\t\t\t}\n\t\t\tm.push(row);\n\t\t}\n\t\treturn m;\n\t}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isSemigroup : a > Boolean | function isSemigroup(m) {
return isString(m)
|| !!m && hasAlg('concat', m)
} | [
"canGroupSelectedItems()\n {\n if (Object.keys(this._selectedItems).length > 1)\n {\n for (var itemIndex in this._selectedItems)\n {\n var item = this._selectedItems[itemIndex];\n if (!(item instanceof WorkflowJobItem))\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Detects if there are other JSXElements in a higher scope. | function findOtherJSX(path) {
var state = { otherJSX: false, node: path.node };
path.findParent(function (path) {
if (path.isJSXElement()) {
state.node = path.node;
} else if (path.isFunction()) {
path.traverse(jsxVisitor, state);
} else if (path.isProgram()) {
path.traverse(jsxVisito... | [
"hasWrappers() {\n return this.wrappers.length > 0\n }",
"inDOM() {\n\t\t\treturn $(Utils.storyElement).find(this.dom).length > 0;\n\t\t}",
"function hasErrorOverlay() {\n return document.querySelectorAll(ERROR_OVERLAY_NAME).length;\n}",
"function inDOM() {\n var closestBody = $that.closest(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the subfolder inside the current folder, as specified by the leafPath | async addSubFolderUsingPath(leafPath) {
await spPost(Folder(this, "AddSubFolderUsingPath"), request_builders_body({ leafPath: toResourcePath(leafPath) }));
return this.folders.getByUrl(leafPath);
} | [
"function createNewFolder() {\n var id = $(this).parent().attr(\"data-id\");\n fileSystem.createFileOrFolder(id, \"folder\");\n updateUI();\n }",
"function subFolderCreate() {\n var requester = gapi.client.request({\n 'path': '/drive/v2/files',\n 'method': 'POST',\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to recursively walk through arrays and find highest and lowest number | function recursiveHighLow(data){if(data===void 0){return void 0}else if(babelHelpers.instanceof(data,Array)){for(var i=0;i<data.length;i++){recursiveHighLow(data[i])}}else{var value=dimension?+data[dimension]:+data;if(findHigh&&value>highLow.high){highLow.high=value}if(findLow&&value<highLow.low){highLow.low=value}}}//... | [
"function findMaximumValue(array) {\n\n}",
"function maxRecurse(...num) {\n const array = num[0];\n const array2 = [...array];\n let max = array2[0];\n\n if (array2.length === 1) {return max}\n array2.shift();\n let newMax = maxRecurse(array2);\n if (max < newMax) {max = newMax}\n \n re... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
transforamtion des isbn en chaine | function formeIsbn(liste) {
var isbnOffre = "";
for (var i = 0; i < liste.length; i++) {
if (i == 0) isbnOffre = liste[i].book.isbn;
else {
if (i == liste.length - 1) isbnOffre = isbnOffre + "," + liste[i].book.isbn;
else isbnOffre = isbnOffre + ",... | [
"function convertIsbn10ToIsbn13(isbn10){\n // Check if isbn10 is valid\n if (!isValidIsbn10(isbn10)){\n console.warn(`${isbn10} is not a valid ISBN10 or not expecting dashes in argument`);\n return \"\";\n }\n let prefix = \"978\";\n let middle = isbn10.substring(0, isbn10.length - 1);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Pool Does Not Contain Entity Exception | function PoolDoesNotContainEntityException(entity, message) {
_super.call(this, message + "\nPool does not contain entity " + entity);
} | [
"function PoolRequests (){ \n return myContract.methods.getRequestCount().call().then(function(totalCount){ \n console.log(\"-----------------------------------------------------\");\n console.log(\"Total Request since start = \", totalCount);\n }).then(function(){\t \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Remove from the canvas the given particle | function clearParticle(particle) {
var locationToRemove = particle.locations.shift();
ctx.fillStyle = "#FFFFFF";
ctx.fillRect(locationToRemove.x * (width / rows), locationToRemove.y * (height / rows), width / rows, height / rows);
} | [
"function stopParticle(particle, xnum, ynum) {\n particle.x = xnum;\n particle.y = ynum;\n particle.draw();\n\n return;\n}",
"__removeParticleEventListener(){\n Utils.changeCursor(this.myScene.canvasNode, \"pointer\");\n this.myScene.canvasNode.addEventListener(\"mousedown\", this.__removePartic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
verifForm(login, mot_de_passe) Cette fonction verifies si le login et le mot de passe de sont bien saisis. | function verifForm(login, mdp) {
/*********** Login verification **********************/
if ((login == undefined) || (login.length == 0)) {
$('#login_obligatoire').show();
return false;
}
$('#login_obligatoire').hide();
/************* Mot de passe verification **************/
if ((mdp == undefined) || (mdp.... | [
"function VerificationConfirmation() {\n const confirmation = document.getElementById(\"confirmation\");\n const pwd = document.getElementById(\"pwd\");\n const LMINI = 8; // DP LMINI = longueur minimale du mot de passe\n\n //DP si le mot de passe comporte moins de 8 lettres et que la confirmation est d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fetch phases from server | @action fetchPhases() {
// To reduce number of REST api calls, fetch phases only when list is empty
if (this.phases.length == 0) {
RestClientService.callGet('/phases').then(response => {
return response
.json()
.then(json => {
... | [
"_fetchState() {\n this._fetchLeagues();\n this._fetchSeasons();\n this._fetchRallies();\n this._fetchDrivers();\n }",
"getArchived({commit}, data) {\n commit('setElectionsLoadStatus', 1);\n\n ElectionAPI.getArchived(\n data.url\n )\n .then( ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Attempt to add player disk to Ith grid column | add(I, player) {
let empty = this.slice((i, j) => i == I).filter(cell => !cell.val);
if (empty.length) {
// Disk falls to the bottom-most available grid cell
let move = empty[empty.length-1];
// Add the player's disk and drop it into the grid
move.drop(player);
return move;
... | [
"function moveDisk(evt) {\n let clickedTower = evt.currentTarget;\n \n if (currentMode === \"pickUp\") {\n diskSelected = clickedTower.lastElementChild;\n diskSelected.style = \"border: 3px solid gold\";\n currentMode = \"putDown\"\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
inheritaning from super class vehicle | function Car(vehicletype,name,model,type){ //
Vehicle.call(this, vehicletype)
if(typeof(vehicletype) == typeof("")){
this.vehicletype = vehicletype;
}
else{
this.vehicletype = "Car";
}
if(typeof(name) == typeof("")){
this.name = name;
}
else{
this.name = "General";
... | [
"function Price(color, make, model, price){\n // this is how I can inherit the properties of Car\n Car.call(this,color, make, model)\n\n this.price = price\n // return `car color ${this.color}, model ${this.model}, maker ${this.make} and price is $${price}`\n}",
"function TruckFactory() {\n TruckFa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders the text header to the header cell. | __textHeaderRenderer() {
this.__setTextContent(this._headerCell._content, this.header);
} | [
"_defaultHeaderRenderer() {\n if (!this.path) {\n return;\n }\n\n this.__setTextContent(this._headerCell._content, this._generateHeader(this.path));\n }",
"_renderHeaderCellContent(headerRenderer, headerCell) {\n if (!headerCell || !headerRenderer) {\n return;\n }\n\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Restore the values of globals to undo the preceding pushGlobals() call. | function popGlobals() {
if (_globalsStack.length > 1) {
_globalsStack.pop();
}
_updateGlobals(G, _globalsStack[_globalsStack.length - 1]);
} | [
"function reInitializeGlobalVariable(){\n\t//empty all row in the designer area\n\t//$('#box-body').empty();\n\n\t//re-initialize the global values\t\n\t//delete gblEntityDesignJson[wrkTgtCollection];\n\tmstEntityDesignArr = [];\n\tselParentNodeArr = [];\n\twrkTgtCollection = '';\n}",
"set(name, value, global) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate case note submitted from the Home page quick add widget | function validQuickCaseNote (cseVals)
{
var errors = [];
//check description
if (cseVals[4].value === '')
{errors.push('<p>Please provide a description of what you did.</p>');}
//check if the time entered is greater than 0 hours and 0 minutes
if (cseVals[2].value == '0' && cseVals[3].value... | [
"function validCaseNote(cseVals)\n{\n\n\tvar errors = [];\n\n\t//check if a description has been put in the textarea\n\tif (cseVals[6].value === 'Describe what you did...' || cseVals[6].value === '')\n\t{errors.push('<p>Please provide a description of what you did.</p>');}\n\n\t//check if the time entered is greate... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Send an EWS request for the message's subject. | function sendRequest() {
// Create a local variable that contains the mailbox.
var mailbox = Office.context.mailbox;
debugger;
var request = getSubjectRequest(mailbox.item.itemId);
var envelope = getSoapEnvelope(request);
mailbox.makeEwsRequestAsync(envelope, callback);
} | [
"function sendRequest() {\n // Create a local variable that contains the mailbox. \n var mailbox = Office.context.mailbox;\n var request = getSubjectRequest(mailbox.item.itemId);\n var envelope = getSoapEnvelope(request);\n\n mailbox.makeEwsRequestAsync(envelope, callback);\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Scales player size depending on difficulty mode | function scalePlayer(mode){
return map(mode, 1,3,2,1);
} | [
"function setCardSize(){\n if (windowHeight/rangee < gameWidth/column){\n cardSize = windowHeight/rangee*0.7;\n }\n else {\n cardSize = gameWidth/column*0.7;\n }\n}",
"setScales() {\n this.r3a1_char_north.setScale(3);\n this.r3a1_char_south.setScale(3);\n this.r3a1_char_west.setScale(3);\n t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Show the code on selected code cells. | function showCode(notebook) {
if (!notebook.model || !notebook.activeCell) {
return;
}
const state = Private.getState(notebook);
notebook.widgets.forEach(cell => {
if (notebook.isSelectedOrActive(cell) && cell.model.type === 'code') {
cell.inputHid... | [
"function setCodeText(e) {\n document.querySelector(\"#language-selected\").innerHTML =\n extensionState.codeLanguage.charAt(0).toUpperCase() +\n extensionState.codeLanguage.slice(1);\n\n e = e || window.event;\n var keepWordList = e && e.shiftKey;\n\n // Change code snippet if shift key is no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to insert character information into 'chars' table | function charToDB(name, roomID, userID, langs, callback){
var insertobj = {};
insertobj["userID"] = new ObjectID(userID);
insertobj["roomID"] = new ObjectID(roomID);
insertobj["char_name"] = name;
insertobj["char_langs"] = langs;
mongoInsert("chars", insertobj, null, function(result, extra){
callback(re... | [
"function createCharacters() {\n _case_ = new character('_case_', 110, 4, 20);\n acid = new character('acid', 120, 2, 10);\n brute = new character('Brüte', 170, 1, 15);\n fdat = new character('f.dat', 150, 1, 12);\n }",
"function addChar(charName, roomID, email, langs, callback){ \n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a defer object containing the location pointing to a resolvedList with all the found coordinates. | function createAmbiguityList(locCoord) {
// make example working even if nominatim service is down
if (locCoord.input.toLowerCase() === "madrid") {
locCoord.lat = 40.416698;
locCoord.lng = -3.703551;
locCoord.locationDetails = formatLocationEntry({
city: "Madrid",
... | [
"function createAmbiguityList(locCoord) {\n locCoord.error = \"\";\n locCoord.resolvedList = [];\n var timeout = 3000;\n\n if (locCoord.isResolved()) {\n // if we changed only another location no need to look this up again\n var tmpDefer = $.Deferred();\n tmpDefer.resolve([locCoord]... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION NAME : setChildDevice2() AUTHOR : James Turingan DATE : December 18, 2013 MODIFIED BY : REVISION DATE : REVISION : DESCRIPTION : stores the data from cgi to json => devicesFilter PARAMETERS : DEV,hostname,ctr | function setChildDevice2(DEV,hostname,ctr){
var hname = hostname;
var InfoType = "JSON";
if(InfoType == "XML"){
var device = DEV.childNodes;
for(var i = 0; i < device.length; i++){
if(device[i].nodeName == "MODULE"){
var newModule = device[i];
var vId = newModule.getAttribute('ModuleVid');
var nam... | [
"function setChildDevice(DEV,hostname,ctr){\n\tvar hname = hostname;\n\tvar InfoType = \"JSON\";\n\tif(InfoType == \"XML\"){\n\t\tvar device = DEV.childNodes;\n\t\tfor(var i = 0; i < device.length; i++){\n\t\t\tif(device[i].nodeName == \"LINECARD\" ){\n\t\t\t\tvar newLC = device[i];\n\t\t\t\tvar LineCardVid = newLC... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
saveRemoteCookiesInSession As distinct from the cookies we set in the user browser, we need to fake a cookie jar for the cookies of the remote gallery. Storing this in session allows it to persist across multiple user requests. This is necessary because loading images from the remote gallery requires that you have a co... | function saveRemoteCookiesInSession(req, cookies) {
if (!req.session.remoteCookieStore) {
req.session.remoteCookieStore = [];
} else {
req.session.remoteCookieStore = [];
}
cookies.forEach(function(remoteCookie) {
req.session.remoteCookieStore.push(remoteCookie);
if (config.system.debug) {
conso... | [
"async function propagateBrowserCookieValues() {\n\n let zitiCookies = await ls.getWithExpiry(zitiConstants.get().ZITI_COOKIES);\n if (isNull(zitiCookies)) {\n zitiCookies = {}\n }\n\n // Obtain all Cookie KV pairs from the browser Cookie cache\n\tlet browserCookies = Cookies.get();\n\tfor (const cookie in b... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function splits the given Number of Seats and Aisle seats and constructs the srray which holds the Avalable Seats. lets say we have NumberOfSeats = 10 i.e. 09 Seats and [0,5,6,9] as aisle seats then the Object constructed will be [[0,1,2,3,4,5][6,7,8,9]] | initAvailableSeats(seatInfo) {
let availableSeats = {};
for (const key in seatInfo) {
if (seatInfo.hasOwnProperty(key)) {
const row = seatInfo[key];
let seats = [...Array(row.numberOfSeats || 0).keys()];
let aisles = row.aisleSeats || [];
... | [
"function prepareDataForReserve(data){\n var arr=[];\n for(let o in data[\"seats\"])\n {\n let c=(data[\"seats\"][o]);\n c.map(d1=>{\n let ret=o+\"\";\n ret+=d1;\n arr.push(ret);\n });\n\t\n }\n return arr;\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Splits the active hand into two hands | split() {
let playerHand = this.state.playerHand; // All player hands
let activeHand = this.state.playerHand[this.state.activeHand]; // Active player hand
let newHand = new Hand([]); // New hand
let cardToMove = activeHand.getCards()[1];
activeHand.removeCards(cardToMove);
... | [
"function HandleFrame(frame) {\t\n\tvar InteractionBox = frame.interactionBox;\n\t//No hand - variables undefine\n\tif(frame.hands.length == 1 || frame.hands.length == 2){\n\t\t//Grabs 1st hand per frame\n\t\tvar hand = frame.hands[0];\n\t\tHandleHand(hand,1,InteractionBox);\n\t\tif(frame.hands.length == 2){\n\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sorts array of jobs by distance | function sortByDistance(jobs){
jobs.sort(function(a,b){
if(a.distance > b.distance){ return 1}
if(a.distance < b.distance){ return -1}
return 0;
});
return jobs;
} | [
"function sortCoordsByDistance(array) {\n array.sort(function (current, next) {\n let dist_current = distanceBetweenPoints(character.real_x, character.real_y, current.x, current.y);\n let dist_next = distanceBetweenPoints(character.real_x, character.real_y, next.x, next.y);\n if (dist_curren... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SEARCH CODE matchSearchFunc for definition to searchTerm (EngPlain) | function matchSearchFuncEngPlain (searchTerm) {
return function(element) {
if (element.definition == searchTerm) {
return true;
} else {
return false;
}
}
} | [
"function matchSearchFuncEngRegex (searchTerm) {\n return function(element) {\n var re = \".*\" + searchTerm + \".*\";\n if (element.definition.match(re)) {\n return true;\n } else {\n return false;\n }\n }\n }",
"function myIndexOf(stri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This is a convenience method that generates code to read a variable, given its index and a Boolean that indicates whether it's a global. | getVariable (index, isGlobal) {
if (isGlobal) {
return this.op("get_global").varuint(index, "global_index");
} else {
return this.op("get_local").varuint(index, "local_index");
}
} | [
"setVariable (index, isGlobal, tee) {\n if (isGlobal) {\n if (tee) {\n this\n .op(\"set_global\").varuint(index, \"global_index\")\n .op(\"get_global\").varuint(index, \"global_index\");\n } else {\n this.op(\"set_global\").varuint(index, \"global_index\");\n }\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create transformation matrix for a shape | function create_matrix(index, global_mode,global_rotation,shapes_tx,shapes_ty,shapes_rotation,shapes_scale){
var mvMatrix = mat4.create(); // this is the matrix for transforming each shape before draw
//set into an identity matrix (after create you don't know if there's junk in it)
// set identity - fresh matri... | [
"function transformMatrix_(s, t) {\n return [t[0] * s[0] + t[1] * s[2],\n t[0] * s[1] + t[1] * s[3],\n s[0] * t[2] + s[2] * t[3],\n s[1] * t[2] + t[3] * s[3],\n s[0] * t[4] + s[4] + s[2] * t[5],\n s[1] * t[4] + s[3] * t[5] + s[5]];\n}",
"transform(transformation) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enable and hide all disabled fields in a form before submit | function enableFieldsForSubmit(theform) {
var elems = theform.elements;
for (var i = 0; i < elems.length; i++) {
if (elems[i].disabled) {
elems[i].style.visibility = "hidden";
elems[i].disabled = false;
}
}
} | [
"disableSubmitInputs() {\n this.jqueryForm.find('[type=submit]').each(function () {\n $(this).prop('disabled', true);\n });\n }",
"function disableAgencySubmit(disable) {\n $('#agencySubmit').attr('disabled', disable);\n}",
"function disableAttendeeSubmit(disable) {\n $('#atten... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the given matrix "result" as the interpolated values for "gradient" (float) between the ones of the matrices "startValue" and "endValue". | static LerpToRef(startValue, endValue, gradient, result) {
for (let index = 0; index < 16; index++) {
result._m[index] =
startValue._m[index] * (1.0 - gradient) + endValue._m[index] * gradient;
}
result._markAsUpdated();
} | [
"static Lerp(startValue, endValue, gradient) {\n const result = new Matrix();\n Matrix.LerpToRef(startValue, endValue, gradient, result);\n return result;\n }",
"static DecomposeLerp(startValue, endValue, gradient) {\n const result = new Matrix();\n Matrix.Decompo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Simple tree methods Adds the vampire as an offspring of this vampire | addOffspring(vampire) {
this.offspring.push(vampire);
vampire.creator = this;
} | [
"addOffspring(vampire) {\n // should add parent as creator\n vampire.creator = this;\n this.offspring.push(vampire);\n }",
"vampireWithName(name) {\n\n if (this.name === name) {\n return this;\n }\n for (let child of this.offspring) {\n let vampire = child.vampireWithName(name);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API bool InputInt(const char label, int v, int step = 1, int step_fast = 100, ImGuiInputTextFlags extra_flags = 0); | function InputInt(label, v, step = 1, step_fast = 100, extra_flags = 0) {
const _v = import_Scalar(v);
const ret = bind.InputInt(label, _v, step, step_fast, extra_flags);
export_Scalar(_v, v);
return ret;
} | [
"function InputInt2(label, v, extra_flags = 0) {\r\n const _v = import_Vector2(v);\r\n const ret = bind.InputInt2(label, _v, extra_flags);\r\n export_Vector2(_v, v);\r\n return ret;\r\n }",
"function InputInt3(label, v, extra_flags = 0) {\r\n const _v = import_Vector3(v);\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Only edit price for caretaker, pet must exist first in caretaker's table already | async function edit_caretaker_price_of_pet(req, res, next) {
var username = req.user.username;
var type = req.body.type;
var price = req.body.price;
var data;
try {
data = await pool.query(sql_query.query.caretaker_fulltime_parttime, [username]);
if (data.rows[0].is_fulltime) {
co... | [
"async price_update() {}",
"function addEditClick() {\r\n $(\".edit_btn\").on(\"click\", function (evt) {\r\n evt.preventDefault();\r\n id = evt.target.id;\r\n const filtered = cupcakes.filter((c) => c.id == id);\r\n const cupcake = filtered[0];\r\n $(\".cupcake_list\").html(\"\");\r\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the address has a number, a label, a zip code and a city using a regex. | function validateAddress() {
var addressInput = $('#register-address');
var addressInputValue = addressInput.val();
var addressRegex = /^\d+\s([A-Z]?[a-z]+\s){2}\d{5}\s[A-Z]?[a-z]+$/;
if (addressInputValue.match(addressRegex)) {
validInput(addressInput);
} else {
invalidInpu... | [
"function zipOrCity(searchInput) {\n regexp = /^[0-9]{5}(?:-[0-9]{4})?$/;\n\n if (regexp.test(searchInput))\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"function validateAddress() {\n return checkPersonalInfo(\"address\", \"Add... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the class name for a specific cell | function getClassName(location) {
var cellClass = 'cell-' + location.i + '-' + location.j;
return cellClass;
} | [
"function OnCellClick(){\n this.classList.add(\"clicked\");\n // console.log(this);\n}",
"function resolveGridColorClass(cell)\n{\n\tvar cc = \"gold\";\n\tif(cell.detected>0)\n\t{\n\t\t// apply the detected bin\n\t\tif(cell.detected < 5)\n\t\t{\n\t\t\tcc = \"blue1\";\n\t\t}\n\t\telse if(cell.detected < 51)\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Parse the visualization settings passed in the World settings of MATRX. Also changes the bg if needed | function parse_vis_settings(vis_settings) {
bg_colour = vis_settings['vis_bg_clr'];
bg_image = null;
if (Object.keys(vis_settings).includes('vis_bg_img') && vis_settings['vis_bg_img'] != null) {
bg_image = fix_img_url(vis_settings['vis_bg_img']);
}
// update background colour / image if ne... | [
"function parse_world_settings(world_settings) {\n tps = (1.0 / world_settings['tick_duration']).toFixed(1);\n current_tick = world_settings['nr_ticks'];\n\n if (current_tick > latest_tick_processed + 1) {\n console.log(\"Dropped frame, current tick:\", current_tick, \" last tick processed: \", late... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. makeTimeSliceGraph and its helper functions / Given a timeseries graph and a string matching a timestamp in that graph, returns a new graph containing only data present at that particular moment. Can generate a timeslice from a C3 graph specification with an xaxis of either "timeseries" (like a Long Term Average gra... | function makeTimeSliceGraph (timestamp, graph) {
let slicedData = [];
let timestamps = [];
let sliceIndex = -1;
if(graph.axis.x.type == "timeseries") {
//x-axis has a series of dates
timestamps = graph.data.columns.find(function(series) {return series[0] === 'x'});
}
else if(graph.axis.x.type == "c... | [
"slice(begin, end) {\n const size = this.size();\n const b = resolveBegin(begin, size);\n const e = resolveEnd(end, size);\n\n if (b === 0 && e === size ) {\n return this;\n }\n\n const events = [];\n for (let i = b; i < e; i++) {\n events.push(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If a change Document has not been provided, prompt for one. This will use the change document Validator. | async changeDocumentStep(stepContext) {
const changeDocument = stepContext.options;
if(stepContext.parent.result){
// changeDocument.intent = stepContext.parent.intent;
if (!changeDocument.number) {
return await stepContext.beginDialog(CD_VALIDATOR_DIALOG, { cha... | [
"get newDoc() {\n return (\n this._doc || (this._doc = this.changes.apply(this.startState.doc))\n )\n }",
"function LoadDocumentBtnClicked() \n{\n\n //Initialize Viwer\n\tOnInitializeViwer();\n\t\n //get the document provided by the user\n documentId = document.getElementById(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Private helper to create a tooltip item model | function createTooltipItem(element) {
var xScale = element._xScale;
var yScale = element._yScale || element._scale; // handle radar || polarArea charts
var index = element._index;
var datasetIndex = element._datasetIndex;
return {
xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '',
... | [
"generateToolTip() {\n //Order the data array\n let data = formatArray.collectionToBottom(this.data, ['Database IDs', 'Comment']);\n\n if (!(data) || data.length === 0) {\n return generate.noDataWarning(this.name);\n }\n\n //Ensure name is not blank\n this.validateName();\n\n if (!(this.da... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check project root and composer.json | function preFlightCheck(root) {
if (!fs.existsSync(root)) {
throw new Error('Invalid project root');
}
consola.success('Found project root');
if (!fs.existsSync(root + '/composer.json')) {
throw new Error('composer.json not found in project root');
}
consola.success('Found compos... | [
"function checkRepo() {\n\t\tif (!pkg.repository) {\n\t\t\tproblems.push({\n\t\t\t\tmessage: `cannot found \"repository\" in package.json.`\n\t\t\t});\n\t\t}\n\t}",
"function findCliConfig() {\n return ['angular.json', '.angular.json', 'angular-cli.json', '.angular-cli.json'].find(file => fs.existsSync(file));... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Split a block tags contents in to an array of bits that contains the type of block node, and any arguments that were passed to the block node if they exist. | function makeBits(blockToken) {
return (function (bits, split) {
// Remove empty strings and strip whitespace.
for (i = 0; i < split.length; i++) {
(function (bit) {
return bit === "" ? null : bits.push(bit);
}(strip(split[i])));
... | [
"function _extract_tags(cblock, tags) {\n var extracted = tags.map(function(tag) {\n return cblock[tag];\n });\n if (extracted[0] === undefined)\n return null;\n // Verify that, in case of loops, all tags have the same length\n var basetype = extracted[0].type;\n var baselen = null;\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Mark/unmark todo as done Move todo to bottom if done If unmarked, move up (before first marked as "done") | markAsDone(state, todoIndex) {
let markedTodo = null;
const markAndMove = () => {
state.todos[todoIndex].isDone = !state.todos[todoIndex].isDone;
markedTodo = state.todos.splice(todoIndex, 1);
};
let insertIndex = null;
for (let i = 0; i < state.todos.length; i++) {
... | [
"moveTaskBack(task) {\n const index = this.state.tasksDone.indexOf(task);\n this.state.tasksDone.splice(index, 1);\n this.state.toDoTasks.unshift(task);\n this.setState({toDoTasks: this.state.toDoTasks,\n tasksDone: this.state.tasksDone\n })\n }",
"moveToTasksDone(t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to downlaod svg with id 'visual' | function download () {
//get svg element.
var svg = document.getElementById("visual");
//get svg source.
var serializer = new XMLSerializer();
var source = serializer.serializeToString(svg);
//add name spaces.
if(!source.match(/^<svg[^>]+xmlns="http\:\/\/www\.w3\.org\/2000\/svg"/)){
source = sourc... | [
"_downloadSvgAsPng() {\n savesvg.saveSvgAsPng(document.getElementById(\"svg\"), \"timeline.png\");\n }",
"function getSvg(){\r\n return d3.select('svg');\r\n }",
"function exportSvgClick() {\n const filename = Data.IsSavedDiagram ?\n Data.SavedDiagramTitle :\n decodeURIComponent(Data.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deletes a message on a timeout. | function deleteMessage(message) {
message.delete(deleteTimeout);
} | [
"function prevMsgDelete() {\n message.delete([300])\n .then(msg => console.log(`Deleted message from ${msg.author.username}`))\n .catch(console.error);\n }",
"async deleteMessage() {\n try {\n await AsyncStorage.removeItem('messages');\n } catch (er... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handle months error message for periods | function showMonthsPeriodErrorIfPresent(error, id) {
if (!isEmpty(error)) {
$("#monthsError_"+id).text(error);
}
} | [
"function getValidMonth(){\r\n\treturn 3;\r\n}",
"function DateTimeDayMonth() { }",
"function hasProperDaysPerMonth(element){\n\t\n\t\t// months of the year\t\n\t\tvar MONTHS_ARRAY = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \n\t\t\t\"September\", \"October\", \"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Handles object size & sprite updates. Should get rid of this in favor of accessors. | function __handle_sprite__(_object_) {
if (_object_.sprite_index == null) return;
_object_.sprite_width = _object_.sprite_index.width;
_object_.sprite_height = _object_.sprite_index.height;
_object_.sprite_xoffset = _object_.sprite_index.xoffset;
_object_.sprite_yoffset = _object_.sprite_index.yoffset;
_object_.i... | [
"function massOfObjAChange(scope) {\n mass_ball_a = scope.mass_of_a;\n getChild(\"ball_a\").scaleX = 0.5 + (scope.mass_of_a - 1) / 20;\n getChild(\"ball_a\").scaleY = 0.5 + (scope.mass_of_a - 1) / 20;\n ball_a_radius = (getChild(\"ball_a\").image.height * getChild(\"ball_a\").scaleY) / 2;\n}",
"update()\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checking preferences setup on the index page | function checkPreferences() {
// Check for preferences
if (typeof (Storage) !== "undefined" && window.location.pathname.indexOf("dashboard.php") === -1) {
var location_value = localStorage.location;
if (location_value !== undefined && location_value !== "") {
var element = document.getElementById('location');
... | [
"function checkSettings() {\n\tconsole.log('--checking for db settings...');\n\tlet settings;\n\ttry {\n\t\tsettings = db.getData('/settings');\n\t} catch (err) {\n\t\tsettings = {\n\t\t\twhiteList: [],\n\t\t\tlandingBg: {\n\t\t\t\tenable: false,\n\t\t\t\turl: ''\n\t\t\t},\n\t\t\tautoCrop: true\n\t\t};\n\t\tdb.push... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Renders all roles into a table | function viewRoles() {
connection.query("SELECT title FROM role;", function (err, res) {
renderTable2(err, res, "Role Title", "title");
})
} | [
"function showAllRoles() {\n query = 'SELECT * FROM role;';\n connection.query(query, (err, results) => {\n if (err) throw err;\n console.table(results);\n // return to main menu\n askUser();\n });\n}",
"function populate_roles_fields () {\n // Populate the fields from the roles table\n for (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update position based on the selected anchor node | _recalculatePosition() {
if (!this._isActive()) { return; }
const anchorNode = this._getAnchorNode();
const rect = anchorNode.getBoundingClientRect();
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
let node = ReactDOM.findDOMNode(this);
node.style.top = rect.top ... | [
"function updateAnchor() {\n\t\tif (!labels.selection) return;\n\t\tlabels.selection.each(function(d) {\n\t\t var bbox = this.getBBox(),\n\t\t x = bbox.x + bbox.width / 2,\n\t\t y = bbox.y + bbox.height / 2;\n\t\t \n\t\t d.anchorPos.x = x;\n\t\t d.anchorPos.y = y;\n\t\t \n\t\t // If a label ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This acts as a base class for all distributions. | function Distribution() {} | [
"function Distribution(props) {\n return __assign({ Type: 'AWS::CloudFront::Distribution' }, props);\n }",
"static add(entryDistribution){\n\t\tlet kparams = {};\n\t\tkparams.entryDistribution = entryDistribution;\n\t\treturn new kaltura.RequestBuilder('contentdistribution_entrydistribution', 'a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Method to get the formatter method for a given field key | getFieldFormatter(key) {
const field = this.computedFieldsObj[key]
// `this.computedFieldsObj` has pre-normalized the formatter to a
// function ref if present, otherwise `undefined`
return field ? field.formatter : undefined
} | [
"getGetterName () {\n\t\tconst definition = this.definition;\n\t\tlet getterName;\n\n\t\tgetterName = definition.getter;\n\n\t\tif (!getterName) {\n\t\t\tconst name = definition.name;\n\t\t\tconst Name = (name.substr(0, 1).toUpperCase() + name.substr(1));\n\n\t\t\tgetterName = ('get' + Name);\n\t\t}\n\n\t\treturn g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Chord Bank, Patch and PitchwheelDeviation messages Returns undefined if there are no attributes | function attributesMoment(channel, midiChordDef)
{
var attrMoment,
msg,
attributes;
/// Sets both RegisteredParameter controls to 0 (zero). This is standard MIDI for selecting the
/// pitch wheel so that it can be set by the subsequent DataEntry messages.
/// ... | [
"function getChordMoments(channel, midiChordDef, msDurationInScore)\n\t\t{\n\t\t\tvar i, j,\n len = midiChordDef.basicChordsArray.length,\n pitches,\n pitchesLength,\n basicChordDef,\n msPositionInChord = 0,\n allNoteOffs = []... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Validate the database name | function validateDatabaseName(databaseName) {
if (typeof databaseName !== 'string')
throw MongoError.create({ message: 'database name must be a string', driver: true });
if (databaseName.length === 0)
throw MongoError.create({ message: 'database name cannot be the empty string', driver: true });
if (datab... | [
"function name_check() {\r\n name_warn();\r\n final_validate();\r\n}",
"function nameValidation() {\n // Name validation\n const nameValue = name.value;\n const nameValidator = /[a-zA-z]+/.test(nameValue);\n\n return nameValidator;\n}",
"function getLegalDBName(input) {\n input = input.toLowerCase();... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prepares event array for local storage. Removes moment objects. | function prepareEventsForStorage(events) {
const prepared = events.map(event => {
const { startObj, endObj, ...rest } = event;
return rest;
});
return JSON.stringify(prepared);
} | [
"function loadFakeEvents () {\n\tif(localStorage.getItem('event') == null) {\n\t\t//load in fake events array\n\t\tlocalStorage.setItem('event', JSON.stringify(fake_events));\n\t}\n}",
"clearUncommittedEvents () {\n this._uncommittedEvents = [];\n }",
"getDanglingAudioEvents(millis, events){\n let ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Empty constructor for the Constants class. | function Constants() {
throw new Error('Constants should not be instantiated!');
} | [
"function SingletonClass() {}",
"get OccludeeStatic() {}",
"constructor() { \n \n ConfigHash.initialize(this);\n }",
"function MppOptions() {\n throw new Error('This is a static class');\n}",
"function DocBookNamespace()\n{\n\tthis.Strings = new Object;\n}",
"constructor() {\r\n sup... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Push string onto the stack. | pushString(s) {
this.pushObject(s);
} | [
"push(val) {\n this._stack.push(val);\n }",
"push(msg) {\r\n this._msgStack.push(msg)\r\n }",
"stackPush(byte) {\n this.writeRam({ address: 0x0100 + this.cpu.sp, value: byte });\n this.decrementRegister('sp');\n }",
"pushToken(token) {\n this.stack.push(token);\n }",
"push(e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns true if all key/value pairs in the given query are currently active. | function queryIsActive(query, activeQuery) {
if (activeQuery == null) return query == null;
if (query == null) return true;
for (var p in query) if (query.hasOwnProperty(p) && String(query[p]) !== String(activeQuery[p])) return false;
return true;
} | [
"_query_is_valid() {\n let valid = this._required.reduce((res, key) => {\n return res && this._param_is_set(key);\n }, true);\n\n for (let [parent_key, one_required] of Object.entries(this._one_required)) {\n valid =\n valid &&\n one_required.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Make sure the scale of the object is within a given range, else, switch the scale direction | function maintainScale(item) {
var small = 5; // smallest allowed size (diameter, not radius)
var large = 20; // largest allowed size (diameter, not radius)
if ((item.bounds.width >= large) || (item.bounds.width <= small)) {
item.data.scale.direction *= -1; // reverse direction
}
} | [
"function _scaling ( /*[Object] event*/ e ) {\n\t\tvar activeObject = cnv.getActiveObject(),\n\t\tscale = activeObject.get('scaleY') * 100;\n\t\tif ( scale > 500 ) {\n\t\t\tactiveObject.scale(5);\n\t\t\tactiveObject.left = activeObject.lastGoodLeft;\n \tactiveObject.top = activeObject.lastGoodTop;\n\t\t}\n\t\tac... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
BigNat > Int > Int | function h$ghcjsbn_indexBigNat(b, i) {
h$ghcjsbn_assertValid_b(b, "indexBigNat");
h$ghcjsbn_assertValid_s(i, "indexBigNat");
var bl = b[0];
return i >= bl ? 0 : b[i+1];
} | [
"static int64(v) { return n(v, -64); }",
"static int128(v) { return n(v, -128); }",
"static int8(v) { return n(v, -8); }",
"static int208(v) { return n(v, -208); }",
"isBigInt() {\n return !!(this.type.match(/^u?int[0-9]+$/));\n }",
"function bool(i) /* (i : int) -> bool */ {\n return $std_cor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return true if current can be used for model run: if workset in readonly state | isReadonlyWorksetCurrent () {
return this.worksetCurrent?.Name && this.worksetCurrent?.IsReadonly
} | [
"isUseCurrentAsBaseRun () {\n return this.isCompletedRunCurrent && (!this.isReadonlyWorksetCurrent || this.isPartialWorkset())\n }",
"isPartialWorkset () {\n return (Mdf.worksetParamCount(this.worksetCurrent) !== Mdf.paramCount(this.theModel)) &&\n (!this.worksetCurrent?.BaseRunDigest || !th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
using useStare in React whatever the user inputs the emoji it is rendered and matched with DB | function emojiInputHandler(event) {
var userInput = event.target.value;
// var meaning = emojiDictionary[userInput];
if (userInput in emojiDictionary) {
setMeaning(emojiDictionary[userInput]);
} else setMeaning("That's a new one! We don't have this in our database");
} | [
"textChangeHandler(event) {\n let newConvertedText = \"\"\n let buffer = \"\";\n\n for (let i = 0; i < event.target.value.length; i++) {\n let targetChar = event.target.value.charAt(i);\n\n if (JAPANESE_CHARACTER_REGEX.test(targetChar)) {\n newConvertedText ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get Results directory from the case on a popup dialog The dialog is shown BELOW the popup. BUG. | function getResultsDirForCaseStep(tag) {
var callback_on_accept = function(selectedValue) {
console.log(selectedValue);
var popup = katana.$activeTab.find("#editCaseStepDiv").attr('popup-id');
// Convert to relative path.
var pathToBase = katana.$activeTab.find('#savefilepath').t... | [
"function getResultsDirForCase(tag) {\n var callback_on_accept = function(selectedValue) { \n \t\tconsole.log(selectedValue);\n \t\t// Convert to relative path.\n \t\tvar savefilepath = katana.$activeTab.find('#savefilepath').text();\n \t\tconsole.log(\"File path ==\", savefilepath);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |