query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
createDropdownMenu generate the dropdown menu which displays the programs that the user can select from | function createDropdownMenu() {
var dropdownMenuItems = document.getElementsByClassName("gen-tree");
for (var i = 0; i < dropdownMenuItems.length; i++) {
dropdownMenuItems[i].onclick = function() {
updateProgramTitle(this.innerHTML);
var tableId = 'course-table';
var program = thi... | [
"function createDropDownMenu() {\r\n $(\"ul#topMenu\").empty();\r\n var a = [];\r\n var menuName = [\"Process\", \"Application\", \"System\"];\r\n for (var menuType = 2; menuType >= 0; menuType--) {\r\n var ddMenu = appx_session.currentmenuitems.dropdown[menuType];\r\n for (var i = 0; i < ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check location parameter exists | function paramExist(req, res, next) {
// If location query has been sent then return something
if (req.query.location) {
next();
}
// If location paramter is missing then give correct HTTP code and informative JSON message
else {
res.json(400, {
'error': 'Missing pa... | [
"function is_param_exist() {\n if(document.URL.indexOf('?') != -1){\n return true;\n }\n return false;\n }",
"function hasLocation( search ) {\n var location = getLocationObject();\n return location && typeof location.locations[ search ] !== 'undefined';\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Deserialize a JSON representation of a state. `config` should have at least a `schema` field, and should contain array of plugins to initialize the state with. `pluginFields` can be used to deserialize the state of plugins, by associating plugin instances with the property names they use in the JSON object. | static fromJSON(config, json, pluginFields) {
if (!json)
throw new RangeError("Invalid input for EditorState.fromJSON");
if (!config.schema)
throw new RangeError("Required config field 'schema' missing");
let $config = new Configuration(config.schema, config.plugins);
let instance = new Edit... | [
"deserialize(state) {\n return jsonToBlocks(state)\n }",
"reconfigure(config) {\n let $config = new Configuration(this.schema, config.plugins);\n let fields = $config.fields, instance = new EditorState($config);\n for (let i = 0; i < fields.length; i++) {\n let name = fields[i].name;\n inst... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET recupera los favoritos de un usuario registrado | async getAllFavs(req, res, next) {
try {
const userId = req.param('id');
const favs = await Usuario.findOne({_id:userId}).populate('favoritos').exec();
res.json({success: true, favorites: favs});
}catch (e) {
console.log('ERROR: ', e);
next(e);... | [
"sendFavorites(req,res){\n lib.findCurrentUser(req).then((foundUser)=>{\n return res.status(200).send(foundUser.favorites);\n });\n }",
"async function getAllFavorites() {\n\tconst {data} = await httpService.get(`${config.API_URI}/userData/favorites/all`);\n\treturn data;\n}",
"async favorites(req, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ServerSynch button click event handler | function OnBtnServerSynch_Click( e )
{
OnBtnServerSynch() ;
} | [
"function OnBtnServerSynch_Click( e )\n{\n OnBtnServerSynch() ;\n}",
"function bttnClick(){\n PostNewOperation(\"\")\n }",
"function OnBtnServerSynch()\r\n{\r\n try\r\n {\r\n if( Titanium.Network.networkType === Titanium.Network.NETWORK_NONE )\r\n {\r\n alert( L( 'gen... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Highlight in the menu of links the first section that is showing | function highlightFirstVisibleSection() {
const sections = document.querySelectorAll("section");
// Find the closest visible section
let winningSection = { id: "", y: 9999 }; // seed
for (const section of sections) {
const location = section.getBoundingClientRect();
if ((location.y > 0) & (location.y <... | [
"function setNavHighlight() {\n // navVisible();\n const sections = getSections();\n for(const section of sections ) {\n const currentPos = getCurPos (section);\n const currentItem = document.querySelector('.menu__link.'+section.id);\n if(currentPos.top < 150 && currentPos.bottom > 150... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
send request to commit/save to github | function commitGithub(GH, UI) {
var d = new Date()
var ds = d.toLocaleDateString()
var ts = d.toLocaleTimeString()
var data = GH.parse(UI);
data['editcontent'] = UI.geteditor();
data['commitmsg'] = "Updated from Brython Server: "+ds+" "+ts;
$.ajax({
ur... | [
"function commitGithub(GH, UI) {\n var d = new Date();\n var ds = d.toLocaleDateString();\n var ts = d.toLocaleTimeString();\n var data = GH.parse(UI);\n data['editcontent'] = UI.geteditor();\n data['commitmsg'] = \"Updated from Brython Server: \" + ds + \" \" + ts;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Saves grid contents as HTML to be opened in Excel; called by button in grid (see Java class Gridhelper, method writeNavButtons). | function saveGridAsExcelHtml(gridId, dispType) {
sendGridToServerAsExcelHtml(gridId, getCorePath() + "/gridToExcelHTML.jsp?date=" + new Date(), dispType);
return false;
} | [
"reportExport(){\n bcdui.component.exports.exportWysiwygAsExcel({rootElement: this.gridRenderingTarget});\n }",
"function sendGridToServerAsExcelHtml(grid, url, dispType) {\r\n ourl = url;\r\n odispType = dispType;\r\n formatGridAsCsvOrHtml(grid, 0, \"HTML\");\r\n}",
"function exportGridToExcel(){\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create and track xhr request spans | function xhrCallback(
handlerData,
shouldCreateSpan,
shouldAttachHeaders,
spans,
) {
if (
!hasTracingEnabled() ||
(handlerData.xhr && handlerData.xhr.__sentry_own_request__) ||
!(handlerData.xhr && handlerData.xhr.__sentry_xhr__ && shouldCreateSpan(handlerData.xhr.__sentry_xhr__.url))
... | [
"function xhrCallback(handlerData, shouldCreateSpan, spans) {\n var _a, _b;\n if (!utils_2.hasTracingEnabled() || ((_a = handlerData.xhr) === null || _a === void 0 ? void 0 : _a.__sentry_own_request__) ||\n !(((_b = handlerData.xhr) === null || _b === void 0 ? void 0 : _b.__sentry_xhr__) && shouldCreat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return the most common number if there is a tie, return the lower number loop through all of the items in the arr create a count obj also have a highest num and count key which keeps track of the highest return the highest num | function mostCommon(arr) {
let count = {
highestCount: 0,
highestNum: null
};
let sortedArr = arr.sort()
for (let i = 0; i < sortedArr.length; i++) {
let num = sortedArr[i];
if (count[num]) {
count[num]++
if (count[num] > count.highestCount) {
count.highestCount = count[nu... | [
"function mostFrequentItem (arr) {\n var count = {}\n for (var i = 0; i < arr.length; i++) {\n if (Object.keys(count).includes(arr[i]) === false) {\n count[arr[i]] = 1\n } else {\n count[arr[i]] += 1\n }\n }\n var max = ['', 0]\n for (var key in count) {\n if (count[key] > max[1]) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Core functions Updates the users information with their new password or with original. Returns the modal to view mode from edit mode. Sets the attemptedSubmit state to true to detect errors if any are encountered. | onUpdate() {
this.setState({ attemptedSubmit: true });
if (this.state.changePassword) this.updateWithNewPassword();
else this.updateUser();
this.props.onReturn();
} | [
"function updatePasswordUser(idx) {\n\t$(\"#change-password\").val(\"\");\n\t$(\"#change-password2\").val(\"\");\n\t$(\"#dialog-password\").dialog({\n\t\tmodal : true,\n\t\tautoOpen : false,\n\t\tbuttons : {\n\t\t\t\"OK\" : function() {\n\t\t\t\t$(this).dialog(\"close\");\n\t\t\t\tvar pass = $(\"#change-password\")... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Safe parse json string to order. Converts unsafe numbers to strings. Converts all LONG fields with converter if provided | function parseOrder(str, toLongConverter) {
const ord = parse(str);
const schema = ord.version === 2 ? schemas_1.orderSchemaV2 : schemas_1.orderSchemaV1;
return toLongConverter ? index_1.convertLongFields(ord, schema, toLongConverter) : ord;
} | [
"function fixLongInts(rawBytes) {\n if (!rawBytes)\n return rawBytes;\n\n var matchNonQuotedLongInts = /\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|([:\\s][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]*)[,\\s}]/ig;\n var longIntCount = 0;\n var matchAr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
prepends the given value to the environment variable | function prependEnv(envName, envValue, divider=' ') {
let existingValue = process.env[envName];
if (existingValue) {
envValue += `${divider}${existingValue}`
}
core.exportVariable(envName, envValue);
} | [
"setEnvVar(name, value, callback) {\n this.query('SET @' + name + ' = ' + this.escape(value), [], (results, error) => {\n callback(results, error);\n });\n }",
"setEnvVar(name, value) {\n // Set variable both as env var and as step variable, which might be re-used in subseqeunt steps. \n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
delete all construction notes up to this index point (not inclusive) | function deleteToHere (index) {
// set construction points to animating
svg.select('.construction-notes').selectAll('rect')
.attr('animating', 'yes')
.attr('selected', 'false')
// disable choice mouse events
svg.select('.choice-notes').selectAll('rect')
.on('mousedown', null)
... | [
"function note_delete(_noteindex){\r\n\tif(_noteindex>=0 & _noteindex<notes.length) {\r\n\t\tnotes.splice(_noteindex,1);\r\n\t\tnumnote--;\r\n\t}\r\n}",
"function deleteNote(index){\r\n noteArray.splice(index,1);\r\n saveAll();\r\n decryptNotes();\r\n}",
"function clearDeleted() {\n for (let i = 0;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Now, need a function to check if a point is in the REGIONS and update occupancy count For convenience, we'll have it return also the list of region names occupied by the point. | function updateCount( x, y, regions ) {
var occupied = []; // This will hold the list of regions occupied by this point
for (var r in regions)
{
if (x >= regions[r].ul[0] && x <= regions[r].lr[0] && // Just like region checking code you already have,
y <= regions[r].ul... | [
"function checkRegion(coordinates) {\n\n}",
"getRegionsInView()\n {\n var bottomLeftPos = this.screenToWorldPos(0, window.innerHeight);\n var bottomLeftRegion = WORLD.getRegionPositionFromWorldPosition(bottomLeftPos.x, bottomLeftPos.y);\n\n var xRegionMax = Math.floor(((bottomLeftRegion.x ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks to see if there are bees in the same place as the queen | get queenHasBees() {
return this._queenPlace.bees.length > 0;
} | [
"function checkQueens(){\n\t\tlet deadQueens = 0\n\t\tfor (let i = 0; i < bees.length; i++) {\n\t\t\tif(bees[i].type === \"Queen\" && bees[i].status === \"dead\" ){\n\t\t\t\tdeadQueens ++\n\t\t\t}\n\t\t}\n\t\treturn deadQueens\n\t}",
"canPlace( x2, y2) {\n // This function will check if queen can be placed (x2... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the usual default settings. Settings used: Binary mode (TYPE I) File structure (STRU F) Additional settings for FTPS (PBSZ 0, PROT P) | async useDefaultSettings() {
const features = await this.features();
// Use MLSD directory listing if possible. See https://tools.ietf.org/html/rfc3659#section-7.8:
// "The presence of the MLST feature indicates that both MLST and MLSD are supported."
const supportsMLSD = features.has("M... | [
"async useDefaultSettings() {\n const features = await this.features();\n // Use MLSD directory listing if possible. See https://tools.ietf.org/html/rfc3659#section-7.8:\n // \"The presence of the MLST feature indicates that both MLST and MLSD are supported.\"\n const supportsMLSD = feat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set the container height so that the table of content is using the viewport to display its content without scrolling issue | function setContainerHeight() {
if (!isMobileView()) {
// the height is viewport - header so that the last toc will be in
// view without the need to scroll the outer container
$('#background-container').css('height', $(window).height() - $('header').height());
$('#background-con... | [
"function setTableWrapperHeight(container) {\n\t\t\t// max height for the table container\n\t\t\tvar accesoriesHeight = $(opt.pagerSelector).height();\n\t\t\tvar gcHeader = $('.d3g-header');\n\n\t\t\tif (gcHeader) {\n\t\t\t\taccesoriesHeight += gcHeader.height();\n\t\t\t}\n\n\t\t\tvar tableMaxHeight = $(window).hei... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SEARCHPAGE FUNCTIONS // Validates the search input to see if it matches a known suburb or parkname. OUTPUT: Returns true if query matches, false if query doesn't match. | function searchQueryValidate(){
for (var i = 0; i < suburbs.length; i++){
suburbs[i] = suburbs[i].replace("'", "'");
if (searchbarInput.value.toUpperCase() == suburbs[i].toUpperCase()){
return true;
}
}
for (var i = 0; i < parkNames.length; i++){
parkNames[i] = parkNames[i].replace("'", "'");
... | [
"function searchpagevalidate(ref) {\r\n\t// search box is called \"search\", not keyword\r\n\tif (ref.search.value.search('^[ A-Za-z0-9_\\\\.-]+$') !=-1)\r\n\t{\r\n\t \treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert('Need a valid keyword to \\nsearch on!');\r\n\t\treturn false;\t\t\t\r\n\t}\r\n}",
"function ch... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
named constructs a NetworkPolicy with metadata.name set to name. | function named(name) {
return new NetworkPolicy({ metadata: { name } });
} | [
"function named(name) {\n return new Namespace({ metadata: { name } });\n }",
"function named(name) {\n return new Node({ metadata: { name } });\n }",
"getNamedPolicy(ptype) {\n return __awaiter(this, void 0, void 0, function* () {\n return this.model.getPolicy('p', ptype);... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
World x coord to screen Status: done | WorldToScreenX(x) {
return Math.round((this.center.x + this.scale.px*x));
} | [
"function GetCurrentLocationX()\n{\n var r, g, b, p;\n boxee.getActiveWidget().mouseMove(0,0);\n for (var x = progress_x1; x < progress_x2; x += progress_skip_pixels)\n {\n p = boxee.getActiveWidget().getPixel(x, progress_y);\n b = B(p);\n g = G(p);\n r = R(p);\n if(g < 100 || g == 255)\n {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
1. creates template 2. adds it to 'templates' collection as any other document, using addDocument function | function addTemplate(templateName, fieldsArray,callback){
createTemplate(templateName,fieldsArray, function(readyTemplate){
addDocument('templates',readyTemplate,function(result){
callback(result)})})
} | [
"createTemplate(doc){\n\t\t\tthis.get('commandRegistry').execute(DOCUMENT_SAVEAS_TEMPLATE, doc);\n\t\t}",
"function addTemplate() {\n var newTemplate = new template($(\"#templateName\")[0].value, $(\"#checkbox1\")[0].value, $(\"#checkbox2\")[0].value, $(\"#checkbox3\")[0].value,\n $(\"#checkbox4\")[0].v... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function is the handler for the idle time counter. This gets run once per second. It increments the idle counter and checks the counter against the IDLE_TIMEOUT value and sends the user back to the main menu (if the user is not already there) after the timer runs out. It also lets you use an element "SecondsUntilE... | function CheckIdleTime() {
_idleSeconds++;
var oPanel = $("#SecondsUntilExpire");
if (oPanel)
oPanel.html((IDLE_TIMEOUT - _idleSeconds) + "");
if (_idleSeconds >= IDLE_TIMEOUT) {
//No need to go to the main_menu page if we are already there
if (curr_page != "main_menu") {
... | [
"function handleIdleTimeout() {\n // console.log(idleTimeout);\n // re: Req R4 description, setTimeout() implements a one-shot timer,\n // setInterval continues the alerts until the user is no longer idle.\n // therefore, using setInterval and not setTimeout.\n window.setInterval(() => {\n if (idleTimeout =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Loads view from specified file path. | loadView(filePath, options) {
const resource = 'file://' + this.getView(filePath);
this._internalWin.loadURL(resource);
} | [
"function loadView(viewpath, callback) {\n _fs.readFile(viewpath, fileEncoding, function (err, content) {\n if (err) throw err;\n callback(content);\n });\n }",
"function loadView(path, element) {\n if (!(path in view_cache)) {\n $.get(path, function (html)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
All labels should have a for attribute. See also: hasNoEmptyForAttributes(). | function hasNoLabelsMissingForAttributes() {
const problemLabels = elementData.label
.filter(label => label.for === null)
.map(label => stringifyElement(label));
if (problemLabels.length) {
const item = {
// description: 'All labels should have a for attribute.',
details: 'Found label(s) wit... | [
"function hasNoEmptyForAttributes() {\n const problemLabels = elementData.label\n .filter(label => label.for === '')\n .map(label => stringifyElement(label));\n if (problemLabels.length) {\n const item = {\n // description: 'The for attribute of a label must not be empty.',\n details: 'Found la... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Task "ALAHLY" and "Zamalek" are the best teams in Egypt, but "ALAHLY" always wins the matches between them. "Zamalek" managers want to know what is the best match they've played so far. The best match is the match they lost with the minimum goal difference. If there is more than one match with the same difference, choo... | function bestMatch(ALAHLYGoals, zamalekGoals) {
let lowest;
let lowestMatch;
let zamalekPoints;
const scoreDiff = ALAHLYGoals.map((el,i) => el -= zamalekGoals[i])
scoreDiff.forEach((el,i) =>{
if(!lowest){
lowest = el
lowestMatch = i
zamalekPoints = zamalekGoals[i]
}
if (el < lowe... | [
"function bestMatch(ALAHLYGoals, zamalekGoals) {\n let bestGameIndex = 0;\n let goalDifferential = ALAHLYGoals[0] - zamalekGoals[0];\n let goalsScored = zamalekGoals[0];\n for (let i = 1; i < ALAHLYGoals.length; i++) {\n let tempDifferential = ALAHLYGoals[i] - zamalekGoals[i];\n let tempGoalsScored = zama... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
cargar = obtiene todos los datos de los logros juego = objeto juego success = funcion callback que se llama cuando se han obtenido todos los datos. fail = funcion callback que se llama cuando no se han obtenido los datos. | cargar(juego, success, fail) {
let self = this;
ajaxJuego("getLogros", {hash: juego._hash}, function(res){
if(res.status == 1){
self.setLogros(res.logros);
success();
}else fail();
});
} | [
"function cargar_libro_destacado(consecutivo) {\n\t$('.img_libro_destacado').addClass(\"img_libro_destacado_aparece\");\n\tvar parametros = {\"consecutivo\" : consecutivo};\n\t$.ajax({\n\t\turl: \"../json/json_datos_libro.php\",\n\t\tdata: parametros,\n type: \"POST\",\n dataType : \"JSON\",\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Object that can be used to configure the default options for the paginator module. | function MatPaginatorDefaultOptions() {} | [
"function MatPaginatorDefaultOptions() { }",
"setPaginationOptionsWhenPresetDefined(gridOptions, paginationOptions) {\n if (gridOptions.presets && gridOptions.presets.pagination && gridOptions.pagination) {\n paginationOptions.pageSize = gridOptions.presets.pagination.pageSize;\n pagi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to add a new sponsor in the given section required: sponsor image url, sponsor section | function addSponsor(request, response) {
const imageUrl = request.body.sponsor.imageUrl;
const sponsorSection = request.body.sponsor.sponsorSection;
const sponsorChild = sponsorNode + '/' + sponsorSection;
let emptyFields = new Array();
if(imageUrl === undefined) {
emptyFields.push('imageUrl');
}
if(sponsor... | [
"function addSponsor(sponsorId, isSponsorsPage) {\r\n\t// Set current eventId\r\n\t$('#eventIdSponsor').val(localStorage.getItem(\"curEventId\"));\r\n\tvar displayText = \"Partner created successfully. Add more partners or proceed to next step.\";\r\n\t// Set base path\r\n\tif(sponsorId == null)\r\n \t\tsponsorId ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Replace the letter in the guessedWordSoFar if the letter is present in the chosen word else return 1 indicating a failed guess | function replaceLetter(letter){
var str = currentWordChosen;
var indices = [];
for(var i=0; i<str.length;i++) {
if (str[i] === letter) indices.push(i);
}
//console.log(indices);
if(indices.length == 0){
return -1;
}
for(var key in i... | [
"function guessUpdate(letter) {\n guesses--; // decreases available guesses\n chancesRemainingEl.innerHTML = guesses;\n\n if (word.indexOf(letter) === -1) { // letter is NOT in the word\n wrongGuesses.push(letter); // update letters guessed\n lettersGuessedEl.innerHTML = wrongGuesses.join(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hides `ionicSelectableAddItemTemplate`. See more on [GitHub]( | hideAddItemTemplate() {
// Clean item to add as it's no longer needed once Add Item Modal has been closed.
this._itemToAdd = null;
this._toggleAddItemTemplate(false);
} | [
"showAddItemTemplate() {\n this._toggleAddItemTemplate(true);\n // Position the template only when it shous up.\n this._positionAddItemTemplate();\n }",
"function onItemHideEmptyText(){\r\n\t\tif(g_emptyAddonsWrapper)\r\n\t\t\tg_emptyAddonsWrapper.hide();\r\n\t}",
"function hideDropDown(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
increase velocity to the right | function moveRight() {
testplayer.velocityX += 0.5;
} | [
"moveRight(){\r\n this.xvelocity = this.movementSpeed;\r\n }",
"function accelerateRight() {\n\t\t\tvar velVec = avatar.getLinearVelocity();\n\t\t\tvelVec.z = Math.max(velVec.z - 2, -25);\n\t\t\tvelVec.x /= 1.2;\n\t\t\tavatar.setLinearVelocity(velVec);\n\t\t}",
"updateVelocity() {\n vec3.scale(this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get map from mapview | function mapFromMapView(mapViewId) {
for (var map of metaData.maps) {
for (var mv of map.mapViews) {
if (mv.id === mapViewId) return map;
}
}
return null;
} | [
"get mapView() {\n return this.dataSource.mapView;\n }",
"function getMap() {\r\n return map;\r\n }",
"function getMap() {\n return this.map;\n }",
"function viewMap() {\n $state.go(\n \"map\"\n );\n }",
"function MapViewFactory () {\n\n}",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get all groups request | async getAllGroups() {
log('get all groups ....');
return this.api.get('/api/1.0/tags', {
params: {
company: this.companyId,
token: this.token,
limit: LIMIT,
},
}).then((response) => response.data.data).catch((error) => {
log(error.response.data.message, true);
... | [
"getGroups() {\n\t return request.get({ uri: process.env.AUTHZ_API_URL + '/groups', json: true, headers: { 'Authorization': 'Bearer ' + this.accessToken } })\n\t .then(res => {\n\t log(chalk.green.bold('Groups:'), `Loaded ${res.groups.length} groups.`);\n\t return res.groups;\n\t });\n\t}",
"func... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if a specific revision of a doc has been deleted metadata: the metadata object from the doc store rev: (optional) the revision to check. defaults to winning revision | function isDeleted(metadata, rev) {
if (!rev) {
rev = merge.winningRev(metadata);
}
var dashIndex = rev.indexOf('-');
rev = rev.substring(dashIndex + 1);
var deleted = false;
merge.traverseRevTree(metadata.rev_tree,
function (isLeaf, pos, id, acc, opts) {
if (id === rev) {
deleted = !!... | [
"function isDeleted(metadata, rev) {\n if (!rev) {\n rev = merge.winningRev(metadata);\n }\n var dashIndex = rev.indexOf('-');\n if (dashIndex !== -1) {\n rev = rev.substring(dashIndex + 1);\n }\n var deleted = false;\n merge.traverseRevTree(metadata.rev_tree,\n function (isLeaf, pos, id, acc, opts)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get words from database (or cached in localStorage) | _getWords() {
// Try to get it from localStorage
let words = localStorage.getItem("enlighten_words_" + this.language);
if (words && words.length > 0) {
this.words = JSON.parse(words);
this._updateMatches();
}
// Fetch from server (even if we found somethin... | [
"getWords() {\n\n //checks local storage first and returns JSON of words\n if (this._localStorageService.get('words')) {\n var deferred = this._$q.defer();\n deferred.resolve(JSON.parse(this._localStorageService.get('words')));\n return deferred.promise;\n }\n\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to remove colours from the scatter | function remove_colour_scatter(data){
d3.selectAll(".scatter-circle")
.style("fill", function(d){
if (d.searched_house == true)
{
return "yellow"
}
else if (barchart_data.indexOf(d) !== -1)
{
return "steelblue"
}
})
} | [
"function removeColor(ids) {\n //console.log(ids.length);\n //For each layer (i.e. polygon) the code below is executed.\n jsonLayer.eachLayer(function (layer) {\n //console.log(layer.feature.properties.wikidata);\n for (var i=0; i<ids.length; i++) {\n if(layer.feature.properties.wikidata == ids[i]) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update Bid items: an object with keys of columns you want to update and values with updated values | async update(items) {
const updateData = Bid.sqlForPartialUpdate(
"bids",
items,
"id",
this.id
);
let result;
try {
result = await db.query(updateData.query, updateData.values);
} catch (error) {
throw new ExpressError(error.message, 400);
}
let bid = new Bid(result.rows[0])... | [
"function update_items(obj) {\n\tpg.connect(connection_string , function(err, client, done) {\n\t\tif(err) {\n\t\t\treturn console.error(err);\n\t\t}\n\t\tclient.query({\n\t\t\ttext: \"SELECT upsert_item($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11);\",\n\t\t\tvalues: [ \n\t\t\t\tobj.product_id,\n\t\t\t\tobj.produc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set listener on checkboxes to turn on/off trackers by status, and update the clusters | function initStatusCheckboxes() {
$('div.layer-control').on('change', '#status-layers input', function() {
var status = $(this).val();
// 1) update the markers on the map
var markers = CONFIG.status_markers[status].markers;
CONFIG.clusters.FilterMarkers(markers, !$(this).prop('checked')); // false to ... | [
"function watchBuildingLabels() {\n\t\tON = document.getElementById(\"On\")\n\t\tOFF = document.getElementById(\"Off\")\n\t\tMOBILE = document.getElementById(\"labels-icon\")\n\t\t\n\t\tbuildings_lyr.watch('labelsVisible', function(newValue, oldValue, property, object) {\n\t\t\tif (newValue == true) {\n\t\t\t\tON.c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Foundset Managment Handle viewPort, row, sort, isLastRow of a foundsetReference object FoundsetManager | function FoundSetManager(foundsetRef, foundsetUUID, isRoot) {
var thisInstance = this;
// properties
this.foundset = foundsetRef;
this.isRoot = isRoot ? true : false;
this.foundsetUUID = foundsetUUID;
// methods
this.getViewPortData;
this.getViewPortRow;
this.hasMoreRecord... | [
"function getClientViewPortRow(foundsetObj, index) {\n\t\t\t\t\tvar row;\n\t\t\t\t\tif (foundsetObj.viewPort.rows) {\n\t\t\t\t\t\trow = foundsetObj.viewPort.rows[index];\n\t\t\t\t\t}\n\t\t\t\t\treturn row;\n\t\t\t\t}",
"function ObjectThatUnderstandSetGrid() { }",
"getPositionInfo(rowObj, isNext) {\n let... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a string of CSS, return a version where all occurrences of URLs, have been rewritten based on the relationship of the old base URL to the new base URL. | _rewriteCssTextBaseUrl(cssText, oldBaseUrl, newBaseUrl) {
return cssText.replace(constants_1.default.URL, (match) => {
let path = match.replace(/["']/g, '').slice(4, -1);
path = url_utils_1.rewriteHrefBaseUrl(path, oldBaseUrl, newBaseUrl);
return 'url("' + path + '")';
... | [
"function css(cssStr, baseUri, prefix, externalParse) {\n var urlRE = /url\\(['\"]?([^\\/:'\"\\)]+(?:\\/[^'\"\\)]*)?)['\"]?\\)/ig\n , cssFrag = null\n , stylesheet = null\n , ruleChanges = {};\n\n if ( externalParse ) {\n return cssFragUsingExternal(cssStr, baseUri);\n }\n\n //... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a comparable timestamps by removing readability characters ('' and ':') further divides into date value and time value returns input array containing the updated values sorted by date | function cleanData(values){
var newValues = [];
for (var i = 0; i < values.length; ++i) {
var dayTime = values[i].timestamp.split(" ");
dayTime[0] = dayTime[0].split("-");
dayTime[1] = dayTime[1].split(":");
var aDate = new Dat... | [
"function sortFunction(input) {\n\n input.sort((a,b) => {\n\n if (a.timestamp === b.timestamp) {\n return (input.indexOf(a) - input.indexOf(b))\n } else {\n return (b.timestamp-a.timestamp)\n }\n\n }\n )\n\n}",
"__normalizeTimestamps(timestamps) {\n\t\tfor (let [key, value] of ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To check if a bucket already exists. __Arguments__ `bucketName` _string_ : name of the bucket `callback(err)` _function_ : `err` is `null` if the bucket exists | bucketExists(bucketName, cb) {
if (!isValidBucketName(bucketName)) {
throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)
}
if (!isFunction(cb)) {
throw new TypeError('callback should be of type "function"')
}
var method = 'HEAD'
this.makeRequest({ method, bu... | [
"bucketExists(bucketName, cb) {\n if (!isValidBucketName(bucketName)) {\n throw new errors.InvalidBucketNameError('Invalid bucket name: ' + bucketName)\n }\n if (!isFunction(cb)) {\n throw new TypeError('callback should be of type \"function\"')\n }\n var method = 'HEAD'\n this.makeReque... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a URL according to the type of a repository | function getURL( repository ) {
var repourl;
if (typeof repository === 'object') {
repourl = repository.url;
} else {
repourl = repository
};
return repourl;
} | [
"function _getRepositoryURL(data) {\n var result = false;\n // Si le champs repository est une string\n if (_.isString(data.repository) && !_.isEmpty(data.repository)) {\n result = data.repository;\n } else if (_.isPlainObject(data.repository)) {\n data = data.repos... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
can match a pokemon by name. feature not used but assignment asks for it. worked perfect when testing | name(nameMatch){
//loops through all the pokemon objects to match name
for(let i=0; i<this.pokes.length; i++) {
if(this.pokes[i].name == nameMatch){
//returns name and exists function
return this.pokes[i];
}
}
//testing leftover. if function called and not exited during loop then this console.lo... | [
"function getPokemon(pokemonName = \"\"){\r\n let pokemon = null;\r\n for(let i =0; i < allPokemon.length; i++){\r\n if(allPokemon[i].name === pokemonName){\r\n pokemon = allPokemon[i];\r\n break;\r\n }\r\n }\r\n return pokemon;\r\n}",
"function isPokemon(pokemonNam... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instantiates a new Emote Action | constructor() {
super('Emote Action', 'core.rosie.action.emote')
} | [
"constructor(actor, receiver, action){\n this.actor = actor;\n this.receiver = receiver;\n this.action = action;\n }",
"function action() {\n return new Action();\n}",
"function actionCreator() {return action}",
"constructor() { \n \n OutboundAction.initialize(this);\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redux middleware to systematically execute async actions. The action is expected to have an 'execAsync' method. (see ajax.js) The action then gets transformed into the action's type with these suffixes: _start _done _fail _cancel | function isAsync (action) {
return !!action.execAsync;
} | [
"async asyncActions({dispatch, commit}, actions){\n for(var index in actions)\n await dispatch(actions[index])\n }",
"function callAction(actionContext, action, payload, done) {\n var executeActionPromise = new Promise(function (resolve, reject) {\n setImmediate(function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Used to position an element relative to the given positioning props. If positioning has been completed before, previousPositions can be passed to ensure that the positioning element repositions based on its previous targets rather than starting with directionalhint. | function positionElement(props, hostElement, elementToPosition, previousPositions) {
return _positionElement(props, hostElement, elementToPosition, previousPositions);
} | [
"function getRelativePosition(el, relativeEl, posStr) {\n if (!posStr) return;\n \n let [x, y] = posStr.split(' ');\n \n if (!y && x === 'center') y = 'center';\n else if (!y) return;\n \n const {top, left, height, width} = relativeEl.getBoundingClientRect();\n \n const extraOffset = 3;\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check if a user is a zoom user | function isZoomUser(userId){
var url = "https://api.zoom.us/v2/users/" + userId;
var options = {
"method": "get",
"headers": {
'Content-Type':'application/json',
'Authorization': jwt_token
}
};
try{
var response = UrlFetchApp.fetch(url, options);
var json = response.getContentTe... | [
"function zoomsIn(step) {\n if (step instanceof ZoomStep) {\n return step.source == step.target.parent;\n }\n else\n return false;\n}",
"function canZoomIn() {\n return GenericWorkflowDesigner.ZoomConstants.currentZoomRatio <\n GenericWorkflowDesigner.ZoomConstants.maxZoom... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
XML / Returns array (possibily empty) of all child elements matching xpath. Very basic xpath only no attributes or //. | function getChildElements(element, xpath) {
var children = [];
if (!xpath || xpath.length<1) {
error("Failed to find empty xpath '" + xpath + "'"); return children;
} else {
xpath = xpath.replace(/^\/+/,"").replace(/\/+$/,""); // Remove starting and ending slashes
var names = xpath.split("/");
... | [
"function getElementsByXpath(xPath) {\r\n\tvar elm = document.evaluate(xPath, document, null, XPathResult.UNORDERED_NODE_ITERATOR_TYPE, null);\r\n\treturn elm;\r\n}",
"getElementsByXPath(expression, scope) {\n scope = scope || document;\n let nodes = [];\n let a = docu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check whether a given XMLQuery node is an explicit viewState node | static isViewStateNode(node) {
var _a, _b, _c, _d, _e, _f;
const SEP = (0, Const_1.$faces)().separatorchar;
return "undefined" != typeof ((_a = node === null || node === void 0 ? void 0 : node.id) === null || _a === void 0 ? void 0 : _a.value) && (((_b = node === null || node === void 0 ? void 0... | [
"function isView( node ) {\n\t\t\treturn editor.dom.hasClass( node, 'wpview' );\n\t\t}",
"function checkView(hostView,component){var hostTView=hostView[TVIEW];var oldView=enterView(hostView,hostView[HOST_NODE]);var templateFn=hostTView.template;var viewQuery=hostTView.viewQuery;try{namespaceHTML();createViewQuery... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
playSound Function: Parms: No explicit params, but event will be used Return: No return Description: Play sound for the animal that was clicked on | function playSound() {
// Set the src
sound.src = `audio/${event.target.name}.mp3`;
// Play the sound
sound.play();
} | [
"function soundClick () {\n clickSound.play();\n}",
"playSound(audio, ev) {\n audio.play()\n }",
"function playSound(name) {\r\n name.play();\r\n}",
"function onPlaySound(name) {\n console.log(\"onPlaySound\", name);\n\n // find the sound in the sounds object by name and play it\n sounds[name].... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Select a link in the Google Music tab or open it when not connected. | function selectLink(link, openGmInCurrentTab) {
postToGooglemusic({ type: "selectLink", link: link });
openGoogleMusicTab(link, true, false, openGmInCurrentTab);//if already opened focus the tab, else open & focus a new one
} | [
"function connectGoogleMusicTabs() {\n chromeTabs.query({ url:\"*://play.google.com/music/listen*\" }, function(tabs) {\n tabs.forEach(function(tab) {\n chromeTabs.insertCSS(tab.id, { file: \"css/gpm.css\" });\n chromeTabs.executeScript(tab.id, { file: \"js/jquery.min.js\" });\n chromeT... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns array of vertices oriented around the face | getOrientedEdges() {
var edge = this.edges[0];
var edges = [edge];
var used = new Set();
used.add(edge);
var vertices = [];
vertices.push(edge.startVertex);
vertices.push(edge.endVertex);
for (var i = 1; i < this.edges.length; i++) {
var res = this.getNextEdge(edge, used, vertices)... | [
"generateVertices() {\n //wait, if I have all the points in the vertices array, then all I have to do is loop over the same exact shape pushing the faces to the face array\n //wait again, I could even try reserving the old face data since the shape is the same, like going from\n //one to adding... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Insert the data from the movies.json file to the movies table of the database | function insertMovies(db) {
movies.forEach(movie => {
const sql = 'INSERT INTO movies(link, id, metascore, rating, synopsis, title, votes, year) ' +
'VALUES("' + movie.link + '", "' + movie.id + '", ' + movie.metascore + ', ' + movie.rating +
', "' + movie.synopsis + '", "' + movie.t... | [
"function loadDataToTable(){\n\n\tconsole.log(\"Importing movies into DynamoDB. Please wait.\");\n\n\tvar allMovies = JSON.parse(fs.readFileSync('moviedata.json', 'utf8'));\n\tallMovies.forEach(function(movie) {\n\t var params = {\n\t TableName: \"Movies\",\n\t Item: {\n\t \"year\": mov... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get details on a job by id | static async getJob(id) {
let res = await this.request(`jobs/${id}`);
return res.job;
} | [
"static async getJob(id) {\n const res = await this.request(`jobs/${id}`);\n return res.job;\n }",
"static async getJob(id) {\n let res = await this.request(`jobs/${id}`)\n return res.job;\n }",
"static async getJob(id) {\n\t\tlet res = await this.request(`jobs/${id}`);\n\t\treturn res.job;\n\t}",... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Runs all registered _typing_ handlers and then continues the event emission process. | onTypingActivity(context) {
return __awaiter(this, void 0, void 0, function* () {
yield this.handle(context, 'Typing', this.defaultNextEvent(context));
});
} | [
"onTyping(handler) {\n return this.on('Typing', handler);\n }",
"function updateTyping() {\n if (!typing) {\n typing = true;\n socket.emit('typing');\n }\n lastTypingTime = (new Date()).getTime();\n setTimeout(function () {\n var typingTimer =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
____ _ _ __ __ _ _ _ | _ \ _ __(_)_ ____ _| |_ ___ | \/ | ___| |_| |__ ___ __| |___ | |_) | '__| \ \ / / _` | __/ _ \ | |\/| |/ _ \ __| '_ \ / _ \ / _` / __| | __/| | | |\ V / (_| | || __/ | | | | __/ |_| | | | (_) | (_| \__ \ |_| |_| |_| \_/ \__,_|\__\___| |_| |_|\___|\__|_| |_|\___/ \__,_|___/ region private methods ... | function getDirectiveName(prefix, constructName) {
return prefix + _.upperFirst(_.camelCase(constructName));
} | [
"function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,\"\"))}",
"function directiveNormalize(name){return camelCase(name.replace(PREFIX_REGEXP,''));}",
"function directiveNormalize(name) { // 8950\n retu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes in a JSON result, certifications, and returns a formatted string of the certification results | function formatCertifications(certifications) {
var largeOutput = '';
for (var i = 0; i <= certifications.length; i++) {
largeOutput += formatCertification(certifications[i]);
}
return largeOutput;
} | [
"function formatCompletedCertifications(certifications) { \n\n\tvar largeOutput = ''; \n\n\n\tfor (var i = 0; i < certifications.length; i++) { \n\t//\tconsole.log('certification ' + i.toString() + ' name: ' + certifications[i].name); \n\t\t// var certification = certifications[i]; \n\n\t\tlargeOutput += formatComp... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GET all properties under user's ID | function findByUser(id) {
return db("property").where("user_id", "=", id);
} | [
"get myProperties() {\r\n return new UserProfileQuery(this, \"getmyproperties\");\r\n }",
"function getUserProperties() {\n\n // Get the current client context and PeopleManager instance.\n context = SP.ClientContext.get_current();\n var peopleManager = new SP.UserProfiles.PeopleManager(context... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
rainbow generator does not draw it! fills an array with colours | function generateRainbowColours() {
var size = 16;
rainbow = new Array(size);
for (var i = 0; i < size; i++) {
var red = sin_to_hex(i, 0 * Math.PI * 2 / 3); // 0 deg
var blue = sin_to_hex(i, 1 * Math.PI * 2 / 3); // 120 deg
var green = sin_to_hex(i, 2 * Math... | [
"function rainbowfy() {\n chars.forEach(function(char, index) {\n nextColor();\n printChar(char, index);\n });\n}",
"static rainbow(steps) {\n return tabulate(x => getColourAt(rainbow, x / (steps - 1)), steps);\n }",
"function drawRainbow(offset){\n for (var i = 0; i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get details on a user by username | static async getUser(username) {
let res = await this.request(`users/${username}`);
return res.user;
} | [
"static async getUserInfo(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }",
"static async getUserInfo(username) {\n let res = await this.request(`users/${username}`);\n return res.user;\n }",
"function getUserByName(username) {\n}",
"async functi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
swappingWithAny : Pacman [Listof Ghost] > Boolean is pacman swapping positions with any ghost? | function swappingWithAny(pacman, listOfGhosts) {
for (var i = 0; i < listOfGhosts.length; i++) {
if (swappingPositions(pacman.position, pacman.direction, listOfGhosts[i].position, listOfGhosts[i].direction)) {
return true;
}
}
return false;
} | [
"function swappingPositions(pacPosition, pacDirection, ghoPosition, ghoDirection) {\n var newGhoPosition;\n switch (pacDirection) {\n case \"left\": // check if ghost is to the left of pacman -> move ghost to the right\n newGhoPosition = new Posn(ghoPosition.x + 1, ghoPosition.y);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
One non numeric character repeated 5 or more times | function excessiveSingleCharacterRepeats(str, normed) {
return /(\D)\1{4,}/gi.test(str)
} | [
"function hasRepeatingChars() {\n //\n}",
"function repeatedString(s, n) {}",
"function repeater(char) {\n if (char.length === 5) {\n return char;\n } else {\n char += char[0];\n return repeater(char);\n }\n}",
"function threePlusCharsRepeatTwice(str) {\n return (str.length < 80 && /(....*)[ \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set the state for a comment. Args: reviewID (number): The ID of the review the comment belongs to. commentID (number): The ID of the comment. commentType (string): The type of the comment. state (string): The new state for the comment's issue. This will be one of ``open``, ``resolved``, ``dropped``, or ``verify``. | setCommentState(reviewID, commentID, commentType, state) {
const comment = this.getComment(reviewID, commentID, commentType);
this._requestState(comment, state);
} | [
"async _requestState(comment, state) {\n await comment.ready();\n\n const oldIssueStatus = comment.get('issueStatus');\n\n comment.set('issueStatus', state);\n const rsp = await comment.save({\n attrs: ['issueStatus'],\n });\n\n this._notifyIssueStatusChanged(com... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
adds an input box to the nav bar | function addSearchObject(){
let elem = document.getElementById("navbar");
box = document.getElementById("addBox");
/*
* check if search box already exists or not
*/
if(box == null){
let input = document.createElement("input");
input.type = "text";
input.placehold... | [
"function addSearchInput() {\n let $searchBox = (`\n <div class=\"student-search\">\n <input placeholder=\"Search for students...\">\n <button>Search</button>\n </div>`);\n $pageHeader.append($searchBox);\n }",
"function addQuestionInput() {\n\n $( \"<li>\", {\"class\": \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
[DOD]check to see if the all the transactions in the block are valid | CheckBlockTransactions(transactions){
for(var transaction = 0; transaction < transactions.length; transaction++){
if(transactions[transaction].verifyTrxSignature() && transactions[transaction].verifyID() && transactions[transaction].checkSingleSpent()){
var prevTransaction = findPrev... | [
"hasValidTransactions(){\r\n for(const tx of this.transactions){\r\n if(!tx.isValid()){\r\n return false;\r\n }\r\n }\r\n return true;\r\n }",
"isValidBlock(b) {\n if (!b.verifyProof()) return false;\n // FIXME: Validate all transactions.\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
J C O M P O N E N T S H E L P E R S run those functions specified from the called functions argument. To use, get_dependencies(function1 function2 function3 function4) | function _runner(dependencies){
//check if attr 'success-function' exist and not empty
if(typeof dependencies !== typeof undefined && dependencies !== false && dependencies !== "") {
var classList = dependencies.split(/\s+/);
$.each(classList, function(index, item) {
... | [
"function executeFunctions() {\n\t\tvar len = functions.length;\n\n\t\tfunctionsExecuted = true;\n\n\t\tfor ( var x = 0; x < len; x++ ) {\n\t\t\tfunctions[x]();\n\t\t}\n\n\t}",
"function check_program_trace_for_dependencies(){\n\t\n\tvar result = [];\n\n\t// Works for global level hoisting\n\t//Getting all the gl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
update future forecast (row1) | function updateFutureForecast(){
//update days
var nDay2= getDayAfter(getTodaysDay());
var nDay3 = getDayAfter(nDay2);
var nDay4 = getDayAfter(nDay3);
var nDay5 = getDayAfter(nDay4);
day1Text.text = getTodaysDay();
day2Text.text = nDay2;
day3Text.text = nDay3;
day4Text.text = nDay4;... | [
"function update() {\n const sheet = SpreadsheetApp.getActive().getActiveSheet();\n const data = sheet.getRange(CONFIG.RANGE.TRENDS_DATA).getValues();\n const dates = data.map(item => {return item[0]}).reverse(); // Array with the dates of all entries, beginning with the newest\n const url = sheet.getRa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starting from google cloud vision detected texts build a common objects array (given also a minimum confidence threshold) | function buildTextsObj(gCloudV, azureCV, minScore = 0.0){
let texts = [];
let gCloudTexts = gCloudV['textAnnotations']; //text is going to be detected just from gcloud
//apply standard bounding box to all the detected objects
if(azureCV)// azure computer vision results are available
gCloudVObj... | [
"function buildObjectsObj(gCloudV, azureCV, minScore = 0.0){\n let objects = [];\n\n if(gCloudV) {// gcloud vision results are available\n let gCloudObjects = gCloudV['localizedObjectAnnotations'];\n\n //apply standard bounding box to all the detected objects\n if(azureCV)// azure compute... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function for getting pricing, used to updtae the subtotal and grand total. | function getPricing(iPrice,iQty,operation){
if(gTotal == 0){
//Add the subTotal to the price of the item selected
sTotal = parseFloat(iPrice);
$('#subTotal').empty().text(sTotal.toFixed(2));
//Add the the item price to the grand total
gTotal = parseFloat(iPrice);
//$(... | [
"function calculatePricing() {\n firstClassCount = getBookedTicketValue('firstClass');\n economyClassCount = getBookedTicketValue('economyClass');\n\n subTotal = firstClassCount * 150 + economyClassCount * 100;\n document.getElementById(\"sub-total\").innerText = '$' + subTotal;\n\n tax = Math.round(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a promise: done if associated html element has override, reject if element has the no override | function validateOverride(dataid, columnName, owner) {
var deferred = $.Deferred();
var myObject = new Object();
myObject.dataid = dataid;
var devUrl = "MapUtilService.asmx/GetOverridePrecedence";
var deploymentUrl = common.deploymentUrl(devUrl);//common.deploymentUrl(de... | [
"function waitForElementIfNotPresent(selector, ancestor) {\n return domReadyPromise.then(function() {\n if ($(selector).length > 0) {\n return resolvedPromise;\n }\n\n var defer = $.Deferred();\n $(ancestor).arrive(selector, { onceOnly: true }, funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
============================================================================= CGMZ_Window_Toast The toast window, handles displaying the toast information ============================================================================= | function CGMZ_Window_Toast() {
this.initialize.apply(this, arguments);
} | [
"function createToast() {\n var divToast, lblClose, btnClose, divOutput;\n\n // Define an HTML element builder function.\n var nodeBuilder = function (elementType, options, text) {\n var newElement = document.createElement(elementType);\n for (var i = 0; i < options.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This will add a post to our database and return an observable that holds the uodated user data | addPost(post) {
console.log(post);
return this.http.post("http://localhost:8080/api/users/addPost/" + JSON.parse(localStorage.getItem('user')).id, post);
} | [
"applyToPost(post) {\n return this.http.post(\"http://localhost:8080/api/users/\" + JSON.parse(localStorage.getItem('user')).username + \"/apply/\" + post.id, post);\n }",
"async add(post) {\n const db = await dbPromise;\n return db.transaction('posts', 'readwrite').objectStore('posts').ad... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates a given contestants score. If the optional third parameter "add" is true, then it will add the new score to their current score. Otherwise, it will simply replace their current score with the new score. | function updateContestantScore(contestant, score, add) {
if (add) {
var curScore = parseInt($('.player.' + contestant).find('.score').html());
score = curScore + parseInt(score);
}
$('.player.' + contestant).find('.score').first().html(score);
} | [
"UpdateScore(newScore){\n this.currentScore += newScore;\n }",
"function addScore(added_score){\n score += added_score;\n}",
"update_score (value) {\n this.set('score', this.get('score') + this.sanitize_score(value));\n }",
"function increase_score(value)\r\n{\r\n\tscore += value;\t\t//Adds t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Redirects users to "vcaballeassign3_1.html", the game set up page where Player 1 and Player 2's names are inputted and the type of dice game they want to play is selected | function startGame () {
location.replace("vcaballeassign3_1.html");
} | [
"function goToChallenge(number){\t\n\twindow.location = \"/challenge-\"+number+\".html\";\n}",
"function play() {\n if (isDupicateName()) {\n alert(\"There are duplicate names. Please make all participant's names unique.\");\n }\n else if (participants.length > 2) {\n window.location.href = \"game.html\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
updateStudent not used for now. Will be used later pass in an ID, a field to change, and a value to change the field to purpose: finds the necessary student by the given id finds the given field in the student (name, course, grade) changes the value of the student to the given value for example updateStudent(2, 'name',... | updateStudent() {
} | [
"updateStudent(id, field, value){\n\t\t//field = name || course || grade\n\t\t//value = what is in the given field\n\t\tif (this.data[id] === undefined){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tthis.data[id].data[field] = value;\n\t\t\treturn true;\n\t\t}\n\t}",
"updateStudent(id, field, value) {\n\t\tif (this.do... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function called if no instance is selected | function validateIfNoInstanceSelected(toBePassedArgumentsArray){
hideFadeLoadingImg();
paramArray = new Array();
paramArray[0]='instance';
return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xcb0g0aw',paramArray,'');
} | [
"function use_object()\r\n{\r\n\tif (targeted)\r\n\t{\r\n\t\tDeselected();\r\n\t} else {\r\n\t\tSelected();\r\n\t}\r\n}",
"function handleInstanceSelection(elem) {\n // children of the li can be clicked, we need to make sure the li is the one with focus here\n elem = elem.closest(\"li\");\n\n // If the u... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by LUFileParserparagraph. | exitParagraph(ctx) {
} | [
"exitFileControlParagraph(ctx) {\n\t}",
"exitParse(ctx) {\n\t}",
"function translator_terminate()\n{\n this.parser.terminate();\n}",
"exitParagraphName(ctx) {\n\t}",
"exitInputOutputSectionParagraph(ctx) {\n\t}",
"exitCompilationUnit(ctx) {\n\t}",
"exitConfigurationSectionParagraph(ctx) {\n\t}",
"exi... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sumZero([3, 2, 1, 0, 1, 2, 3]) > [3, 3] sumZero([2, 0, 1, 3]) > undefined sumZero([1, 2, 3]) > undefined | function sumZero(array) {
let first = 0;
let last = array.length - 1;
while (last > first) {
if (array[first] + array[last] === 0) {
return [array[first], array[last]];
} else if (array[first] + array[last] > 0) {
last--;
} else {
first++;
}
}
return undefined;
} | [
"function sumZero(arr) {\n if (arr[0] >= 0) {\n return 0\n }\n\n for (const v1 of arr) {\n for (const v2 of arr) {\n if (v1 + v2 == 0) {\n return [v1, v2]\n }\n }\n }\n return 0\n}",
"function sumZero(arr) {\n // i will check first item, j checks the next. Add them together to se... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Waits until all elements on the page are loaded. It needs to be used in page.evaluate. | async function waitForAllElements(){
let count = 0;
const timeout = ms => new Promise(resolve => setTimeout(resolve, ms));
for(let i = 0; i < 10; i++){
await timeout(200);
const cCount = document.getElementsByTagName('*').length;
if(cCount != count){count = cCount;}
else{retu... | [
"function waitUntilElementsFullyParsed() {\n var link = document.querySelector('#elements'); // the main element bundle\n var allImports = link.import.querySelectorAll('link[rel=\"import\"]'); // all the imports in the main element bundle\n var numberOfImportsComplete = 0;\n\n splashLoadingPercentUpd... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Throw a wrapper error with more errors as `diagnostics`, if some parses so far failed. | throwOnFailure() {
if (this.hasDiagnostics()) {
const x = MalstructuredData(
`JSON-LD document with ${this.diagnostics.length} errors`
);
x.diagnostics = this.diagnostics;
throw x;
}
return this;
} | [
"function parseError(collection) {\n const { error } = collection;\n const { title, message } = error;\n\n return title + ERROR_SEPARATOR + message;\n}",
"function MultiError(errors) {\r\n mod_assertplus.array(errors, 'list of errors')\r\n mod_assertplus.ok(errors.length > 0, 'must be a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
masqueradeAs will allow a given context to be copied to a new user. | masqueradeAs(user) {
return new Context(merge({}, this, { user }));
} | [
"function onCopyActiveUser() {\n tempAuth.updateCurrentUser(activeUser()).then(\n () => {\n alertSuccess('Copied active user to temp Auth');\n },\n error => {\n alertError('Error: ' + error.code);\n }\n );\n}",
"publish(context, user) {\n context.user = user;\n context.userStore.next... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to render repo info to html | function repoInformationHTML(repos) {
if (repos.length === 0) { //if data not return (no repos found) then the array of that data = 0 and we want to return a comment
return `<div class="clearfix repo-list">No Repos!</div>`
}
//if data is returned then we need to loop through the array so create a va... | [
"getRepositoryInfoAsHtml(repository) {\n let returnHtml = \"<h4><span class='material-icons md-24'>info</span> \" +\n \"Repository Info</h4><ul class='repository-info'>\";\n if (repository.owner != null) {\n returnHtml = returnHtml.concat(\"<li><span class='material-ic... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`joy help` help functions displays a list of possible joy tasks to run and how to select them | function help() {
console.log("joy \n\
\n \
Usage:\n \
joy new <name>...\n \
joy build \n \
joy serve \n \
joy tidy \n \
joy help \n \
\n \
joy -h | --help \n \
joy --version \n \
\n \
Options: \n \
-h --help Show this screen. \n \
--version Show version.\n \
")... | [
"function help() {\n\n // Print grunt version.. Also initing colors for later use\n task.init([]);\n\n // the list of tasks we'd like to output\n var knowns = {\n init: {info: 'Initialize a new mockup with grunt.js and the dirs for pages, assets and json files'},\n mockup: {info: 'Generate the site conten... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
this function is used to validate the input date and make sure the input date are in ddmmyy format. | function checkinputdate(thisDateField)
{
// add by charlie, 21-09-2003. trim the value before validation
thisDateField.value = trim(thisDateField.value);
// end add by charlie
var day = thisDateField.value.charAt(0).concat(thisDateField.value.charAt(1));
var month = thisDateField.value.charAt(3).concat(thisDat... | [
"function validate_date(input_date) {\n\tvar dateFormat = /^\\d{1,4}[\\.|\\/|-]\\d{1,2}[\\.|\\/|-]\\d{1,4}$/;\n\tif (dateFormat.test(input_date)) {\n\t\ts = input_date.replace(/0*(\\d*)/gi, \"$1\");\n\t\tvar dateArray = input_date.split(/[\\.|\\/|-]/);\n\t\tdateArray[1] = dateArray[1] - 1;\n\t\tif (dateArray[2].len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Write a function that will return a random integer between 10 and 100. Test it. | function randomInt_10_100(){
return Math.floor(Math.random()*(100-10))+10;
} | [
"function getRandomInt(){\n return Math.floor(Math.random() * 10);\n}",
"function getRandom(){\n return 1 + Math.floor(Math.random()*10);\n}",
"function getRandomNumber() {\n return Math.floor(Math.random() * 100);\n}",
"function randomint(num){ return Math.floor(Math.random()*num);}",
"function rollD100... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculates the change in y position for a movement of d units and angle tx to the X axis. | function dy(tx, d) {
return d * Math.sin(rad(tx));
} | [
"updateDxDy() {\n let moveData = calculateDxDy(this.direction, this.speed);\n this.dx = moveData.dx;\n this.dy = moveData.dy;\n }",
"function coordinatesToPos(xt, yt, x, y, d) {\n\tvar pos = -1;\n\txy = getOffsetByRotation(d);\n\tif (yt == y + (4 * xy.y) + (2 * xy.x) && xt == x + (4 * xy.x... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Throw a typed error. | function typedThrow(msg) {
throw new Error(msg);
} | [
"function throwGenericError() {\n throw new Error('Generic error');\n}",
"function throwTypeMismatchError() {\n throw new Scorm2004ValidationError(scorm2004_error_codes.TYPE_MISMATCH);\n}",
"function doSomething() {\n console.log(\"-------THROW OWN TYPE-------\")\n throw { error: \"This broke\", code:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function deletes a single row from table parks | destroy(id) {
return db.none(`
DELETE FROM parks
WHERE id = $1`, id);
} | [
"function del_new(row) {\r\n _.remove(self.tableParams.settings().dataset, function (item) {\r\n return row === item;\r\n });\r\n self.deleteCount++;\r\n self._tableTracker.untrack(row);\r\n self.tableParams.reload().then(function (data) {\r\n if (data.length... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add Playlist on "enter" key press | function emitPlaylist(event){ if (event.which == 13) {addPlaylist();}} | [
"function addItemAfterKeypress(event){\n\tif(inputLength() > 0 && event.keyCode == 13){\n\t\taddItem();\n\t}\n}",
"function addListAfterKeypress(event) {\n\tif (event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}",
"function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to hide progress indicator | function HideProgressIndicator() {
progressIndicator.stop();
} | [
"hideProgressBar() {}",
"function __hideProgressIndicator()\n{\n\tDEBUG.out(\"Hide progress indicator.\");\n\tsetTimeout('__hideProgressIndicator();', 1);\n}",
"function hideProgressBar() {\n $(\"#loadingBar\").hide();\n }",
"function hideProgressBar() {\n KASClient.hideProgress();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function which read all files from phpdoc and call it parser | function main() {
var files = fs.readdirSync(DOC_DIR);
files.forEach(fileIterator);
} | [
"parse() {\n const basePath = path.join(this.iotjs, 'docs/api');\n\n fs.readdir(basePath, (err, files) => {\n this.verboseLog(`Read '${basePath}' directory.`);\n\n if (err) {\n console.error(err.message);\n return false;\n }\n\n const promises = files.filter(file => !file.inc... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
GoodMorningWorld by ModMonstR.com ASIS, NO WARRANTY This work is licensed under a Creative Commons Attribution 3.0 Unported License ============================================================ Overview: 1. Gets all current day's Calendar Events from the Default Calendar 2. Saves an overview of the events in a Google Do... | function goodMorningWorld() {
//Prepare Date
var today = new Date();
var todayString = today.getFullYear().toString() + lPad(1+today.getMonth())+lPad(today.getDate());
//Get today's events from the default Calendar
var cal = CalendarApp.getDefaultCalendar().getEventsForDay(today);
//Create a Google Document, file... | [
"function todayAgenda(){\n \n //Fetch Current Date and format as a String\n var today = new Date();\n \n //Formatting\n var today_string = today.getFullYear().toString() +' '+ padding(1 + today.getMonth()) +' '+ padding(1 + today.getDate()) +' : ';\n \n //Fetch Calendar Events for the Current day\n var cal... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
If the component updates and the user is not the same as the app level user, update the user and get the last exposure | componentDidUpdate(){
if(this.props.currentUser !== this.state.currentUser){
this.setState({
currentUser: this.props.currentUser,
})
this.props.currentUser && this.props.callGetLastExposure(this.props.food.id);
}
} | [
"_updateUser() {\n\t\tconst user = UserStore.activeUser();\n\t\tconst authInfo = UserStore.activeAuthInfo();\n\t\tconst emails = user && user.UID ? UserStore.emails.get(user.UID) : null;\n\t\tconst primaryEmail = emails && !emails.Error ? emails.filter(e => e.Primary).map(e => e.Email)[0] : null;\n\n\t\tif (this._a... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a single data object containing `id` which is a MAC address peform a lookup to resolve the manufacturer name. Resolves: the object passed in, augmented with 'shortName' and optionally 'name' property | function performMacAddressLookup(data) {
return new Promise(function (resolve, reject) {
var mac = data.id;
// Fail early if no MAC address given
if (!mac) {
console.error('no MAC address given');
resolve();
return;
}
// Fail is MAC address is in excluded list
if ( _.fil... | [
"function getDeviceManufacturer(host) {\n // Don't run if just unit testing.\n if (underTest) {\n host.manufacturer = \"underTest\";\n return;\n }\n\n // Get vendor info for unknown mac addresses using http://api.macvendors.com/ as older versions of nmap are suspect.\n request(\"http://... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
CONCATENATED MODULE: ./src/modules/bip21Link.js Implements BIP 0021 Link Encoding More: Format: bitcoin:[?amount=][?label=][?message=] bitcoincash:[?amount=][?label=][?message=] | function encodeBip21Link(isBCH, address, amount, label, message) {
var parts = [];
if (amount) parts.push('amount=' + encodeURIComponent(amount));
if (label) parts.push('label=' + encodeURIComponent(label));
if (message) parts.push('message=' + encodeURIComponent(message));
return (isBCH ? 'bitcoincash' : 'bi... | [
"convertBase58(cleeString)\r\n {\r\n //----------------------------------------------\r\n // PublicKey = \"123\"\r\n // keyAsString = \"0x004872dd8b2ceaa54f922e8e6ba6a8eaa77b48872144b\"\r\n // adresseAsString = \"12EHDzypjuALLPyopJHU37QuhyQs3bG\"\r\n //--------------... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
To be invoked this when leaving or erroring out of a meeting. NOTE (Paul, 20210107): this could probably be expanded to reset all meetingdependent vars, but starting with this targeted small set which were being reset properly on leave() but not when leaving via prebuilt ui. | resetMeetingDependentVars() {
this._participants = {};
this._participantCounts = EMPTY_PARTICIPANT_COUNTS;
this._waitingParticipants = {};
this._activeSpeaker = {};
this._activeSpeakerMode = false;
this._didPreAuth = false;
this._accessState = { access: DAILY_ACCESS_UNKNOWN };
this._meet... | [
"resetMeetingDependentVars() {\n this._participants = {};\n this._waitingParticipants = {};\n this._activeSpeakerMode = false;\n this._didPreAuth = false;\n this._accessState = { access: DAILY_ACCESS_UNKNOWN };\n resetPreloadCache(this._preloadCache);\n }",
"function resetVariablesInPopup() {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Moves Morty Up in Tablet View | function mortyUp(){
mUp -= 1;
$('#morty').css('top', mUp+"em");
} | [
"moveUp() {\n if (this.y > 12) {\n this.y -= 8;\n }\n }",
"function moveUp() {\n let currentTableRow = $(this)\n .parent() // td\n .parent(); // tr\n let previousTableRow = currentTableRow.prev();\n\n currentTableRow\n .insertBefore... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that runs when the dialog is suposed to close | function handleClose() {
setDialog(false);
} | [
"function handleDialogClose() {\n handleDialog(false)\n }",
"_close() {\n this.trigger('dialog-closed');\n }",
"dialogClose() {\n\t\t/*\n\t\t\tDo something when the user closes the dialog\n\t\t*/\n\t\tconsole.log(\"dialog is closed\");\n\t\tthis.toggleModalDialog();\n\t}",
"functio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |