query stringlengths 9 14.6k | document stringlengths 8 5.39M | metadata dict | negatives listlengths 0 30 | negative_scores listlengths 0 30 | document_score stringlengths 5 10 | document_rank stringclasses 2
values |
|---|---|---|---|---|---|---|
Load an image from a file into an tag, and then use that to get its dimensions and create a thumbnail. Store these values in an metadata object, and pass the object to the callback function. If anything goes wrong, pass an error message to the error function. | function getImageSizeAndThumbnail(file, callback, error) {
// If the file size is too big it might not actually be an image file
// or it might be too big for us to process without memory problems.
// So we're not even going to try.
if (file.size > MAX_IMAGE_FILE_SIZE) {
error('Ignoring large file... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function file_get_dimensions(file, settings, callback) {\n var fr = new FileReader;\n fr.onload = function() { // file is loaded\n var img = new Image;\n\n img.onload = function() {\n //console.log(\"file_get_dimensions dim=\" + img.width + \"/\" + img.height);\n file.height = img.height;\n ... | [
"0.626282",
"0.62608135",
"0.618107",
"0.6148876",
"0.6133231",
"0.60116905",
"0.5922323",
"0.5912476",
"0.5745534",
"0.5737058",
"0.56472534",
"0.56372315",
"0.560131",
"0.55934805",
"0.55684453",
"0.55463654",
"0.5543804",
"0.5527466",
"0.55110854",
"0.545967",
"0.5434698",... | 0.7297729 | 0 |
Changes book patron information, and calls | function loanBookToPatron(e) {
e.preventDefault();
// Get correct book and patron
const book = libraryBooks[bookLoanForm.children[0].value];
const patron = patrons[bookLoanForm.children[1].value];
// Add patron to the book's patron property
book.patron = patron;
// Add book to the patron's book table in the D... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loanBookToPatron(e) {\n\te.preventDefault();\n\n\t// Get correct book and patron\n\tlet id = document.getElementById(\"loanBookId\").value;\n\tlet card = document.getElementById(\"loanCardNum\").value;\n\tlet currBook = '';\n\tlet currPatron = '';\n\tif (isNaN(id)){\n\t\talert(\"Book IDs must be numbers!\... | [
"0.5905875",
"0.53689563",
"0.5311678",
"0.52497476",
"0.5117207",
"0.51035184",
"0.5074169",
"0.50577456",
"0.49809968",
"0.49698958",
"0.4963913",
"0.49374753",
"0.49178776",
"0.4912023",
"0.4865701",
"0.48276117",
"0.47884077",
"0.4747429",
"0.47352824",
"0.47347158",
"0.4... | 0.6473654 | 0 |
Creates and adds a new patron | function addNewPatron(e) {
e.preventDefault();
// Add a new patron to global array
const patron_name = patronAddForm.children[0].value.trim()
const new_patron = new Patron(patron_name);
patrons.push(new_patron);
// Call addNewPatronEntry() to add patron to the DOM
addNewPatronEntry(new_patron);
patronAddForm.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addNewPatron(e) {\n\te.preventDefault();\n\n\t// Add a new patron to global array\n\tlet patronName = document.getElementById(\"newPatronName\").value;\n\tlet patron = new Patron(patronName);\n\tpatrons.push(patron);\n\t// Call addNewPatronEntry() to add patron to the DOM\n\taddNewPatronEntry(patron);\n}"... | [
"0.6846771",
"0.5539826",
"0.55187905",
"0.5233577",
"0.5172787",
"0.51568425",
"0.5082949",
"0.49338064",
"0.49238086",
"0.49149525",
"0.48840904",
"0.4825537",
"0.47821704",
"0.47533232",
"0.47533232",
"0.47085908",
"0.47036403",
"0.46788707",
"0.4668713",
"0.4666255",
"0.4... | 0.69829565 | 0 |
Displays deatiled info on the book in the Book Info Section | function displayBookInfo(book) {
// Add code here
bookInfo.children[0].innerHTML = "Book Id: <span>"+book.bookId+"</span>";
bookInfo.children[1].innerHTML = "Title: <span>"+book.title+"</span>";
bookInfo.children[2].innerHTML = "Author: <span>"+book.author+"</span>";
bookInfo.children[3].innerHTML = "Genre: <span>... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displayBookInfo(book) {\n\t// Add code here\n\tlet section = document.getElementById(\"bookInfo\");\n\tlet id = \"<p>Book Id: <span>\" + book.bookId + \"</span>\";\n\tlet title = \"<p>Title: <span>\" + book.title + \"</span>\";\n\tlet author = \"<p>Author: <span>\" + book.author + \"</span>\";\n\tlet genr... | [
"0.7133593",
"0.6679227",
"0.6299719",
"0.62654907",
"0.62002224",
"0.6120285",
"0.60837656",
"0.60638434",
"0.59966063",
"0.59600985",
"0.59343344",
"0.5900637",
"0.5889498",
"0.5795503",
"0.57536376",
"0.5753099",
"0.5715922",
"0.5696163",
"0.56898075",
"0.56596386",
"0.563... | 0.68407863 | 1 |
Adds a book to a patron's book list with a status of 'Within due date'. (don't forget to add a 'return' button). | function addBookToPatronLoans(book) {
// Add code here
const patron = book.patron;
const book_id = document.createElement('td');
book_id.innerText = book.bookId;
const book_title = document.createElement('td');
book_title.innerHTML = '<strong>'+book.title+'</strong>';
const book_status = document.createElemen... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addBook(title,pages,author,status) {\n let book = new Book(title,pages,author,status);\n book.position = myLibrary.length;\n myLibrary.push(book);\n render(book,book.position);\n getData(myLibrary);\n}",
"function addBookToLibrary() {\n let newBook = new Book(bookTitle, authorName, pageN... | [
"0.65833586",
"0.65705514",
"0.6473979",
"0.6469133",
"0.64579636",
"0.6408944",
"0.6391512",
"0.63893145",
"0.6388918",
"0.63285357",
"0.6326605",
"0.6315906",
"0.62848145",
"0.6277252",
"0.62709737",
"0.6261171",
"0.6258012",
"0.6257002",
"0.6247446",
"0.62409467",
"0.62365... | 0.71676755 | 0 |
Removes book from patron's book table and remove patron card number from library book table | function removeBookFromPatronTable(book) {
// Add code here
const bookTableRows = bookTable.children[0].children;
for(let i = 1; i < bookTableRows.length; i++){
if(bookTableRows[i].children[0].innerText == book.bookId){
bookTableRows[i].children[2].innerText = '';
}
}
helper(book, 'removeBookFromPatronTab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeBookFromPatronTable(book) {\n\n\t// remove the book from the patrons\n\tlet possible = document.getElementById(\"patrons\").children;\n\tfor (let i = 0; i < possible.length; i++){\n\t\tif (possible[i].children[1].children[0].innerHTML == book.patron.cardNumber){\n\t\t\tlet books = possible[i].childr... | [
"0.8196892",
"0.7278303",
"0.7213217",
"0.6861483",
"0.6733157",
"0.65261847",
"0.65189415",
"0.6518506",
"0.6504092",
"0.64859915",
"0.6442736",
"0.6427677",
"0.6419851",
"0.6323608",
"0.6290416",
"0.62673855",
"0.62048656",
"0.61549455",
"0.6124155",
"0.6092402",
"0.6092199... | 0.8227697 | 0 |
Set status to red 'Overdue' in the book's patron's book table. | function changeToOverdue(book) {
// Add code here
helper(book, 'changeToOverdue');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeToOverdue(book) {\n\t// Add code here\n\tlet possible = document.getElementById(\"patrons\").children;\n\tfor (let i = 0; i < possible.length; i++){\n\t\tif (possible[i].children[1].children[0].innerHTML == book.patron.cardNumber){\n\t\t\tlet books = possible[i].children[3].children[0].children\n\t\... | [
"0.5957836",
"0.58401036",
"0.5696486",
"0.5536414",
"0.55100965",
"0.53032964",
"0.5301463",
"0.5254733",
"0.52544147",
"0.52061033",
"0.5204457",
"0.519612",
"0.5170224",
"0.51399785",
"0.5128433",
"0.5115254",
"0.5094578",
"0.50887614",
"0.5069308",
"0.5056846",
"0.5034872... | 0.66291016 | 0 |
This function pushes random cities into an array while avoiding duplicates. | function randomIzer(cityCount, locations) {
var sum = 0;
for (i = 0; i < cityCount; i++) {
var randomCity = locations[Math.floor(Math.random() * locations.length)];
var index = cities.indexOf(randomCity);
if((Number(cities.length) >= Number(locations.length))) {
/* This may or may ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getUnique(array){\n for(i=0; i < array.length; i++){\n if(cities.indexOf(array[i]) === -1) {\n cities.push(array[i]);\n }\n }\n}",
"function initializeEdges(){\n\tfor(var i = 0; i < numCities; ++i) {\n\t\tarr = new Array();\n\t\tfor(var j = 0; j < numCities; ++j) \n\t\t\tarr.push(... | [
"0.6836345",
"0.6634563",
"0.656787",
"0.6349567",
"0.6291293",
"0.625473",
"0.62003917",
"0.60051465",
"0.5992157",
"0.5913386",
"0.5887301",
"0.5887127",
"0.58766836",
"0.58721286",
"0.5834536",
"0.5833792",
"0.5797492",
"0.57871044",
"0.57726246",
"0.57254213",
"0.57098967... | 0.6958003 | 0 |
This function sends city names to the Geocoder API, acquires coordinates, and injects the coordinates into the getTime function. | function geoCoder(city) {
// Return a new promise
return new Promise(function(resolve, reject) {
var result = city.split(', ');
var request = new XMLHttpRequest();
var method = 'GET';
var url = 'https://maps.googleapis.com/maps/api/geocode/json?address=+' + result[0]
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCoords() {\n let placeName = searchField.val();\n\n // Clear the search field\n searchField.val(\"\");\n\n let geoAPIURL = \"https://api.opencagedata.com/geocode/v1/json?q=\" + placeName + \"&key=eb47c1b37c7f4b77b7dc729f0915b698\";\n $.get(geoAPIURL, function (result) {\n currentCit... | [
"0.6277181",
"0.61697865",
"0.6151698",
"0.6093902",
"0.60838354",
"0.60552377",
"0.60261834",
"0.60222423",
"0.6004967",
"0.5982305",
"0.5981695",
"0.5979403",
"0.59748703",
"0.59606814",
"0.59146196",
"0.5913707",
"0.59096795",
"0.5900139",
"0.587018",
"0.58635914",
"0.5859... | 0.7206128 | 0 |
This function creates a button on the map to clear all info windows from the screen. | function clearWindows(controlDiv, map) {
// Set CSS for the control border
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = '#fff';
controlUI.style.border = '2px solid #fff';
controlUI.style.borderRadius = '3px';
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetInfoWindows() {\n\tinfowindow.close();\n}",
"function clearMap() {\n for (var i = 0; i < currMarkers.length; i++) {\n currMarkers[i].setMap(null); //This will remove currMarkers[i] from the map\n }\n //Finally, let's set our currMarkers to a new, empty array\n currMarkers = [];\n... | [
"0.72106284",
"0.7014306",
"0.6708614",
"0.6683505",
"0.6682915",
"0.6682915",
"0.6682915",
"0.66742986",
"0.66192204",
"0.6587744",
"0.6579462",
"0.6567243",
"0.65495455",
"0.65355176",
"0.65275794",
"0.65263075",
"0.6505748",
"0.64958745",
"0.6491373",
"0.64868844",
"0.6478... | 0.7518753 | 0 |
This function creates a button on the map to bring all info windows back on the screen. | function restoreWindows(controlDiv, map) {
// Set CSS for the control border
var controlUI = document.createElement('div');
controlUI.style.backgroundColor = '#fff';
controlUI.style.border = '2px solid #fff';
controlUI.style.borderRadius = '3px';
controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resetInfoWindows() {\n\tinfowindow.close();\n}",
"_updateBtn() {\n var ariaLabel = this._resource.view;\n var removeClass, addClass;\n if (this.isFullscreen()) {\n //Is fullscreen, exit.\n ariaLabel = this._resource.exit;... | [
"0.68008953",
"0.68006444",
"0.67911303",
"0.6751508",
"0.6730328",
"0.6546004",
"0.6451491",
"0.64410746",
"0.64385104",
"0.64197236",
"0.6373752",
"0.63707525",
"0.63469017",
"0.63314635",
"0.63148034",
"0.63120884",
"0.6309113",
"0.629639",
"0.62956065",
"0.62687695",
"0.6... | 0.6819233 | 0 |
Prepare signed request to AWS STS :: GetCallerIdentity | __getStsRequest(credentials) {
return aws4.sign({
service: 'sts',
method: 'POST',
body: 'Action=GetCallerIdentity&Version=2011-06-15',
headers: this.__iam_server_id_header_value ? {
'X-Vault-AWS-IAM-Server-ID': this.__iam_server_id_header_value,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"__getStsRequest() {\n const body = 'Action=GetCallerIdentity&Version=2011-06-15';\n const headers = {\n 'host': 'sts.amazonaws.com',\n 'content-type': 'application/x-www-form-urlencoded; charset=utf-8',\n 'content-length': body.length.toString(),\n };\n ... | [
"0.7649764",
"0.65379083",
"0.63252854",
"0.60188663",
"0.5900517",
"0.5648599",
"0.5579702",
"0.55750585",
"0.55750585",
"0.5568611",
"0.5462996",
"0.54422504",
"0.54202425",
"0.54162294",
"0.54034066",
"0.5377569",
"0.53374064",
"0.53290945",
"0.5328528",
"0.53283215",
"0.5... | 0.7518095 | 1 |
hacky way of resetting height back to auto after animation incoming sorry :) | function setAutoHeight(){
if(animatedRef.current){
animatedRef.current.style.height = 'auto'
animatedRef.current.style.overflow = 'auto'
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function autoHeightAnimate(element, time){\n var curHeight = element.height(), // Get Default Height\n autoHeight = element.css('height', 'auto').height(); // Get Auto Height\n element.height(curHeight); // Reset to Default Height\n element.stop().animate({ height: autoH... | [
"0.7398089",
"0.7330609",
"0.7061929",
"0.6976723",
"0.6838673",
"0.6806215",
"0.65489143",
"0.65339226",
"0.64882994",
"0.64372814",
"0.6429361",
"0.6420497",
"0.6369906",
"0.6357927",
"0.63527966",
"0.6348792",
"0.6338384",
"0.6332467",
"0.6273718",
"0.6256229",
"0.6249494"... | 0.7447891 | 0 |
display the ETH account if exists. Ask to connect account otherwise | function AccountDisplay() {
const {
ethConnected,
ethAccount,
connectEthAccount,
} = useContext(EthContext)
return (
<>
{!ethConnected && <>
<div style={{marginBottom: "10px"}}>
<Button
onClick={() => {... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function requestAccount() {\n const account = await window.ethereum.request({ method: 'eth_requestAccounts' });\n setConnected(\"Connected\");\n setUserAddress(account[0]);\n }",
"function connect() {\n let connectButton = document.getElementById('connectButton');\n connectButton.style.disp... | [
"0.65755105",
"0.6538531",
"0.6483419",
"0.6360145",
"0.6262944",
"0.62547505",
"0.6248682",
"0.6213371",
"0.62093127",
"0.6165764",
"0.61483794",
"0.60918975",
"0.6039078",
"0.60236675",
"0.60060483",
"0.60060483",
"0.5952875",
"0.5910711",
"0.59040123",
"0.58996135",
"0.589... | 0.69841975 | 0 |
Load file from templates/ directory. | function loadTemplate(x) {
var f = path.join(__dirname, '..', 'templates', x);
return fs.readFileSync(f, 'utf-8');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadTemplate(file) {\r\n var dfd = jQuery.Deferred();\r\n\r\n $.get( \"templates/\" + file, function( data ) {\r\n dfd.resolve(data);\r\n });\r\n\r\n return dfd.promise();\r\n }",
"function loadTemplate(path) {\n\tif (templateFuncs[path])\n\t\treturn;\n\t\n\ttem... | [
"0.73248166",
"0.72957426",
"0.72655857",
"0.7180474",
"0.711952",
"0.7109504",
"0.6890374",
"0.67874396",
"0.6764916",
"0.67016006",
"0.66533095",
"0.6635172",
"0.6593383",
"0.656188",
"0.6525999",
"0.65222144",
"0.65084195",
"0.64602953",
"0.6441587",
"0.6339871",
"0.632159... | 0.78811187 | 0 |
You can get the all keys your user has access to or just the ones from a specific sphere. | async function run() {
await cloud.login('crownstoneEmail', 'crownstonePassword')
let allKeys = await cloud.keys();
// you can call keys on a sphere object too. Select the sphere by its ID
let sphereId = '5f3ea7fdd2eabaa437fdd2e6';
let keysInSphere = await cloud.sphere(sphereId).keys();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get keysounds () {\n return this._keysounds.all()\n }",
"GetKey(){\n return this.keys;\n }",
"function getKeys() {\n return cachedKeys;\n // TODO: Replace with something better when the server is smarter.\n }",
"getKeys () {\n const requestOptions = _.merge({}, this._api.requestOp... | [
"0.6324391",
"0.5872162",
"0.5839067",
"0.5740659",
"0.5722868",
"0.5659285",
"0.56241024",
"0.5617417",
"0.5558882",
"0.55358315",
"0.5493148",
"0.5440301",
"0.5421923",
"0.5417923",
"0.5402971",
"0.53768337",
"0.5347794",
"0.5283356",
"0.5237702",
"0.52316165",
"0.52161056"... | 0.66093636 | 0 |
Gets adjudication info based on selected search parameter | getAdjudicationInfo() {
return this.get('store').query('program-record', { //Get program record
filter: {
name: this.get("searchValue") //Program record has already been selected
}
}).then((programRecords) => {
//Get all terms
return this.get('store').query('term', {}).then(dummy => {
return th... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function funcGetConstituent() \r\n{\r\n var remAction = \"dp_donorsearch\";\r\n // params=@donor_id,@last_name,@first_name,@opt_line,@address,\r\n // @city,@state,@zip,@country,@filter_id,@user_id\r\n var fields = [\"searchID\", \"searchLastName\", \"searchFirstName\", \"\", \"\",\r\n ... | [
"0.55561596",
"0.5425936",
"0.5370426",
"0.5351688",
"0.53404474",
"0.5320858",
"0.5266277",
"0.5260692",
"0.51917446",
"0.51837564",
"0.5170015",
"0.5158392",
"0.50828487",
"0.5072895",
"0.5072159",
"0.5067422",
"0.50603515",
"0.50592005",
"0.50546885",
"0.504897",
"0.504037... | 0.57848877 | 0 |
Handler to update form values when a field update event is fired. | handleFormFieldUpdate(event) {
const value = event.detail.value;
// Index represents which form was updated.
const index = event.detail.index;
if (index >= this.fieldValues.length) {
throw new Error('Out of bounds index when updating field values.');
}
// The field has been updated, so it ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"updateValue(event) {\n const { id, value } = event.target;\n const { formName, updateForm } = this.props;\n updateForm(formName, id, value);\n }",
"inputValueUpdated(e) {\n this.props.onValueChange(this.props.id, e);\n this.updateValue(e);\n }",
"handleFieldChange (event) {\n ... | [
"0.69756764",
"0.6929074",
"0.66679573",
"0.6647044",
"0.6479137",
"0.64771646",
"0.643753",
"0.64219505",
"0.63956624",
"0.6346829",
"0.63439906",
"0.63134426",
"0.62958086",
"0.6290634",
"0.62866104",
"0.6260307",
"0.62286896",
"0.622353",
"0.62078613",
"0.61947167",
"0.619... | 0.74590635 | 0 |
get plot bands settings | function getHealthPlotBandSettings() {
return [{from: 0, to: 1, color: '#ffd4d5'},
{from: 1, to: 2, color: '#ffe2d8'},
{from: 2, to: 3, color: '#fffae7'},
{from: 3, to: 4, color: '#edffd6'},
{from: 4, to: 5, color: '#e6ffe9'},
{from: 5, to: 6, color: '#ffffff'}];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static filterBands(dc, bands) {\n\t\tdc.imageCollection(ic => ic.select(bands));\n\t\tdc.dimBands().setValues(bands);\n\t\treturn dc;\n\t}",
"static filterBands(dc, bands) {\n\t\tdc.imageCollection(ic => ic.select(bands));\n\t\tdc.dimBands().setValues(bands);\n\t\treturn dc;\n\t}",
"function getBands() {\n ... | [
"0.59153485",
"0.59153485",
"0.5892315",
"0.58342355",
"0.5685406",
"0.56752014",
"0.55195266",
"0.54920155",
"0.54575795",
"0.54414505",
"0.54272735",
"0.5404386",
"0.53735495",
"0.5346852",
"0.53304833",
"0.53182465",
"0.52923125",
"0.5279986",
"0.52354276",
"0.52246875",
"... | 0.74837846 | 0 |
Write the css string into the style tag | function writeCss(){
var css = createCssString();
style.styleSheet ? style.styleSheet = css : style.innerHTML = css;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCss(str) {\n mStyle.cssText = str;\n }",
"function setCss(str) {\n mStyle.cssText = str;\n }",
"function setCss( str ) {\n mStyle.cssText = str;\n }",
"function setCss( str ) {\n mStyle.cssText = str;\n }",
"funct... | [
"0.72148633",
"0.72043884",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633",
"0.72034633"... | 0.8063576 | 0 |
When a user types !bday set, bot sets their bday | onSet(msg) {
const parsedInput = msg.content.split(' ');
const memberId = msg.member.user.id;
const memberTag = msg.member.user.tag;
const birthDate = parsedInput[2];
const match = birthDate.match(/(0\d{1}|1[0-2])\/([0-2]\d{1}|3[0-1])/);
if(!match) {
msg.reply('invalid birthday formatting, type `!bd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changebBirth_day(value){\n bbirth_day = value.value;\n if(bbirth_day!='' && bbirth_month!='' && bbirth_year!=''){\n $('#nbabyexpecBtn').prop('disabled', false);\n }\n}",
"function yourBirthday() {\n today = new Date();\n dd = String(today.getDate()).padStart(2, '0');\n mm = Stri... | [
"0.5945439",
"0.58786243",
"0.55675983",
"0.55324316",
"0.54923165",
"0.54644656",
"0.5455562",
"0.5434278",
"0.5403945",
"0.5372333",
"0.53631026",
"0.53410685",
"0.5318015",
"0.53053284",
"0.5279425",
"0.52583826",
"0.52554727",
"0.5254835",
"0.5240657",
"0.5219462",
"0.520... | 0.65974796 | 0 |
When a user types !bday help, list of commands is sent | onHelp(msg) {
const commandList = [
'\n`!bday help`: Pull up this menu\n',
'`!bday set MM/DD`: Set or update sending user\'s bday\n',
'`!bday confetti`: Throw confetti at user\n',
'`!bday upcoming`: List upcoming bdays\n'
];
const helpEmbed = new Discord.RichEmbed()
.setColor('#d6abde')
.setTit... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function helpWhat(terminal, command) {\n var what = command.replace(\"help\", \"\");\n //terminal.echo(\">HELP: \" + what);\n if (what.match(\"who$\")) {\n terminal.echo(\">[[b;#388E8E;#000000]A text about me.]\");\n\n }else if (what.match(\"education$\")) {\n terminal.echo(\">[[b;#388E8E... | [
"0.7213148",
"0.7181719",
"0.7155264",
"0.7102738",
"0.705422",
"0.6912957",
"0.68881696",
"0.6855658",
"0.6849717",
"0.67708576",
"0.66561973",
"0.66549027",
"0.66451836",
"0.6607157",
"0.65584475",
"0.6516897",
"0.64452654",
"0.63933074",
"0.63667965",
"0.6360153",
"0.63181... | 0.80190057 | 0 |
When a user types !bday confetti, a cute message is sent | onConfetti(msg) {
msg.reply('have some confetti ♡ (ノ^ヮ^)ノ*:・゚✧');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userTalks() {\n\n const messageText = $(\"#user_entry\").val();\n\n if (messageText.length === 0 || messageText.split(\" \").length - 1 === messageText.length) {\n return;\n }\n \n sendMessage(\"user_message\", messageText);\n $(\"#user_entry\").val('');\n \n sendReplyWithDelay();\n}",
"sendC... | [
"0.65641385",
"0.63515586",
"0.6170768",
"0.6057046",
"0.5926589",
"0.59184587",
"0.58741516",
"0.58700126",
"0.5861142",
"0.58327025",
"0.58174515",
"0.58163327",
"0.57604945",
"0.5758059",
"0.57469076",
"0.57306373",
"0.5723981",
"0.5719735",
"0.5717086",
"0.5716173",
"0.57... | 0.6765026 | 0 |
When a user types !bday upcoming, a list of birthdays by month is sent | onUpcoming(msg) {
const currentMonth = Number(moment().format('MM'));
const currentDay = Number(moment().format('DD'));
Birthday.scan({
ProjectionExpression: '#bm, #bd, #i, #t',
FilterExpression: '#bm = :current_month and #bd > :current_day',
ExpressionAttributeNames: {
'#bm': 'birth_month',
'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function birthdays(month, day)\n{\n\tvar u = new User;\n\tvar lastuser = system.stats.total_users;\n\tvar list = [];\n\tmonth = parseInt(month, 10) + 1;\n\tfor(u.number = 1; u.number <= lastuser; u.number++) {\n\t\tif(u.settings&(USER_DELETED|USER_INACTIVE))\n\t\t\tcontinue;\n\t\tif(u.security.restrictions&(UFLAG_... | [
"0.6923204",
"0.64622134",
"0.63263124",
"0.6060262",
"0.58463824",
"0.5793166",
"0.57191753",
"0.5715711",
"0.5681223",
"0.56511444",
"0.56443465",
"0.5619574",
"0.5570683",
"0.5570314",
"0.55460656",
"0.5543951",
"0.5509158",
"0.5501219",
"0.54566854",
"0.5441298",
"0.54202... | 0.6860175 | 1 |
gets an id to tell our api server which event to fetch | getEvent(id) {
return apiClient.get('/events/' + id)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get eventId() {\n return this._data.id;\n }",
"function getId() {\n return EventBus.getId();\n }",
"function eventid(e){\n return parse_id(e.target.get('id'));\n }",
"function getCurrentEventId() {\n\treturn window.location.search.split('id=')[1]\n}",
"function _getEve... | [
"0.7006506",
"0.6906876",
"0.67796695",
"0.66781986",
"0.66173947",
"0.66162527",
"0.65749234",
"0.64939344",
"0.64926064",
"0.64316195",
"0.639586",
"0.6374864",
"0.6222243",
"0.6221537",
"0.61932266",
"0.6095736",
"0.6068488",
"0.60678875",
"0.60607386",
"0.60494286",
"0.60... | 0.76242393 | 0 |
Builds a map of bit previews for loading into an infinite scrolling container. Params: `nextProps`: a props object, in case we need to have the latest props passed in before they've actually updated, `newPage`: an integer page value, for paging through result lists from the backend, `concatBits`: whether to concatenate... | buildPreviews({ nextProps = null,
newPage = null,
concatBits = false } = {}) {
let props = nextProps || this.props,
page = newPage || this.state.page,
fetchType, // The type of fetch we'll be making to the backend - whether
// to the bit inde... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"componentWillReceiveProps(nextProps) {\n const currentProps = this.props,\n query = nextProps.query,\n newBit = nextProps.newBit,\n updatedBit = nextProps.updatedBit,\n deletedBit = nextProps.deletedBit,\n windowWidth = nextProps.windowWidth;\n\n // If our query h... | [
"0.57687926",
"0.55040795",
"0.5076349",
"0.5060784",
"0.5038988",
"0.48638824",
"0.4823068",
"0.4661817",
"0.4649057",
"0.46043047",
"0.45832962",
"0.45814753",
"0.4579208",
"0.45761728",
"0.4567505",
"0.45650348",
"0.4544016",
"0.44984615",
"0.44681975",
"0.44616187",
"0.44... | 0.7620888 | 0 |
A callback that handles the creation of a new bit, adding a BitPreview to our list in the front position. | handleBitCreate(uniqueID) {
const newBits = Immutable.OrderedMap([[
uniqueID,
<BitPreview key={uniqueID} num={uniqueID}
onClick={this.handleBitClick}
onMount={this.resetActiveBit}
body=''
updatedAt={new Date()}/>
]]).concat(this... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleBitUpdate(updatedBit) {\n const { uniqueID, body } = updatedBit;\n const bits = this.state.bits;\n const newPreview = <BitPreview key={uniqueID} num={uniqueID}\n onClick={this.handleBitClick}\n onMount={this.resetActiveBit}\n ... | [
"0.62177604",
"0.56205875",
"0.5427389",
"0.5387026",
"0.5217177",
"0.5142505",
"0.51107675",
"0.5107349",
"0.50827014",
"0.5041986",
"0.49975833",
"0.49594033",
"0.49354458",
"0.49200982",
"0.4901185",
"0.48777363",
"0.4871649",
"0.48656958",
"0.48514298",
"0.48298162",
"0.4... | 0.68070424 | 0 |
A callback that handles the update of a new bit, updating the BitPreview object in the list. | handleBitUpdate(updatedBit) {
const { uniqueID, body } = updatedBit;
const bits = this.state.bits;
const newPreview = <BitPreview key={uniqueID} num={uniqueID}
onClick={this.handleBitClick}
onMount={this.resetActiveBit}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleBitCreate(uniqueID) {\n const newBits = Immutable.OrderedMap([[\n uniqueID,\n <BitPreview key={uniqueID} num={uniqueID}\n onClick={this.handleBitClick}\n onMount={this.resetActiveBit}\n body=''\n updatedAt={new Date()}/>\n ]]... | [
"0.5972804",
"0.5781707",
"0.56177765",
"0.533929",
"0.53342533",
"0.5271307",
"0.520915",
"0.5081037",
"0.50721604",
"0.5048804",
"0.4984864",
"0.49743047",
"0.49585673",
"0.49444407",
"0.49399632",
"0.49377826",
"0.49073818",
"0.48927516",
"0.48876",
"0.48869535",
"0.486800... | 0.74235845 | 0 |
A safer version of `normalizeDoc` `normalizeDoc` concat strings and flat "concat" in `fill`, while `cleanDoc` don't On `concat` object, `normalizeDoc` always return object with `parts`, `cleanDoc` may return strings `cleanDoc` also remove nested `group`s and empty `fill`/`align`/`indent`/`linesuffix`/`ifbreak` if possi... | function cleanDoc(doc) {
return mapDoc(doc, (currentDoc) => cleanDocFn(currentDoc));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function concat(docs) {\n const concatenation = prettier.concat(processComments(docs));\n return concatenation.parts.length === 0 ? \"\" : concatenation;\n }",
"function normaliseDico(dico) {\n for (let word of dico) {\n if (word.word_ok === undefined) {\n word.w... | [
"0.5231198",
"0.5127542",
"0.5068618",
"0.5054378",
"0.5052115",
"0.4866647",
"0.48426855",
"0.48426855",
"0.48317018",
"0.476962",
"0.47042474",
"0.46897218",
"0.46842402",
"0.46760505",
"0.46404716",
"0.46199444",
"0.46169195",
"0.45862997",
"0.45856985",
"0.45662993",
"0.4... | 0.5676558 | 1 |
Get model acording to String type | static getModel(type) {
switch (type) {
case "Bill":
return require("./ModelProducts/Bill");
case "Cargo":
return require("./ModelProducts/Cargo");
case "Driver_Notification":
return require("./ModelProducts/Driver_Notification"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getTypeModel(name) {\n const model = this.types()[name];\n if (!model) {\n return null;\n }\n return model;\n }",
"function getModelByType(type) {\n\tswitch (type) {\n\t\tcase Types.USER:\n\t\t\treturn User;\n\t\tcase Types.TOPIC:\n\t\t\treturn Topic;\n\t\tcase Ty... | [
"0.715378",
"0.6984503",
"0.653278",
"0.64196205",
"0.6330599",
"0.6323445",
"0.61758786",
"0.61395377",
"0.61344856",
"0.61219186",
"0.6063951",
"0.60027194",
"0.5971699",
"0.5942452",
"0.59420896",
"0.5905143",
"0.5887749",
"0.5838491",
"0.5836969",
"0.57980174",
"0.5795702... | 0.70383006 | 1 |
Function executing the game. Game consists of 5 turns where user is asked for input, computer makes its choice and the choice is shown to the user. Decision() gives points to whoever won the round, which is displayed to the user afterwards. After 5 turns, the final point score is evaluated and the winner of the game de... | function game() {
console.log("Welcome to Rock, Paper, Scissors!");
var turn = 1;
while (turn <= 5) {
askInput();
computerPlay();
console.log("You: "+ user, "Computer: "+ computer);
decision(user, computer);
console.log("Your points: " + userPoints + ", Computer points: " + computerPoints);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function game (userChoice) {\n let computerChoice = computerSelection();\n switch (userChoice + computerChoice) {\n //Define the winning cases\n case \"rs\":\n case \"sp\":\n case \"pr\":\n win(userChoice, computerChoice);\n break;\n \n //Define... | [
"0.70412296",
"0.69264966",
"0.6904932",
"0.68709314",
"0.68570536",
"0.6736418",
"0.6733157",
"0.6707071",
"0.66900796",
"0.6670041",
"0.66533834",
"0.66443366",
"0.6635418",
"0.6599873",
"0.6594547",
"0.65934944",
"0.6592689",
"0.6586996",
"0.65676326",
"0.65669626",
"0.656... | 0.7420322 | 0 |
function to pick a random direction for the robot to move in | function randomRobot(state) {
return { direction: pickRandom(roadGraph[state.place]) };
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRandomDirection() {\n var randomDirection = 'stop';\n \n switch(Math.floor(Math.random() * 4)) {\n case 0:\n randomDirection = 'up';\n break;\n \n case 1:\n randomDirection = 'down';\n break;\n \n ... | [
"0.7523489",
"0.7511189",
"0.74985844",
"0.7279022",
"0.70820755",
"0.7082061",
"0.702064",
"0.7004809",
"0.6996951",
"0.6973631",
"0.6970479",
"0.6968312",
"0.69537956",
"0.69488776",
"0.6849379",
"0.6846688",
"0.6839852",
"0.6814853",
"0.6782581",
"0.6727118",
"0.66951996",... | 0.7562133 | 0 |
compared robots to each other to measure efficiency | function compareRobots(robot1, memory1, robot2, memory2) {
let robot1TurnsAvg = 0;
let robot2TurnsAvg = 0;
for (let tasks = 0; tasks < 100; tasks++) {
robot1TurnsAvg += testRobot(VillageState.random(), robot1, memory1);
robot2TurnsAvg += testRobot(VillageState.random(), robot2, memory2);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"runs() {\n let runs = 0;\n if (this.types.includes(\"benchmark\") && this.benchmark_options.engine) {\n runs += this.benchmarkTrials * this.benchmarkRuns;\n }\n\n if (this.types.includes(\"accelerate\") && this.acceleration_options.engine) {\n runs += this.accelerateKernelTrials;\... | [
"0.60646635",
"0.60535085",
"0.60364467",
"0.60238737",
"0.5901979",
"0.5871652",
"0.58527225",
"0.5845305",
"0.5693972",
"0.56824243",
"0.56770974",
"0.5676162",
"0.5671907",
"0.5656124",
"0.5651852",
"0.56418735",
"0.56102544",
"0.5575511",
"0.5565666",
"0.5524019",
"0.5507... | 0.67415416 | 0 |
Generator of function for convert ldap errors code to string | function genLdapErrorsToStr() {
var errors = [];
for ( var i in Components.interfaces.nsILDAPErrors) {
errors[ errors.length ] = i;
}
return function(n) {
return errors[n];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function err(strm,errorCode){strm.msg = msg[errorCode];return errorCode;}",
"function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}",
"function err(strm,errorCode){strm.msg=msg[errorCode];return errorCode;}",
"function err(strm,errorCode){strm.msg=messages[errorCode];return errorCode;}",
"... | [
"0.6346958",
"0.6321165",
"0.6321165",
"0.62146264",
"0.6048652",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
"0.5939211",
... | 0.7756654 | 0 |
var events_timeout_long = 0; | function get_events_timeout(delay) {
if (events_timeout !== 0) {
clearTimeout(events_timeout);
events_timeout = 0;
//clearTimeout(events_timeout_long);
}
//events_timeout_long = setTimeout(function() {get_events(); events_timeout_long = 0;}, 60000);
events_timeout = setTimeout(function() {get_events();... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timeouthandler()\n\t{}",
"function Events_DoFormResponseTimeout()\r\n{\r\n // End form response validation\r\n Events_EndFormResponseValidation();\r\n \r\n // Switch form events submition to false\r\n mblnEventsFiredThroughPipeline = false;\r\n \r\n // Remove fire mode\r\n mblnEv... | [
"0.64410406",
"0.640758",
"0.6307545",
"0.6262005",
"0.602122",
"0.5945411",
"0.5945411",
"0.5945282",
"0.59420305",
"0.5941945",
"0.5915931",
"0.591406",
"0.58926183",
"0.5873716",
"0.585299",
"0.5852144",
"0.5845424",
"0.5845424",
"0.5845424",
"0.5845424",
"0.5845424",
"0... | 0.74158776 | 0 |
Peg a marker and append it to a marker string This results in a | separated marker string to be used for logging and reports. | function pegMarker(mList, marker) {
mList = mList + marker + "|";
return (mList);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function markupMarkerText(markerText, location) {\r\n\tmarkerText = \"Lat: \" + location.lat() + \" Lng: \" + location.lng() + \" Address: \" + markerText;\r\n\tvar prettyMarkerText = markerText.replace(\"Lat: \", \"<b>Lat:</b> \").replace(\" Lng: \", \"<br><b>Lng:</b> \").replace(\" Address: \", \"<br><b>Address:... | [
"0.64291203",
"0.58375704",
"0.57711476",
"0.56798154",
"0.56122386",
"0.55192363",
"0.5498943",
"0.54595643",
"0.53983855",
"0.5388438",
"0.5351439",
"0.5315159",
"0.53030366",
"0.5256276",
"0.5251836",
"0.52475226",
"0.5245556",
"0.52396905",
"0.5229735",
"0.52140623",
"0.5... | 0.72033626 | 0 |
Shows a list of failed installs and skipped plugins | showResults () {
if (this.failed.size) {
this.failed.forEach((message, pluginName) => console.log(`Installation of "${pluginName}" failed:
${message}
`))
}
if (this.skipped.length) {
console.log(`The following plugins were skipped and need to be manually added to
config.xml:
${this.ski... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function list () {\n\tprettyLog('log', 'INSTALLED COMPONENTS: ' + installed_components.sort().join(', '));\n}",
"function showLoadingErrors() {\n const failedTasks = []\n const taskStatus = {}\n\n // Construct data for full report\n for (const data of scripts) {\n const messages = []\n // check sources... | [
"0.59536165",
"0.5672914",
"0.5530482",
"0.5530482",
"0.5530482",
"0.5425367",
"0.5408324",
"0.5392988",
"0.5284951",
"0.5253485",
"0.51568776",
"0.5093337",
"0.50661284",
"0.4980417",
"0.4975112",
"0.4949537",
"0.4935462",
"0.49328768",
"0.49286193",
"0.49247634",
"0.490437"... | 0.822393 | 0 |
Function to handle the button click should send the button index for the parent component | handleClick() {
const { index, onClickButton } = this.props;
onClickButton(index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"eventToNumberofPage(){\n\n for(let i =0;i<this.ParentButton.children.length;i++){\n this.ParentButton.children[i].addEventListener(\"click\",()=>{\n this.DisplayItemOnPaGE(this.NumberOfPrudct.value,i*this.NumberOfPrudct.value)\n })\n }\n }",
"prevButton() {\n this... | [
"0.6771887",
"0.6281056",
"0.6141219",
"0.61361504",
"0.6100835",
"0.60764754",
"0.6066337",
"0.5998171",
"0.59854364",
"0.5985224",
"0.59262055",
"0.5923736",
"0.5907791",
"0.590345",
"0.58747023",
"0.58740586",
"0.58739144",
"0.5869554",
"0.586812",
"0.58598536",
"0.5858809... | 0.7236371 | 0 |
Ham lay cac transaction de dien vao 1 block | getTransactionsForBlock() {
try {
// Lay ra so luong transaction vua du 1 block
const transactionsForBlock = this.transactions.slice(0, this.blockSize);
// Clear khoi danh sach transaction trong hang cho de dao
this.clearTransactions(transactionsForBlock);
return transactionsForBlock;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"payForBCVisa(visa){\n let tx = this.citizen.payVisa(visa.country, visa.id, {value:visa[2]-visa[1]});\n tx.done(t => {\n console.log('Successfully paid visa.');\n this.checkTransaction(t).bind(this);\n });\n }",
"parseBlock(self, block) {\n\n var blockNum = block.header.number.low;\n ... | [
"0.62685066",
"0.6266292",
"0.6260595",
"0.6162629",
"0.60975736",
"0.5941719",
"0.59259266",
"0.59242475",
"0.59212965",
"0.58795977",
"0.58652633",
"0.5863362",
"0.58459926",
"0.5833852",
"0.58124673",
"0.58124673",
"0.5804271",
"0.5794078",
"0.5777022",
"0.5753177",
"0.573... | 0.64657056 | 0 |
Provides distilled information about a logger from its raw loggest JSON transport data, as well as access to the raw data. | function LoggerMeta(raw, semanticIdent, entries, schemaNorm) {
this.raw = raw;
this.schemaNorm = schemaNorm;
this.semanticIdent = semanticIdent;
this.entries = entries;
this.family = "";
this.parent = null;
/** If this is a connection type, the other side of the connection, if any. */
this.otherSide = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processLog(rawLog) {\r\n let log = JSON.parse(rawLog);\r\n\r\n if(logger.filter(log)) {\r\n console.log(format(log)); // eslint-disable-line\r\n }\r\n}",
"function getLogObj () { return logObj; }",
"function formatInfo (log) {\n return {\n mkdwn: true,\n attachments: [{\n color: 'goo... | [
"0.5347229",
"0.5322861",
"0.5240658",
"0.5185631",
"0.5185631",
"0.5185631",
"0.5185631",
"0.5185631",
"0.5141436",
"0.5138455",
"0.5132044",
"0.5126575",
"0.51148325",
"0.50893986",
"0.50794154",
"0.49908477",
"0.49901938",
"0.49809706",
"0.49573347",
"0.4955185",
"0.494310... | 0.54752153 | 0 |
fucntion findWeather (locationData, GPS) | function findWeather (locationData, GPS) {
//hide form and display loading text
//If GPS
if (GPS) {
//store lat and long in a var
var weatherAPIData = {
lat: locationData[0],
lon: locationData[1],
units: weatherUnits,
APPID: weatherAPI
}
} else {
//add that var to the weather api and send
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWeather(location) {\n\tvar geocoder = NodeGeocoder({provider: 'google'});\n\tgeocoder.geocode(location, function(err, res) {\n\t\tif(res==null || res[0]==null || res[0].latitude==null) //geocoding failed \n\t\t\tconsole.log('oops something went wrong with geocode');\n \t\telse //we got the longitude a... | [
"0.74602264",
"0.7293406",
"0.71619546",
"0.7071377",
"0.69495237",
"0.6891736",
"0.6878367",
"0.68294555",
"0.68227863",
"0.680424",
"0.6786822",
"0.67716515",
"0.6748871",
"0.6721",
"0.6714367",
"0.66856825",
"0.6665561",
"0.6660576",
"0.66461414",
"0.66454464",
"0.66204476... | 0.7392937 | 1 |
Sets suffix based on units used. | function setSuffix() {
if (weatherUnits === 'metric'){
weatherSuffix = {
none: '\xB0',
temp: '\xB0C',
dist: 'kph',
amnt: 'cm'
}
} else {
weatherSuffix = {
none: '\xB0',
temp: '\xB0F',
dist: 'mph',
amnt: 'in'
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setSuffix(value, lineNumber, globalPos) {\n this.suffixValue += value;\n this.suffixLineNumber = lineNumber;\n this.suffixGlobalPos = globalPos;\n this.endLineNumber = lineNumber;\n }",
"set parameterSuffix(suffix) {\n this.ParameterSuffix = suffix;\n this.hasParamet... | [
"0.6784342",
"0.6327605",
"0.60281235",
"0.595233",
"0.59263945",
"0.5817901",
"0.5741001",
"0.56609917",
"0.5550188",
"0.55487937",
"0.5535405",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
"0.5531022",
... | 0.7745463 | 0 |
function to get section id from image ids | function getimageid(id) {
var pf;
if (id <= 6) {
pf = 1;
} else if (id > 6 && id <= 8) {
pf = 2;
} else if (id > 8 && id <= 10) {
pf = 3;
} else if (id > 10 && id <= 13) {
pf = 4;
} else if (id > 13 && id <= 14) {
pf = 5;
} else if (id > ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getCurrentId()\n{\n\treturn parseInt($('section').filter(function(){ return $(this).css('display') != 'none'; }).attr('id').substring(8));\n}",
"function getCurrSectionID(){\n return \"section_\"+String(curr_section);\n }",
"function readId(image) {\n return image.data.id;\n }",
... | [
"0.6554662",
"0.6301872",
"0.62056786",
"0.61102104",
"0.60266143",
"0.59535736",
"0.58976144",
"0.5859768",
"0.58467966",
"0.57604355",
"0.57041126",
"0.5680888",
"0.566134",
"0.56464654",
"0.56333935",
"0.5620436",
"0.56123",
"0.5608429",
"0.5599132",
"0.5595528",
"0.555381... | 0.63042414 | 1 |
'''''''''' '''''''''' '''''''''' '''''''''' '''''''''' LCASE | function lCASE(TheString) {
"use strict";
return TheString.toLowerCase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function LCase(a) {\n var s = \"\";\n var k = String(a);\n var l = k.length; \n var z, m;\n for (var i = 0; i < l; i++) {\n z = k[i].charCodeAt(0);\n if(z>64 && z<91){\n m = z + 32; \n s += String.fromCharCode(String(m));\n } else {\n s += String.fromCha... | [
"0.7041274",
"0.66696256",
"0.6481685",
"0.6448835",
"0.64373976",
"0.63629925",
"0.636093",
"0.6342188",
"0.63179255",
"0.6316399",
"0.6246088",
"0.62208873",
"0.6208566",
"0.61666596",
"0.61609757",
"0.61417",
"0.6134115",
"0.61206454",
"0.60844433",
"0.6079073",
"0.6066301... | 0.7301327 | 0 |
'''''''''' '''''''''' '''''''''' '''''''''' '''''''''' UCASE | function uCASE(TheString) {
"use strict";
return TheString.toUpperCase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function properCases (string){\n\tif (string != null) {\n\t\tstring = string.toLowerCase();\n\t\tpatt1 = /^(.)|\\s+(.)|-(.)/g;\n\t\tstr_new = string.replace(patt1, function($1){\n\t\t\treturn $1.toUpperCase();\n\t\t});\n\t\treturn str_new;\n\t}\n\treturn string;\n\t}",
"properCase(str) {\n return str.replac... | [
"0.7272525",
"0.71816725",
"0.7082315",
"0.70281315",
"0.687796",
"0.6876791",
"0.68707895",
"0.6867335",
"0.681266",
"0.6773062",
"0.6740568",
"0.6718001",
"0.6690767",
"0.66814923",
"0.66799873",
"0.66746944",
"0.66652113",
"0.66615546",
"0.6660696",
"0.66574335",
"0.665289... | 0.75499636 | 0 |
'''''''''' '''''''''' '''''''''' '''''''''' '''''''''' LTRIM | function lTRIM(TheString) {
"use strict";
return TheString;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function funTrim(p_strCad) {\n p_strCad = p_strCad.replace(/^\\s*|\\s*$/g, \"\");\n return p_strCad;\n}",
"function LTrim( value ) {\r\n var re = /\\s*((\\S+\\s*)*)/;\r\n return value.replace(re, \"$1\");\r\n}",
"function ltrim()\r\n{\r\n return this.replace( /^\\s+/g,'');\r\n}",
"function LTr... | [
"0.7306482",
"0.72662526",
"0.7263819",
"0.7257519",
"0.7200324",
"0.7159826",
"0.71349126",
"0.7023558",
"0.6987222",
"0.698251",
"0.6961856",
"0.6936393",
"0.6935272",
"0.6935272",
"0.6925295",
"0.69242424",
"0.6911613",
"0.69086784",
"0.6897925",
"0.6867717",
"0.6867717",
... | 0.7423714 | 0 |
'''''''''' '''''''''' '''''''''' '''''''''' '''''''''' RTRIM | function rTRIM(TheString) {
"use strict";
return TheString;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function funTrim(p_strCad) {\n p_strCad = p_strCad.replace(/^\\s*|\\s*$/g, \"\");\n return p_strCad;\n}",
"function fidoquoter_trim(src) {\n\treturn src.replace(/(^\\s+)|(\\s+$)/g, \"\");;\n}",
"function _Field_rtrim(){\n\tthis.setValue(_rtrim(this.getValue()), null, false);\n\treturn true;\n}",
"rtrim... | [
"0.7151733",
"0.704908",
"0.70426726",
"0.6978251",
"0.6976237",
"0.6945239",
"0.69053453",
"0.6875628",
"0.6833657",
"0.68191683",
"0.6812162",
"0.67557067",
"0.67546546",
"0.67513955",
"0.6733651",
"0.6731796",
"0.67117834",
"0.6709939",
"0.6708948",
"0.67067003",
"0.670221... | 0.7266864 | 0 |
Sends the answers to the data base | async function sendAnswers(answers) {
console.log(answers);
//sends the list to the database with sendData() function.
const response = await sendData('/api/finishedResponse', answers);
console.log(response);
newLocation();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sendResults() {\n document.querySelector(\"#my-answers\").submit();\n }",
"function sendQuestion() {\n // null count identifies any unfilled cells in the survey\n let nullCount = objectArr.filter(function (value) {return value === null }).length\n // This is labeled \"Next... | [
"0.6635646",
"0.64222986",
"0.6401499",
"0.6364244",
"0.6326211",
"0.6302991",
"0.62329113",
"0.6080658",
"0.600466",
"0.5887366",
"0.5854988",
"0.5847931",
"0.5825904",
"0.5796761",
"0.57800865",
"0.5776537",
"0.57245713",
"0.5696371",
"0.5695286",
"0.5693151",
"0.5685495",
... | 0.72517365 | 0 |
Tip to share the same waiterTask between gameService and gameController | set waiterTask(value) {
this.gameService.waiterTask = value;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async checkConditions() {\n let currentPlayer = this.controller.currentPlayer;\n this.controller.waiting = true;\n await this.checkSwamp(currentPlayer);\n await this.checkEnd(currentPlayer);\n this.controller.waiting = false;\n }",
"function checkOnWait(task, item) {\n}",
... | [
"0.60432917",
"0.57053876",
"0.56405145",
"0.5545713",
"0.5445232",
"0.54219055",
"0.54119545",
"0.54084295",
"0.53855854",
"0.5346333",
"0.5338904",
"0.53051096",
"0.52987564",
"0.52844477",
"0.5264314",
"0.5261706",
"0.5256571",
"0.5223692",
"0.5221788",
"0.5219556",
"0.519... | 0.7389993 | 0 |
global _ Sorts and Groups charities by the first letter in the Charity name, also on GHD it will filter to only return charities that have ghd_access = true | function buildOrderedGroupedCharities(charities, isGHD, is_lah_app) {
var filteredCharities = [];
if (!isGHD || is_lah_app) {
filteredCharities = charities;
} else {
filteredCharities = charities.filter(function (charity) {
return charity.ghd_access === ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function alphabetize(stg) {\n \n}",
"boroughsFilterOptions(boroughs) {\n this.boroughsOptions = boroughs.sort(function (a, b) {\n return a.boroughName < b.boroughName ? -1 : a.boroughName > b.boroughName ? 1 : 0;\n })\n }",
"_sort_characters(range,data,clicked_line){\n let ret = [];\n cons... | [
"0.6032288",
"0.56801337",
"0.5598585",
"0.55227256",
"0.549619",
"0.549619",
"0.5470893",
"0.54410017",
"0.5357675",
"0.53102905",
"0.52987236",
"0.52752554",
"0.52514285",
"0.5250546",
"0.5246136",
"0.52432066",
"0.52079093",
"0.5205872",
"0.52057904",
"0.52022994",
"0.5152... | 0.7285104 | 0 |
In this exercise, you will implement your own version of the Array.prototype.reverse method. Your implementation should differ from the builtin method in the following two ways: It should accept either a string or an array as an argument. It should return a new string or array. Problem in: string or array out: new stri... | function reverse(inputForReversal) {
let results;
let j = 0;
results = (Array.isArray(inputForReversal)) ? [] : '';
for (let i = inputForReversal.length - 1; i >= 0; i -= 1) {
if (typeof results === 'string') {
results += inputForReversal[i];
} else {
results[j] = inputForReversal[i];
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reverseArray(arr){\n \n}",
"function ReverseArray(x){\n \n\n}",
"function rev(arr){\n return arr.reverse();\n}",
"function reverseArray(array){\n\n}",
"function reverseArr(arg) {\n return arg.reverse();\n}",
"function makeReverse(array){\n if(array instanceof Array){\n let ... | [
"0.7675926",
"0.762204",
"0.759255",
"0.75628275",
"0.75173527",
"0.7473938",
"0.7453604",
"0.7403616",
"0.73149884",
"0.7265505",
"0.72486687",
"0.7237474",
"0.7227364",
"0.7212823",
"0.7204201",
"0.7195881",
"0.7183033",
"0.7177852",
"0.71718895",
"0.7166804",
"0.7162791",
... | 0.8043006 | 0 |
add to members.json file | function add() {
let id = localStorage.getItem("index")
fs.readFile("./database/members.json", "utf-8", function(err, data) {
if(err) throw err
var memberObject = JSON.parse(data)
memberObject.members.push({
id: id,
surname: surname,
otherNames: firstAndOther,
gender: gender,
DOB: DOB,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onMemberAdded(member) {\n this.members.push(member);\n }",
"function addMemberToList() {\n if (settings.current_member) {\n var member_record = {\n 'id': settings.current_member._id,\n 'name': settings.current_member.title,\n 'time': w.mome... | [
"0.6756017",
"0.6564689",
"0.64394397",
"0.63218755",
"0.6206911",
"0.6157177",
"0.614547",
"0.6108435",
"0.6061932",
"0.59462434",
"0.59211177",
"0.58697945",
"0.5810449",
"0.5773598",
"0.5759563",
"0.5757228",
"0.57483304",
"0.57464516",
"0.5713223",
"0.56880206",
"0.567966... | 0.694979 | 0 |
Create and return Contact object instance from request body for POST'ing new contacts. | function createNewContactObj(req, res) {
let newContact;
try {
newContact = new Contact(
req.body.departmentId,
req.body.name,
req.body.imgUrl,
req.body.phone,
req.body.email
);
// Add default contact img if none is provided
if (newContact.imgUrl === "" || typeof newCo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createContact (req, res) {\n Models.Contact.create(req.body, function(err, results) {\n if (err) {\n res.sendStatus(500);\n return;\n }\n res.status(201).json(results);\n });\n }",
"createContact(req, res) {\r\n var contact = extractContactData(... | [
"0.7135369",
"0.6437103",
"0.6415039",
"0.6203253",
"0.619499",
"0.60448897",
"0.5951229",
"0.59511644",
"0.5843931",
"0.5838804",
"0.58132267",
"0.58102345",
"0.57293665",
"0.56528145",
"0.5652597",
"0.5639515",
"0.5624606",
"0.55763",
"0.55760354",
"0.55758375",
"0.55749196... | 0.7043419 | 1 |
Create and return Contact object instance from request body for updating existing contacts. | function createUpdatedContactObj(req, res) {
let updatedContact = {};
if (typeof req.body.departmentId !== "undefined")
updatedContact.departmentId = req.body.departmentId;
if (typeof req.body.name !== "undefined") updatedContact.name = req.body.name;
if (typeof req.body.imgUrl !== "undefined") updatedConta... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createNewContactObj(req, res) {\n let newContact;\n try {\n newContact = new Contact(\n req.body.departmentId,\n req.body.name,\n req.body.imgUrl,\n req.body.phone,\n req.body.email\n );\n\n // Add default contact img if none is provided\n if (newContact.imgUrl === \... | [
"0.6232071",
"0.6172509",
"0.59025043",
"0.57497686",
"0.56391907",
"0.5621987",
"0.5460716",
"0.5401488",
"0.53963745",
"0.53586817",
"0.535733",
"0.53488195",
"0.5308436",
"0.5291698",
"0.529054",
"0.52866364",
"0.52751887",
"0.52706915",
"0.5261315",
"0.52542526",
"0.52377... | 0.666305 | 0 |
Delete old contact image from Firebase Storage if This doesn't | function deleteOldContactImage(oldContactObj) {
if (typeof oldContactObj.imgUrl === "undefined") {
console.log("No imgUrl to delete");
return;
}
if (typeof oldContactObj.imgUrl === DEFAULT_CONTACT_IMG_URL) {
console.log("Cannot delete default image");
return;
}
// Extracts filename from imgUr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteUserImageFile(user) {\n var fileName = user.img.substring(user.img.lastIndexOf('%2F') + 3, user.img.lastIndexOf('?'));\n // tslint:disable-next-line: max-line-length\n firebase__WEBPACK_IMPORTED_MODULE_3__[\"default\"].storage().ref().child('images/' + user.userId + '/' + fileName).delet... | [
"0.7163472",
"0.7104793",
"0.7007701",
"0.68625003",
"0.65832645",
"0.6466748",
"0.639899",
"0.6224737",
"0.61960447",
"0.6130361",
"0.6086006",
"0.6024174",
"0.60203755",
"0.59837747",
"0.5922685",
"0.5921685",
"0.5919646",
"0.58766025",
"0.5868925",
"0.5855587",
"0.5853573"... | 0.7470871 | 0 |
delete category and related products and return how many records are removed | async function deleteCategory(req, res, next){
try {
const postData = req.body
const resu = {status:false,message:'Failed to remove category.'}
const mongoose = require('mongoose');
const id = mongoose.Types.ObjectId(postData._id)
const result = await CategoryModel... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"delete(data) {\n return this.model.findOneAndUpdate({ _id: data.id, isDeleted: { $ne: true } }, { $set: { isDeleted: true} }).then(async (parent) => {\n if(parent)\n // Remove child products\n await this.model.findOneAndUpdate({ parent: data.id, isDeleted: { $ne: tru... | [
"0.6328387",
"0.60170156",
"0.5796372",
"0.577196",
"0.57388055",
"0.57207114",
"0.57204694",
"0.57159936",
"0.5668346",
"0.56566954",
"0.5648862",
"0.5579648",
"0.5571925",
"0.5563963",
"0.5499663",
"0.5465151",
"0.5453295",
"0.54448247",
"0.5440204",
"0.5422766",
"0.5422376... | 0.6469571 | 0 |
The public add method, which uses the child's join method. | add(child) {
child.join(this);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"append(child, openStart) {\n joinInlineInto(this, child, openStart);\n }",
"append(child, openStart) {\n joinInlineInto(this, child, openStart);\n }",
"add(child) {\n this.el.appendChild(child.el)\n }",
"addTo(parent){return makeInstance(parent).put(this)}",
"_add(child) {\n... | [
"0.66189766",
"0.6589247",
"0.6328319",
"0.628454",
"0.6260031",
"0.6253985",
"0.6148254",
"0.6128723",
"0.60499364",
"0.60269934",
"0.59904003",
"0.59593517",
"0.5948364",
"0.58283734",
"0.58254015",
"0.5818984",
"0.58039236",
"0.57986856",
"0.5782985",
"0.57389575",
"0.5732... | 0.8154491 | 0 |
Set the sticky column widths | function setStickyWidths($tableInstance) {
var $stickyWidth = $tableInstance.parent().find('td').first().outerWidth();
var test = $tableInstance.parent().siblings('.fixed-column').find('td').first().outerWidth($stickyWidth);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setColumnWidths() {\n var currColHeader,\n columnCells,\n cellData,\n headerWidth,\n cellWidth,\n cellDataWidth = 0;\n\n\n _.each(scope.tableColumns, function(value, index) {\n ... | [
"0.6773491",
"0.66329056",
"0.66120654",
"0.6458209",
"0.6431736",
"0.6400951",
"0.6358241",
"0.63552815",
"0.6340343",
"0.6272864",
"0.623199",
"0.62257826",
"0.6110688",
"0.6109191",
"0.61081624",
"0.61024386",
"0.6089825",
"0.60786706",
"0.60494804",
"0.60358214",
"0.60356... | 0.7066538 | 0 |
Parse vehicle speed LSB and MSB into KPH value | function parse_speed(byte0, byte1) {
return (((byte0 & 0xFF) | ((byte1 & 0x0F) << 8)) / 16);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"kmhToMs(speed) {\n return speed / 3.6\n }",
"function kmhToMs(speed) {\n speed /= 3.6;\n\treturn speed;\n}",
"msToKmh(speed) {\n return speed * 3.6\n }",
"function KmH_CONVERSION(windSpeedMs) {\n return windSpeedMs * 3.6;\n}",
"function mphToKmh(speed) {\n speed *= 1.609344;\n\... | [
"0.6617442",
"0.6577155",
"0.64710206",
"0.6444333",
"0.6393938",
"0.6357516",
"0.6214961",
"0.6212531",
"0.6096442",
"0.5722301",
"0.5716086",
"0.56584734",
"0.5650332",
"0.557591",
"0.55758274",
"0.55628103",
"0.5437256",
"0.5402472",
"0.5394308",
"0.5377945",
"0.53031456",... | 0.68632597 | 1 |
Build the folder with Gulp. | function buildBabylonJSAndDependencies() {
colorConsole.log("Running gulp compilation");
let exec = shelljs.exec("gulp --max-old-space-size=8192 typescript-all", {
cwd: path.resolve(__dirname, "../../Gulp/")
});
if (exec.code) {
colorConsole.error("Error during compilation, abortin... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function build() {\n\tfs.readFile(\"package.json\", \"utf-8\", function(err, config) {\n\t\tvar json = JSON.parse(config);\n\n\t\tgulp.src(json.main)\n\t\t\t.pipe(browserify())\n\t\t\t.pipe(concat(\"bundle.js\"))\n\t\t\t.pipe(gulp.dest(\"./build\"));\n\n\t\tconsole.log(\"Built \"+json.main);\n\t});\n}",
"functio... | [
"0.65678513",
"0.6475143",
"0.64344984",
"0.64050937",
"0.6387851",
"0.6288579",
"0.62876326",
"0.6269548",
"0.6257809",
"0.62231463",
"0.61929846",
"0.6184327",
"0.6183857",
"0.6151141",
"0.61472285",
"0.6108755",
"0.60999864",
"0.60969853",
"0.60703003",
"0.60581154",
"0.60... | 0.72590166 | 0 |
.controller("resetForgottonPwdCtrl", resetForgottonPwdCtrl); /It receives a password reset parameter which was sent to user email from the server as a paramater For this $routeParams dependency is injected into the controller. It send the password reset token back to the server alongwith newPassword entered by the user... | function resetForgottonPwdCtrl($scope, $http, $location, $routeParams, authentication, $anchorScroll, $timeout){
$anchorScroll();
$scope.receivedToken = $routeParams.receivedToken;
//console.log("RT : " + $scope.receivedToken);
//console.log("User is : " + user);
$scope.change = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ChangePassController ($window, REGEX, accountService) {\n var vm = this;\n\n vm.errors = [];\n vm.data = {\n currentPassword: '',\n newPassword: '',\n repeatPassword: ''\n };\n vm.sendRequest = sendRequest;\n vm.goBack = goBack;\n ... | [
"0.6624103",
"0.629077",
"0.62560517",
"0.62560517",
"0.6234614",
"0.6204298",
"0.61577946",
"0.6062905",
"0.59597105",
"0.5925061",
"0.59045273",
"0.5855345",
"0.5829402",
"0.5807288",
"0.57807946",
"0.57802033",
"0.57529324",
"0.5724659",
"0.5723419",
"0.57071906",
"0.56960... | 0.80439126 | 0 |
concat case truncated address for MOU | function concatAddress(Case){
let address = `${Case.family_home_address_line_1} ${Case.family_home_address_postcode}`;
return address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function format_address(address)\n {\n const new_address = address.substring(0,5) + '...' + address.slice(-3)\n return new_address;\n }",
"function buildAddress (addrComps){\n var address = '';\n if (addrComps) {\n address = [\n (addrComps[0] && addrComps[0].short_name || ''... | [
"0.58693415",
"0.58643264",
"0.5681746",
"0.56405014",
"0.56038743",
"0.55585796",
"0.55481535",
"0.5535453",
"0.5512521",
"0.54664785",
"0.5448651",
"0.5442658",
"0.543663",
"0.5422597",
"0.54174125",
"0.540376",
"0.5389717",
"0.53675276",
"0.53595346",
"0.5353067",
"0.53502... | 0.6731593 | 0 |
determines file name for generated document | function fileName () {
if (data.partner_a.last_name === data.partner_b.last_name) {
return `${data.case.case_number} ${data.partner_a.last_name} MOU.docx`
} else {
return `${data.case.case_number} ${data.partner_a.last_name} ${data.partner_b.last_name} MOU.docx`
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getFileName(doc){\n\t\t\tconst filePath = doc.document.fileName;\n\t\t\tconst fileName = path.basename(filePath);\n\t\t\treturn fileName;\n\t\t}",
"function generateFilename(suite) {\n return self.filePrefix + getFullyQualifiedSuiteName(suite, true) + '.html';\n }",
"function generateFilenam... | [
"0.7318862",
"0.675875",
"0.6711191",
"0.67038184",
"0.66983664",
"0.663471",
"0.66124433",
"0.65945643",
"0.64252234",
"0.6403657",
"0.63927287",
"0.63739264",
"0.6364845",
"0.63537467",
"0.634895",
"0.63379025",
"0.6311508",
"0.6260378",
"0.6216118",
"0.61924195",
"0.617990... | 0.73594147 | 0 |
What happens when a warehouse is selected | warehousePick(e) {
this.setState({
warehouseOption: e.target.value
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _setPrevSelectedWarehouse(){\n\t\t\tif(product_detail.has_warehouse.length>0){\n\t\t\t\tvar index= 0;\n\t\t\t\t_.forEach(product_detail.has_warehouse,(item,key)=>{\n\t\t\t\t\tif(parseInt(item.is_default) === 1){\n\t\t\t\t\t\tif(parseInt(item.has_unlimited)===1){\n\t\t\t\t\t\t\t$scope.product.defaultwhouse... | [
"0.6166519",
"0.5888219",
"0.5788711",
"0.57408386",
"0.5728376",
"0.5727601",
"0.57107437",
"0.56000805",
"0.55893815",
"0.5565902",
"0.5517193",
"0.5499452",
"0.54956836",
"0.54954714",
"0.54928017",
"0.54758877",
"0.54724634",
"0.54553634",
"0.5450948",
"0.5450505",
"0.544... | 0.6904331 | 0 |
Find the value in the table Role or create it | findOrCreateRole(name){
return new Promise(function (resolve, reject) {
models.Role.findOrCreate({
where: {name: name},
defaults: {name: name}
}).then(function (station) {
resolve(station[0].dataValues)
})
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addRole(role) {\n return this.connection.query(\"INSERT INTO role SET ?\", role);\n }",
"function getRoleID() {\n const query = \"SELECT id FROM role WHERE title = ? \";\n connection.query(query, `${answer.role}` , (err, res) => {\n if (res === null || res === undefined) {\... | [
"0.6318618",
"0.63150746",
"0.60825586",
"0.6075784",
"0.60724694",
"0.6067946",
"0.60595286",
"0.60561776",
"0.60440725",
"0.6016953",
"0.5955162",
"0.59328985",
"0.5854677",
"0.5823529",
"0.580588",
"0.57949966",
"0.57729536",
"0.57497823",
"0.57208884",
"0.5695682",
"0.567... | 0.6668936 | 0 |
Okay, so this part is hard because it's fairly abstracted and uses recursion. The escape key alters var running to yes/pausing/no. Animation takes an amount of time (called step), and has Level and Display do their thing with that amount of time. In some cases (game is paused, level status != 0), animation can return f... | function runLevel(level, Display) {
var display = new Display(document.body, level, gameOptions);
var running = "yes";
display.splashScreen = true;
//pausing event function
function handleKey(event) {
if (event.keyCode == 27 ) { // keyCode 27 is escape key
if (running == "no") {
running = "yes";
displ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runLevel(level, Display) {\n let display = new Display(document.body, level);\n let state = State.start(level);\n let ending = 1;\n let running = \"yes\";\n\n return new Promise(resolve => {\n function escHandler(event) {\n if (event.key != \"Escape\") return;\n ... | [
"0.6494806",
"0.6268745",
"0.6190289",
"0.61811954",
"0.6147271",
"0.61258703",
"0.60988265",
"0.6094388",
"0.6066772",
"0.6051161",
"0.6032711",
"0.60307294",
"0.5993275",
"0.5990713",
"0.5987085",
"0.5978071",
"0.5974529",
"0.5967954",
"0.5945902",
"0.594451",
"0.5906061",
... | 0.731458 | 0 |
De functie progress kijkt hoe ver je in het artikel gescrollt bent. inspiratie | function progress(gelezen, textOver) {
textOver = fullArticle.offsetHeight - window.innerHeight; //check de height van het volledige artikel - de hoogte van je scherm
gelezen = window.scrollY / textOver * 100; //check hoever je bent door je scrollhoogte te delen door het aantal tekst waar nog niet door gescro... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scene_progress(event) {\r\n\t\t// event.scrollDirection liefert als Scrollrichtung FORWARD REVERSE oder PAUSED.\r\n\t\tvar scrollDirection = event.scrollDirection;\r\n\t\t\r\n\t\t// Aenderung des Flugzeugbildes bei Richtungswechsel - PAUSED nicht relevant (aktuelles Bild bleibt automatisch erhalten)\r\n\t... | [
"0.69548494",
"0.64068455",
"0.63980675",
"0.63958377",
"0.6369609",
"0.63354886",
"0.63168705",
"0.6211923",
"0.6207949",
"0.617447",
"0.6167879",
"0.6158721",
"0.61542183",
"0.6147824",
"0.61314243",
"0.6121708",
"0.6116549",
"0.6107355",
"0.60873157",
"0.6077774",
"0.60523... | 0.68932176 | 1 |
build block with rating | function BuildRating(ratingValue) {
var star = '<i class="fa fa-star"></i>';
var ratingblock = '<!-- this block created in js --><span class="ovr-rating" itemprop="reviewRating" itemscope itemtype="http://schema.org/Rating">';
ratingblock = ratingblock + '<meta itemprop="worstRating" content = "' + ratingValue + ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"buildBlock() {\n\t\tthis.html = document.createElement(\"div\")\n\n\t\tCSS.style({width: (this.size - 2) + \"px\", height: (this.size - 2) + \"px\"}, this.html)\n\t\tCSS.addClass(\"block\", this.html)\n\t}",
"createRatingElement(reviewRating) {\r\n const $rating = document.createElement('p');\r\n $rating.c... | [
"0.613109",
"0.6040657",
"0.5913061",
"0.5770245",
"0.576722",
"0.57605094",
"0.57376754",
"0.5737634",
"0.5718566",
"0.56776774",
"0.5659414",
"0.5623158",
"0.5611134",
"0.5585097",
"0.54956603",
"0.5483735",
"0.5481499",
"0.5475377",
"0.5456372",
"0.54530704",
"0.5441261",
... | 0.72784853 | 0 |
Create a new Contact object that uses the values that we pass into our function here. | function makeContact(name, phone, addr) {
return {
name: name,
phone: phone,
// Create a new date object that represents the current time (the default)
added: new Date(),
// This will get set when we add the Contact to the ContactList
id: undefined,
addr: {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Contact(firstName, lastName, phoneNumber) {\n this.firstName= firstName;\n this.lastName= lastName;\n this.phoneNumber=phoneNumber;\n}",
"function Contact (firstName, lastName, phoneNumber, address) {\n this.firstName = firstName;\n this.lastName = lastName;\n this.phoneNumber = phoneNumber;\n th... | [
"0.7134246",
"0.71097386",
"0.7105958",
"0.70740145",
"0.70442665",
"0.702575",
"0.7013372",
"0.6996968",
"0.69837236",
"0.69504476",
"0.69503826",
"0.68753487",
"0.68733543",
"0.6798785",
"0.67977965",
"0.6770633",
"0.6746471",
"0.67036813",
"0.6677263",
"0.66278434",
"0.658... | 0.7447499 | 0 |
Carga en el sistema el contenido que tiene la bolsa de compras del foxycart | function obtenerContenidoBolsaCompras(){
jQuery.getJSON('https://'+storedomain+'/cart?'+fcc.session_get()+'&output=json&callback=?', function(cart) {
xajax_llenarCarritoLocal(cart.products);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cargar()\n\t\t\t{\n\t\t\t\tvar item = bot[Math.floor(Math.random()*bot.length)];//Elemento conseguido al azar del vector bot.\n\t\t\t\tsec.push(item); //Agregamos el boton elegido al azar en la secuencia.\t\n\t\t\t\tcopia(); //Dispara la funcion copia\n\t\t\t}",
"function onLoad(){\r\n let contenidoT... | [
"0.5805474",
"0.5802964",
"0.576302",
"0.57621646",
"0.5756198",
"0.56396466",
"0.5612343",
"0.55901325",
"0.55810136",
"0.55744845",
"0.555459",
"0.5553125",
"0.55515623",
"0.55377984",
"0.55118257",
"0.5487518",
"0.5486734",
"0.5459996",
"0.5448812",
"0.5418856",
"0.5415451... | 0.672878 | 0 |
Calcula el costo de envio segun el departamento | function calcularCostoEnvio(){
var id_departamento = $("#id_departamento").attr("value");
var subtotal = $("#subtotal").attr("value");
xajax_calcularEnvio(id_departamento, subtotal);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calcularCosto(s,h,c,m){\n\tcuentas(s,h,c,m, (error,calculo)=> {\n if (error) {\n\t console.log(\"Error: \", error.message);\n\t }\n else {\n console.log(\"El precio de una persona en el proyecto es \" + calculo.sueldoPorPersona());\n console.log(\"El precio to... | [
"0.69663966",
"0.67030007",
"0.6541471",
"0.65027755",
"0.64584476",
"0.6336514",
"0.6327682",
"0.6321718",
"0.63208747",
"0.6290827",
"0.62079763",
"0.6190801",
"0.61759686",
"0.6140489",
"0.60761446",
"0.6051011",
"0.60445046",
"0.6044098",
"0.6036266",
"0.60131305",
"0.601... | 0.6994112 | 0 |
Oculta todos los mensajes de error reportados en la pagina | function limpiarMensajesError(){
$('#errEmail').css("display", "none");
$('#errEmailConf').css("display", "none");
$('#errClave').css("display", "none");
$('#errClaveConf').css("display", "none");
$('#errNombre').css("display", "none");
$('#errApellido').css("display", "none");
$('#errDireccion').css("display", ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function limpiarErrores() {\n\t$(selErrorUsuario).text(\"\");\n\t$(selErrorPassword).text(\"\");\n\t$(selInfoForm).text(\"\");\n\treturn;\n}",
"function clearErrors() {\n var errFields = getFieldsWithClass(\"error\");\n errFields.map( function(DL){ hideError( DL ); } );\n}",
"function resetErrMsg(){\n\t\... | [
"0.6734557",
"0.62248516",
"0.61662006",
"0.61512077",
"0.60755426",
"0.60736454",
"0.605804",
"0.60545206",
"0.59795886",
"0.5974482",
"0.595322",
"0.5923846",
"0.59101176",
"0.5905603",
"0.5893652",
"0.5892939",
"0.58922046",
"0.58876526",
"0.5857223",
"0.5855837",
"0.58357... | 0.6670665 | 1 |
autogenerate a key function for an extent | function key_function (extent) {
const div = extent[1] - extent[0] < 5 ? 2 : 1;
return function (k) {
return Math.floor(k * div) / div;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getKey(_, ctx) {\n const k = 'k:' + _.$key + '_' + (!!_.$flat);\n return ctx.fn[k] || (ctx.fn[k] = Object(vega_util__WEBPACK_IMPORTED_MODULE_1__[\"key\"])(_.$key, _.$flat, ctx.expr.codegen));\n}",
"function outputKey(name, ext) {\n return name + '.' + ext;\n}",
"function outputKey(name, ext) {\n ... | [
"0.6298392",
"0.6261028",
"0.62377816",
"0.62316155",
"0.62159956",
"0.6208251",
"0.61652976",
"0.6150453",
"0.6053474",
"0.6043502",
"0.6041269",
"0.5993115",
"0.5934228",
"0.5872518",
"0.5829478",
"0.5829478",
"0.5826565",
"0.5826565",
"0.5819255",
"0.5819255",
"0.57856953"... | 0.69725233 | 0 |
Apply a validation test to each date provided. | function validateEach(value, element, test) {
var inst = $.datepick._getInst(element);
var rangeSelect = $.datepick._get(inst, 'rangeSelect');
var multiSelect = $.datepick._get(inst, 'multiSelect');
var dates = (rangeSelect ? value.split($.datepick._get(inst, 'rangeSeparator')) :
multiSelect ? value.split($.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isValidInput(dates)\n\t{\t\n\t\t//Check if all of the dates are in the correct format\n\t\tfor (var i = 0; i < dates.length; i++)\n\t\t{\n\t\t\tvar date = dates[i];\n\t\t\tif (date != \"\" && !isDate(date))\n\t\t\t{\n\t\t\t\tconsole.log(\"----------\");\n\n\t\t\t\tconsole.log(date);\n\t\t\t\tconsole.log(\... | [
"0.6127214",
"0.6070369",
"0.602705",
"0.5910669",
"0.5875408",
"0.5875231",
"0.57771933",
"0.5768203",
"0.5693552",
"0.5643872",
"0.55636287",
"0.5522392",
"0.5522392",
"0.5500735",
"0.5481819",
"0.54774743",
"0.54677385",
"0.5455731",
"0.54498696",
"0.54468507",
"0.54224235... | 0.68499434 | 0 |
Creates a new LayoutGroup Object to group layouts inside | function LayoutGroup( group_data, empty_group ) {
var group = $('<div/>').addClass('atbb-layout-group');
group.header = $('<div/>').addClass('atbb-layout-group-header').appendTo( group );
group.content = $('<div/>').addClass('atbb-layout-group-content').appendTo( group );
group.namespace = namespace + '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createLayout(options){return options.layout||new StackedLayout();}",
"function createLayout(options){return options.layout||new SplitLayout({renderer:options.renderer||SplitPanel.defaultRenderer,orientation:options.orientation,alignment:options.alignment,spacing:options.spacing});}",
"function createL... | [
"0.6859697",
"0.68202347",
"0.68036664",
"0.67126024",
"0.66938287",
"0.64848727",
"0.6447352",
"0.63872516",
"0.6370188",
"0.6332804",
"0.6317836",
"0.6264603",
"0.6250232",
"0.62304354",
"0.6131537",
"0.605179",
"0.5955224",
"0.5954844",
"0.5903443",
"0.58654743",
"0.582799... | 0.716049 | 0 |
Setup an authenticated Axios instance for Artemis (stored globally in `artemisInstance`). | async function setupAuthenticatedClient() {
const { server } = await inquirer.prompt({
type: "input",
name: "server",
message: "Enter the Artemis server:",
default: "https://artemis.cit.tum.de",
});
const baseURL = `${server}/api`;
// Validate the server URL
if (!/^https?:\/\/.+/.test(baseURL... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createAxiosInstance() {\n\t\tconst portString = this.port ? ':' + this.port : '';\n\n\t\tconst config = {};\n\t\tconfig.baseURL = 'http://' + this.host + portString + '/api/';\n\t\tif (this.userToken) {\n\t\t\tconfig.headers = {\n\t\t\t\tAuthorization: 'Bearer ' + this.userToken\n\t\t\t};\n\t\t}\n\n\t\tthis.axios ... | [
"0.6477514",
"0.5950561",
"0.58790094",
"0.58109355",
"0.5795302",
"0.5479451",
"0.5435463",
"0.5412989",
"0.5400493",
"0.5396211",
"0.539166",
"0.53525937",
"0.5337875",
"0.5306477",
"0.5292036",
"0.5285808",
"0.5275828",
"0.52718973",
"0.5258446",
"0.51858693",
"0.5127586",... | 0.7765866 | 0 |
Checks if ALL inputs have received text, enabling the button if true and disabling if false Specific to the barchart properties window. | function checkForAllBarChartInputs(){
if(barchartNameFilled && numGatesFilled && numReqsFilled){
$('#save_chart_properties_btn').removeAttr('disabled');
//$('#save_chart_properties_btn').addClass('col s6 m6 mouse_point waves-effect waves-light btn');
}
else{
$('#save_chart_properties_btn').attr('disab... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkText() {\n if($(\"query\").value) {\n $(\"go-search\").disabled = false;\n } else {\n $(\"go-search\").disabled = true;\n }\n }",
"function checkForAllGateChartInputs(){\n if(gateTitleFilled && gateRemainingFilled && gateActualFilled && gateAvgDaysFilled){\n $('#... | [
"0.62985194",
"0.6247344",
"0.6047583",
"0.60138345",
"0.5960559",
"0.5928725",
"0.5903299",
"0.58992887",
"0.5866024",
"0.5825108",
"0.5818324",
"0.58170134",
"0.58100903",
"0.5803261",
"0.57944155",
"0.5791633",
"0.5782346",
"0.5781715",
"0.5775235",
"0.5745946",
"0.571566"... | 0.71519977 | 0 |
Checks if ALL inputs have received text, enabling the button if true and disabling if false Specific to the gate properties window. | function checkForAllGateChartInputs(){
if(gateTitleFilled && gateRemainingFilled && gateActualFilled && gateAvgDaysFilled){
$('#next_gate_btn').removeAttr('disabled');
//$('#save_chart_properties_btn').addClass('col s6 m6 mouse_point waves-effect waves-light btn');
}
else{
$('#next_gate_btn').attr('di... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableSendButton() {\n if (document.querySelector('#displayName').value.length > 0 && document.querySelector('#sendText').value.length > 0)\n document.querySelector('#sendTextButton').disabled = false;\n else\n document.querySelector('#sendTextButton').disabled = true;... | [
"0.6281286",
"0.62725896",
"0.6264501",
"0.6256665",
"0.6226289",
"0.6225387",
"0.6128355",
"0.6127988",
"0.6101343",
"0.60974956",
"0.60774904",
"0.60709274",
"0.60487336",
"0.60367876",
"0.6015198",
"0.5997716",
"0.59807956",
"0.5980069",
"0.5944071",
"0.5900321",
"0.585212... | 0.6751257 | 0 |
Creates an object of the charts to be stored in the database | function buildChartObject(){
let chartDBObject = {
"name" : chartProperties[0],
"numGates" : chartProperties[1],
"numReq" : chartProperties[2],
"gates" : gates
};
return chartDBObject;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addNewChart() {\n var Chart = grid.getStore().recordType;\n var c = new Chart(Ext.apply({chartId: chartIndex++}, defaultChartRecord));\n grid.stopEditing();\n store.add([c]);\n grid.startEditing(store.getCount(), 0);\n }",
"function createChart() {\r\n\r\n //... | [
"0.6684943",
"0.62808764",
"0.6268878",
"0.62033796",
"0.61803186",
"0.6166427",
"0.61658496",
"0.61586994",
"0.61454046",
"0.6139721",
"0.608555",
"0.60576874",
"0.60535246",
"0.60297865",
"0.60145175",
"0.6008473",
"0.5964687",
"0.5945551",
"0.594096",
"0.5932358",
"0.59090... | 0.71693355 | 0 |
Controller function for retrieving all saved charts from the database and passing them to be displayed in the charts window for selection | function displaySavedCharts(){
var chartsObj = getAllChartObjects();
displayListOfCharts(chartsObj);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAllChartObjects(){\n itemDB.open(\"BarChartDatabase\", 1, \"barchartDatastore\", \"\", barchartIndexes, true, function(result){\n let db = result;\n itemDB.fetchAll(db, \"barchartDatastore\", function(results){\n displayListOfCharts(results);\n });\n });\n}",
"function GenerateCharts(... | [
"0.6517534",
"0.6510401",
"0.64968574",
"0.6486323",
"0.634147",
"0.6308877",
"0.6255338",
"0.62479854",
"0.6211358",
"0.6203414",
"0.61458164",
"0.61351734",
"0.610123",
"0.60302377",
"0.60224104",
"0.5998305",
"0.5990943",
"0.5895403",
"0.589256",
"0.588706",
"0.5865493",
... | 0.7642945 | 0 |
Retrieves all saved charts from the database. | function getAllChartObjects(){
itemDB.open("BarChartDatabase", 1, "barchartDatastore", "", barchartIndexes, true, function(result){
let db = result;
itemDB.fetchAll(db, "barchartDatastore", function(results){
displayListOfCharts(results);
});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySavedCharts(){\n var chartsObj = getAllChartObjects();\n displayListOfCharts(chartsObj);\n}",
"function getcharts() {\n\t\tvar deferred = $q.defer();\n\t\t$http.get(server + '/dashboards/1', {}).success(function(data, status) {\n\t\t\tdeferred.resolve(data);\n\t\t}).error(function(data, status)... | [
"0.73158157",
"0.65990335",
"0.6555482",
"0.65288776",
"0.6414147",
"0.62816924",
"0.61505157",
"0.6142382",
"0.6037918",
"0.60047185",
"0.5889243",
"0.58112216",
"0.57867914",
"0.57347745",
"0.5729671",
"0.56926054",
"0.5650146",
"0.562667",
"0.5587799",
"0.55722547",
"0.547... | 0.7304052 | 1 |
Sends a chart object to the database to be saved. Parameters: chartDBObject object containing all the relevant properties of the chart to be saved | function sendChartToDB(chartDBObject){
itemDB.open("BarChartDatabase", 1, "barchartDatastore", "", barchartIndexes, true, function(result){
let db = result;
itemDB.createItem(db, "barchartDatastore", chartDBObject, function(){});
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function draw_chart(chartObject) {\n\tvar chart = google.visualization.drawChart( {\n \t\"containerId\": chartObject[\"containerID\"],\n \t\"dataSourceUrl\": chartObject[\"dataSourceUrl\"],\n \t\"query\": chartObject[\"query\"],\n \t\"chartType\": chartObject[\"chartType\"],\n \t\"options\": chartOb... | [
"0.57064426",
"0.5260112",
"0.5188279",
"0.5179896",
"0.5176003",
"0.50666314",
"0.5057594",
"0.5027357",
"0.50155056",
"0.501393",
"0.49413085",
"0.48769897",
"0.48744452",
"0.48728204",
"0.4827974",
"0.47916496",
"0.47719482",
"0.4762938",
"0.4731831",
"0.47144333",
"0.4713... | 0.7754044 | 0 |
Displays the list of charts received in the first window of the charts page Parameters: charts collection of chart objects to be displayed in a list | function displayListOfCharts(charts){
console.log(JSON.stringify(charts));
charts.forEach((chart) =>{
$('<div>', {
class: "row collapseGroup"
}).append( $('<ul>', {
style: "background-color:#eeeeee;",
id: "chartList"
}).append( $('<div>', {
class: "col s10 collapsible-header",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function displaySavedCharts(){\n var chartsObj = getAllChartObjects();\n displayListOfCharts(chartsObj);\n}",
"function createAllCharts() {\n createChartHTML(\"Conductivity\");\n createChartHTML(\"Pressure\");\n createChartHTML(\"Temperature\");\n\n const chartConductivity = createChartAndFunctions(\n \... | [
"0.7267169",
"0.6378226",
"0.6336295",
"0.62982607",
"0.6239285",
"0.62062216",
"0.61808515",
"0.6112421",
"0.6080487",
"0.6065937",
"0.6053713",
"0.5930683",
"0.59267884",
"0.58791995",
"0.5875098",
"0.58718",
"0.58675426",
"0.5837914",
"0.5827903",
"0.5813857",
"0.58004206"... | 0.76047385 | 0 |
Returns an array of each unique instance of a tag from the source data | static getUniqueTags() {
const uniqueTags = [];
for (const quote of quotesData) {
for (const tag of quote.tags) {
if (uniqueTags.indexOf(tag) === -1) uniqueTags.push(tag); // Push tag into array if it isn't there already
}
}
return uniqueTags;
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"tags({ tags }) {\n const obj = tagsFilter(tags, this.result);\n return R.map(([tag, o]) => new Tag(tag, o), obj);\n }",
"function getTags($) {\n const tags = [];\n\n const tagElements = $('.concept_light-tag');\n for (let i = 0; i < tagElements.length; i += 1) {\n const tagText = tagElemen... | [
"0.6363259",
"0.63105446",
"0.61377937",
"0.5944504",
"0.585552",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.58155835",
"0.5796124",
"0.57870746",
"0.57714796",
"0.57030904",
"0.5636938",
"0... | 0.70755494 | 0 |
This is a GroupCharacteristic resource | static get __resourceType() {
return 'GroupCharacteristic';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get group () {\n\t\treturn this._group;\n\t}",
"constructor() {\n super({\n uuid: '1818',\n characteristics: [\n new CyclingPowerMeasurementCharacteristic(),\n new CyclingPowerFeatureCharacteristic(),\n new SensorLocationCharacteristic(),\n ]\n })\n }",
"get() {\n ... | [
"0.53692836",
"0.53280026",
"0.5316328",
"0.5205554",
"0.5205554",
"0.5179009",
"0.5154092",
"0.5106206",
"0.50604653",
"0.5017033",
"0.49879184",
"0.49844152",
"0.4980666",
"0.49694526",
"0.49649253",
"0.49559277",
"0.49456123",
"0.49307588",
"0.4927922",
"0.49274576",
"0.49... | 0.81222564 | 0 |
pushes files from pipe to array | function pushTo(array) {
return map(function (file, cb) {
array.push(file);
cb(null, file);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function push(fs){\n for (var i = fs.length - 1; i >= 0; i--)\n cc.push(fs[i]);\n }",
"function push(fs){\n for (var i = fs.length - 1; i >= 0; i--)\n cc.push(fs[i]);\n }",
"function pipeArray(array){\n let newArray = [];\n for(let i=0; i<array.length; i++) {\n newArr... | [
"0.6243971",
"0.6243971",
"0.6166954",
"0.6136668",
"0.59751314",
"0.5848523",
"0.5848523",
"0.5783773",
"0.5772234",
"0.5747937",
"0.5722852",
"0.57208395",
"0.57208395",
"0.5720081",
"0.57198024",
"0.5710644",
"0.5710644",
"0.5710644",
"0.5710347",
"0.5710347",
"0.5710347",... | 0.7152724 | 0 |
recursively processes files and unwraps bundle files | function recursiveBundle(bundleExt) {
return through2.obj(function(file, enc, cb) {
if (!checkFile(file, cb))
return;
// standart file push to callback
if (path.extname(file.path).toLowerCase() != bundleExt)
return cb(null, file);
// bundle file should be parsed
processBundleFile(file, bundleExt)
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function processBundleFile(file, bundleExt, bundleHandler) {\n\t// get paths\n\tvar relative = path.relative(process.cwd(), file.path);\n\tvar dir = path.dirname(relative);\n\n\t// get bundle files\n\tvar lines = file.contents.toString().split('\\n');\n\tvar resultFilePaths = [];\n\tlines.forEach(function(line) {\... | [
"0.63598543",
"0.56210697",
"0.55246574",
"0.54353195",
"0.53732884",
"0.5330041",
"0.5306778",
"0.5262319",
"0.5173779",
"0.51626694",
"0.5088872",
"0.50374645",
"0.5021939",
"0.49748087",
"0.4971306",
"0.49681145",
"0.49516883",
"0.4915892",
"0.49008515",
"0.48986468",
"0.4... | 0.6527638 | 0 |
of elements are in the inclusive range [lower, upper], return its missing ranges. | function findMissingRanges(nums, lower, upper) {
let res = [];
if (nums[0]>lower) {
nums.unshift(lower)
}
if (nums[nums.length-1]<upper) {
nums.push(upper)
}
for (let i = 0; i < nums.length - 1; i++) {
if (nums[i + 1] - nu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function missing(arr) {\n var start = arr[0];\n var end = arr[arr.length - 1];\n var allElements = [];\n var missingElements = [];\n for (var i = start; i <= end; i++) {\n allElements.push(i);\n }\n for (var i = 0; i < allElements.length - 1; i++) {\n if (arr.indexOf(allElements[i]) === -1) {\n m... | [
"0.6946514",
"0.6691923",
"0.6414877",
"0.62235713",
"0.6204465",
"0.61426866",
"0.6124758",
"0.6056736",
"0.60138994",
"0.5985918",
"0.59713584",
"0.5928559",
"0.5874173",
"0.58051664",
"0.5726045",
"0.57147986",
"0.57040143",
"0.5691509",
"0.56835216",
"0.5678327",
"0.56752... | 0.77716273 | 0 |
Function to build the mighty config window :) | function buildConfigWin (body, head) {
var create = config.create,
fields = config.fields,
configId = config.id,
bodyWrapper = create('div', {id: configId + '_wrapper'});
// Append the style which is our default style plus the user style
head.appendChild(
create(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createConfigWindow() {\n\twindow.createWindow('ConfigWindow', {\n\t\tbackgroundColor: '#303030',\n\t\tparent: 'MainWindow',\n\t\twidth: 1000,\n\t\tshow: false,\n\t\theight: 810,\n\t\ttitle: \"Config\",\n\t\ticon: ICON_GLOBAL_PNG,\n\t\twebPreferences: {\n\t\t\tnodeIntegration: true\n\t\t}\n\t}, {\n\t\tpage... | [
"0.6926272",
"0.64058775",
"0.64029974",
"0.6378057",
"0.6361956",
"0.6309028",
"0.6306353",
"0.63050467",
"0.60936964",
"0.60678303",
"0.60095614",
"0.59626603",
"0.5934602",
"0.59234864",
"0.5920284",
"0.59175664",
"0.5887185",
"0.5846167",
"0.5755145",
"0.5747473",
"0.5742... | 0.6721458 | 1 |
Policy view dialog controller | function DialogViewPolicyController($scope, $mdDialog, $timeout, proxyService) {
// Service
$scope.file = dialogService.getFile();
$scope.linkTo = function(item) {
$mdDialog.hide();
$location.path('/' + item);
};
$scope.hide = function() {
$m... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function userDetailDialogController() { }",
"function wizard_open_dialog_edit_policy(obj)\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\tinit_dialog_error();\r\n\t\t\t\r\n\t\t\t$(\"#list-panel\").dialog(list_search_dialog());\r\n\t\t\t\r\n\t\t\tvar self = $(obj);\r\n\t\t\tvar id = $(obj).attr(\"value\");\r\n\t\t\tdata[\"id... | [
"0.6667276",
"0.64373845",
"0.63723165",
"0.62340707",
"0.60503685",
"0.59590286",
"0.59250695",
"0.57772446",
"0.5765448",
"0.5737011",
"0.57245344",
"0.56805843",
"0.5669181",
"0.56240135",
"0.5616865",
"0.5616542",
"0.5616032",
"0.56032526",
"0.5596653",
"0.5572151",
"0.55... | 0.7046094 | 0 |
Update sentiment in BurndownChart | function updateBurndownSentiment() {
const labels = burndownChart.data.labels;
httpGetAsync('/sentimentdailychart', 'GET', function (result){
const json = JSON.parse(result);
// Update Sentiment Dataset
burndownChart.data.datasets[2].data = parseSentimentData(labels, json);
bur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onSentimentAnalyzed(msg){\n console.log(msg);\n for (var i=app.$data.messages.length-1; i>=0; i--) {\n if (app.$data.messages[i].id === msg.id) {\n app.$data.messages[i].sentiment = msg.sentiment;\n if(msg.sentiment > 0)\n app.$data.messages[i].class = 'la... | [
"0.63758975",
"0.62305677",
"0.6138219",
"0.57882845",
"0.5739963",
"0.57207924",
"0.5581389",
"0.5572603",
"0.5555967",
"0.5516148",
"0.55104107",
"0.55022347",
"0.5493086",
"0.54895514",
"0.54807615",
"0.54767036",
"0.5469098",
"0.5454359",
"0.5431288",
"0.54166657",
"0.540... | 0.8438909 | 0 |
Get n documents of a document class that match the criterias. | function getDocumentsByCriterias(params) {
var deferred = $q.defer();
$http({
method: 'POST',
url: $rootScope.serverEndpoint + 'jsonServices/searchDocuments',
contentType: "application/json; charset=utf-8",
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getCourse() {\n const pageNumber = 3;\n const recordsPerPage = 2;\n const course = await Courses\n // .find({})\n // .find({ price: { $in: [100, 500] } })\n // .find({ price: { $gt: 100, $lt: 400 } })\n // .find({ author: /^abhi/i })\n // .find({ autho... | [
"0.5528506",
"0.5467736",
"0.52855724",
"0.5181513",
"0.5152831",
"0.5082862",
"0.5082578",
"0.50482935",
"0.50227726",
"0.4958428",
"0.4952386",
"0.49277413",
"0.4915362",
"0.49130175",
"0.4889685",
"0.48584765",
"0.48420736",
"0.48272815",
"0.47997898",
"0.4797125",
"0.4787... | 0.5692157 | 0 |
Gets the keys and values for multivalued type. Parses the string if it's "VALUES", or get the values from server for other types. | function getMultivaluedFieldValues(field, isSearch) {
var deferred = $q.defer();
var multivaluedType = field.multivalued.substring(0, field.multivalued.indexOf(':'));
var values = field.multivalued.substring(field.multivalued.indexOf(':') + 1, field.multivalued.length);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getValues(type, values) {\n\tif (type === \"checklist\" || type === \"radio\") {\n\t\tvar valuesArr = values.split(\",\");\n\t} else if (values.indexOf(\"-\") > 0) {\n\t\tvar valuesArr = values.split(\"-\");\n\t} else {\n\t\tvar valuesArr = values.split(\",\");\n\t}\n\n\tfor (var value in valuesArr) {\n\t... | [
"0.57241875",
"0.5717179",
"0.5358412",
"0.5287309",
"0.52424914",
"0.50887966",
"0.506847",
"0.4976739",
"0.49697003",
"0.49580958",
"0.48752066",
"0.48682263",
"0.48521549",
"0.48212627",
"0.47673544",
"0.47673544",
"0.47649357",
"0.47600687",
"0.47436342",
"0.47303873",
"0... | 0.60685235 | 0 |
Macro transform some code | function macroTransform(code) {
var compiledCode = sweet.compile(code, {
modules: getMacros(),
readableNames: true
}).code;
return adRequireStr + compiledCode;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function code (ctx, node) {\n const macro = ctx.code || defaultMacro\n return `${macro(node.value, node.lang, node.meta)}`\n}",
"function transformation (){\r\n }",
"function replaceMacro(str) {\n\t\t\tvar returnVal = str;\n\t\t\tif (returnVal.indexOf('!{') != -1) {\n\t\t\t\ttry {\n\t\t\t\t\tfor (var i = ... | [
"0.65001076",
"0.6302164",
"0.62645483",
"0.61977404",
"0.6013145",
"0.6012601",
"0.60094106",
"0.5992602",
"0.5866435",
"0.58537793",
"0.570157",
"0.56997645",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5645852",
"0.5570672"... | 0.75310564 | 0 |
Macro transform a module before requiring it. Must provide the full, resolved filename of the module. Optionally cache the transformed module code on disk. NOTE: Once cached, it won't be recompiled (unless you macroRequire the same module again with 'cacheOnDisk' set to false). So this isn't like 'make', which will det... | function macroRequire(filename, cacheOnDisk) {
var adfilename = filename + '.ad';
var m = require.cache[adfilename];
if (m !== undefined) {
m = m.exports;
} else {
if (!cacheOnDisk || !fs.existsSync(adfilename)) {
var code = fs.readFileSync(filename);
var compiledCode = macroTransform(code);
fs.writeFi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function fauxRequire(filename) {\n const contents = await fs_1.readFile(filename, \"utf8\");\n const code = stripBOM(contents);\n // Construct the module\n const replacementModule = new Module(filename, this);\n // And initialise it:\n // Ref: https://github.com/nodejs/node/blob/eb6741b15eb... | [
"0.59055173",
"0.58420146",
"0.5611639",
"0.55429155",
"0.5403526",
"0.53807783",
"0.537871",
"0.5370319",
"0.53522575",
"0.52758133",
"0.5255007",
"0.52523035",
"0.52175874",
"0.51750314",
"0.5169925",
"0.5160303",
"0.51549804",
"0.51549804",
"0.51282257",
"0.5090301",
"0.50... | 0.7069714 | 0 |
takes a verifiable presentation and rules, returns all claims which are known to be true under the given set of rules This function is intentionally not exposed publicly. | async function checkSoundness(presentation, rules) {
const ver = await verifyP(presentation);
if (!ver.verified) {
throw ver;
}
// Pre-expand the presentaion using local cache. Tests run pretty slow otherwise.
presentation = await jsonld.expand(presentation, { documentLoader });
return await acceptCompo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showRules(rules) {\n if(rules === 'calendarRules') {\n vm.showCalendarRulesOptions = !vm.showCalendarRulesOptions;\n if ( vm.showCalendarRulesOptions && vm.showHolidayRulesOptions ) {\n vm.showHolidayRulesOptions = false;\n }\n } else if(rules === 'holid... | [
"0.51280785",
"0.50304866",
"0.500789",
"0.49892184",
"0.48846167",
"0.4849906",
"0.4836212",
"0.481448",
"0.48090133",
"0.48059854",
"0.47658652",
"0.47653946",
"0.47535235",
"0.47364962",
"0.47279575",
"0.47201994",
"0.4692986",
"0.4684957",
"0.46747273",
"0.4666267",
"0.46... | 0.60993 | 0 |
to handle third click use removeafterEvent | function removeafterEvent() {
for (var i = 0; i < flipCardInnerArray.length; i++) {
if (flipCardInnerArray[i]) {
flipCardItemArray[i].removeEventListener('click', rotateflipCard)
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _addClickEvents() {\n\t if (FlexTour.currentTour[Constants.END_ON_OVERLAY_CLICK]) {\n\t Utils.getElementsAndAttachEvent(Constants.OVERLAY_STYLE, Constants.FLEX_CLICK, function () {\n\t _exit(false);\n\t });\n\t }\n\n\t Utils.getElementsAndAttachEvent(Constants.BACK_BUTTON... | [
"0.644925",
"0.6401756",
"0.6315741",
"0.6223061",
"0.6177034",
"0.6177034",
"0.615702",
"0.6155966",
"0.6153646",
"0.6149652",
"0.6145052",
"0.6141379",
"0.60961574",
"0.6061519",
"0.6061519",
"0.6061519",
"0.6061519",
"0.6057658",
"0.60539806",
"0.60539806",
"0.6048864",
... | 0.6892362 | 0 |
Attempts to login using Userpass Auth Strategy. | function loginWithUserpass() {
localStorage.setItem("AUTH_STRATEGY", "USERPASS");
const currentUser = {
account: account,
username: username,
password: password,
};
const accountList = JSON.parse(localStorage.getItem("Accounts"));
const servers = JSON.parse(localStorage.getItem("s... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attemptLogin(user) { \r\n \r\n // if password == user.password \r\n // these passwords should not be stored in plain text accessible via db query\r\n if (inputPassword.value == user[0].password) {\r\n // allow access\r\n console.log(\"success\")\r\n // Save data to sessi... | [
"0.6774063",
"0.65066046",
"0.6434969",
"0.6423989",
"0.63706183",
"0.6363883",
"0.6357331",
"0.6323815",
"0.6323788",
"0.63112134",
"0.623597",
"0.6216666",
"0.61870027",
"0.6178126",
"0.6149017",
"0.61459666",
"0.6083464",
"0.60739225",
"0.60726213",
"0.6072173",
"0.6071192... | 0.65534145 | 1 |
Get the socket that corresponds to a cluster ID. | getCluster(id) {
if (ipc.of["cluster-x"]) {
return ipc.of["cluster-x"] || null
} else {
return this.clusters.get(id) || null
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findById(nsp ,id){\n\n let active_sockets = getConnectedSocketsArray(nsp);\n \n for(let i = 0 ; i < active_sockets.length ; ++i){\n if(active_sockets[i].data.id === id) \n return active_sockets[i];\n }\n return;\n }",
"function getSocket(socketId) {\n let socket = io.sockets.co... | [
"0.6597074",
"0.6529729",
"0.64345676",
"0.64345676",
"0.6265199",
"0.6164327",
"0.6039009",
"0.5998489",
"0.5998489",
"0.5969829",
"0.5962715",
"0.5958224",
"0.5850011",
"0.5801291",
"0.5673462",
"0.5673462",
"0.561911",
"0.55325574",
"0.5464413",
"0.5377464",
"0.53482676",
... | 0.6548603 | 1 |
Get given restaurant's reviews from file | function getReviews(restaurant_name) {
// Replace ' with \'
var name = restaurant_name.replace(/'/g, "\'")
return new Promise((resolve, reject) => {
// Do line by line checking on businesses
business_stream.on("data", data => {
// stash data read into string buffer
buf += data.toString()
// then proce... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static fetchReviewsByRestaurant(id) {\r\n return fetch(DBHelper.REVIEWS_PATH + '/?restaurant_id=' + id)\r\n .then(function(response) {\r\n if(!response.ok)\r\n throw Error(response.statusText);\r\n return response.json();\r\n })\r\n .then(function(reviews) {\r\n Inde... | [
"0.6449135",
"0.6166617",
"0.61203754",
"0.61136025",
"0.6105939",
"0.60305744",
"0.5950805",
"0.59453714",
"0.59281766",
"0.5911361",
"0.58784026",
"0.58542836",
"0.5802323",
"0.57969165",
"0.5793341",
"0.57732695",
"0.57343286",
"0.5726106",
"0.5708526",
"0.5703462",
"0.570... | 0.68303585 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.