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 |
|---|---|---|---|---|---|---|
Clear WebGL (depth) after 1min of run | function clearDepth() {
renderer.clearDepth(1);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"cleanupWebGL() {}",
"function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl2\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create ... | [
"0.75271577",
"0.71244013",
"0.71184266",
"0.70930094",
"0.70930094",
"0.7053501",
"0.70499206",
"0.6935659",
"0.6922435",
"0.69011056",
"0.68858784",
"0.67867905",
"0.6778077",
"0.6760073",
"0.67220414",
"0.6694737",
"0.6636735",
"0.6630691",
"0.6625205",
"0.6611403",
"0.658... | 0.7261925 | 1 |
Functions that handle ListBox selection and button actions / onListBoxAction: Called from ListBox event handlers | function onListBoxAction (data) {
if (data.index < 0) return;
switch (data.action) {
case 'navigate':
if (debug) console.log(`navigate: ${data.index}`);
updateButton(false);
break;
case 'activate':
if (debug) console.log(`activate: ${data.index}`)
sendButtonActivationMessage({... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listBoxSelectionCallBack(eventObj)\n{\n\tkony.print(\"\\n\\nin list box selection\\n\\n\");\n\tif(btnId==\"btnOrigin\"){\n\t\tfrmAnimation.lblSelectedOrigin.text=\"Origin: \"+(eventObj.selectedKeyValue)[1];\n\t\tkony.print(\"\\n--->\"+frmAnimation.lblSelectedOrigin.text);\n\t\t\t\t\n\t}else{\n\t\t\n\t\tfr... | [
"0.7392048",
"0.7068184",
"0.6567267",
"0.64783067",
"0.6200226",
"0.6195994",
"0.6120593",
"0.611731",
"0.6082135",
"0.602773",
"0.6025057",
"0.59951574",
"0.5970093",
"0.5878831",
"0.58513296",
"0.5822986",
"0.5816855",
"0.5792404",
"0.57719886",
"0.5727343",
"0.5692175",
... | 0.7394105 | 0 |
Handle window focus change events: If the sidebar is open in the newly focused window, save the new window ID and update the sidebar content. | function handleWindowFocusChanged (windowId) {
if (windowId !== myWindowId) {
let checkingOpenStatus = browser.sidebarAction.isOpen({ windowId });
checkingOpenStatus.then(onGotStatus, onInvalidId);
}
function onGotStatus (result) {
if (result) {
myWindowId = windowId;
runContentScripts('o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function focusHandler(){\n isWindowFocused = true;\n }",
"function focusHandler(){\n isWindowFocused = true;\n }",
"function focusHandler(){\r\n isWindowFocused = true;\r\n }",
"function updateSidebar() {\n $('.sidebar-menu li').removeClass('active... | [
"0.57622784",
"0.57622784",
"0.5707427",
"0.5674421",
"0.5631589",
"0.5615489",
"0.5607207",
"0.5587777",
"0.5506651",
"0.5482559",
"0.54382694",
"0.5414452",
"0.5411722",
"0.54102224",
"0.53714263",
"0.53623503",
"0.5355416",
"0.5355416",
"0.5355416",
"0.53215647",
"0.528549... | 0.70908797 | 0 |
getActiveTabFor: expected argument is ID of window with focus. The module variable myWindowId is updated by handleWindowFocusChanged event handler. | function getActiveTabFor (windowId) {
return new Promise (function (resolve, reject) {
let promise = browser.tabs.query({ windowId: windowId, active: true });
promise.then(
tabs => { resolve(tabs[0]) },
msg => { reject(new Error(`getActiveTabInWindow: ${msg}`)); }
)
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getTabWindowByChromeTabId (tabId) {\n const tw = this.windowIdMap.find(w => w.findChromeTabId(tabId))\n return tw\n }",
"getTabWindowByChromeId (windowId) {\n return this.windowIdMap.get(windowId)\n }",
"function getActiveTabId(e) {\n\t\tvar query = { active: true, currentWindow: true };\n\t\tfuncti... | [
"0.74438876",
"0.74290186",
"0.6755566",
"0.66839886",
"0.6648591",
"0.655822",
"0.64862543",
"0.64339864",
"0.6389305",
"0.6357002",
"0.6334173",
"0.6326636",
"0.62317747",
"0.6226168",
"0.6186943",
"0.6168544",
"0.61467344",
"0.61053",
"0.60988045",
"0.6039023",
"0.60050756... | 0.7634702 | 0 |
Restoring the checkbox statuses | function restoreChkbxStatus(len, increment) {
const testArray = JSON.parse(localStorage.getItem('checkboxStatuses'));
const anotherArray = JSON.parse(localStorage.getItem('displayStatuses'));
for (var k = 0; k < len; k++) {
entryList[k + increment].checked = testArray[k];
entryList[k + incre... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function syncronizeCheckboxes(clicked, pri, pub) {\n pri.checked = false;\n pub.checked = false;\n clicked.checked = true;\n }",
"function restore() {\n var i = 0;\n var list;\n while (that.data.lists[i] !== undefined) {\n list = that.data.lists[i];\n if (list.tChecked) {\n th... | [
"0.6916666",
"0.6393776",
"0.6352745",
"0.63186836",
"0.6316324",
"0.62939316",
"0.6279714",
"0.62796664",
"0.62531996",
"0.62198687",
"0.6215878",
"0.6199987",
"0.6190296",
"0.61751896",
"0.6167841",
"0.6148121",
"0.6143057",
"0.61397487",
"0.6138587",
"0.6122321",
"0.612013... | 0.70359266 | 0 |
Show the Remove All button if there are more than one entries. | function showRemoveBtn() {
if (document.getElementById('entries').childElementCount > 1) {
document.getElementById('removeBtn').style.display = 'initial';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displayDeleteAll() {\n const deleteAllBtn = document.querySelector('.deleteAll');\n // add button if guest array bigger than zero and no deleteAllButton\n if (party.guests.length && !deleteAllBtn) {\n const tableContainer = document.querySelector('#tableContainer');\n tableContainer.appendChild(... | [
"0.72400993",
"0.66364855",
"0.6522446",
"0.62390465",
"0.6174773",
"0.61586815",
"0.61159176",
"0.60888386",
"0.6069556",
"0.6066277",
"0.6054565",
"0.590161",
"0.5832153",
"0.5826949",
"0.5823255",
"0.58211416",
"0.58107257",
"0.58070296",
"0.5759274",
"0.5747089",
"0.57413... | 0.71412474 | 1 |
takes wavelength in nm and returns an rgba value adapted from | function wavelengthToColor(wavelength) {
var r, g, b, alpha, colorSpace,
wl = wavelength,
gamma = 1;
// UV to indigo:
if (wl >= 380 && wl < 440) {
R = -1 * (wl - 440) / (440 - 380);
G = 0;
B = 1;
// indigo to blue:
} else if (wl >= 440 && wl < 490) {
R = 0;
G = (wl - 440) / (490 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function wavelengthToColor(wavelength) {\n var r,g,b,alpha,\n colorSpace,\n wl = wavelength,\n gamma = 1;\n \n if (wl >= 380 && wl < 440) {\n R = -1 * (wl - 440) / (440 - 380);\n G = 0;\n B = 1;\n } else if (wl >= 440 && wl < 490) {\n R = 0;\n G = (wl - 440) ... | [
"0.7833795",
"0.7622385",
"0.6670089",
"0.6535967",
"0.64636475",
"0.6079295",
"0.60789424",
"0.6070874",
"0.6065623",
"0.5981613",
"0.5977258",
"0.5961137",
"0.59331894",
"0.5919916",
"0.5916034",
"0.5853928",
"0.58256084",
"0.5820887",
"0.58110523",
"0.57610303",
"0.5714932... | 0.7809527 | 1 |
ProgressButton: component that represents each number underneath the sudoku board. It has a progress bar on the outside showing how many of that number have been put onto the board. props: value: the number that is stored in the button. onClick: a function that executes after the component is clicked. percent: the perc... | function ProgressButton(props) {
return (
<Progress
theme={
{
error: {
symbol: props.value,
trailColor: 'rgb(240, 240, 240)',
color: 'rgb(7, 76, 188)',
},
default: {
symbol: props.value,
trailColor: 'rgb(245, 2... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"animateProgressBar() {\n const\n cardLen = this.props.cards.length, // get cardsLength\n current = this.state.current, // get current\n calcPer = (lg, sm) => lg && sm ? (sm / lg) * 100 : 0, // create func that return precen... | [
"0.65872",
"0.65730345",
"0.6360369",
"0.63334435",
"0.63189983",
"0.6311207",
"0.6309521",
"0.63063455",
"0.6296162",
"0.619475",
"0.61631364",
"0.6151493",
"0.6149023",
"0.6141332",
"0.6125544",
"0.61229694",
"0.6116238",
"0.61112714",
"0.60833883",
"0.60608685",
"0.6043936... | 0.69918656 | 0 |
handle the device information | function handle_device(topic, payload) {
var deviceID = topic[2];
if (topic[4] == "flx") flx = JSON.parse(payload);
if (topic[4] == "sensor") {
var config = JSON.parse(payload);
for (var obj in config) {
var cfg = config[obj];
if (cfg.enabl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _collectDeviceInfo() {\n _device.deviceClass = \"Handset\";\n _device.id = DeviceInfo.getUniqueID(); // Installation ID\n _device.model = DeviceInfo.getModel();\n }",
"function Device(listen_port) {\n //a basic device. Many functions are stubs an... | [
"0.6881749",
"0.6316864",
"0.6182602",
"0.6162377",
"0.6117553",
"0.6077262",
"0.60668993",
"0.6066492",
"0.60541606",
"0.60541606",
"0.60541606",
"0.60541606",
"0.60541606",
"0.60541606",
"0.6032404",
"0.60089266",
"0.5942555",
"0.5935273",
"0.59175646",
"0.5915749",
"0.5854... | 0.64631146 | 1 |
handle the sensor information | function handle_sensor(topic, payload) {
var sensor = {};
var msgType = topic[3];
var sensorId = topic[2];
if (sensors[sensorId] == null) {
sensors[sensorId] = new Object();
sensor.id = sensorId;
sensor.name = sensorId;
} else sensor = sensors[... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sensorFunc() {\n\t// calls the success callback if the sesnor is there otherwise calls error\n\t// callback\n\ttizen.humanactivitymonitor.getHumanActivityData(\"HRM\",\n\t\t\tsuccessCallbackHeart, errorCallback); // HeartRate API\n}",
"function handle_sensor(topicArray, payload) {\n // the retrieved ... | [
"0.6966615",
"0.6716126",
"0.66259146",
"0.64087725",
"0.63992155",
"0.62982756",
"0.6296216",
"0.6273894",
"0.62679636",
"0.62663",
"0.6263095",
"0.6262468",
"0.61906576",
"0.6142741",
"0.6094484",
"0.6092796",
"0.60718995",
"0.60653365",
"0.60595727",
"0.6053847",
"0.605205... | 0.68387544 | 1 |
Het gaat hier om een gepubliceerd trackModel die door de eigenaar is geprivatiseerd of defintief verwijderd heeft. De volger hoeft alleen maar de dit trackModel/trackSupModel en trackTagModellen (incl updaten van de lables in SideMenu) uit zijn stores te verwijderen. Dit trackModel is dan niet meer zichtbaar in zijn TR... | function verwijderTrack(trackModel, mode, watch) {
var q = $q.defer();
//console.warn('dataFactoryTrack verwijderTrack: ', trackModel.get('naam'));
var trackId = trackModel.get('Id');
initxData(trackModel);
//
// Clean up stores
//
loDash.remove(dataFactoryTrack.star,... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateReacties(trackModel) {\n\n //console.warn('dataFactoryTrack updateReacties naam: ', trackModel.get('naam'));\n\n var q = $q.defer();\n\n var trackId = trackModel.get('Id');\n\n var trackReacties = loDash.filter(dataFactoryTrackReactie.store, function (trackReactieModel) {\n ... | [
"0.7294336",
"0.5948411",
"0.566308",
"0.56378025",
"0.551426",
"0.5450242",
"0.5441904",
"0.54346395",
"0.53733796",
"0.53655684",
"0.5345137",
"0.5313684",
"0.5289227",
"0.5282877",
"0.5271635",
"0.5228974",
"0.5216725",
"0.5216628",
"0.521087",
"0.52106005",
"0.5206321",
... | 0.69560146 | 1 |
build a list of this object from Json object | static createListFromJson(jsonObj)
{
var answer = [];
for (var publicationIndex = 0; publicationIndex < jsonObj.length; publicationIndex++)
{
answer.push(PublicationCard.createFromJson(jsonObj[publicationIndex]));
}
return answer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static createListFromJson(jsonObj)\n\t{\n\t\tvar answer = [];\n\t\tfor (var projectIndex = 0; projectIndex < jsonObj.length; projectIndex++)\n\t\t{\n\t\t\tanswer.push(ProjectStudent.createFromJson(jsonObj[projectIndex]));\n\t\t}\n\t\treturn answer;\n\t}",
"function createData(json) {\n\tconsole.log(json);\n\tdat... | [
"0.6511763",
"0.6003714",
"0.5967254",
"0.5797491",
"0.5694719",
"0.56515944",
"0.5651211",
"0.5574462",
"0.55693215",
"0.55429196",
"0.55225444",
"0.5520386",
"0.55173886",
"0.54675996",
"0.545905",
"0.544704",
"0.5379877",
"0.5379143",
"0.53785515",
"0.537014",
"0.53679097"... | 0.6721883 | 0 |
sort according to some property list of this object | static sortByProperty(ObjList, property)
{
return ObjList.sort(function(a, b)
{
var x = a[property + ""];
var y = b[property + ""];
return ((x < y) ? -1 : ((x > y) ? 1 : 0));
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sortByProperty(property){ \n return function(a,b){ \n if(a[property] < b[property]) \n return 1; \n else if(a[property] > b[property]) \n return -1; \n \n return 0; \n ... | [
"0.73198926",
"0.7296321",
"0.7296321",
"0.72160774",
"0.7187887",
"0.71842307",
"0.7149367",
"0.7125927",
"0.70316625",
"0.69431007",
"0.68770385",
"0.68661344",
"0.6842619",
"0.683528",
"0.6831407",
"0.6830048",
"0.6805293",
"0.6801186",
"0.6793107",
"0.67834175",
"0.678119... | 0.7727587 | 0 |
filter the list according to some property and value | static filterList(objList, property, filterValue)
{
var answer = [];
for (var objIndex = 0; objIndex < objList.length; objIndex++)
{
if (objList[objIndex][property + ""] == filterValue)
{
answer.push(objList[objIndex]);
}
}
return answer;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"filter(predicate = this._compare) {\n return this._list.getValue().filter((_) => predicate(_));\n }",
"function where(list, properties, k) {\n var names = []\n return reduce(list, function(list, v, k) {\n var names = true\n for (var k in properties) {\n if (properties[k] ... | [
"0.69004273",
"0.6489177",
"0.63892597",
"0.633543",
"0.6235546",
"0.621389",
"0.610121",
"0.6040775",
"0.60404855",
"0.6020834",
"0.5991925",
"0.59573346",
"0.5935419",
"0.5934845",
"0.5932653",
"0.5930276",
"0.5890107",
"0.5890107",
"0.5890107",
"0.5890107",
"0.5890107",
... | 0.7527607 | 0 |
split list into list of lists according to some property | static splitByProperty(ObjList, property)
{
var answer = {};
var spliter = ObjList[0][property + ""];
var subGroup = [ObjList[0]];
for (var publicationIndex = 1; publicationIndex < ObjList.length; publicationIndex++)
{
if (ObjList[publicationIndex][property + ""] != spliter)
{
answer[spliter] = [..... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function groupBy2(xs, prop) {\n var grouped = {};\n for (var i=0; i<xs.length; i++) {\n var p = xs[i][prop];\n if (!grouped[p]) { grouped[p] = []; }\n grouped[p].push(xs[i]);\n }\n return grouped;\n}",
"function groupItems(list) {\n return list.reduce(function (groupedList, element) {\n var key ... | [
"0.5736494",
"0.55942863",
"0.55851495",
"0.5567104",
"0.5532998",
"0.5500809",
"0.5461137",
"0.5460786",
"0.53871804",
"0.5371475",
"0.535328",
"0.5328581",
"0.53005475",
"0.5291793",
"0.5284913",
"0.5275434",
"0.5275434",
"0.5275434",
"0.5275434",
"0.5275434",
"0.5272965",
... | 0.7096044 | 0 |
This method is used to set a custom terminal function for the push on the last created Flow in the Flow chain | setTerminalFunction(func){
if( Util.isFunction(func) )
this.terminalFunc = func;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"push(input){\n this.next !== null ? this.next.push(input) : this.terminalFunc(input);\n }",
"Push() {\n\n }",
"function Push() {\n console.debug(\"Push()\");\n}",
"static get PUSH_LEFT() { return \"pushLeft\"; }",
"function setTerminal() {\n \"use strict\";\n addInput(SHELLNEW);... | [
"0.5894712",
"0.5687585",
"0.55689806",
"0.55226415",
"0.5410262",
"0.53981024",
"0.53510433",
"0.53049326",
"0.52745247",
"0.5273706",
"0.527057",
"0.525383",
"0.5235407",
"0.520267",
"0.5181505",
"0.51257867",
"0.51084137",
"0.50890785",
"0.5045798",
"0.5039319",
"0.5020774... | 0.6085474 | 0 |
This method create a Flow from several data types. Supported data types are: Array, Flow, Map, Set, Object, FileSystem, JAMLogger | static from(data){
return FlowFactory.getFlow(data);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Flow(nodeList, flows, node, type) {\n this.nodeList = nodeList;\n this.flows = flows;\n this.node = node;\n this.type = type;\n}",
"static of(){\n if( arguments.length == 0 )\n return FlowFactory.getFlow([]);\n\n if( arguments.length > 1 )\n return... | [
"0.6014337",
"0.5861445",
"0.53727204",
"0.5016639",
"0.49903375",
"0.4984653",
"0.4975973",
"0.49730957",
"0.49730957",
"0.49670136",
"0.4927937",
"0.4919229",
"0.48817575",
"0.4831915",
"0.4805668",
"0.47669953",
"0.47496417",
"0.47432217",
"0.4739487",
"0.4725464",
"0.4701... | 0.6073683 | 0 |
This method creates a Flow using different modes from supplied arguments | static of(){
if( arguments.length == 0 )
return FlowFactory.getFlow([]);
if( arguments.length > 1 )
return FlowFactory.getFlow(arguments);
if( arguments.length == 1 && Util.isNumber(arguments[0]) )
return new IteratorFlow(FlowFactory.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createFlow() {\n // Very simple random unique ID generator\n this.formattedFlow.flowId = `${new Date().getTime()}`;\n this.formattedFlow.flowName = this.originalFlow.flow;\n this.formattedFlow.comment = this.originalFlow.comment;\n this.formattedFlow.startAt = this.originalFlow.s... | [
"0.5705125",
"0.56897783",
"0.5656588",
"0.5529257",
"0.5344734",
"0.51809794",
"0.5176161",
"0.5161175",
"0.5136103",
"0.5111144",
"0.50556713",
"0.5043777",
"0.5017146",
"0.49989784",
"0.49793434",
"0.49251306",
"0.48796272",
"0.48600587",
"0.48528117",
"0.48454717",
"0.483... | 0.5701238 | 1 |
This creates a Flow from a range of numbers. It is assumed that end > start | static fromRange(start, end){
return FlowFactory.getFlow([...new Array(end - start + 1).keys()].map((elem) => elem + start));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createRange(start, end, step) {\n return new Range(\n type.isBigNumber(start) ? start.toNumber() : start,\n type.isBigNumber(end) ? end.toNumber() : end,\n type.isBigNumber(step) ? step.toNumber() : step\n );\n }",
"function createRange(start, end, step) {\n return n... | [
"0.6557774",
"0.6553659",
"0.65510285",
"0.65236956",
"0.65049326",
"0.64819974",
"0.6318393",
"0.62468153",
"0.6182466",
"0.61631614",
"0.61609024",
"0.6149031",
"0.6106702",
"0.6085905",
"0.6048761",
"0.60284626",
"0.6016698",
"0.6012064",
"0.5992934",
"0.59705955",
"0.5959... | 0.7746055 | 0 |
This is a direct method to create a Flow from file. | static fromFile(file){
return new IteratorFlow(FlowFactory.createIteratorFromFileSystem(file));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static from(data){\n return FlowFactory.getFlow(data);\n }",
"createFlow() {\n // Very simple random unique ID generator\n this.formattedFlow.flowId = `${new Date().getTime()}`;\n this.formattedFlow.flowName = this.originalFlow.flow;\n this.formattedFlow.comment = th... | [
"0.6166627",
"0.57145196",
"0.56857115",
"0.562967",
"0.5604891",
"0.5471463",
"0.5301391",
"0.5241441",
"0.5224979",
"0.51904845",
"0.5137636",
"0.50957966",
"0.5093447",
"0.50872844",
"0.50281215",
"0.50156933",
"0.49810165",
"0.4952644",
"0.49317124",
"0.48863092",
"0.4859... | 0.70620036 | 0 |
FLOW METHODS This method restricts data operation to a certain number, starting from the first item it can see. | limit(num){
if( num <= 0 )
throw new Error("Limit value must be greater than 0");
var flow = new RangeMethodFlow(0, num);
setRefs(this, flow);
return flow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"skip(num){\n if( num <= 0 )\n throw new Error(\"Skip value must be greater than 0\");\n\n var flow = new RangeMethodFlow(num, Number.MAX_VALUE);\n setRefs(this, flow);\n\n return flow;\n }",
"function EnsureLimit() {\n\t\t\t\tif (_itemId > 10 && (... | [
"0.5690883",
"0.5311678",
"0.5290672",
"0.5168561",
"0.5142593",
"0.51268005",
"0.4991036",
"0.49759328",
"0.4947757",
"0.49148992",
"0.4912665",
"0.4898238",
"0.48551947",
"0.4844317",
"0.48417974",
"0.48272336",
"0.48217312",
"0.48174116",
"0.48081303",
"0.4784529",
"0.4756... | 0.5594103 | 1 |
Skip until the condition in the function argument returns true | skipUntil(func){
if( !Util.isFunction(func) )
throw new Error("skipUntil requires a function");
var flow = new SkipTakeWhileUntilFlow(func, 1);
setRefs(this, flow);
return flow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"skipWhile(func){\n if( !Util.isFunction(func) )\n throw new Error(\"skipWhile requires a function\");\n\n var flow = new SkipTakeWhileUntilFlow(func, 2);\n setRefs(this, flow);\n\n return flow;\n }",
"takeWhile(func){\n if( !Util.isFunc... | [
"0.7029516",
"0.6718507",
"0.67023265",
"0.66092503",
"0.65189856",
"0.65189856",
"0.65139866",
"0.6432234",
"0.6400434",
"0.6175636",
"0.6145253",
"0.6144896",
"0.61159474",
"0.6108472",
"0.6106238",
"0.60610074",
"0.6059095",
"0.6037861",
"0.6037861",
"0.60053694",
"0.59980... | 0.6817808 | 1 |
Skip while the condition in the function argument returns true | skipWhile(func){
if( !Util.isFunction(func) )
throw new Error("skipWhile requires a function");
var flow = new SkipTakeWhileUntilFlow(func, 2);
setRefs(this, flow);
return flow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"skip(opSt) { return false; }",
"takeWhile(func){\n if( !Util.isFunction(func) )\n throw new Error(\"takeWhile requires a function\");\n\n var flow = new SkipTakeWhileUntilFlow(func, 4);\n setRefs(this, flow);\n\n return flow;\n }",
"async resolv... | [
"0.6879535",
"0.6777159",
"0.66293716",
"0.65964663",
"0.6511093",
"0.6500644",
"0.6500644",
"0.64705396",
"0.62586856",
"0.62370336",
"0.62226963",
"0.6222539",
"0.61811286",
"0.61511815",
"0.6101928",
"0.6062624",
"0.60604185",
"0.6048583",
"0.5979251",
"0.5973103",
"0.5966... | 0.7103854 | 0 |
Alias of foreach for those familiar with the JS forEach | forEach(func){
this.foreach(func);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ForEach() {}",
"function forEach(arr, fun) { return HTMLCollection.prototype.each.call(arr, fun); }",
"function foreach(a, f) {\n for (var i = 0; i < a.length; i++) {\n f(a[i]);\n }\n}",
"forEach(callback, thisArg = undefined) {\n let i = 0;\n for (let p in this)\n call... | [
"0.7932546",
"0.7412556",
"0.73404443",
"0.7309132",
"0.7269947",
"0.7161315",
"0.7154374",
"0.7056756",
"0.7028455",
"0.69966483",
"0.6978964",
"0.69717395",
"0.6971216",
"0.69622266",
"0.69577485",
"0.6856901",
"0.6834711",
"0.6832951",
"0.6823172",
"0.6802958",
"0.67939556... | 0.7717121 | 1 |
This function is used to set the linked references for Flows (like LinkedLists) | function setRefs(primary, secondary){
secondary.prev = primary;
primary.next = secondary;
secondary.rootFlow = primary.rootFlow;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setReferences(currentId) {\n if (!(this.referencedVariables[currentId].originalIds.length === 1\n && this.referencedVariables[currentId].originalIds[0] === currentId)) {\n this.referencedVariables[currentId].originalIds.forEach((d) => {\n this.setReferences(d);\n ... | [
"0.6091946",
"0.6017897",
"0.59291023",
"0.5927652",
"0.5911776",
"0.59032995",
"0.58989304",
"0.58872604",
"0.58802027",
"0.5861781",
"0.58299994",
"0.5828967",
"0.57657737",
"0.5746016",
"0.5735655",
"0.5723207",
"0.57144654",
"0.56937146",
"0.56832844",
"0.56626827",
"0.56... | 0.6770335 | 0 |
This method is used to determine if data is pushed on this IteratorFlow as a stream | isStream(){
return this.iterators.length > 0 && this.iterators[0].streamer && Util.isStreamer(this.iterators[0].streamer);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hasPipeDataListeners(stream){var listeners=stream.listeners('data');for(var i=0;i<listeners.length;i++){if(listeners[i].name==='ondata'){return true;}}return false;}",
"_doPush(){//This works best for streaming from filesystem (since it is static/finite) and JS generators too...\n var obj;\n\... | [
"0.65608674",
"0.6411723",
"0.6329973",
"0.6166335",
"0.61634654",
"0.6122687",
"0.6122133",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
"0.6107537",
... | 0.7266703 | 0 |
This methods merges another data input on the current stream. It is only available to IteratorFlow We can not merge Streamers with other data types | merge(data){
var isStream = this.isStream();
var iterator = FlowFactory.getIterator(data);
//ensure that we cannot mix streams and static data structures
if( (!isStream && iterator.streamer)
|| (isStream && !iterator.streamer) )
throw new ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function merge$() {\n\tfor (var _len = arguments.length, streams = Array(_len), _key = 0; _key < _len; _key++) {\n\t\tstreams[_key] = arguments[_key];\n\t}\n\n\tvar values = streams.map(function (parent$) {\n\t\treturn parent$.value;\n\t});\n\tvar newStream = stream(values);\n\tstreams.forEach(function triggerMerg... | [
"0.6134648",
"0.6035722",
"0.58465743",
"0.5826035",
"0.5820796",
"0.5814241",
"0.56638765",
"0.56244284",
"0.5609664",
"0.55938804",
"0.5549562",
"0.5514483",
"0.5475858",
"0.5460846",
"0.5442579",
"0.5441733",
"0.54165757",
"0.5394357",
"0.5347644",
"0.53381926",
"0.5338192... | 0.7981541 | 0 |
This method is used by OutFlow to trigger the start of a push flow for finite data and for JS generators | _doPush(){//This works best for streaming from filesystem (since it is static/finite) and JS generators too...
var obj;
if( !this.isDiscretized ) {
while(true) {
if (!this.isListening || this.pos >= this.iterators.length)
break;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"begin() {\n //for (let [, arr] of this.arrangements.filter(a => a.at === this.iterations && a.when === \"start\")) arr.exe();\n this.engine.phases.current = this;\n this.engine.events.emit(this.name, this);\n }",
"_definitelyPush() {\n\t\t// create copy of collected chunks to be pushed as... | [
"0.57655185",
"0.5632301",
"0.5508445",
"0.54772514",
"0.5462174",
"0.5454371",
"0.53902304",
"0.538924",
"0.5375783",
"0.53715616",
"0.5368803",
"0.53670794",
"0.5361112",
"0.532122",
"0.52992535",
"0.528071",
"0.5265861",
"0.525854",
"0.5254401",
"0.52314043",
"0.52100694",... | 0.6006543 | 0 |
This method subscribes a Flow (IteratorFlow) to a Streamer to listen for data changes This method is placed outside the class to prevent external access | function subscribeToStream(streamer, flow){
var func = function(data){
setTimeout(() => flow._prePush(data, streamer), 0);
};
streamer.subscribe(func);
flow.subscribers[streamer.key] = func;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_listen(){\n if( this.isDiscretized ) {//for discretized flows...maintain the subscription state for consistency\n var streamers = []; //the order with which we should arrange data in discretized flows\n\n for (let iterator of this.iterators) {\n if (it... | [
"0.65513027",
"0.5845343",
"0.5828928",
"0.58125",
"0.5673418",
"0.56472117",
"0.5590598",
"0.5556058",
"0.5555709",
"0.55441004",
"0.5483723",
"0.5482346",
"0.5442747",
"0.54296744",
"0.5423778",
"0.5405285",
"0.53719753",
"0.53719753",
"0.5355241",
"0.5355241",
"0.5355241",... | 0.5941531 | 1 |
This method should be called by your internal implementation to send data to listeners like the InFlow and/or IteratorFlow | send(data){
Flow.from(this.listeners).where(listener => listener.notify && Util.isFunction(listener.notify)).foreach(listener => listener.notify(data));
Flow.from(this.listeners).where(listener => !(listener.notify && Util.isFunction(listener.notify)) && Util.isFunction(listener)).foreach(listen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dispatch(data) {\n this._receiveListener(data);\n }",
"onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }",
"onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }",
"onData(data) {\n this.emit(\"data\", data);\n this.onSuccess();\n }",
... | [
"0.64082885",
"0.62990487",
"0.62565744",
"0.6215769",
"0.6215769",
"0.6215769",
"0.61426413",
"0.60756236",
"0.60725445",
"0.6047418",
"0.6030183",
"0.6023809",
"0.5988507",
"0.59221447",
"0.59221447",
"0.59221447",
"0.59020776",
"0.59020776",
"0.5895517",
"0.588165",
"0.586... | 0.73781633 | 0 |
Generate HTML and JSON reports | async report() {
const { logger, db } = this[OPTIONS];
const testedPages = await db.read('tested_pages');
logger.info('Saving JSON report');
const json = new JSONReporter(this[OPTIONS]);
await json.open();
await json.write(testedPages);
await json.close();
logger.info('Saving HTML Repo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static generateHTMLReport(capabilities) {\n const os = require(\"os\");\n\n report.generate({\n jsonDir: path.resolve('./test/'),\n reportPath: path.resolve('./test/'),\n metadata: {\n browser: {\n name: capabilities.get('browserName'... | [
"0.6794463",
"0.66173285",
"0.6382862",
"0.6302422",
"0.6292933",
"0.62754923",
"0.62583613",
"0.62321824",
"0.6148897",
"0.6145369",
"0.60203487",
"0.6013818",
"0.5989477",
"0.59849805",
"0.59810555",
"0.59620833",
"0.5927691",
"0.5901185",
"0.58981466",
"0.58895123",
"0.588... | 0.74107265 | 0 |
///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ////////... | function settingDialog(exportInfo) {
dlgMain = new Window("dialog", strTitle);
dlgMain.orientation = 'column';
dlgMain.alignChildren = 'left';
// -- top of the dialog, first line
dlgMain.add("statictext", undefined, strLabelDestination);
// -- two groups, one for left and one for right ok, ca... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function settingDialog(exportInfo) { //设置对话框\n\n\tvar brush,\n\t\tdestination,\n\t\tresult,\n\t\ttestFolder;\n\n\tdlgMain = new Window('dialog', strTitle);\n\n\t// match our dialog background color to the host application\n\tbrush = dlgMain.graphics.newBrush(dlgMain.graphics.BrushType.THEME_COLOR, 'appDialogBackgr... | [
"0.83063394",
"0.7474406",
"0.6514149",
"0.63470656",
"0.6144442",
"0.6022726",
"0.5980467",
"0.59690773",
"0.5906276",
"0.5866956",
"0.5866837",
"0.58417386",
"0.5814656",
"0.5791883",
"0.5779246",
"0.5757548",
"0.5751364",
"0.57504123",
"0.5745105",
"0.5728416",
"0.57019114... | 0.7999531 | 1 |
Function: btnRunOnClick Usage: routine is assigned to the onClick method of the run button Input: checks the dialog params and closes with the dialog with true Return: , dialog is closed with true on success | function btnRunOnClick() {
// check if the setting is properly
var destination = dlgMain.etDestination.text;
if (destination.length == 0) {
alert(strAlertSpecifyDestination);
return;
}
var testFolder = new Folder(destination);
if (!testFolder.exists) {
alert(strA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onRunButtonPress() {\n\tif (!validateSettings()) return;\n\tdlgMain.close(runButtonID);\n}",
"function runOperation() {\n\tsetConfig();\n\tcreatePrints();\n\trunDialog.close();\n}",
"function ClickOnStartContinue()\n{\n if(Btn_Start_Continue.Exists)\n {\n Btn_Start_Continue.ClickButton()\n Log... | [
"0.71719664",
"0.6129805",
"0.6078865",
"0.6034298",
"0.596392",
"0.58390397",
"0.5809481",
"0.5804938",
"0.57655156",
"0.57511175",
"0.57294905",
"0.57183695",
"0.57056075",
"0.567636",
"0.5615213",
"0.5606421",
"0.56009555",
"0.5593158",
"0.55565405",
"0.5554577",
"0.554519... | 0.6612402 | 1 |
Function: btnBrowseOnClick Usage: routine is assigned to the onClick method of the browse button Input: pop the selectDialog, and get a folder Return: , sets the destination edit text | function btnBrowseOnClick()
{
var defaultFolder = dlgMain.etDestination.text;
var testFolder = new Folder(dlgMain.etDestination.text);
if (!testFolder.exists) defaultFolder = "~";
var selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder);
if (selFolder != null) {
dlgMain... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onBrowseButtonPress(){\n\tvar defaultFolder = dlgMain.grpDestination.field.text;\n\tvar testFolder = new Folder(defaultFolder);\n\tif (!testFolder.exists) {\n\t\tdefaultFolder = \"~\";\n\t}\n\tvar selFolder = Folder.selectDialog(strTitleSelectDestination, defaultFolder);\n\tif ( selFolder != null ) {\n\t\... | [
"0.80689317",
"0.71014553",
"0.69558316",
"0.6892214",
"0.6866621",
"0.6721307",
"0.6530963",
"0.6507591",
"0.65049386",
"0.64399964",
"0.6425381",
"0.64203185",
"0.64085335",
"0.64076823",
"0.6369404",
"0.63565904",
"0.63387996",
"0.6298164",
"0.6255021",
"0.6253249",
"0.608... | 0.84480196 | 0 |
Function: ExportInfo Usage: object for holding the dialog parameters Input: Return: object holding the export info | function ExportInfo() {
this.destination = new String("");
this.selectionOnly = false;
this.style = new String(strStyle);
try {
this.destination = Folder(app.activeDocument.fullName.parent).fsName;
}
catch(someError) {
// do nothing, stop error propagation only
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ui_settingsDialog(exportInfo) {\n\n\t// Configure the dialog\n\tvar res = String(\" \\\n\t\tdialog { \\\n\t\t\ttext: '\"+strTitle+\"', \\\n\t\t\torientation: 'column', \\\n\t\t\talignChildren: 'left', \\\n\t\t\tgrpDestination: Group { \\\n\t\t\t\tlabel: StaticText { text: '\"+ escapeString(strLabelDestina... | [
"0.69108146",
"0.6871796",
"0.6547925",
"0.6397909",
"0.6269094",
"0.61239517",
"0.60223556",
"0.59475535",
"0.5934391",
"0.58898175",
"0.583196",
"0.5742452",
"0.5728104",
"0.5722974",
"0.57212543",
"0.57168704",
"0.5666863",
"0.5636692",
"0.56313735",
"0.56248724",
"0.56095... | 0.7097998 | 0 |
Function: getTempFolder Usage: create a temp folder using random numbers Input: none Return: a new blank folder to put files in temporarily | function getTempFolder()
{
var tempLocation;
var folder = Folder.temp; // File(exportInfo.destination).parent;
while(true) { // set temporary folder with random name
tempLocation = folder.toString() + "/temp" + Math.floor(Math.random()*10000);
var testFolder = new Folder(tempLocation... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findRandomTemporaryDirectory() {\n const randomName = crypto.randomBytes(32).toString('hex')\n const temporaryPath = path.join(libraryBasePath, randomName)\n if (fs.existsSync(temporaryPath)) {\n return findRandomTemporaryDirectory()\n }\n\n return temporaryPa... | [
"0.7303385",
"0.72429144",
"0.7017715",
"0.6708041",
"0.6699022",
"0.648603",
"0.64061487",
"0.6265706",
"0.62408775",
"0.60809445",
"0.6061852",
"0.5997148",
"0.5990174",
"0.59865415",
"0.59748805",
"0.59659344",
"0.589774",
"0.5894593",
"0.5851076",
"0.5811833",
"0.57738626... | 0.84796 | 0 |
Function: objectToDescriptor Usage: create an ActionDescriptor from a JavaScript Object Input: JavaScript Object (o) Pre process converter (f) Return: ActionDescriptor NOTE: Only boolean, string, and number are supported, use a pre processor to convert (f) other types to one of these forms. | function objectToDescriptor (o, f) {
if (undefined != f) {
o = f(o);
}
var d = new ActionDescriptor;
var l = o.reflect.properties.length;
for (var i = 0; i < l; i++ ) {
var k = o.reflect.properties[i].toString();
if (k == "__proto__" || k == "__count__" || k == "__class__" || k == "reflect")
cont... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function descriptorToObject (o, d, f) {\r\n\tvar l = d.count;\r\n\tfor (var i = 0; i < l; i++ ) {\r\n\t\tvar k = d.getKey(i); // i + 1 ?\r\n\t\tvar t = d.getType(k);\r\n\t\tstrk = app.typeIDToStringID(k);\r\n\t\tswitch (t) {\r\n\t\t\tcase DescValueType.BOOLEANTYPE:\r\n\t\t\t\to[strk] = d.getBoolean(k);\r\n\t\t\t\t... | [
"0.62795913",
"0.58345985",
"0.5788902",
"0.57155055",
"0.57155055",
"0.5026582",
"0.49509013",
"0.49452564",
"0.4928153",
"0.47949854",
"0.47505236",
"0.46887055",
"0.46710858",
"0.46704477",
"0.4661458",
"0.4661458",
"0.4661458",
"0.4661458",
"0.4661458",
"0.46578354",
"0.4... | 0.8270871 | 0 |
Function: descriptorToObject Usage: update a JavaScript Object from an ActionDescriptor Input: JavaScript Object (o), current object to update (output) Photoshop ActionDescriptor (d), descriptor to pull new params for object from JavaScript Function (f), post process converter utility to convert Return: Nothing, update... | function descriptorToObject (o, d, f) {
var l = d.count;
for (var i = 0; i < l; i++ ) {
var k = d.getKey(i); // i + 1 ?
var t = d.getType(k);
strk = app.typeIDToStringID(k);
switch (t) {
case DescValueType.BOOLEANTYPE:
o[strk] = d.getBoolean(k);
break;
case DescValueType.STRINGTYPE:
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function objectToDescriptor (o, f) {\r\n\tif (undefined != f) {\r\n\t\to = f(o);\r\n\t}\r\n\tvar d = new ActionDescriptor;\r\n\tvar l = o.reflect.properties.length;\r\n\tfor (var i = 0; i < l; i++ ) {\r\n\t\tvar k = o.reflect.properties[i].toString();\r\n\t\tif (k == \"__proto__\" || k == \"__count__\" || k == \"_... | [
"0.75533724",
"0.6569119",
"0.5526549",
"0.51103747",
"0.5047909",
"0.4884658",
"0.48834768",
"0.4799259",
"0.4798489",
"0.4789828",
"0.47839227",
"0.47755012",
"0.47672334",
"0.47672334",
"0.4724588",
"0.46902186",
"0.46416414",
"0.4628304",
"0.45911044",
"0.4453492",
"0.443... | 0.718284 | 1 |
Function: StrToIntWithDefault Usage: convert a string to a number, first stripping all characters Input: string and a default number Return: a number | function StrToIntWithDefault( s, n ) {
var onlyNumbers = /[^0-9]/g;
var t = s.replace( onlyNumbers, "" );
t = parseInt( t );
if ( ! isNaN( t ) ) {
n = t;
}
return n;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function strToIntWithDefault(s, n) { //把字符串转换为数字\n\n\tvar onlyNumbers = /[^0-9]/g,\n\t\tt = s.replace(onlyNumbers, '');\n\n\tt = parseInt(t, 10);\n\n\tif (!isNaN(t)) {\n\t\tn = t;\n\t}\n\n\treturn n;\n}",
"function TryParseInt(str, defaultValue){\n var retValue = defaultValue;\n if(str != null){\n i... | [
"0.82995236",
"0.6905283",
"0.67226857",
"0.66155624",
"0.66009635",
"0.65952545",
"0.6586593",
"0.6560997",
"0.6512591",
"0.64873964",
"0.6486105",
"0.64746135",
"0.6465985",
"0.6452506",
"0.6438687",
"0.6436834",
"0.6375978",
"0.6341577",
"0.63101",
"0.6306241",
"0.6300914"... | 0.83300906 | 0 |
Takes a lock object, and sends a request to that lock to unlock | function unlock_lock(lock, callback) {
let str = JSON.stringify({
Action: "TOGGLE"
})
send_command(lock, str)
callback(f.hacker.verb())
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async unlock() {\n\t\tif (this.lock_status_id === 2) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(1);\n\t\tawait this.await_event('status:UNLOCKED');\n\t}",
"unlock() {\n this.locked = 0\n }",
"unlock() {\n this.isLocked = false;\n this.refreshState();\n }",
"unlock() {\n Atomics.... | [
"0.6994963",
"0.66803813",
"0.66722",
"0.66555375",
"0.66543484",
"0.6508819",
"0.639839",
"0.615003",
"0.6100489",
"0.6085905",
"0.60403425",
"0.59574896",
"0.5905636",
"0.58783865",
"0.5866898",
"0.5821947",
"0.5785694",
"0.5782023",
"0.5712773",
"0.5666819",
"0.564414",
... | 0.6942008 | 1 |
To check for presence of diamond on click | function checkForDiamond (e) {
let elementToCheck = e.srcElement
let elementPosition = elementToCheck.getBoundingClientRect()
let elementPositionObj = {
cellPositionTop: parseInt(elementPosition.top),
cellPositionLeft: parseInt(elementPosition.left)
}
elementToCheck.classList.remove('unk... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkDiamond(elem, diamondPos) {\n\n /** If the square is already checked, then don't check again*/\n if(elem.classList.contains(\"done\") || this.gameOver)\n {\n return;\n }\n\n let isDiamond = false;\n let x = elem.getAttribute(\"x\");\n let y = elem.getAttribute(\"y\");\n let dIndex... | [
"0.68239886",
"0.6273277",
"0.6249081",
"0.60598344",
"0.60344017",
"0.60270023",
"0.6007742",
"0.599134",
"0.5991333",
"0.5940339",
"0.58954006",
"0.58666563",
"0.5865667",
"0.58490616",
"0.58330333",
"0.58104396",
"0.575806",
"0.5751387",
"0.5733285",
"0.5723229",
"0.570578... | 0.70848995 | 0 |
get list of all indexers | async function getAllIndexers() {
const url = getIndexerUrl();
const indexerList = await getData({ uri: url });
return indexerList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getIndexerValue() {\n const indexers = this._indexers,\n result = [];\n\n for (let i = 0; i < indexers.length; i++) {\n result.push(indexers[i].val());\n }\n\n return result;\n }",
"getIndices() {\n return this._registry.get('properties', 'schemaData', { in... | [
"0.6700296",
"0.6373289",
"0.5961235",
"0.5952486",
"0.58707345",
"0.5865344",
"0.58385175",
"0.5815432",
"0.57516646",
"0.5702357",
"0.5625296",
"0.55507374",
"0.55507374",
"0.5531465",
"0.54669195",
"0.5431267",
"0.5422411",
"0.5420051",
"0.54129714",
"0.54033834",
"0.53877... | 0.8348808 | 0 |
GET One Todo with the provided ID | function readOne(req, res, next) {
todoRepository.findOne({
_id: req.params.id
}, function (err, todos) {
if (err) {
res.send(err);
}
else {
res.json(todos);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getTodoById(id) {\n for (const i in todos) {\n const todo = todos[i];\n debugVar = todo;\n return todo;\n }\n\n if (todo.id === id) {\n return todo;\n }\n\n return null;\n }",
"function selectATodo(todo_id) {\n return d... | [
"0.7446939",
"0.720031",
"0.69799197",
"0.6963429",
"0.68636817",
"0.67221177",
"0.67046577",
"0.6697848",
"0.66908777",
"0.6569379",
"0.6531879",
"0.6494542",
"0.6489736",
"0.6485646",
"0.6426763",
"0.641737",
"0.64111006",
"0.64087814",
"0.63859665",
"0.63856345",
"0.634991... | 0.74806696 | 0 |
globally initializing the styleIds array | function initStyles() { // function for getting the ids from the local storage into the styleIds array
var storedNames = JSON.parse(localStorage.getItem("styles") || '[]');
styleIds = storedNames.map(element => JSON.parse(element).id);
console.log('styleIds'.styleIds)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static get styles() { return []; }",
"setupStyles_() {\n if (this.styles_.length) {\n return;\n }\n\n for (let i = 0, size; size = this.sizes[i]; i++) {\n this.styles_.push({\n url: `${this.imagePath_ + (i + 1)}.${this.imageExtension_}`,\n height: size,\n width: size\n ... | [
"0.67286617",
"0.6711965",
"0.62842315",
"0.6019971",
"0.59924304",
"0.59844387",
"0.59844387",
"0.59195125",
"0.5919479",
"0.59068644",
"0.5899297",
"0.5859986",
"0.5847478",
"0.580809",
"0.5790694",
"0.5790694",
"0.5790694",
"0.5787608",
"0.576951",
"0.57650995",
"0.5765099... | 0.74856 | 0 |
Check for threads that are scheduled to be closed and close them | async function applyScheduledCloses() {
const threadsToBeClosed = await threads.getThreadsThatShouldBeClosed();
for (const thread of threadsToBeClosed) {
const closeMode = thread.scheduled_close_silent;
if (config.closeMessage && ! closeMode & SCHEDULED_CLOSE_MODE.SILENT) {
const closeMessa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function applyScheduledCloses() {\r\n const threadsToBeClosed = await threads.getThreadsThatShouldBeClosed();\r\n for (const thread of threadsToBeClosed) {\r\n if (config.closeMessage && ! thread.scheduled_close_silent) {\r\n const closeMessage = utils.readMultilineConfigValue(config.closeM... | [
"0.72873867",
"0.59656674",
"0.57460296",
"0.5633413",
"0.5598141",
"0.54074544",
"0.53801537",
"0.535614",
"0.5314782",
"0.5295674",
"0.52796066",
"0.527865",
"0.5245535",
"0.5244968",
"0.51843786",
"0.51372606",
"0.51300836",
"0.5121815",
"0.50970364",
"0.5092351",
"0.50802... | 0.7417025 | 0 |
Fetch all posts created by a user | posts(user) {
return user.getPosts();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPosts(){\n var posts = [];\n var currentUserId = Meteor.userId();\n \n // display only user's posts if currently logged in\n if (currentUserId){\n posts = Posts.find({owner: currentUserId}, {sort: {creationDate: -1}});\n } else {\n posts = Posts.find({}, {sort: {creationDate: -1}});\n }\n ... | [
"0.74919844",
"0.74148387",
"0.7263313",
"0.72552896",
"0.7079012",
"0.7008244",
"0.70023364",
"0.69027275",
"0.686663",
"0.6862673",
"0.6860463",
"0.6856039",
"0.6796464",
"0.67176944",
"0.66719204",
"0.6638497",
"0.6590459",
"0.6585281",
"0.65516216",
"0.65416783",
"0.65274... | 0.7831254 | 0 |
Label with required field display, htmlFor, and block styling | function Label(_ref) {
var htmlFor = _ref.htmlFor,
label = _ref.label,
required = _ref.required;
return _react.default.createElement("label", {
style: {
display: "block"
},
htmlFor: htmlFor
}, label, " ", required && _react.default.createElement("span", {
style: {
color: "r... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function FieldLabel({ model }) {\n const { label, isMandatory } = model;\n\n if (!label || label.length === 0) {\n return null;\n }\n return (\n <div className=\"ff-field-label\" >\n {label}\n {(isMandatory) && (\n <span className=\"ff-field-mandatory\... | [
"0.670288",
"0.60990804",
"0.5998615",
"0.5868826",
"0.5847852",
"0.5778551",
"0.5767557",
"0.5738318",
"0.568455",
"0.5545074",
"0.5482438",
"0.54752636",
"0.5445866",
"0.5419466",
"0.5392262",
"0.5384172",
"0.5381788",
"0.5366222",
"0.53472376",
"0.5327174",
"0.53151035",
... | 0.63564664 | 1 |
Create a function that takes a number (step) as an argument and returns the number of matchsticks in that step. See step 1, 2 and 3 in the image above. | function matchHouses(step) {
if (step === 0){
return 0;
} else {
return (5 * step) + 1
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function numWays(steps){\n var stairs = new Array(steps+1);\n stairs[0] = 1;\n stairs[1] = 1;\n for(var i=2;i<stairs.length;i++){\n stairs[i] = stairs[i-1]+stairs[i-2];\n }\n return stairs[steps]\n}",
"function stepsCount(num, steps) {\n if (num <= 0) return;\n if (num === 1) {\n ... | [
"0.6326018",
"0.62703425",
"0.61365795",
"0.6103491",
"0.60844654",
"0.60844654",
"0.60844654",
"0.59861463",
"0.5896685",
"0.58959943",
"0.5886099",
"0.5827093",
"0.57891214",
"0.57764864",
"0.57749146",
"0.5746566",
"0.57333976",
"0.56991816",
"0.56991816",
"0.56991816",
"0... | 0.7258101 | 0 |
prints the deck of card objects | print_deck() {
if (this.deck.length === 0) {
console.log(
"Deck has not been generated. Call generate_deck() on deck object before continuing.",
)
} else {
for (let c = 0; c < this.deck.length; c++) {
console.log(this.deck[c])
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"printDeck(){\n console.log(\"Printing deck..\");\n for (const card of this.cards){\n card.displayCard();\n }\n // for (let i=0; i < this.cards.length; i++){\n // console.log(`${i+1}:${this.cards[i]}`);\n //}\n }",
"function printDeck() {\n var resul... | [
"0.7851098",
"0.75887036",
"0.7290327",
"0.723787",
"0.7114862",
"0.6987267",
"0.6956463",
"0.6883937",
"0.6878408",
"0.6862186",
"0.6740982",
"0.6673502",
"0.6654526",
"0.6578331",
"0.65128076",
"0.64945745",
"0.6441548",
"0.6438234",
"0.64375144",
"0.6435145",
"0.64243954",... | 0.8022254 | 0 |
FIND // FROM, SELECT, CALLBACK | static find(from, select, callback) {
find(from, {}, select, {}, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static findOne(from, select, callback) {\n findOne(from, {}, select, {}, callback);\n }",
"static findWhere(from, select, where, callback) {\n find(from, where, select, {}, callback);\n }",
"static findOneWhere(from, select, where, callback) {\n findOne(from, wher... | [
"0.70508325",
"0.69658035",
"0.6775976",
"0.67516553",
"0.63515645",
"0.6249541",
"0.62335974",
"0.6201742",
"0.6182281",
"0.61668193",
"0.60927075",
"0.6061717",
"0.6053274",
"0.6053274",
"0.599711",
"0.5993098",
"0.5993098",
"0.59373194",
"0.59373194",
"0.58883005",
"0.5881... | 0.7520128 | 0 |
FROM, SELECT, WHERE, ORDERBY, CALLBACK | static findWhereOrder(from, select, where, orderby, callback) {
find(from, where, select, orderby, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ... | [
"0.61639965",
"0.6125367",
"0.5998499",
"0.5948966",
"0.5885602",
"0.58367777",
"0.58326936",
"0.57719743",
"0.5720882",
"0.5657524",
"0.56434005",
"0.5624733",
"0.5588958",
"0.55889195",
"0.55826503",
"0.558083",
"0.55767155",
"0.5570669",
"0.5560254",
"0.5554302",
"0.551882... | 0.6181167 | 0 |
FIND ONE // FROM, SELECT, CALLBACK | static findOne(from, select, callback) {
findOne(from, {}, select, {}, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static find(from, select, callback) {\n find(from, {}, select, {}, callback);\n }",
"static findOneWhere(from, select, where, callback) {\n findOne(from, where, select, {}, callback);\n }",
"function find() {}",
"static findWhere(from, select, where, callback) {\n ... | [
"0.7305295",
"0.718484",
"0.6932672",
"0.6691217",
"0.64910847",
"0.644256",
"0.64323795",
"0.630001",
"0.6285284",
"0.6285284",
"0.6278437",
"0.6244728",
"0.6244728",
"0.6239255",
"0.6239255",
"0.6237212",
"0.6205782",
"0.61498463",
"0.6144593",
"0.61239946",
"0.60439783",
... | 0.75772613 | 0 |
FIND INNER JOIN // FROM, SELECT, JOIN, CALLBACK | static findInnerJoin(from, select, join, callback) {
findInnerJoin(from, {}, select, join, {}, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static findInnerJoinWhere(from, select, where, join, callback) {\n findInnerJoin(from, where, select, join, {}, callback);\n }",
"static findInnerJoinWhereOrder(from, select, where, join, orderby, callback) {\n findInnerJoin(from, where, select, join, orderby, callback);\n }",... | [
"0.7549586",
"0.69616145",
"0.6910877",
"0.60859513",
"0.57186496",
"0.5668827",
"0.56324303",
"0.5555086",
"0.5535045",
"0.5451174",
"0.5352476",
"0.5272109",
"0.51424843",
"0.51024616",
"0.5095254",
"0.5060973",
"0.50348043",
"0.5022924",
"0.49924514",
"0.4932506",
"0.49254... | 0.78167605 | 0 |
FROM, SELECT, JOIN, ORDERBY, CALLBACK | static findInnerJoinOrder(from, select, join, orderby, callback) {
findInnerJoin(from, {}, select, join, orderby, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ... | [
"0.58848023",
"0.57687473",
"0.5705418",
"0.5487354",
"0.5480866",
"0.54615325",
"0.54339117",
"0.5423955",
"0.53772235",
"0.5350298",
"0.53425974",
"0.5338893",
"0.5319425",
"0.5319411",
"0.5313796",
"0.5313753",
"0.5251842",
"0.5248762",
"0.5232248",
"0.5194783",
"0.5174864... | 0.5788549 | 1 |
FROM, SELECT, WHERE, JOIN, ORDERBY, CALLBACK | static findInnerJoinWhereOrder(from, select, where, join, orderby, callback) {
findInnerJoin(from, where, select, join, orderby, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"queryAll(callback) {\r\n var self = this;\r\n this.table.findAll(this.select)\r\n .then(function (data) {\r\n self.data = data;\r\n callback(self);\r\n },\r\n function (err) {\r\n localData = { error: err };\r\n ... | [
"0.60357344",
"0.57442415",
"0.5700293",
"0.5689771",
"0.5654416",
"0.56365913",
"0.55299103",
"0.5524143",
"0.54805267",
"0.5469346",
"0.5459586",
"0.5427421",
"0.5328001",
"0.53189456",
"0.5310093",
"0.53100014",
"0.52856827",
"0.5280557",
"0.52684355",
"0.52655685",
"0.525... | 0.57911855 | 1 |
FIND LEFT JOIN // FROM, SELECT, JOIN, CALLBACK | static findLeftJoin(from, select, join, callback) {
findLeftJoin(from, {}, select, join, {}, callback);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static findLeftJoinWhere(from, select, where, join, callback) {\n findLeftJoin(from, where, select, join, {}, callback);\n }",
"static findLeftJoinOrder(from, select, join, orderby, callback) {\n findLeftJoin(from, {}, select, join, orderby, callback);\n }",
"static findLeft... | [
"0.7722422",
"0.71773404",
"0.7132845",
"0.5753619",
"0.57143575",
"0.5251691",
"0.5065213",
"0.49813566",
"0.49480498",
"0.48615816",
"0.47994074",
"0.47624263",
"0.47337973",
"0.46875355",
"0.4653055",
"0.46352357",
"0.46176502",
"0.4595695",
"0.45810297",
"0.45780098",
"0.... | 0.7944322 | 0 |
UPDATE // TABLE, UPDATES, WHERE, CALLBACK | static update(table, updates, query, callback) {
if (table.length === 0 || updates.length === 0 || query.length === 0) {
return;
}
let options = [table];
let sql = 'UPDATE ?? SET ';
let sets = [];
for (let key in updates) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateData(sqlQuery, obj, callback){\r\n console.log(\"\\nSQL Query::\"+sqlQuery);\r\n connMgr.getConn(function (connection) {\r\n connection.query(sqlQuery, obj, function(err,res){\r\n if(err) throw err;\r\n if(callback)callback();\r\n console.log('Changed ' ... | [
"0.692523",
"0.6757804",
"0.66608644",
"0.66053283",
"0.65152186",
"0.6473978",
"0.64712006",
"0.64691204",
"0.64691204",
"0.64691204",
"0.6465907",
"0.643347",
"0.6372709",
"0.6261236",
"0.62578446",
"0.6214459",
"0.6213561",
"0.619379",
"0.61779755",
"0.61732286",
"0.614786... | 0.685313 | 1 |
CREATE UPDATE // TABLE, DATA, CALLBACK | static createUpdate(table, data, callback) {
if (table.length === 0 || data.length === 0) {
return;
}
let options = [table];
let sql = 'INSERT INTO ?? (';
let sets = [];
let setValues = [];
if (!Array.isArray(data)) ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateData(id, data, userID, _callback) {\n db.transaction(\n tx => {\n tx.executeSql('update images set photo = ?, name = ?, description = ?, price = ?, address = ? where id = ?', [data[0], data[1], data[2], data[3], data[4], id], () => {\n this.insertIntoLog(userID, \"edit data : \" + dat... | [
"0.6365311",
"0.63515353",
"0.6273513",
"0.62477237",
"0.623554",
"0.6218646",
"0.6218646",
"0.6218646",
"0.6214957",
"0.6201936",
"0.6128711",
"0.610704",
"0.6089083",
"0.60854906",
"0.60675275",
"0.60041606",
"0.5985274",
"0.5971839",
"0.59590966",
"0.59426886",
"0.5935435"... | 0.68953604 | 0 |
fyi: ALL fields must be present in the bo (for it to be created correctly if necessary) but that makes the matching unrealistic/undesired. Thus this method is likely practically unusable. | getMatchOrCreate(bo) {
return this.getMatching(bo).then(obj => {
let matchingBo;
try {
matchingBo = obj.val();
} catch (_err) {}
if (matchingBo) {
return Right(matchingBo);
}
return this.create(bo);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static assertFieldsExist(fields = []) {\n if (fields === RETURNS_ALL_FIELDS) {\n return;\n }\n\n const modelFields = this.fields();\n\n // Ensure that all fields are defined within our model\n const missing = fields.reduce((missing, field) => {\n if (modelFields.indexOf(field... | [
"0.5737411",
"0.5457191",
"0.5374542",
"0.5360257",
"0.53312933",
"0.5265744",
"0.51736456",
"0.51610607",
"0.50864327",
"0.50282425",
"0.49672687",
"0.49584824",
"0.49451214",
"0.4941018",
"0.49217084",
"0.4913216",
"0.4911907",
"0.48920283",
"0.48672137",
"0.48573485",
"0.4... | 0.5877177 | 0 |
Render a success TwiML and optionally sends notifications To notify via SMS: req.query.notify = sms:4081234567 req.query.notify = 4081234567 To notify via yo: req.query.notify = yo:recipient:apikey | function renderSuccess(req, res, identifier) {
var notifyQuery = req.query.notify || '';
var notify = notifyQuery.split(':');
var protocol = notify[0];
var successParams = parseNotify(req, identifier);
return res.render('success', successParams);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendNotification() {\n // overrides default that no notifs will show when app is in foregruond\n Notifications.setNotificationHandler({\n handleNotification: async () => ({\n shouldShowAlert: true\n })\n });\n\n N... | [
"0.5794008",
"0.5759697",
"0.55709374",
"0.55594426",
"0.55066866",
"0.5472384",
"0.5464021",
"0.54527056",
"0.54133725",
"0.5389886",
"0.5381415",
"0.5357388",
"0.533699",
"0.5305945",
"0.5287527",
"0.5271591",
"0.52711457",
"0.52659965",
"0.52626544",
"0.5260453",
"0.522230... | 0.6763276 | 0 |
saves th customer to the localstorage and rettturns customer overview state | _saveCustomer(){
if (Object.keys(this.customer).length === 7) {
this.storage.setData('customers', this.customer, this.formState);
this._cancel();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCustomer(){\n return(\n this.formState ?\n this.storage.getItem('customers', this.customerId) : {}\n )\n }",
"function CustomerLocal(customer){\n localStorage.clear();\n localStorage.setItem(\"customerId\", parseInt(customer.id));\n localStorage.setItem(\"custom... | [
"0.7025117",
"0.6902631",
"0.68171936",
"0.67184013",
"0.66212994",
"0.6575759",
"0.6474541",
"0.64126784",
"0.63545185",
"0.6304186",
"0.62972",
"0.6262501",
"0.6237662",
"0.6190239",
"0.6167383",
"0.6164728",
"0.6147107",
"0.61382836",
"0.6115855",
"0.6076733",
"0.6071015",... | 0.7455452 | 0 |
if formState is true we are editing the customer and gets the data form the local storage. else we are creating new customer. | getCustomer(){
return(
this.formState ?
this.storage.getItem('customers', this.customerId) : {}
)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_saveCustomer(){\n if (Object.keys(this.customer).length === 7) {\n this.storage.setData('customers', this.customer, this.formState);\n this._cancel();\n }\n }",
"getCustomerData() {\n const newCustomer = {\n id: $.uuid(),\n name: customerNameIn... | [
"0.73254466",
"0.64708704",
"0.6376936",
"0.6292517",
"0.62639695",
"0.6226702",
"0.622496",
"0.6151249",
"0.6150682",
"0.614703",
"0.61087084",
"0.6080229",
"0.60107684",
"0.59823847",
"0.5976923",
"0.59622717",
"0.59557474",
"0.5948932",
"0.5936509",
"0.59264094",
"0.591996... | 0.7083344 | 1 |
specifies which steps of the pathway to draw and draws them | function render() {
var ctx = canvas.getContext("2d");
ctx.clearRect(0, 0, canvas.clientWidth, canvas.clientHeight);
var varList = document.getElementsByClassName("inner-flex-horiz");
//Draw each step of the pathway, including reversible and non-reversible steps
for (var i = 0; i < enzymeList.length... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"debug( draw, steps=10, inc_dxdy=false, inc_dxdy2=false ){\r\n let prev = new Vec3();\r\n let pos = new Vec3();\r\n let dev = new Vec3();\r\n let t;\r\n\r\n // Draw First Point\r\n this.at( 0, prev );\r\n draw.pnt( prev, \"yellow\", 0.05, 1 );\r\n\r\n for( l... | [
"0.70697945",
"0.67920697",
"0.67242545",
"0.67022383",
"0.6664862",
"0.66017634",
"0.6601743",
"0.65780336",
"0.65537614",
"0.6550907",
"0.6531512",
"0.6468508",
"0.6457658",
"0.6450764",
"0.6445439",
"0.6426784",
"0.64162934",
"0.64034486",
"0.6393927",
"0.6391958",
"0.6381... | 0.6842936 | 1 |
Jquery ajax call to get roles & populate role dropdown | function getRoles(userId) {
$("#ddlrole").empty();
$("#ddlrole").append($("<option></option>").val("").html(""));
if (roles.length === 0) {
$.ajax({
type: "POST",
url: "ManageUserApi.aspx/GetRoles",
data: "{}",
contentType: "application/json; charset=u... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fillRoles() {\n $(\"select[name='RoleId']\").empty();\n $.ajax({\n url: \"/Employee/Roles/\" + $('select[name=\"DepartmentId\"]').val(),\n dataType: \"Json\",\n type: \"Get\",\n data: {},\n success: function (response) {\n ... | [
"0.7696604",
"0.76254886",
"0.7573151",
"0.7380626",
"0.73712444",
"0.7306547",
"0.7224069",
"0.7114847",
"0.7094175",
"0.7090697",
"0.7025095",
"0.69665056",
"0.6868839",
"0.68439126",
"0.6810113",
"0.68028665",
"0.68014115",
"0.6794497",
"0.6732222",
"0.6713366",
"0.6709205... | 0.779096 | 0 |
set all the widths to the elements | function setWidths() {
var unitWidth = getUnitWidth() - 20; // adjust for padding. for padding:0, make this 1
$isocontainer.children(":not(.width2)").css({ width: unitWidth });
$isocontainer.children(".width2").css({ width: (unitWidth * 2) });
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOrigWidth()\n{\n\tfor(var i=0; i < hdr.length; i++)\n\t{\n\t\thdr[i].width = hWidth[i];\n\t}\n\t\n\tfor(var i=0; i < drow1.length; i++)\n\t{\n\t\tdrow1[i].width = dWidth[i];\n\t}\n\t\n}",
"function _increaseWidth(){\n layout.changeWidth(1);\n }",
"function setWidths() {\n\t\t\t$t.find( 't... | [
"0.7077539",
"0.7010517",
"0.6996412",
"0.6984562",
"0.698392",
"0.6913587",
"0.69069856",
"0.6885303",
"0.6835429",
"0.6812564",
"0.67487574",
"0.6721842",
"0.66989815",
"0.66989815",
"0.66935444",
"0.6677265",
"0.6660298",
"0.6651036",
"0.6651036",
"0.6651036",
"0.66369313"... | 0.80272555 | 0 |
Ajax Call for Username Forgot Page. | function UsernameAjaxMethod() {
var user = $("#usernameCheck").val();
$.ajax({
type: "POST",
url: "Login.aspx/UsernameForgotPageMethod",
data: "{Forgotuser: '" + user + "'}",
dataType: "json",
contentType: "application/json; charset=utf-8",
success: function (resp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset_password()\n{\n\tvar username=$('#username').val();\n\tif(username=='')\n\t{\n\t\talert('please enter email id');\n\t}\n\telse\n\t{\n\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl:\"http://codeuridea.net/kidssitter/resetting/send-email\",\n\t\t\t\tdata:{'username':$('#username').val()},\n\t\t\t\... | [
"0.6690176",
"0.66683954",
"0.6453761",
"0.6408495",
"0.63641775",
"0.62688625",
"0.62679505",
"0.6256149",
"0.622892",
"0.6155679",
"0.6136436",
"0.6123072",
"0.6092463",
"0.6090744",
"0.604611",
"0.6017466",
"0.6014703",
"0.6010808",
"0.60059583",
"0.60032654",
"0.59902346"... | 0.6906878 | 0 |
Ajax Call for username and PasswordTwo Forgot page. | function UsernamePasswordTwoCheckAjaxMethod() {
var user = $("#usernameCheck").val();
var pwdTwo = $("#PasswordTwoCheck").val();
$.ajax({
type: "POST",
url: "Login.aspx/UsernameAndPasswordTwoCheckForgotPageMethodAjax",
data: "{userCheck:'" + user + "', pwdCheck:'" + pwdTwo + "'}",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function UsernamePasswordCheckAjaxMethod() {\n var user = $(\"#usernameCheck\").val();\n var pwd1 = $('#PasswordOneCheck').val();\n $.ajax({\n type: \"POST\",\n url: \"Login.aspx/UsernameAndPasswordOneCheckForgotPageMethod\",\n data: \"{userCheck:'\" + user + \"', pwdCheck:'\" + pwd1 ... | [
"0.67950946",
"0.6754989",
"0.6718557",
"0.66401005",
"0.65080565",
"0.6493332",
"0.64481765",
"0.64315546",
"0.6399592",
"0.63384277",
"0.62695366",
"0.6263902",
"0.62500465",
"0.6236251",
"0.6214668",
"0.62064695",
"0.6189092",
"0.6146866",
"0.61059314",
"0.60973126",
"0.60... | 0.71463114 | 0 |
close create feed modal | function closeModal() {
document.getElementById("backdrop").style.display = "none";
document.getElementById("createFeedModal").style.display = "none";
document.getElementById("createFeedModal").classList.remove("show");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function closeCreatePostModal() {\r\n\t\r\n\tvar modalBackdrop = document.getElementById('modal-backdrop');\r\n\tvar createPostModal = document.getElementById('create-post-modal');\r\n\r\n\tmodalBackdrop.classList.add('hidden');\r\n\tcreatePostModal.classList.add('hidden');\r\n\r\n\t// This function is defined bel... | [
"0.6863503",
"0.6671225",
"0.6381248",
"0.6369099",
"0.6344691",
"0.6299557",
"0.626921",
"0.626921",
"0.62435544",
"0.6240885",
"0.61899865",
"0.61791176",
"0.61532605",
"0.61532605",
"0.6139722",
"0.6077376",
"0.60741377",
"0.6056354",
"0.6052493",
"0.60463095",
"0.6042145"... | 0.6841656 | 1 |
hide add button if it's not current logged in users own profile | function toggleAddButton() {
const loggedInUserId =
document.querySelector(".logged-in-user-id").innerHTML;
const profileId = document.querySelector(".current-profile-id").innerHTML;
if (loggedInUserId !== profileId) {
document.querySelector(".new-feed-button").classList.add("d-none");
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkToShowAddButton() {\n const hasResult = this.hasQuery && (! this.hasUsers && ! this.hasDepartment);\n\n this.setShowAddButton( hasResult );\n }",
"function handleClick() {\n setShowUserProfile((!showUserProfile))\n }",
"function toggleAddButton() {\n const loggedI... | [
"0.6933118",
"0.6854732",
"0.67922974",
"0.675933",
"0.64543074",
"0.6411886",
"0.6378024",
"0.6368346",
"0.6321812",
"0.6281145",
"0.6266627",
"0.6223535",
"0.6173657",
"0.61585486",
"0.61256045",
"0.6111671",
"0.6039487",
"0.6028034",
"0.60268646",
"0.6011177",
"0.6006853",... | 0.72641385 | 0 |
Is the final check for organicness, before adding to array, to be used in RestrictListProducts function | function _organicCheck(item, organicBool){
if(organicBool.checked && item.organic == true){
restricted_prods.push(item);
} else if (!(organicBool.checked)) {
restricted_prods.push(item);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restrictListProducts(prods, restriction, organic) {\n\tvar product_information = [];\n if (organic){\n\n for (let i=0; i<prods.length; i+=1) {\n if ((restriction == \"lactosenutfree\") && (prods[i].lactosefree) && (prods[i].nutfree) && (prods[i].organic)){\n product_in... | [
"0.64424646",
"0.6329203",
"0.6263789",
"0.6247003",
"0.6152083",
"0.6087974",
"0.59763646",
"0.59583944",
"0.5938998",
"0.59161246",
"0.57905895",
"0.57601166",
"0.5672675",
"0.5606312",
"0.5566219",
"0.55474746",
"0.5512951",
"0.5480384",
"0.54802597",
"0.54764855",
"0.5463... | 0.6496614 | 0 |
map our sessionActions to class props | function mapDispatchToProps(dispatch) {
return {
actions: bindActionCreators(sessionActions, dispatch)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_registerToActions(action) { \n switch(action.actionType) {\n case ActionTypes.CLASSES_FETCHED:\n this._setClasses(action.payload);\n break;\n case ActionTypes.CLASS_CREATED:\n ClassActions.fetchClasses();\n break;\n ... | [
"0.5642977",
"0.55315065",
"0.55312365",
"0.5512893",
"0.55089194",
"0.5462351",
"0.54150105",
"0.5411497",
"0.5410926",
"0.54068655",
"0.53695333",
"0.5351256",
"0.53392726",
"0.53357464",
"0.5313728",
"0.53108215",
"0.53049886",
"0.5302996",
"0.5293588",
"0.5250595",
"0.524... | 0.6616551 | 0 |
render the children of this component the children of this component is an arrow function that takes the count and inrementCount and renders the original component and passes the count and inrementCount to it | render() {
return (
<div>
{this.props.children(this.state.count, this.incrementCount)}
</div>
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render() {\n return (\n <Child handleClick={() => this.updateCount()} count={this.state.count}>\n Count\n </Child>\n );\n }",
"render() { \n console.log(\"props\",this.props)\n return ( \n <div>\n <div className=\"title m-2\">{this.props.children}</... | [
"0.6643785",
"0.66287214",
"0.65983915",
"0.658134",
"0.65642995",
"0.6360201",
"0.62864524",
"0.62839437",
"0.62774336",
"0.62731767",
"0.6217829",
"0.62085485",
"0.61763597",
"0.61495376",
"0.61429685",
"0.6142749",
"0.6121322",
"0.60920495",
"0.6079362",
"0.6040119",
"0.60... | 0.7884897 | 0 |
for some reason, the interaction between the random seed and the webgl pseduorandom function produces unpleasant looking artifacts (i.e. diagonal and occasionally horizontal lines) for certain values of the random seed the main cause seems to be when the random seed is less than 0.27 or so this fix doesn't 100% solve t... | function generateRandomSeed(){
return Math.random() * 0.73 + 0.27;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function random () {\n\t\n\tseed = 312541332155 * (4365216455 + seed) % 7654754253243312;\n\t\n\treturn 0.0000001 * (seed % 10000000);\n\t\n}",
"function srandom() {\n randomSeed = (randomSeed * 9301 + 49297) % 233280;\n return randomSeed / 233280;\n}",
"function rnd() \n{\n\t\t\n rnd.seed = (rnd.seed... | [
"0.6522048",
"0.6380164",
"0.6356211",
"0.6312801",
"0.6273608",
"0.6235491",
"0.61811876",
"0.6104483",
"0.60932875",
"0.60890627",
"0.6079582",
"0.607377",
"0.6056277",
"0.6053681",
"0.6040202",
"0.59780675",
"0.5958687",
"0.59291494",
"0.59094006",
"0.5903984",
"0.5903626"... | 0.6948111 | 0 |
Find student by name and english within (min,max) | function find()
{
var str = prompt("Tìm theo thên sinh viên: ");
var min = parseFloat(prompt("Min Điểm Anh Văn: "));
var max = parseFloat(prompt("Max Điểm Anh Văn: "));
var found = [];
for(var i=0; i<list.length; i++)
{
var logic = list[i].name.includes(str) && (min <= list[i].english) && (list[i].english <... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findBestStudent(sortA,h){\n //read each object inside of Array.\n var x;\n var txt = \"\";\n var arrayBestStudent;\n for (i=0; i < sortA.length;i++){\n var alu = sortA[i];\n for (x in alu) {\n if(alu.grade >= h){\n txt ... | [
"0.53605336",
"0.5236415",
"0.52123845",
"0.52116615",
"0.51960886",
"0.51480806",
"0.5130726",
"0.51219517",
"0.5118432",
"0.5090784",
"0.5089608",
"0.5087221",
"0.4942091",
"0.49295577",
"0.49284372",
"0.4927867",
"0.4925993",
"0.4876195",
"0.48691663",
"0.48641905",
"0.486... | 0.6514899 | 0 |
This method serves the purpose of updating any tile detail i.e changing state based on given params data : state object, ids : ids of tiles to be modified, status : status with which tiles should be updated incrementCount : to increment or not increment count | updateTiles(data, ids, status, incrementCount = false) {
//Iterating through provided ids
_.map(ids, function (id) {
//Updating status of given ids with given state
data[id]['status'] = status
//For complete this is will result in additional score point to prevent it ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleClick(id) {\n //taking the state object in another variable\n let data = this.state.tileData;\n //Getting the currently active tiles\n let currentActive = _.filter(data, {'status': 'active'})\n //To prevent actions during delay\n if (currentActive.length < 2) {\n ... | [
"0.6142494",
"0.57734376",
"0.5750621",
"0.57186747",
"0.5547951",
"0.5534367",
"0.55251896",
"0.5505066",
"0.5447544",
"0.5415714",
"0.5391554",
"0.5390321",
"0.53763944",
"0.5337144",
"0.5305733",
"0.53017634",
"0.5288924",
"0.52837616",
"0.5274543",
"0.5256012",
"0.5255083... | 0.84763926 | 0 |
This method is to handle the click of tiles. Based on the state of game, the new state will be generated here. | handleClick(id) {
//taking the state object in another variable
let data = this.state.tileData;
//Getting the currently active tiles
let currentActive = _.filter(data, {'status': 'active'})
//To prevent actions during delay
if (currentActive.length < 2) {
//Fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function tileClick() {\n\tvar position = parseInt(this.dataset.position);\n\tif (board.isValidMove(position)) {\n\t\tboard.placeTile(current, position);\n\t\tthis.getElementsByClassName('tile-image')[0].src = current.img;\n\t\tif (board.isWinningState(current, position)) {\n\t\t\tend(current);\n\t\t} else if (boar... | [
"0.7156538",
"0.70725775",
"0.69551",
"0.6948739",
"0.69445723",
"0.689793",
"0.68488145",
"0.6846115",
"0.6833589",
"0.6792237",
"0.6714962",
"0.6714962",
"0.6707241",
"0.6697729",
"0.6674949",
"0.6587558",
"0.65588075",
"0.65304506",
"0.65228873",
"0.6517864",
"0.6499317",
... | 0.7425664 | 0 |
Utility to get the game instruction/reset/restart button based on game status | renderInstructionSection(gameStatus, STATUS) {
if (gameStatus == STATUS.BEGIN) {
return <span className="game-instruction">Click on any tile to begin the game</span>
} else {
let buttonLabel = (gameStatus == STATUS.COMPLETE) ? " Restart Game " : " Reset Game "
let ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getButtonStatusText(challenge) {\n const [CCSTB, CCFB] = [this.Constants.STARTED.BUTTONS, this.Constants.FINISHED.BUTTONS];\n\n const uScore = this.getUser(challenge).score;\n const oScore = this.getOpponent(challenge).score;\n\n let statusTxt = null;\n\n if (ChallengeUtils.isNewCha... | [
"0.6413001",
"0.6261465",
"0.62492067",
"0.6249016",
"0.6231306",
"0.62172127",
"0.6195295",
"0.6194462",
"0.61833894",
"0.6174551",
"0.61691624",
"0.61605155",
"0.6137381",
"0.61365545",
"0.61361325",
"0.6135666",
"0.6132148",
"0.61310554",
"0.6119435",
"0.6119396",
"0.61192... | 0.68386793 | 0 |
Normalizes the tile URL so that tiles repeat across the x axis (horizontally) like the standard Google map tiles. | function getHorizontallyRepeatingTileUrl(coord, zoom, urlfunc) {
var y = coord.y;
var x = coord.x;
// tile range in one direction range is dependent on zoom level
// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
var tileRange = 1 << zoom;
// don't repeat across y-axis (v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getHorizontallyRepeatingTileUrl(coord, zoom, urlfunc) {\n var y = coord.y;\n var x = coord.x;\n \n // tile range in one direction range is dependent on zoom level\n // 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc\n var tileRange = 1 << zoom;\n \n // don't repeat acr... | [
"0.6843974",
"0.61374843",
"0.58517843",
"0.56534225",
"0.55879474",
"0.556825",
"0.5466736",
"0.5306864",
"0.5253604",
"0.52235794",
"0.516368",
"0.5154958",
"0.51505864",
"0.5102653",
"0.51008755",
"0.5099507",
"0.5058561",
"0.5058543",
"0.5027266",
"0.50181586",
"0.5017844... | 0.6820857 | 1 |
================================================================================== Adds a crater on the map at the selected location to the calculated size. ================================================================================== | function addCrater(location_)
{
var location1 = location_;
dataProvider.setCbSelectDepthObject(parseInt(selectedBuilding));
var lat = location1.lat();
var lng = location1.lng();
dataProvider.setLatitude(parseFloat(lat));
dataProvider.setLongitude( parseFloat(lng));
dataProvider.setCbLocation(parseInt(cmb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function increaseSize() {\n\tif (selectedShape) {\n\t\tselectedShape.resize(5);\n\t\tdrawShapes();\n\t}\n}",
"radiusResized() {\n\t\tif( this.searchRadius.getRadius() > locsearch.map_attributes.max_radius * 1000 ) {\n\t\t\tthis.searchRadius.setRadius( locsearch.map_attributes.max_radius * 1000 );\n\t\t}\n\t\tthi... | [
"0.5915427",
"0.590992",
"0.5751164",
"0.57064664",
"0.57052106",
"0.5687674",
"0.5662098",
"0.5610895",
"0.55383986",
"0.5504745",
"0.54977345",
"0.5489173",
"0.5481716",
"0.54469305",
"0.5397067",
"0.5388447",
"0.5388419",
"0.5376396",
"0.5376353",
"0.5343446",
"0.5329552",... | 0.6280322 | 0 |
================================================================================= =================================================================================== Calculate the crater bounds. =================================================================================== | function craterBounds(lat_, lon_ ,craterDiameter){
var lat1 = lat_;
var lon1 = lon_;
var d = Math.SQRT2*craterDiameter/2.0;
var R = 6370000;
var brng1 = 45*Math.PI/180;
var brng2 = 225*Math.PI/180;
lat1 = lat1*Math.PI/180;
lon1 = lon1*Math.PI/180;
var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + Math.c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get bounds() {}",
"function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }",
"get boundsValue() {}",
"get localBounds() {}",
"... | [
"0.681576",
"0.6706417",
"0.660061",
"0.63839865",
"0.63708615",
"0.6307134",
"0.62913907",
"0.6281191",
"0.61922103",
"0.6177425",
"0.6169913",
"0.6135824",
"0.6122678",
"0.6122418",
"0.6114216",
"0.60479003",
"0.6044865",
"0.59958386",
"0.59903866",
"0.5989155",
"0.5986858"... | 0.7160708 | 0 |
============================================== ================================================================================== Once the calc is complete put the results on the UI. ================================================================================== | function onCalcComplete()
{
////////////////////////////////
//Display Results
////////////////////////////////
//The data on the map screen.
setImpactValues(dataProvider.getDgOutputs());
//The inputValues
setInputValues(dataProvider.getDgInputs());
//The damage table
setDamage(dataProvider.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcResults() {\n\t\trbAge.innerText = parseInt(currentAge)+parseInt(yearsToRetirement);\n\t\trbIncome.innerText = rawNestAmount*targetRetirementIncomePercentage;\n\t\trbInterest.innerText = (rawNestAmount-(rawNestAmount*targetRetirementIncomePercentage))*targetInterestRateToNest;\n\t\trbBalance.innerText... | [
"0.74880457",
"0.7394863",
"0.7280815",
"0.72197276",
"0.7156501",
"0.70714635",
"0.7022014",
"0.679462",
"0.67822",
"0.6777992",
"0.6716648",
"0.6692626",
"0.664951",
"0.6634787",
"0.65943533",
"0.6565198",
"0.65605116",
"0.65293264",
"0.6506112",
"0.65058047",
"0.6497893",
... | 0.7548231 | 0 |
================================================================================= ================================================================================== Sets the damage text which is the second table of the data view are. ================================================================================== | function setDamage(txtDamage)
{
$("#LB_Damage").text( damage1 + " " + dist +" km "+ damage2);
var impTbl = document.getElementById("DamageInfo");
$('#DamageInfo').html(txtDamage);
//impTbl.innerHTML = txtDamage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setDeniseText() {\n var textToApplyDenise = \"\";\n if (houseUpgrades.upgrades[1].owned == 0) { textToApplyDenise = \"We Need a BED to sleep in\"; }\n else if (houseUpgrades.upgrades[2].owned == 0) { textToApplyDenise = \"I wish I had a CHEST to put stuff.\"; }\n else if (house... | [
"0.58480114",
"0.5510582",
"0.5442686",
"0.5438436",
"0.54304445",
"0.54039335",
"0.5368918",
"0.51778656",
"0.51649284",
"0.51649284",
"0.50955313",
"0.50470734",
"0.5015801",
"0.5010383",
"0.49946755",
"0.49886534",
"0.49717358",
"0.4961141",
"0.49541914",
"0.4941081",
"0.4... | 0.67597437 | 0 |
================================================================================== =================================================================================== Sets the data for the energy table which is the third table of the data view. ===========================================================================... | function setEnergyValues(dgEnergy)
{
var impTbl = document.getElementById("InputEnergyTable");
//impTbl.innerHTML = "";
var keys = dgEnergy.keys()
var values = dgEnergy.values();
var tableData = "";
for (var i = 0; i < keys.length;i++)
{
if (i % 2 && i != 0)
tableData = tableData + "<tr><td>"+ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setData(data) {\n this.dataAgents.map((d, idx) => d.setData(data[idx]));\n this.sheet.table.render();\n }",
"function setDataTbl(){\n var currentIndex = 1;\n var tablegroup = \"datagrpRestriction\";\n setTable(currentIndex, tablegroup, this.grid.getPrimaryKeysForRow(this));\t\n}",
"function set... | [
"0.61513656",
"0.6063266",
"0.60035765",
"0.591022",
"0.58577436",
"0.5847947",
"0.58167595",
"0.58074325",
"0.57826096",
"0.5726791",
"0.5700324",
"0.56770486",
"0.56290007",
"0.56025475",
"0.5591837",
"0.5583447",
"0.5567965",
"0.5562535",
"0.550695",
"0.5494547",
"0.549329... | 0.6096933 | 1 |
=================================================================================== ==================================================================================== Sets the impactor text which is the fours data table in the data view. ================================================================================... | function setImpactorText(impactorText)
{
var impTbl = document.getElementById("ImpactorInfo");
$('#ImpactorInfo').html(impactorText);
//impTbl.innerHTML = impactorText;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rowSetText(text) {\n rowClear();\n currentRow.append('div').classed('tbar-row-text', true)\n .text(text);\n }",
"function datasetText(dataset) {\r\n\treturn dataset;\r\n}",
"function _setDisplayText(oController) {\r\n\t\tvar oTextReader = oController.getView... | [
"0.5730968",
"0.5560151",
"0.5478787",
"0.5443164",
"0.5415416",
"0.5345215",
"0.5345215",
"0.532174",
"0.5284046",
"0.5278402",
"0.5278402",
"0.52751315",
"0.52326137",
"0.52229834",
"0.5205857",
"0.5204834",
"0.5188104",
"0.5175853",
"0.51694655",
"0.51694655",
"0.51572",
... | 0.74685097 | 0 |
================================================================================== =================================================================================== Sets if a fireball has been seen which is the final table of the data view. =============================================================================... | function setFireballSeen(fireArray)
{
var impTbl = document.getElementById("FireballTable");
//impTbl.innerHTML = "";
var keys = fireArray.keys()
var values = fireArray.values();
var tableData = "";
//if dist is 0 do not display the exposure, the last value in the fire array.
var display_exposure = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function markFlag() {\n let $td = $(this)\n if (unclickable(this)) {\n return false;\n }\n let id = $td.attr(\"id\")\n let cell = game.getCellByID(id);\n if (!cell.hasRevealed) {\n if (cell.hasFlag) {\n cell.hasFlag = false\n flagCount--\n } else {\n ... | [
"0.5634471",
"0.5581494",
"0.55257374",
"0.5500357",
"0.5315188",
"0.530258",
"0.5281695",
"0.52091527",
"0.5147832",
"0.51279825",
"0.5124307",
"0.5118517",
"0.51015556",
"0.50693595",
"0.5052583",
"0.50250953",
"0.501962",
"0.501859",
"0.5016423",
"0.5005908",
"0.5004938",
... | 0.69569063 | 0 |
===================================================================================== ======================================================================================= draw the scale line beneath the crater. ======================================================================================= | function drawScale()
{
var c=document.getElementById("Crater_Area");
var ctx=c.getContext("2d");
ctx.font = '10pt Arial';
var diam = nbFormat(dataProvider.impactor.crDiam)+"m";
var depth = nbFormat(dataProvider.impactor.crDepth)+"m";
var dl =depth.length;
var dil = diam.length;
ctx.fillText(diam, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createX(){\n line(0, 0, -vScale/2, -vScale/2);\n line(0, 0, vScale/2, -vScale/2);\n line(0, 0, vScale/2, vScale/2);\n line(0, 0, -vScale/2, vScale/2);\n}",
"function renderAxisLine() {\n ctx.save();\n ctx.setLineDash(renderAttrs.lineDash || []);\n if( ren... | [
"0.666861",
"0.6438871",
"0.6383193",
"0.6371038",
"0.63630515",
"0.6312043",
"0.6255201",
"0.6255201",
"0.6255201",
"0.62264526",
"0.6173866",
"0.61598027",
"0.6139451",
"0.6091123",
"0.60581917",
"0.60348976",
"0.60309803",
"0.6029382",
"0.60277915",
"0.60252756",
"0.600054... | 0.6467912 | 1 |
File: linkify.js Version: 20101010_1000 Copyright: (c) 2010 Jeff Roberson MIT License: Summary: This script linkifys http URLs on a page. Usage: See demonstration page: linkify.html | function linkify(text) {
/* Here is a commented version of the regex (in PHP string format):
$url_pattern = '/# Rev:20100913_0900 github.com\/jmrware\/LinkifyURL
# Match http & ftp URL that is not already linkified.
# Alternative 1: URL delimited by (parentheses).
(\() # $1 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function linkify(text) {\r\n var replaceText, replacePattern1, replacePattern2, replacePattern3;\r\n\r\n //URLs starting with http://, https://, or ftp://\r\n replacePattern1 = /(\\b(https?|ftp):\\/\\/[\\-A-Z0-9+&@#\\/%?=~_|!:,.;]*[\\-A-Z0-9+&@#\\/%=~_|])/gim;\r\n replacedText = text.replace(replacePat... | [
"0.73212177",
"0.7284751",
"0.7234442",
"0.7212285",
"0.7210462",
"0.7128047",
"0.69046366",
"0.6873047",
"0.6612578",
"0.6440961",
"0.642403",
"0.6311282",
"0.630552",
"0.6294974",
"0.6288601",
"0.6206067",
"0.61951596",
"0.6171151",
"0.6165195",
"0.6165195",
"0.6165195",
... | 0.76830006 | 0 |
Boot the component. This method is triggered after the user's webpack.mix.js file has executed. | boot() {
console.log("WebpackConfig:");
console.log("-------------- \n");
console.dir(Config, {depth: 1});
console.log("----------------------------------------------- \n");
console.log("Mix Object:");
console.log("------------- \n");
console.dir(Mix, {depth: this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"boot() {\n let workboxPlugin = require('workbox-webpack-plugin');\n\n this.plugin = new workboxPlugin[this.pluginName](Object.assign({\n swDest: 'service-worker.js'\n }, this.config));\n }",
"boot() {\n //\n }",
"onBoot() {}",
"boot() {\n\n }",
"async afterBootstra... | [
"0.6334365",
"0.59990925",
"0.5923069",
"0.58922476",
"0.58356553",
"0.58034647",
"0.5646825",
"0.5618756",
"0.5604551",
"0.54944116",
"0.54641694",
"0.54373395",
"0.5397692",
"0.5389931",
"0.53733677",
"0.53467876",
"0.53372073",
"0.53238165",
"0.5284397",
"0.5238695",
"0.52... | 0.6398949 | 0 |
Find the largest palindrome made from the product of two 3digit numbers. | function abc(num) {
loop1: for (i = num; i.toString().length >= num.toString().length; i--) {
pal = parseInt(i.toString() + i.toString().split('').reverse().join(''))
for (x = num; x.toString().length >= num.toString().length; x--) {
if (pal % x === 0 && (pal / x).toString().length === n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function largestPalendrome() {\n\n // start by assuming the largest found is 0\n let largest = 0;\n\n // for each 3 digit number\n for (let i = 999; i > 99; i--) {\n\n /*\n * for every other 3 digit number that produces\n * a product with the first 3 digit number that's\n * larger than the large... | [
"0.8244534",
"0.79137754",
"0.77638936",
"0.7744406",
"0.7543545",
"0.68317336",
"0.6761058",
"0.6756271",
"0.6684387",
"0.66421425",
"0.66368604",
"0.66197836",
"0.6540573",
"0.6489629",
"0.64078575",
"0.636488",
"0.6334653",
"0.6264511",
"0.6263654",
"0.62555104",
"0.625545... | 0.79189456 | 1 |
Generates the surface procedure | function compileSurfaceProcedure(vertexFunc, faceFunc, phaseFunc, scalarArgs, order, typesig) {
var key = [typesig, order].join(',')
var proc = allFns[key]
return proc(
vertexFunc,
faceFunc,
phaseFunc,
pool.mallocUint32,
pool.freeUint32)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createSurface() {\n let controlPoints = [];\n for (var i = 0, k = 0; i < this.nPointsU; i++) {\n let uPoint = [];\n for (var j = 0; j < this.nPointsV; j++, k++) {\n this.controlPoints[k].push(1);\n uPoint.push(this.controlPoints[k]);\n }\... | [
"0.69514656",
"0.6635534",
"0.65917426",
"0.65917426",
"0.6431906",
"0.6343412",
"0.6314351",
"0.6134876",
"0.6055668",
"0.60374963",
"0.59640545",
"0.5880201",
"0.58474845",
"0.58474845",
"0.58474845",
"0.5828926",
"0.5808765",
"0.5808765",
"0.57948244",
"0.57175183",
"0.569... | 0.6677741 | 1 |
Add menu script update link | function update_link() {
$('#side_navi').append('<p><a href="#" id="farmer_update" onclick="update_script()">Update '+SCRIPT.name+'</a></p>');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function install_menu() {\n let config = {\n name: script_id,\n submenu: 'Settings',\n title: script_title,\n on_click: open_settings\n };\n wkof.Menu.insert_script_link(config);\n }",
"function installMenu() {\n wkof.Menu.insert_script_link(... | [
"0.7260296",
"0.71842474",
"0.7151768",
"0.68889284",
"0.66425437",
"0.646941",
"0.6463191",
"0.6381814",
"0.63699275",
"0.6367864",
"0.6360849",
"0.6348565",
"0.6292368",
"0.6149883",
"0.60756356",
"0.60742766",
"0.60204",
"0.5928667",
"0.592414",
"0.5909938",
"0.59097916",
... | 0.7613079 | 0 |
updates state=enabled|disabled for scheduled functions | updateScheduledState(callback) {
if (isScheduled) {
series([staging, production].map(FunctionName=> {
return function update(callback) {
if (state === 'disabled') {
setTimeout(function rateLimit() {
cloudwatch.disableRule({
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _(){this.state.eventsEnabled||(this.state=W(this.reference,this.options,this.state,this.scheduleUpdate))}",
"toggleEnabled() {\n let { enabled, scheduledRestart } = this.state;\n enabled = !enabled;\n //If the select boxes are no longer enabled, reset the scheduled restart time and ... | [
"0.68644005",
"0.68377197",
"0.6545934",
"0.6545934",
"0.64584535",
"0.6416128",
"0.6416128",
"0.6416128",
"0.6416128",
"0.6414262",
"0.6414262",
"0.62776065",
"0.62683696",
"0.6240283",
"0.6240283",
"0.6240283",
"0.6240283",
"0.62242657",
"0.62186015",
"0.6198962",
"0.617845... | 0.7258236 | 0 |
Create graphdata as count of all albumids in watchlist object array | function createGraphData() {
for (var item in $scope.myWatchlistData) {
if (findIndexFromId($scope.graphData, 'albumId', $scope.myWatchlistData[item]['albumId']) > -1) {
$scope.graphData[findIndexFromId($scope.graphData, 'albumId', $scope.myWatchlistData[item]['albumId'])]['count'] += 1;
} else ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"dump(albumId, updateCounts = true) {\n return new Promise((resolve, reject) => {\n const tagged = {};\n const opts = { count: 1000 }; // batch size for hscan\n if (albumId && albumId !== ALBUM_ALL) {\n // pattern match\n opts.match = `${albumId}${ALBUM_DELIM}*`;\n }\n cons... | [
"0.6124445",
"0.5977314",
"0.5788596",
"0.5679312",
"0.5676466",
"0.55802757",
"0.5572946",
"0.5571088",
"0.5505164",
"0.5503802",
"0.5494125",
"0.5488272",
"0.5486973",
"0.5483269",
"0.54712486",
"0.5431309",
"0.54191947",
"0.5418644",
"0.5418281",
"0.5403805",
"0.53901243",... | 0.863871 | 0 |
Renders the 'Translations' tab. | function renderTranslationsTab() {
log('Updating translations:', config.translations);
updateTranslationsTab();
const $tbody = $('div.translator-em tbody.translations-body');
// Remove all rows
$tbody.children().remove();
const langs = Object.keys(config.translations).sort();
if (langs.lengt... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onTranslation() {\n }",
"function renderTranslation(jsonLanguage) {\n let index = 0;\n $.each(jsonLanguage, function(key, value) {\n $(elementsToTranslate[index]).text(value);\n index++;\n });\n }",
"function getTranslations() {\r\n return translations;\r\n }",
"... | [
"0.59520274",
"0.5877778",
"0.57859194",
"0.57017756",
"0.561128",
"0.548846",
"0.5477214",
"0.54496366",
"0.5421672",
"0.53985286",
"0.53985286",
"0.5394087",
"0.5393753",
"0.53291297",
"0.53180015",
"0.53131676",
"0.53131676",
"0.53131676",
"0.5262238",
"0.52555954",
"0.517... | 0.75680906 | 0 |
endregion region Packages Renders the table on the 'Packages' tab. | function renderPackagesTab() {
log('Updating packages:', config.packages);
const $tbody = $('div.translator-em tbody.packages-body');
// Remove all rows
$tbody.children().remove();
const keys = sortByVersion(config.packages);
if (keys.length) {
// Create rows
for (const key of ke... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Packages()\n {\n\tRenderHeader(\"Packages\");\n \tRenderPresentPackageBox();\n \tRenderUpgradeOptionsBox();\n \tRenderSeeDowngradeOptionsBox();\n \treturn;\t\t\t\n }",
"function getPackages() {\n\tvar lImage;\n\tinitializeDB();\n\t\n\tdb.transaction( function( tx ) {\n\t\ttx.executeSql( \"SELECT * FROM ... | [
"0.7688612",
"0.6095892",
"0.5980909",
"0.58574325",
"0.5855525",
"0.58353907",
"0.57516766",
"0.5669934",
"0.56421596",
"0.5564887",
"0.5543537",
"0.5458237",
"0.54402024",
"0.5410779",
"0.5331439",
"0.53298044",
"0.5315721",
"0.5308434",
"0.53001904",
"0.5283787",
"0.525389... | 0.7913512 | 0 |
Logger constructor path log directory node nodeId app application name writeInterval flush log to disk interval writeBuffer buffer size 64kb keepDays delete files after N days, 0 to disable toFile write log types to file toStdout write log types to stdout | function Logger(options) {
const { path, node } = options;
const { writeInterval, writeBuffer, keepDays } = options;
const { toFile, toStdout } = options;
this.active = false;
this.path = path;
this.node = node;
this.writeInterval = writeInterval || 3000;
this.writeBuffer = writeBuffer || 64 * 1024;
t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loggerConstructor () { // 'private' properties\n let folderName = 'logs';\n let rootPath = __basedir;\n let maxFileSize = 1 * 1024 * 1024; // 1Mb\n let nFolderPath = path.join(rootPath, folderName);\n let oFolderPath = path.join(nFolderPath, 'pas... | [
"0.66316384",
"0.6213382",
"0.59326875",
"0.5902909",
"0.58307755",
"0.58197993",
"0.5802454",
"0.57567525",
"0.5694818",
"0.5627106",
"0.55963695",
"0.55963695",
"0.55963695",
"0.55477667",
"0.55477667",
"0.5485831",
"0.54696065",
"0.5381219",
"0.5357346",
"0.53321844",
"0.5... | 0.6809766 | 0 |
set a vector as the elementwise product of two others | function setmulvec(dest, a, b){
for(var i = a.length; i--;) dest[i] = a[i] * b[i];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function vector_product(a, b) {\n return a.x * b.y - a.y * b.x;\n}",
"function multiple(){\n results.value = Number(a.value) * Number(b.value);\n }",
"function addmulvec(dest, a, b){\n for(var i = a.length; i--;) dest[i] += a[i] * b[i];\n}",
"function product(a, b) {\n a = (0 in arguments) ? a... | [
"0.74677026",
"0.7085743",
"0.7004867",
"0.69605833",
"0.69461644",
"0.6898884",
"0.68982893",
"0.6879464",
"0.6866489",
"0.6790204",
"0.677751",
"0.6737516",
"0.6719198",
"0.67145056",
"0.66751516",
"0.6660845",
"0.6595616",
"0.65816575",
"0.6572185",
"0.6543904",
"0.6529034... | 0.7573702 | 0 |
add the elementwise product of two vectors to another | function addmulvec(dest, a, b){
for(var i = a.length; i--;) dest[i] += a[i] * b[i];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function vector_product(a, b) {\n return a.x * b.y - a.y * b.x;\n}",
"function dotProduct(a, b) {\n return a.reduce(function (sum, v, i) {\n return sum + (v * b[i]);\n }, 0);\n}",
"function vectorAdd(a, b) {\n\treturn [ a[0] + b[0], a[1] + b[1] ];\n}",
"function vecAddInPlace(a, b) {\n for (... | [
"0.7678153",
"0.7377385",
"0.7313809",
"0.7152705",
"0.7035703",
"0.6997022",
"0.69657123",
"0.69481725",
"0.6922437",
"0.68786275",
"0.68783504",
"0.68415916",
"0.6811938",
"0.6758713",
"0.6722696",
"0.6712463",
"0.67064494",
"0.6699543",
"0.6693455",
"0.6685542",
"0.6674893... | 0.77976996 | 0 |
returns the index of the maximal element | function max_index(n){
var m = n[0], b = 0;
for(var i = 1; i < n.length; i++)
if(n[i] > m) m = n[b = i];
return b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findMaxItem(arr) {\n let len = arr.length\n let max = -Infinity\n let index = -1\n\n while (len--) {\n if (arr[len] > max) {\n max = arr[len]\n index = len\n }\n }\n return { index, max }\n }",
"get maxIndex() {\n return Number(this.getAttribute(\"max\")... | [
"0.7659736",
"0.75277543",
"0.75142074",
"0.74478006",
"0.74185216",
"0.7382815",
"0.7375305",
"0.7373277",
"0.736681",
"0.7282791",
"0.7269045",
"0.71506506",
"0.7141066",
"0.71338856",
"0.7114232",
"0.71062475",
"0.70754445",
"0.70227444",
"0.7011901",
"0.6970003",
"0.69545... | 0.7871901 | 0 |
returns the maximal element according to a metric | function max_element(n, metric){
var m = metric(n[0]), b = n[0];
for(var i = 1; i < n.length; i++){
var v = metric(n[i]);
if(v > m){
m = v;
b = n[i];
}
}
return b;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function msMax() {\n\t\tlet max1 = msSingle.reduce((a, b) => {\n\t\t\treturn a[1] > b[1] ? a : b;\n\t\t});\n\n\t\treturn parseInt(max1[0]); //function being reduced has 2 key/value pairs in each object. reducing to max in value index 1 then returning value index 0;\n\t}",
"finalMax(measure) {\n var subsc... | [
"0.6608896",
"0.64870214",
"0.6480787",
"0.646891",
"0.64675325",
"0.63979",
"0.6376412",
"0.6286211",
"0.62834084",
"0.626417",
"0.6255048",
"0.6236694",
"0.62311286",
"0.62240356",
"0.6222924",
"0.61820006",
"0.6175195",
"0.61678094",
"0.6156411",
"0.6154091",
"0.61538976",... | 0.8359975 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.