query stringlengths 9 34k | document stringlengths 8 5.39M | negatives listlengths 19 20 | metadata dict |
|---|---|---|---|
Creates an empty Stack. | function Stack() {
this.list = new LinkedList_1.default();
} | [
"createNewStack() {\n let stack = new Stack();\n this._stacks.push(stack);\n this._registers.push(null);\n this._callbackUpdateStack(\"register\", \"push\", null);\n this._updateStackGUI();\n return stack;\n }",
"function emptyStack(stack) {\n while(stack.length > 0) { stack.pop(); }\n st... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Helper fucntion to tell if APL is supported. | function hasAPLSupport(event) {
if (
hasIn(event, [
"context",
"System",
"device",
"supportedInterfaces",
"Alexa.Presentation.APL"
])
) return true;
else return false;
} | [
"static isPakoAvailable(){\n var isIt = true;\n\n try{\n pako;\n }catch(e){\n console.warn(e);\n isIt = false;\n }\n\n return isIt;\n }",
"async function checkOffersEnabled(ln) {\n const conf = await ln._listconfigs()\n return conf['experimental-offers'] && !/(^v?|-v)0\\.(9\\.|10\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Configure a single axe. | function configureOneAxe(axisName, inputChartDef, c3Axes) {
var axisMap = inputChartDef.axisMap;
if (!axisMap) {
return;
}
var series = axisMap[axisName];
if (!series) {
return;
}
for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {
var seriesCo... | [
"function configureOneAxe(axisName, inputChartDef, c3Axes) {\n var axisMap = inputChartDef.axisMap;\n if (!axisMap) {\n return;\n }\n var series = axisMap[axisName];\n if (!series) {\n return;\n }\n for (var _i = 0, series_1 = series; _i < series_1.length; _i++) {\n var ser... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get the total kills or deaths for a team type is a string either kills or deaths to denote which stat we get | function getTotalKD(match, teamId, type) {
var participants = match['participants'];
var total = 0;
for(i = 0; i < participants.length; i++) {
if(participants[i]['teamId'] == teamId) {
total += participants[i]['stats'][type]
}
}
if(total == 0) { // just so we don't break
total++;
}
retur... | [
"function stats(team) {\n\n if (team == 'offense'){\n\n return \"Offense:\" + \" \" +\n \"Points: \" + \"\" + offense.points + \" \" +\n \"Turnovers: \" + \"\" + offense.turnovers + \" \" +\n \"Shots Made: \" + \" \" + offense.shotsMade + \" \" +\n \"Shots Missed: \" + \" \" + offense.shotsMissed;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Assigns a CollectionEventType and converts annotations to Annotation objects. | setCollectionEventType(collectionEventType) {
this.collectionEventTypeId = collectionEventType.id;
this.collectionEventType = collectionEventType;
this.setAnnotationTypes(collectionEventType.annotationTypes);
} | [
"function CollectionDto(obj) {\n var self = this;\n\n obj = obj || {};\n\n obj.collectionEventAnnotationTypes = _.map(\n obj.collectionEventAnnotationTypes,\n function (serverAt) {\n return new CollectionEventAnnotationType(serverAt);\n });\n obj.specimenGroups = _.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
A function for rendering the list of Raffles to the page | function renderRaffleList(rows) {
raffleList
.children()
.not(":last")
.remove();
raffleContainer.children(".alert").remove();
if (rows.length) {
console.log(rows);
raffleList.prepend(rows);
} else {
renderEmpty();
}
} | [
"function getRaffles() {\n $.get(\"/api/raffles\", function(data) {\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createRaffleRow(data[i]));\n }\n renderRaffleList(rowsToAdd);\n nameInput.val(\"\");\n });\n }",
"function renderResultsList()... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
takes an array of driver JavaScript objects as the first argument and a string called revenue as the second argument, and returns an array of driver objects that have a revenue attribute that's greater than the passedin revenue argument solution 1 refactored | function driversWithRevenueOver(array, revenue) {
return array.filter(driver => driver.revenue > revenue)
} | [
"function driversWithRevenueOver(driver_array, revenue) {\n return driver_array.filter(function (driver) {\n return driver.revenue > revenue;\n })\n}",
"function driversWithRevenueOver(drivers, revenue){\n return drivers.filter(function(driver){\n return driver.revenue > revenue;\n });\n }",
"funct... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Function to Compute the Winner | function computeWinner(){
let winner;
if(P1.score <= 21){
if(P1.score > P2.score || P2.score>21){
blackjackGame.win++;
winner = P1;
}else if(P1.score < P2.score){
blackjackGame.loss++;
winner = P2;
}else if(P1.score === P2.score){
... | [
"function computeWinner() {\n let winner;\n if (YOU[\"score\"] <= 21) {\n if (YOU[\"score\"] > DEALER[\"score\"] || DEALER[\"score\"] > 21) {\n winner = YOU;\n blackjackDatabase[\"result\"][\"win\"]++;\n }\n }\n if (YOU[\"score\"] < DEALER[\"score\"] || YOU[\"score\"] > 21) {\n if (DEALER[\"s... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Connect to the given hostname using the specified credentials | async connect({ state, commit, dispatch }, { hostname = location.host, username = defaultUsername, password = defaultPassword } = {}) {
if (!hostname || hostname === defaultMachine) {
throw new Error('Invalid hostname');
}
if (state.machines.hasOwnProperty(hostname)) {
throw new Error(`Host ${hostname}... | [
"connect() {\n if(!this.username || !this.password) {\n return;\n }\n slsk.connect({\n user: this.username,\n pass: this.password,\n }, (err, client) => this.onConnected(err, client));\n }",
"function IRC_client_connect(hostname,nick,username,realname,port,password) {\n\tvar sock;\n\n\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Toggle the editing state of the message. | toggleEdit() {
if (this.isEditingOpen()) {
return this.isEditingOpen(false);
}
this.newText(this.message());
return this.isEditingOpen(true);
} | [
"function toggleEdit() {\n isBeingEdited ? setIsBeingEdited(false) : setIsBeingEdited(true);\n }",
"toggleEdit() {\n this.editing = !this.editing;\n }",
"function toggleEdit() { setEditing(edit => !edit) }",
"toggleEditingMode() {\n console.log(\"[bio-editor.js] INSIDE TOGGLE EDITOR\");\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends weights to all peers, waits to receive weights from all peers and then averages peers' weights into the model. | async function onEpochEnd_Sync(model, epoch, receivers, recv_buffer) {
const serialized_weights = await serializeWeights(model)
const epoch_weights = {epoch : epoch, weights : serialized_weights}
for (var i in receivers) {
console.log("Sending weights to: ", receivers[i])
await send_data(epoc... | [
"updateWeights() {\n _.forEach(this.incoming, connection => connection.update())\n }",
"updateWeights() {\n const w = _.clone(this.weights);\n\n for (let i = 0; i < w.length; i++) {\n w[i] += this.deltas[i];\n }\n\n this.network.getFlat().decodeNetwork(w);\n }",
"_m... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Get order of layers TODO: Order Onchange we will send this info back to server via ajax | function getorder(){
var i = 0;
var layerarray = [];
$(".layer").each(function(){
layerarray[i] = $(this).find('img').attr('src');
i++;
});
var lst = "";
for(j=0; j< layerarray.length; j++){
lst += j + ": " + layerarray[j] + " ; ";
}
alert(lst);
} | [
"function getLayerOrder() {\n var layerNodes = rootNode.querySelectorAll(\".draggable\"),\n rasterLayers = rootNode.querySelectorAll(\"select\"),\n order = [];\n\n for (var i=0; layerNodes.length > i; i++) {\n order.push( layers[ layerNodes[i].getAttribute(\"data-id\") ] ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
NB: defaultPort only knows http and https. Returns undefined otherwise. | function defaultPort (protocol) {
return { 'http:': 80, 'https:': 443 }[protocol]
} | [
"function defaultPort(protocol) {\n return { 'http:': 80, 'https:': 443 }[protocol]\n }",
"function defaultPort(protocol) {\n return {'http:':80, 'https:':443}[protocol];\n }",
"_defaultPortOrNull() {\n return !this.scheme ? null : Global.DefaultSchemePort(this.sche... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Compare parent and child playlists and add the child to the parent | function addChildtoParentPlaylist(parentPlaylist, childPlaylist){
// console.log("parentPlaylist: "+parentPlaylist);
// console.log("childPlaylist: "+childPlaylist);
// Get a Parent Object
getUserPlaylistSongs(parentPlaylist);
// Wait a second for the function to finish getting the Parent and then get the ... | [
"moveIn(){\n\t\t//item above it becomes parent\n\t\tlet index = this.parent.allMyChildren.findIndex(x => x.id == this.id)\n\t\t//check index not negative\n\t\tif (index !== 0 && this.parent.allMyChildren[index-1].type == \"Suite\"){\n\t\t\tlet newParent = this.parent.allMyChildren[index-1]\n\t\t\tlet me = this.pare... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read the text out loud to let the talkers know that a text has been sent... | function readOutLoud() {
var speech = new SpeechSynthesisUtterance();
var message = "Alert, alert! A notification has been sent informing O Prior that her name came up in conversation! Alert, alert! A notification has been sent informing O Prior that her name came up in conversation.";
// Set the text and voice ... | [
"function read(txt){\n\t\n //this part is going to be sweet because I have to separate the txt string into chunks of 100 chars in order for the google tts service\n //to provide me with texts longer than 100 chars translated to voice.\n play_sound(\"http://translate.google.com/translate_tts?ie=UTF-8&q=\"+encod... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns the property value for the given attribute value. Called via the `attributeChangedCallback` and uses the property's `converter` or `converter.fromAttribute` property option. | static _propertyValueFromAttribute(value,options){const type=options.type;const converter=options.converter||defaultConverter;const fromAttribute=typeof converter==='function'?converter:converter.fromAttribute;return fromAttribute?fromAttribute(value,type):value;} | [
"function getPropValue(attribute) {\n return extractValue(attribute, _values2.default);\n}",
"static _propertyValueFromAttribute(value, options) {\n var type = options.type;\n var converter = options.converter || defaultConverter;\n var fromAttribute = typeof converter === 'function' ? converter :... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
register a new covered area in a city | registerArea(newArea) {
return this.findOneAndUpdate(
{ _id: newArea.city },
{
$push: {
areas: newArea,
},
}
);
} | [
"async addArea() {\n const area = this.ctx.request.body;\n\n // area exists\n if (!await this.service.areas.insert(area)) {\n this.ctx.body = this.service.util.generateResponse(400, 'area exists');\n return;\n }\n\n this.ctx.body =... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
load data into icon image gallery | function loadIconImages(data) {
var gallery_container = d3.select('.map-gallery');
// clean previous elements
gallery_container.selectAll("*").remove();
// append div for origin icon image
var icon_origin = gallery_container.selectAll('.origin-icon').data(originImage)
.enter().append('div').attr('class', 'ori... | [
"function loadImageData() {\n // loads through each link/file in manifest\n for (let data_id in manifest_images) {\n let file_name = manifest_images[data_id]; // e.g. \"1540-2.json\" or \"1540@https://i.imgur.com/2p3NEQB.png\"\n // if there is an \"@\" in the name (i.e. if from the world wide web)\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the next item using the `dom_filter' function and select it by adding the class `marker_class' to it. When the last item is reached, the behavior is controlled by the hackernews_end_behavior variable. | function hackernews_next_item (I, dom_filter, marker_class, next_item_test) {
var doc = I.buffer.document;
var items = dom_filter(I);
var sel_items = items.filter(function (p) { return (p.className.indexOf(marker_class) >= 0); });
var current = sel_items.length ? sel_items[0] : null;
var current_i... | [
"function hackernews_prev_item (I, dom_filter, marker_class, prev_item_test) {\n var items = dom_filter(I);\n var sel_items = items.filter(function (p) { return (p.className.indexOf(marker_class) >= 0); });\n var current = sel_items.length ? sel_items[0] : null;\n var current_i = current ? items.index... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert Token to Wild Card Token. | getWildCardToken(currentToken) {
var wildCardToken;
if (!currentToken.endsWith("*")) {
wildCardToken = currentToken + "*";
}
return wildCardToken;
} | [
"static decodeToken(token){\n \n const decodedToken = decode(token);\n return decodedToken;\n }",
"convertToToken() {\n return TokenModel.toJson({\n id: this.tokenId,\n isPrivacy: true,\n name: this.name,\n symbol: this.pSymbol,\n isInit: false,\n // listTxs,\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Forwards focus to a thumbnail when tabbing. | onFocus_() {
// Ignore focus triggered by mouse to allow the focus to go straight to the
// thumbnail being clicked.
const focusOutlineManager = FocusOutlineManager.forDocument(document);
if (!focusOutlineManager.visible) {
return;
}
// Change focus to the thumbnail of the active page.
... | [
"function thumbnailFocus(e) {\n const thumbFront = document.querySelector('.thumb-front');\n thumbFront.focus();\n}",
"setHighlightedThumbnail(thumbnail) {\n this.setState({\n focusThumbnail: thumbnail,\n });\n }",
"function focus(img){\r\n\t\t// set image as current...\r\n\t\t// XXX\r\n\t\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns removed lines in the string returned by GitHub API | function getRemovedLines(string){
var allChangedLinesRegex = /\@\n(.*\n)*/g; // Matches each line ends with a "@" and followed by anything
var allChangedLinesArray = string.match(allChangedLinesRegex);
var allChangedLines = allChangedLinesArray[0]; // There is only one item in the array (that is a string)
var added... | [
"function parseTextFileLinesFromGitHub(sourcePageUrl) {\n const codeLineRegexPattern = 'class=\"blob-code blob-code-inner js-file-line\">(.*?)</td>';\n const codeLineTDRegex = new RegExp(codeLineRegexPattern, 'g');\n const codeLineRegex = new RegExp(codeLineRegexPattern);\n\n\n\n return ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Adds all available events to the webhook. | addAllEvents() {
this.webhook.events = [].concat(this.events);
} | [
"generateEvents() {\n\t\tconst promises = defaultEvents.events.map((event) => {\n\t\t\treturn request.post('https://forgetful-elephant.herokuapp.com/events')\n\t\t\t\t.send(event)\n\t\t\t\t.then((res) => {\n\t\t\t\t\treturn res;\n\t\t\t\t})\n\t\t\t\t.catch((res) => {\n\t\t\t\t\treturn res;\n\t\t\t\t\tthis.setState(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Sends an API request over the websocket connection. | async sendApiRequest(request) {
while (this.socket.readyState === rippled_web_socket_schema_1.WebSocketReadyState.Connecting) {
await sleep(5);
}
if (this.socket.readyState !== rippled_web_socket_schema_1.WebSocketReadyState.Open) {
throw new shared_1.XrpError(shared_1.Xr... | [
"function twitch_subscribe_to_webhook(json_to_send) {\n let xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 202) {\n console.log(\"202 request passed!\");\n console.log(xmlHttp.responseText);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that moves the display to the next state of calculation draws another svg with the next possible lego states | function nextState(){
for (var i = 3; i<=91; i++){
$("#MathJax-Span-"+i).css("color","black");
}
var points = model.get_current_state_array();
var pointdict = model.get_current_state();
var numpoints = points.length;
... | [
"function generate_next_states() {\n console.log(myInputJSObject.results);\n console.log(myInputJSObject.request.get('numRelTime'));\n console.log(myInputJSObject.results.get('selectedTimePoint'));\n // Prevent user from exploring next state beyond allowed time points\n if (myInpu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
navigate to a new view/page by changing href | navigateTo(pageId) {
window.location.href = `#${pageId}`;
} | [
"function goToHref(href) {\n window.location.href = href;\n}",
"static goto(path){\n history.pushState(null, null, path);\n this.instance.setPath(path);\n this.instance.mainInstance.render();\n }",
"function clickSwitchPage(e) {\n data.currentView = $(e.currentTarget).attr('data-... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Convert a URL object into a RequestOptions object. Copied from Node's internals (where it's used in http(s).request() and http(s).get()), modified only to use the RequestOptions type above. See | function urlToOptions(url) {
var options = {
protocol: url.protocol,
hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ? url.hostname.slice(1, -1) : url.hostname,
hash: url.hash,
search: url.search,
pathname: url.pathname,
path: "" + (url.path... | [
"function urlToOptions(url) {\n const options = {\n serviceName: url.serviceName,\n conn: url.conn,\n protocol: url.protocol,\n hostname: typeof url.hostname === 'string' && url.hostname.startsWith('[') ?\n url.hostname.slice(1, -1) :\n url.hostname,\n hash: url.hash,\n headers: url.hea... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create button based on type, spec, and parent size | createButton(buttonSpec) {
let newButton;
switch (buttonSpec.type) {
case 'simple':
newButton = new Button(buttonSpec, false, this, this.box, this.box.widthPix, this.box.heightPix);
break;
case 'safety':
newButton = new SafetyButton... | [
"generateButton(width, title, bid, icon, color=\"#333333\") {\n const button = Ti.UI.createView({...style.viewStyle, width: width});\n button.add(Ti.UI.createLabel({...style.labelStyle, text: title, color: color}));\n button.add(Ti.UI.createButton({...style.iconStyle, title: icon, bid: bid, color: color... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reproduce una sola vez el audio cargado previamente con el nombre indicado. El AudioContext debe estar activado para poder reproducir un audio. | playSound(name) {
// Comprobamos los errores que puedan surgir
if (!this.context) {
throw new Error("El AudioContext no ha sido activado todavía.");
}
if (!this.buffers.has(name.toLowerCase())) {
throw new Error("No se ha cargado ningún sonido con el nombre \"" + ... | [
"function setupAudioContext() {\n domElements.audio = document.querySelector(\"audio\");\n domElements.audio.src = `media/${audioOptions.track}`;\n domElements.audioControls = document.querySelector(\".audio-controls\");\n\n let wasPaused = false;\n domElements.audioControls.onmou... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get nonnormalized pmf and return normalized cmf pmf: probability mass function cmf: cumulative mass function | function normalize(massfunc) {
// calculate the sum of numbers in pmf to normalize it
let pmf = Object.assign({}, massfunc); // javascript uses call by sharing for object arguments, so copy object using Object.assign
let sum = 0;
for (let i in pmf) {
sum += pmf[i];
}
... | [
"calcularMCC() {\n var TP = this.darTP;\n var TN = this.darTN;\n var FP = this.darFP;\n var FN = this.darFN;\n return (((TP * TN) - (FP * FN)) / (Math.sqrt((TP + FP) * (TP + FN) * (TN + FP) * (TN + FN))))\n }",
"getMolarMass() {\n let MM = 0;\n let farr = this.g... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
WoDUiGemDropDownSelected: End / WoDUiGemDropDownImage: Begin | function WoDUiGemDropDownImage() {
WodUiWidget.call(this, 'div')
this.setClass('gemselect arrowicon');
this.appendChild(new WodUiImage('dropdown.gif',16,20,''));
} | [
"function WoDUiGemDropDownSelected() {\n WodUiWidget.call(this, 'div')\n this.setClass('gemselect selected')\n}",
"function WoDUiGemDropDown( socketLabel, isInline ) {\n\n WodUiWidget.call(this, 'div')\n\n this.selectedIndex = 0;\n this.click = false;\n this.socketLabel = socketLabel\n\n this... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
MakeConstraintList: used to find invalid corner combinations | function MakeConstraintList (iRuleNum, iNumCorners)
{
var constraintCornerList = [];
// opposite corner constraint
if (iRuleNum == 3 || iRuleNum == 6)
{
for (var i = Math.round (iNumCorners / 2); i < iNumCorners; i++)
constraintCornerList.push (i);
for (var i = 0; i < Math.... | [
"function CheckConstraint (iRuleNum, iConstraintCornerList, iCurrCornerNum, iPrevCornerList)\n{\n // The return value (or retValue) is true for the selected point is valid according to\n // the selected constraint; or false for the selected point is not valid since it\n // violates some type of constraint\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Production AssignmentStatement ::== Id = Expr | function parse_AssignmentStatement() {
tree.addNode('AssignmentStatement', 'branch');
parse_ID();
//tree.endChildren();
match('=', parseCounter);
parseCounter++;
parse_Expr();
//tree.endChildren();
tree.endChildren();
} | [
"function parseAssignmentStatement() {\n CST.addBranchNode(\"AssignmentStatement\");\n parseID();\n if (match([\"T_assign\"], false, false)) {\n parseExpr();\n log(\"Assignment Statement\");\n }\n else {\n errorlog(\"Parse Error - Expected = to assign ID to something, got \" + to... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Reads a fixed number of bytes from the stream. | static async readFixedBytes(stream, length, options = {}) {
const bytes = await stream.read(length, { abortSignal: options.abortSignal });
if (bytes.length !== length) {
throw new Error("Hit stream end.");
}
return bytes;
} | [
"read (bytes) {\n let bytes_ = parseInt(bytes)\n if (isNaN(bytes_)) {\n throw new Error(`Unexpected argument of type ${typeof bytes}, required unsigned integer`)\n }\n let padding = 0\n if (bytes_ > this._length) {\n padding = bytes_ - this._length\n bytes_ = this._length\n }\n l... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
OpenSaferpayWindowJScript(strUrl) this function provides the open window functionality for using form javascript | function OpenSaferpayWindowJScript(strUrl)
{
window.onerror = DoNothing;
//add the standalone attribute to deliver the window state to the server
if(strUrl.indexOf("WINDOWMODE=Standalone") == -1) strUrl += "&WINDOWMODE=Standalone";
w = window.open(
strUrl,
'SaferpayTerminal',
'scrollba... | [
"function OpenSaferpayTerminalWindow() \r\n\t{\r\n\t\twindow.onerror = DoNothing;\r\n\r\n\t\t//reset the url for the next click\r\n\t\tif(strMode == \"LINK\") objRef.href = strUrl;\r\n\t\telse if(strMode == \"FORM\") objRef.action = strUrl;\r\n\t\t\r\n\t\t//add the standalone attribute to deliver the window state ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Selects an initial video file to be played before the interactive Loom | function open()
{
GC.initial_video_path = dialog.showOpenDialog({ properties: ['openFile', 'multiSelections'] });
} | [
"playFirstVideo() {\n this.currentPos_ = 0;\n this.reloadCurrentVideo_(this.onFirstVideoReady_.bind(this));\n }",
"function selectionChange(){\n var selected = document.getElementById(\"trackSelect\").value;\n document.getElementById(\"aud-source\").setAttribute(\"src\", \"./mp3/\"+selected);\n document... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
starts the second player's game if the first player has finished | function startGame2(){
if(!gameStarted){
timeRemaining = 15;
startGame1 = false;
gameStarted = true;
$scoreP2.text(0);
timeUp = false;
p2Score = 0;
highlight();
countdown();
findWinner();
}
} | [
"_playerTwoInitiate () {\n this._choosenPlayer = 'Luigi'\n this._startGame()\n }",
"function startGame (player1, player2) {\n const newGame = new Game(io, player1.gameInfo.room, [player1, player2], endCB);\n\n newGame.start();\n\n activeGames.push(newGame);\n}",
"function startGame() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
date_created computed: true, optional: false, required: false | get dateCreated() {
return this.getStringAttribute('date_created');
} | [
"date_created()\n\t{\n\t\treturn `${this.month}-${this.date}-${this.year}`;\n\t}",
"get createDate() {\n return this.getStringAttribute('create_date');\n }",
"get created() {\n return this.get('created').toISOString()\n }",
"function createdAt(date) {}",
"get createdDate() {\n return th... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Converts string to real DOM | function stringToDom (string) {
const template = document.createElement('template');
template.innerHTML = string.trim();
return template.content.firstChild;
} | [
"function connversionStringtoDOM(string){\n let div = document.createElement(\"div\");\n div.innerHTML = string;\n return div.firstElementChild;\n}",
"stringToDomNode(string){\n let wrapper= document.createElement('div');\n wrapper.innerHTML= string;\n return wrapper.firstChild; \... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Normalizes the cherry picking object to always be an object with `pick` and `omit` properties | function normalizeCherryPickObject(fields) {
if (Array.isArray(fields)) {
return {
pick: fields,
omit: [],
};
}
return {
pick: fields.pick,
omit: fields.omit,
};
} | [
"function $pick(obj, picked){\n\treturn ($type(obj)) ? obj : picked;\n}",
"function cherryPickStructure(structure, include) {\n var cherry = copyResourceObj(structure);\n\n pickRelationships(structure.relationships, include, cherry);\n\n return cherry;\n}",
"function cloneHelperOptions(options) {\n var ret ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Test to see if this is new chrome after or equal to 20. | function isNewChrome() {
var regExp = new RegExp("Chrome/[23][0-9]\.", "i");
var test = navigator.userAgent.match(regExp);
return test && hasChrome();
} | [
"function isOldChrome() {\n var regExp = new RegExp(\"Chrome/1.\\.\", \"i\");\n var test = navigator.userAgent.match(regExp);\n\n return test && hasChrome();\n}",
"Chrome ():boolean {\n\n\t\treturn this.chrome = this.agent.match(/Chrome/i) ? true : false;\n\t}",
"function isChromium() {\n // Bas... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The Atom's Particles' States' translaction movements around the Atom's Nucleus | function particles_translaction_movements() {
// Creating the quarternion for the Atom's State #1
var quaternion_for_atom_state_1 = new THREE.Quaternion();
// Setting and applying the quarternion's Y Axis for the Atom's State #1
quaternion_for_atom_state_1.setFromAxisAngle( y_axis, ( motions_factor * ... | [
"function particles_translaction_movements() {\n\n // Creating the quarternion for the Electron's Ground State\n var quaternion_for_electron_ground_state = new THREE.Quaternion();\n\n // Setting and applying the quarternion's Y Axis for the Electron's Ground State\n quaternion_for_electron_ground_state.... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Calculate max possible position in utf8 buffer, that will not break sequence. If that's not possible (very small limits) return max size as is. buf[] utf8 bytes array max length limit (mandatory); | function utf8border(buf, max) {
var pos;
max = max || buf.length;
if (max > buf.length) { max = buf.length; }
// go back from last position, until start of sequence found
pos = max - 1;
while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }
// Very small and broken sequence,
... | [
"function utf8border(buf, max) {\n var pos;\n\n max = max || buf.length;\n if (max > buf.length) { max = buf.length; }\n\n // go back from last position, until start of sequence found\n pos = max - 1;\n while (pos >= 0 && (buf[pos] & 0xC0) === 0x80) { pos--; }\n\n // Fuckup - very small and broken sequence,\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
for each virus within a certain distance, there is a chance that the cell will become infected through infect() method | checkVirus() {
var {x, y} = this.pos;
agents.filter(a => a instanceof Virus).forEach(v => {
if(getDistance(x,v.pos.x,y,v.pos.y) < options.infectionDistance && !this.isInfected) {
if(Math.random() < options.infectionProbability) {
this.i... | [
"checkVirus() {\n var {x, y} = this.pos;\n agents.filter(a => a instanceof Virus).forEach(v => {\n var dist = getDistance(x,v.pos.x,y,v.pos.y);\n if(dist < options.followDistance) {\n this.angle = getFollowAngle(x,v.pos.x,y,v.pos.y);\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
closes the import box | function importCloseHandler(obj)
{
const importDiv = $("#import-div");
importDiv.remove();
} | [
"function cancelImport() {\n var thisImportDialog = this;\n thisImportDialog.hide();\n gOverlay.hide();\n}",
"onOldstyleImportClose() {\n const modal = document.querySelector(\".oldstyle-import\")\n\n modal.classList.add(\"hidden\")\n }",
"function hideImporter() {\n\t\tdocument.getEle... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Main function. Parse command line arguments. Call library code `extract` funciton. | function main() {
console.log('Abacus Language Extraction Tool.');
console.log('Convert CSV containing languages into separate JSON files.');
DU.displayTag();
if(ops.version){
process.exit();
}
if(!ops.repoPath){
console.error('Missing argument: --repoPath');
ops.printHelp();
process.exit(-2);
}
if(!... | [
"function main() {\n\tvar config, argv = parseArgs(process.argv.slice(2), { boolean: true });\n\tif (argv && argv.o) {\n\t\tconfig = {\n\t\t\toutputDir: argv.o,\n\t\t\tdryRun: argv.dryrun,\n\t\t\tsubDirs: argv.subdirs,\n\t\t\tmboxFile: argv._[0]\n\t\t};\n\t\textractor.extract(config);\n\t} else {\n\t\tconsole.log(U... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Comment on user profile | function commentOnProfile(steamID, message, isError, callback) {
// Check if bot should add comments
if (Config.options.failureReply && Config.options.successReply) {
// Check if message is an error and adding error comments is disabled
if (isError && !Config.options.failureReply) {
... | [
"addComment(profileId, comment){\n console.log(profileId, comment)\n check(profileId, String);\n check(comment, String);\n if(!Meteor.user())\n throw new Meteor.Error(403, \"Could not comment on profile\");\n Comment.insert({\n receiver:profileId,\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Create Paginator object from API json | static fromJson(json) {
return new Paginator(json.nbHits, json.nbPages, json.page);
} | [
"function getPagination(objectResponse, currPage, url, limit) {\n\n const totalPage = Math.ceil(parseInt(objectResponse.count) / limit);\n\n objectResponse = JSON.stringify(objectResponse);\n objectResponse = JSON.parse(objectResponse);\n\n objectResponse.next = currPage == totalPage ? null : `${url}/?page=${cu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Given a location with at least `lat` and `lng`, compute its `octant` and its first `x`, `y`, `max`; then set `levels` to an empty array. | function computeOctant(location) {
if (location.lat > 0) {
if (location.lng < -90) {
location.octant = 0;
} else if (location.lng < 0) {
location.octant = 1;
} else if (location.lng < 90) {
location.octant = 2;
} else {
location.octant = 3;
}
} else {
if (location.lng < -90) {
location.oc... | [
"function computeLatLng(location) {\n\tvar l = location.levels.length;\n\tvar x = location.x;\n\tvar y = location.y;\n\t\n\tfor (var i=l-1; i>=0; i--) {\n\t\tvar level = +location.levels[i];\n\t\tif (level === 1) {\n\t\t\tx /= 2;\n\t\t\ty = y/2 + 0.5;\n\t\t} else if (level === 2) {\n\t\t\tx /= 2;\n\t\t\ty /= 2;\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function to update the header value like points, lives, next time interval etc | function headerUpdater(){
var timer = setInterval(() => {
$("#nextDevil").text(GMvariables.interval/1000);
$("#score").text(GMvariables.points);
$("#live").text(GMvariables.live);
if(GMvariables.live<1){
$("#timer").show();
$("#timer").text("Score = " + GMvari... | [
"function updateHeaders() {\r\n document.querySelector('h3 span').innerText = gGame.secsPassed;\r\n document.querySelector('.lives span').innerText = gGame.lives;\r\n document.querySelector('.safe-amount').innerText = gSaveMe;\r\n}",
"update(header){\n let s = header.split(',');\n let now = Date.no... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
builds the modal and handles the logic for renaming media objects returns a promise from the $q library | function renameMedia(photoToBeRenamed, allPhotos) {
return $q(function(resolve, reject) {
var modalData = {
photoToBeRenamed: photoToBeRenamed,
allPhotos: allPhotos
};
ModalBuilderFct.buildComplexModal(
"md",
WizioConfig.uploadViews.modals.renameMedi... | [
"static onClickRenameMedia() {\n let $element = $('.context-menu-target'); \n let id = $element.data('id');\n let name = $element.data('name');\n\n let modal = UI.messageModal(\n 'Rename ' + name,\n new HashBrown.Views.Widgets.Input({\n type: 'text',\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
initLockScreen() Start lockscreen events | function initLockScreen() {
passwordInputBox.keypress(function(e){
if (e.charCode === os.enterKeyCode) {
testLogin();
}
});
} | [
"function lockScreen() {}",
"function _lockDeviceScreen() {\n\n\tcloseModuleDrawer();\n\n\tlockScreen.removeClass(\"lockscreenopened hidden\"); // Show the lockscreen\n\tpasswordInputBox.focus(); // Focus on password box\n\n\tupdateLockScreenTime(); // Start updating time again\n}",
"function lockScreen() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cambia el estado de la variable bloquearCamposFormFertilizante | cambiarBloquearCamposFormFertilizante(state, nuevoEstado) {
state.bloquearCamposFormFertilizante = nuevoEstado
} | [
"function limpiarCamposSuscripcion() {\n formSuscripcion.nombre.value = \"\";\n formSuscripcion.email.value = \"\";\n formSuscripcion.password.value = \"\";\n formSuscripcion.password2.value = \"\";\n formSuscripcion.checkboxPremium_0.checked = false;\n}",
"function limparUltimosCampos(tipo){\r\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Determine whether the given properties match those of a `CfnDistributionProps` | function CfnDistributionPropsValidator(properties) {
if (!cdk.canInspect(properties)) {
return cdk.VALIDATION_SUCCESS;
}
const errors = new cdk.ValidationResults();
errors.collect(cdk.propertyValidator('distributionConfig', cdk.requiredValidator)(properties.distributionConfig));
errors.colle... | [
"function CfnDistributionPropsValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received:... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Prints the table name to the console | printTableNameinConsole() {
console.log(this.name);
} | [
"function consoleTable(table) {\n\t console.table(table);\n\t}",
"function displayTable() {\n // select table data to send to CLI\n let query = \"SELECT * FROM allemployees;\";\n connection.query(query, function(err, res) {\n if (err) console.log(err);\n // Sent stringified results to the CLI after a co... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Foreach reel, load texture atlas to create the reels spinning animation | loadTextureAtlas() {
for (let i = 1; i < constants.NUM_OF_REELS + 1; i++) {
this.load.multiatlas(
`reel${i}`,
`texture_atlas/reel${i}/frames.json`,
`texture_atlas/reel${i}`
);
}
} | [
"RebuildTextures() {}",
"function spin_reels() {\n $('#keyframes').empty();\n $('.reel, #results *').removeClass('active');\n\n var reel_params = get_reel_params();\n\n $('#keyframes').append(keyframe_rule('reel-1-spin', reel_params[0]),\n keyframe_rule('reel-2-spin', reel_pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
add animation class to h1Content | function h1ContentAnimation() {
h1Content.classList.add('heading-content-animation')
} | [
"function h2ContentAnimation() {\n h2Content.classList.add('heading-content-animation')\n}",
"function addClassToTitle(){\n document.querySelector('h1').classList.add(\"myHeading\")\n }",
"function animationLogo() {\n logo.classList.add('logo-animate');\n}",
"function addClass() {\n heading.cl... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Displays the HTML content for a specific faction | function displayFactionContent(factionName) {
var faction = Factions[factionName];
document.getElementById("faction-name").innerHTML = factionName;
document.getElementById("faction-info").innerHTML = "<i>" + faction.info + "</i>";
var repGain = faction.getFavorGain();
if (repGain.length != 2) {repGain ... | [
"function displayFactionContent(factionName) {\n\tvar faction = Factions[factionName];\n document.getElementById(\"faction-name\").innerHTML = factionName;\n document.getElementById(\"faction-info\").innerHTML = \"<i>\" + faction.info + \"</i>\";\n var repGain = faction.getFavorGain();\n if (repGain.len... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function declaration helloCat accepting a callback | function helloCat(callbackFunc) {
return 'Hello ' + callbackFunc(3);
} | [
"function helloCat(callbackFuncy) {\n return \"Hello \" + callbackFuncy(2);\n }",
"function helloCat(callbackFunc) {\n return \"Hello \" + callbackFunc(7);\n }",
"function helloCat(callbackFunc) {\n return \"Hello \" + callbackFunc(3);\n}",
"function greetings(callback) {\n callback();\n}",
"fun... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
fillTheTradeDetailsOfCurrentSeller : Fill the Trade details of current seller in the Table | function fillTheTradeDetailsOfCurrentSeller(tradeRecords, Requested_Trade_Status, currentUser, currentUserType) {
var shipmentDetailsTable = document.getElementById("Seller_Page_Trade_Details");
for (var i = 0, currentRowIndex = 0; i < tradeRecords.length - 1; i++) {
responseSingleObject ... | [
"function addTrader(traderInfo) {\n \"use strict\";\n let traders = $(\".traders\");\n let trader = $(`<li class=\"trader\"></li>`);\n let name = $(`<h3 class=\"trader-name\">${traderInfo.title}</h3>`);\n trader.append(name);\n\n let description = $(`<p class=\"trader-description\"></p>`);\n de... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
check if dimensions of image allow sending to api & showing results depends on minWidthOfImageForDisplayBottomOffersWrapper & minHeightOfImageForDisplayBottomOffersWrapper parameters | function checkImageDimensions(image){if(test)console.log(image.src+" ; state:"+image.complete+":n w h:"+image.naturalWidth+" "+image.naturalHeight+";w h:"+image.clientWidth+" "+image.clientHeight);if(image.clientWidth>0){if(image.clientWidth<minWidthOfImageForDisplayBottomOffersWrapper){if(test)console.log('картинка '+... | [
"function forceImageDimensionsIfEnabled() {\n if (options.forcedImageWidth && options.forcedImageHeight) {\n data.itemsContainer.find('.mg_block').each(function () {\n $(this).find('img').width(options.forcedImageWidth);\n $(this).find('img').height(op... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Cycles over properties in an object and calls a function for each property value. If the function returns a truthy value, then the iteration is stopped. | function eachProp(obj, func) {
var prop;
for (prop in obj) {
if (obj.hasOwnProperty(prop)) {
if (func(obj[prop], prop)) {
break;
}
}
}
} | [
"function eachProp(obj, func) {\n var prop;\n for (prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n if (func(obj[prop], prop)) {\n break;\n }\n }\n }\n}",
"function eachProp(obj, func) {\n var prop;\n for (prop in obj) {\n if (... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
SPD is measured on a scale of 110 | get SPD(){
return this._SPD
} | [
"getSpd() {\n return this.spd;\n }",
"get ypm() { return this.spd.total * 20 }",
"get ypmr() { return this.spd.total * 5 }",
"speedConversion() {\n let spd = this.spd.total\n if (spd < 11) {\n return '3.5mph (5.6km per hour)';\n }\n if (spd > 10 && spd < 22) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Instead of creating functions for onMouseMove, onMouseDown, OnMouseUp, OnMouseLeave just call the stopPainting function. | function stopPainting() {
painting = false;
} | [
"function stop (){\n\t\t\t\t// Switch the paint status to false\n\t\t\t\tpaint = false;\n\t\t\t}",
"function mouseReleased(){\n\tdrawing = false;\n}",
"_onCanvasMouseLeave(evt){\n /*\n this._mouse = null;\n //console.log( \"leave\" );\n this._canvas.blur();\n this._canvas.style.border = this._bor... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
read library items of library | function readLibraryItems(xmlLibrary, library) {
var xmlLibraryItems = xmlLibrary.getElementsByTagName("shapes");
if (!xmlLibraryItems.length) {
return;
}
var moList = xmlLibraryItems[0].getElementsByTagName("shape");
var j, m;
for (j = 0, m = moList.... | [
"function getRead(library) {\n let leidos = []\n let noLeidos = []\n let listOfBooks = Object.values(library);\n\n for (let book of listOfBooks) {\n\n if (book.read === true) {\n leidos.push(book.title)\n } else {\n noLeidos.push(book.title)\n }\n }\n console.log(`Libros leidos: ${leidos}`)... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Matches all whole numbers with decimals | static get wholeNumberDecimal() {
return /^\+?\d*\.\d+$/;
} | [
"function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.test(num + \"\"));\n}",
"decimal(numberInt, numberDec){\n //const entero = new RegExp('^\\\\d{1,' + numberInt + '}?$');\n const decimal = new RegExp('^\\\\d{1,' + numberInt + '}(\\\\.\\\\d{1,' + numberDec + '})?$');\n return decimal;\n }",
"fu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This function moves every block down and removes blocks, wich have reached the bottom. | function moveBlocks() {
blocks = noteArea.childNodes;
blocks.forEach(function (child) {
var rect = child.getBoundingClientRect();
var newTop = rect.top + fallDownSpeed;
var newBottom = noteArea.getBoundingClientRect().bottom - fallDownSpeed - rect.bottom;
if (newTop >= noteArea.g... | [
"function neibBottom(){\n var i=0;\n while (i<4) {nodeIterator.nextNode(); i++};\n gameField.replaceChild(nodeIterator.referenceNode,emptyBlock);\n gameField.insertBefore(emptyBlock,gameField.children[index+i-1]);\n }",
"placeBlocks() {\n\t\tlet current = this.array[0];\n\n\t\tcurrent.visited = true;... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Datatype Channel Extends mxShape. | function mxShapeEipDatatypeChannel(bounds, fill, stroke, strokewidth)
{
mxShape.call(this);
this.bounds = bounds;
this.fill = fill;
this.stroke = stroke;
this.strokewidth = (strokewidth != null) ? strokewidth : 1;
} | [
"function mxShapeEipMessageChannel(bounds, fill, stroke, strokewidth)\n{\n\tmxShape.call(this);\n\tthis.bounds = bounds;\n\tthis.fill = fill;\n\tthis.stroke = stroke;\n\tthis.strokewidth = (strokewidth != null) ? strokewidth : 1;\n}",
"function mxShapeEipDeadLetterChannel(bounds, fill, stroke, strokewidth)\n{\n\t... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
creates a geometry and texture for a circle and combines them to form the object. It imports a texture and bump map to form a material. This is the floor of the ice cave. will change shadow and color options to include more realistic shadow interactions might include normal map at later time | function initCaveFloor(){
var geometryCi = new THREE.CircleGeometry( 98, 32 );
var normalTextureCi = new THREE.TextureLoader().load('libs/ice-floor-b.png');
var bumpTextureCi = new THREE.TextureLoader().load('libs/ice-floor-3.png');
var materialCi = new THREE.MeshPhongMaterial( {
... | [
"function createMoon(radius) {\n // Create geometry\n let geometry = new THREE.SphereGeometry(1, 20, 20);\n\n // Create material\n let textureMap = new THREE.TextureLoader().load(\"images/moonmap.jpg\");\n let bumpMap = new THREE.TextureLoader().load(\"images/moonmap.jpg\");\n let material = new T... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets all geo code information of the given search term. | function getGeocodeInformation(term){
let dfr = Q.defer();
if(!term || term == ''){
dfr.resolve(null);
}
geocoder.geocode(term)
.then(function (geo) {
dfr.resolve(goe);
},function(err){
dfr.reject(null);
});
return dfr.promise;
} | [
"function geocode(searchText) {\n\t\tgeocoder.geocode({\n\t\t\tsearchText: searchText,\n\t\t\tmaxResults: 1,\n\t\t\tjsonattributes: 1\n\t\t\t}, function(result) {\n\t\t\tprocessGeocodeResults(result);\n\t\t\t}, function(error) {\n\t\t\talert(error);\n\t\t});\n\t}",
"function bdGEO(){\n \tfor(var i=0;i < ad... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Returns false / Use the every method inside the checkPositive function to check if every element in arr is positive. The function should return a Boolean value. | function checkPositive(arr) {
// Add your code below this line
return arr.every(function(num) {
return num > 0;
});
//if every element passes the test --> true if all passes, false if not
// Add your code above this line
} | [
"function checkPositive(arr) {\n return arr.every(function(val) {\n return val > 0;\n });\n}",
"function checkPositive(arr) {\n // Add your code below this line\n return arr.every(item => item > 0)\n \n // Add your code above this line\n }",
"function checkPositive(arr) {\n // Add your code be... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Check to see if hasPrevious | function hasPrevious() {
return (currentVideo > 0);
} | [
"hasPrevious() {\n return currentposition > 0;\n }",
"hasPrevious() {\n return this.index > 0;\n }",
"prevExists() {\r\n\t\treturn this.curr.prev == null ? false : true;\r\n\t}",
"function HasPrevWaypoint() : boolean {\n return (HasWaypointWithID(currentWaypoint - 1));\n}",
"get hasPrev() {... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Functions for displaying information about the current activity. | function displayActivity(intel){
$( "#positionData" ).text( activityString + " " + intel );
} | [
"function info(){\n return (this.title + \" by \" + this.author + \", \" + this.pages + \", \" + this.read);\n }",
"function showStatus () {\n if (activities.length === 0) {\n return \"Add some activities before calling showStatus\";\n }\n else {\n for (let i = 0; i < activities.length; i++) {\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
======================================================== Determines if first date partially intersects second date NOTE: This is a shallow test (no patterns tested) | dateShallowIntersectsDate(date1, date2) {
if (date1.isDate) {
return date2.isDate ? date1.dateTime === date2.dateTime : this.dateShallowIncludesDate(date2, date1);
}
if (date2.isDate) {
return this.dateShallowIncludesDate(date1, date2);
} // Both ranges
if (date1.start && date2.end &&... | [
"dateShallowIntersectsDate(date1, date2) {\n if (date1.isDate) {\n return date2.isDate ? date1.startTime === date2.startTime : this.dateShallowIncludesDate(date2, date1);\n }\n\n if (date2.isDate) {\n return this.dateShallowIncludesDate(date1, date2);\n } // Both ranges\n\n\n if (date1.star... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Gets the nearest npm_modules directory | function getNearestNodeModulesDirectory(options) {
// Get the nearest node_modules directories to the current working directory
var nodeModulesDirectories = (0, _findNodeModules2['default'])(options);
// Make sure we find a node_modules folder
if (nodeModulesDirectories && nodeModulesDirectories.length > 0) {... | [
"getNodeModulesPath(currentDir) {\r\n var rootPath = vs.workspace.rootPath;\r\n while (currentDir != path.dirname(currentDir)) {\r\n console.log(currentDir);\r\n var candidatePath = path.join(currentDir, 'node_modules');\r\n if (fs.existsSync(candidatePath)) {\r\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
This code is same as 'simpleFetch' function of promise.js | function simpleFetch2(url) {
return new Promise(function (resolve, reject) {
var req = new XMLHttpRequest();
req.addEventListener("load", function () {
let htData = JSON.parse(req.responseText);
if (typeof htData !== "object") reject("wrong data");else resolve(htData);
});
req.open("GET", ... | [
"_makeFetch() {\n let request = require('request');\n\n return (uri) => {\n return new Promise((resolve, reject) => {\n request(uri, (error, response, body) => {\n if (!error && response.statusCode == 200) {\n resolve({ text: () => body });\n } else {\n reje... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
trackStr the unique tracking string for the link. url redirects to the url after calling tracking functions. prop which ominiture property to modify. linkType usually defaulted, but can be overridden. gs same as linkType | function iv_doTracking (trackStr, url, prop, linkType, linkName, gs, el ) {
if (linkType == null || linkType == "") { linkType = "o"; }
if (linkName == null || linkName == "") { linkName = "Downloaded File"; }
if (prop != null && prop != ""){
prop=prop.replace(/s_prop/, "s_iv.prop");
... | [
"function trackCustomLink(link_obj, link_name) {\n\tvar s=s_gi(s_account)\n\ts = s_gi(s_account);\n\ts.linkTrackVars = \"eVar10\";\n\ts.eVar10 = link_name;\n\ts.linkTrackEvents = 'None';\n\ts.tl(link_obj, 'o', link_name);\n }",
"setTrackingURL(trackingURL) {\n this.trackingURL = trackingURL;\n }",
"function... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
The function should accept 1 parameter: id The function should select the element with the given id The function should return the element's textContent | function getTextById (id) {
return document.getElementById(id).textContent;
} | [
"function getTextById (id) {\n return $(\"#\" + id).text();\n}",
"function getTextById(id) {\n return document.getElementById(id).textContent;\n}",
"function getTextById (id) {\n\n}",
"function getElementByIdWithInnerText(id) {\n const result = document.getElementById(id).innerText;\n return result;\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
get month in format 04/18 and return 20180401 | getDateFromMonth(month, flag) {
if (month !== undefined) {
if (month.includes('/')) {
let arr = month.split("/")
return flag === 'end' ? `20${arr[1]}-${arr[0] + 1}-01` : `20${arr[1]}-${arr[0]}-01`
}
}
return month
} | [
"M(date) {\n return date.month()\n }",
"function getTwoDigitMonth(m) {\n\tvar mLen = m.length;\n\tif(mLen == 1) {\n\t\tm = '0'+''+m;\n\t} else if(mLen == 2) {\n\t\tif(m > 12) {\n\t\t\tm = 12;\n\t\t}\n\t}\n\treturn m;\n}",
"function getTwoDigitMonth(date) {\n return (date.getMonth() + 1).toString().pa... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
TextBoxManager Class defination, Maintains all the TextBoxs in a Page | function PBTextBoxMgr()
{
this.bPostBack = false;
this.TextBoxs = new PBMap();
this.Get = PBTextBoxMgr_Get;
this.Add = PBTextBoxMgr_Add;
this.GetIDs = PBTextBoxMgr_GetIDs;
this.Count = PBTextBoxMgr_Count;
this.KeyUp = PBTextBoxMgr_KeyUp;
this.MousDown = PBTextBoxMgr_MousDown;
this.M... | [
"constructor(){\n this.instance = createTextBox();\n }",
"bindTextboxListeners() {\n var fnClickTextbox = this.events.eventFunctions[\"fnClickTextbox\"];\n var mainScope = this;\n\n $( \"input.mskin-textbox-input\", this.htmlElement.container).click( function() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Display Filtered Devices based on OG | function displayOGDevices(){
var data = getDeviceData();
if(document.getElementById('GID').value == '0'){
//buildDeviceTable(data.Devices); //just display all devices if we have not selected an OG.
if(filterEnrollemntStatus() !== '0'){ //if we have selected anything else than All.
var enrollStatus =... | [
"function filterAllDevices()\n{\n // run this method via kd -->0: kd> dx Debugger.State.Scripts.PlugAndPlayDeviceTree.Contents.filterAllDevices()\n\n // host.diagnostics.debugLog(\"filterAllDevices Begin\\n\")\n // return filterDevices(host.namespace.Debugger.Sessions.First().Devices.DeviceTree.First());\n //\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
End of Adder Function 3 Advanced Panel Function | function advancedPanel(obj) {
const basePanel=document.querySelector(".basepanel");
const advanceBtn=document.querySelectorAll('.advanced');
basePanel.classList.add("showhide");
advanceBtn.forEach((button)=>{
button.addEventListener('click',(event)=>{
advancedOperationHandling(obj,ev... | [
"function closeMyMealPanel()\n{\n erasePanel('myMealPanel');\n}",
"function closeNutritionDetailPanel() \n{\n erasePanel('nutritionLabel');\n}",
"function removeDetailPanel()\n{\n\n}",
"function showNextPanel() {\n $(this).removeClass('active');\n $('#' + panelToShow).fadeOut(200, ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
int > list[string] Returns a list filled with size empty strings | function emptyList(size)
{
var li = [];
for(var i = 0; i < size; i++)
{
li.push("");
}
return li;
} | [
"function emptyList(size)\n{\n return fillList(size, \"\");\n}",
"function get_empty_list() {\n return [];\n}",
"function newList(length) { return Array(length).fill() }",
"function emptyStringArray(n) {\n\tvar toReturn = [];\n\tfor(; n > 0 ; n--) {\n\t\ttoReturn.push(\"\");\n\t}\n\treturn toRetu... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
checks tile to right is clear | function isRightClear (ghostCurrentPosition) {
if (!cells[ghostCurrentPosition + 1].classList.contains(borderClass) && (!cells[ghostCurrentPosition + 1].classList.contains(tarantulaClass) || !cells[ghostCurrentPosition].classList.contains(scorpianClass) || !cells[ghostCurrentPosition].classList.contains(waspClass))... | [
"function moveRightAllowed(tile) {\n var tileIndex = tileArray.indexOf(tile);\n var indexOfTileToTheRight = tileIndex + 1;\n if (\n tileIndex != numColumns - 1 &&\n tileIndex != numColumns * 2 - 1 &&\n tileIndex != numColumns * 3 - 1 &&\n tileIndex != numColumns * 4 - 1 &&\n tileIndex != numColumn... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
FUNCTION: setDisabled DESCRIPTION: Disables or enables the list or menu ARGUMENTS: theValue boolean true to disable, false to enable RETURNS: nothing | function RecordsetColumnMenu_setDisabled(theValue)
{
if (this.listControl)
{
if (theValue && !this.listControl.object.getAttribute("disabled"))
{
this.listControl.object.setAttribute("disabled", true);
}
else if (!theValue && this.listControl.object.getAttribute("disabled"))
{
... | [
"function ListMenu_setDisabled(theValue)\r\n{\r\n if (this.listControl)\r\n {\r\n if (theValue && !this.listControl.object.getAttribute(\"disabled\"))\r\n {\r\n this.listControl.object.setAttribute(\"disabled\", true);\r\n }\r\n else if (!theValue && this.listControl.object.getAttribute(\"disable... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Bachelier Futures Spread (BFS) Price | function bfs_price(_type, _X, _K, _t, _r, _s) {
let _d
_d = (_X - _K) / (_s * Math.sqrt(_t))
if (_type == 'C') {
return Math.exp(-_r * _t) * (normsdist(_d, true) * (_X - _K) + normsdist(_d, false) * (_s * Math.sqrt(_t)))
} else {
return Math.exp(-_r * _t) * (normsdist(-_d, true) * (_K - ... | [
"balanceFeeds():Number {\n let { price } = this.batchInformation;\n let totalSum = 0;\n // console.log(this.feeds)\n if (this.state.feeds && this.feeds !== []) {\n this.feeds.forEach((weeks) => {\n weeks.forEach(day => {\n let totalCost = (day... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
PostBlog jsx element to display the postblog form and to access the form attributes. | PostBlog () {
this.setState({ formvalue: true })
const formdata =
<div className='PostBlog' align='center'>
<br /><br />
<h2>Post a Blog</h2>
<Card style={{ width: '40rem' }}>
<Form onSubmit={this.PostBlogAPI}>
<Form.Group controlId='exampleForm.ControlInput1'... | [
"render() {\n return (\n <div>\n <h3>Create a Blog Post</h3>\n <BlogForm onSubmit={this.onSubmit} />\n </div>\n );\n }",
"render() {\n if (!this.props.blog) {\n return <div>Loading...</div>;\n }\n return (\n <div>\n <h3>Edit a Blog</h3>\n <BlogForm\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Merits are added at a specific index to allow them to be laid out where the player wants, for organisational reasons. You might want all your social merits together, or all your influences and statuses, etc. | addMerit(index, merit)
{
if (merit instanceof FightingStyle)
{
this.addFightingStyle(merit);
}
else if(merit instanceof StyleIndividualMerit)
{
this.addIndividualStyleMerit(merit);
}
if(this.items['merit'+index])
{
this.removeMerit(index);
}
merit.useGroup = this;
this.items['merit... | [
"function adjustCustomListMerge(){\n\tenemies.cl.list.forEach(function(hero){\n\t\thero.merge = enemies.cl.merges;\n\t\t//Update hero base stats\n\t\tsetStats(hero);\n\t});\n\n\t//Update enemy UI\n\tupdateEnemyUI();\n}",
"mergeTogether(idx) {\n\t\tthis.remove(idx);\n\t\tlet arr;\n\t\tif (typeof idx === 'number') ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Purpose: updates both dogs properties Input: boolean for if left dog wins Notes: notice that we calculate the ratings, before we update properties. GamesWon must be updated before games played bc it relies on games played | function updateDogs(leftWins) {
leftResult = Number(leftWins); // this turns true into 1, and false into 0
rightResult = Number(!leftWins); // this turns true into 1, and false into 0
leftDog.rating = calculate(leftDog, rightDog, leftResult);
rightDog.rating = calculate(rightDog, leftDog, rightResult);... | [
"function checkWhoWon() {\n if (gameBall.yBall < 0) {\n gameState.playerWins++;\n newGameRecord.humanWins = gameState.playerWins;\n newGameRecord.aiWins = gameState.enemyWins;\n newPlayerRecord.winLoseAI = \"Win\";\n setProperty(\"winLoseLabel\", \"text-color\", \"green\");\n setText(\"winLoseLab... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Submits a form for the purpose of sending a CSV file or HTML to Excel inline or as an attachment. | function postFormTextForCsvHtmlForExcel(txt, actionUrl, dispType) {
var formName = "__form_sending_csv_html_to_excel__";
var aNewInnerHTML = '<form id="' + formName + '" method="post" >' +
'<input type="hidden" name="textForFile" />' +
'<input type="hidden" name="colNames" />' +
'<i... | [
"function submitForm () {\n\n\t\t\t// Add submitting state\n\t\t\tform.setAttribute('data-submitting', true);\n\n\t\t\t// Send the data to the MailChimp API\n\t\t\tsendData(serializeForm(form));\n\n\t\t}",
"function DownloadCsv(form) {\n // Create table header\n headerRow = [];\n headerRow.push(\"Timestamp\");... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Stop execution of the composite accessor. In the commonHost, do nothing. Other hosts may invoke wrapup() on adjacent accessors and stop execution. | function stop() {
console.log("commonHost.js: stop() invoked, stop() does nothing.");
} | [
"despawn() {\n super.despawn();\n\n this.getOperators().forEach((operator) => {\n operator.despawn();\n });\n }",
"stopMonitorInterrogateOperation_() {\n this.interrogateOperationId = null;\n this.interval_.cancel(this.interrogateOperationInterval_);\n }",
"stop() {\n ... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Find the discussion posts by the given filter. | async function _findPosts (filter) {
const posts = await model.findAll({
where: filter
})
const result = []
for (const post of posts) {
const author = await model._models.User.findById(post.authorId)
const replies = await model.count({ where: { parentId: { [Op.eq]: post.id } } })
result.push({ a... | [
"function findBy(filter) {\n return db(\"posts\").where(filter);\n}",
"posts(parent, args, { db }, info) {\n\n // no query: return all posts\n if (!args.query) {\n return db.posts;\n }\n\n // query: return all posts that match the search query either in the post title or in... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Starts the SS OAuth flow for the specified plugin | launchAuthFlow (pluginID) {
return new Promise((resolve, reject) => {
// send it to background so background can do the actual authflow with chrome:
chrome.runtime.sendMessage({
sheetmonkey: {
cmd: 'launchAuthFlow',
params: {
pluginID: pluginID
}
... | [
"function startOauth() {\n const qs = querystring.stringify({\n state,\n client_id: CLIENT_ID,\n response_type: 'code',\n redirect_uri: REDIRECT_URI,\n });\n\n open(`${AUTH_URL}?${qs}`);\n}",
"fbLogin(){\n /*OAUTH INITIALIZE*/\n OAuth.initialize('06xEp9h-x2w58YbIALBrQWD-UJw');\n\n OAuth.popup('f... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Invoke CIF APIs to create a new case record. This will open the case create form with certain fields like contactId and description prepopulated | function createCase() {
var ef = {};
ef["entityName"] = "incident";
var fp = {};
fp["customerid"] = phone.contactId; //prepopulate some fields we know
fp["customeridtype"] = "contact";
fp["caseorigincode"] = 1;
fp["description"] = $('#callNotesField').text();
//Now invoke CIF API
Mic... | [
"function createNewCase () {\n var createUniqueCase = createUniqueRecordFactory('Case', ['subject']);\n const caseData = {\n contact_id: 8,\n case_type_id: 'housing_support',\n subject: 'New Case',\n status_id: 'Open'\n };\n\n var caseObj = createUniqueCase(caseData);\n\n if (!caseObj.is_error) {\n... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
2, 3, 4, 5, 6 are counted as +1 7, 8, 9 are counted as 0 10, J, Q, K, A are counted as 1 Create a function that counts the number and returns it from the array of cards provided. | function count(deck) {
let addOne = [2, 3, 4, 5, 6]
let minusOne = [10, "J", "Q", "K", "A"]
let count = 0
for(let i = 0; i < deck.length; i++){
if(addOne.includes(deck[i])){
count += 1
}
else if(minusOne.includes(deck[i])){
count -=1
}
}
return count
} | [
"countCards() {\n let counts = Array(6).fill(0);\n for (const card of this.cards) {\n counts[card - 1]++;\n }\n return counts;\n }",
"function scoreHand(cards) {\n\tvar sum = 0;\n\tvar aCount = 0;\n\tcards.forEach(function(item, index, arr) {\n\t\tvar temp = Number(... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
return nonerror if keybase is actually installed and we got an identity. | check() {
if (this.identity != null) return Promise.resolve();
this.identity = this.findIdentityFromKeybaseConfig();
if (this.identity != null) return Promise.resolve();
this.cli.status("Checking keybase...");
const p = child_process.spawn(KEYBASE_BINARY, [ "status" ], { stdio: [ "ignore", "pipe", ... | [
"function whichKeybase() {\r\n return __awaiter(this, void 0, void 0, function() {\r\n var path\r\n return __generator(this, function(_a) {\r\n switch (_a.label) {\r\n case 0:\r\n return [4 /*yield*/, aWhich(keybaseBinaryName_1.default)]\r\... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
function that highlights both bar and county geometry and places cooresponding div popup | function highlight (d) {
//get the second class in the object of svg element that called function, the second class in the list is the county name
var countyClass = "." + d3.select(this).attr("class").split(" ")[1];
//select both the county geometry and bar elements and color code them
... | [
"function highlightRegAndEthnicity(e) {\n var layer = e.target;\n layer.setStyle({\n weight: 3,\n color: '#666',\n dashArray: '',\n fillOpacity: 0.7\n });\n if (!L.Browser.ie && !L.Browser.opera && !L.Browser.edge) {\n layer.bringToFront();\n }\n info.update(laye... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
support new Binding() new Binding(subscriptionText, parentBinding) new Binding("$click|alert;val:path", parentBinding); | function Binding( subscriptionText, parentBinding, bindingNs, bindingOptions ) {
var nsProperty, match, emptyBinding;
//handle the case: new Binding()
if (!subscriptionText) {
//
//shared property
this.subscriptions = [];
return;
}
//handle the case : new Binding (elem);
if (subscriptionText.... | [
"function Component_BindingHandler() {}",
"function ODataParentBinding() {}",
"function Binding () {\n\t this.id = ++uid\n\t this.subs = []\n\t}",
"function EventBinding() {\n }",
"function Binding(val) {//val = valor to observe\r\n var self = this;\r\n self.elementBindings = [];\r\n if(ty... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
round to the nearest 1/1000 | _round(x) {
return Math.round( x * 1000) / 1000;
} | [
"function round(x) {\n return Math.round(x * 1000) / 1000;\n}",
"function round(x) {\r\n return Math.round( x * 1000) / 1000;\r\n}",
"function roundIt(value) {\n let places = 100;\n if (value < 100) {\n places = 10000;\n } else if (value < 0.001) {\n places = 1000000;\n }\n return... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |
Inverts filehosting checkboxes selection | function selectInvert()
{
var $checked = $(":checkbox:visible:checked");
var $unchecked = $(":checkbox:visible:not(:checked)");
$unchecked.prop("checked",true)
.each(function(index, element){lsSetVal("hosts", this.id, true)});
$checked.prop("checked",false)
.each(function(index, ... | [
"function selectInvert()\r\n {\r\n var $checked = $(\":checkbox:visible:checked\");\r\n var $unchecked = $(\":checkbox:visible:not(:checked)\");\r\n \r\n $unchecked.prop(\"checked\",true)\r\n .each(function(index, element){GM_setValue(this.i... | {
"objective": {
"paired": [],
"self": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} |