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
Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback.
onAny(listener) { this._anyListeners = this._anyListeners || []; this._anyListeners.push(listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on(name, callback) {\n if (listeners[name] === undefined) {\n listeners[name] = [callback];\n } else {\n listeners[name].push(callback);\n }\n }", "addEventListener(name, callback) {\n this.instance.on(name, callback);\n }", "function registerListener(event_name,...
[ "0.7394834", "0.7378805", "0.6941454", "0.69218343", "0.6864508", "0.68165493", "0.67416173", "0.6730367", "0.6729546", "0.6674991", "0.66716504", "0.65797365", "0.6544818", "0.65358967", "0.6531936", "0.6531936", "0.6524538", "0.6522213", "0.6502764", "0.6448572", "0.6422769...
0.0
-1
Adds a listener that will be fired when any event is emitted. The event name is passed as the first argument to the callback. The listener is added to the beginning of the listeners array.
prependAny(listener) { this._anyListeners = this._anyListeners || []; this._anyListeners.unshift(listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "on(name, callback) {\n if (listeners[name] === undefined) {\n listeners[name] = [callback];\n } else {\n listeners[name].push(callback);\n }\n }", "function Listener(callback) {\n var listener = callback;\n listener.onArr = function (arr,eventName) {\n ...
[ "0.7697547", "0.7054176", "0.6991829", "0.6964034", "0.6818684", "0.67896086", "0.6768237", "0.67482173", "0.67186064", "0.67186064", "0.66999495", "0.6678827", "0.665461", "0.6624508", "0.66185534", "0.65893745", "0.6537873", "0.65254486", "0.65033334", "0.6449389", "0.64224...
0.0
-1
Removes the listener that will be fired when any event is emitted.
offAny(listener) { if (!this._anyListeners) { return this; } if (listener) { const listeners = this._anyListeners; for (let i = 0; i < listeners.length; i++) { if (listener === listeners[i]) { listeners.splice(i, 1); return this; } } } else { this._anyListeners = []; } return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_unlisten() {\n const that = this;\n\n if (that._trackListener) {\n that._trackListener.unlisten();\n }\n\n if (that._fillListener) {\n that._fillListener.unlisten();\n }\n\n if (that._lineListener) {\n that._lineListener.unlisten();\n ...
[ "0.78343904", "0.7782837", "0.772481", "0.7594351", "0.758446", "0.7574993", "0.7538692", "0.7506632", "0.7500639", "0.7472067", "0.7417481", "0.7417481", "0.7417481", "0.7391687", "0.7385274", "0.7351547", "0.7295183", "0.7295183", "0.7295183", "0.7262007", "0.7252703", "0...
0.0
-1
Returns an array of listeners that are listening for any event that is specified. This array can be manipulated, e.g. to remove listeners.
listenersAny() { return this._anyListeners || []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "listenersAny() {\n return this._anyListeners || [];\n }", "function watchedEvents(obj) {\n var listeners = obj[META_KEY].listeners, ret = [];\n\n if (listeners...
[ "0.71215725", "0.71215725", "0.71215725", "0.68107253", "0.6782971", "0.6774838", "0.6745852", "0.66891485", "0.6687362", "0.6560062", "0.6491802", "0.6485784", "0.6368906", "0.6306218", "0.6273138", "0.6254611", "0.6251891", "0.6233837", "0.61943555", "0.60552526", "0.599997...
0.6921147
3
Adds the `listener` function as an event listener for `ev`.
on(ev, listener) { super.on(ev, listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "function _on (event, listener) {\n if (typeof _events[event] !== 'object') {\n _events[event] = [];\n }\n\n _events[event].push(listener);\n }", "static addListener(listener) {\n listeners.push(listene...
[ "0.7538891", "0.713268", "0.7111036", "0.7033408", "0.7013971", "0.7013971", "0.70016426", "0.6995966", "0.69426817", "0.69417566", "0.6839801", "0.6804345", "0.6679578", "0.6619077", "0.6616332", "0.6603275", "0.6506358", "0.64776033", "0.64776033", "0.64776033", "0.64776033...
0.6254217
38
Adds a onetime `listener` function as an event listener for `ev`.
once(ev, listener) { super.once(ev, listener); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addListener(event, listener) {\n this.ee.addListener(event, listener);\n }", "addEventListener(target, type, listener, options) {\n this.log(`Adding \"${type}\" eventlistener`, target);\n \n const boundListener = listener.bind(this);\n target.addEventListener(type, boundListener, options);\...
[ "0.6449999", "0.6242542", "0.62090105", "0.61925524", "0.6187242", "0.61823976", "0.61704934", "0.61413634", "0.59626997", "0.59487814", "0.59487814", "0.5908819", "0.5879635", "0.5875124", "0.582561", "0.5756302", "0.5730138", "0.5689595", "0.56756294", "0.56675404", "0.5640...
0.0
-1
Emits a reserved event. This method is `protected`, so that only a class extending `StrictEventEmitter` can emit its own reserved events.
emitReserved(ev, ...args) { super.emit(ev, ...args); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reserved(){}", "function newEmitter() {\n var emitter = new EventEmitter()\n\n function go() {\n emitter.emit('criticalEvent')\n }\n\n go()\n\n return emitter\n}", "function emit(self, eventName) { self.emit(eventName); }", "ignoreEvent(event) { return true; }", "discard(payload) {\n co...
[ "0.61554444", "0.54177517", "0.5299779", "0.5293753", "0.52906513", "0.5269415", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.5233803", "0.5233803", "0.5231736", "0.5231736", "0.5231736", "0.5...
0.74587727
0
Returns the listeners listening to an event.
listeners(event) { return super.listeners(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get eventListeners() {\n return this.eventListenersLocal;\n }", "static get listenedEvents() {\n\t\treturn DOM_EVENTS;\n\t}", "function getChangeListeners() {\n const store = shareStore.get(this) || createStore(this);\n return store.changeListeners;\n }", "get_listeners() { return null; }", ...
[ "0.7210599", "0.71057445", "0.67440987", "0.6460909", "0.64533424", "0.62665415", "0.61981416", "0.61981416", "0.6161581", "0.6161581", "0.6161581", "0.61240137", "0.6055426", "0.6002546", "0.5986734", "0.59639084", "0.5944684", "0.59375453", "0.5921217", "0.5907043", "0.5890...
0.65914327
3
Encode packet as string.
encodeAsString(obj) { // first is type let str = "" + obj.type; // attachments if we have them if (obj.type === PacketType.BINARY_EVENT || obj.type === PacketType.BINARY_ACK) { str += obj.attachments + "-"; } // if we have a namespace other than `/` // we append it followed by a comma `,` if (obj.nsp && "/" !== obj.nsp) { str += obj.nsp + ","; } // immediately followed by the id if (null != obj.id) { str += obj.id; } // json data if (null != obj.data) { str += JSON.stringify(obj.data); } debug("encoded %j as %s", obj, str); return str; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encodeAsString(obj) {\n // first is type\n let str = \"\" + obj.type;\n // attachments if we have them\n if (obj.type === PacketType.BINARY_EVENT ||\n obj.type === PacketType.BINARY_ACK) {\n str += obj.attachments + \"-\";\n }\n // if we have a namesp...
[ "0.68948394", "0.68948394", "0.68729776", "0.67704785", "0.6760609", "0.6566028", "0.6300765", "0.62097317", "0.5991091", "0.58656377", "0.5779245", "0.57125056", "0.56874585", "0.5680321", "0.5679311", "0.566398", "0.55941576", "0.55941576", "0.55941576", "0.55802727", "0.55...
0.6650793
5
Encode packet as 'buffer sequence' by removing blobs, and deconstructing packet into object with placeholders and a list of buffers.
encodeAsBinary(obj) { const deconstruction = binary_1.deconstructPacket(obj); const pack = this.encodeAsString(deconstruction.packet); const buffers = deconstruction.buffers; buffers.unshift(pack); // add packet info to beginning of data list return buffers; // write all the buffers }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encodeAsBinary(obj) {\n const deconstruction = binary.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // ...
[ "0.6491757", "0.6442412", "0.63879544", "0.6364918", "0.5896878", "0.5847301", "0.54266447", "0.54266447", "0.54266447", "0.5416601", "0.53911227", "0.5325642", "0.5325642", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.53015953", "0.53015953", "0.530159...
0.65920836
0
Deallocates a parser's resources
destroy() { if (this.reconstructor) { this.reconstructor.finishedReconstruction(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "deinitParser() {\n console.log(\"CaptionsParser :: deinitParser\");\n }", "cleanup() {\n debug(\"cleanup\");\n const subsLength = this.subs.length;\n for (let i = 0; i < subsLength; i++) {\n const sub = this.subs.shift();\n sub.destroy();\n }\n t...
[ "0.6598592", "0.62988186", "0.6282632", "0.61542046", "0.6127689", "0.6106722", "0.6092097", "0.6092097", "0.6091555", "0.59782225", "0.5965163", "0.59142655", "0.58554417", "0.58030844", "0.57905257", "0.57028115", "0.56914043", "0.5683034", "0.56631476", "0.5648176", "0.564...
0.0
-1
Cleans up binary packet reconstruction variables.
finishedReconstruction() { this.reconPack = null; this.buffers = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruction() {\n this.reconPack = null;\n this.buffers = [];\n }", "finishedReconstruc...
[ "0.63718796", "0.63718796", "0.63718796", "0.6353819", "0.6071918", "0.5921566", "0.58615255", "0.5817088", "0.57815003", "0.57543", "0.5753198", "0.5753198", "0.57321244", "0.572426", "0.5679321", "0.562295", "0.5609885", "0.5591577", "0.55859816", "0.5566109", "0.5501618", ...
0.6361064
3
Returns true if obj is a Buffer, an ArrayBuffer, a Blob or a File.
function isBinary(obj) { return withNativeArrayBuffer && (obj instanceof ArrayBuffer || isView(obj)) || withNativeBlob && obj instanceof Blob || withNativeFile && obj instanceof File; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", "function isBuf(obj) {\n\t return (global.Buffer && global.Buffer.isBuffer(obj)) ||\n\t (global.ArrayBuffer && obj instanceof ArrayBuffer);\n\t}", ...
[ "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.803447", "0.8023567", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0.79891235", "0....
0.77741295
81
TODO: emstricten & fix the typing here! `createWithBsPrefix...`
function createWithBsPrefix(prefix, _temp) { var _ref = _temp === void 0 ? {} : _temp, _ref$displayName = _ref.displayName, displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName, Component = _ref.Component, defaultProps = _ref.defaultProps; var BsComponent = /*#__PURE__*/react.forwardRef(function (_ref2, ref) { var className = _ref2.className, bsPrefix = _ref2.bsPrefix, _ref2$as = _ref2.as, Tag = _ref2$as === void 0 ? Component || 'div' : _ref2$as, props = (0,objectWithoutPropertiesLoose/* default */.Z)(_ref2, ["className", "bsPrefix", "as"]); var resolvedPrefix = useBootstrapPrefix(bsPrefix, prefix); return /*#__PURE__*/react.createElement(Tag, (0,esm_extends/* default */.Z)({ ref: ref, className: classnames_default()(className, resolvedPrefix) }, props)); }); BsComponent.defaultProps = defaultProps; BsComponent.displayName = displayName; return BsComponent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createWithBsPrefix(prefix, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n _ref$displayName = _ref.displayName,\n displayName = _ref$displayName === void 0 ? pascalCase(prefix) : _ref$displayName,\n Component = _ref.Component,\n defaultProps = _ref.defaultProps;\n\n var BsComp...
[ "0.72558004", "0.72558004", "0.7241421", "0.72054803", "0.7179913", "0.71568877", "0.5667578", "0.56435794", "0.54514116", "0.5317735", "0.52713424", "0.5159015", "0.5156747", "0.5130988", "0.5121047", "0.51059747", "0.50844276", "0.5081573", "0.5081573", "0.5018943", "0.5001...
0.72207934
3
CONCATENATED MODULE: ./app/components/Avatar.js / harmony default export
function Avatar(_ref) { var path = _ref.path, size = _ref.size; //size:.avatar-medium .avatar-sm return /*#__PURE__*/React.createElement("img", { src: path, alt: "Avatar", className: "avatar " + size }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get ImageResolver() {return WebpackModules.getByProps(\"getUserAvatarURL\", \"getGuildIconURL\");}", "function Avatar(props) {\n return (\n <img className=\"Avatar\" src={props.user.avatarUrl} alt={props.user.name} />\n );\n}", "function Avatar(props) {\n return (\n <img className=\"Avatar\"\n sr...
[ "0.6372429", "0.63032466", "0.6260666", "0.6255008", "0.587173", "0.58440965", "0.5771948", "0.57689273", "0.5758416", "0.5746804", "0.57277787", "0.57277787", "0.5652027", "0.56428885", "0.5584269", "0.55498016", "0.554062", "0.55048263", "0.5494068", "0.54721415", "0.545009...
0.5867863
5
Returns true if the HTML5 history API is supported. Taken from Modernizr. changed to avoid false negatives for Windows Phones:
function supportsHistory() { var ua = window.navigator.userAgent; if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf('Windows Phone') === -1) return false; return window.history && 'pushState' in window.history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsHistory() { // 60\n var ua = navigator.userAgent; // 61\n if ((ua.indexOf('Android 2.') !== -1 || ua.indexOf('Android 4.0') !== -1) && ua.indexOf('Mobile Safari') !== -1 && ua.indexOf('Chrome') === -1 && ua.indexOf(...
[ "0.8457442", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "0.8437014", "...
0.8341028
100
Returns true if browser fires popstate on hash change. IE10 and IE11 do not.
function supportsPopStateOnHashChange() { return window.navigator.userAgent.indexOf('Trident') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function supportsPopStateOnHashChange(){return window.navigator.userAgent.indexOf('Trident')===-1;}", "function supportsPopStateOnHashChange() {\n return window.navigator.userAgent.indexOf('Trident') === -1;\n }", "function supportsHashChange(documentMode, global) {\n return 'onhashchange' i...
[ "0.85082066", "0.84276813", "0.734538", "0.734538", "0.734538", "0.734538", "0.73256963", "0.72438544", "0.7106022", "0.68635136", "0.6817992", "0.6817992", "0.6817992", "0.68016374", "0.67740774", "0.676368", "0.6732663", "0.670574", "0.6660475", "0.66572684", "0.65663636", ...
0.82981575
61
Returns false if using go(n) with hash history causes a full page reload.
function supportsGoWithoutReloadUsingHash() { return window.navigator.userAgent.indexOf('Firefox') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changed()\n {\n if (window.location.hash !== this.lastHash)\n {\n this.lastHash = window.location.hash;\n return true;\n }\n else\n {\n return false;\n }\n }", "function checkHash() {\r\n if (location.hash && $this.find(l...
[ "0.6853592", "0.6627107", "0.6169394", "0.61218673", "0.61203706", "0.6109625", "0.6105205", "0.6105017", "0.6095695", "0.6089655", "0.6070026", "0.6031158", "0.6027591", "0.6025375", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", "0.5998307", ...
0.59979945
94
Returns true if a given popstate event is an extraneous WebKit event. Accounts for the fact that Chrome on iOS fires real popstate events containing undefined state when pressing the back button.
function isExtraneousPopstateEvent(event) { return event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isExtraneousPopstateEvent(event){event.state===undefined&&navigator.userAgent.indexOf('CriOS')===-1;}", "function isExtraneousPopstateEvent(event) {\n event.state === undefined && navigator.userAgent.indexOf('CriOS') === -1;\n}", "function isExtraneousPopstateEvent(event) {\n event.state === undefin...
[ "0.8189633", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8106464", "0.8076116", "0.7768142", "0.65637994", "0.65342957", "0.65262496", "0.65262496", "0.65262496", "0.65262496", "0.6526249...
0.8111777
46
Creates a history object that uses the HTML5 history API including pushState, replaceState, and the popstate event.
function createBrowserHistory(props) { if (props === void 0) { props = {}; } !canUseDOM ? false ? 0 : tiny_invariant_esm(false) : void 0; var globalHistory = window.history; var canUseHistory = supportsHistory(); var needsHashChangeListener = !supportsPopStateOnHashChange(); var _props = props, _props$forceRefresh = _props.forceRefresh, forceRefresh = _props$forceRefresh === void 0 ? false : _props$forceRefresh, _props$getUserConfirm = _props.getUserConfirmation, getUserConfirmation = _props$getUserConfirm === void 0 ? getConfirmation : _props$getUserConfirm, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var basename = props.basename ? stripTrailingSlash(addLeadingSlash(props.basename)) : ''; function getDOMLocation(historyState) { var _ref = historyState || {}, key = _ref.key, state = _ref.state; var _window$location = window.location, pathname = _window$location.pathname, search = _window$location.search, hash = _window$location.hash; var path = pathname + search + hash; false ? 0 : void 0; if (basename) path = stripBasename(path, basename); return history_createLocation(path, state, key); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var transitionManager = createTransitionManager(); function setState(nextState) { (0,esm_extends/* default */.Z)(history, nextState); history.length = globalHistory.length; transitionManager.notifyListeners(history.location, history.action); } function handlePopState(event) { // Ignore extraneous popstate events in WebKit. if (isExtraneousPopstateEvent(event)) return; handlePop(getDOMLocation(event.state)); } function handleHashChange() { handlePop(getDOMLocation(getHistoryState())); } var forceNextPop = false; function handlePop(location) { if (forceNextPop) { forceNextPop = false; setState(); } else { var action = 'POP'; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location }); } else { revertPop(location); } }); } } function revertPop(fromLocation) { var toLocation = history.location; // TODO: We could probably make this more reliable by // keeping a list of keys we've seen in sessionStorage. // Instead, we just default to 0 for keys we don't know. var toIndex = allKeys.indexOf(toLocation.key); if (toIndex === -1) toIndex = 0; var fromIndex = allKeys.indexOf(fromLocation.key); if (fromIndex === -1) fromIndex = 0; var delta = toIndex - fromIndex; if (delta) { forceNextPop = true; go(delta); } } var initialLocation = getDOMLocation(getHistoryState()); var allKeys = [initialLocation.key]; // Public interface function createHref(location) { return basename + createPath(location); } function push(path, state) { false ? 0 : void 0; var action = 'PUSH'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.pushState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.href = href; } else { var prevIndex = allKeys.indexOf(history.location.key); var nextKeys = allKeys.slice(0, prevIndex + 1); nextKeys.push(location.key); allKeys = nextKeys; setState({ action: action, location: location }); } } else { false ? 0 : void 0; window.location.href = href; } }); } function replace(path, state) { false ? 0 : void 0; var action = 'REPLACE'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var href = createHref(location); var key = location.key, state = location.state; if (canUseHistory) { globalHistory.replaceState({ key: key, state: state }, null, href); if (forceRefresh) { window.location.replace(href); } else { var prevIndex = allKeys.indexOf(history.location.key); if (prevIndex !== -1) allKeys[prevIndex] = location.key; setState({ action: action, location: location }); } } else { false ? 0 : void 0; window.location.replace(href); } }); } function go(n) { globalHistory.go(n); } function goBack() { go(-1); } function goForward() { go(1); } var listenerCount = 0; function checkDOMListeners(delta) { listenerCount += delta; if (listenerCount === 1 && delta === 1) { window.addEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.addEventListener(HashChangeEvent, handleHashChange); } else if (listenerCount === 0) { window.removeEventListener(PopStateEvent, handlePopState); if (needsHashChangeListener) window.removeEventListener(HashChangeEvent, handleHashChange); } } var isBlocked = false; function block(prompt) { if (prompt === void 0) { prompt = false; } var unblock = transitionManager.setPrompt(prompt); if (!isBlocked) { checkDOMListeners(1); isBlocked = true; } return function () { if (isBlocked) { isBlocked = false; checkDOMListeners(-1); } return unblock(); }; } function listen(listener) { var unlisten = transitionManager.appendListener(listener); checkDOMListeners(1); return function () { checkDOMListeners(-1); unlisten(); }; } var history = { length: globalHistory.length, action: 'POP', location: initialLocation, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, block: block, listen: listen }; return history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBrowserHistory() {\r\n\t var options = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\r\n\t\r\n\t !_ExecutionEnvironment.canUseDOM ? process.env.NODE_ENV !== 'production' ? _invariant2['default'](false, 'Browser history needs a DOM') : _invariant2['default'](false) : unde...
[ "0.7363717", "0.73296857", "0.73296857", "0.7308878", "0.7308878", "0.7308878", "0.7308878", "0.73070294", "0.73040956", "0.730119", "0.729325", "0.7287951", "0.72879344", "0.7282965", "0.72828287", "0.72828287", "0.72828287", "0.72828287", "0.72828287", "0.7254779", "0.72541...
0.7078388
52
Creates a history object that stores locations in memory.
function createMemoryHistory(props) { if (props === void 0) { props = {}; } var _props = props, getUserConfirmation = _props.getUserConfirmation, _props$initialEntries = _props.initialEntries, initialEntries = _props$initialEntries === void 0 ? ['/'] : _props$initialEntries, _props$initialIndex = _props.initialIndex, initialIndex = _props$initialIndex === void 0 ? 0 : _props$initialIndex, _props$keyLength = _props.keyLength, keyLength = _props$keyLength === void 0 ? 6 : _props$keyLength; var transitionManager = createTransitionManager(); function setState(nextState) { (0,esm_extends/* default */.Z)(history, nextState); history.length = history.entries.length; transitionManager.notifyListeners(history.location, history.action); } function createKey() { return Math.random().toString(36).substr(2, keyLength); } var index = clamp(initialIndex, 0, initialEntries.length - 1); var entries = initialEntries.map(function (entry) { return typeof entry === 'string' ? history_createLocation(entry, undefined, createKey()) : history_createLocation(entry, undefined, entry.key || createKey()); }); // Public interface var createHref = createPath; function push(path, state) { false ? 0 : void 0; var action = 'PUSH'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; var prevIndex = history.index; var nextIndex = prevIndex + 1; var nextEntries = history.entries.slice(0); if (nextEntries.length > nextIndex) { nextEntries.splice(nextIndex, nextEntries.length - nextIndex, location); } else { nextEntries.push(location); } setState({ action: action, location: location, index: nextIndex, entries: nextEntries }); }); } function replace(path, state) { false ? 0 : void 0; var action = 'REPLACE'; var location = history_createLocation(path, state, createKey(), history.location); transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (!ok) return; history.entries[history.index] = location; setState({ action: action, location: location }); }); } function go(n) { var nextIndex = clamp(history.index + n, 0, history.entries.length - 1); var action = 'POP'; var location = history.entries[nextIndex]; transitionManager.confirmTransitionTo(location, action, getUserConfirmation, function (ok) { if (ok) { setState({ action: action, location: location, index: nextIndex }); } else { // Mimic the behavior of DOM histories by // causing a render after a cancelled POP. setState(); } }); } function goBack() { go(-1); } function goForward() { go(1); } function canGo(n) { var nextIndex = history.index + n; return nextIndex >= 0 && nextIndex < history.entries.length; } function block(prompt) { if (prompt === void 0) { prompt = false; } return transitionManager.setPrompt(prompt); } function listen(listener) { return transitionManager.appendListener(listener); } var history = { length: entries.length, action: 'POP', location: entries[index], index: index, entries: entries, createHref: createHref, push: push, replace: replace, go: go, goBack: goBack, goForward: goForward, canGo: canGo, block: block, listen: listen }; return history; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createMemoryHistory(base = '') {\n let listeners = [];\n let queue = [START];\n let position = 0;\n function setLocation(location) {\n position++;\n if (position === queue.length) {\n // we are at the end, we can simply append a new entry\n queue.push(locati...
[ "0.67093724", "0.6660363", "0.66349125", "0.6514125", "0.6496346", "0.6491885", "0.6476713", "0.64495486", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6383285", "0.6377784", "0.63725656", "0.6372155", "0.63628995", "0.63628995", "0.63628995", "0.634001...
0.6401474
8
The public API for prompting the user before navigating away from a screen.
function Prompt(_ref) { var message = _ref.message, _ref$when = _ref.when, when = _ref$when === void 0 ? true : _ref$when; return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; if (!when || context.staticContext) return null; var method = context.history.block; return React.createElement(Lifecycle, { onMount: function onMount(self) { self.release = method(message); }, onUpdate: function onUpdate(self, prevProps) { if (prevProps.message !== message) { self.release(); self.release = method(message); } }, onUnmount: function onUnmount(self) { self.release(); }, message: message }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function navigateAway() {\n switch (document.body.id) {\n case 'options':\n chrome.runtime.sendMessage({\n 'name': 'OptionsSave',\n 'excludes': gTplData.options.globalExcludesStr.trim(),\n 'useCodeMirror': gTplData.options.useCodeMirror,\n }, logUnhandledError);\n break;\n ...
[ "0.63582224", "0.6336378", "0.6291143", "0.60359854", "0.6020931", "0.6016651", "0.59726274", "0.5955357", "0.5907807", "0.5901265", "0.59011984", "0.58868617", "0.586042", "0.58596414", "0.5846708", "0.5844033", "0.5826336", "0.5799647", "0.5799465", "0.5793241", "0.5777686"...
0.0
-1
Public API for generating a URL pathname from a path and parameters.
function generatePath(path, params) { if (path === void 0) { path = "/"; } if (params === void 0) { params = {}; } return path === "/" ? path : compilePath(path)(params, { pretty: true }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makePath(var_args){\n\t var result = join(slice(arguments), '/');\n\t // need to disconsider duplicate '/' after protocol (eg: 'http://')\n\t return result.replace(/([^:\\/]|^)\\/{2,}/g, '$1/');\n\t }", "function makePath(var_args){\n var result = join(slice(arguments), '/...
[ "0.72512805", "0.7178873", "0.7178873", "0.68712044", "0.68696356", "0.6721023", "0.6654717", "0.65425456", "0.644447", "0.6395405", "0.63352627", "0.63270307", "0.628425", "0.62621105", "0.62249243", "0.61872166", "0.6135351", "0.61011547", "0.609315", "0.6084816", "0.608481...
0.6648755
49
The public API for navigating programmatically with a component.
function Redirect(_ref) { var computedMatch = _ref.computedMatch, to = _ref.to, _ref$push = _ref.push, push = _ref$push === void 0 ? false : _ref$push; return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; var history = context.history, staticContext = context.staticContext; var method = push ? history.push : history.replace; var location = createLocation(computedMatch ? typeof to === "string" ? generatePath(to, computedMatch.params) : _extends({}, to, { pathname: generatePath(to.pathname, computedMatch.params) }) : to); // When rendering in a static context, // set the new location immediately. if (staticContext) { method(location); return null; } return React.createElement(Lifecycle, { onMount: function onMount() { method(location); }, onUpdate: function onUpdate(self, prevProps) { var prevLocation = createLocation(prevProps.to); if (!locationsAreEqual(prevLocation, _extends({}, location, { key: prevLocation.key }))) { method(location); } }, to: to }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "navigateToComponent(event) {\n let contractCode = event.currentTarget.dataset.item;\n // eslint-disable-next-line no-console\n console.log('contractcode:'+contractCode);\n this[NavigationMixin.Navigate]({\n type: 'standard__component',\n attributes: {\n ...
[ "0.61909544", "0.58901256", "0.5834737", "0.5770242", "0.56208116", "0.5563699", "0.55466664", "0.55171984", "0.5478709", "0.54625344", "0.5461492", "0.5452722", "0.54364544", "0.5411622", "0.54054534", "0.5397201", "0.5391978", "0.53629184", "0.5354345", "0.53436154", "0.534...
0.0
-1
Public API for matching a URL pathname to a path.
function matchPath(pathname, options) { if (options === void 0) { options = {}; } if (typeof options === "string" || Array.isArray(options)) { options = { path: options }; } var _options = options, path = _options.path, _options$exact = _options.exact, exact = _options$exact === void 0 ? false : _options$exact, _options$strict = _options.strict, strict = _options$strict === void 0 ? false : _options$strict, _options$sensitive = _options.sensitive, sensitive = _options$sensitive === void 0 ? false : _options$sensitive; var paths = [].concat(path); return paths.reduce(function (matched, path) { if (!path && path !== "") return null; if (matched) return matched; var _compilePath = compilePath$1(path, { end: exact, strict: strict, sensitive: sensitive }), regexp = _compilePath.regexp, keys = _compilePath.keys; var match = regexp.exec(pathname); if (!match) return null; var url = match[0], values = match.slice(1); var isExact = pathname === url; if (exact && !isExact) return null; return { path: path, // the path used to match url: path === "/" && url === "" ? "/" : url, // the matched portion of the URL isExact: isExact, // whether or not we matched exactly params: keys.reduce(function (memo, key, index) { memo[key.name] = values[index]; return memo; }, {}) }; }, null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchPath(pathname,options){if(options===void 0){options={};}if(typeof options===\"string\")options={path:options};var _options=options,path=_options.path,_options$exact=_options.exact,exact=_options$exact===void 0?false:_options$exact,_options$strict=_options.strict,strict=_options$strict===void 0?false:...
[ "0.7498675", "0.6678324", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66614777", "0.66610277", "0.6649874", "0.66393703", "0.66393703", "0.66393703", "0.65095", "0.6471337", "0.6337194", "0.6104091", "0.6070635", "0.6048713", "0.6048...
0.6640097
42
A public higherorder component to access the imperative API
function withRouter(Component) { var displayName = "withRouter(" + (Component.displayName || Component.name) + ")"; var C = function C(props) { var wrappedComponentRef = props.wrappedComponentRef, remainingProps = _objectWithoutPropertiesLoose(props, ["wrappedComponentRef"]); return React.createElement(context.Consumer, null, function (context) { !context ? false ? 0 : invariant(false) : void 0; return React.createElement(Component, _extends({}, remainingProps, context, { ref: wrappedComponentRef })); }); }; C.displayName = displayName; C.WrappedComponent = Component; if (false) {} return hoistStatics(C, Component); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FunctionalComponent() {}", "function higherOrder(a) {\n a(); \n}", "function purchaseItem(...fns) => fns.reduce(compose)\n\n{} // so I have to make sure that I have returned in here this property", "_isolatedComputeForWrapper(component) {\n const computations = ReactInterpreter.computations(...
[ "0.6070405", "0.57829124", "0.57713205", "0.56781846", "0.5601167", "0.53402764", "0.53382486", "0.52356786", "0.5168645", "0.5168645", "0.5168645", "0.5168645", "0.5148882", "0.5085232", "0.50566614", "0.50550544", "0.5034251", "0.50302976", "0.50270486", "0.5023248", "0.502...
0.0
-1
Reads file as HTML AST
function readHTML(file) { return parse(readFileSync(file, 'utf-8')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadHTML(path,name) {\n html[name] = pug.compile(fs.readFileSync(__dirname+path,\"utf8\"))\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n ...
[ "0.611419", "0.60167515", "0.58644223", "0.5858895", "0.5821196", "0.58199507", "0.5761517", "0.5667549", "0.56016403", "0.5577509", "0.55709463", "0.545141", "0.54437375", "0.54271954", "0.542706", "0.54122686", "0.5377525", "0.5374414", "0.53628474", "0.53308064", "0.532717...
0.75782984
0
Disable touch scrolling / document.querySelector(All) returns a NodeList instead of Array
function list(weirdlist) { return Array.prototype.slice.call(weirdlist); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function __(elm) { return document.querySelectorAll(elm) }", "queryAll(selector) {\n return res.concat(Array.prototype.slice.call(document.querySelectorAll(selector)))\n }", "queryAll(target) {\n return document.querySelectorAll(target);\n }", "_preventWebkitOverflowScrollingTouch(element){var result...
[ "0.6344784", "0.6237541", "0.62322605", "0.62320954", "0.6185808", "0.6096378", "0.606944", "0.6019488", "0.5972995", "0.59676427", "0.5941434", "0.5941434", "0.5920947", "0.58979595", "0.58867496", "0.5871322", "0.5870612", "0.58666664", "0.58216816", "0.57847613", "0.577955...
0.0
-1
Opens a tab $delta$ away from the current one.
function open(delta) { var num = current+delta; if (num >= element.querySelectorAll(".tabs li").length || num < 0) { return; } var menu = element.querySelector(".tabs li:nth-child("+(num+1)+")"); list(element.querySelectorAll(".tabs li")).map(function (tohide) {tohide.className = "";}) menu.className = "active"; list(element.querySelectorAll("section")).map(function (v) { v.style.marginLeft = parseFloat(v.style.marginLeft)-delta*100+"%"; v.style.opacity = 0.5; }); var id = menu.getAttribute("data-id"); document.getElementById(id).style.opacity = 1; current = num; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openInTab(selected){\r\n openEntryInNewTab(false, selected);\r\n }", "function openTab(tabName) {\n //todo\n}", "switchTab(oldTab, newTab) {\n const tabs = this.getTabs();\n var panel;\n\n newTab.focus();\n // Make the active tab focusable by the user (Tab key)\n newTab.rem...
[ "0.6310745", "0.6231327", "0.61822337", "0.6083347", "0.6080908", "0.60688126", "0.6011768", "0.6010892", "0.5983891", "0.5983891", "0.5978738", "0.5829404", "0.579989", "0.57867485", "0.5771583", "0.5769427", "0.5761883", "0.57603073", "0.571014", "0.57039124", "0.56973237",...
0.73782057
0
Gets a Date. Accepts anything that a Date() object constructor does.
function inputDate(display, recursive = true) { let input = new Date(inputString(display, persistent)); if(isNaN(input.getTime())) { if(recursive) { console.log("ERROR: Response must be a date! Please try again!"); input = inputDate(display, recursive); } else { throw "ERROR: Response must be a date!"; } } return input; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDate() {\n var date = new Date()\n return date\n}", "function newDate(x) {\n return new Date(x);\n }", "function myDate(){\r\n var date = new Date();\r\n return date;\r\n}", "function date() {\n return struct('Date', value => {\n return value instanceof Date && !isNaN(va...
[ "0.6822436", "0.6761444", "0.6503689", "0.6473593", "0.6473593", "0.63336414", "0.62518233", "0.62503606", "0.62503606", "0.62503606", "0.62503606", "0.62503606", "0.6221738", "0.6219679", "0.62018234", "0.6179714", "0.61550444", "0.60455674", "0.6036279", "0.60172725", "0.59...
0.0
-1
Get cryptocurrency exchange rates
function fetchCryptoExchangeRates() { $.getJSON(crypto, function(data) { showCryptoExchangeRates(data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getExchangeRate() {\n const sourceCurrency = document.querySelector('.currency_convert_from').value;\n const destinationCurrency = document.querySelector('.currency_convert_to').value;\n\n const url = buildAPIUrl(sourceCurrency, destinationCurrency);\n fetchCurrencyRate(url);\n...
[ "0.7814988", "0.73062956", "0.7274762", "0.71633637", "0.7146334", "0.71281594", "0.70702064", "0.67513305", "0.67416984", "0.66913635", "0.6688716", "0.66884404", "0.6624526", "0.6608974", "0.6604429", "0.65456337", "0.64787847", "0.64659846", "0.6442459", "0.64053595", "0.6...
0.623569
34
controllo presenza caratteri speciali
function controllo(nome,cognome){ var nome_pul = nome.replace(/[^A-Za-z0-9]/g, ""); var cognome_pul = cognome.replace(/[^A-Za-z0-9]/g, ""); if(nome==nome_pul && cognome==cognome_pul) return true; else return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function comportement (){\n\t }", "function mostraNotas(){}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\...
[ "0.6245995", "0.62325907", "0.612506", "0.6084603", "0.6079673", "0.6016612", "0.5992857", "0.593216", "0.592705", "0.5896207", "0.5877942", "0.5850661", "0.5768883", "0.5750453", "0.57502186", "0.5703736", "0.5697608", "0.5693314", "0.5689646", "0.5686873", "0.5686093", "0...
0.0
-1
LOCATING ELEMENTS IN THE DOM / FUNCTIONALITIES
function getEventsSection() { document.getElementById("ex-02-js-btn").addEventListener("click", () => {alert("You just clicked me!")}) $("#ex-02-jquery-btn").on("click", () => {alert("You just clicked me!")}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findElements(element) {\n\n // var topElements = new Array();\n // var j = 0; \n\n var target_element_coordinates = getPageXY(element);\n var top_target_element = getTop(element);\n\n var xpathTopElements = new Array(); \n\n var ...
[ "0.6579426", "0.60839546", "0.60611856", "0.59836286", "0.5909414", "0.5905388", "0.5891326", "0.58846474", "0.5829889", "0.5829889", "0.5812836", "0.58108157", "0.5808733", "0.5792669", "0.5791788", "0.5726173", "0.57077944", "0.5702382", "0.5691261", "0.566715", "0.56555957...
0.0
-1
Constructs the API payload request map based on properties of ApiRequest
function buildMap(apiRequest) { var keyValueMap = {}; keyValueMap["transaction.id"] = apiRequest.transactionId; keyValueMap["order.id"] = apiRequest.orderId; keyValueMap["merchant"] = config.TEST_GATEWAY.MERCHANTID; keyValueMap["sourceOfFunds.type"] = "CARD"; keyValueMap["session.id"] = apiRequest.sessionId; keyValueMap["order.currency"] = apiRequest.orderCurrency; keyValueMap["apiOperation"] = "PAY"; keyValueMap["order.amount"] = apiRequest.orderAmount; return keyValueMap; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildArgs() {\n let args = {};\n\n // Skip any url parameters (e.g. items that begin with $)\n for (let key in this.givenArgs) {\n if (key.substring(0, 1) !== '$') {\n args[key] = this.givenArgs[key];\n }\n }\n\n let apiType = u.thisOrThat(this.contextOptions.api_type,\n ...
[ "0.56026655", "0.5550744", "0.5280476", "0.5263608", "0.5169081", "0.5135113", "0.50437146", "0.5019758", "0.5007848", "0.50032365", "0.49942538", "0.4980435", "0.4964532", "0.49496245", "0.4940132", "0.49246657", "0.49220482", "0.48945662", "0.4882811", "0.48472273", "0.4846...
0.69339496
0
Returns the base URL for the API call (either REST or NVP)
function getApiBaseURL(gatewayHost, apiProtocol) { switch (apiProtocol) { case "REST": return gatewayHost + "/api/rest"; case "NVP": return gatewayHost + "/api/nvp" default: throwUnsupportedProtocolException(); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequestBaseURL() {\n\n var url;\n\n if (useProxy) {\n url = proxyURL;\n } else if (oauth && oauth.instance_url) {\n url = oauth.instance_url;\n } else {\n url = serverURL;\n }\n\n // dev friendly API: Remove trailing '/' if any so url + path concat alw...
[ "0.7850118", "0.78041357", "0.75129306", "0.74798", "0.72589505", "0.7181715", "0.70752907", "0.70319974", "0.69690305", "0.6924421", "0.68996084", "0.68924016", "0.68537605", "0.6821435", "0.6811206", "0.68061227", "0.67507184", "0.67480886", "0.67268217", "0.67123735", "0.6...
0.63862383
48
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsCubicQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a3, a2, a1, a0], [b3, b2, b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // bitlength 48 -> saves 2 bits -> 1-4 summands // bitlength 47 -> saves 4 bits -> 5-16 summands // bitlength 46 -> saves 6 bits -> 17-64 summands // (a3**2 + b3**2)*t**6 + let t6 = qaq(tp(a3, a3), tp(b3, b3)); // exact if bitlength <= 48 - 2 summands // (2*a2*a3 + 2*b2*b3)*t**5 + let t5 = qm2(qaq(tp(a2, a3), tp(b2, b3))); // exact if bitlength <= 48 - 2 summands // (2*a1*a3 + a2*a2 + 2*b1*b3 + b2*b2)*t**4 + let t4 = qaq(qm2(qaq(tp(a1, a3), tp(b1, b3))), qaq(tp(a2, a2), tp(b2, b2))); // exact if bitlength <= 47 - 6 summands // (2*a0*a3 + 2*a1*a2 - 2*a3*cx + 2*b0*b3 + 2*b1*b2 - 2*b3*cy)*t**3 + let t3 = qm2(qdifq(qaq(qaq(tp(a0, a3), tp(a1, a2)), qaq(tp(b0, b3), tp(b1, b2))), (qaq(tp(a3, cx), tp(b3, cy))))); // exact if bitlength <= 47 - 6 summands // (2*a0*a2 + a1**2 - 2*a2*cx + 2*b0*b2 + b1**2 - 2*b2*cy)*t**2 + let t2 = qaq(qm2(qdifq(qaq(tp(a0, a2), tp(b0, b2)), (qaq(tp(a2, cx), tp(b2, cy))))), qaq(tp(a1, a1), tp(b1, b1))); // exact if bitlength <= 47 - 10 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0**2 - 2*a0*cx + b0**2 - 2*b0*cy + cx**2 + cy**2 - r**2 let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t6, t5, t4, t3, t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if ...
[ "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6388867", "0.6366699", "0.6366699", "0.6324955", "0.6322721", "0.6322721", "0.6320649", "0.6320649", "0.627577", "0.6239352", "0.6239352", "0.6239352", "0.6209139", "0.6181426", "0...
0.0
-1
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsQuadraticQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a2, a1, a0], [b2, b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // (a2*a2 + b2*b2)*t**4 + let t4 = qaq(tp(a2, a2), tp(b2, b2)); // exact if bitlength <= 48 - 2 summands // (2*a1*a2 + 2*b1*b2)*t**3 + let t3 = qm2(qaq(tp(a1, a2), tp(b1, b2))); // exact if bitlength <= 48 - 2 summands // (2*a0*a2 + a1*a1 - 2*a2*cx + 2*b0*b2 + b1*b1 - 2*b2*cy)*t**2 + let t2 = qaq(qm2(qdifq(qaq(tp(a0, a2), tp(b0, b2)), (qaq(tp(a2, cx), tp(b2, cy))))), qaq(tp(a1, a1), tp(b1, b1))); // exact if bitlength <= 47 - 10 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0*a0 - 2*a0*cx + b0*b0 - 2*b0*cy + cx*cx + cy*cy - r*r let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t4, t3, t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if ...
[ "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.64106387", "0.63895106", "0.63673735", "0.63673735", "0.63246775", "0.6323446", "0.6323446", "0.6321296", "0.6321296", "0.6276508", "0.6240145", "0.6240145", "0.6240145", "0.6210016", "0.61...
0.0
-1
precondition bitalgined bitlength of coefficients <= 47
function getCoeffsLinearQuad(circle, ps) { let { radius: r, center: [cx, cy] } = circle; let [[a1, a0], [b1, b0]] = get_xy_1.getXY(ps); // exact if bitlength <= 49 // (a1**2 + b1**2)*t**2 + let t2 = qaq(tp(a1, a1), tp(b1, b1)); // exact if bitlength <= 48 - 2 summands // (2*a0*a1 - 2*a1*cx + 2*b0*b1 - 2*b1*cy)*t + let t1 = qm2(qdifq(qaq(tp(a0, a1), tp(b0, b1)), (qaq(tp(a1, cx), tp(b1, cy))))); // exact if bitlength <= 48 - 4 summands // a0*a0 - 2*a0*cx + b0*b0 - 2*b0*cy + cx*cx + cy*cy - r*r let t0 = qaq(qmn2(qaq(tp(a0, cx), tp(b0, cy))), qdifq(qaq(qaq(tp(a0, a0), tp(b0, b0)), qaq(tp(cx, cx), tp(cy, cy))), tp(r, r))); // exact if bitlength <= 47 - 9 summands return [t2, t1, t0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if (this.t <= 0) return 0\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ (this.s & this.DM))\n}", "function bnBitLength() {\n if ...
[ "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6409897", "0.6388867", "0.6366699", "0.6366699", "0.6324955", "0.6322721", "0.6322721", "0.6320649", "0.6320649", "0.627577", "0.6239352", "0.6239352", "0.6239352", "0.6209139", "0.6181426", "0...
0.0
-1
These tests rely on some unintuitive cleverness due to WPT's test setup: 'UpgradeInsecureRequests' does not upgrade the port number, so we use URLs in the form ` If the upgrade fails, the load will fail, as we don't serve HTTP over the secure port.
function generateURL(host, protocol, resourceType) { var url = new URL("http://{{host}}:{{ports[https][0]}}/upgrade-insecure-requests/support/"); url.protocol = protocol == Protocol.INSECURE ? "http" : "https"; url.hostname = host == Host.SAME_ORIGIN ? "{{host}}" : "{{domains[天気の良い日]}}"; if (resourceType == ResourceType.IMAGE) { url.pathname += "pass.png"; } else if (resourceType == ResourceType.FRAME) { url.pathname += "post-origin-to-parent.html"; } else if (resourceType == ResourceType.WEBSOCKET) { url.port = {{ports[wss][0]}}; url.protocol = protocol == Protocol.INSECURE ? "ws" : "wss"; url.pathname = "echo"; } return { name: protocol + "/" + host + " " + resourceType, url: url.toString() }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function vertifyHttps(urllink){\n var result = 0;\n if (urllink.indexOf(\"https\") == 0){\n result = 1;\n }\n return result;\n}", "function ensureHttps() {\n if (window.location.protocol != \"https:\" && window.location.protocol != \"file:\" && window.location.hostname != \"localhost\") {\n window.loc...
[ "0.5663019", "0.56533706", "0.5504292", "0.5396829", "0.53193516", "0.5307611", "0.52811784", "0.5259151", "0.52168", "0.519685", "0.51860756", "0.5158868", "0.51378375", "0.5119795", "0.5104709", "0.5101643", "0.5101051", "0.508431", "0.50841606", "0.5074305", "0.5047692", ...
0.507729
19
function close log page division
function closelog(){ document.getElementById("log-page").style.display='none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cerrar() {\twindow.close(); }", "function logout()\n{\n\twindow.close();\n}", "function closePrint () {\n document.body.removeChild(this.__container__);\n}", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._sc...
[ "0.65679157", "0.6518292", "0.6301026", "0.6241632", "0.6193293", "0.61474246", "0.6139693", "0.6139693", "0.6129852", "0.6113695", "0.607087", "0.6059503", "0.60426104", "0.6005438", "0.5998574", "0.597252", "0.5968872", "0.5968258", "0.5962123", "0.59604", "0.59448415", "...
0.77408665
0
function close register division
function closeRegister(){ document.getElementById("register-page").style.display='none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subReg(register) {\n var a = regA[0];\n a -= register[0];\n regA[0] = a;\n // All flags are updated\n regF[0] = F_OP | ((a < 0) ? F_CARRY : 0) | (regA[0] ? 0 : F_ZERO);\n if ((regA[0] ^ register[0] ^ a) & 0x10) {\n regF[0] |= F_HCARRY;\n }\n return 1\n }", "subcReg(register) {\n ...
[ "0.59951186", "0.59903306", "0.5778063", "0.5775216", "0.5755409", "0.5732962", "0.5662409", "0.56209105", "0.56072074", "0.55883783", "0.5579185", "0.55561465", "0.5506326", "0.5471306", "0.5451275", "0.53904885", "0.53860986", "0.53832304", "0.53694063", "0.53283936", "0.52...
0.0
-1
If all the input field pass the validation checking, the function will record all answers.
function SucRegister(){ var username=document.getElementById("username").value; var password=document.getElementById("psw").value; var email=document.getElementById("email").value; var birthday=document.getElementById("birthday").value; var phone=document.getElementById("phone").value; var registationJson = { Username: username, Password: password, Email: email, Phone: phone, Birthday: birthday }; //alert(JSON.stringify(registationJson)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkUserInput(){\n\t\t//check if title name is inputted\n\t\tif (!$(element).find('input[id=edit_title_name]').val()){\n\t\t\talert (\"Please input the test's title name\");\t\t\n\t\t\treturn false;\n\t\t}\n\t\t//check if test type is selected\n\t\tif (!$('#edit_test_type').val()){\n\t\t\talert (\"Please...
[ "0.6791253", "0.6737322", "0.6671197", "0.66696006", "0.6634069", "0.65347576", "0.6465407", "0.6459555", "0.6443187", "0.64375234", "0.642993", "0.64258444", "0.6386198", "0.6372094", "0.6286644", "0.626637", "0.625499", "0.62447333", "0.62384737", "0.6234305", "0.6230528", ...
0.0
-1
function check validation of password input
function InvalidPwd(textbox){ /**set regex require character and number with minimum 8 length */ var regular=/^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d]{8,}$/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an password is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter password Minimum eight characters, at least one letter and one number'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidPassword(password) {\n\n\n}", "function password() {\n var errors = document.querySelector(\"#errors\");\n var password = document.querySelectorAll(\"#pass\");\n var pass = password.value.trim();\n var patt = /^(?=.*[a-z])(?=.*\\d){8,16}$/ig;\n if(!patt.test(pass)) {\n retur...
[ "0.8636811", "0.8322139", "0.8284327", "0.821419", "0.8108004", "0.8106444", "0.8081049", "0.8064388", "0.80379236", "0.80311745", "0.80173665", "0.7998091", "0.7988798", "0.7981248", "0.7959785", "0.7926897", "0.7920558", "0.791664", "0.7916487", "0.7901953", "0.7891962", ...
0.74818027
86
function check validation of email
function InvalidEmail(textbox){ /**set regex for email. Patter specify string before @ and after @ */ var regular=/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an email is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter valid email address'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {}", "function validarEmail(email){expr=/^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;if(!expr.test(email)) return false;else return true;}", "function emailValid(){\n if(/\\S+@\\S+\\.\\S+/g.test(email)){\n setErrors('')\n return true\...
[ "0.8688694", "0.8444328", "0.84381914", "0.83712006", "0.834653", "0.8331678", "0.83203065", "0.83201474", "0.8318403", "0.8309891", "0.8304819", "0.82466", "0.8241919", "0.823395", "0.8232771", "0.8232654", "0.8231609", "0.8229886", "0.82072306", "0.81679684", "0.8167925", ...
0.0
-1
function check the validation of phone input
function InvalidPhone(textbox){ /** Set regex as start with 61 and with 8 digital input*/ var regular=/(?:\+?61)?(?:\(0\)[23478]|\(?0?[23478]\)?)\d{8}/; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an Phone number is necessary!'); }else if (!textbox.value.match(regular)) { textbox.setCustomValidity('Please enter valid AU phone number'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processPhone() {\n let input = this.phone\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 11)) {\n ...
[ "0.82622063", "0.8253023", "0.81372327", "0.8134091", "0.808094", "0.8064818", "0.8056426", "0.804736", "0.8036537", "0.8027282", "0.79202104", "0.79126143", "0.78999907", "0.78970844", "0.788502", "0.78679353", "0.7846669", "0.78421205", "0.7840188", "0.7832785", "0.78261554...
0.75120986
56
function check the validation of birth input
function InvalidBirth(textbox){ /**read user selection input from calendar */ var birth = parseInt(textbox.value.substring(0, 4)); /**Calculate age of user */ var age = 2021 - birth; /**update validation textbox content */ if (textbox.value === '') { textbox.setCustomValidity('Entering an Birthday is necessary!'); }else if (age <= 12) { textbox.setCustomValidity('Test requirs minimum 12 years old'); }else{ textbox.setCustomValidity(''); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBirthdate (input, error, extra) {\n if (input) {\n console.log(input)\n if (extra.test(input)) {\n return true\n }\n }\n error.classList.remove('hidden')\n return false\n}", "function check_inputBirthday() {\n\tvar text_birthday = $(\"#input_calendar\").val();\n\tvar show_err_birt...
[ "0.77816725", "0.76380193", "0.76249504", "0.75717264", "0.75243115", "0.7523997", "0.75046283", "0.7417215", "0.737609", "0.7364252", "0.73534983", "0.72722703", "0.7199765", "0.71627945", "0.7139314", "0.7089039", "0.70698863", "0.70568466", "0.70498794", "0.7047614", "0.70...
0.7294675
11
var backUrl = "";
function deal_number(){ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function back(){\n\twindow.history.back();\n}", "function back(){\r\n window.history.back();\r\n}", "function back () {\n\t\n\t window.history.back();\n\t \n}", "function goBack() {\r\n window.location = '/';\r\n}", "function previous(){\n\twindow.location.href = previousurl;\n}", "function goBack(){...
[ "0.7229205", "0.7160019", "0.71343106", "0.71336424", "0.70909697", "0.70630014", "0.7039348", "0.6987162", "0.69503915", "0.6938129", "0.6937925", "0.6920891", "0.6906681", "0.68984747", "0.6896229", "0.6882824", "0.68809587", "0.68809587", "0.68809587", "0.68809587", "0.688...
0.0
-1
> FIN de todo con respecto a CLIENTES
function load_cliente(page) { var FiltroCliente = $("#FiltroCliente").val(); var parametros = {"accion":"cargar","page":page,"FiltroCliente":FiltroCliente}; //$("#loader").fadeIn('slow'); $.ajax({ url:'../listas/listar_cliente_paginado.php', data: parametros, beforeSend: function(objeto) { //$("#loader").html("<img src='loader.gif'>"); }, success:function(data) { $(".outer_div").html(data).fadeIn('slow'); //$("#loader").html(""); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function principal() {\n choquecuerpo();\n choquepared();\n dibujar();\n movimiento();\n \n if(cabeza.choque (comida)){\n comida.colocar();\n cabeza.meter();\n } \n}", "function escreveConteudo(){}", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, i...
[ "0.6193593", "0.6058605", "0.58932954", "0.5822564", "0.57767314", "0.57481384", "0.57398385", "0.57309264", "0.5720382", "0.571154", "0.5704059", "0.5665257", "0.5665257", "0.56613165", "0.5660063", "0.56396943", "0.5632282", "0.56276846", "0.5619998", "0.56035376", "0.55731...
0.0
-1
function to return my name
function myName() { return myName.kurt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_my_name(name){\n return name;\n}", "function returnMyName() {\n return myName;\n}", "function returnMyName() {\n return myName;\n}", "function get_my_name(name){\n return name + \" Ubanell\";\n}", "function getName() {\n return \"Hai Aku Sam\";\n}", "function returnName() {\n ...
[ "0.8551962", "0.8371396", "0.8371396", "0.8235422", "0.81362486", "0.8101663", "0.80422556", "0.80303234", "0.8011707", "0.79279065", "0.78792614", "0.7867598", "0.78362143", "0.7829625", "0.77503145", "0.7733961", "0.76767516", "0.7653938", "0.76387036", "0.7614294", "0.7614...
0.7490612
28
gets all products from products table and displays to the console.
function displayItems(){ return new Promise(function(resolve, reject) { // do a thing, possibly async, then… //makes the query call var query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products' connection.query(query, function(err, items){ //display all the details to the page //console.log(items); //cycle through the items and display each item //console.log('id Product department price qty') for (var i =0; i < items.length; i++){ var print = items[i].item_id +' '; print += items[i].product_name +' '; print += items[i].department_name +' '; print += items[i].price +' '; print += items[i].stock_qty; console.log(print); } }); //connection.end(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayProducts(){\n console.log('printing product table... \\n');\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n // Log all results of the SELECT statement\n console.log('Products \\n---------------')\n for(var i = 0; i < res....
[ "0.8360354", "0.82975686", "0.82669085", "0.82498777", "0.8196092", "0.81910586", "0.81650335", "0.81420845", "0.809749", "0.80914646", "0.8086937", "0.80617875", "0.8055362", "0.80471057", "0.79968077", "0.79838383", "0.79642946", "0.7958511", "0.7954268", "0.7940812", "0.79...
0.0
-1
function to sell the items by completing the order
function sellItems(itemID, qtyRequested){ //check qty available by itemID and compare qty requested var query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products WHERE ?'; connection.query(query, {item_id: itemID}, function(err, items){ //if equal to or less than process order and display cost if (qtyRequested <= items[0].stock_qty){ //run query to update qty //determines the new qty of items var newQTY = items[0].stock_qty - qtyRequested; updateItemQTY(itemID, newQTY); //calculate total cost of items var totalCost = items[0].price * qtyRequested; //display cost console.log('Total amount owed is: $' + totalCost); } else { //if greater than stock qty display error message console.log('There was a problem with your request, you either requested an invalid qty or invalid ID'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _sell() {\n\t\tif (this.state.items_to_sell.length < 1) {\n\t\t\tLogging.warn('Nothing to sell?');\n\t\t\treturn;\n\t\t}\n\n\t\tawait movement.pathfind_move('basics');\n\n\t\tfor (let item of this.state.items_to_sell) {\n\t\t\tconst index = Item.find(item);\n\t\t\tif (index !== -1) {\n\t\t\t\twindow.sell(ind...
[ "0.72672755", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.67875373", "0.6700555", "0.66958225", "0.6677445", "0.6655415", "0.66389936", "0.6566304", "0.65639794", "0.6449293", "0.64365256", "0.6425523", "0.64189684", "0.6405516", "0.639737...
0.7058993
1
function to update a record with the sale of items
function updateItemQTY(itemID, newQTY){ var query = 'UPDATE products SET stock_qty = '+ newQTY + ' WHERE item_id =' + itemID; connection.query(query); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async updateSale(saleID, storeID) {\n\n}", "function updateProductSale() {\n // select the item in database\n connection.query(\"SELECT price, id FROM products WHERE id =?\", [itemToBuy], function (err, res) {\n if (err) throw err;\n // update sales of item in database\n connection.que...
[ "0.7487715", "0.7419291", "0.7258978", "0.6660814", "0.6657514", "0.663115", "0.65494645", "0.6477898", "0.64133316", "0.6398499", "0.63968354", "0.6353275", "0.63235843", "0.6308567", "0.63012666", "0.6292885", "0.6283933", "0.62696624", "0.62630177", "0.6244582", "0.6232437...
0.57738215
78
set your counter to 1
function myLoop () { // create a loop function setTimeout(function () { // call a 3s setTimeout when the loop is called var randomNum = Math.ceil(Math.random()*10); datep = datep+1; gdpp1 = scale*randomNum; gdpp2 = (capacity/randomNum)*10; var dateps = datep.toString(); datap.addRows([[dateps, gdpp1, gdpp2]]); chartp.draw(datap, optionsb); chartp2.draw(datap, optionsb); // your code here i++; // increment the counter if (i < 2030) { // if the counter < 10, call the loop function myLoop(); // .. again which will trigger another } // .. setTimeout() }, 100) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function incrementCounter() {\n setCounter(counter + 1);\n }", "function Increment(){\n setCounter(counter + 1) \n }", "function increment(){\n\t\tsetCount(prevCount=>prevCount+1)\n\t}", "function incrementCounter () {\r\n counter ++;\r\n console.log('counter', counter);\r\n }", "functio...
[ "0.80675226", "0.78473806", "0.7641305", "0.758745", "0.7501995", "0.7501995", "0.7501995", "0.7497403", "0.7388694", "0.7368814", "0.73529434", "0.7343868", "0.7340014", "0.73354733", "0.72501016", "0.7172979", "0.7142189", "0.7119729", "0.70900935", "0.7061894", "0.7027055"...
0.0
-1
myAns: pony, undefined trAns: pony, lol explain: deep's val was assigned with 'pony' and sure was assigned as 'lol'
function es6() { var left = 10; var right = 20; if (right > left) { //console.log([left,right]); [left, right] = [right, left]; } // console.log([left,right]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "a(a.a, \"a\", a() { a.a.aAa = a.a.aAa = 0; });N\nN\n a.aAa = {N\n a: a(a) {a (!aAa(a, a)) a_a(a);},N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a, a); a_a(a); }},N\n a: a(a){aAaAa(a, a);},N\n a: a(a, aAa),N\n a: a(a) {a (!aAa(a, a)) { aAaAa(a); }}N\n };N\nN\n a a = a.a.aAa();N\n a(a, \"...
[ "0.552228", "0.5452805", "0.5270812", "0.5246687", "0.52386415", "0.5216386", "0.5136943", "0.50710064", "0.50216526", "0.50078857", "0.49928764", "0.4989059", "0.4935105", "0.4809827", "0.47849518", "0.47778845", "0.4770162", "0.4735433", "0.4712699", "0.4676829", "0.4652700...
0.0
-1
myAns: undefined, undefined, undefined trAns: undefined, 10, 10 explain: b,c assign at global? immutable and reference?
function getCoords() { return { x: 10, y: 22 }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exaqmple5() {\n var b = 1;\n // b = 10 // * Error:e b is read-only\n}", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[4], t[4] = a[5], t[5] = a[6], t[6] = a[8], t[7] = a[9], t[8] = a[10], t;\n }", "function a(t, a) {\n return t[0] = a[0], t[1] = a[1]...
[ "0.6171213", "0.61678195", "0.6150296", "0.6122829", "0.6065563", "0.5919837", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.5915318", "0.58492327", "0.58413357", "0.58413357", "0.5799543", "0.5774466", "0.5754179", "0.5753245", "0.5726523", "0.5724349",...
0.0
-1
renders router and navbar
render() { const Map = ReactMapboxGl({ accessToken: "pk.eyJ1IjoiaGlkZS0iLCJhIjoiY2plZ2JxYjk2MDJ5NTJ3cGl5bnFobXkxaiJ9.ia8SLIYusJpY5XT9_wjvIA" }); return ( <div> <div> <Router> <div> { /* <nav className="navbar fixed-top navbar-expand-md navbar-toggleable-md navbar-light bg-light"> <button type="button" className="navbar-toggler" data-toggle="collapse" data-target="#navbarNav"> <span className="navbar-toggler-icon"></span> </button> <div className='collapse navbar-collapse' id='navbarNav'> <ul className='navbar-nav mr-auto'> <Link style={{display: 'inline-block'}} to="/" className="brand"> <Animation /> </Link> </ul> <ul className='navbar-nav mr-right'> <Icon type="picture" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}} to="/Portfolio" className="brand mr-3">Portfolio</Link> <Icon type="user" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}} to="/About" className="brand mr-3">About</Link> <Icon type="form" className="mr-2 mt-1"/><Link style={{display: 'inline-block'}}to="/Contact" className="brand mr-3">Contact</Link> </ul> </div> </nav> */ } {<Menu // Navbar onClick={this.handleClick} selectedKeys={[this.state.current]} mode="horizontal" > <Menu.Item key="home"> <Link style={{display: 'inline-block'}} to="/" className="brand"> <Animation /> </Link> </Menu.Item> <Menu.Item style={{float: 'right'}} key="contact"> <Icon type="form" /><Link style={{display: 'inline-block'}}to="/Contact" className="brand">Contact</Link> </Menu.Item> <Menu.Item style={{float: 'right', display: 'inline-block'}}key="about"> <Icon type="user" /><Link style={{display: 'inline-block'}} to="/About" className="brand">About</Link> </Menu.Item> <Menu.Item style={{float: 'right'}} key="portfolio"> <Icon type="picture" /><Link style={{display: 'inline-block'}} to="/Portfolio" className="brand">Portfolio</Link> </Menu.Item> </Menu>} <div className='container-fluid' style={{padding:0}}> <Switch> <Route exact path="/" component={Homepage} /> <Route path="/Profile" component={Portfolio} /> <Route path="/Upload" component={About} /> <Route path="/Contact" render={(props) => this.renderContact(props)} /> <Route path="/Admin" component={Admin} /> <Route path="/Portfolio" component={Portfolio} /> <Route path="/About" component={About} /> <Route path="/Contact" component={Contact} /> </Switch> </div> </div> </Router> </div> </div> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "render() {\n return( \n <nav className=\"navbar navbar-default\">\n <div cl...
[ "0.7131257", "0.6949598", "0.6890401", "0.6795282", "0.6753324", "0.66977024", "0.66841215", "0.66377985", "0.66354483", "0.659705", "0.6556771", "0.6547306", "0.6521401", "0.6480799", "0.64574564", "0.6456046", "0.6451004", "0.64009005", "0.63923085", "0.63918185", "0.639013...
0.0
-1
Exibi o ano atual no elemento jsdate
function currentDate() { var date = new Date(); jQuery("#js-date").html(date.getFullYear()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function masqueSaisieDate(obj) {\n\n var ch = obj.value;\n var ch_gauche, ch_droite;\n obj.value = ch.slice(0, 10);\n ch.toString();\n if (((ch.slice(2, 3)) !== (\"/\")) && (ch.length >= 3)) {\n if (ch.slice(0, 2) > 31) {\n ch_gauche = '31';\n } else {\n ch_gauche...
[ "0.68344027", "0.6398112", "0.6370306", "0.63264036", "0.6295104", "0.6285838", "0.6259141", "0.6246084", "0.62244886", "0.620246", "0.61880463", "0.6115644", "0.6087137", "0.60627204", "0.6052555", "0.5993949", "0.5988957", "0.5985112", "0.59719914", "0.59369123", "0.5914895...
0.0
-1
use a Flow type import to get our Produce type
function saveInventory(inventory) { var outpath = _path2.default.join(__dirname, '..', '..', 'data', 'produce.json'); return new Promise(function (resolve, reject) { // lets not write to the file if we're running tests if (process.env.NODE_ENV !== 'test') { _fs2.default.writeFile(outpath, JSON.stringify(inventory, null, '\t'), function (err) { err ? reject(err) : resolve(outpath); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function propTypeToFlowTypeTransform(j, node, callback) {\n // instanceOf(), arrayOf(), etc..\n const {\n name\n } = node.callee.property;\n\n switch (name) {\n case _constants.PROPTYPES_IDENTIFIERS.INSTANCE_OF:\n return j.genericTypeAnnotation(node.arguments[0], null);\n\n case _constants.PROPTY...
[ "0.6021028", "0.57973087", "0.5684701", "0.56819445", "0.5322835", "0.53035563", "0.52247864", "0.503843", "0.4999311", "0.49831748", "0.4957687", "0.49325165", "0.48940253", "0.4836136", "0.4813239", "0.4812697", "0.4781046", "0.4756906", "0.4656571", "0.46375892", "0.463054...
0.0
-1
Builds the SQL Query for retrieving all petitions from the DB
function buildGetPetitionsQuery(queries){ let q = "SELECT petition_id as petitionId, title, Category.name as category, User.name as authorName, " + "(SELECT count(*) FROM Signature WHERE Signature.petition_id=Petition.petition_id) as signatureCount " + "FROM Petition " + "INNER JOIN Category ON Category.category_id=Petition.category_id " + "INNER JOIN User ON author_id=user_id "; let constraints = []; //Check if the 'q' query exists, if so add the relevant constraint if(queries["q"]) { constraints.push(`title LIKE "%${queries["q"]}%"`); } //Check if the 'categoryId' query exists, if so add the relevant constraint if(queries["categoryId"]) { constraints.push(`Petition.category_id = ${queries["categoryId"]}`); } //Check if the 'authorId' query exists, if so add the relevant constraint if(queries["authorId"]) { constraints.push(`Petition.author_id = ${queries["authorId"]}`); } //If there is a query, add it to the SQL query if(constraints.length > 0) { q += 'WHERE'; for(let constraint of constraints) { q += ` ${constraint} AND` } //We need to remove the trailing 'AND', slice it from the string q = q.slice(0, -3); } //Check if the 'sortBy' query exists, if so add the requested ordering if(queries["sortBy"]) { switch(queries["sortBy"]) { case "ALPHABETICAL_ASC": q += "ORDER BY title ASC, petitionId ASC"; break; case "ALPHABETICAL_DESC": q += "ORDER BY title DESC,Completed /petitions endpoint petitionId ASC"; break; case "SIGNATURES_ASC": q += "ORDER BY signatureCount ASC, petitionId ASC"; break; case "SIGNATURES_DESC": q += "ORDER BY signatureCount DESC, petitionId ASC"; break; default: //Use the Node.js implementation to specify an error code throw new ApiError('sortBy query unavailable', 400); } } else { //Default sorting mode q += "ORDER BY signatureCount DESC, petitionId ASC"; } return q; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findAll() {\n return db.many(`\n SELECT *\n FROM parks p\n ORDER BY p.name\n `);\n }", "_generateTableListQuery(table, conditions = {}, forUpdate = false) {\n assert(typeof table === 'string', 'must provide table');\n assert(typeof conditions === 'object', 'conditions must be object');\n\n ...
[ "0.5742926", "0.5542701", "0.5535327", "0.55135286", "0.54901123", "0.54628456", "0.5451736", "0.5425484", "0.5418275", "0.5416352", "0.5392962", "0.5346311", "0.53233314", "0.5310157", "0.5292506", "0.52699107", "0.5236434", "0.5221286", "0.51881343", "0.5188116", "0.518174"...
0.6962434
0
uncomment to debug without any others actions debug = true; performAction = false; emailWhenUpdated = false; / ========================================= ABOUT THE AUTHOR ========================================= This program was created by Derek Antrican If you would like to see other programs Derek has made, you can check out his website: derekantrican.com or his github: ========================================= BUGS/FEATURES ========================================= Please report any issues at ========================================= $$ DONATIONS $$ ========================================= If you would like to donate and help Derek keep making awesome programs, you can do that here: ========================================= CONTRIBUTORS ========================================= Andrew Brothers Github:
function Install(){ ScriptApp.newTrigger("main").timeBased().everyMinutes(howFrequent).create(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeDebugEmail(){\n /**\n * Validates an email for structure.\n *\n * @param email string The email to validate\n * @return bool true - valid email\n * false - invalid email\n */\n var validateEmail = function(email) {\n // Valid email regex\n v...
[ "0.64899635", "0.58789897", "0.5562439", "0.5548831", "0.55373275", "0.5524924", "0.5509555", "0.54616374", "0.54583025", "0.54568225", "0.5445266", "0.54102343", "0.5363662", "0.53632057", "0.53625184", "0.5361257", "0.53589916", "0.5351025", "0.53069025", "0.5290215", "0.52...
0.0
-1
get the timezoneoffset of a date for a given timezone Default method getTimeZoneOffset() return for the current time which is in USA for google script and which have different daylight saving time
function getTimezoneOffset(d, tz) { var ls = Utilities.formatDate(d, tz, "yyyy/MM/dd HH:mm:ss"); var a = ls.split(/[\/\s:]/); //Logger.log("getTimezoneOffset:" + tz + ' = ls = ' + ls + ' / a = ' + a) a[1]--; var t1 = Date.UTC.apply(null, a); var t2 = new Date(d).setMilliseconds(0); return (t2 - t1) / 60 / 1000; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "get timezoneOffset() {\n if (Date._timezoneOffsetStd === undefined) this._calculateOffset();\n return Date._timezoneOffsetStd;\n }", "get timezo...
[ "0.80024624", "0.73876953", "0.7255866", "0.7252273", "0.7252273", "0.7252273", "0.71632075", "0.7147182", "0.6992944", "0.69095653", "0.6644391", "0.65092313", "0.65016264", "0.64996916", "0.64995474", "0.6491267", "0.6437536", "0.6396718", "0.63538826", "0.6327604", "0.6301...
0.7430525
1
import registerServiceWorker from './registerServiceWorker'
function render() { ReactDOM.render( <Router> <RootContainer /> </Router>, document.getElementById('root') ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerServiceWorker(){\n return navigator.serviceWorker.register(\"./service-worker.js\")\n .then(response => {\n console.log(\"Service Worker Succesfully added\");\n })\n .catch(error => console.log(error));\n}", "_initServiceWorker() {\n if (process.browser && 'serviceWorker' i...
[ "0.733244", "0.69406617", "0.68767214", "0.6641403", "0.6560466", "0.6393896", "0.6298363", "0.6264658", "0.62016886", "0.6196806", "0.6143055", "0.609493", "0.601878", "0.5944373", "0.59259284", "0.59006613", "0.5899331", "0.5782517", "0.5768954", "0.57593435", "0.5729845", ...
0.0
-1
O(n^2) time | O(n^2) space
populateSuffixTrieFrom(string) { for (let i = 0; i < string.length; i++) { this.insertSubstringStartingAt(i, string) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left])...
[ "0.636499", "0.61789864", "0.6123739", "0.5955105", "0.5902497", "0.5876144", "0.5831905", "0.58203113", "0.5818576", "0.58150095", "0.57975554", "0.5783868", "0.57635564", "0.57235825", "0.57108873", "0.57038677", "0.5669614", "0.562856", "0.55775636", "0.55583626", "0.55323...
0.0
-1
O(m) time | O(1) space
contains(string) { let node = this.root for (const letter of string) { if (!(letter in node)) return false node = node[letter] } return this.endSymbol in node }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function icecreamParlor(m, arr) {\n for (let i = 0; i < arr.length - 1; i++) {\n for (let j = i+1; j < arr.length ; j++) {\n if (arr[i] + arr[j] == m) return [i+1, j+1]\n }\n }\n}", "function arrayManipulation(n, queries) {\n const acc = {};\n for (const [a, b, k] of queries) {\n acc[a...
[ "0.5633025", "0.56154114", "0.5611666", "0.5550035", "0.5469891", "0.5463774", "0.5404005", "0.53978956", "0.5367519", "0.53571314", "0.5342542", "0.52979875", "0.5296959", "0.52743644", "0.5262183", "0.51869833", "0.5144041", "0.5139094", "0.51370883", "0.51330006", "0.51178...
0.0
-1
Create a new agent with its signing pen, from a mnemonic or a keyPair.
static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) { if (mnemonic) { // if keypair doesnt correspond to the mnemonic, delete the keypair if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) { warn(`keypair doesn't match mnemonic, ignoring keypair`) keyPair = null } } else if (keyPair) { // if there's a keypair but no mnemonic, generate mnemonic from keyapir mnemonic = Bip39.encode(keyPair.privkey).data } else { // if there is neither, generate a new keypair and corresponding mnemonic keyPair = EnigmaUtils.GenerateNewKeyPair() mnemonic = Bip39.encode(keyPair.privkey).data } const pen = await Secp256k1Pen.fromMnemonic(mnemonic) return new this({name, mnemonic, keyPair, pen, ...args}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create( label, privateKey ){\n\treturn new KeyPair(label, privateKey);\n}", "function createMinerId (alias) {\n _createKey(alias, minerIdKeystorePath)\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateK...
[ "0.5653055", "0.5348549", "0.51183164", "0.5073282", "0.47861168", "0.47482783", "0.4725499", "0.46971315", "0.467273", "0.46564057", "0.46455765", "0.4637237", "0.4627807", "0.46194184", "0.45636174", "0.45481858", "0.45250797", "0.45062736", "0.45048594", "0.4501839", "0.44...
0.70333385
0
Create a new agent from a signing pen.
constructor (options = {}) { const { network , name = "" , pen , mnemonic , keyPair , fees = SecretNetwork.Gas.defaultFees } = options const pubkey = encodeSecp256k1Pubkey(pen.pubkey) return Object.assign(this, { network, name, keyPair, mnemonic, pen, pubkey, API: new SigningCosmWasmClient( network.url, this.address = pubkeyToAddress(pubkey, 'secret'), this.sign = pen.sign.bind(pen), this.seed = EnigmaUtils.GenerateNewSeed(), this.fees = fees ) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) {\n if (mnemonic) {\n // if keypair doesnt correspond to the mnemonic, delete the keypair\n if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) {\n warn(`keypair doesn't match mnemonic, ignoring keypair`)\n ...
[ "0.48949978", "0.48640415", "0.48530108", "0.4774951", "0.4771536", "0.46646932", "0.45978272", "0.45912632", "0.4515223", "0.44812745", "0.44806337", "0.4470632", "0.44579676", "0.44567546", "0.4421732", "0.44188836", "0.44065", "0.4360031", "0.4359998", "0.43599558", "0.435...
0.43406802
24
Get the current balance in a specified denomination.
async getBalance (denomination = 'uscrt') { const account = await this.API.getAccount(this.address) || {} const balance = account.balance || [] const inDenom = ({denom, amount}) => denom === denomination const balanceInDenom = balance.filter(inDenom)[0] || {} return balanceInDenom.amount || 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBalance() {\n return balance;\n }", "async getBalance () {\n await this.update()\n return this.client.getBalance()\n }", "function getBalance() {\n const payload = {\n symbol: 'ELF',\n owner: wallet.address\n };\n\n multiTokenContract.GetBalance.call(payload)\n ...
[ "0.6942409", "0.6714723", "0.66609716", "0.6582339", "0.6557121", "0.6481666", "0.6477863", "0.64767516", "0.6461573", "0.63955", "0.638458", "0.63446736", "0.63416445", "0.6338454", "0.6334421", "0.63229644", "0.6322435", "0.6261131", "0.6245841", "0.62338144", "0.61992073",...
0.806093
0
Send some `uscrt` to an address.
async send (recipient, amount, denom = 'uscrt', memo = "") { if (typeof amount === 'number') amount = String(amount) return await this.API.sendTokens(recipient, [{denom, amount}], memo) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async simplerSend (amount, address) {\n const txid = await this.client.sendToAddress(address, amount)\n return txid\n }", "async sendToAddress(krai, address) {\n if (this.active) {\n try {\n console.log('Looking up account info');\n let accountInfo = await t...
[ "0.53880954", "0.5215648", "0.51981896", "0.51842564", "0.5166067", "0.51105434", "0.50891536", "0.5023047", "0.49253744", "0.49253485", "0.49173206", "0.49079472", "0.4881413", "0.48292726", "0.4816638", "0.47931868", "0.47452828", "0.47395355", "0.47036067", "0.46772507", "...
0.0
-1
Send `uscrt` to multiple addresses.
async sendMany (txs = [], memo = "", denom = 'uscrt', fee = SecretNetwork.Gas(500000 * txs.length)) { if (txs.length < 0) { throw new Error('tried to send to 0 recipients') } const from_address = this.address //const {accountNumber, sequence} = await this.API.getNonce(from_address) let accountNumber, sequence const msg = await Promise.all(txs.map(async ([to_address, amount])=>{ ({accountNumber, sequence} = await this.API.getNonce(from_address)) // increment nonce? if (typeof amount === 'number') amount = String(amount) const value = {from_address, to_address, amount: [{denom, amount}]} return { type: 'cosmos-sdk/MsgSend', value } })) const signBytes = makeSignBytes(msg, fee, this.network.chainId, memo, accountNumber, sequence) return this.API.postTx({ msg, memo, fee, signatures: [await this.sign(signBytes)] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUsers(dcnt) {\n io.sockets.emit('join', {\n names: Object.keys(allUsrName), //just get all their names\n dcnt: dcnt\n });\n }", "function sendAll(obj) {\n clients.forEach((client) => {\n send(client, obj);\n })\n}", "forEach(callback) {\n fo...
[ "0.49759355", "0.48770338", "0.48396292", "0.47920975", "0.46969154", "0.46669462", "0.45950216", "0.45782965", "0.4572112", "0.45387185", "0.45359734", "0.45359734", "0.45359734", "0.45359734", "0.4530559", "0.4512454", "0.4490507", "0.44634604", "0.44536066", "0.4450927", "...
0.54898155
0
`await` this to get info about the current block of the network.
get block () { return this.API.getBlock() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getBlockInfo(blockNum) {\n var info = await web3.eth.getBlock(blockNum)\n return info\n}", "async getCurrentBlockNumber() {\n const blockNum = await window.web3.eth.getBlockNumber();\n this.setState({currentBlockNumber: blockNum});\n }", "getBlock() {\n const self = this\n ...
[ "0.74712193", "0.7160966", "0.70184815", "0.6893731", "0.68704396", "0.682075", "0.6818044", "0.6780187", "0.6703221", "0.6643881", "0.6512256", "0.6492273", "0.6463958", "0.6407212", "0.64002395", "0.6396356", "0.6374369", "0.6330996", "0.63239133", "0.6306357", "0.6287778",...
0.70250756
2
`await` this to get the account info for this agent's address.
get account () { return this.API.getAccount(this.address) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAccount(address) {\n if (address == null) {\n return null;\n }\n var response = await restGet(`/auth/accounts/${address}`);\n var account;\n try {\n account = response.data.result.value;\n } catch (e) {\n return null;\n }\n\n if (account.address == \"\") {\n return null;\n }\...
[ "0.69001406", "0.6792922", "0.67014945", "0.6667558", "0.66384286", "0.6629176", "0.6600547", "0.65904033", "0.6445566", "0.64336807", "0.6403458", "0.64022124", "0.64022124", "0.6387307", "0.6369204", "0.6346381", "0.63448113", "0.6328385", "0.63090277", "0.63067836", "0.628...
0.68403494
1
`await` this to get the current balance in the native coin of the network, in its most granular denomination
get balance () { return this.getBalance() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getBalance() {\n if (this.active) {\n try {\n console.log('Looking up account balance');\n let response = await this.client.account_balance(this.GAME_ADDRESS);\n return this.getKraiFromRaw(response.balance);\n } catch (error) {\n ...
[ "0.74293727", "0.7396473", "0.7341274", "0.7198438", "0.71622384", "0.71339095", "0.70615524", "0.7039908", "0.70301795", "0.6927544", "0.6866696", "0.68604755", "0.68266636", "0.67492956", "0.6720872", "0.6669353", "0.6627617", "0.6614965", "0.6611551", "0.65928966", "0.6552...
0.60432965
62
`await` this to pause until the block height has increased. (currently this queries the block height in 1000msec intervals)
get nextBlock () { return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{ while (true) { await new Promise(ok=>setTimeout(ok, 1000)) const now = await this.API.getBlock() if (now.header.height > height) { resolve() break } } })) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForNewBlock(height, cb) {\n var actualHeight = height;\n async.doWhilst(\n function (cb) {\n request({\n type: 'GET',\n url: baseUrl + '/api/blocks/getHeight',\n json: true\n }, function (err, resp, body) {\n if (err || resp.statusCode != 200) {\n re...
[ "0.71196485", "0.70206577", "0.6949194", "0.6811678", "0.67125505", "0.665578", "0.65126926", "0.65034145", "0.6415976", "0.6394332", "0.6286481", "0.6271266", "0.62548894", "0.62484163", "0.6225977", "0.6164402", "0.61447823", "0.6105917", "0.6074959", "0.6023015", "0.598066...
0.7681687
0
Upload a compiled binary to the chain, returning the code ID (among other things).
async upload (pathToBinary) { return this.API.upload(await readFile(pathToBinary), {}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deploy(bytecode, abi, pipe) {\n\n}", "compile() {\n // Check if it is already compiled\n if (!this.compiled) {\n // Find the file and read it into memory\n let filePath = path.resolve(__dirname, 'contracts', 'SimpleStorage.sol');\n let fileSource = fs.readF...
[ "0.5894483", "0.5706609", "0.5677075", "0.55815244", "0.5562345", "0.53481674", "0.5141971", "0.50735664", "0.49832237", "0.498043", "0.49797356", "0.49532413", "0.49396405", "0.48989385", "0.48838103", "0.4876351", "0.48616552", "0.48295802", "0.482352", "0.47964936", "0.478...
0.55440354
5
Instantiate a contract from a code ID and an init message.
async instantiate ({ codeId, initMsg = {}, label = '' }) { const initTx = await this.API.instantiate(codeId, initMsg, label) const codeHash = await this.API.getCodeHashByContractAddr(initTx.contractAddress) return { ...initTx, codeId, label, codeHash } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Contract(contractId) {\n contract_classCallCheck(this, Contract);\n // TODO: Add methods based on the contractSpec (or do that elsewhere?)\n this._id = contract_Buffer.from(contractId, 'hex');\n }", "static async initContractInstance(inputInitParams) {\n const {contractAddress} = inputInitP...
[ "0.63230795", "0.6299882", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.5986646", "0.5913843", "0.5833289", "0.5726055", "0.5667258", "0.5617678", "0.5506324", "0.5486914", "0.54818", "0.54380006", "0.5355722", "...
0.7190188
0
Create a rule, will not render after stylesheet was rendered the first time. Will link the rule in `this.rules`.
createRule(name, style, options) { options = { ...options, sheet: this, jss: this.options.jss, Renderer: this.options.Renderer } // Scope options overwrite instance options. if (options.named == null) options.named = this.options.named const rule = createRule(name, style, options) // Register conditional rule, it will stringify it's child rules properly. if (rule.type === 'conditional') { this.rules[rule.selector] = rule } // This is a rule which is a child of a condtional rule. // We need to register its class name only. else if (rule.options.parent && rule.options.parent.type === 'conditional') { // Only named rules should be referenced in `classes`. if (rule.options.named) this.classes[name] = rule.className } else { this.rules[rule.selector] = rule if (options.named) { this.rules[name] = rule this.classes[name] = rule.className } } options.jss.plugins.run(rule) return rule }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRule(selector) {\n var index = styleSheet.cssRules.length;\n styleSheet.insertRule(selector + ' {}', index);\n return styleSheet.cssRules[index];\n}", "function linkRule(rule, cssRule) {\n rule.renderable = cssRule;\n if (rule.rules && cssRule.cssRules) rule.rules.link(cssRule.cssRu...
[ "0.6862027", "0.6737874", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "0.6734027", "...
0.6548749
37
Overridden to supply undefined length because it's entirely possible this is sparse.
valueSeq() { var valuesSequence = super.valueSeq(); valuesSequence.length = undefined; return valuesSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set length(length) {\n\t\tthis._length = length;\n\t}", "set length(value) {}", "set length(value) {}", "get length() {\n return this._index.length;\n }", "get length() { return this._length; }", "get length() { return this._length; }", "function arrayLengthTest1() {\n var arr;\n var k;...
[ "0.648643", "0.64084154", "0.64084154", "0.63181126", "0.63049847", "0.63049847", "0.62740856", "0.61771405", "0.61771405", "0.6119211", "0.6119211", "0.6099573", "0.6063441", "0.5943261", "0.5908476", "0.5904925", "0.58931476", "0.58667564", "0.5856715", "0.5855682", "0.5855...
0.0
-1
Overrides to get length correct.
take(amount) { var sequence = this; if (amount > sequence.length) { return sequence; } var takeSequence = sequence.__makeSequence(); takeSequence.__iterateUncached = function(fn, reverse, flipIndices) { if (reverse) { // TODO: can we do a better job of this? return this.cacheResult().__iterate(fn, reverse, flipIndices); } var taken = 0; var iterations = 0; // TODO: ensure didFinish is necessary here var didFinish = true; var length = sequence.__iterate((v, ii, c) => { if (taken++ < amount && fn(v, ii, c) !== false) { iterations = ii; } else { didFinish = false; return false; } }, reverse, flipIndices); return didFinish ? length : iterations + 1; }; takeSequence.length = this.length && Math.min(this.length, amount); return takeSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get length() {}", "get length() {}", "get length() {\n\t\treturn this.getLength();\n\t}", "function getLength() {\n\t\t\treturn data.length;\n\t\t}", "get length() { return this._length; }", "get length() { return this._length; }", "getLength() {\n return this.length;\n }", "getLength() {\n...
[ "0.81764436", "0.81764436", "0.815856", "0.7982924", "0.79270107", "0.79270107", "0.7896725", "0.7896725", "0.78867817", "0.7884087", "0.7846043", "0.780714", "0.7713117", "0.76629823", "0.7629956", "0.75790644", "0.7578405", "0.7578231", "0.7531723", "0.7526828", "0.75267667...
0.0
-1
abstract __iterateUncached(fn, reverse, flipIndices)
__makeSequence() { return makeIndexedSequence(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function eachReverse(array, fn) {\n var i = array.length;\n while (i--) {\n fn(array[i], i);\n }\n}", "* [Symbol.iterator]() {\n\t\tfor (const item of this.cache) {\n\t\t\tyield item;\n\t\t}\n\n\t\tfor (const item of this.oldCache) {\n\t\t\tconst [key] = item;\n\t\t\tif (!this.cache.has(key)) {\n...
[ "0.6122174", "0.6021834", "0.59368086", "0.59368086", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", "0.59023947", ...
0.0
-1
Sequence.prototype.filter and IndexedSequence.prototype.filter are so close in behavior that it makes sense to build a factory with the few differences encoded as booleans.
function filterFactory(sequence, predicate, thisArg, useKeys, maintainIndices) { var filterSequence = sequence.__makeSequence(); filterSequence.__iterateUncached = (fn, reverse, flipIndices) => { var iterations = 0; var length = sequence.__iterate((v, k, c) => { if (predicate.call(thisArg, v, k, c)) { if (fn(v, useKeys ? k : iterations, c) !== false) { iterations++; } else { return false; } } }, reverse, flipIndices); return maintainIndices ? length : iterations; }; return filterSequence; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter(keepIf) {\n const self = this;\n return new Seq(function* () {\n for (const element of self)\n if (keepIf(element))\n yield element;\n });\n }", "function bouncer2(arr) {\n return arr.filter(Boolean)\n}", "function falsyFilter(){\nf...
[ "0.6230247", "0.6189363", "0.6102953", "0.60412955", "0.59969646", "0.5978879", "0.59539735", "0.59510285", "0.5937768", "0.5931186", "0.59292996", "0.5904279", "0.5903832", "0.5887538", "0.5823944", "0.5800472", "0.5781253", "0.57788664", "0.5776585", "0.57582664", "0.574619...
0.6928207
0
extends super class constructor
constructor() { super(); this.windows = 4; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructur() {}", "constructor(a, b, c) {\n super(a, b, c);\n }", "constructor() {\n\t\tsuper(...arguments);\n\t}", "constructor() { super() }", "constructor (){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "constructor(){}", "construc...
[ "0.82251936", "0.79075104", "0.7902193", "0.78449553", "0.7842001", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.77767575", "0.7743238", "0.77415466", "0.77376467", "0.7679964", "0.76201963", "0.76201963", "0.7551389", "0.7537723", "0...
0.0
-1
================ DRAW EFFECTS ====================
function initEffects(){ w = $("#effects").width(); h = $("#effects").height(); effectsCanvas = document.getElementById("effects"); effectsCanvas.width = w; effectsCanvas.height = h; effectsContext = effectsCanvas.getContext("2d"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "drawEffect() {\n var effect = this.decideParticleEffect();\n if (effect)\n this.game.addEntity(effect);\n }", "draw() {\n this.drawExistingEntities();\n this.disableEntities();\n this.blockHeroMovement();\n this.killedEnemiesCounter();\n }", "function draw(){\r\n\treque...
[ "0.7175995", "0.6756187", "0.6641002", "0.644936", "0.64451736", "0.6381269", "0.6367208", "0.63565016", "0.63565016", "0.63565016", "0.6348644", "0.63153726", "0.63153726", "0.6303444", "0.6302979", "0.6302781", "0.62759477", "0.6275754", "0.6252963", "0.6245626", "0.6242325...
0.0
-1
================ INITIALIZE GAME ====================
function init() { initValues(); initEngine(); initLevel(); initTouchHandlers(); startTurn(); initEffects(); setInterval(tick, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n init...
[ "0.80410624", "0.79410183", "0.790484", "0.77652174", "0.76843137", "0.76833725", "0.76373404", "0.75701165", "0.7564578", "0.7522507", "0.750825", "0.75034875", "0.74794316", "0.74632657", "0.744874", "0.7437712", "0.74331915", "0.74140954", "0.74111825", "0.74034786", "0.73...
0.0
-1
================ UI HANDLERS ====================
function initTouchHandlers() { $('.done-button').bind('touchstart', function(e){ nextTurn(); }) $('.mode-button').bind('touchstart', function(e){ const myIndex = $(e.target).data("index"); const myName = $(e.target).data("name"); const myPlayer = $(e.target).data("player"); buttonSelected = player.buttons[myName]; if (buttonSelected.mode.onModeStart) buttonSelected.mode.onModeStart(); updateButtons(); }) $('.mode-button').bind('touchend', function(e){ if (buttonSelected && buttonSelected.mode.onModeEnd) { buttonSelected.mode.onModeEnd(); } updateButtons(); }) $('#container').bind('touchstart', function(e){ e.preventDefault(); const touch = e.targetTouches[0]; touchX = touch.pageX; touchY = touch.pageY; if (buttonSelected && buttonSelected.mode.onTouchStart) { buttonSelected.mode.onTouchStart(); } updateButtons(); }) $('#container').bind('touchmove', function(e){ e.preventDefault(); const touch = e.targetTouches[0]; touchX = touch.pageX; touchY = touch.pageY; if (buttonSelected && buttonSelected.mode.onTouchMove) { buttonSelected.mode.onTouchMove(); } updateButtons(); }) $('#container').bind('touchend touchcancel', function(e){ e.preventDefault(); if (buttonSelected && buttonSelected.mode.onTouchEnd) { buttonSelected.mode.onTouchEnd(); } updateButtons(); }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function UI(){}", "function UI(){}", "function UI() {}", "function UI() {}", "function UI() {}", "function UI() {\n }", "handleInteliUiMenu() {\n //import InteliUI API to be able to communicate with the editor\n var inteliUiApi = new InteliUiApi();\n var container = $('#inteliUi-c...
[ "0.686129", "0.686129", "0.6796653", "0.6796653", "0.6796653", "0.6663937", "0.6625558", "0.65125835", "0.6444413", "0.6343591", "0.6259258", "0.62534493", "0.62512034", "0.6191829", "0.61880404", "0.614265", "0.6129523", "0.61091805", "0.6078466", "0.6076758", "0.6067815", ...
0.0
-1
================ MANAGING PHYSICS ====================
function addWall(x, y, width, height, color, rotation) { if (!color) color = "#00000000"; const newWall = Matter.Bodies.rectangle(x+width/2, y+height/2, width, height, { isStatic: true, render: { visible: false }, render: { fillStyle: color } }); if (rotation) Matter.Body.rotate(newWall, degreesToRadians(rotation)); return newWall }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "refreshFromPhysics() {}", "refreshFromPhysics() {}", "function modelNexus(name,xu,h,h0,rat,row,col,c_1,c_2) {\n var c1 = c_1 || [1,1,0];\n var c2 = c_2 || [1,192/255,0];\n var transform = new Transform();\n\n scene.new_Part(name+\"plats\");\n for(var i=0; i<3;i++){\n ...
[ "0.5898804", "0.5898804", "0.56797415", "0.56433815", "0.56433815", "0.55750424", "0.55658066", "0.55527043", "0.5542595", "0.5527983", "0.5494414", "0.5457887", "0.5451798", "0.54494", "0.544439", "0.5435168", "0.5391977", "0.53888464", "0.53877306", "0.53496283", "0.5348187...
0.0
-1
================ UTILITY FUNCTIONS ====================
function getTouchDistance(){ const ballPos = ball.body.position; return getDistance(touchX, touchY, ballPos.x, ballPos.y); }
{ "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() {}", "transient protected internal ...
[ "0.6754465", "0.65777403", "0.64131147", "0.6255865", "0.60716826", "0.606176", "0.6018082", "0.5905508", "0.5823355", "0.5823355", "0.5818964", "0.57699364", "0.57612514", "0.5709106", "0.5706893", "0.56966954", "0.56754845", "0.563252", "0.56275195", "0.55836457", "0.554751...
0.0
-1
internal = recurse the window menu and extract all 'accelerator' values with reserved=true
function extractKeybindings (menuNode) { if (menuNode.accelerator && menuNode.click && menuNode.reserved) { return { binding: convertAcceleratorToBinding(menuNode.accelerator), cmd: menuNode.click } } else if (menuNode.submenu) { return menuNode.submenu.map(extractKeybindings).filter(Boolean) } else if (Array.isArray(menuNode)) { return _flattenDeep(menuNode.map(extractKeybindings).filter(Boolean)) } return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function m_tt_Mkm_CmdEnum()\n{\n\tvar n = 0;\n\tfor(var i in config_menu)\n\t\teval(\"window.\" + i.toString().toUpperCase() + \" = \" + n++);\n\tm_tt_aV.length = n;\n}", "initHotkeys() {\n const PREFIX = \"alt+shift+\";\n const keys = Hotkey.getKeys();\n const rkeys = keys.filter(k => k.indexOf(P...
[ "0.5672235", "0.56299275", "0.5614718", "0.55224115", "0.54705167", "0.5452561", "0.5440017", "0.54134077", "0.5395205", "0.53901607", "0.538843", "0.53812414", "0.5335745", "0.5269757", "0.52655584", "0.52325195", "0.52013046", "0.5200467", "0.5180582", "0.51687264", "0.5137...
0.5746991
0
=========================== Bot setup! =========================== This function sets up and runs our bot.
function init_bot() { console.log("Initializing Penny..."); // rtmHandlers (real time message handlers) rtmHandlers.onAuthentication(env); rtmHandlers.onReceiveMessage(env); rtmHandlers.startRtm(env); setupScheduledPrompts(env); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupBot(args) {\r\n if (botDataExists()) {\r\n console.log('Found saved bot data during setup - loading it');\r\n loadBotData();\r\n } else {\r\n console.log('No saved bot data found - generating default data');\r\n setupDefaultBot();\r\n saveBotData();\r\n }\r...
[ "0.7023849", "0.6938551", "0.66934544", "0.6670126", "0.6544007", "0.64738196", "0.645209", "0.645011", "0.64082813", "0.6370061", "0.63590604", "0.6271769", "0.6154662", "0.6133547", "0.6094147", "0.60537106", "0.6043347", "0.6000122", "0.5998333", "0.5951112", "0.5885482", ...
0.7067322
0
This function handles pesky input quotations and properly delineated backslashes
function pathCorrect (filepath) { pathArray = filepath.split(path.sep); var correctedPath = path.normalize(pathArray.join('\\\\')); correctedPath = correctedPath.replace(/\"/g,''); return correctedPath; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clean(input){\n return input.replace('\\'', '');\n \n }", "_checkQuotes() {\n const str = aStr.string;\n if (str.length >= 2\n && str[0] == str[str.length - 1]\n && (str[0] == \"'\" || str[0] == '\"')) {\n this.isQuoted = true;\n this.quote = str[0];\n retur...
[ "0.6947087", "0.67111605", "0.6710543", "0.6710543", "0.6710543", "0.6710543", "0.6659576", "0.6612262", "0.65579706", "0.6534072", "0.65152067", "0.6513588", "0.6503538", "0.64928925", "0.642996", "0.64244646", "0.63969755", "0.639467", "0.6360615", "0.6359078", "0.63571113"...
0.0
-1
Replacer Function Skips () statements, Finds Z values, converst to num, offsets, converts back to string
function zOffset (match, numberPart) { //console.log(match); //console.log('Number part is: ' + numberPart); if (typeof numberPart == 'undefined'){ return match; } else { let zValue = Number(numberPart); //console.log(zValue); if (zValue === 20 || zValue === 30) { return match; } //Add zValue Offset - use math.format to eliminate floating point errors, then convert back to number zValue = zValue - partLength; zValue = Number(math.format(zValue, {precision: 8})); //Check for long decimal floating point errors if (countDecimals(zValue) > 4) { errorCount += 1; floatErrors.push((i+1)); } //If the number is an integer, ensure a decimal is included in the string conversion if (Number.isInteger(zValue)) { var newString = 'Z' + zValue.toFixed(1); //Preceding space is added back into the string } else { var newString = 'Z' + zValue.toString(); } return newString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function replacer (x,y,z){\n let s = '' + y;\n for (let i = y.length; i < z; i++) s += '0';\n return s;\n }", "function replacer(match, p1, p2, p3, offset, string) {\n // p1 is nondigits, p2 digits, and p3 non-alphanumerics\n return [p1, p2, p3].join(' - ');\...
[ "0.70561826", "0.60980505", "0.60753936", "0.606705", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.5982162", "0.58412826", "0.5757439", "0.560449", "0.54878515", "0.54862624", "0.54674727", "0.54393834", "0.5415193", "0.5367315", "0.5327956", "0.5317712...
0.5462023
16
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You 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. Architecture
function ArtemisConsole() { this.getServerAttributes = function (jolokia, mBean) { var req1 = { type: "read", mbean: mBean }; return jolokia.request(req1, { method: "post" }); }; this.createAddress = function (mbean, jolokia, name, routingType, method) { jolokia.execute(mbean, "createAddress(java.lang.String,java.lang.String)", name, routingType, method); }; this.deleteAddress = function (mbean, jolokia, name, method) { jolokia.execute(mbean, "deleteAddress(java.lang.String)", name, method); }; this.createQueue = function (mbean, jolokia, address, routingType, name, durable, filter, maxConsumers, purgeWhenNoConsumers, method) { jolokia.execute(mbean, "createQueue(java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,int,boolean,boolean)", address, routingType, name, filter, durable, maxConsumers, purgeWhenNoConsumers, true, method); }; this.deleteQueue = function (mbean, jolokia, name, method) { jolokia.execute(mbean, "destroyQueue(java.lang.String)", name, method); }; this.purgeQueue = function (mbean, jolokia, method) { jolokia.execute(mbean, "removeAllMessages()", method); }; this.browse = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'browse()' }, method); }; this.deleteMessage = function (mbean, jolokia, id, method) { ARTEMIS.log.info("executing on " + mbean); jolokia.execute(mbean, "removeMessage(long)", id, method); }; this.moveMessage = function (mbean, jolokia, id, queueName, method) { jolokia.execute(mbean, "moveMessage(long,java.lang.String)", id, queueName, method); }; this.retryMessage = function (mbean, jolokia, id, method) { jolokia.execute(mbean, "retryMessage(java.lang.String)", id, method); }; this.sendMessage = function (mbean, jolokia, headers, type, body, durable, user, pwd, method) { jolokia.execute(mbean, "sendMessage(java.util.Map, int, java.lang.String, boolean, java.lang.String, java.lang.String)", headers, type, body, durable, user, pwd, method); }; this.getConsumers = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'listAllConsumersAsJSON()' }, method); }; this.getRemoteBrokers = function (mbean, jolokia, method) { jolokia.request({ type: 'exec', mbean: mbean, operation: 'listNetworkTopology()' }, method); }; this.ownUnescape = function (name) { //simple return unescape(name); does not work for this :( return name.replace(/\\\\/g, "\\").replace(/\\\*/g, "*").replace(/\\\?/g, "?"); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initiator() {\n throw new Error('Not implemented');\n }", "function getImplementation( cb ){\n\n }", "function _____SHARED_functions_____(){}", "get Android() {}", "constructor() {\n throw new Error('Not implemented');\n }", "static create () {}", "init() {\n // hello from t...
[ "0.5192742", "0.5190828", "0.50438756", "0.50031596", "0.4937668", "0.4826248", "0.48038277", "0.4797566", "0.4776659", "0.4776659", "0.47549367", "0.4746918", "0.4736192", "0.47212085", "0.47049117", "0.46956068", "0.46956068", "0.4691667", "0.46873403", "0.46783352", "0.467...
0.0
-1
The ARTEMIS service handles the connection to the Artemis Jolokia server in the background
function artemisService() { 'ngInject'; var self = { artemisConsole: undefined, getVersion: function (jolokia) { ARTEMIS.log.info("Connecting to ARTEMIS service: " + self.artemisConsole.getServerAttributes(jolokia)); }, initArtemis: function (broker) { ARTEMIS.log.info("*************creating Artemis Console************"); self.artemisConsole = new ArtemisConsole(); } }; return self; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start() {\n this.setupDoorbellSocket();\n this.setupMQTT();\n this.initLogin();\n }", "function ArtemisConsole() {\n\n this.getServerAttributes = function (jolokia, mBean) {\n var req1 = { type: \"read\", mbean: mBean };\n return jolokia.request(req1, { method: \"post\" });\n };\n\n this.creat...
[ "0.58810544", "0.5861172", "0.58084726", "0.56619513", "0.5636481", "0.5614398", "0.56017923", "0.55977917", "0.5561187", "0.554426", "0.55383235", "0.55216837", "0.55192965", "0.5510061", "0.54942155", "0.5489043", "0.54535776", "0.5438874", "0.5436381", "0.5414355", "0.5385...
0.55109984
13
Sets $scope.row to currently selected JMS message. Used in: ARTEMIS/js/browse.ts camel/js/browseEndpoint.ts TODO: remove $scope argument and operate directly on other variables. but it's too much side effects here...
function selectCurrentMessage(message, key, $scope) { // clicking on message's link would interfere with messages selected with checkboxes if ('selectAll' in $scope.gridOptions) { $scope.gridOptions.selectAll(false); } else { $scope.gridOptions.selectedItems.length = 0; } var idx = Core.pathGet(message, ["rowIndex"]) || Core.pathGet(message, ['index']); var jmsMessageID = Core.pathGet(message, ["entity", key]); $scope.rowIndex = idx; var selected = $scope.gridOptions.selectedItems; selected.splice(0, selected.length); if (idx >= 0 && idx < $scope.messages.length) { $scope.row = $scope.messages.find(function (msg) { return msg[key] === jmsMessageID; }); if ($scope.row) { selected.push($scope.row); } } else { $scope.row = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCurrentMessage(message, key, $scope) {\n // clicking on message's link would interfere with messages selected with checkboxes\n if ('selectAll' in $scope.gridOptions) {\n $scope.gridOptions.selectAll(false);\n }\n else {\n $scope.gridOptions.selected...
[ "0.67660975", "0.6256739", "0.59547883", "0.58603173", "0.5809188", "0.5669057", "0.5610899", "0.5361881", "0.53603286", "0.533458", "0.5322815", "0.5279658", "0.52687013", "0.5266453", "0.52545375", "0.5249026", "0.51985466", "0.51287353", "0.5122258", "0.51195323", "0.51162...
0.68048555
0
Adds functions needed for message browsing with details Adds a watch to deselect all rows after closing the slideout with message details TODO: export these functions too?
function decorate($scope) { $scope.selectRowIndex = function (idx) { $scope.rowIndex = idx; var selected = $scope.gridOptions.selectedItems; selected.splice(0, selected.length); if (idx >= 0 && idx < $scope.messages.length) { $scope.row = $scope.messages[idx]; if ($scope.row) { selected.push($scope.row); } } else { $scope.row = null; } }; $scope.$watch("showMessageDetails", function () { if (!$scope.showMessageDetails) { $scope.row = null; $scope.gridOptions.selectedItems.splice(0, $scope.gridOptions.selectedItems.length); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_read_messages(messages)\n{\n Array.each(messages, function(message) {\n var id = message.get('text');\n var rowelem = $('msgrow-'+id);\n\n // Remove the new class from the ckeckbox and summary\n rowelem.getElementsByClassNam...
[ "0.6320755", "0.59993416", "0.57495004", "0.5710571", "0.55365074", "0.5442885", "0.5441454", "0.539694", "0.5373962", "0.5357895", "0.5327819", "0.5325876", "0.5302621", "0.52867204", "0.5271538", "0.52688235", "0.52628917", "0.52628016", "0.5253582", "0.52531195", "0.522971...
0.0
-1
bind model values to search params...
function currentValue() { var answer = $location.search()[paramName] || defaultValue; return answer === "false" ? false : answer; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onSearch(value) {\n this.model.query = value;\n }", "onSearch(value) {\n this.model.query = value;\n }", "function searchBinding(){\n var selector = thisInstance.constants.selector,\n $searchForm = $(selector.searchForm);\n $searchForm.on('submit', function(event){\...
[ "0.7259465", "0.7259465", "0.62701225", "0.61706376", "0.6068848", "0.59847015", "0.5893689", "0.5849422", "0.5848959", "0.5814683", "0.57553935", "0.57285357", "0.5724531", "0.57236356", "0.5723054", "0.5710857", "0.5688826", "0.5650459", "0.5646865", "0.564323", "0.5636922"...
0.0
-1
Generates the HTML for a link to the destination
function createDestinationLink(destinationName, destinationType) { if (destinationType === void 0) { destinationType = "queue"; } return $compile('<a target="destination" title="' + destinationName + '" ng-click="connectToDestination()">' + destinationName + '</a>')($scope); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeLink() {\n // var a=\"http://www.geocodezip.com/v3_MW_example_linktothis.html\"\n var url = window.location.pathname;\n var a = url.substring(url.lastIndexOf(\n '/') + 1) + \"?lat=\" +\n map.getCenter()\n .lat()\n ...
[ "0.6682557", "0.62523365", "0.6246781", "0.62387705", "0.6108658", "0.6063756", "0.6057287", "0.59873235", "0.5983369", "0.59809536", "0.59450084", "0.594434", "0.59342194", "0.5905177", "0.59000206", "0.5889419", "0.5875309", "0.58298373", "0.58223563", "0.5818942", "0.57764...
0.5944947
11
Avoid the JMX type property clashing with the ForceGraph type property; used for associating css classes with nodes on the graph
function renameTypeProperty(properties) { properties.mbeanType = properties['type']; delete properties['type']; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCType(prop, classContext) {\n\tprop.isPtr = false;\n\tprop.CType = undefined;\n\tprop.CConstType = undefined;\n\tprop.CBaseType = undefined;\n\n\t/*\n\t * map basic JSON types\n\t */\n\tswitch ( prop.type ) {\n\tcase 'string':\n\t\tprop.CBaseType = \"std::string\";\n\t\tprop.isPtr = true;\n\t\tbreak;\n...
[ "0.57275623", "0.56749016", "0.5421634", "0.52650917", "0.5243341", "0.5152161", "0.5091512", "0.5091512", "0.50166875", "0.50130606", "0.500727", "0.4996701", "0.49426684", "0.49331057", "0.4905186", "0.4904321", "0.48959813", "0.48710933", "0.48627383", "0.48509043", "0.484...
0.51890785
5
For some reason using ngrepeat in the modal dialog doesn't work so lets just create the HTML in code :)
function createBodyText(message) { ARTEMIS.log.info("loading message:" + message); if (message.text) { var body = message.text; var lenTxt = "" + body.length; message.textMode = "text (" + lenTxt + " chars)"; return body; } else if (message.BodyPreview) { var code = Core.parseIntValue(localStorage["ARTEMISBrowseBytesMessages"] || "1", "browse bytes messages"); var body; message.textMode = "bytes (turned off)"; if (code != 99) { var bytesArr = []; var textArr = []; message.BodyPreview.forEach(function (b) { if (code === 1 || code === 2) { // text textArr.push(String.fromCharCode(b)); } if (code === 1 || code === 4) { // hex and must be 2 digit so they space out evenly var s = b.toString(16); if (s.length === 1) { s = "0" + s; } bytesArr.push(s); } else { // just show as is without spacing out, as that is usually more used for hex than decimal var s = b.toString(10); bytesArr.push(s); } }); var bytesData = bytesArr.join(" "); var textData = textArr.join(""); if (code === 1 || code === 2) { // bytes and text var len = message.BodyPreview.length; var lenTxt = "" + textArr.length; body = "bytes:\n" + bytesData + "\n\ntext:\n" + textData; message.textMode = "bytes (" + len + " bytes) and text (" + lenTxt + " chars)"; } else { // bytes only var len = message.BodyPreview.length; body = bytesData; message.textMode = "bytes (" + len + " bytes)"; } } return body; } else { message.textMode = "unsupported"; return "Unsupported message body type which cannot be displayed by hawtio"; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowRecipeModalDialog(recipe) {\n\n // Get list of recipe ingredients\n var params = { recipeId: recipe.Id };\n $http.post(\"/Flavor/GetIngredients\", params).success(function(data) {\n\n var ingredients = data;\n\n var modalInstance = $modal.open({\n templateUrl: 'app/vi...
[ "0.6062488", "0.5832763", "0.58152795", "0.581073", "0.5782862", "0.5757095", "0.57422274", "0.57078576", "0.5661147", "0.562069", "0.55974466", "0.5585795", "0.5466677", "0.54657984", "0.5456743", "0.5446964", "0.5442606", "0.54391044", "0.5437678", "0.54154956", "0.5408793"...
0.0
-1
For some reason using ngrepeat in the modal dialog doesn't work so lets just create the HTML in code :)
function createHeaderHtml(message) { var headers = createHeaders(message); var properties = createProperties(message); var headerKeys = _.keys(headers); function sort(a, b) { if (a > b) return 1; if (a < b) return -1; return 0; } var propertiesKeys = _.keys(properties).sort(sort); var jmsHeaders = _.filter(headerKeys, function (key) { return _.startsWith(key, "JMS"); }).sort(sort); var remaining = _.difference(headerKeys, jmsHeaders.concat(propertiesKeys)).sort(sort); var buffer = []; function appendHeader(key) { var value = headers[key]; if (value === null) { value = ''; } buffer.push('<tr><td class="propertyName"><span class="green">Header</span> - ' + key + '</td><td class="property-value">' + value + '</td></tr>'); } function appendProperty(key) { var value = properties[key]; if (value === null) { value = ''; } buffer.push('<tr><td class="propertyName">' + key + '</td><td class="property-value">' + value + '</td></tr>'); } jmsHeaders.forEach(appendHeader); remaining.forEach(appendHeader); propertiesKeys.forEach(appendProperty); return buffer.join("\n"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ShowRecipeModalDialog(recipe) {\n\n // Get list of recipe ingredients\n var params = { recipeId: recipe.Id };\n $http.post(\"/Flavor/GetIngredients\", params).success(function(data) {\n\n var ingredients = data;\n\n var modalInstance = $modal.open({\n templateUrl: 'app/vi...
[ "0.6061549", "0.58335304", "0.58166134", "0.5811624", "0.578494", "0.5757101", "0.5742959", "0.570838", "0.5663189", "0.56211245", "0.5596041", "0.5588401", "0.54677236", "0.5465394", "0.54587", "0.54462504", "0.54451334", "0.5438785", "0.5438256", "0.5418066", "0.5408251", ...
0.0
-1
Fonction 11: Permet d'afficher le planning
function showPlanning() { $('#planning').empty(); let date_Target = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) date_Target.push('0' +parseInt(day+i)+ '/0' +parseInt(month)+ '/' +parseInt(year)); else date_Target.push(parseInt(day+i)+ '/0' +parseInt(month)+ '/' +parseInt(year)); } else { date_Target.push('0' +parseInt(day + i - 30)+ '/0' +parseInt(month+1)+ '/' +parseInt(year)); } } let td_Morning_CLass = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) td_Morning_CLass.push('0' +parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-morning'); else td_Morning_CLass.push(parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-morning'); } else { td_Morning_CLass.push('0' +parseInt(day + i - 30)+ '-0' +parseInt(month+1)+ '-' +parseInt(year)+ '-morning'); } } let td_Afternoon_Class = []; for(let i = 0; i < 7; i++) { if(day+i <= 30) { if(day+i < 10) td_Afternoon_Class.push('0' +parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-afternoon'); else td_Afternoon_Class.push(parseInt(day+i)+ '-0' +parseInt(month)+ '-' +parseInt(year)+ '-afternoon'); } else { td_Afternoon_Class.push('0' +parseInt(day + i - 30)+ '-0' +parseInt(month+1)+ '-' +parseInt(year)+ '-afternoon'); } } let content = ''; content += `<thead> <tr> <th>&nbsp;</th> <th>${date_Target[0]}</th> <th>${date_Target[1]}</th> <th>${date_Target[2]}</th> <th>${date_Target[3]}</th> <th>${date_Target[4]}</th> </tr> </thead> <tbody> <tr> <td>9H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>10H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>11H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>12H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>13H</td> <td class="${td_Morning_CLass[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Morning_CLass[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>14H</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> <tr> <td>15H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>16H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> <tr> <td>17H</td> <td class="${td_Afternoon_Class[0]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[1]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[2]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[3]} tab-cell-hour">&nbsp;</td> <td class="${td_Afternoon_Class[4]} tab-cell-hour">&nbsp;</td> </tr> </tbody>` $('#planning').append(content); setTimeout(() => { showCLassroom(class_Selected); }, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculatePlan() {\n // Check if user left the minutes blank\n if (minutes) {\n // Find fee value to origin from destiny\n const getFee = values.find(value => value.origem === origin && value.destino === destiny);\n\n if (getFee) {\n\n // Calcul...
[ "0.6230617", "0.6217203", "0.6105719", "0.6037342", "0.5989817", "0.5837272", "0.578146", "0.56761444", "0.5604932", "0.5590402", "0.55792296", "0.557561", "0.55262077", "0.55132383", "0.5490316", "0.5415217", "0.53922755", "0.5374338", "0.5330806", "0.53258115", "0.5320576",...
0.49583286
76