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
Render modal for password verification
renderPasswordCheckModal() { this.refs.passwordCheck.renderModal(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show404password() {\n $('.modal h2').html('This password hasn\\'t been compromised');\n }", "function showChangePasswordModal() {\n $('#change-password-modal').modal('show');\n}", "function changePassword() {\n $('#changePasswordFormModal').modal();\n}", "function show_modal_retrieve...
[ "0.72635037", "0.7039152", "0.6906701", "0.661096", "0.63135", "0.62479115", "0.6223074", "0.6214736", "0.618749", "0.61787516", "0.6151192", "0.6084533", "0.60755825", "0.6074745", "0.60725486", "0.6031887", "0.6016876", "0.60060817", "0.60043854", "0.5984966", "0.5971166", ...
0.7297713
0
Returns an object with each unique word in the input as a key, and the count of the number of occurances of that word as the value. (HINT: the code `text.toLowerCase().match(/[az]+/g)` will return an array of all lowercase words in the string.)
function getWordCounts(text) { var wordsArray = text.toLowerCase().match(/[a-z]+/g); var resultObj = {}; for(var i = 0; i < wordsArray.length; i++){ if(resultObj.hasOwnProperty(wordsArray[i])){ resultObj[wordsArray[i]]++; } else { resultObj[wordsArray[i]] = 1; } } return resultObj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wordOccurances(text){\n let wordArray = text.split(\" \");\n let count_dict = wordArray.reduce(function (array, word){\n if(word in array) array[word] ++; \n else array[word] = 1;\n return array;\n },{});\n return count_dict;\n}", "function wordCount(str){\n const clean...
[ "0.8203295", "0.79836434", "0.7856143", "0.77229077", "0.7674756", "0.7663666", "0.7640369", "0.7406713", "0.7406713", "0.7403678", "0.7356706", "0.7308281", "0.7290092", "0.71790856", "0.7167664", "0.7161442", "0.7147173", "0.71243626", "0.70873004", "0.7082895", "0.7050572"...
0.81722397
1
for computer department fetch the relate product link and name.
function fetchDataForGivenDepartment(Link) { return new Promise(function (resolve, reject) { page.goto(Link).then(function () { return page.evaluate(function () { let computerItemTypeLink = document.querySelectorAll('.a-spacing-micro.apb-browse-refinements-ind...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function productLink(depId, productId) {\n\tif(productId != null || productId != '') {\n\t\tvar url = URL_PRODUTO;\n\t\tvar params = depId +'/'+ productId;\n\t\t\n\t\treturn url + params;\n\t}\n}", "getProductLink(productId){\r\n const link = this.links.find(link => link.id == 'productDetail');\r\n ...
[ "0.5912613", "0.5878672", "0.5594105", "0.55906355", "0.55356413", "0.5459718", "0.53948903", "0.53805506", "0.5298162", "0.52902806", "0.5246025", "0.5201423", "0.51812637", "0.51707876", "0.5153248", "0.5133928", "0.5070684", "0.5053856", "0.5037323", "0.5035125", "0.502966...
0.59456146
0
Component that displays a criminal record. It has information about the defendant and a list of cases.
function CRecord(props) { const { cases } = props; const cRecordStyle = {margin: '15px', border: '1px solid black', borderRadius: '25px', padding: '10px', width: '950px'}; return ( <div className="cRecord" style={cRecordStyle}> <ApplicantHolderWrapper /> <Cases cases={c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CasesList() {\n const listOfCases = result.map((t) =>\n <div key={t}>\n <h3>{t[1].country}</h3>\n <h4 onClick={getValue}>{t[0]}</h4>\n <p>Confirmed: {t[1].confirmed}</p>\n <p>Recovered: {t[1].recovered}</p>\n <p>D...
[ "0.54415524", "0.52770776", "0.50280035", "0.4970324", "0.4952543", "0.49249247", "0.4866357", "0.4857961", "0.4812677", "0.4810609", "0.4804684", "0.4765849", "0.47589973", "0.47547856", "0.47371", "0.47359738", "0.47238746", "0.47169608", "0.46829772", "0.4680389", "0.46654...
0.6015976
0
March 22, 2009 finds propeller with gear ratio closest to unity i.e., best choice for directdrive outrunner.
function find_direct_drive_prop(nprops,prop_list){ var i, best_i, delta, delta_min; if(nprops == 0){ //there were no suitable props found delta_min = 0; }else{ delta_min = Math.abs(1.0 - prop_list[0].gear_ratio); //how far is the gear ratio from unity? } best_i = 0; for(i = 1; i < nprops; i++){ delta = Math...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closestO(shipp){\n let ans=999;\n let val;\n for(const player of game.players.values()) {\n if(player.id!==me.id){\n if(gameMap.calculateDistance(shipp.position,player.shipyard.position)<ans){\n ans=gameMap.calculateDistance(player.shipyard.position,shipp.position);\n ...
[ "0.63415885", "0.62620825", "0.61445236", "0.59110296", "0.5874148", "0.58278704", "0.5753338", "0.5702306", "0.56858766", "0.5666032", "0.5651181", "0.56349194", "0.5613866", "0.5613182", "0.56070924", "0.5607003", "0.5570283", "0.55456996", "0.55429405", "0.5541929", "0.551...
0.6413195
0
function to suggest a suitable pitch speed and thrust for the model
function suggest_speed_and_thrust(myDoc,flag){ // alert("329: in suggest_speed_and_thrust(); myDoc = " + myDoc + "flag = " + flag); var plane1 = new Object(); plane1 = read_airframe_data(myDoc); //read in wing span, chord, model weight, number of wings, scaling percentage // alert("332"); if(plane1.errors == 1){ //...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPitch() {\n\tif ( !flying ) return true;\n\t// absolute value\n\tvar amt = Math.round( Math.abs( env.pitch - offsetPitch ) * 10 ) / 10,\n\t\t// Used for not sending same commands over and over.\n\t\tspeedIdent = '0',\n\t\t// The speed is a percent of the max.\n\t\tspeed = Math.round( amt * maxPitch / 1...
[ "0.6612665", "0.644253", "0.6391533", "0.62753606", "0.5856815", "0.5611917", "0.55838716", "0.55683213", "0.5561937", "0.5554881", "0.5495823", "0.5482683", "0.5435367", "0.54352707", "0.5432973", "0.5417617", "0.54142165", "0.5414176", "0.5405841", "0.54031825", "0.5371812"...
0.7279712
0
find number of series lipo cells that is nearest fit to "vbat" volts aug 05 2008
function find_cell_count(vbat,vcell){ if(vbat < vcell/2){ return 1; }else if (vbat > 60.0){ alert("676: Warning: battery voltage over 60 volts in find_cell_count(). Continuing.."); } var i = 0; var vnom = 0.0; do{ i++; vnom = i * vcell; //nominal voltage from "i" cells at "vcell" volts each }while(vnom ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findStepSize(data){\n\tdata.sort();\n\tvar minDifference = Math.abs(data[1] - data[0]);\n\tfor(var x = 0; x < data.length - 1; x++){\n\t\tif(Math.abs(data[x] - data[x-1]) < minDifference){\n\t\t\tminDifference = Math.abs(data[x] - data[x-1]);\n\t\t}\n\t}\n\tif(minDifference >=1){return 1;}\n\treturn minDi...
[ "0.5714331", "0.55901515", "0.54888153", "0.5473101", "0.54037136", "0.5363217", "0.5310972", "0.528579", "0.52545494", "0.5233714", "0.5190668", "0.5187585", "0.5173303", "0.5164538", "0.514018", "0.51375854", "0.51342255", "0.511795", "0.51072466", "0.51015633", "0.5098793"...
0.6840258
0
find min and max number of series A123 2300 mAh cells that will work with this model Since A123 cells are only available in one or two capacities, this uses a different algorithm than the one used to find lipo cell count The pack weight and maximum possible pack output power are used, rather than "C" rate and mAh. apr ...
function find_A123_counts(myDoc,power_needed){ check_if_number(myDoc,'auw','all up weight'); var auw = parseFloat(myDoc.getElementById('auw').value); /*all up weight of plane */ var formunits = myDoc.getElementById('formunits').value; /* what units are used for the weight? */ if(formunits == "imperial"){ auw *=...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMaximumDigitizeUses() {\n var chips = getChips();\n return 1 + (chips.includes(\"TRAM\") ? 1 : 0) + (chips.includes(\"TRIGRAM\") ? 1 : 0);\n}", "_getMaxN() {\n const minDim = Math.min(this.width, this.height);\n if (minDim > 4.0 / 10.0) return 250;\n if (minDim > 4.0 / 100.0) return 1000;\...
[ "0.6513846", "0.6105238", "0.59731513", "0.594886", "0.5845602", "0.58254135", "0.5720629", "0.57028633", "0.56178844", "0.56112516", "0.5593257", "0.55910295", "0.5575262", "0.5575262", "0.5575262", "0.5575262", "0.5575262", "0.5575262", "0.5575262", "0.5575262", "0.5569482"...
0.7184857
0
This function, find_stall_speed, returns the stall speed in kmph, given the wing loading in grams per square decimetre.
function find_stall_speed(wing_loading){ // alert("260: wing loading = " + wing_loading + "gm/dm²"); var stall_speed; var Wldg; var rho_air = 1.25; //kg/m³, density of air at sea level var Cl_max = 1.0; //max lift coefficient of wing. Can vary with aerofoil, but 1.0 is usable approx Wldg = wing_loading / 100.0; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "kmhToMs(speed) {\n return speed / 3.6\n }", "function kmhToMs(speed) {\n speed /= 3.6;\n\treturn speed;\n}", "function cockroachSpeed(s){\n let m = (1000 * s);\n let cm = m * 100;\n return Math.floor(cm / 60 / 60);\n}", "msToKmh(speed) {\n return speed * 3.6\n }", "function...
[ "0.6024604", "0.5656412", "0.5615432", "0.5570867", "0.5551105", "0.553288", "0.55190545", "0.55135864", "0.54959154", "0.54647225", "0.54000443", "0.5382428", "0.53765005", "0.53620505", "0.53596425", "0.5349914", "0.5336142", "0.53111255", "0.53019196", "0.5288408", "0.5262...
0.8224662
0
new function to go through all props data and find those props that match the airframe requirements and motor power Jan 30, 2007 JC
function check_all_props_v2(prop_model,prop_coeffs,fudge,max_prop_rpm,count,prop_list,myplane,flag){ var i; var prop_rpm; var propdia, proppitch, propK, power_to_prop; var prop_pitch_speed, prop_thrust; var Vpitch_target = myplane.target_pitch_speed; //target pitch speed in kmph var pd_to_span_max = 0.7; //max p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkPowerRequirements() {\n for (let [tech, value] of Object.entries(this.definition.power_reqs ?? {})) {\n if (!haveTech(tech, value)){\n return false;\n }\n }\n return true;\n }", "function getProperties(props) {\n\t v...
[ "0.54717237", "0.5354864", "0.53105444", "0.52822536", "0.52817595", "0.52817595", "0.52817595", "0.5228438", "0.51030374", "0.50711685", "0.5063669", "0.50517154", "0.50236607", "0.50161994", "0.49767834", "0.49669328", "0.49406502", "0.493684", "0.493684", "0.49282828", "0....
0.63289356
0
find the best of the props that did NOT meet the pitch speed requirement (for instance, prop max size too small so pitch speed too high)
function find_best_bad_prop(nprops,prop_list,target_pitch_speed){ // alert("1540: Entered find_best_bad_prop."); var i, best_i, pitch_speed, min_delta, delta; if(nprops == 0){ //there were no suitable props found pitch_speed = 0; }else{ pitch_speed = prop_list[0].pitch_speed; //metres per sec pitch_speed *= 36...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_direct_drive_prop(nprops,prop_list){\n\tvar i, best_i, delta, delta_min;\n\tif(nprops == 0){\t//there were no suitable props found\n\t\tdelta_min = 0;\n\t}else{\n\t\tdelta_min = Math.abs(1.0 - prop_list[0].gear_ratio);\t//how far is the gear ratio from unity?\n\t}\n\tbest_i = 0;\n\tfor(i = 1; i < npr...
[ "0.67930615", "0.67130387", "0.5844889", "0.5684442", "0.54893535", "0.54562634", "0.5435498", "0.5390336", "0.53651536", "0.526672", "0.5249657", "0.5211957", "0.5203873", "0.5194164", "0.51876014", "0.5129412", "0.5128448", "0.5095529", "0.5089245", "0.50759536", "0.4992589...
0.7891378
0
calculate prop thrust in Kg given dia, pitch,prop constant, prop rpm, fudge factor Jan 30, 2007 JC
function find_prop_thrust(dia,pitch,K,rpm,fudge){ var thrust_kg; var thrust_oz; var p_eff; // prop static thrust(oz) = K P_eff D^3 RPM^2 x 1.1e(-10), where p_eff allows for high P/D props having proportionately less thrust p_eff = prop_effective_pitch(pitch,dia); thrust_oz = K * p_eff * dia * dia * dia * rpm * rpm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_prop_rpm(dia,pitch,K,power){\n\tvar prop_rpm = 0.0;\n// prop absorbed power(watts) = K P D^4 RPM^3 x 5.33e(-15)\n// prop static thrust(oz) = K P_eff D^3 RPM^2 x 1.1e(-10)\n\n// rearrange power equation to get:\n//prop rpm^3 = power/(K P D^4 x 5.33e(-15); take cube root of RHS to get rpm at which this...
[ "0.70268005", "0.6975853", "0.6569566", "0.58511317", "0.5823181", "0.57369334", "0.57085603", "0.5678871", "0.56558245", "0.5633846", "0.56299806", "0.56298095", "0.55821425", "0.5560165", "0.55556273", "0.5535242", "0.55342066", "0.553248", "0.55270326", "0.5520053", "0.550...
0.82193696
0
function to find the pitch speed of a propeller, given rpm and pitch Jan 30, 2007 JC
function find_prop_pitch_speed(pitch,rpm){ var pitch_speed; pitch_speed = pitch * rpm/1056; //prop pitch speed in mph // pitch_speed *= 1.609 * 1000.0/3600.0; //convert mph to metres/sec pitch_speed *= 1.609; //pitch speed in kmph return pitch_speed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_prop_rpm(dia,pitch,K,power){\n\tvar prop_rpm = 0.0;\n// prop absorbed power(watts) = K P D^4 RPM^3 x 5.33e(-15)\n// prop static thrust(oz) = K P_eff D^3 RPM^2 x 1.1e(-10)\n\n// rearrange power equation to get:\n//prop rpm^3 = power/(K P D^4 x 5.33e(-15); take cube root of RHS to get rpm at which this...
[ "0.68765306", "0.6274704", "0.61235905", "0.60900635", "0.60062766", "0.59883106", "0.58806115", "0.5863722", "0.57968265", "0.5754183", "0.5753216", "0.57433486", "0.5695161", "0.5667306", "0.563244", "0.56318897", "0.55923676", "0.55897176", "0.5560113", "0.54661685", "0.54...
0.87070465
0
function to find at what rpm a specified propeller absorbs a specified amount of power Jan 30, 2007 JC
function find_prop_rpm(dia,pitch,K,power){ var prop_rpm = 0.0; // prop absorbed power(watts) = K P D^4 RPM^3 x 5.33e(-15) // prop static thrust(oz) = K P_eff D^3 RPM^2 x 1.1e(-10) // rearrange power equation to get: //prop rpm^3 = power/(K P D^4 x 5.33e(-15); take cube root of RHS to get rpm at which this prop absorb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cruiseRPM (power, pa, isa) {\n\tvar rpm;\n\n\tswitch (power) {\n\tcase \"Max\":\n\t\t// The highest power setting in table is 83. The high power setting that's the lowest is 60.\n\t\t// Search from 83 downward to 60 until we find a setting that works.\n\t\tfor (power = 83; power >= 60; power--) {\n\t\t\tr...
[ "0.6059255", "0.6040585", "0.5987609", "0.5932468", "0.5919136", "0.5897523", "0.57702494", "0.5653622", "0.5567756", "0.55576223", "0.55364126", "0.55186063", "0.55076444", "0.549415", "0.5494027", "0.5481554", "0.546665", "0.5465761", "0.54653007", "0.54614604", "0.5451827"...
0.6955758
0
Crawl Every posts in "_Waiting" directory Only call when not crawling
async crawlFromList(){ this.crawling = true let errorList = [] let list = this.waitingList.pop() let content = fs.readFileSync(list, 'utf8').split('/n') for(let i = 0; i < content.length; i++){ let id = content[i] let result ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function crawlerAllPages (url) {\n cra.queue({ //Crawl the given url\n uri: url,\n callback: async (e, res, done) => {\n if(e) {\n throw e;\n } \n else {\n let $ = res.$; //Contain all the content of the web page\n ...
[ "0.65951145", "0.64041865", "0.6318391", "0.59620774", "0.5756829", "0.5672107", "0.56617653", "0.56538326", "0.56292087", "0.5583294", "0.5563297", "0.5556944", "0.5528007", "0.5521257", "0.5489253", "0.54851145", "0.5484062", "0.54479814", "0.541494", "0.54055744", "0.53995...
0.6633751
0
DELETE Method Remove members from a community
function removeMembersFromCommunity(domainName, data, done) { const arr = []; const query = (`DELETE FROM ${COMMUNITY_MEMBERSHIP_TABLE} WHERE username =? AND domain = ? IF EXISTS`); data.forEach((val) => { arr.push({ query, params: [val.username.toLowerCase(), domainName.toLowerCase()] }); }); return cli...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteCommunity(success, error, data) {\n\tdebug('delete community with slug');\n\n\tvar self = this\n\t\t, resident = self.req.user\n\t\t, eventbus = self.app.get('eventbus')\n\n\t\t/* AnonymousFunction: forwardError\n\t\t * Forwards an error object using the error callback argument\n\t\t */\n\t\t, forwa...
[ "0.6356452", "0.63143885", "0.6172232", "0.6086341", "0.591993", "0.5888464", "0.5794656", "0.5779124", "0.57721335", "0.5761432", "0.57460463", "0.57421964", "0.5738493", "0.57301414", "0.5729473", "0.5720928", "0.5711442", "0.5698293", "0.5695196", "0.56901985", "0.5678556"...
0.7306962
0
PATCH Method Modify role of a members in a community
function modifyRoleOfMembersFromCommunity(domainName, data, done) { const arr = []; const query = (`UPDATE ${COMMUNITY_MEMBERSHIP_TABLE} SET role =? ,updatedon = dateof(now()) WHERE domain =? AND username =? IF EXISTS `); data.forEach((val) => { arr.push({ query, params: [val.role.toLowerCase(), domainN...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update({ role, body }, res) {\n\t\tObject.assign(role, body);\n\t\trole.save()\n\t\tres.sendStatus(204);\n\t}", "async update({ request, response, auth }) {\n try {\n let body = request.only(fillable)\n const id = request.params.id\n const data = await Role.find(id)\n if (!data || data.len...
[ "0.7008997", "0.64985013", "0.63967437", "0.63667613", "0.6328707", "0.63170063", "0.6287661", "0.6267156", "0.62260497", "0.61378276", "0.6092821", "0.60119945", "0.59564096", "0.58505553", "0.58253837", "0.58248025", "0.58068687", "0.57681584", "0.5764584", "0.57137054", "0...
0.6954111
1
each matrix[i] represents sums of seq of size i from 0 to k1 for each matrix[i][j] j represents sum of window where windowEnd = j so for size 5 at 0,4 would be found at matrix[4][4], matrix[4][5] would be 1,5 and so on
function largestSumSubarrayAtMostSizeK(arr, k){ var matrix = new Array(arr.length); var maxSum = Math.NEGATIVE_INFINITY; for(var i = 0; i < arr.length; i++){ matrix[i] = new Array(arr.length); // init ele of size 1 here matrix[0][i] = arr[i]; maxSum = max(maxSum, arr[i]); } console.log(matrix); for(var wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matrixElementsSum(matrix) {\n let floors = matrix.length\n let arr = []\n if (floors === 1) {return matrix[0].reduce((prev, cur) => prev + cur)}\n for(let i=0;i<matrix.length;i++){\n for(let j=0;j<matrix[i].length;j++){\n if(matrix[i][j]===0){\n let floor = i\n while(floor<floors...
[ "0.600754", "0.5985602", "0.5883024", "0.5705054", "0.569834", "0.5671948", "0.55755144", "0.5536152", "0.5524596", "0.5456202", "0.5407864", "0.5400865", "0.5388376", "0.53847647", "0.53796077", "0.53498614", "0.53427154", "0.528757", "0.5276759", "0.52599066", "0.52551466",...
0.64242864
0
function to load the videos
function loadVideos() { $.getJSON(URL, options, function(data){ videoLoop(data); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadVideos(url) {\n $(\"#masterImage\").hide();\n $(\"#externalVideo\").hide();\n $('#videoplayer').show();\n\n $('#videoplayer > video > source').attr('src', url);\n $('#videoplayer > video > embed').attr('src', url);\n ...
[ "0.8151236", "0.80610716", "0.79937184", "0.7846081", "0.782237", "0.7693644", "0.764384", "0.76319927", "0.7577244", "0.7577244", "0.75091195", "0.7382994", "0.73533154", "0.73533154", "0.7350783", "0.7316766", "0.72951883", "0.7244769", "0.72029257", "0.7148324", "0.7125986...
0.817425
0
data for all the videos
function videoLoop(data) { $.each(data.items, function(i, item){ const thumb = item.snippet.thumbnails.maxres.url; const title = item.snippet.title; const description = item.snippet.description.substring(0,100); const descriptionLong = item.snippet.description; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function getVideoData() {\n let response = await fetch(url);\n\n if (response.ok) {\n // if HTTP-status is 200-299\n // get the response body (the method explained below)\n let json = await response.json();\n console.log(json);\n videos = [];\n\n json.forEach((...
[ "0.6826042", "0.67791635", "0.6638215", "0.6476049", "0.6472202", "0.64652234", "0.64238006", "0.64168483", "0.64035827", "0.6397803", "0.6352869", "0.6346692", "0.6332128", "0.63100785", "0.6303792", "0.62854695", "0.62597466", "0.6251647", "0.6248073", "0.62398934", "0.6232...
0.71755177
0
input :regions output : merged regions
function fixed(regions) { if (regions.length==1) { return regions; } //for now it use two only.//TODO multi regions. if (nearby$1(regions[0],regions[1])) { return [merge$1(regions[0],regions[1])] } else { return regions } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "linearizeRegions() {\n let regions = [];\n let linearize = (region) => {\n if (Object.values(region.regions) == 0) {\n return region;\n } else {\n return Object.values(region.regions).map(r => linearize(r));\n }\n };\n return linearize(this.region);\n }", "loadRegions(re...
[ "0.64774555", "0.6344107", "0.6157079", "0.6060501", "0.5919268", "0.58785146", "0.58429873", "0.58417976", "0.5797234", "0.571326", "0.5700063", "0.56763554", "0.5675771", "0.5660881", "0.5633672", "0.5628447", "0.5584908", "0.5557538", "0.5539722", "0.55391896", "0.5377478"...
0.6766089
0
initialize the datatable used for the dashboard page, as well as the datatable search controls.
function _setupDashboardDataTable(options) { var _options = $.extend({}, options); _extendSorting(); // set the project selector to the last project viewed from this page // if not found, then select the first item var prevSelected = $.cookie("tdar_datatable_selected_project"); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\tvar table = \"t\";\n//\tvar processing = \"r\";\n\tvar length = \"l\";\n\tvar info = \"i\";\n\tvar pagination = \"p\";\n\t\n\t$('#songs').DataTable({\n//\t\t\"processing\": true,\n\t\t\n\t\t\"dom\": \n\t\t\tgetTag(\"panel-body\", table /*+ processing*/) +\t\t\t\n\t\t\tgetTag(\"panel-footer\",\...
[ "0.704216", "0.6878411", "0.68424064", "0.6835214", "0.67742795", "0.67294437", "0.67000043", "0.6650712", "0.66497165", "0.66196775", "0.6609436", "0.65664697", "0.64903045", "0.6469842", "0.6458865", "0.6448201", "0.6406318", "0.6402276", "0.6391869", "0.63877904", "0.63873...
0.72007006
0
row unselected callback: remove the row of the "selected records" table
function _rowUnselected(obj) { // console.log('removing selected reosurce:' + obj.id); $('#hrid' + obj.id).remove(); var $row = $('#dtr_' + obj.id); var $table = $row.closest('table'); // var $div = $row.closest('div'); $row.remove(); if ($table.find('tr').length...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rowDeselect(grid) {\r\n var $selectedRow = getSelectedRow(grid)\r\n if (!$selectedRow.length) {\r\n return\r\n }\r\n $selectedRow.removeClass(classes.selected)\r\n}", "function BocList_UnselectRow (bocList, rowBlock)\n{\n // Remove currentRow from list\n var selectedRows = _bocList_selectedRow...
[ "0.7251755", "0.7227031", "0.72186935", "0.7206334", "0.71667325", "0.71074873", "0.7047379", "0.69351786", "0.674428", "0.6667474", "0.66663355", "0.66248316", "0.6614906", "0.66110677", "0.6589163", "0.6571894", "0.6494561", "0.64903224", "0.64894515", "0.64748824", "0.6444...
0.8092511
0
Transforms options into an object suitable for got to use as a body. This can be one of two things: A FormCanBeURLEncoded object, which is just a keyvalue object where the values have been flattened and got can serialize it into application/xwwwformurlencoded content type. A BodyCanBeFormMultipart: when the options inc...
serializeApiCallOptions(options) { // The following operation both flattens complex objects into a JSON-encoded strings and searches the values for // binary content let containsBinaryData = false; const flattened = objectEntries(options) .map(([key, value]) => { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function normalizeOpts(options, config) {\n var opts = utils.extend({}, options);\n var json = opts.json;\n var keys = Object.keys(config).concat(['headers', 'method', 'url', 'params']);\n var body = utils.omit(opts, keys);\n var text;\n\n if (/markdown\\/raw/.test(opts.url)) {\n text = opts.body;\n }\n\...
[ "0.63196504", "0.63064617", "0.603267", "0.59413373", "0.59182334", "0.588201", "0.58756375", "0.5875009", "0.5875009", "0.5868153", "0.57771343", "0.56141037", "0.5547425", "0.54513204", "0.5416335", "0.5416335", "0.5416335", "0.5416335", "0.5416335", "0.5416335", "0.5416335...
0.6725153
0
Determines whether a request body object should be treated as FormDataencodable (ContentType=multipart/formdata).
function canBodyBeFormMultipart(body) { // tried using `isStream.readable(body)` but that failes because the object doesn't have a `_read()` method or a // `_readableState` property return isStream(body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}", "function isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof FormData;\n}", "function isFormData(value) {\n return typeof FormData !== 'undefined' && value instanceof ...
[ "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.75918525", "0.7282544", "0.7180441", "0.7072836", "0.6059707", "0.604828", "0.604828", "0.6...
0.7594671
0
exports the list of orders between some date range
static async export(req, res) { try { const filter = { dt_created: { $gte: new Date('1900-01-01T00:00:00'), }, deleted: false, }; if (req.query.dateStart) { filter.dt_created.$gte = new Date(req.query.dateStart); } if (req.query.dateEnd) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async index(req, res) {\n let {currentPage, pageSize, date} = req.query;\n let page = currentPage ? parseInt(currentPage) : 0\n let perPage = pageSize ? parseInt(pageSize) : -1\n\n let options = {\n perPage: perPage,\n page: page,\n filters: {\n deliveryDate: {\n $gte: Da...
[ "0.6670655", "0.6074972", "0.6026233", "0.6016545", "0.59442127", "0.5881008", "0.5850843", "0.5672453", "0.56363416", "0.5593833", "0.5567073", "0.55484253", "0.55008876", "0.54586774", "0.541632", "0.5404659", "0.5401083", "0.53423977", "0.53264934", "0.53115755", "0.527960...
0.6847065
0
send notification on order creation
static async _sendOrderSuccessNotification(order) { try { const customer = await Customer .findOne({ _id: order.customer_id, deleted: false, }) .populate('user'); if (customer) { await EmailController.processEmail( `Souk New Order [#${order....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static async createOrder({ quantity }) {\n //send text\n await sendSms(\n process.env.ORDER_HANDLER_NUMBER,\n `New Order received for ${quantity}`\n );\n\n //store the order\n const order = await Order.insert({ quantity });\n\n return order;\n }", "_create() {\n OrdersControll...
[ "0.7004419", "0.69802487", "0.65367603", "0.6523967", "0.6495819", "0.6476777", "0.64190066", "0.6365057", "0.629284", "0.62414813", "0.62397", "0.6203828", "0.6067681", "0.60524607", "0.6021081", "0.59979075", "0.5980987", "0.5975143", "0.5935428", "0.5922411", "0.59113413",...
0.7226788
0
send notification on order refund
static async _sendRefundNotification(order) { try { const customer = await Customer .findOne({ _id: order.customer_id, deleted: false, }) .populate('user'); if (customer) { await EmailController.processEmail( `Your Souk Partially Refunded Or...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function send_refund_email() {\n uuid = get_uuid();\n WpAjax.get({\n action: 'send_email',\n order_id: $scope.order.order_id,\n order_uuid: uuid,\n order_coin: $scope.altcoinselect,\n refund_address: $scope.altrefund\n });\n }", "func...
[ "0.71909803", "0.65161717", "0.6328377", "0.6317095", "0.61969346", "0.61347437", "0.6129306", "0.60409385", "0.6028868", "0.5879971", "0.584964", "0.5810399", "0.56528264", "0.5621157", "0.5613813", "0.56124413", "0.5587499", "0.5572507", "0.55711204", "0.5542328", "0.554038...
0.8205709
0
Breadth first search from the given vertex index and the maximum distance to cover > could also pass a function to test instead of distance
BFS(start_index, max_distance) { /* let visited = new Array(); let queue = new Array(); visited.push(start_index); queue.push(start_index); let start_vertex_position = [0, 0, 0]; this.populateAllocatedVertexPosition(start_index, start_vertex_position); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bfsSearch(startingVertex) {\n console.log('BFS search -> ')\n const queue = new Queue();\n const visitedVertex = [];\n if(!this.adjacencyList[startingVertex])\n return;\n queue.enqueue(startingVertex);\n while(!queue.isEmpty()) {\n const currentVertex = queue.dequeue();\n console.l...
[ "0.6789869", "0.6388294", "0.63104546", "0.6238285", "0.61874735", "0.602462", "0.5966663", "0.5962276", "0.59340477", "0.5919284", "0.5915392", "0.59143317", "0.5910702", "0.5900362", "0.5891151", "0.5851997", "0.5838459", "0.5811295", "0.5765276", "0.5733538", "0.57326555",...
0.7103732
0
p_world is the world coordiantes of the point to test
isPointInside(p_world) { m4.multiplyVec3Test(this.view_matrix, p_world, this.p_world); if (windingNumber(this.p_world, this.data.positions) > 0) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTileWorld(xp, yp){\n var x = xp-this.offset.x; \n var y = yp-this.offset.y;\n if(x<0||x>this.width-1){return false;}\n if(y<0||y>this.height-1){return false;}\n return this.map[y][x];\n }", "WorldToViewportPoint() {}", "function isAlive (x, y, world) {\n const { arr, r...
[ "0.65684205", "0.6166629", "0.61617035", "0.61545247", "0.6112655", "0.60442394", "0.59998137", "0.596268", "0.59173137", "0.5871832", "0.5859986", "0.57656217", "0.5720921", "0.5698276", "0.56765276", "0.5667276", "0.5648719", "0.56473446", "0.5616271", "0.55977917", "0.5592...
0.72776985
0
moves along the plane defined by the camera's target vector and up vector
panAlongPlane(horizontal, vertical) { let horizontal_axis = vec3.normalize(vec3.cross(this.up, vec3.normalize(vec3.subtract(this.position, this.target)))); let vertical_axis = vec3.normalize(vec3.cross(vec3.normalize(vec3.subtract(this.position, this.target)), horizontal_axis)); let h = vec3.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movePlane()\r\n{\r\n eyePt[0] += viewDir[0]*speed;\r\n eyePt[1] += viewDir[1]*speed;\r\n eyePt[2] += viewDir[2]*speed;\r\n}", "function moveCamera() {\n console.log(\"moveCamera \",center,cam);\n camera.position.copy(Orbit(center, cam.horizontal, cam.vertical, cam.distance));\n camera....
[ "0.7280876", "0.68117803", "0.6645551", "0.66152436", "0.65022177", "0.64870447", "0.6467928", "0.64218783", "0.63740855", "0.6363247", "0.6308325", "0.6293813", "0.62749237", "0.62719584", "0.6233106", "0.61930454", "0.61784816", "0.6154196", "0.6154196", "0.6154196", "0.615...
0.74154663
0
Sort by Descending Metro Pop
function descending(a, b) { if (parseInt(a.metro_population) > parseInt(b.metro_population)) return -1; if (parseInt(a.metro_population) < parseInt(b.metro_population)) return 1; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortByPopularity() {\n\t\t//Make a copy of the initialArray and the sort function\n\t\tlet copiedContacts = [...contacts];\n\n\t\t//Sorting descending\n\t\tcopiedContacts.sort((a, b) => b.popularity - a.popularity);\n\n\t\t//Another form to sort??\n\t\t// copiedContacts.sort((a, b) => {\n\t\t// \tif (b.po...
[ "0.6691744", "0.6589753", "0.6589753", "0.65113634", "0.65067804", "0.64612097", "0.63510376", "0.6283171", "0.6238862", "0.6189509", "0.61546606", "0.6103711", "0.6095706", "0.60792524", "0.60311896", "0.6026297", "0.60248536", "0.60226834", "0.5969973", "0.59682906", "0.596...
0.6747352
0
Is called when we brush on scatterplot 1
function update_scatterplot(brushEvent) { extent = brushEvent.selection; //Check all the circles that are within the brush region dots.classed("selected", (d) => { if (isBrushed(extent, x_scatter(d.property_crime), y_scatter(d.violent_crime)) && !selectedDots.has(d)) { selectedDots.add(d) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateChart1(brushEvent) {\n //TODO: Check all the circles that are within the brush region in Scatterplot 1\n extent = brushEvent.selection;\n myCircle1.classed(\"selected\", function(d){ return isBrushed(extent, x1(d[xKey1]), y1(d[yKey1]) ) } )\n svg2.selectAll(\"circle\").classed(\"selected\", func...
[ "0.7165653", "0.71005577", "0.7098656", "0.70796704", "0.70213085", "0.6997256", "0.69732535", "0.69555354", "0.69239634", "0.68922687", "0.6830227", "0.6811423", "0.6800875", "0.67975163", "0.6785675", "0.67752886", "0.6737695", "0.6732521", "0.6730938", "0.6712469", "0.6708...
0.75071824
0
Check if location have in film
checkIsLocationInFilm(listFilm, filmId) { let checkFlag = false; for (let i = 0; i < listFilm.length; i++) { if (listFilm[i].includes(filmId)) { checkFlag = true; break; } } return checkFlag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkLocation() {\r\n\t\t\r\n\t\t$scope.isRussia = false;\r\n\t\t\r\n\t\tangular.forEach($rootScope.locations, function(loc){\r\n\t\t\t\r\n\t\t\tif($rootScope.location == loc.id && loc.isRussia){\r\n\t\t\t\t$scope.isRussia = true;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function locationMatch(places, destinatio...
[ "0.6408273", "0.6040217", "0.60022056", "0.5984422", "0.5900446", "0.5838033", "0.57536167", "0.57398623", "0.5737292", "0.5734181", "0.57082033", "0.5705166", "0.5701508", "0.56966686", "0.5667252", "0.5647535", "0.55886", "0.55869883", "0.55781204", "0.5573947", "0.5572665"...
0.70282716
0
Fetch Location In List Film
async fetchLocation() { const url = "https://ghibliapi.herokuapp.com/locations"; const data = await fetch(url); const listLocations = await data.json(); let listLocationsInFilm = []; listLocations.forEach((location) => { if ( this.checkIsLocationInFilm( location.films, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovies(loc) {\r\n\tvar nearLocation;\r\n /*\r\n * Make the url compatible\r\n */\r\n nearLocation = loc.replace(/ /g, '%2B');\r\n nearLocation = nearLocation.replace(/'/g, '%2527');\r\n nearLocation = nearLocation.replace(/,/g, '%252C');\r\n stageComp(9);\r\n /*\r\n * Ajax...
[ "0.671937", "0.6333843", "0.62738407", "0.6109488", "0.60482025", "0.59108984", "0.58826685", "0.5878256", "0.58604807", "0.57838255", "0.5777589", "0.56984156", "0.5695251", "0.5668097", "0.56478614", "0.5633616", "0.55981284", "0.5593827", "0.55834216", "0.5582545", "0.5581...
0.7142617
0
Check if people have in film
checkIsVehicleInFilm(filmsLink, filmId) { if (filmsLink.includes(filmId)) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIsPeopleInFilm(listFilm, filmId) {\n let checkFlag = false;\n for (let i = 0; i < listFilm.length; i++) {\n if (listFilm[i].includes(filmId)) {\n checkFlag = true;\n break;\n }\n }\n return checkFlag;\n }", "function has_movie(movie){\r\n for(i=0;i<movie_db.length;i++...
[ "0.714343", "0.66040725", "0.63842535", "0.6174889", "0.6147365", "0.6049867", "0.59948224", "0.59444463", "0.58858454", "0.58452743", "0.5810566", "0.58003104", "0.5792232", "0.5765414", "0.5763812", "0.5763075", "0.57401544", "0.5727663", "0.57267743", "0.57081795", "0.5689...
0.67071134
1
Check if people have in film
checkIsPeopleInFilm(listFilm, filmId) { let checkFlag = false; for (let i = 0; i < listFilm.length; i++) { if (listFilm[i].includes(filmId)) { checkFlag = true; break; } } return checkFlag; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkIsVehicleInFilm(filmsLink, filmId) {\n if (filmsLink.includes(filmId)) return true;\n return false;\n }", "function has_movie(movie){\r\n for(i=0;i<movie_db.length;i++){\r\n if(movie_db[i].Title != movie.Title){ \r\n return false;\r\n }\r\n return true;\r\n\r\n ...
[ "0.67071134", "0.66040725", "0.63842535", "0.6174889", "0.6147365", "0.6049867", "0.59948224", "0.59444463", "0.58858454", "0.58452743", "0.5810566", "0.58003104", "0.5792232", "0.5765414", "0.5763812", "0.5763075", "0.57401544", "0.5727663", "0.57267743", "0.57081795", "0.56...
0.714343
0
Fetch People In List Film
async fetchPeople() { const url = "https://ghibliapi.herokuapp.com/people"; const data = await fetch(url); const listPeople = await data.json(); let listPeopleInFilm = []; listPeople.forEach((people) => { if ( this.checkIsPeopleInFilm(people.films, this.props.match.params.filmId) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async bringFilms(req, res) {\n try {\n const films = await Film.find();\n res\n .status(200)\n .json(films);\n } catch (error) {\n res\n .status(400)\n .json({\n message: err\n ...
[ "0.6577952", "0.63285357", "0.63073236", "0.62756544", "0.6273742", "0.62553805", "0.61909723", "0.61806065", "0.6167114", "0.61191493", "0.6026392", "0.5992235", "0.5962813", "0.5962745", "0.5952483", "0.59493744", "0.5944439", "0.5934891", "0.59071076", "0.5830695", "0.5828...
0.67762285
0
Called when the mouse enters the card element
function cardMouseEnterHandler () { var quality = jwCard.featured ? FEATURED_CARD_THUMBNAIL_QUALITY : DEFAULT_CARD_THUMBNAIL_QUALITY; mouseOver = true; // thumbnails are not loaded yet thumbstrip .load(thumbnailsTrack.file, quality) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function enter(event){\n $card.addClass(settings.hoverInClass+\" \"+settings.hoverClass);\n currentX = currentY = 0;\n setTimeout(function(){\n $card.removeClass(settings.hoverInClass);\n }, 1000);\n }", "function onMouseEnter() {\n LxNotificationService.success('...
[ "0.759902", "0.72543234", "0.71676934", "0.7124789", "0.7029635", "0.68843704", "0.6832805", "0.6832805", "0.6773275", "0.6741276", "0.6665581", "0.6659087", "0.6650554", "0.6647825", "0.6641114", "0.6635267", "0.6634079", "0.66158533", "0.6614496", "0.65710914", "0.6568078",...
0.74435794
1
Called when the mouse leaves the card element
function cardMouseLeaveHandler () { mouseOver = false; // reset index thumbnailIndex = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function leave() {\n $card.addClass(settings.hoverOutClass + \" \" + settings.hoverClass);\n $card.css({\n perspective: settings.perspective + \"px\",\n transformStyle: \"preserve-3d\",\n transform: \"rotateX(0) rotateY(0)\"\n });\n setTimeout(function () {\n ...
[ "0.81098455", "0.7585416", "0.7142886", "0.69203824", "0.688121", "0.68654084", "0.68292534", "0.6802572", "0.6796989", "0.6761557", "0.6685472", "0.6671726", "0.6667784", "0.6656936", "0.6655227", "0.66482425", "0.66189677", "0.65990853", "0.65825105", "0.65804166", "0.65441...
0.81586283
0
Replace current poster with default item poster
function showDefaultPoster () { var posterElement; // show thumb of current progress when a thumbnailsTrack is defined and feedid is continue watching if (true === progressPreview) { return thumbstrip .load(thumbnailsTrack.fi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setVideoPoster(ref) {\n document.getElementById('video').setAttribute('poster','images/'+ref+'.jpg');\n}", "setPoster(poster, passive = true) {\n // Don't override if call is passive\n if (passive && this.poster) {\n return Promise.reject(new Error('Poster already set'));\n }\n\n // ...
[ "0.5923869", "0.5921678", "0.5868318", "0.58182484", "0.5783131", "0.574061", "0.5738237", "0.5716634", "0.5672006", "0.5562634", "0.5550554", "0.55441535", "0.5518609", "0.54656655", "0.5457111", "0.54486996", "0.5418613", "0.53532267", "0.5266989", "0.5261573", "0.52306986"...
0.6787403
0
Show thumbnail closes to the item's progress
function showProgressThumbnail () { var position = jwCard.item.progress * jwCard.item.duration; thumbstrip .getThumbnails() .then(function (thumbnails) { return thumbnails.find(function (item) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleThumbnailClick() {\n this.modal.openModal();\n\n var slideIndex = this.photoId;\n this.modal.showPhoto(slideIndex);\n }", "function showThumbnail() {\n\t\t$('#' + $series[index] + '_video_thumbnail').show();\n\t}", "function thumbnailClick(event)\n{\n\tif(!$(\"#full_view\").is(\":...
[ "0.6554428", "0.6428704", "0.642394", "0.63647896", "0.62907636", "0.6110175", "0.6068962", "0.5988381", "0.5981711", "0.59808767", "0.59643984", "0.5922718", "0.5901995", "0.5860512", "0.5857491", "0.58051586", "0.58032846", "0.5781873", "0.5777635", "0.5752643", "0.57077724...
0.75488144
0
Show thumbnail closest to the item's position
function showPositionThumbnail (url, position) { thumbstrip.load(url, SEARCH_THUMBNAIL_QUALITY) .then(function (thumbnails) { return thumbnails.find(function (item) { return item.start <= position && item.end >= position; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blog_listing_tape_position() {\n var current_item = jQuery('.current_item'),\n current_item_width = current_item.find('img').width(),\n prev_item = jQuery('.prev_item'),\n next_item = jQuery('.next_item'),\n prev_item_2 = jQuery('.prev_item_2'),\n next_item_2 = jQuery('.next_item...
[ "0.61370385", "0.61141396", "0.60823315", "0.6057213", "0.59552443", "0.59546924", "0.59160775", "0.59160775", "0.5861483", "0.5860291", "0.5860291", "0.584035", "0.58342457", "0.5758412", "0.5742193", "0.5698386", "0.5697073", "0.5691162", "0.563237", "0.5625446", "0.5621476...
0.6413604
0
Update to the next thumbnail, this functions repeats itself after the THUMBNAIL_AUTOMATIC_INTERVAL timeout.
function showNextThumbnail () { if (!mouseOver) { showDefaultPoster(); return; } thumbnailIndex = thumbnailIndex + 1; thumbstrip .getThumbnails() .then(function (thumbnails)...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setThumbUrls(item) { setTimeout(() => { setThumbUrl(item, 0) }, 5000) }", "function startInterval() {\n setInterval(displayNextImage, 50);\n}", "function nextButton() {\n 'use strict';\n var thumbnails = getThumbnailsArray();\n //if the current image is the last, go to first image in the array\n...
[ "0.65114206", "0.62524503", "0.6068774", "0.60385686", "0.59370714", "0.59311044", "0.59095967", "0.5792404", "0.5778433", "0.57471186", "0.5741129", "0.5713329", "0.5708104", "0.57025945", "0.56916964", "0.56583893", "0.56343454", "0.5625523", "0.56156963", "0.5606848", "0.5...
0.7148619
0
Prepare depth and sort drawing array
function GraphDrawSort() { var X, Y, Z, X1, Y1, Z1, X2, Y2, Z2; for (var I = 0; I < GraphDCount; I++) { if (GraphD_[I].Type < 0) { GraphD_[I].X1 = GraphD_[I].Obj.X; GraphD_[I].Y1 = GraphD_[I].Obj.Y; GraphD_[I].Z1 = GraphD_[I].Obj.Z; GraphD_[I]....
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sort(x, y, diam, ids, level, group) {\n if (!ids.length) {\n return null;\n }\n\n // save first point as level representative\n var levelItems = levels[level] || (levels[level] = []);\n va...
[ "0.60869783", "0.60101336", "0.5904334", "0.5840472", "0.582974", "0.57115227", "0.5618026", "0.55868", "0.55849516", "0.55843234", "0.5584117", "0.55475336", "0.5542656", "0.55308294", "0.54813147", "0.546245", "0.5450858", "0.54490966", "0.54397374", "0.5419712", "0.5418664...
0.68565196
0
Build the neighbor list
function GraphBuildNeighbors(V) { V.NeiF = []; V.NeiB = []; V.NeiA = []; V.NeiO = []; V.NeiL = []; var IsF; var IsB; for (var I = 0; I < GraphECount; I++) { var E = GraphE_[I]; if (E.V1 != E.V2) { if (E.V1 == V) { IsF =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getNeighbors() {\n if (!this.mine) {\n for (let i = -1; i <= 1; i++ ) {\n for (let j = -1; j <= 1; j++) {\n let tempR = this.r + i;\n let tempC = this.c + j;\n if (tempR >= 0 && tempR < this.rs && tempC >= 0 && tempC < this.c...
[ "0.6887177", "0.6678084", "0.6578302", "0.64807796", "0.6464578", "0.64224803", "0.64027655", "0.6388262", "0.63685405", "0.6241982", "0.62122947", "0.62004715", "0.6186638", "0.6177843", "0.61712146", "0.6148116", "0.6146753", "0.61360013", "0.61059827", "0.6067737", "0.6050...
0.67910415
1
Count edges by vertice numbers
function GraphEdgeCount(V1, V2) { return GraphEdgeCountObj(GraphV_[V1], GraphV_[V2]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n for(var i=0, il=cells.length; i<il; ++i) {\n var c = cells[i]\n for(var j=0, jl=c.length; j<jl; ++j) {\n vc = max(vc, c[j])\n }\n }\n return vc+1\n}", "function countVertices(cells) {\n var vc = -1\n , max = Math.max\n f...
[ "0.6668167", "0.6668167", "0.6668167", "0.6668167", "0.6668167", "0.64937943", "0.6475466", "0.6433464", "0.6433464", "0.6433464", "0.63494366", "0.6254916", "0.618331", "0.61511415", "0.60715777", "0.6033393", "0.6015342", "0.59685194", "0.5928652", "0.59242886", "0.58410025...
0.67880523
0
Set text display for vertices or edges
function SetText(SetV, SetE) { if (SetV) { switch (TextVMode) { case 0: { for (var I = 0; I < GraphVCount; I++) { GraphV_[I].Text = GraphV_[I].Label; } } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function drawText() {\n\t\t\tparent.ctx.beginPath();\n\t\t\tparent.ctx.font = \"20px Arial\";\n\t\t\tparent.ctx.fillStyle = \"#555555\";\n\t\t\tparent.ctx.fillText(\"T=[ ]\", 6, 23);\n\t\t\tparent.ctx.closePath();\n\t\n\t\t\tparent.ctx.beginPath();\n\t\t\tparent.ctx.font = \"14px Arial\";\n\t\t\t//pa...
[ "0.63771635", "0.62155724", "0.61909527", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.61791366", "0.6136961", "0.6058907", "0.5998594", "0.5992715", "0.5976153", "0.5923541", "0.5918803", "0....
0.62510145
1
Undo line graph based on edgevertice array
function AlgorithmLineGraphUndo() { for (var I = 0; I < AlgorithmLineGraphUndoLabels.length; I++) { for (var II = 0; II < AlgorithmLineGraphUndoLabels[I].length; II++) { AlgorithmLineGraphUndoLabels[I][II] = GraphV_[AlgorithmLineGraphUndoLabels[I][II]]; } } StructImpo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function undo(g) {\n g.eachEdge(function(e, s, t, a) {\n if (a.reversed) {\n delete a.reversed;\n g.delEdge(e);\n g.addEdge(e, t, s, a);\n }\n });\n}", "function AlgorithmLineGraph()\n{\n AlgorithmLineGraphUndoStruct = StructExport();\n AlgorithmLineGraphUndoLabels = [];\n var Ver...
[ "0.67669886", "0.6727639", "0.65729606", "0.6517941", "0.642101", "0.642101", "0.6349325", "0.6331041", "0.63157254", "0.62723774", "0.62723774", "0.6228158", "0.62169343", "0.60794455", "0.6059083", "0.6048686", "0.6003646", "0.59544986", "0.59173197", "0.59093463", "0.58457...
0.69338787
0
moveDown() // Increase by 1 the value of player.row moveDown() // Increase by 1 the value of player.row moveRight() // Increase by 1 the value of player.col
move() { if (keyIsDown(moveDown)) { player.row += 1; } if (keyIsDown(moveUp)) { player.col -= 1; } if (keyIsDown(moveLeft)) { player.row -= 1; } if (keyIsDown(moveRight)) { player.col += 1; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveRight(){\n\tplayer.x += 1;\n\tcheckWin();\n}", "function doMove(row, col) {\n\tactivePlayer.score += points[row-1][col-1];\n\tpoints[row-1][col-1] = 0;\n\t$(\"#score\" + activePlayer.id.toString()).html(activePlayer.score);\n\trestoreGrid(activePlayer.row, activePlayer.col);\n\t\n\tactivePlayer.row ...
[ "0.7585487", "0.7503232", "0.7375329", "0.72458816", "0.72022027", "0.7048777", "0.70109165", "0.70103174", "0.6920779", "0.6919645", "0.6917008", "0.69142056", "0.68894506", "0.68401414", "0.68401414", "0.6837732", "0.68313825", "0.682611", "0.68066394", "0.6775935", "0.6767...
0.88944125
0
streaming file reader that does IO with webassembly module
function parseFile(fileData, wasmModule, callback) { // webassembly parameters var BUFFER_SIZE_BYTES = 5000000;//5000000; // needs to match #define in webassembly wasmModule.instance.exports.setInputBufferBytes(0); wasmModule.instance.exports.setOutputBufferBytes(0); wasmModule.instance.exports.setu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function script() {\n // Creating a stream through which each file will pass\n return through2.obj(function(file, enc, cb) {\n if (file.isNull()) {\n // return empty file\n cb(null, file);\n }\n if (file.isBuffer()) {\n file.contents = convert.buffer(file.contents);\n }\n if (file.i...
[ "0.60820305", "0.5957762", "0.59335256", "0.59007996", "0.5897557", "0.5836717", "0.5836717", "0.5782928", "0.573998", "0.57019067", "0.57019067", "0.56699926", "0.56699926", "0.56568724", "0.5613202", "0.5578284", "0.55762035", "0.5572629", "0.555056", "0.55433357", "0.55353...
0.6532877
0
Constructs a Mediator instance.
constructor(mediatorName, viewComponent) { super(); this.mediatorName= mediatorName || this.constructor.NAME; this.viewComponent=viewComponent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Mediator() {\n //Mediator.loadAllFromStart();\n }", "function createInstantiateMediator(_ref) {\n\t var UsedClass = _ref.UsedClass,\n\t updateFunction = _ref.updateFunction;\n\t\n\t return function mediator(value, previousValue, key, object) {\n\t if (previousValue instance...
[ "0.6217547", "0.586149", "0.57370794", "0.57007694", "0.5685778", "0.5426703", "0.53371656", "0.52966523", "0.52320045", "0.5187109", "0.5184728", "0.5048626", "0.50071317", "0.49811986", "0.49399802", "0.49216008", "0.49212992", "0.49020785", "0.4852393", "0.48387283", "0.48...
0.5990866
1
Get the Mediator instance name.
getMediatorName() { return this.mediatorName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get instanceName() {\n if (this._impl)\n return this._impl.getInstanceName();\n return undefined;\n }", "getName() {\n return this.instanceName;\n }", "get instanceNameInput() {\n return this._instanceName;\n }", "name() { return this.director.name(); }", "get name() {\n\t\t...
[ "0.7262329", "0.711042", "0.6406685", "0.63944614", "0.638472", "0.63295364", "0.6256286", "0.62002355", "0.6136192", "0.6112085", "0.60866004", "0.6071112", "0.6058593", "0.6051713", "0.6026753", "0.59922534", "0.59638786", "0.59638786", "0.59638786", "0.59638786", "0.596387...
0.73775846
0
Set the IMediator's view component.
setViewComponent(viewComponent) { this.viewComponent = viewComponent; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setView(initView) {\n this.view = initView;\n }", "setView(initView) {\n this.view = initView;\n }", "get view() {\n return this.mView;\n }", "setView(view) {\n this.setState({\n currentView: view\n })\n }", "constructor(mediatorName, viewComponent) {\n super();\n ...
[ "0.6913987", "0.6913987", "0.620929", "0.60173506", "0.59866446", "0.5977679", "0.58984095", "0.5791239", "0.574462", "0.5744444", "0.56975985", "0.56761354", "0.5633483", "0.56227636", "0.56008524", "0.55818194", "0.5483556", "0.5394657", "0.5393881", "0.5371323", "0.5357622...
0.71337885
0
Handle INotifications. Typically this will be handled in a switch statement, with one 'case' entry per INotification the Mediator is interested in.
handleNotification(notification) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onRecieved(event, notification) {\n if (ionic.Platform.isAndroid()) {\n handleAndroid(notification);\n }\n else if (ionic.Platform.isIOS()) {\n handleIOS(notification);\n }\n }", "function parseNotificationData() {\n var notificationData = NOTIFICA...
[ "0.54838157", "0.5466674", "0.53903174", "0.51624954", "0.5104284", "0.5093854", "0.5051731", "0.50457317", "0.5025986", "0.5024029", "0.50193477", "0.49942413", "0.49683362", "0.49619484", "0.49586555", "0.49290007", "0.4894276", "0.48891374", "0.4873443", "0.48326984", "0.4...
0.601832
0
They want to eat as much candy as they can, but each child must eat exactly the same amount of candy as any other child. Determine how many pieces of candy will be eaten by all the children together. INPUT: the number of children (n): 1 <= n <= 10 the number of candies (m): 2 <= m <= 100 OUTPUT: Number
function candies(n, m) { // Step1: Create a variable that will hold the number // of candies given to the children let counter = 0 // Step2: While the number of candies is larger than or // equal to the number of children, add the number of children // to counter (that get one piece of candy) and subtract the ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chocolateFeast(n, c, m) {\n //total number of chocolate bar bought & num of wrapper\n var numOfBar = Math.floor(n / c);\n var numOfWrapper = Math.floor(n / c);\n\n while (numOfWrapper >= m) {\n var leftOverWraps = numOfWrapper % m;\n var barExchanged = Math.floor(numOfWrapper / m...
[ "0.68889886", "0.6812877", "0.6256052", "0.62295675", "0.6223342", "0.61348796", "0.6011331", "0.59645146", "0.5956407", "0.5924013", "0.59152144", "0.5908127", "0.5903885", "0.5839645", "0.5784837", "0.5771772", "0.5764754", "0.57338643", "0.5716371", "0.5714876", "0.5695460...
0.8859109
0
Property getter for checking whether a connection is established.
get connected() { return !!this.connection && this.connection.readyState === 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get connecting() {\n return !!this.connection && this.connection.readyState === 2;\n }", "isConnected() {\n return this.connectionState() === 'open';\n }", "get connectionStatus() {\n return this._isConnected;\n }", "get connectionStatus() {\n var _a, _b;\n retur...
[ "0.8092783", "0.7964507", "0.7821128", "0.7694112", "0.768166", "0.76486665", "0.76361144", "0.7608273", "0.74989426", "0.74989426", "0.74989426", "0.74989426", "0.74706304", "0.7371815", "0.7334351", "0.72837657", "0.7282986", "0.71234995", "0.7073572", "0.7073572", "0.70405...
0.8046603
1
Property getter for checking whether a connection is being established.
get connecting() { return !!this.connection && this.connection.readyState === 2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get connected() {\n return !!this.connection && this.connection.readyState === 1;\n }", "isConnected() {\n return this.connectionState() === 'open';\n }", "getHasConnection(connectionState) {\n return connectionState === STATE_CONNECTED;\n }", "get connectionStatus() {\n ...
[ "0.8029759", "0.802382", "0.785868", "0.7834323", "0.77746326", "0.7714771", "0.7679751", "0.7662099", "0.7574611", "0.7574611", "0.7574611", "0.7574611", "0.7494488", "0.7478545", "0.73571014", "0.73543686", "0.7248197", "0.7192505", "0.7146198", "0.70896786", "0.70717794", ...
0.80563706
0
Model contains subjectCode: string, questions: object of type Question
constructor (subjectCode, questions) { this._subjectCode = subjectCode this._questions = questions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Quiz(questions) {\n this.questions = questions;\n return this;\n}", "getQuestions() {\n return this.questions;\n }", "function Quiz(questions) {\n this.score =0;\n this.questions= questions;\n this.questionIndex =0;\n}", "function Quiz(questions){\n this.score = 0;\n thi...
[ "0.6465512", "0.62478995", "0.62389207", "0.6226237", "0.622621", "0.61943924", "0.61868155", "0.6157492", "0.6149205", "0.6138138", "0.61314774", "0.6126612", "0.6115042", "0.61070204", "0.61060715", "0.60825914", "0.6069554", "0.60152", "0.60056585", "0.6000582", "0.5972882...
0.7431299
0
Lifecycle (componentDidMount) implement Action getBookings to call API
componentDidMount() { this.getListBookings(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillMount(){\r\n\tthis.getBookings();\r\n}", "componentDidMount() {\n api\n .getAllBookings()\n .then(resp => {\n this.setState({ bookings: resp });\n })\n .catch(console.error);\n }", "componentDidMount() {\n const id = this.props.match.params.id;\n LocalAPI.get(`...
[ "0.84976125", "0.7868319", "0.77329195", "0.7659039", "0.756667", "0.74684536", "0.74549335", "0.74523634", "0.74322045", "0.74271035", "0.7423929", "0.7389111", "0.7370577", "0.7370577", "0.73679817", "0.7366066", "0.7364624", "0.7360758", "0.7360459", "0.7360459", "0.734157...
0.8229655
1
Lifecycle (componentDidUpdate) close modal CreateBooking
componentDidUpdate(prevProps, prevState) { const { isSucessBooking } = prevProps; if (isSucessBooking) { this.refCreateBooking && this.refCreateBooking.close(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onCloseExisting () {\n\t\tif(this.state.EditExistingAlerts === true){\n\t\t\tthis.setState({EditExistingAlerts: false});\n\t\t}\n\t}", "_close() {\n\t\tif (this.isDestroyed) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scheduler = this.get('scheduler');\n\t\tconst element = this.element;\n\n\t\t// Close modal.\n\t\tth...
[ "0.64276326", "0.6380722", "0.63361424", "0.63081", "0.627007", "0.6255887", "0.62497747", "0.618507", "0.6172434", "0.6172434", "0.61658514", "0.61658514", "0.6156155", "0.61388004", "0.6134729", "0.61183137", "0.61183137", "0.60772914", "0.60772914", "0.60640955", "0.599789...
0.71075255
0
argv['includeidgenerator'] ? loadIdGeneratorPlugin() : clientOfExternalGeneratorService(9292, 'localhost'); argv['includenamegenerator'] ? loadNameGeneratorPlugin() : clientOfExternalGeneratorService(9393,'localhost');
function loadIdGeneratorPlugin(options) { seneca.use(require('./id_generator/idGeneratorPlugin'), options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPreCondition() {\n return helpers\n .run('generator-jhipster/generators/client')\n .withOptions({\n fromCli: true,\n skipInstall: true,\n skipServer: true,\n blueprints: 'nodejs',\n 'skip-i18n': true,\n skipChecks: true,...
[ "0.5662692", "0.5444017", "0.5211426", "0.51937264", "0.51539075", "0.5038025", "0.5023892", "0.5015394", "0.4996782", "0.4996782", "0.4996782", "0.4996782", "0.4996782", "0.4996782", "0.49916598", "0.49890414", "0.49890414", "0.49890414", "0.49890414", "0.49890414", "0.49890...
0.6171378
0
Example For inputString = "var_1__Int", the output should be firstDigit(inputString) = '1'; For inputString = "q2qq", the output should be firstDigit(inputString) = '2'; For inputString = "0ss", the output should be firstDigit(inputString) = '0'.
function firstDigit(inputString) { inputString = inputString.split(''); for(var i = 0; i < inputString.length; i++){ if(inputString[i] == '1' ||inputString[i] == '0' || inputString[i] == '1' || inputString[i] == '2' || inputString[i] == '3' || inputString[i] == '4' || inputString[i] == '5' || inputString[i] == ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstDigit(inputString) {\n return inputString.match(/\\d/)[0];\n}", "function parseFirstInt(input) {\n\n let inputToParse = input;\n \n for (let i = 0; i < input.length; i++) {\n let firstInt = parseInt(inputToParse);\n if (!Number.isNaN(firstInt)) {\n return firstInt;\n }...
[ "0.7851224", "0.67122126", "0.64974904", "0.6374874", "0.6281574", "0.62384796", "0.6148601", "0.60583776", "0.60029423", "0.59287655", "0.5914089", "0.59006083", "0.5878384", "0.58324534", "0.5824931", "0.5818725", "0.5801588", "0.5774288", "0.57704264", "0.5738105", "0.5723...
0.7273138
1
Usage : multiply the matrix contents by a scalar Arg : n scalar Return:
multiply(n) { for (let i = 0; i < this.rows; i++) { for (let j = 0; j < this.cols; j++) { this.matrix[i][j] *= n; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function multiply(arr, n) {\n var product = arr[0];\n for (var i = 1; i <= n; i++) {\n product *= arr[i];\n }\n return product;\n }", "function multiply(arr, n) {\r\n var product = 1;\r\n for (var i = 0; i < n; i++) {\r\n product *= arr[i];\r\n }\r\n return product;\r\n }"...
[ "0.7411773", "0.7307368", "0.7257791", "0.71969277", "0.7002521", "0.6879494", "0.6852794", "0.6847909", "0.67965007", "0.6755107", "0.6746636", "0.66893876", "0.666533", "0.6663106", "0.66273516", "0.66231304", "0.66168267", "0.6614133", "0.65862596", "0.65862596", "0.658611...
0.83802867
0
Usage : Adds a scalar to the matrix contents Arg : n scalar to add by Return:
add(n) { for (let i = 0; i < this.rows; i++) { for (let j = 0; j < this.cols; j++) { this.matrix[i][j] += n; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "add(input) //!throws ERRCODE103\r\n {\r\n // @param returnMatrix, the matrix that will be returned\r\n let returnMatrix = new Matrix(this.rows, this.cols);\r\n //check if it is a matrix\r\n if(input instanceof Matrix)\r\n {\r\n //if it is make sure it has the same d...
[ "0.64407295", "0.6355723", "0.6204036", "0.58599263", "0.5840457", "0.5669981", "0.5661546", "0.5659242", "0.5624218", "0.56163085", "0.5568283", "0.5568283", "0.55400723", "0.5485305", "0.54748553", "0.54253405", "0.5411439", "0.53872114", "0.5373921", "0.5373921", "0.537250...
0.7744648
0
Usage : subtracts a matrix from the current matrix Arg : matrix the matrix to subtract by Return:
subtract(matrix) { let newMat = new Matrix(this.rows, this.cols); if (this.matrix.rows == matrix.rows && this.matrix.cols == matrix.cols) { //can only subtract from equal sized arrays for (let i = 0; i < this.rows; i++) { for (let j = 0; j < this.cols; j++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "subtract(input) //!throws ERRCODE100\r\n {\r\n // @param returnMatrix, the matrix that will be returned\r\n let returnMatrix = new Matrix(this.rows, this.cols);\r\n //check if it is a matrix\r\n if(input instanceof Matrix)\r\n {\r\n //if it is make sure it has the s...
[ "0.7701846", "0.6637635", "0.6428175", "0.6409493", "0.6306615", "0.61042094", "0.6081697", "0.60796976", "0.60796976", "0.60796976", "0.6058546", "0.60468173", "0.60468173", "0.60468173", "0.60152864", "0.59962857", "0.5976796", "0.59729326", "0.5957319", "0.59403586", "0.59...
0.8412199
0
Usage : Runs the Matrix through a sigmoid equation (representing learning curves) Arg : Return:
activate() { let newMat = new Matrix(this.rows, this.cols); for (let i = 0; i < this.rows; i++) { for (let j = 0; j < this.cols; j++) { newMat.matrix[i][j] = this.sigmoid(this.matrix[i][j]); } } return newMat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sigmoid_matrix(m1){\n\tvar o;\n\to = init_matrix(m1.rows,m1.cols);\n\tfor(var i = 0;i<m1.rows;i++){\n\t\tfor(var j = 0;j<m1.cols;j++){\n\t\t\to.data[i].data[j] = 1.0/(1+Math.exp(-m1.data[i].data[j]));\n\t\t}\n\t}\n\treturn o;\n}", "function sigmoidActivation(netInput){\n return 1 / (1 + (Math.E ** -n...
[ "0.7621391", "0.68077284", "0.67420727", "0.67325205", "0.66857284", "0.6608245", "0.648193", "0.6468134", "0.6322496", "0.62876815", "0.62852", "0.62174416", "0.61777633", "0.61084336", "0.6093381", "0.5998331", "0.59939283", "0.59939283", "0.58728045", "0.5872778", "0.58274...
0.7227514
1
Usage : AntiBias. This method removes the bottom row of the matrix to remove the bias level Arg : Return:
removeBottom() { let newMat = new Matrix(this.rows - 1, this.cols); for (let i = 0; i < newMat.rows; i++) { for (let j = 0; j < this.rows; j++) { newMat.matrix[i][j] = this.matrix[i][j]; } } return newMat; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Bias() {\n\n let newMat = new Matrix(this.rows + 1, 1);\n for (let i = 0; i < this.rows; i++) {\n newMat.matrix[i][0] = this.matrix[i][0];\n }\n newMat.matrix[this.rows][0] = 1;\n return newMat;\n\n }", "function rightUpperAntenna() {\n\n instanceMatrix = mult(...
[ "0.6572121", "0.5668795", "0.56025743", "0.5553689", "0.5548017", "0.55458784", "0.53118193", "0.529293", "0.5284934", "0.5244684", "0.5244608", "0.51541984", "0.5111776", "0.5049011", "0.5042887", "0.4994889", "0.49848115", "0.49749354", "0.49464244", "0.48684096", "0.485018...
0.6041175
1
Usage : generates a random number for col and row maxes. rows and cols below this number come from the initial matrix; those after come from the mate. Used to produce a series of different child options for each //mate pair Arg : Return:
crossover(mate) { let child = new Matrix(this.rows, this.cols); let randCol = Math.floor(Math.random() * this.cols); let randRow = Math.floor(Math.random() * this.rows); for (let i = 0; i < this.rows; i++) { for (let j = 0; j < this.cols; j++) { if ((i < ra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matrixGenerator(matrixSize, grass, grassEater, Wolf , People , Tractor) {\n for (let i = 0; i < matrixSize; i++) {\n matrix[i] = [];\n for (let o = 0; o < matrixSize; o++) {\n matrix[i][o] = 0;\n }\n }\n for (let i = 0; i < grass; i++) {\n let customX = Math...
[ "0.63545865", "0.6262975", "0.62053347", "0.6138337", "0.60982174", "0.6054405", "0.60100836", "0.5970758", "0.5966287", "0.5922769", "0.5905477", "0.5901124", "0.5860431", "0.58537996", "0.5825474", "0.5781842", "0.5746681", "0.57449365", "0.5729021", "0.56989807", "0.569", ...
0.68136835
0
called when the googlegraph library is loaded.
function graphLibraryLoaded() { console.log("viz: load complete"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onGraphLoaded() {\n\n //TODO: Change reference length according to parsed graph\n this.axis = new CGFaxis(this, this.graph.axis_length);\n\n this.setGlobalAmbientLight(this.graph.ambient[0],this.graph.ambient[1],this.graph.ambient[2],this.graph.ambient[3]);\n this.gl.clearColor(this.gra...
[ "0.6945579", "0.6894811", "0.68069017", "0.6791405", "0.6781315", "0.6723839", "0.6667882", "0.6654201", "0.6650106", "0.66020405", "0.65763265", "0.6570821", "0.6562132", "0.6557056", "0.65248966", "0.65079135", "0.64718527", "0.63792926", "0.6371904", "0.6310103", "0.627839...
0.69879264
0
_repoSort is a comparison function that sorts more recently pushed repos first.
_repoSort(a, b) { if (a.PushedAt < b.PushedAt) return 1; else if (a.PushedAt > b.PushedAt) return -1; return 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortRepos(reposURL){\n reposData = fetchData(reposURL)\n \n return reposData.then((val)=>{\n val.sort((a, b)=>{\n return a.pushed_at < b.pushed_at\n })\n let repos = val\n findTopLanguage(repos)\n })\n }", "functio...
[ "0.67698205", "0.6238821", "0.59394145", "0.5816787", "0.57609606", "0.5697868", "0.56646514", "0.5659892", "0.56519675", "0.5636645", "0.56299996", "0.56067604", "0.55823016", "0.5577673", "0.5571477", "0.55614185", "0.55597645", "0.55243033", "0.55209565", "0.55209565", "0....
0.82113963
0
displays the next page of students
nextPage() { this.displayedStudents = this.students.slice(10 * this.currentPage, (10 * this.currentPage) + 10); this.currentPage++; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function goToNext() {\n studentRows = $(\".students-row\");\n var nbPages = Math.ceil(studentRows.length / studentsRowsPerPage);\n if (currentPage < nbPages) {\n goToPage(currentPage + 1);\n }\n}", "function nextPage() {\n viewPage(current_page + 1)\n}", "function next() {\n if (currentP...
[ "0.7460064", "0.73635185", "0.73293716", "0.7180764", "0.71628225", "0.7151755", "0.71243197", "0.7039996", "0.70156413", "0.69873124", "0.6968105", "0.69592935", "0.6939548", "0.69004446", "0.6859214", "0.68536216", "0.68498135", "0.6837077", "0.6834404", "0.68270516", "0.68...
0.7855403
0
displays the previous page of students
previousPage() { this.currentPage--; this.displayedStudents = this.students.slice(10 * (this.currentPage - 1), (10 * (this.currentPage - 1)) + 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previous_page() {\n if(currentPageInfo.previous_page !== undefined){\n loadPage(currentPageInfo.previous_page);\n }\n }", "function previous() {\n\tpage.number -= 1;\n\t\n\tpaginate();\n}", "function goPrevious() {\n if (pageNum <= 1)\n return;\n pageNum--;\n renderPa...
[ "0.7462377", "0.743823", "0.7410681", "0.7410681", "0.7355519", "0.73495185", "0.7339255", "0.73089194", "0.7280625", "0.7252987", "0.7244741", "0.7213193", "0.7206254", "0.7186359", "0.71840984", "0.718157", "0.7119852", "0.7088994", "0.7048558", "0.7028534", "0.7026745", ...
0.764584
0
conditions to disable the next button of the paginator
get disableNext() { return (this.currentPage == this.totalPages); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isNextDisabled(){\n\t\treturn this.props.totalPages >= this.state.page;\n\t}", "_nextButtonsDisabled() {\n return this.disabled || !this.hasNextPage();\n }", "_nextButtonsDisabled() {\n return this.disabled || !this.hasNextPage();\n }", "function disable_next( )\n{\n $( \"#paging-last\" ...
[ "0.8163767", "0.81060046", "0.81060046", "0.7729626", "0.769508", "0.75648046", "0.7528465", "0.7465123", "0.7424587", "0.7397421", "0.7354876", "0.7234662", "0.7207481", "0.7173253", "0.7100134", "0.7100134", "0.7082395", "0.7010856", "0.70069826", "0.6886151", "0.6833676", ...
0.82102627
0
conditions to disable the previous button of the paginator
get disablePrevious() { return this.currentPage == 1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_previousButtonsDisabled() {\n return this.disabled || !this.hasPreviousPage();\n }", "_previousButtonsDisabled() {\n return this.disabled || !this.hasPreviousPage();\n }", "isPreviousDisabled() {\n\t\treturn 1 >= this.state.page;\n\t}", "function previousPage() {\r\n if(currentPage >1){...
[ "0.79445577", "0.79445577", "0.78760695", "0.75220615", "0.7397767", "0.7375888", "0.7319209", "0.7310032", "0.72951645", "0.72951645", "0.72618103", "0.71962076", "0.71876013", "0.7153068", "0.7136575", "0.7135602", "0.7099721", "0.7083048", "0.70559543", "0.69948584", "0.69...
0.83208686
0
find all doctors in the doctors table who have a specialty that matches the current Doctor's create an object for all those doctors with certain needed values later, push each to an array
function createDocArray (currentDoctorSpecialty) { db.Doctors.findAll({ where: { primary_specialty: currentDoctorSpecialty } }).then (function (data) { for (var i = 0; i < data.length; i++) { docOb...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateSpecialities() {\n\n infoDoctor.forEach(function(doctor){\n\n doctor.specialities.forEach(function(speciality){\n\n\n if(!specialities.includes(speciality)){\n specialities.push(speciality);\n }\n });\n });\n}", "function search() {\n searched = [];\n vCards = [];\...
[ "0.67457664", "0.57511264", "0.559008", "0.551248", "0.5476909", "0.5436235", "0.54206806", "0.5379494", "0.52294505", "0.5130521", "0.50880694", "0.5026892", "0.50013155", "0.4968778", "0.4952711", "0.4930678", "0.4899981", "0.48428622", "0.48047233", "0.47797987", "0.477652...
0.65609485
1
take the doctors array and the totals array and find the max of the totals array and take the index of that in the doctors array and push it to the potentials array, do this for all the totals so as to resort the doctors array essentially
function getMatches (totalsArray, doctorsArray) { for (var j = 0; j < totalsArray.length; i++) { max = Math.max(...totalsArray); for (var i = 0; i < doctorsArray.length; i++) { if(doctorsArray[i].total === max) { potentialsArray.push(do...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doctorsSort (doctorsArray) {\n\n for (var i = 0; i < doctorsArray.length; i++) {\n totalsArray.push(doctorsArray[i].total);\n }\n\n getMatches(totalsArray, doctorsArray);\n\n }", "function findMax(totalsArray) {\n var max = 0;\n for(var i = 0; i < totalsArray...
[ "0.59984654", "0.5792633", "0.55168897", "0.54255635", "0.5312762", "0.5299046", "0.52080667", "0.5203478", "0.51747525", "0.5165369", "0.51248497", "0.5113757", "0.50996673", "0.50899893", "0.5008819", "0.497851", "0.49503735", "0.49454546", "0.4945006", "0.4941309", "0.4927...
0.74266744
0
take the best match doctor and hit the 'BETTER DOCTOR API' and get that doctor's full stats, picture, bio etc. send all of that to the front end as a docMatch object.
function getBestDoc(bestMatch, matchText, matchesArray) { var uid = bestMatch.bestdoc_id; console.log(uid); client.get("https://api.betterdoctor.com/2016-03-01/doctors/"+uid+"?user_key=d8943b3e452eb1a5bbf27cdab4f4bd92", function (data, response) { docMa...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMatch(matchID) {\n var cheerio = require('cheerio'),\n request = require('request');\n\n return new Promise(function (resolve, reject) {\n request({\n url: 'http://csgo.99damage.de/de/leagues/matches/' + matchID,\n headers: { 'User-Agent': 'Mozilla/5.0 (Windows...
[ "0.5503581", "0.5394713", "0.5309042", "0.53046566", "0.518628", "0.5149734", "0.51298624", "0.51031476", "0.50023484", "0.4966831", "0.49373084", "0.49369082", "0.49346837", "0.49296692", "0.49268454", "0.4899636", "0.48888397", "0.4885021", "0.48849627", "0.48844892", "0.48...
0.79609704
0
We have to register a root middleware inside the designated transport, so that we can intercept POST requests on the upload path.
function handleIncomingRequest(req, res, next) { // check if we're on the set upload path let matcher = matchHandler(req.path); if (!matcher) return next(); let handlerObj = matcher.handler, inputData = Object.assign({}, req.query, matcher.params); if (req.method === 'O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "configure() {\n // add auth middlewares here, e.g. passport\n this.server\n .use(cors())\n .use(morgan(\"combined\"))\n .use(express.urlencoded({ extended: false }))\n .use(express.json())\n .use(`/${this.apiPrefix}`, mainController)\n .use(errorsInterceptor)\n }", "init() {\...
[ "0.53757167", "0.5319565", "0.5307806", "0.5265219", "0.52413964", "0.5133941", "0.51263237", "0.51102585", "0.5061897", "0.5051558", "0.50067925", "0.50052786", "0.49988773", "0.49869776", "0.49626368", "0.49579263", "0.49477214", "0.4941809", "0.49129212", "0.4912048", "0.4...
0.57880205
0
Called to attach busboy to the request.
function attachBusboy(fileProcessFn, onDone) { delete intentObj._attachBusboy; if (!intentObj.fieldName) intentObj.fieldName = handlerObj.fieldName; let customLimits = intentObj.data('uploadLimits'); let busboyObj, busboyOpt = { headers: req.headers, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function busboy(req, res, next) {\n console.log(\"busboy called\");\n try {\n let bus = new Busboy({ headers: req.headers });\n // On file upload completion\n bus.on(\"finish\", () => {\n // files will now be available in req.files\n const files = req.files;\n const fileArr = [];\n /...
[ "0.6265897", "0.5916987", "0.5904987", "0.5537601", "0.5451401", "0.51570123", "0.5154057", "0.5048908", "0.5048908", "0.5048908", "0.5028285", "0.50260425", "0.49276713", "0.4905733", "0.4815176", "0.48046133", "0.47640023", "0.47584125", "0.47376585", "0.4737535", "0.468899...
0.6122833
1
Called to signal that the intent is done.
function onIntentCompleted(wasError, data, intentObj) { let fileObj = intentObj.data('file'); if (fileObj && fileObj.error) { let err = fileObj.error; fileObj.destroy(); return next(err); } if (wasError) { next(data); if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Done() {\n this.done = true;\n\n this.reply.type(this.responseContentType);\n this.reply.send(this.Result);\n }", "function onFinish() {\n console.log('finished!');\n }", "forceFinishActivity() {\n // to be overrided by subclasses\n }", "function onFinish() {\n console.log(\"finish...
[ "0.64798325", "0.6361244", "0.6358896", "0.62683153", "0.6230613", "0.6230613", "0.6212153", "0.61613345", "0.61476225", "0.61476225", "0.61476225", "0.6132387", "0.61224645", "0.61207825", "0.60499287", "0.60270333", "0.60248137", "0.6013864", "0.6011764", "0.6009145", "0.59...
0.668784
0
gen_food generates the food using the random coordinates from the function above it But then checks if the product of that would collide with any of the snake's squares
function gen_food() { food_x = random_food(0, snakeboard.width - 10); food_y = random_food(0, snakeboard.height - 10); snake.forEach(function has_snake_eaten_food(part) { const has_eaten = part.x === food_x && part.y === food_y; if (has_eaten) gen_food() }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gen_food() {\n // Generate a random number the food x-coordinate\n food_x = random_food(0, currentCanvas.width - 10);\n // Generate a random number for the food y-coordinate\n food_y = random_food(0, currentCanvas.height - 10);\n \n // if the new food location is where a snake currently is, generate...
[ "0.83560723", "0.8284153", "0.8107035", "0.80773073", "0.7852913", "0.78096807", "0.7779849", "0.77765244", "0.7765018", "0.7741792", "0.7740646", "0.76512486", "0.7588687", "0.7568661", "0.7496423", "0.7384758", "0.73845345", "0.7286598", "0.72832274", "0.728155", "0.72707",...
0.8532117
0
This method set the label for each button operation
function setLabel(val){ /*BUTTONS*/ var linkOperation = $('.mathContainer').find('a#' + val.id + '.operation'); if( val.label ) { linkOperation.html(val.label); } if(val.rendered) { MathQuill.StaticMath(linkOperation[0]); } if(val.graphic) { linkOperation.addClass('graphic').append('...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeButtonText () {\n\t\t\t// Ideally, we could show two radio buttons, labeled Auto and Manual, for Move and Animate buttons that auto-generate their labels.\n\t\t\t// This is overkill for a feature of little significance. Instead, just turn off the shouldAutogenerateLabel flag if it exists.\n\t\t\tass...
[ "0.72238445", "0.67228913", "0.6658416", "0.65562946", "0.651558", "0.6496951", "0.6496951", "0.6496951", "0.6485692", "0.6482089", "0.6471197", "0.6462088", "0.6453654", "0.63901585", "0.6365705", "0.63206476", "0.6313318", "0.6304742", "0.63015807", "0.6277382", "0.62739414...
0.7433688
0
method to keep a given dialog box centered on screen based upon viewport size
function place_dialog_center(dialog_obj) { //debugger; var window_height = $(window).height(); var window_width = $(window).width(); var scroll_top = $(window).scrollTop(); //var scroll_left = $(window).scrollLeft(); //$(dialog_obj).parent('.ui-dialog').css('top', window_height / 2 - $(dialog_o...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function centre() {\n if (modal.outerHeight(true) < $(window).height()) {\n var diff = $(window).height() - modal.outerHeight(true)\n modal.css({ top: diff / 2 })\n }\n }", "function centerDialog(dialog)\n{\n // reset margin\n $(dialog).css({\n 'margin' : '0',\n 'left' ...
[ "0.6973738", "0.69272864", "0.69205153", "0.689203", "0.6872869", "0.68440574", "0.6843074", "0.6823865", "0.68232447", "0.6791808", "0.67853034", "0.67590725", "0.67261875", "0.6626785", "0.6604017", "0.65732735", "0.6566774", "0.6545064", "0.6470528", "0.6470528", "0.645032...
0.74794626
0
Download covers of books here Change the zoom=1 in thumbnail url to zoom=0 for bigger image;
function getBigImage(url) { return url.replace("zoom=1", "zoom=0"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "downloadPicture(grid, uncropped){\n let limits;\n if(!uncropped)\n limits = this._setLimits(grid);\n else {\n\n limits = {\n top: 0,\n bottom: grid.childNodes.length - 1,\n left: 0,\n right: grid.childNodes[0].childNodes.length -1\n }...
[ "0.6072582", "0.5989327", "0.5859857", "0.5799043", "0.5733149", "0.5713447", "0.56317717", "0.5604683", "0.56041247", "0.5568283", "0.55277705", "0.5507307", "0.5455128", "0.5438098", "0.54373807", "0.54186046", "0.54177195", "0.5415059", "0.5400476", "0.5400092", "0.5393533...
0.6107543
0
Check whether the site is in preview mode, and also set the language
checkPreviewModeAndLanguageCode() { //don't run this in server mode if (process.server || process.static) { return; } //don't run this in "generate" mode if (process.argv.includes("generate")) { return; } //lang=en-us --set the language code //agilitypreviewkey=xyz --set prev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeLanguage(currentLang) {\n state.currentLang = currentLang;\n\n var languageStrings = {\n en: \"[EN]\",\n es: \"[ES]\",\n vi: \"[VI]\",\n ar: \"[AR]\"\n }\n\n var lowerLanguageStrings = {\n en: \"[en]\",\n es: \"[es]\",\n vi: \"[vi]\",\n ar: \"[ar]\...
[ "0.63303643", "0.62839276", "0.60158104", "0.5934399", "0.58492684", "0.5729167", "0.5713786", "0.5670806", "0.56423026", "0.56417054", "0.56270516", "0.56131315", "0.5611442", "0.5609506", "0.5597159", "0.5570402", "0.55503017", "0.5544101", "0.55281174", "0.5520211", "0.550...
0.69388825
0
Triger 100km Grid ED50
function mkanED50() { var c = curlatLng; c0 = c.lng(); d0 = c.lat(); var z = getZone(c0); var UTM = fl2MGRS(d0, c0); x0 = UTM[6]; y0 = UTM[7]; x0 = Math.round(x0 / 100000); y0 = Math.round(y0 / 100000); var z2; if (getZoneL0(getZone(c0)) > c0) { z2 = z - +1; } else { z2...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function kan100ED50() {\n\n var c = curlatLng;\n c0 = c.lng();\n d0 = c.lat();\n var UTM = fl2EDMGRS(d0, c0);\n\n x0 = UTM[6];\n y0 = UTM[7];\n\n\n x0 = Math.round(x0 / 1000);\n y0 = Math.round(y0 / 1000);\n\n\n for (i = y0 - 5; i <= y0 + 5; i++) {\n\n for (j = x0 - 5; j <= x0 + 5...
[ "0.6506408", "0.593645", "0.588377", "0.57443553", "0.56543934", "0.56504107", "0.56459457", "0.563145", "0.5577529", "0.554794", "0.55462337", "0.552915", "0.54626864", "0.54533005", "0.54258907", "0.54213536", "0.5393776", "0.53831375", "0.5382606", "0.53478116", "0.5314178...
0.64295906
1
Check if 1st letter of Square is compatible with Zone
function check_zone_letter_1(z, l) { var out; var x100; switch (l) { case 'A': x100 = 1; break; case 'B': x100 = 1; break; case 'C': x100 = 1; break; case 'D': x100 = 1; break; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nearby_az(string) {\n var str = string.split(\"\");\n console.log(str);\n for (var i = 0; i < str.length - 2; i++) {\n if (str[i] == \"a\" && str[i + 2] == \"z\") {\n return true;\n }\n }\n return false;\n}", "function isCoord(val) \n{\n\treturn val == \"A\" || val == \"B\" || val == \"A...
[ "0.63216144", "0.62897354", "0.60598975", "0.6021021", "0.60173255", "0.5977725", "0.5962752", "0.594919", "0.586974", "0.5809503", "0.57930064", "0.5760372", "0.57480407", "0.57241994", "0.5719124", "0.56954086", "0.5670806", "0.56669044", "0.56406593", "0.5639157", "0.56368...
0.72186625
0
these are functions that were created in video Part 3, in the app.post give the functions a name now function to get all topics
function getTopicList(req, res) { //get the list of all topics console.log('Getting all topics...'); //grabs the data or results from the model //create the callback function so that server not waiting on results topicModel.getAllTopics(function(results) { //send response back to the us...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _getTopics() {\r\n restApi.getTopics()\r\n .success(function (data, status, headers, config) {\r\n vm.topicsList = data;\r\n load();\r\n })\r\n .error(function (data, status, headers, config) {\r\n load();\r\n ...
[ "0.74008816", "0.66971785", "0.6678553", "0.66480446", "0.660274", "0.6560817", "0.6495888", "0.6473768", "0.6447469", "0.62875384", "0.62729776", "0.6271478", "0.6265653", "0.62565976", "0.62550676", "0.62355566", "0.6210116", "0.620927", "0.6193441", "0.6185493", "0.6181045...
0.69115156
1
function to get one topic by id
function getTopic(req, res){ //query example //topic?id=1 //anything after the ? is a query var id = req.query.id; console.log('Getting one topic with id:' + id); topicModel.getTopicById(id, function(results) { res.json(results); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getTopicId(id, res) {\n Temas.find({_id: id}, (err, topic) => {\n if (err) throw err;\n res.send(topic);\n })\n}", "static getById(id) {\n return dbConnect.execute(\"SELECT * FROM topic WHERE ID = ?\", [id]); \n }", "loadTopic(topicID){\n\n }", "function minimal_topic(id, lang) {\n...
[ "0.75592625", "0.7536375", "0.7352008", "0.72339314", "0.70280254", "0.6963626", "0.68745667", "0.679973", "0.6795985", "0.67197895", "0.67133826", "0.66920006", "0.6685686", "0.6520958", "0.63449335", "0.6308048", "0.6289652", "0.6225498", "0.6209063", "0.6209063", "0.619602...
0.76007354
0
function to post a new topic
function postTopic(req, res){ var name = req.body.name; console.log('Creating a new topic with name: ' + name); topicModel.insertNewTopic(name, function(results) { res.json(results); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTopic() {\n// Creates a new topic\n pubsub\n .createTopic(topic)\n .then(results => {\n const topicResult = results[0];\n console.log(`Topic ${topicResult} created.`);\n// Once the topic is created, create a subscription to pai...
[ "0.7279194", "0.6918218", "0.69141835", "0.6830828", "0.6751715", "0.66876334", "0.6636362", "0.6621195", "0.6597895", "0.656843", "0.6450884", "0.6427553", "0.6399825", "0.63794726", "0.6324558", "0.63180614", "0.6252755", "0.6218586", "0.6211648", "0.6204718", "0.6190745", ...
0.75975376
0
var somar (a,b) => a + b
function somar(a,b){ return a + b; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function somar(a, b) {\n return a + b;\n}", "function somme(a, b) {\n return a + b;\n}", "function soma(a, b) {\n return a + b;\n}", "function soma(a, b) {\n return a + b;\n}", "function soma(a, b) {\n let somar = a + b\n console.log(somar)\n}", "function sumar (a,b){\n return a+b;\n}", ...
[ "0.86023283", "0.7878886", "0.7682175", "0.7682175", "0.7662638", "0.7653438", "0.76032174", "0.75547737", "0.7550774", "0.7537614", "0.7529119", "0.74737513", "0.74737513", "0.74710524", "0.74616355", "0.7370734", "0.7345647", "0.73410326", "0.7339669", "0.73330784", "0.7332...
0.8567493
1
Timer to autoclean dbAccessState
function cleanAccessState() { const expired = Date.now() - (60 * 10 * 1000); // 10 minutes try { Object.keys(dbAccessState).forEach((key) => { if (dbAccessState[key].time < expired) delete dbAccessState[key]; }); } catch (e) { console.log(e); } setTimeout(cleanAccessState, 60 * 1000); // che...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "autoSave(seconds) {\n\t\tsetInterval(() => this.dbService.write('state', this.state), seconds * 1000);\n\t}", "function purgeDB() {\n var db = connectDB();\n\n var maxAge=getUnixTime();\n maxAge = maxAge-(31*86400);\n\n db.transaction(\n function(tx) {\n var result = tx.executeSql(\...
[ "0.5978736", "0.5804789", "0.56743926", "0.5661169", "0.5609241", "0.55972683", "0.5575816", "0.5548843", "0.55353993", "0.5447892", "0.54160625", "0.5413776", "0.5375359", "0.53665406", "0.53612465", "0.5356398", "0.53429073", "0.53067034", "0.5275188", "0.5270075", "0.52646...
0.70825356
0
Function:show the search's num
function searchnum_show(num){ //num is set for delete when delete in search if(!num){ var num=$(".HiddeN_projectsearchitemnum").val(); } var num=parseInt(num,10); var CinsH=136; if(num==1){ $('#SourcE_Vsearchdatashowframe').css('top',CinsH+153+'px'); $("#ItemsearcH_numshow").text(num); } else if...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function find_num(dir) {\n dir = dir || direction;\n var ij = $(\".selected\").attr(\"id\").split(\"a\").slice(1, 3).map(function(e) {return +e;});\n ij = get_word_beginning(ij[0], ij[1], dir);\n var num = map_cells(ij, dir, function(sel) {\n var orientation = (dir[0] == 1) ? \"h\": \"v\";\n ...
[ "0.61206543", "0.6107866", "0.5967669", "0.58861864", "0.5886132", "0.58598137", "0.58577853", "0.58416814", "0.57421833", "0.57413167", "0.57055634", "0.57025063", "0.5682232", "0.5654985", "0.56142175", "0.5603642", "0.5601809", "0.5593194", "0.55737245", "0.5544352", "0.55...
0.66313905
0
UPDATE WEBSITE WITH SCORE FOR A SINGLE MOVIE (CALLED FOR EACH MOVIE)
function updateWebsiteWithScore(name, score, external_link){ var obj = { "name": name, "score": score, "external_link": external_link } // Update Cineplex.com with rotten tomato scores chrome.tabs.query( {currentWindow: true, active: true}, function(tabs) { chrome.tabs.sendMessage(tabs[0]...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateScores() {\n \n $scores.find('.p').find('u').html(scores.p);\n $scores.find('.ties').find('u').html(scores.ties);\n $scores.find('.com').find('u').html(scores.com);\n \n }", "function rateMovie(value) {\n fetch(`/api/rateMovie`, {\n method: \"post\",\n head...
[ "0.66016275", "0.6472704", "0.6389248", "0.6384887", "0.6378808", "0.63700736", "0.63384193", "0.63243175", "0.63092977", "0.63042533", "0.6290164", "0.6271005", "0.62608707", "0.6234058", "0.6229001", "0.6218478", "0.62104714", "0.6203528", "0.619993", "0.6199189", "0.619649...
0.65062964
1
Gets the window width.
function getWindowWidth() { return win.innerWidth; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function windowWidth () {\n return wsize.width ? Math.min(80, wsize.width) : null\n }", "function getWindowWidth()\n {\n return window.innerWidth;\n }", "function winWidth() { return getWH('Width'); }", "function getWindowWidth () {\n return win.innerWidth || doc.documentElement.clientWidth...
[ "0.83038485", "0.80321", "0.79827476", "0.79523", "0.7950636", "0.79260266", "0.784307", "0.7838433", "0.7832322", "0.7797956", "0.77312034", "0.7697077", "0.7694274", "0.7663421", "0.7646768", "0.7643672", "0.75919604", "0.75230545", "0.7511527", "0.7494657", "0.7452038", ...
0.82779926
1
Appends the given element ot the given parent.
function appendTo(el, parent) { parent.appendChild(el); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendTo(el, parent) {\n parent.appendChild(el);\n }", "function appendTo(el, parent){\n parent.appendChild(el);\n }", "function appendTo(el, parent){\n parent.appendChild(el);\n }", "function append(parent, element) {\n return parent.appendChild(element);\n}", "fu...
[ "0.82383204", "0.82091624", "0.82091624", "0.782513", "0.782513", "0.764114", "0.76298773", "0.7621131", "0.7621131", "0.7615612", "0.7554862", "0.7532255", "0.7401465", "0.71532136", "0.70712495", "0.701767", "0.69699913", "0.69588697", "0.6928564", "0.68884003", "0.67427725...
0.82728225
0
Gets the average of the last `number` elements of the given array.
function getAverage(elements, number) { var sum = 0; //taking `number` elements from the end to make the average, if there are not enought, 1 var lastElements = elements.slice(Math.max(elements.length - number, 1)); for (var i = 0; i < lastElements.length; i++) { sum = sum + lastElements[i];...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAverage(elements, number) {\n var sum = 0;\n\n //taking `number` elements from the end to make the average, if there are not enought, 1\n var lastElements = elements.slice(Math.max(elements.length - number, 1));\n\n for (var i = 0; i < lastElements.length; i+...
[ "0.74290586", "0.74290586", "0.74290586", "0.73929137", "0.73929137", "0.73929137", "0.73929137", "0.73929137", "0.73929137", "0.7378728", "0.7106855", "0.70037663", "0.6898447", "0.6868508", "0.68620795", "0.68217385", "0.6799104", "0.67772955", "0.67624366", "0.6699256", "0...
0.75349426
1
Sets the value for the given attribute from the `data` attribute with the same suffix ie: datasrcset ==> srcset | datasrc ==> src
function setSrc(element, attribute) { element.setAttribute(attribute, getAttr(element, 'data-' + attribute)); element.removeAttribute('data-' + attribute); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setData(el, attr, val, prefix) {\n\t if (prefix === undefined) {\n\t prefix = 'wookmark-';\n\t }\n\t el.setAttribute('data-' + prefix + attr, val);\n\t }", "function setSrc(element, attribute){\n element.setAttribute(attribute, element.getAttribute('data-' + attribute));\n ...
[ "0.66024595", "0.6517132", "0.6517132", "0.65018463", "0.64074", "0.6285063", "0.6219037", "0.6219037", "0.6186068", "0.6142137", "0.613857", "0.613857", "0.613857", "0.6103128", "0.61011416", "0.6092197", "0.6014107", "0.5989417", "0.5952867", "0.59327453", "0.58972573", "...
0.65450555
1
Setting options from DOM elements if they are not provided.
function setOptionsFromDOM() { //no anchors option? Checking for them in the DOM attributes if (!getOptions().anchors.length) { var anchorsAttribute = '[data-anchor]'; var anchors = $(getOptions().sectionSelector.split(',').join(anchorsAttribute + ',') + anchorsAttribute, container); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setOptionsFromDOM(){\n\n //no anchors option? Checking for them in the DOM attributes\n if(!options.anchors.length){\n var attrName = '[data-anchor]';\n var anchors = $(options.sectionSelector.split(',').join(attrName + ',') + attrName, container);\n ...
[ "0.77139676", "0.7694052", "0.7612932", "0.7574055", "0.75207335", "0.75195163", "0.75195163", "0.75195163", "0.7483969", "0.7483969", "0.62620205", "0.61708736", "0.6156968", "0.61022544", "0.6075035", "0.59923875", "0.5986848", "0.59751743", "0.5768634", "0.5682951", "0.564...
0.77119744
1