query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Disable or enable a form If status is equla to true, it will disable the specified form If status is equal to false, it will enable the specified form | function disableForm(status)
{
var formElts = this.formObj.elements;
for(var i = 0 ; i < formElts.length ; i++)
{
eltObj = formElts[i];
this.disableField(eltObj.id,status);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableForm() {\n getFormControls().prop('disabled', false).removeClass('disabled');\n cancelButton.prop('disabled', false).show();\n submitButton.prop('disabled', false).show();\n passwordToggleButton.prop('disabled', false);\n editButton.hide().prop('disabled', true);\n... | [
"0.68037117",
"0.65678555",
"0.65573984",
"0.64789844",
"0.6471698",
"0.64542764",
"0.62007207",
"0.6193867",
"0.61725324",
"0.6167168",
"0.61602825",
"0.6152279",
"0.61456174",
"0.61281216",
"0.61263084",
"0.612085",
"0.611599",
"0.6106667",
"0.6091993",
"0.60860205",
"0.602... | 0.77575266 | 0 |
Check all required fields in the form and alert the user of them. missingVal parameter is the message to be displayed before each missing field If skipAlert parameter is set to true, this function didn't alert just return a boolean value If the attribute label of the required fied is not set, this function didn't alert... | function checkRequired(missingVal,skipAlert)
{
var currentObj = null;
var currentObjAtt = null;
var eltName = null;
var eltTag = null;
var eltType = null;
var required = null;
var testValue = null;
var label = null;
var spaceRegExp = new RegExp(" ","g");
var alerts = "";
var theFor... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkRequiredFields() {\n\tglobalFilled = true;\n\tfor (pt in attributesHash) {\n\t\tif (!exclusion(pt)) { \n\t\t\ttry {\n\t\t\t\tglobalFilled = checkField(pt, true) && globalFilled;\n\t\t\t} catch (err) { alert(\"error: \" + err.description);}\n\t\t}\n\t}\n\t// should add check for errorMessageLength, be... | [
"0.6820686",
"0.6564928",
"0.65483075",
"0.63492715",
"0.6326432",
"0.62924945",
"0.6215358",
"0.61686",
"0.61282486",
"0.61279553",
"0.6086407",
"0.60795057",
"0.60784984",
"0.60762805",
"0.6053308",
"0.6003669",
"0.5970229",
"0.5950507",
"0.5945913",
"0.5931887",
"0.5924255... | 0.79054916 | 0 |
this function populate a drop down list from an xmlDocument the selectId is the id of the select element the elementTag is the name of the element in the xml document which contain the select html the xmlDoc is the xmlDocument withFirstValueEmpty is boolean if true then it will generate drop down with empty value for t... | function populateDropDown(selectId,elementTag,xmlDoc,withoutFirstValueEmpty){
if(xmlDoc.xml != ""){
var root=xmlDoc.getElementsByTagName(elementTag)[0];
if(root!=null){
var selectOptions=root.getElementsByTagName("option");
var value,displayContent,selectContent;
//reinitialise
document.getElemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function populateTreeSelection(xmlList){\n var treeSelector = document.getElementById(\"treeSelector\");\n\n //clear the selection list\n for (var count = treeSelector.options.length-1; count >-1; count--){\n treeSelector.options[count] = null;\n }\n\n //get the relevant xml elements in an ar... | [
"0.66023105",
"0.6599373",
"0.6517952",
"0.6287341",
"0.6084658",
"0.60698694",
"0.60698694",
"0.6005539",
"0.5995278",
"0.59888965",
"0.59598607",
"0.59267265",
"0.5916156",
"0.5911615",
"0.5897297",
"0.5889653",
"0.5885206",
"0.5837572",
"0.5835242",
"0.582456",
"0.581289",... | 0.82824296 | 0 |
Initializing the WikiaURL object | function WikiaURL( url, params, options ) {
if ( this.constructor !== WikiaURL ) {
return new WikiaURL( url, params, options );
}
const r = { };
r._baseURL = String( url || window.location );
r._urlParams = params || { };
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static initialize(obj, targetUrl) { \n obj['targetUrl'] = targetUrl;\n }",
"static initialize(obj, type, mediaUrl) { \n obj['type'] = type;\n obj['mediaUrl'] = mediaUrl;\n }",
"constructor(url) {\n this.url = url;\n }",
"function initializeDefaultRequestURLObject() {\n const... | [
"0.61964273",
"0.6012501",
"0.58887315",
"0.58435",
"0.5784153",
"0.5758203",
"0.57578605",
"0.57578605",
"0.5732659",
"0.57002604",
"0.5690957",
"0.56803775",
"0.56715",
"0.5644292",
"0.56163853",
"0.55981976",
"0.5573171",
"0.55406946",
"0.5536421",
"0.55320626",
"0.5523617... | 0.6916755 | 0 |
Return true if |object|.|property| can be called without throwing an error. | function canAccessProperty(object, property) {
try {
const unused = object[property];
return true;
} catch (errors) {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_canAccess(obj) {\n // TODO: `Object.getPrototypeOf` can trigger a proxy trap; need to check on that as well.\n\n // check if objects of this type have already been floodgated\n return !this._readErrorsByType.has(Object.getPrototypeOf(obj));\n }",
"function canSetProperty(object, property, primitives){... | [
"0.6657954",
"0.6545225",
"0.6545225",
"0.6491586",
"0.6393904",
"0.6311743",
"0.6188272",
"0.60203826",
"0.59894985",
"0.5832272",
"0.5808668",
"0.5740308",
"0.57318455",
"0.57199705",
"0.5703545",
"0.56836164",
"0.56836164",
"0.5654285",
"0.5651214",
"0.5651214",
"0.5626817... | 0.75379366 | 0 |
Verifies that a popup with origin `origin` and headers `headers` has the expected `opener_state` after being opened. | async function popup_test(description, origin, headers, expected_opener_state) {
promise_test(async t => {
const popup_token = token();
const reply_token = token();
const popup_url = getExecutorPath(
popup_token,
origin.origin,
headers);
// We open popup and then ping it, it will r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SRC_verifyWindowOpener()\r\n{\r\n \tSRC_clearTimedWindowVerification();\r\n\r\n if ((!window.opener) \t\t\t\t||\r\n \t\t(window.opener.closed) \t||\r\n \t\t(typeof window.opener.document == \"unknown\"))\r\n {\r\n setTimeout(function() { SRC_closeWindowOpener(); }, 4000);\r\n return;\r\n\t}\r\n\... | [
"0.5851656",
"0.58432716",
"0.5638042",
"0.52870727",
"0.52048844",
"0.51464516",
"0.5073482",
"0.5068263",
"0.5031959",
"0.49771205",
"0.49705315",
"0.49508417",
"0.49419972",
"0.49392137",
"0.49226186",
"0.4872379",
"0.4861162",
"0.4824589",
"0.48188826",
"0.47811562",
"0.4... | 0.74436635 | 0 |
Assign customer to zone by finding the zone that customer's lat & lng belongs to. | function assignCustomerToZone() {
return new Promise((resolve, reject) => {
dataProvider.getAllCustomers(['latitude', 'longitude', 'route'])
.then(allCustomers => {
for (let customer of allCustomers) {
if (customer && customer.hasOwnProperty('ROUTE') && custom... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAddressAndAccountSet (customerId) {\n\t\t\t\tvar defer = $q.defer();\n\t\t\t\taccountService.getCustomerById(customerId).then(\n\t\t\t\t\tfunction (successResult) {\n\t\t\t\t\t\t$scope.customerID = successResult.data.id;\n\t\t\t\t\t\t$scope.customerDO.id = successResult.data.id;\n\t\t\t\t\t\t$scope.cus... | [
"0.5783503",
"0.5602365",
"0.5510108",
"0.5412538",
"0.52975696",
"0.5287497",
"0.5251972",
"0.51627237",
"0.51237583",
"0.50964123",
"0.5066757",
"0.50615567",
"0.5056036",
"0.50290036",
"0.50247145",
"0.5020104",
"0.49724388",
"0.49688688",
"0.4937117",
"0.4936148",
"0.4917... | 0.7739667 | 0 |
Save global zoneGeoJSON to JSON file | function saveZoneAsJSON() {
let filepath = path.join(__dirname, '../data/json');
if(!fs.existsSync(filepath)) {
fs.mkdirSync(filepath)
}
filepath = path.join(__dirname, '../data/json/ZonesGeoJSON.json');
jsonfile.writeFile(filepath, zoneGeoJSON)
.catch(console.error);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function writeJson(){\n mapjson = JSON.stringify(map, null, 4);\n fs.writeFile('asd/map.json', mapjson, 'utf8', function(){\n });\n}",
"function exportToGeoJSON(element, content) {\n // HTML5 features has been used here\n var geoJsonData = 'data:application/json;charset=utf-8,' + encodeURIComponen... | [
"0.6863459",
"0.6810354",
"0.6414148",
"0.62967485",
"0.6279951",
"0.6223416",
"0.619036",
"0.6121496",
"0.60752743",
"0.5971169",
"0.59013104",
"0.5872868",
"0.58502686",
"0.5839958",
"0.58120954",
"0.58056664",
"0.5800723",
"0.578512",
"0.57814723",
"0.5774017",
"0.57688606... | 0.8498644 | 0 |
Connection for sending messages to clients. | function Sender() {
this.con = new Connection();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sendMessage(msg){\n this.socket.emit(\"client\", msg);\n }",
"connect() {\n log.info('connection constructing.');\n const WebSocketServer = WebSocket.Server;\n const wss = new WebSocketServer({\n port: PORT\n });\n\n wss.on('connection', (ws) => {\n log.info('connection establi... | [
"0.6633007",
"0.6615419",
"0.63277715",
"0.62614393",
"0.62429434",
"0.61992085",
"0.61573976",
"0.61276275",
"0.6125107",
"0.61179155",
"0.61169916",
"0.60897696",
"0.6075451",
"0.6073404",
"0.6061615",
"0.60603976",
"0.6049474",
"0.60439026",
"0.6036007",
"0.597889",
"0.597... | 0.68367296 | 0 |
fetching all the data listed under our search and pushing them all into our custom array | function searchAllData(url) {
console.log(url)
window
.fetch(url)
.then(res => res.json())
.then(data => {
console.log(data)
data.response.rows.forEach(function(n) {
addObject(n);
});
combineJSON(myArray)
})
.catch(error => {
console.log(error)
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async searchSong(searchText) {\n try {\n // Fetching the song info from API\n const fetchedData = await fetch(`${this.apiSong}${searchText}`);\n const responseData = await fetchedData.json();\n // console.log(responseData.data);\n\n // loading only 10 d... | [
"0.6611863",
"0.6609579",
"0.65234697",
"0.64351463",
"0.641648",
"0.6391606",
"0.628052",
"0.62156206",
"0.61910343",
"0.6176549",
"0.616009",
"0.61486566",
"0.61477",
"0.61393005",
"0.61352974",
"0.6133567",
"0.6132563",
"0.61163396",
"0.61134523",
"0.6093469",
"0.60843396"... | 0.7139365 | 0 |
get objects from myArray and add them into one JSON object | function combineJSON(myArray) {
let results = {};
for (let i = 0; i < myArray.length; i++) {
// keys - indices, values - each object
results[i] = myArray[i];
}
// stringify our JSON object and add to our empty string defined above
jsonString += JSON.stringify(results);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function structureObjectData(array) \r\n {\r\n let newArray = array.map( item => ({symbol: item.symbol,name: item.name, id:item.iexId}));\r\n console.log(newArray);\r\n return newArray\r\n }",
"function addObject(objectData) {\n var currentID = objectData.id;\n var currentTitle = objectData.t... | [
"0.5789407",
"0.57555497",
"0.5689575",
"0.56710446",
"0.5659236",
"0.5587205",
"0.55549234",
"0.5525952",
"0.54648435",
"0.5458748",
"0.53366613",
"0.53182054",
"0.5279508",
"0.52724534",
"0.5260714",
"0.5236559",
"0.52312714",
"0.5223768",
"0.5222376",
"0.52191645",
"0.5211... | 0.77735966 | 0 |
pass() returns an object that contains the symbols table and a flag that indicates if there are still unresolved symbols. | function pass(AST, symbols, lc) {
let unresolved = false;
let seen = {};
if (typeof(symbols) === 'undefined') { symbols = {}; }
// If making a pass on a Macro body, LC is provided, else start at $0
if (typeof(lc) === 'undefined') { lc = 0x0; }
for (let statement of AST.body) {
switch (statement.type)... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FreeSym() {\r\n}",
"function findImportantSymbolsInClosure(closure_results) {\n\tvar symbols = {};\n\n\t// Loop over the closure results\n\tfor(var i in closure_results) {\n\t\tvar symbol = closure_results[i].body[closure_results[i].dotPosition];\n\t\tif(!symbols[symbol]) {\n\t\t\tsymbols[symbol] = [];\... | [
"0.54570895",
"0.5429649",
"0.5366718",
"0.49931628",
"0.49771953",
"0.49176192",
"0.49176192",
"0.48979872",
"0.48931977",
"0.48134464",
"0.47733584",
"0.47353786",
"0.47214234",
"0.47214234",
"0.47113913",
"0.46826735",
"0.46797708",
"0.46744913",
"0.46723974",
"0.4638018",
... | 0.5577729 | 0 |
affiche la variable resultat | afficheResultat(){
alert(this.resultat);
console.log(this.tableau);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sumar() {\n num1 = obtenerResultado();\n operacion = \"+\";\n limpiar();\n}",
"function reestablece(){\n colector = \"0\";\n operacion = \"\";\n operador0 = 0;\n operador1 = 0;\n resultado = 0;\n iteracion = 0;\n }",
"function result() {\r\n\r\n \tlet entry1 = '';\r\n \t\r\n\r\n ... | [
"0.62082154",
"0.61407214",
"0.608259",
"0.6037091",
"0.5995503",
"0.59831166",
"0.59793055",
"0.5965681",
"0.59333897",
"0.59319776",
"0.5873658",
"0.5852125",
"0.58193773",
"0.5819301",
"0.58151025",
"0.57834363",
"0.57800806",
"0.5755915",
"0.5747277",
"0.57453805",
"0.573... | 0.6276638 | 0 |
removeDupes('AABB'); // 'AB' removeDupes('AaAaBbBb'); // 'AaBb' removeDupes('cAtCaT'); // 'cAtCaT' | function insensitiveRemoveDupes(string) {
var stringSet = new Set()
var testSet = new Set();
var testString = string.toUpperCase();
for (var i = 0; i < testString.length; i++) {
if (!testSet.has(testString[i])) {
testSet.add(testString[i]);
stringSet.add(string[i]);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeDupes2(str) {\n if (!str) {\n return \"please pass in valid input\";\n }\n\n var len = str.length,\n map = new Array(26),\n nodupe = \"\",\n i;\n\n for(i=0; i<len; i++) {\n if (map.indexOf(str[i]) === -1) {\n nodupe += str[i];\n ma... | [
"0.75407547",
"0.71709204",
"0.70656806",
"0.70006293",
"0.6988394",
"0.69356334",
"0.69302076",
"0.6911611",
"0.6906802",
"0.68927306",
"0.68881214",
"0.68680096",
"0.6856667",
"0.68463737",
"0.6834869",
"0.68297493",
"0.68183917",
"0.6788919",
"0.67874646",
"0.6779702",
"0.... | 0.75100434 | 1 |
Returns payment provider config information | getProviderConfig() {
return this._data.providers;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSPPConfig () {\n return SPP_CONFIG\n}",
"getConfig () {}",
"function getBidderConfig() {\n return bidderConfig;\n }",
"function getConfig() {\n return config;\n }",
"static getProviderInfo(providerId) {\n return DUMMY_PROVIDER_INFO;\n }",
"function getProvider()\n{\n r... | [
"0.6607893",
"0.5891207",
"0.586321",
"0.58365417",
"0.58177686",
"0.5791805",
"0.576472",
"0.5741179",
"0.5727735",
"0.56892526",
"0.5670988",
"0.56572884",
"0.56323934",
"0.5618388",
"0.5608311",
"0.5603366",
"0.55968994",
"0.55745894",
"0.55674744",
"0.55321205",
"0.551451... | 0.7008906 | 0 |
Returns an array of access tokens | getAccessTokens() {
return this._data.accessTokens;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getTokens() {\n const apiURL = `${this.dxApiURL}/v1/tokens`\n const res = await fetcher(apiURL)\n\n return res.data\n }",
"getAccessToken() {}",
"getToken() {\n return [\n this.authenticate([AUTH_TYPE.BASIC, AUTH_TYPE.CLIENT]),\n this._bindAfterToken.bind(this),\n this.exchang... | [
"0.66932756",
"0.6448029",
"0.6304775",
"0.6232494",
"0.6223624",
"0.6124867",
"0.60806054",
"0.5918624",
"0.59095824",
"0.5899432",
"0.58197737",
"0.5811124",
"0.57904106",
"0.57795024",
"0.5756892",
"0.5753412",
"0.57470846",
"0.57466924",
"0.574095",
"0.5732426",
"0.571947... | 0.773347 | 0 |
Checks the provided token and secret, returning true if correct and false if incorrect | checkAuthToken( token, secret ) {
return this.getAccessTokens().find( a => a.token === token && a.secret === secret ) != null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSecretTokenValid(secretToken) {\n return functions.config().email.secret_token === secretToken;\n}",
"function tokenIsVaild(ctx) {\n bearerHeader = ctx.header['authorization'];\n token = bearerHeader.split(' ')[1];\n console.log(token);\n try {\n Jwt.verify(token, appsecret);\n ... | [
"0.72725433",
"0.7105213",
"0.70271105",
"0.68912446",
"0.6883261",
"0.67429936",
"0.67140514",
"0.6630844",
"0.63925517",
"0.63115704",
"0.63115704",
"0.6286428",
"0.6286428",
"0.62603796",
"0.6260051",
"0.62537956",
"0.62115675",
"0.62115675",
"0.62115675",
"0.6198899",
"0.... | 0.7986442 | 0 |
Attempt to load the defined payment providers | loadPaymentProviders() {
Logger.info( `Attempting to load payment providers for tenant with ID ${this.getID()}` );
/* Don't load payment providers if they have already been loaded */
if ( this.getProviders().length > 0 ) {
Logger.info( `Payment providers already loaded for tenant with ID ${this.getID... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_loadModules(modules) {\n for (var module of modules) {\n // A single provider (class or function).\n if (isFunction(module)) {\n this._loadFnOrClass(module);\n continue;\n }\n\n throw new Error('Invalid module!');\n }\n }",
"function initProviders()\n{\n // Check if m... | [
"0.6150965",
"0.5940726",
"0.5793918",
"0.5739824",
"0.5681682",
"0.5661301",
"0.560233",
"0.5598015",
"0.5483006",
"0.54770553",
"0.5418264",
"0.53977776",
"0.53977776",
"0.53977776",
"0.53977776",
"0.53977776",
"0.53977776",
"0.5390302",
"0.53798115",
"0.53198826",
"0.53143... | 0.7636957 | 0 |
Gets a provider by ID | getProvider( id ) {
return this.getProviders()[id];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProvider()\n{\n return providers[ iProvider ];\n}",
"static get(name, id, opts) {\n return new OpenIdConnectProvider(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }",
"static getProvider(providerName) {\n const provider = this.providers.find(provider => pro... | [
"0.6557523",
"0.6361691",
"0.5894112",
"0.5888332",
"0.5884086",
"0.58811843",
"0.58321685",
"0.57992184",
"0.57765573",
"0.5725315",
"0.5695599",
"0.56900793",
"0.56836855",
"0.5683516",
"0.56281817",
"0.56257623",
"0.56156296",
"0.5612041",
"0.56111175",
"0.56061983",
"0.56... | 0.8100131 | 0 |
Encodes svg as a base64 text and opens a new browser window to the svg image that can be saved as a .svg on the users local filesystem. This skips making a round trip to the server for a POST. | function encodeAsImgAndLink(svg) {
if ($.browser.msie) {
// Add some critical information
svg.setAttribute('version', '1.1');
var dummy = document.createElement('div');
dummy.appendChild(svg);
window.winsvg = window.open('/static/html/export.html');
window.winsvg.document.write(dummy.innerHTML... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function encodeAsImgAndLink(svg) {\n if ($.browser.msie) {\n // Add some critical information\n svg.setAttribute('version', '1.1');\n var dummy = document.createElement('div');\n dummy.appendChild(svg);\n window.winsvg = window.open('/static/html/export.html');\n window... | [
"0.7706117",
"0.6844281",
"0.6314517",
"0.6237319",
"0.6219939",
"0.62115264",
"0.61896455",
"0.618139",
"0.6136809",
"0.61324596",
"0.6119365",
"0.6114556",
"0.6104494",
"0.60927147",
"0.6062179",
"0.6037942",
"0.60258704",
"0.60023296",
"0.5972665",
"0.59657806",
"0.5943900... | 0.77324873 | 0 |
Check if an image container is empty of fully opaque items. | function isEmpty(imgContainer) {
for (var i = 0; i < imgContainer.length; i++) {
var thisImg = $(imgContainer[i]);
if (thisImg.css('opacity') === '1') {
return false;
}
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getIsFilled() {\n return this.getAllItemsWidth() >= this.getContainerWidth();\n }",
"get is_empty() {\n return !!(this.flags & PaintVolumeFlags.IS_EMPTY);\n }",
"isEmpty() {\n\t\treturn this.items == 0;\n\t}",
"isEmpty() {\n const isHeaderEmpty = this.__headerTextEditor.getEditor... | [
"0.67833644",
"0.6589415",
"0.63428825",
"0.6329664",
"0.62796235",
"0.62470955",
"0.6244387",
"0.62274975",
"0.62274975",
"0.6221198",
"0.62198615",
"0.6219268",
"0.62152696",
"0.62010634",
"0.618638",
"0.6168482",
"0.6134182",
"0.61329246",
"0.6120932",
"0.6114694",
"0.6105... | 0.76578516 | 0 |
Generates words in an FSA | function generate(fsa) {
var currentState = fsa.startState; // track our current state
var word = ""; // word we are generating
var accept = false; // boolean that lets us continue or exit loop
do {
// 0. If current state is accept state, decide if we should accept
if (fsa.acceptStates.includes(current... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateName(){\n var chain = new Foswig(3); //Using Foswig JS\n var dictionary = [\"MARY\", \"JAMES\", \"PATRICIA\", \"JOHN\", \"ELIZABETH\", \"ROBERT\", \"JENNIFER\", \"MICHAEL\", \"LINDA\", \"WILLIAM\", \"BARBARA\", \"DAVID\", \"MARGARET\", \"RICHARD\"... | [
"0.64190257",
"0.6282776",
"0.6133983",
"0.6120505",
"0.60970837",
"0.6055652",
"0.6002832",
"0.60000324",
"0.59807414",
"0.5950755",
"0.5928352",
"0.5917689",
"0.5915418",
"0.58990294",
"0.5883525",
"0.5851516",
"0.5844704",
"0.58435065",
"0.58183914",
"0.5812499",
"0.578302... | 0.7175141 | 0 |
freq = n SAMPLE_RATE / MY_FFT_SIZE | function mapFreq( i ) {
// var freq = i * SAMPLE_RATE / FFT_SIZE;
var freq = i * self.SAMPLE_RATE / self.spectrum.length;
return freq;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapFreq(i){\n // var freq = i * SAMPLE_RATE / FFT_SIZE;\n var freq = i * SAMPLE_RATE / self.spectrum.length;\n return freq;\n }",
"setFrequency() {\r\n\r\n this.frequency = [];\r\n for (let i = 0; i < this.fftSize / 2; i++) {\r\n this.frequency[i] = i * this.sa... | [
"0.78284454",
"0.7180688",
"0.692647",
"0.68277276",
"0.65908414",
"0.6469817",
"0.63940233",
"0.63763815",
"0.63317287",
"0.60919094",
"0.60623324",
"0.60441655",
"0.60134697",
"0.59850603",
"0.5974276",
"0.59584594",
"0.5956306",
"0.59481335",
"0.5929375",
"0.59035146",
"0.... | 0.76810896 | 1 |
On load, check to see if there is a track name/genre in the URL | function getGenre() {
if ( window.location.hash ) {
var genre = window.location.hash.substr( 1 );
loadAndUpdate( genre );
} else {
var genre = genres[ randomInt( genres.length - 1 ) ];
location.hash = "#" + genre;
loadAndUpdate( genre );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function check_parts(){\r\n\r\n\t\ttrack_url=\"http://ws.audioscrobbler.com/2.0/?method=track.search&track=\"+encodeURI(parts[0])+\"&api_key=977a73b8d997832303ec0a4bbd516ca7\";\r\n\t\thttp2=new XMLHttpRequest();\r\n\t\thttp2.open(\"GET\",track_url,true);\r\n\t\thttp2.onreadystatechange=getlastfmdata;\r\n\t\thttp2.... | [
"0.60543555",
"0.59678787",
"0.59587926",
"0.5907236",
"0.5762382",
"0.5711049",
"0.5688226",
"0.5678013",
"0.56180096",
"0.5576217",
"0.5558414",
"0.55239224",
"0.5505912",
"0.55047774",
"0.5477119",
"0.5442084",
"0.54338473",
"0.5432934",
"0.54214954",
"0.5413486",
"0.53840... | 0.6458938 | 0 |
Downloads the module from github | _downloadModule() {
// If URL is not provided, throw error.
if(!this.evt.options.url) {
return BbPromise.reject(new SError('Github URL is required. (eg. serverless module install <github-url>)', SError.errorCodes.UNKNOWN));
}
let _this = this,
spinner = SCli.spinner(),
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function downloadGithub(fromUrl,toPath,cli,next) {\n\n // Split module / version\n var githubName = fromUrl;\n\n if(githubName) {\n\n var tag = githubName.split('@')[1] || \"\";\n var githubName = githubName.split('@')[0];\n var tmpName = githubName.replace(\"/\",\"-\");\n\n if(githubName.split(\"/\... | [
"0.71874845",
"0.6631186",
"0.64468974",
"0.6208962",
"0.61804456",
"0.6083265",
"0.59220845",
"0.5866999",
"0.5816695",
"0.57277256",
"0.5713199",
"0.5684307",
"0.5641871",
"0.5587239",
"0.5583345",
"0.55472",
"0.552266",
"0.55151355",
"0.5514711",
"0.55053",
"0.54733545",
... | 0.7694584 | 0 |
Validate and prepare data before installing the downloaded module | _validateAndPrepare() {
let _this = this,
srcModuleJsonPath = path.join(_this.pathTempModule, 's-module.json');
// if s-module.json doesn't exist in downloaded module, throw error
if (!SUtils.fileExistsSync(srcModuleJsonPath)) {
return BbPromise.reject(new SError('Missing s-module.j... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onData() {\n if ( packages instanceof Array ) {\n temp.mkdir('staniol_components', function ( err, tempDir ) {\n var components = new Components({\n components : packages,\n directory : tempDir\n ... | [
"0.5998108",
"0.5844654",
"0.5844654",
"0.5713199",
"0.5572038",
"0.55034715",
"0.54687876",
"0.5434917",
"0.53947926",
"0.5385395",
"0.5385395",
"0.5385395",
"0.5385395",
"0.5345699",
"0.5252545",
"0.5184773",
"0.5120116",
"0.51128465",
"0.5108302",
"0.51061344",
"0.50940377... | 0.6540763 | 0 |
Validates whether Consent Date is older than the MinimumConsentDate and if so deletes the MSCC cookie | function validateMinimumConsentDate() {
var consentDate = getCookieValue(cookieName);
if (consentDate < minimumConsentDate)
deleteCookie(cookieName);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validateExpiredate() {\n\t\tlet input = formTrm.inputs.fields.expiredate;\n\t\tlet expiredate = moment(input.val(), momentJsFormats['mm/dd/yyyy']);\n\t\tif (input.val().length < 8) {\n\t\t\treturn true;\n\t\t}\n\t\tif (expiredate.isValid() == false) {\n\t\t\treturn false;\n\t\t}\n\t\tlet minDate = mome... | [
"0.54141194",
"0.5358406",
"0.5330798",
"0.5274583",
"0.5124516",
"0.5093046",
"0.50396127",
"0.50194705",
"0.4994269",
"0.4958256",
"0.49398732",
"0.49318928",
"0.491498",
"0.48987716",
"0.485723",
"0.4848461",
"0.48431456",
"0.4840918",
"0.48301315",
"0.4823644",
"0.4816528... | 0.87099046 | 0 |
JS for read more & Read less button | function readMoreLess() {
var dots = document.getElementById("dots");
var moreText = document.getElementById("more");
var btnText = document.getElementById("Btn");
if (dots.style.display === "none") {
dots.style.display = "inline";
btnText.innerHTML = "Read more";
moreText.style... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ReadMore() {\n $('#show-this-on-click').slideDown();\n $('.readmore').hide();\n $('.readless').show()\n }",
"function readMore() {\n var dots = document.getElementById(\"dots\");\n var moreText = document.getElementById(\"more\");\n var btnText = document.getEl... | [
"0.8132395",
"0.7637343",
"0.76311535",
"0.76282567",
"0.74628067",
"0.7453066",
"0.7421414",
"0.7414647",
"0.70823014",
"0.7007815",
"0.6776164",
"0.6689844",
"0.6619619",
"0.65613186",
"0.6541895",
"0.6541026",
"0.6508923",
"0.6466676",
"0.6449481",
"0.63979155",
"0.6375906... | 0.7771043 | 1 |
Check that a theme exists | function pagerCheckThemeExists(theme) {
'use strict';
if (Object.keys(themes).indexOf(theme) > -1) {
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function registered(themeName){if(themeName===undefined||themeName==='')return true;return applyTheme.THEMES[themeName]!==undefined;}",
"function hasTheme(expression){return angular.isDefined($mdTheming.THEMES[expression.split('-')[0]]);}",
"function hasTheme(expression) {\n return angular.i... | [
"0.7675611",
"0.7666664",
"0.75851613",
"0.75766003",
"0.75716245",
"0.7457075",
"0.7433051",
"0.7071887",
"0.69158167",
"0.683029",
"0.68300945",
"0.68300945",
"0.68300945",
"0.6687132",
"0.6453613",
"0.64000386",
"0.63943195",
"0.63943195",
"0.63943195",
"0.63943195",
"0.63... | 0.80002654 | 0 |
Create a link to the home page | function pagerHomePageLink() {
'use strict';
var link = document.createElement('div');
link.id = 'pagerGoHome';
link.innerHTML = '<a href="../../">Home</a>';
return link;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnCallHomePage(){\n $('#rtnHomePage').html('<a class=\"navbar-brand\" onclick=\"window.location.replace(\\'index.html\\')\" title=\"Return To Home Page\"><i class=\"fa fa-reply-all\" aria-hidden=\"true\"></i></a>');\n }",
"function goHome() {\n if (!isLoggedIn()) {\n return;\n }\n var ho... | [
"0.6995637",
"0.66960996",
"0.66764385",
"0.6475486",
"0.64524084",
"0.64056325",
"0.63896114",
"0.6343541",
"0.6335524",
"0.63137496",
"0.6313645",
"0.63046783",
"0.6294083",
"0.6277954",
"0.6231021",
"0.61980736",
"0.6196652",
"0.61959904",
"0.61820126",
"0.6179936",
"0.617... | 0.71921474 | 0 |
With the given restrictions makes a list of products and orders the list | function restrictList(product, restriction, is_organic, type){
let temp;
for (let i = 0; i < product.length; i++) {
for (let j = 0; j < product.length; j++) {
if (product[i].price < product[j].price) {
temp = product[i]
product[i] = product[j]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restrictListProducts(prods, restriction) {\n\tlet product_names = [];\n\tfor (let i=0; i<prods.length; i+=1) {\n\t\tif(restriction==\"None\"){\n\t\t\tproduct_names.push({name:prods[i].name, price:prods[i].price});\n\t\t}else if(prods[i][restriction]){\n\t\t\tproduct_names.push({name:prods[i].name, price:p... | [
"0.6917375",
"0.68901455",
"0.6868226",
"0.67213106",
"0.66737807",
"0.6640679",
"0.6602903",
"0.6575637",
"0.6529952",
"0.64564615",
"0.6432816",
"0.63559955",
"0.63510305",
"0.6294839",
"0.62678844",
"0.6177047",
"0.61641157",
"0.6123336",
"0.6107239",
"0.6097415",
"0.59728... | 0.69026077 | 1 |
returns true if this link can be picked up by linkify rule from plain text | can_be_linkify(dest) {
let match = dest.match(/^(https?:|\/\/)/i);
if (!match) return false;
let proto = match[0];
let len = linkify.testSchemaAt(dest, proto, proto.length);
return len && (len === dest.length - proto.length);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasLink(input)\n{\n\treturn (input.indexOf('<link') != -1 || input.indexOf('<Link =') != -1 || input.indexOf('<LINK') != -1);\n}",
"can_be_autolink(dest) {\n return /^[a-z][a-z0-9+.\\-]{1,31}:/i.test(dest);\n }",
"function URLCheck(text) \n{\n var urlRegex =/(\\b(https?|ftp|file):\\/\\/[-A-Z0-9... | [
"0.62635505",
"0.6136334",
"0.6005496",
"0.589152",
"0.5888324",
"0.576473",
"0.5753613",
"0.57362264",
"0.5663235",
"0.5593829",
"0.55532825",
"0.55160826",
"0.5510872",
"0.54982924",
"0.54831517",
"0.5481881",
"0.5435583",
"0.54063576",
"0.5363465",
"0.53455454",
"0.5317526... | 0.6272944 | 0 |
Concatenate many markdown texts into a single document This method is required because we can't safely concatenate two markdown parts (e.g. `abcdef` isn't the same as `abc` + `def`). Texts starting with '\n\n' are considered block tags, the rest are inline. | concat(texts) {
let blocks = [];
let inlines = [];
for (let text of texts) {
if (!text.startsWith('\n\n')) {
inlines.push(text);
continue;
}
if (inlines.length) {
blocks.push(this.format_block(this.escape_block(this.concat_inline(inlines))));
inlines = [];... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateMarkdown(data) {\n return `\n # Project Title\n <h1 align=\"center\">${data.title} 👋</h1>\n\n <p align=\"center\">\n <img src=\"https://img.shields.io/github/repo-size/MichaelPappas2662/ReadMeGenerator\" />\n <img src=\"https://img.shields.io/github/languages/top/MichaelPappas2662/ReadM... | [
"0.5572292",
"0.5550195",
"0.5542968",
"0.5494006",
"0.54244745",
"0.54030335",
"0.53943497",
"0.5365678",
"0.5353936",
"0.53376156",
"0.53373873",
"0.53373873",
"0.53331614",
"0.53331614",
"0.53256273",
"0.53058654",
"0.5304096",
"0.52483875",
"0.52341336",
"0.52204615",
"0.... | 0.7088415 | 0 |
args = blackCard, displayName, firstPick, secondPick, host | function buildBlackSelected(args) {
//blackCard, player, (whiteCard, whiteCard), host
let text = ""
let host = false;
let displayName = args.displayName;
let blackCard = args.currentBlack
if (Object.keys(args).length === 4) {
host = args.host;
if (blackCard.indexOf("_") === -1) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"piece_taken(args) {\n\n }",
"async displayProfile(step) {\n \n const user = await this.userProfile.get(step.context, {});\n\n // Send adaptive card.\n //await step.context.sendActivity({\n // text: 'Here is an Adaptive Card:',\n // attachments: [CardFactory.adaptiveCard(CARDS)]\n //});\n\n if... | [
"0.5395675",
"0.5373926",
"0.5310984",
"0.5250351",
"0.5248713",
"0.5246996",
"0.5229027",
"0.51731026",
"0.5156019",
"0.5151425",
"0.5099236",
"0.5091254",
"0.5056283",
"0.50485903",
"0.5041005",
"0.5019764",
"0.5019277",
"0.50090927",
"0.49969646",
"0.4991801",
"0.4979172",... | 0.6563443 | 0 |
recebe a lista de clientes e preenche na janela inserirEvento.ejs | function preencherJanelaDeInserirEvento(clientes){
clientesGlobal = clientes;
let listaClientes = '';
//preenchimento da lista de clientes filtrada na variável listaClientes
clientes.forEach(cliente => {
listaClientes +=
'<div id="cliente_individual" style="margin-top: 30px; width: max-... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function append_client(datos){\n\t\t$('.t-body').empty();\n\t\t$.each(datos, function(index, data){\n\t\t\tif (data.clave_credito) {\n\t\t\t\t$('.t-body').append(\n\t\t\t\t\t\"<tr>\"+\n\t\t\t\t\t\t\"<th class='text-center'>\"+ pad(data.id_cliente,4) + \"</th>\"+\n\t\t\t\t\t\t\"<td>\"+ data.nombre + \" \" + data.ap... | [
"0.6843417",
"0.6785375",
"0.6659212",
"0.662846",
"0.6595054",
"0.65073615",
"0.65009546",
"0.6464794",
"0.64359933",
"0.6354084",
"0.6332801",
"0.6272032",
"0.62646186",
"0.61629725",
"0.6133909",
"0.6095233",
"0.6057751",
"0.6052722",
"0.60428303",
"0.6035565",
"0.6023458"... | 0.6849334 | 0 |
Function that creates and prints the VAT report | function createVATDeclaration(current, startDate, endDate) {
// Accounting period for the current year file
var currentStartDate = current.info("AccountingDataBase","OpeningDate");
var currentEndDate = current.info("AccountingDataBase","ClosureDate");
var currentYear = Banana.Converter.toDate(currentStartD... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function printVitals(v){\n\tvar vital_string = \"BP:\" + v.bp + \", \" +\n\t\t\t\t\t\t\"PR:\" + v.pr + \", \" +\n\t\t\t\t\t\t\"RR:\" + v.rr;\n\treturn vital_string;\n}",
"function createDetailsReport(banDoc, startDate, endDate, cardToPrint) {\r\n\r\n\tvar report = Banana.Report.newReport(\"Details\");\r\n\tvar ... | [
"0.5981261",
"0.5877344",
"0.5845913",
"0.57186204",
"0.56370777",
"0.5622775",
"0.5526699",
"0.5493688",
"0.54759085",
"0.5445386",
"0.5382416",
"0.53774816",
"0.53703564",
"0.536942",
"0.5340248",
"0.5336116",
"0.532208",
"0.5312149",
"0.53049546",
"0.52925783",
"0.52749634... | 0.7045389 | 0 |
VAT functions / Function that checks for all the used vat codes without Gr1 and prints a warning message | function VatUsedVatCodeWithInappropriateGr1HaveGr1(banDoc, report) {
// Get all the vat codes used on the Transactions table
var usedVatCodes = VatCodeUsedInTransactions(banDoc);
// For each code checks if on the VatCodes table there is a Gr1
// Shows a warning message in red for all the vat codes without the Gr1... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatUsedVatCodeWithInappropriateGr1(param, banDoc, report) {\n\tvar usedGr1Codes = [];\n\tvar vatCodes = VatCodeUsedInTransactions(banDoc);\n\tfor (var i = 0; i < vatCodes.length; i++) {\n\t\tvar gr1Codes = VatGetVatCodesForGr1(banDoc, vatCodes[i]);\n\t\tfor (var j = 0; j < gr1Codes.length; j++) {\n\t\t\tu... | [
"0.7129947",
"0.6002437",
"0.5845751",
"0.5713841",
"0.571072",
"0.5697905",
"0.56067723",
"0.56059706",
"0.5568971",
"0.55394036",
"0.549608",
"0.548702",
"0.5451478",
"0.5407091",
"0.53548",
"0.5354742",
"0.53542113",
"0.53333724",
"0.5276452",
"0.5266289",
"0.5265925",
"... | 0.6878113 | 1 |
Function that retrieves the total vat from Banana | function VatGetTotalFromBananaVatReport(banDoc, startDate, endDate) {
var vatReportTable = banDoc.vatReport(startDate, endDate);
var res = "";
for (var i = 0; i < vatReportTable.rowCount; i++) {
var tRow = vatReportTable.row(i);
var group = tRow.value("Group");
//The balance is summed in group named "_tot_"
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async fetchTotalSupply() {\n const { result: { supply: { total } } } = await this.request(\n 'https://public-lcd2.akash.vitwit.com/supply/summary',\n );\n\n const record = total.find((item) => item.denom === 'uakt');\n\n return Number(record.amount) / 10 ** 6;\n }",
"function getTotal() {\n ... | [
"0.7166135",
"0.66375726",
"0.6464203",
"0.63530403",
"0.6334797",
"0.62784517",
"0.6269286",
"0.62523276",
"0.62417746",
"0.6237818",
"0.6230174",
"0.6143053",
"0.6136308",
"0.6136101",
"0.61226296",
"0.6116701",
"0.61074585",
"0.6093066",
"0.60882866",
"0.6073863",
"0.60705... | 0.7607547 | 0 |
checks all the vat/gr1 codes used in the transactions. Add a warning message (red) to the report if codes with not appropriate Gr1 are used | function VatUsedVatCodeWithInappropriateGr1(param, banDoc, report) {
var usedGr1Codes = [];
var vatCodes = VatCodeUsedInTransactions(banDoc);
for (var i = 0; i < vatCodes.length; i++) {
var gr1Codes = VatGetVatCodesForGr1(banDoc, vatCodes[i]);
for (var j = 0; j < gr1Codes.length; j++) {
usedGr1Codes.push(gr1C... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatUsedVatCodeWithInappropriateGr1HaveGr1(banDoc, report) {\n\n\t// Get all the vat codes used on the Transactions table\n\tvar usedVatCodes = VatCodeUsedInTransactions(banDoc);\n\n\t// For each code checks if on the VatCodes table there is a Gr1\n\t// Shows a warning message in red for all the vat codes ... | [
"0.7511219",
"0.61726373",
"0.5727892",
"0.5678876",
"0.55856156",
"0.54616654",
"0.543382",
"0.53856623",
"0.538543",
"0.53844154",
"0.5376616",
"0.53720766",
"0.5352232",
"0.53494567",
"0.5329312",
"0.5268753",
"0.5248626",
"0.52187306",
"0.5200268",
"0.51848906",
"0.517957... | 0.7326003 | 1 |
returns an array with all the gr1 codes for the given vat code Gr1 code can be separated by ";" | function VatGetVatCodesForGr1(banDoc, vatCode) {
var str = [];
var table = banDoc.table("VatCodes");
if (table === undefined || !table) {
return str;
}
//Loop to take the values of each rows of the table
for (var i = 0; i < table.rowCount; i++) {
var tRow = table.row(i);
var gr1 = tRow.value("Gr1");
var v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatGetVatCodesForGr(banDoc, grCodes, grColumn) {\n\n\tvar str = [];\n\tif (!grCodes || !banDoc || !banDoc.table(\"VatCodes\")) {\n\t\treturn str;\n\t}\n\tvar table = banDoc.table(\"VatCodes\");\n\n\tif (!grColumn) {\n\t\tgrColumn = \"Gr1\";\n\t}\n\n\t/* Can have multiple values */\n\tvar arrayGrCodes = gr... | [
"0.68010825",
"0.5842491",
"0.5319327",
"0.52520555",
"0.51848245",
"0.5101457",
"0.5087436",
"0.50811803",
"0.5081033",
"0.5079901",
"0.50672734",
"0.5047497",
"0.50275445",
"0.50155765",
"0.49732783",
"0.4966199",
"0.4965568",
"0.49628323",
"0.49503776",
"0.49458084",
"0.49... | 0.7912999 | 0 |
Returns an array with all the vat codes used in the Transactions table | function VatCodeUsedInTransactions(banDoc) {
var str = [];
var table = banDoc.table("Transactions");
if (table === undefined || !table) {
return str;
}
//Loop to take the values of each rows of the table
for (var i = 0; i < table.rowCount; i++) {
var tRow = table.row(i);
var vatRow = tRow.value("VatCode");
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatGetVatCodesForGr1(banDoc, vatCode) {\n\tvar str = [];\n\tvar table = banDoc.table(\"VatCodes\");\n\tif (table === undefined || !table) {\n\t\treturn str;\n\t}\n\t//Loop to take the values of each rows of the table\n\tfor (var i = 0; i < table.rowCount; i++) {\n\t\tvar tRow = table.row(i);\n\t\tvar gr1 ... | [
"0.5988845",
"0.5807905",
"0.5638532",
"0.56068295",
"0.55332154",
"0.5421109",
"0.53921103",
"0.5372464",
"0.5321772",
"0.52760386",
"0.51859725",
"0.51647925",
"0.51560813",
"0.5151986",
"0.51356167",
"0.50708413",
"0.50438017",
"0.50423074",
"0.502692",
"0.50209856",
"0.50... | 0.72510517 | 0 |
Retrieve the Vat value for a specific gr1 Codes grCodes can be more then one, sepatated by ";" vatClass determines the return value extraInfo is "" for all or a specific value, inclusive void | function VatGetGr1BalanceExtraInfo(banDoc, transactions, grCodes, vatClass, vatExtraInfo, startDate, endDate) {
var vatCodes = VatGetVatCodesForGr(banDoc, grCodes, 'Gr1');
//Sum the vat amounts for the specified vat code and period
var currentBal = VatGetVatCodesBalanceExtraInfo(transactions, vatCodes, vatExtraInf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatGetVatCodesForGr1(banDoc, vatCode) {\n\tvar str = [];\n\tvar table = banDoc.table(\"VatCodes\");\n\tif (table === undefined || !table) {\n\t\treturn str;\n\t}\n\t//Loop to take the values of each rows of the table\n\tfor (var i = 0; i < table.rowCount; i++) {\n\t\tvar tRow = table.row(i);\n\t\tvar gr1 ... | [
"0.58292365",
"0.5150482",
"0.5016201",
"0.4995015",
"0.48377556",
"0.4797867",
"0.46905246",
"0.46886107",
"0.46718645",
"0.46718645",
"0.4646385",
"0.4634124",
"0.4607849",
"0.4607472",
"0.4607472",
"0.4603872",
"0.4556989",
"0.45499066",
"0.45388523",
"0.45388523",
"0.4537... | 0.688563 | 0 |
Return and array with all the VAT Codes belonging to the same group (grCodes) , can include different values separated by ";" in the indicate colums, usually "Gr1" | function VatGetVatCodesForGr(banDoc, grCodes, grColumn) {
var str = [];
if (!grCodes || !banDoc || !banDoc.table("VatCodes")) {
return str;
}
var table = banDoc.table("VatCodes");
if (!grColumn) {
grColumn = "Gr1";
}
/* Can have multiple values */
var arrayGrCodes = grCodes.split(';');
//Loop to take t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function VatGetVatCodesForGr1(banDoc, vatCode) {\n\tvar str = [];\n\tvar table = banDoc.table(\"VatCodes\");\n\tif (table === undefined || !table) {\n\t\treturn str;\n\t}\n\t//Loop to take the values of each rows of the table\n\tfor (var i = 0; i < table.rowCount; i++) {\n\t\tvar tRow = table.row(i);\n\t\tvar gr1 ... | [
"0.73944724",
"0.5751954",
"0.5513973",
"0.53969675",
"0.52702725",
"0.5212506",
"0.5139744",
"0.51117045",
"0.5107848",
"0.5093576",
"0.50865245",
"0.50765455",
"0.50722736",
"0.50684977",
"0.5061092",
"0.5051253",
"0.5031518",
"0.5019698",
"0.500055",
"0.49915153",
"0.49890... | 0.7106974 | 1 |
Get report de credit from the transactions journal | function getCredit(banDoc, startDate, endDate) {
return getAmount(banDoc, "Gr=4449","balance", startDate, endDate);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get credit() { return this._credit; }",
"function findExpenseReport(tranid) {\n\tvar filters = new Array();\n\n\tfilters[0] = new nlobjSearchFilter('custbody_coupa_er_number', null, 'is',\n\t\t\ttranid);\n\n\tvar searchresults = nlapiSearchRecord('expensereport', null, filters);\n\n\tif (searchresults && searchr... | [
"0.6085441",
"0.5945335",
"0.56935716",
"0.5685756",
"0.56690055",
"0.5579144",
"0.5553066",
"0.55258965",
"0.5508874",
"0.55007803",
"0.5454115",
"0.54471415",
"0.5441519",
"0.54252875",
"0.54020596",
"0.53913414",
"0.5340751",
"0.533188",
"0.53235817",
"0.53152275",
"0.5304... | 0.6225129 | 0 |
Period Settings / The main purpose of this function is to allow the user to enter the accounting period desired and saving it for the next time the script is run Every time the user runs of the script he has the possibility to change the date of the accounting period | function getPeriodSettings(param) {
//The formeters of the period that we need
var scriptform = {
"selectionStartDate": "",
"selectionEndDate": "",
"selectionChecked": "false"
};
//Read script settings
var data = Banana.document.getScriptSettings();
//Check if there are previously saved settings and read... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPeriodSettings() {\n\t\n\t//The formeters of the period that we need\n\tvar scriptform = {\n\t \"selectionStartDate\": \"\",\n\t \"selectionEndDate\": \"\",\n\t \"selectionChecked\": \"false\"\n\t};\n\n\t//Read script settings\n\tvar data = Banana.document.scriptReadSettings();\n\t\n\t//Check if ... | [
"0.764182",
"0.60880893",
"0.6021892",
"0.600719",
"0.5952151",
"0.5873444",
"0.5859408",
"0.5838212",
"0.5810324",
"0.5792735",
"0.57495755",
"0.57298493",
"0.57298493",
"0.57298493",
"0.57298493",
"0.57298493",
"0.5718784",
"0.5699443",
"0.5673445",
"0.5651316",
"0.56367147... | 0.7464552 | 1 |
Remaps list of tasks into an object where keys are the day, and value is list of tasks MAKE SURE TO CALL EVERYTIME TASKS IS UPDATED | remapDayToTasks(tasks){
const dayToTasks = {}
tasks.map((t) => {
const d_date = new Date(t.due_date);
const day = d_date.getFullYear() + '-' + d_date.getMonth() + '-' + d_date.getDate();
if (day in dayToTasks){
var new_day = dayToTasks[day];
new_day.push(t);
dayToTasks[day] = new_day;
}else{... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseTasksList(tasks = []) {\n // task id -> task obj, for O(1) lookup\n const tasksMap = {};\n // task group name -> list of task IDs\n const taskIdsByGroupName = {};\n\n for (const task of tasks) {\n tasksMap[task.id] = task;\n\n const taskIds = taskIdsByGroupName[task.group] || [];\n ... | [
"0.72677153",
"0.7252571",
"0.6690383",
"0.61390144",
"0.60189456",
"0.6017083",
"0.5875576",
"0.5842052",
"0.5801135",
"0.5793091",
"0.5791738",
"0.5791738",
"0.57531697",
"0.57434857",
"0.5735873",
"0.565981",
"0.5656294",
"0.5597449",
"0.55974215",
"0.5594572",
"0.55623007... | 0.8205235 | 0 |
convert src=https to just src=http | function ConvertSSLImages(c)
{
replaceImage = 'src=\"http://' + URL;
c = c.replace(re4,replaceImage);
return c;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ConvertSSLImages(code)\r\n{\r\n\treplaceImage = 'src=\\\"http://' + URL;\r\n\tcode = code.replace(re4,replaceImage);\r\n\treturn code;\r\n}",
"function replaceHttpLinksWithHttpsForSkype(url){\n\tlet regex = 'http://'\n\treturn url.replace(regex, 'https://');\n}",
"local(url) {\n return url.repl... | [
"0.69614184",
"0.6446682",
"0.6416014",
"0.6297004",
"0.62352526",
"0.62291753",
"0.6193826",
"0.61366314",
"0.6110284",
"0.60654163",
"0.601131",
"0.5977321",
"0.59687096",
"0.59352285",
"0.5933461",
"0.59181255",
"0.5861501",
"0.58116275",
"0.5803434",
"0.57989097",
"0.5752... | 0.7125115 | 0 |
if img not found use base href | function usePageBaseUrl (img)
{
if ((browser.IE && img.fileSize<=0) || (typeof img.naturalWidth != "undefined" && img.naturalWidth == 0)) {
var s = img.src;
var s3 = s;
var t = false;
var r1 = new RegExp(loadedFile,"gi");
var r2 = new RegExp(doc_root,"gi");
if (loadedFile) {
s = s.replace(r1,"");
} el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function usePageBaseUrl (img)\r\n{\r\n\t// Gecko-based browsers act like NS4 in that they report this\r\n\t// incorrectly: they always return true.\r\n\t// However, they do have two very useful properties: naturalWidth\r\n\t// and naturalHeight. These give the true size of the image. If\r\n\t// it failed to load, ... | [
"0.72217846",
"0.6504991",
"0.64945745",
"0.6443647",
"0.64021057",
"0.6323631",
"0.63052976",
"0.62854844",
"0.62854844",
"0.62450576",
"0.623504",
"0.62203115",
"0.6162908",
"0.61568123",
"0.6076936",
"0.605822",
"0.6045144",
"0.6030508",
"0.60287386",
"0.5997364",
"0.59579... | 0.7401083 | 0 |
creating function for removing classes, function has parameters: obj, cls (type string) | function removeClass(obj, cls) {
//defining variable classNameArray for array, which created by method split
var classNameArray = obj.className.split(" ");
//loop for searching cls in classNumberArray and removing those items
for (var i = 0; i < classNameArray.length; i++) {
//defining variable ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeClass(obj, cls) {\n for (var prop in obj) {\n // case 1:\n var propParts = obj[prop].split(' ');\n if (propParts.indexOf(cls) === -1) {\n return;\n }\n\n var prString = obj[prop];\n var reg = new RegExp(cls, \"g\")\n var match = prString... | [
"0.742715",
"0.7421446",
"0.7345916",
"0.69663453",
"0.6950574",
"0.6950574",
"0.69440454",
"0.6864726",
"0.6743291",
"0.67296875",
"0.66983163",
"0.66508394",
"0.6643971",
"0.66211426",
"0.66211426",
"0.6620157",
"0.6614526",
"0.65990824",
"0.65884113",
"0.65827525",
"0.6544... | 0.78018284 | 0 |
checks if a user already exists, if not, creates a new file and sends user there | function addUser(name,props)
{
if(alreadyClicked)
{
return;
}
let unfilteredName = name;
let filteredName = unfilteredName.replace(/[^a-zA-Z0-9_\-]/g, "");
if(filteredName.length < 1)
{
Popup.alert("Invalid filename! Excluding special c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createUser() {}",
"function createUser(e) {\n e.preventDefault();\n let username = e.target.name.value;\n let pin = e.target.pin.value;\n console.log(username, pin);\n //check if user name is unique\n let x = sortedUsers.find((user) => user.username === username);\n if (x === undefi... | [
"0.63163036",
"0.6300277",
"0.6229707",
"0.62175643",
"0.6208816",
"0.61990446",
"0.6186892",
"0.61813086",
"0.6144678",
"0.61175084",
"0.609061",
"0.6081966",
"0.60787964",
"0.60765344",
"0.6060736",
"0.6032208",
"0.6020638",
"0.6013603",
"0.60110015",
"0.5945545",
"0.593384... | 0.6433233 | 0 |
This component demonstrates a custom marker used in the Vehicles overlay provided as an example. It is modeled after the component available in this file: | function VehicleMarker(props) {
const { vehicle } = props;
const { hasTooltip } = props;
const { hasPopup } = props;
const { tracked } = props;
const { setTracked } = props;
const { color } = props;
const { leaflet } = props;
const { closeZoom, midZoom } = props;
const { midSize, farSize } = props;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createVehicleMarker(vehicle, vehicleColor) {\n var marker = new google.maps.Marker({\n icon: \"https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=\" + vehicle.vtype + \"|bbT|\" + vehicle.routeTag + \"|\" + vehicleColor + \"|eee\",\n position: new google.maps.LatLng(vehicle.lat, v... | [
"0.67259717",
"0.65687084",
"0.6471874",
"0.6452219",
"0.63914704",
"0.63719505",
"0.6338379",
"0.63027626",
"0.6273402",
"0.62675756",
"0.6250559",
"0.6250559",
"0.6244131",
"0.6232655",
"0.6189506",
"0.6168953",
"0.6140536",
"0.6131721",
"0.61035985",
"0.6086627",
"0.608662... | 0.71193594 | 0 |
1) Generate containers with image information: File size in kilobytes Image Width Image Height 2) Visualizes container who contains: compression image. | static generateContainersWithImageInfoAndLoadImageWithCompression(data) {
if (data.hasOwnProperty('response')) {
const imageStatisticsContainers = AngularConstants.generateImageStatisticsConstants();
const BACKEND_KEYS = AngularConstants.generateBackendCompressionAccessibleKeys();
let statisticModule = null... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ImageCompressionDataContainer() {\n this.data_ = {};\n}",
"function computePackInfo(imgInfoList, cb) {\n\n var compute = function(width, height, imgInfoList) {\n\n var out = false;\n\n for (var n = 0; n < imgInfoList.length; n++) {\n var f = imgInfoList[n];\n dele... | [
"0.6214078",
"0.6089979",
"0.59657407",
"0.5892317",
"0.5838399",
"0.573714",
"0.5598547",
"0.5583956",
"0.5554979",
"0.551878",
"0.54858065",
"0.54817176",
"0.54763514",
"0.5466284",
"0.5461151",
"0.54571617",
"0.5448371",
"0.54246247",
"0.53808546",
"0.53736836",
"0.5347677... | 0.6930842 | 0 |
passing single array, a string, and 1 callback arguement is req... finds object by id, assigns var to user and passes back users[key] the function call adds the other half users[key].email | function getUserById(arr1, str1, callBack) {
for (key in arr1) {
if(arr1[key].id === str1) {
var user = arr1[key];
callBack(user);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserById(arr, str, cb) {\n\n}",
"getUser(email) { \n return listUsers.find(item => item.email === email);\n }",
"getUserId(req, res, next) {\n if (!req.body.email) res.send('Need to supply an email')\n User.find({email: req.body.email})\n .then((user) => {\n let returnObj = {... | [
"0.6954707",
"0.6625177",
"0.66189235",
"0.65591955",
"0.65040624",
"0.645751",
"0.6435874",
"0.64048856",
"0.63938195",
"0.63814473",
"0.6339599",
"0.6331122",
"0.63307387",
"0.63278216",
"0.6295825",
"0.6289117",
"0.62867576",
"0.62576",
"0.62430227",
"0.6209352",
"0.620160... | 0.6848549 | 1 |
Display a single evaluation. GET evaluations/:id | async show({ params }) {
const evaluation = await Evaluation.findOrFail(params.id);
return evaluation;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getEvaluation(id, callback){\n $.get(\n getFinalURL(id),\n function (result) {\n callback(result);\n }\n );\n}",
"readEvaluation({ EvaluationID }, callback) {\n return this.request.getAsync({\n uri: esc`evaluation/${EvaluationID}`,\n })\n .bind(this)\n... | [
"0.65320617",
"0.6333517",
"0.5506898",
"0.53403556",
"0.5229954",
"0.51668555",
"0.5124607",
"0.5124366",
"0.5123874",
"0.50832146",
"0.5069899",
"0.50321656",
"0.5022607",
"0.50081855",
"0.49947548",
"0.49876475",
"0.49626604",
"0.4949837",
"0.4931184",
"0.4928465",
"0.4919... | 0.79489356 | 0 |
Update evaluation details. PUT or PATCH evaluations/:id | async update({ params, request, response }) {
const evaluation = await Evaluation.findOrFail(params.id);
const data = request.all();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function updateEval() {\n const eval = await (await fetch( './getEvaluation', { method: 'POST'} )).json();\n fillElements( eval );\n }",
"function putEvaluation(id, data, callback){\n $.ajax({\n type: \"PUT\",\n url: getFinalURL(id),\n data: data,\n success: function(r... | [
"0.66967946",
"0.6182542",
"0.5607684",
"0.5515865",
"0.5514114",
"0.55102545",
"0.5467922",
"0.53066707",
"0.52795887",
"0.5255513",
"0.51974523",
"0.5197377",
"0.5108272",
"0.51028067",
"0.5076716",
"0.50750625",
"0.5070355",
"0.5037011",
"0.5036961",
"0.5028114",
"0.501684... | 0.77820456 | 0 |
Return array of nonnoise normalized words from string content. Nonnoise means it is not a word in the noiseWords which have been added to this object. Normalized means that words are lowercased, have been stemmed and all nonalphabetic characters matching regex [^az] have been removed. | words(content) {
//@TODO
let word_arr = content.split(/\s+/).map((w) => normalize(w)).filter((w) => !this.noise_words.has(w));
return word_arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async words(contentText) {\n //TODO\n let words = [];\n let splitWords;\n let noiseWords = [];\n await db.collection(noise_table).find({}).forEach(function (u) {\n noiseWords.push(u.word);\n });\n while (splitWords = WORD_REGEX.exec(contentText)) {\n let [word, of... | [
"0.6228321",
"0.5678065",
"0.56647444",
"0.5598179",
"0.5446803",
"0.5429357",
"0.5412204",
"0.53306913",
"0.5327265",
"0.52916104",
"0.52870953",
"0.52694994",
"0.5269428",
"0.52450836",
"0.5240959",
"0.52350223",
"0.5232297",
"0.51987034",
"0.5192415",
"0.51819164",
"0.5173... | 0.7256831 | 0 |
Compare result1 with result2: higher scores compare lower; if scores are equal, then lexicographically earlier names compare lower. | function compareResults(result1, result2) {
return (result2.score - result1.score) ||
result1.name.localeCompare(result2.name);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareResultScores(result1, result2) {\n return result2.score - result1.score;\n}",
"function compare(result1, result2) {\n if (result1.StudentID < result2.StudentID) {\n return -1;\n }\n if (result1.StudentID > result2.StudentID) {\n return 1;\n }\n ... | [
"0.7984854",
"0.73128945",
"0.70319027",
"0.6940985",
"0.6916812",
"0.6860893",
"0.6783875",
"0.6764225",
"0.67252916",
"0.6720136",
"0.6717397",
"0.6714151",
"0.6685186",
"0.66514134",
"0.66507614",
"0.6650451",
"0.6567391",
"0.6559366",
"0.65582407",
"0.6548542",
"0.6500709... | 0.8508342 | 1 |
Normalize word by stem'ing it, removing all nonalphabetic characters and converting to lowercase. | function normalize(word) {
return stem(word.toLowerCase()).replace(/[^a-z]/g, '');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalize(word) {\n return word.toLowerCase().replace(/[.!,//]/g, \"\");\n}",
"function normalize(word) {\n var result = \"\";\n for (var i = 0; i < word.length; i++) {\n var kana = word[i];\n var target = transform[kana];\n if (target === false) {\n ... | [
"0.77787626",
"0.6994181",
"0.6879746",
"0.6879746",
"0.67970896",
"0.6678711",
"0.66469926",
"0.6643869",
"0.6643869",
"0.6608552",
"0.65662265",
"0.65493596",
"0.6478883",
"0.6465606",
"0.63981235",
"0.63328457",
"0.6329582",
"0.6322737",
"0.6322737",
"0.6244767",
"0.623207... | 0.86982447 | 1 |
Placeholder for stemming a word before normalization; this implementation merely removes 's suffixes. | function stem(word) {
return word.replace(/\'s$/, '');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}",
"function normalize(word) {\n return stem(word.toLowerCase()).replace(/[^a-z]/g, '');\n}",
"function stemmer() {\n return function (cst) {\n visit(cst, 'WordNode', function (node) {\n node.data = {\... | [
"0.760061",
"0.760061",
"0.69491845",
"0.66704655",
"0.6569383",
"0.630299",
"0.6265275",
"0.62542796",
"0.6178276",
"0.61397344",
"0.61226076",
"0.60064733",
"0.6003547",
"0.6003547",
"0.59965134",
"0.5792786",
"0.5699337",
"0.5659461",
"0.56257683",
"0.56084377",
"0.5604179... | 0.76276314 | 1 |
Displays all items available in store and then starts an order function | function showProducts(){
connection.query('SELECT * FROM products', function(err, res){
if (err) throw err;
console.log('=================================================');
console.log('=================Items in Store==================');
console.log('=================================================');
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options co... | [
"0.6926301",
"0.67347103",
"0.6716825",
"0.6682684",
"0.66669023",
"0.6664162",
"0.66501474",
"0.6606811",
"0.6579819",
"0.6553972",
"0.65319914",
"0.6515685",
"0.64980537",
"0.64943045",
"0.64892447",
"0.6458153",
"0.6452574",
"0.64430636",
"0.64267534",
"0.64228827",
"0.641... | 0.6910003 | 1 |
Allows the user to place a new order or end the connection | function placeNewOrder(){
inquirer.prompt([{
name: 'choice',
type: 'rawlist',
message: 'Would you like to place another order?',
choices: ["YES", "NO"]
}]).then(function(answer){
if(answer.choice === "YES"){
startOrder();
}
else{
console.log('Thank you for shopping at Bamazon!');
connection... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newOrder(){\n\tinquirer.prompt([{\n\t\ttype: 'confirm',\n\t\tname: 'choice',\n\t\tmessage: 'Would you like to place another order?'\n\t}]).then(function(answer){\n\t\tif(answer.choice){\n\t\t\tbuyItem();\n\t\t}\n\t\telse{\n\t\t\tconsole.log('Thank you for shopping at Bamazon!');\n\t\t\tconnection.end();\n... | [
"0.73703855",
"0.7052835",
"0.6690434",
"0.65761876",
"0.65675235",
"0.6526962",
"0.64730436",
"0.6464114",
"0.6398106",
"0.6373494",
"0.6349572",
"0.63441634",
"0.6318418",
"0.6294259",
"0.625859",
"0.62375975",
"0.62375975",
"0.6154386",
"0.6154386",
"0.6141491",
"0.6109605... | 0.7445776 | 0 |
Function get all candidate | function getAllCandidates() {
var obj = {
p: 1,
ps: $scope.candidateListSumary.Pagination.TotalCount,
};
CandidatePoolService.getCandidatesByNetwork(obj).then(function(res) {
$scope.AllCandidates = res;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNeoCandidates() {\n console.log(\"--- Candidates and their votes ---\");\n const neoCandidateContractCall = sc.NeoContract.INSTANCE.getCandidates();\n return rpcClient\n .invokeFunction(\n neoCandidateContractCall.scriptHash,\n neoCandidateContractCall.operation\n )\n .then((neoCa... | [
"0.6636309",
"0.58125645",
"0.57800907",
"0.5695838",
"0.56148475",
"0.5612873",
"0.5581851",
"0.55531204",
"0.5547331",
"0.55357045",
"0.55291873",
"0.54981095",
"0.5496808",
"0.5491295",
"0.5489291",
"0.5464561",
"0.54623455",
"0.54568255",
"0.5426979",
"0.54257464",
"0.539... | 0.73100996 | 0 |
Function get more candidate | function getMoreCandidate() {
$scope.page++;
$scope.isLoadingMore = true;
var obj = {
p: $scope.page,
ps: 10
};
var status = $scope.candidateListSumary.IsSelectingStatus;
CandidatePo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMoreResult() {\n\n $scope.filterObj.p++;\n $scope.isLoadingMore = true;\n var newObj = createFilterObj($scope.filterObj);\n var status = $scope.candidateListSumary.IsSelectingStatus;\n CandidatePoolService.filterCandidates(newOb... | [
"0.7185452",
"0.5664203",
"0.5650182",
"0.55035853",
"0.5470688",
"0.5459393",
"0.5347913",
"0.53219277",
"0.53215945",
"0.53175867",
"0.5305263",
"0.5296176",
"0.52843225",
"0.52824485",
"0.5281603",
"0.5267791",
"0.5264875",
"0.52431864",
"0.523563",
"0.5230619",
"0.5228385... | 0.7679754 | 0 |
Function get more search result | function getMoreResult() {
$scope.filterObj.p++;
$scope.isLoadingMore = true;
var newObj = createFilterObj($scope.filterObj);
var status = $scope.candidateListSumary.IsSelectingStatus;
CandidatePoolService.filterCandidates(newObj).then(fun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showMore() {\n page++;\n instantSearchName();\n}",
"function getMoreContents(){\n\t//Get user input\n\tvar content=document.getElementById(\"keyword\");\n\tif(content.value==\"\"){\n\t\tclearContent();\n\t\treturn;\n\t}\n\t//Send Ajax request\n\txmlHttp=createXMLHttp();\n\tvar url=\"search?keyword... | [
"0.70742035",
"0.6783224",
"0.6487387",
"0.64145464",
"0.6410956",
"0.6403181",
"0.63834375",
"0.63583446",
"0.63467985",
"0.6333908",
"0.63273054",
"0.63065726",
"0.63008094",
"0.6239628",
"0.6225387",
"0.62173647",
"0.62048584",
"0.6191664",
"0.6180653",
"0.6164637",
"0.609... | 0.7078523 | 0 |
Format/define the HTML to the Json content according with the first load or filter(s) selected | function jsonPrepareContent(Json, filter){
var trHTML = '';
if (filter != ""){
var category = "";
Json = Json.filter(
data => {
if (category != data.category.name){
category... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function html(data) {\n if (data.type == \"heading\") {\n $(\"div\")\n .add(\"<h1>\" + data.model.text + \"</h1>\")\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"paragraph\") {\n $(\"div\")\n .add(\"<p>\" + data.model.text + \"</p>\")\n .appendTo(document.ge... | [
"0.6599819",
"0.5951536",
"0.59269345",
"0.5793671",
"0.5748705",
"0.5740974",
"0.5711099",
"0.56676453",
"0.5666108",
"0.56549114",
"0.5646205",
"0.5638636",
"0.5598631",
"0.55863106",
"0.55687",
"0.55071175",
"0.548355",
"0.5476091",
"0.5475188",
"0.5461329",
"0.5458304",
... | 0.6537399 | 1 |
Show TTS is enabled or disabled. | function updateTTSStateView(isEnabled) {
isSpeechEnabled = isEnabled;
var ttsButton = getTTSButtonElement();
endWaveAnimation(); // Don't keep animating the wave hover effect after a click
enableDimmingHover(false); // Don't use hover effects after a click
// Set aria-checked so that screen re... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get enabled() {\r\n return auth.tts && auth.tts.tencent && auth.tts.tencent.enabled; // turn if off by not specifying it in the tts object\r\n }",
"get isEnabled() {\n return this.sw.isEnabled;\n }",
"get enabled() {\n const { config, player } = this;\n return config.enabled && player... | [
"0.79726195",
"0.58333015",
"0.5781946",
"0.56121045",
"0.56002825",
"0.56002825",
"0.56002825",
"0.56002825",
"0.55810744",
"0.55810744",
"0.5523237",
"0.5488027",
"0.546819",
"0.54467195",
"0.5446272",
"0.5441832",
"0.5430422",
"0.5430422",
"0.5430422",
"0.5430422",
"0.5430... | 0.69503564 | 1 |
Animate waves if user hovers over TTS button, speech is off and animation is not already playing | function beginHoverEffects() {
if (!state.isPanel()) {
return;
}
enableDimmingHover(true);
if (!isSpeechEnabled && !waveAnimationStepNum) {
nextWaveAnimationStep();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startAudioHower () {\n audioBtn.style.animation = \"animate50px 0.5s steps(3) infinite\";\n}",
"playAudio(e){\n e.stopPropagation();\n const elem = e.target;\n elem.play();\n elem.parentElement.classList.add('hover-class');\n setTimeout(() => {\n elem.parentElement.classList.remov... | [
"0.660387",
"0.63987386",
"0.6179474",
"0.61338574",
"0.61066824",
"0.61046696",
"0.6085393",
"0.6074321",
"0.60721487",
"0.60505545",
"0.6043452",
"0.6020852",
"0.59833336",
"0.5972912",
"0.59471965",
"0.59378904",
"0.5935579",
"0.5929335",
"0.5879387",
"0.58713835",
"0.5866... | 0.6425763 | 1 |
Given a 2d array like that returned from getHexMap(), iterate through it and position the named tiles in their proper places in the hexmap div | function populate(hexmap) {
// Clear the old map, if any
$('#hexmap').children().remove();
for (index in hexmap) {
var x = hexmap[index].x, y = hexmap[index].y;
var data = hexmap[index].data;
var color = data.color;
// clone the tile and place it
var tile = placeTile(color, x, y);
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PopulateHexes() {\n\tfor (y=TopHex; y<=BottomHex; y++) {\n\t\tfor (x=LeftHex; x<=RightHex; x++) {\n\t\t\tvar WorldCoordX : int = x+XOffset;\n\t\t\tvar WorldCoordY : int = y+YOffset;\n\t\t\tvar TerrainType : int = TypeArray[WorldCoordX, WorldCoordY];\n\t\t\tvar SectorVert : int = x + (y * (XSize+1));\n\t\t... | [
"0.70026207",
"0.68115795",
"0.67543995",
"0.66572297",
"0.6646148",
"0.6543235",
"0.6527192",
"0.65220934",
"0.65211236",
"0.64889216",
"0.64213157",
"0.6356077",
"0.6339482",
"0.6330288",
"0.62877893",
"0.62830263",
"0.62810326",
"0.62689954",
"0.6261342",
"0.6254255",
"0.6... | 0.7026762 | 0 |
Get a new map from the server | function getNewRandomServerMap(event) {
// Get a new map via Ajax
$.getJSON("/map/new-random.json", function(data) {
populate(data["map"]);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetMap() {\n return map;\n }",
"function createMap(){\n\tconst name = document.getElementById(\"map_name\").value;\n\tputServerData(`/ws/maps/${name}/user/${current_user_id}`,refresh);\n}",
"getMap(n) {\n if (this.state.maps[n] != null) {\n return DATA.maps[th... | [
"0.6969589",
"0.6843903",
"0.6495229",
"0.643924",
"0.63118404",
"0.6306196",
"0.6304072",
"0.62469304",
"0.62311935",
"0.6224801",
"0.6209332",
"0.61428434",
"0.6126824",
"0.6116115",
"0.61054236",
"0.6095698",
"0.60902524",
"0.6084564",
"0.6082222",
"0.6050381",
"0.6045278"... | 0.7084002 | 0 |
Get a path (really a list of points) from the server and highlight it. | function getServerRandomPath() {
// Get a new map via Ajax
$.getJSON("/map/random-path.json", function(data) {
selectPath(data["path"]).highlightHex("red");
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tracePath(path) {\n for (i = 0; i < path.length; i++) {\n var pt = path[i];\n var cellNum = xy_to_id(pt);\n color(cellNum, pathColor);\n }\n}",
"function highlightFromList(xPt,yPt) {\n var symbol = new esri.symbol.SimpleMarkerSymbol(esri.symbol.SimpleMarkerSymbol.STYLE_CIRCLE, 18, new ... | [
"0.6233916",
"0.6104896",
"0.6018801",
"0.5874026",
"0.58491385",
"0.5844",
"0.5676499",
"0.56709",
"0.56567836",
"0.5604402",
"0.55114627",
"0.55023605",
"0.54200673",
"0.54132795",
"0.5406241",
"0.54018563",
"0.5397891",
"0.5390596",
"0.53638977",
"0.53542465",
"0.53226703"... | 0.6384763 | 0 |
Given a tile name and row/column numbers, make a clone of the tile and place it in the hexmap. | function placeTile(name, x, y) {
var tile = $("." + name, "#templates").children().clone();
tile.hexMapPosition(x, y).appendTo($('#hexmap'));
return tile;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setTile(position, tile)\n {\n this.tiles[position.y * this.width + position.x] = tile;\n }",
"setTile (q, r, hex) {\n this.map[q][r] = hex;\n }",
"function newTile(row, col) {\n return $(\"<div></div>\")\n .addClass(\"tile\")\n .prop(\"id\", row + \"-\" + col)\n ... | [
"0.67778665",
"0.67313546",
"0.66069937",
"0.6275744",
"0.6255715",
"0.62334937",
"0.61499894",
"0.6079741",
"0.607299",
"0.6068379",
"0.6038338",
"0.59921944",
"0.5986079",
"0.59806097",
"0.596986",
"0.595079",
"0.5939104",
"0.5921523",
"0.5911214",
"0.5890958",
"0.5842419",... | 0.7803751 | 0 |
x_axis_dates() receives days arg for amount of days returns an array of (days arg + 1) date strings formatted for chart x axis | function x_axis_dates(days) {
var d = moment();
var xaxis = [];
var change_days = days;
d.subtract(change_days, 'days');
for(let x = 0; x <= days; x++) {
xaxis.push((d.month() + 1) + "/" + d.date());
d.add(1, 'days');
}
return(xaxis);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildXAxisCategories() {\n var xAxisCategories = [];\n vm.dates.forEach(function(date) {\n var strs = date.split('-');\n xAxisCategories.push(strs[1] + '/' + strs[2]);\n });\n return xAxisCategories;\n }",
"function dateAxis() {\n var past30Days = [];\n var dat... | [
"0.66191554",
"0.618366",
"0.6136941",
"0.61349607",
"0.57534677",
"0.5727494",
"0.5659272",
"0.5643028",
"0.5592957",
"0.55662155",
"0.5562739",
"0.555908",
"0.5541781",
"0.5541781",
"0.5500677",
"0.5496132",
"0.54864484",
"0.548392",
"0.548392",
"0.54797596",
"0.54797596",
... | 0.82615966 | 0 |
moment_dates() same as x_axis dates: receives days arg for amt of days returns an array of (days arg + 1) date strings. These date strings are used to make moment objects in the two_lines function() | function moment_dates(days) {
var md = moment();
var mdates = [];
var change_days = days;
md.subtract(change_days, 'days');
for(let x = 0; x <= days; x++) {
mdates.push(md.format());
md.add(1, 'days');
}
return(mdates);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function x_axis_dates(days) {\n var d = moment();\n var xaxis = [];\n var change_days = days;\n d.subtract(change_days, 'days');\n for(let x = 0; x <= days; x++) {\n xaxis.push((d.month() + 1) + \"/\" + d.date());\n\td.add(1, 'days');\t \n }\n return(xaxis);\n}",
"function initDays(monday) {\n let t... | [
"0.818937",
"0.60605496",
"0.6008055",
"0.59678733",
"0.59541106",
"0.58899075",
"0.5864115",
"0.5828399",
"0.5796143",
"0.5784315",
"0.57439",
"0.5689435",
"0.5679958",
"0.5673266",
"0.56240296",
"0.55788904",
"0.5573641",
"0.55472",
"0.5513582",
"0.551189",
"0.54857135",
... | 0.6947003 | 1 |
line_operations() both lines require almost identical operations this function receives raw enpoint data (created or resolved) returns chart data so that the operations don't need to be performed twice in the two_lines() function | function line_operations(a_line) {
// for loop to change Trello ISO dates to moment objects
// that work with moment methods
for(let x = 0; x < a_line.length; x++) {
a_line[x].cDate = moment(a_line[x].cDate);
}
// call function that returns array of moment.format() strings of
// last (show_days + 1) da... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function two_lines() {\n // calling our lambda function\n try {\n var cr_call = await axios.get('https://91duv1eln6.execute-api.us-east-1.amazonaws.com/dev/chartdb');\n }\n catch(err) {}\n var myChart = new Chart(ctx, {\n options: {\n title: {\n display: true,\n text: ... | [
"0.6984553",
"0.6259383",
"0.6178354",
"0.61322755",
"0.61256",
"0.6113978",
"0.6029504",
"0.60233974",
"0.60233974",
"0.60233974",
"0.60233974",
"0.60233974",
"0.59988433",
"0.5998135",
"0.5997536",
"0.59825367",
"0.59708315",
"0.59508276",
"0.59331423",
"0.59059143",
"0.587... | 0.6707922 | 1 |
two_lines() returns an array of two arrays. [0] is the chart data for the created line and [1] is the chart data for the resolved line | async function two_lines() {
// calling our lambda function
try {
var cr_call = await axios.get('https://91duv1eln6.execute-api.us-east-1.amazonaws.com/dev/chartdb');
}
catch(err) {}
var myChart = new Chart(ctx, {
options: {
title: {
display: true,
text: "The data could... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lineToCurve(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n}",
"toLine() {\n return {\n x1: this[0][0],\n y1: this[0][1],\n x2: this[1][0],\n y2: this[1][1]\n };\n }",
"toLine() {\n return {\n x1: this[0][0],\n y1: this[0][1],\n x2: this[1][0],\n ... | [
"0.65550554",
"0.6344674",
"0.6311292",
"0.61946845",
"0.61817366",
"0.61600065",
"0.6069672",
"0.60529166",
"0.6029379",
"0.59869295",
"0.5984205",
"0.59796476",
"0.59200424",
"0.58302367",
"0.5824337",
"0.5816506",
"0.5773663",
"0.57132834",
"0.5693978",
"0.5689096",
"0.568... | 0.7355186 | 0 |
Funzione che stampa una lista di cose da cose da fare Accetta: arrayList, array della lista delle cose da fare Return: niente, stampa a schermo utilizzando Handlebars | function printList(arrayList){
// Pulisce la lista, prima di stamparla
$('.todo-list').text('');
// Preparo template di Handelbars
var source = $('#todo-template').html();
var template = Handlebars.compile(source);
for (var i = 0; i < arrayList.length; i++) {
context = {
li... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderizado() {\n listaNombres.innerHTML=''\n nombres.forEach( ( item ) => {\n const html = `<li>${item}</li>`;\n listaNombres.innerHTML += html;\n })\n}",
"function showListComent(comentArray) {\n var htmlComentToAppend = '';\n\n for (let i = 0; i < comentArray.length; i++)... | [
"0.614703",
"0.6097217",
"0.5994466",
"0.5956289",
"0.59263515",
"0.59152806",
"0.58316696",
"0.58238846",
"0.58092386",
"0.57679176",
"0.57458514",
"0.5733331",
"0.57300615",
"0.5685369",
"0.56711406",
"0.56573653",
"0.56540084",
"0.5648327",
"0.5631072",
"0.5629455",
"0.562... | 0.7061155 | 0 |
The object which is created by 'dimensionStyles' uses 'DimensionId' as the key. Aphrodite takes that at face value when generating CSS selector names. But CSS selectors can not start with a digit. Ideally, aphrodite would normalize the selector names. But it does not, so to work around that we prefix the dimensionId wi... | function toStyleKey(dimensionId) {
return `d${dimensionId}`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function dimensionStyles(f) {\n const ret = {};\n allDimensionIds.forEach(id => { ret[toStyleKey(id)] = f(id); });\n return ret;\n}",
"function getDimensionName() {\n var dummyRecord = {};\n Object.keys(dimensions).forEach(function(d) {\n dummyRecord[d] = d;\n });\n\n return dimensionFct(dumm... | [
"0.70007956",
"0.66478914",
"0.5864145",
"0.54012966",
"0.5362108",
"0.5334565",
"0.53333986",
"0.53140813",
"0.5306832",
"0.529796",
"0.52586424",
"0.5254809",
"0.51939636",
"0.51906705",
"0.5185679",
"0.5149187",
"0.5149187",
"0.5149187",
"0.5149187",
"0.5149187",
"0.513220... | 0.75504357 | 0 |
Helper function which can be used to create a style object for each dimension. The callback is called once for each DimensionId. The function returns a map from DimensionId to whatever the function returns. | function dimensionStyles(f) {
const ret = {};
allDimensionIds.forEach(id => { ret[toStyleKey(id)] = f(id); });
return ret;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeStyles() {\n // One style per geometry type, with overlay blending\n return ['polygons', 'lines', 'points', 'text'].reduce(function (tgStyles, geomType) {\n tgStyles[(\"XYZ_\" + geomType)] = {\n base: geomType,\n blend: 'overlay'\n };\n... | [
"0.59628487",
"0.5673674",
"0.564426",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"0.5538051",
"... | 0.76496685 | 0 |
This function accepts parsedJson and return an array of resources. | async function getResourcesFromJson(promiseArray) {
let resources = [];
for (let i = 0; i < 5; i++) {
console.info(promiseArray[i]);
var finalResult = promiseArray[i];
var downloads = finalResult["downloads"];
var id = finalResult.id;
resources.push(new Resource(id, downl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function allResources(api) {\n var resources = [];\n var visitor = function (res) {\n resources.push(res);\n res.resources().forEach(function (x) { return visitor(x); });\n };\n api.resources().forEach(function (x) { return visitor(x); });\n return resources;\n}",
"function fetchReso... | [
"0.59954876",
"0.5681369",
"0.56662107",
"0.5648082",
"0.5578043",
"0.53874147",
"0.5355044",
"0.53428185",
"0.5333568",
"0.52717865",
"0.5268763",
"0.526648",
"0.5215504",
"0.5198306",
"0.5189762",
"0.51758325",
"0.5166929",
"0.51660734",
"0.5138624",
"0.5123039",
"0.5119432... | 0.6444112 | 0 |
Create a function printArgsInfo() with no parameters. For each argument passed to it, the function should return its type and its value. | function printArgsInfo() {
if (arguments.length === 0) {
console.log("No arguments.");
}
for (var i = 0; i < arguments.length; i++) {
var type = arguments[i] ? arguments[i].constructor.name.toLocaleLowerCase() : typeof arguments[i];
console.log(arguments[i] + ' (' + type + ')');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inspectArgs() {\n for (let i = 0; i < arguments.length; i++) {\n console.log(arguments[i]);\n }\n}",
"function noArgs() {\n console.log(arguments);\n}",
"function printArguments() {\n\tfor(var i in arguments) {\n \t\tconsole.log(arguments[i]);}\n}",
"function imprimeArguemntos(){\n ... | [
"0.68537813",
"0.6148713",
"0.61285114",
"0.610416",
"0.60366344",
"0.59562707",
"0.5953729",
"0.5930472",
"0.5903384",
"0.5890715",
"0.58720833",
"0.58659947",
"0.585647",
"0.5835601",
"0.5807114",
"0.58056986",
"0.5780851",
"0.5764192",
"0.5752332",
"0.5752332",
"0.5752332"... | 0.77762717 | 0 |
Generate a delete query based on a request body: table: where to make the query key: the column that we query by (e.g. username, handle, id) id: current record ID Returns object containing a DB query as a string | function sqlForDelete(table, key, id) {
if (table === undefined || key === undefined || id === undefined) {
throw new ExpressError("all parameters are required", 500);
}
// build query
let query;
if (Array.isArray(key)) {
query = `DELETE FROM ${table} WHERE ${key[0]}=$1 AND ${key[1]}=$2 RETURNING *`;
} else {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteStatement(qent, q) {\n var table = tablename(qent);\n var params = [];\n var w = whereargs(makeEntity.fromExtraction(qent), q);\n var wherestr = '';\n\n if (!_.isEmpty(w)) {\n for (var param in w) {\n params.push(param + ' = ' + getWhereCond(w[param]));\n }\n wherestr = \" WHERE \... | [
"0.6653291",
"0.65984243",
"0.6391494",
"0.6354453",
"0.6291322",
"0.62520486",
"0.6060525",
"0.60361505",
"0.60302883",
"0.60247207",
"0.59757084",
"0.5924594",
"0.5910413",
"0.5872524",
"0.5847408",
"0.58386266",
"0.58227783",
"0.5788262",
"0.57760805",
"0.57372004",
"0.568... | 0.73698246 | 0 |
render main window view | function renderMainWindow () {
var targetMainPage = process.cwd() + '/html/main.html';
var html = fs.readFileSync(targetMainPage, 'utf8');
$('#window').append(html);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderApplication() {\n impWindows.inv = createInvWindow();\n}",
"renderView(){\n\n var left = Math.floor( window.innerWidth * this._config.left );\n var bottom = Math.floor( window.innerHeight * this._config.bottom );\n var width = Math.floor( window.innerWidth * this._config.width );\n ... | [
"0.6742493",
"0.6462343",
"0.64255846",
"0.64166814",
"0.6412587",
"0.64058083",
"0.6400759",
"0.6377739",
"0.6358257",
"0.6321188",
"0.62743425",
"0.6267044",
"0.62568444",
"0.62541467",
"0.6243844",
"0.622554",
"0.6219917",
"0.6211038",
"0.62046826",
"0.6195689",
"0.6182188... | 0.7288422 | 0 |
Keeps sending connection signals to backend, so it will know the user's still online | function keepConectionAlive() {
GLOBAL.conectionIntervalID = setInterval(() => {
GLOBAL.api.post("/status", { name: GLOBAL.username }).catch(error => {
console.log("Falha na conexão");
console.log(error.toJSON());
history.go();
})
}, 5000)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function connection_online() {\n // Unblock.\n }",
"function onlineState() {\n\t\t\t// Handle the online event\n \tvar networkState = navigator.connection.type;\n\t\t\tconsole.log('Connection type: ' + networkState);\n \tif (networkState !== Connection.NONE) {\n //use connection state to update ... | [
"0.7302797",
"0.72007674",
"0.68927574",
"0.67935663",
"0.67254657",
"0.6694258",
"0.66277516",
"0.6613371",
"0.64888906",
"0.6379675",
"0.6364886",
"0.6348474",
"0.63484496",
"0.63066804",
"0.6306188",
"0.6304127",
"0.629964",
"0.6273102",
"0.6268066",
"0.62638545",
"0.62588... | 0.7326545 | 0 |
Manages the functions that checks the new messages and, if there is any new messages, renders them on screen and updates the apps cache (GLOBAL object). | function updateDisplayedMessagesManager() {
const newMessages = wichMessagesShouldBeAddedInHtml();
newMessages.map(message => {
message.type === "private_message" &&
message.from !== GLOBAL.username &&
message.to !== GLOBAL.username
? void(0)
: displayMessage(generateMess... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function refreshMessages(e) {\n getMessages();\n}",
"function updateMessages(){getCurrentDisplayValue().then(function(msg){ctrl.messages=[getCountMessage(),msg];});}",
"function reloadMessages () { \n console.log(\"Current view called\");\n currentView(true);\n}",
"function refreshMessages() {\n $.... | [
"0.6921552",
"0.6834288",
"0.6793186",
"0.6660059",
"0.657165",
"0.6510974",
"0.6510974",
"0.6510974",
"0.6431303",
"0.6382475",
"0.6372069",
"0.63437515",
"0.63133514",
"0.62824255",
"0.62622046",
"0.62457216",
"0.6236568",
"0.619301",
"0.61799264",
"0.6179119",
"0.6175982",... | 0.70740795 | 0 |
Find the first `preferred` item existing in `arr`. | function prefer(arr, preferred) {
for (var i = 0; i < preferred.length; i++) {
if (arr.indexOf(preferred[i]) !== -1) {
return preferred[i];
}
}
return preferred[0];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function prefer(arr, preferred) {\n for (var i = 0; i < preferred.length; i++) {\n if (arr.indexOf(preferred[i]) !== -1) {\n return preferred[i];\n }\n }\n return preferred[0];\n }",
"function prefer(arr, preferred) {\n for (var i = 0; i < preferred.length; i++) {\... | [
"0.7695888",
"0.71114284",
"0.62953085",
"0.62753874",
"0.62753874",
"0.6238004",
"0.6238004",
"0.6238004",
"0.6238004",
"0.6143434",
"0.5930219",
"0.59189105",
"0.58002794",
"0.57734895",
"0.574748",
"0.56930554",
"0.5665858",
"0.5663704",
"0.5611331",
"0.56085396",
"0.55988... | 0.77115846 | 0 |
It should return an integer that is the number of choices for the current question check if playTurn(choice)===correctAnswer for currentQuestion if yes(true), player1score++ else return false prompt next question switch player | function playTurn(choice) {
if(isGameOver()) {
console.log('finished!');
console.log(player1score);
console.log(player2score);
return false;
}
if (choice === questionList[currentQuestion()].correctAnswer) {
if (currentPlayer === 1) {
player1score++;
currentPlayer = 2;
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function playTurn (choice) {\n if (quiz.isGameOver) {\n return false\n }\n var correct = false\n if (choice === quiz.questions[quiz.currentQuestion].correctChoice) {\n correct = true\n if (quiz.currentQuestion % 2) {\n quiz.player2Points++\n } else {\n quiz.player1Points++\n }\n }\n ... | [
"0.7609741",
"0.7595059",
"0.7574991",
"0.7328169",
"0.7260957",
"0.7229009",
"0.7226325",
"0.72018844",
"0.7071588",
"0.7055645",
"0.70239776",
"0.7015286",
"0.7014034",
"0.6983421",
"0.6964228",
"0.69584846",
"0.6955296",
"0.69544643",
"0.6947414",
"0.6946227",
"0.6938124",... | 0.76194143 | 0 |
add candidate to the list update map, chart and legend | function addCandidate(name, solid, likely, leaning, tilting) {
//clearDelegates();
if(name === undefined) {
var nameHTML = document.getElementById('name');
if(nameHTML !== null) {
name = nameHTML.value;
} else {
name = "Error";
}
}
// ignore white space candidates
if(name.trim() === '') {
return;... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateRecommender() {\n var lastFeatureIndex = this.state.featureFlag.length - 1;\n var name = this.state.featureFlag[lastFeatureIndex].name;\n var description = this.state.featureFlag[lastFeatureIndex].description;\n var obj = { name, description };\n featuresList.push(obj);\n ... | [
"0.5749071",
"0.56639296",
"0.5655045",
"0.5491919",
"0.5469142",
"0.5467813",
"0.54451275",
"0.54443073",
"0.5435924",
"0.54225343",
"0.53902346",
"0.5380922",
"0.53286535",
"0.53159344",
"0.5302963",
"0.5287631",
"0.5277096",
"0.5267396",
"0.52638847",
"0.5252216",
"0.52425... | 0.5802806 | 0 |
TODO do we need this? Load associations immediately, instead of waiting for FixtureAdapter's asynchronous loads. Basically, all we need to do is access each object from inside Ember.run. TODO: We can't test this or insert where needed until App.reset() works. TODO: Handle hasMany. | function loadAssociations(object /*, paths... */) {
var paths = Array.prototype.slice.call(arguments, 1);
for (var i = 0; i < paths.length; i++) {
var components = paths[i].split(".");
for (var j = 0; j < components.length; j++) {
Ember.run(function () {
var path = co... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initRelations() {\n const me = this,\n relations = me.constructor.relations;\n if (!relations) return; // TODO: feels strange to have to look at the store for relation config but didn't figure out anything better.\n // TODO: because other option would be to store it on each model instance, not be... | [
"0.60166585",
"0.5944115",
"0.5911625",
"0.5777041",
"0.5767606",
"0.5651863",
"0.5594228",
"0.55746734",
"0.55526346",
"0.55517906",
"0.55459136",
"0.54429597",
"0.54306537",
"0.5426095",
"0.53661853",
"0.52414834",
"0.52254903",
"0.52044433",
"0.51912713",
"0.5186577",
"0.5... | 0.6111658 | 0 |
Construct and append a popup DOM at the end of the main 'body'. Note: Tried to append this popup as a HTML string but that broke some of tested websites. | function appendPopupDOMToBody() {
let textNode;
let popupDiv = document.createElement("div");
popupDiv.className = "cf-debugger-popup";
// Empty title for now
let popupFeatureHeader = document.createElement("p");
popupFeatureHeader.className = "cf-debugger-popup-title";
textNode = document.createTextNode... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildPopup() {\n if ($('a.popup').length === 0) return;\n\n var popup_window = $('<div>').attr('class', 'popup_window draggable').css('display', 'none');\n var close = $('<div>').attr('class', 'close').html('X').click(function() { $(this).parents('.popup_window').fadeOut(); });\n var header ... | [
"0.72703946",
"0.71392435",
"0.6719113",
"0.6684814",
"0.66742563",
"0.6598957",
"0.64738804",
"0.6462752",
"0.6428331",
"0.64092654",
"0.64092654",
"0.63351536",
"0.6301646",
"0.62952864",
"0.626671",
"0.6261829",
"0.6183809",
"0.6147035",
"0.6097843",
"0.60752815",
"0.60655... | 0.7194924 | 1 |
Check all hovered DOMs and filter all images DOMS contain 'cfdebuggerrequestid' attribute. | function hoveredImageChecker() {
/**
* ':hover' query select every DOM element that are underneath of
* a cursor and return a list of DOMs from the BOTTOM layer to the
* SURFACE layer.
* For example, ['html', 'body', ..., 'div', 'p']
*/
let elementHoverOver = $(document.querySelectorAll(":hover"));
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetPrevIMG() {\n let requestId;\n for (requestId in previousHoveredImages) {\n // Cloudflare cached image\n if (previousHoveredImages[requestId] && imageRequests[requestId].cfCached) {\n previousHoveredImages[requestId].attr(\"cf-debugger-style\", \"cache\");\n // Cloudflare cache miss... | [
"0.5677691",
"0.56739855",
"0.5575659",
"0.53440595",
"0.5148324",
"0.5147243",
"0.5106789",
"0.5099431",
"0.5081986",
"0.5079605",
"0.5047642",
"0.50462896",
"0.5011127",
"0.49919486",
"0.4980279",
"0.4973739",
"0.49511647",
"0.4944894",
"0.48948938",
"0.48859888",
"0.488235... | 0.73209167 | 0 |
Counter for mouseMovementCounterForParent variable to reduce frequency of hovered images checking logic. | function mouseMovementCounter() {
if (mouseMovementCounterForParent < mouseMoveThreashold) {
mouseMovementCounterForParent += 1;
return false;
} else {
mouseMovementCounterForParent = 0;
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hoverMouseMovementCounter() {\n if (mouseMovementCounterForHover < mouseMoveHoverTheshold) {\n mouseMovementCounterForHover += 1;\n return false;\n } else {\n // Set back to 0\n mouseMovementCounterForHover = 0;\n return true;\n }\n}",
"function iFrameMouseMovementCounter() {\n if (mo... | [
"0.693262",
"0.66858697",
"0.5458505",
"0.54362965",
"0.5349735",
"0.53169143",
"0.5286799",
"0.52329594",
"0.5217733",
"0.52161777",
"0.5211581",
"0.51878464",
"0.51831466",
"0.5157323",
"0.5132773",
"0.5111297",
"0.5106042",
"0.50688154",
"0.5053902",
"0.50206804",
"0.50173... | 0.807488 | 0 |
Counter for 'mouseMovementCounterForIFrame' variable to reduce frequency of hovered images checking logic. | function iFrameMouseMovementCounter() {
if (mouseMovementCounterForIFrame < mouseMoveIFrameTheshold) {
mouseMovementCounterForIFrame += 1;
return false;
} else {
// Set back to 0
mouseMovementCounterForIFrame = 0;
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hoverMouseMovementCounter() {\n if (mouseMovementCounterForHover < mouseMoveHoverTheshold) {\n mouseMovementCounterForHover += 1;\n return false;\n } else {\n // Set back to 0\n mouseMovementCounterForHover = 0;\n return true;\n }\n}",
"function mouseMovementCounter() {\n if (mouseMov... | [
"0.71111584",
"0.6335511",
"0.59928423",
"0.5795352",
"0.575101",
"0.5740295",
"0.57094264",
"0.56625247",
"0.5617242",
"0.5541567",
"0.5511745",
"0.5499214",
"0.5495606",
"0.5475143",
"0.5454668",
"0.54518056",
"0.5434228",
"0.5405243",
"0.54034406",
"0.53952503",
"0.5381689... | 0.7988474 | 0 |
Counter for 'mouseMovementCounterForHover' variable to reduce frequency of hovered images checking logic. | function hoverMouseMovementCounter() {
if (mouseMovementCounterForHover < mouseMoveHoverTheshold) {
mouseMovementCounterForHover += 1;
return false;
} else {
// Set back to 0
mouseMovementCounterForHover = 0;
return true;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function iFrameMouseMovementCounter() {\n if (mouseMovementCounterForIFrame < mouseMoveIFrameTheshold) {\n mouseMovementCounterForIFrame += 1;\n return false;\n } else {\n // Set back to 0\n mouseMovementCounterForIFrame = 0;\n return true;\n }\n}",
"hover(item) { // item is the dragged elemen... | [
"0.62771136",
"0.62324244",
"0.6221668",
"0.58531743",
"0.5729244",
"0.5701221",
"0.5651647",
"0.56432974",
"0.5628154",
"0.55981004",
"0.5535034",
"0.5523783",
"0.55005985",
"0.5499581",
"0.5488428",
"0.545915",
"0.5446061",
"0.54418236",
"0.5440272",
"0.54189205",
"0.541379... | 0.8261761 | 0 |
Set back all hovered images back to its filtered color. | function resetPrevIMG() {
let requestId;
for (requestId in previousHoveredImages) {
// Cloudflare cached image
if (previousHoveredImages[requestId] && imageRequests[requestId].cfCached) {
previousHoveredImages[requestId].attr("cf-debugger-style", "cache");
// Cloudflare cache missed image
} ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imageHover () {\n let imageContainner = document.querySelectorAll('.col__img-conatinner');\n for (let images of imageContainner) {\n images.addEventListener(\"mouseover\", () => {\n images.className += \" col__img-conatinner--filter\";\n images.childNodes[3].style.displa... | [
"0.6283252",
"0.609123",
"0.5909425",
"0.58831936",
"0.58808976",
"0.58734024",
"0.58598137",
"0.5825139",
"0.5814155",
"0.5772768",
"0.5772768",
"0.5761911",
"0.57613003",
"0.57318944",
"0.5730891",
"0.5720397",
"0.57161194",
"0.5709524",
"0.5682931",
"0.56770074",
"0.566710... | 0.6127572 | 1 |
Exit a parse tree produced by MmParsermm. | exitMm(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function translator_terminate()\n{\n this.parser.terminate();\n}",
"\"ClassBody:exit\"() {\n stack.pop();\n }",
"exitAtom(ctx) {\n\t}",
"\"VElement[name=template]:exit\"(node) {\n const result = builder.build();\n const json = JSON.stringify(result);\n context.report... | [
"0.60641676",
"0.5737851",
"0.5697361",
"0.55869734",
"0.5512682",
"0.55021334",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
"0.5500029",
... | 0.57920605 | 1 |
Enter a parse tree produced by MmParsersQString. | enterSQString(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enterNQString(ctx) {\n\t}",
"enterDQString(ctx) {\n\t}",
"updateParseTreeTab (root) {\n let html = root.children.map(createParseTreeView).join(\"\");\n if (html === \"\") {\n this.disableTab(\"parse-tree\");\n }\n this.DOMNodes.parseTree.innerHTML = html;\n this.enableTab(\"parse-tree\");\n... | [
"0.5908294",
"0.55331117",
"0.5423868",
"0.53124565",
"0.5242721",
"0.5153325",
"0.51197773",
"0.50999814",
"0.5063534",
"0.50353193",
"0.49254665",
"0.487217",
"0.487217",
"0.487217",
"0.487217",
"0.48718238",
"0.485151",
"0.48238373",
"0.48131874",
"0.48090827",
"0.48018146... | 0.5666257 | 1 |
Exit a parse tree produced by MmParsersQString. | exitSQString(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"exitNQString(ctx) {\n\t}",
"exitDQString(ctx) {\n\t}",
"function translator_terminate()\n{\n this.parser.terminate();\n}",
"exit(guiManager, final) {}",
"exit(guiManager, final) {}",
"exit() {\n console.log(markup.exit);\n process.exit(0);\n }",
"exitExpr(ctx) {\n\t}",
"end() {\n ... | [
"0.6350411",
"0.6216886",
"0.60333127",
"0.52677584",
"0.52677584",
"0.52476",
"0.5234001",
"0.52283895",
"0.52223366",
"0.5144138",
"0.5106009",
"0.50984085",
"0.50984085",
"0.50847995",
"0.50847995",
"0.5055541",
"0.50538146",
"0.49734762",
"0.49725103",
"0.49565065",
"0.49... | 0.62385774 | 1 |
Enter a parse tree produced by MmParserdQString. | enterDQString(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"enterNQString(ctx) {\n\t}",
"enterSQString(ctx) {\n\t}",
"updateParseTreeTab (root) {\n let html = root.children.map(createParseTreeView).join(\"\");\n if (html === \"\") {\n this.disableTab(\"parse-tree\");\n }\n this.DOMNodes.parseTree.innerHTML = html;\n this.enableTab(\"parse-tree\");\n... | [
"0.59413004",
"0.56605536",
"0.54724675",
"0.5319811",
"0.53072524",
"0.52551335",
"0.5253398",
"0.5216417",
"0.51336527",
"0.5070887",
"0.50407165",
"0.50017595",
"0.49274945",
"0.4915206",
"0.48795202",
"0.48790982",
"0.48300055",
"0.48277983",
"0.4819618",
"0.47518158",
"0... | 0.5906354 | 1 |
Exit a parse tree produced by MmParserdQString. | exitDQString(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"exitNQString(ctx) {\n\t}",
"function translator_terminate()\n{\n this.parser.terminate();\n}",
"exitSQString(ctx) {\n\t}",
"\"VElement[name=template]:exit\"(node) {\n const result = builder.build();\n const json = JSON.stringify(result);\n context.report({ node: node, message: json });\n ... | [
"0.6309773",
"0.61766446",
"0.6129767",
"0.533819",
"0.5292784",
"0.5292784",
"0.5249637",
"0.5215136",
"0.5149921",
"0.5135682",
"0.50923985",
"0.50923985",
"0.503379",
"0.50300926",
"0.502864",
"0.5014697",
"0.5012528",
"0.5012528",
"0.5008669",
"0.500122",
"0.4992973",
"... | 0.65129834 | 0 |
Enter a parse tree produced by MmParsernQString. | enterNQString(ctx) {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateParseTreeTab (root) {\n let html = root.children.map(createParseTreeView).join(\"\");\n if (html === \"\") {\n this.disableTab(\"parse-tree\");\n }\n this.DOMNodes.parseTree.innerHTML = html;\n this.enableTab(\"parse-tree\");\n }",
"function showParseTree() {\n // Hide the answe... | [
"0.5495395",
"0.5448945",
"0.53596",
"0.5302135",
"0.52315104",
"0.5191357",
"0.5159323",
"0.5148877",
"0.51354516",
"0.51246166",
"0.51187354",
"0.50759566",
"0.49826702",
"0.48922068",
"0.48814335",
"0.48556668",
"0.4833095",
"0.48112604",
"0.48032278",
"0.47846812",
"0.478... | 0.5761571 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.