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
depois de usado tem de impedir de voltarem a ser utilizados
function limpaSpecialMove(geral) { var x = document.getElementsByClassName(geral); console.log(geral); for (i = 0; i < x.length; i++) { x[i].removeAttribute("draggable"); x[i].removeAttribute("ondragstart"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma +...
[ "0.6239655", "0.6164226", "0.6116465", "0.5959962", "0.5827015", "0.5762625", "0.5755505", "0.5722409", "0.5699861", "0.56917316", "0.56495553", "0.5625128", "0.56198734", "0.56167364", "0.5603512", "0.5599001", "0.55779546", "0.55660915", "0.5558837", "0.55440336", "0.550928...
0.0
-1
! vuerouter v3.0.2 (c) 2018 Evan You
function r(t,e){0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "func...
[ "0.6041203", "0.591867", "0.58457327", "0.5758167", "0.571459", "0.56624407", "0.56578577", "0.5578006", "0.55512494", "0.55378485", "0.552993", "0.5529661", "0.55273634", "0.55263674", "0.54905117", "0.5463575", "0.5449456", "0.5441796", "0.54373884", "0.5417787", "0.5402836...
0.0
-1
resolve dependencies, load, then execute in correct sequence
get(name) { if (!(name in this.resources)) { return Promise.reject(name); } // construct dependency chain let dependencies = [name]; let queue = [name]; while (queue.length > 0) { const next = queue.pop(); const deps = this.resources[next].dependencies.filter(name => !de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSequence() {\n var _args = arguments;\n return {\n deps: ['$ocLazyLoad', '$q',\n\t\t\tfunction ($ocLL, $q) {\n\t\t\t var promise = $q.when(1);\n\t\t\t for (var i = 0, len = _args.length; i < len; i++) {\n\t\t\t promise = promiseThen(_args[i]);\n\t\t\t }\n\t\t\t...
[ "0.6752594", "0.6752594", "0.67407495", "0.67407495", "0.67407495", "0.67407495", "0.67330706", "0.67208916", "0.67058307", "0.6597811", "0.65470827", "0.6467815", "0.63167995", "0.62828064", "0.6268045", "0.6255909", "0.61918", "0.61426955", "0.60926384", "0.6077173", "0.607...
0.5444089
59
load single resource and save a promise
loadResource(name) { if (!(name in this.resources)) { return Promise.reject(name); } const resource = this.resources[name]; if (resource.promise) { return resource.promise; } if (!(resource.type in this.loaders)) { return Promise.resolve(name); } const loader =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async load () {}", "load() {\n this._cache = {}\n return new Promise((resolve, reject) => {\n this._store.exists(this.filename, (err, exists) => {\n if (err || !exists) {\n return resolve()\n }\n\n this._lock(this.filename, (release) => {\n pull(\n thi...
[ "0.66629833", "0.64358723", "0.6234335", "0.61345255", "0.6084053", "0.5899838", "0.5874196", "0.5795473", "0.5756126", "0.5739428", "0.57309633", "0.57309633", "0.5725687", "0.5725182", "0.57227486", "0.57105607", "0.5709229", "0.570867", "0.5679894", "0.566713", "0.5650922"...
0.68762743
0
2) /var caixa_azul = document.getElementById('caixa_azul').innerHTML; var resultado = (9 caixa_azul / 5) + 32; console.log(resultado); document.getElementById('caixa_amarela').innerHTML = resultado; corrigindo
function celsiusToFah(temp_c) { var temp_f = (9 * temp_c / 5) + 32; return temp_f }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calcular() {\r\n console.log(\"SUMA: \" + (6 + 6));\r\n console.log(\"RESTA: \" + (6 - 6));\r\n console.log(\"MULTIPLICACIÓN: \" + (6 * 6));\r\n console.log(\"DIVISIÓN: \" + (6 / 6));\r\n}", "function division()\n{\n var simple_Math = 48 / 6;\n document. getElementById(\"Math\").innerH...
[ "0.75616294", "0.720692", "0.70164984", "0.6994524", "0.6989868", "0.69314414", "0.69276434", "0.68538475", "0.6834505", "0.68268555", "0.68194526", "0.68017954", "0.6797902", "0.6789241", "0.67542815", "0.67433643", "0.67388445", "0.6727068", "0.6712983", "0.6694914", "0.669...
0.0
-1
Called once when the scroll position gets within onEndReachedThreshold of the rendered content.
constructor(props) { super(props); this.onEndReached = this.onEndReached.bind(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reachScrollEnd({ contentOffset, contentSize }) {\n if (contentOffset.y >= contentSize.height) {\n this.setState({ scrollY: -10 });\n } else {\n this.setState({ scrollY: this.state.scrollY + 1 });\n }\n }", "handleScrollEnd(e) {\n const el = e.target;\n if (this.container === window) {\n...
[ "0.69418025", "0.69081783", "0.66622436", "0.6621163", "0.6606542", "0.659289", "0.6585727", "0.6558105", "0.65458584", "0.6544634", "0.6544634", "0.6477163", "0.64585865", "0.6440398", "0.64403903", "0.641531", "0.6409422", "0.63827825", "0.6296369", "0.6234633", "0.6205605"...
0.5670997
64
Called if canLoad is true and loading is done.
onEndReached() { if (this.props.canLoad && !this.props.isLoading) { this.props.onLoad(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function loadComplete() {\n\thasLoaded = true;\n}", "function load() {\n if (!loaded) {\n loaded = true;\n\n callback();\n }\n }", "function loadDone() {\n ...
[ "0.77438647", "0.7498882", "0.72962224", "0.7260952", "0.70405203", "0.68886435", "0.6833051", "0.6812882", "0.6772625", "0.67538255", "0.6723998", "0.6721942", "0.66484064", "0.66241556", "0.65930617", "0.65919757", "0.6504963", "0.65029466", "0.64230424", "0.64155", "0.6413...
0.0
-1
Renders a FlatList with props.
render() { return ( <FlatList {...this.props} onRefresh={this.props.onRefresh} data={this.props.data} renderItem={this.props.renderRow} onEndReached={this.onEndReached} refreshing={this.props.refreshing} onEndReachedThreshold={0.2} ListFooterComp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "render() {\n const listSettings = {\n data: this.props.items,\n extraData: this.state.activeRow,\n keyExtractor: (item) => item.taskId,\n renderItem: ({ item, index }) => this._renderListItem(item, index)\n };\n return (\n <View style={[st...
[ "0.7202257", "0.70873106", "0.70541346", "0.69272506", "0.6877044", "0.6610643", "0.66030484", "0.6602702", "0.6563132", "0.6553796", "0.65132725", "0.6507952", "0.65058196", "0.6488875", "0.64737636", "0.64538956", "0.6409977", "0.6392194", "0.6329595", "0.6328848", "0.63239...
0.6916532
4
You just returned home to find your mansion has been robbed! Given an object of the stolen items, return the total amount of the burglary (number). If nothing was robbed, return the string "Lucky you!".
function calculateLosses(obj) { if (Object.keys(obj).length < 1){ return "Lucky you!" } let sum = 0; for(let i in obj){ sum += obj[i] } return sum; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function h_getRobbed()\n{\n\tvar robberyFactor = h_getRandomInt(10,90); // calculate the percentage player will loose while being robbed\n\n\t// calculate money stolen\n\tvar stolen = Math.round(cash / 100 * robberyFactor);\n\tcash = cash - stolen; \n\t\t\t\t\n\tvar n = noty({text: '<p><i class=\"fa fa-qq\"></i> R...
[ "0.657897", "0.6357304", "0.6342258", "0.57777846", "0.57605356", "0.57307893", "0.571677", "0.56989986", "0.56906533", "0.5676066", "0.5671964", "0.5665669", "0.5664225", "0.5659312", "0.5657678", "0.5638369", "0.5615599", "0.5614942", "0.5613777", "0.56077373", "0.55984527"...
0.62359715
3
Matching the brackets in the input Expression
matchBrackets() { const inputLength = this.inputExpression.length; for (let i = 0; i < inputLength; i++) { const char = this.inputExpression.charAt(i); switch (char) { case "(": case "[": case "{": this.stack.push(char); break; case "]": ca...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static demo() {\n let bracketMatch = new BracketMatch(`{a+(c+d)-b}`);\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n\n bracketMatch.setExpression(`{a+9-(c+d-e+[a+b)}`); //un-even closing\n bracketMatch.matchBrackets();\n bracketMatch.displayResult();\n\n bracketMatch.setExpr...
[ "0.71026874", "0.6777201", "0.66792625", "0.65789884", "0.6481527", "0.64457273", "0.6407865", "0.6407865", "0.6333585", "0.6285605", "0.6178893", "0.60961", "0.60643554", "0.6046369", "0.600877", "0.5949493", "0.59129953", "0.58578527", "0.58319306", "0.5821768", "0.5773233"...
0.7186299
0
Showing the result of the comparsion for the inputExpression
displayResult() { if (this.isExpressionValid) { console.log(`\n${this.inputExpression} : Expression is perfect !!!`); } else { console.log(this.errorCode); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function operatorFunction(e) {\n if(result != \"\") {\n expression = result;\n document.querySelector('#expression').innerHTML = expression;\n document.querySelector('#result').innerHTML = \"\";\n }\n expression += e.target.value;\n document.querySelector('#expression').innerHTML = expression;\n}", ...
[ "0.64520377", "0.6344434", "0.62504405", "0.6113085", "0.603526", "0.5989588", "0.5843819", "0.58287644", "0.58152735", "0.5775271", "0.5728536", "0.5682734", "0.56715226", "0.5651728", "0.56492823", "0.5586862", "0.5554168", "0.55467844", "0.549381", "0.5490237", "0.54793197...
0.6987545
0
Function to demo the usage of the program.
static demo() { let bracketMatch = new BracketMatch(`{a+(c+d)-b}`); bracketMatch.matchBrackets(); bracketMatch.displayResult(); bracketMatch.setExpression(`{a+9-(c+d-e+[a+b)}`); //un-even closing bracketMatch.matchBrackets(); bracketMatch.displayResult(); bracketMatch.setExpression(`{a+9-(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n\tvar docs;\n\n\tdebug( 'Generating REPL help documentation.' );\n\tcreateHelp();\n\n\tdebug( 'Loading REPL help documentation.' );\n\tdocs = require( HELP_OUTPUT );\n\n\tdebug( 'Generating REPL examples.' );\n\tcreateExamples( docs );\n} // end FUNCTION main()", "function Main()\n {\n ...
[ "0.74712557", "0.6928316", "0.69134223", "0.6901949", "0.6801511", "0.67740417", "0.67437595", "0.6728331", "0.6710527", "0.6696957", "0.6695291", "0.6682778", "0.6664797", "0.6656612", "0.65801936", "0.6468011", "0.64392465", "0.64352", "0.64060795", "0.6372928", "0.6359509"...
0.0
-1
Fetch group data from server
fetchFirst(group_id) { console.log("Group Id: "+group_id); var that = this; fetch('http://fcnaija.com/world-cup-2018/display-standings?group_id='+group_id).then(function (response) { return response.json(); }).then(function (result) { console.log(JSON.stringify(result)); that...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "fetchGroups() {\n this.fetchData({type: \"FETCH_GROUPS\"})\n }", "function getData() {\n document.getElementById('widgetBody').innerHTML = 'Requesting groups...';\n var req = opensocial.newDataRequest();\n req.add(req.newFetchPersonRequest(opensocial.IdSpec.PersonId.VIEWER), 'viewer');\n re...
[ "0.7764375", "0.7254359", "0.7177177", "0.6914336", "0.6867764", "0.68330926", "0.6764032", "0.6688762", "0.6638615", "0.65536827", "0.64732075", "0.6468461", "0.64413345", "0.6436041", "0.6424057", "0.63035864", "0.62879115", "0.62838435", "0.62808627", "0.62571484", "0.6246...
0.5881176
46
Get whether or not a longrunning operation with the provided status is finished.
function isFinished(status) { var result = false; for (var _i = 0, terminalStates_1 = terminalStates; _i < terminalStates_1.length; _i++) { var terminalState = terminalStates_1[_i]; if (longRunningOperationStatesEqual(status, terminalState)) { result = true; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFinished (){\n\t\treturn this.status !== null && this.finishDelay < 0;\n\t}", "isDone() {\n const state = this.operation.state;\n return Boolean(state.isCompleted || state.isCancelled || state.error);\n }", "isDone() {\n const state = this.operation.state;\n return Boolean(stat...
[ "0.6733052", "0.64945847", "0.64945847", "0.64945847", "0.6243577", "0.62384015", "0.58947855", "0.5804101", "0.5804101", "0.56445384", "0.56378627", "0.5635436", "0.55664575", "0.5537487", "0.544351", "0.5394632", "0.5377829", "0.53743917", "0.53743917", "0.5371833", "0.5353...
0.83034056
0
Create a new longrunning operation polling strategy based on the provided initial response.
function createLROPollStrategyFromInitialResponse(initialResponse, azureServiceClient, options) { var initialRequestMethod = initialResponse.request.method; var initialResponseStatus = initialResponse.status; var lroPollStrategyType; if (getAzureAsyncOperationHeaderValue(initialResponse)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LROPoller(_lroPollStrategy, _initialResponse) {\n this._lroPollStrategy = _lroPollStrategy;\n this._initialResponse = _initialResponse;\n }", "function LROPoller(_lroPollStrategy, _initialResponse) {\n this._lroPollStrategy = _lroPollStrategy;\n this._initialRespon...
[ "0.6714945", "0.66421366", "0.65900564", "0.6576402", "0.60958165", "0.6086386", "0.5849884", "0.54467005", "0.54453385", "0.5433263", "0.5386771", "0.5371336", "0.5269713", "0.5135185", "0.5074497", "0.5062776", "0.5005199", "0.5005199", "0.5003738", "0.49612385", "0.4961238...
0.7484284
0
Create a new HttpLongRunningOperationResponse.
function LROPoller(_lroPollStrategy, _initialResponse) { this._lroPollStrategy = _lroPollStrategy; this._initialResponse = _initialResponse; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(contentLength, options) {\n const operationArguments = {\n contentLength,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, createOperationSpec);\n }", "create(...
[ "0.5115175", "0.5115175", "0.5112638", "0.51082695", "0.49278164", "0.49278164", "0.49170938", "0.4857552", "0.4844711", "0.47060773", "0.47060773", "0.46725526", "0.46603587", "0.46603587", "0.46100762", "0.4609301", "0.46082786", "0.4591583", "0.4591583", "0.45066", "0.4497...
0.4030572
55
(c) copyright 2007 VOIPTEL Pty Ltd NOT FOR EXTERNAL DISTRIBUTION // // services_view.js DEPRICATED (i think) // services_view javascript required of the "View Services" popup webpage javascript required of the "View Services" popup webpage
function VixenServicesViewClass() { //------------------------------------------------------------------------// // ViewServicesPopupOnClose //------------------------------------------------------------------------// /** * ViewServicesPopupOnClose * * Event handler for when the Plan Type is chosen from the S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ss$st$companyIntroductionControllerBase$openMain(json){\n //No javascript because of invoking the native common services\n}", "function ss$st$companyIntroductionControllerBase$openLinkus(json){\n //No javascript because of invoking the native common services\n}", "function ss$st$companyIntroduct...
[ "0.615129", "0.60017794", "0.59351575", "0.5872201", "0.5866241", "0.5797377", "0.575673", "0.5729619", "0.5684729", "0.56725556", "0.5665576", "0.56612676", "0.56509256", "0.56403375", "0.5614662", "0.55908346", "0.5584979", "0.5562319", "0.5556748", "0.55410236", "0.5529226...
0.6707273
0
Closes all bindings bound to this target.
closeBindings() { this.receiver_.closeBindings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeAll() {\n const that = this;\n\n for (var i = that._instances.length - 1; i > -1; i--) {\n that._close(that._instances[i]);\n }\n }", "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "closeAll() {\n this._openCloseAll...
[ "0.6069587", "0.5819686", "0.5806918", "0.570552", "0.570552", "0.570552", "0.56997365", "0.56138694", "0.5567803", "0.55507576", "0.54947907", "0.5461576", "0.54578936", "0.5346361", "0.53117305", "0.5296039", "0.5288017", "0.5268888", "0.52384394", "0.5219447", "0.5173908",...
0.7126526
23
Closes all bindings bound to this receiver. The receiver will not receive any further message message events unless rebound to one or more handles.
closeBindings() { this.receiver_.closeBindings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "close() {\n this._observers = undefined;\n if (this.notificationQueue != null) {\n // Cancel the notification iterator\n this.notificationQueue.return(undefined).catch(err => {\n ...
[ "0.592188", "0.5649651", "0.5629311", "0.55395794", "0.5504551", "0.5464201", "0.5443901", "0.5423628", "0.5423628", "0.5397746", "0.5357902", "0.53573686", "0.53453636", "0.53013736", "0.5237525", "0.52205145", "0.5218774", "0.5193902", "0.5149887", "0.5149887", "0.5149887",...
0.7872318
22
Closes all bindings bound to this target.
closeBindings() { this.receiver_.closeBindings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closeAll() {\n const that = this;\n\n for (var i = that._instances.length - 1; i > -1; i--) {\n that._close(that._instances[i]);\n }\n }", "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "closeAll() {\n this._openCloseAll...
[ "0.60705835", "0.58204263", "0.5808478", "0.57070166", "0.57070166", "0.57070166", "0.5705652", "0.5615122", "0.5567445", "0.55536616", "0.5498338", "0.5461992", "0.54584247", "0.534893", "0.5312128", "0.53005004", "0.5288806", "0.5271684", "0.52393824", "0.5219138", "0.51731...
0.7126728
21
Closes all bindings bound to this receiver. The receiver will not receive any further message message events unless rebound to one or more handles.
closeBindings() { this.receiver_.closeBindings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sockCloseAll() {\n Object.keys( this._socks ).forEach( id => this.sockClose( id ) );\n }", "close() {\n this._observers = undefined;\n if (this.notificationQueue != null) {\n // Cancel the notification iterator\n this.notificationQueue.return(undefined).catch(err => {\n ...
[ "0.5919191", "0.56499773", "0.56282604", "0.5539359", "0.5501707", "0.54641473", "0.54441947", "0.5420794", "0.5420794", "0.5396902", "0.5357671", "0.5356033", "0.5341831", "0.53009844", "0.5236341", "0.5220423", "0.52174854", "0.51925457", "0.5150276", "0.5150276", "0.515027...
0.7869766
20
================= Getters and setters =================
get actions() { return [MenuAction.SELECT]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get value(){ return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._value; }", "get value() { return this._va...
[ "0.66452", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6583561", "0.6421629", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.64156675", "0.641566...
0.0
-1
================= General methods =================
asRootNode() { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "protected internal function m252() {}", "function _____SHARED_functi...
[ "0.6760054", "0.6601536", "0.65407234", "0.6536182", "0.6457684", "0.64444643", "0.6238936", "0.61986417", "0.6112665", "0.61116594", "0.5989445", "0.59867644", "0.595987", "0.5936309", "0.5922873", "0.5919439", "0.5917105", "0.59050083", "0.5877499", "0.5843704", "0.5839561"...
0.0
-1
================= Debug methods =================
debugString(wholeTree, prefix = '', currentNode = null) { if (!this.automationNode) { return 'BackButtonNode'; } return super.debugString(wholeTree, prefix, currentNode); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "debug() {}", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "function debug(v){return false;}", "function devDebug(){\n\n}", "printDebugLog() {\n this.printMemoryForDebug(this.memory, this.pointer);\n console.debug(`pointer is at ${this.pointer}`);\n console.debug(`relative base is ${t...
[ "0.75550556", "0.7318266", "0.7242892", "0.7101538", "0.6964359", "0.6735203", "0.6713395", "0.6705481", "0.66966313", "0.6657326", "0.66406405", "0.66331846", "0.662134", "0.66123545", "0.6597287", "0.6595891", "0.6575424", "0.6566273", "0.6563316", "0.656016", "0.6545706", ...
0.0
-1
================= Static methods ================= Looks for the back button automation node.
static findAutomationNode_() { if (BackButtonNode.automationNode_ && BackButtonNode.automationNode_.role) { return; } SwitchAccess.findNodeMatching( { role: chrome.automation.RoleType.BUTTON, attributes: {className: 'SwitchAccessBackButtonView'}, }, BackButt...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get backButton() {return browser.element(\"//android.view.ViewGroup/android.view.ViewGroup/android.widget.Button\");}", "get backButton() {return browser.element(\"//android.widget.Button/android.view.ViewGroup/android.widget.ImageView\");}", "function back_button() {\r\n let btn = document.createElemen...
[ "0.7555738", "0.70795727", "0.6792896", "0.66986287", "0.6654422", "0.62713176", "0.61853445", "0.59843427", "0.5973348", "0.5896681", "0.588814", "0.5849308", "0.5827115", "0.58249205", "0.5815518", "0.58104616", "0.58104616", "0.57922214", "0.5755866", "0.5754092", "0.57180...
0.8093481
0
This function defines the behavior that should be taken when the back button is pressed.
static onClick_() { if (MenuManager.isMenuOpen()) { ActionManager.exitCurrentMenu(); } else { Navigator.byItem.exitGroupUnconditionally(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleBackAction() {\n this._triggerOnBack();\n }", "function onBack() {\n resetPageState();\n }", "function onBackKeyDown() {\n goBack();\n}", "function onBackKeyDown() {\n\t//alert(\"Back Pressed\");\n\tgo_back();\n}", "function onBackKey(){\n\tif(app.session.data.extra_prev_state > 0){\...
[ "0.80558693", "0.7876286", "0.78174007", "0.7769245", "0.775537", "0.77104014", "0.761865", "0.75815946", "0.75499463", "0.7508463", "0.7488301", "0.7480487", "0.74474025", "0.743134", "0.7395281", "0.7390634", "0.73811257", "0.73797727", "0.73747605", "0.73747605", "0.737476...
0.0
-1
STUFF FOR AUDIO ANALYSIS
function FourierTransform(bufferSize, sampleRate) { this.bufferSize = bufferSize; this.sampleRate = sampleRate; this.bandwidth = bufferSize * sampleRate; this.spectrum = new Float32Array(bufferSize/2); this.real = new Float32Array(bufferSize); this.imag = new Float32Array(bufferSize); this...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addAudio(obj)\n{\n var desc = '';\n var artist_full;\n var album_full;\n\tvar extension;\n\tvar albumartist;\n \n // first gather data\n var title = obj.meta[M_TITLE];\n if (!title) title = obj.title;\n \n \t// Grab artist, if emtpy, mark as unknown\n var artist = obj.meta[M_AR...
[ "0.6662047", "0.6637056", "0.65168756", "0.6516521", "0.64639896", "0.6410975", "0.636453", "0.63233453", "0.62891567", "0.62539226", "0.6241064", "0.62304276", "0.62066627", "0.61999166", "0.6189929", "0.61701816", "0.61642045", "0.6149509", "0.6148426", "0.6141914", "0.6104...
0.0
-1
Show the notification base on the count of movies
function showNotifications(movies) { chrome.browserAction.setBadgeText({text: `${movies.length}`}); //If movies more than 5 notify as list if(movies.length>5) { let moviesList = movies.map((movie) =>{ let genres = movie.genres ? `[${movie.genres.join(' / ')}]`: ''; return { title:movie.title_lon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countMovies(){\r\n return movies.length\r\n}", "function countMovies(){\n return movies.length\n}", "function howManyMovies (movies) {\n \n}", "function howManyMovies(collection){\n var filterMovies;\n if(collection === undefined || collection.length === 0){\n return undefined;\n }\n e...
[ "0.67652655", "0.6691467", "0.62087864", "0.6059234", "0.6047462", "0.6018877", "0.60179967", "0.59564877", "0.59561574", "0.59527737", "0.59382993", "0.5906724", "0.59057087", "0.5898051", "0.58749646", "0.5867382", "0.5849811", "0.5841811", "0.58372915", "0.5836732", "0.582...
0.6353954
2
clear the form after updating the data
componentWillUnmount() { this.props.clearCurrentTarget(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clear_form_data() {\n $(\"#product_id\").val('');\n $(\"#rec_product_id\").val('');\n $(\"#rec_type_id\").val('1');\n $(\"#weight_id\").val('');\n }", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n i...
[ "0.77810526", "0.775781", "0.7678199", "0.76684535", "0.76571363", "0.76517653", "0.7627889", "0.7620736", "0.7601388", "0.75915575", "0.7558809", "0.7549644", "0.75453603", "0.751818", "0.74715537", "0.7450648", "0.7416801", "0.740949", "0.7393977", "0.7388108", "0.73848504"...
0.0
-1
mount the rider component
async componentDidMount() { await this.props.getRiderById( this.props.location.state && this.props.location.state.id, this.props.token ); logger.info("Individual Rider data", this.props.status); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mount() {\n this.willMount();\n this.render();\n this.didMount();\n }", "function mount() {\n if (!_html) {\n throw new Error('Component ' + _id + ' cannot mount with no HTML. Call render() first');\n }\n\n if (this.viewWillMount) {\n this.viewWillMount();\n ...
[ "0.7079936", "0.65324986", "0.6495256", "0.64667225", "0.6273561", "0.6243981", "0.6194717", "0.6173679", "0.6138297", "0.6110949", "0.6098295", "0.6096631", "0.6087864", "0.60783523", "0.6062289", "0.6053652", "0.60494953", "0.60387623", "0.59945315", "0.5984817", "0.5973930...
0.0
-1
ajouter life et weapon
constructor(number, damages, x, y, src, game, map, weaponName, life, isDefending) { this.number = number; this.damages = damages; this.x = x; this.y = y; this.src = src; this.game = game; this.map = map; this.weaponName = weaponName; this.life = li...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TakeWeapon() {\n this._on_cooldown = true\n this._PaintSpawn()\n this._last_use = Date.now()\n }", "equipWeapon(name) {\n const weapon = name || \"fists\"\n this.equippedWeapon = Item.create(weapon)\n\n if (this.stored.weapon && this.stored.weapon !== \"fists\") {\n this.loot(this.stored....
[ "0.7005743", "0.6543455", "0.64534", "0.6361897", "0.6357904", "0.6246824", "0.6221456", "0.6208315", "0.6183061", "0.61519426", "0.6112098", "0.6111817", "0.60499084", "0.604888", "0.60416967", "0.60188603", "0.59984165", "0.5997549", "0.5993174", "0.5980159", "0.5959802", ...
0.0
-1
when a player moved
updatePlayerPosition(player, newPos) { //7-1 const x = parseInt(newPos.charAt(0)); const y = parseInt(newPos.charAt(newPos.length - 1)); player.x = x; player.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function playerMoved() {\n _hasPlayerMoved = true;\n }", "function onPlayerMove(id, position) {\n\taoi_st.update(id, position.x, position.y);\n}", "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "function move() {\n movingPlayer = true;\n}", "function playerMoving() {\n conso...
[ "0.8351734", "0.7586339", "0.7562477", "0.74872375", "0.73878384", "0.73661834", "0.7361155", "0.7139739", "0.70693237", "0.7064562", "0.7043072", "0.7017743", "0.7013995", "0.6987326", "0.6980079", "0.69304293", "0.68916786", "0.68743247", "0.68411744", "0.6835374", "0.68268...
0.6540678
53
change the state of the player
defense() { this.isDefending = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changePlayer() {\n if (this._currentPlayer == 'X') {\n this._currentPlayer = 'Y'; \n } else {\n this._currentPlayer = 'X'; \n }\n }", "playerStateChanged(playerCurrentState) {\n // console.log('player current update state', playerCurrentState)\n }", "functi...
[ "0.74932504", "0.748594", "0.7464536", "0.7366601", "0.73497975", "0.7202023", "0.7158005", "0.70524466", "0.70381635", "0.6966252", "0.6961961", "0.6955169", "0.6951537", "0.69429624", "0.689979", "0.68964815", "0.6888304", "0.6878866", "0.6877257", "0.6871321", "0.6859479",...
0.0
-1
updating player life according to the equipped weapon and the opponent isDefending attribute
attack() { const userWeaponNameInFrench = this.map.weapons[this.weaponName].nameFR; this.game.textToPrompt = `Votre attaque grâce à votre ${userWeaponNameInFrench} fait <b>${this.damages} de dégâts</b> sur l'adversaire`; if (this.number === 2) { //P2 const player1 = this.game.player...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equipWeapon(newWeapon){\n player.attack.base -= items.weapons[equipped.weapon].attack.base;\n player.attack.multiplier -= items.weapons[equipped.weapon].attack.multiplier;\n player.attack.plusser -= items.weapons[equipped.weapon].attack.plusser;\n\n equipped.weapon = newWeapon;\n\n player.attack.base...
[ "0.6850933", "0.65845406", "0.65820855", "0.65803665", "0.6480915", "0.64750236", "0.64314085", "0.64239925", "0.63798887", "0.6351261", "0.63025117", "0.62594056", "0.62388897", "0.6203253", "0.6188267", "0.61831874", "0.61761737", "0.6169785", "0.6168593", "0.61532485", "0....
0.6566852
4
Method Sphere Parameters radius, stacks, slices Calculate vertices on the slices for each stack
function Sphere(radius, stacks, slices){ var stackAngle = 180.0 / stacks; var degree = 360.0 / slices; var currentRadius; var vertices = []; var allStackVertices = []; //Duplicate vertices for starting point of cube var firstPath = []; for (var i = 0; i < slices; i++ ) { var x, y, z; x = 0; y ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeSphere (slices, stacks) {\n // fill in your code here.\n var sliceDivision = radians(360) / slices;\n var stackDivision = radians(180) / stacks;\n var radius = 0.5;\n\n for (var longitude = 0; longitude < radians(360); longitude += sliceDivision) {\n for (var latitude = 0; latitu...
[ "0.76373196", "0.756944", "0.70497024", "0.6725074", "0.6551309", "0.64975625", "0.63998216", "0.63120073", "0.63091725", "0.62313735", "0.6175707", "0.6160452", "0.61095613", "0.6008509", "0.60068244", "0.5933361", "0.5904645", "0.5896285", "0.5891726", "0.5891365", "0.58895...
0.86960316
0
Method Donut Parameters radius, stacks, slices Calculate vertices to create a tyre
function Donut(radius, stacks, slices){ var stackAngle = 180 / stacks; var degree = 360.0 / slices; var currentRadius; var vertices = []; var allStackVertices = []; for (var j = 1; j < stacks; j++){ var y; var angle = stackAngle * j; currentRadius = Math.sin(degreeToRadian(angle)) * radi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor({ numberOfSlices = 20, radius = 1.0, height = 1.0 }) {\n super();\n /* Points 0, 1, 2, ..., N-1 are on the base circle */\n for (let k = 0; k < numberOfSlices; k++) {\n const angle = (k / numberOfSlices) * 2 * Math.PI;\n const xVal = radius * Math.cos(angle);\n const yVal = radi...
[ "0.6735192", "0.63540107", "0.635203", "0.63152057", "0.62435585", "0.61127555", "0.6002339", "0.5967074", "0.5953997", "0.5929249", "0.58864045", "0.58678156", "0.5709155", "0.56628853", "0.5662598", "0.56462973", "0.5626819", "0.5575931", "0.5565056", "0.55387145", "0.55287...
0.7717728
0
UCSV v1.1.0 Provided under MIT License. Copyright 20102012, Peter Johnson
function arrayofcsvToArrayofArrays(arrayofcsv) { var INITARRAY = [[]]; var arrayofArrays = [[]]; if (typeof(arrayofcsv) != 'undefined') { for(var i=0; i<arrayofcsv.length; i++) { if (typeof(arrayofcsv[i]) === 'string') { arrayofArrays[i] = CSV.csvToArray(arrayofcsv[i])[0]; }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCSVString() {\n let data = this.getDataSummary();\n this.sortStore();\n let rtn = \"Year,Session,Code,Name,Units\\n\";\n this.store.years.forEach(year => {\n year.sessions.forEach(session => {\n session.courses.forEach(course => {\n let da...
[ "0.6592131", "0.6542084", "0.653958", "0.6472127", "0.6442804", "0.636897", "0.6363244", "0.6307001", "0.6304878", "0.629499", "0.6270337", "0.6227951", "0.622415", "0.62194705", "0.6218462", "0.62169236", "0.6176772", "0.6170249", "0.61552125", "0.61454976", "0.6126183", "...
0.0
-1
autor: Grzegorz RUMATOWSKI / obliczenia charakterystyk wedle schematu blokowego umieszczonego w pracy
function obliczPunkty(dane) { var ro = 1.21; // gęstośc czynnika var stosunek_et = [0.86, 0.98, 1, 0.966, 0.86]; // stosunek sprawności izentropowych var mi0 = (1 - (Math.sqrt(Math.sin(dane.beta2 * (Math.PI / 180))) / (Math.pow(dane.z, 0.7)))).toPrecision(3); // współczynnik zmniejszenia mocy wentylatora ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function graczOberwal() {\r\n\r\n\t\t\t\t//zabieranie rebulla:\r\n\t\t\t\tif (DD_predkoscPocztkowaGracza >= 250) {\r\n\t\t\t\t\tDD_predkoscPocztkowaGracza -= 125;\r\n\t\t\t\t\tgracz.twoway(DD_predkoscPocztkowaGracza); //redukuj predkosc gracza\r\n\t\t\t\t\tDD_obrazeniaPocikskowGracz -= 0.05; //zredukuj obrazenia z...
[ "0.5866116", "0.5688088", "0.56068355", "0.5555225", "0.55070263", "0.5453567", "0.5434725", "0.5424849", "0.541618", "0.53632915", "0.5358712", "0.53372985", "0.5317349", "0.5312928", "0.5296226", "0.5292683", "0.5263235", "0.5244743", "0.5229985", "0.5221747", "0.5214863", ...
0.5180241
27
remove spaces and special characters
function trimString(string) { return string.toLowerCase().replace(/\s/g, '-').replace(/[.!_&%/:;')(+?,=]/g, ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scrub(txt){\r\n return txt.replace(/[^a-zA-Z ]/g, \"\")\r\n }", "function clean( w ){\n\treturn w.replace(/[^\\d\\w\\s,().\\?\\/\\\\n\\\\t{}<>=\\\"\\\":%-]/gi, '') // remove special chars\n\t\t\t.replace(/\\s+/g, \" \") // remove extra spaces\n\t\t\t.trim(); // remove trailing chars\n...
[ "0.8087957", "0.79667807", "0.7853882", "0.76030487", "0.74686706", "0.7441964", "0.739006", "0.7328111", "0.7271705", "0.7264156", "0.7236726", "0.7230953", "0.72079587", "0.7197276", "0.71761864", "0.716779", "0.7134984", "0.710161", "0.7070268", "0.7064831", "0.69923085", ...
0.0
-1
Functions for the computer
onComputer(player, computer) { //Handling text to help the player if (this.readComputerText == null) { this.readComputerText = this.add.text(this.computer.x, this.computer.y - 130, 'Press S or ↓ to turn ON', { fontSize: '24px', fill: '#41FF00', backgroundColor: '#3b4566', padding: 10, fontFa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayComputer(computer) {\r return computer.cpu+ \" \" + computer.screenSize;\r}", "function displayComputer(computer) {\n // TODO: Your code here\n return computer;\n}", "function computerMediumModeTurn() {\n \n}", "function makeComputer(computers) {\r return {\r \tcpu: '64mb',\r ...
[ "0.6515425", "0.6483729", "0.64558643", "0.59131134", "0.5879957", "0.5856093", "0.58363247", "0.5763124", "0.5755642", "0.5750199", "0.57446367", "0.57292986", "0.571885", "0.5706295", "0.56974566", "0.5693939", "0.56712663", "0.5668312", "0.5654268", "0.5641916", "0.5638833...
0.0
-1
Write the function min (a, b), which returns the smaller of the numbers a, b.
function min(a, b) { return (a < b && a) || b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function min(a,b) {return a < b ? a : b; }", "function min (a, b) {\n return Math.min(a, b);\n}", "function min(a, b) {\n\treturn (a < b) ? a : b;\n}", "function min(a, b) {\n return (a < b) ? a : b;\n}", "function min(a, b) {\n return (a < b) ? a : b;\n}", "function min(a, b) {\n if (a < b)\...
[ "0.89892656", "0.89540076", "0.8945452", "0.89438915", "0.89438915", "0.8908572", "0.8907165", "0.88827175", "0.88827175", "0.88827175", "0.88374406", "0.88374406", "0.88340807", "0.88092685", "0.8776118", "0.8776118", "0.8776118", "0.87393624", "0.87029356", "0.86771536", "0...
0.84979343
21
Write the function fib (n), which returns the nth Fibonacci number.
function fib(n) { if (n < 2) { return n; } return fib(n - 1) + fib(n - 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fib(n) {\n\t// Write code here\n}", "function fib(n) {\n \n}", "function nthFib(n) {\n if (n === 1) return 0;\n if (n === 2) return 1;\n if (n > 2) return fibonacci(n - 1) + fibonacci(n - 2);\n}", "function fib(n) {\r\n if (n <= 2) return 1;\r\n var fibNums = [0, 1, 1];\r\n for (var i = 3; i ...
[ "0.8669499", "0.8661784", "0.8419606", "0.83851373", "0.83222604", "0.83178604", "0.83016306", "0.8296085", "0.8291573", "0.8280161", "0.82723796", "0.8271831", "0.82557535", "0.8250988", "0.82479393", "0.82478946", "0.8246569", "0.8236216", "0.8226966", "0.8199514", "0.81911...
0.82263196
19
Write a function getDecimal (num), which returns the decimal part of the number
function getDecimal(n) { const up = Math.ceil(n); return up - n; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function decimal(num) {\n // convert to a string\n num = '' + num;\n\n // find decimal point\n var dec = num.indexOf('.');\n\n if (dec >= 0) {\n // take out the decimal point\n num = num.replace('.', '');\n var precision = num.length - dec;\n } else {\n var precision =...
[ "0.7898917", "0.7046733", "0.6981986", "0.68786407", "0.67043966", "0.6609459", "0.6510257", "0.6478441", "0.64361054", "0.6309175", "0.62989235", "0.6267867", "0.6261715", "0.6257527", "0.62376565", "0.62376565", "0.6230919", "0.61901623", "0.6176603", "0.6138566", "0.613550...
0.7352445
1
Write the function ucFirst (str), which returns a string str with the first capital letter, for example ucFirst ("abcd") == "Abcd";
function ucFirst(str) { return str.slice(0, 1).toUpperCase() + str.slice(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ucFirst(str) {\n\n }", "function ucFirst(str) {\n if (!str) return str; \n return str[0].toUpperCase() + str.slice(1);\n }", "function ucFirst(str) {\n return str[0].toUpperCase() + str.slice(1);\n}", "function ucFirst(string) {\r\n return string.substring(0, 1).toUpperCase() + string.su...
[ "0.9200941", "0.9191878", "0.9101594", "0.89539564", "0.8776826", "0.8714349", "0.85531944", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "0.84783983", "...
0.9162865
2
Write a function checkSpam (str), which returns true if the string str contains "XXX", and otherwise false. The function must be case insensitive.
function checkSpam(str) { if (str.match(/xxx+/i)) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSpam(str) {\r\n let strToLowerCase = str.toLowerCase();\r\n return strToLowerCase.includes('spam') || strToLowerCase.includes('xxx');\r\n}", "function checkSpam() {\n return function (str) {\n // Check if str parameter is string type.\n if (typeof str === \"string...
[ "0.83725905", "0.78116566", "0.76797694", "0.7584925", "0.7469557", "0.6708133", "0.62359816", "0.6229998", "0.596189", "0.595374", "0.590657", "0.58486813", "0.58486813", "0.5813317", "0.5806215", "0.5803467", "0.5803173", "0.57612896", "0.5743917", "0.5743917", "0.5741483",...
0.8443568
0
Create a function truncate (str, maxlength), which checks the length of the string str, and if it exceeds maxlength replaces the end of str with "...", so that its length becomes maxlength. For example: truncate("Hello World!!!",8) == "Hello..."
function truncate(str, maxlength) { if (str.length >= maxlength) { str = str.slice(0, maxlength - 3); return `${str}...`; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function truncate() {\n return function (str, maxlength) {\n // Maxlength should be less in acording length of \"...\" .\n if (str.length > maxlength - 3) {\n str = str.slice(0, maxlength) + \"...\";\n }\n return str;\n };\n }", "functio...
[ "0.8610756", "0.83048594", "0.8080174", "0.7980685", "0.79742366", "0.79663056", "0.79663056", "0.79663056", "0.7952019", "0.79461265", "0.793214", "0.7889608", "0.78843874", "0.7867326", "0.7845964", "0.7845594", "0.78250253", "0.781786", "0.7739844", "0.77360815", "0.773391...
0.87591803
0
Create the function isEmpty (obj), which returns true if there are no properties in the object and false if there is at least one property.
function isEmpty(obj) { return Object.keys(obj).length === 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _isEmpty(obj) {\n for(var prop in obj) {\n if(obj.hasOwnProperty(prop))\n return false;\n }\n return true;\n }", "function isEmpty(obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) return false;\n }\n\n return true;\n }", ...
[ "0.878781", "0.8739677", "0.8739677", "0.86784995", "0.86673135", "0.8664253", "0.86230636", "0.861523", "0.85840183", "0.85637826", "0.8549758", "0.854368", "0.85192716", "0.85192716", "0.85161716", "0.8513897", "0.8512881", "0.85087854", "0.85047776", "0.8496193", "0.848763...
0.84290516
33
Create the function multiplyNumeric (obj), which takes an object and multiplies all numeric properties by 2.
function multiplyNumeric(obj) { for (let key in obj) { if (typeof obj[key] === "number") { obj[key] *= 2; } } return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiplyNumericPropertiesBy2() {\n // before the call\n let menu = {\n width: 200,\n height: 300,\n title: \"My menu\"\n };\n console.log(menu);\n\n multiplyNumeric(menu);\n\n // after the call\n console.log(menu);\n // menu = {\n // width: 400,\n // height: 600,\n // title: \"My...
[ "0.6542652", "0.61947197", "0.6133213", "0.612485", "0.59923685", "0.5987141", "0.59641856", "0.5954443", "0.5953816", "0.5953816", "0.5952632", "0.59470505", "0.59470505", "0.5945566", "0.59360677", "0.59284455", "0.59284455", "0.59284455", "0.59260947", "0.5908776", "0.5908...
0.85617596
0
Create the function find (arr, value), which searches for value in array and returns its number, if found, or 1 if not found.
function find(arr, value) { for (let i = 0; i < arr.length; i++) { if (arr[i] === value) { return value; } } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find() {\n return function (arr, value) {\n var len = arr.length,\n i;\n for (i = 0; i < len; i += 1) {\n if (arr[i] === value) {\n return i;\n }\n }\n return -1;\n };\n }", "func...
[ "0.8533683", "0.8289567", "0.8151385", "0.7979616", "0.7836011", "0.78341675", "0.7808919", "0.7801465", "0.7792935", "0.77236193", "0.7654751", "0.7611334", "0.7602225", "0.7568559", "0.75331783", "0.74249923", "0.7414533", "0.74120843", "0.74084383", "0.7394406", "0.7385656...
0.83598316
1
Create a function filterRange (arr, a, b) that takes an array of numbers arr and returns a new array that contains only numbers from the arr range from a to b. The function should not change the arr.
function filterRange(arr, a, b) { const newArr = arr.filter(item => item >= a && item <= b); return newArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterRange(){\n return function(arr, a, b){\n return arr.filter(function(value){\n return value >= a && value <= b;\n });\n }\n }", "function filerRange(arr, a, b) {\n\n let arr2 = arr.slice();\n return arr2.filter(item => (a <= item && item <...
[ "0.885331", "0.8821181", "0.83173984", "0.8267757", "0.8151882", "0.79354644", "0.76867574", "0.7674512", "0.7561035", "0.75453615", "0.7393646", "0.7206397", "0.71579975", "0.6985114", "0.68098056", "0.6733282", "0.660834", "0.6583492", "0.656183", "0.6514911", "0.64688385",...
0.90233344
0
Write the function camelize (str), which converts lines of the form "myshortstring" to "myShortString".
function camelize(str) { const arr = str.split("-"); const newArr = arr.map((item, i) => { return (item = i !== 0 ? item.slice(0, 1).toUpperCase() + item.slice(1) : item); }); return newArr.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function camelize(str) {\r\n var rmv = str.split('-');\r\n for (var i = 0; i < rmv.length; i++) {\r\n rmv[i] = rmv[i].charAt(0).toUpperCase() + rmv[i].slice(1);\r\n }\r\n return rmv.join('');\r\n}", "function camelize(str) {\n var wordParts = str.split('-');\n var newString = wordParts[0...
[ "0.66208583", "0.6583564", "0.65783376", "0.6534402", "0.6523303", "0.6475203", "0.64589554", "0.64538187", "0.64451385", "0.64451385", "0.6434564", "0.6410445", "0.64023453", "0.6387467", "0.63744897", "0.6362341", "0.63191646", "0.63016653", "0.62701017", "0.62081647", "0.6...
0.62328273
19
Use the sort function to "shake" the array elements in random order. arr.sort ("your function")
function shake(arr) { return arr.sort(() => Math.random() - 0.5); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shuffle(array) {\n array.sort(() => Math.random()-0.5);\n console.log(array);\n}", "shuffleArray (arr) {\n\t return arr\n\t\t\t .map(a => [Math.random(), a])\n\t\t\t .sort((a, b) => a[0] - b[0])\n\t\t\t .map(a => a[1]);\n\t}", "function randomize( array ){\n return array.sort( funct...
[ "0.7871647", "0.78552777", "0.7775266", "0.77310014", "0.7726237", "0.7697688", "0.76677537", "0.76594096", "0.76114905", "0.75904304", "0.75030816", "0.74385303", "0.74037886", "0.73897004", "0.73874617", "0.73775405", "0.73737544", "0.7339732", "0.73100024", "0.7262686", "0...
0.75173736
10
Write a function getSums (arr), which returns a new array of the same number of elements, in which at each position there must be a sum of elements arr to this position inclusive. arr = [1,2,3,4,5]; getSums( arr ) = [ 1, 1+2, 1+2+3, 1+2+3+4, 1+2+3+4+5 ] = [ 1, 3, 6, 10, 15 ]
function getSums(arr) { const newArr = arr.map((item, i) => { let j = i, sum = 0; while (j > 0) { sum += arr[j]; j--; } item = sum; return item + 1; }); console.log(newArr); return newArr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumOfSums(arr) {\n var reducer = (sum, currentEl) => sum + currentEl;\n var newArrSum = 0;\n for (var i = 0; i < arr.length; i++) {\n var currentArr = arr.slice(0, i+1);\n newArrSum += currentArr.reduce(reducer);\n };\n return newArrSum;\n}", "function getSums(arr) {\r\n var newArray = [];...
[ "0.8462211", "0.820303", "0.8046721", "0.7962974", "0.78135234", "0.76651245", "0.76345086", "0.7615058", "0.76125246", "0.7570774", "0.7552804", "0.7544091", "0.7514437", "0.75106204", "0.7504241", "0.748876", "0.74623257", "0.7456412", "0.74478745", "0.7433465", "0.7418575"...
0.7501789
15
Write the function getLastDayOfMonth (year, month), which returns the last day of the month.
function getLastDayOfMonth(year, month) { function isLeapYear(y) { return new Date(y, 1, 29).getDate() === 29; } switch (month) { case "January": case "March": case "May": case "July": case "August": case "October": case "December": return 31; case "February": retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLastDayOfMonth(year, month) {\r\n let date = new Date(year, month, -1, 0);\r\n return date.getDate();\r\n}", "static lastDayOfMonth(month, year) {\n return new Date(year, month + 1, 0).getDate();\n }", "function getLastDateOfMonth(year_month) {\n var tmp = year_month.split('-')\n ...
[ "0.85832363", "0.85288066", "0.825127", "0.77034944", "0.75288177", "0.75245005", "0.7480052", "0.7295919", "0.7250289", "0.72490406", "0.7227157", "0.71821105", "0.7109582", "0.7038501", "0.68877167", "0.6777428", "0.6700348", "0.66501945", "0.6597131", "0.656396", "0.654777...
0.8000038
3
Write the function printNumbersInterval (), which sequentially displays in the console numbers from 1 to 20, with an interval between the numbers of 100 ms. Write the function printNumbersInterval (), which sequentially displays in the console numbers from 1 to 20, with an interval between the numbers of 100 ms. Use se...
function printNumbersInterval() { for (let i = 10; i <= 20; i++) { setTimeout(() => { console.log(i); }, 100); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function printNums()\n{\n console.log(1);\n setTimeout(function() {console.log(2);}, 1000);\n setTimeout(function() {console.log(3);}, 0);\n console.log(4);\n}", "function printing() {\n console.log(1);\n setTimeout(function() {\n console.log(2);\n }, 1000);\n s...
[ "0.71954304", "0.6828531", "0.66645956", "0.6601822", "0.65909207", "0.65603864", "0.64572495", "0.64237934", "0.6318003", "0.6236026", "0.62124085", "0.61795956", "0.61442876", "0.6140202", "0.6139232", "0.6099664", "0.60911876", "0.6012413", "0.60066843", "0.59316105", "0.5...
0.80268973
0
Deep copy of object
function deepCopy(obj) { if (obj + "" === "null") { return null; } let newObj = {}; for (let key in obj) { if (typeof obj[key] !== "object") { newObj[key] = obj[key]; } else { newObj[key] = deepCopy(obj[key]); } } return newObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deepCopy(obj){\n return JSON.parse(JSON.stringify(obj));\n}", "function deepCopy(obj) {\n return JSON.parse(JSON.stringify(obj));\n}", "function deepcopy(obj) {\n return Object.assign({}, obj);\n}", "function DeepClone(obj) {\n return JSON.parse(JSON.stringify(obj));\n }", ...
[ "0.79097325", "0.78480816", "0.7805081", "0.77997935", "0.7786751", "0.7699571", "0.76772356", "0.7676468", "0.7667947", "0.7622811", "0.75897205", "0.7524878", "0.7516508", "0.7513753", "0.74356747", "0.7429418", "0.73814076", "0.7353107", "0.73085225", "0.72884303", "0.7280...
0.0
-1
var div1 = document.getElementById("div1");
function success(response){ //div1.innerHTML = response; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nom_div(div)\r\n\t{\r\n\t\treturn document.getElementById(div);\r\n\t}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "function habdiv(){\r\n document.getElementById(\"\")\r\n}", "functi...
[ "0.7545505", "0.7446503", "0.7446503", "0.7341336", "0.7041495", "0.68233204", "0.65504634", "0.64708203", "0.6373175", "0.6356931", "0.6353767", "0.63240397", "0.62907356", "0.62835264", "0.62485087", "0.62423086", "0.6238201", "0.6207831", "0.62025744", "0.62014145", "0.618...
0.0
-1
===============set values for states==============
setSelectedMedia(state, payload) { state.selMedia = payload; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setStates(states) {\n this.states_ = states;\n }", "set state (value) {\n this._mem.state = value;\n }", "function updateValuesAndStates() {\n [values, states] = generateDefaultStateArray(getItemCount());\n}", "async set_state(value)\n { console.log(\"NEEO is setting setate to \"+val...
[ "0.72628224", "0.7060609", "0.70592153", "0.7051352", "0.6915096", "0.6656436", "0.65475756", "0.65428346", "0.65221566", "0.6437195", "0.64125454", "0.64046025", "0.6390624", "0.6381493", "0.63753265", "0.63378435", "0.63297164", "0.6314366", "0.63141793", "0.6279497", "0.62...
0.0
-1
fetch segment titles eg:LPMs for selected media house
fetchSegmentTitles(context, mediaHouseId) { return axios.get('fetch-segments-titles/' + mediaHouseId).then(function(res) { context.commit('setSegment_titles', res.data); // context.commit('getSelMediaId',res.data[1].client_id); console.log(res.data); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getSegmentTitle(segment) {\n // If segment is empty, there is no segment, return empty string\n if (typeof segment == 'string' && segment != undefined && segment.length == 0)\n return '';\n else { // Else there is a segment title to compare\n switch (segment) {\n ...
[ "0.5849529", "0.5683748", "0.55613244", "0.5519796", "0.5504314", "0.5429419", "0.5391402", "0.5378325", "0.53697187", "0.5250298", "0.52369446", "0.5173622", "0.5172041", "0.51543045", "0.5145471", "0.5123451", "0.5119266", "0.5118342", "0.51026404", "0.50967926", "0.5070627...
0.6435817
0
A component that takes in an optional photographer object, and an optional albumID, then renders a breadcrumb link trail
function Breadcrumb({photographer, albumID}) { return ( <ul> <li><Link to="/"><FontAwesomeIcon icon={faHome} /></Link></li> { photographer ? <Fragment> <li><FontAwesomeIcon icon={faChevronRight} /></li> <li><Link to={`/${photographer.id}`}>{photographer.name}</L...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderAlbum(album) {\n console.log('rendering album:', album);\n\n}", "render(){\n const dishName = this.props.match.params.id;\n const recipeUrl = \"/dishes/\" + dishName + \"/Recipes\";\n const restaurantsUrl = \"/dishes/\" + dishName + \"/Restaurants\";\n return (\n ...
[ "0.6282965", "0.60700023", "0.5911411", "0.59051794", "0.5747684", "0.5604972", "0.55468774", "0.55468774", "0.55384517", "0.55014163", "0.5496725", "0.5490069", "0.54754996", "0.5432139", "0.5408903", "0.54047346", "0.5386829", "0.53815484", "0.5372019", "0.5362836", "0.5359...
0.7875587
0
we need to have the number of root redirects passed in so that we can keep track of the state the root was in when this ad started.
function sh_Ad (pid, cid, root_depth) { this.pid = pid; // id of the parent. for debugging. should always be the root node this.cid = cid; this.subIds = {}; // the number of times each cid has been redirected this.wsubIds = {}; // the sum of all redirections up to cid this.hosts = {}; // a ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function redirect2root()\n{\n\trd2RootItvl = setInterval('countDown4redirect(5)', 100);\n}", "function onBeforeRedirect(details) {\n // Catch redirect loops (ignoring about:blank, etc. caused by other extensions)\n let prefix = details.redirectUrl.substring(0, 5);\n if (prefix === \"http:\" || prefix === \"ht...
[ "0.57125574", "0.5403377", "0.52918017", "0.5210333", "0.5151671", "0.51512533", "0.50240374", "0.5009181", "0.50026286", "0.4983311", "0.4966223", "0.4949839", "0.4934849", "0.4929162", "0.49123907", "0.49062243", "0.48995772", "0.48801708", "0.48012847", "0.48012733", "0.47...
0.54926896
1
finds all collisions that stem from queen being moved around one column
function find_collisions(board) { num_collisions = 0; for(var k = 0; k<board.length; k++) { for(var l = k; l<board.length; l++) { if(k != l) { if(exists_collision(k, board[k], l, board[l])) { num_collisions+=1; } } } } return num_collisions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findCollison(field) {\n const { x, y } = this.position\n this.cells.forEach((rows, i) => {\n rows.forEach((cell, j) => {\n if (cell && ((y + i >= numberOfRows) || field[y + i][x + j])) {\n this.isAlive = false\n return\n }\n })\n })\n }", "function queensAttack...
[ "0.65717715", "0.62892455", "0.6109774", "0.60204166", "0.5991601", "0.59796596", "0.5958667", "0.5946383", "0.5936595", "0.59057415", "0.5862938", "0.5857648", "0.58509266", "0.58499986", "0.5829881", "0.58096534", "0.5744069", "0.5740061", "0.5727772", "0.57258594", "0.5724...
0.5860558
11
checks for collision between two coordinates in gameboard
function exists_collision(i, j, k, l) { if( i == k ) { return true; } else if( j == l) { return true; } else if( Math.abs(i - k) == Math.abs(j - l)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collision_check(a,b) {\n let res = (Math.abs(a.x-b.x) * 2 < (16+8)) &&\n (Math.abs(a.y-b.y) * 2< (16+8))\n return res;\n}", "function collision_detector(first, second) {\r\n var x1 = first.get(\"X\");\r\n var y1 = first.get(\"Y\");\r\n var width1 = first.get(\"width\");\r\n var height1 = fi...
[ "0.8275586", "0.79834896", "0.7963194", "0.79526156", "0.79426897", "0.7885424", "0.7845444", "0.7795247", "0.7791725", "0.7781347", "0.7702156", "0.7689522", "0.76894015", "0.76517457", "0.76376975", "0.76101416", "0.75794476", "0.7574776", "0.75732857", "0.7563337", "0.7558...
0.0
-1
Dancing around the fact that '0' is considered a logical 'false' in Javascript.
function existsAndNumber(v, retval = null) { if(!(typeof v === 'undefined' || v === null)) { if (Number.isInteger(v)) { return v; } else { return retval; } } else { return retval; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFalse(boolean){\n return boolean == 0;\n}", "function\nXATS2JS_bool_neg\n (b0)\n{ return !b0 ; }", "function isFalsy(input){\n return 0;\n }", "function isZero(num){\n\treturn num===\"0\"|| num===\"-0\";\n}", "function ifChuckSaysSo() {\n return !!0;\n}", "function zero ...
[ "0.741228", "0.7292186", "0.7225709", "0.7212896", "0.71849537", "0.7067296", "0.6983348", "0.6976725", "0.6934067", "0.6823999", "0.67885894", "0.67773855", "0.6775793", "0.67392015", "0.67259616", "0.66750914", "0.66743577", "0.66404116", "0.6638465", "0.66003454", "0.65882...
0.0
-1
for not duplicating SCRIPTS........
function loadjscssfile(filename, filetype) { if (filetype == "js") { //if filename is a external JavaScript file var fileref = document.createElement('script') fileref.setAttribute("type", "text/javascript") fileref.setAttribute("src", filename) } else if (filetype == "css") { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addScriptBlock(pth,srcs)\r\n{\r\n\tsrcs = srcs.substring(1,srcs.length-1);\r\n\tvar splt =srcs.split(\",\");\r\n\t//alert(splt);\r\n\tfor ( i = 0 ; i < splt.length; i++)\r\n\t{\r\n\t\tvar src = splt[i];\r\n\t\tvar objfl = getElemnt('_jsFile'+src);\r\n\t\tif(!objfl)\r\n\t\t{\r\n\t\t //alert(\"register...
[ "0.6667794", "0.6658075", "0.65448886", "0.64805", "0.64160687", "0.6404528", "0.6333046", "0.62316483", "0.6220774", "0.6216836", "0.62096095", "0.6186579", "0.6170068", "0.6160614", "0.61377615", "0.61353856", "0.61325353", "0.6104875", "0.6099434", "0.6084371", "0.6084371"...
0.0
-1
function for deleting and adding the same script
function reloadJs(src) { alert(src); src = $('script[src$="' + src + '"]').attr("src"); $('script[src$="' + src + '"]').remove(); $('<script/>').attr('src', src).appendTo('body'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeScript(name) {\n delete this.scripts[name];\n }", "function rmScriptFile(name) {\n\tvar scriptPath = scriptLists[name];\n\tif(scriptPath != undefined) {\n\t\t$(\"script\").each(function(){\n\t\t\tif($(this).attr(\"src\") == scriptPath) {\n\t\t\t\t$(this).remove();\n\t\t\t}\n\t\t});\n\t\tscriptLis...
[ "0.69337404", "0.63557297", "0.63333523", "0.6211916", "0.6194355", "0.61741346", "0.61538094", "0.6127527", "0.6112977", "0.6106179", "0.59834313", "0.593238", "0.5912742", "0.5843907", "0.5754815", "0.5745573", "0.5717165", "0.5716009", "0.56714374", "0.5658993", "0.5658076...
0.0
-1
function for cheking if a script or file has been added or not; If yes, script will be removed and generated again
function checkloadjscssfile(filename, filetype) { alert(filename + ", " + filetype); if (filesadded.indexOf("[" + filename + "]") == -1) { loadjscssfile(filename, filetype) filesadded += "[" + filename + "]" //List of files added in the form "[filename1],[filename2],etc" } else ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function scriptExists(fileName) {\n\tif(scriptList[fileName])\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "hasScript(name) {\n return name in this.scripts;\n }", "function checkIfScriptExists(theId, cfTag, aPatt, aVal, bPatt, bVal) {\n var dom = dw.getDocumentDOM();\n var retVal = false;\n v...
[ "0.6859309", "0.6751807", "0.6001887", "0.5979107", "0.5905147", "0.59044373", "0.5722288", "0.5657209", "0.5648222", "0.5640386", "0.5616322", "0.5615339", "0.559239", "0.5578714", "0.5556894", "0.55488473", "0.5514193", "0.5423496", "0.5353483", "0.53493685", "0.53451914", ...
0.61631334
2
function for triggering warning and critical level
function levels () { if (billTotalTotal >= costWarning && billTotalTotal < costCritical) { return 'warning' } if (billTotalTotal >= costCritical) { return 'danger' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnLevelAlert()\n{\n}", "critical(x) {\n this.#mux(x, levels.critical);\n }", "warn() {}", "function warnUser() {\n console.log('warning warning warning');\n}", "LogWarning() {}", "function warning(message) {\r\n command_1.issue('warning', message);\r\n}", "function warning(message) {...
[ "0.6482282", "0.6374425", "0.63339543", "0.62963283", "0.6294983", "0.62772524", "0.62772524", "0.6224555", "0.61719954", "0.6153909", "0.6123484", "0.6123484", "0.6123484", "0.6123484", "0.6123484", "0.6085762", "0.6085762", "0.60565734", "0.6019381", "0.5987806", "0.5983708...
0.56913424
31
function that filters list according to type
function filter (type) { const filteredType = [] for (let i = 0; i < actionList.length; i++) { const action = actionList[i] if (action.type === type) { filteredType.push(action) } } return filteredType }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterElementsByType(objectList, type) {\n var list = objectList || [];\n var result = [];\n forEach(list, function(obj) {\n if(is(obj, type)) {\n result.push(obj);\n }\n });\n return result;\n}", "function filterObject(filter, type, data) { \n filter = _.filter(filter,...
[ "0.72125936", "0.7177234", "0.7173509", "0.6911784", "0.6867799", "0.68461293", "0.6804254", "0.6730622", "0.67179877", "0.66897756", "0.66837955", "0.6661219", "0.66299236", "0.65960294", "0.64506507", "0.64343506", "0.63987476", "0.6369531", "0.63685226", "0.6346695", "0.63...
0.6585247
14
function for calculating the bill
function calculateBill (checkedRadioButton) { var radioTotal = checkedRadioButton let date = moment( new Date()).fromNow() if (radioTotal !== undefined || radioTotal === '') { if (billTotalTotal < costCritical) { var billList = { type: checkedRadioButton, timeStamp: date ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateNewBill() {\r\n\t\ttotalBill = numOxen * oxenPrice + numFood * foodPrice + numClothing * clothingPrice + numAmmunition * ammunitionPrice + (numWheels + numAxles + numTongues) * partsPrice;\r\n\t\t$(\"#storeTable\")[0].rows[7].cells[1].innerHTML = \"$\" + (totalBill.toFixed(2)).toString();\r\n\t}"...
[ "0.7853569", "0.7719375", "0.7700266", "0.76459223", "0.74040633", "0.73995537", "0.728052", "0.7228505", "0.71941537", "0.7177319", "0.7173957", "0.7156156", "0.70468926", "0.70349544", "0.7009507", "0.7000944", "0.7000605", "0.6993762", "0.6985439", "0.69778365", "0.6952936...
0.6563958
55
function that returns values
function returnOftotals () { return { billCallTotal, billSMSTotal, billTotalTotal, currentValueOfCall, currentValueOfSMS, costWarning, costCritical, levels } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnFun(x, y) {\n // return 2, 5 returns 5 because return must only have one value\n return [x, y];\n \n}", "function returnFun(x, y) {\n // return x, y returns 5 because return must only have one value\n return [x, y]\n}", "function returnTwoValues(){\n return {\n first:1,\n...
[ "0.6698331", "0.6605034", "0.65354043", "0.6414612", "0.6361057", "0.6359703", "0.6339122", "0.62541395", "0.61002046", "0.60277253", "0.59681", "0.59613943", "0.59613943", "0.5948614", "0.5929061", "0.5923836", "0.5923175", "0.5892173", "0.58889824", "0.588252", "0.5869793",...
0.0
-1
Create a deeplink to our documentation based on the user's OS and the Platform they're trying to build.
function doclink(section, path, hashOrOverrides) { const url = new URL('https://reactnative.dev/'); // Overrides const isObj = typeof hashOrOverrides === 'object'; const hash = isObj ? hashOrOverrides.hash : hashOrOverrides; const version = isObj && hashOrOverrides.version ? hashOrOverrides.version : _versio...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "docs() {\n const listOfDetails = [];\n const helpDoc = this.command.docLink || getDocLink(this.command.id);\n if (!helpDoc) {\n return '';\n }\n const hyperLink = urlUtil.convertToHyperlink('MORE INFO', helpDoc);\n // if the terminal doesn't support hyperlink, mention complete url under More...
[ "0.5786367", "0.5526098", "0.5439119", "0.53228855", "0.5305443", "0.527975", "0.52738196", "0.5225463", "0.5213177", "0.51604193", "0.515952", "0.5144628", "0.51440144", "0.51103336", "0.50909024", "0.508908", "0.50878376", "0.5065284", "0.50581074", "0.50550306", "0.5048204...
0.5822203
0
Can we figure out what version of react native they're using?
function setVersion(reactNativeVersion) { _version = reactNativeVersion; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function current(projectRoot) {\n try {\n const found = _semver().default.parse(getReactNativeVersion(projectRoot));\n if (found) {\n return found;\n }\n } catch {\n throw new _errors.UnknownProjectError(projectRoot);\n }\n return undefined;\n}", "__getRuntime() {\n return {\n ...req...
[ "0.6743561", "0.6526629", "0.64714015", "0.63617855", "0.63200873", "0.6276259", "0.6244849", "0.6118694", "0.6032455", "0.60054505", "0.599894", "0.5975652", "0.59646434", "0.59251523", "0.5883556", "0.5883556", "0.5878486", "0.58354914", "0.57976276", "0.57976276", "0.57976...
0.5860742
17
Return a valid, cleaned up semver string.
function cleanVersion(version) { if (!version) { version = "latest"; } if (version !== "latest" && !semver.validRange(version)) { version = semver.clean(version); // TODO: This should throw if an invalid version is provided. version = semver.valid(version) || "latest"; } return version; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function semver (s) {\n\t return low.unemptyString(s) &&\n\t /^\\d+\\.\\d+\\.\\d+$/.test(s)\n\t}", "static _minVersion (range) {\n let s = range.split(' ')[0]\n while (s) {\n if (semver.valid(s)) {\n break\n }\n s = s.substring(1)\n }\n return s || undefined\n }", "function...
[ "0.6613691", "0.6151366", "0.612117", "0.58471584", "0.58100826", "0.57685685", "0.57339907", "0.5713742", "0.5713742", "0.5713742", "0.56977415", "0.55806714", "0.5475731", "0.5410604", "0.5402145", "0.5332622", "0.53001773", "0.52422184", "0.5241043", "0.5165428", "0.513564...
0.6624749
0
Return the most recent valid package release for the range provided.
function getLatestForRange(metadata, range) { if (!metadata.versions) { return null; } const versions = Object.keys(metadata.versions).sort(semver.compare); let version; if (range === "latest") { if (metadata["dist-tags"] && metadata["dist-tags"].latest) { // Tagged version. version = me...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getHighestRangeVersionMatch(name, range) {\n const patterns = this.patternsByPackage[name];\n if (!patterns) {\n return null;\n }\n\n const versionNumbers = [];\n const resolvedPatterns = patterns.map(pattern => {\n const info = this.getStrictResolvedPattern(pattern);\n versionNumbers...
[ "0.659882", "0.64447314", "0.6419982", "0.59511876", "0.5933832", "0.58346313", "0.5815661", "0.56627846", "0.5580948", "0.5559955", "0.55473876", "0.5507254", "0.5448012", "0.5445737", "0.543998", "0.54206866", "0.54089147", "0.54089147", "0.53007543", "0.5291358", "0.523041...
0.6627615
0
Report an error with an explicit associated position.
function posError(startPos, endPos, template) { var args = []; var i; for (i = 3; i < arguments.length; ++i) args.push(arguments[i]); throw new MicroXML.ParseError(source, startPos, endPos, template, args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function errorFunction(position) {\n console.log('Error!');\n }", "function PositionError() {\n this.code = null;\n this.message = \"\";\n}", "function PositionError() {\n\tthis.code = null;\n\tthis.message = \"\";\n}", "function PositionError() {\n\tthis.code = null;\n\tthis.message = \"\";\...
[ "0.7152765", "0.671234", "0.6701381", "0.6701381", "0.6656697", "0.65446144", "0.6531916", "0.6466624", "0.64563376", "0.64008117", "0.63996637", "0.63474613", "0.6082304", "0.60594225", "0.60306287", "0.6003839", "0.5962288", "0.5960841", "0.5953895", "0.5901078", "0.5884514...
0.6392669
11
precondition: current char is after "!" postcondition: current char is after closing ">"
function parseComment() { expect("-"); expect("-"); for (;;) { if (curChar > ">") parseSafeChars(); switch (curChar) { case "": error("missing comment close \"-->\""); case "-": advanc...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isClosed(char) {\n return char === '/' || char === '>';\n}", "function charSuitableForTagName(char) {\n return /[.\\-_a-z0-9\\u00B7\\u00C0-\\uFFFD]/i.test(char);\n} // it flips all brackets backwards and puts characters in the opposite order", "lastOutputCharHasOperator() {\n const { output } = t...
[ "0.6601078", "0.6178767", "0.6176715", "0.6076558", "0.5909656", "0.5905901", "0.5896723", "0.58816385", "0.58761996", "0.58731145", "0.5857037", "0.58567613", "0.5817578", "0.580992", "0.57872736", "0.5773672", "0.5773672", "0.5773672", "0.57700694", "0.57668823", "0.5766882...
0.0
-1
precondition: curChar > ">" post: curChar "
function parseSafeChars() { var startPos = pos; do { if (curChar >= "\u007F") { if (curChar <= "\u009F") error("control character #x%1 not allowed", formatCodePoint(curChar)); if (curChar >= "\uD800") { if (curChar <= "\...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function next_char() { c = ++pos < xml.length ? xml[pos] : undefined; }", "current() { return this.valid(this.pos)?this.input.charAt(this.pos):Source.EOI }", "function isClosed(char) {\n return char === '/' || char === '>';\n}", "function curr () { return jsString.charAt(i); }", "function stateSelfClo...
[ "0.6366885", "0.62813735", "0.6206393", "0.6114574", "0.60962766", "0.6085145", "0.6068391", "0.60328615", "0.596135", "0.59398955", "0.58976996", "0.58951974", "0.58951974", "0.58951974", "0.58679265", "0.5858026", "0.5851427", "0.5820131", "0.57841355", "0.57841355", "0.576...
0.60374385
7
current char is whitespace before attribute; return true if attribute was parsed
function tryParseAttribute(attributeMap) { if (!tryS()) return false; while (tryS()) {} var startPos = pos; if (!tryNameStartChar()) return false; while (tryNameChar()) {} var name = source.slice(startPos, pos); // Give the error has early ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleSimpleAttribute() {\n SIMPLEATTR.lastIndex = nextchar-1;\n var matched = SIMPLEATTR.exec(chars);\n if (!matched) throw new Error(\"should never happen\");\n var name = matched[1];\n if (!name) return false;\n var value = matched[2];\n var len = value.length;\n switch(value[0]...
[ "0.6487905", "0.63888216", "0.61969775", "0.6157099", "0.6157099", "0.6157099", "0.6122225", "0.6070577", "0.60690504", "0.6039647", "0.6001239", "0.5950832", "0.59404105", "0.59063596", "0.5886574", "0.5859633", "0.57538074", "0.5726658", "0.5719243", "0.57119113", "0.570727...
0.5790243
16
precondition: current char is character after "" returns data model for element
function parseElement() { var name = parseName(); var content = []; var attributeMap = { }; var text = ""; while (tryParseAttribute(attributeMap)) {} if (tryChar("/")) { expect(">"); return [name, attributeMap, content]; } expect(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get itemText(){return (this.textContent||/* c8 ignore next */'').trim();}", "function stateSelfClosingStartTag(char) {\n if (char === '>') {\n currentTag = new CurrentTag(__assign({}, currentTag, { isClosing: true }));\n emitTagAndPreviousTextNode(); // resets to Data state as ...
[ "0.5867542", "0.55564445", "0.5506045", "0.5492431", "0.5484493", "0.5411851", "0.5356942", "0.5332609", "0.53308547", "0.5299493", "0.5290874", "0.52493906", "0.52411914", "0.5235092", "0.52340364", "0.5232552", "0.5195127", "0.5195127", "0.5193665", "0.5191502", "0.5187573"...
0.0
-1
Get list of venues from database when component is mounting Draw list of components
componentDidMount() { axios.get('/api/venues') .then( ({ data }) => { console.log("Venues retrieved: ", data); this.setState({ venues : data }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentDidMount() {\n this.getAllVenues()\n }", "render(){\n return (\n <ol className=\"venue-list\" role=\"ListBox\">\n {this.props.venues && this.props.venues.map((venue) => <VenueItem key={venue.id} {...venue} itemOnClick={this.props.itemOnClick}/>)}\n </ol>\n ...
[ "0.64794046", "0.634932", "0.60338247", "0.5923433", "0.590593", "0.5878208", "0.58416224", "0.581988", "0.57993865", "0.57953966", "0.57514864", "0.5720464", "0.56932783", "0.56779855", "0.56745964", "0.56109375", "0.56002426", "0.55908537", "0.5576925", "0.5575029", "0.5573...
0.5770072
10
Constructs a new User
constructor(aGoogleId, aFirstName, aLastName, aEMail, aAdress) { super(); this.google_id = aGoogleId; this.firstname = aFirstName; this.lastname = aLastName; this.email = aEMail; this.adress = aAdress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser(email, userName, password) {\n this.email = email;\n this.userName = userName;\n this.password = password;\n}", "function User(name) {\n if(!new.target) { // jei apacioje buvo paleistas konstruktorius (let john = User('john')) be new zodelio, tada sukuria nauja objekta\n return n...
[ "0.7679302", "0.74457926", "0.7432163", "0.73857766", "0.73560214", "0.7338754", "0.73134613", "0.72946525", "0.7175666", "0.71752155", "0.7136688", "0.71239525", "0.71077114", "0.71077114", "0.70998573", "0.70933086", "0.70697206", "0.70697206", "0.7061703", "0.70610106", "0...
0.0
-1
Sets the google_id of the user
setGoogleId(aGoogleId){ this.google_id = aGoogleId; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getGoogleUserId() {\n return this.google_user_id;\n }", "setUser(id) {\n if (!this.service) {\n throw new Error('Google Analytics hasn\\'t been installed on this page');\n }\n if (this.enabled) {\n this.timeout(`user|${id}`, () => {\n console.log('Ser...
[ "0.73244774", "0.71369594", "0.68864316", "0.68864316", "0.6689829", "0.655115", "0.6470696", "0.6440743", "0.63956255", "0.63093877", "0.6288832", "0.6268915", "0.626719", "0.6253258", "0.6246923", "0.62340045", "0.62283236", "0.6139676", "0.6093638", "0.6088085", "0.6029063...
0.75982296
0
Gets the google_id from the user
getGoogleId(){ return this.google_id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getGoogleUserId() {\n return this.google_user_id;\n }", "signIn(googleUser) {\n // TODO(jrobbins): Consider using profile pic.\n // let profile = googleUser.getBasicProfile();\n let idToken = googleUser.getAuthResponse().id_token;\n // We don't use doPost because we don't already have a XSRF toke...
[ "0.79345626", "0.69247806", "0.68244404", "0.65438217", "0.6515005", "0.6483019", "0.6463156", "0.6438559", "0.64300114", "0.64254415", "0.6328053", "0.632406", "0.6300838", "0.6291012", "0.6259482", "0.6249895", "0.62417793", "0.6203817", "0.62013763", "0.61478627", "0.61028...
0.6893534
2
Sets the firstname of the user
setFirstName(aFirstName){ this.firstname = aFirstName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "function setFirstName(firstName) {\n\t\tthis.firstName = firstName;\n\t}", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user....
[ "0.7885129", "0.78015697", "0.7310692", "0.72000164", "0.7128374", "0.71114963", "0.71048826", "0.68176126", "0.6816505", "0.68106663", "0.66753954", "0.66356856", "0.6622786", "0.6622786", "0.6612693", "0.6606168", "0.6586015", "0.6544947", "0.6398417", "0.63836455", "0.6362...
0.68881154
7
Gets the firstname of the user
getFirstName(){ return this.firstname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFirstName(userId, callback) {\n SLACK.api(\"users.info\", {\n \"user\": userId\n }, function(err, response) {\n if (!response.ok) return format.displayErrorMsg(`Failed to get info of ${userId}: API error\\nError: ${err}`, msg => callback(msg));\n else return callback(true, response.user.prof...
[ "0.8131342", "0.79769117", "0.7957752", "0.7580026", "0.7492409", "0.7489799", "0.7489474", "0.7431132", "0.7421058", "0.7410713", "0.7341026", "0.7307772", "0.7274667", "0.7274667", "0.7274667", "0.7274667", "0.7229758", "0.7229758", "0.7229758", "0.7229758", "0.7229758", ...
0.6542586
68
Sets the lastname of the user
setLastName(aLastName){ this.lastname = aLastName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setLastName(lastName) {\n\t\tthis.lastName = lastName;\n\t}", "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name...
[ "0.7599012", "0.7552298", "0.73477924", "0.7344043", "0.69746", "0.6951016", "0.6703173", "0.6637182", "0.6436262", "0.6431125", "0.6430286", "0.64229554", "0.6412401", "0.6356285", "0.62366897", "0.62366897", "0.61797637", "0.6174288", "0.6145089", "0.61174834", "0.6108737",...
0.7087852
4
Gets the lastname of the user
getLastName(){ return this.lastname; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get lastName(){\n\t\treturn this._user.last_name;\n\t}", "function getFullName(user) {\n const firstName = user.firstName;\n const lastName = user.lastName;\n\n return `${firstName} ${lastName}`;\n}", "function getFullName(user) {\n return user.firstName + \" \" + user.lastName;\n}", "get lastname() { re...
[ "0.8075916", "0.7208493", "0.7197752", "0.71937376", "0.71755993", "0.70751935", "0.7068751", "0.7044668", "0.7042156", "0.7042156", "0.7006944", "0.7005237", "0.7003262", "0.6951843", "0.6885909", "0.6882719", "0.6882719", "0.6882719", "0.6882719", "0.6882719", "0.6882719", ...
0.6688617
49
Sets the email of the user
setEMail(aEMail){ this.email = aEMail; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_user_email(env, email) {\n env.auth.user.user_email = email;\n}", "function set_new_user_email(env, email) {\n init_new_user_storage(env);\n env.auth.new_user.user_email = email;\n}", "set email(newEmail) {\n if (newEmail && newEmail.length === 0) {\n throw new Error('email must con...
[ "0.84784806", "0.78680605", "0.6884506", "0.687207", "0.68316954", "0.67877215", "0.66982573", "0.6696803", "0.6551937", "0.6499247", "0.6463135", "0.6451599", "0.6416123", "0.6328467", "0.6320915", "0.62559295", "0.6227401", "0.6205741", "0.6048134", "0.59841526", "0.5926010...
0.7378045
2
Gets the email of the user
getEMail(){ return this.email; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUserEmail() {\n return firebase.auth().currentUser.email;\n}", "function getEmail()\n {\n var item = Office.context.mailbox.item.from;\n\n var email = item.emailAddress;\n\n return email;\n }", "getEmail() {\n \n return this.email;\n }", "function get_...
[ "0.7818202", "0.7433785", "0.74115235", "0.7348492", "0.73021835", "0.7006462", "0.7004402", "0.7003474", "0.7001942", "0.7001942", "0.7001942", "0.7001942", "0.6990214", "0.6967746", "0.6949042", "0.6910047", "0.6866568", "0.6853571", "0.67049056", "0.67007214", "0.6669903",...
0.6732876
18
Sets the adress of the user
setAdress(aAdress){ this.adress = aAdress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set address(address) {\n\t\tthis._address = new Address(address);\n\t}", "editUserAddress(userId, address) {\r\n return axios.put(USER_API_BASE_URL + '/address/' + userId, address);\r\n }", "function setAppboyUser() {\n // get email and create user ids and such\n var emailAddress = document.get...
[ "0.63585657", "0.6213755", "0.62013674", "0.6163412", "0.6144622", "0.61256313", "0.61149454", "0.6099592", "0.60792893", "0.607565", "0.6033195", "0.6028316", "0.60132545", "0.59836954", "0.590643", "0.588979", "0.5862119", "0.5854225", "0.58253485", "0.58235145", "0.5818168...
0.69393426
0
Gets the adress of the user
getAdress(){ return this.adress; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserAddress(user_id) {\r\n return axios.get(USER_API_BASE_URL + '/address/' + user_id);\r\n }", "function getUserInfo() {\n\n var contract = {\n \"function\": \"sm_getUserInfo\",\n \"args\": JSON.stringify([gUserAddress])\n }\n\n return neb.api.call(getAddressForQueries(), gdAppContractAddr...
[ "0.71632826", "0.6778557", "0.67757255", "0.67031693", "0.6691379", "0.6658702", "0.65690184", "0.6566732", "0.65617007", "0.6547092", "0.64973104", "0.64673334", "0.642847", "0.63979256", "0.6320176", "0.63199306", "0.6306422", "0.6222978", "0.6193908", "0.6188097", "0.61425...
0.6406011
13
Returns an Array of learningprofileUserBO from a given JSON structure
static fromJSON(users) { let result = []; if (Array.isArray(users)) { users.forEach((a) => { Object.setPrototypeOf(a, UserBO.prototype); result.push(a); }) } else { // Es handelt sich offenbar um ein singuläres Objekt let a = users; Object.setPrototypeOf(a, Use...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fromJSON(learnProfiles) {\n let result = [];\n\n if (Array.isArray(learnProfiles)) {\n learnProfiles.forEach((p) => {\n Object.setPrototypeOf(p, LearnProfileBO.prototype);\n result.push(p);\n })\n } else {\n\n let p = learnProfiles;\n Object.setPrototypeOf(p, Lea...
[ "0.7355745", "0.63509166", "0.5742323", "0.567785", "0.5601229", "0.54614526", "0.54198545", "0.53852516", "0.53337324", "0.5328915", "0.53132355", "0.53108037", "0.52904946", "0.528045", "0.52306867", "0.52304983", "0.5228904", "0.52173465", "0.51825684", "0.51782566", "0.51...
0.6480289
1
A utility function to check if the current color assignment is safe for vertex v
function isSafe(v, graph, color, c) { for (let i = 0; i < V; i++) { if (graph[v][i] == 1 && c == color[i]) return false; } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isSafe(v, color, c) {\n for (var i = 0; i < this.V; i++) {\n if ((this.graph[v][i] === 1) && (color[i] === c)) {\n return false;\n }\n }\n return true;\n }", "isSafe(v, graph, color, c) {\n \n for (let i = 0; i < this.v; i++) {\n ...
[ "0.77564394", "0.7549795", "0.74618506", "0.71790177", "0.71145594", "0.69428015", "0.65433836", "0.65190756", "0.63398993", "0.6308892", "0.63071847", "0.6277179", "0.6219725", "0.62035614", "0.61623424", "0.61205614", "0.6100355", "0.6100355", "0.60997206", "0.6093627", "0....
0.771202
1
A recursive utility function to solve m coloring problem
function graphColoringUtil(graph, m, color, v) { /* base case: If all vertices are assigned a color then return true */ if (v == V) return true; /* Consider this vertex v and try different colors */ for (let c = 1; c <= m; c++) { /* Check if assignment of color c to v is fine*/ if (isSafe(v, graph, col...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/25...
[ "0.6588193", "0.6573023", "0.6548703", "0.65486825", "0.6538466", "0.6511507", "0.647689", "0.6341125", "0.62963116", "0.61327904", "0.6125883", "0.61113924", "0.6099676", "0.6085471", "0.6059207", "0.6058579", "0.6052094", "0.60219866", "0.6020752", "0.6016345", "0.59832275"...
0.6294142
9
This function solves the m Coloring problem using Backtracking. It mainly uses graphColoringUtil() to solve the problem. It returns false if the m colors cannot be assigned, otherwise return true and prints assignments of colors to all vertices. Please note that there may be more than one solutions, this function print...
function graphColoring(graph, m) { // Initialize all color values as 0. This // initialization is needed correct functioning // of isSafe() color = Array(V); for (let i = 0; i < V; i++) color[i] = 0; // Call graphColoringUtil() for vertex 0 if (!graphColoringUtil(graph, m, color, 0)) { console.log('S...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "graphColoring(graph, m) {\n // Initialize all color values as 0. This\n // initialization is needed correct functioning\n // of isSafe()\n this.color = new Array(this.v);\n for (let i = 0; i < this.v; i++)\n this.color[i] = 0;\n \n // Call graphColoringUtil()...
[ "0.7846392", "0.78353226", "0.773752", "0.7574559", "0.7463039", "0.7368446", "0.68052477", "0.6637046", "0.65449286", "0.6263381", "0.6212435", "0.6134732", "0.60510594", "0.60102344", "0.5777465", "0.5741406", "0.57364476", "0.5730611", "0.5725649", "0.57053", "0.5696826", ...
0.79233587
0
A utility function to print solution
function printSolution(color) { console.log('Solution Exists: Following' + ' are the assigned colors'); for (let i = 0; i < V; i++) console.log(' ' + color[i] + ' '); console.log(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "solutionToString () {}", "function displaySolution(solution) {\n\n}", "function showSolution(){\n\tvar solution = \"\";\n\tfor(move in lastMove){\n\t\tsolution += \">>> \" + lastMove[move][1] + \" \";\n\t}\n\tdocument.getElementById(\"solution\").innerText = solution;\n}", "function print() {\n var output...
[ "0.6930251", "0.69022095", "0.6560669", "0.6463353", "0.6461239", "0.64486754", "0.64414966", "0.63852555", "0.6369398", "0.62531763", "0.624715", "0.6246287", "0.6245417", "0.6242319", "0.6238461", "0.61946785", "0.61827743", "0.618249", "0.61749333", "0.61706877", "0.614842...
0.6307012
9
Gets the profile of the user who is logged in
async getProfileById(req, res, next) { try { const profile = await accountService.getProfileById(req.userInfo.id) res.send(profile) } catch (error) { next(error) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userProfile() {\n return baseUser().get();\n }", "get userProfile() {\r\n return this.clone(ProfileLoader_1, \"getuserprofile\").postCore();\r\n }", "function getCurrentUserProfile() {\r\n\t \treturn self._userProfile;\r\n\t }", "get userProfile() {\r\n return this.p...
[ "0.8641431", "0.78070986", "0.77370495", "0.7651585", "0.7556831", "0.75433666", "0.75298935", "0.752727", "0.7394056", "0.7346234", "0.73397964", "0.7271605", "0.72641903", "0.72154576", "0.7211322", "0.71968544", "0.717614", "0.7169388", "0.71480864", "0.7124226", "0.702421...
0.66345996
54
Gets the results of the user who is logged in
async getResultsByProfileId(req, res, next) { try { const results = await accountService.getResultsByProfileId(req.userInfo.id) res.send(results) } catch (error) { next(error) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUsers(data){\n users = JSON.parse(data).results;\n renderUsers();\n}", "function get_users(){\n var q = datastore.createQuery(USER);\n return datastore.runQuery(q).then( (entities) => {\n return entities[0];\n });\n}", "getUsers() {\r\n var results;\r\n axios\r\n .get(b...
[ "0.6792322", "0.6637087", "0.6629274", "0.6455366", "0.6451684", "0.6441824", "0.6397544", "0.6367465", "0.6356668", "0.6347937", "0.63388926", "0.6328195", "0.63165975", "0.63064945", "0.63031924", "0.6290525", "0.62855214", "0.6285393", "0.6274741", "0.62747264", "0.626997"...
0.6533059
3
Gets all households the logged in user belongs to
async getHouseholdsByProfileId(req, res, next) { try { const profileHouseholds = await householdProfilesService.getHouseholdsByProfileId(req.userInfo.id) res.send(profileHouseholds) } catch (error) { next(error) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBookmarksOfHouses() {\n getBookmarksOfUser(user).then(getBookmarksOfHousesHandler);\n\n function getBookmarksOfHousesHandler(bookmarks) {\n addBookmarksToHouses(bookmarks, vm.houses)\n }\n\n function addBookmarksToHouses(bookmarks, houses) {\n houses.fo...
[ "0.6449069", "0.63432235", "0.6128615", "0.59746873", "0.5552905", "0.55528677", "0.5478533", "0.5423281", "0.5380365", "0.537899", "0.5371736", "0.5363434", "0.53581405", "0.5332657", "0.5306731", "0.529463", "0.52829117", "0.5281432", "0.52790964", "0.52306116", "0.52005607...
0.6831021
0