query
stringlengths
9
14.6k
document
stringlengths
8
5.39M
metadata
dict
negatives
listlengths
0
30
negative_scores
listlengths
0
30
document_score
stringlengths
5
10
document_rank
stringclasses
2 values
Helper to get a typed SimpleDbStore for the document target object store.
function documentTargetStore(txn){return SimpleDb.getStore(txn,DbTargetDocument.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function documentTargetStore(txn) {\n return getStore$1(txn, DbTargetDocument.store);\n}", "function documentTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetDocument.store);\n}", "function documentTargetStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbTargetDocument.st...
[ "0.76761186", "0.75246686", "0.75246686", "0.75097156", "0.7476392", "0.7468964", "0.7468964", "0.7468964", "0.71240205", "0.71240205", "0.70817405", "0.67005974", "0.67005974", "0.6679762", "0.66677654", "0.6663487", "0.6663487", "0.6663487", "0.6607927", "0.6536626", "0.647...
0.7612641
1
Helper to get a typed SimpleDbStore for the remoteDocuments object store.
function remoteDocumentsStore(txn){return SimpleDb.getStore(txn,DbRemoteDocument.store);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbRemoteDocument.store);\n}", "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn, DbRemoteDocument.store);\n}", "function remoteDocumentsStore(txn) {\n return IndexedDbPersistence.getStore(txn,...
[ "0.7420841", "0.7420841", "0.73864543", "0.7382824", "0.7382824", "0.7382824", "0.73813045", "0.712501", "0.7060696", "0.695434", "0.695434", "0.64717996", "0.6201942", "0.6130535", "0.6130535", "0.6085094", "0.6085094", "0.6085094", "0.60642767", "0.6031356", "0.59799445", ...
0.75756115
0
Checks whether an object looks like a JSON object that should be converted into a struct. Normal class/prototype instances are considered to look like JSON objects since they should be converted to a struct value. Arrays, Dates, GeoPoints, etc. are not considered to look like JSON objects since they map to specific Fie...
function looksLikeJsonObject(input){return typeof input==='object'&&input!==null&&!(input instanceof Array)&&!(input instanceof Date)&&!(input instanceof Timestamp)&&!(input instanceof GeoPoint)&&!(input instanceof Blob)&&!(input instanceof DocumentKeyReference)&&!(input instanceof FieldValueImpl);}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isJSONContainer(obj) {\n if (!obj) { return false; }\n if (obj.RECORD___ === obj) { return true; }\n var constr = directConstructor(obj);\n if (constr === void 0) { return false; }\n var typeTag = constr.typeTag___;\n if (typeTag !== 'Object' && typeTag !== 'Array') { return false; }\n ...
[ "0.70478886", "0.690076", "0.6877085", "0.6822039", "0.6737699", "0.6737699", "0.6737699", "0.67257696", "0.67257696", "0.671834", "0.6669784", "0.65451586", "0.6487071", "0.64797443", "0.6475275", "0.6463843", "0.6461636", "0.644003", "0.644003", "0.63575494", "0.6276503", ...
0.717352
0
TODO(2018/11/01): As of 2018/04/17 we're changing docChanges from an array into a method. Because this is a runtime breaking change and somewhat subtle (both Array and Function have a .length, etc.), we'll replace commonlyused properties (including Symbol.iterator) to throw a custom error message. In ~6 months we can d...
function throwDocChangesMethodError(){throw new index_esm_FirestoreError(Code.INVALID_ARGUMENT,'QuerySnapshot.docChanges has been changed from a property into a '+'method, so usages like "querySnapshot.docChanges" should become '+'"querySnapshot.docChanges()"');}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function throwDocChangesMethodError() {\n throw new FirestoreError(Code.INVALID_ARGUMENT, 'QuerySnapshot.docChanges has been changed from a property into a ' + 'method, so usages like \"querySnapshot.docChanges\" should become ' + '\"querySnapshot.docChanges()\"');\n }", "function throwDocChangesMethodEr...
[ "0.73009336", "0.72349805", "0.7195611", "0.7195611", "0.7166976", "0.7166976", "0.7166976", "0.57884866", "0.54631996", "0.53587776", "0.5337766", "0.52802134", "0.52802134", "0.52700585", "0.52391666", "0.5113136", "0.5103486", "0.5094628", "0.507601", "0.50735646", "0.5073...
0.74256736
0
event adapters Start the data collection by sending the collection command to the active content script
function startDataCollection(event){ console.log("starting"); sendMessage({command: "start", target: tabs[0], mode: event.srcElement.id}); logUserAction("Start Visiting"); window.close(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enterCollection(ctx) {\n\t}", "function main() {\n\tapi.getItems()\n\t\t.then((items) => {\n\t\t\titems.forEach((obj) => store.addItem(obj));\n\t\t});\n\tevents.initEvents();\n\tlist.render();\n}", "setupDataListener(){\n PubSub.subscribe('Items:item-data-loaded',(evt)=>{this.initiliaze(evt.detail)});\n }"...
[ "0.59915084", "0.5624836", "0.56185335", "0.5534386", "0.55321693", "0.5431491", "0.54296833", "0.54017216", "0.53511846", "0.5343947", "0.5335546", "0.5291495", "0.5265165", "0.52422214", "0.52291954", "0.5228302", "0.5226666", "0.5212098", "0.5204061", "0.51739436", "0.5171...
0.7230036
0
invoca por medio de ajax la lista de temas
function cargarTemas() { __app.ajax('/temas/todos', null, onCargarTemasCompleto); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTaskList(){\n\t$.ajax({\n\t\tmethod: 'GET',\n\t\turl : 'http://localhost:8080/task',\n\t\tsuccess: function(result){\n\t\t\t$('#todo-list').empty();\n\t\t\t$('#completed-list').empty();\n\t\t\tfor(i = 0; i < result.length; i++){\n\t\t\t\taddTaskList(result[i]);\n\t\t\t}\n\t\t}\n\t})\n}", "function li...
[ "0.6725584", "0.66058636", "0.65997976", "0.6570963", "0.65564823", "0.6507359", "0.6498004", "0.6489252", "0.64495796", "0.64340883", "0.6433673", "0.64297277", "0.64282286", "0.64084625", "0.6398792", "0.63877296", "0.6387373", "0.63798267", "0.63782865", "0.6376303", "0.63...
0.7209536
0
Functionality that updates the modal content with premade templates
function updateModalContent(newContent) { // First: delete all innerHTML removeModalContent(); // Then: update the content with the selected template modalOverlay.insertAdjacentHTML('beforeEnd', newContent); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "modalContentTemplate(filmData) {\n return `<div class=\"modal__main-info\">\n <div class=\"modal__main-left\">\n <div class=\"poster\">\n <div class=\"poster__inner\">\n <img class=\"poster__img\" src=\"${fil...
[ "0.68122894", "0.67050624", "0.67024547", "0.66720647", "0.6560409", "0.65508664", "0.64878786", "0.64785606", "0.64720786", "0.63921726", "0.6330385", "0.6325704", "0.630869", "0.63057894", "0.62903494", "0.62740266", "0.6249398", "0.6246186", "0.6221414", "0.61940926", "0.6...
0.75898516
0
Create table to show searched data
function renderTable(search_data) { $tbody.innerHTML = ""; for (var i = 0; i < search_data.length; i++) { var sighting = search_data[i]; var fields = Object.keys(sighting); var $row = $tbody.insertRow(i); for (var j = 0; j < fields.length; j++) { var field = fields[j]; var $ce...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create_table() {\n \n/* $(\".userdata_search\").html(\"\"); */\n $(\".userdata_search tbody\").html(\"\");\n \n var tbl = $('<table></table>').attr({ class: \"userdata_search\" });\n var row2 = $('<thead></thead>').attr({ class: [\"class5\"].join(' ') }).appendTo(tbl);\n var row = $('<tr></tr>')....
[ "0.743672", "0.70650834", "0.6980636", "0.69630826", "0.6943558", "0.69313043", "0.6914891", "0.688134", "0.6859331", "0.67941797", "0.6748846", "0.6745292", "0.67311084", "0.663569", "0.66026706", "0.65962064", "0.65385216", "0.650936", "0.65050286", "0.649297", "0.6486279",...
0.7709293
0
Checks actuality of project migrations
check() { var dbMigrations = this.dbMigrations_, fsMigrations = this.fsMigrations_; if (lodash.difference(fsMigrations, dbMigrations).length) { this.throwError_(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _migrationsCheck(cb) {\n\t\tvar query = connection.query('SELECT COUNT(*) FROM ??', ['_migrations'], function(err, rows, fields) {\n\t\t\tif(err) {\n\t\t\t\tcb(new Error('The _migrations table does not exist.'));\n\t\t\t} else {\n\t\t\t\tcb();\n\t\t\t}\n\t\t});\n\n\t}", "function _migrationsCheck(cb) {\...
[ "0.670538", "0.670538", "0.670538", "0.670538", "0.670538", "0.6652473", "0.64209396", "0.64209396", "0.64209396", "0.64209396", "0.64209396", "0.63572294", "0.63440716", "0.633074", "0.6190342", "0.5864363", "0.5864363", "0.58604336", "0.58235604", "0.5782804", "0.5782804", ...
0.75518733
0
On click on the delete link, delete its parent.
function deleteItem(link){ $(link).parent().remove(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function del (e) {\r\n var parent = $(e.target).parent();\r\n var id = parent.attr('id');\r\n parent.remove();\r\n $.ajax({\r\n url: \"core/delete.php\",\r\n type: \"POST\",\r\n dataType: \"text\",\r\n data: \"id=\" + id\r\n });\r\n}", "function deleteItem(){ \n $(this).parent().remove();\n...
[ "0.74066085", "0.7222667", "0.7190076", "0.7089944", "0.6914718", "0.6873346", "0.6860425", "0.6724399", "0.6719916", "0.66979235", "0.6637335", "0.6600134", "0.6595735", "0.6579235", "0.65606236", "0.6547376", "0.6546643", "0.65332353", "0.653033", "0.6521029", "0.6466569", ...
0.72982764
1
Checks form value and set furigana.
checkValue() { let newInput; newInput = this.elName.value; if (newInput === '') { this.initializeValues(); this.setFurigana(); } else { newInput = this.removeString(newInput); if (this.input === newInput) return; // no changes this.input = newInput; if (this.isCon...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setFormValue(field, value){\r\n\tvar i=0;\r\n\tif (field.type == \"select-one\"){\r\n\t\tfor(i=0; i< field.options.length; i++){\r\n\t\t\tif (field.options[i].text == value)\r\n\t\t\t\tfield.options[i].selected=true;\r\n\t\t\telse field.options[i],selected=false;\r\n\t\t}//for\r\n\t} else if (field.type =...
[ "0.598715", "0.598715", "0.5978625", "0.594276", "0.5938196", "0.58861965", "0.58861965", "0.58377993", "0.5763753", "0.569352", "0.56747633", "0.56617063", "0.5653031", "0.5559196", "0.55565095", "0.5542895", "0.5527802", "0.5513095", "0.55099326", "0.550913", "0.5497843", ...
0.6742357
0
helper function to find the minimum distance between a single point and a surface defined by a set of points
function min_distance(point, surface){ var minimum = 1000000000; // arbitrarily large // find two closest points on surface var p1 = surface[0]; var p2 = surface[1]; var d1 = distance(p1, point); // second closest var d2 = distance(p2, point); // closest // swap values if necessary if (d1 < d2){ var...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "closest(points) {\n if (points.length === 1) {\n return Point.create(points[0]);\n }\n let ret = null;\n let min = Infinity;\n points.forEach((p) => {\n const dist = this.squaredDistance(p);\n if (dist < min) {\n ret = p;\n ...
[ "0.7094994", "0.68886316", "0.63958967", "0.6268024", "0.61662775", "0.61351293", "0.6076479", "0.5950406", "0.5922658", "0.5922221", "0.5880693", "0.5875567", "0.58688724", "0.5853577", "0.5852059", "0.5848378", "0.58183795", "0.58052945", "0.5805142", "0.57988274", "0.57884...
0.80360353
0
finds the vertical distance between two lines at a given xvalue
function vertical_distance(x, line1_p1, line1_p2, line2_p1, line2_p2){ // detect invalid values (not between x-ranges of both segments) if (!(between(x, line1_p1[0], line1_p2[0]) && (between(x, line2_p1[0], line2_p2[0])))){ return NaN; } // find corresponding points on both lines var slope1 = (line1_p1[1]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLineLengthBetweenPoints (x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n }", "function lineLength(x, y, x0, y0){\n return Math.sqrt((x -= x0) * x + (y -= y0) * y);\n}", "function getLineLength(x1, y1, x2, y2) {\n var res = Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 -...
[ "0.70935535", "0.6711785", "0.6684788", "0.641683", "0.6354587", "0.62838244", "0.6268492", "0.62093246", "0.6129224", "0.61134243", "0.60895437", "0.6074152", "0.6056755", "0.604596", "0.6024685", "0.6018125", "0.5999244", "0.59716916", "0.5969514", "0.5964811", "0.5954248",...
0.7826152
0
finds the width of a lesion at a given percentage of its maximum depth
function width_at_depth (points, percent_depth){ var lowest = 1000000; var highest = -1000000; for (var i = 0; i < points.length; i++){ if (points[i][1] < lowest){ lowest = points[i][1]; } if (points[i][1] > highest){ highest = points[i][1]; } } var pair1 = []; var pair2 = []; //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compute_width(depth, areas) {\n if (areas.length == 0) {\n return 0;\n } else {\n area = sum_array(areas);\n return area / depth;\n };\n}", "function levelWidth(root) {\n\t// array to loop over tree\n\tconst arr = [root, 's'];\n\t//counter to check for widths\n\tconst counter = [0];\n\n\t// ...
[ "0.68355453", "0.6271827", "0.62336767", "0.62298626", "0.61889863", "0.61743605", "0.6165617", "0.6149438", "0.6068723", "0.60285175", "0.5944012", "0.5940338", "0.5899395", "0.58972335", "0.58900857", "0.5862145", "0.5849093", "0.5821635", "0.5788713", "0.5764281", "0.57599...
0.64102584
1
analyzes cartilage width, accepts two sets of points representing the cartilage surface and osteochondral interface
function evaluateCartilage(surface, oc_interface, interval_count){ // transform coordinates so that a line between the ends of the OC interface is horizontal var oc_slope = (oc_interface[oc_interface.length-1][1]-oc_interface[0][1]) / (oc_interface[oc_interface.length-1][0]-oc_interface[0][0]); var new_surfac...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeSetup()\n{ \n //set distances based on points...\n for(let i=0;i<4;i++)\n {\n len[i]=sqrt(pow(x[(i+1)%4]-x[i],2)+pow(y[(i+1)%4]-y[i],2));\n }\n \n whichType();//checks type.\n checkOpen();//checks open or crossed.\n}", "function computeCenters() {\n centers = [];\n ...
[ "0.62492615", "0.5696323", "0.55888826", "0.55412257", "0.5498206", "0.5485822", "0.54462564", "0.54199636", "0.5411243", "0.54064685", "0.5388579", "0.53209186", "0.53209186", "0.53154576", "0.5313278", "0.53125244", "0.5286746", "0.528181", "0.5277904", "0.5256129", "0.5246...
0.5735372
1
Set the Barbarian actions as being locked or not.
setActionsLocked(flag) { if (flag === undefined) { throw new Error("setActionsLocked: flag argument is required"); } this.actionsLocked = flag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _lockFunctionality() {\n lockUserActions = true;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function _unlockFunctionality() {\n lockUserActions = false;\n viewModel.set(\"lockUserActions\", lockUserActions);\n}", "function lockActions() {\n $('.modal').find('.actio...
[ "0.6472561", "0.6130128", "0.61037046", "0.6103128", "0.5913216", "0.5810229", "0.5755878", "0.56787163", "0.56568575", "0.5608884", "0.5580455", "0.5566329", "0.5470361", "0.5470361", "0.5459375", "0.5442831", "0.5437788", "0.5437507", "0.54295367", "0.5421886", "0.5418577",...
0.7007486
0
Sets the backdrop offset to the current screen.
setBackdrop(screenNumber) { this.getBackdrop().css('background-position', -1* SCREEN_WIDTH * screenNumber + 'px 0px'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doRepositionBackdrop() {\n // Position under the topmost overlay\n var top = overlays.top();\n\n if (top) {\n\n // The backdrop, if shown, should be positioned under the topmost overlay that does have a backdrop\n for (var i = _overlays.length - 1; i > -1; i--) {\n if (_overlays[...
[ "0.628946", "0.6141828", "0.5879977", "0.54127306", "0.53979045", "0.53096074", "0.5268508", "0.5225944", "0.50899345", "0.508898", "0.5046985", "0.50173813", "0.5016853", "0.5008737", "0.49300045", "0.49275392", "0.49259233", "0.492385", "0.49155632", "0.49060243", "0.490602...
0.72804755
0
Hide the monsters on a particular screen.
hideMonsters(screenNumber) { validateRequiredParams(this.hideMonsters, arguments, 'screenNumber'); let opponents = this.getMonstersOnScreen(screenNumber); for (let opponent of opponents) { opponent.getProperties().getSprite().css('display', 'none'); opponent.getProperties...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hideAllScreens() {\n this.activeScreen = Screen.NONE;\n }", "function hideSinglePlayerStatScreen(){\n console.log(\"hideSinglePlayerStatScreen\")\n //indicate we are showing all of the player's stats\n statScreen.ShowAll = true;\n //Clears the healthbar\n singleGraphics.clear();\n statScree...
[ "0.76082146", "0.7279854", "0.7156498", "0.70310706", "0.6749914", "0.6706334", "0.66804695", "0.6653532", "0.66523284", "0.65389687", "0.65145296", "0.64873534", "0.64788747", "0.643965", "0.6429737", "0.6397872", "0.6385218", "0.6333699", "0.6319699", "0.62949526", "0.62641...
0.8165666
0
Initialize a monster for a particular screen
initializeMonster(monster, screenNumber) { monster.getProperties().getSprite().css(CSS_LEFT_LABEL, monster.getProperties().getDefaultX() + 'px'); monster.getProperties().getSprite().css(CSS_BOTTOM_LABEL, monster.getProperties().getDefaultY(screenNumber) + 'px'); monster.getProperties...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "initializeScreen(screenNumber) {\n validateRequiredParams(this.initializeScreen, arguments, 'screenNumber');\n let monsters = this.getMonstersOnScreen(screenNumber);\n\n for (let monster of monsters) {\n this.initializeMonster(monster, screenNumber);\n }\n }", "construct...
[ "0.6812995", "0.66513896", "0.6647709", "0.64412194", "0.64321977", "0.64271086", "0.6290029", "0.6266707", "0.6227675", "0.62144494", "0.621016", "0.61519355", "0.60422766", "0.5986478", "0.5948585", "0.59035206", "0.5882536", "0.5879027", "0.5867835", "0.58419025", "0.57953...
0.7641371
0
when the component is mount, we call the api toget the previously saved infos about this job offer and update the local state to update the form
componentDidMount() { AuthentificationStore.addChangeListener(this._onChange.bind(this)); fetch("/jobOffers/offer/" + this.props.match.params.id) .then(function(response) { return response.json(); }) .then(body => { this.setState({ jobOffer: body }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prepopulateJobBag(){\n \n const {history,match} = this.props;\n const jobId = parseInt(match.params.jobid);\n\n // Check if the job number id\n\n if(jobId!=\"NaN\" && jobId>0){\n const req = this.props.settings.setting.react_api_folder+'/manage_jobs_actions/...
[ "0.6709075", "0.6350005", "0.6288713", "0.6202829", "0.61889815", "0.6118971", "0.6112995", "0.6087327", "0.6084487", "0.6065637", "0.60639346", "0.6019141", "0.6003574", "0.60021144", "0.59993243", "0.59982663", "0.5986359", "0.5982946", "0.5961064", "0.5958583", "0.5937827"...
0.68641704
0
reset state if the seeded prop is updated note: setting state from props can be considered antipattern in react but due to a design issue with the layout of this component and its multi effected showmore/showless icon (changes if icon is toggled but also if rows are removed on the Unassigned event page thus this is nec...
componentWillReceiveProps(nextProps){ if (nextProps.showmoreIcon !== this.props.showmoreIcon) { this.setState({ showmoreIcon: nextProps.showmoreIcon }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "reset(prop, e) {\n var newState = {};\n newState[prop] = '';\n this.setState(newState);\n }", "componentWillReceiveProps(nextProps) {\n if (!nextProps.toggleL && nextProps.toggleR) {\n this.clearDeselectionPopup()\n }\n }", "static getDerivedStateFromProps(props, state) {\r\n if (p...
[ "0.65752596", "0.64249456", "0.6370593", "0.63347787", "0.62932795", "0.626881", "0.62357223", "0.62201375", "0.6217882", "0.6167349", "0.6165508", "0.6161676", "0.61551905", "0.61420536", "0.61419123", "0.6123111", "0.60797274", "0.6065943", "0.60545725", "0.60207033", "0.60...
0.6590052
0
========================================================================= SEND FORM LINK TO SLACK DIALOG =========================================================================
function generateSlackFormLink(startDate, endDate, form) { var ui = SpreadsheetApp.getUi(); var result = ui.alert( 'Slack ' + startDate + ' - ' + endDate + ' Form?', 'This will be send to #priv-consensys-member.', ui.ButtonSet.YES_NO_CANCEL); if(result == ui.Button.YES) { postForm(startDate,...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ExtLinkClickThru(ext_id,openNewWin,url,form) {\r\n\t$.post(app_path_webroot+'ExternalLinks/clickthru_logging_ajax.php?pid='+pid, { url: url, ext_id: ext_id }, function(data){\t\t\r\n\t\tif (data != '1') {\r\n\t\t\talert(woops);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!openNewWin) {\r\n\t\t\tif (form !=...
[ "0.64329827", "0.61569136", "0.61007124", "0.60126394", "0.60083985", "0.5876832", "0.5870301", "0.58429945", "0.5808113", "0.5797652", "0.5797511", "0.57779825", "0.5767741", "0.5749849", "0.5732234", "0.5730894", "0.5705166", "0.5668229", "0.56551516", "0.56508774", "0.5647...
0.6645757
0
We avoid Emscripten's cwd, because each MIPS sim has its own, so use this to get absolute paths
function absolute(mips, path) { if (path.length === 0) return mips.cwd; try { path = FS.lookupPath(path).path; } catch (ex) {} path = PATH.normalize(mips.cwd + path); return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static _getSpaceRoot(){\n return process.cwd(); //path.dirname(module.parent.paths[0])\n }", "function tilda(cwd) {\n if (cwd.substring(0, 1) === '~') {\n cwd = (process.env.HOME || process.env.HOMEPATH || process.env.HOMEDIR || process.cwd()) + cwd.substr(1);\n }\n return path.resolve(cwd);\n}", "fu...
[ "0.69734997", "0.6636196", "0.6547233", "0.6374444", "0.63654643", "0.6335709", "0.6314468", "0.6249961", "0.6247353", "0.624221", "0.6210497", "0.62073255", "0.61992157", "0.61731625", "0.6162345", "0.61584747", "0.60821575", "0.60718787", "0.60528433", "0.60277003", "0.5992...
0.74453264
0
next two functions build our query params based on element classes and ids
function find_query_params() { //these need to be formatted to allow multiple values var multiples = ['category-type','party-type', 'gender-type']; var search_params = {} , data_types = []; $('.search-item').each(function(i,item){ if($(item...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getQueryString(idsArray){\n\tif(!isNull(idsArray)){\n\t\tvar strQuery=\"\";\n\t\tif(idsArray.constructor == Array){\n\t\t\tfor(var i=0;i<idsArray.length;i++){\n\t\t\t\tif(idsArray[i].indexOf('.')==0){//class\n\t\t\t\t\t$(idsArray[i]).each(function(){\n\t\t\t\t\t\tstrQuery=_getQueryStringByObj($(this),strQ...
[ "0.61160344", "0.5947005", "0.5919604", "0.5632946", "0.5542136", "0.54960686", "0.54771286", "0.5376662", "0.53013206", "0.5289417", "0.528811", "0.52780044", "0.52592325", "0.5254949", "0.52442825", "0.5239061", "0.5227898", "0.52092415", "0.52044106", "0.5182694", "0.51613...
0.6195886
0
this version of the dashboard only allowed alerts on crime data, so we don't show option on other data types
function allowed_alert(query) { var filtered_alert = []; var not_allowed = ['voter','health','property','realestate']; var pieces = query.split('|'); var data_types = pieces.pop().split('-'); var allowed = data_types.filter( function(data_type) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function raiseCrimeEmergency() {\n\temergencyType = 'crime';\n\t\n}", "getAlert() {\n if (this.props.alerts.category === \"error-adding-employee\") {\n return \"alert alert-danger\"\n }\n if (this.props.alerts.category === \"success-adding-employee\") {\n return \"alert...
[ "0.55335814", "0.5369706", "0.5361401", "0.5311112", "0.5228457", "0.50983816", "0.5063406", "0.50476915", "0.504552", "0.50384325", "0.50316316", "0.50201184", "0.5013565", "0.50039184", "0.49995175", "0.49973136", "0.49778658", "0.4977371", "0.49637732", "0.4958944", "0.495...
0.6280029
0
uses url and config file to get county
function find_county() { var county_re = /org\/([^\/]+)\//; var county_match = county_re.exec(location.href); return county_match[1]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function populateCounties() {\n\tvar searchCounty = \"\";\n\trequest_url = COUNTIES_URL;\n\n\trequest_params = ACTION_TYPE + \"=\" + ACTION_QUERY + \"&\" + SEARCH_KEY + \"=\"\n\t\t\t+ searchCounty + \"&\" + RESULT_FORMAT + \"=\" + RESULT_FORMAT_DROPDOWN;\n\n\trequest_intent = INTENT_QUERY_COUNTIES;\n\n\tsendPOSTHt...
[ "0.6250843", "0.619184", "0.6079864", "0.5813255", "0.57673883", "0.57164806", "0.57126445", "0.562844", "0.56257683", "0.5621308", "0.5610339", "0.5593879", "0.55932796", "0.5567233", "0.55190027", "0.55140144", "0.5493279", "0.5462891", "0.5447858", "0.54459745", "0.5378840...
0.6831744
0
Show progress when loading comments
onLoadingCommentsChange(val) { if (this.vssue.comments) { if (val) { this.progressStart(); } else { this.progressDone(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadComments() {\n loadCommentTexts().then(amount => {loadCommentAvatars(amount)});\n }", "function showComments() {\n\t//let listOfComments = {};\n\t// Check if there are comments\n\tif (1 === 2) {\n\t\t//(listOfComments.length === 0) {\n\t\t$('.comments-list').removeClass('loading').addClass...
[ "0.70197105", "0.6723162", "0.66820586", "0.66766787", "0.6614289", "0.6596365", "0.6522517", "0.6498374", "0.6472939", "0.6403063", "0.6351329", "0.62870866", "0.62603444", "0.62389576", "0.62325984", "0.6230341", "0.6194995", "0.61860293", "0.6132468", "0.61212945", "0.6112...
0.7154639
0
Post a new issue
async postIssue() { if (!this.API || !this.options || this.issue || this.issueId) return; // login to create issue if (!this.isLogined) { this.login(); } // only owner/admins can create issue if (!this.isAdmin) return; try { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createIssue( issue) {\n return db('issues').insert(issue);\n}", "function createIssue() {\n console.log(\"Proceeding to create issue from the ticket\");\n getTicketDetails(\n function (ticketData) {\n checkAndCreateIssue(\n ticketData.ticket.id,\n function () {\n // The...
[ "0.72030634", "0.71377623", "0.7026403", "0.69685763", "0.68660265", "0.6848155", "0.68215996", "0.6706412", "0.660682", "0.6475841", "0.63896173", "0.63110095", "0.6250365", "0.61857605", "0.61753386", "0.61609167", "0.60602605", "0.6014827", "0.5986371", "0.59318125", "0.59...
0.8016778
0
Get comments of this vssue according to the issue id
async getComments() { try { if (!this.API || !this.issue || this.isLoadingComments) return; this.isLoadingComments = true; const comments = await this.API.getComments({ accessToken: this.accessToken, issueId: this.issue.id, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getComments(id, userID){\n //Only give comments if that person is registered or the course is public\n const course = await Course.findOne({\"comments\": id});\n const person = await User.findOne({\"_id\": userID});\n if ((!person.courses.includes(course._id)) && !course.public){\n ...
[ "0.64346343", "0.6376028", "0.6327159", "0.6303045", "0.6249977", "0.6244307", "0.622643", "0.61438745", "0.61418116", "0.60369754", "0.60030574", "0.5995623", "0.59792656", "0.5965008", "0.5935135", "0.5902242", "0.58991945", "0.5881069", "0.5880272", "0.5855647", "0.5851955...
0.65629244
0
Get reactions of a comment
async getCommentReactions({ commentId, }) { try { if (!this.API || !this.issue) return; const reactions = await this.API.getCommentReactions({ accessToken: this.accessToken, issueId: this.issue.id, commentId, });...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function api_get_comments(req, res) {\n Message.find({type : 'comment', parent : req.param('msg_id')}).sort({time:-1}).exec(function(err, messages) {\n\tif(!err && messages) {\n\t\tvar m = new Array();\n\n\t\tfor (var i = 0; i < messages.length; i++) {\n\t\t\tvar r = messages[i].toObject();\n\t\t\tr.id = messages...
[ "0.6051861", "0.59545755", "0.5944434", "0.5938125", "0.59123594", "0.5881141", "0.5832794", "0.57631546", "0.5749717", "0.5709326", "0.5688512", "0.5684795", "0.567931", "0.5677499", "0.5646348", "0.56340903", "0.561997", "0.5617875", "0.56017053", "0.5543842", "0.5538276", ...
0.8014663
0
Set options of Vssue if `options` prop is changed
onOptionsChange(options) { this.vssue.setOptions(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "slottedOptionsChanged(prev, next) {\n super.slottedOptionsChanged(prev, next);\n this.setProxyOptions();\n this.updateValue();\n }", "optionsUpdateHook() { }", "setOptions(options) {\n this.options = Object.assign({\n labels: ['Vssue'],\n state: 'Vssue',\n pref...
[ "0.69700027", "0.6960738", "0.68784904", "0.6818698", "0.6740375", "0.6698144", "0.66418946", "0.65532136", "0.6414065", "0.64096755", "0.6340614", "0.6323658", "0.630339", "0.6172472", "0.61213285", "0.6114115", "0.6096769", "0.6079886", "0.6041286", "0.60149455", "0.6008348...
0.84322524
0
Continue the game after game is paused.
continueGame () { if (this.pauseTimer > 0) return if (this.lives > 0) { this.startGame(false) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pause() {\n _isGamePaused = true;\n\n Frogger.observer.publish(\"game-paused\");\n }", "function gamePause() {\n drawPauseState();\n resumeCountdown = 3;\n gameState = \"gamePaused\";\n}", "function userTouchedContinue() {\n TileSum.game.state.start('Play');\n }", "function c...
[ "0.77735484", "0.77268076", "0.76095647", "0.75505704", "0.7522317", "0.7464823", "0.74525636", "0.7433339", "0.74223626", "0.7411579", "0.7367625", "0.7345384", "0.73270655", "0.7276461", "0.7261384", "0.7250646", "0.7179251", "0.7169549", "0.7169549", "0.7124511", "0.711269...
0.8014371
0
This function calls all auxiliary functions and returns an ordered list of all moves ranked by most damage to least damage TODO: Test out with array of numbers or something like that
function moveCalculator(Moves, AtkPokemon, DefPokemon){ //Array of the damage of every move. Retains the same index as the passed in Moves object move_Damage = [] for (move in Moves){ //Calculate Move power damage = calculateDamage(move, AtkPokemon, DefPokemon) move_Damage.push(damag...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortMoves (options) {\n var searchCount\n var goodCount = 5\n var moveCount = options.moves.length\n if (options.context.depth < 2) {\n searchCount = (searchFirstMoves <= moveCount) ? searchFirstMoves : moveCount\n } else if (options.context.depth < 4) {\n searchCount = 2\n } else {\n searc...
[ "0.6661331", "0.6408151", "0.6380538", "0.6377528", "0.61389947", "0.6105095", "0.6003708", "0.5986237", "0.5943134", "0.59334046", "0.592625", "0.59182537", "0.5907904", "0.5902311", "0.5897822", "0.58928794", "0.5887842", "0.58620375", "0.5860151", "0.5858107", "0.58363706"...
0.73295295
0
This function calculates the damage for each move
function calculateDamage(move, AtkPokemon, DefPokemon){ power = move.power ad = 0 //idk how this one is calculated exactly modifier = 0 //this ones complicated damage = (((2*AtkPokemon.level/5 + 2)*power*ad)/50 + 2)*modifier }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "computeDamage(){\n return this._units.reduce((accum, curUnit) => accum + curUnit.computeDamage(), 0.0);\n }", "function getDamageUser(userMove, userMoveName){\n damage = 10;\n for (var i = 0; i < wildPokemonType.length; i++) {\n var multiplier = pokeTypesEffect[userMove][pokeTypes[wild...
[ "0.6821802", "0.672971", "0.663389", "0.6477635", "0.6465782", "0.64205885", "0.63370055", "0.6307988", "0.621663", "0.6206573", "0.6197662", "0.6197429", "0.61855006", "0.6175565", "0.6173215", "0.6158049", "0.61408097", "0.61278045", "0.6110575", "0.6110226", "0.609165", ...
0.7855347
0
rickshawChartCtrl Controller for data for all Rickshaw chart used in Rickshaw chart view
function rickshawChartCtrl() { /** * Data for simple chart */ var simpleChartSeries = [ { color: '#1ab394', data: [ { x: 0, y: 40 }, { x: 1, y: 49 }, { x: 2, y: 38 }, { x: 3, y: 30 }, { x: ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chart(){\n\t\tthis.init();\n\t}", "function DefaultDashboardChartsCtrl() {\n var colors = pxDemo.getRandomColors();\n\n // Morris chart\n //\n\n this.morrisData = [\n { day: '2014-03-10', v: pxDemo.getRandomData(20, 5) },\n { day: '2014-03-11', v: pxDemo.getRandomData(20, 5) },\n ...
[ "0.59784395", "0.5791186", "0.5745781", "0.5711525", "0.56895494", "0.5550361", "0.5493095", "0.54540294", "0.54478866", "0.5434883", "0.54318196", "0.5412601", "0.53833354", "0.5382824", "0.5382824", "0.53543824", "0.5342001", "0.5338363", "0.5334101", "0.5330514", "0.532842...
0.78623426
0
Basic validation of amount. Bigger than 0 and typeof number
function isValidAmount(amount) { return amount > 0 && typeof Number(amount) == "number"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidAMOUNTValue(amount) {\n return amount != '' && /^\\d*$/.test(amount)\n}", "validateValue (value) {\n return TypeNumber.isNumber(value) && !isNaN(value)\n }", "function checkAmountInput(amount) {\r\n let regexpattern = new RegExp(\"^\\\\d+\\.?\\\\d*$\");\r\n return regexpattern.test(amo...
[ "0.7295838", "0.72336286", "0.71550167", "0.7090135", "0.7001713", "0.6999125", "0.6959789", "0.6947407", "0.6906659", "0.6894528", "0.6884079", "0.6851791", "0.6833957", "0.68192554", "0.6787838", "0.67211574", "0.6718045", "0.67101383", "0.67035824", "0.66831416", "0.667569...
0.81704795
1
This sample demonstrates how to Lists all of the streaming jobs in the specified resource group.
async function listAllStreamingJobsInAResourceGroupAndDoNotUseTheExpandODataQueryParameter() { const subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; const resourceGroupName = "sjrg6936"; const credential = new DefaultAzureCredential(); const client = new StreamAnalyticsManagementClient(credential, subs...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function listAllStreamingJobsInAResourceGroupAndUseTheExpandODataQueryParameterToExpandInputsOutputsTransformationAndFunctions() {\n const subscriptionId = \"56b5e0a9-b645-407d-99b0-c64f86013e3d\";\n const expand = \"inputs,outputs,transformation,functions\";\n const resourceGroupName = \"sjrg3276\";\n c...
[ "0.6987504", "0.680709", "0.57248485", "0.57102036", "0.56097895", "0.55474937", "0.5544842", "0.54930073", "0.5461369", "0.5384108", "0.5361914", "0.53143847", "0.5257139", "0.52520525", "0.5249781", "0.5153864", "0.5153419", "0.5044646", "0.5019459", "0.50182074", "0.501010...
0.75091195
0
This sample demonstrates how to Lists all of the streaming jobs in the specified resource group.
async function listAllStreamingJobsInAResourceGroupAndUseTheExpandODataQueryParameterToExpandInputsOutputsTransformationAndFunctions() { const subscriptionId = "56b5e0a9-b645-407d-99b0-c64f86013e3d"; const expand = "inputs,outputs,transformation,functions"; const resourceGroupName = "sjrg3276"; const options = ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function listAllStreamingJobsInAResourceGroupAndDoNotUseTheExpandODataQueryParameter() {\n const subscriptionId = \"56b5e0a9-b645-407d-99b0-c64f86013e3d\";\n const resourceGroupName = \"sjrg6936\";\n const credential = new DefaultAzureCredential();\n const client = new StreamAnalyticsManagementClient(cre...
[ "0.75089025", "0.680574", "0.5722185", "0.57077336", "0.5607997", "0.55447465", "0.5542588", "0.5492776", "0.5459304", "0.5381888", "0.5359087", "0.5311721", "0.52552724", "0.5249444", "0.5247645", "0.5151398", "0.5151179", "0.50424767", "0.5019714", "0.5016066", "0.5009312",...
0.6987579
1
Compare email tokens from extracted jwt and database
static async compare(req, res, next) { const { jwtToken, dbToken } = req.apiResults; try { if (!jwtToken || !req.body || !dbToken) { throw new Error("One or more required data is not supplied!"); } const { token: outerToken } = req.jwtToken || req.bod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validarTk(token){\n return jwt.verify(token, config.jwtSecret);\n \n \n}", "function performVerification(data, verification_data, res) {\n \n console.log(\"Incoming data-------------------------------\");\n console.log(data);\n console.log(\"Verfication data----------------------------...
[ "0.6496294", "0.6309793", "0.62724215", "0.6198814", "0.61530644", "0.61274374", "0.6114635", "0.60752976", "0.6053488", "0.6026647", "0.60140973", "0.5997302", "0.5978375", "0.59454113", "0.5941373", "0.59399974", "0.59330803", "0.5928786", "0.5901193", "0.58985", "0.5888629...
0.7458489
0
Challenge 1. make your own array object. This object does not use the in built array at all. It supports its own version of push and pop. You can also get by index 2. in question 6 make miles impossible to directly alter after creation 1.
function myArray(){ this.size = 0, this.print = function(){ for (let i = 0; i < this.size; i++){ console.log(this[i]); } }, this.push = function(item){ this[this.size] = item; this.size++; }, this.pop = function(){ this[this.size-1] = undefined...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Array() {}", "function main() {\n Array.SIZE_RATIO = 3;\n\n // Create an instance of the Array class\n let arr = new Array();\n\n // Add an item to the array\n arr.push(3);\n console.log(arr);\n /* What is the length, capacity and memory address of \n your array?\n A: Lenght:1, capacity:3, me...
[ "0.60626334", "0.60292697", "0.5944122", "0.5869637", "0.5841565", "0.57512957", "0.5725774", "0.5720602", "0.56908315", "0.5684516", "0.56757987", "0.5657475", "0.5656996", "0.5650779", "0.56447846", "0.56313896", "0.5599728", "0.5566344", "0.55569804", "0.5542811", "0.55421...
0.670923
0
User requeste a reset of swimmer counts
function ResetSwimmerCounts() { GetRaceFinisherCounts(); UpdateRacersSwimming(); UpdateRacersFinished(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetCount() {\n this.count = this.initialCount;\n }", "_resetPendingCount() {\n count = updateCount = 0;\n }", "function resetCounts() {\n //e = select, n = anarchy, d = democracy\n return {'a':0,'b':0,'u':0,'l':0,'r':0,'d':0,'s':0,'e':0,'n':0,'m':0};\n}", "resetNumberOfMoves(){\n ...
[ "0.652887", "0.63639283", "0.63512516", "0.62899864", "0.61980027", "0.6164972", "0.6151218", "0.61473167", "0.61407584", "0.6116779", "0.6081976", "0.6066538", "0.6062274", "0.6059453", "0.6055132", "0.6051019", "0.60480124", "0.6047147", "0.6044437", "0.60411954", "0.604086...
0.7792407
0
Get an existing LoadBalancer resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, state, opts) { pulumi.log.warn("LoadBalancer is deprecated: aws.elasticloadbalancingv2.LoadBalancer has been deprecated in favor of aws.lb.LoadBalancer"); return new LoadBalancer(name, state, Object.assign(Object.assign({}, opts), { id: id })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static fromLookup(scope, id, options) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_elasticloadbalancingv2_ApplicationLoadBalancerLookupOptions(options);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n ...
[ "0.5522598", "0.50870806", "0.50683665", "0.5020208", "0.497974", "0.4979308", "0.49452266", "0.4873166", "0.4777039", "0.47759315", "0.47578725", "0.47428522", "0.4718318", "0.47073483", "0.46337396", "0.460411", "0.46009836", "0.45933577", "0.45546216", "0.45463532", "0.452...
0.64344645
0
Returns true if the given object is an instance of LoadBalancer. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === LoadBalancer.__pulumiType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultSubnet.__pulumiType;\n }", "static isBvmAddr(o: Object): boolean {\n return o instanceof BvmAddr;\n }", "static isInstance(obj) {\n if (o...
[ "0.60714763", "0.59347653", "0.5927264", "0.58807206", "0.5715156", "0.56338793", "0.559706", "0.55790573", "0.55687785", "0.5550529", "0.554436", "0.55364865", "0.5497574", "0.54922366", "0.54706335", "0.5448301", "0.5432817", "0.5426557", "0.54164547", "0.54117674", "0.5409...
0.77388185
0
ms store the original boundaryrelative position and set absolute position assumes 'this' is a draggable html element within boundary
function setAbsolutePosition() { var top = $(this).position().top + $boundary.scrollTop(); var width = $(this).innerWidth(); // store current yPos positions.unshift(top); // move to absolute positioning $(this) .css({ ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onDragMove() {\n if (this.dragging) {\n let newPosition = this.data.getLocalPosition(this.parent);\n this.x = newPosition.x;\n this.y = newPosition.y;\n }\n}", "function positionDrag(e){\n var c = S.content,\n d = S.dimensions,\n coords = S.lib.get...
[ "0.65399164", "0.65307415", "0.64830303", "0.62040544", "0.60920805", "0.6033546", "0.6013784", "0.59830916", "0.5955353", "0.5947887", "0.5925458", "0.5915547", "0.5910726", "0.5910014", "0.59017295", "0.58941066", "0.5888917", "0.58815026", "0.587093", "0.58684766", "0.5865...
0.71722436
0
swap list positions of draggable and target
function swapListItemPositions($target, direction) { var draggableListIndex = $dragging.data('draggable-index'); var targetListIndex = $target.data('draggable-index'); var targetTop; var heightDifference = $target.outerHeight() - $dragging.outerHeight(); if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function swapItems(start, end){\r\n const itemOne = listItems[start].querySelector('.draggable');\r\n const itemTwo = listItems[end].querySelector('.draggable');\r\n\r\n listItems[start].appendChild(itemTwo);\r\n listItems[end].appendChild(itemOne);\r\n}", "function swapItems(fromIndex, toIndex) {\n ...
[ "0.7231079", "0.716105", "0.711074", "0.70794225", "0.7012307", "0.69396716", "0.6886017", "0.675981", "0.6546913", "0.65003824", "0.64486974", "0.62733096", "0.6220087", "0.62106895", "0.62041193", "0.6203026", "0.61464244", "0.6144922", "0.6131415", "0.61286056", "0.6081835...
0.7927537
0
as the draggable moves, we calculate if we need to move it to a new list position
function snapToListPosition(direction) { var $target; var dragElementPositionTop = $dragging.position().top; var dragElementHeight = $dragging.outerHeight(); var targetElementPositionTop; var targetElementHeight; // if the delta is large enough, $...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init_BoardDragDrop() {\n $(\".connected\").sortable({\n connectWith: \".connected\",\n receive: function (event, ui) {\n var laneType = this.getAttribute(\"data-lane-type\");\n var laneID = this.getAttribute(\"data-id\");\n if ((laneType == 3) || (ui.item....
[ "0.7017928", "0.6969701", "0.6724313", "0.6714002", "0.6689554", "0.66670656", "0.660517", "0.65788555", "0.65407044", "0.64778614", "0.647259", "0.6462633", "0.64410233", "0.64335114", "0.64293015", "0.6425444", "0.6415086", "0.6323047", "0.63137984", "0.6279193", "0.6270522...
0.74062943
0
reset styles & remove placeholder
function reset() { $boundary .css('height', 'auto') .find('.placeholder') .remove() .end() .find('.draggable') .attr('style', ''); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resetStyles () {\n\t\tthis.selection\n\t\t\t.attr('data-rel', '')\n\t\t\t.attr('data-hidden', '')\n\t}", "function emptyStyle() {\n\t$(\".pick\").each(function(){\n\t\t$(this).empty();\n\t});\n}", "function resetStyles() {\r\n $scope.showForm = true\r\n $scope.showLogo = false\r\n $scope.l...
[ "0.67642915", "0.66990125", "0.66601574", "0.6649406", "0.66291803", "0.66086644", "0.65700173", "0.6561361", "0.65563196", "0.6550202", "0.6534815", "0.6468779", "0.6468098", "0.64427716", "0.64389855", "0.64389855", "0.642152", "0.6417344", "0.63861847", "0.63842124", "0.63...
0.73785084
0
build geo database to `api/assets/geolite`
async function buildGeoLite() { // init geolite database url let url = 'https://cdn.jsdelivr.net/gh/GitSquared/node-geolite2-redist@master/redist/GeoLite2-Country.tar.gz'; if (process.env.MAXMIND_LICENSE_KEY) { url = 'https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&licens...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function geoWrite(config, geoData) {\n // mongoose.connect(config.db);\n // var db = mongoose.connection;\n // var collection = db.collection('geo');\n // console.log(\"about to update\")\n // console.log(geoData);\n // collection.update({ _id: ObjectId(\"5773497a893c69e9b7a86dad\") }, { $push: {...
[ "0.6086823", "0.5971749", "0.5591861", "0.5364068", "0.5344317", "0.5341805", "0.52946705", "0.525791", "0.52495766", "0.5244347", "0.52382904", "0.5211483", "0.5194075", "0.51929337", "0.5191231", "0.5182689", "0.5163114", "0.5163105", "0.51567286", "0.5155177", "0.51371336"...
0.74019617
0
The draw function for the Tree which takes a empty geometry and Return cylindermesh!
function DrawTheTree2(geom, x_init, y_init, z_init){ var geometry = geom; var Wrule = GetAxiomTree(); var n = Wrule.length; var stackX = []; var stackY = []; var stackZ = []; var stackA = []; var stackV = []; var stackAxis = []; var theta = params.theta * Math.PI / 180; var scale = params.scale; var a...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Tree() {\n\n this.mesh = new THREE.Object3D();\n var top = createCylinder( 1, 30, 30, 4, Colors.green, 0, 90, 0 );\n var mid = createCylinder( 1, 40, 40, 4, Colors.green, 0, 70, 0 );\n var bottom = createCylinder( 1, 50, 50, 4, Colors.green, 0, 40, 0 );\n var trunk = createCylinder( 10, 10,...
[ "0.6898562", "0.6708071", "0.6708071", "0.6635934", "0.6594494", "0.6302421", "0.625228", "0.61873144", "0.61303943", "0.60439575", "0.6031439", "0.60280377", "0.6002882", "0.5967892", "0.5916542", "0.59140736", "0.5893779", "0.5878236", "0.5820949", "0.5817835", "0.5817835",...
0.7074454
0
Convert vector between point X and Y to a cylinder...
function cylinderMesh(pointX, pointY,treeWidth) { var direction = new THREE.Vector3().subVectors(pointY, pointX); var orientation = new THREE.Matrix4(); orientation.lookAt(pointX, pointY, new THREE.Object3D().up); orientation.multiply(new THREE.Matrix4(1, 0, 0, 0, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawcylinder(gl,canvas,a_Position,r,s,x1,y1,x2,y2){\r\n\r\n // ** DRAW CYLINDERS **\r\n //\r\n\r\n // multiply degrees by convert to get value in radians \r\n // a circle is 360 degrees, rotate by (360 / s) degrees for every side, where n is number of sides!\r\n const convert = Math.PI/180 \r\n co...
[ "0.6336584", "0.62820566", "0.62040854", "0.61241597", "0.60885936", "0.60264266", "0.59795725", "0.5966922", "0.596528", "0.596528", "0.5951377", "0.5938583", "0.58713025", "0.5854693", "0.5854693", "0.58434", "0.5820725", "0.5793484", "0.57743734", "0.5753707", "0.57500565"...
0.63864774
0
set this to false to stop Spam of "Activated Robotrimp MagnetoShriek Ability" Finish Challenge2
function finishChallengeSquared() { // some checks done before reaching this: // getPageSetting('FinishC2')>0 && game.global.runningChallengeSquared var zone = getPageSetting('FinishC2'); if (game.global.world >= zone) { abandonChallenge(); debug("Finished challenge2 because we are on zo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldFarmHackingSkill() {\n return true;\n }", "function Claim()\r\n\t{\r\n\t\t//Show_Solution(Sudoku_Solution);\r\n\t\tfor(var i=0; i<3; i++)\r\n\t\t{\r\n\t\t\tfor(var j=0; j<3; j++)\r\n\t\t\t{\r\n\t\t\t\tif(Claiming(i,j))\r\n\t\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\t}", ...
[ "0.6115727", "0.59832543", "0.58398336", "0.5813325", "0.5813325", "0.56470424", "0.55181205", "0.5482211", "0.54789466", "0.54771143", "0.54616475", "0.5461621", "0.5454641", "0.5447134", "0.5416185", "0.541275", "0.536525", "0.5362943", "0.53395885", "0.53361195", "0.533456...
0.636713
0
auto spend nature tokens
function autoNatureTokens() { var changed = false; for (var nature in game.empowerments) { var empowerment = game.empowerments[nature]; var setting = getPageSetting('Auto' + nature); if (!setting || setting == 'Off') continue; //buy/convert once per nature per loop if (s...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function twTokenStrong(stream, state) {\n var maybeEnd = false,\n ch;\n while (ch = stream.next()) {\n if (ch == \"'\" && maybeEnd) {\n state.tokenize = tokenBase;\n break;\n }\n maybeEnd = (ch == \"'\");\n }\n return \"strong\";\n }", "function twTokenStrong(stream, ...
[ "0.5863265", "0.5863265", "0.58330864", "0.5793421", "0.56981754", "0.56959707", "0.54972523", "0.5487911", "0.5402416", "0.53890204", "0.5384637", "0.53822684", "0.53205913", "0.5316284", "0.5263694", "0.52555865", "0.52546984", "0.521633", "0.5209758", "0.5195845", "0.51811...
0.62111944
0
Check if currently in a Spire past IgnoreSpiresUntil
function isActiveSpireAT() { return game.global.spireActive && game.global.world >= getPageSetting('IgnoreSpiresUntil'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isPastCutoff() {\n return this.isTracking && Date.now() - this.pauses.last() > 5 * 60 * 1000\n }", "getExpiresIn() {}", "isExpired() {\n return this.expirationTime < msalCommon.TimeUtils.nowSeconds();\n }", "get expired() {\n if (this.expiresAt) {\n const now = Math.floor(Date...
[ "0.63156515", "0.59460473", "0.5745443", "0.5693015", "0.56757474", "0.55865324", "0.55576295", "0.5487151", "0.5472766", "0.54438704", "0.54003155", "0.5389266", "0.5375843", "0.53474784", "0.534482", "0.5264681", "0.5250081", "0.5219429", "0.52010095", "0.52005845", "0.5197...
0.6629535
0
Exits the Spire after completing the specified cell.
function exitSpireCell() { if(isActiveSpireAT() && game.global.lastClearedCell >= getPageSetting('ExitSpireCell')-1) endSpire(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exitSpireCell() { \n if(game.global.world == 200 && game.global.spireActive && game.global.lastClearedCell >= getPageSetting('ExitSpireCell')-1) \n endSpire(); \n}", "function exit() {\r\n if (\r\n snake[0].x < 0 ||\r\n snake[0].x > boardSize - cellSize ||\r\n snake[0].y < 0 ||...
[ "0.6708773", "0.59724855", "0.5608793", "0.55897707", "0.5581135", "0.5578321", "0.5554778", "0.5473993", "0.5440729", "0.5413619", "0.53994715", "0.5396247", "0.5391786", "0.5362772", "0.53435344", "0.53435344", "0.53435344", "0.53435344", "0.5325293", "0.5319718", "0.531341...
0.717676
0
console.log(my_min2(list)); // => 5 Largest Contiguous Subsum We have an array of integers, and we need to find the largest contiguous (togetherin sequence) subsum. Find the sums of all the contiguous subarrays and return the max. Phase 1 Write a function that interates through the array and finds all the subarrays usi...
function largest_contiguous_subsum1(arr){ let arrays = []; for (let i=0; i<arr.length; i++){ for (let k=i; k<arr.length; k++){ let array = []; for (let j=i; j<=k; j++){ array.push(arr[j]); } let sum = array.reduce((a,b) => a+b); arrays.push(sum); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function largest_contiguous_subsum2(arr){\n\n let max_so_far = arr[0];\n let curr_max = arr[0];\n\n for (i=1; i<arr.length; i++){\n curr_max = Math.max(arr[i], curr_max+arr[i]);\n max_so_far = Math.max(max_so_far, curr_max);\n }\n return max_so_far;\n}", "function getMaxSubSum(arr) { \n let ...
[ "0.86087215", "0.804534", "0.7817947", "0.77800906", "0.77481604", "0.7629411", "0.75651944", "0.7529762", "0.7519463", "0.7472336", "0.7471453", "0.7446639", "0.7392624", "0.7384808", "0.7374659", "0.73616666", "0.73517835", "0.73487926", "0.73056227", "0.72722715", "0.72620...
0.8231295
1
declaring variables for position, animation frames, and time
constructor(){ this.x = 100; this.y = 100; this.frameHeight = 53; this.frameWidth = 64; this.currentFrameX = 23; this.currentFrameY = 16; this.spriteSheet; this.currentFrameNum = 1; this.time = 0; this.timeUntilLast = 0; this.timeFromLast = 0; this.animationTime = 50; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function animations() {\n\tarthur.srcX = arthur.currentFrame * arthur.width;\n\tif (arthur.goRight) {\n\t\tarthur.srcY = arthur.goRowRight * arthur.height;\n\t} else if (arthur.goLeft) {\n\t\tarthur.srcY = arthur.goRowLeft * arthur.height;\n\t} else if (arthur.duckRight) {\n\t\tarthur.srcY = arthur.duckRowRight * ...
[ "0.69716364", "0.6904034", "0.68851423", "0.67007816", "0.6552989", "0.6547332", "0.65439856", "0.65439767", "0.65066624", "0.64970833", "0.6486129", "0.64780354", "0.6476743", "0.64639014", "0.6432951", "0.6432079", "0.64233345", "0.64219034", "0.6420977", "0.63988847", "0.6...
0.7134445
0
function for setting the start coordinates for the projectile
setStart(x, y){ if (this.alive == false){ this.x = x + 130; this.y = y + 17; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setStartingPosition() {\n this.x = CELL_WIDTH * 2;\n this.y = CELL_HEIGHT * COLS;\n }", "setStart() {\n this.start = this.setPos();\n this.locationX = this.start.x;\n this.locationY = this.start.y;\n this.field[this.start.y][this.start.x] = pathCharacter;\n }", "rtnStartPos() {\n this.x ...
[ "0.6912226", "0.6832978", "0.6782371", "0.67650247", "0.6622884", "0.6473286", "0.64385235", "0.6422049", "0.63959634", "0.6380487", "0.6364963", "0.63424397", "0.63280666", "0.632175", "0.6293732", "0.622061", "0.6207966", "0.6100578", "0.6099007", "0.60922694", "0.60753715"...
0.70478463
0
changing animation frames every 55 milliseconds and when it reaches max frame
animate(){ if (this.timeFromLast > this.animationTime){ this.currentFrameNum++; this.currentFrameX += this.frameWidth; this.timeFromLast = 0; this.timeUntilLast = millis(); } if (this.currentFrameNum > this.maxFrame){ this.currentFrameNum = 3; this.currentFrameX = 22; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tick() {\n\n //make framecount always be a number between 0 to 600\n if (framecount<600) \n framecount++;\n else\n { \n flag++;\n framecount=framecount%600;\n }\n\n requestAnimFrame(tick);\n draw();\n animate();\n \n \n\n}", "animate(framesCounter) {\n\n if (f...
[ "0.7321077", "0.69107866", "0.6903336", "0.689462", "0.6847129", "0.68330157", "0.6783298", "0.6773496", "0.6739243", "0.67279994", "0.66336834", "0.6625943", "0.65799457", "0.6579243", "0.6539542", "0.65038145", "0.64870876", "0.6486413", "0.64746475", "0.6471799", "0.645795...
0.7823296
0
changing frames for when the character is facing the right
rightState(){ this.state = "right"; this.animationTime = 40; this.currentFrameNum = 0; this.currentFrameY = 436; this.currentFrameX = 0; this.frameHeight = 114; this.frameWidth = 94; this.maxFrame = 9; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "rightTurn() {\r\n this.fltire.rotateY(-16);\r\n this.frtire.rotateY(-16);\r\n }", "frame () {\n\t\t// If th bonuss is without life, dn't move it.\n\t\tsuper.frame();\n\t\tthis.setDirection(this.direction.rotate(this.rotationSpeed))\n\t}", "frame () {\n\t\tsuper.frame();\n\t\tthis.setDirection(this.direc...
[ "0.6988162", "0.6734525", "0.67239493", "0.67080015", "0.6569484", "0.64698386", "0.6454202", "0.6439852", "0.6434033", "0.637835", "0.6367711", "0.63643557", "0.63638145", "0.6348461", "0.6297219", "0.62657034", "0.6243334", "0.62404716", "0.62372714", "0.62338144", "0.62209...
0.71798813
0
frames for when character is facing left
leftState(){ this.state = "left"; this.animationTime = 40; this.currentFrameNum = 0; this.currentFrameY = 553; this.currentFrameX = 0; this.frameHeight = 114; this.frameWidth = 94; this.maxFrame = 9; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "left() {\n // If the LEFT key is down, set the player velocity to move left\n this.sprite.body.velocity.x = -this.RUN_SPEED;\n //this.animate_walk();\n }", "leftTurn() {\r\n this.fltire.rotateY(16);\r\n this.frtire.rotateY(16);\r\n }", "turnLeft() {\n this._currentLinearSpeed = 0;\n ...
[ "0.73133856", "0.693303", "0.6691323", "0.6678744", "0.6556454", "0.6552337", "0.6549804", "0.65222216", "0.65061015", "0.6499008", "0.6482977", "0.643752", "0.6428309", "0.64126855", "0.63954884", "0.6318961", "0.63065434", "0.6305223", "0.62657773", "0.62638646", "0.6261632...
0.731095
1
frames for when the character is stationary
stationaryState(){ this.state = "stationary"; this.animationTime = 55; this.currentFrameNum = 0; this.willStop = false; this.currentFrameX = 0; this.currentFrameY = 0; this.frameHeight = 112; this.frameWidth = 79; this.maxFrame = 9; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "animate(){\n if (this.timeFromLast > this.animationTime){\n this.currentFrameNum++;\n this.currentFrameX += this.frameWidth;\n this.timeFromLast = 0;\n this.timeUntilLast = millis();\n }\n \n //change to stationary after hadouken is used\n if (this.state === \"hadouken\" && this....
[ "0.68405306", "0.62424135", "0.6224361", "0.6168025", "0.6137486", "0.60569984", "0.6055182", "0.60536665", "0.6029969", "0.6026117", "0.6007218", "0.6005884", "0.59817666", "0.59764534", "0.5971013", "0.59471613", "0.5947107", "0.59462726", "0.5945132", "0.5942897", "0.59209...
0.6790762
1
frames for when the character uses the hadouken
hadouken(){ this.state = "hadouken"; this.animationTime = 55; this.currentFrameNum = 0; this.willStop = false; this.currentFrameX = 0; this.currentFrameY = 2348; this.frameHeight = 109; this.frameWidth = 125; this.maxFrame = 8; hadouken1.startTime = millis(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleheroFrame() {\n\t\tif (this.frameX < 3 && this.moving) this.frameX++;\n\t\telse this.frameX = 0;\n\t}", "function victoryAnimation() {\n\tfor (let i = 0; i < 8; i++) {\n\t\tflashLetters(i);\n\t}\n}", "function drawFrame() {\n //Fundo e Caixas\n for (var i = 0; i < HUD.length; i++) {\n ...
[ "0.6500949", "0.63717014", "0.6194328", "0.6180196", "0.6158472", "0.61305386", "0.6129825", "0.61229867", "0.608366", "0.608046", "0.6079174", "0.6054578", "0.6049512", "0.6047945", "0.6003271", "0.5988211", "0.5986313", "0.59711975", "0.5958426", "0.59512115", "0.59268063",...
0.7360992
0
moving the character based on its state
move(){ this.charY = windowHeight - 200; if (this.state === "right") this.charX += 4; if (this.state === "left") this.charX -= 4; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "move(){\n switch(this.direction){\n case \"n\":\n this.col-=1;\n this.direction=\"n\";\n break;\n case \"e\":\n this.row += 1;\n this.direction=\"e\"; \n break;\n case \"s\":\n ...
[ "0.69844955", "0.67858887", "0.67705536", "0.67487365", "0.66506577", "0.66484547", "0.654065", "0.6479425", "0.6444482", "0.6443363", "0.64170367", "0.64132804", "0.63788944", "0.6371097", "0.63512313", "0.63495356", "0.6326806", "0.6315239", "0.6291548", "0.6288259", "0.628...
0.7941872
0
try to JSONParse the given variable if it is a string return: object or false on error
function safeJSONParse(variable) { try { if (typeof variable == "string") variable=JSON.parse(variable); return variable; } catch { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isJson( string, )\n{\n\ttry\n\t{\n\t\treturn JSON.parse( string, ()=> true, );\n\t}\n\tcatch( e )\n\t{\n\t\treturn false;\n\t}\n}", "IsJsonString(str) {\n try {\n return JSON.parse(str);\n } catch (e) {\n return str;\n }\n }", "function parseJson (jsonStri...
[ "0.7793528", "0.7639939", "0.7635331", "0.7635331", "0.763151", "0.75653297", "0.756432", "0.7550463", "0.75309414", "0.75213104", "0.74761117", "0.7467963", "0.7457585", "0.7445528", "0.7421885", "0.74177", "0.7408275", "0.74075574", "0.73891443", "0.73891443", "0.73891443",...
0.7683708
1
New packet error, extends default error class.
function PacketError(message, extra) { if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } this.name = this.constructor.name; this.level = 'Critical'; this.message = message; this.extra = extra; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CustomError() {}", "function CustomError(type,message){\n\t\t\tthis.type=type;\n\t\t\tthis.message=message;\n\t\t}", "function extendError(constructor, error_name, default_message, status_code, safe_message) {\n /*jshint validthis:true */\n \n // check for optional constructor\n ...
[ "0.7020092", "0.635068", "0.63197356", "0.63026273", "0.62938434", "0.62360144", "0.62108105", "0.6192444", "0.61341524", "0.6121295", "0.6079457", "0.6031701", "0.6028829", "0.60282385", "0.60117376", "0.6008815", "0.59550375", "0.5922795", "0.59172416", "0.59131163", "0.590...
0.7008456
1
Construct a generic Request object. The URL is |test_url|. All other fields are defaults.
function new_test_request() { return new Request(test_url) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static request(method, url, config = {}) {\n return Request.make(method, url, config);\n }", "@exposedMethod\n\trequest(options, url=null, json=null) {\n\t\t/*\n\t\t*\tCreate, send, and return a new `Request`. See the `Request`\n\t\t*\tconstructor for the `options` specification.\n\t\t*/\n\t\tif (typeo...
[ "0.6638846", "0.64101845", "0.6334804", "0.63018996", "0.62438667", "0.6103885", "0.58861715", "0.57570624", "0.5753225", "0.5723475", "0.5692982", "0.56849635", "0.5586672", "0.5580204", "0.55631196", "0.55519205", "0.55082494", "0.5448006", "0.5383356", "0.5369603", "0.5365...
0.78611463
0
Return an identifier for the tree expansion state.
function nodeExpansionIdentifier(path) { const splitPath = path.split('/'); if (splitPath.length > 1) { return `G:${splitPath[splitPath.length - 1]}`; } return ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_getExpandedState() {\n return this.expanded ? 'expanded' : 'collapsed';\n }", "_getExpandedState() {\n return this.expanded ? 'expanded' : 'collapsed';\n }", "function getExpandableTargetElementID()\r\n{\r\n}", "getIdentifier () {\n return (this._identifier);\n }", "getId() {\n ...
[ "0.5656337", "0.5656337", "0.5645384", "0.55834687", "0.5345829", "0.53317225", "0.51989716", "0.5192754", "0.5062759", "0.50327003", "0.5027351", "0.50154865", "0.50127435", "0.50047374", "0.5004341", "0.49946573", "0.4952317", "0.4916813", "0.4911228", "0.4900761", "0.48924...
0.63093114
0
Call this method for tutorials with deprecated content, it will display a message in the beginnig of the page stating that the tutorial is deprecated. Pass a string if you want to display any other text.
function displayDeprecatedWarning(text) { var container = $('<div />', { 'class': 'deprecated-container' }); var cell = $('<div />', { 'class': 'deprecated-cell' }).appendTo(container); var p = $('<p />', { 'text': text != null ? text : 'Functionality explained in this tutori...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "function deprecated(details) {\n console.log('Deprecated API usage: ' + details);\n }", "function showHelp(helpMessage) {\n $(\"#hel...
[ "0.6155814", "0.60845333", "0.5817553", "0.57777125", "0.5719948", "0.5641764", "0.5538467", "0.55131286", "0.55131286", "0.54956704", "0.547804", "0.54641485", "0.54181254", "0.5416328", "0.54139847", "0.5406566", "0.540531", "0.5400667", "0.53845036", "0.53598875", "0.53132...
0.6557683
0
updates the question form with validation messages / classes
function updateForm({ answer, answerIndex }) { currentState = answer.correct ? STATES.CORRECT : STATES.INCORRECT // add correct/incorrect (stat) class to the form $('form').addClass(currentState) // disable all radios $('input[type=radio]').prop('disabled', true) if (answer.correct) { // add class, success mes...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validate() {\r\n\r\n\r\n \r\n // set the progress of the background\r\n progress.style.width = ++position * 100 / questions.length + 'vw'\r\n\r\n // if there is a new question, hide current and load next\r\n if (questions[position]) hideCurrent(putQuestion)\r\n else hideCurre...
[ "0.6535848", "0.6398047", "0.6312606", "0.62959003", "0.62550265", "0.6219928", "0.6192129", "0.6094662", "0.6065104", "0.6041724", "0.600894", "0.59998304", "0.5971749", "0.5957085", "0.5917785", "0.590533", "0.5903665", "0.58990216", "0.58947426", "0.57842416", "0.5779262",...
0.6516944
1
cleanup procedures start nodeEnd is the function called when the node instance receives an exit signal it needs to be reset every time the agora process refreshes if killed
function nodeEnd() { // signal all current processing requests that a terminate request has been received isTerminating = true; // if it is processing, ensure all events return before stopping if (processing) { (function wait() { if (processing) { setTimeout(wait, 100); } else { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endMonitorProcess( signal, err ) {\n\n if ( err ) {\n \n log.e( 'Received error from ondeath?' + err ); \n\n releaseOracleResources( 2 ); \n\n\n } else {\n\n log.e( 'Node process has died or been interrupted - Signal: ' + signal );\n log.e( 'Normally this would be due to DOCKER STOP comman...
[ "0.66363543", "0.65154916", "0.6301238", "0.62487996", "0.62001604", "0.6180978", "0.6143477", "0.60690796", "0.6034279", "0.6033834", "0.6007936", "0.5979", "0.5979", "0.5979", "0.5979", "0.5979", "0.5974789", "0.5945357", "0.59279394", "0.5925792", "0.5925008", "0.5914519...
0.7573604
0
Write a function `printNStop5(num)` that will print all the numbers from 0 to `num 1`. It should stop printing and end the first time it encounters a number that is multiple of 5, , except 0 (otherwise we wouldn't see anything). Examples: > printNStop5(5) 0 1 2 3 4 > printNStop5(15) 0 1 2 3 4
function printNStop5(num) { // your code here... }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function highFive(num){ //print numbers less than 6 and if equals to 5 then print High Five!\n for(var i=0; i<num; i++){\n if(i == 5){// if num equals to 5, log below\n console.log(\"High Five!\");\n }\n else{//print i\n console.log(i);\n }\n }\n}", "functi...
[ "0.67742056", "0.65540546", "0.65039474", "0.6465406", "0.64429015", "0.63577163", "0.63577163", "0.6232831", "0.6222594", "0.6050855", "0.59807324", "0.5877286", "0.5867348", "0.58585066", "0.5811957", "0.5754944", "0.5745096", "0.5730267", "0.572765", "0.56863695", "0.56450...
0.7633555
0
Sets the current transport. Disables the existing one (if any).
setTransport(transport) { debug("setting transport %s", transport.name); if (this.transport) { debug("clearing existing transport %s", this.transport.name); this.transport.removeAllListeners(); } // set up transport this.transport = transport; // set up transport listeners transport....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setTransport(transport) {\n debug$3(\"setting transport %s\", transport.name);\n const self = this;\n\n if (this.transport) {\n debug$3(\"clearing existing transport %s\", this.transport.name);\n this.transport.removeAllListeners();\n }\n\n // set up transport\n this.tra...
[ "0.67459184", "0.6706888", "0.6706888", "0.6572428", "0.64738613", "0.6465157", "0.5838586", "0.56495196", "0.5562277", "0.5529616", "0.5461857", "0.5448869", "0.5448636", "0.5423519", "0.540358", "0.53743124", "0.5348146", "0.53134495", "0.5308269", "0.52647144", "0.52348036...
0.682649
0
Called on `drain` event
onDrain() { this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important // for example, when upgrading, upgrade packet is sent over, // and a nonzero prevBufferLen could cause problems on `drain` this.prevBufferLen = 0; if (0 === this.writeBuffer.length) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen);\n // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and a nonzero prevBufferLen could cause problems on `drain`\n this.prevBufferLen = 0;\n if (0 ...
[ "0.8247324", "0.8247324", "0.8173619", "0.8173619", "0.81596136", "0.77630365", "0.75937366", "0.75937366", "0.75937366", "0.75937366", "0.7451056", "0.74041635", "0.7384224", "0.7368941", "0.73628247", "0.73325115", "0.7316264", "0.7316264", "0.7316264", "0.7316264", "0.7316...
0.8281806
0
For polling, send a close packet.
doClose() { const close = () => { debug("writing close packet"); this.write([{ type: "close" }]); }; if ("open" === this.readyState) { debug("transport open - closing"); close(); } else { // in case we're trying to close while // handshaking is in progr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "doClose() {\n const self = this;\n\n function close() {\n debug(\"writing close packet\");\n self.write([{ type: \"close\" }]);\n }\n\n if (\"open\" === this.readyState) {\n debug(\"transport open - closing\");\n close();\n } else {\n // in case we're trying to close while\n...
[ "0.77094585", "0.77094585", "0.7688598", "0.7667976", "0.70320964", "0.6886", "0.6818271", "0.6818271", "0.68078834", "0.68016535", "0.6762174", "0.67345065", "0.6728473", "0.6640385", "0.66342425", "0.66342425", "0.6624417", "0.66060144", "0.6605341", "0.6602532", "0.6602532...
0.77702695
0
Produces an ack callback to emit with an event.
ack(id) { const self = this; let sent = false; return function (...args) { // prevent double callbacks if (sent) return; sent = true; debug("sending ack %j", args); self.packet({ type: socket_io_parser_1.PacketType.ACK, id: id, data: args }); }...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "ack(id) {\n const self = this;\n let sent = false;\n return function (...args) {\n // prevent double callbacks\n if (sent)\n return;\n sent = true;\n debug(\"sending ack %j\", args);\n self.packet({\n type: so...
[ "0.6723864", "0.6723864", "0.6637715", "0.63410074", "0.6321067", "0.62284005", "0.6210286", "0.61519814", "0.61519814", "0.5999861", "0.5871506", "0.57802236", "0.5758691", "0.57207406", "0.57207406", "0.56145823", "0.5605704", "0.55522174", "0.55365825", "0.54450524", "0.53...
0.6820758
0
Emit buffered events (received and emitted).
emitBuffered() { this.receiveBuffer.forEach(args => this.emitEvent(args)); this.receiveBuffer = []; this.sendBuffer.forEach(packet => this.packet(packet)); this.sendBuffer = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "emitBuffered() {\n this.receiveBuffer.forEach((args) => this.emitEvent(args));\n this.receiveBuffer = [];\n this.sendBuffer.forEach((packet) => {\n this.notifyOutgoingListeners(packet);\n this.packet(packet);\n });\n this.sendBuffer = [];\n }", "emitBuf...
[ "0.81823784", "0.8137464", "0.8137464", "0.8026419", "0.7090655", "0.6554891", "0.64418477", "0.62802976", "0.6275241", "0.6170106", "0.60873294", "0.5932964", "0.5926397", "0.5884234", "0.5846472", "0.5810155", "0.578966", "0.578966", "0.57637584", "0.5746689", "0.5746689", ...
0.8205933
0
Sets the compress flag.
compress(compress) { this.flags.compress = compress; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\n this.flags.compress = compress;\n return this;\n }", "compress(compress) {\...
[ "0.7773767", "0.7638622", "0.7638622", "0.7638622", "0.6975546", "0.65287226", "0.6496418", "0.62764674", "0.59876275", "0.58504254", "0.5814126", "0.5755006", "0.57215875", "0.57215875", "0.56853396", "0.5651306", "0.56130254", "0.55274165", "0.548731", "0.5386694", "0.53726...
0.76612735
1
Emits a reserved event. This method is `protected`, so that only a class extending `StrictEventEmitter` can emit its own reserved events.
emitReserved(ev, ...args) { super.emit(ev, ...args); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reserved(){}", "function newEmitter() {\n var emitter = new EventEmitter()\n\n function go() {\n emitter.emit('criticalEvent')\n }\n\n go()\n\n return emitter\n}", "function emit(self, eventName) { self.emit(eventName); }", "ignoreEvent(event) { return true; }", "discard(payload) {\n co...
[ "0.61554444", "0.54177517", "0.5299779", "0.5293753", "0.52906513", "0.5269415", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.52452296", "0.5233803", "0.5233803", "0.5231736", "0.5231736", "0.5231736", "0.5...
0.74587727
0
Encode packet as 'buffer sequence' by removing blobs, and deconstructing packet into object with placeholders and a list of buffers.
encodeAsBinary(obj) { const deconstruction = binary_1.deconstructPacket(obj); const pack = this.encodeAsString(deconstruction.packet); const buffers = deconstruction.buffers; buffers.unshift(pack); // add packet info to beginning of data list return buffers; // write all the buffers }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "encodeAsBinary(obj) {\n const deconstruction = binary.deconstructPacket(obj);\n const pack = this.encodeAsString(deconstruction.packet);\n const buffers = deconstruction.buffers;\n buffers.unshift(pack); // add packet info to beginning of data list\n return buffers; // ...
[ "0.6491757", "0.6442412", "0.63879544", "0.6364918", "0.5896878", "0.5847301", "0.54266447", "0.54266447", "0.54266447", "0.5416601", "0.53911227", "0.5325642", "0.5325642", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.5305685", "0.53015953", "0.53015953", "0.530159...
0.65920836
0
Reads file as HTML AST
function readHTML(file) { return parse(readFileSync(file, 'utf-8')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadHTML(path,name) {\n html[name] = pug.compile(fs.readFileSync(__dirname+path,\"utf8\"))\n}", "function parseFile(err, contents) {\r\n const output = parse(contents, {\r\n columns: true,\r\n skip_empty_lines: true\r\n });\r\n\r\n // Call build function. Interpret and construct Org Chart\r\n ...
[ "0.611419", "0.60167515", "0.58644223", "0.5858895", "0.5821196", "0.58199507", "0.5761517", "0.5667549", "0.56016403", "0.5577509", "0.55709463", "0.545141", "0.54437375", "0.54271954", "0.542706", "0.54122686", "0.5377525", "0.5374414", "0.53628474", "0.53308064", "0.532717...
0.75782984
0
Opens a tab $delta$ away from the current one.
function open(delta) { var num = current+delta; if (num >= element.querySelectorAll(".tabs li").length || num < 0) { return; } var menu = element.querySelector(".tabs li:nth-child("+(num+1)+")"); list(element.querySelectorAll(".tabs li")).map(function (tohide) {tohide.className = "";}) menu.classN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openInTab(selected){\r\n openEntryInNewTab(false, selected);\r\n }", "function openTab(tabName) {\n //todo\n}", "switchTab(oldTab, newTab) {\n const tabs = this.getTabs();\n var panel;\n\n newTab.focus();\n // Make the active tab focusable by the user (Tab key)\n newTab.rem...
[ "0.6310745", "0.6231327", "0.61822337", "0.6083347", "0.6080908", "0.60688126", "0.6011768", "0.6010892", "0.5983891", "0.5983891", "0.5978738", "0.5829404", "0.579989", "0.57867485", "0.5771583", "0.5769427", "0.5761883", "0.57603073", "0.571014", "0.57039124", "0.56973237",...
0.73782057
0
Constructs the API payload request map based on properties of ApiRequest
function buildMap(apiRequest) { var keyValueMap = {}; keyValueMap["transaction.id"] = apiRequest.transactionId; keyValueMap["order.id"] = apiRequest.orderId; keyValueMap["merchant"] = config.TEST_GATEWAY.MERCHANTID; keyValueMap["sourceOfFunds.type"] = "CARD"; keyValueMap["session.id"] = apiReque...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "buildArgs() {\n let args = {};\n\n // Skip any url parameters (e.g. items that begin with $)\n for (let key in this.givenArgs) {\n if (key.substring(0, 1) !== '$') {\n args[key] = this.givenArgs[key];\n }\n }\n\n let apiType = u.thisOrThat(this.contextOptions.api_type,\n ...
[ "0.56026655", "0.5550744", "0.5280476", "0.5263608", "0.5169081", "0.5135113", "0.50437146", "0.5019758", "0.5007848", "0.50032365", "0.49942538", "0.4980435", "0.4964532", "0.49496245", "0.4940132", "0.49246657", "0.49220482", "0.48945662", "0.4882811", "0.48472273", "0.4846...
0.69339496
0
function close log page division
function closelog(){ document.getElementById("log-page").style.display='none'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cerrar() {\twindow.close(); }", "function logout()\n{\n\twindow.close();\n}", "function closePrint () {\n document.body.removeChild(this.__container__);\n}", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._sc...
[ "0.65679157", "0.6518292", "0.6301026", "0.6241632", "0.6193293", "0.61474246", "0.6139693", "0.6139693", "0.6129852", "0.6113695", "0.607087", "0.6059503", "0.60426104", "0.6005438", "0.5998574", "0.597252", "0.5968872", "0.5968258", "0.5962123", "0.59604", "0.59448415", "...
0.77408665
0
function to sell the items by completing the order
function sellItems(itemID, qtyRequested){ //check qty available by itemID and compare qty requested var query = 'SELECT item_id, product_name, department_name, price, stock_qty FROM products WHERE ?'; connection.query(query, {item_id: itemID}, function(err, items){ //if equal to or less than process order and disp...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _sell() {\n\t\tif (this.state.items_to_sell.length < 1) {\n\t\t\tLogging.warn('Nothing to sell?');\n\t\t\treturn;\n\t\t}\n\n\t\tawait movement.pathfind_move('basics');\n\n\t\tfor (let item of this.state.items_to_sell) {\n\t\t\tconst index = Item.find(item);\n\t\t\tif (index !== -1) {\n\t\t\t\twindow.sell(ind...
[ "0.72672755", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.6791315", "0.67875373", "0.6700555", "0.66958225", "0.6677445", "0.6655415", "0.66389936", "0.6566304", "0.65639794", "0.6449293", "0.64365256", "0.6425523", "0.64189684", "0.6405516", "0.639737...
0.7058993
1
Builds the SQL Query for retrieving all petitions from the DB
function buildGetPetitionsQuery(queries){ let q = "SELECT petition_id as petitionId, title, Category.name as category, User.name as authorName, " + "(SELECT count(*) FROM Signature WHERE Signature.petition_id=Petition.petition_id) as signatureCount " + "FROM Petition " + "INNER JOIN Catego...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findAll() {\n return db.many(`\n SELECT *\n FROM parks p\n ORDER BY p.name\n `);\n }", "_generateTableListQuery(table, conditions = {}, forUpdate = false) {\n assert(typeof table === 'string', 'must provide table');\n assert(typeof conditions === 'object', 'conditions must be object');\n\n ...
[ "0.5742926", "0.5542701", "0.5535327", "0.55135286", "0.54901123", "0.54628456", "0.5451736", "0.5425484", "0.5418275", "0.5416352", "0.5392962", "0.5346311", "0.53233314", "0.5310157", "0.5292506", "0.52699107", "0.5236434", "0.5221286", "0.51881343", "0.5188116", "0.518174"...
0.6962434
0
get the timezoneoffset of a date for a given timezone Default method getTimeZoneOffset() return for the current time which is in USA for google script and which have different daylight saving time
function getTimezoneOffset(d, tz) { var ls = Utilities.formatDate(d, tz, "yyyy/MM/dd HH:mm:ss"); var a = ls.split(/[\/\s:]/); //Logger.log("getTimezoneOffset:" + tz + ' = ls = ' + ls + ' / a = ' + a) a[1]--; var t1 = Date.UTC.apply(null, a); var t2 = new Date(d).setMilliseconds(0); return (t2 - t1) / 60 /...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_zone_offset( ) {\n\tvar current_date = new Date( );\n\tvar gmt_offset = current_date.getTimezoneOffset( ) / 60;\n\treturn (gmt_offset);\n}", "get timezoneOffset() {\n if (Date._timezoneOffsetStd === undefined) this._calculateOffset();\n return Date._timezoneOffsetStd;\n }", "get timezo...
[ "0.80024624", "0.73876953", "0.7255866", "0.7252273", "0.7252273", "0.7252273", "0.71632075", "0.7147182", "0.6992944", "0.69095653", "0.6644391", "0.65092313", "0.65016264", "0.64996916", "0.64995474", "0.6491267", "0.6437536", "0.6396718", "0.63538826", "0.6327604", "0.6301...
0.7430525
1
Create a new agent with its signing pen, from a mnemonic or a keyPair.
static async create ({ name = 'Anonymous', mnemonic, keyPair, ...args }={}) { if (mnemonic) { // if keypair doesnt correspond to the mnemonic, delete the keypair if (keyPair && mnemonic !== Bip39.encode(keyPair.privkey).data) { warn(`keypair doesn't match mnemonic, ignoring keypair`) key...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function create( label, privateKey ){\n\treturn new KeyPair(label, privateKey);\n}", "function createMinerId (alias) {\n _createKey(alias, minerIdKeystorePath)\n}", "function createUser() {\nvar code = new Mnemonic();\n\n//Load a private key from a seed\nvar privateKey = code.toHDPrivateKey();\nvar hdPrivateK...
[ "0.5653055", "0.5348549", "0.51183164", "0.5073282", "0.47861168", "0.47482783", "0.4725499", "0.46971315", "0.467273", "0.46564057", "0.46455765", "0.4637237", "0.4627807", "0.46194184", "0.45636174", "0.45481858", "0.45250797", "0.45062736", "0.45048594", "0.4501839", "0.44...
0.70333385
0
Get the current balance in a specified denomination.
async getBalance (denomination = 'uscrt') { const account = await this.API.getAccount(this.address) || {} const balance = account.balance || [] const inDenom = ({denom, amount}) => denom === denomination const balanceInDenom = balance.filter(inDenom)[0] || {} return balanceInDenom.amount || 0 }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBalance() {\n return balance;\n }", "async getBalance () {\n await this.update()\n return this.client.getBalance()\n }", "function getBalance() {\n const payload = {\n symbol: 'ELF',\n owner: wallet.address\n };\n\n multiTokenContract.GetBalance.call(payload)\n ...
[ "0.6942409", "0.6714723", "0.66609716", "0.6582339", "0.6557121", "0.6481666", "0.6477863", "0.64767516", "0.6461573", "0.63955", "0.638458", "0.63446736", "0.63416445", "0.6338454", "0.6334421", "0.63229644", "0.6322435", "0.6261131", "0.6245841", "0.62338144", "0.61992073",...
0.806093
0
Send `uscrt` to multiple addresses.
async sendMany (txs = [], memo = "", denom = 'uscrt', fee = SecretNetwork.Gas(500000 * txs.length)) { if (txs.length < 0) { throw new Error('tried to send to 0 recipients') } const from_address = this.address //const {accountNumber, sequence} = await this.API.getNonce(from_address) let account...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUsers(dcnt) {\n io.sockets.emit('join', {\n names: Object.keys(allUsrName), //just get all their names\n dcnt: dcnt\n });\n }", "function sendAll(obj) {\n clients.forEach((client) => {\n send(client, obj);\n })\n}", "forEach(callback) {\n fo...
[ "0.49759355", "0.48770338", "0.48396292", "0.47920975", "0.46969154", "0.46669462", "0.45950216", "0.45782965", "0.4572112", "0.45387185", "0.45359734", "0.45359734", "0.45359734", "0.45359734", "0.4530559", "0.4512454", "0.4490507", "0.44634604", "0.44536066", "0.4450927", "...
0.54898155
0
`await` this to get the account info for this agent's address.
get account () { return this.API.getAccount(this.address) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getAccount(address) {\n if (address == null) {\n return null;\n }\n var response = await restGet(`/auth/accounts/${address}`);\n var account;\n try {\n account = response.data.result.value;\n } catch (e) {\n return null;\n }\n\n if (account.address == \"\") {\n return null;\n }\...
[ "0.69001406", "0.6792922", "0.67014945", "0.6667558", "0.66384286", "0.6629176", "0.6600547", "0.65904033", "0.6445566", "0.64336807", "0.6403458", "0.64022124", "0.64022124", "0.6387307", "0.6369204", "0.6346381", "0.63448113", "0.6328385", "0.63090277", "0.63067836", "0.628...
0.68403494
1
`await` this to pause until the block height has increased. (currently this queries the block height in 1000msec intervals)
get nextBlock () { return this.API.getBlock().then(({header:{height}})=>new Promise(async resolve=>{ while (true) { await new Promise(ok=>setTimeout(ok, 1000)) const now = await this.API.getBlock() if (now.header.height > height) { resolve() break } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function waitForNewBlock(height, cb) {\n var actualHeight = height;\n async.doWhilst(\n function (cb) {\n request({\n type: 'GET',\n url: baseUrl + '/api/blocks/getHeight',\n json: true\n }, function (err, resp, body) {\n if (err || resp.statusCode != 200) {\n re...
[ "0.71196485", "0.70206577", "0.6949194", "0.6811678", "0.67125505", "0.665578", "0.65126926", "0.65034145", "0.6415976", "0.6394332", "0.6286481", "0.6271266", "0.62548894", "0.62484163", "0.6225977", "0.6164402", "0.61447823", "0.6105917", "0.6074959", "0.6023015", "0.598066...
0.7681687
0
Instantiate a contract from a code ID and an init message.
async instantiate ({ codeId, initMsg = {}, label = '' }) { const initTx = await this.API.instantiate(codeId, initMsg, label) const codeHash = await this.API.getCodeHashByContractAddr(initTx.contractAddress) return { ...initTx, codeId, label, codeHash } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Contract(contractId) {\n contract_classCallCheck(this, Contract);\n // TODO: Add methods based on the contractSpec (or do that elsewhere?)\n this._id = contract_Buffer.from(contractId, 'hex');\n }", "static async initContractInstance(inputInitParams) {\n const {contractAddress} = inputInitP...
[ "0.63230795", "0.6299882", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.6076653", "0.5986646", "0.5913843", "0.5833289", "0.5726055", "0.5667258", "0.5617678", "0.5506324", "0.5486914", "0.54818", "0.54380006", "0.5355722", "...
0.7190188
0
Sequence.prototype.filter and IndexedSequence.prototype.filter are so close in behavior that it makes sense to build a factory with the few differences encoded as booleans.
function filterFactory(sequence, predicate, thisArg, useKeys, maintainIndices) { var filterSequence = sequence.__makeSequence(); filterSequence.__iterateUncached = (fn, reverse, flipIndices) => { var iterations = 0; var length = sequence.__iterate((v, k, c) => { if (predicate.call(thisArg, v, k, c)) {...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "filter(keepIf) {\n const self = this;\n return new Seq(function* () {\n for (const element of self)\n if (keepIf(element))\n yield element;\n });\n }", "function bouncer2(arr) {\n return arr.filter(Boolean)\n}", "function falsyFilter(){\nf...
[ "0.6230247", "0.6189363", "0.6102953", "0.60412955", "0.59969646", "0.5978879", "0.59539735", "0.59510285", "0.5937768", "0.5931186", "0.59292996", "0.5904279", "0.5903832", "0.5887538", "0.5823944", "0.5800472", "0.5781253", "0.57788664", "0.5776585", "0.57582664", "0.574619...
0.6928207
0
internal = recurse the window menu and extract all 'accelerator' values with reserved=true
function extractKeybindings (menuNode) { if (menuNode.accelerator && menuNode.click && menuNode.reserved) { return { binding: convertAcceleratorToBinding(menuNode.accelerator), cmd: menuNode.click } } else if (menuNode.submenu) { return menuNode.submenu.map(extractKeybindings).filter(Boolean...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function m_tt_Mkm_CmdEnum()\n{\n\tvar n = 0;\n\tfor(var i in config_menu)\n\t\teval(\"window.\" + i.toString().toUpperCase() + \" = \" + n++);\n\tm_tt_aV.length = n;\n}", "initHotkeys() {\n const PREFIX = \"alt+shift+\";\n const keys = Hotkey.getKeys();\n const rkeys = keys.filter(k => k.indexOf(P...
[ "0.5672235", "0.56299275", "0.5614718", "0.55224115", "0.54705167", "0.5452561", "0.5440017", "0.54134077", "0.5395205", "0.53901607", "0.538843", "0.53812414", "0.5335745", "0.5269757", "0.52655584", "0.52325195", "0.52013046", "0.5200467", "0.5180582", "0.51687264", "0.5137...
0.5746991
0
=========================== Bot setup! =========================== This function sets up and runs our bot.
function init_bot() { console.log("Initializing Penny..."); // rtmHandlers (real time message handlers) rtmHandlers.onAuthentication(env); rtmHandlers.onReceiveMessage(env); rtmHandlers.startRtm(env); setupScheduledPrompts(env); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupBot(args) {\r\n if (botDataExists()) {\r\n console.log('Found saved bot data during setup - loading it');\r\n loadBotData();\r\n } else {\r\n console.log('No saved bot data found - generating default data');\r\n setupDefaultBot();\r\n saveBotData();\r\n }\r...
[ "0.7023849", "0.6938551", "0.66934544", "0.6670126", "0.6544007", "0.64738196", "0.645209", "0.645011", "0.64082813", "0.6370061", "0.63590604", "0.6271769", "0.6154662", "0.6133547", "0.6094147", "0.60537106", "0.6043347", "0.6000122", "0.5998333", "0.5951112", "0.5885482", ...
0.7067322
0
Sets $scope.row to currently selected JMS message. Used in: ARTEMIS/js/browse.ts camel/js/browseEndpoint.ts TODO: remove $scope argument and operate directly on other variables. but it's too much side effects here...
function selectCurrentMessage(message, key, $scope) { // clicking on message's link would interfere with messages selected with checkboxes if ('selectAll' in $scope.gridOptions) { $scope.gridOptions.selectAll(false); } else { $scope.gridOptions.selectedItems.length = 0; } var idx = C...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectCurrentMessage(message, key, $scope) {\n // clicking on message's link would interfere with messages selected with checkboxes\n if ('selectAll' in $scope.gridOptions) {\n $scope.gridOptions.selectAll(false);\n }\n else {\n $scope.gridOptions.selected...
[ "0.67660975", "0.6256739", "0.59547883", "0.58603173", "0.5809188", "0.5669057", "0.5610899", "0.5361881", "0.53603286", "0.533458", "0.5322815", "0.5279658", "0.52687013", "0.5266453", "0.52545375", "0.5249026", "0.51985466", "0.51287353", "0.5122258", "0.51195323", "0.51162...
0.68048555
0
Go through and add modified footers to documents that are edited.
addFooters() { /* Add footers for modified rows */ this.gridApi.forEachNodeAfterFilterAndSort((node) => { if (node.data.hadronDocument.isModified()) { this.addFooter(node, node.data, 'editing'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setupFooter(docname, docver, docstage, docrev, docdate) {\n var footer = doc.getFooter();\n var paragraphs = footer.getParagraphs();\n var doctrack = convertStageToTrack(docstage);\n \n // Build the filename based on provided data\n var docfilename = \"\";\n \n // The passed in docname will be s...
[ "0.61070263", "0.5891777", "0.57783645", "0.55601573", "0.5443705", "0.54333746", "0.5428693", "0.5251889", "0.5247858", "0.5243702", "0.51936513", "0.5155064", "0.51381797", "0.5113296", "0.51047283", "0.50937366", "0.50905514", "0.5075639", "0.5064649", "0.5064649", "0.5043...
0.72144055
0
set the planes marker in the map using the selected position in the chart view
function setPlanePosition( i ){ var k = i + offset; // offset is adjusted to the first index in the currently filtered // segment when this segment is displayed if (planePosition != null && k >= 0 && k < pointarray.length){ planePosition.setPosition(pointarray[k].LatLng); $("#heading").text(new String(p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function panblanPark(){\n map.setView(new ol.View({\n center: blancoParkMercator,\n zoom: 19\n }));\n}", "function panAquSpCen(){\n map.setView(new ol.View({\n center: aquSpMercator,\n zoom: 19\n }));\n}", "function setMarker(){\n\n \tif (current_marker!...
[ "0.6529476", "0.6505528", "0.6450405", "0.6436074", "0.63727903", "0.6346302", "0.6320233", "0.62810385", "0.6136053", "0.61084455", "0.6055648", "0.60529345", "0.60199285", "0.60024774", "0.5979785", "0.59593457", "0.5913965", "0.59015435", "0.5888769", "0.5874749", "0.58346...
0.6765788
0
return true if (i,i+1) crosses (k,k+1)
function isCrossing(i, k){ if ( i == k || i == k + 1 || i == k - 1){ return false; } var path1 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k].LatLng]; var path2 = [pointarray[i].LatLng, pointarray[i + 1].LatLng, pointarray[k + 1].LatLng]; var path3 = [pointarray[k].LatLng, pointarray[k + ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function containsCloseNums(nums, k) {\n for (let i = 0; i < nums.length; i++) {\n for (let j = 0; j < nums.length; j++) {\n if (i !== j && nums[i] === nums[j]) {\n return Math.abs(i - j) <= k\n }\n }\n }\n return false\n}", "function containDuplication(arr,k){\n if(arr.length===0)\n r...
[ "0.62931365", "0.62828517", "0.62527996", "0.62113714", "0.6109504", "0.5946809", "0.59088993", "0.587759", "0.5803817", "0.5799639", "0.5791983", "0.5776205", "0.57043606", "0.565883", "0.5657893", "0.56131077", "0.56079686", "0.5554067", "0.5546994", "0.5545171", "0.5530581...
0.705261
0
when segments (i,i+1) and (k,k+1) cross each other, return the intersection point as the interpolation on the first segment (i,i+1) determine the intersection point by the Cramerrule
function getIntersection (i, k) { var det = dx(i,i + 1) * dy(k,k + 1) - dx(k, k +1 ) * dy(i, i + 1); var s = dx(i,k) * dy (k,k + 1) - dx(k,k + 1) * dy(i, k); s = s / det; var t = dy(i,k) * dx (i,i + 1) - dy(i,i + 1) * dx(i, k); t = t / det; return s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cubicSegmentIntersections(px1, py1, px2, py2, px3, py3, px4, py4, x1, y1, x2, y2) {\n var intersections = [];\n // Find line equation coefficients.\n var A = y1 - y2;\n var B = x2 - x1;\n var C = x1 * (y2 - y1) - y1 * (x2 - x1);\n // Find cubic Bezier curve equation coefficients from con...
[ "0.6423302", "0.6368426", "0.62815225", "0.6260365", "0.6254019", "0.6101914", "0.6070711", "0.59512794", "0.59469426", "0.59067935", "0.583224", "0.5796831", "0.5796831", "0.57700837", "0.57184213", "0.56974655", "0.56851524", "0.5668007", "0.5667565", "0.55917317", "0.55894...
0.6872056
0