Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
! moment.js locale configuration
function t(e,t,n){var r,o;return"m"===n?t?"хвіліна":"хвіліну":"h"===n?t?"гадзіна":"гадзіну":e+" "+(r=+e,o={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"хвіліна_хвіліны_хвілін":"хвіліну_хвіліны_хвілін",hh:t?"гадзіна_гадзіны_гадзін":"гадзіну_гадзіны_гадзін",dd:"дзень_дні_дзён",MM:"месяц_месяцы_месяцаў",yy:"год_гады_гадоў"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){return e+" "+function(e,t){return 2===t?function(e){var t={m:"v",b:"v",d:"z"};return void 0===t[e.charAt(0)]?e:t[e.charAt(0)]+e.substring(1)}(e):e}({mm:"munutenn",MM:"miz",dd:"devezh"}[n],e)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return r+=1===e?"dan":"dana";case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={m:["eine Minute","einer Minute"],h:["eine Stunde","einer Stunde"],d:["ein Tag","einem Tag"],dd:[e+" Tage",e+" Tagen"],w:["eine Woche","einer Woche"],M:["ein Monat","einem Monat"],MM:[e+" Monate",e+" Monaten"],y:["ein Jahr","einem Jahr"],yy:[e+" Jahre",e+" Jahren"]};return t?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={s:["mõne sekundi","mõni sekund","paar sekundit"],ss:[e+"sekundi",e+"sekundit"],m:["ühe minuti","üks minut"],mm:[e+" minuti",e+" minutit"],h:["ühe tunni","tund aega","üks tund"],hh:[e+" tunni",e+" tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:[e+" kuu",e+" kuud"],y:["ühe aasta","aasta","üks aasta"],yy:[e+" aasta",e+" aastat"]};return t?o[n][2]?o[n][2]:o[n][1]:r?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={s:["थोडया सॅकंडांनी","थोडे सॅकंड"],ss:[e+" सॅकंडांनी",e+" सॅकंड"],m:["एका मिणटान","एक मिनूट"],mm:[e+" मिणटांनी",e+" मिणटां"],h:["एका वरान","एक वर"],hh:[e+" वरांनी",e+" वरां"],d:["एका दिसान","एक दीस"],dd:[e+" दिसांनी",e+" दीस"],M:["एका म्हयन्यान","एक म्हयनो"],MM:[e+" म्हयन्यानी",e+" म्हयने"],y:["एका वर्सान","एक वर्स"],yy:[e+" वर्सांनी",e+" वर्सां"]};return r?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={s:["thoddea sekondamni","thodde sekond"],ss:[e+" sekondamni",e+" sekond"],m:["eka mintan","ek minut"],mm:[e+" mintamni",e+" mintam"],h:["eka voran","ek vor"],hh:[e+" voramni",e+" voram"],d:["eka disan","ek dis"],dd:[e+" disamni",e+" dis"],M:["eka mhoinean","ek mhoino"],MM:[e+" mhoineamni",e+" mhoine"],y:["eka vorsan","ek voros"],yy:[e+" vorsamni",e+" vorsam"]};return r?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=e+" ";switch(n){case"ss":return r+=1===e?"sekunda":2===e||3===e||4===e?"sekunde":"sekundi";case"m":return t?"jedna minuta":"jedne minute";case"mm":return r+=1===e?"minuta":2===e||3===e||4===e?"minute":"minuta";case"h":return t?"jedan sat":"jednog sata";case"hh":return r+=1===e?"sat":2===e||3===e||4===e?"sata":"sati";case"dd":return r+=1===e?"dan":"dana";case"MM":return r+=1===e?"mjesec":2===e||3===e||4===e?"mjeseca":"mjeseci";case"yy":return r+=1===e?"godina":2===e||3===e||4===e?"godine":"godina"}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e){return e%100==11||e%10!=1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={m:["eng Minutt","enger Minutt"],h:["eng Stonn","enger Stonn"],d:["een Dag","engem Dag"],M:["ee Mount","engem Mount"],y:["ee Joer","engem Joer"]};return t?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){switch(n){case"s":return t?"хэдхэн секунд":"хэдхэн секундын";case"ss":return e+(t?" секунд":" секундын");case"m":case"mm":return e+(t?" минут":" минутын");case"h":case"hh":return e+(t?" цаг":" цагийн");case"d":case"dd":return e+(t?" өдөр":" өдрийн");case"M":case"MM":return e+(t?" сар":" сарын");case"y":case"yy":return e+(t?" жил":" жилийн");default:return e}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r=" ";return(e%100>=20||e>=100&&e%100==0)&&(r=" de "),e+r+{ss:"secunde",mm:"minute",hh:"ore",dd:"zile",ww:"săptămâni",MM:"luni",yy:"ani"}[n]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r,o;return"m"===n?t?"минута":"минуту":e+" "+(r=+e,o={ss:t?"секунда_секунды_секунд":"секунду_секунды_секунд",mm:t?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",ww:"неделя_недели_недель",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o=e+" ";switch(n){case"s":return t||r?"nekaj sekund":"nekaj sekundami";case"ss":return o+=1===e?t?"sekundo":"sekundi":2===e?t||r?"sekundi":"sekundah":e<5?t||r?"sekunde":"sekundah":"sekund";case"m":return t?"ena minuta":"eno minuto";case"mm":return o+=1===e?t?"minuta":"minuto":2===e?t||r?"minuti":"minutama":e<5?t||r?"minute":"minutami":t||r?"minut":"minutami";case"h":return t?"ena ura":"eno uro";case"hh":return o+=1===e?t?"ura":"uro":2===e?t||r?"uri":"urama":e<5?t||r?"ure":"urami":t||r?"ur":"urami";case"d":return t||r?"en dan":"enim dnem";case"dd":return o+=1===e?t||r?"dan":"dnem":2===e?t||r?"dni":"dnevoma":t||r?"dni":"dnevi";case"M":return t||r?"en mesec":"enim mesecem";case"MM":return o+=1===e?t||r?"mesec":"mesecem":2===e?t||r?"meseca":"mesecema":e<5?t||r?"mesece":"meseci":t||r?"mesecev":"meseci";case"y":return t||r?"eno leto":"enim letom";case"yy":return o+=1===e?t||r?"leto":"letom":2===e?t||r?"leti":"letoma":e<5?t||r?"leta":"leti":t||r?"let":"leti"}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n,r){var o={s:["viensas secunds","'iensas secunds"],ss:[e+" secunds",e+" secunds"],m:["'n míut","'iens míut"],mm:[e+" míuts",e+" míuts"],h:["'n þora","'iensa þora"],hh:[e+" þoras",e+" þoras"],d:["'n ziua","'iensa ziua"],dd:[e+" ziuas",e+" ziuas"],M:["'n mes","'iens mes"],MM:[e+" mesen",e+" mesen"],y:["'n ar","'iens ar"],yy:[e+" ars",e+" ars"]};return r||t?o[n][0]:o[n][1]}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! moment.js locale configuration
function t(e,t,n){var r,o;return"m"===n?t?"хвилина":"хвилину":"h"===n?t?"година":"годину":e+" "+(r=+e,o={ss:t?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:t?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:t?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[n].split("_"),r%10==1&&r%100!=11?o[0]:r%10>=2&&r%10<=4&&(r%100<10||r%100>=20)?o[1]:o[2])}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cl(e,t,n){return\"m\"===n?t?\"минута\":\"минуту\":e+\" \"+\n//! moment.js locale configuration\n//! locale : Russian [ru]\n//! author : Viktorminator : https://github.com/Viktorminator\n//! Author : Menelion Elensúle : https://github.com/Oire\n//! author : Коренберг Марк : https://github.com/socketpair\nf...
[ "0.82635474", "0.803583", "0.7878269", "0.7548106", "0.72040725", "0.71984273", "0.7174624", "0.71708643", "0.7132608", "0.7130732", "0.7045036", "0.66717654", "0.66717654", "0.6335232", "0.62935024", "0.62765163", "0.62765163", "0.62765163", "0.62765163", "0.6211631", "0.609...
0.0
-1
! FullCalendar Interaction Plugin v4.4.2 Docs & License: (c) 2019 Adam Shaw /! Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
function Tl(e,t){function n(){this.constructor=e}El(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "renderedCallback(){\n // Performs this operation only on first render\n if (this.fullCalendarJsInitialised) {\n return;\n }\n this.fullCalendarJsInitialised = true;\n\n\n Promise.all([\n loadScript(this, FullCalendar + '/jquery.min.js'),\n loadScript(this, FullCalendar + '/jquery-ui...
[ "0.6569317", "0.64378154", "0.64097697", "0.638955", "0.6299459", "0.62309885", "0.6179522", "0.60901976", "0.60732734", "0.60716724", "0.5936425", "0.5850297", "0.5826539", "0.57463586", "0.5744016", "0.5737605", "0.57156247", "0.56866515", "0.56789315", "0.5669489", "0.5605...
0.0
-1
Define a SGTeamMember inheriting person and adding new items
function SGTeamMember(first, last, age, gender, rank, role, id, greetingText) { Person.call(this, first, last, age, gender); this.rank = rank; this.role = role; this.id = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTeamMember() {\n SGTeamMember.prototype = Object.create(Person.prototype);\n Object.defineProperty(SGTeamMember.prototype, 'constructor', {\n value: SGTeamMember,\n enumerable: false,\n writable: true });\n\n //Adding a SGTeamMember greeting\n SGTeamMember.prototype.greeting = f...
[ "0.6724782", "0.6209222", "0.6193945", "0.6099632", "0.60966015", "0.6056443", "0.6030487", "0.6025743", "0.5891332", "0.58731806", "0.5794426", "0.5742305", "0.5716586", "0.56963354", "0.5684781", "0.5684354", "0.5643509", "0.5604413", "0.55575174", "0.5527613", "0.5505644",...
0.64566576
1
This is the inheritance part
function createTeamMember() { SGTeamMember.prototype = Object.create(Person.prototype); Object.defineProperty(SGTeamMember.prototype, 'constructor', { value: SGTeamMember, enumerable: false, writable: true }); //Adding a SGTeamMember greeting SGTeamMember.prototype.greeting = function () { return "Hi. My name is " + this.rank + " " + this.name.first + " " + this.name.last + ". I am the " + this.role + " of this team."; }; //Instantiate the SGTeamMember object var teamMember = new SGTeamMember(document.getElementById("first").value, document.getElementById("last").value, document.getElementById("age").value, document.getElementById("gender").value, document.getElementById("rank").value, document.getElementById("role").value, document.getElementById("id").value); //Display document.getElementById("OutputObjCreation").innerHTML = teamMember.greeting(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function inherited() { }", "function SuperclassBare() {}", "function SuperclassBare() {}", "function Derived() {} // private", "function Base() {}", "function inherts(child , parent) {\n child.prototype = Object.create(parent.prototype);\n child.prototype.constructor = chi...
[ "0.7472655", "0.74333006", "0.6846257", "0.6846257", "0.6815175", "0.6465893", "0.6360232", "0.6349798", "0.63149935", "0.6283189", "0.6283189", "0.6270408", "0.6270408", "0.62403965", "0.623518", "0.6229648", "0.6184734", "0.6180777", "0.6171984", "0.6165103", "0.6151711", ...
0.0
-1
progress and success handlers for media multi uploads
function fileQueued(fileObj) { //var items = jQuery('#media-items').children(); var uploadtitle = '<div class="uploading-item-wrapper"><div class="uploading-item-name clearfix"><span class="filename original">'+fileObj.name+'</span></div></div>'; var uploadprocess = '<div class="progress"><div class="bar"></div></div>'; var uploadinfo = '<div class="uploading-item-info clearfix"><div class="percent">0%</div><div class="filesize"></div></div>'; // Create a progress bar containing the filename jQuery('<div class="uploading-item">').attr( 'id', 'media-item-' + fileObj.id ).append(uploadtitle+uploadprocess+uploadinfo).prependTo( jQuery('#media-items' ) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleUploads() {\n \n}", "_updateFilesUploadProgress(files, xhr, e) {\n if (!files[0].upload.chunked) // Handle file uploads without chunking\n for (let file of files){\n if (file.upload.total && file.upload.bytesSent && file.upload.bytesSent == file.upload.total) continue;\...
[ "0.72166723", "0.6759011", "0.6690268", "0.6680694", "0.66543263", "0.6648346", "0.6554648", "0.650841", "0.6475504", "0.6475412", "0.64716095", "0.64379007", "0.64331603", "0.63567746", "0.63420486", "0.63374996", "0.6336398", "0.6335095", "0.63304543", "0.6329161", "0.63229...
0.6082613
50
check to see if a large file failed to upload
function fileUploading( up, file ) { var hundredmb = 5 * 1024 * 1024, max = parseInt( up.settings.filters.max_file_size, 10 ); if (file.size > hundredmb ) { setTimeout( function() { if ( file.status < 3 && file.loaded === 0 ) { // not uploading //FileError( file, pluploadL10n.big_upload_failed.replace( '%1$s', '<a class="uploader-html" href="#">' ).replace( '%2$s', '</a>' ) ); FileError( file, pluploadL10n.upload_failed); up.stop(); // stops the whole queue up.removeFile( file ); up.start(); // restart the queue } }, 10000 ); // wait for 10 sec. for the file to start uploading } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateExtensionBeforeUpload(file){\n var maxSize = 5000000 // 5 MB \n var size = file.size;\n var checkFileSize = false;\n if(maxSize > size){\n checkFileSize = true; \n }\n return checkFileSize;\n ...
[ "0.7009517", "0.69744873", "0.69640195", "0.69640195", "0.6829291", "0.68288743", "0.6725757", "0.66173923", "0.649176", "0.64755553", "0.62461025", "0.6187233", "0.6181545", "0.6058019", "0.60517704", "0.60460395", "0.6036406", "0.60172814", "0.59773743", "0.596959", "0.5962...
0.6004872
18
Implementation of the properties defined in the interface
function Person(name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get properties() { return this._properties; }", "static get properties(){let props={};if(super.properties){props=Object.assign(props,super.properties)}return props}", "static get properties(){let props={items:{name:\"items\",type:\"Array\",value:\"[]\",reflectToAttribute:!1,observer:!1},source:{name:\"source\"...
[ "0.64714545", "0.6186689", "0.6126559", "0.61251825", "0.61143583", "0.6005949", "0.59955233", "0.59955233", "0.59861", "0.5961021", "0.5961021", "0.5961021", "0.5951046", "0.59273577", "0.5922874", "0.591547", "0.58995116", "0.5894872", "0.5864184", "0.58364415", "0.58247495...
0.0
-1
Start the HTTP server.
function startHttpServer() { return new Promise(resolve => { // Wrap in a promise so we can be notified when the server has started. const app = express(); setupHandlers(app); const port = process.env.PORT && parseInt(process.env.PORT) || 3000; app.listen(port, () => { resolve(); // HTTP server is listening, resolve the promise. }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async start () {\n assert(!this._server, 'http server is already started');\n this._app = express();\n this._app.use('/healthcheck', healthcheck(this._config));\n this._app.use('/', video(this._counterService, this._config));\n\n this._server = http.createServer(this._app);\n ...
[ "0.7759217", "0.771617", "0.7695088", "0.76249075", "0.75297314", "0.74441195", "0.73875606", "0.73631877", "0.7362271", "0.7272456", "0.7224689", "0.7114068", "0.7081332", "0.707595", "0.6918703", "0.6918306", "0.6903541", "0.688631", "0.6860296", "0.68597335", "0.68437314",...
0.68410206
21
Gets an article record from a server and processes it to html according to the value of the forEdit parameter. Assumes existence of the urlBase global variable with the base of the server url (e.g. " availability of the Mustache.render() function and Mustache templates with id="templatearticle" (if forEdit=false) and id="templatearticleform" (if forEdit=true).
function fetchAndProcessArticle(targetElm, artIdFromHash, offsetFromHash, totalCountFromHash,forEdit) { const url = `${urlBase}/article/${artIdFromHash}`; fetch(url) .then(response =>{ if(response.ok){ return response.json(); }else{ //if we get server error return Promise.reject(new Error(`Server answered with ${response.status}: ${response.statusText}.`)); } }) .then(responseJSON => { if(forEdit){ responseJSON.formTitle="Article Edit"; responseJSON.formSubmitCall = `processArtEditFrmData(event,${artIdFromHash},${offsetFromHash},${totalCountFromHash},'${urlBase}')`; responseJSON.submitBtTitle="Save article"; responseJSON.urlBase=urlBase; responseJSON.backLink=`#article/${artIdFromHash}/${offsetFromHash}/${totalCountFromHash}`; document.getElementById(targetElm).innerHTML = Mustache.render( document.getElementById("template-article-form").innerHTML, responseJSON ); }else{ responseJSON.backLink=`#articles/${offsetFromHash}/${totalCountFromHash}`; responseJSON.editLink=`#artEdit/${responseJSON.id}/${offsetFromHash}/${totalCountFromHash}`; responseJSON.deleteLink=`#artDelete/${responseJSON.id}/${offsetFromHash}/${totalCountFromHash}`; document.getElementById(targetElm).innerHTML = Mustache.render( document.getElementById("template-article").innerHTML, responseJSON ); } }) .catch (error => { ////here we process all the failed promises const errMsgObj = {errMessage:error}; document.getElementById(targetElm).innerHTML = Mustache.render( document.getElementById("template-articles-error").innerHTML, errMsgObj ); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchAndProcessArticle(targetElm, artIdFromHash, offsetFromHash, totalCountFromHash,forEdit) {\r\n const url = `${urlBase}/article/${artIdFromHash}`;\r\n\r\n fetch(url)\r\n .then(response =>{\r\n if(response.ok){\r\n return response.json();\r\n }else{ //if...
[ "0.64214396", "0.6407961", "0.60427153", "0.5922153", "0.573828", "0.55590856", "0.55590856", "0.55590856", "0.55590856", "0.55590856", "0.55590856", "0.55590856", "0.55445784", "0.5543667", "0.5519542", "0.54975885", "0.5430651", "0.53749865", "0.53735715", "0.52708316", "0....
0.6668005
0
ALL the Help Functions: Function that runs when: On loading of the page
function help(){ document.getElementById("body").innerHTML = ` <html lang="en"> <head > <link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <title>Help Page</title> </head> <body> <div class="row"> <div class="col-md-12"> <div class="mx-auto" style="width: 200px;"> <h1>Help Page</h1> <div class="text-justify"> <p>Hi there, please state your <strong>Issue</strong> and preferred <strong>Means of Communication</strong> before clicking the <strong>Next</strong> button.</p> </div> <!--Issue--> <div class="text-justify" id = "text"> <label><p><strong>Issue:</strong></p></label><br> <input type = "radio" name = "Issue" id = "general" value = "General" checked = "checked"/> <label for = "General">General</label><br> <input type = "radio" name = "Issue" id = "password" value = "Password"/> <label for = "password">Password</label><br> <input type = "radio" name = "Issue" id = "others" value = "Others"/> <label for = "Others">Others</label><br> </div> <!--Means of Communication--> <div class="text-left"> <label><p><strong>Means of Communication:</strong></p></label> <input type = "radio" name = "MoC" id = "Chat" value = "Chat" checked = "checked"/> <!-- onclick="checkFunc1()"/>--> <label for = "Chat">Chat</label><br> <input type = "radio" name = "MoC" id = "Call" value = "Call"/> <!-- onclick="checkFunc1()"/>--> <label for = "Call">Call</label><br> </div> <!--Next Button--> <!-- <a href="chat.html">--> <button type="button" id="Next" onclick="checkFunc()" class="btn btn-primary btn-lg btn-block">Next</button> <!-- </a>--> <!--About the Team--> <div class="mt-5"> <h10><small>SUTD ISTD Class of 2021 Cohort 3 Group 5.</small></h10> </div> </div> </div> </div> </body> </html> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function homePageLoader() {\n\n pageCreator(\"home-page\");\n navBar(\"home-page\");\n restaurantLogo();\n bookTableBtn(\"home-page\");\n socialMedia();\n}", "onPageReady () {}", "function startatLo...
[ "0.70600224", "0.6906804", "0.67995405", "0.6786683", "0.6742353", "0.67045915", "0.669307", "0.66840845", "0.6661327", "0.6642032", "0.66349006", "0.66313726", "0.66313726", "0.6623615", "0.66232234", "0.6607113", "0.659649", "0.6595121", "0.6592545", "0.6591654", "0.6590763...
0.0
-1
called when the user click next
function checkFunc() { // Prevent multiple clicks document.getElementById("Next").disabled = true; // Wait message alert("Please Wait while we connect you with our Administrators.\nThank you."); console.log("in checkFunc()"); var radios_issue = document.getElementsByName("Issue"); var radios_moc = document.getElementsByName("MoC"); for (var i = 0; i < radios_issue.length; i++) { if (radios_issue[i].checked) { // alert(radios_issue[i].id); issueClicked = radios_issue[i].id; break; } } for (var j = 0; j < radios_moc.length; j++) { if (radios_moc[j].checked) { // alert(radios_moc[i].id); mocClicked = radios_moc[j].id; break; } } // Add user to Firebase Database. socket.emit("addUser", issueClicked); console.log(`issueClick: ${issueClicked}`); socket.emit('Anonymous', issueClicked); console.log("[DEMO] :: Issue Selected: " + issueClicked); console.log("[DEMO] :: MOC Selected: " + mocClicked); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onClickNaviNext(el) {\n curPageNumber = curPageNumber + 1;\n refreshTable();\n debug('Next button clicked. page number : ' + curPageNumber);\n }", "_nextButtonClickHandler() {\n const that = this;\n\n that.next();\n }", "function goNext() {\n ...
[ "0.7909268", "0.7883064", "0.78396475", "0.7766671", "0.77470636", "0.7740416", "0.7724237", "0.7710754", "0.7688871", "0.7682514", "0.7656187", "0.76459134", "0.7631812", "0.7564113", "0.753702", "0.75000834", "0.7474459", "0.746632", "0.74618834", "0.7457132", "0.7411854", ...
0.0
-1
get the conversation between admin and the user
function initiateConversation(adminID){ rainbowSDK.contacts.searchById(adminID).then((contact)=>{ console.log("[DEMO] :: " + contact); if(mocClicked == "Chat"){ rainbowSDK.conversations.openConversationForContact(contact).then(function(conversation) { console.log("[DEMO] :: Conversation", conversation); conversation1 = conversation; rainbowSDK.im.getMessagesFromConversation(conversation, 30).then(function() { console.log("[DEMO] :: Messages", conversation); chat(); }).catch(function(err) { console.error("[DEMO] :: Error Messages 1", err); }); }).catch(function(err) { console.error("[DEMO] :: Error conversation", err); }); }else{ //check browser compatibility if(rainbowSDK.webRTC.canMakeAudioVideoCall()) { console.log("[DEMO] :: Audio supported"); if(rainbowSDK.webRTC.hasAMicrophone()) { /* A microphone is available, you can make at least audio call */ console.log("[DEMO] :: microphone supported"); var res = rainbowSDK.webRTC.callInAudio(contact); if(res.label === "OK") { call(); /* Your call has been correctly initiated. Waiting for the other peer to answer */ console.log("[DEMO] :: Contact Successful"); let paragraph = document.getElementById("p1"); paragraph.innerHTML("Waiting for Admin to pick up."); } else{console.log("[DEMO] :: Call not initialised successfully.");} }else { alert("DEMO :: no microphone found"); } }else{ alert("DEMO :: browser does not support audio") } } }).catch((err)=>{ console.log(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getAdminDialogues(input, senderId) {\n const FbAPIClass = require('./botTools').FacebookAPI;\n const FacebookAPI = new FbAPIClass(senderId);\n\n const delayActivationRegex = /activate message delay/i;\n const delayDeactivationRegex = /deactivate message delay/i;\n const flowResetRegex = /roo masters ...
[ "0.6354686", "0.6277512", "0.6079163", "0.60776937", "0.60776937", "0.6044221", "0.57802457", "0.5732491", "0.5732471", "0.5614711", "0.5571742", "0.55638456", "0.5551505", "0.5523197", "0.5522247", "0.55134344", "0.54886407", "0.54707086", "0.54594404", "0.5439639", "0.53805...
0.52724326
33
chat Template that organises the Json String into HTML
function chatTemplate(chat_json) { return ` <div class = "${chat.class}" style = "display: flex; flex-flow: row wrap; align-items: flex-start; margin-bottom: 10px;"> <div class="user-photo" style = "width: 60px; height: 60px; background: #ccc; border-radius: 50%; overflow: hidden;"> <img src=${chat_json.image} style = "width: 100%"> </div> <p class="chat-message" style = "width: 80%; padding: 15px; margin: 5px 10px 0; border-radius: 10px; color: #fff; font-size: 20px; ${chat_json.background}${chat_json.order}"> ${chat_json.message} </p> </div> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render(data){\n var html = data.map(function(message,index){\n return(`\n <div class=\"message\">\n <strong>${message.nickname}</strong>\n <p>${message.text}</p>\n </div>\n `);\n }).join(' ');\n\n document.getElementById('messages'...
[ "0.6597314", "0.6462079", "0.6435891", "0.63820213", "0.6373793", "0.6289539", "0.62359965", "0.6138855", "0.6121441", "0.6066289", "0.6061095", "0.60221267", "0.6021302", "0.5984731", "0.5974902", "0.5935893", "0.5918229", "0.5865548", "0.58410716", "0.57934403", "0.5791925"...
0.7797198
0
Function that runs when: Going from Help page to Chat page User sends a message Administrator sends a message
function chat(){ document.getElementById("body").innerHTML = ` <html> <head> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="chat.css"> <title>Chat</title> </head> <body id = "body"> <div class = "row"> <div class ="col-md-12"> <div class="mx-auto" style="width: 200px;"> <div class="mb-5"> <h1 class="text-center" >Chat</h1> </div> </div> </div> <div class ="col-md-6"> <div class="mx-auto" style="width: 200px;"> <div class="chatbox"> <div class="chatlogs" id="chatlogs"> ${chat_json.map(chatTemplate).join("")} </div> <div class="chat-form"> <textarea class="form-control" id="sendBox" rows= "1"></textarea> <button type="button" id="sendButton" onclick="sendFunc()">Send</button> <button type="button" id="endButton" style = "color: #ff0000;" onclick="endFunc()">End</button> </div> </div> </div> </div> </div> </body> </html> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function feedback(message, guid){\n // var pid = getPidForUser(guid);\n var session = getSessionForUser(guid);\n var originalguid = getFirstGuid(guid);\n // send to session pages - control page can display\n io.to(session).emit('feedback', {\"message\": message, \"user\": origina...
[ "0.68943954", "0.663146", "0.64962876", "0.64781797", "0.64682126", "0.6455366", "0.64182127", "0.6410737", "0.6405171", "0.6360514", "0.63242185", "0.6313633", "0.628098", "0.6277013", "0.6270637", "0.6266897", "0.62662286", "0.6255746", "0.6236719", "0.62313753", "0.6227387...
0.0
-1
ALL the Call Functions:
function call(){ document.getElementById("body").innerHTML = ` <html> <head> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="chat.css"> <title>Call</title> </head> <body id = "body"> <div class = "row"> <div class="mx-auto" style="width: 200px;"> <div class="mb-5"> <h1 class="text-center" >Call Page</h1><br> <p class="text-center" > Please speak into your mic to talk to our Administrator.</p> <p class="text-center" id = "status" > Status: </p> <p class="text-center" id = "p1"></p> <audio id="globalAudioTag" autoplay style="display:none;"></audio> <div class="text-center"> <button type="button" id="endButton" style = "color: #ff0000;" onclick="endFunc()">End Call</button> </div> </div> </div> </div> </body> </html> `; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClientCalls() {\n\n }", "function main() {\n\t\t//Check the Method\n\t\tif ($.request.method === $.net.http.POST) {\n\t\t\tif (gvMethod === \"MAP\") {\n\t\t\t\t//Perform The Mapping between In and Out\n\t\t\t\ttry {\n\t\t\t\t\t_mapInToOut();\n\t\t\t\t} catch (errorObj) {\n\t\t\t\t\tgvStatus = \"Error durin...
[ "0.6387829", "0.6243718", "0.61963904", "0.60801286", "0.6041381", "0.6028061", "0.5999504", "0.5951649", "0.5945321", "0.59081453", "0.59010345", "0.58895284", "0.58113235", "0.5805655", "0.5796284", "0.5785626", "0.5783551", "0.5757754", "0.57479", "0.57309294", "0.5724948"...
0.0
-1
ALL the End Functions: when user clicked end button
function endFunc(){ var result = confirm("Are you sure you want to exit the chat?"); if(result){ endConversation(); document.getElementById("body").innerHTML = ` <html> <head> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link rel="stylesheet" type="text/css" href="chat.css"> <title>Thank You</title> </head> <body id = "body"> <div class = "row"> <div class="mx-auto" style="width: 200px;"> <div class="mb-5"> <h1 class="text-center" >Thank You!</h1><br> <p class="text-center" > We hope that we have been of assistance to you!</p> </div> </div> </div> </body> `; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function endEvent(){}", "end(event) {\n\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "function endEarlyButton() {\n endEarlyDetails();\n}", "function handleEnd(){\n if ((tracksBtn.value === 'playing') &...
[ "0.7851226", "0.7632989", "0.758429", "0.7320415", "0.720986", "0.7144952", "0.7105768", "0.701245", "0.69884366", "0.6911069", "0.6901466", "0.6843886", "0.68260735", "0.681316", "0.6802625", "0.6797743", "0.6794221", "0.67759514", "0.67591107", "0.67539173", "0.6721428", ...
0.0
-1
unhighlight is used for controlling what happens when a message is supposed to appear next to an input. In this case : remove class haserror from css bootstrap and fill the helpblock class with nothing inside.
function submitForm() { $.ajax({ url: 'actions/ajax/register.php', type: 'POST', data: $('#register-form').serialize(), // Data are persist and contain in "data" dataType: 'json' }) .done(function (data) { $('#btn-signup').html('<img src="img/loader/ajax-loader.gif" /> &nbsp; signing up...').prop('disabled', true); // Loading gif. $('input[type=text],input[type=password]').prop('disabled', true); // Disable the input text, email and password setTimeout(function () { if (data.status === 'success') { $('#register_result').slideDown('fast', function () { $('#register_result').html('<div class="alert alert-info">' + data.message + '</div>'); // Show the $response['message'] from the actions/ajax/register.php file. $("#register-form").trigger('reset'); // Reset the form $('input[type=text],input[type=password]').prop('disabled', false); // Enable the input text, email, password $('#btn-signup').html('Submit').prop('disabled', false); }).delay(5000).slideUp('fast'); // Hide the $response['message'] after 10 secondes. window.setTimeout(function () { location.reload() }, 6500); // Reload page after a certain delay. } else { $('#register_result').slideDown('fast', function () { $('#register_result').html('<div class="alert alert-danger">' + data.message + '</div>'); const current = 1; const widget = $(".step"); $("#register-form").trigger('reset'); widget.show(); widget.not(':eq(0)').hide(); widget.find('#error').each(function () { $(this).html(''); }); $('#register-form').find('input[name="current_form_step"]').val(1); setProgress(current); hideButtons(current); $('input[type=text],input[type=password]').prop('disabled', false); $('#btn-signup').html('Submit').prop('disabled', false); }).delay(3000).slideUp('fast'); } }, 3000); }) .fail(function () { alert('An error occured, please contact the admin for further support.'); const current = 1; const widget = $(".step"); $("#register-form").trigger('reset'); widget.show(); widget.not(':eq(0)').hide(); widget.find('#error').each(function() { $(this).html(''); }); $('#register-form').find('input[name="current_form_step"]').val(1); setProgress(current); hideButtons(current); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeErrorHint(element) {\n element.classList.remove(\"error\")\n}", "applyErrorStyle() {\n this.nodes.inputHolder.classList.add(this.CSS.inputError);\n this.nodes.progress.remove();\n }", "function removeMessage(){\n var errorinput = document.querySelectorAll(\"wrong-input\");\n [].for...
[ "0.65928155", "0.6579145", "0.65050477", "0.6498303", "0.64972645", "0.64967495", "0.6429752", "0.6411734", "0.63763297", "0.6370645", "0.6346371", "0.6328108", "0.63204134", "0.6307109", "0.61745083", "0.6173893", "0.6159797", "0.6110402", "0.611002", "0.6092011", "0.6085968...
0.0
-1
GAME ASSETS BASE CLASS OF ALMOST EVERY ASSET
function Box(x, y, width, height, speed = 30) { this.x = x; this.y = y; this.width = width; this.height = height; this.speed = speed; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Spriteset_Base() {\n this.initialize.apply(this, arguments);\n}", "get mainAsset() {}", "set mainAsset(value) {}", "function camSetEnemyBases(bases)\n{\n\tvar reload = !camDef(bases);\n\tif (!reload)\n\t{\n\t\t__camEnemyBases = bases;\n\t\t__camNumEnemyBases = 0;\n\t}\n\t// convert label strings ...
[ "0.65754974", "0.59851146", "0.5598863", "0.55185205", "0.5446757", "0.54238814", "0.5412399", "0.53719413", "0.5350498", "0.5339725", "0.52982396", "0.52982396", "0.5295462", "0.52811676", "0.5272436", "0.5267937", "0.52527434", "0.5245198", "0.5214108", "0.5194572", "0.5180...
0.0
-1
HELPER FUNCTIONS HELPER FUNCTIONS FOR GAME LOOP
function readInput() { if (controls.moveUp) player.moveUp(); if (controls.moveDown) player.moveDown(); if (controls.moveLeft) player.moveLeft(); if (controls.moveRight) player.moveRight(); if (controls.faceUp) player.faceUp(); if (controls.faceDown) player.faceDown(); if (controls.faceLeft) player.faceLeft(); if (controls.faceRight) player.faceRight(); if (controls.shoot) player.shoot(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runGame() {\n\t// DISPLAY WELCOME BANNER\n\n\t// STORE INITIAL GAME STATE\n\n\t// WHILE LOOP FOR WHEN GAME IS NOT WON\n}", "function createGame () {}", "launchGame() {\n this.grid.generate()\n this.grid.generateWalls()\n this.grid.generateWeapon('axe', this.grid.giveRandomCase())\...
[ "0.6723328", "0.65571755", "0.6491383", "0.6438042", "0.6430582", "0.6383302", "0.638224", "0.6370705", "0.63647467", "0.6356082", "0.6340284", "0.6336723", "0.63341904", "0.63219833", "0.6316161", "0.6305208", "0.6297144", "0.6288664", "0.6282659", "0.6271422", "0.6265592", ...
0.0
-1
HELPER FUNCTIONS FOR EVENT LISTENERS
function checkKey(e) { if (e.keyCode === 87) controls.moveUp = true; else if (e.keyCode === 83) controls.moveDown = true; else if (e.keyCode === 65) controls.moveLeft = true; else if (e.keyCode === 68) controls.moveRight = true; else if (e.keyCode === 38) controls.faceUp = true; else if (e.keyCode === 40) controls.faceDown = true; else if (e.keyCode === 37) controls.faceLeft = true; else if (e.keyCode === 39) controls.faceRight = true; else if (e.keyCode === 32) controls.shoot = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function EventHelper (possibleEvents) {\n }", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", "function EventHandlers() {}", ...
[ "0.75532854", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007", "0.72231007"...
0.0
-1
Loads the function code from a local disk path.
static fromAsset(path, options) { try { jsiiDeprecationWarnings.aws_cdk_lib_aws_s3_assets_AssetOptions(options); } catch (error) { if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") { Error.captureStackTrace(error, this.fromAsset); } throw error; } return new AssetCode(path, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function LocalLoader() { }", "load() {}", "load() {}", "loadFile(path) {\r\n path = this.getAbsoluteDataPath(path);\r\n // Check if a file exists at this path\r\n if (FS_1.FS.existsSync(path)) {\r\n try {\r\n // If it exists, read the contents\r\n ...
[ "0.61710286", "0.6004756", "0.6004756", "0.59410226", "0.59317225", "0.5924242", "0.5920621", "0.5919022", "0.58467567", "0.5802487", "0.5800652", "0.5656796", "0.565346", "0.5651359", "0.5628073", "0.5524898", "0.551345", "0.54191357", "0.5414121", "0.5358909", "0.5358909", ...
0.0
-1
Inline code for AppSync function
static fromInline(code) { return new InlineCode(code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async _syncApplications(req, res) {\n // log method\n logger.log(1, '_syncApplications', 'Attempting to sync applications');\n try {\n // lambda invoke parameters\n let params = {\n FunctionName: `expense-app-${STAGE}-PortalDataSyncFunction`,\n Qualifier: '$LATEST'\n };\n ...
[ "0.6237409", "0.58064175", "0.56619716", "0.5627084", "0.5610517", "0.5610517", "0.5610517", "0.5610517", "0.56017953", "0.5454321", "0.5402877", "0.5373927", "0.5217258", "0.5168108", "0.51403946", "0.51399827", "0.5105531", "0.50881344", "0.5071753", "0.5066518", "0.5065400...
0.0
-1
alphabetical sort function used to sort the "AddTab" dropdown list.
function alphabeticalsort(a,b){ var z = 0; if (a.label.toLowerCase() < b.label.toLowerCase()){ z = -1; } if (a.label.toLowerCase() > b.label.toLowerCase()){ z = 1; } if (a.label.toLowerCase() == b.label.toLowerCase()){ z = 0; } return (z); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function orderAlphabetically() {}", "function sortTableAlphabeticallyAscending(){\n sortAlphabeticallyAscending();\n}", "sortOptionsByName(a, b) {\n var aName = a.value.toLowerCase();\n var bName = b.value.toLowerCase();\n return ((aName < bName) ? -1 : ((aName > bName) ? 1 : 0));\n ...
[ "0.72943866", "0.7039919", "0.683717", "0.6819782", "0.67544645", "0.66391206", "0.6631086", "0.65611935", "0.654577", "0.6520791", "0.65192986", "0.65158516", "0.64789605", "0.6471293", "0.6470589", "0.64686185", "0.6438568", "0.6438568", "0.64292765", "0.6428717", "0.640893...
0.6361438
26
var word = "hello";
function receiver(request, sender, sendResponse){ word = request; console.log(word); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function req_string(){\n\tlet word = ;\n\treturn word\n}", "function words(str) {\n\n}", "function hello(str){\n return str;\n }", "function sayItLoud(word) {\n console.log(word.toUpperCase());\n}", "function getVariable(str) {\n\n return str;\n}", "function pr...
[ "0.70901877", "0.6964679", "0.6697091", "0.6641019", "0.657495", "0.65557116", "0.65388286", "0.651875", "0.64888126", "0.64452547", "0.643175", "0.63970685", "0.63329244", "0.63242084", "0.6311911", "0.63015914", "0.62795395", "0.6265138", "0.62560004", "0.625304", "0.621311...
0.0
-1
next step is to put the recipe label and url in the a tah in inner.html items that we want to be displayed in order: Recipe img > findings.hits[i].recipe.image Recipe label with href > label findings.hits[i].recipe.label ; href > findings.hits[i].recipe.url Calories > findings.hits[i].recipe.calories
function getMeSomeRecipes(findings) { for (let i = 0; i < 10; i++) { // Recipe Image let imgUrl = findings.hits[i].recipe.image; let img = document.createElement("img"); img.setAttribute("src", imgUrl); //Recipe Label let labelName = findings.hits[i].recipe.label; let label = document.createElement("a"); let labelhref = findings.hits[i].recipe.url; label.setAttribute("href", labelhref); label.innerText = labelName; //Recipe Calories let caloriesNumber = findings.hits[i].recipe.calories; let calories = document.createElement("p"); calories.innerText = `Only ${Math.round(caloriesNumber)} calories!`; //Recipe Div let recipediv = document.createElement("div"); // recipediv.appendChild(img); // recipediv.appendChild(label); // recipediv.appendChild(calories); recipediv.append(img, label, calories); //last one below endPoint.appendChild(recipediv); recipediv.setAttribute("class", "plate"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function useApiData(data) {document.querySelector(\"#content\").innerHTML = `\n<img src=\"${data.hits[0]recipe.image}\">\n<h5>${data.hits[0].recipe.label}</h5>\n<p>Source: ${data.hits[0].recipe.source}</p>\n<a href=\"${data.hits[0].recipe.url}\">Go conferir</a>\n`\n}", "function renderResult(result) {\n $('body...
[ "0.67163694", "0.6495173", "0.6326585", "0.63071424", "0.62476385", "0.617753", "0.61494863", "0.61387634", "0.6118738", "0.61071825", "0.6100399", "0.6098915", "0.60967654", "0.6058859", "0.6057945", "0.60541964", "0.6046508", "0.60142344", "0.6011751", "0.6005503", "0.60010...
0.6862389
0
Sets the map on all markers in the array.
function setAllMap(map) { for (var i = 0; i < markers.length; i++) { markers[i].setMap(map); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setMapOnAll(map) {\n for (var i = 0; i < markersArray.length; i++) {\n markersArray[i].setMap(map);\n }\n}", "function setMapOnAll(map) {\r\n for (var i = 0; i < markers.length; i++) {\r\n markers[i].setMap(map);\r\n }\r\n }", "function setMapOnAll(map){\n ...
[ "0.86419475", "0.8592096", "0.85918146", "0.8581791", "0.8581473", "0.85735416", "0.85723966", "0.857033", "0.857033", "0.85633993", "0.85626596", "0.8554875", "0.8554875", "0.8554875", "0.8554875", "0.85501784", "0.85501784", "0.8547008", "0.85301447", "0.8528565", "0.852266...
0.84972596
29
Removes the markers from the map, but keeps them in the array.
function clearMarkers() { setAllMap(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearMarkers() {\n markers.forEach(function(marker) {\n marker.removeFrom(mymap);\n });\n markers = [];\n}", "function remMarkerSez(){\n for (var x in markerArray){\n\t\t\tmarkerArray[x].setMap(null);\n\t\t }\n}", "function removeMarkers() {\n for (i = 0; i < markers.length; i++) ...
[ "0.83624744", "0.8339306", "0.8328489", "0.8328489", "0.8301215", "0.82779366", "0.8271111", "0.82512647", "0.82458705", "0.82372373", "0.82269716", "0.8213937", "0.8189744", "0.81634974", "0.8160817", "0.81574255", "0.81571305", "0.8154514", "0.81432164", "0.8132379", "0.811...
0.0
-1
Shows any markers currently in the array.
function showMarkers() { setAllMap(map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showMarkers() {\n for (var i=0; i < markers.length; i++) {\n markers[i].setVisible(true);\n }\n }", "function showMarkers() {\n displayAllMarkers(map);\n }", "function showMarkers() {\n\t\t setMapOnAll(map);\n\t\t}", "function showMarkers() {\n\t\t setMapOnAll(map);\n\t\t}", "fun...
[ "0.83660954", "0.8186145", "0.814078", "0.814078", "0.81302625", "0.81292725", "0.8116352", "0.81025255", "0.8095168", "0.8091384", "0.8081748", "0.8078595", "0.80732024", "0.8072171", "0.8071884", "0.8071884", "0.801003", "0.79556906", "0.7946402", "0.7925289", "0.7904578", ...
0.81549734
3
Deletes all markers in the array by removing references to them.
function deleteMarkers() { clearMarkers(); markers = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteMarkers() {\n clearMarkers();\n markers = [];\n // remove bounds values from boundsArray\n boundsArray = [];\n}", "function deleteMarkers() {\n clearMarkers()\n markerArr = []\n}", "function deleteAllMarkers() {\r\n if (_markersArray) {\r\n for (i in _markersArray) {\r\n ...
[ "0.79807633", "0.79240143", "0.7880661", "0.77787656", "0.77312356", "0.7722471", "0.77152866", "0.76681226", "0.76642114", "0.76642114", "0.76642114", "0.766018", "0.7659618", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "0.764948", "...
0.7611798
40
Create a new BrowserWindow when `app` is ready
function createWindow () { //window state keeper let state = windowStateKeeper({ defaultWidth: 500, defaultHeight: 650 }); mainWindow = new BrowserWindow({ x: state.x, y: state.y, width: state.width, height: state.height, minWidth: 350, maxWidth: 650, minHeight: 300, webPreferences: { nodeIntegration: true }, show: false }) // Load index.html into the new BrowserWindow mainWindow.loadFile('renderer/main.html'); //manage the window state with state keeper state.manage(mainWindow); // Open DevTools - Remove for PRODUCTION! //mainWindow.webContents.openDevTools(); // Listen for window being closed mainWindow.on('closed', () => { mainWindow = null }) mainWindow.once('ready-to-show', mainWindow.show); appMenu.currentMenu(mainWindow.webContents); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_initWindow() {\n this._window = new BrowserWindow({\n focusable: false,\n show: false\n });\n\n this._window.loadURL(Notifier.PathToWindow);\n }", "function createMainWindow() {\n mainWindow = new BrowserWindow({\n width: WIDTH,\n height: HEIGHT,\n icon: path.join(__d...
[ "0.7439638", "0.74264365", "0.7401286", "0.72882456", "0.7224521", "0.7200428", "0.71505237", "0.7126082", "0.71174705", "0.71149224", "0.70915836", "0.7076883", "0.70563895", "0.7045518", "0.7023594", "0.7009553", "0.6988202", "0.69839144", "0.69720095", "0.6957637", "0.6945...
0.68745583
32
must redefine noop each time so it doesn't inherit from previous arbitrary classes
function noop() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop() {}", "function _noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "function noop(){}", "f...
[ "0.7526021", "0.7526021", "0.7526021", "0.7526021", "0.7526021", "0.7526021", "0.7526021", "0.7474873", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", "0.739682", ...
0.0
-1
V imeniku isce po podanih stolpcih za iskanim nizom Iskani niz obarva rdece s rumenim ozadjem in ga podcrta znotraj vrstice Izpise samo vrstice, kjer je bil iskani niz najden
async function lookForPeople(phonebook, header, searchFields, searchFilter) { let noMatch = true; // ali je sploh katera oseba v imeniku najdena? phonebook.forEach(person => { // Preleti osebe v imeniku, in glede na izbrana iskalna polja in filtre isci in izpisuj let personPrint = ""; // String katerega sestavljamo za osebo, ce je bilo kaj najdeno let personMatch = false; // Ali se iskani niz pojavi pri osebi? for (var col in header) { let i = header[col]; // index stolpca if (searchFields.includes(col)) { // Uporabnik zeli iskati po tem polju // Spremeni v string in indeksiraj stringe person[i] = person[i].toString() let pos = 0; let oldPos = 0; let indices = []; // Isci po celem stringu kje se nahajajo pozicije while ((pos = person[i].indexOf(searchFilter, oldPos)) > -1) { indices.push(pos); oldPos = pos + searchFilter.length; } oldPos = 0; // Barvaj stringe, kjer so bile najdene pozicije for (let j=0; j<indices.length; j++) { personMatch = true; noMatch = false; // Pridobi substr od nepobarvanega dela personPrint += person[i].substr(oldPos, indices[j] - oldPos); // Pridobi del, ki ga je treba pobarvat personPrint += chalk.yellow( chalk.underline( chalk.bold( chalk.bgMagenta( person[i].substr(indices[j], searchFilter.length) )))); // Popravi staro pozicijo na zaden char zapisan v newPerson oldPos = indices[j] + searchFilter.length; } // V kolikor je za zadnjo najdeno pozicijo se kaj, dodaj v string (nepobarvano) if (oldPos < person[i].length) { personPrint += person[i].substr(oldPos, person[i].length - oldPos); } personPrint += " " } else { // Vseeno dodaj stolpec v string, v primeru da se isce po ostalih stolpcih personPrint += person[i] + " "; } } if (personMatch) { // Izpisi trenuten personPrint kot zadetek (pobarvani deli vkljuceni) console.log(personPrint); } }); // Obvesti ali je bil kdo najden let result = {"noMatch": noMatch}; return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jelKenta(niz)\n{\n\t/* make a set from an array */\n\tvar skup = napraviSet(niz);\n\tvar tmpn = Array.from(skup);\n\ttmpn.sort();\n\n\tif(skup.size === 5)\n\t{\n\t\tconsole.log(tmpn[4]);\n\t\t/* kandidat za kentu */\n\t\tif((tmpn[4] - tmpn[0]) === 4)\n\t\t{\n\t\t\t/* velika ili mala kenta? */\n\t\t\tif(tm...
[ "0.67079115", "0.66086614", "0.6588543", "0.6503447", "0.6411943", "0.6401569", "0.6375653", "0.63005114", "0.6274444", "0.6266517", "0.615698", "0.61478424", "0.6111749", "0.6070658", "0.60660726", "0.6035492", "0.60261947", "0.6001451", "0.5998673", "0.59914774", "0.5962251...
0.0
-1
Redraws the library conflicts
function updateLibraryConflicts(){ var list = $("#library-list"); list.html(""); for(var id in lib_conflicts) { var c = lib_conflicts[id]; var conflict = $("<div class='library-conflict'>"); var name = $("<div class='library-conflict-name'>").html(c.name); var years = $("<div class='library-conflict-years'>").html(c.years); var remove = $("<button class='button'>").html("Remove"); remove.attr("onclick", "removeConflict("+id+")"); //remove.attr("onclick", ); conflict.append(name).append(years).append(remove); list.append(conflict); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "redrawTheme() {\n this._refreshStyleSheet();\n this._drawLogo();\n }", "function reset_highlight() {\n\t$('.imj_highlightDependencies').removeClass(\"imj_highlightDependencies\");\n}", "function forceRedraw() {\n var tempStyleSheet = document.createElement('style');\n document.body.appendChild(tem...
[ "0.5746306", "0.56543815", "0.554185", "0.5524184", "0.5491174", "0.53969604", "0.5361566", "0.53248364", "0.524189", "0.52418125", "0.52334845", "0.52145433", "0.5206442", "0.520284", "0.5169705", "0.5169705", "0.5163949", "0.5160191", "0.51589644", "0.51499987", "0.51477414...
0.6299278
0
Given a new country, updates the enire page
function updateWithCountry(){ return function(){ /* Get the selected country code */ ccode = $("#country-input option:selected")[0].value; /* Make sure we were able to get the country code */ if(ccode === undefined || ccode.length !== 3){ /* TODO: Update timeline and map to be blank */ return; } /* Get the conflicts for the country */ $.ajax({ type: "get", url: "/disputes/country/"+ccode, success: function(data){ disputes = data.disputes; /* Update disputes per year */ for(var i=1812; i<1993; i++){ disputes_per_year[i+""] = 0; } for(var year in disputes){ for(var i = 0; i<disputes[year].length; i++){ var start = parseInt(disputes[year][i].dispute[4]); var end = parseInt(disputes[year][i].dispute[7]); for(var j=start; j<end; j++){ disputes_per_year[j+""]++; } } } /* Update the maximum number of disputes found */ max_disputes_in_year = 0; for(var i=1812; i<1993; i++){ var num_disp = disputes_per_year[i+""]; if(num_disp > max_disputes_in_year) max_disputes_in_year = num_disp; } /* Update the timeline */ drawTimeline(date_start, date_end); /* Update the conflict DOM */ updateConflicts(); /* Update the map */ updateMap(); } }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pt9CountryChange() {\n ptCountryChange(pt9InitializeState,'AUEFT');\n }", "function handleCountryChange(countryCode, countryName) {\n basicMsg(\"Loading...\");\n $(\"#sourcesList\").prop('selectedIndex', 0); //reset sources list\n\n if (countryCode === 'All') {\n displa...
[ "0.6655316", "0.660322", "0.6579025", "0.6573853", "0.6438471", "0.64133376", "0.6409713", "0.63747454", "0.6317996", "0.6242204", "0.62264663", "0.62254775", "0.6220533", "0.6190308", "0.618959", "0.6178868", "0.61718464", "0.6163816", "0.6148273", "0.6051192", "0.5987728", ...
0.5901455
25
Updates conflict information with the given start and end date
function updateConflicts(){ /* Remove children */ var ul = $("#conflict-list ul"); ul.html(""); var start_yr = timelinePixelToYear(date_start); var end_yr = timelinePixelToYear(date_end); /* Create and add new children */ for(var year in disputes){ if(parseInt(year) < start_yr || parseInt(year) > end_yr) continue; for(var i = 0; i<disputes[year].length; i++){ var li = $("<li>"); li.attr("onclick", "updateDetails("+year+","+i+")"); if(disputes[year][i].dispute[16] !== undefined) li.html(disputes[year][i].dispute[16]); else li.html("Unnamed Conflict of " + year); ul.append(li); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkConflict() {\n var event1 = $scope.events[0];\n event1.conflict = 0;\n var event2;\n var i = 1;\n while (i < $scope.events.length) {\n event2 = $scope.events[i];\n event2.conflict = 0;\n var event1End ...
[ "0.57612413", "0.5690803", "0.54826987", "0.5404315", "0.5310068", "0.52800864", "0.5115271", "0.5092457", "0.5092406", "0.50859", "0.49811685", "0.4977782", "0.49751657", "0.49723938", "0.49567866", "0.49567866", "0.49567866", "0.49567866", "0.4950253", "0.49229136", "0.4899...
0.5420406
3
Draws the unpopulated timeline on the timeline canvas
function drawTimeline(slider_start, slider_end){ /* Clear the context */ timeline_context.clearRect(0,0, timeline_canvas.width, timeline_canvas.height); timeline_context.fillStyle = "#FFFBF4"; timeline_context.fillRect(0,0,timeline_context.width, timeline_context.height); /* Timeline highlight */ timeline_context.fillStyle = "rgba(240, 150, 150, .1);" timeline_context.fillRect(slider_start,0, slider_end-slider_start, 70); /* Timeline axis */ timeline_context.fillStyle = "#777"; timeline_context.font = "bold 12pt Helvetica" timeline_context.fillText("1816",0,95); timeline_context.fillText("1992", 555, 95); /* Timeline line */ timeline_context.fillStyle = "#EEE"; timeline_context.strokeStyle = "#777"; timeline_context.lineWidth = 1; timeline_context.fillRect(10, 70, 580, 5); timeline_context.strokeRect(10, 70, 580, 5); /* Timeline data */ if(disputes_per_year !== undefined){ timeline_context.fillStyle = "rgba(240, 150, 150, 1);" var bar_width = yearsTotimelinePixels(1); var bar_inc = 65/max_disputes_in_year; for(var year in disputes_per_year){ if(disputes_per_year[year]>0){ timeline_context.fillRect( yearTotimelinePixels(parseInt(year)), 70-(bar_inc*disputes_per_year[year]), bar_width, bar_inc*disputes_per_year[year]); } } } /* Timeline sliders */ timeline_context.fillStyle = "#866"; timeline_context.arc(slider_start, 70, 10, 0, 2*Math.PI, false); timeline_context.fill(); timeline_context.fillStyle = "#866"; timeline_context.arc(slider_end, 70, 10, 0, 2*Math.PI, false); timeline_context.fill(); /* Timeline vertical bar */ timeline_context.strokeStyle = "#FAA"; timeline_context.beginPath(); timeline_context.moveTo(slider_start, 0); timeline_context.lineTo(slider_start, 60); timeline_context.stroke(); timeline_context.closePath(); timeline_context.beginPath(); timeline_context.moveTo(slider_end, 0); timeline_context.lineTo(slider_end, 60); timeline_context.stroke(); timeline_context.closePath(); timeline_context.fillStyle = "#777"; timeline_context.font = "bold 10pt Helvetica" timeline_context.fillText("" + timelinePixelToYear(slider_start), slider_start, 10); timeline_context.fillText("" + timelinePixelToYear(slider_end), slider_end-30, 10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onInitialDrawComplete() {\n var date = new Date();\n var year = date.getFullYear();\n var month = date.getMonth();\n var nextMonth = month == 11 ? 0 : month + 1;\n var nextYear = month == 11 ? year + 1 : year;\n var day = 1;\n\n this.timeline.setWindow(\n new Date(year, month, day),\n ...
[ "0.7080322", "0.6962328", "0.691651", "0.6812492", "0.66872245", "0.66731375", "0.6668398", "0.660053", "0.63190126", "0.63044447", "0.6264887", "0.6247488", "0.62271714", "0.6179236", "0.61697626", "0.6105627", "0.60899585", "0.60818005", "0.60580105", "0.603072", "0.6030198...
0.7229555
0
Time comp: O(n) Space comp: O(n) Iterative solution
function returnKthToLast(head, k) { let p1 = head; for (let i = 0; i < k; i++) { p1 = p1.next; } let p2 = head; while(p1) { p2 = p2.next; p1 = p1.next; } return p2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mystery(n) {\n let r = 0;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j <= n; j++) {\n for (let k = 1; k < j; k++) {\n r++;\n }\n }\n }\n return r;\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.lengt...
[ "0.6663564", "0.65929866", "0.65746254", "0.6571828", "0.65539616", "0.65265745", "0.64724004", "0.6401897", "0.63385755", "0.6328479", "0.6302101", "0.62902457", "0.6273732", "0.62656975", "0.62620693", "0.62528133", "0.6239516", "0.6233018", "0.6218765", "0.62186587", "0.62...
0.0
-1
gets activated when we press down a key
function keyDownHandler(event) { // get the keyCode switch (event.keyCode) { // "up arrow" key case 38: // set upArrowPressed = true upArrowPressed = true; break; // "down arrow" key case 40: downArrowPressed = true; break; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keyDown(event) {\n var keyCode = event.which || event.keyCode;\n this.activeCommands[keyCode] = true;\n }", "keyDown(event) {\n var keyCode = event.which || event.keyCode;\n this.activeCommands[keyCode] = true;\n }", "function keyDown(e) {\n keyPress[e.key] = true;\n}", "keyDown(...
[ "0.80504364", "0.80504364", "0.80347586", "0.785865", "0.77134097", "0.77106714", "0.76767427", "0.76314795", "0.7584557", "0.7535983", "0.752803", "0.7504957", "0.7483984", "0.74645764", "0.7461633", "0.7461633", "0.74455506", "0.74045163", "0.7401521", "0.73460174", "0.7337...
0.7201216
39
update : position , movement , score ,etc....(core logic)
function update() { ball.x += ball.velocityX; ball.y += ball.velocityY; //simple AI to control computer paddle let computerLevel = 0.8; comp.y += (ball.y - (comp.y + comp.height / 2)) * computerLevel; // user up down change if (upArrowPressed && user.y > 0) { user.y -= 12; } else if (downArrowPressed && user.y < cvs.height - user.height) { user.y += 12; } if (ball.y + ball.radius > cvs.height || ball.y - ball.radius < 0) { //( if ball hit upper or lower boundary , reverse y velocity ) ball.velocityY = -ball.velocityY; } let player = ball.x < cvs.width / 2 ? user : comp; if (collision(ball, player)) { // calculating and normalising where the ball hits the player let collidePoint = ball.y - (player.y + player.height / 2); collidePoint = collidePoint / (player.height / 2); // calculating angle in radian let angleRad = collidePoint + Math.PI / 4; //direction in which ball must go after collision let direction = ball.x < cvs.width / 2 ? 1 : -1; //change velocity x and y ball.velocityX = direction * ball.speed; ball.speed += 1; //increasing speed everytime ball hits the paddle } // update score if (ball.x - ball.radius < 0) { // comp win comp.score++; resetBall(); } else if (ball.x + ball.radius > cvs.width) { // user win user.score++; resetBall(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n // initialize next move\n let nextPosition = this.getNextPosition();\n // if next position is not blocked by an object\n if (this.isPositionFree(nextPosition)) {\n this.position.x = nextPosition.x;\n this.position.y = nextPositi...
[ "0.7234212", "0.7201657", "0.7168078", "0.6947328", "0.6931839", "0.6915788", "0.6915788", "0.68867666", "0.6876057", "0.686695", "0.6858264", "0.6815257", "0.6812449", "0.6776745", "0.6761515", "0.67493415", "0.67452395", "0.67289484", "0.6721278", "0.67107475", "0.669773", ...
0.0
-1
DO NOT EDIT. Use zipCodeMaker.py to generate.
function constructZipCodeArray() { var zipCoords = [ new google.maps.LatLng( 0.480002428422559E+02, -0.122372853876444E+03), new google.maps.LatLng( 0.479981950000000E+02, -0.122375631000000E+03), new google.maps.LatLng( 0.479954570000000E+02, -0.122386731000000E+03), new google.maps.LatLng( 0.479902260000000E+02, -0.122392217000000E+03), new google.maps.LatLng( 0.479893630000000E+02, -0.122394729000000E+03), new google.maps.LatLng( 0.479971770000000E+02, -0.122402868000000E+03), new google.maps.LatLng( 0.479998150000000E+02, -0.122407599000000E+03), new google.maps.LatLng( 0.480010780000000E+02, -0.122415062000000E+03), new google.maps.LatLng( 0.479964950000000E+02, -0.122416726000000E+03), new google.maps.LatLng( 0.479998150000000E+02, -0.122427727000000E+03), new google.maps.LatLng( 0.480027260000000E+02, -0.122435159000000E+03), new google.maps.LatLng( 0.480032290000000E+02, -0.122435586000000E+03), new google.maps.LatLng( 0.480038240000000E+02, -0.122435159000000E+03), new google.maps.LatLng( 0.480042970000000E+02, -0.122439560000000E+03), new google.maps.LatLng( 0.480039150000000E+02, -0.122441548000000E+03), new google.maps.LatLng( 0.479998150000000E+02, -0.122451180000000E+03), new google.maps.LatLng( 0.480000860000000E+02, -0.122460993000000E+03), new google.maps.LatLng( 0.480042670000000E+02, -0.122461817000000E+03), new google.maps.LatLng( 0.480066170000000E+02, -0.122463861000000E+03), new google.maps.LatLng( 0.480077840000000E+02, -0.122466638000000E+03), new google.maps.LatLng( 0.480075470000000E+02, -0.122475305000000E+03), new google.maps.LatLng( 0.480053040000000E+02, -0.122483653000000E+03), new google.maps.LatLng( 0.480044190000000E+02, -0.122485362000000E+03), new google.maps.LatLng( 0.479970370000000E+02, -0.122485605000000E+03), new google.maps.LatLng( 0.479970370000000E+02, -0.122485605000000E+03), new google.maps.LatLng( 0.479964620000000E+02, -0.122491597000000E+03), new google.maps.LatLng( 0.479986780000000E+02, -0.122493949000000E+03), new google.maps.LatLng( 0.480007330000000E+02, -0.122493861000000E+03), new google.maps.LatLng( 0.480007530000000E+02, -0.122507578000000E+03), new google.maps.LatLng( 0.480142590000000E+02, -0.122506984000000E+03), new google.maps.LatLng( 0.480132570000000E+02, -0.122514445000000E+03), new google.maps.LatLng( 0.480099220000000E+02, -0.122518739000000E+03), new google.maps.LatLng( 0.480097390000000E+02, -0.122519931000000E+03), new google.maps.LatLng( 0.480096260000000E+02, -0.122524222000000E+03), new google.maps.LatLng( 0.480114550000000E+02, -0.122526230000000E+03), new google.maps.LatLng( 0.480125060000000E+02, -0.122525889000000E+03), new google.maps.LatLng( 0.480190180000000E+02, -0.122519821000000E+03), new google.maps.LatLng( 0.480271940000000E+02, -0.122507278000000E+03), new google.maps.LatLng( 0.480286330000000E+02, -0.122506799000000E+03), new google.maps.LatLng( 0.480403340000000E+02, -0.122506753000000E+03), new google.maps.LatLng( 0.480406130000000E+02, -0.122496289000000E+03), new google.maps.LatLng( 0.480495180000000E+02, -0.122497526000000E+03), new google.maps.LatLng( 0.480495100000000E+02, -0.122500059000000E+03), new google.maps.LatLng( 0.480459090000000E+02, -0.122500058000000E+03), new google.maps.LatLng( 0.480457690000000E+02, -0.122506841000000E+03), new google.maps.LatLng( 0.480660890000000E+02, -0.122506691000000E+03), new google.maps.LatLng( 0.480678510000000E+02, -0.122510781000000E+03), new google.maps.LatLng( 0.480666048842414E+02, -0.122512642377293E+03), new google.maps.LatLng( 0.480666048842414E+02, -0.122512642377293E+03), new google.maps.LatLng( 0.480734236733704E+02, -0.122511418071775E+03), new google.maps.LatLng( 0.480750926560238E+02, -0.122511118407914E+03), new google.maps.LatLng( 0.480753010000000E+02, -0.122511081000000E+03), new google.maps.LatLng( 0.480755461188955E+02, -0.122511327856426E+03), new google.maps.LatLng( 0.480810850000000E+02, -0.122516906000000E+03), new google.maps.LatLng( 0.480941542167064E+02, -0.122524108786013E+03), new google.maps.LatLng( 0.480965370000000E+02, -0.122525422000000E+03), new google.maps.LatLng( 0.480965524699514E+02, -0.122525234289681E+03), new google.maps.LatLng( 0.480975380000000E+02, -0.122513276000000E+03), new google.maps.LatLng( 0.480954384500262E+02, -0.122499152449630E+03), new google.maps.LatLng( 0.480942420000000E+02, -0.122491104000000E+03), new google.maps.LatLng( 0.480775608267170E+02, -0.122471988143992E+03), new google.maps.LatLng( 0.480685010000000E+02, -0.122461606000000E+03), new google.maps.LatLng( 0.480543230000000E+02, -0.122448419000000E+03), new google.maps.LatLng( 0.480464556371648E+02, -0.122433942613526E+03), new google.maps.LatLng( 0.480450010000000E+02, -0.122431266000000E+03), new google.maps.LatLng( 0.480447184818418E+02, -0.122430240189224E+03), new google.maps.LatLng( 0.480441693399557E+02, -0.122428246279635E+03), new google.maps.LatLng( 0.480372861321143E+02, -0.122403253660313E+03), new google.maps.LatLng( 0.480367835104642E+02, -0.122401428663617E+03), new google.maps.LatLng( 0.480365630000000E+02, -0.122400628000000E+03), new google.maps.LatLng( 0.480340300000000E+02, -0.122387382000000E+03), new google.maps.LatLng( 0.480344570000000E+02, -0.122376259000000E+03), new google.maps.LatLng( 0.480167812263017E+02, -0.122374686000000E+03), new google.maps.LatLng( 0.480090554265219E+02, -0.122373998466698E+03), new google.maps.LatLng( 0.480080131436756E+02, -0.122373905712008E+03), new google.maps.LatLng( 0.480007910000000E+02, -0.122373263000000E+03), new google.maps.LatLng( 0.480002428422559E+02, -0.122372853876444E+03), ]; return zipCoords }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main() {\n var year_zip = define_zippy('year');\n var month_zip = define_zippy('month');\n var topic_zip = define_zippy('topic');\n var collection_zip = define_zippy('collection');\n}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip() {...
[ "0.62616396", "0.6171133", "0.6171133", "0.6171133", "0.6141213", "0.58906025", "0.58729374", "0.58729374", "0.58729374", "0.58729374", "0.586976", "0.5866391", "0.5833366", "0.5823646", "0.5813035", "0.56864625", "0.5640382", "0.56234306", "0.5590841", "0.5552588", "0.552158...
0.0
-1
mark the world in search
function highlightWord(){ var keyword = document.getElementById("keyword").value; var display = document.getElementById('fileContent'); var newContent = ""; //find all the occurences let spans = document.querySelectorAll("mark"); for (var i=0; i< spans.length; i++){ spans[i].outerHTML = spans[i].innerHTML; } var re = new RegExp(keyword, "gi"); var replaceText = "<mark od ='markMe'>$&</mark>"; var currentBook = display.innerHTML; newContent = currentBook.replace(re, replaceText); display.innerHTML = newContent; var count = document.querySelectorAll("mark"); document.getElementById("searchstat").innerHTML = "found " + count.length + " occurences"; if (count > 0){ var element = document.getElementById("markMe"); element.scrollIntoView; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function outSearchResult(){\n highlightShip(oldMmsi);\n jumpto(oldCoordinates);\n}", "function searchLoc(){\n selectedPlace = document.getElementById('place');\n deleteAllMarkers();\n searchNearLocs(map, curPos);\n }", "function searchUpdated(term) {\n setsearch(term);\n }", "function...
[ "0.64316845", "0.6083975", "0.60482275", "0.60162365", "0.6009958", "0.59987974", "0.59826374", "0.5971761", "0.5852573", "0.58283406", "0.58159286", "0.5806928", "0.57990044", "0.5785072", "0.5741532", "0.57368064", "0.56941503", "0.5687996", "0.5684281", "0.5669868", "0.565...
0.0
-1
Examples factorial(5) => 120 5 4 3 2 1 => 120 factorial(4) => 24 4 3 2 1 => 24 Bonus Use a memoize function to cache with recursion
function factorial(n) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoizedFactorial() {\n let cache = [1];\n function inner(n) {\n if (!cache[n]) {\n cache[n] = inner(n - 1) * n \n } \n return cache[n]\n }\n return inner\n }", "function factorial(n){\n //se crea una cache para almecenar los ...
[ "0.8511063", "0.8230194", "0.797256", "0.76474655", "0.75943184", "0.75881857", "0.7505791", "0.7445432", "0.744183", "0.74265575", "0.74232256", "0.7421188", "0.7414093", "0.73804563", "0.73659635", "0.7353689", "0.7347226", "0.73431563", "0.7342619", "0.7334186", "0.7333285...
0.73711735
14
Get random int from range
function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function randInt(range) {\n return Math.floor(Math.random()* range);\n}", "function randomInt(range) {\n return Math.floor(Math.random() * range);\n }", "function getRandomInt(range) {\n return 1 + Math.floor(Math.random() * Math.floor(range));\n }", "function randomInt(range) {\n ...
[ "0.87585855", "0.8697117", "0.868583", "0.8677989", "0.8677334", "0.8677334", "0.8677334", "0.8677334", "0.85963154", "0.85791296", "0.85301936", "0.8410987", "0.8410987", "0.83964527", "0.83625734", "0.83249855", "0.8305281", "0.82484436", "0.8245177", "0.81926924", "0.81846...
0.0
-1
Move to another list item
function listMove(steps = 0){ if (filter().length > 0) itemIndex += steps; if (itemIndex < 0){ itemIndex = filter().length - 1 } itemIndex %= fStorage.length - 1; update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveToCompletedList(newItem){\n completedList.prepend(newItem);\n}", "function swapItems(fromIndex, toIndex) {\n // get the picked up item and the target position item\n const itemOne = listItems[fromIndex].querySelector(\".draggable-list__detail\");\n const itemTwo = listItems[toIndex].querySelec...
[ "0.6548707", "0.6519676", "0.6505136", "0.6421122", "0.636212", "0.6265601", "0.6242285", "0.6227965", "0.6185981", "0.61780155", "0.6133683", "0.6131711", "0.6095885", "0.6070714", "0.6066016", "0.6041052", "0.60210586", "0.6017752", "0.5978422", "0.5971671", "0.5956477", ...
0.5823854
33
Filter array by type
function filter(){ fStorage.length = 0; for (let i = 0; i < storage.length; i++){ if (storage[i].type == fType || fType == "all") { fStorage[fStorage.length] = storage[i]; } } return fStorage; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeAllElements(array, type) {\n return array.filter(function(item) {\n return (item.indexOf(type) === -1);\n });\n }", "function filterArrayy(arr){\r\n return arr.filter ((element) => typeof element ===\"number\");\r\n}", "function filterItems (array, filter) {\n if(filter.trim()....
[ "0.7333189", "0.73054296", "0.7120849", "0.7100422", "0.7059188", "0.6935863", "0.6863183", "0.67732817", "0.67341924", "0.67005223", "0.66774344", "0.66760725", "0.66048586", "0.65725523", "0.6528385", "0.64564", "0.6439021", "0.6296112", "0.62323815", "0.6227997", "0.621621...
0.5677626
40
middleware to check if user is logged in or not.
function requireAuth(nextState, replace) { if (!LoginStore.isLoggedIn()) { replace({ pathname: '/login', state: { nextPathname: nextState.location.pathname } }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isLoggedIn(request, response, next){\n // If they are authenticated, carry on\n if(request.isAuthenticated()){ return next();}\n // If they aren't, redirect them to the home page\n response.redirect('/');\n}", "function isLoggedIn(request, response, next) {\n // if user is authenticated in the se...
[ "0.8130827", "0.80180913", "0.7876595", "0.782581", "0.7809108", "0.7793106", "0.77660173", "0.7759402", "0.7758418", "0.77542377", "0.7750908", "0.77412885", "0.7731095", "0.7715523", "0.7710746", "0.76985776", "0.7694054", "0.7693698", "0.7691954", "0.7687467", "0.768662", ...
0.0
-1
if winningPlayer is null then its a draw
constructor(gamePage, winningPlayer=null){ super(); this.gamePage = gamePage; this.winningPlayer = winningPlayer; this.addEvents({ 'click .rematch-btn' : 'rematch', 'click .new-game-btn' : 'newGame', 'click .hide-window-btn' : 'hideWindow' }); FixEverything.navbar.render(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkForWin() {\r\n if (game_1.isWinningState(board)) {\r\n var winner = game_1.detectWinner(board);\r\n view_1.displayGameOver(winner);\r\n }\r\n else if (game_1.isDrawState(board)) {\r\n view_1.displayGameOver(null);\r\n }\r\n}", "checkWinner() {\n this.checkInHor...
[ "0.72864866", "0.72530013", "0.7111277", "0.71056974", "0.7091193", "0.7054453", "0.69548905", "0.6899447", "0.6873821", "0.6819291", "0.6819221", "0.68048704", "0.6789152", "0.6788011", "0.6784978", "0.677317", "0.67339456", "0.67260045", "0.6716584", "0.67137426", "0.670891...
0.0
-1
Publish tutor availability for subject(s)
function publish(subjects) { subjects_ = subjects; var arr = hangoutURL.split('/'); gid = arr[arr.length - 1]; pid = localParticipant.person.id; var payload = 'subjects=' + subjects + '&gid=' + gid + '&pid=' + pid + '&pName=' + localParticipant.person.displayName + '&count=' + count + '&maxParticipants=' + MAX_COUNT; try { $('#message').html(""); httpRequest('POST', SERVER_PATH, 'publishsubjects', payload); $('#message').html("Submitted"); } catch (e) { console.log(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function onPublish() {\n setPublishing(true);\n try {\n const response = await api.request({ method: 'PUT', url: `${PUBLICATION_PATH}/publish/${id}`, data: {} });\n mutate(`${PUBLICATION_PATH}/${id}`);\n setPublishing(false);\n setPublishSuccess(true);\n setTimeout(() => setPub...
[ "0.5720583", "0.54572177", "0.5431891", "0.53924656", "0.5275281", "0.52708536", "0.523012", "0.5229384", "0.52283525", "0.5170004", "0.5148517", "0.51289713", "0.5124613", "0.51207703", "0.51160693", "0.5102971", "0.50965893", "0.5042826", "0.5026513", "0.50139827", "0.49968...
0.635756
0
Post a heartbeat to inform host that this tutor HO is still available
function heartBeat() { httpRequest('GET', SERVER_PATH, 'heartbeat', 'gid=' + gid + '&pid=' + pid + "&count=" + count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function heartbeat () { this.isAlive = true }", "queueHeartbeat() {\n\t\t\tif (this.options.ignoreHeartbeat) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!(this.hasHandshook && this.open)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (this.heartbeatTimeout !== undefined) {\n\t\t\t\tclearTimeout(this.heartbeatTimeout);\n\...
[ "0.72263926", "0.7109383", "0.71085775", "0.6915055", "0.68861634", "0.688286", "0.6869308", "0.67477936", "0.67313135", "0.67250514", "0.67086905", "0.6685666", "0.6644593", "0.65829605", "0.6556017", "0.64808047", "0.645904", "0.6414704", "0.64124084", "0.64010787", "0.6392...
0.640519
19
Save settings, overwrite tracker.js file
function saveSettings() { DEBUG && console.log("Saving settings..."); jQuery.ajax({ type: "POST", url: 'helpers/saveSettings.php', data: { delay: jQuery('#delayRange').val(), static: jQuery('#staticWebsite').is(':checked'), recordClick: jQuery('#recordClicks').is(':checked'), recordMove: jQuery('#recordMove').is(':checked'), recordKey: jQuery('#recordKey').is(':checked'), maxMove: jQuery('#maxMoves').val(), serverPath: jQuery('#serverPath').val(), ignoreGET: jQuery('#ignoreGET').val(), percentangeRecorded: jQuery('#percentangeRecorded').val(), }, success: function () { alert("Settings successfully saved!"); }, error: function (data) { alert("Could not save settings!" + data.responseText); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveSettings() {\n fs.writeFileSync(SETTINGS_FILE, settings, SETTINGS_TYPE);\n}", "function save() {\n require('Storage').writeJSON('qmsched.json', settings);\n}", "_saveSettings(settings = null) {\n if (settings == null) {\n settings = this.settings.toJS();\n }\n\n ss.set(\"settings_v...
[ "0.73162335", "0.69485545", "0.69398546", "0.6905729", "0.6787198", "0.6755092", "0.6753151", "0.66769636", "0.6666348", "0.66618085", "0.6630609", "0.6620979", "0.6598296", "0.65770036", "0.6547662", "0.6458316", "0.6441682", "0.6436496", "0.63869256", "0.63647985", "0.63399...
0.0
-1
Get settings, read from tracker.js file
function loadSettings() { jQuery.getJSON('helpers/loadSettings.php', function (data) { settings = data; }).fail(function (data) { if (data.responseText.indexOf('login') != -1) window.location = 'login.php'; else alert("Could not load settings from file." + data.responseText); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get() {\n return settings;\n }", "function getSettings(){\n if(localStorage.getItem('settings') !== null){\n settings = JSON.parse(localStorage.getItem('settings'));\n }\n}", "function getSettings() {\n chrome.storage.sync.get({\n apiToken: '',\n addresses: {}\n },...
[ "0.6978229", "0.68247634", "0.68226206", "0.6748168", "0.66652143", "0.65442395", "0.65340227", "0.65099037", "0.6440046", "0.643934", "0.6431932", "0.64244866", "0.64244866", "0.64244866", "0.6395378", "0.63864046", "0.6368854", "0.63415265", "0.63063", "0.6303605", "0.62944...
0.0
-1
Makes sure every date between first and last has at least a 0 value
function fillEmptyDates(data) { if (data === null || data[0].values.length === 0) { return data; } if (Date.prototype.tomorrow == null) { Date.prototype.tomorrow=function(){ /* Returns a new date object*/ var newd = new Date(this); newd.setDate(newd.getDate()+1); return newd; }; } var newdata = []; var curDate = data[0].values[0].x; data[0].values.forEach(function(d){ while(curDate < d.x) { newdata.push({x:curDate, y:0}); curDate = curDate.tomorrow(); } newdata.push(d); curDate = curDate.tomorrow(); }); return [{key: 'Snaps Per Day', values: newdata}]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get hasValidDates() {\n let me = this,\n start = me.startDateMS,\n end = me.endDateMS;\n\n return !start || !end || end - start >= 0;\n }", "get hasValidDates() {\n const {\n startDateMS,\n endDateMS\n } = this;\n return !startDateMS || !endDateMS || endDateMS - startDateMS >=...
[ "0.6355291", "0.62490755", "0.5787765", "0.57518506", "0.5676495", "0.56567144", "0.5634439", "0.5620605", "0.56108123", "0.5556205", "0.55173725", "0.54704106", "0.54386556", "0.5386612", "0.5386612", "0.53747386", "0.53747386", "0.53747386", "0.53747386", "0.53747386", "0.5...
0.5671974
5
Handle a file load
function handleProgress() { message.text = "Loading " + (preloader.progress * 100 | 0) + "%"; stage.update(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleFileLoad(evt) {\n\t// If the file is an audio file, decode it\n\tif (evt.item.audio === true) {\n\t\tvar audioFile = audioFilenames[evt.item.number];\n\t\taudioFile.result = queue.getResult(audioFile.name);\n\t\tdecodeSound(audioFile);\n\t}\n}", "function handleFileLoad(event) {\n console.log(\...
[ "0.7436387", "0.70735985", "0.6849198", "0.65771407", "0.65771407", "0.6542549", "0.65182745", "0.64621526", "0.6421306", "0.6420583", "0.63777477", "0.6354598", "0.63100475", "0.6271615", "0.6270971", "0.62487805", "0.6215236", "0.6213226", "0.6211976", "0.6167493", "0.61674...
0.0
-1
run the blinkLED function every 250ms
function blinkLED() { //function to start blinking if (LED.readSync() === 0) { //check the pin state, if the state is 0 (or off) LED.writeSync(1); //set pin state to 1 (turn LED on) } else { LED.writeSync(0); //set pin state to 0 (turn LED off) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function blink_controller(){\n for (var i=0; i < game_items.length; i++) {\n game_items[i].update_blink();\n }\n setTimeout(blink_controller, interval * 35);\n}", "function periodicActivity()\r\n{\r\n myLed.write(ledState?1:0); //if ledState is true then write a '1' (high) otherwise write a '0' ...
[ "0.7519278", "0.7509107", "0.7280722", "0.7181604", "0.71539044", "0.7108851", "0.70685905", "0.7018417", "0.6983705", "0.6978372", "0.6978372", "0.69561875", "0.6898393", "0.68744993", "0.684661", "0.67198026", "0.67012614", "0.66999006", "0.6696355", "0.6596924", "0.6589232...
0.72018933
3
index.html (nodes, destinations, masters, obstacles, UIinterface) src/MarkerWithLabel.js src/Coordinates.js src/Node.js Google Maps wrapper
function Map() { // map variables var that = this, endCallback, lastFitTime = new Date(); var mapNodes = [], mapDestinations = [], mapObstacles = [], polyline, mapRefresh, running = false; var map = new google.maps.Map(document.getElementById('map'), { zoom: 3, tilt: 0, scaleControl: true, streetViewControl: false, center: new google.maps.LatLng(20, 0), //mapTypeId: google.maps.MapTypeId.HYBRID, panControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, zoomControlOptions: { position: google.maps.ControlPosition.TOP_RIGHT }, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.RIGHT_BOTTOM } }); map.controls[google.maps.ControlPosition.RIGHT_TOP].push(document.getElementById('tilt')); map.controls[google.maps.ControlPosition.RIGHT_TOP].push(document.getElementById('fullscreen')); map.controls[google.maps.ControlPosition.TOP_LEFT].push(document.getElementById('controls')); this.init = function (end) { endCallback = end; // reset old setting for (var i in mapDestinations) for (var j in mapDestinations[i]) mapDestinations[i][j].setMap(null); for (var i in mapNodes) for (var j in mapNodes[i]) mapNodes[i][j].setMap(null); for (var i in mapObstacles) mapObstacles[i].setMap(null); mapDestinations = []; mapNodes = []; mapObstacles = []; // initialiaze new settings if (destinations.length + nodes.length <= 0) return; map.setMapTypeId(google.maps.MapTypeId.HYBRID); var bounds = new google.maps.LatLngBounds(); for (var i in destinations) bounds.extend(destinations[i].toGoogleMaps()); for (var i in nodes) bounds.extend(nodes[i].position().coordinates.toGoogleMaps()); map.setCenter(bounds.getCenter()); map.fitBounds(bounds); lastFitTime = new Date(); this.start(); } this.start = function () { running = true; for (var i in nodes) nodes[i].start(); mapRefresh = setInterval(function () { if (masters.length == 0) { that.stop(); if (endCallback) endCallback(); } else draw(); }, parseInt(document.getElementById('mapRefresh').value)); draw(); } this.stop = function () { running = false; clearInterval(mapRefresh); for (var i in nodes) nodes[i].stop(); } function getScale(latitude) { return Math.pow(2, map.getZoom()) / 156543.03392 / (!latitude ? 1 : Math.cos(latitude * Math.PI / 180)); } function svgArcedTriangle(r, h, overture) { var cosOverture = Math.cos(overture / 2); var sinOverture = Math.cos(overture / 2); var point1 = [ r * cosOverture, r * sinOverture ]; var point2 = [ r * cosOverture, - r * sinOverture ]; var point3 = [ r + h, 0 ]; return 'M' + point1.join(',') + ' A' + [ r, r ].join(',') + ' 0 0,0 ' + point2.join(',') + ' L' + point3.join(',') + ' L' + point1.join(','); } function draw() { // not intialized yet if (destinations.length + nodes.length <= 0) return; var scale, nodesGM = nodes.map(function (value) { return value.position().coordinates.toGoogleMaps(); }); // obstacles (simple black cylindres with infinite height) if (!mapObstacles[0]) for (var i = 0; i < obstacles.length; i++) mapObstacles[i] = new google.maps.Circle({ map: map, center: obstacles[i].toGoogleMaps(), radius: 2, fillColor: '#333', fillOpacity: 1, strokeColor: 'black', strokeWeight: 0.6, strokeOpacity: 1, clickable: false, zIndex: 1 }); // destinations for (var i = 0; i < destinations.length; i++) { var destination = destinations[i].toGoogleMaps(); scale = getScale(destination.lat()); if (!mapDestinations[i]) mapDestinations[i] = { text: new MarkerWithLabel({ map: map, position: destination, clickable: false, icon: { path: '', zIndex: 1 }, labelContent: i.toString(), labelClass: 'text destination', labelStyle: { 'font-size': 3 * scale + 'px' }, labelAnchor: new google.maps.Point(50, -1.3 * scale) }), circle: new google.maps.Circle({ map: map, center: destination, radius: 1, fillColor: 'red', fillOpacity: 0.9, strokeColor: '#900', strokeWeight: 1, strokeOpacity: 1, clickable: false, zIndex: 1 }), pin: new google.maps.Marker({ map: map, position: destination, clickable: false, icon: { url: document.getElementById('destination').src, anchor: new google.maps.Point(7, 28), zIndex: 1 } }) }; else { mapDestinations[i].text.labelStyle = { 'font-size': 3 * scale + 'px' }; mapDestinations[i].text.labelAnchor = new google.maps.Point(50, -1.3 * scale); } } // nodes for (var i = 0; i < nodes.length; i++) { var center = nodesGM[i]; var orientation = -Math.toDegrees(nodes[i].position().orientation); scale = getScale(center.lat()); if (!mapNodes[i]) mapNodes[i] = { text: new MarkerWithLabel({ map: map, position: center, clickable: false, icon: { path: '', zIndex: 3 }, labelContent: i.toString(), labelClass: 'text node', labelStyle: { 'font-size': 2 * scale + 'px' }, labelAnchor: new google.maps.Point(50, -scale) }), point: new google.maps.Circle({ map: map, center: center, radius: 0.5, fillColor: '#5bc0de', fillOpacity: 1, strokeColor: '#004F74', strokeWeight: 1, strokeOpacity: 1, clickable: false, zIndex: 3 }), coverage: new google.maps.Circle({ map: map, center: center, radius: parseInt(document.getElementById('coverage').value), fillColor: 'green', fillOpacity: 0.2, strokeColor: 'green', strokeWeight: 1, strokeOpacity: 0.5, clickable: false, zIndex: 0 }), orientation: new google.maps.Marker({ map: map, position: center, clickable: false, icon: { path: svgArcedTriangle(scale * 2 / 3, scale * 2 / 3, Math.PI / 2), rotation: orientation, fillColor: '#5bc0de', fillOpacity: 1, strokeColor: '#004F74', strokeWeight: 1, strokeOpacity: 1, zIndex: 3 } }) }; else { mapNodes[i].text.setPosition(center); mapNodes[i].text.labelStyle = { 'font-size': 3 * scale + 'px' }; mapNodes[i].text.labelAnchor = new google.maps.Point(50, 5 * scale); mapNodes[i].point.setCenter(center); mapNodes[i].coverage.setCenter(center); var icon = mapNodes[i].orientation.icon; icon.path = svgArcedTriangle(scale * 2 / 3, scale * 2 / 3, Math.PI / 2); icon.rotation = orientation; mapNodes[i].orientation.setIcon(icon); mapNodes[i].orientation.setPosition(center); } } // lines if (!polyline) polyline = new google.maps.Polyline({ map: map, path: nodesGM, geodesic: true, strokeColor: '#000', strokeOpacity: 1, strokeWeight: 1, clickable: false, zIndex: 2 }); else polyline.setPath(nodesGM); // fit bounds if (running && document.getElementById('follow').checked && new Date().getTime() - lastFitTime.getTime() > 100) { lastFitTime = new Date(); var bounds = new google.maps.LatLngBounds(); for (var i in destinations) bounds.extend(destinations[i].toGoogleMaps()); for (var i in nodes) bounds.extend(nodes[i].position().coordinates.toGoogleMaps()); map.fitBounds(bounds); } } // listeners google.maps.event.addListener(map, 'zoom_changed', draw); google.maps.event.addListener(map, 'idle', function () { document.getElementById('start').focus(); }); document.getElementById('tilt').addEventListener('click', function () { map.setTilt((map.getTilt() + 45) % 90); }); document.getElementById('fullscreen').addEventListener('click', function () { var mapDiv = document.getElementById('map'); var prefixes = [ '', 'moz', 'webkit', 'o', 'ms' ]; for (var i in prefixes) { var prefix = prefixes[i]; if (typeof mapDiv[prefix + 'RequestFullScreen'] != 'undefined') { mapDiv[prefix + (document[prefix + 'IsFullScreen'] ? 'Cancel' : 'Request') + 'FullScreen'](); break; } } }); document.getElementById('mapRefresh').addEventListener('change', function () { clearInterval(mapRefresh); if (running) that.start(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadDefaultInterface() {\n\tthis.options['marker_onclick'] = new Function('event','currentMaps[\\''+id+'\\'].marker_onclick(event)');\n\n\tthis.options['originNode'] = tag('input',{'type':'text','value':'Port Huron,MI'},[]);\n\tthis.options['destinationNode'] = tag('input',{'type':'text','value':'Ypsilant...
[ "0.62260365", "0.5998086", "0.5908458", "0.5896668", "0.58569604", "0.58520067", "0.5840177", "0.58329135", "0.5809903", "0.5809279", "0.58089733", "0.5787084", "0.5786722", "0.5778993", "0.5771604", "0.5757256", "0.5756058", "0.5744439", "0.57175815", "0.56943333", "0.568776...
0.0
-1
This is a dummy function to check if the function name has been altered by minification. If the function has been minified and NODE_ENV !== 'production', warn the user.
function isCrushed() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function uglify(name) {\n console.log(\"Hello \" + name);\n}", "function keepNonMinified(file) {\n\tvar keep = true;\n\tif(file.path.match('.js$')) {\n\t\tvar minPath = file.path.replace('.js', '.min.js');\n\t\tkeep = !exists(minPath);\n\t}\n\treturn keep;\n}", "function markFuncFreeze(fun, opt_name) {\n /...
[ "0.60263145", "0.5777792", "0.57169825", "0.5680016", "0.5680016", "0.5635227", "0.5635227", "0.5620449", "0.5575049", "0.5547515", "0.55280983", "0.5519714", "0.5519714", "0.5519714", "0.5519714", "0.5519714", "0.55096775", "0.54918844", "0.54845864", "0.547782", "0.5477695"...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
TODO add the mesh getter setter to an Abstract Base Class
get() { return this.mesh; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n this.mesh = null;\n }", "get meshComponents() {\n this.__collectMeshComponents();\n return this.__meshComponents;\n }", "function MeshBase()\n{\n\tthis.indicesLength;\n\t\n\tthis.vertexBufferObject;\n\tthis.normalBufferObject;\n\tthis.tangentBufferObject;\n\tthis.te...
[ "0.73213136", "0.7072631", "0.69715685", "0.6927061", "0.6906819", "0.67797047", "0.66443306", "0.66265225", "0.6575943", "0.64960957", "0.64725983", "0.64595765", "0.6453735", "0.64083743", "0.63717264", "0.6266575", "0.6232345", "0.62310714", "0.61854136", "0.6086941", "0.6...
0.7746989
0
console.log(firstAnagram("gizmo", "sally")); // => false console.log(firstAnagram("elvis", "lives")) // => true console.log(firstAnagram("elviss", "lives")) // => false
function secondAnagram(str1, str2) { str1 = str1.split(""); str2 = str2.split(""); str1.sort(); str2.sort(); str1 = str1.join(""); str2 = str2.join(""); if (str1 == str2) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAnagram(stgOne, stgTwo) {\n \n \n}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(first, second) {\n let output1 = first.toLowerCase().split(\"\").sort().join(\"\");\n let output2 = second.toLowerCase()...
[ "0.7628381", "0.7606626", "0.7606626", "0.7606626", "0.7489989", "0.7457987", "0.7451937", "0.74071854", "0.73828864", "0.73485065", "0.73197556", "0.72913384", "0.7215078", "0.72076035", "0.71930754", "0.7192925", "0.71700805", "0.7136636", "0.7135387", "0.71331775", "0.7093...
0.68044347
44
console.log(secondAnagram("gizmo", "sally")); // => false console.log(secondAnagram("elvis", "lives")) // => true console.log(secondAnagram("elviss", "lives")) // => false
function thirdAnagram(str1, str2) { let str1Obj = {}; let str2Obj = {}; for (let i = 0; i < str1.length; i++) { if (str1Obj[str1[i]]) { str1Obj[str1[i]]++ } else { str1Obj[str1[i]] = 1 } } for (let i = 0; i < str2.length; i++) { if (str2Obj[str2[i]]) { str2Obj[str2[i]]++ } else { str2Obj[str2[i]] = 1 } } for (const key in str1Obj) { if (str1Obj[key] !== str2Obj[key]) { return false } } return true }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAnagram(first, second) {\n let output1 = first.toLowerCase().split(\"\").sort().join(\"\");\n let output2 = second.toLowerCase().split(\"\").sort().join(\"\");\n return output1 == output2;\n}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, s...
[ "0.81070924", "0.80907714", "0.80907714", "0.80907714", "0.80286396", "0.80146086", "0.80103767", "0.7897891", "0.78327984", "0.7832157", "0.7789089", "0.7781562", "0.7767145", "0.77567077", "0.77519786", "0.77479035", "0.7717633", "0.769828", "0.7694583", "0.76883805", "0.76...
0.72051805
72
console.log(thirdAnagram("gizmo", "sally")); // => false console.log(thirdAnagram("elvis", "lives")) // => true console.log(thirdAnagram("elviss", "lives")) // => false
function fourthAnagram(str1, str2) { let obj = {}; for (let i = 0; i < str1.length; i++) { if (obj[`${str1[i]}1`]) { obj[`${str1[i]}1`]++ } else { obj[`${str1[i]}1`] = 1 } } for (let i = 0; i < str2.length; i++) { if (obj[`${str2[i]}2`]) { obj[`${str2[i]}2`]++ } else { obj[`${str2[i]}2`] = 1 } } for (const key in obj) { if (obj[key[0]+"1"] !== obj[key[0]+"2"]) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAnagram(stgOne, stgTwo) {\n \n \n}", "isAnagram(a, b) {\n\n var x = a.toLowerCase();\n var y = b.toLowerCase();\n if (x.length != y.length) {\n return false;\n //console.log(\"Given string is not Anagram.\");\n }\n else {\n var m...
[ "0.76745754", "0.76693237", "0.76247543", "0.76247543", "0.76247543", "0.7601986", "0.7530106", "0.7501478", "0.7493195", "0.74318606", "0.741391", "0.740721", "0.73391813", "0.7331515", "0.73256433", "0.7269973", "0.7254811", "0.7231702", "0.72288543", "0.7227069", "0.721197...
0.7194154
21
draw everything on the canvas
function drawEverything() { drawthetrack(); player1.DrawItSelf(i); player2.DrawItSelf(j); allTheObstacles1.forEach((eachObstacle) => { eachObstacle.drawItSelf(); if (eachObstacle.x < 20) { allTheObstacles1.shift(); } }) allTheObstacles2.forEach((eachObstacle) => { eachObstacle.drawItSelf(); if (eachObstacle.x < 20) { allTheObstacles2.shift(); } }) allCloud1.forEach((cloud) => { cloud.drawItSelf(); if (cloud.x < 20) { allCloud1.shift(); } }) allCloud2.forEach((cloud) => { cloud.drawItSelf(); if (cloud.x < 20) { allCloud2.shift(); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "draw() { \r\n // Make sure the canvas has been prepared\r\n if (!this._setup) {\r\n this.prepare();\r\n }\r\n \r\n // Get the drawing context\r\n let ctx = this._canvas.getContext(\"2d\");\r\n \r\n // Clear the canvas by displaying only the bac...
[ "0.80368483", "0.79755145", "0.79619044", "0.78342", "0.78267944", "0.7804052", "0.77894694", "0.7780691", "0.7772275", "0.77669877", "0.775553", "0.7749517", "0.76689243", "0.7664617", "0.76546115", "0.7644842", "0.7611873", "0.75973177", "0.7585296", "0.7574093", "0.7564433...
0.0
-1
move everything to the left
function moveLeftAll() { allTheObstacles1.forEach((eachObstacle) => { eachObstacle.moveLeft(); }) allTheObstacles2.forEach((eachObstacle) => { eachObstacle.moveLeft(); }) allCloud1.forEach((cloud) => { cloud.moveLeft(); }) allCloud2.forEach((cloud) => { cloud.moveLeft(); }) player1.moveLeft(); player2.moveLeft(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toLeft(){\n imgIndex--;\n if(imgIndex == -1){\n imgIndex = imgItems.length-1;\n }\n changeImg(imgIndex);\n }", "moveLeft() {\r\n this.actual.moveLeft();\r\n }", "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "function moveLef...
[ "0.73707914", "0.7351942", "0.72928095", "0.71632063", "0.71602875", "0.7155465", "0.71357954", "0.71342397", "0.7122955", "0.71229005", "0.7111094", "0.7085339", "0.70789325", "0.7063442", "0.7060247", "0.7044826", "0.70423925", "0.70354295", "0.6993817", "0.69842815", "0.69...
0.0
-1
A function with an empty return or without it returns undefined
function citylight(name,special) { console.log(`${name}'s speciality is ${special}.`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nothing(){// parameters are optional within functions\n return undefined // will return undefined as a single value of the function\n}", "function returnUndefined() {}", "function noReturn() {}", "function emptyReturn() {return;}", "function f () {\n return undefined;\n }", "function retu...
[ "0.8206277", "0.8149916", "0.739154", "0.7291723", "0.72893524", "0.71194565", "0.7060487", "0.70497525", "0.70497525", "0.70497525", "0.70497525", "0.70205027", "0.70022345", "0.6893155", "0.68631846", "0.68222827", "0.68108803", "0.6634852", "0.6625153", "0.64922595", "0.64...
0.0
-1
input donde el usuario ingresa el nombre
function nombreIngresado(e){ e.preventDefault(); let nombreUsuario = document.getElementById("usuarioInput").value; document.getElementById("inputIngresado").innerHTML = nombreUsuario; localStorage.setItem("nombreUsuario", nombreUsuario); //local storage set item localStorage.getItem("nombreUsuario"); //local storage get item }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nomeUser(nome){\n\n nome = prompt(\"Qual è il tuo nome?\")\n \n return nome\n}", "function addUserName() {\n const username = document.getElementById(\"username\").value;\n if (username) {\n console.log(\"Hello\" + username);\n } else {\n console.log(\"user not found\");\n }\n const e...
[ "0.7453226", "0.6989732", "0.6941294", "0.6931997", "0.6922664", "0.68899584", "0.6851554", "0.68198735", "0.6806345", "0.6777791", "0.6728767", "0.6660758", "0.6635884", "0.6625728", "0.6618496", "0.6576068", "0.65528166", "0.655107", "0.65429753", "0.6519443", "0.6519406", ...
0.6234651
57
[[[ SECTION GAME ]]] Funcion del nombre de las herramientas y a quien le gana esta herramienta
function Jugada(nombre, gano){ this.nombre = nombre; this.gano = gano; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showLives() {\n var lifeMsg;\n // gLivesCount = num;\n // var elLife = document.querySelector('.life');\n if (gLivesCount === 1) lifeMsg = `${gLivesCount} LIFE LEFT `;\n else if (!gLivesCount) lifeMsg = `NO MORE LIVES `;\n else lifeMsg = `${gLivesCount} LIVES LEFT `;\n\n if (gNumOfHin...
[ "0.6552751", "0.64257985", "0.62428916", "0.62267506", "0.61771446", "0.6094532", "0.60944855", "0.5944768", "0.58738154", "0.58538824", "0.5852371", "0.5849951", "0.5848075", "0.5835283", "0.58303726", "0.5829311", "0.5828837", "0.58192426", "0.5818933", "0.57931954", "0.577...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits (ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function () {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7400138", "0.7260489", "0.7260489", "0.69331414", "0.6617391", "0.6483997", "0.64602226", "0.6353279", "0.6344644", "0.6344644", "0.63239115", "0.63239115", "0.61245894", "0.6122224", "0.6098067", "0.6075326", "0.6070057", "0.606857", "0.6066822", "0.6063841", "0.6063841",...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM (x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.65954375", "0.6168972", "0.6044958", "0.6022759", "0.591924", "0.58853126", "0.5843347", "0.577806", "0.57772064", "0.5703021", "0.562801", "0.55890924", "0.5570078", "0.5464318", "0.54534", "0.5339202", "0.5326124", "0.5318228", "0.53027326", "0.52718914", "0.52644837", ...
0.0
-1
Class: Buffer ============= The Buffer constructor returns instances of `Uint8Array` that are augmented with function properties for all the node `Buffer` API functions. We use `Uint8Array` so that square bracket notation works as expected it returns a single octet. By augmenting the instances, we can avoid modifying the `Uint8Array` prototype.
function Buffer (arg) { if (!(this instanceof Buffer)) { // Avoid going through an ArgumentsAdaptorTrampoline in the common case. if (arguments.length > 1) return new Buffer(arg, arguments[1]) return new Buffer(arg) } if (!Buffer.TYPED_ARRAY_SUPPORT) { this.length = 0 this.parent = undefined } // Common case. if (typeof arg === 'number') { return fromNumber(this, arg) } // Slightly less common case. if (typeof arg === 'string') { return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8') } // Unusual. return fromObject(this, arg) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0...
[ "0.7387608", "0.7387608", "0.7387608", "0.7387608", "0.7387608", "0.7387608", "0.7387608", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0.73838997", "0....
0.71254957
65
Duplicate of fromArray() to keep fromArray() monomorphic.
function fromTypedArray (that, array) { var length = checked(array.length) | 0 that = allocate(that, length) // Truncating the elements is probably not what people expect from typed // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior // of the old Buffer constructor. for (var i = 0; i < length; i += 1) { that[i] = array[i] & 255 } return that }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromArray(as) {\n // For some reason, TypeScript does not infer this type correctly\n var b = build;\n var f = as.reduce(b, []);\n return f;\n }", "function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to....
[ "0.65889376", "0.65335846", "0.6512674", "0.64970803", "0.6463127", "0.6455966", "0.644092", "0.63979745", "0.63979745", "0.63979745", "0.63979745", "0.63100034", "0.63100034", "0.62795615", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261167", "0.6261...
0.62321496
78
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset (offset, ext, length) { if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.66716176", "0.66716176", "0.66315866", "0.6520346", "0.63839465", "0.627423", "0.6253665", "0.62347245", "0.62347245", "0.6108547", "0.6036368", "0.6017906", "0.59830993", "0.59575397", "0.59489954", "0.59489954", "0.59489954", "0.59489954", "0.59489954", "0.59489954", "0....
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function t(e){return!!e.constructor&&'function'==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function n(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.const...
[ "0.6310727", "0.6224555", "0.62207437", "0.62207437", "0.62207437", "0.6154229", "0.61486113", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.6084733", "0.60484034", "0.6019956", "0.5980783", "0.5980783", "0.5953351"...
0.0
-1
Calculate the MD5 of an array of littleendian words, and a bit length
function core_md5 (x, len) { /* append padding */ x[len >> 5] |= 0x80 << ((len) % 32) x[(((len + 64) >>> 9) << 4) + 14] = len var a = 1732584193 var b = -271733879 var c = -1732584194 var d = 271733878 for (var i = 0; i < x.length; i += 16) { var olda = a var oldb = b var oldc = c var oldd = d a = md5_ff(a, b, c, d, x[i + 0], 7, -680876936) d = md5_ff(d, a, b, c, x[i + 1], 12, -389564586) c = md5_ff(c, d, a, b, x[i + 2], 17, 606105819) b = md5_ff(b, c, d, a, x[i + 3], 22, -1044525330) a = md5_ff(a, b, c, d, x[i + 4], 7, -176418897) d = md5_ff(d, a, b, c, x[i + 5], 12, 1200080426) c = md5_ff(c, d, a, b, x[i + 6], 17, -1473231341) b = md5_ff(b, c, d, a, x[i + 7], 22, -45705983) a = md5_ff(a, b, c, d, x[i + 8], 7, 1770035416) d = md5_ff(d, a, b, c, x[i + 9], 12, -1958414417) c = md5_ff(c, d, a, b, x[i + 10], 17, -42063) b = md5_ff(b, c, d, a, x[i + 11], 22, -1990404162) a = md5_ff(a, b, c, d, x[i + 12], 7, 1804603682) d = md5_ff(d, a, b, c, x[i + 13], 12, -40341101) c = md5_ff(c, d, a, b, x[i + 14], 17, -1502002290) b = md5_ff(b, c, d, a, x[i + 15], 22, 1236535329) a = md5_gg(a, b, c, d, x[i + 1], 5, -165796510) d = md5_gg(d, a, b, c, x[i + 6], 9, -1069501632) c = md5_gg(c, d, a, b, x[i + 11], 14, 643717713) b = md5_gg(b, c, d, a, x[i + 0], 20, -373897302) a = md5_gg(a, b, c, d, x[i + 5], 5, -701558691) d = md5_gg(d, a, b, c, x[i + 10], 9, 38016083) c = md5_gg(c, d, a, b, x[i + 15], 14, -660478335) b = md5_gg(b, c, d, a, x[i + 4], 20, -405537848) a = md5_gg(a, b, c, d, x[i + 9], 5, 568446438) d = md5_gg(d, a, b, c, x[i + 14], 9, -1019803690) c = md5_gg(c, d, a, b, x[i + 3], 14, -187363961) b = md5_gg(b, c, d, a, x[i + 8], 20, 1163531501) a = md5_gg(a, b, c, d, x[i + 13], 5, -1444681467) d = md5_gg(d, a, b, c, x[i + 2], 9, -51403784) c = md5_gg(c, d, a, b, x[i + 7], 14, 1735328473) b = md5_gg(b, c, d, a, x[i + 12], 20, -1926607734) a = md5_hh(a, b, c, d, x[i + 5], 4, -378558) d = md5_hh(d, a, b, c, x[i + 8], 11, -2022574463) c = md5_hh(c, d, a, b, x[i + 11], 16, 1839030562) b = md5_hh(b, c, d, a, x[i + 14], 23, -35309556) a = md5_hh(a, b, c, d, x[i + 1], 4, -1530992060) d = md5_hh(d, a, b, c, x[i + 4], 11, 1272893353) c = md5_hh(c, d, a, b, x[i + 7], 16, -155497632) b = md5_hh(b, c, d, a, x[i + 10], 23, -1094730640) a = md5_hh(a, b, c, d, x[i + 13], 4, 681279174) d = md5_hh(d, a, b, c, x[i + 0], 11, -358537222) c = md5_hh(c, d, a, b, x[i + 3], 16, -722521979) b = md5_hh(b, c, d, a, x[i + 6], 23, 76029189) a = md5_hh(a, b, c, d, x[i + 9], 4, -640364487) d = md5_hh(d, a, b, c, x[i + 12], 11, -421815835) c = md5_hh(c, d, a, b, x[i + 15], 16, 530742520) b = md5_hh(b, c, d, a, x[i + 2], 23, -995338651) a = md5_ii(a, b, c, d, x[i + 0], 6, -198630844) d = md5_ii(d, a, b, c, x[i + 7], 10, 1126891415) c = md5_ii(c, d, a, b, x[i + 14], 15, -1416354905) b = md5_ii(b, c, d, a, x[i + 5], 21, -57434055) a = md5_ii(a, b, c, d, x[i + 12], 6, 1700485571) d = md5_ii(d, a, b, c, x[i + 3], 10, -1894986606) c = md5_ii(c, d, a, b, x[i + 10], 15, -1051523) b = md5_ii(b, c, d, a, x[i + 1], 21, -2054922799) a = md5_ii(a, b, c, d, x[i + 8], 6, 1873313359) d = md5_ii(d, a, b, c, x[i + 15], 10, -30611744) c = md5_ii(c, d, a, b, x[i + 6], 15, -1560198380) b = md5_ii(b, c, d, a, x[i + 13], 21, 1309151649) a = md5_ii(a, b, c, d, x[i + 4], 6, -145523070) d = md5_ii(d, a, b, c, x[i + 11], 10, -1120210379) c = md5_ii(c, d, a, b, x[i + 2], 15, 718787259) b = md5_ii(b, c, d, a, x[i + 9], 21, -343485551) a = safe_add(a, olda) b = safe_add(b, oldb) c = safe_add(c, oldc) d = safe_add(d, oldd) } return [a, b, c, d] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binl_md5 (x, len) {\n\t /* append padding */\n\t x[len >> 5] |= 0x80 << (len % 32)\n\t x[(((len + 64) >>> 9) << 4) + 14] = len\n\t\n\t var i\n\t var olda\n\t var oldb\n\t var oldc\n\t var oldd\n\t var a = 1732584193\n\t var b = -271733879\n\t var c = -1732584194\n\t var...
[ "0.7908864", "0.7908864", "0.7851151", "0.7851151", "0.78297484", "0.781424", "0.7799697", "0.7797474", "0.77968043", "0.77968043", "0.77955353", "0.7787075", "0.7781164", "0.7781164", "0.77667457", "0.77615637", "0.7760521", "0.7751281", "0.7748616", "0.7743792", "0.7743792"...
0.7489554
70
These functions implement the four basic operations the algorithm uses.
function md5_cmn (q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BasicOp(a, b) {\n var sum = a + b;\n console.log(\"sum\" + sum);\n var sub = a - b;\n console.log(\"sub\" + sub);\n var multi = a * b;\n console.log(\"multiplication\" + multi);\n var div = a / b;\n console.log(\"devision\" + sub);\n}", "function arithmaticOpration(){\n\taddition();\n\tSubstrati...
[ "0.614667", "0.60421485", "0.5994541", "0.5898469", "0.57985216", "0.5742825", "0.5727613", "0.57271165", "0.56053096", "0.55835235", "0.5573103", "0.55728894", "0.55604", "0.5515135", "0.550902", "0.55050015", "0.54754686", "0.5475394", "0.5429418", "0.54290855", "0.54249525...
0.0
-1
Add integers, wrapping at 2^32. This uses 16bit operations internally to work around bugs in some JS interpreters.
function safe_add (x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF) var msw = (x >> 16) + (y >> 16) + (lsw >> 16) return (msw << 16) | (lsw & 0xFFFF) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n}", "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b...
[ "0.77990013", "0.77990013", "0.7757441", "0.7740754", "0.7736016", "0.77296126", "0.77296126", "0.77224797", "0.77194643", "0.769616", "0.76924163", "0.76924163", "0.76805955", "0.76805955", "0.76805955", "0.7522335", "0.7448978", "0.7289236", "0.7154131", "0.7140704", "0.706...
0.0
-1
Bitwise rotate a 32bit number to the left.
function bit_rol (num, cnt) { return (num << cnt) | (num >>> (32 - cnt)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt...
[ "0.87508583", "0.8438198", "0.8438198", "0.8438198", "0.8438198", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8334637", "0.83200794", "0.8303131", ...
0.0
-1
Represent num in a wNAF form
function getNAF(num, w) { var naf = []; var ws = 1 << (w + 1); var k = num.clone(); while (k.cmpn(1) >= 0) { var z; if (k.isOdd()) { var mod = k.andln(ws - 1); if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod; else z = mod; k.isubn(z); } else { z = 0; } naf.push(z); // Optimization, shift by word if possible var shift = (k.cmpn(0) !== 0 && k.andln(ws - 1) === 0) ? (w + 1) : 1; for (var i = 1; i < shift; i++) naf.push(0); k.iushrn(shift); } return naf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toUnformattedNF()\n{\n\treturn (this.num);\n}", "function getNAF(num,w){var naf=[];var ws=1<<w+1;var k=num.clone();while(k.cmpn(1)>=0){var z;if(k.isOdd()){var mod=k.andln(ws-1);if(mod>(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z);}else{z=0;}naf.push(z);// Optimization, shift by word if possible\nvar shi...
[ "0.6765914", "0.64303064", "0.64303064", "0.6332739", "0.6330919", "0.62930375", "0.6287292", "0.6284914", "0.6284914", "0.6283662", "0.627307", "0.627307", "0.627307", "0.627307", "0.627307", "0.6270584", "0.6270584", "0.62674284", "0.6219913", "0.6143485", "0.60998714", "...
0.6263132
62
Represent k1, k2 in a Joint Sparse Form
function getJSF(k1, k2) { var jsf = [ [], [] ]; k1 = k1.clone(); k2 = k2.clone(); var d1 = 0; var d2 = 0; while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { // First phase var m14 = (k1.andln(3) + d1) & 3; var m24 = (k2.andln(3) + d2) & 3; if (m14 === 3) m14 = -1; if (m24 === 3) m24 = -1; var u1; if ((m14 & 1) === 0) { u1 = 0; } else { var m8 = (k1.andln(7) + d1) & 7; if ((m8 === 3 || m8 === 5) && m24 === 2) u1 = -m14; else u1 = m14; } jsf[0].push(u1); var u2; if ((m24 & 1) === 0) { u2 = 0; } else { var m8 = (k2.andln(7) + d2) & 7; if ((m8 === 3 || m8 === 5) && m14 === 2) u2 = -m24; else u2 = m24; } jsf[1].push(u2); // Second phase if (2 * d1 === u1 + 1) d1 = 1 - d1; if (2 * d2 === u2 + 1) d2 = 1 - d2; k1.iushrn(1); k2.iushrn(1); } return jsf; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function K(a,b){this.g=[];this.H=a;this.G=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.K=this.m=!1;this.j=0;this.b=null;this.o=0}", "function K(){this.i=0,this.j=0,this.S=new Array}", "function k(m1, m2){\r\n return do_(\r\n bind(\"x\", m1),\r\n bind(\"xs\", m2),\r\n ...
[ "0.5769692", "0.5731908", "0.53482056", "0.52648157", "0.5132514", "0.51150286", "0.5110443", "0.50927955", "0.50731033", "0.50641257", "0.50608915", "0.5059641", "0.5027422", "0.50183904", "0.5014289", "0.49767065", "0.49767065", "0.49767065", "0.49522403", "0.4840789", "0.4...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.6149275", "0.54203457", "0.53920096", "0.53668714", "0.53668714", "0.53668714", "0.53408384", "0.5318133", "0.5318133", "0.5318133", "0.5308971", "0.52618045", "0.5255616", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0...
0.0
-1
For Node v0.10 support. Remove this eventually.
function isSlowBuffer (obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(...
[ "0.5863474", "0.5705808", "0.568645", "0.55544066", "0.55544066", "0.5446477", "0.5434516", "0.5381192", "0.5356294", "0.53282356", "0.53189546", "0.52043676", "0.51996946", "0.5156968", "0.51501393", "0.51281303", "0.51281303", "0.51281303", "0.5112595", "0.5100047", "0.5090...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
if it's past the high water mark, we can push in some more. Also, if we have no data yet, we can stand some more bytes. This is to work around cases where hwm=0, such as the repl. Also, if the push() triggered a readable event, and the user called read(largeNumber) such that needReadable was set, then we ought to push more, so that another 'readable' event will be triggered.
function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push(){if(pushes>PUSHCOUNT)return;if(pushes++===PUSHCOUNT){console.error(\" push(EOF)\");return r.push(null)}console.error(\" push #%d\",pushes);r.push(new Buffer(PUSHSIZE))&&setTimeout(push)}", "tryPush() {\n\t\t// Get the total length of what would be pushed.\n\t\tconst amountToPush = Math.min(thi...
[ "0.65658844", "0.64052856", "0.6392542", "0.6380758", "0.6350603", "0.6350603", "0.6241856", "0.6212878", "0.6170371", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", "0.6164681", ...
0.0
-1
This function is designed to be inlinable, so please take care when making changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); if (n <= state.length) return n; // Don't have enough if (!state.ended) { state.needReadable = true; return 0; } return state.length; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.6834781", "0.67074317", "0.6685873", "0.6599575", "0.6528078", "0.6306303", "0.63039434", "0.62592036", "0.6209561", "0.612205", "0.6071775", "0.59868515", "0.59800345", "0.590985", "0.5897201", "0.58810145", "0.5879038", "0.57503766", "0.572729", "0.5717947", "0.57138914"...
0.0
-1