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 |
|---|---|---|---|---|---|---|
Displays seperate cards for each time frame with corresponding commute info | function cardDisplay() {
// commute array holding an object for each commute time frame(daily, weekly, monthly, yearly)
let commute = [{
timeFrame: 'Daily',
commuteTime: `Time: ${dailyCommuteTime}`,
commuteDistance: `Distance: ${dailyDistance} miles`,
cost: `Cost: $${computeCost(dailyDistance, mpgA... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showCards(args) {\n let player = args.getAttribute('player');\n let cardType = args.getAttribute('cardType');\n var player_sheet = 'p' + player.slice(6);\n var sheet = document.getElementById(player_sheet);\n\n var i, tabcontent;\n tabcontent = sheet.querySelectorAll('.tabcontent')\n ... | [
"0.64655095",
"0.6436965",
"0.6434079",
"0.6427602",
"0.6421137",
"0.6407932",
"0.6370076",
"0.63045925",
"0.62536323",
"0.62237006",
"0.6204448",
"0.6203144",
"0.6202183",
"0.6161944",
"0.6151026",
"0.61486185",
"0.61359936",
"0.61246914",
"0.6124306",
"0.61066467",
"0.60984... | 0.7746315 | 0 |
Any time a transaction is added, edited, or removed, we need to ensure the balance is updated: | onTransactionChange() {
$store.recalculateBalances();
this.balances = $store.state.balances;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"commit() {\n this.account.balance -= this.amount; // balance = balance - this.amount\n }",
"commit() {\n this.account.balance += this.amount; // balance = balance + this.amount\n }",
"commit() {\n // check if transaction is allowed\n if (this.isAllowed()) {\n // Keep track of the time of the... | [
"0.74919873",
"0.7196895",
"0.7120982",
"0.6991336",
"0.68519545",
"0.67487884",
"0.6748528",
"0.6730116",
"0.6727558",
"0.6607417",
"0.65302634",
"0.6512364",
"0.6497932",
"0.6458375",
"0.64385486",
"0.6409622",
"0.6402638",
"0.639369",
"0.6361588",
"0.6343707",
"0.6343288",... | 0.72811913 | 1 |
When the animal definition is loaded from file, each animal definition only contains attributes that it has, but not the attributes that it doesn't have, even for attributes that are defined as default attributes in attributes.json. This is done to save storage space. However, the AnimalForm should allow user to modify... | static addUnusedAttributeToAnimals(oldAnimalDefinition, attributeDefinition) {
// let attributeDefinition = props.attributeDefinition;
// must do deep cloning for hydratedAnimalDefinition would just be a
// reference to oldAnimalDefinition
let hydratedAnimalDefinition = JSON.parse(JSON.stringify(oldAnim... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"initAttributes() {\n // loop through our attributes and create buffers and attributes locations\n for(const key in this.attributes) {\n // is this attribute active in our program?\n this.attributes[key].isActive = this.program.activeAttributes.includes(this.attributes[key].name)... | [
"0.5096221",
"0.50474185",
"0.50441134",
"0.5001046",
"0.49310896",
"0.4901087",
"0.4845567",
"0.4835437",
"0.47968215",
"0.47881335",
"0.4777808",
"0.47482374",
"0.4736499",
"0.47109812",
"0.4700405",
"0.4673258",
"0.46527648",
"0.4647958",
"0.4636271",
"0.46358123",
"0.4622... | 0.6029065 | 0 |
+v 2.7.0 Helpers for strict interface usage (non BaseObject class for performance reasons) usage: obtain caster (through IMyInterface.StrictCast(myobject); caster.Call("mymethod", arg1, arg2....); x = caster.Get("myprop"); x = caster.Get("myprop","empty"); | function __InterfaceCaster(obj, iface, strict) {
this.iface = iface;
this.obj = obj;
this.strict = strict;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get(o) { return o && typeof o === 'object' && upwardifieds.get(o); }",
"function safeGet(obj, prop) {\n var result;\n\n try {\n result = obj[prop];\n } catch (err) {// pass\n }\n\n return result;\n}",
"function Interface () {}",
"function $rt_objGetProp(obj, propStr)\n{\n // Try reading t... | [
"0.534955",
"0.5207101",
"0.51081944",
"0.5104243",
"0.5028902",
"0.5007483",
"0.49649376",
"0.49596867",
"0.49399135",
"0.4939126",
"0.49141085",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.49038118",
"0.... | 0.64742523 | 0 |
Plot each point of the mandlebrot set starting at z_0 = startNum | function plot(startNum)
{
if (!isNaN(startNum))
{
let img = mandlebrot_ctx.createImageData(mandlebrot_canvas.width, mandlebrot_canvas.height);
let mapper = function (x,y) {
let a = x / 100 - 4;
let b = 2 - y / 100;
return math.complex(a, b);
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculatePoints(c) {\n\n // Calculate what values in xy-plane the coordinates are corresponding to\n new_xmin = currentMandelbrot.xmin + (c.x / (currentMandelbrot.width - 1)) * (currentMandelbrot.xmax - currentMandelbrot.xmin);\n new_xmax = currentMandelbrot.xmin + (c.x2 / (currentMandelbrot.widt... | [
"0.59483224",
"0.5653886",
"0.5426369",
"0.5382395",
"0.5271132",
"0.52584165",
"0.52521014",
"0.52032924",
"0.51972276",
"0.5147273",
"0.5123876",
"0.5116972",
"0.51100016",
"0.50696576",
"0.5059673",
"0.5059651",
"0.50374454",
"0.501399",
"0.49421012",
"0.49335778",
"0.4931... | 0.7756341 | 0 |
Add the latest comment to Recent Comments section | function addNewToRecent(currentPost, commentContent, commentEmail) {
const $commentList = $('.recent-comment-list');
const $postTitle = currentPost.find('.post__title').text();
console.log($postTitle);
const html = `
<li class="recent-comment">
<h4 class="post__title recent-comment__title"... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getLastComments(){\n\t\t\treturn dataservice.getLastComments()\n\t\t\t\t.then(function(data) {\n\t\t\t\t\tdata.forEach(function(entry) {\n\t\t\t\t\t\tentry.creationDate = new Date(entry.creationDate);\n\t\t\t\t\t});\n\t\t\t\t\tctrl.lastComments = data;\n\t\t\t\t\treturn data;\n\t\t\t\t});\n\t\t}",
"func... | [
"0.69149715",
"0.6822439",
"0.66101986",
"0.6281375",
"0.62284034",
"0.6225259",
"0.6190178",
"0.61834586",
"0.6155016",
"0.61495566",
"0.6143253",
"0.6127296",
"0.6109514",
"0.60477453",
"0.6044451",
"0.601996",
"0.59900296",
"0.59867287",
"0.5971635",
"0.59486514",
"0.59194... | 0.699776 | 0 |
When page loads, add a random comment to the Recent Comments section | function addRandomRecent() {
console.log('add recent');
const recentCommentHtml = recentCommentTemp(localData);
$('.sidebar--right').append(recentCommentHtml);
// Add click event to postTitle of the comment
$('.recent-comment__title').on('click', function () {
const $title = $(this);
clo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function commentDisplay(comments) {\r\n var comments = JSON.parse(comments);\r\n var divhere = document.getElementById('commentshere');\r\n divhere.innerHTML = '';\r\n for (i = 0; i < comments.length; i++) {\r\n var rand = Math.floor(Math.random() * 100) + 1;\r\n var newhtml = `\r\n ... | [
"0.63608086",
"0.62744886",
"0.6075076",
"0.6047605",
"0.60409266",
"0.6040284",
"0.60138917",
"0.6005148",
"0.59907997",
"0.59631234",
"0.5928029",
"0.5917295",
"0.59171534",
"0.5898459",
"0.5898385",
"0.5866015",
"0.5857094",
"0.5812828",
"0.5809424",
"0.5808743",
"0.579915... | 0.78674084 | 0 |
Click a postTitle in the Recent Comments section, scroll to that post and fully expand it | function scrollToPost(postTitle) {
console.log('scroll to post', postTitle);
// closePosts();
const $currentPostTitle = postTitle.text();
const $targetPost = $('.post').filter(function () {
return $(this).find('.post__title').text() === $currentPostTitle;
});
const $targetCommentBlock = $t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scrollCommentIntoView ()\n\t{\n\t\t// Check if the comments are collapsed\n\t\tif (hashover.setup['collapses-comments'] !== false) {\n\t\t\t// Check if comment exists on the page\n\t\t\tvar linkedHidden = hashover.elements.exists (pageHash, function (comment) {\n\t\t\t\t// Check if the comment is visable\... | [
"0.70241684",
"0.6980393",
"0.6842167",
"0.66087157",
"0.6563191",
"0.6559946",
"0.6291751",
"0.6206092",
"0.61068195",
"0.60622865",
"0.6033841",
"0.6012211",
"0.5939262",
"0.58823603",
"0.58335465",
"0.5822037",
"0.57253724",
"0.5723918",
"0.57062745",
"0.569122",
"0.568798... | 0.7371489 | 0 |
When page loads, populate the feed section with posts | function populatePosts() {
console.log('populate posts');
const postHtml = postTemp(localData);
$('.feed').html(postHtml);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function init() {\n getAllPosts(); //since we want to see all posts when a page loads\n\n }",
"function getPosts () {\n apiService.getHomeFeed()\n .then(function (response) {\n $scope.posts = response;\n $scope.loading = false;\n if (postId) findPost(postId);\n })\... | [
"0.73137224",
"0.72665405",
"0.7194373",
"0.7157495",
"0.6952481",
"0.68467677",
"0.68227744",
"0.67973554",
"0.6762956",
"0.6749549",
"0.67397416",
"0.6730827",
"0.6679393",
"0.6639667",
"0.662218",
"0.66056",
"0.6516023",
"0.6510403",
"0.64624166",
"0.6457089",
"0.64541936"... | 0.8091037 | 0 |
Create a new post thru the createpost form | function createPost(e) {
e.preventDefault();
console.log('create post');
const $feed = $('.feed');
const $postTitle = $.trim($('#title').val());
const $postContent = $.trim($('#content').val());
const createPostTemplate = Handlebars.compile($('#create-post-template').html());
if ($postTitle... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPost(post){\n console.log(post);\n $http.post(`${server}/posts`, {post: post})\n .then(function(res){\n console.log(res);\n\n $state.go('index')\n });\n }",
"function createPost() {\n if (vm.post.title) {\n vm.post.description = \"\";\n vm.post.parentComp... | [
"0.79227763",
"0.7726811",
"0.76099783",
"0.73670477",
"0.7285121",
"0.71414286",
"0.6972001",
"0.6936143",
"0.691688",
"0.68864703",
"0.6816352",
"0.6803098",
"0.6783964",
"0.6770747",
"0.675253",
"0.6709527",
"0.66755414",
"0.66612846",
"0.66194",
"0.661007",
"0.6603727",
... | 0.7903156 | 1 |
Create an option in a selector. NOTE: the 'label' value should be regular text. It Will be escaped as necessary. | function createOPTION(parent, optionClass, label, value) {
var option = createNode(parent, 'OPTION', optionClass);
// 'falsey' values are allowed for labels and values, so
// we have to specifically compare only for undefined or null here
if (label !== undefined && label !== null) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSelect(id, label, options) {\n let start = `\n <div class=\"form-group col-md-3\">\n <label for=\"${id}\">${label}</label>\n <select class=\"form-control\" id=\"${id}\">`;\n let data = ``;\n for (let i = 0; i < options.length; ++i) {\n let option = option... | [
"0.64883834",
"0.6399402",
"0.63862556",
"0.6203005",
"0.61738986",
"0.615216",
"0.6100721",
"0.60850155",
"0.60684156",
"0.6046597",
"0.6046597",
"0.6046597",
"0.60330284",
"0.60193366",
"0.6003804",
"0.59979904",
"0.59272945",
"0.5904496",
"0.58989877",
"0.5893259",
"0.5846... | 0.6966582 | 0 |
Remove any contents of a node. THIS ASSUMES ALL CONTENTS ARE HTML, NOT SOMETHING LIKE SVG? | function removeAllChildren(node) {
node.innerHTML = '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeChildren(node)\r\n{\r\n node.innerHTML = \"\";\r\n}",
"function removeAllNodeFrom(parentNode){\n parentNode.innerHTML = '';\n}",
"function clearNode(node) {\n setTextContent(node, \"\");\n}",
"function clearNode(node) {\n setTextContent(node, \"\");\n}",
"function clearNode(node) ... | [
"0.756198",
"0.7294977",
"0.71441305",
"0.71441305",
"0.71441305",
"0.71441305",
"0.71441305",
"0.71441305",
"0.71441305",
"0.7061567",
"0.7015158",
"0.69656235",
"0.6945674",
"0.68935347",
"0.6878713",
"0.6855378",
"0.67349946",
"0.6728382",
"0.6722822",
"0.6682404",
"0.6663... | 0.77131015 | 0 |
Given a string of HTML, set a node's contents to that | function setHTML(node, html) {
var frag = document.createDocumentFragment(),
tmp = document.createElement('body'),
child;
tmp.innerHTML = html;
// Append elements in a loop to a DocumentFragment, so that the
// browser does not re-render the document for each ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setInnerHTML(html) {\r\n if (this.childNodes) {\r\n let _doc = parseMarkup(html, {\r\n ownerDocument: this.getOwnerDocument()\r\n });\r\n this.empty();\r\n // ATTENTION: important to copy the childNodes array first\r\n // as appendChild removes from parent\r\n _doc.childNode... | [
"0.70568734",
"0.6662651",
"0.64414185",
"0.64414185",
"0.62927365",
"0.62830573",
"0.6244615",
"0.6192672",
"0.60828006",
"0.60579234",
"0.5955809",
"0.5949248",
"0.59261787",
"0.59030586",
"0.58892334",
"0.58600044",
"0.5809194",
"0.57816243",
"0.5748311",
"0.57224566",
"0.... | 0.6893788 | 1 |
close the ongoing scene | function closeScene(){
currentSession.closeScene();
_createDataRequest();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeScenes() {\n this.scene.stop('SceneUp');\n this.scene.stop('SceneDown');\n //this.cm.style.display = 'none';\n\n this.launchScenes();\n\n }",
"onClose() {\n this.gameModel.close();\n this.closeGame();\n }",
"static _terminateCurrentScene() {\r\n this.... | [
"0.84107566",
"0.7301721",
"0.7178426",
"0.71164775",
"0.711172",
"0.7078719",
"0.7044778",
"0.7040113",
"0.7032019",
"0.701734",
"0.70106786",
"0.69406897",
"0.6927929",
"0.6925352",
"0.6892967",
"0.6875211",
"0.6875204",
"0.68699324",
"0.68241805",
"0.6817598",
"0.6803038",... | 0.79355854 | 1 |
Closes an ongoing media session | function closeMedia(){
mediaPlaying = false;
timeManager.stopVideo();
currentSession.closeMedia();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"closeMedia(){\n\n if (!(this.currentMediaSession)){\n\n logger.warn('Request to close non existent media session, Aborting');\n return;\n\n }\n\n // Place to register any additional events before closing the media session\n\n this.currentMediaSession = null; ... | [
"0.8040516",
"0.70390964",
"0.6983622",
"0.6976826",
"0.6776269",
"0.6727192",
"0.661352",
"0.6571244",
"0.6527704",
"0.6480862",
"0.64787304",
"0.64756507",
"0.6339657",
"0.6314007",
"0.6261496",
"0.6257298",
"0.62550163",
"0.62032235",
"0.61895424",
"0.6131659",
"0.61204946... | 0.781019 | 1 |
Adds the total number of key value pairs in the event to eventDataPairs. If the eventDataPairs exceed max size, then submits a post request and clears session | function _checkDataPairs(){
eventDataPairs++;
if (eventDataPairs >= config.getMaxEventsNumber){
_createDataRequest();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function postBatch(connection, measures, done) {\n\n var data = [];\n var sendCount = 0;\n\n for (var key in measures) {\n // skip loop if the property is from prototype\n if (! measures.hasOwnProperty(key)) { continue; }\n\n\n // console.log(key, measures[key].event, measures[key].buffer.length);\n ... | [
"0.49542764",
"0.49361965",
"0.4906884",
"0.48903757",
"0.4628907",
"0.46067348",
"0.45910248",
"0.45612106",
"0.45340648",
"0.44959095",
"0.4484575",
"0.44819903",
"0.44812164",
"0.44446614",
"0.44229",
"0.44211513",
"0.44119358",
"0.44112533",
"0.44004256",
"0.43822515",
"0... | 0.66269284 | 0 |
Here is the busines logic by which we apply transforms to the data Use debug() in the browser console to check during runtime Disable debug before production The idea with this one is to build up an object / dictionary where the unique key is the name of the creative and its value is an object containing the cumulative... | function byCreative() {
// final data for this transform will be stored here
appStore.transformed.creative = [];
// get creatives as an object / dictionary
let creativesObj = {};
_.each(appStore.original.spots , item=>{
if (!creativesObj[item.Creative]) {
// if this creative has never been seen add... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processTotals() {\n let income_statement = this.company.income_statement;\n let results = {\n totals:\n [\n {\n name: \"Revenue\", 'value': income_statement.total_revenue,\n bar: { s... | [
"0.6095748",
"0.5977296",
"0.5794646",
"0.5713998",
"0.56588066",
"0.56516695",
"0.56499916",
"0.5638548",
"0.5626283",
"0.5621324",
"0.5532681",
"0.55324125",
"0.549715",
"0.54883945",
"0.54836583",
"0.5475689",
"0.54643834",
"0.5456112",
"0.5453146",
"0.5436344",
"0.5421948... | 0.7633087 | 0 |
factory for player objects receives boolean (isHuman? true or false), returns player properties and methods | function createPlayer (isHuman) {
let type = true;
// x goes first, so human goes first to have a chance at a tie
let sign = 'X';
if (!isHuman) {
type = false;
sign = 'O';
}
return {sign, type};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createPlayer() {\n\t\tif (this.player1Selction.index === 0) {\n\t\t\tthis.player1 = new Ryu(this.ctx, false);\n\t\t} else if (this.player1Selction.index === 1) {\n\t\t\tthis.player1 = new Ken(this.ctx, false);\n\t\t} else if (this.player1Selction.index === 2) {\n\t\t\tthis.player1 = new Chun(this.ctx, false);\n\t\... | [
"0.6612975",
"0.65358216",
"0.6510406",
"0.64952266",
"0.6452866",
"0.6374141",
"0.6313638",
"0.62743646",
"0.6234572",
"0.6219202",
"0.6129901",
"0.6102313",
"0.6091245",
"0.60877436",
"0.6082917",
"0.6051698",
"0.60194844",
"0.60169536",
"0.5968394",
"0.59602684",
"0.595572... | 0.72391796 | 0 |
============================================================================= (1) Internal Only : getCompositeFigureId: returns a unique Id for a Composite Figure ============================================================================= | function getCompositeFigureId() {
return (common_composite_figure_id + (cocomposite_figure_counter++));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSurfaceId(surface) {\r\n var isolatedNodeComponent = surface.context.isolatedNodeComponent;\r\n if (isolatedNodeComponent) {\r\n var parentSurface = isolatedNodeComponent.context.surface;\r\n // nested containers\r\n if (surface.isContainerEditor()) {\r\n if (isolatedNodeComponent._i... | [
"0.592649",
"0.5883096",
"0.5842937",
"0.58185136",
"0.554694",
"0.552154",
"0.5443898",
"0.5378753",
"0.53775907",
"0.5375548",
"0.53324306",
"0.5304852",
"0.5299846",
"0.5289821",
"0.5250633",
"0.5248948",
"0.5247856",
"0.524495",
"0.5244007",
"0.5244007",
"0.5217175",
"0... | 0.9159682 | 0 |
======================================================= Class: BoxHandleKit ======================================================= | function BoxHandleKit() {
var argv = BoxHandleKit.arguments;
var argc = BoxHandleKit.length;
this.className = "BoxHandleKit";
if (argv.length > 0) this.initBoxHandleKit();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hBoxforPlaceInfo(){\n\t\trandom = random+1;\n\t\tvar hboxbasicConf1 = {id:\"hBoxforPlaceInfo\"+random,isVisible:true,orientation:constants.BOX_LAYOUT_HORIZONTAL,skin:\"HboxRoundedSkinJS\"};\n\t\tvar hboxlayoutConf1 = {containerWeight:100,margin:[2,2,2,2],padding:[0,0,0,0],percent:true};\n\t\tvar hboxPSPCo... | [
"0.62406176",
"0.6233502",
"0.5931656",
"0.57877916",
"0.575353",
"0.56670785",
"0.56506133",
"0.5640587",
"0.56343585",
"0.5626092",
"0.55977845",
"0.55838335",
"0.55744976",
"0.55651104",
"0.5551674",
"0.5538321",
"0.5521734",
"0.5516241",
"0.5515051",
"0.5512483",
"0.55083... | 0.7779376 | 0 |
Assign user attributes to each node | function assignAttributes(node) {
targetUser = users.find(el => {
return (el._id == node._id)
})
node.username = targetUser.username;
node.points = targetUser.points;
node.parent = targetUser.parent;
node.id = targetUser.id;
node.items = targetUser.items
node.chi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setAttributes(obj, node) {\r\n\t\t\t\tif(node.attributes.length > 0) {\r\n\t\t\t\t\tvar a = node.attributes.length-1;\r\n\t\t\t\t\tvar attName;\r\n\t\t\t\t\tobj._attributes = [];\r\n\t\t\t\t\tdo { //Order is irrelevant (speed-up)\r\n\t\t\t\t\t\tattName = String(formatName(node.attributes[a].name));\r\n\t\... | [
"0.61719656",
"0.61172587",
"0.5994189",
"0.58357495",
"0.5646752",
"0.56093717",
"0.55369717",
"0.55078197",
"0.5468282",
"0.5444252",
"0.53884333",
"0.5365914",
"0.5348361",
"0.5332177",
"0.53224516",
"0.52560747",
"0.5254791",
"0.52429503",
"0.52340937",
"0.5219565",
"0.52... | 0.85534054 | 0 |
Funcion que agrega n items (carrusel_meta.show_each) al carrusel. type = si es piso o muro delete_all = si hay que borrar los items del carrusel solamente los borra cambiar de categoria. | function updateCarousel(type, delete_all, arrow_dir) {
var meta_temp = null;
var limit = 0;
var arrow = null;
if (type === 'piso')
meta_temp = carrusel_meta.piso;
else if (type === 'muro')
meta_temp = carrusel_meta.muro;
if (meta_temp !== null) {
// Borrar todos los items del carrusel si delet... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function More() {\n let dataToShow=[];\n let count=0;\n for(let i=0;i<modifiedData.length;i++){\n if(count===6){\n break;\n }\n if(!modifiedData[i].show){\n modifiedData[i].show=true;\n dataToShow.push(modifiedData[i]);\n count++;\n }\n }\n createHTML(dataToShow);\n}",
"catego... | [
"0.5402625",
"0.5361807",
"0.5189829",
"0.50964695",
"0.50885975",
"0.5088539",
"0.5064018",
"0.5062314",
"0.5058752",
"0.50363064",
"0.50333464",
"0.503307",
"0.5005952",
"0.5003387",
"0.5000461",
"0.4996789",
"0.4982362",
"0.49785033",
"0.49776438",
"0.4976502",
"0.49711317... | 0.54508114 | 0 |
Resetear los valores por defecto de los inputs del formulario del cubicador. | function clearCubicadorForm() {
var fields = $('form#cubicador_form > input.cubicador_field');
for (var i = 0; i < fields.length; i++) {
if (/m2/i.test(fields[i].name)) {
fields[i].value = 1;
} else {
fields[i].value = null;
}
}
// Resetear el atributo de cantidad de cajas.
setCantidad... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function reset() {\r\n num1=parseFloat(document.getElementById(\"num1\").value = \"\");\r\n num2=parseFloat(document.getElementById(\"num2\").value = \"\");\r\n}",
"function limparCampos(){\n numeroInicialInput.value = '';\n numeroFinalInput.value = '';\n}",
"function reset_input_subcuentas(){\n\t\... | [
"0.7291083",
"0.7153372",
"0.71043444",
"0.69981045",
"0.6947246",
"0.6908366",
"0.68966055",
"0.68934083",
"0.6874413",
"0.6857035",
"0.6831693",
"0.6812666",
"0.67943704",
"0.66997176",
"0.66968167",
"0.66740525",
"0.6646346",
"0.663319",
"0.6623067",
"0.66223544",
"0.66147... | 0.71749634 | 1 |
Dado la cantidad de cajas se asigna este valor al span y a su datacantidadcajas. Tambien verifica si tiene que habilitar el boton de enviar al carrito dentro del modal. | function setCantidadCajas(cantidad) {
var btn = $('button#send_carrito_cub');
// Setear el texto del span y el dataset con la cantidad de cajas.
recurrent_nodes.num_cajas.innerHTML = cantidad;
recurrent_nodes.num_cajas.dataset.numCajas = cantidad;
// Revisar si habilitar o no el boton de enviar al carrito de... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function habilitar() {\n const calle = form1.calle.value;\n const numero = form1.num.value;\n const colonia = form1.col.value;\n const cp = form1.cod.value;\n const ciudad = form1.ciudad.value;\n const pais = form1.pais.value;\n val = 0;\n\n if (calle == \"\") {\n\t\tval++;\n\t}\n\n\tif (nu... | [
"0.62614125",
"0.6248621",
"0.6158082",
"0.613098",
"0.5953892",
"0.5951386",
"0.59076315",
"0.5860057",
"0.58391637",
"0.58041394",
"0.5758103",
"0.5755612",
"0.5732392",
"0.5698508",
"0.56877875",
"0.566472",
"0.5657778",
"0.56553715",
"0.5631278",
"0.5612818",
"0.5598233",... | 0.8024317 | 0 |
Valida los datos (email, nombre y rut) que se envian a impresion. | function validateImpresionData(data) {
var pass = true;
// EMAIL
if (validateEmail(data.email.value.trim())) {
setValidOrInvalidField(data.email, true);
} else {
setValidOrInvalidField(data.email, false);
pass = false;
}
// NOMBRE
if (data.nombre.value.trim().length !== 0) {
setValidOrInva... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validarCampo(){\r\n // valida la longitud de los campos y el contenido\r\n validarLongitud(this);\r\n\r\n // validar el campo email\r\n if(this.type === 'email'){\r\n validarEmail(this);\r\n }\r\n let errores = document.querySelectorAll('.error');\r\n if(email.value !=... | [
"0.6781371",
"0.67494684",
"0.6728949",
"0.66941375",
"0.6626029",
"0.6577531",
"0.6553052",
"0.6516527",
"0.64927334",
"0.6482932",
"0.6466623",
"0.64130276",
"0.64030576",
"0.6382042",
"0.63813573",
"0.63685924",
"0.63633925",
"0.6349492",
"0.6327312",
"0.628638",
"0.627328... | 0.7152291 | 0 |
Funcion para setear el valor de rotacion para los input hidden. input: nodo input hidden del valor de la rotacion. | function setRotateDegrees(input) {
var degrees = input.value;
var new_degrees = null;
var index = rotate_degrees.indexOf(parseInt(degrees));
if (index !== -1) {
if (rotate_degrees[index + 1] === undefined)
new_degrees = rotate_degrees[0];
else
new_degrees = rotate_degrees[index + 1];
} el... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set rotation(value) {}",
"function swapRotor(val) {\n // Gets current rotor value\n var el = document.getElementById(\"wheelVal\" + val);\n const current = el.innerHTML;\n const states = [\"I\", \"II\", \"III\", \"IV\", \"V\"];\n // Increases the rotor value by 1\n const nIndex = (states.indexO... | [
"0.6244982",
"0.6001735",
"0.58806",
"0.5872234",
"0.58313847",
"0.5719371",
"0.56987554",
"0.5643383",
"0.5624412",
"0.56231046",
"0.5596488",
"0.55825365",
"0.55045193",
"0.5395409",
"0.53939646",
"0.5380289",
"0.5375629",
"0.53738284",
"0.5355385",
"0.534837",
"0.5337877",... | 0.65889955 | 0 |
Create a list of shopping items. You should use an unordered list. All of your HTML should go inside the Div tag with the id "content". | function exerciseTwo(shopping) {
let content = document.querySelector('#content');
const uList = document.createElement('ul');
shopping.forEach(item => {
const ulItem = document.createElement('li');
ulItem.innerText = item;
uList.appendChild(ulItem);
})
content.appendChild(uList)
//Write your... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createList(){ \n\tstate.items.forEach(function(item){\n\tvar theHtml = \n\t'<li>' +\n\t\t'<span class=\"shopping-item\">' + item.displayName + '</span>' +\n\t\t'<div class=\"shopping-item-controls\">' +\n\t\t\t'<button class=\"shopping-item-toggle\">' +\n\t\t\t\t'<span class=\"button-label\">check</span>'... | [
"0.78645",
"0.7308984",
"0.7270829",
"0.71921235",
"0.7121915",
"0.695319",
"0.69322515",
"0.6869227",
"0.68314207",
"0.6785049",
"0.6771598",
"0.67592746",
"0.6727608",
"0.67122155",
"0.6711345",
"0.6700614",
"0.6694944",
"0.667984",
"0.66624874",
"0.66569585",
"0.66510123",... | 0.7435603 | 1 |
Asynchronously deploys smart contract and logs contract address | async function deploy() {
try {
const { contractAddress } = await sendTransaction('deploy', [{ data: bin }], undefined, null, true);
console.log(contractAddress);
} catch (error) {
log('fail', error);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function deploy(){\n\n // This is actually connecting to the node!\n\tlet web3 = new Web3( new Web3.providers.HttpProvider(\"http://10.50.0.2:22000\", net));\n\n \n // get account information\n let account = await web3.eth.personal.getAccounts();\n account = account[0];\n\n // sets up deplo... | [
"0.7337951",
"0.7219453",
"0.71425325",
"0.70058477",
"0.69682187",
"0.6913339",
"0.6909564",
"0.68967646",
"0.67575663",
"0.6707921",
"0.6694171",
"0.6593396",
"0.648783",
"0.6461808",
"0.64095914",
"0.6391935",
"0.63702446",
"0.6369932",
"0.63442636",
"0.6303825",
"0.629551... | 0.7742949 | 0 |
const [genderData, setGenderData] = useState([]); const [ageData, setAgeData] = useState([]); const [ethnicityData, setEthnicityData] = useState([]); const [yearRange, setYearRange] = useState("20052010"); const [ isLoading, setIsLoading ] = useState(true) | constructor(props) {
super(props);
this.state = {
ageData: [],
incomeData: [],
ethnicityData: [],
yearRange: "2005-2010"
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"prepareData() {\n\n let preparedData = [];\n\n if (!this.state.years) return;\n\n for (var i = 0; i < this.state.years.length; i++) {\n\n let year = this.state.years[i];\n\n preparedData.push({\n x: i,\n y: year.amount\n })\n }\n\n this.setState({preparedData: null}, () ... | [
"0.62922347",
"0.6288126",
"0.6263072",
"0.60108525",
"0.5918038",
"0.58937776",
"0.5866437",
"0.58526415",
"0.5841462",
"0.5837092",
"0.5787483",
"0.5780269",
"0.5775192",
"0.57245636",
"0.56804574",
"0.5679605",
"0.56694925",
"0.5643611",
"0.56394506",
"0.5634199",
"0.56306... | 0.7200239 | 0 |
Task 2: inning() Write a function called `inning` that generates a random number of points that a team scored in an inning. This should be a whole number between 0 and 2. | function inning(){
const score = (Math.round(Math.random() * 2));
return score;
// console.log(score);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function inning() {\n let points = Math.floor(Math.random() * 3);\n return points;\n}",
"function inning(){\n return Math.floor(Math.random() * 3)\n}",
"function inning(){\n return Math.floor(Math.random()*3)\n}",
"function inning(){\n return Math.floor(Math.random() * 3);\n}",
"function inning(min, m... | [
"0.7472893",
"0.68648934",
"0.68584454",
"0.68404317",
"0.68147117",
"0.64812",
"0.6204917",
"0.62032515",
"0.6195268",
"0.6164485",
"0.61515206",
"0.61514854",
"0.6144889",
"0.612744",
"0.61249095",
"0.61009365",
"0.6084312",
"0.60440975",
"0.6004269",
"0.5993238",
"0.593276... | 0.71322817 | 1 |
Task 4: Create a function called `scoreboard` that accepts the following parameters: (1) Callback function `inning` that you wrote above (2) A number of innings and returns the score at each pont in the game, like so: 1st inning: 0 2 2nd inning: 1 3 3rd inning: 1 3 4th inning: 2 4 5th inning: 4 6 6th inning: 4 6 7th in... | function scoreboard(getInningScore, cb, numberOfInnings) {
let currentInning = 1;
const scoreList = new Array(numberOfInnings + 1).fill({ Home: 0, Away: 0 });
const inningScore = getInningScore(cb, 1);
return () => {
const { Home, Away } = inningScore();
scoreList[currentInning] = { Home, Away };
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scoreboard(getInningScore, number) {\n\n let finalRuns = {\n 'Home': 0,\n 'Away': 0,\n }\n\n for (let i = 0; i < number; i++) {\n finalRuns.Home = finalRuns.Home + getInningScore(0,3);\n finalRuns.Away = finalRuns.Away + getInningScore(0,3);\n if(i === 0) {\n console.log(`${i+1}st i... | [
"0.7449134",
"0.692535",
"0.66121066",
"0.6458343",
"0.64457023",
"0.641005",
"0.6397325",
"0.6353209",
"0.6339297",
"0.63147324",
"0.6265793",
"0.62424624",
"0.62191284",
"0.6216569",
"0.62091374",
"0.62006074",
"0.6193599",
"0.61767936",
"0.6173257",
"0.61700976",
"0.616473... | 0.78643453 | 0 |
Updates element state based on `queryResult`, and switches to `nextActiveLensKey` if appropriate. | function update(queryResult, nextActiveLensKey) {
// NOTE: `unstable_batchedUpdates()` is necessary for now but can be removed
// in a future version of React.
ReactDOM.unstable_batchedUpdates(() => {
setCurrentPage(queryResult.currentPage);
setTotalPages(queryResult.totalPages);
setFilter... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_recomputeResults(query, oldResults) {\n if (this.paused) {\n // There's no reason to recompute the results now as we're still paused.\n // By flagging the query as \"dirty\", the recompute will be performed\n // when resumeObservers is called.\n ... | [
"0.5271559",
"0.512164",
"0.49990004",
"0.49869674",
"0.49258763",
"0.488851",
"0.4850528",
"0.48402977",
"0.47993612",
"0.4792179",
"0.47729668",
"0.473554",
"0.47293517",
"0.4727209",
"0.46770623",
"0.466534",
"0.46628743",
"0.46348563",
"0.46252152",
"0.46220443",
"0.46220... | 0.750734 | 0 |
change_script Changes the lower windows contents location to the location indicated by script | function change_script (script) {
if (top.location != self.location)
parent.lower.document.location.href = script
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changePage(site)\r\n{\r\n\tself.location = site;\r\n}",
"function changeWebPage(pageName) {\n window.location.href = pageName;\n}",
"function changePage() {\r\n window.location.assign('index.html');\r\n }",
"static reloadCurrentScript() {\n event_sliderUpdate();\n ToxenScriptManag... | [
"0.55017596",
"0.5465632",
"0.54210246",
"0.53987074",
"0.53687453",
"0.5348628",
"0.51994944",
"0.5165775",
"0.5131217",
"0.5112331",
"0.50946754",
"0.50861603",
"0.50723076",
"0.5029091",
"0.5007848",
"0.49964723",
"0.49961525",
"0.4984121",
"0.49801987",
"0.49656546",
"0.4... | 0.70293146 | 0 |
change_frames Switches between framed and non framed environment. If you start with the nonframe version and then go to frames their will always be a ? in the URL. This is the way I intended the files to be used. If you start with the framed version the first time you try to go to nonframed it will appear to do nothing... | function change_frames () {
if (top.document.URL.indexOf ("$$$") != -1)
return self.document.URL
else {
path = document.URL.split ("/")
return ("index.html?$$$" + path[path.length - 1] + "$$$")
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changeFrame(req) {\n var link;\n if (req === \"demo-songs\") {\n link = \"frames/demos/index.html\";\n }else{\n link = \"frames/frame2.html\";\n }\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n docume... | [
"0.6682557",
"0.661662",
"0.65562433",
"0.65349025",
"0.64681363",
"0.6440067",
"0.6416697",
"0.63135904",
"0.6109264",
"0.5998432",
"0.5981744",
"0.5821885",
"0.5804528",
"0.5769923",
"0.5738624",
"0.57308096",
"0.57166845",
"0.57155585",
"0.57049227",
"0.5671122",
"0.566763... | 0.7872865 | 0 |
script_viewable Returns 'frame' if the second frame is viewable, otherwise it returns 'script'. See change_frames for further information. | function script_viewable () {
if (top.document.URL.indexOf ("$$$") != -1)
return "Frame"
else {
return "Script"
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pixflow_detectPosition(){\r\n 'use strict';\r\n\r\n if(window.self === window.top){\r\n return 'front-end';\r\n }else{\r\n var $top = top.location.href;\r\n if($top.indexOf(\"customize.php\") != -1){\r\n if($('#vc-link').length){\r\n return 'customiz... | [
"0.46460223",
"0.4639867",
"0.46197146",
"0.45610452",
"0.450233",
"0.44404158",
"0.4428859",
"0.441936",
"0.4415063",
"0.43726975",
"0.43356383",
"0.43313628",
"0.43033126",
"0.4298026",
"0.4288634",
"0.42846173",
"0.4230144",
"0.420905",
"0.4206196",
"0.42030776",
"0.420016... | 0.78031147 | 0 |
get_upper_frame Returns all the information between the $$$'s in the sites url. If there is more than two $$$'s in the URL only the information between the first and second $$$ will be returned. If there are no $$$'s in the URL toc.html will be returned. | function get_upper_frame () {
path = top.document.URL.split ("$$$")
if (path[0].length != top.document.URL.length)
return path[1]
else
return "toc.html"
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function change_frames () {\n if (top.document.URL.indexOf (\"$$$\") != -1)\n return self.document.URL\n else {\n\tpath = document.URL.split (\"/\")\n\treturn (\"index.html?$$$\" + path[path.length - 1] + \"$$$\")\n }\n}",
"function getThisPage() {\n var result = '';\n var url = window.locati... | [
"0.62405443",
"0.5325251",
"0.52733636",
"0.5136634",
"0.5126354",
"0.5112361",
"0.49980566",
"0.49919647",
"0.4881189",
"0.48806947",
"0.4862911",
"0.48035887",
"0.47913677",
"0.47907794",
"0.47780755",
"0.47780755",
"0.47780755",
"0.47780755",
"0.47778234",
"0.47778234",
"0... | 0.7513767 | 0 |
Calculate the eigenvalues and output to the DOM | function find_eig() {
// This method will print the result to the user.
// Remove the previous answer.
$("#answer").remove();
var matrix = get_entries();
try {
// sol is an array of the eigenvalues
var sol = numeric.eig(matrix).lambda.x;
var ans_text = "The answer is " + "... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_matrix() {\n // These methods clear of the previous calculations.\n $(\"#matrix_holder1\").empty();\n $(\"#solve_button\").remove();\n $(\"#answer\").remove();\n\n // Show the brackets around the matrix\n $(\"#matrix_holder1\").show();\n\n // Get the number of rows.\n var r = ... | [
"0.67994636",
"0.6535036",
"0.6218107",
"0.5716659",
"0.5609803",
"0.5369778",
"0.5345583",
"0.5329734",
"0.52824795",
"0.52425396",
"0.49800885",
"0.49691924",
"0.49674553",
"0.4966361",
"0.49530023",
"0.49485278",
"0.49086028",
"0.48906845",
"0.48451865",
"0.48018134",
"0.4... | 0.7551102 | 0 |
uploading a video to youtube | async function runUpload(videoInfo, userId) {
console.log('This is in upload.js', userId);
try {
const filePath = videoInfo.videoFilePath;
if (!filePath) throw new Error('Wrong file path.');
const fileSize = fs.statSync(filePath).size;
// initialize the Youtube API library
const youtube = goog... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uploadMatchToYoutube(match, videoFile, privacyStatus, callback) {\n console.log('Starting to upload to youtube: ' + videoFile)\n youtube.videos.insert({\n part: 'status, snippet',\n resource: {\n snippet: {\n title: getVideoTitle(match),\n descr... | [
"0.7133577",
"0.6496792",
"0.64878905",
"0.6406907",
"0.635039",
"0.6301589",
"0.6257656",
"0.62392145",
"0.6234906",
"0.6234906",
"0.6234906",
"0.6234906",
"0.6234906",
"0.6230164",
"0.6230164",
"0.62205136",
"0.62205136",
"0.62205136",
"0.6168219",
"0.61039025",
"0.6097983"... | 0.6596934 | 1 |
It will then return the time in words This code is garbage, far from dry and I'll need to come back to clean it but it was my first "medium" challenge completed :) | function timeInWords(h, m) {
let timeString;
let wArray = [
" o' clock",
"one",
"two",
"three",
"four",
"five",
"six",
"seven",
"eight",
"nine",
"ten",
"eleven",
"twelve",
"thirteen",
"fourteen",
"fifteen",
"sixteen",
"seventeen",
"eightee... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function timeInWords (time) {\n const timeArr = time.split(':');\n const [h, m] = timeArr.map((timeStr) => parseInt(timeStr));\n //create hash for conversions\n const timeConvert = {\n 1 : 'one',\n 2 : 'two',\n 3 : 'three',\n 4 : 'four',\n 5 : 'five',\n 6 : 'six',\n 7 : 'seven',\n 8 : '... | [
"0.79481083",
"0.7480607",
"0.74736214",
"0.71578914",
"0.7131784",
"0.6885034",
"0.6820781",
"0.6756992",
"0.6719466",
"0.65489906",
"0.65178937",
"0.64546233",
"0.6318346",
"0.62023187",
"0.61569315",
"0.61359644",
"0.61301965",
"0.6120633",
"0.6113242",
"0.61054456",
"0.61... | 0.7777252 | 1 |
END Seller Regisration Validation / START Seller Verification Validation | function sellerVerficationValidation() {
var isValid = true;
for (var i = 0; i < document.forms["verificationForm"].length-1; i++) {
var myID = document.forms["verificationForm"].elements[i].id;
if(myID != ""){
if (document.getElementById(myID).className.indexOf("formfield_req")>-1) {
if (document.forms["v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validate() {\n\t//validate pickup information\n\tif (validatePickup()) {\n\t\t\n\t\t//validate name and phone\n\t\tif (validateInfo()) {\n\t\t\t\n\t\t\t//validate credit card\n\t\t\tif (validateCC()) {\n\t\t\t\t\n\t\t\t\t//proceed\n\t\t\t\tcompleteOrder();\n\t\t\t}\n\t\t}\n\t}\n}",
"function initialvali... | [
"0.611949",
"0.6044735",
"0.6039028",
"0.60196954",
"0.59492767",
"0.5924263",
"0.59221613",
"0.58824664",
"0.58096814",
"0.5807174",
"0.57660323",
"0.5742416",
"0.5725867",
"0.57209074",
"0.57191896",
"0.57159257",
"0.5700942",
"0.56864864",
"0.56755143",
"0.567531",
"0.5666... | 0.6087172 | 1 |
plots selected equation from drop down menu | function plotDropEquation(){
canvasContext.strokeStyle="#FF0000";
canvasContext.beginPath();
canvasContext.translate(canvas.width/2,(canvas.height+jump)/2-offset);
for (var x = -canvas.width/2; x <= canvas.width; x += jump) {
canvasContext.lineTo(-x,eval(document.getElementById('dropmenu').val... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function plotFunctions() {\n var valueSelect = d3.select(\"#selDataset\").node().value;\n panelPlot(valueSelect);\n Graph (valueSelect);\n gaugeChart (valueSelect);\n console.log(valueSelect)}",
"function plotEquation(){\n\n canvasContext.strokeStyle=\"#FF0000\";\n\n canvasContext.beginPath();\n canvasCo... | [
"0.6475724",
"0.6343516",
"0.6249049",
"0.6209029",
"0.6181486",
"0.6173912",
"0.6135221",
"0.6107143",
"0.60978353",
"0.6082194",
"0.6072796",
"0.60155785",
"0.59717315",
"0.5968196",
"0.5962636",
"0.5957252",
"0.5943346",
"0.5930271",
"0.59296155",
"0.591889",
"0.5902329",
... | 0.63898814 | 1 |
plots equations in text box | function plotEquation(){
canvasContext.strokeStyle="#FF0000";
canvasContext.beginPath();
canvasContext.translate(canvas.width/2,(canvas.height+jump)/2-offset);
for (var x = -canvas.width/2; x <= canvas.width; x += jump) {
canvasContext.lineTo(-x, eval(document.data.equation.value));
}
canvasContext.st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"insertEquation() {\r\n\t\t\t\ttextInserter.insertText(codemirror, \"$$$$\", 2);\r\n\t\t\t}",
"function drawFormula() {\n fill(fgColor)\n .strokeWeight(0)\n .textSize(24);\n text(a + ' x ' + (b >= 0 ? '+ ' : '- ') + Math.abs(b) + ' y = ' + c, 20, 40);\n text('a: ', 20, 100);\n text('b: ', 20, 140);\n t... | [
"0.60861945",
"0.60674024",
"0.5988871",
"0.58630776",
"0.5844371",
"0.5798341",
"0.5777414",
"0.5722596",
"0.56918913",
"0.5664345",
"0.56424695",
"0.5640777",
"0.5618829",
"0.560373",
"0.5599359",
"0.5598868",
"0.5598056",
"0.5597333",
"0.55953026",
"0.5574745",
"0.55708295... | 0.6404256 | 0 |
enables drop down menu | function enableDrop(){
document.getElementById('dropmenu').disabled = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function barOption1Selected() {\r\n enableOption1Controls();\r\n}",
"function barOption2Selected() {\r\n enableOption2Controls();\r\n}",
"function enableMenu() {\n\n\t$(\"#menuIconImg\").show();\n\t$(\"#menuLink\").show();\n\tchangeMenuVisibility();\n}",
"showDropdownBtn() { $('#dropdownBtn').show(); }... | [
"0.6900009",
"0.6800924",
"0.6692711",
"0.6665349",
"0.6645534",
"0.66215277",
"0.65544903",
"0.6531145",
"0.64736015",
"0.64545673",
"0.6435661",
"0.6431",
"0.641753",
"0.6408568",
"0.640521",
"0.63910073",
"0.63655925",
"0.6331695",
"0.6328712",
"0.6319907",
"0.6306428",
... | 0.70579267 | 0 |
disables drop down menu | function disableDrop(){
document.getElementById('dropmenu').disabled = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableDrop(){\n document.getElementById('dropmenu').disabled = false;\n}",
"function disableselect(e){\r\nreturn false\r\n}",
"function disableModuleSelect() {\n\n\tif (!newProject&&moduleSelect.length) {\n\t\tmoduleSelect.disabled = false;\n\t\tdisableButton(goModuleButton, false);\n\t\tdisableButto... | [
"0.7678856",
"0.7191469",
"0.6982792",
"0.68617564",
"0.6848201",
"0.6828394",
"0.6818954",
"0.6768637",
"0.67316926",
"0.66903776",
"0.6674507",
"0.66456515",
"0.65621054",
"0.6530891",
"0.65224135",
"0.65170664",
"0.6512468",
"0.6489174",
"0.6489174",
"0.6489174",
"0.648917... | 0.774851 | 0 |
enables manual plot text box and plot button | function enableManualPlot(){
document.getElementById('Plot').disabled = false;
document.getElementById('manEquation').disabled = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function showAddPlotDialog (){ model.style.display = \"block\"; }",
"function disableManualPlot(){\n document.getElementById('Plot').disabled = true;\n document.getElementById('manEquation').disabled = true;\n}",
"function optionChanged(id) {\n CreatePlot(id);\n}",
"function optionChanged() {\n build... | [
"0.71120644",
"0.6951595",
"0.6396129",
"0.6285328",
"0.6261842",
"0.621861",
"0.62068456",
"0.60985935",
"0.6073632",
"0.5961982",
"0.5956501",
"0.59545994",
"0.593389",
"0.5908035",
"0.5905988",
"0.589358",
"0.5888632",
"0.5883215",
"0.58763534",
"0.5848007",
"0.5841315",
... | 0.7352267 | 0 |
disables manual plot text box and plot button | function disableManualPlot(){
document.getElementById('Plot').disabled = true;
document.getElementById('manEquation').disabled = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function enableManualPlot(){\n document.getElementById('Plot').disabled = false;\n document.getElementById('manEquation').disabled = false;\n}",
"function hideAxes() {\n statusShowAxes = false;\n}",
"function tooltipOff() {\r\n d3.event.preventDefault();\r\n tooltip.style(\"opacity\", \"0\");\r\n }... | [
"0.78216815",
"0.71336",
"0.64925694",
"0.6353902",
"0.6322119",
"0.6321452",
"0.63128483",
"0.6304805",
"0.6290164",
"0.6289495",
"0.6273718",
"0.6253163",
"0.6235808",
"0.6227191",
"0.6194886",
"0.61534697",
"0.61377054",
"0.61227554",
"0.61215323",
"0.6120341",
"0.6077644"... | 0.803513 | 0 |
Nice EventEmitter more objectfriendly: listeners can be objects (i.e. no need to "bind" on listening methods) easier to find leaks: debug counting allows each "class" of listeners to set its own maximum number easier to stop listening: per listener (i.e. no need to keep track of each "on" so you can "remove" later) eas... | function EventEmitter () {
this._listenersPerEventId = {};
if (debugLevel > 0) {
this._maxCountPerListenerKey = {};
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EventEmitter () {\r\n this._listenersPerEventId = {};\r\n\r\n if (debugLevel > 0) {\r\n this._maxCountPerListenerKey = {};\r\n }\r\n}",
"function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined;}",
"function EventEmitter(){this._events=this... | [
"0.75597435",
"0.67856246",
"0.67856246",
"0.67856246",
"0.67856246",
"0.6770112",
"0.6768032",
"0.6637869",
"0.6622147",
"0.65377796",
"0.65377796",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
"0.65145916",
... | 0.7568304 | 0 |
Nice EventEmitter more objectfriendly: listeners can be objects (i.e. no need to "bind" on listening methods) easier to find leaks: debug counting allows each "class" of listeners to set its own maximum number easier to stop listening: per listener (i.e. no need to keep track of each "on" so you can "remove" later) eas... | function EventEmitter () {
this._listenersPerEventId = {};
if (debugLevel > 0) {
this._maxCountPerListenerKey = {};
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function EventEmitter () {\n this._listenersPerEventId = {};\n\n if (debugLevel > 0) {\n this._maxCountPerListenerKey = {};\n }\n}",
"function EventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined;}",
"function EventEmitter(){this._events=this._events||{}... | [
"0.7567336",
"0.6786036",
"0.6786036",
"0.6786036",
"0.6786036",
"0.67698234",
"0.67688996",
"0.6638186",
"0.66227096",
"0.65379894",
"0.65379894",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608",
"0.6514608"... | 0.7558776 | 1 |
What happens when adding/removing listeners during an emit on same event ID. | function addRemoveDuringEmitTest () {
EventEmitter.setDebugLevel(EventEmitter.DEBUG_THROW);
var signaler = new MySignaler();
var ear1 = new Ear(1), ear2 = new Ear(2), ear3 = new Ear(3), ear4 = new Ear(4);
ear1.onSignal1 = function () {
signaler.forgetListener(this);
signaler.on('signal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function emit() {}",
"on(eventName: string, callback: Function): number {\n const listener = new Listener(eventName, callback);\n const id = this.nextListenerId();\n this.eventListeners[id] = listener;\n this.subEmitter.on(eventName, listener.cb);\n return id;\n }",
"addListener(callback) {\n ... | [
"0.6051913",
"0.6040426",
"0.59458953",
"0.58462554",
"0.58462554",
"0.57185936",
"0.57046",
"0.5677042",
"0.5677042",
"0.5677042",
"0.5677042",
"0.56230116",
"0.5534718",
"0.55293083",
"0.55291724",
"0.55206686",
"0.5520033",
"0.5520033",
"0.55129373",
"0.54592335",
"0.54444... | 0.64517576 | 0 |
setAt(idx, val): set val at idx to val | setAt(idx, val) {
let node = this.head
if (!this.head) throw Error("Empty array");
if (idx > this.length) throw Error("Index out of array");
if (idx === 0) {
this.head.val = val;
return
}
for (let i=0; i<idx; i++) {
node = node.next;
}
node.val = val;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setAt(idx, val) {\n if (idx >= this.length || idx < 0) {\n throw new Error(\"Invalid Index\");\n }\n //changes the value at the index passed in\n let cur = this._get(idx);\n cur.val = val;\n }",
"setAt(idx, val) {\n let currentNode = this.head;\n let currentIdx = 0;\n while (current... | [
"0.8671692",
"0.7752648",
"0.74485695",
"0.73912346",
"0.7375251",
"0.71297866",
"0.70760804",
"0.68310356",
"0.68274814",
"0.68193126",
"0.68193126",
"0.66991675",
"0.66862386",
"0.6683245",
"0.6582582",
"0.6553709",
"0.6553709",
"0.6534765",
"0.6390302",
"0.63900965",
"0.63... | 0.77899754 | 1 |
Enqueue a callback to be run at the end of the current batching cycle. Throws if no updates are currently being performed. | function asap(callback, context) {
invariant(batchingStrategy.isBatchingUpdates, "ReactUpdates.asap: Can't enqueue an asap callback in a context where" + 'updates are not being batched.');
asapCallbackQueue.enqueue(callback, context);
asapEnqueued = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function asap(callback, context) {\n !batchingStrategy.isBatchingUpdates ? false ? undefined : _prodInvariant('125') : void 0;\n asapCallbackQueue.enqueue(callback, context);\n asapEnqueued = true;\n}",
"function asap(callback, context) {\n invariant(batchingStrategy.isBatchingUpdates, \"ReactUpdates.asap: ... | [
"0.6511576",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"0.6220726",
"... | 0.6275929 | 1 |
Constructor for creating a raw PromiseState. DO NOT USE DIRECTLY. Instead, use PromiseState.create() or other static constructors | function PromiseState(_ref) {
var _ref$pending = _ref.pending,
pending = _ref$pending === undefined ? false : _ref$pending,
_ref$refreshing = _ref.refreshing,
refreshing = _ref$refreshing === undefined ? false : _ref$refreshing,
_ref$fulfilled = _ref.fulfilled,
fulfille... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor() {\n\n // initially all promises are set to \"pending\", this can only be changed once\n\n this[stateSymbol] = PENDING;\n\n // make sure we can detect whether those values have been set before\n\n this[valueSymbol] = notSetSymbol;\n\n this[reasonSymbol] = notSetSymbo... | [
"0.63987315",
"0.60963476",
"0.605486",
"0.59537655",
"0.5797212",
"0.56980985",
"0.56617033",
"0.5658314",
"0.5640306",
"0.56218445",
"0.56022877",
"0.55657685",
"0.5557196",
"0.55404204",
"0.5526294",
"0.5473406",
"0.5460748",
"0.5460499",
"0.54576004",
"0.544433",
"0.54359... | 0.7190476 | 0 |
Function: KnxNetProtocolExtra.sendAck This function is used to send acknowledge messages to the KNXIP interface Normally, the library would take care of this IF it is able to parse the incoming message If not, which may be caused by a broken message, it wont send a acknowledge which would cause the KNXIP interface to k... | sendAck (seqnum, conContext) {
conContext.send(KnxNetProtocol.prepareDatagram(KnxConstants.SERVICE_TYPE.TUNNELING_ACK, null, seqnum, conContext))
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function ack() {\n debug('ack delivery', data.fields.deliveryTag);\n ch.ack(data);\n }",
"async ack(msg) {\n // We must not acknowledge messages if we turned that feature off.\n if (this.config.consumeOptions.noAck === true) return;\n await this.channel.ack(msg);\n }",
"processOAck... | [
"0.5696592",
"0.567419",
"0.5628433",
"0.5627809",
"0.5468147",
"0.5446536",
"0.53706026",
"0.5357052",
"0.52817327",
"0.52549475",
"0.52549475",
"0.5235123",
"0.5198464",
"0.51501286",
"0.514589",
"0.5140592",
"0.5102784",
"0.5018965",
"0.5005807",
"0.5003346",
"0.5003346",
... | 0.8194157 | 0 |
Function: KnxNetProtocolExtra.msgGetSeqnum This function extracts the sequence number from a message May only be needed to work with FSM.prototype.sendAck Arguments: message The message to work on as a raw Buffer NOT in Json | msgGetSeqnum (message) {
return message[message[0] + 2]
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getSeqNumber(channel_id) {\n sortBy = ['message_id'];\n let channels = repository.objects('Messages').filtered(`channel_id = \"${channel_id}\"`)\n .sorted(sortBy);\n if (channels.length === 0)\n return 0;\n else\n return channels[channels.length -... | [
"0.6158223",
"0.5815139",
"0.5657087",
"0.54539675",
"0.53695345",
"0.52533627",
"0.5095129",
"0.5078004",
"0.5008955",
"0.4953989",
"0.49348384",
"0.48571596",
"0.48571596",
"0.48262408",
"0.48087993",
"0.48046145",
"0.48009607",
"0.47429803",
"0.4691052",
"0.46902302",
"0.4... | 0.8471953 | 0 |
Function: KnxNetProtocolExtra.messageMatchesTemplate() This function checks if a KNX message matches a given template (both JSON objects) It checks if every element contained in the template is the same as it is in the message NOTE that: a: Buffer([1]) is treated as equal to a: 1 Arguments: template The template to che... | messageMatchesTemplate (template, rawMsgJson) {
// Check if both are defined
if (!(template && rawMsgJson)) {
return -1
}
for (let e in template) {
// Check if the current element exists in template
if (template.hasOwnProperty(e)) {
// Check if the current element exists in ra... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function matchKeyCode(remoteName, template, target) {\n var templateCodes = template.split(\" \");\n var maxCodeValue = 0;\n var minCodeValue = 1000000;\n\n var templateCodeLength = templateCodes.length - 1;\n logger.debug(\"per \" + remoteName + \" /// target length \" + target.length + \" and temp... | [
"0.53005743",
"0.5223192",
"0.51047724",
"0.5047794",
"0.5047794",
"0.5047794",
"0.5047794",
"0.5024711",
"0.48889765",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.4788797",
"0.47452646",
"0.45704746"... | 0.8497079 | 0 |
Works in the same way as other forms The User's for the group are added one by one using the plus icon each added user is stored in the state under members and displayed for the user to see | render() {
return (
<Form>
<Form.Field>
<Input
label = "New Group:"
placeholder="Group name"
onChange={this.handleInputChange}
/>
</Form.Field>
<Form.Field>
<Inp... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addMember() {\n let newMember = document.getElementById(\"new-member\").value;\n this.state.members.push(newMember);\n this.setState(\n {\n members: this.state.members\n }\n );\n }",
"addUser(user) {\n user.addToGroup(this);\n }",
"f... | [
"0.65730083",
"0.64981425",
"0.6446672",
"0.64424926",
"0.6381639",
"0.63754314",
"0.63457966",
"0.6284535",
"0.62689984",
"0.6227176",
"0.6206974",
"0.62059045",
"0.6204735",
"0.61898315",
"0.6188885",
"0.6159105",
"0.61323845",
"0.6128122",
"0.6090825",
"0.60760987",
"0.607... | 0.65894336 | 0 |
Changes interface color based on shown page | function changeColor(){
//page array
pageHashes = ['home', 'about-me', 'projects', 'contact-me'];
//get current page
var page=getPageNumber();
//change logo if page is changed
var logo='#logo'+page;
var color='color'+page;
if(!$(logo).is(':visible')){
$('.logo').stop(true, true);
$('.logo:visible').fadeOu... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changePageColor(color) {\n document.getElementsByTagName(\"body\")[0].style.backgroundColor = color;\n}",
"function setPageBackgroundColor() {\n chrome.storage.sync.get(\"color\", ({ color }) => {\n document.body.style.backgroundColor = color;\n });\n }",
"function turnjs_setbgcolor() {... | [
"0.66571695",
"0.64769876",
"0.64087373",
"0.63518924",
"0.63518924",
"0.63518924",
"0.6320374",
"0.63059044",
"0.6293164",
"0.6231712",
"0.6216556",
"0.6198891",
"0.6186326",
"0.61861676",
"0.6185802",
"0.6177883",
"0.61360747",
"0.6128887",
"0.61288315",
"0.6123488",
"0.609... | 0.6894307 | 0 |
Returns page number based on positions | function getPageNumber(){
//get positions of each page and scrollbar
var position=$(window).scrollTop();
var positions=[];
positions[0]=$('#page1').offset().top;
positions[1]=$('#page2').offset().top-160;
positions[2]=$('#page3').offset().top-160;
positions[3]=$('#page4').offset().top-160;
//calculate page num... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"PAGE(context){\n /**category: Numbering */\n /**desc: Insert the total number of pages in the document*/\n /**formula:[\\* Format Switch]*/\n /**switches:*:Page number formatting options*/\n const {topFrame:{props:{i=0,I=0}}}=context.selection?.props('page')||{topFrame:{props:{}}... | [
"0.71280426",
"0.6613452",
"0.6575567",
"0.6476555",
"0.63600767",
"0.63418794",
"0.6283435",
"0.62550205",
"0.625432",
"0.6144207",
"0.61401916",
"0.6139864",
"0.6096475",
"0.60724145",
"0.604104",
"0.6032491",
"0.6032402",
"0.6029582",
"0.60241497",
"0.59983516",
"0.5970530... | 0.7656736 | 0 |
purelyWrapUnit: Unit test wrapper function. This is called within a loop over input scenarios, returning an object that includes the input object and has the actual program outputs inserted | function purelyWrapUnit(callScenario) {// json object for a single scenario, with inputs and
// expected outputs
const [mock_yn, timeWidth, dpTotals, dpPerCall, callsWidth] =
[...Utils.csvToLis(callScenario.inp[SCALARS][0]).map(v => v === '' ? undefined : v)];
const ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function purelyWrapUnit(inpGroups) { // input groups object\n\n let inMeta = {};\n let exceptions = [];\n let utOutput = {};\n const repFields = inpGroups[INP_TITLE][0].split(DELIM)\n inMeta.title = repFields[0];\n inMeta.inp = getGroups(inpGroups[INP_FIELDS]);\n inMeta.out = getGroups(inpGroups[OUT_FIELDS]... | [
"0.67355305",
"0.6242392",
"0.6202043",
"0.59703946",
"0.58996046",
"0.5839351",
"0.57986987",
"0.57668203",
"0.576577",
"0.5750804",
"0.5750804",
"0.5750804",
"0.5750804",
"0.57228166",
"0.57115436",
"0.57096225",
"0.5695944",
"0.5689616",
"0.5677696",
"0.5662689",
"0.555595... | 0.68888944 | 0 |
Create a "close" button and append it to each list item | function createCloseButtons(){
var myNodelist = document.getElementsByTagName("LI");
var i;
for (i = 0; i < myNodelist.length; i++) {
var span = document.createElement("SPAN");
var txt = document.createTextNode("\u00D7");
span.className = "cl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newElement() {\r\n var li = document.createElement(\"li\");\r\n var inputValue = document.getElementById(\"myInput\").value;\r\n var t = document.createTextNode(inputValue);\r\n li.appendChild(t);\r\n if (inputValue === '') {\r\n alert(\"You gotta write someting my man!\");\r\n } else {\r\n do... | [
"0.70477676",
"0.7035839",
"0.7008111",
"0.6987866",
"0.69657844",
"0.690129",
"0.6834717",
"0.68308043",
"0.67890763",
"0.6761907",
"0.6713435",
"0.67127466",
"0.66887087",
"0.66887087",
"0.6680174",
"0.6662078",
"0.66606206",
"0.6660083",
"0.6643924",
"0.6622115",
"0.660926... | 0.7902229 | 0 |
Perform the actual deployment of a bootstrap stack, given a template and some parameters | async function deployBootstrapStack(template, parameters, environment, sdkProvider, options) {
var _a, _b, _c;
const toolkitStackName = (_a = options.toolkitStackName) !== null && _a !== void 0 ? _a : toolkit_info_1.DEFAULT_TOOLKIT_STACK_NAME;
const resolvedEnvironment = await sdkProvider.resolveEnvironment... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cmdDeploy(template, inputParams, args, cfmateConfigFile, configOverrides) {\n return __awaiter(this, void 0, void 0, function* () {\n const templateAbsPath = resolvePath(template);\n const tpl = yield loadTemplate(templateAbsPath);\n const doc = new CfnTemplate(tpl);\n const... | [
"0.65421677",
"0.59368896",
"0.5766868",
"0.572191",
"0.5548973",
"0.5529298",
"0.5463046",
"0.5457521",
"0.5435793",
"0.5433173",
"0.5423778",
"0.541948",
"0.5375168",
"0.5364346",
"0.53596205",
"0.53508115",
"0.53195596",
"0.530011",
"0.52939856",
"0.5273865",
"0.5267615",
... | 0.7415206 | 0 |
In this challenge, we're going to implement a 'curry' function for an arbitrary number of arguments. `curryN` will take two parameters: a) fn: The function we want to curry. b) n: Optional number of arguments to curry. If not supplied, `curryN` should use the fn's arity as the value for `n`. NOTES This solution was hea... | function curryN(fn,n){
//if curryN is not passed an "n", we use fn.'s length
if (typeof n != 'number') n = fn.length;
//define a function to curry fn as many times
//as fn has arguments
function getCurriedFn(prev){
return function(arg){
//concat the previously received arguments with new ones
var args =... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function curryN(fn, n) {\n if(typeof n !== 'number') {\n n = fn.length;\n } \n function genCurry(prev) {\n return function (arg) {\n var args = prev.concat(arg)\n if (args.length < n) {\n return genCurry(args)\n }\n return fn.apply(this, args)\n }\n }\n return genCurry([]);... | [
"0.8173231",
"0.78645617",
"0.78645617",
"0.77038336",
"0.7518138",
"0.7355892",
"0.7316327",
"0.7285176",
"0.72388",
"0.72280127",
"0.7102253",
"0.7076854",
"0.70509005",
"0.7024098",
"0.7014942",
"0.7000659",
"0.6985999",
"0.6952807",
"0.6801557",
"0.6791536",
"0.6762806",
... | 0.83243465 | 0 |
Constructor for creating objects that inherit from jCanvas preferences and defaults | function jCanvasObject( args ) {
var params = this,
propName;
// Copy the given parameters into new object
for ( propName in args ) {
// Do not merge defaults into parameters
if ( args.hasOwnProperty( propName ) ) {
params[ propName ] = args[ propName ];
}
}
return params;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function jCanvasDefaults() {\n\textendObject( this, jCanvasDefaults.baseDefaults );\n}",
"function CanvasBasicObject() { }",
"function Canvas(options) \n{\n var arrayCanvas = new Array();\n var clickX = new Array();\n var clickY = new Array();\n var clickDrag = new Array();\n var pens = new Arra... | [
"0.7548866",
"0.632005",
"0.5987705",
"0.59762275",
"0.5899912",
"0.58774585",
"0.5828846",
"0.5823633",
"0.5821818",
"0.5812158",
"0.58102477",
"0.5797591",
"0.57766175",
"0.5757573",
"0.5754968",
"0.57506794",
"0.57506794",
"0.5730721",
"0.5722553",
"0.57183164",
"0.5717379... | 0.6620547 | 1 |
jCanvas default property values | function jCanvasDefaults() {
extendObject( this, jCanvasDefaults.baseDefaults );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static getDefaults() {\n return {\n frame:'chart center-container > view', whiskerLen:.3, y0:0, y1:0,\n attr:{stroke:'black', 'stroke-width':1}\n }\n }",
"static getDefaults() {\n return {\n frame:'chart center-container > view', whiskerLen:.3, width:.3, notchWidth:.25,\n... | [
"0.7155441",
"0.70443314",
"0.6962317",
"0.6860471",
"0.6813171",
"0.6777241",
"0.6755446",
"0.6723989",
"0.669323",
"0.66305625",
"0.66283256",
"0.64653367",
"0.6413357",
"0.6404805",
"0.62773275",
"0.6164656",
"0.6152383",
"0.6130618",
"0.61085516",
"0.60913354",
"0.6045821... | 0.77851844 | 0 |
Internal helper methods Determines if the given operand is a string | function isString( operand ) {
return ( typeOf( operand ) === 'string' );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function is_string(arg) {\r\n return typeof arg === 'string';\r\n }",
"function is_string( arg ) {\n return typeof arg === 'string';\n }",
"function isOperator(string) {\n return string == \"+/=\" || string == \"-\" || string == \"/\" || string == \"X\" || string == \"+\" || string == \"=\";\n... | [
"0.6788957",
"0.6774497",
"0.67662543",
"0.6711009",
"0.6666464",
"0.6631075",
"0.6631075",
"0.66197133",
"0.6617167",
"0.6617167",
"0.6617167",
"0.6617167",
"0.6617167",
"0.6617167",
"0.6605155",
"0.6595246",
"0.6589903",
"0.6589903",
"0.65554905",
"0.6511998",
"0.6511998",
... | 0.8037286 | 0 |
Determines if the given operand is numeric | function isNumeric( operand ) {
return !isNaN( Number( operand ) ) && !isNaN( parseFloat( operand ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isNumeric ( a ) {\n return !isNaN( parseFloat( a ) ) && isFinite( a );\n }",
"function isNumeric(num) {\r\n return !isNaN(num);\r\n}",
"function isNumeric(num){\n return !isNaN(num)\n}",
"function isNumeric(num){\n return !isNaN(num);\n}",
"function isNumeric(num) {\n return !i... | [
"0.75661844",
"0.7432333",
"0.74290895",
"0.7408513",
"0.7403218",
"0.7403218",
"0.7402455",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.73893744",
"0.7385928",
"0.7370283",
"0.... | 0.82883996 | 0 |
Get 2D context for the given canvas | function _getContext( canvas ) {
return ( canvas && canvas.getContext ? canvas.getContext( '2d' ) : NULL );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getContext() {\n return canvas.getContext(\"2d\");\n \n}",
"context() {\n return this._canvas.getContext('2d');\n }",
"getContext() {\n return this.canvas.getContext(\"2d\");\n }",
"get Context() {\n return this.canvas.getContext('2d')\n }",
"function getContext(canvas) {\n... | [
"0.79106075",
"0.7370537",
"0.73591375",
"0.71880347",
"0.70865273",
"0.69632274",
"0.68304473",
"0.6732129",
"0.6698602",
"0.6675013",
"0.6636827",
"0.6604787",
"0.655987",
"0.6512662",
"0.6509484",
"0.64666283",
"0.64571035",
"0.62911296",
"0.6286025",
"0.62765825",
"0.6215... | 0.79127544 | 0 |
Coerce designated number properties from strings to numbers | function _coerceNumericProps( props ) {
var propName, propType, propValue;
// Loop through all properties in given property map
for ( propName in props ) {
if ( props.hasOwnProperty( propName ) ) {
propValue = props[ propName ];
propType = typeOf( propValue );
// If property is non-empty string and value ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toNumber() {\n let m = this.if('#TextValue');\n let res = m.map(val => {\n let obj = parse(val);\n if (obj.num === null) {\n return val\n }\n let fmt = val.has('#Ordinal') ? 'Ordinal' : 'Cardinal';\n let str = format(obj, fmt);\n if (st... | [
"0.70686656",
"0.6817465",
"0.678181",
"0.6769409",
"0.6769409",
"0.65585697",
"0.6461578",
"0.6355106",
"0.63402003",
"0.62106144",
"0.62049",
"0.62012815",
"0.6198834",
"0.6174852",
"0.61046296",
"0.602203",
"0.5987092",
"0.5982519",
"0.5961856",
"0.59534174",
"0.59345984",... | 0.72108364 | 0 |
Clone the given transformations object | function _cloneTransforms( transforms ) {
// Clone the object itself
transforms = extendObject( {}, transforms );
// Clone the object's masks array
transforms.masks = transforms.masks.slice( 0 );
return transforms;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"clone() {\n return new Transformer(this.pos);\n }",
"cloneTransformed(transform) {\n const result = new CoordinateXYZ(this._xyz.clone());\n result.tryTransformInPlace(transform);\n return result;\n }",
"cloneTransformed(transform) {\n const result = this.clone();\n ... | [
"0.7221882",
"0.71565884",
"0.7060108",
"0.6230131",
"0.6230131",
"0.6230131",
"0.6230131",
"0.6229802",
"0.6077654",
"0.606563",
"0.6062456",
"0.60226107",
"0.6013123",
"0.60085154",
"0.60063964",
"0.59857273",
"0.59461844",
"0.5909295",
"0.587641",
"0.5876044",
"0.5849362",... | 0.74068207 | 0 |
Save canvas context and update transformation stack | function _saveCanvas( ctx, data ) {
var transforms;
ctx.save();
transforms = _cloneTransforms( data.transforms );
data.savedTransforms.push( transforms );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveToCanvasBuffer() {\n canvasBuffer = ctx.getImageData(0, 0, width, height);\n}",
"function trackTransforms(ctx) {\n var svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n var xform = svg.createSVGMatrix();\n ctx.getTransform = function(){ return xform; };\n ... | [
"0.6716318",
"0.65999246",
"0.6543278",
"0.6534112",
"0.6488852",
"0.6344783",
"0.63225573",
"0.6312975",
"0.6290813",
"0.6274573",
"0.6273725",
"0.62725246",
"0.6163285",
"0.60925835",
"0.6066513",
"0.6061827",
"0.6049023",
"0.6047447",
"0.60453653",
"0.604099",
"0.6027129",... | 0.75808483 | 0 |
Restore canvas context update transformation stack | function _restoreCanvas( ctx, data ) {
if ( data.savedTransforms.length === 0 ) {
// Reset transformation state if it can't be restored any more
data.transforms = _cloneTransforms( baseTransforms );
} else {
// Restore canvas context
ctx.restore();
// Restore current transform state to the last saved state
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _restoreTransform( ctx, params ) {\n\t// If shape has been transformed by jCanvas\n\tif ( params._transformed ) {\n\t\t// Restore canvas context\n\t\tctx.restore();\n\t}\n}",
"function resetTransform() {\n context.setTransform(1, 0, 0, 1, 0, 0);\n \n context.scale(canvas.width / WIDTH, canvas.h... | [
"0.7597793",
"0.73191077",
"0.7266346",
"0.6807369",
"0.65837324",
"0.6525398",
"0.65113354",
"0.6499648",
"0.64747196",
"0.6410015",
"0.63903064",
"0.6352323",
"0.6324514",
"0.6311947",
"0.6260833",
"0.6220467",
"0.61813635",
"0.6171161",
"0.6162595",
"0.6125869",
"0.6104100... | 0.7605175 | 0 |
Set the style with the given name | function _setStyle( canvas, ctx, params, styleName ) {
if ( params[ styleName ] ) {
if ( isFunction( params[ styleName ] ) ) {
// Handle functions
ctx[ styleName ] = params[ styleName ].call( canvas, params );
} else {
// Handle string values
ctx[ styleName ] = params[ styleName ];
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setStyle(styleName, styleValue) { this._styles.set(styleName, styleValue); return this }",
"function setStyleByClassName (className, styleProperty, value) {\n\n}",
"setStyle(style) {\r\n\t\tthis.style = style;\r\n\t}",
"updateStyle(style) {\n this.style = style\n }",
"function setStyleById(i, p, v) {\r... | [
"0.756771",
"0.67614156",
"0.6646595",
"0.6482919",
"0.6459941",
"0.64551",
"0.6439547",
"0.63472664",
"0.6267534",
"0.6254921",
"0.62494075",
"0.6218987",
"0.621405",
"0.6204433",
"0.6184049",
"0.617154",
"0.60787594",
"0.60787594",
"0.60131454",
"0.59609354",
"0.59477687",
... | 0.6800492 | 1 |
Set canvas context properties | function _setGlobalProps( canvas, ctx, params ) {
_setStyle( canvas, ctx, params, 'fillStyle' );
_setStyle( canvas, ctx, params, 'strokeStyle' );
ctx.lineWidth = params.strokeWidth;
// Optionally round corners for paths
if ( params.rounded ) {
ctx.lineCap = ctx.lineJoin = 'round';
} else {
ctx.lineCap = param... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setCanvasPreferences() {\n\tctx.lineWidth = 2;\n\tctx.lineJoin = \"round\";\n\tctx.lineCap = \"square\";\n\tctx.textAlign = \"center\";\n\tctx.textBaseline = \"center\";\n}",
"function init(){\n context = myCanvas.getContext('2d');\n}",
"function privateSetContext(canvas) {\n privateCanvas = c... | [
"0.7142978",
"0.6861992",
"0.6846992",
"0.6823741",
"0.66641366",
"0.6578107",
"0.6571844",
"0.65696144",
"0.6537726",
"0.64872444",
"0.646202",
"0.644653",
"0.6432409",
"0.63902915",
"0.63749444",
"0.6363096",
"0.63500834",
"0.634439",
"0.63400775",
"0.6326232",
"0.6307674",... | 0.6916853 | 1 |
Optionally enable masking support for this path | function _enableMasking( ctx, data, params ) {
if ( params.mask ) {
// If jCanvas autosave is enabled
if ( params.autosave ) {
// Automatically save transformation state by default
_saveCanvas( ctx, data );
}
// Clip the current path
ctx.clip();
// Keep track of current masks
data.transforms.masks.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getMask() {\n let normalized = this[_normalized];\n let mask = null;\n\n if (normalized.mask) {\n let src = this[_applicationSrc];\n mask = normalized.mask.map(path => join(src, path));\n } else {\n mask = this.getSrc();\n }\n\n return mask;\n }",
"masker() {\n return this.... | [
"0.6688473",
"0.6282485",
"0.6172076",
"0.6142731",
"0.6096356",
"0.60805357",
"0.60805357",
"0.60805357",
"0.60805357",
"0.6061907",
"0.57787967",
"0.5748135",
"0.57251775",
"0.57240397",
"0.56795377",
"0.55777246",
"0.5568658",
"0.547434",
"0.5469084",
"0.5420852",
"0.53886... | 0.6912328 | 0 |
Restore individual shape transformation | function _restoreTransform( ctx, params ) {
// If shape has been transformed by jCanvas
if ( params._transformed ) {
// Restore canvas context
ctx.restore();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function restoreTransformation () {\n selectSvgContainer();\n d3.zoom().transform(svg, transform);\n svg.attr(\"transform\", d3.zoomTransform(svg.node()));\n }",
"resetTransformations() {\n\t\t\t\tthis.saveStates([\"left\", \"top\", \"width\", \"height\", \"points\", \"transformations\"])... | [
"0.7072534",
"0.68522006",
"0.6688014",
"0.667017",
"0.65376616",
"0.6446327",
"0.63866836",
"0.634059",
"0.6315689",
"0.6128285",
"0.6060028",
"0.60578203",
"0.60578203",
"0.60578203",
"0.60578203",
"0.60578203",
"0.60578203",
"0.60578203",
"0.60478866",
"0.6024046",
"0.6005... | 0.76517594 | 0 |
Transform ( translate, scale, or rotate ) shape | function _transformShape( canvas, ctx, params, width, height ) {
// Get conversion factor for radians
params._toRad = ( params.inDegrees ? ( PI / 180 ) : 1 );
params._transformed = TRUE;
ctx.save();
// Optionally measure ( x, y ) position from top-left corner
if ( !params.fromCenter && !params._centered && wid... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function composeTransform(x, y, scaleX, scaleY, rot) {\n\n}",
"compose(o){if(o.origin){o.originX=o.origin[0];o.originY=o.origin[1]}// Get the parameters\nvar ox=o.originX||0,oy=o.originY||0,sx=o.scaleX||1,sy=o.scaleY||1,lam=o.shear||0,theta=o.rotate||0,tx=o.translateX||0,ty=o.translateY||0,result=new Matrix().tr... | [
"0.7541865",
"0.6888438",
"0.67727256",
"0.6766684",
"0.6494753",
"0.64502305",
"0.6428686",
"0.63980985",
"0.6383872",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6312562",
"0.6305689",
"0.63052523",
"0.63052523",
"0.63046545... | 0.75191706 | 1 |
Layer API Retrieved the stored jCanvas data for a canvas element | function _getCanvasData( canvas ) {
var dataCache = caches.dataCache, data;
if ( dataCache._canvas === canvas && dataCache._data ) {
// Retrieve canvas data from cache if possible
data = dataCache._data;
} else {
// Retrieve canvas data from jQuery's internal data storage
data = $.data( canvas, 'jCanvas' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getCanvasInfo() {\n\t\treturn this.objectModel.getCanvasInfo();\n\t}",
"get canvas() {\n return this.canvasElement;\n }",
"getCanvas() {\n\t\treturn this.objectModel.getCanvas(); // TODO - Remove this method when WML Canvas moves to pipeline flow\n\t}",
"get canvas() { return this.vo.canvas; }",
... | [
"0.69625324",
"0.66983193",
"0.64426863",
"0.6407391",
"0.63914186",
"0.6355529",
"0.63467467",
"0.63210267",
"0.6296393",
"0.6155491",
"0.61550605",
"0.61470073",
"0.61072665",
"0.60699445",
"0.59620744",
"0.59158814",
"0.58989096",
"0.58457273",
"0.58241355",
"0.58210087",
... | 0.7249457 | 0 |
Enable drag support for this layer | function _enableDrag( $canvas, data, layer ) {
var dragHelperEvents, eventName, i;
// Only make layer draggable if necessary
if ( layer.draggable || layer.cursors ) {
// Organize helper events which enable drag support
dragHelperEvents = [ 'mousedown', 'mousemove', 'mouseup' ];
// Bind each helper event to t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"startDragging() {\n this.dragging = false;\n if (!d3.event.active) this.simulation.alphaTarget(0.3).restart();\n }",
"function r(e){e._internalDrag=!0,e.setMode(\"drag\")}",
"option(type, disabled) {\n if (disabled) {\n this.setDraggable(false);\n } else {\n this.setDraggable(t... | [
"0.7119376",
"0.6825541",
"0.6809237",
"0.67909586",
"0.6630385",
"0.66169333",
"0.6609045",
"0.6587199",
"0.6550961",
"0.65408844",
"0.6503614",
"0.64902157",
"0.6472672",
"0.6472672",
"0.6458611",
"0.6458611",
"0.6451287",
"0.64391774",
"0.64126515",
"0.6398747",
"0.6396352... | 0.7370195 | 0 |
Create or update the data map for the given layer and group type | function _updateLayerGroups( $canvas, data, layer, props ) {
var groupMap = data.layer.groups,
group, groupName, g,
index, l;
// If group name is not changing
if ( !props ) {
props = layer;
} else {
// Remove layer from all of its associated groups
if ( props.groups !== UNDEFINED && layer.groups !== N... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function update() {\n for (let i = 0; i < geojsons.length; i++) {\n geojsons[i][0].addTo(mapObj)\n }\n layerObj = newLayer();\n controlsObj = makeControls();\n legend.addTo(mapObj);\n}",
"function update_map(map) {\n\t// First remove all layers from map\n\tmap.eachLayer(function(l) { map.re... | [
"0.5999201",
"0.59876764",
"0.59270054",
"0.5854612",
"0.5852849",
"0.5848569",
"0.5821224",
"0.58181244",
"0.58051026",
"0.57979345",
"0.5734233",
"0.57253236",
"0.57217383",
"0.5699102",
"0.5693322",
"0.569073",
"0.5667468",
"0.56585556",
"0.5647521",
"0.5633845",
"0.561458... | 0.63284135 | 0 |
Get topmost layer that intersects with event coordinates | function _getIntersectingLayer( data ) {
var layer, i,
mask, m;
// Store the topmost layer
layer = NULL;
// Get the topmost layer whose visible area intersects event coordinates
for ( i = data.intersecting.length - 1; i >= 0; i -= 1 ) {
// Get current layer
layer = data.intersecting[ i ];
// If layer h... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_getLocationAtCenter() {\n const {width, height, bounds} = this._viewportProps;\n\n if (!bounds) {\n return null;\n }\n\n const viewport = new OrbitViewport(this._viewportProps);\n\n const C0 = viewport.unproject([width / 2, height / 2, 0]);\n const C1 = viewport.unproject([width / 2, height... | [
"0.626626",
"0.59873563",
"0.59332544",
"0.58929986",
"0.5867425",
"0.57944024",
"0.5767107",
"0.5714493",
"0.5696167",
"0.56547934",
"0.5645018",
"0.5627117",
"0.5615283",
"0.5610187",
"0.56042254",
"0.5595742",
"0.55815256",
"0.5571929",
"0.5565742",
"0.5563502",
"0.5558179... | 0.7699576 | 0 |
Draw individual layer (internal) | function _drawLayer( $canvas, ctx, layer, nextLayerIndex ) {
if ( layer && layer.visible && layer._method ) {
if ( nextLayerIndex ) {
layer._next = nextLayerIndex;
} else {
layer._next = NULL;
}
// If layer is an object, call its respective method
layer._method.call( $canvas, layer );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function redraw()\n{\n\tlayer.draw();\n\tattribLayer['1'].draw();\n\tattribLayer['2'].draw();\n}",
"draw() {\n\t\tthis.hoverCalc()\n\t\tthis.clicked()\n\t\tthis.newPosition()\n\t\tthis.drawLine()\n\n\t\tthis.applyCircleStyle()\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextSt... | [
"0.71205276",
"0.692483",
"0.6791951",
"0.6785014",
"0.6742343",
"0.6730409",
"0.6718613",
"0.67077756",
"0.6699312",
"0.66723114",
"0.66065127",
"0.6602277",
"0.6602277",
"0.65959764",
"0.65688074",
"0.6563236",
"0.6554438",
"0.655318",
"0.65513897",
"0.65253323",
"0.6515134... | 0.7163836 | 0 |
Set cursor on canvas | function _setCursor( $canvas, layer, eventType ) {
var cursor;
if ( layer.cursors ) {
// Retrieve cursor from cursors object if it exists
cursor = layer.cursors[ eventType ];
}
// Prefix any CSS3 cursor
if ( $.inArray( cursor, css.cursors ) !== -1 ) {
cursor = css.prefix + cursor;
}
// If cursor is defined... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set cursor(v) {\n this.canvas.style.cursor = v;\n }",
"function _resetCursor( $canvas, data ) {\n\t$canvas.css( {\n\t\tcursor: data.cursor\n\t} );\n}",
"get cursor() {\n return this.canvas.style.cursor;\n }",
"function setCursorPosition(e){\t\n\tcursor.x = e.pageX;\n cu... | [
"0.8006273",
"0.7222342",
"0.7218494",
"0.7148379",
"0.7088715",
"0.7069794",
"0.6974628",
"0.6947357",
"0.68944883",
"0.6860219",
"0.6840484",
"0.67577493",
"0.67508054",
"0.67422885",
"0.67092836",
"0.6676783",
"0.6657748",
"0.66403395",
"0.6633903",
"0.6633869",
"0.660595"... | 0.7468252 | 1 |
Reset cursor on canvas | function _resetCursor( $canvas, data ) {
$canvas.css( {
cursor: data.cursor
} );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"resetCursor() {\n document.body.style.cursor = 'initial';\n }",
"function mouseBackToCursor() {\n map.getCanvas().style.cursor = \"\";\n }",
"resetSmartCursor() {\n this._scActive = false;\n }",
"reset(){\n if(this.cursor){\n this.cursor.close();\n this.cursor =... | [
"0.74665946",
"0.74650395",
"0.7392204",
"0.7309188",
"0.7276402",
"0.7264634",
"0.7183575",
"0.714878",
"0.70876664",
"0.6955213",
"0.6832297",
"0.675686",
"0.67097974",
"0.6600974",
"0.66008955",
"0.6587686",
"0.6580944",
"0.6577458",
"0.6562691",
"0.6446289",
"0.6429723",
... | 0.849986 | 0 |
Run the given event callback with the given arguments | function _runEventCallback( $canvas, layer, eventType, callbacks, arg ) {
// Prevent callback from firing recursively
if ( callbacks[ eventType ] && layer._running && !layer._running[ eventType ] ) {
// Signify the start of callback execution for this event
layer._running[ eventType ] = TRUE;
// Run event callb... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function event( ) {\n// =============================================================\n\tvar ar_args = arrayfromargs( arguments );\n\teventProcess( ar_args );\n}",
"trigger(events, arg) {\n for (let e of words(events)) {\n if (this.events.has(e)) {\n for (const callb... | [
"0.71572363",
"0.6536831",
"0.6329174",
"0.62949955",
"0.6206852",
"0.62021863",
"0.6043756",
"0.6031143",
"0.5991348",
"0.59759825",
"0.5968241",
"0.59391195",
"0.593707",
"0.59258544",
"0.5902321",
"0.589122",
"0.5834172",
"0.5803086",
"0.57308316",
"0.5712403",
"0.5649485"... | 0.6878789 | 1 |
Determine if the given layer can "legally" fire the given event | function _layerCanFireEvent( layer, eventType ) {
// If events are disable and if
// layer is tangible or event is not tangible
return ( !layer.disableEvents &&
( !layer.intangible || $.inArray( eventType, tangibleEvents ) === -1 ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static IsTouchingLayers() {}",
"onEvent(e, hitLayers) {\n const timeline = this._block.ui.timeline;\n\n switch (e.type) {\n case 'mousedown':\n // @todo - can't zoom if\n // `playControl.running === true` && `centeredCurrentPosition === true`\n if (hitLayers.indexOf(this.gridAxisM... | [
"0.6425445",
"0.6137612",
"0.6012079",
"0.59837854",
"0.5842488",
"0.5807957",
"0.5780551",
"0.5751017",
"0.56677485",
"0.5621933",
"0.5609261",
"0.55928737",
"0.5592664",
"0.5584223",
"0.55549043",
"0.5459237",
"0.5428169",
"0.5425727",
"0.54115593",
"0.54055464",
"0.5381074... | 0.7586157 | 0 |
Trigger the given event on the given layer | function _triggerLayerEvent( $canvas, data, layer, eventType, arg ) {
// If layer can legally fire this event type
if ( _layerCanFireEvent( layer, eventType ) ) {
// Do not set a custom cursor on layer mouseout
if ( eventType !== 'mouseout' ) {
// Update cursor if one is defined for this event
_setCursor( ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_onEvent(e, hitLayers) {\n this._executeCommandBackward('onEvent', e, hitLayers);\n }",
"function _addLayerEvent( $canvas, data, layer, eventName ) {\n\t// Use touch events if appropriate\n\t// eventName = _getMouseEventName( eventName );\n\t// Bind event to layer\n\tjCanvas.events[ eventName ]( $canvas, dat... | [
"0.6608179",
"0.6457381",
"0.63283813",
"0.5959354",
"0.5935702",
"0.59212273",
"0.59149057",
"0.58992517",
"0.58711",
"0.58592224",
"0.58525056",
"0.585015",
"0.58499986",
"0.5834063",
"0.58329976",
"0.58321565",
"0.58249193",
"0.58201873",
"0.5810634",
"0.5810634",
"0.58106... | 0.76850605 | 0 |
Add a jCanvas layer (internal) | function _addLayer( canvas, params, args, method ) {
var $canvas, data,
layers, layer = ( params._layer ? args : params );
// Store arguments object for later use
params._args = args;
// Convert all draggable drawings into jCanvas layers
if ( params.draggable || params.dragGroups ) {
params.layer = TRUE;
p... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createLayer(id, // @param String: layer id\r\n type, // @param String: \"canvas\", \"vmlcanvas\",\r\n // \"div\", \"img\", etc...\r\n hide, // @param Boolean(= false): true = hidden layer\r\n ... | [
"0.6725851",
"0.6627704",
"0.6570776",
"0.6515176",
"0.64980227",
"0.6423768",
"0.6415156",
"0.6380783",
"0.63569146",
"0.6328549",
"0.6292652",
"0.6248073",
"0.6246376",
"0.61426914",
"0.60881186",
"0.6032242",
"0.6011162",
"0.5990487",
"0.5966976",
"0.5919445",
"0.5904916",... | 0.7203415 | 0 |
Remove subproperty aliases from layer object | function _removeSubPropAliases( layer ) {
var propName;
for ( propName in layer ) {
if ( layer.hasOwnProperty( propName ) ) {
if ( propName.indexOf( '.' ) !== -1 ) {
delete layer[ propName ];
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fixFields(feature, aliases) {\r\n\r\n\tif (aliases) {\r\n\t\tvar newAttributes = {};\r\n\r\n\t\tfor (var field in feature.attributes){\r\n\t\t\tnewAttributes[aliases[field]] = feature.attributes[field];\r\n\t\t\tdelete feature.attributes[field];\r\n\t\t}\r\n\r\n\t\tfor (var field in newAttributes) {\r\n\t... | [
"0.60068023",
"0.5752921",
"0.5742425",
"0.5728604",
"0.5615175",
"0.5591308",
"0.5591308",
"0.5591308",
"0.5560281",
"0.5560281",
"0.5531257",
"0.55124617",
"0.55124617",
"0.54844016",
"0.54844016",
"0.54844016",
"0.54844016",
"0.54844016",
"0.54844016",
"0.54844016",
"0.548... | 0.8467762 | 0 |
Convert a color value to an array of RGB values | function _colorToRgbArray( color ) {
var originalColor, elem,
rgb = [],
multiple = 1;
// Deal with complete transparency
if ( color === 'transparent' ) {
color = 'rgba(0, 0, 0, 0)';
} else if ( color.match( /^([a-z]+|#[0-9a-f]+)$/gi ) ) {
// Deal with hexadecimal colors and color names
elem = document.he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getRGBarray(color){\n\tvar rgb = color.match(/\\d+/g);\n\tvar rgbArray = [];\n\tfor(var i in rgb) {\n \t\trgbArray[i]=rgb[i];\n\t}\n\treturn rgbArray;\n}",
"function rgb(r, g, b){\n\treturn [r, g, b, 255];\n}",
"function colorConv(color) {\n var rgb = [parseInt(color.substring(0,2),16), \n parseI... | [
"0.74733233",
"0.7432002",
"0.7430409",
"0.7404683",
"0.727061",
"0.726079",
"0.7245009",
"0.7231147",
"0.7231147",
"0.7231147",
"0.7231147",
"0.7231147",
"0.7210931",
"0.7195888",
"0.7187813",
"0.71848106",
"0.71282244",
"0.71282244",
"0.71282244",
"0.71282244",
"0.71282244"... | 0.77217615 | 0 |
Animate a hex or RGB color | function _animateColor( fx ) {
var n = 3,
i;
// Only parse start and end colors once
if ( typeOf( fx.start ) !== 'array' ) {
var orig = fx.start.slice(0);
fx.start = _colorToRgbArray( fx.start );
console.log(orig, '=>', fx.start);
fx.end = _colorToRgbArray( fx.end );
}
fx.now = [];
// If colors are RGB... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setColor(hex) {\n var color;\n if (hex) {\n color = Utils.decToRGB(hex, 1);\n this.immersed = true;\n } else {\n color = Utils.decToRGB(Style.floatingparticles.color, 1);\n this.immersed = false;\n }\n\n if (!this._color ) {\n ... | [
"0.7148652",
"0.68528676",
"0.6834515",
"0.6781428",
"0.6709861",
"0.66172254",
"0.6599202",
"0.6568805",
"0.64547724",
"0.64340943",
"0.6425395",
"0.6394165",
"0.63877386",
"0.6372603",
"0.63351744",
"0.6309372",
"0.63042754",
"0.6287888",
"0.628286",
"0.6225289",
"0.6217835... | 0.74199504 | 0 |
Convert mouse event name to a corresponding touch event name ( if possible ) | function _getTouchEventName( eventName ) {
// Detect touch event support
if ( maps.touchEvents[ eventName ] ) {
eventName = maps.touchEvents[ eventName ];
}
return eventName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getMouseEventName( eventName ) {\n\tif ( maps.mouseEvents[ eventName ] ) {\n\t\teventName = maps.mouseEvents[ eventName ];\n\t}\n\treturn eventName;\n}",
"function remapEvent(eventName) {\n var globalObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;\n\n if (!('ontouchs... | [
"0.70265794",
"0.6781336",
"0.6781336",
"0.6639074",
"0.6595498",
"0.645698",
"0.6324599",
"0.61787766",
"0.609938",
"0.60592574",
"0.6010868",
"0.60021335",
"0.5999737",
"0.5980812",
"0.59760475",
"0.59538865",
"0.5942587",
"0.59341174",
"0.5925577",
"0.5925577",
"0.5922731"... | 0.76198953 | 0 |
Convert touch event name to a corresponding mouse event name | function _getMouseEventName( eventName ) {
if ( maps.mouseEvents[ eventName ] ) {
eventName = maps.mouseEvents[ eventName ];
}
return eventName;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getTouchEventName( eventName ) {\n\t// Detect touch event support\n\tif ( maps.touchEvents[ eventName ] ) {\n\t\teventName = maps.touchEvents[ eventName ];\n\t}\n\treturn eventName;\n}",
"function remapEvent(eventName) {\n var globalObj = arguments.length > 1 && arguments[1] !== undefined ? arguments[... | [
"0.7489872",
"0.64679784",
"0.64679784",
"0.644886",
"0.6347458",
"0.6287762",
"0.62467766",
"0.613505",
"0.6072857",
"0.5971713",
"0.59640115",
"0.59251946",
"0.5913261",
"0.5896287",
"0.5894781",
"0.5894781",
"0.5894781",
"0.5878902",
"0.58187026",
"0.58043766",
"0.58043766... | 0.70911807 | 1 |
Retrieves a coterminal angle between 0 and 2pi for the given angle | function _getCoterminal( angle ) {
while ( angle < 0 ) {
angle += ( 2 * PI );
}
return angle;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getAngleBetween0and2PI(angle) {\n\n while (angle < 0) {\n angle += 2 * PI;\n }\n angle %= 2 * PI;\n return angle;\n\n}",
"function angle(i) {return 36*i*Math.PI/180}",
"function angle(n) {\n return 180*(n-2);\n}",
"static angle(x, y) {\n var ang;\n if (!this.isZero(x) && !t... | [
"0.7172142",
"0.7113873",
"0.70601624",
"0.67698723",
"0.6589461",
"0.64721507",
"0.64547455",
"0.64406985",
"0.64138067",
"0.6409215",
"0.63725203",
"0.6361944",
"0.6347261",
"0.6343404",
"0.6303714",
"0.62992346",
"0.6287166",
"0.6273204",
"0.6272964",
"0.6242476",
"0.62186... | 0.79929227 | 0 |
Retrieves the xcoordinate for the given angle in a circle | function _getArcX( params, angle ) {
return params.x + ( params.radius * cos( angle ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function xCoord( angle, radius ){\n return radius * Math.cos( angle - Math.PI / 2 ) + (w/2);\n}",
"function getX(radius, angle) {\n\treturn POLY_WIDTH / 2 + radius * Math.cos(angle);\n}",
"function coordOfPointOnCircle (centerX, centerY, radius, angle) {\n\tx = centerX + radius * Math.cos(angle);\n\ty = cen... | [
"0.8062191",
"0.75570446",
"0.6993433",
"0.66435385",
"0.6618313",
"0.6590965",
"0.6402266",
"0.63958347",
"0.6183014",
"0.61442727",
"0.61132705",
"0.6022768",
"0.60196835",
"0.60098696",
"0.5964115",
"0.5954748",
"0.5928981",
"0.5927169",
"0.5862737",
"0.58508325",
"0.58452... | 0.80145454 | 1 |
Retrieves the ycoordinate for the given angle in a circle | function _getArcY( params, angle ) {
return params.y + ( params.radius * sin( angle ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function yCoord( angle, radius ){\n return radius * Math.sin( angle - Math.PI / 2 ) + (h/2);\n}",
"function getY(radius, angle) {\n\treturn (POLY_HEIGHT + POLY_TITLE_SIZE + POLY_TITLE_TOP_PADDING) / 2 +\n\t\tradius * Math.sin(angle);\n}",
"function check_angleY(angle)\n{\n\tvar y = 0;\n\tdegrees = make_de... | [
"0.8220504",
"0.7516112",
"0.6816358",
"0.66532207",
"0.662197",
"0.6366555",
"0.6134949",
"0.61130655",
"0.6090912",
"0.5985678",
"0.59807897",
"0.594262",
"0.5896863",
"0.58926487",
"0.5890742",
"0.5852506",
"0.5836847",
"0.58104515",
"0.5788817",
"0.5788667",
"0.57752895",... | 0.8253255 | 0 |
Optionally adds arrow to start of path | function _addStartArrow( canvas, ctx, params, path, x1, y1, x2, y2 ) {
if ( !path._arrowAngleConverted ) {
path.arrowAngle *= params._toRad;
path._arrowAngleConverted = TRUE;
}
if ( path.startArrow ) {
_addArrow( canvas, ctx, params, path, x1, y1, x2, y2 );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function changePathArrow() {\n var lmnt = d3.select(this);\n var value = lmnt.property(\"value\");\n var path = drawingpad.select(\"#\" + selectedNode);\n var data = path.data()[0];\n\n if (value == \"no_A_and_B\") {\n // geen van kanten een pijl\n data.arrowheadstart = false;\n ... | [
"0.6728794",
"0.670693",
"0.6687553",
"0.6412435",
"0.6350565",
"0.6290677",
"0.6096093",
"0.60846996",
"0.6080861",
"0.60476327",
"0.6024519",
"0.60081846",
"0.5999357",
"0.5970595",
"0.59534526",
"0.5950918",
"0.59413016",
"0.5921472",
"0.58936435",
"0.58909327",
"0.5881775... | 0.6829731 | 0 |
Optionally adds arrow to end of path | function _addEndArrow( canvas, ctx, params, path, x1, y1, x2, y2 ) {
if ( !path._arrowAngleConverted ) {
path.arrowAngle *= params._toRad;
path._arrowAngleConverted = TRUE;
}
if ( path.endArrow ) {
_addArrow( canvas, ctx, params, path, x1, y1, x2, y2 );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addArrow(segment, arrowheadLength = segment.getLength().multiplyMagExactConstant(0.1), arrowHeadAngle = new Angle('20.00000')) {\n let point1 = segment.point1;\n let point2 = segment.point2;\n let arrowProportion = arrowheadLength.divideMag(segment.getLength());\n let arrowheadEnd1 = po... | [
"0.637846",
"0.63284564",
"0.625994",
"0.6257576",
"0.62446094",
"0.6241468",
"0.6185796",
"0.6129459",
"0.59255534",
"0.58340544",
"0.5832161",
"0.5742114",
"0.5708168",
"0.5706834",
"0.56987745",
"0.5672992",
"0.56714803",
"0.5647804",
"0.56442493",
"0.5638187",
"0.56136656... | 0.67671925 | 0 |
Draws quadratic curve (internal) | function _drawQuadratic( canvas, ctx, params, path ) {
var l,
lx, ly,
lcx, lcy;
l = 2;
_addStartArrow(
canvas,
ctx,
params,
path,
path.cx1 + params.x,
path.cy1 + params.y,
path.x1 + params.x,
path.y1 + params.y
);
if ( path.x1 !== UNDEFINED && path.y1 !== UNDEFINED ) {
ctx.moveTo( path.x1 ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drawLine(begin, control, end) {\r\n ctx.beginPath();\r\n ctx.moveTo(begin.x, begin.y);\r\n ctx.quadraticCurveTo(control.x, control.y, end.x, end.y);\r\n ctx.stroke();\r\n ctx.closePath();\r\n}",
"function drawCurve(x1, x2, x3, x4, y1, y2, y3, y4) {\n var c = document.getElementById(\"c... | [
"0.7042103",
"0.7030268",
"0.6836822",
"0.6829559",
"0.6764411",
"0.67559534",
"0.6714363",
"0.6659454",
"0.66592574",
"0.6644079",
"0.6594456",
"0.6581623",
"0.65116066",
"0.64522576",
"0.63132733",
"0.6233682",
"0.6164503",
"0.6148869",
"0.6137967",
"0.61251086",
"0.6106610... | 0.71146476 | 0 |
Retrieves the xcoordinate for the given vector angle and length | function _getVectorX( params, angle, length ) {
angle *= params._toRad;
angle -= ( PI / 2 );
return ( length * cos( angle ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function xCoord( angle, radius ){\n return radius * Math.cos( angle - Math.PI / 2 ) + (w/2);\n}",
"function vectorToX(y, p) {\n\treturn (-1 * Math.sin(y / 180 * Math.PI) * Math.cos(p / 180 * Math.PI));\n}",
"function vX1Pos(d) {\n\t\tvar svgCircle = document.getElementById(myId.substr(1) + '_'+nameId(d.name... | [
"0.6198874",
"0.60287523",
"0.5837879",
"0.58032906",
"0.5743732",
"0.5651648",
"0.5620823",
"0.5620823",
"0.553634",
"0.5494589",
"0.5491069",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.54826313",
"0.548... | 0.82695425 | 0 |
Retrieves the ycoordinate for the given vector angle and length | function _getVectorY( params, angle, length ) {
angle *= params._toRad;
angle -= ( PI / 2 );
return ( length * sin( angle ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _getArcY( params, angle ) {\n\treturn params.y + ( params.radius * sin( angle ) );\n}",
"function yCoord( angle, radius ){\n return radius * Math.sin( angle - Math.PI / 2 ) + (h/2);\n}",
"getAngle(vector) {\n let angle = Math.atan2(this.x, this.y);\n if (vector) {\n angle -... | [
"0.63102335",
"0.6253861",
"0.6243209",
"0.60071653",
"0.60071653",
"0.5879915",
"0.5843166",
"0.5817842",
"0.5817842",
"0.5811505",
"0.567299",
"0.56727105",
"0.5622239",
"0.5585891",
"0.55832106",
"0.5578927",
"0.5542781",
"0.55427647",
"0.5540469",
"0.55352765",
"0.5531364... | 0.84711057 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.