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 |
|---|---|---|---|---|---|---|
Execute facebook request to get page's infos | function doInfoPageFacebookRequest(linkFacebook, index, callback) {
counterCallbackInfoPageFBRequest++;
facebook.get(('/' + linkFacebook[index].fields.pageName + '?fields=likes,talking_about_count'), function(response) {
response = JSON.parse(response);
if(!response.error)
{
var date = new Date();
var... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getPageInfo(page) {\n document.getElementById('comments_list').style.display = 'none';\n document.getElementById('likes_list').style.display = 'none';\n document.getElementById('post_info').style.display = 'none';\n document.getElementById('comment_filter').style.display = 'none';\n ... | [
"0.6623283",
"0.64965713",
"0.63613683",
"0.6124064",
"0.596434",
"0.58963174",
"0.5891124",
"0.58635557",
"0.5856084",
"0.58521956",
"0.5786808",
"0.5777097",
"0.5739193",
"0.5738044",
"0.572675",
"0.5687358",
"0.5687358",
"0.5687358",
"0.56856555",
"0.56837004",
"0.56748724... | 0.6689559 | 0 |
detect the sum of the flowers that the bouquet needs | function sumOfFlowers(flowerWithQuantity) {
return flowerWithQuantity
.map(flower => {
return parseInt(
flower.split(/([0-9]+)/).filter(value => {
return value >= 0;
})[1]
);
})
.reduce((prev, current) => {
return prev + current;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function solvePartOne() {\n moduleMass.forEach(mass => {\n let thisCalc = fuelCalculation(mass);\n totalPartOne += thisCalc;\n })\n console.log('PART ONE: Fuel required for modules alone = ' + totalPartOne);\n return totalPartOne;\n}",
"function calculateBranchSums(node, runningSum, total) {\n\tlet acc... | [
"0.5892803",
"0.56655496",
"0.5584273",
"0.5584273",
"0.55764097",
"0.5544735",
"0.5525636",
"0.55161977",
"0.5481797",
"0.5456948",
"0.54514307",
"0.5447299",
"0.5443061",
"0.5431711",
"0.5431711",
"0.543135",
"0.53768647",
"0.537406",
"0.5346333",
"0.53422964",
"0.5334221",... | 0.6284476 | 0 |
Collects all relevant data for the overlay table in Flex Support web extension (Overlay section) This method is called during initialization of the Overlay section and on pressing the "Reload" button | function collectOverlayTableData() {
// create an array with all relevant overlays (no aggregation overlays)
var aAllOverlays = OverlayRegistry.getOverlays();
var aRelevantOverlayList = [];
aAllOverlays.forEach(function(oOverlay) {
if (!oOverlay.isA("sap.ui.dt.AggregationOverlay")) {
var sParentId = oOve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"on_overlay_data(data) {\n this.get('.').forEach(x => {\n if (x.settings.$synth) this.del(`${x.id}`)\n })\n for (var ov of data) {\n let obj = this.get_one(`${ov.id}`)\n if (obj) {\n this.tv.$set(obj, 'loading', false)\n if (!ov.dat... | [
"0.6417354",
"0.6221836",
"0.60012734",
"0.5978334",
"0.59086",
"0.5784899",
"0.5780955",
"0.5749562",
"0.5740019",
"0.57172024",
"0.5692374",
"0.5680169",
"0.56586576",
"0.5645204",
"0.56451136",
"0.56338876",
"0.5622994",
"0.5620343",
"0.5618154",
"0.5603935",
"0.5595026",
... | 0.7012918 | 0 |
Handler method for the Rta event "stop" sends a corresponding message to the Flex Support web extension (Overlay section) | function onRtaStop() {
window.postMessage({
type: "rtaStopped",
id: "ui5FlexibilitySupport.submodules.overlayInfo",
content: {}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onStop() {\n}",
"function onStop(){\n alert(\"stopped\")\n}",
"stop () {\n\n }",
"stopActivity(){this._FBPTriggerWire(\"--activityStopped\")}",
"function stop() {\n\n}",
"stop () {\n\t\tthis.reset();\n\t\tthis.dispatchEvent(new CustomEvent(\"stopped\"));\n\t}",
"function mediaStopHandler(pEv... | [
"0.67326045",
"0.6714594",
"0.6578153",
"0.6555523",
"0.6528964",
"0.64895415",
"0.64197344",
"0.63878584",
"0.62915826",
"0.627288",
"0.6233372",
"0.6233372",
"0.6233372",
"0.6233372",
"0.6230359",
"0.6198057",
"0.6192722",
"0.6192722",
"0.6191246",
"0.6189138",
"0.6119106",... | 0.78761274 | 0 |
Sends a message to the Flex Support web extension (Overlay section) that UI Adaption has started | function onRtaStart() {
window.postMessage({
type: "rtaStarted",
id: "ui5FlexibilitySupport.submodules.overlayInfo",
content: {}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"showPopupBonusStartEvent(){\n\n this.getService(\"SoundService\").stopGroup(\"main\");\n\n if (this.getService(\"AutoPlayService\").isActive() && this.getService(\"AutoPlayService\").isStopOnBonusEnabled()) {\n this.getService(\"AutoPlayService\").stopAutoSpins();\n }\n\n thi... | [
"0.61131257",
"0.5805994",
"0.5764051",
"0.5760563",
"0.56999236",
"0.56835496",
"0.5614034",
"0.5607471",
"0.5585174",
"0.5554227",
"0.55395097",
"0.5534308",
"0.55211914",
"0.55145997",
"0.54954517",
"0.54867923",
"0.54382133",
"0.5432725",
"0.5424658",
"0.54084593",
"0.539... | 0.67880136 | 0 |
Update the settings to match the ones on the time machine viewer | function syncSettingsToViewer() {
setPlaybackSpeed(timelapse.getPlaybackRate());
syncStartTime();
syncEndTime();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function applySettings(time, session) {\n let settingsTab = document.querySelector(\".settings\");\n settingsTab.style.display = \"none\";\n setStartTime(false);\n setTimer(time * 60);\n setSession(session);\n }",
"function saveSettings() {\n infoGetter()\n minuteConverter(allScheds)\n c... | [
"0.6878252",
"0.66230583",
"0.6483418",
"0.63956445",
"0.6393461",
"0.6380758",
"0.6307922",
"0.6301739",
"0.6281794",
"0.61992526",
"0.6193487",
"0.61792773",
"0.6169765",
"0.6145098",
"0.61085755",
"0.6101478",
"0.6084277",
"0.60819995",
"0.607896",
"0.60047257",
"0.5973388... | 0.7264121 | 0 |
Get the view direction | function getViewDirection() {
return $this.find("input:radio[name='set-view-tool-toggle-view-radio']:checked").val();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get viewDirection() {\n return this.node.worldTransform.forward;\n }",
"get direction() {\n return Math.atan2(this._dy, this._dx);\n }",
"getDirection() {\n return this._dirVector\n }",
"getDirection() {\n return this.velocity.heading();\n }",
"get Directional(... | [
"0.77814156",
"0.75672305",
"0.75500643",
"0.7304517",
"0.72606814",
"0.72606814",
"0.72454625",
"0.72454625",
"0.7155038",
"0.714379",
"0.705118",
"0.7045737",
"0.70373195",
"0.6998602",
"0.6995413",
"0.6995413",
"0.6995413",
"0.6995413",
"0.69653404",
"0.69653404",
"0.69511... | 0.75773853 | 1 |
Set the view type (image or video) | function setViewType(view_type) {
if (view_type == "image") {
$type_image_radio.prop("checked", true).trigger("change");
} else {
$type_video_radio.prop("checked", true).trigger("change");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeViewType() {\n if ($(this).val() == \"video\") {\n $video_settings.show();\n } else {\n $video_settings.hide();\n }\n }",
"mediaViewContent(type) {\n // Avatars require a bit more overhead than embedded a video.\n if (type == \"3D\") {\n\n } else {\n\n }... | [
"0.66462994",
"0.6452933",
"0.6452933",
"0.6444936",
"0.6305218",
"0.60328865",
"0.59608245",
"0.59016657",
"0.5901379",
"0.58221346",
"0.58140916",
"0.5744728",
"0.5730874",
"0.572481",
"0.56373405",
"0.5597301",
"0.5585303",
"0.55648243",
"0.55225146",
"0.5520666",
"0.54764... | 0.74862784 | 0 |
Parse the capture time string to the format for the thumbnail server | function parseCaptureTime(capture_time, flag) {
var isStart = flag == "start";
return timelapse.shareDateFromFrame(frameNumber, isStart);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parseTimeString(str) {\n\t var pat = /(\\d+)(?::0*(\\d*))?(?::0*(\\d*))?([wsugz])?$/;\n\t var hms = str.match(pat);\n\t hms[1] = parseInt(hms[1], 10);\n\t hms[2] = hms[2] ? parseInt(hms[2], 10) : 0;\n\t hms[3] = hms[3] ? parseInt(hms[3], 10) : 0;\n\t ... | [
"0.66174746",
"0.63496083",
"0.623006",
"0.61529356",
"0.61461204",
"0.6098098",
"0.60874367",
"0.6084792",
"0.6059112",
"0.6052135",
"0.6032957",
"0.60275525",
"0.60011196",
"0.60011196",
"0.60011196",
"0.60011196",
"0.5983925",
"0.59820276",
"0.59644693",
"0.59289074",
"0.5... | 0.6966166 | 0 |
Save the view and pass in the urls to the callback function | function saveView() {
// Set bound
var current_bound_type = $this.find("input:radio[name='set-view-tool-toggle-view-radio']:checked").val();
bound[current_bound_type] = thumbnail_tool.cropBoxToViewBox();
// Automatically compute another bounding box if not defined
if (current_bound_type =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"callbacks(view) {\n return {};\n }",
"function viewHandler() {\r\n if (current_viewType == \"MapView\" && current_tagType == \"Results\") {\r\n var hashValue = createHashValue();\r\n Sys.Application.addHistoryPoint({ param: hashValue }, siteTitle);\r\n }\r\n}",
"function saveH... | [
"0.6141763",
"0.57647717",
"0.5577239",
"0.5437344",
"0.5401857",
"0.5376068",
"0.53088444",
"0.5285452",
"0.5259654",
"0.52407557",
"0.5220864",
"0.5218712",
"0.52063906",
"0.5204594",
"0.5196313",
"0.5168088",
"0.51456624",
"0.5115503",
"0.51096207",
"0.5064388",
"0.5054538... | 0.59816015 | 1 |
Safely get the value from a variable, return a default value if undefined | function safeGet(v, default_val) {
if (typeof default_val === "undefined") default_val = "";
return (typeof v === "undefined") ? default_val : v;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _get(value, default_value) {\n return (typeof value !== 'undefined') ? value : default_value;\n}",
"function pick(value, defaultValue) {\n return (typeof value == 'undefined' ? defaultValue : value);\n}",
"function valueOrDefault(value, defaultValue) {\n return (typeof value !== 'undefined' ? valu... | [
"0.7794473",
"0.703814",
"0.6927442",
"0.67903775",
"0.67801946",
"0.6773843",
"0.67649156",
"0.66695285",
"0.66632265",
"0.66632265",
"0.66632265",
"0.66632265",
"0.66632265",
"0.6631824",
"0.6609301",
"0.654778",
"0.6471768",
"0.6423813",
"0.6423813",
"0.6393943",
"0.637500... | 0.76575196 | 1 |
parcel layer lookup parcelLayerLookup.js / ParcelLayerLookup: Function takes in the file and corresponding kmlURL and loads onto the google earth map. | function parcelLayerLookup(file,kmlURL){
google.earth.fetchKml(ge, kmlURL, function(kmlObject) {
if (kmlObject) {
parcelLayerKmlObjects[file] = kmlObject;
ge.getFeatures().appendChild(kmlObject);
//Turn off progress bar- layer has been loaded
$( "#progress" ).hide();
}els... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadKmlLayer(src, map) {\n var kmlLayer = new google.maps.KmlLayer(src, {\n suppressInfoWindows: true,\n preserveViewport: false,\n map: map\n });\n}",
"function parcelLayerLookupProperty(prop){\r\n\r\n\tvar state = (dijit.byId('stateSelect').attr('value'));\r\n\tvar county = (dijit.byId('cou... | [
"0.6571343",
"0.650267",
"0.649249",
"0.62924314",
"0.62120456",
"0.6206204",
"0.59701234",
"0.57573986",
"0.5686159",
"0.5620046",
"0.5595912",
"0.5587309",
"0.55815345",
"0.5550928",
"0.5487337",
"0.5473676",
"0.54624367",
"0.54424226",
"0.5433153",
"0.54221016",
"0.5380291... | 0.84817517 | 0 |
parcelLayerLookupProperty: For every property, this function generates the respective file and kmlURL for each state to pass on to the parcelLayerLookupFunction | function parcelLayerLookupProperty(prop){
var state = (dijit.byId('stateSelect').attr('value'));
var county = (dijit.byId('countySelect').attr('value'));
//Show progress bar to indicate layer is trying to be loaded
$( "#progress" ).show();
var kmlURL = "";
var file = "";
if(state == 'CT'){
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parcelLayerLookup(file,kmlURL){\r\n\r\n\tgoogle.earth.fetchKml(ge, kmlURL, function(kmlObject) { \r\n\t\tif (kmlObject) {\r\n\t\t\t\t\r\n\t\t\tparcelLayerKmlObjects[file] = kmlObject;\r\n\t\t\t\r\n\t\t\tge.getFeatures().appendChild(kmlObject);\r\n\t\t\t\r\n\t\t\t//Turn off progress bar- layer has been loa... | [
"0.6042953",
"0.54312944",
"0.52857333",
"0.5114337",
"0.5096704",
"0.502749",
"0.48938456",
"0.482331",
"0.48059607",
"0.47932214",
"0.4776222",
"0.47628272",
"0.47342563",
"0.47303274",
"0.472645",
"0.47064537",
"0.4691943",
"0.4688487",
"0.46872607",
"0.46706766",
"0.46676... | 0.7967477 | 0 |
tslint:disableline:novarrequires JS module with no typings Monkeypatches Cucumber.js Given/When/Then step generators to ensure that any step definition they create is executed within WebDriver's ControlFlow and therefore synchronised with it | function synchronise(cucumber, controlFlow) {
[
'Given',
'When',
'Then',
]
.forEach(function (stepGenerator) { return cucumber[stepGenerator] = synchronising(cucumber[stepGenerator]); });
// ---
/**
* Creates a synchronising StepGenerator, which looks like a regular ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSteps() {\n //\n}",
"pluginSteps () {\n // no-op, could be overridden by each plugin as needed\n // this place holder exist for those plugins that don't need, nor include it\n }",
"function verifyStep() {\n return;\n}",
"async __before() {\n\n }",
"step() {\n }",
"function creat... | [
"0.6537142",
"0.6290711",
"0.58648574",
"0.5848269",
"0.5755958",
"0.56127995",
"0.56087136",
"0.556596",
"0.55217916",
"0.54857177",
"0.5483009",
"0.5478683",
"0.54085654",
"0.5394542",
"0.53527576",
"0.5322944",
"0.53208435",
"0.53144664",
"0.53081644",
"0.52698797",
"0.522... | 0.64808077 | 1 |
Assumes that step definition has a callback interface if the number of parameters passed by cucumber matches its signature | function hasCallbackInterface(step, params) {
return step.length === params.length;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onStepClicked(step) {\n if (this.props.hasOwnProperty('onStepClicked') && typeof this.props.onStepClicked === 'function') {\n\n // Wrap the function in a generic handler so we can pass in custom args\n let callback = this.props.onStepClicked\n callback(arguments[0])\n\n //this.props.stepper.... | [
"0.60111177",
"0.53357375",
"0.5277389",
"0.5252428",
"0.5223187",
"0.5221596",
"0.5215726",
"0.51717657",
"0.51712924",
"0.51608187",
"0.5121375",
"0.5106613",
"0.5106613",
"0.5106613",
"0.5077486",
"0.50350976",
"0.5031157",
"0.50228137",
"0.49924105",
"0.4974495",
"0.49596... | 0.7054775 | 0 |
get the current user's postcards | getUserPCards(){
const userPCards = this.state.postcards.filter((p) => {
if(p.creator.id === this.props.currentUser.id){
return true
} else {
return false
}
})
this.setState({
userPCards: userPCards
})
// console.log(userPCards, "this is userPCards");
// console.log(this.friends, "this i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCards() {\r\n\t\t\treturn Cards;\r\n\t\t}",
"get_player_cards() {\n return this.player_cards.slice();\n }",
"function get() {\n return flashcards;\n }",
"getCards() {\n return fetch((this.serverUrl + this.cohortId + '/cards'), {\n method: 'GET',\n header... | [
"0.5859594",
"0.5850943",
"0.58410156",
"0.58115953",
"0.58092487",
"0.5726481",
"0.5718664",
"0.5627883",
"0.55990374",
"0.55341965",
"0.55325043",
"0.5453752",
"0.5422395",
"0.5378189",
"0.536914",
"0.5368849",
"0.53682446",
"0.53682446",
"0.53535444",
"0.53529525",
"0.5318... | 0.6508762 | 0 |
Helper function to get all the templates. Use MW Bot to get the article content, check if the flag 'querycontinue' exists, if true, update the params and recursively crawl all the data | function getAllTemplatesHelper(client, params, result, callback){
client.api.call(params, function(err, info,next,data){
if(err ) {
callback(err);
return;
}
if(info === undefined || data === undefined){
callback(null,result);
return;
}
var allPages = info.pages;
for(var ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadTemplates() {\n var memes = document.querySelector('#memes');\n var explorePage = document.querySelector('#explore-page');\n var profileContainer = document.querySelector(\"#profileContainer\");\n var templates = document.querySelector('#templates');\n \n \n hideElement(memes);\n ... | [
"0.6160094",
"0.5783326",
"0.5763503",
"0.5729636",
"0.5691242",
"0.55316967",
"0.54979575",
"0.5446544",
"0.5431458",
"0.54151",
"0.5400517",
"0.5377952",
"0.53313285",
"0.5323913",
"0.53125715",
"0.53007936",
"0.53000456",
"0.5261358",
"0.5230719",
"0.5219951",
"0.5210505",... | 0.75340915 | 0 |
0 Arreglo con los ids de clientes | function listClientsIds() {
return clients.map((client) => client.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function listClientsIds() {\r\n return clients.map((client) => client.id);\r\n}",
"setTrainerClients(trainerId,all_members){\n let clients = [];\n const trainr = trainers.getTrainerById(trainerId);\n\n for (let i = 0; i < all_members.length; i++) {\n \n let clientid = all_members... | [
"0.75315136",
"0.66284287",
"0.62458766",
"0.6217505",
"0.6035421",
"0.6034431",
"0.5970337",
"0.59598064",
"0.5926643",
"0.59232664",
"0.58875877",
"0.5885199",
"0.5880773",
"0.5859923",
"0.58451194",
"0.5841449",
"0.58350736",
"0.582053",
"0.58189577",
"0.5815092",
"0.58127... | 0.74397016 | 1 |
jQuery, DOM or array items collection | function elementsCollection(items) {
this.items = items;
this.itemsType = '';
if (isjQuery(this.items)) {
this.itemsType = 'jquery';
}
else if (isArray(this.items)) {
this.itemsType = 'array';
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function arrayToJQueryCollection(arr){\n\n var $elems = $();\n\n $.each(arr, function(index, val){\n $elems.push(val);\n });\n\n return $elems;\n }",
"get elements() {\n var nodes = this.getElementsByTagName('*');\n var alist = new NodeList(this.ownerDocume... | [
"0.6398591",
"0.6328386",
"0.6305668",
"0.595632",
"0.59514034",
"0.585366",
"0.5852011",
"0.5851255",
"0.5837879",
"0.5810554",
"0.58004874",
"0.5765881",
"0.57648706",
"0.57470983",
"0.5745242",
"0.57406974",
"0.5704926",
"0.5702945",
"0.56814384",
"0.56805414",
"0.56761444... | 0.6914237 | 0 |
appends lazy elements to all sections and slides | function appendLazyElements(id){
$(id).find('.section').each(function(index, section){
var slides = $(section).find('.slide');
if(slides.length){
slides.append(lazyLoadElements);
}
else{
$(section).append(lazyLoadElements);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lazyLoadElements()\n{\n\n\tj('.js-lazy-element').Lazy({\n\n\t\tappendScroll: j('.gallery-fancybox'),\n\n\t\t// your configuration goes here\n\t\tscrollDirection: 'vertical',\n\t\teffect : \"fadeIn\",\n\t\teffectTime : 6000,\n\t\tthreshold : 0,\n\n onError: function(element) {\n ... | [
"0.69075495",
"0.6644243",
"0.658902",
"0.6442739",
"0.64072156",
"0.63911957",
"0.6364695",
"0.63170844",
"0.6272464",
"0.62431777",
"0.6213038",
"0.6184953",
"0.6181076",
"0.6174484",
"0.61272013",
"0.6118433",
"0.6090135",
"0.6072181",
"0.60691625",
"0.6060781",
"0.6055313... | 0.8027627 | 0 |
Create function to adjust available races depending on the selected realm | function onRaceSelect() {
resetCharacterDetails('race');
getSelectedRace();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ApplyRace(inputracetxt) {\n\tif (IsSetDropDowns) return; // when just changing the dropdowns, don't do anything\n\tif (event.target && event.target.name === \"Race\" && inputracetxt.toLowerCase() === event.target.value.toLowerCase()) return; //no changes were made\n\n\t//only update the tooltips and Curre... | [
"0.593356",
"0.57053953",
"0.5624847",
"0.55944216",
"0.554933",
"0.553638",
"0.550276",
"0.54573035",
"0.53042465",
"0.530214",
"0.5293917",
"0.5272608",
"0.5261902",
"0.5228653",
"0.5218481",
"0.519335",
"0.5161235",
"0.5146744",
"0.51294076",
"0.51259243",
"0.5116925",
"... | 0.5797918 | 1 |
Inserts available races and classes into drop downs depending on selected realm | function fillDropDown(type) {
if(type == 'races') {
document.getElementById(type).innerHTML += `<option name="Blank" id="Blank"></option>`
if(selectedRealm == 'Albion') {
for(let i = 0; i < albRaces.length; i++) {
document.getElementById(type).innerHTML += `<option name="${albRaces[i].name}" id="${albRace... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selRace() {\n\t\t\n\t\t// define needed variables\t\t\n\t\tvar races = [\"--Choose A Race--\", \"Human\", \"Elf\", \"Dwarf\", \"Gnome\", \"Half-Elf\", \"Half-Orc\", \"Halfling\"];\n\t\t\n\t\t// create our select elements/attributes\n\t\t$(\"#select_race\").append(\"<select id='char_race'></select>\");\n\t... | [
"0.6942811",
"0.6205235",
"0.6154234",
"0.6039244",
"0.6029395",
"0.6010385",
"0.589867",
"0.5889169",
"0.58508927",
"0.5795259",
"0.5766403",
"0.572316",
"0.5702267",
"0.5696914",
"0.56728023",
"0.5619226",
"0.5618283",
"0.5583504",
"0.5560256",
"0.5554829",
"0.5553376",
"... | 0.7324415 | 0 |
Constructs trainer window with each specialization's name, buttons, slider and trained values | function drawTrainer() {
document.getElementById("specializationAdjusters").innerHTML = "";
document.getElementById('totalSpecAvailable').innerHTML = parseInt(document.getElementById('specPoints').value);
document.getElementById('totalSpecNeeded').innerHTML = 0;
document.getElementById('totalSpecRemaining').innerHT... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setupGui() {\n // Create training buttons and info texts\n for (let i = 0; i < NUM_CLASSES; i++) {\n const div = document.createElement('div');\n document.body.appendChild(div);\n div.style.marginBottom = '10px';\n\n // Create training button\n const button = document.createElement('butto... | [
"0.6280078",
"0.5845733",
"0.5837423",
"0.57454824",
"0.5733037",
"0.56987756",
"0.56039774",
"0.5582284",
"0.5573014",
"0.5544506",
"0.5537348",
"0.5493128",
"0.54904824",
"0.54685724",
"0.54557365",
"0.5440571",
"0.54324436",
"0.53751624",
"0.5371557",
"0.53213423",
"0.5260... | 0.6807294 | 0 |
Adjusts the needed and remaining specialization points when a spec's trained value is increased or decreased | function adjustSpecPoints(spec, action) {
let slider, value, pointsNeeded, pointsRemaining, pointsAvailable, minLevel, trainButton, selectedSpec;
selectedSpec = selectedClass.specializations.find(specs => specs.metaData.spec == spec);
slider = document.getElementById(`${spec}Slider`);
value = document.getElementByI... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawTrainer() {\n\tdocument.getElementById(\"specializationAdjusters\").innerHTML = \"\";\n\tdocument.getElementById('totalSpecAvailable').innerHTML = parseInt(document.getElementById('specPoints').value);\n\tdocument.getElementById('totalSpecNeeded').innerHTML = 0;\n\tdocument.getElementById('totalSpecRe... | [
"0.5658595",
"0.54331845",
"0.5381301",
"0.5375069",
"0.53332835",
"0.5153795",
"0.5087976",
"0.50556654",
"0.50287867",
"0.50276935",
"0.50104976",
"0.4981105",
"0.4978683",
"0.49765354",
"0.4972208",
"0.49517238",
"0.489033",
"0.48827806",
"0.48599392",
"0.4855377",
"0.4852... | 0.6667315 | 0 |
Changes the displayed minimum level on the trainer window according to all specializations trained values | function adjustMinLevel() {
let highestValues = [];
for(specLine in selectedClass.specializations) {
highestValues[specLine] = parseInt(document.getElementById(`${selectedClass.specializations[specLine].metaData.spec}Value`).textContent);
}
document.getElementById('minLevelDisp').innerHTML = Math.max(...highestVa... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetLevel(lvl) {\n $('.train-tech').each(function(index) {\n $(this).find('label').each(function() {\n if (parseInt($(this).text()) > parseInt(lvl)) {\n $(this).addClass('invisible');\n } else if ($(this).hasClass('invisible')) {\n $(this).remov... | [
"0.60029745",
"0.5898105",
"0.57346034",
"0.5503636",
"0.54541874",
"0.545348",
"0.54525995",
"0.54322803",
"0.5428703",
"0.54163814",
"0.54163814",
"0.53820163",
"0.53729236",
"0.5359262",
"0.5355849",
"0.53556305",
"0.53514034",
"0.5341827",
"0.5337851",
"0.53285575",
"0.53... | 0.7852582 | 0 |
Resets character level to 1 | function resetLevel() {
level = 1;
specPoints = 0;
document.getElementById("charLevel").value = level;
document.getElementById("specPoints").value = specPoints;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetLevel() {\n currentLevel = 1;\n $('#level').text('Level: ' + 0);\n}",
"SET_LEVEL_CHARACTERS(state) {\n if (!state.levels.length) return;\n\n state.levelCharacters = state.levels[state.currentLevel]\n .word.split('').map(char => char);\n }",
"function resetLevelCounter() {\n cou... | [
"0.6955234",
"0.66225",
"0.65455943",
"0.62612236",
"0.6236968",
"0.6189931",
"0.6110915",
"0.6064244",
"0.5877144",
"0.58462685",
"0.5843873",
"0.5824463",
"0.5731066",
"0.5687628",
"0.56227225",
"0.56179047",
"0.56148237",
"0.5614778",
"0.55638766",
"0.5550558",
"0.553944",... | 0.7239688 | 0 |
Resets character base attributes | function resetAttributes() {
str = 0;
con = 0;
dex = 0;
qui = 0;
intel = 0;
emp = 0;
pie = 0;
cha = 0;
resetAttributeBonus();
resetAttributePrio();
resetResists();
document.getElementById('strAttribute').value = str;
document.getElementById('conAttribute').value = con;
document.getElementById('dexA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"reset(){\n\t\tthis.currentChar = null;\n\t\tthis.charNum=-1;\n\t\tthis.row = 1;\n\t}",
"function resetJsAttributeVars(){\n\t//Determinamos los valores para realizar la b?squeda\n\tjsCccCuentCorriBancaCodCc = '';\n\tjsCccCuentCorriBancaSociOidSoci = '';\n\tjsCccCuentCorriBancaDesCc = '';\n\tjsCccCuentCorriBancaCu... | [
"0.6387259",
"0.63328755",
"0.63178074",
"0.6307188",
"0.62369657",
"0.62369657",
"0.62369657",
"0.6155614",
"0.6121908",
"0.6121908",
"0.6006916",
"0.59874165",
"0.59810007",
"0.59193116",
"0.5872516",
"0.58647186",
"0.58644086",
"0.58088255",
"0.5782814",
"0.5782168",
"0.57... | 0.65574497 | 0 |
Resets character attribute priorities | function resetAttributePrio() {
let styleNormal = 'white';
document.getElementById('strPrio').style.color = styleNormal;
document.getElementById('strLabel').style.color = styleNormal;
document.getElementById('conPrio').style.color = styleNormal;
document.getElementById('conLabel').style.color = styleNormal;
docum... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetAttributes() {\n\tstr = 0;\n\tcon = 0;\n\tdex = 0;\n\tqui = 0;\n\tintel = 0;\n\temp = 0;\n\tpie = 0;\n\tcha = 0;\n\t\n\tresetAttributeBonus();\n\tresetAttributePrio();\n\tresetResists();\n\t\n\t\t\n\tdocument.getElementById('strAttribute').value = str;\n\tdocument.getElementById('conAttribute').value... | [
"0.6491287",
"0.5795409",
"0.5789066",
"0.5774858",
"0.5774858",
"0.5774858",
"0.5751256",
"0.57138085",
"0.5620829",
"0.5586866",
"0.5513593",
"0.5396061",
"0.538414",
"0.5358985",
"0.5322135",
"0.53019464",
"0.5295444",
"0.52946705",
"0.5274072",
"0.52740616",
"0.52643746",... | 0.58236337 | 1 |
Resets all character details | function resetCharacterDetails(resets) {
respecAllPoints();
resetSpecializations();
resetLevel();
resetAbilities();
resetSkills();
if(resets == "realm") {
resetAttributes();
} else if(resets == "race") {
resetAttributePrio();
} else if(resets == "class") {
resetAttributeBonus();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\n\n // Remove previous game data\n clearGameDivs();\n\n // Create Characters for Character Select\n charCreation();\n }",
"function resetCharactersState() {\n player.reset();\n allEnemies.forEach((bug) => bug.reset());\n}",
"reset(){\n\t\tthis.currentChar = n... | [
"0.78701144",
"0.7505455",
"0.7473363",
"0.7454053",
"0.72896355",
"0.7269473",
"0.70389986",
"0.7002423",
"0.6999522",
"0.6898899",
"0.6870771",
"0.6845771",
"0.68056756",
"0.6764323",
"0.6703575",
"0.6691988",
"0.6680439",
"0.66690546",
"0.6662629",
"0.66414577",
"0.6640312... | 0.760348 | 1 |
Assigns values to character attributes depending on selected race | function setAttributes() {
if(selectedRace == undefined) {
resetAttributes();
} else {
str = selectedRace.attributes[0].value;
con = selectedRace.attributes[1].value;
dex = selectedRace.attributes[2].value;
qui = selectedRace.attributes[3].value;
intel = selectedRace.attributes[4].value;
emp = selectedR... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"rollAttributes(race) {\n this.iq = this.rollAttribute(race.name, race.iqRoll.sides, race.iqRoll.amount, race.iqRoll.multiplier, race.iqRoll.bonus);\n this.iq.name = 'IQ';\n this.me = this.rollAttribute(race.name, race.meRoll.sides, race.meRoll.amount, race.meRoll.multiplier, race.meRoll.bonus)... | [
"0.67975587",
"0.6378962",
"0.6007689",
"0.5793071",
"0.57650954",
"0.5702842",
"0.56804204",
"0.56697077",
"0.5642171",
"0.5637253",
"0.5601981",
"0.55624884",
"0.5554869",
"0.5527746",
"0.5425915",
"0.54229176",
"0.5333852",
"0.5332638",
"0.5310775",
"0.5281569",
"0.5280707... | 0.72018427 | 0 |
Adds 30 recommended attribute points | function setOptimizedAttributes() {
resetAttributeBonus();
if(selectedClass != undefined) {
setAttributePrio(selectedClass.attributeBonuses[0].name, selectedClass.attributeBonuses[1].name, selectedClass.attributeBonuses[2].name);
for(let i = 0; i < selectedClass.attributeBonuses.length; i++) {
if(selectedC... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_calculateAttrPoints() {\n let { str, agi, vit, luk, dex } = this.config.attributes;\n let attr = { str, agi, vit, luk, dex };\n\n let statusPoints = -50;\n\n for (let value in attr) {\n let val = parseFloat(attr[value]) || 0;\n\n statusPoints += val;\n }\n return stat... | [
"0.59467214",
"0.55897975",
"0.54780865",
"0.5425994",
"0.5388607",
"0.5240325",
"0.5216794",
"0.5206194",
"0.51918584",
"0.5158299",
"0.514587",
"0.49953875",
"0.4978762",
"0.49779087",
"0.4962305",
"0.4961249",
"0.4924716",
"0.48914218",
"0.4885629",
"0.48829642",
"0.485798... | 0.5774076 | 1 |
Increases or decreases attribute bonuses depending on which was selected. | function changeAttributeBonus() {
let attBonus = 0;
if(selectedAttribute.includes('Str')) {
attBonus = strAttBonus;
} else if(selectedAttribute.includes('Con')) {
attBonus = conAttBonus;
} else if(selectedAttribute.includes('Dex')) {
attBonus = dexAttBonus;
} else if(selectedAttribute.includes('Qui')) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setOptimizedAttributes() {\n\tresetAttributeBonus();\n\tif(selectedClass != undefined) {\t\t\n\t\tsetAttributePrio(selectedClass.attributeBonuses[0].name, selectedClass.attributeBonuses[1].name, selectedClass.attributeBonuses[2].name);\n\t\n\t\tfor(let i = 0; i < selectedClass.attributeBonuses.length; i++... | [
"0.6752898",
"0.56343895",
"0.55711067",
"0.53747976",
"0.5250027",
"0.51650184",
"0.5157162",
"0.5155588",
"0.51516265",
"0.5144021",
"0.5142923",
"0.51416814",
"0.50700396",
"0.5036561",
"0.50324446",
"0.50228363",
"0.50200886",
"0.5016645",
"0.4965555",
"0.4945059",
"0.494... | 0.72473943 | 0 |
Gets skill that was moused over and provides object details | function tooltip(event) {
let allSpecs, allAbilities, currentSpec, currentAbility, nameLabel, levelLabel, targetElement, targetSkill, xPosition, yPosition, modal, content;
let found = false;
//combat styles variables
let opening, followup, endurance, damage, hit, def, effect, style;
//baseline/spells variables
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function skillHover(skill) {\n\tdocument.getElementById(\"title\").innerHTML = skill.name\n\tdocument.getElementById(\"description\").innerHTML = skill.description\n\tdocument.getElementById(\"graytext\").innerHTML = skill.graytext\n\tdocument.getElementById(\"syn_title\").innerHTML = skill.syn_title\n\tdocument.g... | [
"0.59390056",
"0.5880137",
"0.5837147",
"0.5814841",
"0.58092517",
"0.5790865",
"0.5783276",
"0.5715416",
"0.5597012",
"0.55553716",
"0.5553669",
"0.55379474",
"0.5530697",
"0.55179507",
"0.5510389",
"0.5494134",
"0.548458",
"0.54781127",
"0.54389054",
"0.54352033",
"0.542755... | 0.6029458 | 0 |
Function adjusts available specialization points on character level change | function changeSpecPoints() {
let newLevel;
let halfRun = false;
//check input
if(document.getElementById("charLevel").value == "" || document.getElementById("charLevel").value == 0) {
document.getElementById("charLevel").value = 1;
newLevel = 1;
} else if(document.getElementById("charLevel").value > 50) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sliderChangeResolution(evt) {\n\n const v = evt.target.value\n const vmap = floor(map(v,0,300,1,150))\n lettera.querySelectorAll('.selected').forEach(e => {\n let computedFontSize = window.getComputedStyle(e).fontSize\n let computedSize = floor(parseInt(computedFontSize))\n e.previousSibling.p... | [
"0.5470469",
"0.54686856",
"0.54540014",
"0.54337674",
"0.5268561",
"0.5230991",
"0.5229795",
"0.51258767",
"0.5120956",
"0.5090735",
"0.50762504",
"0.5067915",
"0.505637",
"0.5055292",
"0.50243187",
"0.4981985",
"0.49736798",
"0.49681813",
"0.4967994",
"0.49331206",
"0.49269... | 0.6210229 | 0 |
Wrapper type for phet/joist's Screen class. | function TScreen( screen, phetioID ) {
assertInstanceOf( screen, phet.joist.Screen );
TObject.call( this, screen, phetioID );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ScreenService($window) {\n var Screen = {\n\n /**\n * Returns `true` if the screen is smaller than 600px or false otherwise\n *\n * @return {Boolean}\n */\n isExtraSmallScreen: function isExtraSmallScreen() {\n return $window.outerWidth < 600;\n }\n };\n... | [
"0.70534825",
"0.68759537",
"0.6783137",
"0.6496695",
"0.6491088",
"0.64866346",
"0.6238537",
"0.62010425",
"0.61874944",
"0.61437434",
"0.6118723",
"0.609332",
"0.6061557",
"0.60395014",
"0.60105795",
"0.5990117",
"0.59803736",
"0.58913356",
"0.58691555",
"0.5858786",
"0.581... | 0.796461 | 0 |
Get readable name for log level. | function logLevelName(level) {
return level === LOGLEVEL.ERROR ? "ERROR" :
level === LOGLEVEL.WARN ? "WARN" :
level === LOGLEVEL.INFO ? "INFO" :
level === LOGLEVEL.DEBUG ? "DEBUG" : "UNKOWN";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLevelName(level) {\n const levelName = byLevel[level];\n if (levelName) {\n return levelName;\n }\n throw new Error(`no level name found for level: ${level}`);\n }",
"function getLevelByName(name) {\n switch (name) {\n case \"NOTSET\":\n return LogLe... | [
"0.72270614",
"0.6670532",
"0.65298367",
"0.64718705",
"0.63024217",
"0.6298604",
"0.6298604",
"0.6298604",
"0.6298604",
"0.6298604",
"0.6298604",
"0.6169093",
"0.6169093",
"0.6103596",
"0.6087224",
"0.5923884",
"0.5904535",
"0.5845454",
"0.5757452",
"0.5725256",
"0.57101816"... | 0.76810753 | 0 |
netTotal method provides the net total of the licence (debit value credit value) | $netTotal () {
return this.debitLineValue - this.creditLineValue
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"total() {\r\n const totalDiscount = this.pricingRules.reduce((acc, currPolicy) => {\r\n return acc + currPolicy(this.cart);\r\n }, 0);\r\n const grossPrice = this.cart.reduce((acc, curr) => acc + curr.price, 0);\r\n const netPrice = grossPrice - totalDiscount;\r\n const netPriceFormatted = `$${... | [
"0.69341934",
"0.68644613",
"0.6711884",
"0.64435273",
"0.64308023",
"0.639714",
"0.61395633",
"0.60431474",
"0.59567416",
"0.5954146",
"0.5919869",
"0.59107804",
"0.5910029",
"0.5891956",
"0.5890314",
"0.5843018",
"0.5819664",
"0.58095336",
"0.57637024",
"0.5763245",
"0.5757... | 0.81202763 | 0 |
Switches the current time to break time | function switchBreakTime() {
if (!working && timerMode == 2) {
return;
}
//Adds to counter cycle as it begins switching to the shortBreakTime
counter = counter + 1;
working = false;
console.log(worki... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function switchToBreak() {\n if (session === \"pomodoro\") {\n setSession(\"short\");\n setTimer(short * 60);\n } else if (session === \"short\") {\n setSession(\"long\");\n setTimer(long * 60);\n } else if (session === \"long\") {\n setSession(\"finished\");\n ... | [
"0.75229317",
"0.6955586",
"0.69269186",
"0.6835956",
"0.6832875",
"0.6766717",
"0.66545445",
"0.6620567",
"0.6596654",
"0.65746015",
"0.6543349",
"0.6485053",
"0.6426286",
"0.6420707",
"0.63815063",
"0.63704586",
"0.6321018",
"0.62846255",
"0.62571275",
"0.6218557",
"0.61949... | 0.7459632 | 1 |
Switches from current time to long break time after 4 cycles | function switchLongBreakTime(){
if (!working && timerMode == 50) { //only seems to work when % pomodoroLoop === 0
return;
}
working = false;
console.log(working);
toggleButtons();
currentTime = longBreakTime;
di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function switchBreakTime() {\n if (!working && timerMode == 2) {\n return;\n }\n //Adds to counter cycle as it begins switching to the shortBreakTime\n counter = counter + 1;\n working = false;\n conso... | [
"0.77228343",
"0.71014583",
"0.70260376",
"0.6974498",
"0.69525665",
"0.69492763",
"0.68912774",
"0.6781342",
"0.6739079",
"0.66960126",
"0.6693908",
"0.6675793",
"0.66132593",
"0.65055186",
"0.6469103",
"0.64572966",
"0.64476115",
"0.6438765",
"0.63893723",
"0.6295721",
"0.6... | 0.7609633 | 1 |
Switches the current time to work time | function switchWorkTime() {
if (working) {
return;
}
working = true;
console.log(working);
toggleButtons();
currentTime = workTime;
displayTime();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setWorkTime(value){\n \tthis.setState({\n\t\t\tworkTime:value\n \t});\n \t// update timer to match with work time\n \tif(this.state.isWorkTime){\n \t\tthis.setState({\n \t\t\ttime:{minutes:value, seconds:'00'}\n \t\t})\n \t}\n }",
"function changeTime() {\r\n militaryTime = !militar... | [
"0.71653104",
"0.6962204",
"0.6945134",
"0.6622335",
"0.65442544",
"0.6456276",
"0.6446292",
"0.6407588",
"0.6400327",
"0.6387999",
"0.6367935",
"0.63678944",
"0.6309792",
"0.6243631",
"0.6218069",
"0.61848706",
"0.6116899",
"0.611486",
"0.6096823",
"0.609326",
"0.6075732",
... | 0.80012363 | 0 |
factory function for creating flocks | function createFlock() {
let flock = {};
// relative weights for how much each type of force affects the flockers
flock.defaultSeperateWeight = 32;
flock.defaultPathFindWeight = 20;
flock.seperateWeight = flock.defaultSeperateWeight;
flock.cohesionWeight = 14;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Flock() {\n // An array for all the boids\n this.boids = []; // Initialize the array\n}",
"function setupFlock() {\n\n new GLTFLoader().load(\n gltfs[0],\n (gltf) => {\n flock.add(gltf.scene);\n })\n // new GLTFLoader().load(gltfs[0], function (gltf) {\n // for (let i = 0; i <... | [
"0.63535833",
"0.5851018",
"0.58232206",
"0.5718449",
"0.56688046",
"0.54675585",
"0.5453112",
"0.5337378",
"0.53049177",
"0.526045",
"0.5230604",
"0.52025473",
"0.5200514",
"0.5193664",
"0.5158487",
"0.5150251",
"0.5147645",
"0.5124685",
"0.50777864",
"0.5077587",
"0.506648"... | 0.69972885 | 0 |
Checks if empty and updates the css class | updateEmptiness()
{
if (this.image.getAttribute("src") === "")
{
// no image set
cssClass(this.element, "no-image", true)
}
else if (this.image.naturalWidth == 0)
{
// image set, but error while loading
cssClass(this.element, "n... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _setEmptyClass()\n\t\t\t\t\t{\n\t\t\t\t\t\tconst $body = $(editor.contentDocument.body);\n\t\t\t\t\t\tif($body.text().length === 0)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$body.addClass(\"empty\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$body.removeClass(\"empty\");\n\t\t\t\t\t\t}\n\t\t\t\t... | [
"0.7741291",
"0.6493728",
"0.62388855",
"0.594479",
"0.5829763",
"0.57192904",
"0.5640747",
"0.559124",
"0.55700105",
"0.5555144",
"0.5497608",
"0.54878443",
"0.5484319",
"0.5479713",
"0.5479713",
"0.5457509",
"0.54220384",
"0.54190713",
"0.5414217",
"0.54027855",
"0.53781134... | 0.6808494 | 1 |
Updates the src tag of the image | updateImageSrc()
{
let data = this.shroom.getData(this.key)
if (!(data instanceof Object))
return
this.image.src = this.shroom.spores[data["@spore"]].url;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeImage(img, src)\n{\n\timg.setAttribute(\"src\", src);\n}",
"function setSrcImage(id, src) {\n $(id).attr('src', src);\n}",
"function setSrcImage(id, src) {\n $(id).attr('src', src);\n}",
"set(src) {\n this.updateAttrs({\n src,\n })\n }",
"fun... | [
"0.7624073",
"0.75045913",
"0.75045913",
"0.7141109",
"0.7059534",
"0.6980487",
"0.69651705",
"0.6874747",
"0.6853547",
"0.68299574",
"0.680597",
"0.6804781",
"0.6779013",
"0.67292595",
"0.67287934",
"0.67159766",
"0.6709548",
"0.67039603",
"0.6682472",
"0.6678812",
"0.667051... | 0.78120106 | 0 |
function to show winner modal popup window | function winnerPopUp() {
let pointshtml = document.querySelector('.points').innerHTML;
document.querySelector('.game-points').innerHTML = pointshtml;
modalwindow.modal({
fadeDuration: 300
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayWinner(winner) {\n\t\t\tdocument.getElementById(\"winnerModal\").style.display = \"block\";\t// Show winning popup\n\t\t\tif(winner == \"p1\") {\t// If winner is Player 1, then show the bet points won from player 2\n\t\t\tdocument.getElementById(\"betPoints\").innerHTML = document.getElementById(\"... | [
"0.8050343",
"0.7650021",
"0.76379293",
"0.754843",
"0.754252",
"0.7430718",
"0.73532015",
"0.7319761",
"0.7231072",
"0.71850336",
"0.7162204",
"0.7151993",
"0.7149342",
"0.7099907",
"0.7059261",
"0.70308036",
"0.7012919",
"0.6987453",
"0.6981163",
"0.6964182",
"0.6925203",
... | 0.76988673 | 1 |
Modify the kebabize function so that it converts a camel case string into a kebab case. kebabize('camelsHaveThreeHumps') // camelshavethreehumps kebabize('camelsHave3Humps') // camelshavehumps Notes: the returned string should only contain lowercase letters | function kebabize(str) {
str = str.replace(/[\d]/g, "")
str = str.charAt(0).toLowerCase() + str.slice(1);
return str.replace(/([A-Z])/g, a => "-"+a.toLowerCase());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function kebabize(str) {\n return str.replace(/[A-Z]/g, c => '-' + c.toLowerCase()).replace(/\\d/g, '').replace(/^-/, '');\n}",
"function kebabize(str){\n return str.split('')\n .map(letter => letter.replace(/\\d/,''))\n .filter(letter => letter!=='')\n .map( (letter,i) => \n letter.replace( /[... | [
"0.8291274",
"0.8226872",
"0.82045895",
"0.8079909",
"0.78613794",
"0.771038",
"0.7694177",
"0.765223",
"0.76429933",
"0.75495815",
"0.7515734",
"0.7502045",
"0.74607515",
"0.74607515",
"0.74607515",
"0.74607515",
"0.74607515",
"0.74607515",
"0.74607515",
"0.74607515",
"0.746... | 0.8231651 | 1 |
Return the result of an operation over two numbers. Arguments; two valid numbers and one operation symbol. Supports sum, subtraction, multiplication and division. | function getResult(val1, val2, operation) {
if (operation === '+') {
return val1 + val2;
} else if (operation === '-') {
return val1 - val2;
}else if (operation === '*') {
return val1 * val2;
}else if (operation === '/') {
return val1 / val2;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getResult (val1, val2, operation) {\nif (operation === '+') {\n\treturn val1+val2;\n} else if (operation === '-') {\n\treturn val1-val2;\n} else if (operation === '*') {\n\treturn val1*val2;\n} else if (operation === '/') {\n\treturn val1/val2; } \n}",
"function getResult(val1, val2, operation)\t{\r\n ... | [
"0.7775491",
"0.77158475",
"0.7664858",
"0.76280725",
"0.75253",
"0.7517226",
"0.75091016",
"0.7503718",
"0.7503713",
"0.7495627",
"0.74837416",
"0.74794716",
"0.74582535",
"0.74464935",
"0.7436358",
"0.7435007",
"0.74307",
"0.7388168",
"0.73757184",
"0.73439837",
"0.73085797... | 0.77722967 | 1 |
Generic interpolators. Should they be moved to dojox.fx? | function InterpolNumber(start, end){
this.start = start, this.end = end;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createInterpolation(config) {\n if (config.outputRange && typeof config.outputRange[0] === 'string') {\n return createInterpolationFromStringOutputRange(config);\n }\n\n var outputRange = config.outputRange;\n checkInfiniteRange('outputRange', outputRange);\n\n var inputRange = config.inputRange;\... | [
"0.5226438",
"0.5208966",
"0.5208966",
"0.5208966",
"0.5208966",
"0.52064",
"0.5178714",
"0.5178714",
"0.51777995",
"0.51777995",
"0.51777995",
"0.51455927",
"0.5127795",
"0.5127299",
"0.5127299",
"0.51263815",
"0.5060687",
"0.5060687",
"0.50504315",
"0.5031262",
"0.5000389",... | 0.54619133 | 0 |
Get Minder User object from UserStore, by email. | getUserByEmail(email) {
console.assert(email);
// TODO(madadam): Query userStore by email.
// For now, iterate through all users in the UserStore (via Database).
let filter = {
type: 'User',
};
let queryProcessor = this.database.getQueryProcessor(Database.NAMESPACE.SYSTEM);
console.ass... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUser (email) {\n\n var users = db.get('users');\n var user = users[email];\n\n if (!user) {\n // Idea: auto-verify a new user's email the first time?\n user = {\n emails: [ email ],\n machines: []\n }\n users[email] = user;\n db.save();\n }\n\n return user;\n\n} // Don't e... | [
"0.72502846",
"0.71611637",
"0.70365304",
"0.7010321",
"0.6865621",
"0.68529034",
"0.68482304",
"0.67973006",
"0.6765812",
"0.6742651",
"0.66226566",
"0.6572839",
"0.6546656",
"0.65356356",
"0.65266687",
"0.6512056",
"0.64508164",
"0.6442723",
"0.6411303",
"0.634503",
"0.6342... | 0.76860654 | 0 |
Start volume operator's watcher loop. NOTE: Not getting the start sequence right can have catastrophic consequence leading to unintended volume destruction and data loss. Therefore it's important not to call this function before volume manager and registry have been started up. | async start () {
var self = this;
// install event handlers to follow changes to resources.
self._bindWatcher(self.watcher);
await self.watcher.start();
// This will start async processing of volume events.
self.eventStream = new EventStream({ volumes: self.volumes });
self.eventStream.on(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startWatch() {\n if (watcher) return\n\n watcher = setInterval(function() {\n if (self.root[self.origin.offset]) {\n stopWatch()\n self.update()\n }\n }, 300) // is it good enought for you?)\n }",
"_startWatch()\n\t{\n\t\tthis.l... | [
"0.6135947",
"0.568119",
"0.567359",
"0.56579125",
"0.56370825",
"0.56123203",
"0.5604612",
"0.55980366",
"0.5573974",
"0.55622745",
"0.54928344",
"0.5451834",
"0.5439315",
"0.5326769",
"0.5263298",
"0.52530116",
"0.52333266",
"0.520896",
"0.52042437",
"0.5198467",
"0.5198467... | 0.7105868 | 0 |
Stop listening for watcher and node events and reset the cache | async stop () {
this.watcher.removeAllListeners();
await this.watcher.stop();
this.eventStream.destroy();
this.eventStream = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"stop () {\n this._watching = false;\n this._source.removeListener(this._onData);\n }",
"_off() {\n const eventCache = this._eventCache;\n Util.each(eventCache, (fns, type) => {\n Util.each(fns, fn => {\n this.off(type, fn);\n });\n });\n this._eventCache = {};\n }",
"unwatc... | [
"0.6768978",
"0.66860473",
"0.6638057",
"0.660545",
"0.65360165",
"0.651773",
"0.64872086",
"0.64592296",
"0.64260167",
"0.6381153",
"0.6380716",
"0.63805604",
"0.63744617",
"0.6363457",
"0.6363457",
"0.6362668",
"0.635102",
"0.63333756",
"0.6329906",
"0.63173085",
"0.6278626... | 0.67783403 | 0 |
In case something changed in the parameters or the loaded local_connectivity is set to None, just use this method to draw the 'default' surface with the gray coloring. | function LCONN_PICK_drawDefaultColorBuffers() {
if (noOfUnloadedBrainDisplayBuffers != 0) {
displayMessage("The load operation for the surface data is not completed yet!", "infoMessage");
return;
}
for (var i=0; i<BASE_PICK_brainDisplayBuffers.length; i++) {
var fakeColorBuffer = gl.createBuf... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\r\n\tif(resultantSehirler.size == 0) {\r\n\t\tbackground(defaultImag);\r\n\t}\r\n}",
"function setDefaultSettings() {\n\t\tjsPlumb.Defaults.PaintStyle = {\n\t\t\tconnectorStyle : {\n\t\t\t\tstrokeStyle : '#5c96bc',\n\t\t\t\tlineWidth : 2,\n\t\t\t\toutlineColor : 'transparent',\n\t\t\t\toutlineW... | [
"0.5809472",
"0.5646851",
"0.5590601",
"0.5477105",
"0.544275",
"0.54200166",
"0.54032385",
"0.53633785",
"0.53326774",
"0.53302485",
"0.5319482",
"0.5312536",
"0.5276575",
"0.52641565",
"0.5260762",
"0.52517325",
"0.5239368",
"0.52286524",
"0.5225386",
"0.5188266",
"0.516571... | 0.6511621 | 0 |
add plugin to component context | function addPluginToComponentContext(component, plugins) {
var key, pluginName;
for (key in plugins) {
if (plugins.hasOwnProperty(key)) {
pluginName = plugins[key];
if (pluginName.indexOf("plugin.") > -1) {
pluginName = pluginName.replace("... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ComponentPlugin() {}",
"registerPlugin(plugin) {\n this.#pluginClasses = this.#pluginClasses.concat(plugin)\n }",
"function CustomMyPlugin(){}",
"enterInstallPlugin(ctx) {\n\t}",
"function SamplePlugin(){}",
"add(plugin) {\n opr.Toolkit.assert(\n !this.isRegistered(plugin.name)... | [
"0.7387128",
"0.6468559",
"0.63689774",
"0.62432426",
"0.62299263",
"0.6214025",
"0.61889964",
"0.6156075",
"0.613916",
"0.613916",
"0.61074084",
"0.6048713",
"0.59931123",
"0.5948335",
"0.5900905",
"0.5882919",
"0.5853615",
"0.5849386",
"0.58445436",
"0.58445436",
"0.5829193... | 0.7067694 | 1 |
Get the user's account nonce | function getNonce() {
web3.eth.getTransactionCount(userPublicKey, function (err, nonce) {
userNonce = nonce;
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getNonce() {\n return kitx.makeNonce().replace('-', '');\n }",
"static async getCurrentTxNonce() {\n try {\n return await db.get('txNonce');\n } catch (err) {\n throw new Error(`system db: error when getting current tx nonce! ${err}`);\n }\n }",
"async function getUuidByAcc... | [
"0.7199131",
"0.7002627",
"0.6676008",
"0.6660393",
"0.66466504",
"0.66380435",
"0.66198933",
"0.66135764",
"0.65828377",
"0.6544645",
"0.65075827",
"0.64706635",
"0.6308489",
"0.6296824",
"0.6182743",
"0.6095642",
"0.6084536",
"0.60533226",
"0.59984905",
"0.59210694",
"0.586... | 0.79396 | 0 |
id: A unique string identified for this lobby. gameMap: A map of socket ids to game numbers. playersReady: a count of the number of players ready PUBLIC INTERFACE | constructor(id) {
this.id = id;
this.gameMap = new Map();
this.playersReady = 0;
this.playerCount = 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addPlayerToLobby(player, id, privacyPacket) {\n console.log(\"Adding player to lobby. Private: \" + privacyPacket.status);\n for (var i = id; i < 9999; i++) {\n if (!lobbies[i].player1) {\n lobbies[i].player1 = player; //add first player to lobby\n lobbies[i].player1.lob... | [
"0.64829254",
"0.63605165",
"0.6295132",
"0.62644726",
"0.62320685",
"0.6175698",
"0.6060933",
"0.602636",
"0.59750414",
"0.5970375",
"0.59553385",
"0.5911699",
"0.58832794",
"0.5877471",
"0.58734983",
"0.58663654",
"0.5845763",
"0.5819853",
"0.5813941",
"0.58055645",
"0.5802... | 0.7407186 | 0 |
function in charge of drawing the bird | function drawBird(){
cntxt.beginPath();
// cntxt.arc(startPositionX, startPositionY, 15, 0, Math.PI*2);
// //cntxt.rect(startPositionX-20, startPositionY,birdHeight-10,birdHeight-10);
// cntxt.fillStyle = "gold";
// cntxt.fill();
cntxt.drawImage(image, startPositionX, startPositionY, 40,40);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawBird()\r\n{\r\n //v06\r\n c.drawImage(birdPic, bird.x, bird.y, bird.size, bird.size); // Draw bird \r\n/* \r\n //draw bird\r\n c.fillStyle = \"blue\";\r\n c.fillRect(bird.x, bird.y, 40,40);\r\n*/ \r\n}",
"draw() {\n\n\t}",
"function draw() {}",
"function draw() {}",
"func... | [
"0.778179",
"0.7522675",
"0.75054175",
"0.75054175",
"0.7472387",
"0.74120104",
"0.7379145",
"0.7379145",
"0.736226",
"0.7332094",
"0.7332094",
"0.729788",
"0.72856164",
"0.7265834",
"0.725738",
"0.725738",
"0.7186008",
"0.71824944",
"0.7178605",
"0.7178605",
"0.7178605",
"... | 0.76924455 | 1 |
function to animate the still images | function animateImages() {
var state = $(this).attr("data-state");
var still_image = $(this).attr("data-still");
var animated_image = $(this).attr("data-animate");
if (state == "still") {
$(this).attr("data-state", "animate");
$(this).attr("src", animated_image);
} else {
$(t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function anim() {//fades out the current image and starts nextImg.\r\n $(\"#restpics\").fadeTo(fadeSpeed, 0, \"swing\", nextImg);\r\n }",
"function animate() {\n $(\"#gifDiv\").on(\"click\", \".gif-\" + j, function () {\n // to see if the image ... | [
"0.73723394",
"0.73318493",
"0.7290352",
"0.71902007",
"0.70374954",
"0.69719374",
"0.69712704",
"0.6942111",
"0.6867194",
"0.68190795",
"0.68184716",
"0.68087095",
"0.6777269",
"0.67772555",
"0.6750655",
"0.6744293",
"0.67263734",
"0.6722151",
"0.67168325",
"0.66689616",
"0.... | 0.75249815 | 0 |
function to show the favourite images my calling renderImages function | function showFavs() {
event.preventDefault();
$("#topic_div").empty();
$("#images_div").empty();
// if no fav images show no images message
if (Object.entries(favList).length == 0 && Object.entries(favMList).length == 0) {
$("#images_div").html('<div class="alert alert-danger text-center" ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showFavs(){\n clearCards()\n getLikedImages()\n}",
"function renderFavourites() {\n $favouritesOne.html(twitOneObj.favourites); //replace this with favourites method\n $favouritesTwo.html(twitTwoObj.favourites);\n $favouritesImg.attr('class', 'icon');\n $favouritesImg.attr('src', 'TFAssets/fav... | [
"0.72760147",
"0.70011914",
"0.69763476",
"0.6857284",
"0.6829114",
"0.6803615",
"0.679061",
"0.6696675",
"0.66916",
"0.6649041",
"0.6638497",
"0.65891355",
"0.6586874",
"0.6584926",
"0.6560385",
"0.65002936",
"0.64822644",
"0.64577246",
"0.6452354",
"0.64343315",
"0.6414871"... | 0.7216153 | 1 |
Track event in Google Analytics | function gaTrackEvent(eventCateg, eventName, eventData, eventValue){
if(window._gaq && window._gaTrackEvents){
_gaq.push(['_trackEvent', eventCateg, eventName, eventData, eventValue]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetupGoogleAnalyticsTrackEvents(){TrackEventsForImageClicks();}",
"function build_ga_track_event(category, action , label )\n{\n\tvar ga_event_code = \"_gaq.push(['_trackEvent', \" + category + \", \" + action + \", \" + label + \"]);\";\n\tvar gtm_event_code = \"dataLayer.push({'event': 'trackEvent','e... | [
"0.749997",
"0.73782146",
"0.73702127",
"0.7248621",
"0.7220733",
"0.71721864",
"0.7163032",
"0.71343124",
"0.7052875",
"0.7027049",
"0.6997415",
"0.6993715",
"0.69820255",
"0.6962279",
"0.69240475",
"0.69240475",
"0.69240475",
"0.68953633",
"0.6793857",
"0.6763432",
"0.67612... | 0.7654962 | 0 |
Add function to print all addresses, including a header | function showAddresses(addresses){
console.log("Addresses");
for (let address of addresses){
console.log(`\t ${address}`);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAddresses(addresses){\n console.log(`Addressess:`);\n for (let address of addresses){\n console.log(`${address}`);\n }\n}",
"function showAddresses(addresses) {\n console.log(\"Addresses\");\n for (let address of addresses) {\n console.log(`${address}`);\n }\n}",
"f... | [
"0.66010875",
"0.6410055",
"0.6354579",
"0.62576437",
"0.6150504",
"0.5967294",
"0.5933741",
"0.5692028",
"0.5669326",
"0.5651484",
"0.56258667",
"0.5610912",
"0.5594444",
"0.54621744",
"0.5446491",
"0.54314953",
"0.54058945",
"0.5381345",
"0.5347059",
"0.53159654",
"0.525821... | 0.6691771 | 0 |
Add function to print phone types and numbers | function showPhoneNums(phoneNumbers) {
console.log("Phone Numbers:");
for (let phoneNumber of phoneNumbers) {
console.log(`\t ${phoneNumber[0]} : ${phoneNumber[1]}`);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayPhone() {\n\tif(phone == undefined){\n\t\t$('.results').append(` `);\n\t}else{\n\t$('.results').append(`<p class=\"phone\">${phone}</p>`);\n\t}\n}",
"function showPhoneNums(phoneNum){ \n console.log('Phone Numbers:');\n for (const num of phoneNum){\n console.log(num)\n console.log(`${... | [
"0.67594916",
"0.64711034",
"0.64072704",
"0.6286838",
"0.6281348",
"0.62042296",
"0.61712044",
"0.6145859",
"0.6140418",
"0.5987597",
"0.59808326",
"0.595369",
"0.59078777",
"0.5844845",
"0.5844845",
"0.5844845",
"0.5844845",
"0.5839238",
"0.5722724",
"0.5709038",
"0.5704952... | 0.6597237 | 1 |
Add function to show balance status | function showBalanceStatus(amount){
console.log(`Balance: ${amount}`);
if (amount < 0){
console.log("You are overdrawn!");
}
else if (amount < 20){
console.log("Warning: You are close to zero balance.");
}
else{
console.log("Thank you for your business!");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showBalanceStatus(balance) {\n console.log(`Balance: ${balance}`);\n if (balance < 0) {\n console.log(\"You are overdrawn\");\n } else if (balance < 20) {\n console.log(\"Warning: You are close to zero balance!\");\n } else {\n console.log(\"Thank you for your business\");... | [
"0.7927765",
"0.78707075",
"0.7763595",
"0.75828844",
"0.74518114",
"0.72562414",
"0.7172706",
"0.6860901",
"0.6734116",
"0.667888",
"0.66634613",
"0.6655218",
"0.6652689",
"0.6572756",
"0.64908516",
"0.64783895",
"0.64463174",
"0.63874424",
"0.6380933",
"0.63774574",
"0.6327... | 0.7895094 | 1 |
Account Report Add function to show bank customer report | function showAccountReport(customer){
printInfo(customer['Account Holder'], customer['Account Number'], customer['Business Name']);
showAddresses(customer['Addresses']);
showPhoneNums(customer['Phone Numbers']);
showTransactions(customer['Transactions'], customer['Starting Balance']);
if (customer['... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCustomerReport(income, customer) {\n accountInfo(customer.get(\"Account Holder\"),\n customer.get(\"Account Number\"),\n customer.get(\"Business Name\"));\n showAddresses(customer.get(\"Addresses\"));\n showPhones(customer.get(\"Phone Numbers\"));\n console.log(\"Starting Bal... | [
"0.6492166",
"0.643117",
"0.63416195",
"0.6329166",
"0.6305934",
"0.6248692",
"0.6237296",
"0.61892545",
"0.61826855",
"0.6147829",
"0.6145977",
"0.6121835",
"0.603536",
"0.59521556",
"0.59520483",
"0.59437734",
"0.5924145",
"0.5833206",
"0.5826815",
"0.581594",
"0.579614",
... | 0.6671748 | 0 |
Program Transform instruction string to instruction object. | function translateInstruction(instructionString){
let instruction = new Instruction()
instruction.direction = instructionString.charAt(0)
instruction.steps = parseInt(instructionString.slice(1, instructionString.length))
return instruction
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function parse_and_compile(string) {\n \n // machine_code is array for machine instructions\n const machine_code = [];\n \n // insert_pointer keeps track of the next free place\n // in machine_code\n let insert_pointer = 0;\n\n // three insert functions (nullary, unary, binary instructions)... | [
"0.58158255",
"0.5776663",
"0.55535865",
"0.5428346",
"0.54002917",
"0.53187454",
"0.526337",
"0.52281886",
"0.51252437",
"0.50512576",
"0.49951148",
"0.4994877",
"0.49822885",
"0.49604678",
"0.49513486",
"0.49171788",
"0.49130288",
"0.49047327",
"0.48929706",
"0.48867908",
"... | 0.7394208 | 0 |
Channel to handle the file uploads with TUS file: File object metadata: composed details, includes filename, filetype, lastModified and jwt | function uploadChannel(file, metadata) {
return eventChannel(emitter => {
const upload = new tus.Upload(file, {
endpoint: `${FILES_API_HOST}/files/`,
retryDelays: [0, 1000, 3000, 5000],
chunkSize: 52000000,
metadata,
onError: error =>
emitter({
error,
file... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async upload(ctx) {\n console.log('This the part', ctx.request)\n const { key, url } = await uploadFile({\n fileName: ctx.request.files.filename.name,\n filePath: ctx.request.files.filename.path,\n fileType: ctx.request.files.filename.type\n })\n ctx.body = { status: 200, message: 'File ... | [
"0.67077726",
"0.64827627",
"0.64558184",
"0.62924844",
"0.6227367",
"0.61906135",
"0.6180573",
"0.6136669",
"0.61169136",
"0.6110458",
"0.61085814",
"0.6086475",
"0.6063996",
"0.6057043",
"0.6045322",
"0.6007428",
"0.5993868",
"0.5970753",
"0.59320575",
"0.5925074",
"0.59138... | 0.7092991 | 0 |
Add hover class to Search Submit. | function search_add_class() {
$( this ).closest( '.search-form' ).addClass( 'hover' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hover() {\n\t\tname = this.className;\n\t\tthis.className += \" hover\";\n\t}",
"static hoverSearchBar (e) {\n let mainHeaderForm = document.getElementById('main-header-form');\n let mainHeaderInput = document.querySelector('#main-header-form input');\n if ( e.type === 'mouseenter' ... | [
"0.6266334",
"0.6254659",
"0.6134812",
"0.5984802",
"0.59528613",
"0.59319603",
"0.5883229",
"0.58465594",
"0.5726222",
"0.56306",
"0.551865",
"0.5423945",
"0.5419852",
"0.54026955",
"0.53971463",
"0.5394496",
"0.5388945",
"0.5376825",
"0.5323305",
"0.5320663",
"0.53176934",
... | 0.8283861 | 0 |
Make sure to remove all image attributes to fit perfectly. | function remove_image_attributes() {
if ( ( $( 'body' ).hasClass( 'page' ) || $( 'body' ).hasClass( 'single' ) ) && $( '.site-main > .hentry' ).hasClass( 'has-post-thumbnail' ) ) {
$( '.entry-thumbnail' ).find( 'img' ).removeAttr( 'width' ).removeAttr( 'height' );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cleanImages(){\n var images = document.images;\n\n if(images){\n for(var i=images.length-1; i>=0; i--){\n if(this.banners_sizes.indexOf(images[i].width + 'x' + images[i].height) > -1){\n this.fillSpace(images[i]);\n }\n }\n }\n}",
"clean() {\n ... | [
"0.6848228",
"0.66117764",
"0.65174156",
"0.62290907",
"0.62072325",
"0.6199806",
"0.61865604",
"0.61394495",
"0.6127885",
"0.6127885",
"0.6054093",
"0.5993544",
"0.5964562",
"0.5964562",
"0.5964562",
"0.595068",
"0.595068",
"0.5873516",
"0.58641195",
"0.58641195",
"0.5864119... | 0.76699924 | 0 |
Define Site Main width depending on the number of Hentry. | function site_main_width() {
$( '.archive .site-main, .blog .site-main, .search-results .site-main' ).each( function() {
var total_width = 0;
$( this ).find( '.hentry' ).each( function() {
if ( $( window ).width() > 1279 ) {
$( this ).width( Math.round( $( window ).width() / 100 * 24 ) );
total_wi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setMainElementWidth() {\n const el = document.getElementsByTagName(\"main\");\n el[0].style.width = \"100%\";\n el[0].style.maxWidth = \"100%\";\n }",
"setMainElementWidth() {\n const el = document.getElementsByTagName(\"main\");\n el[0].style.width = \"100%\";\n el[0].style.maxWidth = \"100%\... | [
"0.6660658",
"0.6660658",
"0.65286577",
"0.63700026",
"0.62786686",
"0.62612957",
"0.6259904",
"0.6237321",
"0.6235271",
"0.62350935",
"0.6051949",
"0.6022783",
"0.60155696",
"0.6008837",
"0.59961766",
"0.5991908",
"0.5989792",
"0.59783536",
"0.595398",
"0.5920419",
"0.589254... | 0.8029804 | 0 |
Add a class to big image and caption > 767px. | function image_big() {
$( '.page .entry-content, .single .entry-content' ).find( 'img:not(.latex)' ).each( function() {
// Ignore table, VideoPress, portfolio and recipe images
if ( $( this ).parents( 'table' ).length || $( this ).parents( '.video-player' ).length || $( this ).parents( '.portfolio-entry' ).leng... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function normalSize() {\n if ($(\"#bunny-img\").hasClass(\"small-size\")) {\n $(\"#bunny-img\").removeClass(\"small-size\").addClass(\"med-size\")\n }\n}",
"function resizeMobile() {\n var tileHeight = $(\".zci--currency .tile--s\").outerHeight();\n\n if(tileHeight > 155) {\n $(\".z... | [
"0.6108963",
"0.6096135",
"0.605248",
"0.6026164",
"0.6008564",
"0.5978218",
"0.59592015",
"0.5905046",
"0.58571833",
"0.5848575",
"0.58152604",
"0.5794834",
"0.57738644",
"0.57533044",
"0.57150525",
"0.56920844",
"0.5628215",
"0.5620935",
"0.55926794",
"0.55582917",
"0.55353... | 0.689485 | 0 |
The actual arguments are formed as an arraylike object and assigned to `arguments` property of called function object (see second line) and the property can be accessed via `arguments` identifier in the body of function. | function func() {
console.log(arguments);
console.log(func.arguments);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function foo() {\n var args = arguments;\n print(typeof arguments);\n print(arguments.length);\n print(arguments[0]);\n print(arguments[1]);\n print(arguments[2]);\n print(arguments[3]);\n print(arguments[4]);\n print(arguments[5]);\n}",
"function args() {\n console.log(arguments);\n}... | [
"0.7808276",
"0.7420253",
"0.7340528",
"0.72974455",
"0.72869265",
"0.7164266",
"0.7141569",
"0.70776826",
"0.7074114",
"0.7065023",
"0.70395565",
"0.70169604",
"0.6986633",
"0.6966953",
"0.6947821",
"0.6929097",
"0.69202024",
"0.6913285",
"0.68830925",
"0.6852394",
"0.681561... | 0.76088876 | 1 |
stop timer and progress bar | function stop(timer, bar) {
'use strict';
clearInterval(timer);
clearInterval(bar);
document.getElementById('set').disabled = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopTime(){\n\ttimeBarFull2.stop();\n}",
"stop() {\n this.state = GuiTimer.State.STOPPED;\n this.num_ticks = 0;\n this.elapsedTime = 0;\n }",
"stop() {\n if (this.timer) {\n clearInterval(this.timer);\n this.timer = null;\n }\... | [
"0.7917911",
"0.7725674",
"0.74358016",
"0.74323785",
"0.7372481",
"0.73539776",
"0.7333179",
"0.73119825",
"0.7297547",
"0.7261975",
"0.72036415",
"0.7191181",
"0.7135511",
"0.7134322",
"0.7134322",
"0.7123432",
"0.7123031",
"0.71206874",
"0.7120541",
"0.7120081",
"0.7118351... | 0.7920527 | 0 |
Finds the closest MatDialogRef to an element by looking at the DOM. | function getClosestDialog(element, openDialogs) {
var parent = element.nativeElement.parentElement;
while (parent && !parent.classList.contains('mat-dialog-container')) {
parent = parent.parentElement;
}
return parent ? openDialogs.find(function (dialog) { return dialog.id === parent.id; }) : nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getClosestDialog(element, openDialogs) {\n var parent = element.nativeElement.parentElement;\n\n while (parent && !parent.classList.contains('mat-dialog-container')) {\n parent = parent.parentElement;\n }\n\n return parent ? openDialogs.find(function (dialog) {\n return dialog.id === parent.id;\... | [
"0.7281892",
"0.72747505",
"0.60352635",
"0.5862861",
"0.5862861",
"0.5826657",
"0.5826657",
"0.58214414",
"0.5799627",
"0.5799627",
"0.5799627",
"0.5799627",
"0.5799627",
"0.57126033",
"0.56894433",
"0.56836486",
"0.5662812",
"0.5644884",
"0.5643523",
"0.5569606",
"0.5569606... | 0.7345337 | 0 |
mainly used for shooting enemies (i.e. Slime, Flying Eye, Dragon) and all towers if the shooting entity's shootingBounds collide with target's entityBound, the entity can shoot. | function canShoot(shootingEntity, target) {
return (distance(shootingEntity, target) < shootingEntity.shootingRadius + target.radius);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function canShoot() {\n return timeSinceLastShot >= constants.SHOOT_DELAY && currentMunition > 0;\n }",
"enemyShoot (enemy, bullets, player) {\n\n var distance = enemy.x - player.x\n if(enemy.active){\n if(distance < 450 && distance > -450){ //only fire is enemy active and certain distance\n co... | [
"0.6707352",
"0.6694191",
"0.64631355",
"0.6366463",
"0.6333986",
"0.63321674",
"0.63217497",
"0.6299768",
"0.62630814",
"0.6261746",
"0.6234066",
"0.6221293",
"0.6131457",
"0.60891175",
"0.6034285",
"0.60069984",
"0.59924954",
"0.5984191",
"0.59807163",
"0.59719455",
"0.5939... | 0.8060575 | 0 |
Predicted Output: shiftLeft([1,2,3,4,5]) should return [2,3,4,5,0]; | function shiftLeft(arr){
var tempArr=[]
var i;
for (i=1; i<arr.length; i++){
tempArr[i-1]=arr[i];
}
tempArr[i-1]=0;
return tempArr;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function shiftLeft(arr){\n var leftshift = 1;\n for(var i = 0; i < arr.length; i++){\n if(arr[i + leftshift] == undefined){\n arr[i]= 0;\n }\n else{\n arr[i] = arr[i + leftshift];\n }\n \n }\n return arr;\n}",
"function iterationLeftShift(){\r\... | [
"0.78197736",
"0.7748583",
"0.76743126",
"0.733302",
"0.73127776",
"0.72576195",
"0.72358745",
"0.71964145",
"0.7162972",
"0.7139577",
"0.7052198",
"0.70496535",
"0.7048894",
"0.70304286",
"0.70249414",
"0.7016652",
"0.701586",
"0.68902165",
"0.6884941",
"0.68829805",
"0.6846... | 0.8219871 | 0 |
Opens the modal controlled by `this.$anchor`, and closes all others by default. | open() {
if (this.options.deepLink) {
var hash = `#${this.id}`;
if (window.history.pushState) {
window.history.pushState(null, null, hash);
} else {
window.location.hash = hash;
}
}
this.isActive = true;
// Make elements invisible, but remove display: none so w... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"openModal() {\n\t\tthis.modal.addClass(\"modal--is-visible\");\n\t\treturn false; /* it's a link element; prevents default behavior of scrolling up */\n\t}",
"handleOpenModal() {\n this.showTheModal(true);\n }",
"open() {\n if (this.options.deepLink) {\n var hash = `#${this.id}`;\n\n if ... | [
"0.6619162",
"0.6436186",
"0.6420631",
"0.6414111",
"0.62708986",
"0.62447757",
"0.62447757",
"0.61937815",
"0.6190864",
"0.61854243",
"0.61854243",
"0.61854243",
"0.61519766",
"0.61519766",
"0.6148952",
"0.6148952",
"0.6129395",
"0.6128316",
"0.610476",
"0.6093735",
"0.59527... | 0.64846003 | 1 |
Displays dialog with JSLint options. | function showOptionsDialog() {
var currentDoc = DocumentManager.getCurrentDocument(),
opts = [],
promise,
dialog,
dialogOkBtn,
varEls,
varLen,
inputs,
inputsLen,
result,
i,
helpers = {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showOptionsDialog(){\n\t\t$.options.show();\n\t}",
"function options_OnClick()\n{\n\ntry {\n\tDVDOpt.Show();\n}\n\ncatch(e) {\n e.description = L_ERRORUnexpectedError_TEXT;\n\tHandleError(e);\n\treturn;\n}\n\n}",
"function showStyleUsage()\r\n{\r\n // Check for valid record to show the screen(ta... | [
"0.58646953",
"0.57876766",
"0.56536794",
"0.5617709",
"0.5573959",
"0.5559621",
"0.55571496",
"0.5522305",
"0.5518244",
"0.55169106",
"0.54897887",
"0.54897887",
"0.54545367",
"0.54425704",
"0.541844",
"0.53950787",
"0.5393561",
"0.5381795",
"0.535586",
"0.5346006",
"0.53395... | 0.6854442 | 0 |
Clears all dialog's options. | function clearOptions() {
varEls.removeClass('true false').
addClass('default').
html('default'); // Reset all var elements.
inputs.val(''); // Clear input elements' values.
result.val(''); // Clear the directive textarea.
opts = []; ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clear() {\n /**\n * @private\n * @readonly\n * @type {String[]}\n */\n this._options = [];\n\n /**\n * @private\n * @readonly\n * @type {Object}\n */\n this._optionChangeListeners = {};\n }",
"function clearSelect() {\... | [
"0.7127609",
"0.6858851",
"0.66638035",
"0.65561527",
"0.6486778",
"0.6443717",
"0.6432954",
"0.6423284",
"0.63362986",
"0.62972033",
"0.62902254",
"0.62859535",
"0.6262686",
"0.6242057",
"0.6209175",
"0.6207869",
"0.6185047",
"0.61685455",
"0.6148488",
"0.61377466",
"0.61295... | 0.7304732 | 0 |
Inserts JSLint directive on editor body. | function insertDirectiveToEditor() {
var editor = EditorManager.getCurrentFullEditor(),
editorDoc = editor.document,
startPosition = {line: 0, ch: 0},
firstLineContent = currentDoc.getLine(0);
editor.setCursorPos(startPosition); // Set curs... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function appendJSLib(txt) {\n var textArea = htmlEditor.getValue();\n var searchText = textArea.search(\"<head>\");\n if (searchText > 0) {\n txt = \"<head>\" + \"\\n\" + txt;\n var updatedTextArea = textArea.replace(\"<head>\", txt);\n htmlEditor.setValue(upda... | [
"0.62649095",
"0.56064206",
"0.52817476",
"0.52462655",
"0.5238071",
"0.5234011",
"0.50864005",
"0.50029737",
"0.49577615",
"0.4885868",
"0.4880708",
"0.48777372",
"0.48744452",
"0.4848109",
"0.48091125",
"0.48055908",
"0.4782702",
"0.47797245",
"0.4774857",
"0.4770535",
"0.4... | 0.65856206 | 0 |
Gets directive from editor and populates the appropriate options in dialog. Assumes that the directive is on the first line of the document. | function getDirectiveFromEditor() {
var firstLineContent = currentDoc.getLine(0),
tempArr = [],
arr = [],
tempArrLen,
arrLen,
tempArrItem,
arrItem,
subStr,
option,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"findDialog() {\n var opt = this.options\n return opt.dialogDb.getData(opt.dialogPath + this.message.directive)\n }",
"function insertDirectiveToEditor() {\n\t\t\tvar editor = EditorManager.getCurrentFullEditor(),\n\t\t\t\teditorDoc = editor.document,\n startPosition = {line: 0, ch: 0},\n ... | [
"0.60892016",
"0.59507644",
"0.5694983",
"0.503169",
"0.502339",
"0.50210875",
"0.50081563",
"0.5000593",
"0.49820638",
"0.49716112",
"0.49531397",
"0.49264127",
"0.49250394",
"0.49103552",
"0.48856512",
"0.48703137",
"0.48527822",
"0.4845708",
"0.48106632",
"0.47842324",
"0.... | 0.80289 | 0 |
Disables Dialog's OK button. | function disableDialogOkButton() {
dialogOkBtn.
attr('disabled', true).
prop('disabled', true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableDialogOkButton() {\n dialogOkBtn.\n attr('disabled', false).\n prop('disabled', false);\n }",
"function disableClickOK () {\n svl.ui.modalSkip.ok.attr(\"disabled\", true);\n svl.ui.modalSkip.ok.addClass(\"disabled\");\n status.di... | [
"0.7267661",
"0.7129125",
"0.6910105",
"0.6860832",
"0.647934",
"0.6449765",
"0.6368663",
"0.63062215",
"0.62856525",
"0.62655056",
"0.62482095",
"0.6213027",
"0.6168693",
"0.6164758",
"0.6113043",
"0.6089731",
"0.60759073",
"0.60513246",
"0.6051042",
"0.6029336",
"0.601751",... | 0.8044664 | 0 |
Enables Dialog's OK button. | function enableDialogOkButton() {
dialogOkBtn.
attr('disabled', false).
prop('disabled', false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function disableDialogOkButton() {\n dialogOkBtn.\n attr('disabled', true).\n prop('disabled', true);\n }",
"function enableClickOK () {\n svl.ui.modalSkip.ok.attr(\"disabled\", false);\n svl.ui.modalSkip.ok.removeClass(\"disabled\");\n status.... | [
"0.7404397",
"0.73580337",
"0.68238425",
"0.67237216",
"0.641697",
"0.64138544",
"0.6267107",
"0.61749804",
"0.596907",
"0.5821152",
"0.5799574",
"0.57732546",
"0.5697447",
"0.56948125",
"0.56260467",
"0.55892324",
"0.5563277",
"0.55364335",
"0.55362993",
"0.5509189",
"0.5509... | 0.8323505 | 0 |
function that renders most recently added tweet by the user | function loadMostRecentTweet() {
$.ajax({
url: '/tweets',
type: 'GET',
success: function( tweetsReceived){
let len = tweetsReceived.length;
let $tweet = createTweetElement(tweetsReceived[len-1]);
$('#realtweets').prepend($tweet);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUserTweets(author) {\n var userObj = streams.users[author];\n $('.left-bar').html('');\n\n userObj.sort(function(a,b) {\n return b.created_at - a.created_at;\n });\n \n for (let array in userObj) {\n var userTweet = userObj[array];\n var $addItem = $('<div class=\"tweet... | [
"0.7195515",
"0.7053001",
"0.70275956",
"0.69397765",
"0.6927044",
"0.69072205",
"0.6886929",
"0.67934376",
"0.6741705",
"0.6732292",
"0.6726934",
"0.6684648",
"0.66834515",
"0.66510046",
"0.66508603",
"0.66344583",
"0.66155344",
"0.6613198",
"0.66032714",
"0.6596547",
"0.655... | 0.7437344 | 0 |
Helper function that loads all tweets fetched from the server | function loadTweets() {
$.ajax({
url: '/tweets',
type: 'GET',
success: function( tweetsReceived){
renderTweets(tweetsReceived);
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadTweets() {\n $.ajax({\n method: 'GET',\n url: '/tweets'\n }).done(function (tweets) {\n renderTweets(tweets);\n })\n }",
"function loadTweets() {\n $.ajax({\n url: '/tweets',\n method: 'GET',\n success: function(data) {\n renderTweets(data);\n }... | [
"0.8068289",
"0.7941162",
"0.7933183",
"0.7899693",
"0.78852373",
"0.78644735",
"0.78632057",
"0.78528756",
"0.7837476",
"0.7836489",
"0.77257967",
"0.7685289",
"0.76770633",
"0.76211536",
"0.75890374",
"0.7571225",
"0.74954206",
"0.7493426",
"0.74765646",
"0.74688625",
"0.73... | 0.7962375 | 1 |
This validates that the dish id matches the route id | function routeIdBodyId(req, res, next) {
const dishId = req.params.dishId;
const { id } = req.body.data;
if (!id || id === dishId) {
return next();
}
next({
status: 400,
message: `Dish id doesn't match route id. The Dish ${id} is set to the Route ${dishId}`,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function routeIdMatchesDishId(req, res, next) {\n const routeId = req.params.dishId;\n const dishId = req.body.data.id;\n if (!dishId || routeId === dishId) {\n return next();\n }\n next({\n status: 400,\n message: `Dish id does not match route id. Dish: ${dishId}, Route: ${routeId}`,\n });\n}",
"... | [
"0.80513144",
"0.7289964",
"0.70067894",
"0.66113913",
"0.64869153",
"0.6419182",
"0.59673005",
"0.58038664",
"0.5764715",
"0.56778055",
"0.56561583",
"0.56383586",
"0.5634159",
"0.5620975",
"0.55610573",
"0.55139816",
"0.55073434",
"0.5494937",
"0.5479433",
"0.5464012",
"0.5... | 0.76071644 | 1 |
This finds the dish id else it gives an error that the dish doesn't exist | function dishExists(req, res, next) {
const { dishId } = req.params;
const foundDish = dishes.find((dish) => dish.id === dishId);
if (foundDish) {
res.locals.dish = foundDish;
return next();
}
next({
status: 404,
message: `The Dish id ${dishId} doesn't exist`,
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getDish(id) {\n for (let dish of this.dishes) {\n if (dish.id === id) {\n return dish;\n }\n }\n return undefined;\n }",
"function findDishByID(id){\n\treturn new Promise(function(resolve , reject ){\n\t\tDish.findById(id).then(function(dish){\n\t\t\tif(!dish){\n\t\t\t\treturn reject(n... | [
"0.74781245",
"0.6868686",
"0.6765",
"0.67585427",
"0.6728917",
"0.67128533",
"0.66090816",
"0.6372195",
"0.6262563",
"0.62357265",
"0.6112898",
"0.608966",
"0.6052326",
"0.6037922",
"0.6019768",
"0.5928877",
"0.5881352",
"0.5781789",
"0.57483494",
"0.56949395",
"0.5665463",
... | 0.6899697 | 1 |
Function to Handle Game Logic | function gameLogic(){
//Switch for Current State
switch(GameManager.currentState){
//If Currently in Loading
case GameManager.statesE.LOADING:
//Draw Star Background
Background.backgroundDraw();
//Start LoadScreen Bar
loadScreen.startBar(1 , (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function gameLogic(){\n dotEaten();\n powerPelletEaten();\n}",
"function gameLogic(){\r\n player.getSensorData(raceWalls)\r\n if(capsAreMoving){\r\n if(counter % 3 === 0){\r\n smartCapsPop.caps.forEach(caps => {\r\n if(stepCounter < caps.brain.length){\r\n ... | [
"0.73452765",
"0.7200882",
"0.70927835",
"0.6974569",
"0.69632167",
"0.68484575",
"0.6847928",
"0.68189484",
"0.6810065",
"0.67860246",
"0.6782044",
"0.67654526",
"0.6742665",
"0.67110664",
"0.6677355",
"0.66621655",
"0.66495734",
"0.6619207",
"0.66069883",
"0.658284",
"0.657... | 0.7616454 | 0 |
Add Routes from list | _addRoutes(value, parent) {
for (const i in value) {
const newRoute = this._addRoute(value[i], parent);
if (value[i].routes) {
this._addRoutes(value[i].routes || [], newRoute);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addRoutes(value) {\r\n this._addRoutes(value, this._routes);\r\n }",
"async function addRoutes(){\r\n // console.log('start addRoutes')\r\n await store.dispatch(CATEGORIES_ACTION_API_ALL)\r\n\r\n // console.log('before add router', Object.keys(categories).length);\r\n let ca... | [
"0.7115004",
"0.6328758",
"0.62951714",
"0.62859476",
"0.61669344",
"0.6124194",
"0.6102272",
"0.60893047",
"0.6062505",
"0.5967615",
"0.5951528",
"0.58870405",
"0.586204",
"0.586204",
"0.5850178",
"0.583167",
"0.582026",
"0.5796439",
"0.5795517",
"0.57915765",
"0.57899547",
... | 0.7010411 | 1 |
meter element correction for old browsers. eslintdisablenextline nounusedvars | function meter() {
var tag = 'meter'
var symbol = 'value'
var elements = document.getElementsByTagName(tag)
for (var index = 0; index < elements.length; index++) {
var element = elements[index]
var value, inner
value = element.attributes.getNamedItem(symbol) === null ? value : element.attributes.get... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function n(n){return null!=_renderers_support_lengthUtils_js__WEBPACK_IMPORTED_MODULE_0__[\"meterIn\"][n]}",
"function YPower_get_meter()\n { var json_val = this._getAttr('meter');\n return (json_val == null ? Y_METER_INVALID : Math.round(json_val/65.536) / 1000);\n }",
"function mk_skill_meter(... | [
"0.6962216",
"0.60456556",
"0.58662766",
"0.57466817",
"0.56073844",
"0.5587194",
"0.55338424",
"0.54729193",
"0.54673785",
"0.5459549",
"0.5452369",
"0.5451895",
"0.54336524",
"0.543079",
"0.5417399",
"0.54064125",
"0.53619695",
"0.53619695",
"0.53619695",
"0.53619695",
"0.5... | 0.65416205 | 1 |
//////////////////// Data Prep functions /////////////////// //////////////////////////////////////////////////////////// /////////////// Filter out nonneeded nodes | function filterNodeData() {
// //Create a node -> node id mapping
// node_by_id = {}
// nodes.forEach(d => { node_by_id[d.id] = d })
// //Test to see if any nodes exist in the edges, but not the nodes list
// let lost_edges = []
// edges.forEach(d => {
// ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"ssrHydrationPrep() {\n this.nodesToKeep = [];\n\n this.ssrKeep.forEach(item => {\n while (item.firstChild) {\n this.nodesToKeep.push(item.firstChild); // track the nodes that will be preserved\n this.appendChild(item.firstChild);\n }\n });\n\n // Remove all children not in the \... | [
"0.6844233",
"0.61648303",
"0.61069524",
"0.6069485",
"0.6009262",
"0.5929334",
"0.57022935",
"0.5689871",
"0.56531084",
"0.55760187",
"0.5565942",
"0.5564252",
"0.55620235",
"0.5533515",
"0.54686856",
"0.5438662",
"0.543524",
"0.5430432",
"0.5430432",
"0.54065096",
"0.540143... | 0.65261865 | 1 |
Replace duplicate labelled nodes | function replaceDuplicates() {
//Create a node -> node id mapping
node_by_id = {}
nodes.forEach(d => { node_by_id[d.id] = d })
let duplicates = edges.filter(d => d.predicate === "exactMatch")
duplicates.forEach(d => {
let source_node = node_by_id[d.source]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _labelBlankNodes(namer, element) {\n if(_isArray(element)) {\n for(var i = 0; i < element.length; ++i) {\n element[i] = _labelBlankNodes(namer, element[i]);\n }\n } else if(_isList(element)) {\n element['@list'] = _labelBlankNodes(namer, element['@list']);\n } else if(_isObject(element)) ... | [
"0.6064038",
"0.6064038",
"0.6053009",
"0.5914159",
"0.5882795",
"0.58786374",
"0.58786374",
"0.5732964",
"0.5712275",
"0.56812507",
"0.56698555",
"0.56517315",
"0.5620049",
"0.55668676",
"0.5565457",
"0.5538557",
"0.5528612",
"0.5520661",
"0.5505437",
"0.5505437",
"0.5488159... | 0.6481142 | 0 |
Test if one of the nodes of an edge is of a certain node type | function testType(d, type) { return node_by_id[d.source].type === type || node_by_id[d.target].type === type } | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function testTypeId(d, type) { return node_by_id[d.source.id].type === type || node_by_id[d.target.id].type === type }",
"function isNodeOneOf(elem, nodeTypeArray) { // 5246\n if (nodeTypeArray.indexOf(elem.nodeName) !== -1) { ... | [
"0.65917754",
"0.6519063",
"0.64555544",
"0.64555544",
"0.64555544",
"0.64555544",
"0.64555544",
"0.64555544",
"0.64555544",
"0.6418435",
"0.64061415",
"0.6398177",
"0.6303451",
"0.6303451",
"0.6202178",
"0.6156633",
"0.6144389",
"0.6076752",
"0.6059577",
"0.5987218",
"0.5946... | 0.71792567 | 0 |
//////////////////// Community functions /////////////////// //////////////////////////////////////////////////////////// /////// Add community center points to primary nodes | function findCommunityCenters() {
//Run a community algorithm on the primary nodes
let community = jLouvain().nodes(nodes_primary.map(d => d.id)).edges(edges_primary)
let community_result = community()
//Find the number of nodes per community
community_count = byCount(d3.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setupCommunity() {\n const { width, height } = this.borderCtx.canvas.getBoundingClientRect();\n this.borderCtx.clearRect(0, 0, width * 2, height * 2);\n const bounds = this._createIncrementals();\n\n for (let i = 0; i < this.numCommunities; i++) {\n const dividedStats = this._createDividedStats(i)... | [
"0.6259903",
"0.6194895",
"0.6194524",
"0.61633533",
"0.6123724",
"0.6070785",
"0.599761",
"0.59579015",
"0.5933565",
"0.585859",
"0.5848149",
"0.5778719",
"0.57401216",
"0.5718138",
"0.56359804",
"0.5632959",
"0.5595224",
"0.5536644",
"0.5532092",
"0.55287045",
"0.55189645",... | 0.7101262 | 0 |
Find the number of (weighted) connections between each pair of communities | function calculateCommunityConnections() {
let community_matrix = {}
//Get the number of connections between the communities
edges.forEach(d => {
let sc = node_by_id[d.source].community
let tc = node_by_id[d.target].community
if(typeof sc === "undefined"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"connWeights() {\n for (var i = 0; i < this.cons.length; i++) {\n this.weights[i] = dist(this.x,this.y,this.cons[i].x,this.cons[i].y);\n }\n }",
"function roadsAndLibraries(n, c_lib, c_road, cities) {\n if (c_road >= c_lib) return n * c_lib;\n\n let sum = 0;\n let count = 0;\n let groups = [];\n ... | [
"0.66197807",
"0.6578101",
"0.64817315",
"0.6240488",
"0.6014069",
"0.59869623",
"0.5919404",
"0.5850477",
"0.5850417",
"0.5845422",
"0.58079773",
"0.579969",
"0.5771854",
"0.5749204",
"0.5744279",
"0.5711287",
"0.57031286",
"0.5692909",
"0.5651798",
"0.5637123",
"0.56168246"... | 0.7923265 | 0 |
Move communities with less than X member to its most connected one | function replaceSmallCommunities(community_count, community_connections, community_count_by_id, community_biggest) {
let min_number = 10
community_count
.filter(d => d.frequency < min_number)
.forEach(d => {
let connections = community_connections.filter(c =>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bubbleUp() {\n let index = this.size - 1;\n const parent = (i) => Math.ceil(i / 2 - 1);\n while (parent(index) >= 0 && this.comparator(parent(index), index) > 0) {\n this.swap(parent(index), index);\n index = parent(index);\n }\n }",
"function makeMove(column,... | [
"0.5413928",
"0.5283869",
"0.52611333",
"0.51126534",
"0.50910336",
"0.5081827",
"0.50703067",
"0.50552994",
"0.5039163",
"0.50332665",
"0.5029522",
"0.49638203",
"0.4950628",
"0.4908805",
"0.4907411",
"0.49035162",
"0.48971987",
"0.4872066",
"0.4869079",
"0.4865139",
"0.4864... | 0.6122657 | 0 |
Run the secondary simulation | function runSecondarySimulation() {
let collide
simulation_secondary
.nodes(nodes)
.stop()
// .on("tick", drawQuick)
// .on("end", () => {
// //Save the final positions for zooming and panning
// nodes.forEach(d =>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"runSimulation(){\n this.moveParticles();\n this.drawParticles();\n this.maintainParticles();\n }",
"run() {\n require('seedrandom')('hi.', { global: true });\n wireSlidersToHandlers(this);\n this.populateCommunities();\n this.updateAgentSize(this.getAgentSize(this.stats.sum()));\n\n this... | [
"0.66218126",
"0.6345764",
"0.6265735",
"0.62582016",
"0.61962146",
"0.6174463",
"0.61267745",
"0.60720927",
"0.6069868",
"0.5885984",
"0.5836352",
"0.5794748",
"0.57436365",
"0.5681844",
"0.5676924",
"0.56713957",
"0.55906135",
"0.5589175",
"0.5575492",
"0.5549029",
"0.55292... | 0.70792925 | 0 |
Save the node simulation info to file | function saveToFile(nodes) {
//Only keep the needed values
let nodes_minimal = []
nodes.forEach(d => {
nodes_minimal.push({
"id": d.id,
"community": d.community,
"degree": d.degree,
"x_fixed": roundTo(d.x_fixed, ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"writeToFile() {\n this.writeArrayToFile(this.fileName, JSON.stringify(Member.generateRandomPeople(10)));\n }",
"function studentSaveData() {\n serializer = new xmldom.XMLSerializer();\n tosave = serializer.serializeToString(xmldoc);\n tosave =`<?xml version=\"1.0\" encoding=\"UTF-8\"?><?xml-styleshe... | [
"0.6066181",
"0.60027903",
"0.59522575",
"0.5927036",
"0.58998513",
"0.58454454",
"0.58251315",
"0.56907904",
"0.5641064",
"0.56338286",
"0.56320393",
"0.5630963",
"0.56277597",
"0.560973",
"0.56078506",
"0.5603025",
"0.55985737",
"0.5588829",
"0.55647665",
"0.5549742",
"0.55... | 0.6824118 | 0 |
Calculate the optimum zoom level | function calculateZoomLevel(node) {
//Find an optimal zoom level in terms of how big the node will get
//But the zoom level cannot be bigger than the max zoom
return Math.min(max_zoom, Math.min(width*0.4, height*0.4) / (2*node.r_fixed))
}//function calculateZoomLevel | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function zoomFactor()\r\n{\r\n return Math.pow( Math.sqrt(2), 10-zoomLevel );\r\n}",
"function computeZoom() {\n var camera = m_renderer.camera();\n\n if (camera.position()[2] < 0) {\n m_options.zoom = 3;\n }\n else if (camera.position()[2] < 1) {\n m_options.zoom = 10;\n }\n else if... | [
"0.77335346",
"0.76955795",
"0.7273194",
"0.70571667",
"0.691624",
"0.67503196",
"0.67023104",
"0.66784024",
"0.6662409",
"0.66560596",
"0.6625271",
"0.66216993",
"0.66009617",
"0.659813",
"0.64763665",
"0.6474962",
"0.64601433",
"0.6442604",
"0.64401937",
"0.6404261",
"0.638... | 0.79093236 | 0 |
Restart random nav after a period of inactivity | function startInactiveTimer() {
if(!random_navigation_initialized) return
clearTimeout(inactive_timer)
//Set the inactive timer again to restart the animation after 30 seconds of inactivity
inactive_timer = setTimeout(() => { initializeRandomNavigation() }, 30000)
}//function ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restartGame() {\n console.log(\"game restart\")\n setUp(randomIndex(studentName.length))\n resetCounters();\n pageView();\n}",
"function restart() {\n USERdestination = \"\";\n USERadjectives = [];\n USERitinerary = [];\n\n somethingChanged = true;\n\n loadHome();\n}",
"func... | [
"0.61861145",
"0.612977",
"0.60854805",
"0.5945364",
"0.59391665",
"0.5927211",
"0.59113425",
"0.59079033",
"0.58890533",
"0.5875056",
"0.585571",
"0.5847015",
"0.5809781",
"0.57960886",
"0.5786204",
"0.5776193",
"0.5763261",
"0.5760273",
"0.5743163",
"0.57406926",
"0.5738528... | 0.68954146 | 0 |
Draw edges of clicked node on hidden canvas | function drawHiddenEdges(node) {
if(!node) return
//Draw the selected edges
clearCanvas([ctx_hidden])
edges_selected.forEach(d => { drawEdges(ctx_hidden, d, d.stroke_hidden, Math.max(10, getLineWidth(d)) ) })
}//function drawHiddenEdges | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawPotentialEdge() {\n // If user has clicked a node different to the selected node, draw the potential edge\n if (selectedItem != null && currentItem != null && currentItem != selectedItem) {\n var potentialEdge = new Edge(currentItem,selectedItem); \n potentialEdge.setWeight(0);\n ... | [
"0.6705306",
"0.6512164",
"0.6430103",
"0.64066076",
"0.63494587",
"0.6342799",
"0.63407123",
"0.6279985",
"0.62510026",
"0.624014",
"0.61937624",
"0.6172719",
"0.61315507",
"0.609236",
"0.60869837",
"0.60587925",
"0.602985",
"0.60273725",
"0.6012876",
"0.6006444",
"0.6002686... | 0.7236438 | 0 |
////////////// Hover state drawing functions /////////////// //////////////////////////////////////////////////////////// //////////// Draw the selected nodes and edges | function drawSelected() {
if(timer_draw) timer_draw.stop()
//Clear all the canvases
clearCanvas([ctx_edges, ctx_nodes, ctx_hover, ctx_hidden])
//Draw the edges
edges_selected.forEach(d => {
//Make the selected edges more visually apparent
drawEd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw() {\n\tborder();\n\n\tfor (let i = 0; i < states.length; i++) {\n\t\tstates[i].show(mouseX, mouseY);\n\n\t\tif (states[i].selected) {\n\t\t\tstrokeWeight(10);\n\t\t\tstroke(30, 200, 190);\n\n\t\t\tline(\n\t\t\t\tstates[i].x + states[i].w,\n\t\t\t\tstates[i].y + states[i].h / 2,\n\t\t\t\tmouseX,\n\t\t... | [
"0.69600916",
"0.6918191",
"0.67894775",
"0.66354865",
"0.66076887",
"0.650878",
"0.64210165",
"0.6379342",
"0.6354085",
"0.6348937",
"0.63425165",
"0.6338923",
"0.6335611",
"0.633149",
"0.6320026",
"0.6316006",
"0.6291291",
"0.6290603",
"0.6290074",
"0.62826437",
"0.6195843"... | 0.75722957 | 0 |
Calculate edge thickness based on type and zoom | function getLineWidth(d) {
//The min value of how thin the lines can become depends on the zoom level
let min_edge = transform.k < 1 ? transform.k : 0.8
let line_width = 2 * Math.max(min_edge, zoom_edge_increase(transform.k) * (d.focus === "primary" ? primary_line_width : secondary_line_wid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get strokeLength() {\n if (this._el instanceof SVGGeometryElement) {\n return this._el.getTotalLength();\n }\n else {\n const dim = this.bounds;\n return 2 * dim.height + 2 * dim.width;\n }\n }",
"getShelfDepth() { re... | [
"0.62941754",
"0.59827125",
"0.584391",
"0.57445323",
"0.56925195",
"0.55278885",
"0.551577",
"0.5503214",
"0.5472554",
"0.54644614",
"0.54383093",
"0.5412007",
"0.53866124",
"0.5383924",
"0.5378675",
"0.5368532",
"0.53645235",
"0.5348737",
"0.53479004",
"0.5347799",
"0.53319... | 0.66132843 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.