Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Extensions must override these methods
get meleRange () { throw "Game system not supported"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "function ExtraMethods() {}", "transient protected internal function m189() {}", "transient final protected internal function m174() {}", "get extension() { return thi...
[ "0.65565217", "0.6387178", "0.6234775", "0.62329197", "0.61241794", "0.6023681", "0.60214055", "0.59723765", "0.5939525", "0.5939525", "0.5887724", "0.5880492", "0.5807941", "0.5675986", "0.5628541", "0.5611776", "0.55372316", "0.5467687", "0.5466474", "0.54606897", "0.545596...
0.0
-1
Resource measuring how much a token can do on their turn. It takes one time unit for a token to move one tile
get time () { throw "Game system not supported"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get time ()\n\t{\n\t\tlet speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10);\n\t\t\n\t\tif (! speed)\n\t\t\tspeed = 30;\n\n\t\treturn speed / this.gridDistance;\n\t}", "function countMoves() {\n moves++;\n moveCounter.innerHTML = moves;\n if (moves === 1) {\n //time does no...
[ "0.61191505", "0.5944346", "0.57466817", "0.5740257", "0.57154614", "0.5714246", "0.5704308", "0.5698482", "0.56001776", "0.5569426", "0.550349", "0.54873794", "0.5465075", "0.54643494", "0.54584754", "0.5416745", "0.54138476", "0.54136264", "0.5404696", "0.5395248", "0.53903...
0.0
-1
Get various token data
getCurrentHealth (token_ = this.token) { return token_.actor.data.data.attributes.hp.value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getToken() { return this.token.getToken(); }", "function getToken() {\n return token;\n }", "getToken() {\n return [\n this.authenticate([AUTH_TYPE.BASIC, AUTH_TYPE.CLIENT]),\n this._bindAfterToken.bind(this),\n this.exchange(),\n ];\n }", "getToken({ data }) {\n // the paramet...
[ "0.6809693", "0.6736218", "0.667215", "0.6598766", "0.6449091", "0.6422729", "0.64042854", "0.631129", "0.62498766", "0.6212837", "0.62045026", "0.6202585", "0.6146302", "0.6122915", "0.6111426", "0.6108626", "0.6101695", "0.6097957", "0.60831034", "0.6081622", "0.60598177", ...
0.0
-1
A measure of the amount of time a mook has to do stuff todo: evaluate units
get time () { let speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10); if (! speed) speed = 30; return speed / this.gridDistance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "getCompletedPerUnit() {\n return this.recentProgress / this.windowLength;\n }", "function PropulsionUnit() {\n }", "function PropulsionUnit() {\n }", "function Propu...
[ "0.671757", "0.65408695", "0.64435166", "0.64435166", "0.64319277", "0.63505006", "0.63386524", "0.63067424", "0.6302476", "0.62557125", "0.6216922", "0.6166669", "0.61409885", "0.61378205", "0.61341965", "0.6129477", "0.61283743", "0.6123936", "0.61157423", "0.6099823", "0.6...
0.0
-1
Build a custom Model Instance
function JDBModel(modelDef) { this.$$schema = schemaDef; Model.call(this, db, modelDef); } // end JDBModel
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "newModel(arg) {\n const Model = this.Model;\n return new Model(arg);\n }", "function Model() {}", "function createModel() {\n var model = new Model();\n\n // give model the default values provided by the service\n...
[ "0.7250482", "0.7250482", "0.70093375", "0.6923544", "0.67450756", "0.67220956", "0.6662518", "0.64658755", "0.63567436", "0.634368", "0.6336473", "0.6316182", "0.63027406", "0.62577987", "0.6220183", "0.6220183", "0.61887413", "0.6155591", "0.61268884", "0.6102393", "0.60851...
0.0
-1
! Vue.js v2.5.2 (c) 20142017 Evan You Released under the MIT License.
function r(t){return void 0===t||null===t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mounted() {\n }", "mounted() {\n\n }", "mounted() {\n\n }", "constructor() {\n this.vue = new Vue();\n }", "mounted() {\n /* eslint-disable no-console */\n console.log('Mounted!');\n /* eslint-enable no-console */\n }", "created () {\n\n }", "created () {...
[ "0.6943217", "0.6901279", "0.6879416", "0.65494436", "0.6468856", "0.6391447", "0.6391447", "0.6340164", "0.63236547", "0.6313482", "0.6293663", "0.62686497", "0.6234844", "0.6215023", "0.6211317", "0.61953175", "0.61894226", "0.6187602", "0.61824423", "0.61824423", "0.616253...
0.0
-1
alert("screen" + screenwidth + "x" + screenheight); NAVIGATION
function hideAllMenus() { document.getElementById("menu1").style.display = "none"; document.getElementById("menu2").style.display = "none"; document.getElementById("menu3").style.display = "none"; document.getElementById("tableXContainer").style.display = "none"; document.getElementById("map-canvas2").style.display = "none"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBom(){\n console.log(screen.width);\n console.log(screen.height);\n console.log(window.location);\n}", "function starting() {\n\tvar hpos = window.screenX;\n\tvar vpos = window.screenY;\n\talert (\"tonterias\");\n\talert( window.heigth +\",\"+ window.width );\n\twindow.resizeTo( resh, resv);...
[ "0.6858412", "0.67050314", "0.66744655", "0.6490168", "0.6460653", "0.64594173", "0.6424386", "0.63180405", "0.62979835", "0.62548226", "0.61987776", "0.6198234", "0.61946374", "0.61483264", "0.61412436", "0.61165553", "0.6107346", "0.60996777", "0.6095634", "0.60836464", "0....
0.0
-1
The study feature. variation: study info about particular client study variation studyUtils: the configured studyUtils singleton. reasonName: string of bootstrap.js startup/shutdown reason logLevel: the log level from Config.jsm ( uses same level as bootstrap.js)
constructor({variation, studyUtils, reasonName, logLevel}) { this.treatment = variation.name; this.studyUtils = studyUtils; this.reasonName = reasonName; // Randomize frame script URL due to bug 1051238. this.FRAME_SCRIPT_URL = `resource://${STUDY}/content/new-tab-variation.js?${Math.random()}`, this.XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"; this.DOORHANGER_ID = "onboarding-trackingprotection-notification"; this.DOORHANGER_ICON = "chrome://browser/skin/tracking-protection-16.svg#enabled"; this.STYLESHEET_URL = `resource://${STUDY}/skin/tracking-protection-study.css`; this.PREF_TP_UI_ENABLED = "privacy.trackingprotection.ui.enabled"; this.TP_ENABLED_GLOBALLY = (this.treatment === "pseudo-control"); this.TP_ENABLED_IN_PRIVATE_WINDOWS = (this.treatment === "control"); this.PREF_TP_ENABLED_GLOBALLY = "privacy.trackingprotection.enabled"; this.PREF_TP_ENABLED_IN_PRIVATE_WINDOWS = "privacy.trackingprotection.pbmode.enabled"; this.init(logLevel); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStudyState() {\n return this.study_state;\n }", "getStudyStatus() {\n return this.study_status;\n }", "function getScenario (name) {\n var scenario = { name: name }\n scenario.config = require(`../examples/${name}/webpack.config`)\n\n try {\n var manifest = require(`../examples/${name}/package...
[ "0.5128658", "0.50991416", "0.49080807", "0.49036923", "0.48992968", "0.48587966", "0.47773543", "0.471713", "0.4692595", "0.4628808", "0.46274167", "0.4625167", "0.45750666", "0.44930327", "0.44772887", "0.44549042", "0.44508377", "0.44479096", "0.44365692", "0.4416215", "0....
0.54558784
0
Create a new instance of the ConsoleAPI, so we can control the maxLogLevel with Config.jsm.
initLog(logLevel) { XPCOMUtils.defineLazyGetter(this, "log", () => { const ConsoleAPI = Cu.import("resource://gre/modules/Console.jsm", {}).ConsoleAPI; const consoleOptions = { maxLogLevel: logLevel, prefix: "TPStudy", }; return new ConsoleAPI(consoleOptions); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ConsoleLogger() {\n var formatter = new Formatter(),\n consoleHandler = new ConsoleHandler(formatter),\n savedLevel = storage.get(STORAGE_NAMESPACE),\n utils = new LoggerUtils(this);\n\n Logger.call(this, consoleHandler, entryFactory);\n\n if (savedLev...
[ "0.6528621", "0.6328268", "0.6290529", "0.6275239", "0.6195472", "0.6178798", "0.6178798", "0.6087904", "0.6008766", "0.5973577", "0.5962152", "0.58590657", "0.57695955", "0.57655317", "0.5696917", "0.5696194", "0.5569975", "0.55513996", "0.5537464", "0.542825", "0.5420169", ...
0.62470955
4
"fast" and "private" treatments differ only in copy
async applyExperimentalTreatment( win, introPanelMessage, learnMoreURL, newTabMessage) { // 1. Initialize built-in Tracking Protection, OFF globally Services.prefs.setBoolPref(this.PREF_TP_ENABLED_IN_PRIVATE_WINDOWS, false); // 2. Show intro panel if addon was just installed if (this.reasonName === "ADDON_INSTALL") { this.showIntroPanel(win, introPanelMessage, learnMoreURL); } // 3. Add new tab variation this.state.newTabMessage = newTabMessage; Services.mm.loadFrameScript(this.FRAME_SCRIPT_URL, true); // 4. Add pageAction icon and pageAction panel; this is the complicated part await this.addPageActionAndPanel(win); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Copy() {}", "_copy () {\n return new this.constructor()\n }", "_copy () {\n return new this.constructor()\n }", "get shallowCopy() {\n return this.shallowCopy$();\n }", "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "copyXYZW() {\nreturn RQ.copyOfQV(this.xyzw)...
[ "0.65383637", "0.6479084", "0.6479084", "0.6328337", "0.6242957", "0.6227667", "0.6221231", "0.6175137", "0.6035028", "0.5996835", "0.59868425", "0.5962454", "0.5962454", "0.59060967", "0.5902603", "0.58771706", "0.587453", "0.5839078", "0.58348656", "0.581035", "0.5794205", ...
0.0
-1
This method is called if event occurs from: Services.wm.addListener(this) Adds event listeners to newly created windows (browser application window) This method is NOT called when opening a new tab.
onOpenWindow(xulWindow) { var win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor) .getInterface(Ci.nsIDOMWindowInternal || Ci.nsIDOMWindow); win.addEventListener( "load", () => this.addWindowEventListeners(win), {once: true} ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenWindow() {\n this.initDefaultUI();\n this.initFastClick();\n this.setMoblie();\n }", "onWin(callback) {\n\t\tthis.win_observers.push(callback);\n\t}", "connectedCallback () {\n this.shadowRoot.addEventListener('menuIconClick', (e) => this.addWindow(e))\n this.shadowRoot.addEventListener('...
[ "0.67087895", "0.6697847", "0.6690493", "0.66853255", "0.6614415", "0.6608121", "0.6544766", "0.6519769", "0.6515507", "0.6467843", "0.64591724", "0.6441301", "0.64028895", "0.6382979", "0.63580275", "0.6293462", "0.62737226", "0.6258234", "0.6251742", "0.6250687", "0.6203425...
0.6193602
21
This method is called when opening a new tab among many other times. This is a listener for the addTabsProgressListener Not appropriate for modifying the page itself because the page hasn't finished loading yet. More info:
onLocationChange(browser, progress, request, uri, flags) { const LOCATION_CHANGE_SAME_DOCUMENT = 1; // ensure the location change event is occuring in the top frame (not an // iframe for example) and also that a different page is being loaded if (progress.isTopLevel && flags !== LOCATION_CHANGE_SAME_DOCUMENT) { // if tracking protection has already blocked any resources for this tab, // reset the counter on the pageAction if (this.state.blockedResources.has(browser)) { this.showPageAction(browser.getRootNode(), 0); this.setPageActionCounter(browser.getRootNode(), 0); this.state.blockedResources.set(browser, 0); this.state.timeSaved.set(browser, 0); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tabLoad() {\n // Tab load safety check\n if (tabHasLoaded) {\n return;\n }\n tabHasLoaded = true;\n\n setupPage();\n\n getAlerts();\n }", "registeredTabs() {\n this.updateTabs()\n }", "function pageUpdated(tabId, changeInfo, tab) {\n\tif ...
[ "0.65003854", "0.64629453", "0.6443682", "0.63921773", "0.63863176", "0.6301662", "0.6283091", "0.6266893", "0.6263265", "0.6224947", "0.6220185", "0.62192357", "0.61856693", "0.6180788", "0.6180788", "0.6173446", "0.61587244", "0.6147937", "0.61225915", "0.6085357", "0.60780...
0.0
-1
e.g. takes " and turns it into "mozilla.com"
getRootDomain(host) { const domain = host.split("."); domain.shift(); return domain.join("."); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fixLocationNames (text) {\n var t = text; \n t = t.replace(/\\\\'/g, \"'\");\n // console.log(t);\n return t; \n}", "function IgnoreSpecialCharactersFromString(name){\n\t\tvar answer = name.split(\"\");\n\t\t\n\t\tfor(var i=0; i < answer.length; i++){\n\t\t\tif(answer[i] == \"/\" || answer[i...
[ "0.62879425", "0.61810935", "0.617759", "0.6057302", "0.60502386", "0.60371584", "0.60248435", "0.60136855", "0.6006507", "0.6000711", "0.5992546", "0.59913296", "0.5936591", "0.5936591", "0.58925027", "0.5844544", "0.5842103", "0.5836293", "0.5782062", "0.5776443", "0.577606...
0.0
-1
Called when a nonfocused tab is selected. If have CNN in one tab (with blocked elements) and Fox in another, go to Fox tab and back to CNN, you want counter to change back to CNN count. Only one icon in URL across all tabs, have to update it per page.
onTabChange(evt) { const win = evt.target.ownerGlobal; const currentURI = win.gBrowser.currentURI; // Don't show the page action if page is not http or https if (currentURI.scheme !== "http" && currentURI.scheme !== "https") { this.hidePageAction(win.document); return; } const currentWin = Services.wm.getMostRecentWindow("navigator:browser"); // If user changes tabs but stays within current window we want to update // the status of the pageAction, then reshow it if the new page has had any // resources blocked. if (win === currentWin) { this.hidePageAction(win.document); // depending on the treatment branch, we want the count of timeSaved // ("fast") or blockedResources ("private") const counter = this.treatment === "private" ? this.state.blockedResources.get(win.gBrowser.selectedBrowser) : this.state.timeSaved.get(win.gBrowser.selectedBrowser); if (counter) { this.showPageAction(win.document, counter); this.setPageActionCounter(win.document, counter); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onSwitchTab()\n\t{\n\t\tvar idx = jQuery(this).index();\n\t\t_preferences.tab = parseInt(idx, 10);\n\n\t\tClient.loadFile(DB.INTERFACE_PATH + 'basic_interface/tab_itm_0'+ (idx+1) +'.bmp', function(data){\n\t\t\tCashShop.ui.find('.tabs').css('backgroundImage', 'url(' + data + ')');\n\t\t\t//reques...
[ "0.6804875", "0.67060405", "0.662984", "0.6509093", "0.640578", "0.6388963", "0.6351939", "0.6343096", "0.6339086", "0.6297179", "0.6263849", "0.6222256", "0.6215924", "0.62062645", "0.6173672", "0.615899", "0.6154063", "0.613716", "0.61233974", "0.61130035", "0.61130035", ...
0.66836447
2
[END] Init section ============================================================================== [START] Websocket section =======================================================================
function setWebsocketConnection() { console.log('Opening WS connection to: ' + "ws://" + window.location.host + "/API-ws/"); vm.ws = new WebSocket("ws://" + window.location.host + "/API-ws/"); vm.ws.onmessage = function(e) { receiveWebsocketMessage(e.data); }; vm.ws.onopen = function() { // Request information console.log('Opened WS connection to: ' + "ws://" + window.location.host + "/API-ws/"); //TODO requestGetDetails('content', 'get_details'); }; // Call onopen directly if socket is already open if (vm.ws.readyState == WebSocket.OPEN) {vm.ws.onopen();} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n\n /**\n * Initialize the websocket server object\n * @type {TemplatedApp}\n */\n const app = uWS.App().ws('/*', {\n\n // Websocket server options\n compression: uWS.SHARED_COMPRESSOR,\n maxPayloadLength: 16 * 1024 * 1024,\n ...
[ "0.7875458", "0.7656297", "0.7656297", "0.75624424", "0.7470115", "0.74622655", "0.7413259", "0.7399179", "0.7365329", "0.73570615", "0.7317922", "0.72944677", "0.7293981", "0.7284767", "0.72635704", "0.7236498", "0.7235157", "0.7226381", "0.72094995", "0.720764", "0.72030324...
0.6787456
60
Create an iterator for an iterable object.
function iter(object) { var it; if (typeof object.iter === 'function') { it = object.iter(); } else { it = new ArrayIterator(object); } return it; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static createIteratorFromIterable(iterable){\n //TODO save state for restarting when Flow is being reused\n return iterable;\n }", "function iter(o) {\n // Makes sure that create_iterator is called in the same scope as iter.\n return create_iterator.call(this, o);\n}", "funct...
[ "0.7961911", "0.7845444", "0.7678671", "0.74827826", "0.74399346", "0.7403339", "0.7403339", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7401556", "0.7398377", "0.7398377", "0.7396775", "0.7384306", ...
0.74190605
6
Construct a new array iterator.
function ArrayIterator(source) { this._index = 0; this._source = source; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CreateArrayIterator(array, kind) {\n var o = ToObject(array);\n var iterator = new ArrayIterator;\n set_internal(iterator, '[[IteratedObject]]', o);\n set_internal(iterator, '[[ArrayIteratorNextIndex]]', 0);\n set_internal(iterator, '[[ArrayIterationKind]]', kind);\n return iterator;\n ...
[ "0.7158582", "0.6462191", "0.64544094", "0.6399269", "0.63200223", "0.6319811", "0.6319811", "0.6319811", "0.6319811", "0.6319811", "0.6286498", "0.6193526", "0.6193526", "0.61046344", "0.6049771", "0.6003641", "0.59335035", "0.59039986", "0.58515316", "0.5800976", "0.5793156...
0.6902262
2
validates data, returns false if it's ok or an error message else
validateFormData(data){ if (data.s_id == "-1") return 'Вы должны выбрать школу'; if (data.p_name == '') return 'Вы должны выбрать проект'; if (data.start == '') return 'Вы должны указать дату начала'; if (data.finish == '') return 'Вы должны указать дату конца'; if (Date.parse(data.finish) <= Date.parse(data.start)) return 'Дата конца не может быть раньше даты начала'; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate(data) {\n\tif (\n\t\tvalidateName(data[\"name\"]) == \"\" &&\n\t\tvalidateStandard(data[\"standard\"]) == \"\" &&\n\t\tvalidateRollNo(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateDate(data[\"DOB\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"rollNo\"]) == \"\" &&\n\t\tvalidateEmpty(data[\"name\"]) == \"\"...
[ "0.77531505", "0.7391569", "0.72468317", "0.719642", "0.7034853", "0.70219046", "0.7018224", "0.699882", "0.69641054", "0.69521403", "0.69462174", "0.6935079", "0.69181216", "0.69050217", "0.6879", "0.6865814", "0.6849471", "0.68477464", "0.6826225", "0.6814217", "0.6780389",...
0.69787955
8
This handler function recieves data from other ipfscoord peers.
rpcHandler (inData) { try { console.log('Data recieved by rpcHandler: ', inData) const jsonData = JSON.parse(inData) console.log('jsonData: ', jsonData) // _this.eventEmitter.emit('rpcData', jsonData) } catch (err) { console.error('Error in rpcHandler()') // Do not throw an error. This is a top-level function. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "send_data_to_partner(data_received){\n\t\tclients[data_received['person_b']].socket.emit('data_received',{'type' : 'partner_data', 'content': data_received['content']});\n\t}", "function gotData(data) {\n var sender = data.val();\n\n /********************* GET ADDRESS ******************...
[ "0.6314063", "0.60349506", "0.60322356", "0.58554256", "0.58441746", "0.56437814", "0.5621773", "0.5512736", "0.5439217", "0.5390139", "0.5339901", "0.5338641", "0.53247094", "0.532297", "0.5307712", "0.52739733", "0.5268061", "0.5229465", "0.52286667", "0.5208887", "0.520163...
0.0
-1
temperature units C (default) or F
function addChartHT(title, subtitle, y_axis_left_title, y_axis_right_title) { // specify the chart options var chartOptions = { chart: { renderTo: 'chart-container', defaultSeriesType: 'line', backgroundColor: '#ffffff', zoomType: 'x', resetZoomButton: { relativeTo: 'chart' }, panning: true, panKey: 'shift', events: { redraw: function() { chartRedrawEvent(this); } } }, time: { useUTC: false }, title: { text: title }, subtitle: { text: subtitle }, plotOptions: { series: { marker: { radius: 2 }, animation: true, step: false, borderWidth: 0, turboThreshold: 0, lineWidth: 1 } }, xAxis: { type: 'datetime', title: { text: 'Date' }, minRange: 60*60*1000 // one hour }, yAxis: [{ showEmpty: false, title: { text: y_axis_left_title } }, { opposite: true, showEmpty: false, title: { text: y_axis_right_title } }], navigation: { buttonOptions: { verticalAlign: 'bottom', y: -10 } }, exporting: { menuItemDefinitions: { // Custom definition units: { onclick: function () { // toggle temperature units sessionStorage.setItem('fahrenheit',(!useFahrenheit).toString()); location.reload(); }, text: useFahrenheit?'Celsius':'Fahrenheit' } }, buttons: { contextButton: { menuItems: ['downloadPNG','units'] } } }, legend: { enabled: true }, credits: { text: 'casportpony.com', href: '' // 'https://casportpony.com/' does not work on google sites } }; // draw the chart return new Highcharts.Chart(chartOptions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function CtoF(temperature) ...
[ "0.77452135", "0.7725546", "0.76010853", "0.74930245", "0.7398444", "0.7391513", "0.7308329", "0.72347814", "0.72189057", "0.72105247", "0.71854264", "0.71824884", "0.71745837", "0.7166796", "0.7133198", "0.7127945", "0.7110141", "0.71008384", "0.7095202", "0.70890886", "0.70...
0.0
-1
add a series to the chart
function addSeries(chart, name, channel_id, field_number, api_key, results, color, yaxis, conversion_function) { yaxis = yaxis || 0; conversion_function = conversion_function || function(x) {return x}; // get the data with a webservice call $.getJSON('https://api.thingspeak.com/channels/' + channel_id + '/fields/' + field_number + '.json?offset=0&round=2&results=' + results + '&api_key=' + api_key, function(data) { var chart_data = []; var gap_count = 0; var field_name = 'field' + field_number; var prev_time = Date.parse(data.feeds[0].created_at); // iterate through each feed $.each(data.feeds, function() { // get value and time var value = conversion_function(parseFloat(this[field_name])); var time = Date.parse(this.created_at); // skip nulls in data (data with a time but no measurement) if (isNaN(value) && ++gap_count) return; gap_count=0; // deliberately add gap if no measurements for several minutes if (time-prev_time > 5*60*1000) chart_data.push([time-1,null]); prev_time=time; // add to chart data chart_data.push([time, value]); }); // add the chart data (if valid) if (chart_data.length) chart.addSeries({ data: chart_data, name: name, color: color, yAxis: yaxis }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addSeries() {\n storeData = data;\n colorArray.push(colorSpectrum[series%colorSpectrum.length]);\n series = storeData[0].length;\n labelArray.push(origLabels[1] + series);\n doCalc();\n}", "function add(series, metric_name, values) {\n\t\tseries.meta.columns.push(metric_name);\n\t\tseries...
[ "0.7620622", "0.7334544", "0.705951", "0.7002387", "0.6879844", "0.6511024", "0.64162505", "0.6291845", "0.6285553", "0.6232612", "0.6224276", "0.6188661", "0.61150205", "0.61108863", "0.610223", "0.60997015", "0.6095512", "0.6060811", "0.6024232", "0.6022714", "0.6002816", ...
0.66059595
5
called on chart redraw (multiple times)
function chartRedrawEvent(chart) { // track zoom state let wasZoomed = chartIsZoomed; chartIsZoomed = !!(chart.resetZoomButton); chart.yAxis.forEach(function(axis, index) { let extremes = axis.getExtremes(); let chartIncludeMin = Math.min(...chartIncludeValues[index]); let chartIncludeMax = Math.max(...chartIncludeValues[index]); // reset extremes to auto if zoomed if (chartIsZoomed && (chartIsZoomed!=wasZoomed)) { axis.setExtremes(null,null); } // set extremes to include the chartIncludeValues for non zoomed if (!chartIsZoomed && (chartIncludeMin<extremes.min || chartIncludeMax>extremes.max)) { axis.setExtremes(Math.min(extremes.min,chartIncludeMin), Math.max(extremes.max,chartIncludeMax)); } }); // reset x extremes if exiting zoom if (wasZoomed && (chartIsZoomed!=wasZoomed) && chartXStart && chartXEnd) { chart.xAxis[0].setExtremes(chartXStart, chartXEnd); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateChart () {\n \n }", "function redraw(){\n chart.isDirtyBox=true;\n chart.chartWidth=chart.containerWidth;\n chart.reflow();\n chart.redraw();\n }", "function updateChart() {\n removePreviousChart();\n emptyChartData(chart);\n filterCategoryInsertion...
[ "0.74662846", "0.72784215", "0.7269396", "0.7202488", "0.71778464", "0.7036196", "0.70253307", "0.6957714", "0.69487715", "0.6930688", "0.6923092", "0.6878351", "0.6818725", "0.6787653", "0.6758963", "0.67191035", "0.6695916", "0.6674819", "0.6674819", "0.66683656", "0.663317...
0.62400615
58
add a horizontal reference line (and rescale chart if necessary)
function addReferenceLine(chart, value, yaxis) { yaxis = yaxis || 0; // add reference line chart.yAxis[yaxis].addPlotLine({ value: value, color: 'red', dashStyle: 'dot', width: 2 }); // add to the values that should be included on the chart (ie. rescale list) chartIncludeValues[yaxis].push(value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addLine () {\n\tconst linksCoords = this.getBoundingClientRect();\n\tline.style.width = `${linksCoords.width}px`;\n\tline.style.transform = `translate(${linksCoords.left}px, ${linksCoords.top}px)`;\n\tline.style.opacity = 1;\n}", "function renderAxisLine() {\n ctx.save();\n ...
[ "0.6873988", "0.6289484", "0.62650836", "0.6237712", "0.60501766", "0.60153943", "0.59681445", "0.594657", "0.5936607", "0.583125", "0.58251613", "0.5798592", "0.5762405", "0.57575756", "0.5748796", "0.57458395", "0.574221", "0.57418716", "0.574093", "0.5739442", "0.5731919",...
0.7033804
0
set y axis title and label color
function setYAxisColor(chart, color, yaxis) { yaxis = yaxis || 0; chart.yAxis[yaxis].update({ title: { style: { color: color } }, labels: { style: { color: color } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.options.vAxis.title = labels[index];\n }", "function setYAxisTitleFtn(chart, index, labels) {\n $log.info('setting the Y Axis title: ' + labels[index]);\n chart.op...
[ "0.7211678", "0.7211678", "0.69628364", "0.6746738", "0.6605784", "0.65127677", "0.63657725", "0.6360708", "0.61986953", "0.61933553", "0.60415703", "0.58542657", "0.57747245", "0.5773445", "0.5767792", "0.576734", "0.576734", "0.5737276", "0.5737276", "0.57358855", "0.572392...
0.73200464
0
helper function to round numbers correctly
function round(value, decimals) { return Number(Math.round(value+'e'+decimals)+'e-'+decimals); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roundme(val) {\n return val;\n }", "function roundNum(num){\n return Math.round(num * 10) / 10;\n }", "function round(num){\n return Math.round(num*10) / 10;\n }", "function round( nr ) {\n\t\treturn Math.round( 100*nr )/1...
[ "0.7889947", "0.78350425", "0.7595077", "0.74883074", "0.7452614", "0.74313205", "0.7386218", "0.73673147", "0.7365495", "0.7317709", "0.7311718", "0.7285321", "0.72780657", "0.7243302", "0.7238937", "0.72291756", "0.7226804", "0.7224358", "0.7216883", "0.7216824", "0.7198773...
0.0
-1
helper function to convert Celsius to Fahrenheit
function temperatureCtoF(tempC) { return round((tempC * 1.8) + 32, 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function celsiusToFahrenheit(temperature){\n return (temperature*9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature * 9/5)+32;\n}", "function celsiusToFahrenheit(temp){\n return ((9/5) * temp) + 32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature ...
[ "0.8591764", "0.8572324", "0.8557569", "0.855333", "0.8552828", "0.85504115", "0.85355514", "0.85192215", "0.84894556", "0.84592146", "0.843883", "0.8419756", "0.83965737", "0.83819586", "0.8372484", "0.83716947", "0.83716947", "0.83613575", "0.8339583", "0.832744", "0.832477...
0.0
-1
! vuerouter v3.0.2 (c) 2018 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "func...
[ "0.6042088", "0.59192574", "0.58442247", "0.57572705", "0.571358", "0.5663805", "0.56568575", "0.55766237", "0.5550271", "0.5538255", "0.5528895", "0.55286473", "0.5526299", "0.55251426", "0.54889333", "0.5461573", "0.54504114", "0.54407704", "0.5436747", "0.5418446", "0.5403...
0.0
-1
get the user's project count to implement pagination
async function fetchProjectCount() { if (loggedInUser) { const projectCountResult = await fetch( `/searchProjects/${loggedInUser._id}/count/${query}`, { method: "GET", } ); const parsedProjectsData = await projectCountResult.json(); setProjectCount(parsedProjectsData.count); setIsDataLoading(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numPages(){\n let no_pages = Math.ceil(all_projects.length/per_page);\n return parseInt(no_pages);\n }", "function projectCount() {\n $http.get('../api/project/count')\n .success(function (data, status, headers, config) {\n cons...
[ "0.72571236", "0.698243", "0.6689139", "0.6434947", "0.6403922", "0.62969476", "0.6218683", "0.61550844", "0.6129921", "0.610201", "0.60687286", "0.60455346", "0.6043784", "0.6022392", "0.6004966", "0.596928", "0.5943809", "0.59359586", "0.59309965", "0.58342564", "0.5809787"...
0.80330926
0
Adds focus event to the input. On focus selects the text content of the input.
addFocusEventListener() { this.input.addEventListener('focus', () => this.input.select()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function focusInputElement () {\n elements.input.focus();\n }", "function focusInputElement () {\n elements.input.focus();\n }", "focus() {\n this.$.input._focusableElement.focus();\n }", "focus () {\n const { textInput } = this;\n textInput && textInput.focus();\n }", "focus() {\n ...
[ "0.7055412", "0.7055412", "0.68872213", "0.6880144", "0.6875773", "0.6875565", "0.68479896", "0.68452066", "0.6843065", "0.6797068", "0.679039", "0.6767311", "0.66292423", "0.6601434", "0.6599773", "0.6553613", "0.6477195", "0.6431828", "0.6429465", "0.6407373", "0.63576", ...
0.73644197
0
Add Event Listeners Adds a click event listener to the reset button. On click sets the value to every entry in the input matrix to a blank string.
addResetButtonListener() { this.resetBtn.addEventListener('click', () => this.entries().forEach(entry => entry.value = "")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addResetListener() {\n\t\t$('#reset').on('click', resetBoard)\n\t\t\n\t}", "function addResetListener() {\n var resetButton = document.getElementById('reset');\n resetButton.addEventListener('click', resetBoard);\n}", "function reset() {\r\n turn = 1;\r\n clickCounter = 0;\r\n win1 = -1;\r\...
[ "0.6735011", "0.6689606", "0.6662631", "0.66318655", "0.66318655", "0.65800375", "0.6569994", "0.65472484", "0.6508659", "0.6502485", "0.64979905", "0.64452064", "0.64181393", "0.6368874", "0.635599", "0.63265955", "0.6323387", "0.6309487", "0.6270637", "0.6253161", "0.622866...
0.7311259
0
Initialize Matrix Input Grid Generates the initial entries for the input matrix.
initMatrix() { const rows = this.rows(); const columns = this.columns(); for (let row = 0; row < rows; row++) { for (let col = 0; col < columns; col++) { this.matrix.appendChild(this.createMatrixEntry(row, col, this.ID)); } } this.setMatrixGridRows(rows); this.setMatrixGridCols(columns); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "createInitialGrid() {\n let gridArray = [];\n for(let row = 0; row < this.gridData.getSize(); row++){\n for(let col = 0; col < this.gridData.getSize(); col++){\n let cell = new Cell(row, col);\n gridArray.push(cell);\n }\n }\n\n this._...
[ "0.72385544", "0.71468896", "0.70017624", "0.6849892", "0.66762555", "0.667294", "0.6483828", "0.6481032", "0.64789253", "0.64389604", "0.6355339", "0.62756467", "0.6231351", "0.62100494", "0.62091005", "0.61918527", "0.6187529", "0.6180396", "0.6161365", "0.6132321", "0.6129...
0.7775112
0
Constructs a new RoomPool and sets listeners and emitters from the given socket.io instance.
constructor(socketIoInstance) { this.rooms = {}; SafeSocket.socketsOn(socketIoInstance, 'connection', (socket) => { Logger.logInfo('socket ' + socket.id + ' connected'); socket.emit('clientConnectedToServer', { socketId: socket.id }); // Default socket.io actions socket.on('disconnect', () => { this.onDisconnect(socket); }); socket.on('disconnecting', () => { this.playerAttemptLeaveRoom(socket, {}); }); // Custom actions socket.on('hostAttemptEndGame', (data) => { this.hostAttemptEndGame(socket, data) }); socket.on('hostAttemptStartGame', (data) => { this.hostAttemptStartGame(socket, data) }); socket.on('playerAttemptCreateRoom', (data) => { this.playerAttemptCreateRoom(socket, data) }); socket.on('playerAttemptJoinRoom', (data) => { this.playerAttemptJoinRoom(socket, data) }); socket.on('playerAttemptLeaveRoom', (data) => { this.playerAttemptLeaveRoom(socket, data) }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function RoomSocket(io, roomId){\n this.roomId = roomId;\n this.io = io;\n}", "constructor(socket, logger, socketManager) {\n this.socket = socket;\n this.logger = logger;\n this.socketManager = socketManager;\n\n /**\n * Create a map of event handlers to be used during the\n * handler bind...
[ "0.69521755", "0.6355749", "0.6265657", "0.6171448", "0.59839207", "0.5929215", "0.5885986", "0.5880528", "0.57616717", "0.5724911", "0.5722843", "0.5722817", "0.56957006", "0.56906736", "0.5675947", "0.5657708", "0.565391", "0.5651382", "0.5636755", "0.56223243", "0.5620404"...
0.6916228
1
PRIVATE METHODS Attempts to add a player identified by the given username and socket to the room identified by the given room code. Returns true if successful, false if unsuccessful.
_addPlayerToRoom(socket, username, roomCode) { if (!this.roomExists(roomCode)) { return false; } return this.rooms[roomCode].addPlayer(socket, username); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPlayer(socket, username) {\n if (this.playerMap.getPlayerCount() >= MAX_PLAYERS) {\n return false;\n }\n\n if (!this.playerMap.containsUsername(username) && !this.gameServer.isInGame()) {\n this.playerMap.putPlayer(new Player(socket, username));\n\n if (this.hostSocket === undefined) {\n...
[ "0.7259357", "0.6986688", "0.65623856", "0.6164955", "0.616157", "0.60117674", "0.58439666", "0.5842452", "0.58084244", "0.5745237", "0.57409793", "0.57213867", "0.5685096", "0.5671052", "0.56618416", "0.5655997", "0.56455445", "0.5608213", "0.55980283", "0.5526065", "0.55140...
0.902076
0
Returns the room code associated with the given socket. Returns undefined if none exists.
_getRoomCodeFromSocket(socket) { if (socket && socket.rooms) { return socket.rooms[Object.keys(socket.rooms)[1]]; } return undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRoomInfo(socket, game) {\n if(socket && game) {\n const room = Array.from(socket.rooms)[1];\n const existingGame = game.map(game => game.roomId).indexOf(room);\n return existingGame;\n }\n else {\n return -1;\n }\n}", "function GetRoomHost(RequestingSocket, Roo...
[ "0.677028", "0.64517397", "0.6379158", "0.63646704", "0.6343907", "0.6165044", "0.6035847", "0.60143197", "0.5894607", "0.5782973", "0.576276", "0.56828135", "0.55689883", "0.54989797", "0.5497969", "0.5470038", "0.54437405", "0.54031354", "0.54011744", "0.5392365", "0.537356...
0.89912665
0
Returns the sanitized username from the given data object. Returns empty string if unsuccessful.
_getSanitizedUsername(data) { if (!data || !data.username) { return ""; } return StringSanitizer.getHtmlSanitized(data.username).substring(0, MAX_USERNAME_LENGTH); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserName(authData) {\n switch (authData.provider) {\n // case 'password':\n // return authData.password.email.replace(/@.*/, '');\n case 'twitter':\n return authData.twitter.username;\n // case 'facebook':\n ...
[ "0.6556607", "0.6441322", "0.6351614", "0.62824726", "0.62534326", "0.6222458", "0.62051564", "0.593441", "0.58392864", "0.57818395", "0.5737936", "0.5735899", "0.57323736", "0.5671924", "0.567183", "0.5656397", "0.5636011", "0.560751", "0.560013", "0.5596617", "0.55797195", ...
0.8672377
0
PUBLIC METHODS Returns the number of active rooms within the RoomPool.
getNumRooms() { return Object.keys(this.rooms).length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static numActiveGames() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .length;\n }", "static totalNumPlayers() {\n return Rooms.getAll()\n .filter(({isActive}) => isActive)\n .reduce((count, {players}) => {\n return count + players.filter(x => x.isConnected && ...
[ "0.7090985", "0.6865184", "0.6586705", "0.65550524", "0.6523901", "0.6487544", "0.6442403", "0.63598233", "0.63311267", "0.6260583", "0.6251814", "0.61382014", "0.59974605", "0.598827", "0.59823996", "0.5964406", "0.59638923", "0.5648914", "0.5622821", "0.5615856", "0.5610976...
0.73321277
0
Returns the room associated with the given room code.
getRoom(roomCode) { return this.rooms[roomCode]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRoom(roomCode) {\n var ref = firebase.database().ref(\"Rooms/\" + roomCode);\n var room = $firebaseObject(ref);\n \n return room;\n }", "getRoom() {\n const id = this.roomName;\n\n if (!activeRooms.hasOwnProperty(id)) {\n throw new...
[ "0.81037015", "0.6867597", "0.68174833", "0.65568066", "0.6457666", "0.6432544", "0.63360745", "0.62797904", "0.62742895", "0.62188333", "0.6176027", "0.6173807", "0.61285734", "0.60923064", "0.60649204", "0.59586626", "0.59307027", "0.59038717", "0.58686805", "0.5835802", "0...
0.83012074
0
Removes the Room associated with the given room code from the pool.
removeRoom(roomCode) { Logger.logInfo('Removing room: ' + roomCode); this.rooms[roomCode].forceEndGame(); delete this.rooms[roomCode]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteRoom(roomCode){\n let room = rooms[roomCode];\n if(room){\n let players = room.players;\n for(let i = 0; i < players.length; i++){\n let player = players[i];\n delete socks[player].room;\n }\n delete rooms[roomCode];\n }\n}", "function removeRoom(room) {\n\n // Get the ...
[ "0.77561486", "0.68303543", "0.6174956", "0.5931559", "0.58749324", "0.58472323", "0.58472323", "0.57995254", "0.57529414", "0.57374996", "0.5692177", "0.5665478", "0.5627274", "0.5608368", "0.5488951", "0.54682386", "0.5447557", "0.5413424", "0.5396953", "0.5335224", "0.5323...
0.83133036
0
Reserves a new room with a new, random, and unused room code. Returns the new room code.
reserveNewRoom() { var newRoomCode; do { newRoomCode = Hasher.genHash(ROOM_CODE_LENGTH); } while(this.roomExists(newRoomCode)); this.rooms[newRoomCode] = new Room(newRoomCode); return newRoomCode; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genRoomCode() {\n const roomSeed = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',\n rooms = io.sockets.adapter.rooms;\n let code\n do {\n code = ''\n for (var i = 0; i < 5; i++) {\n code += roomSeed[getRandomInt(roomSeed.lengt...
[ "0.6878282", "0.65021133", "0.6363232", "0.63338953", "0.6167534", "0.6124831", "0.6070692", "0.59665966", "0.5927118", "0.590617", "0.5899809", "0.58489764", "0.5801537", "0.57892317", "0.5769441", "0.57183534", "0.57066935", "0.5628291", "0.55877244", "0.55680364", "0.55564...
0.85030913
0
Returns whether a room exists for the given room code.
roomExists(roomCode) { return this.rooms.hasOwnProperty(roomCode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function roomExists(code) {\r\n try {\r\n console.log(\"checking if room with code: \" + code + \" exists\");\r\n console.log(rooms[code]);\r\n if(code == null || code == undefined || typeof code != 'string' || !rooms[code]) {\r\n console.log(\"it's bad\");\r\n return ...
[ "0.8155792", "0.6707367", "0.66065294", "0.6592731", "0.6389099", "0.6184209", "0.61693615", "0.61344033", "0.59396476", "0.58948386", "0.58383", "0.57602453", "0.57387096", "0.56388247", "0.5636944", "0.5549528", "0.5495908", "0.5493824", "0.54198974", "0.53347903", "0.53254...
0.8139524
1
SOCKET LISTENERS Attempts to end a game for the Room associated with the given socket.
hostAttemptEndGame(socket, data) { Logger.logInfo('Socket ' + socket.id + ' attempting to end game'); var roomCode = this._getRoomCodeFromSocket(socket); if (this.roomExists(roomCode)) { var room = this.getRoom(roomCode); if (room.attemptEndGame(socket)) { Logger.logInfo('Game at room ' + roomCode + ' ended'); room.playerMap.emitCustomToAll('hostEndGameSuccess', (socket) => { return { thisClientIsHost: room.socketIsHost(socket) } }); room.playerMap.emitCustomToAll('updateLobby', (socket) => { return room.getLobbyData(socket); }); } else { Logger.logWarning('Socket ' + socket.id + ' failed to end game'); socket.emit('hostEndGameFailure', { reason: 'room.attemptEndGame() failed' }); } } else { Logger.logWarning('Socket ' + socket.id + ' failed to end game'); socket.emit('hostEndGameFailure', { reason: 'Room does not exist' }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static onSocketDisconnect(socket) {\n Object.keys(socket.rooms).forEach(room => {\n try {\n if (rooms.isRoomExists(room)) {\n if (rooms.getRoomPlayersCount(room) === 1) {\n rooms.removeRoom(room);\n } else {\n ...
[ "0.67095983", "0.65666056", "0.6465502", "0.63598245", "0.63392496", "0.6291714", "0.6026626", "0.60133773", "0.59561044", "0.5952015", "0.5904428", "0.59020364", "0.58681196", "0.583592", "0.5810024", "0.5774309", "0.57681537", "0.57665354", "0.57302386", "0.57266414", "0.57...
0.66460216
1
Executes desired actions upon finished disconnect of the given socket.
onDisconnect(socket) { Logger.logInfo('socket ' + socket.id + ' disconnected'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "disconnect() { socket_close(this) }", "function _onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n console.log(\"Disconnection process$$$$$$$\")\n socket.disconnect();\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "function onDisconnect(socket) {\n}", "...
[ "0.74811697", "0.740101", "0.70499253", "0.69528717", "0.69528717", "0.69528717", "0.69528717", "0.6930239", "0.6784795", "0.6738863", "0.6719454", "0.6692035", "0.666585", "0.66150254", "0.64326304", "0.6431526", "0.64082694", "0.6402869", "0.6402145", "0.6392281", "0.637305...
0.66416764
13
Attempts to disconnect the player from their respective room. If the room no longer has any socket connections, remove it.
playerAttemptLeaveRoom(socket, data) { Logger.logInfo('socket ' + socket.id + ' disconnecting...'); var roomCode = this._getRoomCodeFromSocket(socket); if (this.roomExists(roomCode)) { this.getRoom(roomCode).disconnectPlayer(socket); socket.leave(roomCode, () => { socket.emit('playerLeaveRoomSuccess', {}); }); this.getRoom(roomCode).playerMap.emitCustomToAll('updateLobby', (socket) => { return this.getRoom(roomCode).getLobbyData(socket); }); } else { socket.emit('playerLeaveRoomFailure', { reason: 'Room does not exist' }); return; } if (this.getRoom(roomCode).socketsEmpty()) { this.removeRoom(roomCode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "destroy() {\n\t\tfor ( const socket of this._socketServer.getSocketsInRoom( this.id ) ) {\n\t\t\tsocket.disconnect();\n\t\t}\n\n\t\tif ( this.player ) {\n\t\t\tthis.player.destroy();\n\t\t}\n\n\t\tif ( this.opponent ) {\n\t\t\tthis.opponent.destroy();\n\t\t}\n\n\t\tthis.stopListening();\n\t}", "disconnect() {\n ...
[ "0.7549337", "0.746207", "0.74367696", "0.717408", "0.71303415", "0.69996125", "0.6983756", "0.6982726", "0.69243854", "0.6915905", "0.684387", "0.6801671", "0.67985797", "0.67504376", "0.6743738", "0.6723735", "0.6717301", "0.6701697", "0.6583741", "0.6583741", "0.65765405",...
0.6099578
47
Create randomizer to pull 4 different powers of a pokemon and push it into a new array
function getRandomPower(movesArr, data) { let min = 0; let max = data.moves.length; let randomMove = Math.floor(Math.random() * (max - min) + min); movesArr.push(data.moves[randomMove]); // put the four random moves in a new array }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generatePokemonAry(){\n wildPokemon = []\n\n for (let i = 1; i < 650; i++) {\n wildPokemon.push(i);\n \n }\n return wildPokemon;\n \n}", "async function generatePokemonArray(pokemon) {\n randomPokemon = pokemon[Math.floor(Math.random() * 151)]\n getRandomPokemonData(ra...
[ "0.7005367", "0.67773926", "0.6680528", "0.6574842", "0.65537995", "0.6510981", "0.65074015", "0.6484808", "0.6430658", "0.63793385", "0.6373412", "0.6362663", "0.6345218", "0.62932444", "0.6280637", "0.6278372", "0.6272051", "0.6262572", "0.624271", "0.6241701", "0.6209146",...
0.7426572
0
Function to capitalise firstletters
function capitaliseFirstLetter(string) { return string.charAt(0).toUpperCase() + string.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function caps(a) {return a.substring(0,1).toUpperCase() + a.substring(1,a.length);}", "function capitalize(str) {}", "function capitalFirstLetter(name) {\n return name.charAt(0).toUpperCase() + name.slice(1)\n}", "function capitaliseFirstLetter(string){\n\t\t\tvar newstring = string.toLowerCase();\n\t\t\t...
[ "0.8213183", "0.81953067", "0.81399673", "0.80937546", "0.8059772", "0.79980177", "0.79878026", "0.79865927", "0.79527646", "0.7950897", "0.79493636", "0.794932", "0.79415804", "0.79404116", "0.7928362", "0.79268533", "0.7925957", "0.7924953", "0.7924953", "0.7924953", "0.791...
0.7774763
34
Create a function called travelFrom that receives a start station and an end station.
function travelFrom() { var startStationInput = document.querySelector("#startStation"); var startStation = startStationInput.value; var endStationInput = document.querySelector("#endStation"); var endStation = endStationInput.value; var start = capitaliseFirstLetter(startStation.toLowerCase()); var end = capitaliseFirstLetter(endStation.toLowerCase());var startLine = findLine(start); var endLine = findLine(end); var startLineArray = sydneyTrains[startLine]; var endLineArray = sydneyTrains[endLine]; // Check if stations exists on the lines entered if (!stations.includes(start) || !stations.includes(end)) { var message = ("Something went wrong and the stations you entered don't exist on those lines"); } else if (endLineArray.includes(start) || startLineArray.includes(end)) { //Tell person to switch to the line. if (endLineArray.includes(start)) { var correctLine = endLine; } else { var correctLine = startLine; } var numberofStops = Math.abs(endLineArray.indexOf(end) - startLineArray.indexOf(start)); if (numberofStops > 1) { var stopOrStops = "stops"; } else { var stopOrStops = "stop"; }; var message = "To go from "+start+" to "+end+" - you will need to go through "+numberofStops+" "+stopOrStops+" on the "+correctLine+"."; } else { //Find first station that matches both startLine and endLine = switchingStation var switchingStation = endLineArray.find(function(item) { return startLineArray.includes(item); }); //Tell person how many stops from startStation to switchingStation //Tell person where to switch (switchingStation) //Tell person how many stops from switchingStation to endStation var numberofStops1 = Math.abs(startLineArray.indexOf(switchingStation) - startLineArray.indexOf(start)); var numberofStops2 = Math.abs(endLineArray.indexOf(switchingStation) - endLineArray.indexOf(end)); if (numberofStops1 > 1) { var stopOrStops1 = "stops"; } else { var stopOrStops1 = "stop"; }; if (numberofStops2 > 1) { var stopOrStops2 = "stops"; } else { var stopOrStops2 = "stop"; }; var message = "To go from "+start+" to "+end+" - you will need to take "+startLine+" for "+numberofStops1+" "+stopOrStops1+", switch at "+switchingStation+" to "+endLine+", then go through "+numberofStops2+" "+stopOrStops2+"."; }; answer.innerText = message; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_journey(station1, station2) {\n const toDate = new Moment().format(\"YYYY-MM-DD\");\n const fromDate = new Moment().businessSubtract(20).format(\"YYYY-MM-DD\");\n\n return {\n \"from_loc\":station1,\n \"to_loc\":station2,\n \"from_time\":\"0000\",\n ...
[ "0.62054175", "0.5913088", "0.5890718", "0.57346815", "0.5714327", "0.56850135", "0.56673986", "0.5622518", "0.557216", "0.5567229", "0.5535041", "0.55243945", "0.5486196", "0.5436927", "0.5353946", "0.53172594", "0.53129697", "0.527652", "0.52694666", "0.52590513", "0.521350...
0.64472765
0
This method is to define many drawing instructions inside the class, so render method can use them without redefining them every time.
loadInstructions () { this.instructionParameters = { clearRect: ['ctx', 'x', 'y', 'width', 'height'], clearPolygon: ['ctx', 'path'], drawImage: [ 'ctx', 'src', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageByPos: [ 'ctx', 'src', 'pos', 'areaSize', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageInNinePos: [ 'ctx', 'src', 'pos', 'length', 'lengthDiagonal', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawDifferentImageInNinePos: ['ctx', 'src', 'pos', 'allCoords', 'alpha'], drawImageInPolygon: [ 'ctx', 'src', 'path', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], drawImageInPolygonByValue: [ 'ctx', 'src', 'value', 'areaWidth', 'path', 'srcPos', 'size', 'canvasPos', 'resize', 'alpha' ], writeTextLine: [ 'ctx', 'y', 'value', 'color', 'fontSize', 'alpha' ], writeTextLines: [ 'ctx', 'y', 'value', 'newLineOnBelow', 'color', 'fontSize', 'alpha' ] } // everything here has `this.instruction` as `this` this.instruction = { _sin45: Math.sin(Math.PI * 0.75), _posOrder: [ 'upleft','up','upright', 'left','neutral','right', 'downleft','down','downright' ], /** * Take the position data and convert their number to either -1, 0, or 1. * * It turns out there's a joystick that can't push the input all the way to 1, * so this method is to ensure stick/dpad position is always one of 9 possible cases. * * @param {number[]} pos * array of x-axis and y-axis value, each in a range of 0 ~ 1 (inclusive) * @param {number} [threshold=0.5] axis value below this is considered inactive * @returns {number[]} returns new pos data with values always being either -1, 0, or 1. * @private */ _getDigitalPos: function (pos, threshold = 0.5) { if (!pos) { pos = [0, 0] } const posMagnitude = [ Math.abs(pos[0]), Math.abs(pos[1]) ] const digitalPos = [ posMagnitude[0] >= threshold ? pos[0] / posMagnitude[0] : 0, posMagnitude[1] >= threshold ? pos[1] / posMagnitude[1] : 0 ] if (digitalPos[0] % 1 !== 0 || digitalPos[1] % 1 !== 0) { GamepadRenderer.announceMessage( new Error('Value divided by its magnitude didn\'t return 1. ' + 'Code will keep running but it should be always rounded.') ) digitalPos[0] = Math.round(digitalPos[0]) digitalPos[1] = Math.round(digitalPos[1]) } return digitalPos }, clearRect: function ( ctx, x, y, width, height ) { ctx.clearRect(x, y, width, height) }, clearPolygon: function ( ctx, path ) { ctx.save() ctx.globalCompositeOperation = 'destination-out' ctx.beginPath() for (let p = 0; p < path.length; p=p+2) { if (typeof path[p+1] === 'undefined') { continue } ctx.lineTo(path[p], path[p+1]) } ctx.closePath() ctx.fill() ctx.restore() }, drawImage: function ( ctx, src, srcPos, size, canvasPos, resize, alpha = 1 ) { if ( alpha === 0 || !srcPos || !size || !canvasPos ) { return } if (alpha !== 1) { ctx.save() ctx.globalAlpha = alpha } ctx.drawImage(src, ...srcPos, ...size, ...canvasPos, ...resize||size) if (alpha !== 1) { ctx.restore() } }, drawImageByPos: function ( ctx, src, pos, areaSize, srcPos, size, canvasPos, resize, alpha = 1 ) { if (!srcPos || !size || !canvasPos) { return } if (pos === null) { pos = [0, 0] } const fixedPos = [] for (let a = 0; a < 2; a++) { fixedPos.push(pos[a] * areaSize[a] + canvasPos[a]) } this.drawImage( ctx, src, srcPos, size, fixedPos, resize, alpha ) }, drawImageInNinePos: function ( ctx, src, pos, length, lengthDiagonal, srcPos, size, canvasPos, resize, alpha = 1 ) { if (pos === null) { pos = [0, 0] } if (typeof lengthDiagonal === 'undefined') { lengthDiagonal = length * this._sin45 } const digitalPos = this._getDigitalPos(pos) // if both axis is not zero then dP[0]*dP[1] will be true const fixedLength = digitalPos[0] * digitalPos[1] ? lengthDiagonal : length const fixedPos = [] for (let a = 0; a < 2; a++) { fixedPos.push(digitalPos[a] * fixedLength + canvasPos[a]) } this.drawImage( ctx, src, srcPos, size, fixedPos, resize, alpha ) }, drawDifferentImageInNinePos: function ( ctx, src, pos, allCoords, alpha = 1 ) { if (pos === null) { pos = [0, 0] } const digitalPos = this._getDigitalPos(pos) /* * this.posOrder = [ * 'upleft','up','upright', * 'left','neutral','right', * 'downleft','down','downright' * ] */ const positionIndex = 4 + digitalPos[0] + 3 * digitalPos[1] const coord = allCoords[this._posOrder[positionIndex]] if (!coord) { return } this.drawImage( ctx, src, coord[0], coord[1], coord[2], coord[3], alpha ) }, drawImageInPolygon: function ( ctx, src, path, srcPos, size, canvasPos, resize, alpha = 1 ) { ctx.save() if (alpha === 0) { return } if (alpha !== 1) { ctx.globalAlpha = alpha } ctx.beginPath() for (let p = 0; p < path.length; p=p+2) { if (typeof path[p+1] === 'undefined') { continue } ctx.lineTo(path[p], path[p+1]) } ctx.closePath() ctx.clip() ctx.drawImage(src, ...srcPos, ...size, ...canvasPos, ...resize||size) ctx.restore() }, drawImageInPolygonByValue: function ( ctx, src, value, areaWidth, path, srcPos, size, canvasPos, resize, alpha = 1 ) { const fixedPath = [] const width = value * areaWidth for (let p = 0; p < path.length; p++) { if (path[p].constructor === Array) { fixedPath.push( path[p][0] + (path[p][1] ? 1 : -1) * width ) } else { fixedPath.push(path[p]) } } this.drawImageInPolygon( ctx, src, fixedPath, srcPos, size, canvasPos, resize, alpha ) }, /** * write text on a semitransparent black line that fills up the full width * @param {CanvasRenderingContext2D} ctx * @param {number} y bottom point of the text * @param {string} value * @param {string} [color='white'] * @param {number} [fontSize=16] * @param {number} [alpha=1] */ writeTextLine: function ( ctx, y, value, color = 'white', fontSize = 16, alpha = 1 ) { ctx.save() // fill background color ctx.globalAlpha = 0.5 * alpha ctx.fillStyle = 'black' /*const letterHeight = parseFloat( window.getComputedStyle(ctx.canvas, null) .getPropertyValue('font-size') )*/ ctx.fillRect(0, y, ctx.canvas.clientWidth, -1 * fontSize) // write text ctx.globalAlpha = alpha ctx.fillStyle = color ctx.font = '1em monospace' ctx.textBaseline = 'ideographic' ctx.fillText(value, 0, y) ctx.restore() }, /** * write multiple text lines on a semitransparent black line that fills up the full width * @param {CanvasRenderingContext2D} ctx * @param {number} y bottom point of the text * @param {string[]} value * @param {boolean} [newLineOnAbove=false] next line will appear above the last line * @param {string} [color='white'] * @param {number} [fontSize=16] * @param {number} [alpha=1] */ writeTextLines: function ( ctx, y, value, newLineOnAbove = false, color = 'white', fontSize = 16, alpha = 1 ) { ctx.save() // fill background color ctx.globalAlpha = 0.25 * alpha ctx.fillStyle = 'black' const totalHeight = value.length * fontSize ctx.fillRect(0, y, ctx.canvas.clientWidth, -1 * totalHeight) ctx.globalAlpha = alpha ctx.fillStyle = color ctx.font = '1em monospace' ctx.textBaseline = 'ideographic' for (let l = 0; l < value.length; l++) { ctx.fillText( value[l], 0, y - ( newLineOnAbove ? l : (value.length - 1 - l) ) * fontSize ) } ctx.restore() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function draw() {}", "function draw() {}", "_draw() {\n\n }", "draw() { }", "draw() { }", "draw() { }", "function draw() {\n Gravity();\n Animation();\n...
[ "0.73082095", "0.70346916", "0.70346916", "0.70346916", "0.70346916", "0.6950455", "0.6950455", "0.6932039", "0.6868791", "0.6868791", "0.6868791", "0.683042", "0.6829487", "0.6801683", "0.6668261", "0.66600645", "0.6633977", "0.66174203", "0.65915954", "0.65626174", "0.65316...
0.6733822
14
This method is to define gamepad input orders in a way I can hopefully efficiently loop through.
loadOrders () { this.order = { stick: ['left','right'], buttonGroup: ['dpad', 'face', 'shoulder'], button: [ // joystick rendering will skip after first property of this array // so first property should be the joystick related dpad value ['value','up','down','left','right'], [ 'down','right','left','up', 'select','start','l3','r3', 'home','touchpad' ], ['l1','r1','l2','r2'] ] } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startEventListenerOnKeyPads(selectors) {\n function shuffle(array) {\n array.sort(() => Math.random() - 0.5);\n}\n\nlet a = 'up';\nlet b = 'down';\nlet c = 'left';\nlet d = 'right';\n\n\nlet KeyDirection = [a, b, c, d];\n\nshuffle(KeyDirection);\nconsole.log(KeyDirection);\n\nvar up = KeyDirection[0];...
[ "0.649522", "0.6433406", "0.6014376", "0.6013471", "0.58738744", "0.5836327", "0.5830031", "0.5792323", "0.5785564", "0.57520384", "0.572038", "0.57070404", "0.57055527", "0.5665696", "0.5656995", "0.56430066", "0.56107724", "0.56047666", "0.55956495", "0.55859685", "0.557428...
0.6197832
2
Convert Markdown to HTML Markup
function markdownToMarkup(markdown, callback) { var url = githubRepoActionURL(['markdown']) + '?mode=gfm'; request.post({ url: url, json: { text: markdown } }, handleResponse(200, true, function(err, markup) { if (err) { return callback(err); } callback(null, markup); })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertHTMLtoMarkdown() {\n\n}", "function md2html (md) {\n return mdit.render(md)\n}", "transformMarkdown(params) {\n if (!params.markdown) {\n return { __html: '' };\n }\n return { __html: markdownIt.render(params.markdown) };\n }", "function mdToHtml(input) {\n let rule = myna....
[ "0.8640409", "0.74972075", "0.74428976", "0.7378501", "0.7371878", "0.72884965", "0.7280197", "0.70190054", "0.6997466", "0.69668925", "0.6957361", "0.69461393", "0.6830327", "0.6829788", "0.6823085", "0.68093866", "0.6781923", "0.6682228", "0.66651016", "0.66441953", "0.6644...
0.7467208
2
You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return 1.
function findEvenIndex(arr) { let right_sum = 0, left_sum = 0; for (let i=1; i<arr.length; i++) right_sum = right_sum + arr[i]; for (let i=0, j=1; j<arr.length; i++, j++){ right_sum = right_sum - arr[j]; left_sum = left_sum + arr[i]; if (left_sum === right_sum) return i+1; } return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findEvenIndex(arr) { \n let leftSum = 0;\n let rightSum = arr.reduce((a, b) => a + b)\n \n for (let i = 0; i < arr.length; i++) {\n \n rightSum -= arr[i];\n \n if (leftSum === rightSum) {\n return i\n }\n \n leftSum += arr[i]\n }\n return -1\n}", "function findEvenIndex(a...
[ "0.7906271", "0.78039396", "0.775093", "0.7715918", "0.76990026", "0.7683487", "0.7554195", "0.74983937", "0.7477046", "0.74080884", "0.739395", "0.7382017", "0.7339562", "0.7195341", "0.71766406", "0.71043175", "0.709105", "0.7086797", "0.7032675", "0.7029075", "0.7018418", ...
0.75329965
7
End of SocketIO part of the code / FUNCTIONS
function changeTurn(onDisconnect) { gameState.turnIndex = (gameState.turnIndex + 1) % gameState.players.length; // Broadcast turnChange to ALL clients, with disconnected player ID (which exists only if current player disconnected): io.emit('turnChange', onDisconnect); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function socketIOinit(io)\n{\n console.log(\"running on port\");\n //python client connects\n io.on('connection',function(socket){\n // socketListeners\n // call this immediately on PC client\n socket.on('registerListener',function(data){\n console.log(\"uid: \" + data['UID']);\n var uuid = d...
[ "0.6936016", "0.6867888", "0.682123", "0.68086815", "0.66597736", "0.65771884", "0.6573033", "0.6565166", "0.65449053", "0.6510505", "0.6459128", "0.64338434", "0.6417054", "0.64154327", "0.6396147", "0.6349292", "0.63471603", "0.63421875", "0.63358086", "0.63179195", "0.6311...
0.0
-1
Initializes the turn and turn timer, returns timerId
function startTurnTimer(timerId, turnDuration) { console.log('\nInitializing turn timer!'); // Initialize or reset time remaining gameState.nextTurnTimestamp = Date.now() + turnDuration; console.log( 'Next turn at: ' + new Date(gameState.nextTurnTimestamp).toString().substring(16,25) ); // Every time the timer goes off, update timestamp and change turn! timerId = setInterval(() => { console.log('\n >>>>>>>>>>> ' + new Date().toString().substring(16,25) + ' - Time to change turns! <<<<<<<<<<\n'); // Update time of next turn change gameState.nextTurnTimestamp = Date.now() + turnDuration; changeTurn(); }, turnDuration); // TO DO: enable user-specified turn length return timerId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTurnTimer(timerId, turnDuration, socketId) {\n\t// If turn timer isn't already running\n\tif (!timerId) {\n\t\tconsole.log('Initializing turn timer!');\n\n\t\t// Initialize time of next turn change (will use this to sync the clients)\n\t\tnextTurnChangeTimestamp = Date.now() + turnDuration;\n\n\t\tco...
[ "0.69657207", "0.6415698", "0.6256748", "0.62334555", "0.61666274", "0.6148235", "0.6038309", "0.6023115", "0.60155964", "0.60087466", "0.5994431", "0.5968748", "0.5964544", "0.5924045", "0.5791115", "0.57769287", "0.5763371", "0.5730712", "0.5725152", "0.5721867", "0.5715033...
0.6997706
0
Helper functions, just in case:
function getCurrentPlayer() { return gameState.players[gameState.turnIndex]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static private internal function m121() {}", "transient private protected internal function m182() {}", "static final private internal function m106() {}", "static private protected inte...
[ "0.64457023", "0.61670953", "0.6145694", "0.5942318", "0.56866544", "0.5681822", "0.56045526", "0.55390525", "0.5401124", "0.5393439", "0.53122216", "0.5255313", "0.52533", "0.5202225", "0.5196518", "0.5155395", "0.5155395", "0.51252145", "0.51252145", "0.5108702", "0.509155"...
0.0
-1
creat footer to the table
function Footer() { var data = document.getElementById('aziz'); var tr7 = document.createElement('tr'); data.appendChild(tr7); var th6 = document.createElement('th'); tr7.appendChild(th6); th6.textContent = 'Totals'; var totalOfTotal = 0; for (var i = 0; i < hours.length; i++) { var sumHour = 0; for (let j = 0; j < loc.length; j++) { sumHour = sumHour + loc[j].numberofCookiespurchsedPerhour[i]; } var td8 = document.createElement('td'); tr7.appendChild(td8); td8.textContent = sumHour; totalOfTotal = totalOfTotal + sumHour; } var th9 = document.createElement('td'); tr7.appendChild(th9); th9.textContent = totalOfTotal; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function footer( conteudo ){\n\n tabela.find('tfoot').remove();\n\n var footer = elementoTfooter.clone();\n\n content = $('<tr>').html( $('<td>').attr('colspan',elementoLinha.find('td').length).html( conteudo ) );\n\n tabela.append( footer...
[ "0.8113571", "0.79268444", "0.79246783", "0.7684201", "0.75547415", "0.75266427", "0.75158376", "0.73957175", "0.738576", "0.7353884", "0.7344595", "0.7330811", "0.73256516", "0.7284439", "0.72625464", "0.7135546", "0.7128146", "0.71010584", "0.70959985", "0.70781195", "0.702...
0.7471599
7
Function to draw the map with state
function drawMap(dataColumn) { var valueById = d3.map(); data.forEach(function(d) { var id = name_id_map[d[config.state]]; valueById.set(id, +d[dataColumn]); }); // Get the domain from the data set for setting up the color scale quantize.domain([d3.min(data, function(d){ return +d[dataColumn] }), d3.max(data, function(d){ return +d[dataColumn] })]); // Draw the states g.selectAll("path") .data(topojson.feature(us, us.objects.states).features) .enter().append("path") .attr("class", "feature") // .attr("transform", "scale(" + SCALE + ")") // .on("click", clicked) .style("fill", function(d) { return quantize(valueById.get(d.id)); // fill color based on number of petitions filed } ) .attr("d", path) .on("mousemove", function(d) { // tooltip var html = ""; html += "<div class=\"tooltip_kv\">"; html += "<span class=\"tooltip_key\">"; html += id_name_map[d.id]; html += "</span>"; html += "</div>"; for (var i = 0; i < Object.keys(data[0]).length -1 ; i++) { html += "<div class=\"tooltip_kv\">"; html += "<span class='tooltip_key'>"; html += Object.keys(data[0])[i]; html += "</span>"; html += "<span class=\"tooltip_value\">"; html += (dataMap[id_name_map[d.id]][Object.keys(data[0])[i]]); html += ""; html += "</span>"; html += "</div>"; } $("#tooltip-container").html(html); $(this).attr("fill-opacity", "0.7"); $("#tooltip-container").show(); var coordinates = d3.mouse(this); var map_width = $('.feature')[0].getBoundingClientRect().width; if (d3.event.layerX < map_width / 2) { d3.select("#tooltip-container") .style("top", (d3.event.layerY + 15) + "px") .style("left", (d3.event.layerX + 15) + "px"); } else { var tooltip_width = $("#tooltip-container").width(); d3.select("#tooltip-container") .style("top", (d3.event.layerY + 15) + "px") .style("left", (d3.event.layerX - tooltip_width - 30) + "px"); } }) .on("mouseout", function() { $(this).attr("fill-opacity", "1.0"); $("#tooltip-container").hide(); }); // draw the states mesh g.append("path") .datum(topojson.mesh(us, us.objects.states, function(a, b) { return a !== b; })) .attr("class", "mesh") // .attr("transform", "scale(" + SCALE + ")") .attr("d", path); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawMap(){\n\t\tthis.blocks.forEach(function (e) {\n\t\t\te.draw();\n\t\t});\n\t}", "function drawMap(){ ctx.innerHTML = dungeon.displayDungeon(); }", "render() {\n MapPlotter.setUpFilteringButtons();\n MapPlotter.readFiltersValues();\n\n MapPlotter.currentStateName = 'Texas';\n Map...
[ "0.72234654", "0.71786165", "0.71266085", "0.7116646", "0.7102464", "0.7073265", "0.69769585", "0.69706786", "0.68775374", "0.68589884", "0.6838313", "0.6717955", "0.6686259", "0.65446484", "0.6511566", "0.6486987", "0.6483987", "0.64721763", "0.6456711", "0.64558625", "0.643...
0.67057353
12
specify what to do when zoom event listener is triggered
function zoom_actions(){ circles.attr("transform", d3.event.transform); zoomed(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zoomChangedListener(thisWithMap,action) {\n //console.log(\"detected zoom change\")\n twitter_geomap.ac.logUserActivity(\"map zoom changed\", \"zoom\",twitter_geomap.ac.WF_EXPLORE);\n if (thisWithMap) {\n throttledRetrieveData();\n }\n}", "function zoom() {\n this\n .on(\"mo...
[ "0.77054757", "0.7683496", "0.7528863", "0.7322875", "0.72404444", "0.72291535", "0.72169966", "0.71679544", "0.71493906", "0.7140538", "0.71404344", "0.71395624", "0.70767236", "0.7068506", "0.70560664", "0.7050216", "0.7036339", "0.7033562", "0.7031384", "0.70246893", "0.69...
0.0
-1
change drawing to start from on drag to on mouse down. EVENT CALLBACK FUNCTIONS
function doMousedown(e){ dragging = true; let mouse = getMouse(e); ctx.beginPath(); ctx.moveTo(mouse.x, mouse.y); //points currentLayer.push(mouse); allPoints.push(currentLayer); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function win_drag_start(ftWin){draggingShape = true;}", "startDrag(x, y) {}", "function onMouseDown(e){\n drawing = true;\n current.x = e.clientX;\n current.y = e.clientY;\n }", "function mousemove() {\n if (isMouseDown) {\n draw();\n }\n}", "function drag_start(d) {\n\t\t\t if (!d3.event.ac...
[ "0.7787101", "0.7570723", "0.75316006", "0.74736786", "0.73840016", "0.7383776", "0.7383776", "0.73804694", "0.7369859", "0.7367871", "0.734733", "0.72757125", "0.72757125", "0.72712064", "0.72459584", "0.72350466", "0.71971494", "0.71751845", "0.71346754", "0.7119397", "0.71...
0.67628956
64
if the user drags out of the canvas
function doMouseout(e) { ctx.closePath(); if(dragging){ //points currentLayer = []; console.log(allPoints); dragging = false; } //points currentLayer = []; console.log(allPoints); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function droppedOnCanvas(x, y) {\n $canvas = $draw_canvas;\n var border_left = $canvas.offset().left;\n var border_top = $canvas.offset().top;\n var border_right = $canvas.offset().left + $canvas.width();\n var border_bottom = $canvas.offset().top + $canvas.height();\n if (x > border_...
[ "0.71460116", "0.712604", "0.68792766", "0.6746542", "0.6617145", "0.65910155", "0.65847796", "0.6584404", "0.6486763", "0.6483796", "0.64604145", "0.6448419", "0.64298344", "0.6414306", "0.6401812", "0.6394529", "0.6375023", "0.6364158", "0.635562", "0.635562", "0.6348289", ...
0.0
-1
NAME: Measurement PURPOSE: Measure selection on screen and place marks indicating measurement
function theScript() { /////////////////////////////////////////////////// // BEGIN THE SCRIPT //================================================= //////////////////////////////////////////////////////////////////////////////// // INITIAL REQUIREMENTS //////////////////////////////////////////////////////////////////////////////// // Require open document try { if (app.documents.length > 0 ) { // OK to proceed to arguments setup and run main function var args = {}; args.SCRIPT_NAME = "MEASUREMENT"; args.DOC_REF = app.activeDocument; args.SELECTION = args.DOC_REF.selection; args.ACTIVE_LAYER = args.DOC_REF.activeLayer; args.ACTIVE_LAYER_NAME = args.ACTIVE_LAYER.name; // Call the main function main(args); } else { throw new Error('There are no documents open!'); } } catch(e) { alert( e.message, "Script Alert", true); } //////////////////////////////////////////////////////////////////////////////// // SCRIPT MAIN PROCESS //////////////////////////////////////////////////////////////////////////////// // Main Process // The beginning of the script starts here // Add main logic routine to this function function main(args){ var selectedItem = args.DOC_REF.selection[0]; var selectionName; if (selectedItem.name) { // Use name selectionName = selectedItem.name; } else { // Use type because name property is empty selectionName = selectedItem.typename; } var myDialog = sfDialogFactory(mainDialog(selectionName)); myDialog.show(); } //////////////////////////////////////////////////////////////////////////////// // SCRIPT SUPPORTING FUNCTIONS //////////////////////////////////////////////////////////////////////////////// // Supporting Functions // Include functions that offer partial functionality // These functions are called and acted upon within the mainProcess function function objReflection(obj, display) { // Function for easy object reflection // USAGE EXAMPLE: // var objectInfo = objReflection(someObject, "none"); // or // objReflection(someObject, "alert"); var KVOs = []; for(var member in obj){ KVOs.push("\n" + member + ":" + obj[member]); }; switch(display) { case "alert": alert("Object Reflection: " + KVOs); break; case "none": break; default: return undefined; } return KVOs; } function sfDialogFactory(dialog) { // A factory method for creating dialog screens // Dialog Window var d = new Window("dialog", dialog.title); // alert("Number of Inputs" + dialog.inputs.length); // alert("Number of Options" + dialog.options.length); var i; // counter var len; // length of array elements // Generate Groups if (dialog.groups.length > 0) { len = dialog.groups.length; for (i = 0; i < len; i++ ) { var currentGroup = dialog.groups[i]; var inputGroup = d.add ("panel", undefined, currentGroup.title); inputGroup.alignChildren = ["fill","fill"]; if (currentGroup.elements.length > 0) { // Add Elements var ii; var elemLen = currentGroup.elements.length; for (ii = 0; ii < elemLen; ii++ ) { var currentElement = currentGroup.elements[ii]; var el = inputGroup.add(currentElement.type, undefined, currentElement.value); // Additional properties added for future reflection el.elName = currentElement.name; el.elIndex = ii; switch(currentElement.type) { case "statictext": el.visible = currentElement.visible; break; case "edittext": el.visible = currentElement.visible; break; case "dropdownlist": el.visible = currentElement.visible; el.selection = currentElement.selection; el.onChange = currentElement.onChange; break; default: throw new Error('Unknown Dialog Element Type'); } } } } } function getControlValues(set) { var elementsData = {}; elementsData.controls = []; // TO DO Add more types var giLen = set.children.length; for (var gi = 0; gi < giLen; gi++ ) { var child = set.children[gi]; // alert(objReflection(child, "none", false)); // alert(child.type); var control = {}; control.name = child.elName; control.index = child.elIndex; control.type = child.type; control.visible = child.visible; switch(child.type) { case "statictext": control.value = child.text; break; case "edittext": control.value = child.text; break; case "dropdownlist": control.value = child.selection.text; break; default: throw new Error('Unknown Dialog Element Type'); } elementsData.controls.push(control); // alert(objReflection(control, "none", false)); } return elementsData; } // Buttons Group var buttonGroup = d.add("group"); var bOK = buttonGroup.add("button", undefined, "Continue"); var bCANCEL = buttonGroup.add("button", undefined, "Cancel"); // Button Click Handlers bOK.onClick = function(){ d.close(); dialog.callback("continue", getControlValues(inputGroup)); return true; }; bCANCEL.onClick = function (){ d.close(); dialog.callback("cancel"); return false; }; return d; } function mainDialog(selectionName) { // Main Dialog var dialogObj = {}; dialogObj.groups = []; // An array of dialog groups dialogObj.title = "Measurement"; var group1 = {}; group1.title = "Take Measurement"; // Add Elements using JSON shorthand syntax group1.elements = [ { "name":"MeasureSelectedItem", "type":"statictext", "value":"Measure Selected Item?", "visible":true }, { "name":"Selected", "type":"statictext", "value":"Selected: " + selectionName, "visible":true }, { "name":"UnitOfMeasurement", "type":"statictext", "value":"Unit of Measurement", "visible":true }, { "name":"UnitType", "type":"dropdownlist", "value":["inches","points","millimeters","centimeters","picas","pixels"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"ScreenDPI", "type":"statictext", "value":"Screen DPI (if measuring in pixels)", "visible":true }, { "name":"ScreenDPIValue", "type":"edittext", "value":150, "visible":true }, { "name":"ColorOfMeasurement", "type":"statictext", "value":"Color Of Measurement Lines", "visible":true }, { "name":"ColorType", "type":"dropdownlist", "value":["MAGENTA","CYAN","RED","WHITE","BLACK"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"ColorModeOfMeasurement", "type":"statictext", "value":"Color Mode", "visible":true }, { "name":"ColorMode", "type":"dropdownlist", "value":["CMYK","RGB"], "visible":true, "selection":0, // "onChange":function(){ alert("My Drop Downdown change"); return true;} }, { "name":"MarkerOffset", "type":"statictext", "value":"Amount to offset measurement marks", "visible":true }, { "name":"MarkerOffsetValue", "type":"dropdownlist", "value":[0,5,10,20], "visible":true, "selection":1, // "onChange":function(){ alert("My Drop Downdown change"); return true;} } ]; // Add to group list dialogObj.groups.push(group1); dialogObj.callback = function(type, formData) { if (type === "continue"){ var unit; var screenDPI; var color; var colorMode; var markerOffset; // Do something with formData values here var cLen = formData.controls.length; var formValues = ''; for (var c = 0; c < cLen; c++ ) { if (formData.controls[c].name === "UnitType") { unit = formData.controls[c].value; } if (formData.controls[c].name === "ScreenDPIValue") { screenDPI = formData.controls[c].value; } if (formData.controls[c].name === "ColorType") { color = formData.controls[c].value; } if (formData.controls[c].name === "ColorMode") { colorMode = formData.controls[c].value; } if (formData.controls[c].name === "MarkerOffsetValue") { markerOffset = formData.controls[c].value; } } takeMeasurement(args.DOC_REF, unit, screenDPI, color, colorMode, markerOffset); } else { // Cancel return false; } } return dialogObj; } function findLayerContext(obj) { // alert("findLayerContext: \n" + obj.name + "\n" + obj.typename); var theContext = undefined; if (obj.layers) { // alert("USING OBJECT FOR LAYER CONTEXT..."); theContext = obj; } else { // alert("SEARCHING PARENTS FOR LAYER..."); theContext = findLayerContext(obj.parent); } return theContext; } function takeMeasurement(doc_ref, unit, screenDPI, colorName, colorMode, markerOffset) { // alert("takeMeasurement: \n" + "[markerOffset] " + markerOffset); var selectedItem = doc_ref.selection[0]; if (selectedItem) { var referenceContext = findLayerContext(selectedItem); } else { alert("You must select an item before taking a measurement."); return false; } var myBounds = selectedItem.geometricBounds; // Set up X and Y co-ordinates var x1 = myBounds[0]; var x2 = myBounds[2]; var y1 = myBounds[1]; var y2 = myBounds[3]; // Set up data for the Measurements var ptWidth = myBounds[2] - myBounds[0]; var ptHeight = myBounds[1] - myBounds[3]; // The default unit is points // Default values var tmpWidth = ptWidth; var tmpHeight = ptHeight; var unitSuffix = "pts"; var unitSuffixSingular = "pt"; // Convert the unit of measure depending on the setting. // Adobe Illustrator Measures everything in Points. Use the following conversion formulas // // Unit Conversion formula // centimeters 28.346 points = 1 centimeter // inches 72 points = 1 inch // millimeters 2.834645 points = 1 millimeter // picas 12 points = 1 pica // Qs 1 Q (1 Q equals 0.23 millimeter) // pixels conversion // points = (pixels / 150) * 72 assuming 150dpi system switch(unit) { case "points": tmpWidth = ptWidth; tmpHeight = ptHeight; unitSuffix = "pts"; unitSuffixSingular = "pt"; break; case "millimeters": tmpWidth = Math.round(ptWidth / 0.02834645); tmpHeight = Math.round(ptHeight / 0.02834645); unitSuffix = "mm"; unitSuffixSingular = "mm"; break; case "centimeters": tmpWidth = Math.round(ptWidth / 0.2834645); tmpHeight = Math.round(ptHeight / 0.2834645); unitSuffix = "cm"; unitSuffixSingular = "cm"; break; case "picas": tmpWidth = Math.round(ptWidth / 0.12); tmpHeight = Math.round(ptHeight / 0.12); unitSuffix = "picas"; unitSuffixSingular = "pica"; break; case "inches": tmpWidth = Math.round(ptWidth / 0.72); tmpHeight = Math.round(ptHeight / 0.72); unitSuffix = "inches"; unitSuffixSingular = "inch"; break; case "pixels": tmpWidth = Math.round(ptWidth / 0.72); tmpHeight = Math.round(ptHeight / 0.72); var dpi = parseInt(screenDPI); tmpWidth = tmpWidth * dpi; tmpHeight = tmpHeight * dpi; unitSuffix = "pixels (" + dpi + " dpi)"; unitSuffixSingular = "pixel (" + dpi + " dpi)"; break; default: tmpWidth = ptWidth; tmpHeight = ptHeight; unitSuffix = "pts"; unitSuffixSingular = "pt"; } var finalWidth = tmpWidth / 100; var finalHeight = tmpHeight / 100; // Find Centre of Object var xCentre = x1 + (ptWidth / 2); var yCentre = y1 - (ptHeight / 2); var colorObj = getColorByName(colorMode, colorName); // Make the dimension lines makeDimensions(doc_ref, myBounds, referenceContext, colorObj, markerOffset); function makeDimensions(doc_ref, objBounds, context, measurementColor, lineOffset) { // alert("makeDimensions: \n" + "[lineOffset] " + lineOffset); var x1 = objBounds[0]; var x2 = objBounds[2]; var y1 = objBounds[1]; var y2 = objBounds[3]; // Create Measurements Layer var measurementLayerName = "MEASUREMENT OF "; if (selectedItem.name) { // Use name measurementLayerName = measurementLayerName + selectedItem.name; } else { // Use type because name property is empty measurementLayerName = measurementLayerName + selectedItem.typename; } var theMeasurementLayer = measurementLayerCreate(context, measurementLayerName); // Create groups for Measurements var yMeasure = theMeasurementLayer.groupItems.add(); yMeasure.name = "Height"; var xMeasure = theMeasurementLayer.groupItems.add(); xMeasure.name = "Width"; var xLineOffset = parseInt(lineOffset); var yLineOffset = parseInt(lineOffset); var xLabelOffset = xLineOffset + 15; var yLabelOffset = yLineOffset + 3; // X Measurement Line and Endpoints var xLine1 = xMeasure.pathItems.add(); xLine1.stroked = true; xLine1.strokeColor = measurementColor; xLine1.setEntirePath ([[x1,y1 + xLineOffset],[xCentre - 30,y1 + xLineOffset]]); var xLine2 = xMeasure.pathItems.add(); xLine2.stroked = true; xLine2.strokeColor = measurementColor; xLine2.setEntirePath ([[xCentre + 30,y1 + xLineOffset],[x2,y1 + xLineOffset]]); var xLineEnd1 = xMeasure.pathItems.add(); xLineEnd1.stroked = true; xLineEnd1.strokeColor = measurementColor; xLineEnd1.setEntirePath ([[x1,y1 + (xLineOffset + 4)],[x1,y1 + (xLineOffset - 4)]]); var xLineEnd2 = xMeasure.pathItems.add(); xLineEnd2.stroked = true; xLineEnd2.strokeColor = measurementColor; xLineEnd2.setEntirePath ([[x2,y1 + (xLineOffset + 4)],[x2,y1 + (xLineOffset - 4)]]); // Y Measurement Line and Endpoints var yLine1 = yMeasure.pathItems.add(); yLine1.stroked = true; yLine1.strokeColor = measurementColor; yLine1.setEntirePath ([[x2 + yLineOffset,y1],[x2 + yLineOffset,yCentre + 30]]); var yLine2 = yMeasure.pathItems.add(); yLine2.stroked = true; yLine2.strokeColor = measurementColor; yLine2.setEntirePath ([[x2 + yLineOffset,yCentre - 30],[x2 + yLineOffset,y2]]); var yLineEnd1 = yMeasure.pathItems.add(); yLineEnd1.stroked = true; yLineEnd1.strokeColor = measurementColor; yLineEnd1.setEntirePath ([[x2 + (yLineOffset - 4),y1],[x2 + (yLineOffset + 4),y1]]); var yLineEnd2 = yMeasure.pathItems.add(); yLineEnd2.stroked = true; yLineEnd2.strokeColor = measurementColor; yLineEnd2.setEntirePath ([[x2 + (yLineOffset - 4),y2],[x2 + (yLineOffset + 4),y2]]); // Create Text for X Measurement var xText = xMeasure.textFrames.add(); if (finalWidth === 1) { xText.contents = finalWidth + " " + unitSuffixSingular; } else { xText.contents = finalWidth + " " + unitSuffix; } xText.top = y1 + xLabelOffset; xText.left = xCentre; xText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER; for (i=0;i<xText.textRange.characters.length;i++) { xText.characters[i].characterAttributes.fillColor = measurementColor; } // Create Text for Y Measurement var yText = yMeasure.textFrames.add(); if (finalHeight === 1) { yText.contents = finalHeight + " " + unitSuffixSingular; } else { yText.contents = finalHeight + " " + unitSuffix; } yText.rotate (-90); //, true, false, false, false, Transformation.CENTER); yText.top = yCentre; yText.left = x2 + yLabelOffset; yText.paragraphs[0].paragraphAttributes.justification = Justification.CENTER; for (i=0;i<yText.textRange.characters.length;i++) { yText.characters[i].characterAttributes.fillColor = measurementColor; } } function measurementLayerCreate(context, layerName) { var measurementLayer = context.layers.add(); measurementLayer.name = layerName; return measurementLayer; } } // END takeMeasurement() function getColorByName(type, name) { var color = undefined; // Color Type if (type == undefined) { alert("ERROR: getColorByName[type not specified]"); return undefined; } else { if (type == "CMYK") { color = new CMYKColor(); color = getCMYKColorByName(name); return color; } else if (type == "RGB") { color = new RGBColor(); color = getRGBColorByName(name); return color; } else { alert("ERROR: getColorByName[unknown type] " + type); return undefined; } } } function getCMYKColorByName(name) { // "MAGENTA","CYAN","RED","WHITE","BLACK" var colorDef = undefined; switch(name) { case "MAGENTA": colorDef = {C:0, M:100, Y:0, K:0}; break; case "CYAN": colorDef = {C:100, M:0, Y:0, K:0}; break; case "RED": colorDef = {C:0, M:100, Y:100, K:0}; break; case "WHITE": colorDef = {C:0, M:0, Y:0, K:0}; break; case "BLACK": colorDef = {C:0, M:0, Y:0, K:100}; break; default: colorDef = {C:0, M:0, Y:0, K:100}; } var color = new CMYKColor(); color.cyan = colorDef.C; color.magenta = colorDef.M; color.yellow = colorDef.Y; color.black = colorDef.K; return color; } function getRGBColorByName(name) { // "MAGENTA","CYAN","RED","WHITE","BLACK" var colorDef = undefined; switch(name) { case "MAGENTA": colorDef = {R:236, G:0, B:140}; break; case "CYAN": colorDef = {R:0, G:174, B:239}; break; case "RED": colorDef = {R:255, G:0, B:0}; break; case "WHITE": colorDef = {R:255, G:255, B:255}; break; case "BLACK": colorDef = {R:0, G:0, B:0}; break; default: colorDef = {R:0, G:0, B:0}; } var color = new RGBColor(); color.red = colorDef.R; color.green = colorDef.G; color.blue = colorDef.B; return color; } //================================================= // END THE SCRIPT /////////////////////////////////////////////////// }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startMeasure() {\r\n var md;\r\n if (m_measureDisplay!=null) {\r\n md = document.getElementById(m_measureDisplay);\r\n }\r\n\tif (m_currentMeasureToolbarTool==\"point\") {\r\n\t\t//alert(\"MeasurePoint\");\r\n if (md!=null) md.innerHTML = \"Click on the map to return the coordinate ...
[ "0.6660645", "0.6466392", "0.62689114", "0.621941", "0.62172973", "0.61269647", "0.6103384", "0.6018999", "0.59913045", "0.59870505", "0.59870505", "0.59870505", "0.59478664", "0.5900226", "0.58413476", "0.58190143", "0.5790613", "0.5784498", "0.577481", "0.57530797", "0.5723...
0.0
-1
SCRIPT MAIN PROCESS ////////////////////////////////////////////////////////////////////////////// Main Process The beginning of the script starts here Add main logic routine to this function
function main(args){ var selectedItem = args.DOC_REF.selection[0]; var selectionName; if (selectedItem.name) { // Use name selectionName = selectedItem.name; } else { // Use type because name property is empty selectionName = selectedItem.typename; } var myDialog = sfDialogFactory(mainDialog(selectionName)); myDialog.show(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input...
[ "0.7183584", "0.71098226", "0.68887866", "0.6877381", "0.6765994", "0.6694512", "0.6438213", "0.6399354", "0.63963294", "0.63322103", "0.63105613", "0.6277603", "0.6277485", "0.62662166", "0.6265813", "0.6234202", "0.6194339", "0.61773884", "0.6150763", "0.6149403", "0.613689...
0.0
-1
SCRIPT SUPPORTING FUNCTIONS ////////////////////////////////////////////////////////////////////////////// Supporting Functions Include functions that offer partial functionality These functions are called and acted upon within the mainProcess function
function objReflection(obj, display) { // Function for easy object reflection // USAGE EXAMPLE: // var objectInfo = objReflection(someObject, "none"); // or // objReflection(someObject, "alert"); var KVOs = []; for(var member in obj){ KVOs.push("\n" + member + ":" + obj[member]); }; switch(display) { case "alert": alert("Object Reflection: " + KVOs); break; case "none": break; default: return undefined; } return KVOs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function MainScript() {\n debug('');\n audit('MainScript', '======START======');\n // processFile( // UNIQUE INSTITUTION\n // './ABAI_RAW/UNIQUE.csv',\n // 'A Spicy Boy', parseUniqueInstitution, UNIQUE_INSTITUTIONS\n // );\n processFile( // INSTITUTION\n './ABAI_RAW/unique.csv',//abaiBatchRecord[ 'cu...
[ "0.6198107", "0.60040814", "0.59436685", "0.59292924", "0.5902363", "0.58960783", "0.5886769", "0.5821152", "0.563791", "0.56351286", "0.56059897", "0.5603091", "0.5589001", "0.5580957", "0.5580727", "0.5578116", "0.5562296", "0.556029", "0.55576056", "0.5546509", "0.5543146"...
0.0
-1
!NAVBAR FOLD && UNFOLD SVG FUNCTIONS
function fillNET(color){ // console.log($('._NET_').length); $('._NET_').css('fill',color); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SVGWrap() {}", "function open() {\n $('body').addClass('is-collapsed');\n $('.navbar-collapse').addClass('is-active');\n // var bars = $(document.createElement('use')).attr('xlink:href', 'images/sprites/svgsprite.svg#bars') \n // var x = $(document.createElement('u...
[ "0.58386564", "0.5804558", "0.5715248", "0.56998134", "0.56775635", "0.5671653", "0.5662167", "0.5608296", "0.55258036", "0.5508065", "0.5490007", "0.54887545", "0.5487188", "0.54755265", "0.54603946", "0.54556006", "0.5447314", "0.543011", "0.54154235", "0.5412882", "0.53841...
0.0
-1
Extract checing status of the response
function checkStatus(response) { if (!response.ok) { const error = new Error(response.statusText) error.response = response throw error } return response }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusCheck() {\n var statusLog = document.querySelector(\".status\");\n var status = response.status;\n console.log(status);\n\n statusLog.innerHTML += status;\n }", "get status(): number {\n const NO_RESPONSE_CODE = 0;\n const DECIMAL_RADIX = 10;\n return this.exception...
[ "0.70732677", "0.6595952", "0.6594896", "0.6550324", "0.6528779", "0.6522005", "0.64942074", "0.6407818", "0.625687", "0.62459475", "0.62366515", "0.61855304", "0.6175765", "0.61626405", "0.61067903", "0.6103855", "0.60540944", "0.6047178", "0.60424674", "0.60235035", "0.6014...
0.0
-1
public ClassicEditorBuild = ClassicEditorBuild; public editor: CKEditor5.Editor = null; public readyEmitter = new EventEmitter();
constructor(platform, splashScreen, statusBar) { this.platform = platform; this.splashScreen = splashScreen; this.statusBar = statusBar; this.initializeApp(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_editorChanged() {\n this.dispatchEvent(\n new CustomEvent(\"editor-change\", {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: this,\n })\n );\n }", "function EditorConstructor() { }", "function EditorConstructor() { }", "functi...
[ "0.6608435", "0.6500894", "0.6500894", "0.6482283", "0.6478601", "0.644191", "0.640877", "0.63965636", "0.63863283", "0.63609236", "0.63380015", "0.63380015", "0.6288506", "0.62826324", "0.6277275", "0.6276858", "0.6276858", "0.62755585", "0.6264909", "0.6264909", "0.6262657"...
0.0
-1
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here this,this.belongsTo(models.users,{ foreignKey:"user_id" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n...
[ "0.7641299", "0.75082797", "0.73139536", "0.73065066", "0.73065066", "0.73065066", "0.72952354", "0.72845256", "0.7278983", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", "0.72590315", ...
0.0
-1
TODO upload decrypted userInfo app.globalData.userData
uploadUserData() { console.log('upload userData...') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get userData() {}", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "async getUserData() { }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "function getUserData() {\n\n // Retrieve all keys and values from application ...
[ "0.62761796", "0.6135887", "0.61218244", "0.6106369", "0.60079473", "0.6005751", "0.5947759", "0.5922381", "0.5921852", "0.59195805", "0.5919454", "0.5908774", "0.589113", "0.5889766", "0.5868541", "0.5867855", "0.5855064", "0.58347976", "0.5834503", "0.5796074", "0.5774886",...
0.0
-1
End of ajax call for posting a new comment Start of ajax call for reporting a post
function ReportAPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/User/ReportAPost/${postId}`, success: function () { alert('Post reported!'); }, error: function () { alert('There was a problem with reportiing a post, please try again later.'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderCommentResponse()\r\n{\r\n\tif(objAjax)\r\n\t{\r\n\t\tif(objAjax.isProcessComplete())\r\n\t\t{\r\n\t\t\tvar comments = new TRADESTONE.Comments(\"Order Comments\", objAjax.getResult());\r\n\t\t\tcomments.show();\r\n\t\t}\r\n\t\tobjAjax = null;\r\n\t}\r\n}", "function submitComment(evt) {\n evt.pr...
[ "0.66270113", "0.6527379", "0.65152454", "0.6466577", "0.6417172", "0.64071494", "0.63614815", "0.6346578", "0.63079953", "0.63055146", "0.623837", "0.62378263", "0.62342316", "0.62121546", "0.62079924", "0.61628526", "0.6152674", "0.61479276", "0.6131453", "0.61280835", "0.6...
0.6055383
29
Start of ajax call for removing a post
function RemoveAPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/Admin/RemoveAPost/${postId}`, success: function (response) { window.location.href = response.redirectToUrl; alert('Post removed!'); }, error: function (response) { alert(response.responseText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteThisPost() {\n $.ajax({\n //Send ID of swiped list item to PHP\n type: 'GET',\n //Value stored in each post used to identif...
[ "0.74011403", "0.6939452", "0.6862429", "0.6830156", "0.67660993", "0.67588466", "0.6688149", "0.667774", "0.6639187", "0.6617146", "0.65562356", "0.6553251", "0.6538168", "0.6498257", "0.6489831", "0.64780706", "0.64377844", "0.64377695", "0.64071834", "0.63691413", "0.63641...
0.70103455
1
End of ajax call for removing a post Start of ajax call for allowing a post
function PermitToPost(btn) { var postId = $(btn).attr('data-postid'); $.ajax({ type: 'POST', url: `/Admin/PermitToPost/${postId}`, success: function (response) { window.location.href = response.redirectToUrl; alert('Post permitted!'); }, error: function (response) { alert(response.responseText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onAfterAjax() {\n }", "onBeforeAjax() {\n return false;\n }", "function supTemplatePostValid() {\n $('.supTemplatePost').on('click', function (e) {\n e.preventDefault();\n var pathLoad = $(this).data('path');\n var csrf = $('#csrfSupTemplatePost'...
[ "0.6603325", "0.6587009", "0.6474724", "0.6383138", "0.62390876", "0.6180867", "0.61643887", "0.6153889", "0.6102681", "0.60913277", "0.6085205", "0.60689217", "0.6061388", "0.6059175", "0.60470545", "0.6022151", "0.60166305", "0.5959152", "0.59505486", "0.5938547", "0.590362...
0.60327744
15
eslint import/nowebpackloadersyntax: off / eslint import/extensions: off / eslint nounusedvars: off / eslintdisable jsxa11y/accessibleemoji
function DateRangePickerDoc(props) { return ( <> <div className="flex flex-1 flex-grow-0 items-center justify-end"> <Button className="normal-case" variant="contained" color="secondary" component="a" href="https://mui.com/components/date-range-picker" target="_blank" role="button" > <Icon>link</Icon> <span className="mx-4">Reference</span> </Button> </div> <Typography className="text-40 my-16 font-700" component="h1"> Date Range Picker{' '} <a href="https://material-ui.com/store/items/material-ui-pro/"> <span role="img" title="Enterprise"> ⚡️ </span> </a> </Typography> <Typography className="description"> Date pickers let the user select a range of dates. </Typography> <blockquote> <Typography className="mb-40" component="div"> ⚠️ Pro component <br /> <br /> The date range picker is intended for MUI X Pro, a commercial set of advanced components built on top of the community edition (MIT license). <br /> <br /> This paid extension will include more advanced components (rich data grid, date range picker, tree view drag &amp; drop, etc.).{' '} <a href="https://material-ui.com/store/items/material-ui-pro/">Early access</a> starts at an affordable price. </Typography> </blockquote> <Typography className="mb-40" component="div"> The date range pickers let the user select a range of dates. </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Requirements </Typography> <Typography className="mb-40" component="div"> This component relies on the date management library of your choice. It supports{' '} <a href="https://date-fns.org/">date-fns</a>,{' '} <a href="https://moment.github.io/luxon/">luxon</a>,{' '} <a href="https://github.com/iamkun/dayjs">dayjs</a>,{' '} <a href="https://momentjs.com/">moment</a> and any other library via a public{' '} <code>dateAdapter</code> interface. </Typography> <Typography className="mb-40" component="div"> Please install any of these libraries and set up the right date engine by wrapping your root (or the highest level you wish the pickers to be available) with{' '} <code>LocalizationProvider</code>: </Typography> <FuseHighlight component="pre" className="language-jsx"> {` // or @mui/lab/dateAdapter/{dayjs,luxon,moment} or any valid date-io adapter import DateFnsAdapter from '@mui/lab/AdapterDateFns'; import LocalizationProvider from '@mui/lab/LocalizationProvider'; function App() { return ( <LocalizationProvider dateAdapter={DateFnsAdapter}>...</LocalizationProvider> ); } `} </FuseHighlight> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Basic usage </Typography> <Typography className="mb-40" component="div"> Note that you can pass almost any prop from <a href="/api/date-picker/">DatePicker</a>. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/BasicDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/BasicDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Static mode </Typography> <Typography className="mb-40" component="div"> It&#39;s possible to render any picker inline. This will enable building custom popover/modal containers. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/StaticDateRangePickerDemo.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/StaticDateRangePickerDemo.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Responsiveness </Typography> <Typography className="mb-40" component="div"> The date range picker component is designed to be optimized for the device it runs on. </Typography> <ul> <li> The <code>MobileDateRangePicker</code> component works best for touch devices and small screens. </li> <li> The <code>DesktopDateRangePicker</code> component works best for mouse devices and large screens. </li> </ul> <Typography className="mb-40" component="div"> By default, the <code>DateRangePicker</code> component renders the desktop version if the media query{' '} <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pointer"> <code>@media (pointer: fine)</code> </a>{' '} matches. This can be customized with the <code>desktopModeMediaQuery</code> prop. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/ResponsiveDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/ResponsiveDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Form props </Typography> <Typography className="mb-40" component="div"> The date range picker component can be disabled or read-only. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/FormPropsDateRangePickers.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/FormPropsDateRangePickers.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Different number of months </Typography> <Typography className="mb-40" component="div"> Note that the <code>calendars</code> prop only works in desktop mode. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CalendarsDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CalendarsDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Disabling dates </Typography> <Typography className="mb-40" component="div"> Disabling dates behaves the same as the simple <code>DatePicker</code>. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/MinMaxDateRangePicker.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/MinMaxDateRangePicker.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Custom input component </Typography> <Typography className="mb-40" component="div"> You can customize the rendered input with the <code>renderInput</code> prop. For{' '} <code>DateRangePicker</code> it takes <strong>2</strong> parameters – for start and end input respectively. If you need to render custom inputs make sure to spread <code>ref</code>{' '} and <code>inputProps</code> correctly to the input components. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangeInputs.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangeInputs.js')} /> </Typography> <Typography className="text-32 mt-40 mb-10 font-700" component="h2"> Customized day rendering </Typography> <Typography className="mb-40" component="div"> The displayed days are customizable with the <code>renderDay</code> function prop. You can take advantage of the internal <a href="/api/date-range-picker-day/">DateRangePickerDay</a>{' '} component. </Typography> <Typography className="mb-40" component="div"> <FuseExample className="my-24" iframe={false} component={ require('app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangePickerDay.js') .default } raw={require('!raw-loader!app/main/documentation/material-ui-components/components/date-range-picker/CustomDateRangePickerDay.js')} /> </Typography> </> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "extend(config, ctx) {\n config.module.rules.push({\n enforce: 'pre',\n test: /\\.(js|vue)$/,\n loader: 'eslint-loader',\n exclude: /(node_modules)/,\n options: {\n fix: true\n }\n })\n }", "extend (config, ctx) {\n if (ctx.isClient) {\n ...
[ "0.6330731", "0.62717634", "0.6232921", "0.6222625", "0.61779165", "0.61597806", "0.60991013", "0.60978246", "0.60938466", "0.6092497", "0.6082013", "0.6081027", "0.6073714", "0.60690576", "0.6066145", "0.6062772", "0.60450524", "0.60450524", "0.60450524", "0.60450524", "0.60...
0.0
-1
return true, if can cut into k piece by length
function count(lengthArray, woodLength, k) { var count = 0; var curLength; var i; for (i = 0; i < lengthArray.length; i++) { curLength = lengthArray[i]; while (curLength >= woodLength) { count++; curLength -= woodLength; } } return count >= k; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testK(k) {\n let commonDivisor = (num) => {\n return mul.some((item) => (num % item[0] === 0));\n };\n return Array.prototype.every.call(s, (item, index) => (commonDivisor(k + index) === (item === '0')));\n }", "function maxLength1(a, k) {\n const isSatisfied = (a, stInd, l, k) => {\n ...
[ "0.6280222", "0.6198108", "0.5851191", "0.5755905", "0.5754568", "0.5742839", "0.5736298", "0.5722663", "0.57152003", "0.57106644", "0.56659245", "0.56531304", "0.562795", "0.56271684", "0.5596762", "0.55515015", "0.55319893", "0.5477165", "0.54232216", "0.54221916", "0.54202...
0.6333416
0
Send a heartbeat to all opened sockets
function sendHeartbeat() { _.forOwn(_this.socks, function (sock) { sock.write('hb'); }); setTimeout(sendHeartbeat, _this.heartbeatFreq); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heartbeat() {\n io.sockets.emit('heartbeatUsers', users);\n io.sockets.emit('heartbeatMarks', marks);\n}", "function heartbeat() {\n\n board.updateEnemy();\n var data = {\n player_dico: board.player_dic,\n enemy_list: board.enemy,\n waveNum: board.wave_num\n };\n io.so...
[ "0.7641542", "0.74248743", "0.722528", "0.7070184", "0.7062787", "0.6954447", "0.69473207", "0.678155", "0.67734224", "0.6717606", "0.6688937", "0.667452", "0.6626364", "0.6515311", "0.64502543", "0.6448521", "0.6386508", "0.6329419", "0.63277787", "0.6290269", "0.62535113", ...
0.8098782
0
Check that all clients respond to the heartbeat in time
function checkClientsHeartbeat() { var now = Date.now(); _.forOwn(_this.socks, function (sock) { if (sock.hb + _this.clientTimeout < now) { logout(sock); } }); setTimeout(checkClientsHeartbeat, 1000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkHeartBeat() {\n for (var username in users) {\n sendHeartBeatToAnUser(username);\n }\n}", "function funCheckHB() {\n try {\n for (let i = 0; i < global.aryClients.length; i++) {\n // If current time > (last HB received + timeout e.g. 30 seconds)\n if (Date.now() > global....
[ "0.7300449", "0.70118845", "0.6828728", "0.6795977", "0.67125016", "0.668401", "0.6624302", "0.66224736", "0.65680563", "0.6559366", "0.6551395", "0.6535189", "0.6523065", "0.6519578", "0.6452377", "0.6451966", "0.6442796", "0.6367847", "0.6357087", "0.63551205", "0.63424665"...
0.78225017
0
this function checks that the number is a palindrome (can be read both ways)
function palintest(num) { var inverted = ""; num = num.toString(); for (var i= num.length - 1 ;i>-1;i--) { inverted += num[i] } if (inverted == num) {return true} else return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function palindrome(num) {\n if (\n num\n .toString()\n .split(\"\")\n .reverse()\n .join(\"\") === num.toString()\n ) {\n return true;\n } else {\n return false;\n }\n}", "function isPalindromeNumber(n) {\n var head, tail;\n var digits = [];\n while (n >= 10) {\n ...
[ "0.83378977", "0.82282364", "0.8210567", "0.8166243", "0.8153877", "0.80765694", "0.8004502", "0.7984957", "0.7939395", "0.79181904", "0.78944266", "0.78919333", "0.78709644", "0.7850241", "0.7848473", "0.7808613", "0.7733663", "0.7685777", "0.76662964", "0.7653265", "0.76330...
0.74363357
29
sets context for React Router. Necessary for redirects after deleting colors
static get contextTypes() { return { router: React.PropTypes.object.isRequired, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n return (\n <div className=\"app w-screen m-0 p-0 font-sans\">\n <AppContext.Provider value={this.state}>\n \n <BrowserRouter>\n <Switch>\n <Route path=\"/hunts\" component={HuntsListPage} />\n <Route path=\"/signup\" component={Si...
[ "0.6162589", "0.6150867", "0.6134998", "0.60352737", "0.59677476", "0.59649396", "0.5964337", "0.5793643", "0.5721092", "0.57200694", "0.5707615", "0.5684546", "0.56827545", "0.5636593", "0.55914545", "0.55739456", "0.55663544", "0.55651283", "0.5561633", "0.5561078", "0.5529...
0.5954944
7
listar los materiales x tipo de caja y cantidad
function listarMaterialesCaja(id_tipo_caja) { var cantidad = $("#cantidad").val(); cantidad = (cantidad=='')? 0: cantidad; $.ajax({ url: $.PATH + "almacen?function=listMaterialesCaja", data: {id_tipo_caja: id_tipo_caja}, dataType: "json", cache: false, type: "get", success: function(response) { var html = ""; if (response.data != null) { $.flgMateriales = true; // para validar envío var response = response.data; for (var i = 0; i < response.length; i++) { var color = ''; if (response[i].stock_requerido == '1') { if (response[i].stock <= response[i].stock_minimo) { color = '#FAAC58'; } } html += "<tr style='background-color: "+color+"'>"; html += "<td>"+response[i].codigo+"</td>"; html += "<td>"+response[i].nombre+"</td>"; html += "<td>"+response[i].stock+"</td>"; html += "<td>"+response[i].unidad_medida+"</td>"; var valor = 0; if (response[i].calcular == '1') { valor = parseFloat(cantidad)*parseFloat(response[i].multiplo); } else { valor = response[i].multiplo; } html += "<td><input name='id_materiales[]' type='hidden' value='"+response[i].id+"'>"; html += "<input name='materiales[]' type='text' class='decimal' style='width: 50px;' value='"+valor+"'></td>"; html += "<td>"+response[i].tipo+"</td>"; html += "</tr>"; } } else { $.flgMateriales = false; // para validar envío } $("#tbl-materiales tbody").html(html); $("#tbl-materiales tbody").css({"color":"#000"}); $(".decimal").numeric("."); $(".decimal").blur(function (e) { var v = $(this).val().trim(); v = (v == "")?0:parseFloat(v); var cantidad = $("#cantidad").val().trim(); cantidad = (cantidad == "")?0:parseFloat(cantidad); if (v == 0 && cantidad > 0) { //$(this).focus(); $.flgEntrega = false; $(this).css({"background-color":"#FF0000"}); } else { $.flgEntrega = true; $(this).css({"background-color":"#FFFFFF"}); } }); }, error: function(response) { console.log(response); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function genera_parametros(){\r\n\tx_0=103;\r\n\tm=1001;\r\n\tprimos.forEach(a=>{\r\n\t\tprimos.forEach(c=>{\r\n\t\t\tnum_ale = generador_mixto(a,c,x_0,m)\r\n\t\t\tif(num_ale.length == m){ //tambien deberia revisar si hay numeros repetidos\r\n\t\t\t\timprimir_configuracion_parametros_a_pantalla\r\n\t\t\t}\r\n\t\t}...
[ "0.5611846", "0.5522354", "0.5487825", "0.54733056", "0.54161376", "0.5362004", "0.53283936", "0.5312302", "0.5306814", "0.5301719", "0.5290203", "0.5288451", "0.5285376", "0.5266509", "0.5254296", "0.5251927", "0.52505857", "0.524609", "0.52444655", "0.52305555", "0.52245694...
0.56832665
0
Item A Bazaar Item published for trade Define Item Model
function define(sequelize) { /** * Potential columns: * * tags * looking_for (items sought in exchange) */ let Item = sequelize.define('item', { title: { type: DataType.STRING, field: 'title', allowNull: false }, description: { type: DataType.TEXT, field: 'description', allowNull: false }, ecv: { type: DataType.INTEGER, field: 'estimated_cash_value' }, createdAt: { type: DataType.DATE, field: 'created_at' }, updatedAt: { type: DataType.DATE, field: 'updated_at' }, userId: { type: DataType.UUID, field: 'fk_user', allowNull: false } }); return Item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Item(item) {\n this.id = item.id\n this.name = item.name\n this.itemWeight = item.item_weight\n this.value = item.value\n}", "function Item (name, barcode, sellingPrice, buyingPrice) {\n this.name = name;\n this.barcode = barcode;\n this.sellingPrice = sellingPrice;\n this.bu...
[ "0.69196695", "0.6758927", "0.6757405", "0.6702856", "0.66590136", "0.6564232", "0.6561075", "0.651892", "0.65061766", "0.65061766", "0.65061766", "0.6465821", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6385786", "0.6359128", "0.63482785", "0.6311849"...
0.59902626
43
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Adds a random greeting to the page.
function addRandomGreeting() { const greetings = ['I play for my Universites Volleyball Team', ' I play bass and guitar ', 'I´m in rock band called Los Insurgentes. Find us on Spotify ! ']; // Pick a random greeting. const greeting = greetings[Math.floor(Math.random() * greetings.length)]; // Add it to the page. const greetingContainer = document.getElementById('greeting-container'); greetingContainer.innerText = greeting; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRandomGreeting() {\n const greetings =\n ['Hello world!', '¡Hola Mundo!', '你好,世界!', 'Bonjour le monde!'];\n\n // Pick a random greeting.\n const greeting = greetings[Math.floor(Math.random() * greetings.length)];\n\n // Add it to the page.\n const greetingContainer = document.getElementById('js...
[ "0.85573655", "0.85041916", "0.8499197", "0.8463862", "0.8461774", "0.84270716", "0.82573134", "0.7298476", "0.6970288", "0.6944332", "0.6676978", "0.6657239", "0.6651881", "0.64862114", "0.64696574", "0.64603525", "0.64385587", "0.6395104", "0.6394217", "0.6369117", "0.63575...
0.8361552
6
Facts Fetches facts from the servers and adds them to the DOM.
function getFacts() { fetch('/data').then(response => response.json()).then((fact) => { // fact is an object, not a string, so we have to // reference its fields to create HTML content const factsListElement = document.getElementById('server-facts-container'); factsListElement.innerHTML = ''; factsListElement.appendChild( createListElement('Fact 1 : ' + fact.fact1)); factsListElement.appendChild( createListElement('Fact 2 : ' + fact.fact2)); factsListElement.appendChild( createListElement('Fact 3 : ' + fact.fact3)); factsListElement.appendChild( createListElement('Fact 4 : ' + fact.fact4)); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchFacts() {\n // call fetch on the cat facts api getting one random fact\n fetch(`https://cat-fact.herokuapp.com/facts/random?animal_type=cat&amount=1`)\n // when you get a response, save the text\n .then(response => response.text())\n // get the data from response.text\n .then(data =...
[ "0.6238689", "0.5538138", "0.5525729", "0.5382872", "0.5271777", "0.51738405", "0.5134809", "0.5119229", "0.50667167", "0.50391287", "0.50315523", "0.5027485", "0.5012915", "0.4953205", "0.4859165", "0.4812556", "0.48059362", "0.47641572", "0.47627264", "0.473448", "0.4721609...
0.7512953
0
Creates an element containing text.
function createListElement(text) { const liElement = document.createElement('li'); liElement.innerText = text; return liElement; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function textElement(text) {\n let element = document.createElement('span');\n element.innerText = text;\n return element;\n}", "function createText(text) {\n return document.createTextNode(text);\n }", "function createText(text) {\n return document.createTextNode(text);\n }", "createElement...
[ "0.7822513", "0.78123003", "0.78123003", "0.7716485", "0.7635549", "0.7537679", "0.7406359", "0.73221767", "0.728043", "0.7186003", "0.7151407", "0.71403515", "0.70634496", "0.70619506", "0.69153935", "0.6840163", "0.68338305", "0.68338305", "0.68030334", "0.67910063", "0.677...
0.6179573
93
Function to check if a site uses local_mobile, requires SSO login, etc. This should be used only if a fixed URL is set, otherwise this check is already performed in mmLoginSiteCtrl.
function checkSite(siteurl) { var checkmodal = $mmUtil.showModalLoading(); return $mmSitesManager.checkSite(siteurl).then(function(result) { siteChecked = true; $scope.siteurl = result.siteurl; if (result && result.warning) { $mmUtil.showErrorModal(result.warning, true, 4000); } if ($mmLoginHelper.isSSOLoginNeeded(result.code)) { // SSO. User needs to authenticate in a browser. $scope.isBrowserSSO = true; $mmUtil.showConfirm($translate('mm.login.logininsiterequired')).then(function() { $mmLoginHelper.openBrowserForSSOLogin(result.siteurl); }); } else { $scope.isBrowserSSO = false; } }).catch(function(error) { $mmUtil.showErrorModal(error); return $q.reject(); }).finally(function() { checkmodal.dismiss(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isMobileUser(){\n\tif(pmgConfig.agent_ios || pmgConfig.agent_android){\n\t\treturn true;\t\n\t}\n\telse{\n\t\treturn false;\n\t}\n}", "function DetectMobile() {\n\n\t// First check\n if (sessionStorage.desktop) return false;\n else if (localStorage.mobile) return true;\n\n // Alternative check\...
[ "0.665709", "0.64066464", "0.6287017", "0.6285216", "0.6266743", "0.6264146", "0.6187216", "0.6181451", "0.6175087", "0.6156352", "0.6153866", "0.6150326", "0.60985637", "0.609057", "0.60788035", "0.6053461", "0.60517627", "0.6027949", "0.6027239", "0.599849", "0.5993274", ...
0.57434034
41
TODO: 1. drawTiles instead of animateFight 2. do not move but start figting
function animateFight(res){ loadTilemap({ 'animation' : res.animation, 'direction': res.direction, }); console.log(res); loopFight(res) /* // var targetTile = { 'x' : cursorX + res.animation.x, 'y' : cursorY + res.animation.y; $.post(gameurl, { 'class': 'map', 'do': 'getUnitTiles', 'gid': gid, 'offsetX': mapoffsetX, 'offsetY': mapoffsetY, 'screenTilesX': tilesX, 'screenTilesY': tilesY, 'cursorX': cursorX, 'cursorY': cursorY, 'animation' : res.animation, 'direction': res.direction, }, function( data ) { data = $.parseJSON(data); console.log(data); layers.clear('units'); for (var j in data) { var _y = (j) * tileSize - offset; for (var i in data[j]) { var _x = (i) * tileSize - offset; var unit = data[j][i]; drawUnit(unit, { 'x': _x, 'y': _y, 'animate': unit.animate, 'animation': 'attack', 'direction': unit.direction }); } } renderer.render(stage); // hitpoint + death animation }); */ //var selector = 'animation attack' + res.attacker.direction + ' anim-form-animation-attack_' + res.attacker.uid + '_' + res.animation.row; //$('.animation').removeClass().addClass(selector); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animate() {\n \t// call again next time we can draw\n \trequestAnimationFrame(animate);\n \t// clear canvas\n \tctx.clearRect(0, 0, cvWidth, cvHeight);\n \t// draw gameObjects\n \tfor (var obj of gameObjects) {\n \t\tif (obj.hasOwnProperty('tileID')) {\n\t \t\tctx.drawImage(SVGTiles[obj.tileID], o...
[ "0.7226908", "0.70082825", "0.6970953", "0.6858111", "0.6821993", "0.6760133", "0.6760034", "0.66750056", "0.6672165", "0.66682374", "0.66538596", "0.6637454", "0.6632285", "0.6614243", "0.6607741", "0.6602935", "0.6602935", "0.64913267", "0.6472996", "0.64635205", "0.6459503...
0.716197
1
AIzaSyCeNv5vBqhgZbVUdkNbNyIhPbuqXZPksfw import Case from './components/Case';
function App() { // world wide cases info const [info,setInfo]=useState({}); // get data of all countries const [countries,setCountries]=useState([]); // set data for table data const [data,setData]=useState([]); // material ui const classes = useStyles(); const [country, setCountry] = React.useState(''); const [open, setOpen] = React.useState(false); // map zoom const [mapCenter, setMapCenter] = useState({lat: 28.3949,lng: 84.1240}); const [mapZoom,setMapZoom]=useState(3); const [caseType,setCaseType]=useState('cases'); // scroll event handling // const containerRef = React.useRef(); // const elementRef = React.useRef(); // const scrollSpeed = 50; // const { scrollToElement, scrollToY } = useScroll({ scrollSpeed, containerRef }) const handleChange = (event) => { const Selected=event.target.value; const CountryLoad=async()=>{ const selected_response=await api.get(`/countries/${Selected}`); console.log(selected_response.data); setInfo(selected_response.data); setMapCenter([selected_response.data.countryInfo.lat,selected_response.data.countryInfo.long]); setMapZoom(5); } CountryLoad(); setCountry(event.target.value); }; const handleClose = () => { setOpen(false); }; const handleOpen = () => { setOpen(true); }; useEffect(()=>{ const AppLoad=async()=>{ const response=await api.get('/all'); setInfo(response.data); } AppLoad(); },[]); useEffect(()=>{ const countries=async()=>{ const response=await api.get('/countries'); setCountries(response.data); // console.log(response.data); setData(response.data); } countries(); },[]); return ( <div > <Navbar/> <div className="jumbotron" style={{ position: 'relative', overflow: 'scroll' }}> <Jumboturn info={info} setCaseType={setCaseType} /> <div style={{textAlign:"center",backgroundColor:"white"}}> <Button className={classes.button} onClick={handleOpen}> Select the country </Button> <FormControl className={classes.formControl}> <InputLabel id="demo-controlled-open-select-label">Country</InputLabel> <Select labelId="demo-controlled-open-select-label" id="demo-controlled-open-select" open={open} onClose={handleClose} onOpen={handleOpen} value={country} onChange={handleChange} > { countries.map((country)=>{ return <MenuItem value={country.country} key={country.country}>{country.country}</MenuItem> }) } </Select> </FormControl> </div> <Maps center={mapCenter} zoom={mapZoom} countries={countries} casesType={caseType} /> <br /> <TableData datas={data}/> </div> <Footer /> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCaseById(case_id : number): Promise <Case[]>{\n return axios.get(url+'/getCase/'+case_id);\n }", "createUserCase(casee: Case): Promise<void>{\n return axios.post(url+'/case', casee, axiosConfig);\n }", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n ...
[ "0.5636929", "0.51538765", "0.5128173", "0.5030402", "0.49919602", "0.48987514", "0.48860973", "0.4881821", "0.48489416", "0.48084873", "0.4781285", "0.47500202", "0.47482222", "0.47224596", "0.4718368", "0.47182164", "0.4710577", "0.4709978", "0.47061932", "0.46965846", "0.4...
0.0
-1
Only change code above this line
function fun2() { var output = ""; if (typeof myGlobal != "undefined") { output += "myGlobal: " + myGlobal; } if (typeof oopsGlobal != "undefined") { output += " oopsGlobal: " + oopsGlobal; } console.log(output); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected internal function m252() {}", "private internal function m248() {}", "private public function m246() {}", "transient private protected internal function m182() {}", "transient final protected internal function m174() {}", "transient protected internal function m189() {}", "transient private i...
[ "0.704269", "0.6920925", "0.67108494", "0.67096627", "0.65723664", "0.64506495", "0.6447263", "0.6391223", "0.6114873", "0.5990437", "0.59698707", "0.5942723", "0.5900797", "0.58977413", "0.5895389", "0.5790728", "0.578317", "0.5776425", "0.5762054", "0.57532656", "0.5703712"...
0.0
-1
Note: AttributeMarshallingMixin will recognize `selected` as the name of attribute that should be parsed as a boolean attribute, and so will handling parsing it for us.
set selected(selected) { this[internal.setState]({ selected }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get properties() {\n return {\n 'selected': {\n value: false,\n type: 'boolean'\n }\n };\n }", "get checked() {\n return this.hasAttribute(\"checked\");\n }", "function setBoolAttr(d) {\n // change the element's text\n ...
[ "0.6249087", "0.6003263", "0.60014135", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.5926826", "0.59092534", "0.587611", "0.587611", "0.587611", "0.58644813", "0.57658046", ...
0.49235755
96
! moment.js locale configuration
function t(e){return e%100===11||e%10!==1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return r?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.609...
0.0
-1
! betternormalscroll v1.15.0 (c) 20162019 ustbhuangyi Released under the MIT License.
function r(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mkdOnWindowScroll() {\n \n }", "function OCM_scrolling() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$offCanvasEl.mousewheel(function (event, delta) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.scrollTop -= (delta * 30);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t...
[ "0.691387", "0.67678505", "0.675519", "0.6720355", "0.67146266", "0.67146266", "0.67146266", "0.67146266", "0.6700945", "0.66830236", "0.66830236", "0.66798145", "0.6676134", "0.66471356", "0.6584729", "0.65828604", "0.65779155", "0.65779155", "0.65555125", "0.6535867", "0.65...
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! vuex v3.6.2 (c) 2021 Evan You
function r(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFieldVuex() {\n return store.getters.dataField;\n }", "getProfileVuex() {\n return store.getters.dataProfile;\n }", "function vuexInit(){var options=this.$options;// store injection\n\tif(options.store){this.$store=options.store;}else if(options.parent&&options.parent.$store){this.$store=options.par...
[ "0.6760562", "0.6703852", "0.66438663", "0.6288551", "0.6274809", "0.62527895", "0.6230704", "0.6230704", "0.6230704", "0.62251097", "0.6144431", "0.6115101", "0.61012393", "0.606092", "0.606092", "0.606092", "0.606092", "0.606092", "0.60600334", "0.6054526", "0.6018124", "...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?i[n][0]:i[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi",r;case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta",r;case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati",r;case"dd":return r+=1===e?"dan":"dana",r;case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci",r;case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina",r}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r={mm:"munutenn",MM:"miz",dd:"devezh"};return e+" "+i(r[n],e)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var i=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return i+=1===e?t?"sekundo":"sekundi":2===e?t||r?"sekundi":"sekundah":e<5?t||r?"sekunde":"sekundah":"sekund",i;case"m":return t?"ena minuta":"eno minuto";case"mm":return i+=1===e?t?"minuta":"minuto":2===e?t||r?"minuti":"minutama":e<5?t||r?"minute":"minutami":t||r?"minut":"minutami",i;case"h":return t?"ena ura":"eno uro";case"hh":return i+=1===e?t?"ura":"uro":2===e?t||r?"uri":"urama":e<5?t||r?"ure":"urami":t||r?"ur":"urami",i;case"d":return t||r?"en dan":"enim dnem";case"dd":return i+=1===e?t||r?"dan":"dnem":2===e?t||r?"dni":"dnevoma":t||r?"dni":"dnevi",i;case"M":return t||r?"en mesec":"enim mesecem";case"MM":return i+=1===e?t||r?"mesec":"mesecem":2===e?t||r?"meseca":"mesecema":e<5?t||r?"mesece":"meseci":t||r?"mesecev":"meseci",i;case"y":return t||r?"eno leto":"enim letom";case"yy":return i+=1===e?t||r?"leto":"letom":2===e?t||r?"leti":"letoma":e<5?t||r?"leta":"leti":t||r?"let":"leti",i}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.609...
0.0
-1
! vuerouter v3.5.1 (c) 2021 Evan You
function r(e,t){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "...
[ "0.5826907", "0.5787431", "0.57791466", "0.57177967", "0.5693478", "0.56677026", "0.56438506", "0.55971104", "0.55622447", "0.55450404", "0.5535287", "0.5513169", "0.55086446", "0.54607594", "0.54414064", "0.5400921", "0.5376999", "0.5369956", "0.5369956", "0.5369956", "0.536...
0.0
-1
! moment.js locale configuration
function t(e){return"undefined"!==typeof Function&&e instanceof Function||"[object Function]"===Object.prototype.toString.call(e)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t){var n=e.split("_");return t%10===1&&t%100!==11?n[0]:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?n[1]:n[2]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82627255", "0.80355096", "0.7878359", "0.75476736", "0.72037613", "0.71981734", "0.71757025", "0.7170814", "0.71322805", "0.7130772", "0.7044428", "0.667163", "0.667163", "0.6334324", "0.6292554", "0.62773275", "0.62773275", "0.62773275", "0.62773275", "0.62090504", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r={ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"},i=" ";return(e%100>=20||e>=100&&e%100===0)&&(i=" de "),e+i+r[n]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1