query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
update header to show the currently selected value | function updateHeader(scope, control) {
control.header = scope.header;
if (typeof (scope.value) != 'undefined' && control.selectedItem && control.displayMemberPath) {
var currentValue = control.selectedItem[control.displayMemberPath];
if (currentValue != null) {
c... | [
"function changeHeader() {\n \tlet header = document.getElementById('city')\n\tlet headerText = document.getElementById('cities').value\n\n header.innerText = headerText; \n}",
"update() {\r\n this.updateHeader();\r\n }",
"function setSectionHeader(header) {\r\n\tdocument.getElementById('section-h... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
generate the short url recursive function to generate unique short url | function uniqueLinkGen(){
if(linkGenStore.findOne({'shortURL':short_url})===true){//check if short url is present
short_url = linkGen.genURL();
uniqueLinkGen();
}
else{
return short_url;
}
} | [
"function shortenUrl(longUrl) {\n var newUrl = Url({\n long_url: longUrl\n });\n // save the new link in the db\n newUrl.save(function(err) {\n if (err){\n console.log(err);\n }\n });\n // the short url will just be the id of the saved url in the db. Todo : optimize this.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
And then a lot of instructions... SVTCA[a] Set freedom and projection Vectors To Coordinate Axis 0x000x01 | function SVTCA(v, state) {
if (exports.DEBUG) { console.log(state.step, 'SVTCA[' + v.axis + ']'); }
state.fv = state.pv = state.dpv = v;
} | [
"projection(other_vector) {}",
"static translation(v) {\r\n\t\tres = identity(); \t\tres.M[3] = v.x; \r\n\t\tres.M[7] = v.y; \t\tres.M[11] = v.z; \r\n\t\treturn res; \r\n\t}",
"function draw() { \r\n var translateVec = vec3.create();\r\n var scaleVec = vec3.create();\r\n \r\n gl.viewport(0, 0, gl.view... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Github payload > String This function return the repository owner | function getOwner(payload) {
return ( payload.repo || payload.repository ).owner.login;
} | [
"function processGitHubData(data) {\n const { login, id } = data;\n // only works with two names\n return {\n username: login,\n id: id\n };\n}",
"function lastCommit(username){\n return fetch('https://api.github.com/users/' + username + '/events',{headers: {'Authorization': 'token ghp_cyx9DR86w1EanP... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Axios sends asynchronous HTTP requests to REST endpoints and performs operations. getGallery is getting the gallery from the server. | getGallery() {
axios("/gallery").then((sendGallery) => {
this.setState({
galleryCollection: sendGallery.data,
});
return sendGallery;
});
} | [
"function loadThumbnails()\r\n\t{\r\n\t\tvar gallery_id = $(\"#gallery_id\").val();\r\n\t\tjRpc.send(handleThumbnails, {plugin: plugin, method: 'loadThumbnails', params: {gallery_id: gallery_id}});\r\n\t}",
"function loadGalleries() {\n //console.log('loading galleries');\n $('#gallerySpinner').show();\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
when the component mounts update the seats array filling it with 88 values using the possibleSeats options | componentDidMount() {
const { possibleSeats } = this.state;
const seats = [];
for(let i = 0; i < 88; i +=1) {
seats.push(randomItem(possibleSeats));
}
this.setState({
seats,
})
} | [
"initAvailableSeats(seatInfo) {\n let availableSeats = {};\n\n for (const key in seatInfo) {\n if (seatInfo.hasOwnProperty(key)) {\n const row = seatInfo[key];\n let seats = [...Array(row.numberOfSeats || 0).keys()];\n let aisles = row.aisleSeats... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
==Question== Given a sequence of integers and an integer total target, return whether a contiguous sequence of integers sums up to target. ===Example=== [1, 3, 1, 4, 23], 8 : True (because 3 + 1 + 4 = 8) [1, 3, 1, 4, 23], 9 : False my working solution. oh well | function isContiguous(nums, target) {
// find all combinations of the list
// https://stackoverflow.com/questions/5752002/find-all-possible-subset-combos-in-an-array
// https://codereview.stackexchange.com/questions/7001/generating-all-combinations-of-an-array
const combos = new Array(1 << nums.length)
... | [
"function canSum(targetSum, numbers) {\n const table = Array(targetSum + 1).fill(false);\n table[0] = true;\n\n for (let i = 0; i <= targetSum; i++) {\n if (table[i] === true) {\n for (let num of numbers) {\n if (i + num <= targetSum) table[i + num] = true;\n }\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Add recipe collection's recipe to the html body | function addRecipeItemsToBody() {
let htmlCardDisplay = "";
for (let j = 0; j < recipeCollection.recipe.length; j++) {
htmlCardDisplay += addHtmlForm(recipeCollection.recipe[j]);
}
cardParent.innerHTML = htmlCardDisplay;
} | [
"function generateRecipeCard(recipe) {\r\n const recipeCard = `\r\n <div class=\"recipe-card\">\r\n <img src=${recipe.image} alt=\"recipe image\">\r\n <h4 class=\"title\">${recipe.label}</h4>\r\n <p class=\"cal\">Calories: ${recipe.calories.toFixed(0)}</p>\r\n </div... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the list of songs up next in the player overlay. | function listUpNext (songs) {
var upNext = document.getElementById('up-next');
var list = document.createDocumentFragment();
for (var song of songs) {
var listItemTemplate = importTemplate('player-upnext-template');
var listItem = listItemTemplate.querySelector('li');
listItem.textContent = song.name... | [
"function _drawPlaylist() {\n let playlistSongs = store.State.playlist;\n let template = ''\n playlistSongs.forEach(song => {\n template += song.playlistTemplate\n })\n document.getElementById(\"playlist\").innerHTML = template\n\n}",
"function displayTracks(tracks) {\n var tracksList = document.getEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Splits a string into two parts at the first occurrence of any of the given separators. | function split(s, separators) {
let before = null;
let after = null;
for (let i = 0; i < separators.length; ++i) {
const sep = separators[i];
const index = s.indexOf(sep);
if (index >= 0 && (before === null || index < before.length)) {
before = s.substring(0, index);
... | [
"function splitStr (str, separator) {\n return str.split(separator).map(v => v.trim()).filter(v => !!v)\n }",
"function multiSplit(splitStr, splitDelimiters, callback)\n{\n\t/*\n\t * We use a helper function because this way we can pass the result and use\n\t * tail recursion for each recursive call.\n\t ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Dashboard routes define access routes to dashflux dashboard area. All routes are private and user must be logged in. | function dashboardRoutes($stateProvider) {
$stateProvider
.state('root.dashboard', {
url: '/dashboard',
views: {
'main': {
templateUrl: 'app/dashboard/dashboard.html',
controller: 'dashboardCtrl',
// res... | [
"mountRoutes() {}",
"function EquipmentDashboardInternal() {\n const {relativePath, relativeUrl} = useRouter();\n\n return (\n <>\n <TopBar\n header=\"Equipment\"\n tabs={[\n {\n label: 'Federation Gateways',\n to: '/gateway',\n icon: CellWifiIcon,... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ADD THE PROCESSING ICON TO THE FORM | function process(form)
{
var respicon = form.find(".responseicon");
respicon.removeClass("responsesuccess");
respicon.removeClass("responseerror");
respicon.addClass("responseprocessing");
respicon.show();
} | [
"function uiPageLegacyCheckoutForm() {\n updateModalVisilibity(\n ['shop-checkout'], ['shop-tshirt', 'shop-success']);\n\n if (domId('shop-checkout').className === '') {\n domId('shop-checkout').className = 'fa-loaded';\n\n const link = loadCssLink('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Public function `null`. Returns true if `data` is null, false otherwise. | function isNull (data) {
return data === null;
} | [
"static isNull(value) { return value === null; }",
"function isNull(user) {\n return user == null;\n}",
"function checkNull(object) {\n return object === null;\n}",
"function hasData(cell)\n{\n if (cell == null) return 0;\n return cell.length != 0;\n}",
"function hasValidPoint(data) {\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParserdrop_index_partition. | visitDrop_index_partition(ctx) {
return this.visitChildren(ctx);
} | [
"visitDrop_index(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitDrop_procedure(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitModify_index_partition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitSplit_index_partition(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"visitMod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
autoseed() Returns an object for autoseeding, using window.crypto and Node crypto module if available. | function autoseed() {
try {
var out;
if (nodecrypto && (out = nodecrypto.randomBytes)) {
// The use of 'out' to remember randomBytes makes tight minified code.
out = out(width);
} else {
out = new Uint8Array(width);
(global.crypto || global.msCrypto).getRandomValues(out);
}
... | [
"async initialize () {\n await this.generateKey()\n }",
"function generateSalt() {\n return Crypto.randomBytesAsync(256);\n}",
"function seed2key(pk, c){ return hex2hexKey(hash256(pk+c)); }",
"function rk_randomseed(state) {\n var i;\n var tv;\n\n if (rk_devfill(state.key, 4, 0) === rk_error.R... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates the data property for the snabbdom vnode. Should be considered unsafely mutable and is referenced in the snabbdom "modules" (plugins). | _createSnabbdomData () {
let data = {}
let attributes = {}
if ('key' in this.attributes) {
data.key = this.attributes.key
delete this.attributes.key
}
// Shallow copy
for (let p in this.attributes) {
attributes[p] = this.attributes[p]
}
Engine.plugins.forEach((p) =>
... | [
"_setData() {\n this._global[this._namespace] = this._data;\n }",
"get vertexData() {\n if (!this._vertexData)\n this._vertexData = new VertexData(this.effect.vertexFormat, 4)\n return this._vertexData\n }",
"pack(data) {\n Object.assign(data, {\n dataSetId: Utilities.normalize... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
search production lines by keywords | static searchProductionLines(keywords) {
let query = ProductionLine.query();
query.where("name like '%" + keywords + "%'");
query.order("id", true);
return new Promise( (resolve, reject) => {
ProductionLine.exec(query).then( list => {
resolve(list);
}).catch(error => {
rejec... | [
"function findResults(lines, keyword){\n arr = [];\n for (var i in lines){\n var terms = parseTerms(lines[i])[0][0];\n if (terms){\n if (terms.predicate != undefined){\n if (terms.predicate==\"result\"){\n try{\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
listerToutesLesSessions() : retourne le tableau de toutes les sessions; | function listerToutesLesSessions(){
return devfest.sessions;
} | [
"function localStorageListo() {\n var tweets;\n tweets = obtenerTweetsLocalStorage();\n\n tweets.forEach(function cicloEach(val) {\n agregarTweetsAListas(val);\n })\n }",
"async load() {\n const sessions = await this._sessionInfoStorage.getAll();\n this._ses... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Iterator for Lazy.js for netsuite searching | function SearchIterator(sequence) {
// current page of results
this.search = sequence.search
this.slice = []
this.currentPage = 0
this.currentIndex = 0
this.isLastPage = false
this.sliceSize = 1000
} | [
"getIterator(obj) {\n for (var item = this._head; item; item = item.next) {\n if (item.data === obj) {\n return new Iterator(this, item);\n }\n }\n }",
"function findNext(ctx, query) {\n doSearch(ctx, false, query);\n}",
"function _ldapSearch(ldapClient, lo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Makes a card at the id given with the data | function makeCard(id, data)
{
$("#" + id).text(data[0]);
} | [
"function addCard(){\n\tvar id = storage.id();\n\tvar newNode = document.createElement('div');\n\tnewNode.className = \"flashcard-set\";\n\tnewNode.id = id;\n\tnewNode.innerHTML = '<div class=\"term\"><textarea name=\"card-term\" data-card-term=\"'+id+'\" placeholder=\"Term\"></textarea></div><div class=\"definitio... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function adds a `client` and `server` version of the intent manifest fetcher plugin. We can then fetch intent manifest data during SSR/SSG and during CSR from the downloaded intent manifest file instead of bundling the file into the JS artifacts. However, "fetching" a file during SSR/SSG requires file system readi... | function addIntentManifestFetcherPlugins({
nuxtConfig,
intentManifestPath,
intentManifestUrl,
moduleContainer,
}) {
// NOTE: by default,the intentManifest file is downloaded to `/static/intentManifest.json`
const resolvedIntentManifestPath =
intentManifestPath || nodePath.resolve(nuxtConfig.srcDir, nuxt... | [
"async loadManifest(manifest, target = null) {\n // support a custom target or ensure event fires off window\n if (target == null && window) {\n target = window;\n }\n // @todo replace this with a schema version mapper\n // once we have versions\n if (varExists(manifest, \"metadata.siteName\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
`deleteGraph` removes all triples with the given graph from the store | deleteGraph(graph) {
return this.removeMatches(null, null, null, graph);
} | [
"removeVertex(vertex) {\n // Delete from nodes property of graph\n this.nodes.delete(vertex);\n\n // update adjacency lists of other vertices\n for (let v of vertex.adjacent){\n v.adjacent.delete(vertex);\n }\n\n // clear adjacency list of vertex\n vertex.adjacent.clear();\n }",
"delete... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
IMGUI_API void SetScrollFromPosY(float pos_y, float center_y_ratio = 0.5f); // adjust scrolling amount to make given position valid. use GetCursorPos() or GetCursorStartPos()+offset to get valid positions. | function SetScrollFromPosY(pos_y, center_y_ratio = 0.5) {
bind.SetScrollFromPosY(pos_y, center_y_ratio);
} | [
"function verticalScrollbarPos() {\n\t\tvar top = offset.y + height * pixelSize;\n\t\tvar bottom = canvas.height - offset.y;\n\t\treturn [canvas.width - 15, (top / (top + bottom)) * (canvas.height - 100)];\n\t}",
"yOffset() {\n const minY = -this.h/2;\n let maxY = -this.requiredHeight + this.h/2;\n if(th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Visit a parse tree produced by PlSqlParsermain_model_name. | visitMain_model_name(ctx) {
return this.visitChildren(ctx);
} | [
"visitData_manipulation_language_statements(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"function STLangVisitor() {\n STLangParserVisitor.call(this);\n this.result = {\n \"valid\": true,\n \"error\": null,\n \"tree\": {\n \"text\": \"\",\n \"children\": null\n }\n }... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if the text panel is hidden or not | function isTextPanelHidden(){
var panelElement = g_objTextPanel.getElement();
var isHidden = panelElement.data("isHidden");
if(isHidden === false)
return(false);
return(true);
} | [
"function isHidden ( elem ) {\n // @see http://stackoverflow.com/questions/19669786\n return window.getComputedStyle(elem).display === 'none';\n }",
"function IsHidden(){\n\treturn !_showGizmo;\n}//IsHidden",
"isVisible() {\n return this.toolbar.is(\":visible\");\n }",
"shouldHide(s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Play an animation to remind the user that this is a placeholder. | animatePlaceholderStatus() {
Animate.blink(this);
} | [
"function playPauseGifs() {\n var state = $(this).attr(\"data-state\");\n if (state === \"still\") {\n $(this).attr(\"src\", $(this).attr(\"data-animate\"));\n $(this).attr(\"data-state\", \"animate\");\n } else {\n $(this).attr(\"src\", $(this).attr(\"data-still\"));\n $(this).... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register Register the new user data: input: DbHelper, user (contains thirdParty (id, accessToken), name, avatar, geoInfo, settings output: user | function register(data, callback) {
var usersCollection = data.DbHelper.getCollection("Users");
var now = (new Date()).getTime();
var avatar = data.user.avatar;
data.user.settings.sound = true;
var newUser = {
"facebookUserId": data.user.thirdParty.id,
"facebookAccessToken": data.... | [
"function signup(userData){\n console.log(\"creating new user \"+userData.id);\n return User.create(userData)\n }",
"static async register(data) {\n const duplicateCheck = await db.query(\n `SELECT username \n FROM users \n WHERE username = $1`,\n [data.username]\n );\n\n i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Serialize a Datetime into buffer to transport on the network. | function serializeTime(when: Date): Buffer {
const data = Buffer.alloc(8 + 20);
data.writeUInt32LE(20, 0); // size of timestamp as u64
function iso(date) {
function pad(number) {
if (number < 10) {
return '0' + number;
}
return number;
}
return (
date.getUTCFullYear()... | [
"function jsonObject2Date(jsonObj) {\n if (jsonObj) {\n return new Date(jsonObj.time);\n }\n return null;\n}",
"write(buffer) {\n this.wsSocket.send(buffer);\n }",
"get dateTimeSent()\n\t{\n\t\treturn this._dateTimeSent;\n\t}",
"static serialize(obj, view, offset = 0, countBytes = fa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compiles a template and associated directives into a raw compilation result which include a cloneable DocumentFragment and factories capable of attaching runtime behavior to nodes within the fragment. | function compileTemplate(template, directives) {
const fragment = template.content;
// https://bugs.chromium.org/p/chromium/issues/detail?id=1111864
document.adoptNode(fragment);
const context = CompilationContext.borrow(directives);
compileAttributes(context, template, true);
const hostBehavior... | [
"generate() {\n var ast = this.ast;\n\n this.print(ast);\n this.catchUp();\n\n return {\n code: this.buffer.get(this.opts),\n tokens: this.buffer.tokens,\n directives: this.directives\n };\n }",
"compileTemplate() {\n var $el = $(this.template);\n return _.template($el.html())... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the CodeMirror selection to match the provided vim selection. If no arguments are given, it uses the current vim selection state. | function updateCmSelection(cm, sel, mode) {
var vim = cm.state.vim;
sel = sel || vim.sel;
var mode = mode || vim.visualLine ? 'line' : vim.visualBlock ? 'block' : 'char';
var cmSel = makeCmSelection(cm, sel, mode);
cm.setSelections(cmSel.ranges, cmSel.primary);
updateFakeCursor(cm);
... | [
"_updateSelection() {\n\t\t// If there is no selection - remove DOM and fake selections.\n\t\tif ( this.selection.rangeCount === 0 ) {\n\t\t\tthis._removeDomSelection();\n\t\t\tthis._removeFakeSelection();\n\n\t\t\treturn;\n\t\t}\n\n\t\tconst domRoot = this.domConverter.mapViewToDom( this.selection.editableElement ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
sets height of element 1 to equal the height of element 2 | function setHeight(elem1, elem2) {
var height = elem2.height()
elem1.css('height', height);
} | [
"function height2(){\n var h = $( window ).outerHeight(true); // Taille de la fenetre\n $('.titre').css('height', 'inherit');\n $('.zone1').css('height', (h/2)+'px');\n $('.zone2').css('height', (h/2)+'px');\n }",
"_updateHeight() {\n this._updateSize();\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name : validateDualField Return type : Boolean Input Parameter(s) : elementId Purpose : To validate the dual/replica form fields of biller and personal information section against the regular expressions sent by API. History Header : Version Date Developer Name Added By : 1.0 26th July, 2013 Pradeep Yadav | function validateDualField(elementId) {
var dualFieldId = 'replicaof' + elementId;
var replicaFieldValue = $('#' + dualFieldId).val().trim();
/* Checkng if the replica field have the value in it */
if (replicaFieldValue) {
/* Checking if the dual field matched with original field */
if (... | [
"function matchDualFieldValue(elementId) {\n var dualFieldId = 'replicaof' + elementId;\n var mainFieldValue = $('#element' + elementId).val().trim();\n var replicaFieldValue = $('#' + dualFieldId).val().trim();\n /* Checkng if the replica field have the value in it */\n if (replicaFieldValue) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Exit a parse tree produced by Java9ParservariableInitializer. | exitVariableInitializer(ctx) {
} | [
"exitMultiVariableDeclaration(ctx) {\n\t}",
"exitVariableInitializerList(ctx) {\n\t}",
"exitVariableDeclaratorList(ctx) {\n\t}",
"exitUnannTypeVariable(ctx) {\n\t}",
"exitConstructorDeclarator(ctx) {\n\t}",
"visitExit_statement(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitPreprocessorParenthe... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a constant gate (for simulating ground or 1). | function constantGate (value) {
return {
id: nextId(),
type: 'constant',
inputs: Object.seal([]),
outputs: Object.seal([pin()]),
value: value || false
}
} | [
"function circuit (gates) {\n return {\n gates\n }\n}",
"function switchGate () {\n return {\n id: nextId(),\n type: 'switch',\n inputs: Object.seal([]),\n outputs: Object.seal([pin()])\n }\n}",
"function xorGate () {\n return {\n id: nextId(),\n type: 'xor',\n inputs: [pin(), pin()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
find roll pitch yaw of plane formed by 3 points | static rollPitchYaw(a, b, c) {
if (!c) {
return new Vector(
Vector.normalizeAngle(Vector.find2DAngle(a.z, a.y, b.z, b.y)),
Vector.normalizeAngle(Vector.find2DAngle(a.z, a.x, b.z, b.x)),
Vector.normalizeAngle(Vector.find2DAngle(a.x, a.y, b.x, b.y))
... | [
"function FPSyaw(angle){\n var cs = Math.cos(angle*(Math.PI/180));\n var sn = Math.sin(angle*(Math.PI/180));\n\n //temp vectors\n var tn = this.n;\n var tu = this.u;\n var tv = this.v;\n\n //rotate each about y-axis\n this.n.set3f( (cs*this.n.x - sn*this.n.z), this.n.y, (sn*this.n.x + cs*this.n.z) )... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
muestra el mensaje con un titulo | function mensaje(titulo, mensaje){
swal(titulo, mensaje);
} | [
"function mensaje_advertencia(titulo, mensaje){\n swal({ title: titulo, text: mensaje, type: \"error\", confirmButtonText: \"Aceptar\" });\n }",
"function mensajeVacio(){\n return \"Campos obligatorios\";\n }",
"showMessage(type,title,message){\n\t\tsetTimeout(function() {\n\t\t\tv... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Whenever new specs get added to our views 'stack', we need to create a new Templ instance and allow modules to rebind Handlebars logic. | function reloadTempl () {
// Close down the old templ instance.
if (app.templ) app.templ.close();
// Create new templ instance.
app.templ = new Templ(specs, {handlebars: app.handlebars});
// Views middleware uses this handler.
app.templHandler = app.templ.middleware();
} | [
"function patientHandlebarsSetUp() {\n Patient.patientsTableSource = $(\"#patients-table-template\").html();\n Patient.patientsTableTemplate = Handlebars.compile(Patient.patientsTableSource);\n\n Patient.emptyPatientsTableSource = $(\"#empty-patients-table-template\").html();\n Patient.emptyPatientsTableTemplat... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
3. Trail Types Input: an activity. Choices are: hiking, Bike touring, Mountain biking, Horseback riding Output: trails that are suitable for that activity | function findTrails(activity) {
let trails = "";
// TODO: Add code for finding trails from last week's lab
return trails;
} | [
"function chosePunchTalkIgnore() {\n let input = document.getElementById(\"PTI\").value;\n if (input.toUpperCase() == valuesPTI[0]){ \n let punch = document.getElementById(\"actionPunch\")\n if(punch.style.display == 'block')\n punch.style.display = 'none'\n else\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: dwscripts.preprocessDocEditInsertText DESCRIPTION: This function is called during dwscripts.applyDocEdits(), to allow the Server Models to preprocess the inserted text. It returns he processed string which should be inserted into the document. ARGUMENTS: insertText string the text that will be inserted editNo... | function dwscripts_preprocessDocEditInsertText(insertText, editNode, isUpdate)
{
var retVal = insertText;
var serverObj = dwscripts.getServerImplObject();
if (serverObj != null && serverObj.preprocessDocEditInsertText != null)
{
retVal = serverObj.preprocessDocEditInsertText(insertText, editNode, isUpda... | [
"function DocEdit_processNewEdit(index)\n{\n var dom = dw.getDocumentDOM();\n var allSBs = dw.serverBehaviorInspector.getServerBehaviors();\n\n\n if (this.weight==\"beforeNode\")\n {\n var nodeOffsets = dwscripts.getNodeOffsets(this.node);\n\n this.insertPos = nodeOffsets[0];\n this.replacePos = nodeO... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Enter a parse tree produced by KotlinParserconstructorDelegationCall. | enterConstructorDelegationCall(ctx) {
} | [
"enterConstructorInvocation(ctx) {\n\t}",
"enterExplicitConstructorInvocation(ctx) {\n\t}",
"enterConstructorDeclarator(ctx) {\n\t}",
"enterConstructorBody(ctx) {\n\t}",
"visitConstructor_declaration(ctx) {\n\t return this.visitChildren(ctx);\n\t}",
"exitConstructorDelegationCall(ctx) {\n\t}",
"enterPr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selects a random square to be the "active" square for loop4 | function randomSquare4() {
selected4 = squares[randomNum()]
} | [
"function randomSquare1() {\n selected1 = squares[randomNum()]\n }",
"function randomSquare2() {\n selected2 = squares[randomNum()]\n }",
"function randomSquare3() {\n selected3 = squares[randomNum()]\n }",
"function randomize() {\n var x;\n var y;\n var randNum; //only allow 30% of the grid to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Name: DrawChairR Author: Peter Chen Purpose: Draw chair (toward to the right) Arguments: DrawChairR(canvas_name, x_position, y_position); Data format: Example: DrawChairR("myCanvas", 0, 0); | function DrawChairR(c,x,y)
{
var canvas = document.getElementById(c);
var context = canvas.getContext("2d");
context.save();
var lineWidth = 7;
context.beginPath();
context.moveTo(x, y);
context.lineTo(x, y + 110);
context.lineWidth = lineWidth;
context.lineCap = "round";
context.strokeStyle = "#000000";
co... | [
"function DrawChairL(c,x,y)\n{\n\tvar canvas = document.getElementById(c);\n\tvar context = canvas.getContext(\"2d\");\n\tcontext.save();\n\tvar lineWidth = 7;\n\n\tcontext.beginPath();\n\tcontext.moveTo(x, y);\n\tcontext.lineTo(x, y + 110);\n\tcontext.lineWidth = lineWidth;\n\tcontext.lineCap = \"round\";\n\tconte... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Customized selection of simulations | function select_simulations(itype, clusters, ligandonly, rev, stnd){
//variables
var simulationlist, code, URL, custombutton;
//Get selected simulations dynIDs
simulationlist = $(".simulation_checkbox:checked").map(function(){return $(this).attr("name");}).get();
//(Pseudo-)Random identifier for this cus... | [
"function simulatePlan(){\n simulation();\n}",
"function runSimulation() {\n if (runButtonText.data == \"Run Simulation\" && running == true) {\n runButtonText.data = \"Pause Simulation\";\n game.time.events.resume();\n } else if (runButtonText.data == \"Pause Simulation\" && running == true)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Transfer any labels that exist in GitLab that do not exist in GitHub. | async function transferLabels(attachmentLabel = true, useLowerCase = true) {
inform('Transferring Labels');
// Get a list of all labels associated with this project
let labels = await gitlabApi.Labels.all(settings.gitlab.projectId);
// get a list of the current label names in the new GitHub repo (likely to be... | [
"async function transferLabels(projectId, attachmentLabel = true, useLowerCase = true) {\n inform(\"Transferring Labels\");\n\n // Get a list of all labels associated with this project\n let labels = await gitlab.Labels.all(projectId);\n\n // get a list of the current label names in the new GitHub repo (likely ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Change an upwardable. Issue notification that it has changed. | function change(x) {
var u = this;
var debug = u._upwardableDebug;
if (x !== this.valueOf()) {
u = make(x, { debug });
getNotifier(this).notify({object: this, newValue: u, type: 'upward'});
if (debug) {
console.debug(...channel.debug("Replaced upwardable", this._upwardableId, "with", u._upward... | [
"function SetAnyChangeToTrue()\t\n\t\t{\n\t\t\t//Change has taken place\n\t\t\tanyChange = 1;\n\t\t}",
"function notifyChange(attrHolder, key, newValue, oldValue) {\n var listeners = attrHolder.changeListeners;\n for (var i=0, len=listeners.length; i<len; i++) {\n listeners[i].call(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to draw center bar and platform badges | function bar(){
push();
fill(50);
noStroke();
// draw centerBar
rect(
width/2,
height/2,
centerBar.width,
centerBar.height,
centerBar.round,
);
// draw centerBar text
fill(100);
textSize(centerBar.height*0.4);
textAlign(LEFT, CENTER);
text(stationName, 100, height/2);
// d... | [
"drawBallReleaseBar() {\n const canvas = document.getElementById(\"myCanvas\");\n const ctx = canvas.getContext(\"2d\");\n ctx.beginPath();\n // ctx.rect(releaseBarX, releaseBarY, canvas.width-releaseBarWidth, releaseBarHeight, releaseBarWidth);\n ctx.strokeRect(381, 560, 280, 500);\n // ctx.fillS... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Jobs reducer handles job objects | function jobsReducer(state = initialState, action) {
if (action.type === 'SET_JOB_LOCATION') state = {
...state,
pending: {
...state.pending,
location: action.payload
}
}
if (action.type === 'SET_JOB_ADDRESS') state = {
...state,
pending: {
...state.pending,
address: ... | [
"dispatchJobs() {\n\t\tconst job = this.getJob(this.logKeys);\n\n\t\tif (!job) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (this.stat_collector) {\n\t\t\tthis.stat_collector.add(job.key)\n\t\t}\n\n\t\treturn job;\n\t}",
"standardizeJob (name,payload) {\n\n let jobQueue = {\n name,\n attempts : 0,\n payloa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Updates the style of the container with styles for a state (hide/show). This triggers animations. | updateStyle(stateStyle) {
let {styles} = this.stylesheet;
this.setState({
containerStyle: assign({}, styles.container, stateStyle)
});
} | [
"function _updateUIStates() {\n var spriteIndex,\n ICON_CLASSES = [\"splitview-icon-none\", \"splitview-icon-vertical\", \"splitview-icon-horizontal\"],\n layoutScheme = MainViewManager.getLayoutScheme();\n\n if (layoutScheme.columns > 1) {\n spriteIndex = 1;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the car data reduced to just the variables we are interested and cleaned of missing data. | async function getData() {
/*
const carsDataReq = await fetch('https://storage.googleapis.com/tfjs-tutorials/carsData.json');
const carsData = await carsDataReq.json();
const cleaned = carsData.map(car => ({
mpg: car.Miles_per_Gallon,
horsepower: car.Horsepower,
}))
.filter(... | [
"validateCarData(car) {\n let requiredetail = 'license model latLong miles make'.split(' ');\n\n for (let field of requiredetail) {\n if (!car[field]) {\n this.errors.push(new DataError(`invalid field in validatin ${field}`, car));\n }\n }\n return ca... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the duration of the instance. Returns duration in seconds. 1 if value was NaN (duration not available) or Infinite (streaming). | getDuration() {
const time = this._element.duration;
if (isNaN(time) || !Number.isFinite(time)) {
return -1;
} else {
return time;
}
} | [
"function YDataRun_get_duration()\n {\n if(this._isLive) this.refresh();\n return this._duration;\n }",
"static calculateDuration (duration) {\n let seconds = duration * 15\n let days = Math.floor(seconds / (3600 * 24))\n seconds -= days * 3600 * 24\n let hrs = Math.floor(seconds /... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
nbPartiesAffichees: int parties: PartieGibet[] / Constructeur de la classe Gibet | constructor() {
this.nbPartiesAffichees = 0
this.parties = [];
this.afficher();
} | [
"ajouterPartie(nbAAjouter) {\n if (nbAAjouter <= 0 || this.nbPartiesAffichees >= 10) {\n return;\n } else if (nbAAjouter + this.nbPartiesAffichees > 10) {\n nbAAjouter = 10 - this.nbPartiesAffichees;\n }\n \n for (var i = 0; i < nbAAjouter; i++) {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Salva como JPG, com um nome Definido e qualidade baixa; | function salvarJPG(nome){
var doc = app.activeDocument;
var file = new File(doc.path +'\\'+nome+'.jpg');
var opts = new JPEGSaveOptions();
opts.quality = 1;
doc.saveAs(file,opts,true);
} | [
"function generaFoto(cedula)\n\t{\n\t\tvar r = '000000000' + cedula;\n\t\treturn r.substring(r.length,r.length-9) + \".jpg\";\n\t}",
"function archivoSIS(nombreAD, cuerpo){\n var path = \"../archivo/\";\n var fileContent = cuerpo;\n var name = nombreAD;\n path1 = path + name;\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Debounced get data function | debouncedGetDataForKeyword(keyword) {
if(debounceTimer) {
clearTimeout(debounceTimer);
}
debounceTimer = setTimeout(() => {
this.setState({
waitingForResults: true,
}, () => {
this.getDataForKeyword(keyword);
});
}, 200)
} | [
"function fetchData() {\n client.subscribe(\"/fx/prices\", function (data) { //subscribing for updates\n rawData.push(JSON.parse(data.body)); //storing retrived data\n });\n}",
"debounce (n) {\n return debounce(n, this)\n }",
"_storeDebounce() {\n if (this.__storingDeb... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Load cities from the data and save them as coordinates | function loadCities() {
d3.csv("data/City_Coordinates.csv").then(function(data) {
if (data == undefined) {
console.log("Failed to load file");
return;
}
data.forEach(function(d) {
if (records[d.RegionName] != undefined) {
records[d.RegionName]["latitude"] = d.Latitude != "" ? d.Latitude : 0;
re... | [
"function loadCity(){\n var url = 'http://api.openweathermap.org/data/2.5/weather?q='+cities.value()+\n '&APPID=f02124924447c73bc1d1626b1bee5f45&units=imperial';//set units=metric if you prefer Celcius\n loadJSON(url,setCity);\n}",
"function loadCountyData(state, callback) {\n // for now let's always load th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Set base cache key | get _versionCacheKey() {
const oThis = this;
return oThis.cacheBaseKey + '_v';
} | [
"function getMemcachedKey(parameters) {\r\n\t\treturn 'hotel#' + parameters.destination + '#' + parameters.language + '#' + parameters.hotel;\r\n\t}",
"function computeId(baseId, props) {\n if (!props) {\n return \"jsx-\" + baseId;\n }\n\n var propsToString = String(props);\n var key = baseId + propsToStri... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create the footer section of a tiddler | function createTiddlerFooter(title,isEditor)
{
var theFooter = document.getElementById("footer" + title);
var tiddler = store.tiddlers[title];
if(theFooter && tiddler instanceof Tiddler)
{
removeChildren(theFooter);
insertSpacer(theFooter);
if(isEditor)
{
}
else
{
var lingo = config.views.wikif... | [
"function T1_Footer () {\n\n var codeBuffer = \"\";\n\n codeBuffer += '<div class=\"wrapper row3\">';\n codeBuffer += '<footer id=\"footer\" class=\"clear\">';\n codeBuffer += '<p class=\"fl_left\">' + GenerateTitle() + '<a href=\"#\">' + GenerateTitle() + '</a></p>'; \n codeBuffer += ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int hashable_getRandomBytes(unsigned char dest, int nbytes) | function h$hashable_getRandomBytes(dest_d, dest_o, len) {
if(len > 0) {
var d = dest_d.u8;
for(var i=0;i<len;i++) {
d[dest_o+i] = Math.floor(Math.random() * 256);
}
}
return len;
} | [
"function randomBytes(numberBytes) {\n return crypto.randomBytes(numberBytes).toString('base64');\n}",
"function random_with_replacement(bitLength) {\n if (bitLength == null) {\n bitLength = bytes * 8;\n }\n\n var r = random_bit();\n for (var i = 1; i < bitLength; i++) {\n r *= 2;\n r += random_bit(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
paint the current block white | function clearBlock(){
for(var i = 0; i < 4; i++){
if(currentBlock[i].x < 0 || currentBlock[i].y < 0){
continue;
}
boardGui.rows[currentBlock[i].x].cells[currentBlock[i].y].style.backgroundColor = "white";
}
} | [
"function paintBlock(){\n\tfor(var i = 0; i < 4; i++){\n\t\tif(currentBlock[i].x < 0 || currentBlock[i].x > 19 || currentBlock[i].y < 0 || currentBlock[i].y > 9){\n\t\t\tcontinue;\n\t\t}\n\t\tboardGui.rows[currentBlock[i].x].cells[currentBlock[i].y].style.backgroundColor = \"rgba(255,0,0,0.3)\"; \n\t}\n}",
"pain... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Fades in homepage with overview bar chart | function homeAnimation (){
$('#chart1').hide();
$('#chart2').hide();
$('#all-lvgdonut').hide();
$('#about').hide();
$('#chart1').addClass('animated fadeInDown').show();
} | [
"function showBar() {\n // ensure bar axis is set\n showAxis(xAxisBar);\n\n g.selectAll(\".square\")\n .transition()\n .duration(800)\n .attr(\"opacity\", 0);\n\n g.selectAll(\".fill-square\")\n .transition()\n .duration(800)\n .attr(\"x\", 0)\n .attr(\"y\", function(d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determines what is the maximum length in pixels that can be set for the scroll distance. This is equal to the difference in width between the tab list container and tab header container. This is an expensive call that forces a layout reflow to compute box and scroll metrics and should be called sparingly. | _getMaxScrollDistance() {
const lengthOfTabList = this._tabList.nativeElement.scrollWidth;
const viewLength = this._tabListContainer.nativeElement.offsetWidth;
return (lengthOfTabList - viewLength) || 0;
} | [
"function getMaxScrollWidth(container) {\n\t\tvar header = $('>div.tabs-header', container);\n\t\tvar tabsWidth = 0; // all tabs width\n\t\t$('ul.tabs li', header).each(function () {\n\t\t\ttabsWidth += $(this).outerWidth(true);\n\t\t});\n\t\tvar wrapWidth = $('.tabs-wrap', header).width();\n\t\tvar padding = parse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates an indentation strategy that, by default, indents / continued lines one unit more than the node's base indentation. / You can provide `except` to prevent indentation of lines that / match a pattern (for example `/^else\b/` in `if`/`else` / constructs), and you can change the amount of units used with the / `uni... | function continuedIndent({ except, units = 1 } = {}) {
return (context) => {
let matchExcept = except && except.test(context.textAfter);
return context.baseIndent + (matchExcept ? 0 : units * context.unit);
};
} | [
"function continuedIndent({ except, units = 1 } = {}) {\n return (context) => {\n let matchExcept = except && except.test(context.textAfter)\n return context.baseIndent + (matchExcept ? 0 : units * context.unit)\n }\n }",
"function syntaxIndentation(cx, ast, pos) {\n return indentF... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all groups Get a list of all available groups See: ``` api.listAllGroups() ``` Returns promise yielding the group list | listAllGroups () {
return this._apiRequest('/groups/all')
} | [
"userGroups (id) {\n return this._apiRequest(`/user/${id}/groups`)\n }",
"function getPatronGroups(callback) {\n let patronGroupRequest = createRequest('GET', '/groups', 'application/json');\n\n let req = http.get(patronGroupRequest, function (response) {\n let groupResult = '';\n response.on('data', ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create monthly tags chart | function monthlyTagsChart (result) {
var userTags = result.map(tag => tag.Metadata)
// map and parse userTags
const parsed = userTags.map(tag => {
if (typeof tag === 'string') {
try {
return JSON.parse(tag)
} catch (err) {
return tag
}
} else {
return tag
}
}... | [
"function dailyTagsChart (result) {\n var userTags = result.map(tag => tag.Metadata)\n\n // map and parse userTags\n const parsed = userTags.map(tag => {\n if (typeof tag === 'string') {\n try {\n return JSON.parse(tag)\n } catch (err) {\n return tag\n }\n } else {\n retur... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Represents an option argument to a command line program. | function Option() {
Argument.apply(this, arguments);
this.type = Argument.OPTION;
this.extra = undefined;
this.required = undefined;
this.multiple = undefined;
// a type specified in the literal, eg: {Number}
this.kind = undefined
// default value for the option, eg: {=stdout}
this.value = undefined... | [
"function getopt (pat, opts, argv) {\n var arg, i = 0, $, arg, opt, l, alts, given = {};\n pat.replace(/--([^-]+)@/, function ($1, verbose) { opts[verbose] = [] });\n while (!(i >= argv.length || (argv[i] == \"--\" && argv.shift()) || !/^--?[^-]/.test(argv[i]))) {\n arg = argv.shift();\n arg = /^(--[^=]+)=... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
linearly scaling all feature ranges so that circle radius always fits in [0,maxCircleRadius] for all properties | function featureScale(featureRange) {
let x = d3.scaleLinear()
.domain(featureRange)
.range([0, maxCircleRadius]);
return x;
} | [
"function updateRadiusScale(newMax) {\n \n var largerDim = self.width > self.height ? self.width : self.height;\n self.earthquakeRadiusScale = d3.scaleLinear()\n .domain([0, magToEnergy(newMax)])\n .range([1, largerDim * 0.09]);\n \n self.maxEarthquakeMagnitu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TinySegmenter 0.1 Super compact Japanese tokenizer in Javascript | function TinySegmenter() {
var patterns = {
"[一二三四五六七八九十百千万億兆]":"M",
"[一-龠々〆ヵヶ]":"H",
"[ぁ-ん]":"I",
"[ァ-ヴーア-ン゙ー]":"K",
"[a-zA-Za-zA-Z]":"A",
"[0-90-9]":"N"
}
this.chartype_ = [];
for (var i in patterns) {
... | [
"function WordParser () {}",
"async function tokenizing (text) {\n let split = text.split(/[\\[\\]<>.,\\/#!$%\\^&\\*;:{}=_()?@\\s\\'\\-\\\"]/g);\n let newSplit = sw.removeStopwords(split);\n let newText = \"\";\n let count = 0;\n for( let tmp of newSplit){\n let word = tmp.replace(/[\\d+]/g,\"\"); // remo... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The a() function updates the data object `sc.data` with a `x` property whose value is the time since we started the sample. `sc` is the step context object. Calling `sc.done()` indicates the step function has completed. | function a (sc) {
onTimeout(100, function () {
sc.data.x = elapsed()
sc.done()
})
} | [
"function timeStepBtn(){\n console.log(\"time stepped\");\n arr = getNextIteration(arr);\n drawCanvas(arr);\n}",
"step() {\n if (!this.running) return;\n this.calculate();\n this.print();\n }",
"function YDataStream_get_startTime()\n {\n return this._timeStamp;\n }",
"function ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
comment = "(" ([FWS] ccontent) [FWS] ")" | function comment() {
return wrap('comment', and(
literal('('),
star(and(opt(fws), ccontent)),
opt(fws),
literal(')')
)());
} | [
"comments(node, { value: text, type }) {\n return type === 'comment2' && bannerRegex.test(text)\n }",
"function publishComment(comment, badWords, censorFunction, printFunction) {\n\n\n}",
"function h() {\n /*\n Block comment inside of function g.\n */\n instruction1;\n /*\n Block c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reload the page with the given consent string text data. | reloadContent(data) {
this.titleKey = data['activityControlNeeded'] ?
'assistantRelatedInfoTitle' :
'assistantRelatedInfoReturnedUserTitle';
this.contentKey = data['activityControlNeeded'] ?
'assistantRelatedInfoMessage' :
'assistantRelatedInfoReturnedUserMessage';
this.conse... | [
"function refreshPage() {\r\n var url = location.href;\r\n // Strip of information after the \"?\"\r\n if (url.indexOf('?') > -1) {\r\n url = url.substring(0, url.indexOf('?'));\r\n }\r\n\r\n url = buildMenuQueryString(\"\", url);\r\n url = removeParameterFromUrl(url, \"policyViewMode\");\r... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to remove the current html table on display, row by row iteratively except for the column headers | function clearRows() {
// assign variable using getElementById() method to return the element that has the ID attribute of the html table
var table = document.getElementById("ufo-table");
// assign variable to the number of rows displayed in the html page
var rowCount = table.rows.length;
// loop th... | [
"function removeTableData() {\r\n hideTable();\r\n d3.selectAll(\".row_info\").remove();\r\n }",
"function clear() {\n $('.tablesorter tbody tr').remove();\n $('.tablesorter').trigger('updateAll');\n}",
"function removeData(table) {\n for (var i = table.childNodes[1].childElementCount-1; i >0; i--) ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Report as plain text | reportText() {
var report = "";
report += "hits count: " + this.hits + "\n";
report += "misses count: " + this.misses + "\n";
report += "miss rate: " + this.misses / (this.hits + this.misses) + "\n";
switch (this.write) {
case this.writeThrough: report += "write thro... | [
"println(text) {\n return this.write(text + \"\\r\\n\");\n }",
"_report() {\n const msg = this.schedule.name + ' since ' + moment(this.lastRun).format('YYYY-MM-DD HH:mm')\n + ':\\n'\n + this.reports.map(report => '\\u2022 ' + report.name + \": \" + (this.counts[report.name... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reverse Geocode current Map Point of the Event Set Elements with class = .currLoc to the value of Location of Event | function showLocation(evt) {
// console.log("show");
//get mapPoint from event
//The map is in web mercator - modify the map point to display the results in geographic
var mp = esri.geometry.webMercatorToGeographic(evt.mapPoint);
//display mouse coordinates
// dojo.... | [
"function trackMapGotoLastEventDate()\n{\n _resetCalandarDates();\n trackMapClickedUpdateAll();\n}",
"function updateCoords(evt) {\n\t\t\thideCards();\n\t\t\tpt = view.toMap({ x: evt.x, y: evt.y });\n\n\t\t\tcoords = {\"lat\": pt.latitude.toFixed(5),\n\t\t\t\t\t \"lon\": pt.longitude.toFixed(5),\n\t\t\t\t\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function:retCfgObj () Purpose:Return Object prototype. | function retCfgObj (ObjArray, rowNames, colNames)
{
this.ObjArray = ObjArray;
this.rowNames = rowNames;
this.colNames = colNames;
} | [
"function generateObjectsFromCfg (cfgName)\n{\n\tvar ObjArray = new Array();\n\tif (cfgName.length > 0)\n\t\tvar pageList = new Array ();\n\telse\n\t\treturn null;\n\n\tvar colNames = doAction ('DATA_GETHEADERS', 'GetCol', true, 'ObjectName', cfgName).split ('\\t');\t\t\t\t\n\tvar rowNames = doAction ('DATA_GETHEA... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
set all objects in hash to visible=false | invisible()
{
for (let container of this.containers)
{
container.children.forEach(object => object[this.visible] = false)
}
} | [
"deselectAll() {\n\n if (this.currentTab === 'supergroups') {\n for (let sg in this.supergroups) {\n if (this.supergroups.hasOwnProperty(sg)) {\n this.supergroups[sg].visible = false;\n }\n }\n this.checkedSupergroups = [];\n }\n else if (this.current... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Checks if the status is Submission Status | function isSubmissionStatus(status) {
var submission_arr = ['Submitted', 'Selected', 'Security Validated', 'Submitted to Customer PMO', 'Customer PMO Approved'];
if (status){
for (var x in submission_arr) {
if(status.toLowerCase() === submission_arr[x].toLowerCase()) {
return true;
}
}
}
return false;... | [
"function isEnomStatus(status) {\n\tvar submission_arr = ['Submitted to customer PMO Security', 'Adjudicated', 'Scheduled', 'Indoc Date'];\n\tif (status){\n\t\tfor (var x in submission_arr) {\n\t\t\tif(status.toLowerCase() === submission_arr[x].toLowerCase()) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t}\n\treturn f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return solution configuration enum (Debug/Release) | function getSolutionConfiguration(solutionData) {
"use strict";
switch (solutionData.solutionInfo.configurationName) {
case "Debug":
return config.SolutionConfiguration.Debug;
case "Release":
return config.SolutionConfiguration.Release;
default:
throw ... | [
"getBuildType() {\n this.buildType = process.argv[2] ? process.argv[2].split('-').join('') : 'development';\n }",
"level() {\n const env = process.env.NODE_ENV || 'development';\n const isDevelopment = env === 'development';\n return isDevelopment ? 'debug' : 'warn';\n }",
... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Es calcula el resultat. Es sumen tots els coeficients calculats anteriorment. Amb el resultat feim un mod7. | function resultat(dia, mes, any){
var coeficients = A(any) + B(any) + C(any,mes) + D(mes) + E(dia);
var resultat = coeficients;
return resultat%7;
} | [
"function calcularProm(filas)\n{\n let promedio = document.getElementById('promedio');\n let max = document.getElementById('precioMaximo');\n let min = document.getElementById('precioMinimo');\n if(filas.length != 0 )\n {\n let celdas = traerColumna(filas,'name','CELDAPRECIO').map((e)=>parse... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
show form submitted when user press Submit button in foodreview.html | function reviewSubmit() {
var showReviewForm = document.getElementById("review-submitted");
showReviewForm.style.visibility = "visible";
var hideReviewForm = document.getElementById("review-form");
hideReviewForm.style.visibility = "hidden";
} | [
"function createFormHandler(e) {\n e.preventDefault()\n// Add innerHTML apending to Brainstormer in this section\n const characterInput = document.querySelector(\"#user-edit-character\").value\n const setupInput = document.querySelector(\"#user-edit-setup\").value\n const twistInput = document.querySelector(\"... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
ex: raw_date = '20150809T14:00:00Z' return: ['9 Aug, 2015', '14:00'] (Note date format is DMY, confirms with UK format) | function parseRawDate(raw_date) {
var d = new Date(raw_date)
var day = d.getDate()
var dayOfWeek = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'][d.getDay()]
var month = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul',
'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][d.getMonth()]
var year = d.getFullYear()
var hour = ... | [
"getSymbolsFromDateString(dateString, format){\n\t\tif(format === 'UTC'){\n\t\t\tdateString = dateString.replace('T', ' ').replace('Z', '');\n\t\t}\n\t\tif(format === 'ISO'){\n\t\t\tdateString = dateString.replace('T', ' ').replace('+', \" +\");\n\t\t}\n\t\tdateString = dateString.replace(/\\-/g, ' ').replace(/\\//... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
watch for pixel move, and draw only when the value is not 0 | pixMove (v) {
if (v === 0) return
this.createStyles()
} | [
"function setPixelColor(event) {\n if (event.type === 'click') {\n event.target.style.backgroundColor = 'red';\n } else if (mousingDown) {\n event.target.style.backgroundColor = 'red';\n }\n }",
"draw() {\n //coloring the rect as green (In R... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
5.Get station by pagination | function getStationByPagination(query, qs) {
debug('fetching a collection of stations');
var defferd = q.defer();
var opts = {
sort: qs.sort || {},
page: Number(qs.page) || 1,
limit: Number(qs.per_page) || 10
};
StationModel.paginate(query, opts)
.then((stations) => {
... | [
"function GetRecordsNext(){\n CleanTable('available_records_table');\n GetRecords(records.next_page);\n}",
"fetchStudents(page = 1) {\n axios.get(`${utilities.backendUrl}/students`, {params: {page: page}})\n .then((res) => {\n this.setState({\n students: res.d... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
isArabic returns true when 'char' is in the range of Arabic unicode characters as referenced here: including Arabiconly punctuations | isArabic(char) {
return "\u060C" <= char && char <= "\u066C";
} | [
"function isArabic(c) {\n\tif (c >= 'ا' && c <= 'ي' || (c == 'ء' || c == 'ؤ' || c == 'ئ' || c == 'أ'))\n\t\treturn true;\n\treturn false;\n}",
"function CheckArabicword(field) {\n\tif(isEmpty(field)){\n\t\treturn true;\n\t}\n\tvar string = field.value;\n\tfor (i = 0; i < string.length; i++) {\n\t\tvar c = string.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate the RIPEMD160 of an array of littleendian words, and a bit length. | function binl_rmd160(x, len)
{
/* append padding */
x[len >> 5] |= 0x80 << (len % 32);
x[(((len + 64) >>> 9) << 4) + 14] = len;
var h0 = 0x67452301;
var h1 = 0xefcdab89;
var h2 = 0x98badcfe;
var h3 = 0x10325476;
var h4 = 0xc3d2e1f0;
for (var i = 0; i < x.length; i += 16) {
var T;
var A1 = h0... | [
"function binl(x, len) {\n var T, j, i, l,\n h0 = 0x67452301,\n h1 = 0xefcdab89,\n h2 = 0x98badcfe,\n h3 = 0x10325476,\n h4 = 0xc3d2e1... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The purpose of this function is to load all the balances and save the values into the form | function loadBalances() {
for (var k = 0; k < form.length; k++) {
if (form[k]["gr"]){
form[k]["amount"] = calculateGr1Balance(form[k]["gr"], form[k]["vatClass"], param["grColumn"], param["startDate"], param["endDate"]);
}
}
} | [
"function loadNewTransferData() {\n \tfrmNewTransferKA.toColorAccount1.backgroundColor = account1.color;\n\t frmNewTransferKA.toNameAccount1.text = account1.name;\n\t frmNewTransferKA.toAmountAccount1.text = account1.avlBalance;\n \tfrmNewTransferKA.colorAccount2.backgroundColor = account2.color;\n \tfrmNewTra... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
parse an XLIFF file and return | parseXML(rawText) {
// TODO: different code paths for XLIFF 1.2 vs. 2.0 (this is the only way to support both)
// Document.init();
// Working - just return the Document object from this function
const deferred = $q.defer();
const self = this;
// <xliff xmlns="urn:oasis:names:tc:xliff:d... | [
"function cXparse(src) {\n var frag = new _frag();\n\n // remove bad \\r characters and the prolog\n frag.str = _prolog(src);\n\n // create a root element to contain the document\n var root = new _element();\n root.name = \"ROOT\";\n\n // main recursive function to process the xml\n frag = _... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Creates a new playlist element and updates it to the playlist. Runs function which sets up the delete button handler on the entry. | function updatePlaylistDisplay(videoID, entryID, title) {
var playlistItem = createPlaylistItem(videoID, entryID, title);
appendPlaylist(playlistItem);
var entry = $('#' + videoID);
initializeDeleteButtonHandler(entry); //eslint-disable-line no-use-before-define
} | [
"function removePlaylistEntry(entry) {\n var actionURL = entry.children('.deletebutton').attr('href');\n var entryID = entry.data().id;\n logPlaylistRemove(entryID, actionURL);\n}",
"function createPlaylistItem(videoID, entryID, title) {\n var url = createYoutubeUrl(videoID);\n var deleteButton = '<a class=\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that display the result/ user input | function displayResult() {} | [
"function UserInput(){\n let Input = READLINE.question(\"what operation do you want addition, subtraction, multiplication, or division?\")\n\nif (input == \"addition\"){\n\tlet addinput1 = READLINE.question(\"what is your first number?\");\n\tlet addinput2 = READLINE.question(\"what is your second number?\");\n\tr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
assume isAuth middleware is already checked before this middleware then we have req.user the middleware will pass to next what so ever, but req.isSuperAdminAttribute is added purpose: some resources are only accessible by the user itself and the Superadmin | function isSuperAdmin(req, res, next) {
User.findById(req.user.id).then(user => {
if (!user) {
res.status(404).send('User not found');
}
// console.log(user);
if (user.accountType === 'SuperAdmin') {
req.isSuperAdmin = true;
} else {
req.isSuperAdmin = false;
}
next();
... | [
"function userOrBackendAuthorization(req, res, next) {\n if (configUtil.getRequireAuth() === false) return next();\n\n const token = getToken(req);\n const adminToken = configUtil.getAdminToken();\n if (req.isAuthenticated()) return next();\n else if (adminToken && token === adminToken) return next();\n else\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
date > string (w3c) | function date2str(date) {
return pad(date.getFullYear(), 4, "0") + "-" +
pad(date.getMonth() + 1, 2, "0") + "-" +
pad(date.getDate(), 2, "0") + "T" +
pad(date.getHours(), 2, "0") + ":" +
pad(date.getMinutes(), 2, "0") + ":" +
pad(date.getSeconds(), 2, "0") + "Z";
} | [
"function WMIDateStringToDate(dtmDate)\r\n{\r\n if (dtmDate == null) { return \"null date\"; }\r\n var strDateTime;\r\n if (dtmDate.substr(4, 1) == 0) { strDateTime = dtmDate.substr(5, 1) + \"/\"; } \r\n else { strDateTime = dtmDate.substr(4, 2) + \"/\"; }\r\n if (dtmDate.substr(6, 1) == 0)\r\n { s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sets the first nonshowHost player available to the hot seat role. Expected to be called when only one player is present. | _setOnlyPlayerToShowHost() {
var hotSeatSet = false;
this.playerMap.doAll((player) => {
if (!hotSeatSet && !player.isShowHost) {
this.serverState.setHotSeatPlayerByUsername(player.username);
hotSeatSet = true;
}
});
} | [
"function switchPlayer() {\n if (curPlayer == \"NASA\") {\n curPlayer = \"USSR\";\n } else { //curPlayer == \"USSR\"\n curPlayer = \"NASA\";\n }\n }",
"function playerOne(i) {\n if (self.gameData.playerOneTurn === false) {\n self.gameData.playerOneClass = t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get all external components of an app by specifying the appId. | getExternalComponents(appId) {
if (this.appTouchedExternalComponents.has(appId)) {
return this.appTouchedExternalComponents.get(appId);
}
return null;
} | [
"registerExternalComponents(appId) {\n if (!this.appTouchedExternalComponents.has(appId)) {\n return;\n }\n const externalComponents = this.appTouchedExternalComponents.get(appId);\n if (externalComponents.size > 0) {\n this.registeredExternalComponents.set(appId, e... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Hooks the JWT Strategy. | function hookJWTStrategy(passport) {
// TODO: Set up Passport to use the JWT Strategy.
const options = {};
options.secretOrKey = config.keys.secret;
options.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme('jwt');
options.ignoreExpiration = false;
passport.use(new JWTStrategy(options, (JWTPayload, cal... | [
"function hookJWTStrategy(passport) {\r\n var options = {}\r\n \r\n options.secretOrKey = config.secret\r\n options.jwtFromRequest = ExtractJwt.fromAuthHeaderWithScheme('Bearer')\r\n passport.use(new JWTStrategy(options, function(JWTPayload, callback) {\r\n db.users.findOne({ _id: JWTPayload._... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns a nested array of profiles and differences for each prediction. | function getPredictionDifferences(relativeData) {
const userPredictions = _find(relativeData, {id: user.id}).predictions;
return relativeData.map(profile =>
predictions.map(({ id }, i) => {
const userValue = userPredictions[i];
const profileValue = profile.predictions[i];
return {... | [
"function convertToRelativeValues(extents) {\n return data.map(profile => {\n const relativePredictions = predictions.map(({id}, i) => {\n const extent = extents[i];\n const profileValue = _find(profile.predictions, {id}).value;\n const delta = extent[1] - extent[0];\n return (pr... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds the list of all agencies to the browse all page. | function addAgenciesToBrowseAll() {
var list = document.getElementById("agencyList");
if(!list) {
return;
}
var i;
for(i in agencies) {
var agency = agencies[i];
var a = document.createElement("a");
a.href = "Homepage.php?what=agency&id="+i;
var t = document.createTextNode(agency.name);
a.append... | [
"agencies(cb) {\n var agencies = [ ];\n\n this._newRequest().query({ command: 'agencyList' }, function(e) {\n switch(e.name) {\n case 'error':\n cb(null, e.data);\n break;\n\n case 'opentag':\n var tag = ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FIND COURSES ON CRITERIA find courses based on coursename string | static async findCourse(string){
const result=await pool.query('SELECT *,LOWER(coursename),INSTR(LOWER(coursename),?) FROM course WHERE INSTR(LOWER(coursename),?)>0 ORDER BY INSTR(LOWER(coursename),?);',[string,string,string]);
return result;
} | [
"findStudentCourses(courseArray){\r\n \tlet studentCourseList = [];\r\n \tfor(let courseName of courseArray){\r\n studentCourseList.push(this.courses.get(courseName));\r\n\t\t}\r\n\t\treturn studentCourseList;\r\n\t}",
"function getCurrentCourse()\n{\n var foundcourse = null;\n var currentu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Warn if the bin references don't point to anything. This might be better in normalizepackagedata if it had access to the file path. | function checkBinReferences_ (file, data, warn, cb) {
if (!(data.bin instanceof Object)) return cb()
var keys = Object.keys(data.bin)
var keysLeft = keys.length
if (!keysLeft) return cb()
function handleExists (relName, result) {
keysLeft--
if (!result) warn('No bin file found at ' + relName)
if... | [
"function checkBin() {\n\t\tif (pkg.bin) {\n\t\t\tconst bins =\n\t\t\t\ttypeof pkg.bin === 'string'\n\t\t\t\t\t? [pkg.bin]\n\t\t\t\t\t: Object.keys(pkg.bin).map(it => pkg.bin[it]);\n\t\t\tbins.forEach(it => {\n\t\t\t\t!exsitsFile(it, opts.cwd) &&\n\t\t\t\t\tproblems.push({\n\t\t\t\t\t\tmessage: `cannot found file \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
DEFINE RESTAURANT/ZOMATO FUNCTIONS Get city ID using Zomato API If user input matches more than one city, generate buttons that represent potential city matches | function getCity() {
var zomatoURL = "https://developers.zomato.com/api/v2.1/cities?q=" + city;
$.ajax({
url: zomatoURL,
dataType: "json",
async: true,
beforeSend: function (xhr) { xhr.setRequestHeader("user-key", zAPIkey); },
success: function (response) {
if... | [
"function SearchCity(){\n \n var citycode = document.getElementById(\"city_searchbar\").value;\n var countrycode = document.getElementById(\"country_searchbar\").value;\n\n // Check every letter of the citycode string\n for(zl = 0; zl < citycode.length; ++zl){\n\n // If... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the unique group corresponding to the provided group key. | function resolveGroupReference(key) {
for (var i = 0; i < groupedItems.groups.length; i++) {
if (groupedItems.groups.getAt(i).key === key) {
return groupedItems.groups.getAt(i);
}
}
} | [
"function _getGroupKeySelector(item) {\n return item.group.key;\n }",
"async function getGroupName(group) {\n const result = await db.collection(\"Groups\")\n .findOne({ _id: ObjectId(group) }, { projection: { _id: 0, name: 1 } });\n\n if (result === null) {\n throw new RequestError('group does ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Truncates the text content of a node using binary search. If no valid truncation point is found, attempt to truncate its nearest sibling. $textNode The jQuery node to truncate. $rootNode The jQuery root node to measure the truncated height. $clipNode The jQuery node to insert right after the truncation point. options A... | function truncateTextContent($element, $rootNode, $clipNode, options) { // jshint ignore:line
if (options.position === "end") {
return truncateTextEnd($element, $rootNode, $clipNode, options);
}
else if (options.position === "start") {
return truncateTextStart($element, $rootNode, $clipNode, opt... | [
"function _ellipsisElement(tNode, suffix, lineClamp, eNode) {\r\n\r\n suffix = suffix ? suffix : \"...\";\r\n\r\n /*\r\n * Get max height of div including margin, padding and border\r\n * TODO: remove using Jquery to adapt TV4 and TV5\r\n */\r\n var fontSize = $(eNode).c... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
returns all sheets in the db | function allSheets() {
console.log('allCans called')
return db('users_sheets')
} | [
"async function getFileSheets() {\n\n const fileId = selectFileSelectBox.value;\n worksheetSelect.innerHTML = defaultOptionSelect;\n\n if (fileId == 'none') { displayErrorMessage(\"Please select a file\");\n return false;\n }\n /* Send A request to get the sheets */\n const res = await fetch(`/getsheets/${f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |