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 |
|---|---|---|---|---|---|---|
Use this if something is never supposed to have a value. Not even `undefined`. For example, `never[]` can be, ```ts const arrayOfNever = array(never()); ``` The only value that will satisfy this mapper is the empty array. | function never() {
return function (name, mixed) {
throw error_util_1.makeMappingError({
message: name + " must be never",
inputName: name,
actualValue: mixed,
expected: "never",
});
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function Array$empty() {\n return [];\n }",
"function Array$empty() {\n return [];\n }",
"function requireValue(isset) {\n if (!isset) {\n throw new Error(\"reduce of empty array with no initial value\");\n }\n }",
"function arrayHandler(callback, allTruthyMode) {\n ... | [
"0.5621741",
"0.5621741",
"0.5577489",
"0.5539898",
"0.5457381",
"0.5457381",
"0.5441638",
"0.5441638",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"0.5438645",
"... | 0.5986685 | 0 |
restores the entries and adds them to pokedex entries | function restoreEntries(
storedEntries
) {
// convert the stored entries
// from a string back to an object
// with the pokemonIds as keys and
// the stringified entries as values
let restoredEntries = JSON.parse(
storedEntries
);
// convert the entry strings back to
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deleteMarkers() {\n clearMarkers();\n markers = [];\n choiceMarkers = [];\n searchResMarkers = [];\n}//deleteMarkers",
"nuke() {\n this._clearSpatialIndex();\n this.byId = [];\n this.fieldIndexes = {};\n this.fieldsToIndex.forEach(field => {\n this.fieldIndexes[field] = {};\n });... | [
"0.54110515",
"0.5402046",
"0.5352943",
"0.53236425",
"0.53165203",
"0.5305262",
"0.5258091",
"0.5242506",
"0.5242101",
"0.5137043",
"0.51300323",
"0.5115131",
"0.5111485",
"0.51015997",
"0.5101113",
"0.50692147",
"0.50648636",
"0.50505054",
"0.5040968",
"0.50399214",
"0.5016... | 0.69865996 | 0 |
this function updates the subjects dropdown on clicking any grade | function setsubs(grade)
{
$('.sub').html('');
$('.sub').append('<option value="no">SUBJECTS</option>');
data['data'].list.map(function(val)
{
if(val.name==grade)
{
val.subjectList.map(function(v)
{
var s=v.name;
var add='<option ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"selectSubject(event) {\n\n let subjects = document.getElementsByClassName('subject');\n\n for (let i = 0; i < subjects.length; i++) {\n subjects[i].className = 'subject';\n }\n\n event.target.className = 'subject selected';\n\n //update the selected id\n this.setState({\n subjectSelecte... | [
"0.65726906",
"0.6491116",
"0.6424302",
"0.64040977",
"0.6280794",
"0.6280423",
"0.626298",
"0.6253107",
"0.62371063",
"0.62352073",
"0.62029254",
"0.6176851",
"0.6151119",
"0.6121563",
"0.61044115",
"0.6094283",
"0.6090541",
"0.60407686",
"0.5956725",
"0.5935502",
"0.5925065... | 0.72468215 | 0 |
it updates the subsubjects in navigation bar on clicking the the subject | function subsubs(subject)
{
if(window.innerWidth>1024)
{
$('.side').html('');
$('.side').append(' <h1><b>LOGO</b></h1> <h4><b>CONTENTS</b></h4>');
}
else if(window.innerWidth<768)
{
$('#navi').html('');
}
var e=document.getElementsByClassName('grade')[0];
var gra=e.options[e.selected... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toggleSubject (addedSub){\n const foundSubject = _.find(this.state.subjects, subject => subject.name === addedSub);\n foundSubject.isCompleted = !foundSubject.isCompleted;\n this.setState ({subjects : this.state.subjects});\n }",
"function lijstSubMenuItem() {\n\n if ($... | [
"0.65367115",
"0.5998079",
"0.58859354",
"0.58568424",
"0.5854699",
"0.58327657",
"0.5800105",
"0.5792945",
"0.5792188",
"0.57488364",
"0.56903684",
"0.5645654",
"0.5645014",
"0.56170017",
"0.5615744",
"0.55638194",
"0.5516076",
"0.5513796",
"0.54779595",
"0.5471836",
"0.5463... | 0.6626903 | 0 |
MOL2 file syntax defines the atom record as follows: atom_id atom_name x y z atom_type [subst_id [subst_name [charge [status_bit]]]] 0 1 2 3 4 5 6 7 8 9 MOL2 file syntax defines the bond record as follows: bond_id origin_atom_id target_atom_id bond_type [status_bits] 0 1 2 3 4 | parseMolecule(index, atomRecords, bondRecords, result) {
let {atoms, bonds} = result,
inc = atoms.length, // total number of atoms added into the structure previously
spaceRE = /\s+/;
for (let rec of atomRecords) {
let items = rec.trim().split(spaceRE);
le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"parseMolecule(index, atomRecords, result) {\n let {atoms, bonds} = result,\n inc = atoms.length, // total number of atoms added into the structure previously\n spaceRE = /\\s+/;\n for (let i = 0, len = atomRecords.length; i < len; i++) {\n let items = atomRecords[i].t... | [
"0.5408055",
"0.51413727",
"0.50928223",
"0.5089889",
"0.50736403",
"0.5037518",
"0.49817997",
"0.4725309",
"0.46532357",
"0.45925558",
"0.45044145",
"0.44910482",
"0.44699952",
"0.4374528",
"0.43132514",
"0.43111685",
"0.42993292",
"0.4295641",
"0.42842823",
"0.42659193",
"0... | 0.56767416 | 0 |
Populates edge array based on vertices and faces. | computeEdges() {
// array of arrays of edges
this.edges = [];
// map of vertex pairs to edge indices
var vertexPairs = new Map();
let len = this.body.shapes[0].vertices.length;
var faces = this.body.shapes[0].faces;
faces.forEach(f => {
var loop = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function faceEdges(face) {\n var n = face.length,\n edges = [];\n for (var a = face[n - 1], i = 0; i < n; ++i) {\n edges.push([a, a = face[i]]);\n }return edges;\n}",
"function faceEdges(face) {\n var n = face.length,\n edges = [];\n for (var a = face[n - 1], i = 0; i < n; ++i) edges.push([a, a... | [
"0.6657784",
"0.64646196",
"0.64646196",
"0.6414725",
"0.63792056",
"0.6263822",
"0.6261526",
"0.6238883",
"0.6238728",
"0.6108731",
"0.60213214",
"0.6017071",
"0.5946632",
"0.5846974",
"0.5739629",
"0.5691505",
"0.567306",
"0.5646524",
"0.55966413",
"0.5534578",
"0.5532781",... | 0.69835246 | 0 |
Copy position from physics simulation to rendered mesh | update() {
this.mesh.position.copy(this.body.position);
this.mesh.quaternion.copy(this.body.quaternion);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setWorldPosition(position, update = false){ \n let new_pos = this.getParentSpaceMatrix().getInverse().times(position)\n let pp_r_s_inv = Matrix3x3.Translation(new_pos).times(\n Matrix3x3.Rotation(this.getRotation()).times(\n Matrix3x3.Scale(this.getScale())\n ... | [
"0.6462523",
"0.6387515",
"0.63394743",
"0.6281849",
"0.6277799",
"0.62772626",
"0.62642735",
"0.62021154",
"0.6199623",
"0.61876595",
"0.6187237",
"0.61652184",
"0.61549556",
"0.61295533",
"0.60690415",
"0.60180783",
"0.60169667",
"0.60156226",
"0.60047966",
"0.5997315",
"0.... | 0.70207316 | 0 |
Ace refuses to render all changes immediately | function renderChanges() {
ui.editor.ace.renderer.updateFull(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function editOnCompositionStart(){this.setRenderGuard();this.setMode('composite');this.update(EditorState.set(this.props.editorState,{inCompositionMode:true}));}",
"function setupEditor() {\n window.editor = ace.edit(\"editor\");\n editor.setTheme(\"ace/theme/monokai\");\n editor.getSession().setMode(\"ace/mo... | [
"0.64449835",
"0.63343364",
"0.6219092",
"0.60903287",
"0.598501",
"0.5948566",
"0.58068204",
"0.57846594",
"0.5771719",
"0.57518935",
"0.5746964",
"0.57378614",
"0.57146156",
"0.571317",
"0.5712021",
"0.56476974",
"0.56461096",
"0.5621992",
"0.56145036",
"0.56118566",
"0.559... | 0.7972766 | 0 |
function to only enter number for text box | function onlyEnterNumberTextBox(id) {
$("#" + id).keydown(function (e) {
// Allow: backspace, delete, tab, escape, enter and .
if ($.inArray(e.keyCode, [46, 8, 9, 27, 13, 110, 190]) !== -1 ||
// Allow: Ctrl+A
(e.keyCode == 65 && e.ctrlKey === true) ||
// All... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onlyNum(obj,event){\n\tvar num_regx=/^[0-9]*$/;\n\tif( !num_regx.test(obj.value) ) {\n\t\talert('숫자만 입력하실 수 있습니다.');\n\t\tobj.value = obj.value.substring(0, obj.value.length-1 );\n\t}\n}",
"function numberTextField(e,elementId)\n{\n var reg = /[\\b0-9]/;\n var v = document.getElementById(elementId).v... | [
"0.7703949",
"0.76587",
"0.7606104",
"0.7605462",
"0.7569377",
"0.74869925",
"0.73793125",
"0.73667973",
"0.73271775",
"0.7282426",
"0.727135",
"0.72620213",
"0.7261236",
"0.72301495",
"0.72201645",
"0.7187337",
"0.7186212",
"0.71597195",
"0.71134293",
"0.71053606",
"0.709513... | 0.7741312 | 0 |
convert date id to date | function convertDateIdToString(dateString) {
if(dateString == null || dateString == '' ) return "";
dateString = dateString.toString();
var result = dateString.substr(6,2) + "-" + dateString.substr(4,2) + "-" + dateString.substr(0,4);
return result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toYYYYMMDD (n) {\n const d = new Date(n)\n return d.toISOString().split('T')[0]\n }",
"function getDateId() {\n\tvar date = new Date();\n\tvar year = date.getFullYear();\n\tvar month = date.getMonth()+1;\n\tvar day = date.getDate();\n\treturn year+month+day;\n}",
"convertDate(... | [
"0.68168473",
"0.656949",
"0.65142363",
"0.65084946",
"0.6493539",
"0.6490043",
"0.6417927",
"0.6417708",
"0.64116424",
"0.6380895",
"0.63783115",
"0.63737583",
"0.6370005",
"0.6330993",
"0.62723917",
"0.62697387",
"0.62652177",
"0.6244952",
"0.62377936",
"0.62369275",
"0.619... | 0.6851724 | 0 |
Control events are processed here. This is called when Alexa requests an action (IE turn off appliance). | function handleControl(event, context) {
if (event.header.namespace === 'Alexa.ConnectedHome.Control') {
/**
* Retrieve the appliance id and accessToken from the incoming message.
*/
let accessToken = event.payload.accessToken;
let applianceId = event.payload.appliance.app... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleControl(event, context) {\n var requestType=event.header.name;\n var responseType=event.header.name.replace(\"Request\",\"Confirmation\");\n var headers = {\n namespace: \"Alexa.ConnectedHome.Control\",\n name: responseType,\n ... | [
"0.69838643",
"0.6960366",
"0.6899015",
"0.6748353",
"0.63826334",
"0.6018675",
"0.593839",
"0.57300425",
"0.57023305",
"0.56880707",
"0.5606107",
"0.55317867",
"0.54922414",
"0.54922414",
"0.54922414",
"0.5454328",
"0.54481095",
"0.5441287",
"0.54377955",
"0.5417028",
"0.541... | 0.71767503 | 0 |
A function that takes as input the coordinates of an edges and gives out the coordinates of the location where its cost should be mentioned Uses a little trigonometry :) | function getEdgeCostLocation(x1, y1, x2, y2) {
var midx = (x1 + x2) / 2;
var midy = (y1 + y2) / 2;
var angle = Math.atan((x1 - x2) / (y2 - y1));
var coords = {
x: midx + 8 * Math.cos(angle),
y: midy + 8 * Math.sin(angle)
}
return coords;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function squareAroundPoint(nearLat, nearLong, edge) {\n // Ideally, we should do a geospatial query for a circle around the target point. We approximate this\n // by a square.\n var dist = edge / 2 * 1609.34; // convert miles to meters\n var point = new google.maps.LatLng(nearLat, nearLong);\n var e... | [
"0.60282046",
"0.5972613",
"0.5940183",
"0.5937488",
"0.59330994",
"0.59179926",
"0.5848582",
"0.5832108",
"0.5809546",
"0.5809546",
"0.5731715",
"0.57182956",
"0.569109",
"0.5689905",
"0.5665226",
"0.56597245",
"0.5636308",
"0.5621863",
"0.56040365",
"0.5544962",
"0.55060184... | 0.7299202 | 0 |
/ This will consume any overflow in the time accumulated from 'UpdateTime' in 'FixedTimeStep' chunks. / The passed functoin will be invoked for each consumed chunk. This allows us to catch up with any / fraction portions of our fixed time step that overflowed during the normal update cycle. | static ConsumeAccumulatedTime(func)
{
let stepped = 0;
let stepRate = FIXED_TIME_STEP;
while(Time._accu >= stepRate)
{
stepped++;
func();
Time._accu -= stepRate;
//this is a safety feature to ensure we never take longer than an allowed maximum time.
if(Time._time - Time._lastTime > MAX_TIME_S... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"update(timeStep) {\n\n }",
"function timeStepUpdate() {\n if (incrementing == false) {\n incrementing = true;\n setTimeout(function () {\n time += 1;\n incrementing = false;\n }, timeStep * 1000);\n }\n}",
"_processTick(tickTime, ticks) {\n // do t... | [
"0.5634498",
"0.50159085",
"0.49622566",
"0.49606362",
"0.48251945",
"0.48162657",
"0.48135534",
"0.48130465",
"0.47721896",
"0.47691166",
"0.47629115",
"0.47433683",
"0.4713767",
"0.47011852",
"0.46780702",
"0.4674049",
"0.4664973",
"0.46626997",
"0.4643626",
"0.463386",
"0.... | 0.55785924 | 1 |
Generate a snapshot name given a base. | function snapshotName(base) {
"use strict";
var when = formatDate(new Date());
return base + '-' + when;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function generateUsername(base) {\n base = base.toLowerCase();\n var entries = [];\n var finalName;\n return userDB.allDocs({startkey: base, endkey: base + '\\uffff', include_docs: false})\n .then(function(results){\n if(results.rows.length === 0) {\n return BPromise.resolve(base);... | [
"0.65490043",
"0.6277193",
"0.6116239",
"0.60826117",
"0.5952341",
"0.5876089",
"0.58199483",
"0.573663",
"0.5692679",
"0.5687249",
"0.5618089",
"0.5602993",
"0.5602118",
"0.5575302",
"0.5533787",
"0.5522069",
"0.55129623",
"0.55129623",
"0.55129623",
"0.5436213",
"0.5373377"... | 0.8544114 | 0 |
Create a snapshot on the specified dataset with the specified name, exluding all datasets in excl. | function createSnapshot(ds, sn, excl) {
"use strict";
function destroyExcludes(snaps, excl) {
var toDestroy = snaps.filter(function (s) {
var fields = s.name.split('@');
var createdNow = fields[1] === sn;
var inExclude = _.contains(excl, fields[0]);
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async snap(name) {\n await this.nemo.screenshot.snap(name || 'screenshot')\n }",
"takeMemorySnapshot(name) {\n if (!isProfiling) return;\n const snapshot = profiler.takeSnapshot(name);\n const heapFileName = path.join(__dirname, `../../performance/memory/${name}_${(new Date().toISOString())}.heapsna... | [
"0.57099885",
"0.49952084",
"0.49173602",
"0.4823329",
"0.48050103",
"0.47906417",
"0.47362155",
"0.47198105",
"0.46961048",
"0.46948686",
"0.4675691",
"0.46605006",
"0.4631633",
"0.46235973",
"0.46117425",
"0.4595298",
"0.45672947",
"0.4545511",
"0.45219707",
"0.4511676",
"0... | 0.5674466 | 1 |
Keep only num snapshots with the specified base on the specified dataset | function cleanSnapshots(ds, base, num) {
zfs.list({ type: 'snapshot' }, function (err, snaps) {
// Find all snapshots that match the specified dataset and base.
var ourSnaps = snaps.filter(function (s) {
var fields = s.name.split('@');
var parts = fields[1].split('-');
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function pruneAggregated() {\n return Sample.destroy({\n where: { aggregated: false },\n }).then(count => {\n console.log('Pruned %d pre-aggregation samples', count);\n });\n}",
"function filterData(dataset) {\n dList = [];\n \n for (i=0; i < dataset.otu_ids.length; i++) { \n // consol... | [
"0.5298788",
"0.49141982",
"0.4851278",
"0.48118484",
"0.46582255",
"0.4651824",
"0.4643439",
"0.46391973",
"0.46039373",
"0.4591683",
"0.4539239",
"0.4504699",
"0.44960055",
"0.44899675",
"0.4475318",
"0.44503573",
"0.44395456",
"0.443218",
"0.43800408",
"0.4331613",
"0.4324... | 0.60423595 | 0 |
Mark a card as the new minimum. | function markMin(globals, params, q) {
animToQueue(q, '#' + globals.cardArray[params].num,
{top:globals.SELECT_MOVE}, "min", globals, params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set min(value) {\n this.changeAttribute('min', value);\n }",
"set min(value) {\n Helper.UpdateInputAttribute(this, 'min', value);\n }",
"set _min(value) {\n Helper.UpdateInputAttribute(this, \"min\", value);\n }",
"set minIndex(_val) {\n (typeof _val === \"number\") && this.setAttrib... | [
"0.6762539",
"0.6391446",
"0.6310163",
"0.5955062",
"0.594887",
"0.5933817",
"0.57989806",
"0.5765526",
"0.5754966",
"0.5736904",
"0.57338846",
"0.5725054",
"0.5714888",
"0.56963027",
"0.56401217",
"0.56140196",
"0.56140196",
"0.56140196",
"0.56140196",
"0.56140196",
"0.56140... | 0.68334275 | 0 |
Unmark a card as the minimum. | function unmarkMin(globals, params, q) {
animToQueue(q, '#' + globals.cardArray[params].num,
{top:'0px'}, "unmin", globals, params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"remove() {\n if (!this.value) {\n this.value = this.min || 0;\n }\n const step = this.ctrl_key ? 100 : this.shift_key ? 10 : this.step || 1;\n this.value -= step;\n if (this.value < this.min) {\n this.value = this.min || 0;\n }\n this.setValue(... | [
"0.5794074",
"0.57848006",
"0.56940156",
"0.56817675",
"0.5626896",
"0.560562",
"0.55201274",
"0.54891515",
"0.5468478",
"0.5459153",
"0.53400993",
"0.5333994",
"0.5292736",
"0.52908754",
"0.5239382",
"0.51999056",
"0.51772475",
"0.5173613",
"0.5171734",
"0.51701933",
"0.5157... | 0.70508796 | 0 |
Mark a card as sorted. | function markSorted(globals, params, q) {
animToQueue(q, '#' + globals.cards[params].num,
{top:'0px'}, "sort", globals, params);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sortTheCard() {\n this.sort = this.cards.sort((currentCard, nextCard) => currentCard.value - nextCard.value);\n }",
"function setSorted(globals, id) {\n var cards = globals.cards;\n cards[id].sorted = true;\n cards[id].flipped = false;\n globals.totFlip--;\n $('#' + id).css({\n ba... | [
"0.70687985",
"0.6549775",
"0.62567806",
"0.6168512",
"0.6131611",
"0.59777063",
"0.58453494",
"0.5823961",
"0.57884926",
"0.5781722",
"0.57808983",
"0.57802534",
"0.5776661",
"0.5752555",
"0.5728674",
"0.5721736",
"0.56574416",
"0.5646556",
"0.5619388",
"0.5619064",
"0.56166... | 0.6925067 | 1 |
calculate the distance from the the rssi | function distance_rssi(rssi_p){
var cal= -66;
var dist;
if(cal<rssi_p){
dist = Math.pow(10,rssi_p/cal)
}
else{
dist = (0.9*Math.pow(7.71,rssi_p/cal)+0.11)*0.001
}
return dist
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function mapBeaconRSSI(rssi)\n {\n if (rssi >= 0) return 1; // Unknown RSSI maps to 1.\n if (rssi < -100) return 100; // Max RSSI\n return 100 + rssi;\n }",
"function mapBeaconRSSI(rssi) {\n if (rssi >= 0)\n return 1; // Unknown RSSI maps to 1.\n if (rssi < -100)\n return 100; // M... | [
"0.65244526",
"0.647684",
"0.6271676",
"0.6180164",
"0.5978584",
"0.59419155",
"0.59161425",
"0.5910772",
"0.5836793",
"0.5821521",
"0.58053833",
"0.5753798",
"0.5730081",
"0.57222176",
"0.571949",
"0.5654595",
"0.56274945",
"0.562134",
"0.5585668",
"0.5531825",
"0.54504734",... | 0.8016069 | 0 |
this function specifies the positions of bend points | bendPositionsFunction(ele) {
return ele.data('bendPointPositions');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"bpos()\n\t{\n\t\treturn [this.x + DIRS[this.dir][0], this.y + DIRS[this.dir][1]];\n\t}",
"function Bezier(startPt, endPt, startCtrlPt, endCtrlPt) {\n\tvar b;\n\tb.startPoint=startPt;\n\tb.endPoint=endPt;\n\tb.startControlPoint = startCtrlPt;\n\tb.endControlPoint = endCtrlPt;\n\tb.getCartesianAt = new function(t)... | [
"0.6731586",
"0.6204395",
"0.6165572",
"0.6045086",
"0.6009413",
"0.59384155",
"0.5921679",
"0.59192485",
"0.5889758",
"0.58740854",
"0.58181715",
"0.58097786",
"0.5790465",
"0.57809985",
"0.5769285",
"0.5757061",
"0.5715059",
"0.56950915",
"0.5672013",
"0.5658654",
"0.560631... | 0.6479256 | 1 |
Scrambles the given array | function scramble(arr) {
let scrambled = [];
let maxI = arr.length;
for (let i = 0; i < maxI; i++) {
// Appends the value at a random index in arr to the scrambled array and deletes it from arr
let randomIndex = Math.floor(Math.random() * arr.length);
scrambled.push(arr.splice(randomIndex, 1)[0]);
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scramble(arr) {\n for (let i = arr.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * i);\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n return arr;\n }",
"function getScramble() {\n var moves = new Array();\n moves['r'] = new Array(\"R... | [
"0.7952491",
"0.722264",
"0.6984794",
"0.6961692",
"0.6949615",
"0.6908133",
"0.681594",
"0.67960477",
"0.6733211",
"0.658768",
"0.65754473",
"0.656906",
"0.6533714",
"0.65197945",
"0.6506822",
"0.64934915",
"0.64804894",
"0.645834",
"0.645834",
"0.645834",
"0.6449667",
"0.... | 0.7307965 | 1 |
find the (or one of them) smallest square who have A as a corner and B on a side | function findSquare (lineA, colA, lineB, colB) {
// length of a side of that square
let line, col;
let dim = max(abs(lineA - lineB), abs(colA - colB));
if (lineB >= lineA) line = lineA;
else line = lineA - dim;
if (colB >= colA) col = colA;
else col = colA - dim;
return [line, col, dim + 1];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"minSquare() {\n var ind = -1;\n var min = L + 1;\n for (let i = 0; i < B; i++) {\n if (this.choices[i] != -1 && this.choices[i] < min) {\n min = this.choices[i];\n ind = i;\n }\n }\n return ind;\n }",
"function getMinBox() ... | [
"0.69085807",
"0.6315294",
"0.6315294",
"0.6236337",
"0.6224419",
"0.6206841",
"0.612851",
"0.6127941",
"0.6090618",
"0.60611093",
"0.5930872",
"0.58946407",
"0.58901054",
"0.58175117",
"0.5788505",
"0.577618",
"0.5757049",
"0.573049",
"0.5715967",
"0.57059723",
"0.5675279",
... | 0.6543187 | 1 |
We want to approximate the length of a curve representing a function y = f(x) with a<= x <= b. First, we split the interval [a, b] into n subintervals with widths h1, h2, ... , hn by defining points x1, x2 , ... , xn1 between a and b. This defines points P0, P1, P2, ... , Pn on the curve whose xcoordinates are a, x1, x... | function lenCurve(n) {
function seglg() {
return Math.sqrt(Math.pow(n, 2) + 4 * Math.pow(k, 2) + 4 * k + 1) / Math.pow(n, 2);
}
var s = 0;
for (var k = 0; k < n; k++) {
s += seglg();
}
return Math.floor(s * 1e9) / 1e9;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function curveLength({\n fun,\n curveStartParam,\n curveEndParam,\n\n //optionals:\n funIsAVector, //true for t |-> [x,y], false for y=f(x) \n INTEGRATION_POINTS_LIM,\n calculationAccuracy,\n STARTING_EXPONENT_FOR_2,\n SAFETY_INTERACTIONS_LIM... | [
"0.6769427",
"0.58905506",
"0.5680087",
"0.56241846",
"0.5448378",
"0.54405534",
"0.5429641",
"0.5369592",
"0.53184587",
"0.5288144",
"0.5247235",
"0.5210314",
"0.5191495",
"0.5182685",
"0.5181171",
"0.51801234",
"0.5155166",
"0.509476",
"0.50758535",
"0.5073273",
"0.50525904... | 0.6514496 | 1 |
Calculates the increment values for R, G, and B using distance, fps, and duration. This calculation can be made in many different ways. | function calculateIncrement(distanceArray, fps, duration) {
var fps = fps || 30;
var duration = duration || 1;
var increment = [];
for (var i = 0; i < distanceArray.length; i++) {
var incr = Math.abs(Math.floor(distanceArray[i] / (fps * duration)));
if (incr == 0) {
incr = 1;
}
increment.push(incr);
}... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function calculateIncrement(distanceArray, fps, duration) {\n var fps\t\t\t= fps || 30;\n var duration\t= duration || 1;\n var increment\t= [];\n for (var i = 0; i < distanceArray.length; i++) {\n var incr = Math.abs(Math.floor(distanceArray[i] / (fps * duration)));\n if (incr == 0) {\n ... | [
"0.71802247",
"0.56769407",
"0.5670698",
"0.56258494",
"0.5583371",
"0.5529605",
"0.55150187",
"0.55066925",
"0.54881376",
"0.5478588",
"0.5415672",
"0.5410037",
"0.53956777",
"0.539482",
"0.5379198",
"0.5377735",
"0.53744066",
"0.53606665",
"0.5356631",
"0.5353362",
"0.53515... | 0.71370786 | 1 |
==================== Transition Calculator ==================== | function transition() {
// checking R
if (currentColor[0] > targetColor[0]) {
currentColor[0] -= increment[0];
if (currentColor[0] <= targetColor[0]) {
increment[0] = 0;
}
} else {
currentColor[0] += increment[0];
if (currentColor[0] >= targetColor[0]) {
increment[0] = 0;
}
}
// checking G
if ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function transition() {\n generateNewColour();\n\n for (var key in Colour) {\n if(colour[key] > nextColour[key]) {\n colour[key] -= delta[key];\n if(colour[key] <= nextColour[key]) {\n delta[key] = 0;\n ... | [
"0.6630601",
"0.6541303",
"0.6538054",
"0.63178617",
"0.63018835",
"0.62306374",
"0.6152068",
"0.61283296",
"0.60233706",
"0.5993718",
"0.5973599",
"0.59581375",
"0.59218556",
"0.59086174",
"0.5902313",
"0.58689725",
"0.5867377",
"0.5865813",
"0.58509195",
"0.58506835",
"0.58... | 0.67392343 | 0 |
Create an object listing for an entry or page. This is used for Selected Entry, Selected Page, and Reciprocal Objects. | function createObjectListing(obj_title, obj_id, obj_class, obj_permalink, blog_id) {
var $preview = jQuery('<span/>')
.addClass('obj-title')
.text(obj_title);
// Edit link.
var $edit = jQuery('<a/>')
.attr('href', CMSScriptURI+'?__mode=view&_type='+obj_class+'&id='+obj_id+'&blog_id='... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function newListEntry(entry) {\n var listEntry = newElement('li');\n var listText = newElement('span');\n var actionContainer = newElement('div');\n var runButton = createIconButton('power-off', true, null, entry, _run);\n var editButton = createIconButton('edit', true, null, entry, _edit);\n var... | [
"0.5590515",
"0.557202",
"0.55439574",
"0.553152",
"0.54849875",
"0.53939384",
"0.5362691",
"0.53309596",
"0.5288687",
"0.52574104",
"0.5232727",
"0.5219121",
"0.52162504",
"0.52097124",
"0.5176707",
"0.51550287",
"0.5143397",
"0.5116031",
"0.5105161",
"0.5089701",
"0.5076542... | 0.6963715 | 0 |
Create the reciprocal entry association. This happens after selecting an entry from the popup. | function createReciprocalAssociation(obj_title, recip_obj_id, obj_class, obj_permalink, field, blog_id) {
jQuery('input#'+field+'.reciprocal-object').val( recip_obj_id );
// Create a list item populated with title, edit, view, and remove links.
var $li = createObjectListing(
obj_title,
reci... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addRelationship() {\n this.mapTypeForm.reset();\n this.submitted = false;\n this.displayModal = true;\n this.isedit = false;\n }",
"function create_related_entry_dialog(data) {\n let dialog = elementFactory({ type: \"div\" });\n let lst_wrap = elementFactory({ type: \"div\", ... | [
"0.5368761",
"0.5305341",
"0.5257124",
"0.5232171",
"0.51533616",
"0.51533616",
"0.51533616",
"0.51533616",
"0.5139111",
"0.51008296",
"0.50781304",
"0.5073649",
"0.5039997",
"0.5020927",
"0.5015054",
"0.496429",
"0.4951728",
"0.4947675",
"0.49365643",
"0.49352273",
"0.488835... | 0.6117439 | 0 |
Unlink the selected entry from the current entry for a Reciprocal Association. | function deleteReciprocalAssociation(field, recip_obj_id) {
var type = jQuery('#entry_form input[name=_type]').val();
jQuery.get(
CMSScriptURI + '?__mode=unlink_reciprocal',
{
'recip_field_basename': field,
'recip_entry_id': recip_obj_id,
'cur_entry_id': jQuer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"unlink(kcLink) {\n let i = this.kcLinks.indexOf(kcLink);\n this.kcLinks.splice(i,1);\n if (this === kcLink.outPoint) {\n // this is a required docking point and someone just removed the link :(\n this.courseObject.requiredWasUnlinked(this);\n }\n }",
"unlink(c... | [
"0.5946615",
"0.57622755",
"0.55962974",
"0.5592985",
"0.5504511",
"0.54269713",
"0.5403657",
"0.536653",
"0.53381896",
"0.5303855",
"0.52463424",
"0.5215935",
"0.52037936",
"0.5190934",
"0.51818377",
"0.5181754",
"0.5165549",
"0.5155353",
"0.5128827",
"0.5123988",
"0.5067149... | 0.58791316 | 1 |
MultiUse SingleLine Text Group | function addSingleLineTextGroup(parent,field_name) {
var num = jQuery('#' + parent + ' ul').size();
jQuery('#'+field_name+'_multiusesinglelinetextgroupcf_invisible-field').clone().appendTo('#' + parent);
// Switch to display:block so that the field is visible.
jQuery('#' + parent + ' .cf-text-group').c... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addGroupText() {\n\tif (groupText) { groupText.destroy(); }\n\tgroupText = game.add.group();\n\treturn groupText;\n}",
"function multiLineText(text, x, y, width, height) {\n return '<switch>\\n' +\n '<foreignObject x=\"' + x + '\" y=\"' + y + '\" width=\"' + width + '\" height=\"' + height + '\">\\n... | [
"0.6478826",
"0.6269797",
"0.62565714",
"0.5962304",
"0.5921791",
"0.57596415",
"0.57466376",
"0.5706988",
"0.5638568",
"0.56331825",
"0.5615477",
"0.5566478",
"0.55554104",
"0.5538422",
"0.5508039",
"0.5506424",
"0.5506424",
"0.5470638",
"0.5463635",
"0.5440184",
"0.54318166... | 0.6793016 | 0 |
Decamelizes a string with/without a custom separator (hyphen by default). from: | function decamelize(str, separator = '-') {
return str
.replace(/([a-z\d])([A-Z])/g, '$1' + separator + '$2')
.replace(/([A-Z]+)([A-Z][a-z\d]+)/g, '$1' + separator + '$2')
.toLowerCase();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _dasherize(str){return _decamelize(str).replace(/[ _]/g, '-')}",
"function unhyphenate(str){\n\t str = toString(str);\n\t return str.replace(/(\\w)(-)(\\w)/g, '$1 $3');\n\t }",
"function toHyphenDelimited (string) {\n return string.replace(/([a-z][A-Z])/g, function (g) {\n return ... | [
"0.7354994",
"0.68960834",
"0.65580666",
"0.65105164",
"0.65105164",
"0.6434672",
"0.63976294",
"0.63621306",
"0.63453674",
"0.63419646",
"0.6294325",
"0.6270401",
"0.62457764",
"0.6242554",
"0.6231834",
"0.6231834",
"0.6231834",
"0.6231834",
"0.6231834",
"0.6231834",
"0.6225... | 0.7090734 | 1 |
show image as icon on button | function showImageOnButton(uri) {
//me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder"><img src="' + uri + '" class="addPhotoButtonImage"/></div>');
me.getAddImageButtonRef().setHtml('<div class="addPhotoButtonHolder" style="background:url(' + uri + '); background-size:cover; backgroun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function penguinIcon() {\n iconType = image[0];\n $('#status').html(\"Selected place icon is \"+'<img src=\"'+iconType+'\">');\n}",
"function displayIcon(id, imgSrc){\n var elem = document.getElementById(id);\n if (elem) \n elem.src = imgSrc;\n }",
"function createButton(icon)... | [
"0.703531",
"0.6779759",
"0.6743075",
"0.6592491",
"0.6543792",
"0.65394133",
"0.6497033",
"0.64916337",
"0.6489585",
"0.6455797",
"0.641277",
"0.62939835",
"0.62808466",
"0.62791866",
"0.62377536",
"0.62253857",
"0.6222732",
"0.6217703",
"0.62109554",
"0.6205579",
"0.6176818... | 0.7310389 | 0 |
copy photo from gallery to tfs (for iOS) | function copyPhoto(fileEntry) {
window.resolveLocalFileSystemURL(
Sencha.app.getImagesFolder(),
function(fspDestDir) {
fileEntry.copyTo(
fspDestDir,
null,
setImageURL,
function (err) {
console.log('fail');
console.log('error code: ' + err.code);
}
);
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function chooseFromGallery(){\n navigator.camera.getPicture(videoTakenFromGallerySuccess,videoTakenFromGalleryFailed,{ sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY,\n mediaType:navigator.camera.MediaType.ALLMEDIA,allowEdit:true,\n });\n}",
"... | [
"0.561532",
"0.55945224",
"0.5586316",
"0.544252",
"0.53647995",
"0.53227454",
"0.5286344",
"0.52729326",
"0.52709943",
"0.52616906",
"0.52192575",
"0.51363444",
"0.51013196",
"0.5085947",
"0.50716823",
"0.5056637",
"0.5042237",
"0.50379175",
"0.503484",
"0.50297225",
"0.5026... | 0.64179885 | 0 |
Valid if it exists, and is not an autoadded Storybook element i.e. It is not dependent on Storybook's Preview implementation, so it'll work in JSDom (Jest) | function isValidTargetElement(targetElement) {
return (0, _typeGuards.isNotNil)(targetElement) && targetElement !== _storybook.A11yElement.Root && targetElement !== _storybook.A11yElement.Component;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_assertElementExists(matchElement, element) {\n const elName = element.name.replace(/^:xhtml:/, '');\n if (!matchElement && !this._schemaRegistry.hasElement(elName, this._schemas)) {\n let errorMsg = `'${elName}' is not a known element:\\n`;\n errorMsg += `1. If '${elName}' is a... | [
"0.61298835",
"0.61298835",
"0.61205226",
"0.61205226",
"0.60724515",
"0.5960004",
"0.5713902",
"0.57050514",
"0.5687601",
"0.56861067",
"0.567351",
"0.5665304",
"0.5644558",
"0.5642582",
"0.5637174",
"0.55661213",
"0.5520047",
"0.5512397",
"0.5487254",
"0.5466414",
"0.546066... | 0.63711554 | 0 |
endregion Generates Jest a11y tests for all stories in a module Note: `colorcontrast` rule is NOT checked, and it is not likely to be fixed soon. Verify it is/isn't checked with a `console.log(results)` below | async function generateA11yStoryTests(storyModule) {
var _storyModule$default$, _storyModule$default$2;
const storiesTargetElement = (_storyModule$default$ = storyModule.default.parameters) === null || _storyModule$default$ === void 0 ? void 0 : (_storyModule$default$2 = _storyModule$default$.a11y) === null || _st... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportT... | [
"0.57294434",
"0.5580079",
"0.5499903",
"0.543109",
"0.53744584",
"0.53662854",
"0.5349277",
"0.5311394",
"0.5297236",
"0.5289699",
"0.5285793",
"0.5285352",
"0.5285352",
"0.5285352",
"0.5278204",
"0.5275723",
"0.52538955",
"0.52538955",
"0.51994085",
"0.51746184",
"0.5172395... | 0.66634655 | 0 |
Public Functions / changeTagValueType update data when tag value type change | function changeTagValueType() {
// Update the model value type
vm.tagModel.valType = vm.tagValueTypeDropdown.selectedTagValueType.value;
if (vm.tagModel.valType === 'P') {
// Trigger a blur to update the input formatting
$timeout(function() {
$('#tag-percent-input').blur();
}, 0);
} else {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateTagValue() {\n\n\t\tif (!isUpdateValid()) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Start processing animation\n\t\tvm.tagModel.processing = true;\n\n\t\t// Allow the animation to complete before closing\n\t\t$timeout(function() {\n\n\t\t\t// Update the tag values by reference\n\t\t\tvm.initTagData.valType ... | [
"0.6505273",
"0.6376833",
"0.6187452",
"0.6109588",
"0.6109588",
"0.6109588",
"0.6109588",
"0.6048532",
"0.5974636",
"0.59192455",
"0.5913044",
"0.58147687",
"0.5695044",
"0.5641808",
"0.56093323",
"0.5592057",
"0.558667",
"0.55201674",
"0.5517151",
"0.55169946",
"0.5466293",... | 0.7618515 | 0 |
isUpdateValid is the tag value form valid? | function isUpdateValid() {
var modelNum,
maxNum;
if (vm.tagModel.valType === 'P') {
modelNum = Number(vm.percentSlider.model);
maxNum = 100;
} else {
modelNum = Number(vm.currencySlider.model);
maxNum = Number(vm.currencySlider.options.max);
}
return modelNum > 0 && modelNum <= maxNum;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _formUpdateValid(){\n \tif ($scope.updateuser.$valid){\n \t\treturn true;\n \t} else {\n \t\treturn false;\n \t\t}\n }",
"check_update(value) { return (this.value != value); }",
"validateBeforeUpdate (id, newData, prevData) { return true }",
"function isObsFormValid(){\t \n va... | [
"0.6944741",
"0.63028544",
"0.6260635",
"0.6087864",
"0.6078639",
"0.6070235",
"0.60670257",
"0.58582544",
"0.58548623",
"0.57840073",
"0.57627743",
"0.5752816",
"0.57387906",
"0.571443",
"0.56738544",
"0.5644522",
"0.5641344",
"0.56112695",
"0.55955",
"0.5535345",
"0.5534027... | 0.7146377 | 0 |
updateTagValue update the value of the tag | function updateTagValue() {
if (!isUpdateValid()) {
return;
}
// Start processing animation
vm.tagModel.processing = true;
// Allow the animation to complete before closing
$timeout(function() {
// Update the tag values by reference
vm.initTagData.valType = vm.tagModel.valType;
vm.initTagDat... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set tag(value) {}",
"set tag(value) {}",
"set tag(value) {}",
"set tag(value) {}",
"updateValueByDOMTags(){\n this.value.length = 0;\n\n [].forEach.call(this.getTagElms(), node => {\n if( node.classList.contains(this.settings.classNames.tagNotAllowed.split(' ')[0]) ) return\n ... | [
"0.6492815",
"0.6492815",
"0.6492815",
"0.6492815",
"0.6103223",
"0.6081969",
"0.596684",
"0.596684",
"0.596684",
"0.59585774",
"0.5846785",
"0.5839426",
"0.5806268",
"0.5747082",
"0.57427496",
"0.5638813",
"0.5456899",
"0.54544014",
"0.5444481",
"0.54350126",
"0.54139423",
... | 0.7507505 | 0 |
Private Functions / percentSliderStop when the slider stops, blur the input to get the proper formatting | function percentSliderStop() {
$('#tag-percent-input').blur();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }",
"onSliderBlur() {\n gShaderToy.mMouseIsDown = false;\n }",
"_blur(event) {\n // Depending on support for input[type=range],\n // the event.target could be either the handle or its child input.\n // Use closes... | [
"0.7218121",
"0.7218121",
"0.6938819",
"0.6700834",
"0.6666914",
"0.6539147",
"0.6391279",
"0.6296303",
"0.6296303",
"0.62397665",
"0.62397665",
"0.6190092",
"0.6147399",
"0.61416197",
"0.6138224",
"0.6138224",
"0.61041045",
"0.6077673",
"0.6045355",
"0.6036651",
"0.6036568",... | 0.8401178 | 0 |
currencySliderStop when the slider stops, blur the input to get the proper formatting | function currencySliderStop() {
$('#tag-currency-input').blur();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function percentSliderStop() {\n\n\t\t$('#tag-percent-input').blur();\n\t}",
"registerConvert() {\n\t\tlet fields = this.container.find('.js-currencyc_value');\n\t\tfields.on('keyup focusout', (e) => {\n\t\t\tlet value = App.Fields.Double.formatToDb(e.currentTarget.value);\n\t\t\tlet currentCurrencyData = $(e.cu... | [
"0.7104866",
"0.63198334",
"0.63052547",
"0.63052547",
"0.6225074",
"0.61850816",
"0.6126309",
"0.60301",
"0.5933545",
"0.57518923",
"0.56433153",
"0.56074816",
"0.56014985",
"0.56014985",
"0.5597195",
"0.55478835",
"0.5537766",
"0.5528481",
"0.5506492",
"0.54987305",
"0.5498... | 0.87058455 | 0 |
This class defines a complete generic visitor for a parse tree produced by PythonLikeParser. | function PythonLikeVisitor() {
antlr4.tree.ParseTreeVisitor.call(this);
return this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"visitNode(node) { }",
"visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\n else {\n node.visit(this);\n }\n }",
"visit(node, context) {\n if (node instanceof AST) {\n node.visit(this, context);\n }\... | [
"0.65919274",
"0.60482764",
"0.60482764",
"0.5950813",
"0.58122927",
"0.58122927",
"0.58122927",
"0.577187",
"0.5699212",
"0.56250006",
"0.56055236",
"0.55747366",
"0.55630654",
"0.5482851",
"0.5422624",
"0.5421316",
"0.5384845",
"0.53826153",
"0.538102",
"0.5351745",
"0.5320... | 0.7582853 | 0 |
use for get current file info used by file_on_mouse_down, open_new_dir. | function get_cur_file_info_by_id(id){
file_to_operate_id = id;
element_to_operate = document.getElementById(id);
switch(cur_dir_path){
case 'root':
file_to_operate_name = get_json_by_id(cur_dir_path, file_to_operate_id).type;
break;
case 'root/Pictures':
file_to_operate_name = get_... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_current_code_path(){\n\tvar id = $(\"#file_name_nav\").find(\"span.selected\").attr(\"id\");\n\tid = id.replace(\"t_\", \"\");\n\treturn full_path($(\"#\"+id));\n}",
"get info() {\n return this.project.getFileInfo(this.path)\n }",
"function showFileInfo(file){\n console.log(\"name : \" ... | [
"0.64498436",
"0.6211815",
"0.5877517",
"0.58511686",
"0.58344495",
"0.5813102",
"0.5813102",
"0.56974804",
"0.56627387",
"0.5660691",
"0.55960137",
"0.55346304",
"0.55316913",
"0.5522157",
"0.54973036",
"0.5495355",
"0.5493738",
"0.54894185",
"0.5487194",
"0.5457002",
"0.539... | 0.6290701 | 1 |
This is the handler that captures mousemove events when an element is being dragged. It is responsible for moving the element. | function moveHandler(e) {
func_state = state_mouse_move;
if (!e) e = window.event; // IE event Model
// Move the element to the current mouse position, adjusted by the
// position of the scrollbars and the offset of the initial click.
var scroll = getScrollOffsets();
var le... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveHandler(e) {\n if (!e) e = window.event; // IE event Model\n\n // Move the element to the current mouse position, adjusted by the\n // position of the scrollbars and the offset of the initial click.\n var scroll = lion.getScrollOffsets();\n elementToDrag.style.left ... | [
"0.7829178",
"0.75963956",
"0.75963956",
"0.75552905",
"0.75467914",
"0.74622387",
"0.7408157",
"0.7294221",
"0.72456145",
"0.7178884",
"0.71744835",
"0.70877546",
"0.70258254",
"0.7008248",
"0.6947241",
"0.687514",
"0.6863924",
"0.6841702",
"0.6828741",
"0.6769443",
"0.67639... | 0.7636558 | 1 |
return a serial number | serialNumber() {
return `${this.getSNString()}${(this.increament++).toString().padStart(this.padCount, '0')}`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getSerialId() {\n if (!this.serialid) {\n let id = this.getId();\n if (id) {\n id = id.replace(/(.+?)\\/(.+?)\\/(.*)/, '$2');\n this.serialid = id.replace(/(.+)-(.+)/, '$2');\n }\n }\n return this.serialid;\n }",
"function SerialNum()\n{\n var num = 1;\n}",
"async func... | [
"0.76606715",
"0.71967834",
"0.7139077",
"0.6988839",
"0.66305053",
"0.6586764",
"0.6361851",
"0.62254936",
"0.6079622",
"0.6056119",
"0.6008889",
"0.5999183",
"0.594697",
"0.58675075",
"0.5865588",
"0.5862116",
"0.5846896",
"0.5840436",
"0.58371073",
"0.5819352",
"0.58148134... | 0.846465 | 0 |
animates loading screen logo with random glitch animation | function animateLogo() {
let random;
random = Math.floor((Math.random() * 3)+ 1);
$('#wave').css("animation", "glitch" + random + " 2s ease infinite");
setTimeout(function(){ random = Math.floor((Math.random() * 3)+ 1); $('#erase').css("animation", "glitch" + random + " 2s ease infinite");
setTimeou... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function runLogoAnimation() {\n for (const path of svgDrawingPaths) {\n path.style.strokeDashoffset = \"0px\";\n }\n for (const cPath of svgCirclePaths) {\n cPath.style.cssText = \"stroke-dashoffset: 0; transition-delay: 1200ms;\";\n }\n svgVerve.style.cssText =\n \"transform:translateX(0px); transit... | [
"0.7409085",
"0.7091233",
"0.69012314",
"0.68325716",
"0.6708544",
"0.6704111",
"0.66919994",
"0.66762847",
"0.6619367",
"0.66165656",
"0.65011317",
"0.64985526",
"0.64854777",
"0.6482383",
"0.64663875",
"0.64638346",
"0.6448776",
"0.6436602",
"0.634412",
"0.63065964",
"0.629... | 0.7591164 | 0 |
stops logo animation :) | function stopLogo() {
clearInterval(logo);
$('#wave').css("display", "none");
$('#blur').css("display", "none");
$('#erase').css("display", "none");
$('#glitch1').css("display", "block");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopLogoAnimation() {\n if (typeof window.showlogo_iv !== 'undefined') {\n window.ncka = window.lgss = window.lga = 1;\n clearInterval(window.showlogo_iv);\n showLogo(true);\n ... | [
"0.86108387",
"0.7080638",
"0.70496047",
"0.70471853",
"0.6957593",
"0.6907867",
"0.6819871",
"0.6818485",
"0.67659694",
"0.67659694",
"0.67659694",
"0.67310756",
"0.67289686",
"0.6680569",
"0.6631503",
"0.6617334",
"0.65762746",
"0.6566484",
"0.6548353",
"0.65399414",
"0.653... | 0.8123087 | 1 |
animates toggling the featured video | function toggleVideo() {
if($('#featured').hasClass('toggled')) {
$('#form-overlay-wrapper').animate({maxHeight: 0}, 500);
$('#link-form').animate({opacity: 0}, 200);
$('#featured').css('animation', 'toggleFeaturedOn 1s ease forwards');
$('#main-title-wrapper').animate({maxHeight: 0}, 500);
$('#ma... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }",
"function toggle() {\n var trailer = document.querySelector('#onetra');\n var video = document.querySelector('video');\n onetra.classList.toggle('active')\n ... | [
"0.6483139",
"0.6390514",
"0.6388819",
"0.63766366",
"0.63230723",
"0.6285341",
"0.6250968",
"0.62208354",
"0.62047714",
"0.6186793",
"0.6175213",
"0.61472607",
"0.61271334",
"0.6116968",
"0.61030436",
"0.60870284",
"0.6034762",
"0.60342544",
"0.6033538",
"0.6010624",
"0.6006... | 0.7665488 | 0 |
If a resolver is defined, it must be a function. | function isValidResolver(resolver) {
return resolver == null || typeof resolver === 'function';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resolve(value) {\n\t\t\treturn typeof value === 'function' ? value() : value;\n\t\t}",
"function isTypeResolver(\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfn) {\n // 1. A type provider must be a function\n if (typeof fn !== 'function')\n return false;\n // 2. A cla... | [
"0.60108536",
"0.5983928",
"0.57119197",
"0.556918",
"0.5547538",
"0.55399346",
"0.55316556",
"0.54889995",
"0.5416304",
"0.5416304",
"0.54119635",
"0.5396087",
"0.53853196",
"0.53853196",
"0.53354096",
"0.5296625",
"0.5274366",
"0.52573806",
"0.5207318",
"0.5182532",
"0.5179... | 0.78889376 | 1 |
Returns an operation AST given a document AST and optionally an operation name. If a name is not provided, an operation is only returned if only one is provided in the document. | function getOperationAST(documentAST, operationName) {
var operation = null;
for (var i = 0; i < documentAST.definitions.length; i++) {
var definition = documentAST.definitions[i];
if (definition.kind === _kinds.OPERATION_DEFINITION) {
if (!operationName) {
// If no operation name was provided... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOperationAST(documentAST, operationName) {\n var operation = null;\n\n for (var i = 0; i < documentAST.definitions.length; i++) {\n var definition = documentAST.definitions[i];\n\n if (definition.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_0__[\"Kind\"].OPERATION_DEFINITION) {\n if (... | [
"0.8256176",
"0.82004493",
"0.82004493",
"0.81809",
"0.81809",
"0.81494194",
"0.81430614",
"0.59448606",
"0.59448606",
"0.5887792",
"0.58035177",
"0.5791091",
"0.57523274",
"0.57154346",
"0.5593686",
"0.5580738",
"0.55647475",
"0.55647475",
"0.55647475",
"0.55647475",
"0.5555... | 0.82664794 | 1 |
Given a type's introspection result, construct the correct GraphQLType instance. | function buildType(type) {
switch (type.kind) {
case _introspection.TypeKind.SCALAR:
return buildScalarDef(type);
case _introspection.TypeKind.OBJECT:
return buildObjectDef(type);
case _introspection.TypeKind.INTERFACE:
return buildInterfaceDef(type);
case _introspect... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function buildType(type) {\n switch (type.kind) {\n case _typeIntrospection.TypeKind.SCALAR:\n return buildScalarDef(type);\n case _typeIntrospection.TypeKind.OBJECT:\n return buildObjectDef(type);\n case _typeIntrospection.TypeKind.INTERFACE:\n return buildInterfaceDef(type)... | [
"0.62939745",
"0.61280996",
"0.6125423",
"0.60745406",
"0.59689707",
"0.59103006",
"0.58754486",
"0.58754486",
"0.5817086",
"0.57816267",
"0.57815415",
"0.57815415",
"0.5747277",
"0.5745704",
"0.5744993",
"0.5744993",
"0.5703063",
"0.56787306",
"0.56731856",
"0.56731856",
"0.... | 0.63095886 | 1 |
Provided a collection of ASTs, presumably each from different files, concatenate the ASTs together into batched AST, useful for validating many GraphQL source files which together represent one conceptual application. | function concatAST(asts) {
var batchDefinitions = [];
for (var i = 0; i < asts.length; i++) {
var definitions = asts[i].definitions;
for (var j = 0; j < definitions.length; j++) {
batchDefinitions.push(definitions[j]);
}
}
return {
kind: 'Document',
definitions: batchDefinitions
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function concatAST(asts) {\n\t var batchDefinitions = [];\n\t for (var i = 0; i < asts.length; i++) {\n\t var definitions = asts[i].definitions;\n\t for (var j = 0; j < definitions.length; j++) {\n\t batchDefinitions.push(definitions[j]);\n\t }\n\t }\n\t return {\n\t kind: 'Document',\n\t d... | [
"0.6908495",
"0.6170209",
"0.6108926",
"0.5783711",
"0.5783711",
"0.5568391",
"0.5568391",
"0.5568391",
"0.54284203",
"0.5300837",
"0.5247986",
"0.5224473",
"0.5103726",
"0.50698173",
"0.49965164",
"0.49735075",
"0.4945306",
"0.4937225",
"0.4897356",
"0.48926285",
"0.48727074... | 0.7075156 | 1 |
Given two schemas, returns an Array containing descriptions of all the types of potentially dangerous changes covered by the other functions down below. | function findDangerousChanges(oldSchema, newSchema) {
return [].concat(findArgChanges(oldSchema, newSchema).dangerousChanges, findValuesAddedToEnums(oldSchema, newSchema), findTypesAddedToUnions(oldSchema, newSchema));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findDangerousChanges(oldSchema, newSchema) {\n return [].concat(findArgChanges(oldSchema, newSchema).dangerousChanges, findValuesAddedToEnums(oldSchema, newSchema), findInterfacesAddedToObjectTypes(oldSchema, newSchema), findTypesAddedToUnions(oldSchema, newSchema), findFieldsThatChangedTypeOnInputObject... | [
"0.7039056",
"0.70201594",
"0.6972318",
"0.6959837",
"0.6959837",
"0.6959837",
"0.6959837",
"0.6901334",
"0.6893894",
"0.6893894",
"0.68903375",
"0.6874852",
"0.6867015",
"0.6867015",
"0.68197554",
"0.67576176",
"0.67539984",
"0.67539984",
"0.65311575",
"0.6468782",
"0.646878... | 0.7191499 | 0 |
Given two schemas, returns an Array containing descriptions of any breaking changes in the newSchema related to removing an entire type. | function findRemovedTypes(oldSchema, newSchema) {
var oldTypeMap = oldSchema.getTypeMap();
var newTypeMap = newSchema.getTypeMap();
var breakingChanges = [];
Object.keys(oldTypeMap).forEach(function (typeName) {
if (!newTypeMap[typeName]) {
breakingChanges.push({
type: BreakingChangeType.TYPE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findRemovedTypes(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n\n var _arr = Object.keys(oldTypeMap);\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var typeName = _arr[_i];\n\n if (!newTypeMap[typeNa... | [
"0.8176876",
"0.814868",
"0.7263231",
"0.7255352",
"0.72205025",
"0.72205025",
"0.7170979",
"0.70155483",
"0.70155483",
"0.697916",
"0.69538426",
"0.69538426",
"0.6949668",
"0.6916142",
"0.6904582",
"0.67299575",
"0.67047393",
"0.67047393",
"0.67047393",
"0.66956633",
"0.6695... | 0.82110786 | 1 |
Given two schemas, returns an Array containing descriptions of any breaking or dangerous changes in the newSchema related to arguments (such as removal or change of type of an argument, or a change in an argument's default value). | function findArgChanges(oldSchema, newSchema) {
var oldTypeMap = oldSchema.getTypeMap();
var newTypeMap = newSchema.getTypeMap();
var breakingChanges = [];
var dangerousChanges = [];
Object.keys(oldTypeMap).forEach(function (typeName) {
var oldType = oldTypeMap[typeName];
var newType = newTypeMap[ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findArgChanges(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var breakingChanges = [];\n var dangerousChanges = [];\n\n var _arr3 = Object.keys(oldTypeMap);\n\n for (var _i3 = 0; _i3 < _arr3.length; _i3++) {\n var typeName = _arr3[... | [
"0.7709526",
"0.7294602",
"0.72251356",
"0.7023517",
"0.69008",
"0.689002",
"0.689002",
"0.6832358",
"0.6598981",
"0.65873826",
"0.65873826",
"0.65614253",
"0.65614253",
"0.6555589",
"0.6555589",
"0.6555589",
"0.6555589",
"0.6539358",
"0.6526367",
"0.64818496",
"0.6415634",
... | 0.7818474 | 1 |
Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding types to a union type. | function findTypesAddedToUnions(oldSchema, newSchema) {
var oldTypeMap = oldSchema.getTypeMap();
var newTypeMap = newSchema.getTypeMap();
var typesAddedToUnion = [];
Object.keys(newTypeMap).forEach(function (typeName) {
var oldType = oldTypeMap[typeName];
var newType = newTypeMap[typeName];
if (!(o... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findTypesAddedToUnions(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var typesAddedToUnion = [];\n\n var _arr11 = Object.keys(newTypeMap);\n\n for (var _i11 = 0; _i11 < _arr11.length; _i11++) {\n var typeName = _arr11[_i11];\n va... | [
"0.78702915",
"0.76301306",
"0.7412617",
"0.7412617",
"0.74009883",
"0.7070576",
"0.7035441",
"0.7035441",
"0.7005445",
"0.68193376",
"0.68171537",
"0.68171537",
"0.6798756",
"0.6781975",
"0.6781975",
"0.6754903",
"0.65813017",
"0.6446255",
"0.6431304",
"0.63871443",
"0.63271... | 0.7796355 | 1 |
Given two schemas, returns an Array containing descriptions of any dangerous changes in the newSchema related to adding values to an enum type. | function findValuesAddedToEnums(oldSchema, newSchema) {
var oldTypeMap = oldSchema.getTypeMap();
var newTypeMap = newSchema.getTypeMap();
var valuesAddedToEnums = [];
Object.keys(oldTypeMap).forEach(function (typeName) {
var oldType = oldTypeMap[typeName];
var newType = newTypeMap[typeName];
if (!(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function findValuesAddedToEnums(oldSchema, newSchema) {\n var oldTypeMap = oldSchema.getTypeMap();\n var newTypeMap = newSchema.getTypeMap();\n var valuesAddedToEnums = [];\n\n var _arr13 = Object.keys(oldTypeMap);\n\n for (var _i13 = 0; _i13 < _arr13.length; _i13++) {\n var typeName = _arr13[_i13];\n v... | [
"0.7961201",
"0.7452213",
"0.7186998",
"0.7186998",
"0.7143121",
"0.6903845",
"0.6899022",
"0.68724793",
"0.68724793",
"0.68663436",
"0.6860933",
"0.6849344",
"0.6849344",
"0.68405265",
"0.6779417",
"0.67071426",
"0.6547236",
"0.65066653",
"0.64276445",
"0.63447815",
"0.63329... | 0.7793059 | 1 |
Perform the analysis. This must be called before writeTypingsFile(). | analyze() {
if (this._astEntryPoint) {
throw new Error('DtsRollupGenerator.analyze() was already called');
}
// Build the entry point
const sourceFile = this._context.package.getDeclaration().getSourceFile();
this._astEntryPoint = this._astSymbolTable.fetchEntryPoint(... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"postAnalysis() { }",
"processTypings(files) {\n // Set hashes of the app's typings.\n files.forEach(file => {\n let isAppTypings = this.isDeclarationFile(file) &&\n !this.isPackageFile(file);\n\n let path = file.getPathInPackage();\n if (isAppTypings && !this._typingsMap.has(path)) {\... | [
"0.5682125",
"0.55620515",
"0.5528616",
"0.54487497",
"0.5186837",
"0.51358396",
"0.50535023",
"0.50306",
"0.49961954",
"0.49456286",
"0.4872391",
"0.48717216",
"0.48588556",
"0.48485678",
"0.48256865",
"0.48208138",
"0.47816533",
"0.4761912",
"0.46887577",
"0.46489328",
"0.4... | 0.59221 | 0 |
Generates the typings file and writes it to disk. | writeTypingsFile(dtsFilename, dtsKind) {
const indentedWriter = new IndentedWriter_1.IndentedWriter();
this._generateTypingsFileContent(indentedWriter, dtsKind);
node_core_library_1.FileSystem.writeFile(dtsFilename, indentedWriter.toString(), {
convertLineEndings: "\r\n" /* CrLf */,
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function typings() {\n const tmpDir = './typings/tmp';\n const blocklySrcs = [\n \"core/\",\n \"core/components\",\n \"core/components/tree\",\n \"core/components/menu\",\n \"core/keyboard_nav\",\n \"core/renderers/common\",\n \"core/renderers/measurables\",\n \"core/theme\",\n \"core/... | [
"0.7189702",
"0.6461203",
"0.6074944",
"0.5802386",
"0.57882553",
"0.5659313",
"0.55635446",
"0.5557573",
"0.54775023",
"0.5312856",
"0.52679414",
"0.52399546",
"0.5210028",
"0.51979256",
"0.51685524",
"0.51669836",
"0.5165133",
"0.5160877",
"0.5146327",
"0.51181906",
"0.5097... | 0.729225 | 0 |
Ensures a unique name for each item in the package typings file. | _makeUniqueNames() {
const usedNames = new Set();
// First collect the explicit package exports
for (const dtsEntry of this._dtsEntries) {
if (dtsEntry.exported) {
if (usedNames.has(dtsEntry.originalName)) {
// This should be impossible
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"processTypings(files) {\n // Set hashes of the app's typings.\n files.forEach(file => {\n let isAppTypings = this.isDeclarationFile(file) &&\n !this.isPackageFile(file);\n\n let path = file.getPathInPackage();\n if (isAppTypings && !this._typingsMap.has(path)) {\n this._typingsMa... | [
"0.58403444",
"0.57442",
"0.5719649",
"0.5575649",
"0.5575649",
"0.5556027",
"0.5556027",
"0.5552457",
"0.5389013",
"0.52895075",
"0.5261061",
"0.5215282",
"0.5211531",
"0.5206816",
"0.5181104",
"0.50838786",
"0.50370914",
"0.50254107",
"0.49946228",
"0.49946228",
"0.4979858"... | 0.68521297 | 0 |
Before writing out a declaration, _modifySpan() applies various fixups to make it nice. | _modifySpan(span, dtsEntry, astDeclaration, dtsKind) {
const previousSpan = span.previousSibling;
let recurseChildren = true;
switch (span.kind) {
case ts.SyntaxKind.JSDocComment:
// If the @packagedocumentation comment seems to be attached to one of the regular API i... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function attachLocalSpans(doc, change, from, to) {\n\t\t var existing = change[\"spans_\" + doc.id], n = 0;\n\t\t doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) {\n\t\t if (line.markedSpans)\n\t\t { (existing || (existing = change[\"spans_\" + doc.id] = {}... | [
"0.57268137",
"0.57213247",
"0.5699011",
"0.56869346",
"0.56869346",
"0.56869346",
"0.5681026",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.5663481",
"0.56591445",
"0.56591445",
"0.565914... | 0.73561174 | 0 |
You are given two positive integers a and b (a < b <= 20000). Complete the function which returns a list of all those numbers in the interval [a, b) whose digits are made up of prime numbers (2, 3, 5, 7) but which are not primes themselves. non prime single digit : 1, 4, 6, 8, 9 | function notPrimes(a,b) {
let nonPrimeArr = [];
for(let i = a; i <= b; i++) {
if(!isPrime(i) && checkForPrimeDigits(i)) {
nonPrimeArr.push(i)
}
}
return nonPrimeArr;
function checkForPrimeDigits(num) {
let numStr = num.toString();
for(let elem of numStr) {
if(elem!=='2' && elem!=='3' ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function notPrimes(a,b){\n let arr = [];\n for (let i = a; i < b; i++){\n if (!/[014689]/.test(i)) {\n for (let j = 2; j <= Math.sqrt(i); j++){\n if (i % j === 0) { arr.push(i); break;}\n }\n }\n }\n return arr;\n}",
"function primes(limit) {\n let ... | [
"0.8612787",
"0.7368873",
"0.7118093",
"0.70932066",
"0.7036627",
"0.69277114",
"0.6901608",
"0.68667215",
"0.67853785",
"0.6782012",
"0.67624044",
"0.6757332",
"0.67366874",
"0.67043066",
"0.6678171",
"0.6563992",
"0.6545962",
"0.6520927",
"0.6482521",
"0.647499",
"0.6472921... | 0.84410274 | 1 |
Helper Methods Unlock the modal for animation. | function unlockModal() {
locked = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lockModal() {\n locked = true;\n }",
"function lockModal() {\n locked = true;\n }",
"function unlockForEdit() {\n\t$(modalTextTitle).prop(\"disabled\",false);\n\t$(modalTextTitle).css(\"border-bottom\", \"2px solid #7C8487\");\n\n\t$(modalTextareaDescription).prop(\"disabled\",... | [
"0.72454244",
"0.72454244",
"0.6896535",
"0.6820743",
"0.67881566",
"0.6694964",
"0.66023105",
"0.65635765",
"0.6528138",
"0.6525814",
"0.6525814",
"0.6509781",
"0.6484871",
"0.6479335",
"0.646648",
"0.6439817",
"0.6433108",
"0.6390839",
"0.638449",
"0.6374887",
"0.63701576",... | 0.8249799 | 1 |
Lock the modal to prevent further animation. | function lockModal() {
locked = true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function unlockModal() {\n locked = false;\n }",
"function unlockModal() {\n locked = false;\n }",
"function lock() {\n $('button').attr(\"disabled\", \"true\");\n }",
"function lockActions() {\n $('.modal').find('.actions-container')\n .children().first() //... | [
"0.77020603",
"0.77020603",
"0.6724566",
"0.66888505",
"0.6680284",
"0.6579386",
"0.65182763",
"0.6472608",
"0.64131486",
"0.639402",
"0.6376364",
"0.6302623",
"0.62310976",
"0.6218524",
"0.619525",
"0.6177555",
"0.6141152",
"0.6130219",
"0.61241496",
"0.6108205",
"0.60983217... | 0.8878073 | 1 |
Animates the modal opening. Handles the modal 'open' event. | function openAnimation() {
//
// First, determine if we're in the middle of animation.
//
if ( !locked ) {
//
// We're not animating, let's lock the modal for animation.
//
lockModal();
//
// Close any opened modals.
/... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"open() {\n this.modal.jQueryModalFade.addClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'block');\n this.jQueryName.focus();\n }",
"function modalAnimation() {}",
"modalOpen(){\n\t\tthis.setState({modalAppear: true})\n\t}",
"function openModal() {\n setOpen(true);\n }"... | [
"0.72274184",
"0.71450293",
"0.7141732",
"0.7109374",
"0.7081208",
"0.70157766",
"0.6918489",
"0.68839055",
"0.6869721",
"0.68123823",
"0.67818654",
"0.67528653",
"0.67508465",
"0.6713749",
"0.6665212",
"0.6662611",
"0.6645355",
"0.6645355",
"0.6643038",
"0.66234994",
"0.6621... | 0.7665859 | 1 |
Converts JSON to HTML table | function convertToTable(json){
var table = '<table>';
for (x in json){
table += '<tr>';
for (y in json[x]){
table = table + '<td>' + json[x][y] + '</td>';
}
table += '</tr>';
}
table += '</table>';
return table;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function makeTable(json) {\n var obj = JSON.parse(json),\n table = $(\"<table>\"),\n row, value, i;\n\n for (i = 0; i < obj.rows.length; i++) {\n row = $(\"<tr>\");\n row.append(\"<td>\" + obj.rows[i].key + \"</td>\");\n value = obj.rows[i].value... | [
"0.8157815",
"0.794002",
"0.72810906",
"0.72794",
"0.72413075",
"0.72397435",
"0.7226649",
"0.7022742",
"0.7007057",
"0.699789",
"0.6955359",
"0.6935765",
"0.681017",
"0.6798629",
"0.67899024",
"0.67751575",
"0.67607105",
"0.6730741",
"0.6730741",
"0.6716402",
"0.66984075",
... | 0.80924743 | 1 |
rewrite log4js configuration file by replacing relative paths to absolute | function correcting(log_file) {
console.log("Logger: opening log-conf file: " + log_file);
var log = fs.readFileSync(log_file, 'utf8');
var d = false;
var json = JSON.parse(log, function(key, value) {
if (key == 'filename') {
var dirname = utils.dirname(value);
var basename = value.replace(dirname, '... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_loadFileConfig() {\n try {\n let lines = fs.readFileSync(this._LOGLOVE_CONFIG).toString().split('\\n');\n for (let line of lines) {\n let levelPattern = line.split('=');\n this._setLevelAndPatterns(levelPattern[0], levelPattern[1]);\n }\n } catch (err) {\n // console.log('_... | [
"0.54720616",
"0.5089851",
"0.50360763",
"0.5010054",
"0.4969121",
"0.49680153",
"0.4944592",
"0.49240178",
"0.47732988",
"0.47269222",
"0.469177",
"0.46910536",
"0.46713278",
"0.46398327",
"0.46238816",
"0.46063665",
"0.45993313",
"0.45690107",
"0.45314348",
"0.4530905",
"0.... | 0.54788125 | 0 |
Delete the tasks from a specific team by a date range | function deleteTasksByTeamByRange(options, allTasks, myTasks)
{
var calls = [];
Teams.getTasksRange(options)
.then(function (tasks)
{
if(tasks.length == 0)
{
$rootScope.notifier.error($rootScope.ui.planboard... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is no... | [
"0.6183778",
"0.6146677",
"0.6114453",
"0.6088318",
"0.6052065",
"0.58599496",
"0.57875973",
"0.5784129",
"0.5782057",
"0.5766821",
"0.571558",
"0.571338",
"0.5693251",
"0.5689389",
"0.56837016",
"0.56749547",
"0.5636516",
"0.55587596",
"0.5543796",
"0.55289215",
"0.5527656",... | 0.7921611 | 0 |
Returns the unique dates determined by the accompanying comparison function | function uniqueDates(dates, compareFn) {
var d = dates.concat();
// n-squared. can probably be better here. (_.union? _.merge?)
for (var i = 0; i < d.length; ++i) {
for (var j = i + 1; j < d.length; ++j) {
if (compareFn(d[i], d[j]) === 0) {
// remo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSortedUniqueDate(bookings) {\n let uniqueDate = [];\n for (let i = 0; i < bookings.length -1; i++) {\n if(!uniqueDate.includes(bookings[i].date.substring(5,10))){\n uniqueDate.push(bookings[i].date.substring(5,10))\n }\n }\n const sortedUniqueDate= uniqueDate.sort()\n return sortedUniqu... | [
"0.63693047",
"0.62496966",
"0.6195258",
"0.6165936",
"0.60871106",
"0.59565145",
"0.58595645",
"0.58589715",
"0.5834164",
"0.5825121",
"0.58009577",
"0.57928205",
"0.57762784",
"0.57596713",
"0.5755276",
"0.5740565",
"0.5691843",
"0.56712985",
"0.5655792",
"0.56167334",
"0.5... | 0.77713454 | 0 |
Compares two dates with the help of the provided comparator function | function compareDatesWithFunction(d1, d2, fnC) {
var c1 = fnC(d1);
var c2 = fnC(d2);
if (c1 > c2) return 1;
if (c1 < c2) return -1;
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compFunc(a, b)\n{\n\tif (a.date < b.date)\n\t\treturn 1;\n\telse if (a.date > b.date)\n\t\treturn -1;\n\telse\n\t\treturn 0;\n}",
"function compare_date( a, b ) {\n if ( a.date < b.date){\n return -1;\n }\n if ( a.date > b.date ){\n return 1;\n }\n return 0;\n}",
"function d... | [
"0.73501474",
"0.7120855",
"0.70249486",
"0.70114815",
"0.6975558",
"0.69590884",
"0.6923796",
"0.6900942",
"0.689917",
"0.68973756",
"0.68314284",
"0.68014747",
"0.6645342",
"0.6622629",
"0.6592738",
"0.65926725",
"0.6576781",
"0.6573856",
"0.6554653",
"0.65489477",
"0.65375... | 0.7148702 | 1 |
Compares if dates appear in the same logical quarter | function compareQuarters(d1, d2) {
var m1 = d1.getMonth();
var m2 = d2.getMonth();
var q1 = (Math.floor(m1 / 3) * 3);
var q2 = (Math.floor(m2 / 3) * 3);
if (q1 > q2) return 1;
if (q1 < q2) return -1;
return 0;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareQuarterYears(d1, d2) {\n var r = compareYears(d1, d2);\n if (r === 0) {\n r = compareQuarters(d1, d2);\n }\n return r;\n }",
"function getCurrentQuarter(){\n let startDate = new Date()\n let endDate = new Date()\n let month = endDate.getMonth()\n... | [
"0.69359875",
"0.61757916",
"0.6020083",
"0.60103697",
"0.59846246",
"0.58858174",
"0.5853647",
"0.5846302",
"0.5828677",
"0.58286446",
"0.5808071",
"0.57497674",
"0.5706315",
"0.56884485",
"0.5653579",
"0.56431323",
"0.56376064",
"0.5606512",
"0.5584658",
"0.55477524",
"0.55... | 0.703043 | 0 |
Compares one date with another if they are the same quarter of the same year | function compareQuarterYears(d1, d2) {
var r = compareYears(d1, d2);
if (r === 0) {
r = compareQuarters(d1, d2);
}
return r;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compareQuarters(d1, d2) {\n var m1 = d1.getMonth();\n var m2 = d2.getMonth();\n var q1 = (Math.floor(m1 / 3) * 3);\n var q2 = (Math.floor(m2 / 3) * 3);\n if (q1 > q2) return 1;\n if (q1 < q2) return -1;\n return 0;\n }",
"function _isNextYear(d1, d2) {... | [
"0.7048928",
"0.6692871",
"0.66361976",
"0.65389264",
"0.63547534",
"0.63365585",
"0.62701106",
"0.6159095",
"0.6129432",
"0.6115656",
"0.6101225",
"0.60819244",
"0.6069449",
"0.6043508",
"0.60178137",
"0.5967939",
"0.5959819",
"0.5959819",
"0.5906313",
"0.5900762",
"0.589904... | 0.7781297 | 0 |
Run logic in schema at dataModelChange | _checkSchemaLogic(changedData) {
changedData = changedData || {};
const model = this.exo.dataBinding.model;
if (model && model.logic) {
if (typeof (model.logic) === "function") {
this.applyJSLogic(model.logic, null, model, changedData)
}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleModelDataChanged(dataObj) {\n //console.log('handleModelDataChanged', dataObj.payload);\n }",
"function blockCall(change, dataModelName, entityName, data) {\n if (change.hasError === 0) {\n checkForPreviousError(change, dataModelName, entityName, data);\n ... | [
"0.6944443",
"0.623674",
"0.61815137",
"0.6136637",
"0.60225576",
"0.59741586",
"0.59573615",
"0.57878226",
"0.57763386",
"0.5747086",
"0.57308257",
"0.5724112",
"0.572185",
"0.56812304",
"0.56565136",
"0.55925477",
"0.558366",
"0.5545544",
"0.5545084",
"0.5531364",
"0.551550... | 0.6816064 | 1 |
store mpw for autodecryption for autofilling option | function tmpStoreMPW(){
// browser.storage.sync.get("mpw").then(function(res){
// if(res['mpw'] == CryptoJS.SHA512($('#modalInputMPW').val()).toString()){
// SM.setMPW($('#modalInputMPW').val());
// $('#modalMPW').modal('hide');
// // activate checkbox
// $('#pref_autofill_password').prop('checked'... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveForPW(getPw) {\n const encryptPw = encrypt(getPw);\n localStorage.setItem(PW_LS, encryptPw);\n}",
"function withMPDpref(str) { return 'mpd/'+MPD.password+'/'+str; }",
"function encryptorInit() {\n var lock = document.getElementById(\"js-lock\");\n lock.addEventListener(\"click\", promptFor... | [
"0.6445947",
"0.6183979",
"0.5619672",
"0.5609375",
"0.55957896",
"0.55320203",
"0.54935944",
"0.5448543",
"0.5413816",
"0.5399494",
"0.53948253",
"0.53691214",
"0.53690016",
"0.53467315",
"0.53451246",
"0.5340745",
"0.533906",
"0.5338819",
"0.53238666",
"0.5320482",
"0.53181... | 0.6788386 | 0 |
Sets the list of current transformations to the bundler. | _setTransformations() {
// traverse items in the reversed order
var currentIndex = this._browserifyTransformations.length - 1;
while (currentIndex >= 0) {
const currentTransformation = this._browserifyTransformations[currentIndex];
currentIndex--;
if (!currentTransformation ||
typeof (currentTransfo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setTransformations() {\n\t\t// traverse items in the reversed order\n\t\tvar currentIndex = this._browserifyTransformations.length - 1;\n\n\t\twhile (currentIndex >= 0) {\n\t\t\tconst currentTransformation = this._browserifyTransformations[currentIndex];\n\t\t\tcurrentIndex--;\n\t\t\tif (!currentTransformation ||... | [
"0.7263447",
"0.547929",
"0.5444356",
"0.5444356",
"0.5444356",
"0.5444356",
"0.53676915",
"0.530141",
"0.5230234",
"0.52164245",
"0.5198078",
"0.51966965",
"0.5159227",
"0.5158514",
"0.5147033",
"0.5098097",
"0.5061689",
"0.50538903",
"0.5000126",
"0.4947076",
"0.49207065",
... | 0.7211117 | 1 |
Sets the list of current plugins to the bundler. | _setPlugins() {
var currentIndex = this._browserifyPlugins.length - 1;
while (currentIndex >= 0) {
const currentPlugin = this._browserifyPlugins[currentIndex];
currentIndex--;
if (!currentPlugin ||
typeof (currentPlugin) !== 'object' ||
typeof (currentPlugin.plugin) !== 'function') {
this._eve... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_setPlugins() {\n\t\tvar currentIndex = this._browserifyPlugins.length - 1;\n\n\t\twhile (currentIndex >= 0) {\n\t\t\tconst currentPlugin = this._browserifyPlugins[currentIndex];\n\t\t\tcurrentIndex--;\n\t\t\tif (!currentPlugin ||\n\t\t\t\ttypeof (currentPlugin) !== 'object' ||\n\t\t\t\ttypeof (currentPlugin.plugi... | [
"0.8004924",
"0.6818906",
"0.6514046",
"0.6487034",
"0.6434609",
"0.624967",
"0.5965147",
"0.58423436",
"0.58362955",
"0.57685685",
"0.5765481",
"0.5765481",
"0.56770015",
"0.56763065",
"0.5641679",
"0.5604519",
"0.5581039",
"0.55783546",
"0.55635864",
"0.55555177",
"0.552398... | 0.7972612 | 1 |
avant toute collision avec le pnj | function rencontre(pnj, textePnj) { // fonction gérant la collision avec un pnj
if (joueur.posX + joueur.largeur > pnj.posX2 && joueur.posX - tailleTuile < pnj.posX2 && joueur.posY + joueur.hauteur > pnj.posY2 && joueur.posY - tailleTuile < pnj.posY2) {
console.log(pnj.name);
switch(dir) { // on va évaluer la d... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function collision (px,py,pw,ph,ex,ey,ew,eh){\nreturn (Math.abs(px - ex) *2 < pw + ew) && (Math.abs(py - ey) * 2 < ph + eh);\n \n}",
"function collision(b, p) {\r\n //conocemos la altura del jugador\r\n p.top = p.y;\r\n //conocemos la parte inferior del jugador\r\n p.bottom = p.y + p.height;\r\n //la par... | [
"0.7506506",
"0.7225124",
"0.7194058",
"0.71261394",
"0.7066454",
"0.70276684",
"0.69875944",
"0.692585",
"0.69044",
"0.6873446",
"0.6845036",
"0.67910284",
"0.672938",
"0.67030776",
"0.6663254",
"0.6656727",
"0.66527855",
"0.6643274",
"0.663",
"0.6629857",
"0.66223836",
"0... | 0.7339713 | 1 |
Get the log file from the given S3 bucket and key. Parse it and add each log record to the ES domain. | function s3LogsToES(bucket, key, context, lineStream, recordStream) {
// Note: The Lambda function should be configured to filter for .log files
// (as part of the Event Source "suffix" setting).
addFileToDelete(bucket, key);
var s3Stream = s3.getObject({
Bucket: bucket,
Key: key
}).createReadStream();
v... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function s3LogsToES(bucket, key, context, lineStream, recordStream) {\n // Note: The Lambda function should be configured to filter for .log files\n // (as part of the Event Source \"suffix\" setting).\n\n var s3Stream = s3.getObject({Bucket: bucket, Key: key}).createReadStream();\n\n // Flow: S3 file ... | [
"0.7192204",
"0.7129934",
"0.58190775",
"0.56013477",
"0.5531915",
"0.5417477",
"0.5398596",
"0.5318489",
"0.53021234",
"0.5149168",
"0.5094466",
"0.50757706",
"0.5023641",
"0.5020895",
"0.5007629",
"0.49872974",
"0.4980069",
"0.49677464",
"0.49657312",
"0.49385136",
"0.49237... | 0.7220334 | 0 |
Generate and Endpoint from an endpoint schema object. | makeEndpoint(schema) {
return (options) => {
const ep = new endpoint_1.Endpoint(options);
ep.applySchema(ep, schema, schema, ep);
return ep;
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function deriveEndpoint(edge, index, ep, conn) {\n return options.deriveEndpoint ? options.deriveEndpoint(edge, index, ep, conn) : options.endpoint ? options.endpoint : ep.type;\n }",
"set endpoint(endpoint) {\n\t\tif (Array.isArray(endpoint)) {\n\t\t\tthis._endpoint = endpoint.map((i) => new R... | [
"0.6567618",
"0.563212",
"0.54849434",
"0.54841",
"0.5437757",
"0.5389481",
"0.5346032",
"0.53214276",
"0.52909744",
"0.5205821",
"0.5177365",
"0.51664466",
"0.5159697",
"0.5092623",
"0.5089627",
"0.5069809",
"0.5061949",
"0.50262016",
"0.5016462",
"0.49969277",
"0.49825656",... | 0.7860793 | 0 |
Generate API file given discovery URL | async discoverAPI(apiDiscoveryUrl) {
if (typeof apiDiscoveryUrl === 'string') {
const parts = url.parse(apiDiscoveryUrl);
if (apiDiscoveryUrl && !parts.protocol) {
this.log('Reading from file ' + apiDiscoveryUrl);
const file = await readFile(apiDiscoveryUr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function genApiURL ( offset ) {\n URL = gamesURL + apiKey + formatOffset + offset;\n return URL;\n}",
"function buildSpecUrl() {\n let {protocol, host} = window.location\n let url = window.PRELOAD.swagger_url || '/docs?format=openapi'\n return `${protocol}//${host}${url}`\n}",
"async discoverAllAPIs(disco... | [
"0.656145",
"0.6030883",
"0.5935256",
"0.59350294",
"0.58844376",
"0.5838028",
"0.57900196",
"0.5760698",
"0.57544667",
"0.57283306",
"0.5676726",
"0.5670042",
"0.5663588",
"0.56103104",
"0.55902857",
"0.5535263",
"0.55132025",
"0.5500699",
"0.5480999",
"0.54696363",
"0.54557... | 0.71088165 | 0 |
Funcion a la que llamamos cuando se produce el "drag" Hacemos que el evento pueda transferir un dato ("informacion") | function drag(ev) {
ev.dataTransfer.setData("Informacion", ev.target.id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function drag(ev)\n{\n ev.dataTransfer.setData(\"message\", ev.target.id);\n}",
"function dragInicio(ev) {\n ev.dataTransfer.setData(\"Text\", ev.target.id);\n}",
"drag(event) {\n event.dataTransfer.setData(\"divId\", event.target.id);\n console.log(\"----drag----:\");\n }",
"function drag (event... | [
"0.7279743",
"0.7160809",
"0.70878005",
"0.70050955",
"0.69658244",
"0.69637895",
"0.6928682",
"0.69212824",
"0.6917103",
"0.68803",
"0.68770295",
"0.687124",
"0.6871131",
"0.6853929",
"0.68068993",
"0.6798106",
"0.677846",
"0.67727715",
"0.675692",
"0.6748166",
"0.67340213",... | 0.7715458 | 0 |
Load the game, and create the board. | function loadGame(){
game = getJSON("http://navy.hulu.com/create?user=rhassan@andrew.cmu.edu");
board = [];
// Display game information
writeToConsole("GAME ID = " + game.game_id);
writeToConsole("SHIPS = [" + game.ship_sizes + "]");
writeToConsole("BOARD = (" + game.board_size.width + ", " + game.board_size.he... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function create_game_board(){\n update_number_of_players();\n create_player_areas();\n // create new game\n game_instance.deal_cards();\n \n render_cards();\n apply_card_event_handlers();\n \n game_instance.determine_winners();\n // determine_wi... | [
"0.7420864",
"0.72548664",
"0.7228805",
"0.7216703",
"0.715611",
"0.70957667",
"0.7085388",
"0.70358056",
"0.70005196",
"0.692128",
"0.691042",
"0.6856177",
"0.68503314",
"0.6834303",
"0.6823712",
"0.68206155",
"0.67755353",
"0.6763411",
"0.6713929",
"0.67020357",
"0.6700509"... | 0.7423521 | 0 |
Purpose: Starts searching through the grid. Starts by trying to find the largest ship by skipping to every nth blocks. | function startGame(){
var j = 5; // value by which to skip.
while (j>0){
var max = 0;
for(var m =0; m<ships.length; m++){
if (ships[m]>max){ max = ships[m];}
}
if (j>max){ j = max; }
writeToConsole(ships);
writeToConsole("Trying spacing by " + j);
for (var i=0; i<=j; i++){
for(var x=0; x< Math.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function exploreNeighbors(x,y){\n\tfunction labelEmpty(x,y){\n\t\tif (x>=0 && x<game.board_size.width && y>=0 && y<game.board_size.height){\n\t\t\tdocument.getElementById(y+'_'+x).setAttribute('class','avoid');\n\t\t\tboard[x][y] = null;\t\t// Indicate that cell should never be examined\n\t\t}\n\t}\n\tfunction pur... | [
"0.64079535",
"0.6218261",
"0.60234225",
"0.5909205",
"0.57952476",
"0.57545716",
"0.57543164",
"0.56899416",
"0.56549096",
"0.56442755",
"0.5643415",
"0.5632637",
"0.5629312",
"0.56184286",
"0.56154126",
"0.56080747",
"0.56049144",
"0.5600821",
"0.5574246",
"0.55595684",
"0.... | 0.624206 | 1 |
to get no of days in kgp | function no_of_days() {
var d = new Date(),
minutes = d.getMinutes().toString().length == 1 ? '0'+d.getMinutes() : d.getMinutes(),
hours = d.getHours().toString().length == 1 ? '0'+d.getHours() : d.getHours(),
ampm = d.getHo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"calculateDays() {\n const secondsInADay = 86400;\n let seconds = this.calculateSeconds();\n this.daysCount = seconds / secondsInADay;\n this.daysCount = Math.floor(this.daysCount);\n\n return this.daysCount;\n }",
"numberOfDays(){\n return ((this.endDate - this.startDate)/(1000*60*60*24));... | [
"0.67897034",
"0.65952903",
"0.6536408",
"0.6521484",
"0.61982596",
"0.61929715",
"0.6138811",
"0.60371274",
"0.59765095",
"0.59604055",
"0.59576684",
"0.5890101",
"0.58603126",
"0.58555025",
"0.58413243",
"0.58301485",
"0.58148503",
"0.5812444",
"0.58109355",
"0.5765538",
"0... | 0.6867405 | 0 |
This is a ConformanceMessaging resource | static get __resourceType() {
return 'ConformanceMessaging';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function messagingApi()\n{\n\n}",
"sendMessageService(boatId) { \n publish(this.messageContext, BoatMC, {recordId:boatId});\n }",
"get communication () {\n\t\treturn this._communication;\n\t}",
"get communication() {\n\t\treturn this.__communication;\n\t}",
"onWorkerMsg(msg){\n\n if (msg.replyTo!... | [
"0.61389846",
"0.55454636",
"0.5482138",
"0.54554975",
"0.54206866",
"0.5387298",
"0.53735256",
"0.53735256",
"0.53735256",
"0.53735256",
"0.53557914",
"0.53556335",
"0.5337448",
"0.53085494",
"0.53010654",
"0.53010654",
"0.52676386",
"0.52588576",
"0.5256887",
"0.5248511",
"... | 0.7466156 | 0 |
An endpoint (network accessible address) to which messages and/or replies are to be sent. | get endpoint() {
return this.__endpoint;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"get endpoint () {\n\t\treturn this._endpoint;\n\t}",
"address() {\n const address = this.server.address();\n const endpoint = typeof address !== \"string\"\n ? (address.address === \"::\" ? \"localhost\" : address.address) + \":\" + address.port\n : address;\n ... | [
"0.60655105",
"0.58461183",
"0.58366686",
"0.58366686",
"0.58366686",
"0.58349746",
"0.58349746",
"0.58349746",
"0.58349746",
"0.5667294",
"0.55351883",
"0.54919016",
"0.5422372",
"0.54212075",
"0.5405083",
"0.53320336",
"0.52002597",
"0.51635903",
"0.5131667",
"0.5127271",
"... | 0.6017733 | 1 |
this closes the document.ready function functions: this area is for functions======================= updateEnemyBars: this function will update the health and counter bars of the enemies | function updateEnemyBars (fighterClass, fighterHealthClass, fighterCounterClass) {
var healthPercent;
var counterPercent;
healthPercent = ((fighterClass.health * 100) / fighterClass.healthMax);
counterPercent = ((fighterClass.counter * 100) / fighterClass.counterMax);
console.log("enemy health percent: " + heal... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function worldUpdate() {\r\n\t$('#distance').html(prettify(Game.world.distance));\r\n\t$('#zone').html(Game.zone);\r\n\r\n\t//enemy\r\n\t$('#enemyHealth').html(prettify(Game.enemy.health));\r\n\r\n\tvar enemyHealthBar = document.getElementById(\"enemyHealthBar\");\r\n\tvar hp = (Game.enemy.health / Game.enemy.tota... | [
"0.65949917",
"0.64337116",
"0.63488334",
"0.633253",
"0.6284872",
"0.6261083",
"0.62480927",
"0.6132932",
"0.60952646",
"0.6084168",
"0.6084016",
"0.6065441",
"0.60620546",
"0.60593873",
"0.6047584",
"0.60468805",
"0.60406053",
"0.6039369",
"0.6026554",
"0.6007479",
"0.59880... | 0.702743 | 0 |
updateEnemyBars: ========================================= updatePlayerBars: this function updates the health and attack bars of the player | function updatePlayerBars (fighterClass, fighterHealthClass, fighterAttackClass) {
var healthPercent;
var attackPercent;
healthPercent = ((fighterClass.health * 100) / fighterClass.healthMax);
attackPercent = ((fighterClass.attack * 100) / fighterClass.attackMax);
console.log("player health percent: " + healthP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updateEnemyBars (fighterClass, fighterHealthClass, fighterCounterClass) {\n\tvar healthPercent;\n\tvar counterPercent;\n\n\thealthPercent = ((fighterClass.health * 100) / fighterClass.healthMax);\n\n\tcounterPercent = ((fighterClass.counter * 100) / fighterClass.counterMax);\n\n\tconsole.log(\"enemy healt... | [
"0.7557436",
"0.6387888",
"0.61090773",
"0.5945519",
"0.5880743",
"0.57560307",
"0.5620557",
"0.5547833",
"0.55426073",
"0.55151325",
"0.55141973",
"0.54880273",
"0.54811215",
"0.544954",
"0.54156166",
"0.5412472",
"0.54001355",
"0.53820807",
"0.53725255",
"0.5326626",
"0.530... | 0.66340005 | 1 |
fight: ================================================ duelMove: this function moves the clicked enemy into the duel zone | function duelMove (fighterClass) {
var duelistLocation;
attackTime = true;
document.querySelector(".message").innerHTML = "Click on Attack to fight. With each attack your character will get stronger."
//who villain: this section of code figures out who the chosen duelist is
if ($ (fighterClass).attr("id") ===... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function moveChar(){\n\t\t$(\".thumbnail\").on(\"click\", function(){\n\t\t\tvar parent = $(this).parent();\n\t\t\tvar selectedChar = $(this).attr(\"id\");\n\n\t\t\t//Moves the enemy character to the appropriate DIV, and adds the corresponding object to combatObj;\n\t\t\tif (lightSide && darkSide == undefined){\n\... | [
"0.62309426",
"0.6194085",
"0.61904204",
"0.61862403",
"0.615828",
"0.6148708",
"0.61429715",
"0.60981095",
"0.6059894",
"0.6038212",
"0.6012762",
"0.6006209",
"0.5988625",
"0.5966156",
"0.59660256",
"0.59634364",
"0.5920754",
"0.59007365",
"0.5900642",
"0.58951914",
"0.58929... | 0.73192215 | 0 |
Function to display laps | function lap() {
document.getElementById('lapText').innerHTML += `<p>${displayHours}:${displayMinutes}:${displaySeconds}:${displayMilliseconds}</p>`;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"displayLasers(){\n for(let i = 0; i < lasers.length; i++){\n let laser = lasers[i];\n laser.move();\n laser.display();\n laser.laserTouch();\n }\n }",
"show() {\n strokeWeight(2);\n fill(224, 65, 65);\n rect(this.x, this.y, this.w, this.h);\n\n // if the used job rectangle ... | [
"0.65363187",
"0.64915174",
"0.63877255",
"0.63381916",
"0.62199974",
"0.6102788",
"0.6068716",
"0.594185",
"0.5940676",
"0.5936964",
"0.58874375",
"0.5881841",
"0.58234876",
"0.5788378",
"0.5774092",
"0.57665384",
"0.57591915",
"0.57575434",
"0.5748277",
"0.5740207",
"0.5724... | 0.66444856 | 0 |
input: filePath of excel file callback(records) records is array of arrays | function read_excel_file(filePath, callback){
excelParser.parse({
inFile: filePath,
worksheet: 1,
skipEmpty: false,
},function(err, records){
if (err) console.error(err);
typeof callback === 'function' && callback(records);
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function handleExFile(e) {\n document.getElementById('excel').blur();\n\n\tNAME_LIST = [];\n\tvar files = e.target.files, f = files[0];\n console.log(excel.files[0].name.split('.').pop());\n\n\tif(!excelTypeCheck(excel.files[0])) {\n \treturn;\n \t}\n\n\tvar reader = new FileReader();\n\treader.onload = func... | [
"0.6457858",
"0.6455349",
"0.62296724",
"0.6148661",
"0.61139506",
"0.60943913",
"0.6035607",
"0.58760744",
"0.5739597",
"0.57332444",
"0.5687886",
"0.5684987",
"0.56793606",
"0.5673345",
"0.56569004",
"0.56158",
"0.55913126",
"0.5586192",
"0.556271",
"0.5533437",
"0.55055904... | 0.7073651 | 0 |
Try to map a node to all sides of this triangle that don't have a neighbor void MapTriangleToNodes(Triangle& t); | MapTriangleToNodes(t) {
if (this.front_ === null) {
throw new Error("this.front_ === null");
}
for (let i = 0; i < 3; i++) {
if (!t.GetNeighbor(i)) {
// Node* n = front_->LocatePoint(t.PointCW(*t.GetPoint(i)));
const n = this.front_.LocateP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function rotateTrianglePair(t, p, ot, op) {\n var n1, n2, n3, n4;\n n1 = t.neighborCCW(p);\n n2 = t.neighborCW(p);\n n3 = ot.neighborCCW(op);\n n4 = ot.neighborCW(op);\n\n var ce1, ce2, ce3, ce4;\n ce1 = t.getConstrainedEdgeCCW(p);\n ce2 = t.getConstrainedEdg... | [
"0.57377946",
"0.57224864",
"0.54936296",
"0.54827476",
"0.54695934",
"0.5370923",
"0.5347439",
"0.5266831",
"0.5174743",
"0.5151248",
"0.50833434",
"0.50790626",
"0.50676394",
"0.50285983",
"0.4911989",
"0.4893868",
"0.48369232",
"0.4821082",
"0.4805183",
"0.47834313",
"0.47... | 0.82703316 | 0 |
Point GetPoint(const int& index); | GetPoint(index) {
return this.points_.at(index);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function computeInOffsetByIndex(x, y, index) {\n var outx = x + 15;\n var outy = y + 47 + index * 20;\n\n return { x: outx, y: outy };\n}",
"function pointAt(index) {\n var y = Math.floor(index/w) * 1.5;\n var x = ((index + y/3) % w) * rt3;\n return {x: x, y:... | [
"0.7117669",
"0.7050225",
"0.6788835",
"0.6652022",
"0.6570453",
"0.6551717",
"0.64776117",
"0.644447",
"0.64352006",
"0.6357566",
"0.63529104",
"0.6349525",
"0.62419534",
"0.6203459",
"0.6184747",
"0.6174074",
"0.6151645",
"0.6124953",
"0.6121487",
"0.6117371",
"0.6091552",
... | 0.76091355 | 0 |
for rounding to decimal places | function roundit(num,dex) {
return parseFloat(num).toFixed(dex);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function roundToDecimalPlace(value, decimal) {\r\n var factor = Math.pow(10, decimal);\r\n roundedValue = ((Math.round(value * factor))/factor).toFixed(decimal);\r\n return roundedValue;\r\n}",
"function RoundDecimals(float) {\n var roundedFloat = Math.round(float * 10) / 10;\n return roundedFloat;\n ... | [
"0.711695",
"0.7111932",
"0.7093263",
"0.69894254",
"0.6966892",
"0.69576955",
"0.6957056",
"0.69513786",
"0.69166195",
"0.68901163",
"0.68674254",
"0.68340963",
"0.6805976",
"0.67917323",
"0.6777266",
"0.67765355",
"0.67475647",
"0.6742682",
"0.67203707",
"0.67139536",
"0.66... | 0.7337368 | 0 |
Grab float data from distances.txt | async function grabAllData(){
let dataArr=[];
let data = await fetchAndDecodeFloatData("https://geoweb.princeton.edu/people/sk8609/DEVearthscopeoceans/data/FloatInfo/distances.txt", 'text');
tempArr = data.split('\n');
for(let i=0; i<tempArr.length;i++){
let splitArr = tempAr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function grabIndData(Float){\n let dataArr=[];\n let data = await fetchAndDecodeFloatData(`https://geoweb.princeton.edu/people/sk8609/DEVearthscopeoceans/data/FloatInfo/${Float}.txt`, 'text');\n tempArr = data.split('\\n');\n for(let i=0; i<tempArr.length;i++){\n let sp... | [
"0.6266799",
"0.58963054",
"0.55773324",
"0.5534366",
"0.5458368",
"0.5421081",
"0.5285426",
"0.52673453",
"0.5235717",
"0.52149403",
"0.5201872",
"0.51820207",
"0.5136303",
"0.5061028",
"0.5058574",
"0.5051513",
"0.50466347",
"0.50391406",
"0.5024825",
"0.496351",
"0.4958854... | 0.6627487 | 0 |
youtube thumbnail (base) quality = empty or : 0, 1, 2, 3, low0, low1, low2, low3, medium0, medium1, medium2, medium3, high0, high1, high2, high3, max0, max1, max2, max3 | function get_youtube_thumbnail(url, quality) {
if (url) {
var video_id, thumbnail, result;
result = url.match(
/(?:youtu\.be\/|youtube\.com(?:\/embed\/|\/v\/|\/watch\?v=|\/user\/\S+|\/ytscreeningroom\?v=))([\w\-]{10,12})\b/
);
video_id = result[1];
if (video_id) {
let quality_key = ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"set quality(value) {}",
"get quality() {}",
"function getQuality(quality)\n{\n\tquality=decodeURIComponent(quality);\n\tif(quality.toLowerCase()==\"small\")\n\t\treturn \"240p\";\n\tif(quality.toLowerCase()==\"medium\")\n\t\treturn \"360p\";\n\tif(quality.toLowerCase()==\"large\")\n\t\treturn \"480p\";\n\tif(q... | [
"0.6840879",
"0.6385369",
"0.6355864",
"0.629729",
"0.61170053",
"0.59873223",
"0.5962237",
"0.5956563",
"0.5861067",
"0.5855809",
"0.5819462",
"0.5806379",
"0.5793285",
"0.5788339",
"0.573508",
"0.573508",
"0.573508",
"0.573508",
"0.5729142",
"0.5709786",
"0.5707149",
"0.5... | 0.69274455 | 0 |
This function is called when the "Add selected items to cart" button in clicked The purpose is to build the HTML to be displayed (a Paragraph) We build a paragraph to contain the list of selected items, and the total price | function selectedItems(){
var ele = document.getElementsByName("product");
var chosenProducts = [];
var c = document.getElementById('displayCart');
c.innerHTML = "";
// build list of selected item
var para = document.createElement("P");
para.innerHTML = "You selected : ";
para.appendChild(document.createE... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function selectedItems() {\n\n\tvar c = document.getElementById('displayCart')\n\tc.innerHTML = ''\n\n\n\t// build list of selected item\n\tvar para = document.createElement('P')\n\tpara.innerHTML = 'You selected : '\n\tpara.appendChild(document.createElement('br'))\n\tfor (i = 0; i < cart.length; i++) {\n\t\tpara... | [
"0.7670149",
"0.7193816",
"0.7171806",
"0.70372707",
"0.6934285",
"0.68798023",
"0.6806421",
"0.67738956",
"0.67636615",
"0.66968435",
"0.6645513",
"0.6634592",
"0.6633475",
"0.66128176",
"0.6612306",
"0.66095614",
"0.66038877",
"0.65893686",
"0.6585778",
"0.65762156",
"0.657... | 0.7303101 | 1 |
The method to get covers from Google book API based on ISBN and title of the books | async getCover(isbn, title) {
try {
let response = await axios.get(
'https://www.googleapis.com/books/v1/volumes?q=title=' +encodeURIComponent(title) +isbn + "&key=AIzaSyClcFkzl_nDwrnCcwAruIz99WInWc0oRg8"
);
return response.data.items[0].volumeInfo.imageLinks.sm... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static fetchBooksFromGoogle(searchInput){ //searchInput from Content.js\n return fetch(`https://www.googleapis.com/books/v1/volumes?q=${searchInput}`)\n .then(response => response.json())\n .then(json => {\n return json.items.map(item => this.createBook(item)) //returns an array of objects created fr... | [
"0.67026985",
"0.6645842",
"0.6580502",
"0.6496905",
"0.64402133",
"0.63113433",
"0.62750965",
"0.6272987",
"0.62532353",
"0.620866",
"0.6171927",
"0.61680335",
"0.6154817",
"0.60867167",
"0.60772777",
"0.6073042",
"0.60596097",
"0.6036178",
"0.60256964",
"0.5970491",
"0.5926... | 0.73480374 | 0 |
Replies back to the user with information about where the attachment is stored on the bot's server, and what the name of the saved file is. | async function replyForReceivedAttachments(localAttachmentData) {
if (localAttachmentData) {
// Because the TurnContext was bound to this function, the bot can call
// `TurnContext.sendActivity` via `this.sendActivity`;
await this.sendActivity(`Attachment "${ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"handleAttachmentMessage() {\n let response;\n\n // Get the attachment\n let attachment = this.webhookEvent.message.attachments[0];\n //console.log(\"Received attachment:\", `${attachment} for ${this.user.psid}`);\n\n response = Response.genQuickReply(i18n.__(\"fallback.attachment\"), [\n {\n ... | [
"0.6406462",
"0.6172073",
"0.6062147",
"0.6062147",
"0.6020556",
"0.5929268",
"0.5841937",
"0.5737819",
"0.5737073",
"0.5737073",
"0.5734843",
"0.56917673",
"0.56610465",
"0.5645517",
"0.5584695",
"0.5542011",
"0.55292356",
"0.54726654",
"0.54699534",
"0.5462597",
"0.5378199"... | 0.64615303 | 0 |
Returns an inline attachment. | getInlineAttachment() {
const imageData = fs.readFileSync(path.join(__dirname, '../resources/architecture-resize.png'));
const base64Image = Buffer.from(imageData).toString('base64');
return {
name: 'architecture-resize.png',
contentType: 'image/png',
content... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInlineImg(message){\n var attachments = message.getAttachments({\n includeInlineImages: true,\n includeAttachments: false\n });\n \n return attachments;\n}",
"get inlineContent() {\n return this.type.inlineContent;\n }",
"get attachment () {\n\t\treturn this._attachment;\n\t}",
"get... | [
"0.6851515",
"0.6266762",
"0.6195806",
"0.6073926",
"0.603093",
"0.6015178",
"0.6015178",
"0.58593965",
"0.5832146",
"0.5763233",
"0.5739862",
"0.5718545",
"0.5606278",
"0.55855846",
"0.5533645",
"0.5493206",
"0.5454444",
"0.5404289",
"0.5361439",
"0.53519976",
"0.5322941",
... | 0.71616316 | 0 |
Returns an attachment to be sent to the user from a HTTPS URL. | getInternetAttachment() {
// NOTE: The contentUrl must be HTTPS.
return {
name: 'architecture-resize.png',
contentType: 'image/png',
contentUrl: 'https://docs.microsoft.com/en-us/bot-framework/media/how-it-works/architecture-resize.png'
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getFileURLSigned(url) {\n const path = await this.getPathFromUrl(url);\n const result = await this.doRequest({\n path,\n method: \"GET\",\n params: {\n noRedirect: true,\n },\n });\n return result;\n }",
"function get... | [
"0.5525053",
"0.5393399",
"0.52978003",
"0.52469337",
"0.5226839",
"0.5204368",
"0.5202747",
"0.5202747",
"0.5176209",
"0.51752496",
"0.51749665",
"0.5170118",
"0.5170118",
"0.5165892",
"0.51444054",
"0.5136136",
"0.51212376",
"0.51186424",
"0.50992525",
"0.5085678",
"0.50807... | 0.59386057 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.