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 |
|---|---|---|---|---|---|---|
Get the IP address for given MAC address Warning : can return null if the lan has not been scanned recently | async deviceIP(mac) {
if (!F.isMAC(mac)){
throw Error('Invalid MAC');
}
mac = F.normalizeMAC(mac);
// Get the arp table
const arpTable = await this.arpTable();
// Try to find a match in the table
const match = arpTable.reduce((prev, curr) => (curr.mac ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getMACAddress() {\n if (curntMac === undefined || curntMac === null) {\n var iface = getInterface();\n if (iface === null || iface === undefined) {\n if (!underTest) console.error(\"Unable to retrieve the local mac address.\");\n return \"??:??:??:??:??:??\";\n ... | [
"0.67512906",
"0.66967434",
"0.6221126",
"0.6144843",
"0.61079353",
"0.6095468",
"0.6057571",
"0.6040118",
"0.5981035",
"0.5960955",
"0.5947611",
"0.5919811",
"0.5892385",
"0.5871818",
"0.5859669",
"0.5795157",
"0.57921684",
"0.57400614",
"0.5711623",
"0.57080054",
"0.5690635... | 0.80081034 | 0 |
isMAC (internal function exposed) | static isMAC(mac){ return F.isMAC(mac) } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isMac(){\n let bool = false;\n if (navigator.platform.toUpperCase().indexOf('MAC') >= 0\n || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) {\n bool = true;\n }\n return bool;\n }",
"function isMac() {\n return navigator.platform.toUpperCase().indexOf... | [
"0.77212685",
"0.76111406",
"0.7340395",
"0.7253391",
"0.7249361",
"0.7115935",
"0.7115935",
"0.7081732",
"0.7045641",
"0.69517106",
"0.69487584",
"0.6895027",
"0.6875441",
"0.68528193",
"0.6827196",
"0.6827196",
"0.6689856",
"0.66678727",
"0.66669416",
"0.6628737",
"0.634229... | 0.9000925 | 0 |
isIP (internal function exposed) | static isIP(ip){ return F.isIP(ip) } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"is_ip(value) {\n const net = require('net')\n return (net.isIPv4(value) || net.isIPv6(value));\n }",
"function ipCheck(ip) {\n var check = JSON.parse(execSync('/home/jdonas/web-interface/components/ip-checker/scripts/ip-check.py ' + ip));\n if (check[\"exists\"])\n return true;\n r... | [
"0.82469463",
"0.7795139",
"0.7572121",
"0.72951",
"0.7145556",
"0.7118861",
"0.70953083",
"0.7058437",
"0.7051356",
"0.69617194",
"0.6901362",
"0.6859395",
"0.67920977",
"0.67902696",
"0.67662346",
"0.67290026",
"0.67001987",
"0.66872007",
"0.6627336",
"0.6617817",
"0.661309... | 0.8867226 | 0 |
Start the lan scan (Node ICMP Requests) and return the class object | startScan(objParam){
F.validateParamIpArray(objParam.ipArrayToScan);
this.devicesInfosPromises = [];
this.scannerICMP.start(objParam);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"start({ ipArrayToScan = [], timeout = 3000, port = 1 }) {\r\n super.start({ ipArrayToScan : ipArrayToScan });\r\n\r\n let pending = 0\r\n\r\n for (let ip of this.ipArrayToScan) {\r\n pending++\r\n this.scanHost({ ip, port, timeout }, error => {\r\n if (!err... | [
"0.5488798",
"0.5152831",
"0.5106686",
"0.50877744",
"0.50600046",
"0.5011984",
"0.48829395",
"0.48739",
"0.4818753",
"0.4817408",
"0.48112348",
"0.47897655",
"0.47831938",
"0.47775748",
"0.47196573",
"0.47161618",
"0.4710451",
"0.47035012",
"0.4670748",
"0.46610126",
"0.4659... | 0.64694256 | 0 |
benchmark thumbnail via a memory buffer | function viaMemory (filename, thumbnailWidth) {
var data = fs.readFileSync(filename);
var thumb = vips.Image.thumbnailBuffer(data, thumbnailWidth, {crop: 'centre'});
// don't do anything with the result, this is just a test
thumb.writeToBuffer('.jpg');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function benchMark(nData, algo, nWorkers, to) {\n /* Provided Array with MB size */\n var arr = gArr.subarray(0, 1024 * 1024 * nData);\n\n\n for (var i = 0; i < arr.length; i++)\n arr[i] = Math.floor((Math.random() * 100) + 1);\n\n\n\n /*Plain javascr... | [
"0.6009727",
"0.5822762",
"0.5789722",
"0.5691676",
"0.5653648",
"0.55875885",
"0.55494",
"0.53983754",
"0.53591716",
"0.534333",
"0.5340793",
"0.52998877",
"0.52562857",
"0.52433133",
"0.52350765",
"0.52332956",
"0.52303106",
"0.5216799",
"0.51762396",
"0.51730883",
"0.51667... | 0.6195184 | 0 |
We want a function that gives the foo's of those records | function foos(recs) {
if (!recs.length) return [];
return [recs[0].foo].concat(foos(recs.slice(1)));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFieldValuesFunction(lyr, field) {\n var records = lyr.data.getRecords();\n return function getFieldValues(ids) {\n var values = [], rec;\n for (var i=0; i<ids.length; i++) {\n rec = records[ids[i]];\n values.push(rec[field]);\n }\n return values;\n };\n }",
... | [
"0.5522603",
"0.51892537",
"0.4945207",
"0.49412116",
"0.4904648",
"0.48688325",
"0.4797033",
"0.47493705",
"0.47218704",
"0.47218704",
"0.47218704",
"0.47182536",
"0.4713398",
"0.46911475",
"0.46757072",
"0.46659258",
"0.46096689",
"0.46011075",
"0.45786998",
"0.45783496",
"... | 0.63202345 | 0 |
if there is an error with the users location then it reports it to the user and picks a restaurant in Seattle takes an error to tell the user | function onPositionError(error) {
console.error(error);
alert(err.message);
getRestaurants(seattleCoords);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function geolocError(){\n console.log(\"Error getting user's location :(\");\n}",
"function locError(error) {\n userHasGPSCoordinates = false;\n console.log(\"error: the current position could not be located\");\n searchPosition(1); //if no gps is activated we asume the user is in fh\n}",
"function l... | [
"0.6839435",
"0.6825446",
"0.6486245",
"0.64690894",
"0.6431502",
"0.64120555",
"0.6408712",
"0.6372728",
"0.6371027",
"0.633281",
"0.6252143",
"0.6236898",
"0.6185524",
"0.61812216",
"0.6087581",
"0.6082028",
"0.60647744",
"0.60389185",
"0.6031638",
"0.6010539",
"0.6006957",... | 0.69637585 | 0 |
creates a marker of the users' current location | function createMarker() {
var marker = L.marker(currentLocation).addTo(map);
markers.push(marker);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function markCurrentLocation(currentLocation) {\n var marker = new google.maps.Marker({\n position: currentLocation,\n map: map,\n title: \"My Location\"\n });\n}",
"function createLocationSearchMarker(){\n vm.map.markers['user_current_location'] = {\n lat: angular.copy(curre... | [
"0.76290375",
"0.74335146",
"0.7420115",
"0.73924613",
"0.73315996",
"0.73044276",
"0.7201777",
"0.7142877",
"0.71195644",
"0.70111156",
"0.70091134",
"0.7000942",
"0.6977447",
"0.6939291",
"0.6912626",
"0.69061816",
"0.6893931",
"0.68855447",
"0.6875517",
"0.68678045",
"0.68... | 0.7620574 | 1 |
function for pages with charset windows1251 or ISO88595 | function suche3(id) {
var texto;
var ordbogform;
var o_text = document.ordbogform.texto.value;
var i;
var out="";
var debug="";
var oldchar;
var newchar;
for (i=0; i<o_text.length; i++) {
oldchar = o_text.charCodeAt(i);
newchar = win1251[oldchar];
if (newchar==undefined) {
newchar ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function convertSanitizeAndRender() {\n // If charset is not UTF-8, try techniques to coerce it to UTF-8 (likely used only for local files)\n // Maybe one day this will be the default behavior https://bugzilla.mozilla.org/show_bug.cgi?id=1071816\n if (document.characterSet.toUpperCase() != 'UTF-8') {\n try {... | [
"0.54735637",
"0.5394078",
"0.52601373",
"0.50903314",
"0.506079",
"0.50529146",
"0.4940243",
"0.48251426",
"0.47851196",
"0.4747962",
"0.47414812",
"0.47392088",
"0.47272432",
"0.4709888",
"0.4709888",
"0.4709888",
"0.4709888",
"0.47092834",
"0.46942064",
"0.46838805",
"0.46... | 0.5713044 | 0 |
Loads opponents data for their battle card | loadOpponent(data)
{
playSound("oppJoined");
if(game.id === data.id)
{
game.opponent = data.challenger
game.opponentKey = data.challengerkey
}
else
{
game.opponent = data.username
game.opponentKey = data.userkey
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadData(){ \t\n \t//if (gameData.data.player.playerID>0) {\n \t\tCORE.LOG.addInfo(\"PROFILE_PAGE:loadData\");\n \t\t//var p = new ProfileCommunication(CORE.SOCKET, setData); \t\t\n \t\t//p.getData(gameData.data.player.playerID); \t\t\n \t\t\n \t//}\n \t//else \n \t\tsetDa... | [
"0.65370744",
"0.63343996",
"0.6207888",
"0.6199165",
"0.61666596",
"0.61544484",
"0.6130824",
"0.6120575",
"0.611686",
"0.60356116",
"0.602857",
"0.6024934",
"0.5972718",
"0.5960077",
"0.59585476",
"0.5945606",
"0.5944749",
"0.59396785",
"0.5900217",
"0.58937615",
"0.5874648... | 0.63525563 | 1 |
Inhibits double clicking on turn | checkForDoubleClick()
{
var turn
if(app.gameType === "orderChaos")
turn = game.isXTurn ? "order" : "chaos"
else
turn = game.isXTurn ? "x" : "o"
if(turn === game.previousPiece)
{
console.log("you double clicking")
game.isXTurn =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"doubleClick(x, y, _isLeftButton) {}",
"function doubleTap(element) {\r\n interact(element)\r\n .on('doubletap', function(event) {\r\n if (event.target.className === 'furnitureIcon') {\r\n rotateFurniture(event.tar... | [
"0.71018314",
"0.68272597",
"0.6685525",
"0.65232855",
"0.6463972",
"0.64317644",
"0.63880736",
"0.63831",
"0.63438654",
"0.63328207",
"0.6321543",
"0.6295745",
"0.627835",
"0.6201164",
"0.61277443",
"0.61194074",
"0.61127234",
"0.6087909",
"0.6067778",
"0.60664916",
"0.60629... | 0.73370606 | 0 |
Simple animation for opponent leaving game | animateOpponentLeaving()
{
game.opponentLeft = true;
$('#opponentCard').css({ 'right': '0px', 'right': '-20%' }).animate({
'right' : '-20%'
});
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function endGame() {\n $('.home').css({ 'margin-top': '0px' });\n disappear('.instructions');\n hide('.view-button');\n disappear('.follow-circle');\n disappear('.instructions');\n state = \"view\";\n }",
"handleOpponentLeaving()\n {\n console.log(\"opponent... | [
"0.70338786",
"0.6930846",
"0.6917196",
"0.68816555",
"0.685887",
"0.68011844",
"0.6777876",
"0.6774955",
"0.6774955",
"0.674756",
"0.66680664",
"0.6664975",
"0.66634387",
"0.66625226",
"0.6658014",
"0.66252977",
"0.6609127",
"0.66068673",
"0.659844",
"0.65913963",
"0.6588622... | 0.69887066 | 1 |
Initilaizes the client to start multiplayer | startMultiplayer()
{
document.getElementById("chat-box").style.visibility = "visible";
document.getElementById("open-box").style.visibility = "visible";
if(game.firstPlay === true)
{
if(game.challengingFriend)
{
Client.makeNewPlayer({... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onStart() {\n const _ = this;\n Game.socket.once('startReply', function(conf) {\n _.GUI.clear();\n\n const player = new MainPlayer(conf.x, conf.y, _.world);\n\n Game.players[Game.socket.id] = player;\n _.camera.follow(player);\n _.GUI.debug(player, 'x');\n });\n Game.socket.emi... | [
"0.70914906",
"0.6824304",
"0.67563444",
"0.66862994",
"0.6647989",
"0.6585741",
"0.65819895",
"0.6573197",
"0.650352",
"0.6470169",
"0.6446795",
"0.6419964",
"0.64129764",
"0.64087254",
"0.64003265",
"0.6395481",
"0.6393855",
"0.63821954",
"0.63770735",
"0.63765275",
"0.6346... | 0.70229805 | 1 |
function `insertionSort` accepts: m: ? arr: array to be sorted returns: sorted array | function insertionSort(m, arr) {
let i, j, key;
for (j = 2;j <= m;j++) {
key = arr[j];
i = j - 1;
while ((i > 0) && (arr[i] > key)) {
arr[i + 1] = arr[i];
i = i - 1;
}
arr[i + 1] = key;
}
return arr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function insertionSort(arr) {\n var minIdx, temp,\n len = arr.length;\n for (var i = 0; i < len; i++) {\n minIdx = i;\n for (var j = i + 1; j < len; j++) {\n if (arr[j] < arr[minIdx]) {\n minIdx = j;\n }\n }\n temp = arr[i];\n arr... | [
"0.7676622",
"0.76287204",
"0.7610277",
"0.7569468",
"0.74747",
"0.7454902",
"0.7412821",
"0.740796",
"0.7388891",
"0.7384743",
"0.7382508",
"0.7376952",
"0.73676896",
"0.736256",
"0.7258769",
"0.7255086",
"0.72351235",
"0.72343194",
"0.7215172",
"0.72055995",
"0.719649",
"... | 0.8714139 | 0 |
============================================================================== JobFactory: take a mail and generate a job for running, will need to parse. | function Job(mail, content) {
this.mail = mail;
this.content = content;
var parser = new Parser();
this.goals = parser.content_to_goals(this.content);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateJob() {\n\treturn {\n\t\t\tjobName: faker.lorem.words(),\n\t\t boatFullAddress: faker.address.streetAddress(),\n\t\t services: [generateServices(), generateServices(), generateServices()],\n\t\t otherService: faker.lorem.words(),\n\t\t serviceDate: faker.date.future(),\n\t\t assignT... | [
"0.59391814",
"0.5842482",
"0.57943106",
"0.5746953",
"0.565198",
"0.562211",
"0.55982524",
"0.54855317",
"0.54641503",
"0.54577965",
"0.54357076",
"0.541078",
"0.534081",
"0.5285389",
"0.5280841",
"0.52334225",
"0.5144247",
"0.51438296",
"0.51078004",
"0.50834584",
"0.506386... | 0.68385476 | 0 |
Sub Goal: General Download Dispatcher | function GoalDownloadDispatcher(header, params) {
Goal.call(this, header, params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DownloadQueue() {}",
"function startDownload(){\n\n}",
"function fastDownload( ){\n return function(info, tab) {\n\tpre_notif();\n\tvar url = info['srcUrl'];\n\tvar file = url.split(/\\?/)[0];\n\tvar filename = file.split(/\\//);\n\tdo_download( url, filename[filename.length -1] );\n };\n}",
"func... | [
"0.6863066",
"0.67174554",
"0.6684191",
"0.6506078",
"0.643349",
"0.6365155",
"0.62995994",
"0.62855124",
"0.6267512",
"0.6181734",
"0.61798817",
"0.6153378",
"0.61387044",
"0.6061227",
"0.60483325",
"0.6008045",
"0.59772617",
"0.59772617",
"0.59772617",
"0.59654665",
"0.5963... | 0.68655944 | 0 |
============================================================================== GoalFactory, generate goals according to header and params. | function GoalFactory() {
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Goal(header, params) {\n this.header = header;\n this.params = params;\n\n this.deferred = new Deferred();\n this.promise = this.deferred.promise;\n}",
"function ScenarioStepFactory(step,ctx) {\n this.isAction = () => step.action !== undefined\n this.isConsumedMessage = () => (step.message... | [
"0.6458209",
"0.56850463",
"0.5120562",
"0.5107095",
"0.5059739",
"0.50545096",
"0.49481416",
"0.4945847",
"0.49398127",
"0.49398127",
"0.49175188",
"0.4914875",
"0.4904783",
"0.48524722",
"0.47940412",
"0.47782797",
"0.4773378",
"0.47274446",
"0.46983576",
"0.46983576",
"0.4... | 0.7149611 | 0 |
Task You will receive an array as parameter that contains 1 or more integers and a number n. Here is a little visualization of the process: Step 1: Split the array in two: [1, 2, 5, 7, 2, 3, 5, 7, 8] / \ [1, 2, 5, 7] [2, 3, 5, 7, 8] Step 2: Put the arrays on top of each other: [1, 2, 5, 7] [2, 3, 5, 7, 8] Step 3: Add t... | function splitAndAdd(arr, n) {
let newArr = [];
let splitPoint = Math.floor(arr.length / 2);
let arrOne = arr.slice(0, splitPoint);
let arrTwo = arr.slice(splitPoint);
for (let i = 0; i < n; i++) {
if (arrTwo.length > arrOne.length) {
arrOne.unshift(0);
}
for (let... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function splitAndAdd(arr, n) {\n\n while(n > 0){\n let firstHalfLength = Math.floor(arr.length / 2);\n let secondHalfLength = arr.length - firstHalfLength;\n let temp1 = arr.splice(0,firstHalfLength);\n let temp2 = arr.splice(0,secondHalfLength);\n let temp3 = [];\n \n if(temp1.length < temp2... | [
"0.74474686",
"0.73848796",
"0.71837604",
"0.6839436",
"0.6749931",
"0.6656895",
"0.6649245",
"0.6640314",
"0.65801",
"0.6544068",
"0.6451625",
"0.6451625",
"0.6443697",
"0.6419487",
"0.6374998",
"0.63684833",
"0.6341563",
"0.6333702",
"0.63162714",
"0.6252339",
"0.62427515",... | 0.75467634 | 0 |
if i is less than dbRelationship.length, continue the function | function pushToFriendsList(){
if (i < dbRelationship.length) {
// console.log("running length");
// we want to capture the user that isn't the one querying the list
if (dbRelationship[i].userOneId._id == req.user._id) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findRelationship(inserts) {\n var sql = \"SELECT genre_name FROM Genres_Games \"\n + \" JOIN Genres ON Genres_Games.genre_ID = Genres.genre_ID \"\n + \" WHERE Genres_Games.genre_ID = ? AND game_ID = ?\";\n console.log(datetime, \"/addGame\", sql, inserts... | [
"0.57808733",
"0.5511702",
"0.5494449",
"0.52573043",
"0.5234485",
"0.5212259",
"0.51973903",
"0.5196107",
"0.513065",
"0.49976456",
"0.49964333",
"0.4983539",
"0.4982609",
"0.49645373",
"0.49623847",
"0.4915075",
"0.49108964",
"0.48862815",
"0.4856159",
"0.48527107",
"0.4845... | 0.63994515 | 0 |
returns a viable path, where cost is bound by the number of turns note that it tries to compute the path greedily, so it doesn't always return the most efficient path: checks which direction is the goal block try to move towards that direction in a straight line until it a) reaches it or b) is on the same plane as it c... | function findPath(current, goal, grid, path, turns) {
// console.log("current path: " + path);
var stepsDown = goal[0] - current[0]; // delta row
var stepsRight = goal[1] - current[1]; // delta column
// var dirLeftRight = Math.abs(stepsLeft) > Math.abs(stepsDown); // Gives a good direction of whe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_calculatePath() {\n\t\tlet startNode = { x: this.gridX, y: this.gridY };\n\t\tlet goalNode = { x: window.uncover.player.gridX, y: window.uncover.player.gridY };\n\t\tstartNode.g = 0;\n\t\tstartNode.f = Math.pow(startNode.x - goalNode.x, 2) + Math.pow(startNode.y - goalNode.y, 2);\n\n\t\tlet openList = [startNode]... | [
"0.695999",
"0.68973964",
"0.67073625",
"0.6663872",
"0.65436053",
"0.6512539",
"0.6499999",
"0.64943457",
"0.64200187",
"0.64158183",
"0.64002734",
"0.6380161",
"0.6374152",
"0.6312698",
"0.62668824",
"0.6244637",
"0.6228986",
"0.61936325",
"0.61781085",
"0.6069455",
"0.6038... | 0.7044421 | 0 |
Add new patient into JSON | addPatient(){
var pname = readline.question('\nEnter patient name : ');
var pmobile = readline.questionInt('Enter Mobile number : ');
var page = readline.questionInt('Enter patient age : ');
var patient = {
"PName" : pname,
"PMobile" : pmobile,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addData(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Patients.insert(data);\n}",
"function createPatient() {\n const patient = {\n name: document.getElementById('name').value,\n sex: document.getElementById('sex').value,\n gender: document.getElementById('... | [
"0.6682599",
"0.65474343",
"0.64185655",
"0.6356141",
"0.63522136",
"0.63040847",
"0.6142754",
"0.61130875",
"0.5915497",
"0.58347094",
"0.5831864",
"0.57797563",
"0.576129",
"0.5755221",
"0.57359517",
"0.565756",
"0.56125987",
"0.56043696",
"0.5596188",
"0.5584425",
"0.55722... | 0.7728417 | 0 |
Add new doctor into JSON | addDoc(){
let dname = readline.question('\nEnter Doctor name : ');
let specialization = readline.question('Enter patient Speciality : ');
let availability = readline.question('Enter availability Type "AM", "PM" or "Both : ');
var doctor = {
"DoctorName" ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static async postNewDoctor(req,res){\n \n try {\n const doctor = new Collections.Doctor(req.body) \n const result = await doctor.save()\n res.send(result)\n } catch(ex){\n res.status(505).send(ex.message)\n }\n \n }",
"function cre... | [
"0.6111975",
"0.6046596",
"0.5920822",
"0.59111494",
"0.5795241",
"0.5783809",
"0.5749125",
"0.56692225",
"0.5638873",
"0.5611696",
"0.55858684",
"0.5510588",
"0.5507889",
"0.547471",
"0.54192805",
"0.53917503",
"0.5308888",
"0.5295726",
"0.5281028",
"0.5188168",
"0.51719004"... | 0.66281044 | 0 |
fetch the protocol according to 'protocol' and 'local' | async _fetchProtocol(options) {
// if a protocol has been provided then use it
if (this.protocol) {
return this.protocol;
}
// otherwise user either the local or the remote version
else {
options.local = this.local;
return await devtools.Protoc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getProtocol(){\n\t\treturn this.protocol;\n\t}",
"getProtocol() {\n return super.getAsString(\"protocol\");\n }",
"function getprotocol(msg){\n client.getprotocol(msg);\n }",
"get protocol()\t{ return this.match[3] || \"\" }",
"get_protocol()\n {\n return this.liveFun... | [
"0.6926557",
"0.67923397",
"0.6626297",
"0.65391517",
"0.64498335",
"0.64351577",
"0.63453096",
"0.63302636",
"0.6247369",
"0.6238667",
"0.6168163",
"0.6168163",
"0.60973257",
"0.5971689",
"0.59238017",
"0.5848094",
"0.57854617",
"0.5720343",
"0.5700435",
"0.5653929",
"0.5646... | 0.74807674 | 0 |
PBWindowAnimationPlaceholder The window wherer animation frames are edited. | function PBWindowAnimationPlaceholder() {
this.initialize.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initialFrame() {\n\t\t$(\"text-area\").value = ANIMATIONS[$(\"animation-dropbox\").value];\n\t}",
"function modalAnimation() {}",
"function replaceTimelinePlaceholder(target) {\n target.style.animation = 'popwidth 0.2s'\n target.style.transition = '0.5s'\n target.style.left = '0'\n target.style.to... | [
"0.6286793",
"0.608641",
"0.59974885",
"0.5880589",
"0.5705842",
"0.5673312",
"0.5584053",
"0.5508292",
"0.5508292",
"0.54584366",
"0.54112715",
"0.5409036",
"0.5405477",
"0.53930795",
"0.5341371",
"0.53397477",
"0.5324364",
"0.5256209",
"0.5155192",
"0.5135788",
"0.5123072",... | 0.79312986 | 0 |
PBWindowAnimationDisplayText The window wherer animation frames are edited. | function PBWindowAnimationDisplayText() {
this.initialize.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function animatingText(){\t\n\t\tthis.isAnimating;\n\t\tthis.dom;\n\t}",
"function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}",
"function animate() {\n\t\tvar output = document.ge... | [
"0.6337011",
"0.62856805",
"0.6212578",
"0.61237043",
"0.6115168",
"0.6115168",
"0.6107578",
"0.6086466",
"0.6074426",
"0.6054621",
"0.6023153",
"0.6009401",
"0.6006709",
"0.59360033",
"0.5933272",
"0.5922076",
"0.5874944",
"0.5869532",
"0.58530235",
"0.5852348",
"0.5790157",... | 0.7704693 | 0 |
PBWindowAnimationFrameControl The window with animation frame related controls | function PBWindowAnimationFrameControl() {
this.initialize.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function PBWindowAnimationCanvas() {\n this.initialize.apply(this, arguments);\n}",
"animate() {\n if (!window.actionDrivenRender)\n this.render();\n //aktualisiert die Camera\n //this.controls.update();\n //Zeichnet das Bild zum naechsten Visualisierungszeitpunkt (reque... | [
"0.6447952",
"0.634239",
"0.6313763",
"0.62601185",
"0.6248796",
"0.62448704",
"0.6057761",
"0.6026455",
"0.5978117",
"0.5955997",
"0.5917487",
"0.58944523",
"0.58766246",
"0.5867009",
"0.5867009",
"0.58449614",
"0.5821491",
"0.58145505",
"0.58106256",
"0.57863307",
"0.578519... | 0.8458758 | 0 |
PBWindowAnimationCommand The window with animation frame related controls | function PBWindowAnimationCommand() {
this.initialize.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function modalAnimation() {}",
"function PBWindowAnimationPlaceholder() {\n this.initialize.apply(this, arguments);\n}",
"function PBWindowAnimationCanvas() {\n this.initialize.apply(this, arguments);\n}",
"putAnimationBoxes() {\n let cf = this.working_model.frames[this.current_frame];\n\n ... | [
"0.6609947",
"0.6495049",
"0.6432782",
"0.63581234",
"0.63050115",
"0.6066731",
"0.60647076",
"0.6025673",
"0.59975016",
"0.58485806",
"0.5830869",
"0.57904977",
"0.5779897",
"0.57573205",
"0.57538337",
"0.573083",
"0.5685999",
"0.5651313",
"0.5646326",
"0.56284237",
"0.55831... | 0.79276085 | 0 |
PBWindowAnimationCanvas The window wherer animation frames are edited. | function PBWindowAnimationCanvas() {
this.initialize.apply(this, arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupAnimation(){\n\t// create canvas\n\tvar ctx = animation.persist.ctx = lib.canvas.create('canvas1');\n\n\twindow.requestAnimationFrame(animation.draw);\n}",
"putAnimationBoxes() {\n let cf = this.working_model.frames[this.current_frame];\n\n this.animation_display.selection = {\n ... | [
"0.6206736",
"0.6082375",
"0.5967065",
"0.574769",
"0.57340074",
"0.57240534",
"0.571215",
"0.56934583",
"0.56849927",
"0.56724817",
"0.5665379",
"0.56644857",
"0.5577904",
"0.55513215",
"0.5547703",
"0.5547598",
"0.55438656",
"0.55385494",
"0.5533451",
"0.5510619",
"0.549643... | 0.7102701 | 0 |
Returns Android device version. For example, 234 for the following UserAgent : /Mozilla/5.0 (Linux; U; Android 2.3.4; jajp; HTC Desire Build/GRJ22) AppleWebKit/533.1 (KHTML, like Gecko) //Version/4.0 Mobile Safari/533.1 | function getDeviceOSVersion(){
var userAgent = navigator.userAgent.toLowerCase();
var androidPattern = extractAndroidPattern(userAgent);
var version = extractVersion(androidPattern);
var os_version_length = 3;
version = padWithZero(version, os_version_length);
return version;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOsVersion()\n{\n var agent = window.navigator.userAgent,\n start = agent.indexOf( 'OS ' );\n var r = 0;\n \n if ( /iphone|ipod|ipad|iPhone|iPod|iPad/.test( agent ) && start > -1 )\n r = window.Number( agent.substr( start + 3, 3 ).replace( '_', '.' ) );\n \n return r;\n}"... | [
"0.6896565",
"0.68056214",
"0.6635666",
"0.6609375",
"0.6605071",
"0.658047",
"0.6563574",
"0.65624017",
"0.6476784",
"0.6420353",
"0.64188343",
"0.63980645",
"0.63770264",
"0.63768756",
"0.63625425",
"0.63479364",
"0.63353986",
"0.6242055",
"0.60834885",
"0.6048105",
"0.5981... | 0.8168843 | 0 |
The panel that contains the upload form for the user to upload multiple files. | function UploadPanel(params) {
if(params) {
this.init(params);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function panelUpload(){\n\t\n\tif ($('#modal-upload').css('display') == 'none') {\n\t\tmodalShowUpload();\n\t} else {\n\t\tmodalHideUpload();\n\t}\n\t/*if(panelView != 'upload'){\n\t\t$('#action .controls').css('display', 'none');\n\t\tpanelShow(150, 'upload');\n\t\t$('#panelFrame').attr('src', 'helper/upload?f='+... | [
"0.6677065",
"0.62272346",
"0.6224548",
"0.6116136",
"0.6109873",
"0.61024624",
"0.60857296",
"0.6024195",
"0.5947333",
"0.5922268",
"0.5913542",
"0.58724797",
"0.5850785",
"0.58257014",
"0.5783839",
"0.5756818",
"0.5737714",
"0.5729726",
"0.57263654",
"0.57242006",
"0.571719... | 0.6492955 | 1 |
Determine the type of a character in a keypath. | function getPathCharType(ch) {
if (ch === undefined || ch === null) {
return 'eof';
}
var code = ch.charCodeAt(0);
switch (code) {
case 0x5B: // [
case 0x5D: // ]
case 0x2E: // .
case 0x22: // "
case 0x27: // '
case 0x30:
// 0
return ch;
case 0x5F: // _
c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPathCharType (ch) {\n if (ch === undefined || ch === null) { return 'eof' }\n\n var code = ch.charCodeAt(0);\n\n switch (code) {\n case 0x5B: // [\n case 0x5D: // ]\n case 0x2E: // .\n case 0x22: // \"\n case 0x27: // '\n case 0x30: // 0\n return ch\n\n case 0x5F: // _\n ... | [
"0.6553067",
"0.6553067",
"0.6553067",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6530318",
"0.6520842",
"0.6520842",
"0.6520842",
"0.6509395",
"0.64543176",
"0.5893024",
"0.5843903",
"0.5683862",
... | 0.6661384 | 0 |
Load Featured Story Slider. | function loadFeaturedStorySlider() {
var homeStories = document.querySelector('.home-features-stories-cont');
if (homeStories !== null) {
var featuredStoriesLoaded = false;
var featuredStoryCheck = setInterval(function () {
if (featuredStoriesLoaded === false) {
var featuredStoryContainer = do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadSmallSlider() {\n\tpmmViewer.firstSlider.stopAuto();\n\tpmmViewer.firstSlider.reloadSlider({\n\t \tautoControls: false, \n auto: false, \n slideWidth: 0, \n minSlides: 1, \n maxSlides: 1, ... | [
"0.6888995",
"0.6422808",
"0.612873",
"0.59124357",
"0.58204114",
"0.5779397",
"0.5736085",
"0.5709929",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56947494",
"0.56871575",
"0.56747043",
"0.5662796",
"0.5... | 0.80549383 | 0 |
The search suggestions functionality in SharePoint 2013 is provided by ajaxtoolkit.js. In order to extend the existing functionality I had to override the _update function of the AjaxControlToolkit.AutoCompleteBehavior.prototype which is responsible for the search as you type functionality of the search box. | function searchOverride() {
/**
* Keep a copy of the original function
*/
AjaxControlToolkit.AutoCompleteBehavior.prototype._update2 = AjaxControlToolkit.AutoCompleteBehavior.prototype._update;
/**
* Highlight Search Term.
*
* @param {string} picUrl
* Picture URL used for au... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function autosearch(event, asObj) {\r\n var input = $(event.target).val();\r\n var suggList = asObj.children().filter(\".suggestion-list\");\r\n\r\n // If the text-box has no characters, hide the suggestion list.\r\n if (input.length == 0) {\r\n suggList.css(\"display\", \"none\");\r\n... | [
"0.7324965",
"0.69693303",
"0.68663657",
"0.6670588",
"0.66098166",
"0.65792346",
"0.65463513",
"0.65325385",
"0.6511869",
"0.6457301",
"0.64493173",
"0.64326215",
"0.64304954",
"0.6414513",
"0.63793814",
"0.6363215",
"0.6333499",
"0.63235736",
"0.6311863",
"0.6285365",
"0.62... | 0.80513537 | 0 |
Check Org Chart Zone. | function checkOrgChartZone() {
var _this = this;
$('.org-char-cont .ms-hide').each(function () {
if ($(_this).parents().eq(4).hasClass('org-char-cont') || $(_this).parents().eq(5).hasClass('org-char-cont')) {
$(_this).parent().hide();
}
});
if ($('.org-char-cont').children().childr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkChartConsoleFields() {\n\tvar console = View.panels.get('allocGroupConsole');\n\tvar date_start = console.getFieldValue('gp.date_start');\n\tvar date_end = console.getFieldValue('gp.date_end');\n\tvar portfolio_scenario_id = console.getFieldValue('gp.portfolio_scenario_id');\n\n\tif (date_start == \"... | [
"0.5584116",
"0.544664",
"0.5333742",
"0.5276486",
"0.5147062",
"0.50852615",
"0.5070613",
"0.5002961",
"0.49984324",
"0.49895057",
"0.49742225",
"0.49621016",
"0.4923208",
"0.491715",
"0.48976403",
"0.48608223",
"0.48589313",
"0.48558563",
"0.4814571",
"0.47905883",
"0.47836... | 0.7558452 | 0 |
Check Content Types. Iterate through all of the different webpart content types and check to see if the number of hidden web parts is the same as the number of webparts for that particular zone. If so, then hide the whole zone. | function checkContentTypes() {
var _this2 = this;
var contentTypes = ['.how-do-i', '.referrals', '.featured-application', '.management-team-cont', '.notices-cont'];
var _loop = function _loop(i) {
if ($(contentTypes[i] + ' .ms-hide').length >= 1 || $(contentTypes[i]).children().children().children()... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isHidden() {\n return !(\n isPageProviderDisplayBehavior(this.documents) ||\n (this.documents &&\n this.documents.length > 0 &&\n this.documents.every((doc) => !this.hasFacet(doc, 'NotCollectionMember')))\n );\n }",
"function hideUnusedElements() {\n if (document.getElementsBy... | [
"0.56670845",
"0.56443137",
"0.5529109",
"0.55054593",
"0.54848796",
"0.5354343",
"0.5294281",
"0.52598935",
"0.5200438",
"0.5195597",
"0.51785696",
"0.516988",
"0.5153352",
"0.5149652",
"0.5144918",
"0.5141113",
"0.5101667",
"0.50940996",
"0.5089378",
"0.5087987",
"0.5082915... | 0.7474259 | 0 |
Adjust Article Image Block. | function adjustArticleImageBlock() {
var articleImage = document.querySelector('.article-block .article-img-block img');
var articleImageBlock = document.querySelector('.article-block .article-img-block');
var articleDate = document.getElementById('dvPublishDate');
if (articleImage === null && articleI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_artwork(img) {\n var container = $(img).parent();\n\n if ($(img).width() > container.width()){\n // Reduce image\n $(img).css({\n 'height': function() { return (container.width() / $(img).width()) * $(img).height(); },\n 'top': function() { return (container.height() - $(this).height... | [
"0.626094",
"0.6183904",
"0.61039364",
"0.60066575",
"0.591719",
"0.58827406",
"0.5881071",
"0.58453363",
"0.5779427",
"0.57715964",
"0.57531697",
"0.5740094",
"0.5686726",
"0.56489044",
"0.563868",
"0.56211805",
"0.55710965",
"0.5570365",
"0.55623573",
"0.5554478",
"0.553862... | 0.73679024 | 0 |
Update More Search Text. | function updateMoreSearchText() {
if ($('ms-srch-group-link a') !== null) {
$('.ms-srch-group-link a').text('Show All People Results');
$('.ms-srch-group-link a').attr('title', 'Show All People Results...');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateSearchText(searchText){\n $(selector.searchBox).val(searchText);\n }",
"updateNLPInfo(newText) {\n this.spinRefresh(true);\n var oldText = this.state.query.text;\n\n this.props.updateQuery(\n this.state.query.id,\n oldText,\n newText,\n (updatedQuery)... | [
"0.66668576",
"0.6474631",
"0.63669854",
"0.62599987",
"0.6210404",
"0.6084758",
"0.6053367",
"0.60473424",
"0.6033301",
"0.5934851",
"0.5919856",
"0.58526653",
"0.5836699",
"0.5807887",
"0.58002627",
"0.5795332",
"0.5785681",
"0.5771002",
"0.575382",
"0.5723445",
"0.57205576... | 0.7442403 | 0 |
Initialize Content. Used to rearrange and adjust templates as needed as well as set up miscellanious event listenrs used throughout the site. | function initContent() {
var msHide = document.querySelectorAll('.ms-hide');
/**
* Place the Yellow ribbon after the header.
*/
$('#s4-workspace').prepend($('#DeltaPageStatusBar'));
if (msHide.length > 0) {
/**
* Hide all right section web parts that are marked as "hidden".
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initialize(){\n replaceContent(baseContent, homeContainer);\n}",
"init() {\n this.tags = this.getSectionTagsOnThePage();\n\n /**\n * Check if no tags found then table of content is not needed\n */\n if (this.tags.length === 0) {\n return;\n }\n\n /**\n * Initialize tab... | [
"0.73352826",
"0.71798897",
"0.7016394",
"0.69044703",
"0.68750995",
"0.68548274",
"0.6803062",
"0.6759707",
"0.6685084",
"0.66498935",
"0.6649154",
"0.66207135",
"0.65887266",
"0.65836036",
"0.6582813",
"0.65578306",
"0.6541104",
"0.6537578",
"0.64734006",
"0.6433485",
"0.64... | 0.7183169 | 1 |
Build NonEmergency Phone Markup | function buildPhoneMarkup(phoneData) {
var phoneMarkup = '';
var telLink = null;
if (typeof phoneData !== 'undefined') {
if (phoneData.length > 1) {
for (var i = 0; i < phoneData.length; i++) {
if (typeof phoneData[i].phone !== 'undefined' && typeof phoneData[i].name !== 'undefined')... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DeviceWrangler() {\t\r\n\t//TODO better method than User-Agent. Mainly we're interested\r\n\t//in diagonal length in landscape mode (and thus readability)\r\n\t//and screen size in portrait mode (and thus elimination of margins)\r\n\tthis._isPhone = (/Android|webOS|iPhone|iPod|BlackBerry|IEMobile|Opera Mi... | [
"0.57542276",
"0.56926507",
"0.5581735",
"0.5562234",
"0.550468",
"0.5400514",
"0.53675044",
"0.5362587",
"0.53527725",
"0.53502953",
"0.5343781",
"0.5275025",
"0.5273459",
"0.5264217",
"0.52593386",
"0.525377",
"0.5243558",
"0.5217664",
"0.5201086",
"0.51684606",
"0.51636267... | 0.6735002 | 0 |
Check Current Location Time. | function checkCurrentLocationTime() {
currentLocation = $('#dvWeather > .left-side > .location').text().trim();
if (currentLocation !== previousLocation) {
time = $('#dvWeather > .left-side > .timing > #lblTime').text().trim();
hour = parseInt(time.substring(0, 2), 10);
min = parseInt(time.sub... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checktime(){\n\t\t\t\tvar currentDate=new Date().getHours();\n\t\t\t\tif(currentDate > 19){\n\t\t\t\t\t$scope.TodaylaterReminder=false;\n\t\t\t\t}\n\t\t\t\tif(currentDate > 1){\n\t\t\t\t\t$scope.TodaylaterReminder=true;\n\t\t\t\t}\n\t\t\t}",
"function watchCurrentPosition() {\n var positionTimer = na... | [
"0.65379274",
"0.6110605",
"0.5996945",
"0.5994971",
"0.5963233",
"0.5879537",
"0.58712345",
"0.58392924",
"0.5823723",
"0.5795575",
"0.5755166",
"0.5750719",
"0.5737904",
"0.5733677",
"0.5731506",
"0.57228667",
"0.5709482",
"0.5706988",
"0.57048696",
"0.57036185",
"0.5692652... | 0.8284103 | 0 |
Remove Unnecessary Scroll Windows. | function removeUnnecessaryScrollWindows() {
if ($('.home-features-stories-cont .custom-scroll').length > 0) {
$('.home-features-stories-cont .custom-scroll').removeClass('custom-scroll');
}
if ($('.todays-varian-item.referrals.auto-section .custom-scroll').length > 0) {
$('.todays-varian-item.r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function disarmWindowScroller() {\n window.removeEventListener('mousemove', updateMousePosition);\n window.removeEventListener('touchmove', updateMousePosition);\n mousePosition = undefined;\n window.clearTimeout(next$1);\n resetScrolling$1();\n }",
"function disarmWindowScroller() {\n console.d... | [
"0.75056744",
"0.73339605",
"0.6589942",
"0.6537108",
"0.64206296",
"0.638577",
"0.6344059",
"0.630706",
"0.6306384",
"0.6289898",
"0.62469774",
"0.62413853",
"0.6200996",
"0.6147725",
"0.61460286",
"0.6141442",
"0.61357355",
"0.61242425",
"0.61137104",
"0.61104536",
"0.61072... | 0.8083257 | 0 |
Get the metamodel which defines valid states for this model. | getMetamodel() {
return Common.assertInstanceOf(this.metamodel, Metamodel);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"model() {\n return internal(this).model;\n }",
"function getState() {\n return window.stokr.model.getState();\n }",
"static async getDefaultModelsByKey () {\n\t\treturn new WorkflowManager({}).getDefaultModelsByKey();\n\t}",
"static async getDefaultModels () {\n\t\treturn new WorkflowManager(... | [
"0.5526273",
"0.5176831",
"0.5163878",
"0.50935316",
"0.5090694",
"0.4856712",
"0.4843416",
"0.4841572",
"0.48165527",
"0.47495708",
"0.47495708",
"0.46952724",
"0.46952724",
"0.46952724",
"0.46788067",
"0.4663013",
"0.46617505",
"0.46355",
"0.46032894",
"0.46011943",
"0.4592... | 0.60155946 | 0 |
Find lifeline by its ID. | getLifelineById(id) {
for (const lifeline of this.model.diagram.lifelines) {
if (lifeline.id === id) {
return lifeline;
}
}
return undefined;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"search(id) {\n let currentNode = this.head;\n\n while (currentNode) {\n if(currentNode.data.id == id) {\n return currentNode;\n }\n currentNode = currentNode.next\n }\n\n return null;\n }",
"function laserById (id) {\n var i\n for (... | [
"0.60428166",
"0.5984401",
"0.59570885",
"0.5868509",
"0.55995405",
"0.5581598",
"0.55047196",
"0.548342",
"0.54521513",
"0.54489756",
"0.54409295",
"0.5428278",
"0.53929436",
"0.53924817",
"0.53894496",
"0.53670144",
"0.5355767",
"0.5349935",
"0.5325589",
"0.5321938",
"0.532... | 0.78882426 | 0 |
Get step by message ID. | getStepByMessageId(id) {
Common.assertNotNull(id);
for (const step of this.model.diagram.steps) {
if (step.message && step.message.id === id) {
return step;
}
}
return undefined;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMessageById(id) {\n Common.assertNotNull(id);\n const step = this.getStepByMessageId(id);\n if (step) {\n return step.message;\n }\n return undefined;\n }",
"getStep(id) {\n return this.canvas.flow.steps.find(child => child.id == id);\n }",
... | [
"0.7474961",
"0.6855314",
"0.6241044",
"0.6218783",
"0.6015508",
"0.5899887",
"0.5881746",
"0.58801055",
"0.5834707",
"0.581261",
"0.57962704",
"0.57923925",
"0.5663481",
"0.5444255",
"0.52829844",
"0.5201676",
"0.51788",
"0.5171736",
"0.5146318",
"0.5103172",
"0.50831914",
... | 0.8697383 | 0 |
Delete lifeline with ID. | deleteLifelineById(id) {
Common.assertNotNull(id);
this.deleteStepsByLifelineId(id);
const lifeline = this.getLifelineById(id);
if (lifeline) {
const index = this.model.diagram.lifelines.indexOf(lifeline);
if (index !== -1) {
this.model.diagram.lif... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteStepsByLifelineId(id) {\n Common.assertNotNull(id);\n const steps = this.getStepsByLifelineId(id);\n for (const step of steps) {\n this.deleteMessageById(step.message.id);\n }\n this.renumber();\n }",
"function DeleteLine(deletedLineID) {\n var id = '#' +... | [
"0.6976164",
"0.67984766",
"0.66120696",
"0.65293074",
"0.65239596",
"0.64366305",
"0.6428895",
"0.6310925",
"0.630552",
"0.6240976",
"0.61990374",
"0.61521053",
"0.61286825",
"0.6125356",
"0.6125356",
"0.6124063",
"0.608762",
"0.608129",
"0.6057634",
"0.6051988",
"0.6046221"... | 0.840209 | 0 |
Delete all steps corresponding to lifeline. | deleteStepsByLifelineId(id) {
Common.assertNotNull(id);
const steps = this.getStepsByLifelineId(id);
for (const step of steps) {
this.deleteMessageById(step.message.id);
}
this.renumber();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteLifelineById(id) {\n Common.assertNotNull(id);\n this.deleteStepsByLifelineId(id);\n const lifeline = this.getLifelineById(id);\n if (lifeline) {\n const index = this.model.diagram.lifelines.indexOf(lifeline);\n if (index !== -1) {\n this.model... | [
"0.6981755",
"0.5975611",
"0.5662497",
"0.5662497",
"0.5530245",
"0.54460704",
"0.5379715",
"0.53645295",
"0.5311493",
"0.5309273",
"0.5307029",
"0.5289462",
"0.5288758",
"0.5269246",
"0.5262324",
"0.52210003",
"0.52210003",
"0.52142197",
"0.5194241",
"0.5194241",
"0.51903546... | 0.70973617 | 0 |
Get all steps corresponding to lifeline. | getStepsByLifelineId(id) {
Common.assertNotNull(id);
const steps = [];
for (const step of this.model.diagram.steps) {
if (step.message) {
if (step.message.from === id || step.message.to === id) {
steps.push(step);
}
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getLifelineById(id) {\n for (const lifeline of this.model.diagram.lifelines) {\n if (lifeline.id === id) {\n return lifeline;\n }\n }\n return undefined;\n }",
"function allSteps() {\n\t\treturn stepNodes.map(({ order, title }) => ({ order, title }));\... | [
"0.57878214",
"0.556366",
"0.54611623",
"0.54025114",
"0.53864384",
"0.5360367",
"0.5299059",
"0.5299059",
"0.5299059",
"0.5299059",
"0.5299059",
"0.52000254",
"0.5174959",
"0.49710062",
"0.4916346",
"0.49024758",
"0.48154414",
"0.47938323",
"0.4778313",
"0.4765057",
"0.47650... | 0.6310107 | 0 |
Renumber lifelines and messages. | renumber() {
const modelJSON = this.unwrap();
let stepIndex = 1;
let lifelineIndex = 1;
for (const step of modelJSON.diagram.steps) {
if (step.message) {
step.message.index = stepIndex++;
}
}
for (const lifeline of modelJSON.diagram... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setRowNumber() {\n $self.find('td.js-row-no').each(function (i) {\n i = i + 1;\n $(this).text(i);\n });\n }",
"refreshUnreadMessageNumber() {\n this.getApi().post('message/unread-number/', {\n infos: this.getJwtValues(),\n tok... | [
"0.5623663",
"0.5572725",
"0.54411095",
"0.5259217",
"0.5238956",
"0.5232858",
"0.52185625",
"0.5116354",
"0.51145035",
"0.51145035",
"0.5112075",
"0.50906354",
"0.50637484",
"0.50450283",
"0.5042243",
"0.5015624",
"0.50006837",
"0.49937233",
"0.4990814",
"0.49510095",
"0.493... | 0.6707607 | 0 |
/////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// Preprocess model, adding IDs and whatnot. | _preprocess(original) {
const json = _merge({}, this.templates.defaultModel, original);
const metamodel = this.metamodel.unwrap();
if (!json.diagram.metadata.ref) {
if (metamodel.diagram.metadata.id) {
json.diagram.metadata.ref = metamodel.diagram.metadata.id;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_applyModelId(value, old) {\n if (value) {\n this.getStateManager().setState(\"modelId\", value);\n } else {\n this.getStateManager().removeState(\"modelId\");\n }\n }",
"apply(presetModels) {\n return __awaiter(this, void 0, void 0, function* () {\n // Add or up... | [
"0.5952207",
"0.57333654",
"0.5665809",
"0.5538615",
"0.54707444",
"0.5470473",
"0.5462117",
"0.5451816",
"0.544921",
"0.54429495",
"0.54403716",
"0.54403716",
"0.54247",
"0.5420811",
"0.5282036",
"0.5251065",
"0.5249487",
"0.52436817",
"0.52428",
"0.52223426",
"0.5209574",
... | 0.6293526 | 0 |
Getter for the ratings property | get get_ratings () {
return this._ratings;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getRatings() {\n // console.log(\"getRatings()\");\n return store.get('CURRENT_RATINGS');\n }",
"get rating() {\n if (this.unformatted_rating === null) {\n return \"Not Rated Yet!\"\n }\n return this.unformatted_rating\n }",
"getAverageRating() {\n return this._ratings... | [
"0.76561946",
"0.75434196",
"0.7132508",
"0.68751395",
"0.68495846",
"0.67604095",
"0.6689602",
"0.66157293",
"0.6564392",
"0.64724606",
"0.6419094",
"0.6400024",
"0.63563406",
"0.6353247",
"0.633528",
"0.6318532",
"0.62389064",
"0.62307155",
"0.62114316",
"0.61846226",
"0.61... | 0.8857166 | 0 |
FeedHenry 'middleware'. This handles the following: logging of fhact messages fhstats timings secure endpoints | function fhmiddleware() {
var fh = fhMbaasApi.getFhApi();
return function(req, res, next) {
var requestTime = new Date().getTime();
// TODO - need to dig into analytics here and find out what exactly funct should be,
// and possibly replace funct with url in analytics
var funct = req.url;
// N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function logger(req, res, next) {\n\n}",
"function log(req,res,next){\n\n // console.log('hello osho middleware function is running');\n next();// next function helps to change in req,res cycle\n}",
"function middleware(req, res, next) {\n if (req.url === '/log') {\n var level = req.body.level,\n ... | [
"0.6235886",
"0.6150586",
"0.6123464",
"0.6116577",
"0.61108613",
"0.61099774",
"0.60811496",
"0.60145205",
"0.59988576",
"0.5990239",
"0.58820695",
"0.5827372",
"0.5771987",
"0.5735724",
"0.5730263",
"0.57089263",
"0.5693196",
"0.56636393",
"0.56573844",
"0.5618531",
"0.5605... | 0.7419614 | 0 |
Manually performs linear filtering if the extension OES_texture_float_linear is not supported | function textureLinear(defines) {
return `
vec4 textureLinear(sampler2D map, vec2 uv) {
#ifdef OES_texture_float_linear
return texture(map, uv);
#else
vec2 size = vec2(textureSize(map, 0));
vec2 texelSize = 1.0 / size;
uv = uv * size - 0.5;
vec2 f = fract(uv);
uv = fl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterFallback ( f ) {\r\n\r\n\t\tif ( f === THREE.NearestFilter || f === THREE.NearestMipMapNearestFilter || f === THREE.NearestMipMapLinearFilter ) {\r\n\r\n\t\t\treturn _gl.NEAREST;\r\n\r\n\t\t}\r\n\r\n\t\treturn _gl.LINEAR;\r\n\r\n\t}",
"function filterFallback ( f ) {\r\n\r\n\t\tif ( f === THREE.Ne... | [
"0.6279072",
"0.6279072",
"0.6241282",
"0.62335086",
"0.62335086",
"0.62335086",
"0.62335086",
"0.62335086",
"0.62145185",
"0.6209976",
"0.6151047",
"0.612442",
"0.61057246",
"0.61057246",
"0.60592294",
"0.60516465",
"0.60468334",
"0.60432",
"0.60378325",
"0.60378325",
"0.603... | 0.70375925 | 0 |
Estimate the direct lighting integral using multiple importance sampling | function sampleMaterial(defines) {
return `
vec3 importanceSampleLight(SurfaceInteraction si, vec3 viewDir, bool lastBounce, vec2 random) {
vec3 li;
float lightPdf;
vec2 uv;
vec3 lightDir = sampleEnvmap(random, uv, lightPdf);
float cosThetaL = dot(si.normal, lightDir);
float orientation = dot(si.fac... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lightDiffuse() {\n return lightIntensity.multiply(k_d).multiply(dotLN)\n }",
"function pointLighting(normArray){\r\n var pLitColors = [];\r\n var k = 0;\r\n for (var i=0; i<normArray.length; i++){\r\n var norm = new Vector3([normArray[i].x, normArray[i].y, normArray[i].z]);\r\n ... | [
"0.60560685",
"0.5938989",
"0.5820714",
"0.5783672",
"0.5708228",
"0.5617486",
"0.55654114",
"0.5528044",
"0.5499737",
"0.5445038",
"0.5368634",
"0.53598267",
"0.534001",
"0.5325437",
"0.53239423",
"0.5320334",
"0.53116035",
"0.5270188",
"0.5261219",
"0.52577823",
"0.5246818"... | 0.6310057 | 0 |
Similar to buffergeometry.clone(), except we only copy specific attributes instead of everything | function cloneBufferGeometry(bufferGeometry, attributes) {
const newGeometry = new THREE$1.BufferGeometry();
for (const name of attributes) {
const attrib = bufferGeometry.getAttribute(name);
if (attrib) {
newGeometry.addAttribute(name, attrib.clone());
}
}
const index = buff... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cloneBufferGeometry(bufferGeometry, attributes) {\n var newGeometry = new THREE$1.BufferGeometry();\n\n var _iterator3 = _createForOfIteratorHelper(attributes),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var name = _step3.value;\n va... | [
"0.78675026",
"0.66854763",
"0.6294479",
"0.61324984",
"0.61324984",
"0.61067694",
"0.6082721",
"0.6077101",
"0.6077101",
"0.6077101",
"0.60242695",
"0.6016238",
"0.5962351",
"0.5962351",
"0.5958512",
"0.59440565",
"0.5911542",
"0.585612",
"0.584855",
"0.584855",
"0.584855",
... | 0.7949069 | 0 |
Create a piecewise 2D cumulative distribution function of light intensity from an envmap | function envmapDistribution(image) {
const data = image.data;
const cdfImage = {
width: image.width + 2,
height: image.height + 1
};
const cdf = makeTextureArray(cdfImage.width, cdfImage.height, 2);
for (let y = 0; y < image.height; y++) {
const sinTheta = Math.sin(Math.PI * (y ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function envMapDistribution(image) {\n var data = image.data;\n var cdfImage = {\n width: image.width + 2,\n height: image.height + 1\n };\n var cdf = makeTextureArray$1(cdfImage.width, cdfImage.height, 2);\n\n for (var y = 0; y < image.height; y++) {\n var sinTheta = Math.sin(Math.PI... | [
"0.74764216",
"0.6076169",
"0.5143437",
"0.51313215",
"0.49445635",
"0.49191955",
"0.4881171",
"0.48447827",
"0.48138484",
"0.47930703",
"0.47759578",
"0.4755409",
"0.47404188",
"0.46971843",
"0.4627845",
"0.459641",
"0.4574636",
"0.45581946",
"0.45542723",
"0.45371893",
"0.4... | 0.7335514 | 1 |
Convert image data from the RGBE format to a 32bit floating point format See for a description of the RGBE format Optional multiplier argument for performance optimization | function rgbeToFloat(buffer, intensity = 1) {
const texels = buffer.length / 4;
const floatBuffer = new Float32Array(texels * 3);
const expTable = [];
for (let i = 0; i < 255; i++) {
expTable[i] = intensity * Math.pow(2, i - 128) / 255;
}
for (let i = 0; i < texels; i++) {
const r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rgbeToFloat(buffer) {\n var intensity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var texels = buffer.length / 4;\n var floatBuffer = new Float32Array(texels * 3);\n var expTable = [];\n\n for (var i = 0; i < 255; i++) {\n expTable[i] = intensity * Math.p... | [
"0.65700644",
"0.56977946",
"0.5561777",
"0.54301095",
"0.53108686",
"0.5244826",
"0.5244826",
"0.5229854",
"0.5185616",
"0.51706344",
"0.5143714",
"0.5101006",
"0.50968575",
"0.5081223",
"0.50394845",
"0.50362426",
"0.502435",
"0.50170624",
"0.50170624",
"0.50170624",
"0.501... | 0.64425135 | 1 |
Tools for generating and modify env maps for lighting from scene component data | function generateEnvMapFromSceneComponents(directionalLights, environmentLights) {
let envImage = initializeEnvMap(environmentLights);
directionalLights.forEach( light => { envImage.data = addDirectionalLightToEnvMap(light, envImage); });
return envImage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderEnv(){\n for (i = 0; i < worldShapes.length; i++){\n worldShapes[i].render();\n }\n \n let light = new Cube();\n light.color = [1, 1, 0, 1];\n //console.log(g_lightPos[0], g_lightPos[1], g_lightPos[2])\n light.matrix.translate(g_lightPos[0], g_lightPos[1], g_lightPos[2]);\n ... | [
"0.61980283",
"0.61975193",
"0.60030544",
"0.597868",
"0.58283234",
"0.5717207",
"0.5711824",
"0.56674105",
"0.56613195",
"0.56498057",
"0.5623017",
"0.5620108",
"0.56141144",
"0.55998486",
"0.55911636",
"0.5567739",
"0.55659646",
"0.55282396",
"0.552254",
"0.55139965",
"0.55... | 0.74422634 | 0 |
TODO: possibly clean this up and optimize it This function was arrived at through experimentation, it provides good looking results with percieved softness that scale relatively linearly with the softness value in the 0 1 range For now it doesn't incur too much of a performance penalty because for most of our use cases... | function getFalloffAtAngle(angle, softness) {
const softnessCoefficient = Math.pow(2, 14.5 * Math.max(0.001, 1.0 - clamp(softness, 0.0, 1.0)));
const falloff = Math.pow(softnessCoefficient, 1.1) * Math.pow(8, -softnessCoefficient * Math.pow(angle, 1.8));
return falloff;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"softEdgeNormal(r) { // softness is not 0\n\t\tif(r>0.5) {\n\t\t\tlet r1=1-r;\n\t\t\treturn 1-2*r1*r1;\n\t\t}\n\t\treturn 2*r*r;\n\t\t//return r*r; // good for rendering considering convolution, sharp at the center\n\t\t//return r; // a bit faster than quad? but quality is worse\n\t\t//return (1-Math.cos(Math.PI*r)... | [
"0.5698998",
"0.5575688",
"0.5509457",
"0.53150517",
"0.51584584",
"0.5132895",
"0.50653887",
"0.5049291",
"0.50269526",
"0.49898103",
"0.49709007",
"0.4940302",
"0.49383178",
"0.49171323",
"0.49155197",
"0.49110106",
"0.4910178",
"0.4906638",
"0.48925725",
"0.4885507",
"0.48... | 0.56229603 | 1 |
retrieve textures used by meshes, grouping textures from meshes shared by the same mesh property | function getTexturesFromMaterials(meshes, textureNames) {
const textureMap = {};
for (const name of textureNames) {
const textures = [];
textureMap[name] = {
indices: texturesFromMaterials(meshes, name, textures),
textures
};
}
return textureMap;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTexturesFromMaterials(meshes, textureNames) {\n var textureMap = {};\n\n var _iterator = _createForOfIteratorHelper(textureNames),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var name = _step.value;\n var textures = [];\n textur... | [
"0.69022435",
"0.65157473",
"0.6476707",
"0.6455564",
"0.6455311",
"0.6447401",
"0.6399456",
"0.63989913",
"0.6385941",
"0.63706654",
"0.63115513",
"0.6280621",
"0.62263846",
"0.6195689",
"0.6176911",
"0.61611867",
"0.61574733",
"0.61529195",
"0.6142499",
"0.60908806",
"0.601... | 0.6705941 | 1 |
Stratified Sampling Repeatedly sampling random numbers between [0, 1) has the effect of producing numbers that are coincidentally clustered together, instead of being evenly spaced across the domain. This produces low quality results for the path tracer since clustered samples send too many rays in similar directions. ... | function makeStratifiedSampler(strataCount, dimensions) {
const strata = [];
const l = strataCount ** dimensions;
for (let i = 0; i < l; i++) {
strata[i] = i;
}
let index = strata.length;
const sample = [];
function restart() {
index = 0;
}
function next() {
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeStratifiedSampler(strataCount, dimensions) {\n var strata = [];\n var l = Math.pow(strataCount, dimensions);\n\n for (var i = 0; i < l; i++) {\n strata[i] = i;\n }\n\n var index = strata.length;\n var sample = [];\n\n function restart() {\n index = 0;\n }\n\n funct... | [
"0.767738",
"0.5985854",
"0.548736",
"0.5447013",
"0.5410855",
"0.53972816",
"0.53644794",
"0.534396",
"0.52928674",
"0.52893233",
"0.5282977",
"0.52738583",
"0.5269266",
"0.52593786",
"0.5190749",
"0.5172048",
"0.5168352",
"0.5163782",
"0.5146971",
"0.51346767",
"0.51344496"... | 0.7620876 | 1 |
noiseImage is a 32bit PNG image | function setNoise(noiseImage) {
textureAllocator.bind(uniforms.noise, makeTexture(gl, {
data: noiseImage,
minFilter: gl.NEAREST,
magFilter: gl.NEAREST,
storage: 'float'
}));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GenerateNoise()\n{\n if(scale.value != 0 && resX.value != 0 && resY.value != 0 && layers.value != 0)\n {\n //Resize canvas to fit image\n canvas.width = resX.value; \n canvas.height = resY.value; \n\n //Put image into canvas\n ctx = canvas.getContext(\"2d\");\n ... | [
"0.66096044",
"0.640467",
"0.6357144",
"0.6137931",
"0.5825797",
"0.5781215",
"0.57149196",
"0.5695579",
"0.5683839",
"0.56704",
"0.5621816",
"0.54986686",
"0.5479528",
"0.54588795",
"0.54368293",
"0.54368293",
"0.54368293",
"0.54368293",
"0.5429907",
"0.5425084",
"0.54192334... | 0.67206424 | 0 |
TileRender is based on the concept of a compute shader's work group. Sampling the scene with the RayTracingRenderer can be very slow (<1 fps). This overworks the GPU and tends to lock up the OS, making it unresponsive. To fix this, we can split the screen into smaller tiles, and sample the scene one tile at a time The ... | function makeTileRender(gl) {
let currentTile = -1;
let numTiles = 1;
let tileWidth;
let tileHeight;
let columns;
let rows;
let firstTileTime = 0;
let width = 0;
let height = 0;
// initial number of pixels per rendered tile
// based on correlation between system performanc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeTileRender(gl) {\n var desiredMsPerTile = 21;\n var currentTile = -1;\n var numTiles = 1;\n var tileWidth;\n var tileHeight;\n var columns;\n var rows;\n var width = 0;\n var height = 0;\n var totalElapsedMs; // initial number of pixels per rendered tile\n // based on ... | [
"0.758992",
"0.64717424",
"0.63249475",
"0.62942463",
"0.62580293",
"0.61738527",
"0.5926118",
"0.5744267",
"0.5732108",
"0.569409",
"0.56704426",
"0.5648253",
"0.5618645",
"0.5580626",
"0.5578156",
"0.55212694",
"0.55163026",
"0.54937804",
"0.5468155",
"0.54027385",
"0.53934... | 0.75936896 | 0 |
Startup() is called when EdInsertTOC.xhtml is opened | function Startup() {
// early way out if if we have no editor
if (!GetCurrentEditor()) {
window.close();
return;
}
var i;
// clean the table of tag/class pairs we look for
for (i = 0; i < 6; ++i) {
tocHeadersArray[i] = ["", ""];
}
// reset all settings
for (i = 1; i < 7; ++i) {
var m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function openToc(){\n \tcpCmndTOCVisible = true;\n cpCmndPause = true; \t\n }",
"function initNds() {\n\n initTOC();\n}",
"function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n\r\n createEventListeners();\r\n}",
"function ... | [
"0.6395937",
"0.60592425",
"0.6011275",
"0.600011",
"0.59478056",
"0.5946036",
"0.58749455",
"0.58412707",
"0.5840286",
"0.5819343",
"0.58115804",
"0.58044547",
"0.58001137",
"0.57882935",
"0.5782213",
"0.5768758",
"0.5758924",
"0.5757469",
"0.5757175",
"0.57433134",
"0.57160... | 0.6605334 | 0 |
controlClass() is a node filter that accepts a node if (a) we don't look for a class (b) we look for a class and node has it | function controlClass(node, index) {
currentHeaderLevel = index + 1;
if (tocHeadersArray[index][1] == "") {
// we are not looking for a specific class, this node is ok
return NodeFilter.FILTER_ACCEPT;
}
if (node.getAttribute("class")) {
// yep, we look for a class, let's look at all th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function acceptNode(node) {\n switch (node.nodeName.toLowerCase()) {\n case tocHeadersArray[0][0]:\n return controlClass(node, 0);\n case tocHeadersArray[1][0]:\n return controlClass(node, 1);\n case tocHeadersArray[2][0]:\n return controlClass(node, 2);\n case tocHeader... | [
"0.70108175",
"0.62311846",
"0.6014148",
"0.59832364",
"0.5748716",
"0.574253",
"0.5730161",
"0.57017267",
"0.5616035",
"0.5590088",
"0.55815864",
"0.5528839",
"0.5511393",
"0.5489579",
"0.548043",
"0.5476879",
"0.5469687",
"0.5446902",
"0.54404074",
"0.5406446",
"0.5399197",... | 0.74683 | 0 |
Display products from database (id, name, price) | function displayProducts() {
connection.query(`
SELECT item_id, product_name, price
FROM products
WHERE stock_quantity > 0`, (err, response) => {
if(err) console.log(chalk.bgRed(err));
response.forEach(p => p.price = `$ ${p.price.toFixed(2)}`);
console.table(response);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}",
"function displayProducts() {\n // display product ID, name and price\n var quer... | [
"0.7661193",
"0.76367587",
"0.75629056",
"0.7539677",
"0.75155675",
"0.74938625",
"0.74751073",
"0.74684167",
"0.7460956",
"0.7423613",
"0.73738277",
"0.73363584",
"0.7329994",
"0.7316",
"0.7292678",
"0.72663647",
"0.7237409",
"0.7235697",
"0.7230308",
"0.7213026",
"0.7201457... | 0.7687961 | 0 |
Updates the camera filters | updateCameraFilter() {
// Main camera should ignore all UI elements as we render them on a different camera
this.gameCam.ignore(window.game.ui.getAllUIElements());
this.gameCam.ignore(helpers.getObjectSprites());
this.gameCam.ignore(helpers.getFarmFieldSprites());
// Camera 2 is the UI camera, so it should i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applyFilters() {\r\n Caman(\"#canvas\", img, function() {\r\n this.revert(false);\r\n this.brightness(brightnessValue)\r\n .contrast(contrastValue)\r\n .saturation(saturationValue)\r\n .vibrance(vibranceValue)\r\n .exposure(exposureValue)\r\n .hue(hueValue)\r\n .sepia(... | [
"0.6783433",
"0.6546976",
"0.64539665",
"0.64155674",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
"0.63746417",
... | 0.74708 | 0 |
===addOnloadHook=== use both names for it, for Wikipedia compatability (just in case) | function addOnloadHook(f) {
addLoadEvent(f);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadHook() {\n targetBlank();\n bindEnqueue();\n bindIndexButtons();\n}",
"function onLoad()\n{}",
"function page_loaded() {\n post_load_setup();\n}",
"onLoad() {}",
"onLoad() { }",
"onLoad () {}",
"function WindowAddOnloadHandler(h)\r\n{\r\n\twindow.onloadHandlers[window.onloadHandlers.le... | [
"0.661936",
"0.6512825",
"0.63674855",
"0.61882955",
"0.6149581",
"0.6004486",
"0.59998655",
"0.5981188",
"0.5951354",
"0.59303564",
"0.59073406",
"0.5883489",
"0.5879765",
"0.58604175",
"0.5839272",
"0.58350915",
"0.58350915",
"0.5826468",
"0.5811645",
"0.5806418",
"0.579756... | 0.71686786 | 1 |
==addCharSubsetMenu== / add menu for selecting subsets of special characters must match MediaWiki:Edittools | function addCharSubsetMenu() {
var edittools = document.getElementById('editpage-specialchars');
if (edittools) {
var menu = "<select id=\"charSubsetControl\" style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">";
menu += "<option>Edit Tools</option>";
menu += "<option>Latin/Roman</op... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCharSubsetMenu() {\n var specialchars = document.getElementById('specialchars');\n\n if (specialchars) {\n var menu = \"<select id=\\\"charsetBox\\\" style=\\\"display:inline\\\" onkeyup=\\\"chooseCharSubset(selectedIndex)\\\" onChange=\\\"chooseCharSubset(selectedIndex)\\\">\";\n menu += \"<op... | [
"0.6918295",
"0.65661305",
"0.65661305",
"0.5458571",
"0.54176503",
"0.53991383",
"0.5378339",
"0.5339509",
"0.53293943",
"0.52867025",
"0.52867025",
"0.52867025",
"0.5282782",
"0.52631634",
"0.52560925",
"0.52560925",
"0.52560925",
"0.52560925",
"0.52560925",
"0.52560925",
"... | 0.7439142 | 1 |
===chooseCharSubsetMenu=== / select subsection of special characters | function chooseCharSubset(s) {
var l = document.getElementById('editpage-specialchars').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
l[i].style.visibility = i == s ? 'visible' : 'hidden';
}
setCookie('edittoolscharsubset', s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addCharSubsetMenu() {\n var edittools = document.getElementById('editpage-specialchars');\n\n if (edittools) {\n var menu = \"<select id=\\\"charSubsetControl\\\" style=\\\"display:inline\\\" onChange=\\\"chooseCharSubset(selectedIndex)\\\">\";\n menu += \"<option>Edit Tools</option>\";\n menu ... | [
"0.7132199",
"0.7132199",
"0.6812503",
"0.6250955",
"0.59788936",
"0.5870373",
"0.5815879",
"0.58138305",
"0.58026165",
"0.5774595",
"0.5734353",
"0.5728962",
"0.5728962",
"0.5728962",
"0.57233745",
"0.57233745",
"0.57151955",
"0.57151955",
"0.57151955",
"0.57151955",
"0.5715... | 0.71914756 | 1 |
===chooseHelpToolsMenu=== / select subsection of special characters | function chooseHelpTools(s) {
var l = document.getElementById('editpage-helpmenu').getElementsByTagName('p');
for (var i = 0; i < l.length ; i++) {
l[i].style.display = i == s ? 'inline' : 'none';
l[i].style.visibility = i == s ? 'visible' : 'hidden';
}
setCookie('edittoolshelpmenu', s);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function customizeWiki() {\n addCharSubsetMenu();\n addHelpToolsMenu();\n addDigg();\n}",
"function doHelpButton()\n{\n var selTab = document.getElementById(\"tabbox\").selectedTab;\n var key = selTab.getAttribute(\"help\");\n openHelp(key, \"chrome://communicator/locale/help/suitehelp.rdf\");\n}",
"func... | [
"0.59469867",
"0.5840958",
"0.5806161",
"0.5790633",
"0.57879233",
"0.57879233",
"0.572461",
"0.56864387",
"0.56599236",
"0.56464034",
"0.55683595",
"0.55683595",
"0.55579865",
"0.5554837",
"0.55078673",
"0.54651326",
"0.5460771",
"0.54605925",
"0.5413337",
"0.5400317",
"0.53... | 0.6345765 | 1 |
////////////////////////////////////////////// THE BELOW CODE ALLOWS THE JAVASCRIPT FOR DIGG ////////////////////////////////////////////// / ===addDigg=== / call to digg script | function addDigg() {
var digg = document.getElementById('digg');
if (digg) {
var ds=typeof digg_skin=='string'?digg_skin:'';var h=80;var w=52;if(ds=='compact'){h=18;w=120;}
else if(ds=='icon'){h=16;w=16;}
var u=typeof digg_url=='string'?digg_url:(typeof DIGG_URL=='string'?DIGG_URL:window.location.hre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeDNODE(t, rowcount, div, shoutid )\r\n{\r\n\tvar ret = true;\r\n\r\n GM_xmlhttpRequest({\r\n method:\"GET\",\r\n url:t,\r\n headers:{\r\n \"User-Agent\":navigator.userAgent\r\n },\r\... | [
"0.56920415",
"0.56426567",
"0.55253756",
"0.5433076",
"0.534973",
"0.5226154",
"0.52252024",
"0.52138716",
"0.51970035",
"0.5114452",
"0.50547546",
"0.5037025",
"0.50255066",
"0.5023821",
"0.49948704",
"0.4986279",
"0.4975458",
"0.49733838",
"0.49609256",
"0.49582356",
"0.49... | 0.78273463 | 1 |
==================== minDigit version 2 ==================== | function minDigit(digit1, digit2) {
return (digit1 < digit2) ? digit1 : digit2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function minTwoDigits(n) {\n return (n < 10 ? '0' : '') + n;\n}",
"min(m) {\n const mn = ((m || '0') + '');\n return mn.length < 2 ? '0' + mn : mn;\n }",
"function superDigit(n, k) {\n if (n < 10) {\n return n;\n }\n \n return superDigit(\n n\n .toString()\n .split('')... | [
"0.68547785",
"0.67793584",
"0.6754309",
"0.63933325",
"0.63644874",
"0.63644874",
"0.63644874",
"0.63259333",
"0.62991667",
"0.6291033",
"0.6283234",
"0.62742543",
"0.62434685",
"0.62434685",
"0.61267704",
"0.61173135",
"0.61096776",
"0.6082402",
"0.6061548",
"0.60577357",
"... | 0.70427114 | 0 |
==================== maxDigit version 2 ==================== | function maxDigit(digit1, digit2) {
return (digit1 > digit2) ? digit1 : digit2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function solution(digits) {\n let max = 0;\n for (let i = 0; i < digits.length; i++) {\n let num = digits.slice(i, i+5);\n if (num > max) max = num;\n }\n return +max;\n}",
"function maxDigit(n) {\n let arrStrings = String(n).split('');\n let result = +arrStrings[0];\n\n for (let i = 1; i < arrStrin... | [
"0.7302669",
"0.7066847",
"0.7066776",
"0.6840462",
"0.67234075",
"0.66973543",
"0.6675813",
"0.65353423",
"0.64903796",
"0.64873713",
"0.6481839",
"0.6445436",
"0.64259046",
"0.64180887",
"0.63828254",
"0.6371476",
"0.6367876",
"0.63559663",
"0.63285494",
"0.63245076",
"0.63... | 0.7480983 | 0 |
Hide Homepage Slider Stats | function hideStats(slide, numberOfSlides){
if(slide === numberOfSlides-1){
hideStats(-1,numberOfSlides);
}
slide=slide+1;
let prevslide = $('div[data-slick-index=' + slide + ']');
let container = prevslide.find(".slider-info");
container = container.find(".slider-stats");
$(container... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function homePage(){\r\n //This function will hide the sales and show homepage\r\n $(\".contain_Sales\").hide();\r\n $(\".contain_Charts\").hide();\r\n $(\".contain_Home\").show();\r\n }",
"function counter (){\n if(temp == 0){\n slider_section.style.display = \"none\"; \... | [
"0.66772926",
"0.647454",
"0.63862675",
"0.63784504",
"0.63455796",
"0.634367",
"0.634049",
"0.62591094",
"0.6247787",
"0.6215995",
"0.6215853",
"0.62111604",
"0.61885124",
"0.616665",
"0.61561793",
"0.61502445",
"0.6147332",
"0.6136797",
"0.6133146",
"0.61293554",
"0.6108998... | 0.6520082 | 1 |
Animate Homepage Slider Stats | function animateStats(currentSlide) {
let slide = $('div[data-slick-index='+currentSlide+']');
let container=slide.find(".slider-info");
container=container.find(".slider-stats");
$(container).toArray().map(function(stat) {
return function () {
return $(stat).fadeIn().promise();
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showStats(){\n\tbuildStatsPopup();\n\t\n\t//Animate the stats background image\n\tstatsBackgroundImage.animate({transform:SCALE_ONE, duration:400});\n}",
"function showSlider() {\n let sliderCoords = getObjectCoords(slider);\n let slideInfo = $(\".slide.current .slide__info\");\n\n if (!slideIn... | [
"0.6539043",
"0.63696504",
"0.6172715",
"0.6168798",
"0.61359507",
"0.60571843",
"0.6054535",
"0.60518175",
"0.6046284",
"0.59709734",
"0.5948658",
"0.59467125",
"0.58857596",
"0.5875993",
"0.5875993",
"0.5875993",
"0.5871745",
"0.5816109",
"0.5809456",
"0.58029234",
"0.57880... | 0.6802455 | 0 |
Initializes a table that caches constraints between two variables. | #initializeRelatedConstraintTable() {
const temp = [];
this.#relCons = [];
for (let j = 0; j < this.#vars.length; ++j) {
this.#relCons.push(new Array(this.#vars.length));
for (let i = 0; i < this.#vars.length; ++i) {
if (i < j) {
this.#relCons[j][i] = this._pro.constraintsBetween(this.#vars[i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function CreateTableQuery() \n{\nthis.columns = [];\nthis.constraints = [];\n}",
"function staticTableVars(quantDec,quantRes){\n\tbase = [];\n\thead = [];\n\n\t//for each restriction adds a row into base\n\tfor (let i = 0; i < quantRes ; i++) {\n\t\tbase.push(\"f\"+(i+1));\n\t}\n\tbase.push(\"Z\");\n\n\n\thead.p... | [
"0.5972641",
"0.5527195",
"0.5395581",
"0.53191435",
"0.5301221",
"0.5161243",
"0.5156203",
"0.51476395",
"0.51443577",
"0.51378757",
"0.50877684",
"0.5084068",
"0.504005",
"0.5038223",
"0.50282633",
"0.5021048",
"0.50104874",
"0.495705",
"0.49468938",
"0.49397206",
"0.491203... | 0.7099888 | 0 |
Specify whether to use the minimumremainingvalues (MRV) heuristic. Use of MRV may increase processing time for some problems. Default is false. | setUsingMinimumRemainingValuesHeuristics(flag) {
this.#useMRV = flag;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setExcludingMincut(bool){\n\t\t_excludingMincut = bool;\n\t}",
"nap() {\n if (this.energy < 100) {\n this.energy = 100;\n return true;\n } else{\n return false;\n }\n }",
"downMinuteEnabled() {\r\n return !this.minDateTime || this.compareMinutes(-this.stepMinute, this.m... | [
"0.5325161",
"0.5040339",
"0.4965827",
"0.48794118",
"0.48540705",
"0.4829942",
"0.4810209",
"0.474331",
"0.4730754",
"0.47242123",
"0.4644224",
"0.46346247",
"0.46041426",
"0.46029314",
"0.4568232",
"0.45646343",
"0.45469266",
"0.4528679",
"0.45281008",
"0.45223686",
"0.4503... | 0.79986614 | 0 |
to upload file in google drive => function below function is a function | function uploadFile(mimetype, bookname, filedata) {
var bookname1 = 'dcbook.pdf'; // console.log(bookname,bookname1);
try {
var response = drive.files.create({
requestBody: {
name: bookname,
mimeType: mimetype
},
media: {
mimeType: mimetype,
body: fs.createRead... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadGoogleFilesToDropbox(attachment) {\n \n var path = '/Auditions/' + attachment.getName();\n \n var headers = {\n \"Content-Type\": \"application/octet-stream\",\n 'Authorization': 'Bearer ' + dropbox_token,\n \"Dropbox-API-Arg\": JSON.stringify({\"path\": path})\n \n };\n \n var op... | [
"0.7249175",
"0.69119596",
"0.6783581",
"0.6700181",
"0.66952765",
"0.6630149",
"0.6622267",
"0.6591623",
"0.65704906",
"0.65593374",
"0.65593374",
"0.65571",
"0.65492344",
"0.6528061",
"0.64553213",
"0.64462507",
"0.636299",
"0.6358767",
"0.6346228",
"0.63300484",
"0.6325316... | 0.7506478 | 0 |
Repeatedly tests a function for performance function funcToTest the function under test int reps the number of repeated calls returns array with formatted values: [total time for 'reps' iterations, avg iterations per second, reps] | function testPerformance(funcToTest, reps) {
var t0, t1, total, average;
t0 = performance.now();
for (var i = 0; i < reps; i++) {
funcToTest(i)
}
t1 = performance.now();
total = parseFloat((t1 - t0)).toFixed(2);
average = parseFloat((reps * 1000 / (t1 - t0))).toFixed(2);
return [formatWithCommas(tot... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testPerformance(funcToTest, reps) {\n var t0, t1, total, average;\n t0 = performance.now();\n for (var i = 0; i < reps; i++) {\n funcToTest(scores)\n }\n t1 = performance.now();\n total = parseFloat((t1 - t0)).toFixed(2);\n average = parseFloat((reps * 1000 / (t1 - t0))).toFixed(2);\n return [f... | [
"0.817239",
"0.6519167",
"0.60944957",
"0.58732796",
"0.5868799",
"0.5789909",
"0.5785682",
"0.5722714",
"0.569654",
"0.56912327",
"0.5656098",
"0.5656098",
"0.5582304",
"0.55549365",
"0.5536433",
"0.5521085",
"0.5517161",
"0.5508569",
"0.5503929",
"0.54993546",
"0.5443955",
... | 0.83475024 | 0 |
Get the street address of a company from a COMPANY page Returns an array. First element is street address 1, second element is street address 2 | function get_street_address(){
//$street_address_span = $("span:contains('Street Address')")
$street_address_span = $("span:contains('Street')")
$street_address_span = $("span:contains('Street Address')")
//print out the name of the span using jQuery's text
$span_text = $("span").text()
space_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAddresses() {\n // 2021-06-05 OG NEW - Get all the cards from the page \n var groups = document.getElementsByClassName('card-info');\n // 2021-06-05 OG NEW - Initialize an empty array to store the info \n var result = [];\n // 2021-06-05 OG NEW - Go through each group and format the info... | [
"0.5898845",
"0.57922214",
"0.5783602",
"0.5634367",
"0.5617761",
"0.55780643",
"0.5544354",
"0.5526966",
"0.54967463",
"0.5448861",
"0.5422838",
"0.5416059",
"0.54097646",
"0.5370516",
"0.5367849",
"0.5299132",
"0.52895117",
"0.52888644",
"0.5283237",
"0.5283063",
"0.5276259... | 0.61310714 | 0 |
returns true if the contact from an INDIVIDUAL page has at least one company that the he or she is authorized to represent. Returns false if the Authorized to Represent row reads "None'. | function is_authorized_to_represent(){
$span_class = $("span.nowrap:contains('Authorized to Represent')")
var authorized_to_represent_text_data = $span_class.parent().next().text().trim()
//TS
console.log("authorized_to_represent_text_data: " + authorized_to_represent_text_data)
console.log("authorized_to_repre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isAuthenticatedCompany({ name, phone, address }) {\n return (\n userdb.companies.findIndex(\n (company) =>\n company.name === name &&\n company.phone === phone &&\n company.address === address\n ) !== -1\n );\n}",
"function isPixieStatusCompany() {\n return $(\"#... | [
"0.63675636",
"0.53807366",
"0.53382546",
"0.5331725",
"0.5275683",
"0.51697385",
"0.51611453",
"0.51034534",
"0.508778",
"0.50786173",
"0.50412536",
"0.502894",
"0.50204253",
"0.49915624",
"0.4981476",
"0.4947844",
"0.49121734",
"0.49059436",
"0.49009588",
"0.48766777",
"0.4... | 0.60859656 | 1 |
Returns the "Authorized to Represent" string of an INDIVIDUAL page if the contact is authorized to represent. Returns empty string otherwise | function get_authorized_to_represent(){
if(is_authorized_to_represent())
return $("span.nowrap").filter(":contains('Authorized to Represent')").parent().next().text().trim()
else
return ""
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_authorized_to_represent(){\n\t\n\t$span_class = $(\"span.nowrap:contains('Authorized to Represent')\")\n\tvar authorized_to_represent_text_data = $span_class.parent().next().text().trim()\n\n\t//TS\n\tconsole.log(\"authorized_to_represent_text_data: \" + authorized_to_represent_text_data)\n\tconsole.lo... | [
"0.6000689",
"0.5233825",
"0.51997066",
"0.5107606",
"0.5088724",
"0.5087396",
"0.49745652",
"0.49715742",
"0.49228257",
"0.49030235",
"0.49028227",
"0.48017088",
"0.48008177",
"0.4797191",
"0.47962785",
"0.47505894",
"0.4734998",
"0.46734345",
"0.46322593",
"0.46314907",
"0.... | 0.7167109 | 0 |
Returns the companie names and NMLS IDs of the companies an individual works for Returns an array of two arrays. The first array is the name of the companies, and the second is an array of the NMLS IDs corresponding to the first array. | function get_authorized_to_represent_names_and_nmls(){
let atr_string = get_authorized_to_represent()
let atr_strings = atr_string.split('; ')
console.log("atr_string: ", atr_string)
console.log("atr_strings:", atr_strings)
let company_names = []
let nmls_ids = []
atr_strings.forEach(
(atr) => {
let o_p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllCompanyNames(data) {\n let newArr = [];\n for(let i = 0; i < data.length; i++) {\n newArr.push(data[i]['company']);\n }\n return newArr\n}",
"Intersect(other) {\n console.debug(`ContaplusCompany::Intersect (${this}, ${other})`)\n let result = new Co... | [
"0.5833061",
"0.54693764",
"0.5435256",
"0.54277635",
"0.5320715",
"0.5292486",
"0.52153015",
"0.5206933",
"0.5198437",
"0.5178946",
"0.5136345",
"0.5135571",
"0.51280826",
"0.51160705",
"0.50931704",
"0.5044367",
"0.50191665",
"0.49781665",
"0.4963452",
"0.49404192",
"0.4932... | 0.5618606 | 1 |
scrape all the office locations if an INDIVIDUAL page returns an array of AuthorizedToRepresentOfficeLocation of all the office locations if the contact is allowed to represent a company and the office locations are displayed in the "Office Locations" section of the page. returns an empty string otherwise | function get_all_office_locations(){
if(is_authorized_to_represent()){
var allOffices = []
//TS
console.log($("h1:contains('Office Locations')").parent().next().next().children().first().html())
//TE
//get table body where Office Locations data is stored
var $tbody_el = $("h1:contains('Office Locations'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_office_location(){\n\n}",
"function locationFinder() {\n\n var locations = [];\n locations.push(bio.contacts.location);\n \n // iterates through school locations and appends each location to the locations array.\n education.schools.forEach(function(school){\n locations.push(schoo... | [
"0.61246973",
"0.5822747",
"0.57460207",
"0.5586455",
"0.5586244",
"0.5553256",
"0.5547529",
"0.5514663",
"0.52987385",
"0.52169305",
"0.52063525",
"0.51750857",
"0.5165256",
"0.5135742",
"0.50791407",
"0.50102097",
"0.49745253",
"0.49652082",
"0.49588254",
"0.4939312",
"0.48... | 0.7077273 | 0 |
tests the creation of modification of a AuthorizedToRepresentOfficeLocation object | function test_office_objects(){
office_one = new AuthorizedToRepresentOfficeLocation()
office_one.name = "office one"
console.log("office_one's name: " + office_one.name)
console.log("office_one's city: " + office_one.city)
console.assert(office_one.name == "office ones")
console.assert(office_one.city == ""... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function AuthorizedToRepresentOfficeLocation() {\n\tthis.name = \"\"; //Company name\n\tthis.nmlsID = \"\"; \n\tthis.city = \"\";\n\tthis.state = \"\";\n\tthis.zipCode = \"\";\n}",
"isValidLocation(loc) {\n return true;\n }",
"function createLocations(){\n\n\t//Uptown Areas\n\tlibrary = new Location('Libra... | [
"0.7211704",
"0.53613186",
"0.51509875",
"0.5091676",
"0.50819564",
"0.49728015",
"0.49651882",
"0.49566534",
"0.49450177",
"0.49384096",
"0.4933676",
"0.48935676",
"0.4884436",
"0.48775414",
"0.48438433",
"0.482519",
"0.4820159",
"0.48107052",
"0.48070827",
"0.47571",
"0.474... | 0.7037208 | 1 |
valid transaction payment amount | function validPaymentAmount(element){
var transactionTotal = $('#transactionTotal').val();
var transactionDiscount = $('#transactionDiscount').val();
var transactionPaid = $('#transactionPaid').val();
var transactionRemaining = transactionTotal - transactionDiscount - transactionPaid;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static validTransaction(transaction) {\n const { input, outputMap } = transaction\n const { address, amount, signature } = input\n\n // reduce the outputMap to get a grand total\n const outputTotal = Object.values(outputMap).reduce(\n (total, outputAmount) => total + outputAmount\n )\n\n // ... | [
"0.6800577",
"0.6728387",
"0.6594283",
"0.64473385",
"0.6425926",
"0.64158607",
"0.6360946",
"0.6358509",
"0.6335286",
"0.6309119",
"0.6276989",
"0.62337565",
"0.6106874",
"0.6104627",
"0.6095177",
"0.6026397",
"0.6026397",
"0.6009569",
"0.59992033",
"0.59921676",
"0.59751284... | 0.7247018 | 0 |
Full Height Banner BG | function resizebanner() {
$(".fullscreen").css("height", $(window).height());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function optimizeBanSliderBG() {\n\tvar banSliderHeight = $( \".banner-slider\" ).height();\n\t$( \".banner-slider li .slide\" ).children( \"img\" ).css({ \n\t\t\"display\" : \"block\",\n\t\t\"height\" : banSliderHeight,\n\t\t\"opacity\" : 0\n\t});\n}",
"function bannerParallaxImageBG() {\n\tvar bannerParallax ... | [
"0.66795915",
"0.6338356",
"0.62019825",
"0.61837274",
"0.6058767",
"0.60533047",
"0.5978588",
"0.59235394",
"0.5912955",
"0.5904704",
"0.5836949",
"0.5705791",
"0.5693214",
"0.5685028",
"0.56769675",
"0.56707776",
"0.5669676",
"0.56604016",
"0.56533104",
"0.5651953",
"0.5645... | 0.6473044 | 1 |
Test disabling a plugin | function testDisablePlugin() {
addonsManager.open();
// Select the Plugins pane
addonsManager.setCategory({
category: addonsManager.getCategoryById({id: "plugin"})
});
var aPlugin = addonsManager.getAddons({attribute: "value",
value: plugin.id})[0];
persisted.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"disablePlugin() {\n super.disablePlugin();\n }",
"function testDisableEnablePlugin() {\n // Open a new tab for the addons manager page in order to have two open tabs\n // the second one will be used for handling the addons related checks\n // while the first one will be used for handling the plugins relat... | [
"0.7387541",
"0.7257841",
"0.6841273",
"0.65886015",
"0.6580283",
"0.6390537",
"0.62585247",
"0.6258003",
"0.62296784",
"0.62253207",
"0.6106252",
"0.6106252",
"0.60808206",
"0.6074571",
"0.60689956",
"0.6003877",
"0.5993241",
"0.5891819",
"0.5884117",
"0.58668417",
"0.583652... | 0.7704016 | 0 |
Ping the server to see if there are pending transactions. If so, wait for another timeout and try again. If not, trigger a reload of the form. | function commercePosTerminalPing(timeout, url, reloadButtonId, $container) {
window.setTimeout(function () {
$.get(url, null, function(response) {
if (response.pending_transactions) {
commercePosTerminalPing(timeout, url, reloadButtonId, $container);
}
else {
pingin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkServerDelayed() {\n\n // Check that we're not already waiting for something\n if (waitingForServer)\n return;\n \n // Mark that we're checking the server\n waitingForServer = true;\n\n // Hide our elements and show the initial placeholder\n indexElements.serviceTableBody.h... | [
"0.64140046",
"0.6299926",
"0.6016019",
"0.6010848",
"0.5727656",
"0.56942004",
"0.5642332",
"0.5642129",
"0.56036407",
"0.55875146",
"0.55741775",
"0.55677235",
"0.5548097",
"0.55408293",
"0.55125743",
"0.5490293",
"0.54829365",
"0.54567105",
"0.5450294",
"0.5448886",
"0.543... | 0.6621879 | 0 |
Update speed of the shield | function update_Speed2(){
if (game.time.now > speedTime) {
if (shieldDownButton.isDown && (shieldSpeed > 1)){
shieldSpeed = shieldSpeed -1;
speedTime = game.time.now + 150;
}
if (shieldUpButton.isDown && (shieldSpeed < 10)){
shieldSpeed = shieldSpeed + 1;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateSpeed (speed) {\n this.speed = speed;\n }",
"setSpeed(speed) {\n this.speed = speed;\n }",
"accelerate(){\n this.speed += 10;\n }",
"increaseSpeed() {\n\n this.speed = Math.max(this.speed - Snake.SPEED_INCREMENT, Snake.MAX_SPEED);\n\n }",
"function change... | [
"0.7789028",
"0.71157557",
"0.7081373",
"0.7029668",
"0.7014882",
"0.6956693",
"0.6897344",
"0.6797317",
"0.6780533",
"0.6770681",
"0.6756644",
"0.67094",
"0.67063105",
"0.670482",
"0.67045355",
"0.67027617",
"0.66968435",
"0.66694915",
"0.6644832",
"0.6636809",
"0.66307974",... | 0.7573978 | 1 |
Function to activate the shield manually using the "Y" key | function manual_Activate_Shield() {
if (game.time.now > manualShieldTime) {
shielded = !shielded;
manualShieldTime = game.time.now + 150;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function activate() {\n NighShift.start();\n}",
"function activate() {\n\n\n }",
"function attempt_activate_button() {\n\t//enteringFirstTime = true\n\tif(localDebug){\n\t\tconsole.log(\"entering\")\n\t}\n\ttag_no = document.getElementById(\"attempted_login\").value;\n\tif (tags[tag_no]) {\n\t\tdocumen... | [
"0.58878624",
"0.57682455",
"0.5671849",
"0.56697124",
"0.5638424",
"0.5635817",
"0.5604298",
"0.56033367",
"0.5544853",
"0.55244124",
"0.54562694",
"0.54332674",
"0.5400398",
"0.5397304",
"0.5374461",
"0.5363277",
"0.53433096",
"0.5328132",
"0.53197426",
"0.5316744",
"0.5315... | 0.6665127 | 0 |
Sets the specified value on the gpio pin. | function set(val) {
console.log('Setting GPIO ' + config.gpio + ' to ' + val);
gpio.writeSync(val);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setPower(val, gpioDoneCallback){\n if (val == 0) {\n writeGPIO(PIN_POWER, false, function () {\n pCurrent = 0;\n outputDeviceSummary();\n gpioDoneCallback();\n });\n }else{\n // Turn on (Hold in the relay)\n writeGPIO(PIN_POWER, true, func... | [
"0.71495855",
"0.69425094",
"0.66794103",
"0.66005105",
"0.6528987",
"0.64969945",
"0.6446998",
"0.6390614",
"0.6330078",
"0.62940526",
"0.62230784",
"0.6202546",
"0.61342615",
"0.6111102",
"0.60979867",
"0.6065025",
"0.6053133",
"0.6039499",
"0.60293555",
"0.6007093",
"0.600... | 0.84264493 | 0 |
check the file or folder name is valid or not. | function nameCheck(name) {
if (name.indexOf('\\') !== -1) {
return false;
}
var reg = new RegExp('[*:/?<>\"|\\x5c]', 'g');
if (reg.test(name)) {
// invalid file or folder name.
return false;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkNameFolder(val) {\n\t\tvar patt = new RegExp(\"^[a-zA-Z0-9_ -]*$\");\n \t\tvar res = patt.test(val);\n \t\treturn res\n\t}",
"function isFilenameValid(name) {\n return /^[A-Za-z0-9][A-Za-z0-9\\._\\-]*$/.test(name)\n}",
"static isNameValid (name) {\n return /^\\w+$/.test(name)\n }",
"fu... | [
"0.77103037",
"0.75225955",
"0.6798907",
"0.6785436",
"0.6780498",
"0.6774277",
"0.6732977",
"0.67189354",
"0.67125773",
"0.6695492",
"0.6686731",
"0.6656613",
"0.6656613",
"0.6579012",
"0.65684",
"0.6547675",
"0.6526519",
"0.65115243",
"0.6458918",
"0.6437728",
"0.6404645",
... | 0.7986132 | 0 |
UTF8 count file name characters | function countCharacters(newName) {
if (!newName) {
return 0;
}
var totalCount = 0, code, len = newName.length;
for (var i = 0; i < len; i++) {
code = newName.charCodeAt(i);
if (code >= 0x0 && code <= 0x7f) {
totalCount++;
} else if (code <= 0x7ff) {
totalCount += 2;
} else if (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function charactersOccurencesCount() {\n \n}",
"function charactersOccurencesCount() {\n \n}",
"function charactersOccurencesCount() {\n \n}",
"function charactersOccurencesCount() {\n \n}",
"function charactersOccurencesCount() {\n\n}",
"function charactersOccurencesCount() {\n\n}",
"function char... | [
"0.66952926",
"0.66952926",
"0.66952926",
"0.66952926",
"0.66364026",
"0.66364026",
"0.66364026",
"0.66364026",
"0.66364026",
"0.6512775",
"0.6434135",
"0.64316314",
"0.6335608",
"0.62792856",
"0.6278531",
"0.62686974",
"0.62686974",
"0.6222826",
"0.6212017",
"0.6197969",
"0.... | 0.7526396 | 0 |
loads the new scene and tracks path (maybe just use this to start and track elseware?) | newScene(newScene_){
// console.log(newScene_)
if(newScene_ instanceof Scene){
console.log("Loaing Scene: " + newScene_.id)
console.log(newScene_)
//newScene_.addInheritance(inheritedContent_)
this.sceneTimesArray.push(
{
"scene":newScene_.id,
"time":Date.now()
});
//if(newScene_.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"localLoad() {\n if (this.loadView.existingSceneSelect.selectedIndex > -1) {\n Utilitary.showFullPageLoading();\n var option = this.loadView.existingSceneSelect.options[this.loadView.existingSceneSelect.selectedIndex];\n var name = option.value;\n this.sceneCurrent... | [
"0.6826737",
"0.6591682",
"0.64966536",
"0.63590795",
"0.63252574",
"0.6308588",
"0.6262962",
"0.6262545",
"0.6215409",
"0.62041295",
"0.6203112",
"0.6160451",
"0.6156807",
"0.61511856",
"0.6101925",
"0.6066372",
"0.60465926",
"0.60411686",
"0.6030603",
"0.6030087",
"0.602898... | 0.67100465 | 1 |
Get available time interval measurement units. | function getTimeIntervalMeasurementUnits(localeData, restrictedSetOfUnits) {
// All available time interval measurement units.
var units = Object.keys(localeData);
// If only a specific set of available
// time measurement units can be used.
if (restrictedSetOfUnits) {
// Reduce available time interval measurem... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getUnits() {\n const seconds = this.props.timeElapsed / 1000;\n var hr = Math.floor(seconds / 3600).toString();\n var min = Math.floor(seconds / 60).toString();\n var sec = Math.floor(seconds % 60).toString();\n var msec = (seconds % 1).toFixed(2).substring(2);\n \n return this.formatTime(hr) ... | [
"0.6499195",
"0.622019",
"0.61791515",
"0.613714",
"0.61059254",
"0.610492",
"0.60820544",
"0.5974774",
"0.5974774",
"0.5974774",
"0.59652185",
"0.59120834",
"0.5855817",
"0.5797055",
"0.5774019",
"0.5761486",
"0.5747882",
"0.5740861",
"0.5713432",
"0.5680208",
"0.5674149",
... | 0.73163134 | 0 |
Fetch nonprofit. This will return the nonprofit data from the API, or will default to the IRS search API service if it can't be found in the main system. It will reject with a 404 if the EIN does not represent a valid nonprofit. | function fetchNonprofit(ein) {
return new Promise(function (resolve, reject) {
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get("".concat(IRSSearchAPI, "/nonprofits/").concat(ein)).then(function (response) {
resolve(response.data[0]);
}).catch(function () {
reject({
code: 4... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _requestNFLFuturesOdds() {\n return request({\n uri: 'http://www.covers.com/odds/football/nfl-futures.aspx',\n method: 'GET',\n json: true\n })\n .then(function (result) {\n return {\n body: result,\n dom: cheerio.load(result, {normalizeWhitespace: true})\n };\n })... | [
"0.54607844",
"0.53512037",
"0.530364",
"0.52812964",
"0.5230674",
"0.51821333",
"0.5043036",
"0.49485195",
"0.49339408",
"0.49304286",
"0.49056703",
"0.4904103",
"0.48926064",
"0.48821285",
"0.4821556",
"0.48200133",
"0.48051584",
"0.4804912",
"0.47873262",
"0.47627363",
"0.... | 0.80153906 | 0 |
Fetch a fundraiser and return the data or a 404 code if not found. | function fetchFundraiser(id) {
return new Promise(function (resolve, reject) {
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get("".concat(baseURL, "/fundraisers?fundraiser_id=").concat(id)).then(function (response) {
if (response.data.length) {
resolve(response.data[0]);
} else... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"fetchBurners() {\n return fetch(`${this.apiBaseUrl}/v1/burners`, {\n method: 'GET',\n headers: this._headers(),\n })\n .then(this._checkStatus)\n .then(this._parseJSON)\n }",
"function fetchExploreFundraisers(page, limit) {\n var paginated = arguments.length > 2 && arguments[2] !== un... | [
"0.60101026",
"0.57666844",
"0.5716441",
"0.56920326",
"0.5653012",
"0.5596991",
"0.5590471",
"0.5584032",
"0.5548271",
"0.54937726",
"0.5472702",
"0.5463799",
"0.5454661",
"0.5454432",
"0.54420066",
"0.54414165",
"0.5427945",
"0.5424928",
"0.5405468",
"0.5390401",
"0.5343749... | 0.73616576 | 0 |
Fetch fundraisers for a given EIN. Return a 404 code if no fundraisers found. | function fetchFundraisers(ein, page, limit) {
var paginated = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
return new Promise(function (resolve, reject) {
if (!paginated) {
page = 1;
}
external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get("".concat(baseURL,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchExploreFundraisers(page, limit) {\n var paginated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;\n return new Promise(function (resolve, reject) {\n if (!paginated) {\n page = 1;\n } // TODO: create algorithm to display varied fundraisers.\n\n\n external_c... | [
"0.61550987",
"0.55642676",
"0.55070573",
"0.5321132",
"0.53172064",
"0.528789",
"0.52194077",
"0.51067924",
"0.5073457",
"0.5054702",
"0.49295142",
"0.49295142",
"0.491109",
"0.4908649",
"0.48321164",
"0.4827072",
"0.4824372",
"0.4802018",
"0.47839996",
"0.47839996",
"0.4783... | 0.67772794 | 0 |
Fetch fundraisers for the explore page. Return a 404 code if no fundraisers found. | function fetchExploreFundraisers(page, limit) {
var paginated = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
return new Promise(function (resolve, reject) {
if (!paginated) {
page = 1;
} // TODO: create algorithm to display varied fundraisers.
external_commonjs_vue_c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchFundraisers(ein, page, limit) {\n var paginated = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;\n return new Promise(function (resolve, reject) {\n if (!paginated) {\n page = 1;\n }\n\n external_commonjs_vue_commonjs2_vue_root_Vue_default.a.axios.get(\"\".c... | [
"0.64606947",
"0.60735995",
"0.57622516",
"0.57621133",
"0.5404664",
"0.5338162",
"0.53166777",
"0.52913666",
"0.52890146",
"0.5287614",
"0.52776897",
"0.5260327",
"0.52492356",
"0.5247202",
"0.52158",
"0.5213401",
"0.5212637",
"0.5212637",
"0.5208505",
"0.5187122",
"0.516994... | 0.7002301 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.