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 |
|---|---|---|---|---|---|---|
submits user draft to database | function saveDraftHandler(user) {
const newDraftInput = document.getElementById('post-container');
console.log(newDraftInput.value + "<--- there should be the text");
let currentPrompt = '';
get('/api/getprompt', {}, function(prompt){
currentPrompt = prompt.prompt;
console.log(currentPrompt); //test dr... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function saveDraft() \n{\n RMPApplication.debug(\"begin saveDraft\");\n c_debug(debug.process_btn, \"=> saveDraft\");\n\n\tid_state.setValue(\"draft\");\n\t// validate data before continuing the process or saving the form\n\tdataValidation();\n\n\tRMPApplication.debug(\"end saveDraft\");\n\t\n\treturn true;\... | [
"0.6943147",
"0.6780334",
"0.6769008",
"0.66015387",
"0.65385234",
"0.6353032",
"0.62701845",
"0.62120676",
"0.6054937",
"0.59261477",
"0.5913936",
"0.58819735",
"0.58649564",
"0.5833792",
"0.5807987",
"0.5798857",
"0.5781125",
"0.57449335",
"0.56889206",
"0.5634245",
"0.5616... | 0.67855954 | 1 |
appends prompt text to HTML and updates automatically using socket.io when prompt object changes | function renderPrompt(prompt) {
const promptDiv = document.getElementById("prompt-container");
promptDiv.innerHTML = prompt.prompt;
console.log("reached initial prompt generate")
const socket = io();
socket.on('prompt', function(prompt){
const promptDiv = document.getElementById("prompt-con... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function updatePromptDisplay(){\nvar line = promptText;\nvar html = '';\nif (column > 0 && line == ''){\n// When we have an empty line just display a cursor.\nhtml = cursor;\n} else if (column == promptText.length){\n// We're at the end of the line, so we need to display\n// the text *and* cursor.\nhtml = htmlEnco... | [
"0.6504616",
"0.64514756",
"0.6415323",
"0.6315275",
"0.63098377",
"0.6282737",
"0.6270027",
"0.6270027",
"0.61932814",
"0.6094802",
"0.6074891",
"0.6074685",
"0.6052162",
"0.5995637",
"0.5988863",
"0.59456074",
"0.59316874",
"0.59223473",
"0.59139687",
"0.5875537",
"0.587207... | 0.7920272 | 0 |
computer picks a number (14) adds it to the computerPattern array | function computerPicks(){
const num = Math.floor(Math.random() * 4 )
computerPattern.push(num)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function compPatFun() { \n \n if(playerTurn===true){ \n return;\n }\n playerInput = [];//Clear player input from earlier pattern matches\n //Select new color for the computer color sequence and add to the array\n var number = Math.floor(Math.random() * 4); \n var newColor = ... | [
"0.6949741",
"0.67203885",
"0.6509401",
"0.6471171",
"0.6451138",
"0.6323655",
"0.6317589",
"0.6227897",
"0.6180385",
"0.6164247",
"0.61577976",
"0.6150845",
"0.6140357",
"0.6097991",
"0.60857517",
"0.6077071",
"0.60721344",
"0.6068269",
"0.60066724",
"0.5992121",
"0.59873295... | 0.81832445 | 0 |
Check for config in `renovate.json` | function checkForRenovateJson(config) {
return github.getFileJson('renovate.json')
.then((contents) => {
if (!contents) {
logger.debug('No renovate.json found');
return config;
}
logger.debug(`renovate.json config: ${stringify(contents)}`);
return Object.assign(config, contents);
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function checkRenovateConfig() {\n const {status, stdout} = getOutput(\n 'node_modules/renovate/dist/config-validator.js'\n );\n const [configFile] = stdout.match(/(?<=Validating )\\S+/);\n\n if (status === 0) {\n // Handle valid configuration.\n log(green('SUCCESS:'), 'No errors in', cyan(confi... | [
"0.7119652",
"0.6491762",
"0.59924084",
"0.5976398",
"0.5976398",
"0.5920694",
"0.5903443",
"0.5895781",
"0.589306",
"0.58723384",
"0.58706605",
"0.5865239",
"0.5833236",
"0.5719419",
"0.56948346",
"0.5690972",
"0.5690767",
"0.5660124",
"0.5638261",
"0.56278145",
"0.5624878",... | 0.74278396 | 0 |
Ensure config contains packageFiles | function ensurePackageFiles(config) {
// Check for manually configured package files
if (config.packageFiles.length) {
return Promise.resolve(config);
}
// Otherwise, autodiscover filenames
return github.findFilePaths('package.json')
.then((fileNames) => {
const packageFiles =
fileNames.map(fi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function seedConfigFiles() {\n // This is v2 of the devcert certificate authority setup\n fs_1.writeFileSync(constants_1.caVersionFile, '2');\n // OpenSSL CA files\n fs_1.writeFileSync(constants_1.opensslDatabaseFilePath, '');\n fs_1.writeFileSync(constants_1.opensslSerialFilePath, '01');\n}",
"_e... | [
"0.57703507",
"0.57488006",
"0.5674168",
"0.56323594",
"0.5627896",
"0.55633307",
"0.5563083",
"0.5543278",
"0.55178267",
"0.5500139",
"0.5492521",
"0.54854596",
"0.546805",
"0.5406366",
"0.53811586",
"0.5377614",
"0.5360789",
"0.5354067",
"0.5339209",
"0.53358907",
"0.533549... | 0.7888719 | 0 |
Return a promise queue of package file workers | function getWorkers(config) {
return config.packageFiles.reduce((promise, packageFile) => {
const cascadedConfig = configParser.getCascadedConfig(config, packageFile);
return promise.then(() => worker(config.repository, packageFile.fileName, cascadedConfig));
}, Promise.resolve());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"loadQueue() {\r\n return Promise.all(this.list.map(cur => this.load(cur.uri, cur.type, cur.alias))).then((data) => {\r\n this.freeQueue();\r\n return data;\r\n });\r\n }",
"wait() {\n return Promise.allSettled(this._queue.map(q => q.deferred.promise));\n }",
"function... | [
"0.64666647",
"0.6326573",
"0.62645286",
"0.62645286",
"0.61652094",
"0.61192673",
"0.60771936",
"0.60100836",
"0.5989326",
"0.5951689",
"0.58398426",
"0.58133465",
"0.57769454",
"0.57601887",
"0.5758561",
"0.5690189",
"0.5679789",
"0.56560206",
"0.563929",
"0.56279707",
"0.5... | 0.6653963 | 0 |
Return graph inputs as a String[] | function uiGraphGetInputs(/*UIGraphStructure*/ graph){
var inLength = graph.inputsLength();
var inputs = [];
for( var i=0; i<inLength; i++ ){
inputs.push(graph.inputs(i));
}
return inputs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getInputsVerilogString(){\n inputsVerilogString = 'input ';\n for(var i = 0; i < inputNodes.length; i += 1){\n inputsVerilogString = inputsVerilogString + core.getRelid(inputNodes[i]) + ', ';\n }\n }",
"function uiGraphGetOutputs(/*UIGraphStructure*... | [
"0.6688867",
"0.61373645",
"0.60456634",
"0.59874356",
"0.5638152",
"0.5603537",
"0.5492587",
"0.5468308",
"0.5460181",
"0.5433804",
"0.53662056",
"0.53084284",
"0.52845037",
"0.52814305",
"0.5182069",
"0.51556504",
"0.5152729",
"0.5147589",
"0.5105348",
"0.5098104",
"0.50892... | 0.7043533 | 0 |
Return graph outputs as a String[] | function uiGraphGetOutputs(/*UIGraphStructure*/ graph){
var inLength = graph.outputsLength();
var outputs = [];
for( var i=0; i<inLength; i++ ){
outputs.push(graph.outputs(i));
}
return outputs;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getOutputsVerilogString(){\n outputsVerilogString = 'output ';\n for(var i = 0; i < outputNodes.length; i += 1){\n outputsVerilogString = outputsVerilogString + core.getRelid(outputNodes[i]) + ', ';\n }\n }",
"getOutput()\n {\n var res=[];... | [
"0.6580241",
"0.6310223",
"0.585414",
"0.58023113",
"0.5732282",
"0.5706851",
"0.5687117",
"0.56607807",
"0.5626034",
"0.5620383",
"0.55653393",
"0.55211055",
"0.5513906",
"0.5510252",
"0.54766643",
"0.54766643",
"0.5462789",
"0.54512256",
"0.5443787",
"0.54399794",
"0.541984... | 0.7276653 | 0 |
Return graph variables as nd4j.graph.UIVariable[] | function uiGraphGetVariables(/*UIGraphStructure*/ graph){
var varsLength = graph.variablesLength();
var vars = [];
for( var i=0; i<varsLength; i++ ){
vars.push(graph.variables(i));
}
return vars;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uiGraphGetVariableNames(/*UIGraphStructure*/ graph){\n var varsLength = graph.variablesLength();\n var vars = [];\n for( var i=0; i<varsLength; i++ ){\n vars.push(graph.variables(i).name());\n }\n return vars;\n}",
"get variables() {\n\t\t\treturn present.variables;\n\t\t}",
"fun... | [
"0.75142103",
"0.59409255",
"0.5894805",
"0.5817143",
"0.56682837",
"0.56678504",
"0.5636089",
"0.5591687",
"0.55171114",
"0.55115074",
"0.55031174",
"0.54608625",
"0.5457379",
"0.54065806",
"0.5384924",
"0.53823084",
"0.5344962",
"0.53394294",
"0.53394294",
"0.5305802",
"0.5... | 0.8012545 | 0 |
Return graph variables as String[] | function uiGraphGetVariableNames(/*UIGraphStructure*/ graph){
var varsLength = graph.variablesLength();
var vars = [];
for( var i=0; i<varsLength; i++ ){
vars.push(graph.variables(i).name());
}
return vars;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function uiGraphGetVariables(/*UIGraphStructure*/ graph){\n var varsLength = graph.variablesLength();\n var vars = [];\n for( var i=0; i<varsLength; i++ ){\n vars.push(graph.variables(i));\n }\n return vars;\n}",
"function getVariableDimensionsNameList()\n{\n\tvar variableDimensionNameListS... | [
"0.75219786",
"0.65336186",
"0.6274672",
"0.5840878",
"0.57918674",
"0.57769233",
"0.5756788",
"0.57457656",
"0.57457656",
"0.57430834",
"0.5718523",
"0.56860185",
"0.5644136",
"0.5619309",
"0.55682075",
"0.5567887",
"0.5566846",
"0.5552497",
"0.5544104",
"0.55406046",
"0.553... | 0.7652271 | 0 |
Set the width of the side navigation to 25% and the left margin of the page content to 25% | function openNav() {
document.getElementById("mySidenav").style.width = "25%";
document.getElementById("main").style.marginLeft = "25%";
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getWidth() {\nconst ulWidth = $('#ps__nav ul').width();\n const margin = -1*(ulWidth / 2);\n $('#ps__nav ul').css('margin-left', `${margin}px`)\n}",
"function openNav() {\n $(\"#mySidenav\").width(\"250px\");\n $(\"#content\").css(\"margin-left\",\"250px\");\n}",
"function openNav() {\n // do... | [
"0.6387724",
"0.63614833",
"0.63501704",
"0.63499975",
"0.6300249",
"0.62494195",
"0.6222024",
"0.6215011",
"0.61406076",
"0.60635626",
"0.60267466",
"0.6008992",
"0.59974825",
"0.59903884",
"0.59899855",
"0.5970942",
"0.5970486",
"0.5957927",
"0.5956421",
"0.59189665",
"0.59... | 0.6386725 | 1 |
Fetching Widget JSON for the plugin | fetchWidgets(action) {
let {name, version, scope} = action.defaultArtifact;
let artifact = {
name,
version,
scope,
key: 'widgets.' + action.name + '-' + action.type
};
return this.HydratorPlusPlusPluginConfigFactory
.fetchWidgetJson(artifact.name, artifact.version, artifact... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async download_widget(wname){\n var source = await xhr_query(\"widgets/\"+wname+\".html\");\n this.widgets[wname] = { source : source};\n return this.widgets[wname];\n }",
"function get_widget_data() {\n\t\tvar type = $('#pt-widget-type').val();\n\t\t$('#pt-widget-results'... | [
"0.6178988",
"0.6010507",
"0.5949965",
"0.58958775",
"0.5852464",
"0.57908285",
"0.5784374",
"0.5770622",
"0.57027906",
"0.56762075",
"0.5652161",
"0.5620465",
"0.5581369",
"0.5557467",
"0.554127",
"0.55409265",
"0.55340344",
"0.55073804",
"0.5497069",
"0.54366904",
"0.541275... | 0.7285506 | 0 |
draw the donut one wedge at a time | function drawDonut(ctx){
for(var i=0;i<data1.length;i++){
drawWedge2(data1[i],colors[i], ctx);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"wink() {\n let x = Board.getTileCenter(DemoData.chase.enerX),\n y = Board.getTileCenter(DemoData.chase.enerY);\n \n this.calcRadius();\n this.clearEnergizer(x, y);\n this.drawEnergizer(x, y, this.radius);\n }",
"function drawNet(){\n ctx.fillStyle = 'white';\n ... | [
"0.647247",
"0.63681024",
"0.6302816",
"0.6276233",
"0.6265241",
"0.6233044",
"0.6223736",
"0.62182176",
"0.6172607",
"0.6171068",
"0.61473924",
"0.6139231",
"0.61312777",
"0.61185455",
"0.61114264",
"0.6100711",
"0.608961",
"0.60864836",
"0.6086169",
"0.6078006",
"0.607092",... | 0.7704347 | 0 |
Resize a '.resizable' element | resizable()
{
interact('.resize').resizable({
// resize from all edges and corners
edges: { left: false, right: true, bottom: true, top: false },
listeners: {
move (event) {
//HEIGHT SIZE MOVE
var target = event.t... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize() {\n //TODO needed?\n}",
"function makeResizableDiv(div) {\n const element = document.querySelector(div);\n const resizers = document.querySelectorAll(div + ' .resizer');\n const minimum_size = 20;\n let original_width = 0,original_height = 0,original... | [
"0.7127907",
"0.69975245",
"0.68306154",
"0.67976695",
"0.6769056",
"0.65796846",
"0.65559804",
"0.63844585",
"0.637088",
"0.6369222",
"0.6364013",
"0.63499284",
"0.6330182",
"0.6328708",
"0.6283103",
"0.6281599",
"0.6257401",
"0.6227766",
"0.6209686",
"0.620052",
"0.61818194... | 0.79843223 | 0 |
Checks if product has some variants and opens the modal | function productHasVariant(product)
{
swal({
title: "Informazione!",
text: "Questo prodotto ha delle varianti! Verrai ora reindirizzato alla pagina del dettaglio.",
showCancelButton: true,
cancelButtonText: "Annulla!",
},
function (isConfirm) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isVariantAvailable(variant) {\n if(!variant) return false;\n return variant.available && !variant.product.isHidden;\n }",
"verifyVariantPage() {\n $(document).ready(function () {\n if (window.location.href.indexOf(\"variant\") > -1) {\n $('#add-to-cart-button').removeClass... | [
"0.6629612",
"0.6392683",
"0.6303009",
"0.6279436",
"0.62632585",
"0.6261308",
"0.617472",
"0.6095064",
"0.60559756",
"0.6036727",
"0.5988434",
"0.58969116",
"0.58541113",
"0.58392733",
"0.5831648",
"0.58010733",
"0.57835954",
"0.5776149",
"0.57244164",
"0.57145077",
"0.56837... | 0.7820234 | 0 |
FUNZIONE PER RISALIRE AL GIUSTO VARIANT ID | function findVariantId(selected) {
var arrayFinale = $scope.actualProduct.variants
for (var key in selected) {
var chiave = key
var valore = selected[chiave]
var goodIndexs = []
for (var i = 0; i < arrayFinale.length; i++) {
if (arrayFinale[i][chiave] == valore ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function id(value){\n\t\treturn value\n\t}",
"get id() {\n return this[symbol_1.kID].valueOf();\n }",
"get value() {\n return this.id.substring(1, this.id.lastIndexOf('\"'));\n }",
"get value() {\n return this.id.substring(1, this.id.lastIndexOf('\"'));\n }",
"function id() {\... | [
"0.5986824",
"0.5967268",
"0.592979",
"0.58768994",
"0.58387977",
"0.5823633",
"0.5787078",
"0.5784692",
"0.57727796",
"0.57680696",
"0.5731463",
"0.5694057",
"0.5694057",
"0.5694057",
"0.5659125",
"0.5659125",
"0.5659125",
"0.5628105",
"0.5616579",
"0.561591",
"0.561591",
... | 0.62104803 | 0 |
Returns a string representation of a TvShowStatus | function tvShowStatusToString(tv_show_status)
{
switch (tv_show_status)
{
case TvShowStatus.Unknown: return "Unknown";
case TvShowStatus.SeriesEnded: return "Series Ended";
case TvShowStatus.Normal: return "Normal";
}
return null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function toString(name, id, status, value) {\n var s = '[object ' + name + ' ' + id + '] ' + status;\n if(value !== pending) s += ': ' + value;\n return s;\n }",
"function toString(name, id, status, value) {\n\t\tvar s = '[object ' + name + ' ' + id + '] ' + status;\n\n\t\tif(value !== pe... | [
"0.5966673",
"0.59434795",
"0.57782453",
"0.55916846",
"0.55412626",
"0.5512309",
"0.5488193",
"0.5483463",
"0.5475719",
"0.5475719",
"0.5475719",
"0.5475719",
"0.5475719",
"0.54703045",
"0.54675907",
"0.5467466",
"0.54581076",
"0.5454243",
"0.5450103",
"0.542635",
"0.5401633... | 0.8078153 | 0 |
Helper method to render buttons to edit and delete the video | renderButtons() {
// If the user is authorized to edit the video
if (this.state.canModify) {
return (
<div className="buttons right marg-bot-1">
<Link
className="btn btn-primary btn-sm"
to={`/videos/${this.state._id}/edit`}
>
Edit
<... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderButtons() {\n // Deletes the movies prior to adding new movies\n $(\".buttons-view\").empty();\n // Loops through the array of topics to create buttons for all topics\n for (var i = 0; i < topics.length; i++) {\n var createButtons = $(\"<button>\");\n ... | [
"0.6416825",
"0.6249324",
"0.6236669",
"0.62134373",
"0.62091947",
"0.6208933",
"0.62048256",
"0.6185598",
"0.616864",
"0.6146045",
"0.6137365",
"0.6131137",
"0.6092922",
"0.60872525",
"0.6077729",
"0.6051326",
"0.6047292",
"0.6031611",
"0.6017754",
"0.601326",
"0.60087705",
... | 0.69402254 | 0 |
whenever the comment is converted to JSON, remove the '__v' property | transform(doc, json) {
delete json.__v
return json
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stripComments(jsonData) {\n\t\tjsonData = jsonData.replace(/\\/\\*.*?\\*\\//g, \"\");\n\t\tjsonData = jsonData.replace(/\\/\\/.*/g, \"\");\n\t\treturn jsonData;\n\t}",
"function stripComments(jsonData) {\n\t\tjsonData = jsonData.replace(/\\/\\*.*?\\*\\//g, \"\");\n\t\tjsonData = jsonData.replace(/\\/\\/... | [
"0.62051237",
"0.62051237",
"0.62051237",
"0.62051237",
"0.6167343",
"0.59266144",
"0.5720919",
"0.55651414",
"0.55018014",
"0.5488378",
"0.54692763",
"0.5400941",
"0.5399281",
"0.5375497",
"0.5369432",
"0.5369432",
"0.5350854",
"0.53434837",
"0.5336968",
"0.5276133",
"0.5272... | 0.63995194 | 0 |
Toggles the aside filters, open and closes | function toggleAsideFilters() {
const closedValue = getComputedStyle(document.documentElement).getPropertyValue('--filter-width');
const openValue = '240px';
// Toggle the class first
newsFilters.classList.toggle('active');
// Check if the filters aside should be open or closed
const aside... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function filterenOp(){\n openFilter.classList.toggle(\"open\");\n filteren.classList.toggle(\"dicht\");\n}",
"function toggleAside(){\n\tvar $container = $('.aside');\n\tif(!$container.length){ return; }\n\tnew MainNavigation({\n\t\tnavContainer: '.aside',\n\t\tbtnMenu: '.aside-opener-js',\n\t\tanimationSpeed:... | [
"0.6858027",
"0.6710759",
"0.6690967",
"0.6646245",
"0.664394",
"0.664394",
"0.6643779",
"0.66090626",
"0.6550579",
"0.653792",
"0.65108794",
"0.64924276",
"0.6478779",
"0.6469464",
"0.64540154",
"0.6450044",
"0.644297",
"0.6442238",
"0.64220166",
"0.6412494",
"0.63953894",
... | 0.76739293 | 0 |
operate target directory and return the action that represent what have been done | async operateTargetDir(overwrite) {
const { targetDir } = this
const dirExists = await fs.pathExists(targetDir)
if (!dirExists) {
return null
}
const operator = new DirectoryOperator(this)
const dirAction = overwrite
? constant.dirAction.OVERWRITE
: await this.getDirectoryActi... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function cdExec(args, context) {\n\t\tvar targetDirName = args.directory;\n\t\tif (typeof(targetDirName) !== \"string\") { //$NON-NLS-0$\n\t\t\ttargetDirName = targetDirName.Name;\n\t\t}\n\t\tvar result = context.createPromise();\n\t\tmCurrentDirectory.withCurrentTreeNode(\n\t\t\tfunction(node) {\n\t\t\t\tif (targ... | [
"0.5783111",
"0.5604025",
"0.5422198",
"0.5254532",
"0.5217228",
"0.5213427",
"0.51318914",
"0.5065616",
"0.49969485",
"0.49912336",
"0.4976429",
"0.49730662",
"0.49696943",
"0.49618232",
"0.49460047",
"0.4928991",
"0.49275312",
"0.49260035",
"0.49223608",
"0.49002832",
"0.48... | 0.6957811 | 0 |
An old workaround to disable IE default menu actions, because ExtJs stopEvent does not do so in IE TODO: any better way? | function _disableIEMenuShortcut() {
if (Ext.isIE) {
var ch = 'abcdefghijklmnopqrstuvwxyz01234567890'.split('');
var str = '';
for (var i = 0; i < ch.length; i++) {
str += '<span style="position:absolute">' +
'<a accessKey="' + ch[i] +'" onBeforeActivate="this.last = document... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function preventMouseEvent(event) {\n\tif(BrowserDetect.browser == \"Explorer\"){\n\t\tevent.returnValue = false;\n\t} else {\n\t\tevent.preventDefault();\n\t}\n}",
"function stopDefault(e)\n{\t\n\tdispConsoleOutput(\"DVR-99-00-00.js\",arguments.callee.name,\"IN\");\n\tif(e && e.preventDefault){\n\t\te.preventDe... | [
"0.64240265",
"0.63742995",
"0.6372529",
"0.6372529",
"0.6351734",
"0.6351734",
"0.6351734",
"0.6351734",
"0.6351734",
"0.6351734",
"0.63139033",
"0.62749654",
"0.62535435",
"0.6235007",
"0.61724526",
"0.61544156",
"0.6090026",
"0.6067132",
"0.60376006",
"0.5986083",
"0.59825... | 0.6866145 | 0 |
When all of the images have been returned then pass them to the buildFeed function | function sbiImagesReady(getType){
var paginationArr = [],
returnedImagesArr = [];
//Loop through the array of returned sets of data from the Instagram API
jQuery.each( returnedImag... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fetchImages() {\n $('img').each(function () {\n addImage({\n url: getAbsUrl($(this).attr('src')),\n info: $(this).attr('alt')\n });\n });\n}",
"function getMoreImages2(callback) {\n // grab the XML from The Cat API\n $.ajax({\n url: 'https://thecatapi.com/api/images/get',\... | [
"0.73281336",
"0.69610596",
"0.6850776",
"0.6848358",
"0.6715014",
"0.66875243",
"0.6680003",
"0.6675183",
"0.6635846",
"0.6616924",
"0.6596383",
"0.6593652",
"0.65895855",
"0.6563383",
"0.6552115",
"0.6537876",
"0.653718",
"0.6517748",
"0.64714205",
"0.6434548",
"0.6413467",... | 0.69904286 | 1 |
Create the division select => (Empty if not loaded) | getSections() {
if (this.props.admin.divisions.length !== 0)
return (
<AvField type='select' name="divisions" label="Bachelier : " helpMessage="Le bachelier auquel le cours est relié"
errorMessage="Veuillez choisir une section" required>{}
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function loadSelectionFields() {\n var orgSelections = \"<option value='null'> Select Organization </option>\";\n var countrySelections = \"<option value='null'> Select Country </option>\";\n var yearSelections = \"<option value='null'> Select Year </option>\";\n\n recor... | [
"0.65581495",
"0.5994948",
"0.59777933",
"0.5924309",
"0.591782",
"0.58061147",
"0.58023906",
"0.577524",
"0.5769547",
"0.5712682",
"0.5691374",
"0.56744486",
"0.56544125",
"0.5650731",
"0.56487626",
"0.56485355",
"0.56450963",
"0.56437486",
"0.5636101",
"0.5614001",
"0.56124... | 0.63616186 | 1 |
If F,G are inverse functions and x==y, this should return cnMatch | function match(x, y, F, G)
{
switch (x)
{
case F(G(y)):
return cnMatch;
default:
return cnNoMatch;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function match(x, y, F, G)\n{\n switch (x)\n {\n case F(G(y)):\n return cnMatch;\n\n default:\n return cnNoMatch;\n }\n}",
"function match(x, y){\n\n if (x === y) {\n return true;\n\n }\n else {\n\n return false;\n\n }\n }",
"function cequal(x, y) {\n return (x... | [
"0.71346986",
"0.6126184",
"0.5946859",
"0.5931163",
"0.5920825",
"0.5891267",
"0.57891655",
"0.5773977",
"0.5673141",
"0.56206167",
"0.56093603",
"0.5591996",
"0.55705357",
"0.5545434",
"0.5530822",
"0.546399",
"0.54508924",
"0.544313",
"0.5413294",
"0.53834796",
"0.5355583"... | 0.7184569 | 0 |
Converts continuous PCM array to Web Audio API friendly format | audioBufFromRaw(raw) {
let buffer = raw.array;
let channels = raw.channels;
let samples = buffer.length/channels;
let audioBuf = this.context.createBuffer(channels, samples, raw.sampleRate);
for(let i = 0; i < channels; i++) {
// Offset is in bytes, length is in eleme... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function convertAudio(buffer) {\n try {\n const stereo = new Int16Array(buffer);\n const mono = new Int16Array(stereo.length/2);\n let j = 0;\n for (let i = 0; i < stereo.length; i += 4) {\n mono[j++] = stereo[i];\n mono[j++] = stereo[i+1];\n }\n return Buffer.from(mono);\n } ca... | [
"0.67863566",
"0.65097713",
"0.61724514",
"0.60572577",
"0.5995118",
"0.59477806",
"0.5931362",
"0.59304583",
"0.5921358",
"0.5916897",
"0.5909613",
"0.5906719",
"0.58731",
"0.58521813",
"0.582935",
"0.5797338",
"0.57630545",
"0.5761431",
"0.57190686",
"0.5664616",
"0.5663012... | 0.6573727 | 1 |
Stops playback and cancels all scheduled notes. | stop() {
this.isPlaying = false;
clearInterval(this.audioScheduleInterval);
this.audioScheduleIndex = 0;
if (this.playbackNode !== null) this.playbackNode.stop();
audioCtx.close();
audioCtx = new window.AudioContext();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stop() {\n speechSynthesis.cancel();\n }",
"stop() {\n this.reset();\n this.isPlaying = false;\n this.isPaused = false;\n this.isDone = false;\n }",
"stop() {\n // Already stopped? Do not continue\n if (!this.isSpeaking)\n return;\n ... | [
"0.6647436",
"0.65807337",
"0.65306747",
"0.65225613",
"0.6496153",
"0.6456971",
"0.6448739",
"0.6411795",
"0.6406457",
"0.639691",
"0.6376491",
"0.6373386",
"0.6343667",
"0.63415575",
"0.6332922",
"0.6316683",
"0.6316244",
"0.6311373",
"0.6302755",
"0.62966764",
"0.6281997",... | 0.67738855 | 0 |
Cancels the audio rendering process. | cancelRender() {
this.renderingCtx.suspend();
setPlaybackWaitStatus(false);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function stopAudio() {\n if (isBusy()) {\n lastPlayer.stop();\n removeBlurHandler();\n }\n }",
"cancel() {\n window.speechSynthesis.cancel();\n }",
"stop() {\n\t\tthis._isPlaying = false;\n\t\tthis.stopRendering();\n\t}",
"stopAudio() {\n if (!this.audio || !this.audio.audio) {\n ... | [
"0.69977224",
"0.6870058",
"0.68238413",
"0.6765224",
"0.67062527",
"0.66929924",
"0.66639256",
"0.65153384",
"0.6505672",
"0.64662004",
"0.6461484",
"0.6449048",
"0.6421322",
"0.64108723",
"0.6397602",
"0.6375107",
"0.6346884",
"0.6346142",
"0.6332149",
"0.63306916",
"0.6323... | 0.7779021 | 0 |
Clears the schedule of all notes. | clear() {
this.schedule = [];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async clear() {\n\t\t// this._tasks is unedited as Settings#clear will clear the array\n\t\tawait this.client.settings.reset('schedules');\n\t\tthis.tasks = [];\n\t}",
"function clearScheduleSections() {\n\t\tclearScheduleDay(\"mon\");\n\t\tclearScheduleDay(\"tue\");\n\t\tclearScheduleDay(\"wed\");\n\t\tclearSch... | [
"0.70359516",
"0.6878407",
"0.6630549",
"0.6617233",
"0.639658",
"0.63171357",
"0.63146454",
"0.6248088",
"0.6171376",
"0.61586124",
"0.6151375",
"0.6138377",
"0.6120324",
"0.6111903",
"0.6111722",
"0.60385555",
"0.6022868",
"0.60022104",
"0.59987324",
"0.5960344",
"0.5929916... | 0.72837263 | 0 |
calculates grand total and puts it at the bottom | function grandTotal(){
var sum = 0;
$('.sum').each(function(){
sum += parseInt($(this).html() || 0);
$('#grandtotal').html(sum);
})
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function grand_total()\n\t\t{\n\t\t\tvar grandtotal = 0;\n\t\t\t$('.label_total').each( function() {\n\t\t\t\tvar temp = parseInt($(this).attr('data-total'));\n\t\t\t\tgrandtotal += temp;\n\t\t\t});\n\t\t\t$('.grand_total').html('<strong>IDR ' +number_format(grandtotal)+'</strong>');\t\n\t\t}",
"function grand_t... | [
"0.74920577",
"0.7441219",
"0.7210114",
"0.70958567",
"0.70144486",
"0.69845295",
"0.6907983",
"0.69058204",
"0.6904473",
"0.6844123",
"0.6840857",
"0.6807122",
"0.6780227",
"0.6767296",
"0.6746442",
"0.67264646",
"0.671885",
"0.66581076",
"0.6654153",
"0.6630259",
"0.662011"... | 0.77317077 | 0 |
draw a dot if tile has a dot and eaten is false | show(){
if(this.dot){
if(!this.eaten){//draw dot if not eaten
fill(255, 255, 0);
noStroke();
ellipse(this.pos.x, this.pos.y, 3, 3);
}
}else if(this.bigDot){
if(!this.eaten){
fill(255, 255, 0);
noStroke();
ellipse(this.pos.x, this.pos.y... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"show() {\n //Si el dot esta muerto, no se dibujara\n if(!this.dead){\n // if (!this.isBest) {\n fill(this.r, this.g, this.b);\n // } else {\n // fill(0, 0);\n // }\n ellipse(this.pos.x, this.pos.y, 4, 4);\n }\n }",
"dra... | [
"0.7067817",
"0.69184333",
"0.6813813",
"0.67486006",
"0.6617961",
"0.6516731",
"0.64153224",
"0.6373029",
"0.63161623",
"0.6263035",
"0.62029386",
"0.6201385",
"0.61772835",
"0.61759",
"0.6151149",
"0.6082926",
"0.60603213",
"0.605833",
"0.6048427",
"0.6039895",
"0.60393816"... | 0.77100235 | 0 |
Function to download openscad | function download_scad() {
var text = $('#scad').text() + $('#base').text();
var file = new Blob([text], {type: text/text});
var filename="braid"+N+'x'+M+'.scad';
if (window.navigator.msSaveOrOpenBlob) // IE10+
window.navigator.msSaveOrOpenBlob(file, filename);
else { // Others
var a... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function DownloadSource() { }",
"function downloadSRQTX()\r\n{\r\n window.open(\"labdipoverview.do?method=downloadsrqtx\");\r\n}",
"function DownloadWikipediaExample()\n{\n downloadFileToDrive('https://www.wikipedia.org/portal/wikipedia.org/assets/img/Wikipedia-logo-v2.png', 'MyDownloads', 'wikipedia.png',... | [
"0.57434535",
"0.5735425",
"0.5700237",
"0.5652797",
"0.56261307",
"0.5619637",
"0.55750406",
"0.5563232",
"0.55397785",
"0.54556894",
"0.5453564",
"0.5433026",
"0.53755295",
"0.53270364",
"0.5267496",
"0.52658045",
"0.5262241",
"0.5254367",
"0.5245709",
"0.52413803",
"0.5237... | 0.69150466 | 0 |
would contain 1 player for each iframe video | function onYouTubeIframeAPIReady()
{
var allMovieIframes = document.getElementById("moviesCarousel").getElementsByTagName('iframe');
for (currentIFrame of allMovieIframes)
{
players.push(new YT.Player(
currentIFrame.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function lanzavideo() {\n // create the global player from the specific iframe (#video)\n player = new YT.Player('videos', {\n events: {\n // call this function when player is ready to use\n 'onReady': onPlayerReady\n }\n });\n}",
"function youtubeApiHandle() {\n for (let i = 0; i < YTTemp.... | [
"0.7225266",
"0.7165468",
"0.71406853",
"0.70901674",
"0.6995765",
"0.6834986",
"0.6817907",
"0.67569023",
"0.67460537",
"0.67410773",
"0.67362297",
"0.6677489",
"0.6624457",
"0.6597239",
"0.6563073",
"0.6556735",
"0.65398496",
"0.65204126",
"0.6494151",
"0.6480492",
"0.64438... | 0.75130844 | 0 |
to array method converts the queue into the array from first to last. | toArray() {
const array = [];
var temp = this.first;
while (temp.next) {
array.push(temp.data);
temp = temp.next;
}
array.push(temp.data);
return array;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"queueToArray(queue) {\n\t\tlet users = [];\n\t\tlet currUser = queue.first;\n\t\twhile (currUser !== null) {\n\t\t\tusers.push(currUser.value);\n\t\t\tcurrUser = currUser.next;\n\t\t}\n\t\treturn users;\n\t}",
"toArray() {}",
"function toArray() {\n return this._a.slice();\n}",
"function _toArray(arr) { r... | [
"0.7085652",
"0.6687195",
"0.66183966",
"0.6528284",
"0.6460971",
"0.64218205",
"0.63941807",
"0.63900506",
"0.6341322",
"0.63192576",
"0.62980676",
"0.62980676",
"0.62980676",
"0.62762856",
"0.62684876",
"0.62684876",
"0.62634397",
"0.6255021",
"0.6222406",
"0.6182928",
"0.6... | 0.68000054 | 1 |
Sees if the given x and y coordinates is a valid position for a new InitWorker. Checks posn bounds, and if tile is occupied. ListOfInitWorker Int Int > Boolean | isValidPlace(initWorkerList, x, y) { // TODO REFACTOR into single return statement -sb
if (this.tileIsInBounds(x, y)) {
if (!initWorkerList.some((w) => w.x === x && w.y === y)) {
return true;
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_isValidTile(coords) {\n const bounds = this.options.bounds;\n return coords.x >= bounds.min.x\n && coords.y >= bounds.min.y\n && coords.x < bounds.max.x\n && coords.y < bounds.max.y;\n }",
"checkInBounds(coord) \n {\n return (coord.x >= 0 && coord.x < ... | [
"0.6430547",
"0.6403132",
"0.63493323",
"0.62695557",
"0.62305033",
"0.61535406",
"0.6103306",
"0.60627913",
"0.60325706",
"0.60110784",
"0.5961655",
"0.595764",
"0.5941038",
"0.5918755",
"0.5882217",
"0.5862238",
"0.5850925",
"0.5835223",
"0.58333474",
"0.5825091",
"0.582410... | 0.8134544 | 0 |
Board Turn > Boolean Given the current board, is the entire Turn valid? | isValidTurn(board, turn) {
// 1. move valid?
// 2. if winning move, is turn just a move?
// 3. else, apply move, is build valid?
let moveReq = turn[0];
let workerReq = moveReq[1];
let moveDir = moveReq[2];
if (!this.isValidMove(board, workerReq, moveDir)) {
return false;
}
// I... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkTurn() {\n\treturn figure.nums.every((num,i) => {\n\t\t// calculate cell index after turn\n\t\tlet newIndex = num + figure.turns[figure.turnPosition][i];\n\t\t// if current cell is close to the left edge of the board\n\t\tif(num % boardWidth < boardWidth / 2) {\n\t\t\t// the cell after turn is exists... | [
"0.81453353",
"0.74301",
"0.7408413",
"0.7382501",
"0.73483056",
"0.71452993",
"0.71358377",
"0.7128402",
"0.7060635",
"0.70472056",
"0.70424724",
"0.70284206",
"0.70273566",
"0.7019285",
"0.69456893",
"0.69218224",
"0.6914839",
"0.6904866",
"0.69039154",
"0.6888292",
"0.6878... | 0.7477272 | 1 |
Sees if the move command satisfies Santorini's valid move conditions Check valid move conditions: Common conditions pass (see below in checkValid()) Target tile is at most one floor taller than the one where the worker is currently located. Board WorkerRequest Direction > Boolean | isValidMove(board, workerRequest, direction) {
if (this.checkValid(board, workerRequest, direction)) {
if (board.workerNeighborHeight(workerRequest, direction) -
board.workerNeighborHeight(workerRequest, ["PUT", "PUT"]) <= constants.MAX_FLOORS_PER_MOVE) {
return true;
}
}
retur... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isValidMoveBuild(board, workerRequest, moveDir, buildDir) { // todo this needs refactoring to fit turn def -sb\n let clone = board.copy();\n\n if (this.isValidMove(clone, workerRequest, moveDir)) {\n clone.moveWorker(workerRequest, moveDir);\n if (this.isValidBuild(clone, workerRequest, buildDir)... | [
"0.7474092",
"0.73595935",
"0.7261882",
"0.7059826",
"0.69645405",
"0.6943156",
"0.68097454",
"0.67588806",
"0.67219037",
"0.67170906",
"0.67069423",
"0.6695959",
"0.6655511",
"0.6643972",
"0.6643331",
"0.6641366",
"0.66286063",
"0.66045046",
"0.657829",
"0.6573601",
"0.65715... | 0.7854806 | 0 |
Sees if the build command satisfies Santorini's valid build conditions. Check valid build conditions: Common conditions pass (see below in checkValid()) Board WorkerRequest Direction > Boolean | isValidBuild(board, workerRequest, direction) {
return this.checkValid(board, workerRequest, direction);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"isValidMoveBuild(board, workerRequest, moveDir, buildDir) { // todo this needs refactoring to fit turn def -sb\n let clone = board.copy();\n\n if (this.isValidMove(clone, workerRequest, moveDir)) {\n clone.moveWorker(workerRequest, moveDir);\n if (this.isValidBuild(clone, workerRequest, buildDir)... | [
"0.6927818",
"0.67668945",
"0.62332684",
"0.5981868",
"0.5807157",
"0.57507765",
"0.57301694",
"0.57068837",
"0.5706301",
"0.5676391",
"0.56291944",
"0.55237174",
"0.5501817",
"0.5462967",
"0.5462621",
"0.54305845",
"0.54192",
"0.54179263",
"0.54046255",
"0.5387137",
"0.53616... | 0.75876737 | 0 |
Board WorkerRequest > Boolean Does the given Board contain the worker denoted by the WorkerRequest? The named player exists in the game, and it has a worker with the ID in the request. | checkValidWorkerRequest(board, workerRequest) {
let workers = board.getWorkers();
return workers.some((worker) => {
return worker.player === workerRequest.player &&
worker.id === workerRequest.id;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasWon(board, playerID) {\n return this.workerIsOnWinningHeight(board, playerID);\n }",
"checkValid(board, workerRequest, direction) {\n if (this.checkValidWorkerRequest(board, workerRequest)) {\n if (direction.join('') !== \"PUTPUT\") {\n if (board.workerHasNeighbor(workerRequest, direction))... | [
"0.6422417",
"0.6400742",
"0.6261713",
"0.5996372",
"0.5891251",
"0.56686413",
"0.56426954",
"0.56178176",
"0.5606934",
"0.558743",
"0.55457234",
"0.5479637",
"0.54719996",
"0.54437625",
"0.5372412",
"0.52996105",
"0.5258084",
"0.5247723",
"0.5200906",
"0.51978856",
"0.510246... | 0.7888466 | 0 |
Sees if any worker owned by the given player is at the winning height. Board String > Boolean | workerIsOnWinningHeight(board, playerID) {
return board.workers.filter((w) => w.player === playerID).some((w) => {
return board.heightAtTile(w.posn.x, w.posn.y) === constants.MAX_HEIGHT - 1;
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"hasWon(board, playerID) {\n return this.workerIsOnWinningHeight(board, playerID);\n }",
"isWinner(player) {\n return TTTGame.POSSIBLE_WINNING_ROWS.some(row => {\n return this.board.countMarkerFor(player, row) === 3;\n });\n }",
"hasLost(board, playerID) {\n return this.workersCantMove(board,... | [
"0.78718185",
"0.72139245",
"0.6745048",
"0.67281204",
"0.669759",
"0.6669466",
"0.6652764",
"0.66138095",
"0.6603142",
"0.6576881",
"0.6560972",
"0.6556988",
"0.6556277",
"0.6542374",
"0.65397394",
"0.65350044",
"0.65256745",
"0.65238076",
"0.6522117",
"0.6520687",
"0.651998... | 0.8561799 | 0 |
Returns an array of unoccupied tile heights adjacent to the given worker. Worker Board > Boolean | getAdjacentTiles(worker, board) {
let adjArr = [];
for (let d in dirs) {
let newX = dirs[d].x + worker.posn.x;
let newY = dirs[d].y + worker.posn.y;
if (this.checkValid(board, worker, direction.coordToDirection(dirs[d]))) {
adjArr.push([newX, newY]);
}
}
return adjArr.... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"workerIsOnWinningHeight(board, playerID) {\n return board.workers.filter((w) => w.player === playerID).some((w) => {\n return board.heightAtTile(w.posn.x, w.posn.y) === constants.MAX_HEIGHT - 1;\n });\n }",
"getAdjacent(){\r\n\t\treturn [\r\n\t\t\tthis.x>0 ? this.grid.cells[this.x-1][this.y] : null, ... | [
"0.6466756",
"0.59960943",
"0.592849",
"0.59168714",
"0.5907002",
"0.5846283",
"0.58391887",
"0.5806892",
"0.5786461",
"0.5768695",
"0.5738589",
"0.56445664",
"0.5576715",
"0.55682737",
"0.550489",
"0.5471135",
"0.5460275",
"0.5438458",
"0.5410399",
"0.53924733",
"0.53924245"... | 0.8142482 | 0 |
sunday assuming the first day is monday | currSunday(d){
d = new Date(d);
let day = d.getDay(),
diff = d.getDate() - day;
return new Date(d.setDate(diff + 7));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"toSunday(date) {\n while(days[date.getUTCDay()] !== \"Sunday\") {\n date.setDate(date.getDate() + 1);\n }\n }",
"function getSunday(d) {\n d = new Date(d);\n var day = d.getDay(),\n diff = d.getDate() - day;\n return new Date(d.setDate(diff));\n }",
"function ... | [
"0.77594507",
"0.74166685",
"0.7399592",
"0.73089916",
"0.7247519",
"0.7093085",
"0.7023833",
"0.6899772",
"0.6885191",
"0.68672925",
"0.684018",
"0.6725008",
"0.6644323",
"0.66315573",
"0.65656996",
"0.6547823",
"0.6541643",
"0.651341",
"0.6500688",
"0.64900005",
"0.6478653"... | 0.74228734 | 1 |
Check if packageSize is outdated; | function isOutdated(packageSize) {
var now = new Date();
var outdated = now - new Date(packageSize.lastChecked) > OUTOFDATEINTERVAL;
debug('get(%o, %o) -> isOutdated(%o): %o', packageSize.name, packageSize.version, packageSize.lastChecked, outdated);
return outdated;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"checkSize() {\n // to be overridden by plugins\n }",
"function checkUpdate () {\n var pkg = require(\"./package.json\");\n require(\"update-notifier\")({\n packageName: pkg.name,\n packageVersion: pkg.version\n }).notify();\n}",
"function checkForUpdate() {\n request('https://raw.githu... | [
"0.63519126",
"0.6240232",
"0.62142223",
"0.58839077",
"0.5809927",
"0.57819325",
"0.57819325",
"0.5748425",
"0.57427436",
"0.5727668",
"0.5727566",
"0.5714871",
"0.5713218",
"0.5709824",
"0.5707456",
"0.5707456",
"0.5707456",
"0.5707456",
"0.57051516",
"0.57051516",
"0.57051... | 0.7633305 | 0 |
Converts Query data to more usable object | convertQueryData(queryData) {
const obj = JSON.parse(JSON.stringify(queryData)); // deep copy of object
for (let i = 0; i < queryData.length; i++) { // for every word
const wordData = queryData[i];
obj[i].types = new Set();
obj[i].ignore = new Set();
for (let j = 0; j < wordData.ty... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"static process(query, data) {\n Utils.forOwn(data, (entity, name) => {\n const fields = query.getModel(name).fields();\n Utils.forOwn(entity, (record) => {\n Utils.forOwn(record, (value, key) => {\n const field = fields[key];\n if (f... | [
"0.64687216",
"0.63371366",
"0.6278847",
"0.62562096",
"0.6189915",
"0.6181665",
"0.6152693",
"0.6048636",
"0.60164905",
"0.5994987",
"0.59407794",
"0.5830896",
"0.5805543",
"0.57838494",
"0.5782406",
"0.5728749",
"0.57087666",
"0.5704612",
"0.57007885",
"0.56280506",
"0.5620... | 0.6808296 | 0 |
given a directory, obj will be written as batch JSON file | writeBatchJSON(path, obj) {
const folder = path.split('/').slice(0, 6).join('/');
if (!fs.existsSync(folder, () => {})) {
fs.mkdirSync(folder, () => {});
}
const items = fs.readdirSync(folder);
this.writeJSONFile(`${path}/batch${items.length + 1}.json`, obj);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"saveJsonFile(obj) {\n let allData = this.getJsonFile()\n allData.push(obj)\n jsf.writeFileSync(this.file, allData, {spaces:2, EOL:'\\r\\n'})\n }",
"async function writeJson (obj, path) {\n return fs.writeFile(path, JSON.stringify(obj, null, 2))\n}",
"function writeJson(path, obj) {\n return writeFi... | [
"0.6983442",
"0.6795478",
"0.6759098",
"0.66461235",
"0.6551622",
"0.65469307",
"0.63636106",
"0.6300194",
"0.62065697",
"0.6168846",
"0.61660933",
"0.6108922",
"0.6106806",
"0.60773134",
"0.6035771",
"0.5974785",
"0.59356725",
"0.5930145",
"0.5900446",
"0.5836104",
"0.583579... | 0.8283314 | 0 |
Recursively flushes the data in a directory | flushData(path) {
const items = fs.readdirSync(path);
for (const item of items) {
const stats = fs.lstatSync(path + item);
if (stats.isFile()) fs.unlinkSync(path + item);
else this.flushData(`${path + item}/`);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function flush() {\n try {\n fs.mkdirSync('/db');\n } catch(err) {\n if ( err.code !== 'EEXIST' ) {\n throw err;\n }\n }\n\n fs.writeFileSync('/db/data.yml', yaml.safeDump(data));\n}",
"async flush() {\n const initialPath = path.join(initialState.dir, initialState.filename);\n const f... | [
"0.68701905",
"0.646815",
"0.6243747",
"0.6216285",
"0.5980385",
"0.5946587",
"0.5920661",
"0.5910455",
"0.5874104",
"0.5745301",
"0.5725387",
"0.570778",
"0.5705029",
"0.56896114",
"0.5661894",
"0.5657106",
"0.5637406",
"0.5572636",
"0.5532478",
"0.55208975",
"0.5425764",
... | 0.7694593 | 0 |
for country fill/gradient get!!!!!!! replace width with GRAD_LEN or whatver?= | function getRGBgradient(obj, width, perc) {
rgb = obj.getPixelRGB(Math.round(width * perc) - 1, 0) // -1 for hor length
return { r: rgb['r'], g: rgb['g'], b: rgb['b'] };
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_gradient(i,j) {\n let h = this.heightmap;\n let z = (h[j+1][i-1] * 3 +\n h[j+1][i ] * 10 +\n h[j+1][i+1] * 3 +\n h[j-1][i-1] * -3 +\n h[j-1][i ] * -10 +\n h[j-1][i+1] * -3);\n let x = (h[j+1][i+1] * 3 +\n h[j ][i+1] * 10 +\n h[j-1][i+1] * 3 ... | [
"0.6404947",
"0.60043657",
"0.59753036",
"0.59260947",
"0.5848079",
"0.57912636",
"0.5762225",
"0.57530105",
"0.57503724",
"0.5735368",
"0.5722337",
"0.56436986",
"0.55975777",
"0.5585773",
"0.5562358",
"0.55579615",
"0.555176",
"0.5532756",
"0.5495136",
"0.5494853",
"0.54923... | 0.6044798 | 1 |
Adds a dot to the game. | function _addDot() {
// Create dot model
var strokeWidth = 1;
var dotRadius = _getRandomDotRadius();
var initialDotX = _getRandomDotX(dotRadius, strokeWidth);
var initialDotY = 0 - dotRadius - strokeWidth - 1;
var dotModelScore = _getDotModelScore(dotRadius);
var dotModel = new DotModel(dotM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"addDot(index) {\n const dot = new Dot();\n dot.setDotShiftY(this.glyph.dot_shiftY);\n this.addDotsCount++;\n return this.addModifier(index, dot);\n }",
"function _drawDot(dotModel) {\n var dotElem = document.createElementNS(\"http://www.w3.org/2000/svg\", \"circle\");\n dotElem.setAttributeNS(... | [
"0.74332935",
"0.7426189",
"0.7239822",
"0.69428325",
"0.67375034",
"0.6677067",
"0.6614858",
"0.66007286",
"0.6598041",
"0.6525947",
"0.6489404",
"0.64628255",
"0.6461402",
"0.6457734",
"0.64486706",
"0.64416254",
"0.6439188",
"0.63790214",
"0.6378857",
"0.6369807",
"0.63375... | 0.81838244 | 0 |
Creates a pokecard for pokemon, props are id, name, type, base_experience | function PokeCard({ id, name, type, base_experience }) {
return (
<div className="PokeCard">
<h3 className="PokeCard-name">{name}</h3>
<img
src={`${BASE_IMG_URL}${id}.png`}
alt="poke-card" className="PokeCard-image"
/>
<div className="PokeCard-type">Type: {type}</div>
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createPokemonCard(pokemon) {\n const pokemon_element = document.createElement(\"div\");\n pokemon_element.classList.add(\"Pokemon\");\n\n const innerhtml = `\n <div class=\"img-container\">\n <img class=\"img\" src=\"https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/${pokemon... | [
"0.71363753",
"0.6779856",
"0.65748125",
"0.6313222",
"0.63029957",
"0.62155294",
"0.6132293",
"0.61072445",
"0.61043894",
"0.6104107",
"0.6088096",
"0.605476",
"0.59427583",
"0.591042",
"0.58506805",
"0.5843789",
"0.57949054",
"0.5762701",
"0.57443285",
"0.5742297",
"0.57315... | 0.70240116 | 1 |
Call after each input device measurement to track the maximum distance between samples. | function MaximumDistanceEstimator()
{
var previous = null;
//var stats = new RunningStatistics();
// This is used to tack the top speeds. We will
// take the minimum max speed, assuming the others
// are outliers due to noise or system tracking errors
var speeds = new Array(5);
for(var ii ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setMaxDistance(maxDistance) {\n this.attenuation.maxDistance = maxDistance;\n }",
"measureDistance() {\n this._lastDistance = Infinity;\n return this._lastDistance;\n }",
"get maxAccDistance() {\n return configs.maxAccelerationTime * configs.maxSpeed / 2;\n }",
"f... | [
"0.6315528",
"0.5720195",
"0.56052846",
"0.5372323",
"0.5277337",
"0.5272519",
"0.5199541",
"0.51854604",
"0.51729304",
"0.51715356",
"0.5084081",
"0.50610983",
"0.50553596",
"0.50553596",
"0.502367",
"0.5022361",
"0.49751252",
"0.49748373",
"0.49748373",
"0.49748373",
"0.497... | 0.6644055 | 0 |
Estimates power spectral density on the monitor_hz frequency in order to estimate Gaussian white noise variance in an input device signal. When using, ensure the user is idle. Slow movements are fine, but jerks and abrupt stops may inflate the estimate. Note 1, sample_hz / 2 is the Nyquist frequency, the highest freque... | function NoiseEstimator(
monitor_hz,
sample_hz)
{
// Ensure sample rate is in on integer boundary and
// is even. Don't worry though... everything still
// works even when the real sample rate doesn't match
// the estimated rate.
sample_hz = Math.round(sample_hz);
var sample_hz = sampl... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function identifyFakeDeviceSignal_(samples, beLenient) {\n var numPeaks = 0;\n var threshold = MAX_AUDIO_OUTPUT_ENERGY * 0.7;\n if (beLenient)\n threshold = MAX_AUDIO_OUTPUT_ENERGY * 0.6;\n var currentlyOverThreshold = false;\n\n // Detect when we have been been over the threshold and is going back again\n... | [
"0.5000284",
"0.48392564",
"0.48392564",
"0.48077583",
"0.48030183",
"0.47813413",
"0.4742355",
"0.47045934",
"0.46908063",
"0.46363848",
"0.45394063",
"0.45306146",
"0.45267853",
"0.4485728",
"0.44766375",
"0.44688708",
"0.44376233",
"0.4411664",
"0.44037122",
"0.43973398",
... | 0.74739313 | 0 |
Function for hiding original selects, replaced by custom one. | function hideOriginalSelect(select) {
select.classList.add('custom-select__hidden');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hideSelects() {\n // convert all drop downs of the page to a span\n // neglect any drop downs with the \".no-replace\" class\n $(\"select\").not(\".hidden-dropdown\").each(function () {\n $(this)\n\t\t\t\t.after(\"<span class='replacement'></span>\").next()\n\t\t\t\t.addCla... | [
"0.7511378",
"0.7257876",
"0.7148107",
"0.7088547",
"0.68841374",
"0.6841571",
"0.6791642",
"0.67900443",
"0.6758381",
"0.6758381",
"0.6673005",
"0.6601126",
"0.65232635",
"0.64176935",
"0.64058375",
"0.6398339",
"0.6364863",
"0.6340304",
"0.6183556",
"0.6132963",
"0.6113603"... | 0.8010475 | 0 |
Function for creating input in custom select and returns it Takes selected option as argument to create start placeholder | function createInput(option) {
var selectInput = document.createElement('input');
selectInput.tabIndex = -1;
selectInput.classList.add('custom-select__input');
selectInput.placeholder = option.text;
selectInput.setAttribute('aria-label', option.text);
return selectInput;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createInp() {\n const input = document.createElement(this.selectObj.tagName);\n const label = document.createElement(\"label\");\n label.innerHTML = this.selectObj.labelText;\n if (this.selectObj.optionsText && this.selectObj.optionsValue) {\n for (let i = 0; i < this.selectO... | [
"0.6667698",
"0.646369",
"0.63182586",
"0.6207458",
"0.61661965",
"0.6156714",
"0.61145914",
"0.60693926",
"0.6049948",
"0.60452133",
"0.6034933",
"0.60195476",
"0.6005937",
"0.5950746",
"0.5943624",
"0.59294933",
"0.59161913",
"0.59155005",
"0.58979166",
"0.5896913",
"0.5895... | 0.7146205 | 0 |
Function which creates list for options and returns it It takes original select as argument We also initiate creating and appending input and options here | function createSelectList(select, customSelect) {
var selectList = document.createElement('ul');
var selectOptions = select.querySelectorAll('option');
selectList.classList.add('custom-select__list');
selectList.classList.add('custom-select__hidden');
selectOptions.forEach(function(option, index) {
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"createInp() {\n const input = document.createElement(this.selectObj.tagName);\n const label = document.createElement(\"label\");\n label.innerHTML = this.selectObj.labelText;\n if (this.selectObj.optionsText && this.selectObj.optionsValue) {\n for (let i = 0; i < this.selectO... | [
"0.6843418",
"0.66645163",
"0.655125",
"0.6541771",
"0.64872324",
"0.6470089",
"0.6461674",
"0.6456295",
"0.6445489",
"0.6427469",
"0.6396225",
"0.6383575",
"0.6374703",
"0.63528585",
"0.63515633",
"0.63346833",
"0.6319335",
"0.62904155",
"0.6261886",
"0.62500787",
"0.6248503... | 0.6831687 | 1 |
Function creates custom select wrapper and returns it initiates creating select list of options | function createcustomSelect(select) {
var selectСlassList = select.classList;
var customSelect = document.createElement('div');
customSelect.classList.add('custom-select__wrapper');
customSelect.setAttribute('tabindex', '-1');
for (var i = 0; i < selectСlassList.length; i++) {
customSelect.cla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function createSelectList(select, customSelect) {\n var selectList = document.createElement('ul');\n var selectOptions = select.querySelectorAll('option');\n selectList.classList.add('custom-select__list');\n selectList.classList.add('custom-select__hidden');\n selectOptions.forEach(function(option,... | [
"0.7625096",
"0.7133494",
"0.7012587",
"0.6927028",
"0.69262666",
"0.6875744",
"0.685276",
"0.6685484",
"0.6668934",
"0.663567",
"0.66234547",
"0.6620499",
"0.65875226",
"0.6570682",
"0.65526253",
"0.65395284",
"0.65383375",
"0.6499497",
"0.6472225",
"0.64635336",
"0.6457273"... | 0.7729631 | 0 |
Render all items of our select We need this function after using our search functionallity We always store all items in state.options state.renderedOptions only changes | function renderAll() {
selectList.textContent = '';
state.renderedOptions = [];
state.options.forEach(function(item, index) {
item.dataset.count = index;
state.renderedOptions.push(item);
selectList.appendChild(item);
if (state.activeItem) {
state.activOption ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render( e )\n {\n\n this.bindThis();\n\n this.initializeOptions();\n\n if ( this.search )\n {\n this.search = new Search( this );\n }\n\n try\n {\n this.onInit();\n }\n catch( e )\n {\n console.log( 'something... | [
"0.7050876",
"0.67201626",
"0.6678005",
"0.65848917",
"0.6576488",
"0.64224803",
"0.63961756",
"0.6329023",
"0.6286271",
"0.6270048",
"0.62689877",
"0.6224711",
"0.6217444",
"0.6188238",
"0.6137004",
"0.61154765",
"0.611337",
"0.6069115",
"0.603821",
"0.60298604",
"0.60182005... | 0.8126842 | 0 |
Function to wich handles clicks and enters on our select Here we initiate renderAll if our state.renderedOptions sjoter then state.options after search And we use state.countClicks to learn if itn't first click and we should test our lists | function clickAndEnterHandler() {
selectInput.focus();
if (state.status === 'closed' && state.countClicks === 0) {
state.countClicks = 1;
if (state.options.length > state.renderedOptions.length) {
renderAll();
}
}
showCurrentSelectPlaceholder();
state.coun... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"render( e )\n {\n\n this.bindThis();\n\n this.initializeOptions();\n\n if ( this.search )\n {\n this.search = new Search( this );\n }\n\n try\n {\n this.onInit();\n }\n catch( e )\n {\n console.log( 'something... | [
"0.7097312",
"0.6669088",
"0.6442719",
"0.6292015",
"0.62733346",
"0.62303513",
"0.61729646",
"0.6150121",
"0.61028045",
"0.60810024",
"0.60535616",
"0.6052307",
"0.60431826",
"0.60123736",
"0.6011916",
"0.59809786",
"0.5961989",
"0.59010607",
"0.5900823",
"0.5889264",
"0.588... | 0.7501 | 0 |
Move focus and update state.activOption | function focusItemAndUpdateActiveOption(activOption) {
state.activOption = +activOption;
state.renderedOptions[state.activOption].focus();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"focus() {\n this.update({ isDoFocus: true });\n }",
"_updateFocus() {\n\t\tif ( this.isFocused ) {\n\t\t\tconst editable = this.selection.editableElement;\n\n\t\t\tif ( editable ) {\n\t\t\t\tthis.domConverter.focus( editable );\n\t\t\t}\n\t\t}\n\t}",
"_updateFocus() {\n\t\tif ( this.isFocused... | [
"0.7025422",
"0.6852571",
"0.6852571",
"0.67136896",
"0.66424686",
"0.65059096",
"0.64939356",
"0.6423979",
"0.6361528",
"0.6336254",
"0.6299237",
"0.62942797",
"0.6289307",
"0.6274731",
"0.6267915",
"0.62389076",
"0.62389076",
"0.62389076",
"0.62389076",
"0.62389076",
"0.622... | 0.8189437 | 0 |
Selects next option using keyboard We use state.activOption for this porpuses | function selectNext() {
if (state.activOption !== 'default') {
if (state.activOption === state.renderedOptions.length - 1) {
focusItemAndUpdateActiveOption(0);
} else state.activOption += 1;
state.renderedOptions[state.activOption].focus();
} else {
focusItemAndUpda... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onDownKey() {\n var len = this.opt.choices.realLength;\n this.selected = (this.selected < len - 1) ? this.selected + 1 : 0;\n this.render();\n }",
"selectNext() {\n let options = get(this, 'enabledOptions');\n let value = get(this, 'value');\n let index;\n\n if (options) {\n if (value)... | [
"0.70931745",
"0.70486486",
"0.69635606",
"0.695614",
"0.6932347",
"0.69165987",
"0.6886632",
"0.6886632",
"0.68099236",
"0.6809731",
"0.6809731",
"0.6649626",
"0.6588331",
"0.6560289",
"0.64956135",
"0.6469891",
"0.64456224",
"0.6437745",
"0.63976085",
"0.6351337",
"0.632916... | 0.85902596 | 0 |
Selects previous option using keyboard We use state.activOption for this porpuses | function selectPrevious() {
if (state.activOption !== 'default') {
if (state.activOption === 0) {
focusItemAndUpdateActiveOption(state.renderedOptions.length - 1);
} else state.activOption -= 1;
state.renderedOptions[state.activOption].focus();
} else {
focusItemAnd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onUpKey() {\n const len = this.opt.choices.realLength;\n this.selected = this.selected > 0 ? this.selected - 1 : len - 1;\n this.render();\n }",
"function selectNext() {\n if (state.activOption !== 'default') {\n if (state.activOption === state.renderedOptions.length - 1) {\n focus... | [
"0.7199544",
"0.7136848",
"0.7112409",
"0.7051911",
"0.7051911",
"0.7051502",
"0.70282143",
"0.7002546",
"0.6876165",
"0.6722638",
"0.6709597",
"0.65730727",
"0.65696555",
"0.652299",
"0.6507393",
"0.64293087",
"0.64184296",
"0.64184296",
"0.63989687",
"0.63957644",
"0.631188... | 0.84274715 | 0 |
We remove focus and key listeners if user clicks out of customSelect or press "Tab" key | function closeAndRemoveKeyListener(e) {
var target = e.target;
if (target !== customSelect && !customSelect.contains(target)) {
if (state.status === 'expanded') {
toggleCustomSelect();
}
document.removeEventListener('keydown', keyActions);
}
showCurrentSelectPla... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"onKeyDown(select, e){\n if (e && e.keyCode === 9 /*tab*/ && typeof(select.highlighted) === 'object') {\n // needs to be an array because this is multi select\n select.actions.select([select.highlighted]);\n select.actions.close();\n }\n }",
"onUnfocus() {}",
"function removeSe... | [
"0.68563104",
"0.66708755",
"0.6591816",
"0.64538765",
"0.6408276",
"0.6389606",
"0.62527436",
"0.6157782",
"0.61084175",
"0.60829467",
"0.607073",
"0.60342425",
"0.5964001",
"0.59425914",
"0.5918499",
"0.5905633",
"0.588019",
"0.5877703",
"0.5874854",
"0.5861754",
"0.5849271... | 0.7717804 | 0 |
me decodu base64 ne file | function base64_decode(base64str, file) {
// krijon ni buffer object me base64
var bitmap = new Buffer(base64str, 'base64');
// e shkrun bufferin ne file
fs.writeFileSync('./public/profilePhotos/'+file+".jpg", bitmap);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function base64_decode (base64str) {\n fs.writeFile('temp.pdf', base64str, 'base64', err => err && console.log(err))\n}",
"function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n let mime = ... | [
"0.7059523",
"0.69634706",
"0.69544536",
"0.69090664",
"0.6896826",
"0.689302",
"0.689302",
"0.689302",
"0.689302",
"0.689302",
"0.68712246",
"0.68521905",
"0.68429756",
"0.683346",
"0.6777181",
"0.67697257",
"0.67569894",
"0.6739697",
"0.6691637",
"0.6688917",
"0.6612072",
... | 0.71366704 | 0 |
logging down each item and its category that passes through. One day, your boss walks in and asks, "Why are we just randomly placing the items everywhere? It's too difficult to find anything in this place!" Now's your chance to improve the system, impress your boss, and get that raise! The input is a commaseparated lis... | function solution(input) {
const groceries = {
fruit: [], meat: [], other: [], vegetable: [],
};
const group = input.split(',')
.forEach((thing) => {
const [category, item] = thing.split('_');
return groceries.hasOwnProperty(category)
? groceries[category].push(item)
: grocerie... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"extractCategoriesFromItems(allItems) {\n let categories = [];\n let unique = {};\n\n for (let prop in allItems) {\n // The properties used as categories are \"type\" and \"specialType\".\n\n // Check the \"type\" first.\n if (typeof(unique[allItems[prop].type]) == \"undefined\" && allItems[... | [
"0.6021969",
"0.5900065",
"0.58932155",
"0.5864532",
"0.5839987",
"0.58199084",
"0.56070644",
"0.55919373",
"0.558899",
"0.55294985",
"0.54991823",
"0.54613405",
"0.5391691",
"0.53594",
"0.53466785",
"0.5255244",
"0.5246121",
"0.52340513",
"0.52220637",
"0.52190906",
"0.52039... | 0.736224 | 0 |
LOADING PRESENTS / Name: pre_control_panel Purpose: Default methods to run on the /me page Returns: Void | function pre_control_panel()
{
//Load the dates into the DOB selector
loadDates();
//
try
{
//Use Google to load the current state the user resides in
loadstate();
}
catch(e){}
try
{
//Try to show the error box if there is an error
$('#error_display').modal();
}
catch(e){}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function msneula_LoadMe()\n{\n InitGlobals();\n g.btnNext.disabled = false;\n InitButtons();\n}",
"function RemoteControlsPage() {}",
"function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tgetURLparms(function(extensionNum){\r\n\t\t\tgetPT1000XMLData(function(){\r\n\t\t\t\tshowPT1000v... | [
"0.6615739",
"0.6594983",
"0.6397904",
"0.63718086",
"0.6366887",
"0.63492465",
"0.6332736",
"0.6316798",
"0.6303235",
"0.62963635",
"0.6278156",
"0.62497896",
"0.6237724",
"0.6214679",
"0.6206082",
"0.61904705",
"0.6185288",
"0.6179082",
"0.6145877",
"0.6138582",
"0.61217487... | 0.7649376 | 0 |
Name: pre_feed Purpose: Default methods to run on the feed page Returns: Void | function pre_feed()
{
//If the user hasn't removed the notification
if(getCookie("notify")!="off")
{
//Show it
//showNotify("You can now view the changes we make to the website under 'Options / View Changelog'! Click the 'X' to resume.");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setUpFeed() {\n qs(\".poop\").classList.add(\"hidden\");\n let feedType = qs('input[name = \"feed\"]:checked').value;\n let title = document.createElement(\"h2\");\n if(feedType === \"animals\") {\n catagory = \"/FromKittenToCat/\";\n } else if(feedType == \"memes\") {\n catagory ... | [
"0.6934705",
"0.6513312",
"0.6476364",
"0.6455303",
"0.6305825",
"0.6202642",
"0.6127754",
"0.61249745",
"0.61113715",
"0.6053664",
"0.60431254",
"0.59957105",
"0.5922149",
"0.59168035",
"0.5793472",
"0.57878536",
"0.5750908",
"0.5712273",
"0.5670937",
"0.56609476",
"0.565755... | 0.6569442 | 1 |
Async processes all people from db | function processPeople() {
var query = 'all';
fetchDataFromDB(query, function(err, rows) {
// process all the peoples in the DB
for (var i=0; i < rows.length; i++) {
rows.processed = true
}
});
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async getAllPeople() {\r\n const peopleData = await this._peopleDb.query();\r\n\r\n // Only return a list of people's names with their IDs\r\n const people = peopleData.map(personJson => { \r\n // Marshall people json into people model classes\r\n const person = new Person(personJson);\r\n\r\n ... | [
"0.6895273",
"0.6611667",
"0.6496602",
"0.64884204",
"0.6420478",
"0.63542306",
"0.63542306",
"0.6194215",
"0.612107",
"0.6090933",
"0.6083592",
"0.6078523",
"0.60523474",
"0.6046131",
"0.6018947",
"0.60144687",
"0.60127765",
"0.59872746",
"0.59736323",
"0.59662783",
"0.59619... | 0.761374 | 0 |
The proposed style key for the cell. Used for recycling the cell. | get styleKey() {
return this.i.styleKey;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GetKeyCodeStyle(styleCode, styleSize, styleColor, revNo) {\n\n CreateGridOpsDetail(styleCode, styleSize, styleColor, revNo);\n\n //Reload girdview Ops \n var data = CreateObjStyleKeyCode(styleCode, styleSize, styleColor, revNo);\n //ReloadJqGrid(gridOpsTableName, data);\n ReloadJqGrid2LoC... | [
"0.6366052",
"0.61001116",
"0.6029855",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5970491",
"0.5940129",
"0.58859897",
"0.58859897",
"0.58859897",
"0.57879937",
"0.5768115",
"0.5767304",
"0.5607997"... | 0.768123 | 0 |
The resolved value for the cell. | get resolvedValue() {
return this.i.resolvedValue;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function $rt_getCellVal(cell)\n{\n var word = $rt_cell_get_word(cell);\n var type = $rt_cell_get_tag(cell);\n\n //print('getCellVal: ' + $ir_make_value(word, 0));\n\n return $ir_make_value(word, type);\n}",
"function cellValue(cell) {\n return Number(cell.value);\n}",
"getValue() { return this._... | [
"0.6791647",
"0.6725086",
"0.66747457",
"0.6545068",
"0.6499907",
"0.6453321",
"0.6381406",
"0.6368006",
"0.63477427",
"0.63190514",
"0.63102484",
"0.6253231",
"0.6176246",
"0.615544",
"0.61537796",
"0.60778576",
"0.60105354",
"0.60015535",
"0.60015535",
"0.60015535",
"0.6001... | 0.7388391 | 0 |
The row number for the cell. | get rowNumber() {
return this.i.rowNumber;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"$rowToRowIndex(row) {\n for (var i = 0; i < this.lines.getLength(); i++){\n var cell = this.lines.get(i);\n if (cell.row == row)\n return i;\n }\n\n return null;\n }",
"getRow() {\n\t\treturn this.x;\n\t}",
"function getMouseRow() {\n return Math.fl... | [
"0.73171383",
"0.7102081",
"0.6926991",
"0.6748162",
"0.6740021",
"0.6653571",
"0.66167974",
"0.6602194",
"0.65589696",
"0.6553538",
"0.6533094",
"0.64757645",
"0.6469717",
"0.6458228",
"0.64206463",
"0.6332038",
"0.6317882",
"0.62845606",
"0.6224473",
"0.6194507",
"0.6181631... | 0.74372894 | 0 |
Sends an API request to validate the lot number that the user gives | function validateLotNum(lotNum) {
const body = { lotNum: lotNum };
let validateLotNumURL = SERVICE_URL + "validatelotnum?lot_num=" + lotNum;
// POST
fetch(validateLotNumURL, {
method: "POST",
mode: "no-cors",
})
.then(function (response) {
return response.text();
})
.then(function (... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function submitRequest() {\n const word = document.getElementById(\"word\").value.toLowerCase().trim();\n if (word && isNaN(word)) {\n const xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", endpoint + word, true);\n xhttp.send();\n xhttp.onreadystatechange = function() {\n ... | [
"0.5638813",
"0.56055963",
"0.5534973",
"0.5516244",
"0.55086035",
"0.54254425",
"0.5421475",
"0.5374149",
"0.53664845",
"0.53292197",
"0.53076446",
"0.5295959",
"0.5279353",
"0.5272932",
"0.52701247",
"0.5255805",
"0.52459085",
"0.5218709",
"0.51765275",
"0.5166181",
"0.5165... | 0.7875324 | 0 |
Sync the per page values from the query string. | initializePerPageFromQueryString() {
this.perPage = this.currentPerPage
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"perPageChanged() {\n this.updateQueryString({ [this.perPageParameter]: this.perPage })\n }",
"updateQueryString(val, param) {\n\n val = val + \"\"; //converting to string to remove comparasion bugs\n\n let currentParams = qs.parse(store.getState().router.location.search, { arrayFormat: \"br... | [
"0.67905974",
"0.6425047",
"0.61711365",
"0.60097635",
"0.5935136",
"0.57943046",
"0.57341135",
"0.57193506",
"0.56830114",
"0.5632974",
"0.5632974",
"0.555501",
"0.5552367",
"0.55421954",
"0.55000556",
"0.5431832",
"0.5425003",
"0.53922725",
"0.53342146",
"0.5325477",
"0.527... | 0.6437631 | 1 |
Get the current per page value from the query string. | currentPerPage() {
return parseInt(this.$route.query[this.perPageParameter] || this.perPage)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getPageNumber() {\n const queryString = qs.parse(this.props.location.search, { ignoreQueryPrefix: true });\n return queryString.page || 0;\n }",
"currentPage() {\n return parseInt(this.$route.query[this.pageParameter] || 1)\n }",
"initializePerPageFromQueryString() {\n this.perPage = this.c... | [
"0.69410586",
"0.6507352",
"0.64255756",
"0.6050808",
"0.6030416",
"0.6018978",
"0.593358",
"0.58884215",
"0.5791872",
"0.57138556",
"0.57134384",
"0.5713032",
"0.5666055",
"0.5636206",
"0.5633797",
"0.5581036",
"0.5578499",
"0.5497837",
"0.5482665",
"0.5468361",
"0.54557866"... | 0.73367614 | 0 |
Changes a "Start" button into a "Stop" button | function startToStop(StartStopButton) {
// change inner text to "Stop"
StartStopButton.innerText = "Stop";
StartStopButton.classList.remove("start");
StartStopButton.classList.add("stop");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startStop() {\n startButton.className = \"custombutton\";\t\t// revert to default color after first press\n running = !running;\n if (running) {\n startButton.innerHTML = \"Pause\";\n resetStepsPerSec();\n simulate();\n } else {\n startButton.innerHTML = \"Resume\";... | [
"0.82798284",
"0.80609125",
"0.78221756",
"0.77910846",
"0.77675056",
"0.7746391",
"0.7691777",
"0.7535332",
"0.7526014",
"0.7522015",
"0.75186914",
"0.7489495",
"0.7433563",
"0.7355835",
"0.7295588",
"0.7289856",
"0.72568685",
"0.7241083",
"0.720813",
"0.7194304",
"0.718614"... | 0.80675995 | 1 |
Random Fetch Function that will fetch a random picture or video from APOD | async function randPicture() {
fullURL = `${baseURL}&count=1`;
const resp = await fetch(fullURL);
const rJson = await resp.json();
displayRandom(rJson);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"async function getRandomDogImage1() {\n\tlet response = await fetch('https://dog.ceo/api/breeds/image/random');\n\tvalue = await response.json();\n\tconsole.log(value.message);\n}",
"async function randomCatPhoto() {\n try {\n let response = await fetch('https://api.thecatapi.com/v1/images/search');\n let... | [
"0.7298952",
"0.71012694",
"0.7054751",
"0.70512253",
"0.703421",
"0.6935982",
"0.6860926",
"0.6841505",
"0.6816624",
"0.6717968",
"0.66747266",
"0.6659908",
"0.6641307",
"0.66282094",
"0.65651345",
"0.6558264",
"0.654071",
"0.6521765",
"0.6489693",
"0.6487591",
"0.6482726",
... | 0.7947238 | 0 |
Are the selection start and end outside a table. | function isSelectionOutOfTable(opts: Options, editor): boolean {
const {value} = editor;
const {selection} = value;
if (!selection.start.key) return false;
const startPosition = TablePosition.create(opts, value.document, selection.start.key);
const endPosition = TablePosition.create(opts, value.do... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function isSelectionOutOfTable(opts, value) {\n if (!value.selection.startKey) return false;\n\n var startKey = value.startKey,\n endKey = value.endKey;\n\n\n var startPosition = _TablePosition2.default.create(opts, value.document, startKey);\n var endPosition = _TablePosition2.default.create(opts, value.... | [
"0.7638444",
"0.7267376",
"0.70946723",
"0.7058435",
"0.6994096",
"0.6990898",
"0.63174427",
"0.62904555",
"0.6278102",
"0.5991365",
"0.5991224",
"0.587415",
"0.5865549",
"0.58391243",
"0.5824696",
"0.58196163",
"0.5754702",
"0.5657406",
"0.5652133",
"0.56308687",
"0.56281924... | 0.76483345 | 0 |
FUNCIONES LOCALSTORAGE Recibo la "lista" que quiero gurdar en el local storage y el "nombre" con el que voy a guardar | function guardar_localStorage(lista, nombre) {
localStorage.setItem(nombre, JSON.stringify(lista));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function sincronizarStorage(){\n localStorage.setItem('carrito', JSON.stringify(listaCarrito));\n}",
"function guardarListado(cargarDatos) {\n localStorage.setItem(\"cargarDatos\", JSON.stringify(cargarDatos));\n mostrarListado(cargarDatos);\n}",
"function saveListaReservasGrupo(lista) {\n var lis... | [
"0.75865316",
"0.75143695",
"0.7350049",
"0.7281834",
"0.7278079",
"0.7189461",
"0.71655476",
"0.7165134",
"0.71493334",
"0.7145733",
"0.7143106",
"0.71417135",
"0.71187085",
"0.7110261",
"0.7099186",
"0.708907",
"0.7073268",
"0.706554",
"0.7063338",
"0.7055153",
"0.7054539",... | 0.80007654 | 0 |
Indicates whether Change in dropdown selected option was due to a Manual Click or due to System properties of dropdown. vSelectChange_A = 'MANUAL_CLICK' indicates that the jump to a noneditable option in the dropdown was due to a Manual click (i.e.,changed on purpose by user). vSelectChange_A = 'AUTO_SYSTEM' indicates ... | function fnChangeHandler_A(getdropdown)
{
// fnSanityCheck(getdropdown);
vPreviousSelectIndex_A = vSelectIndex_A;
// Contains the Previously Selected Index
vSelectIndex_A = getdropdown.options.selectedIndex;
// Contains the Currently Selected Index
if ((vP... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function fnChangeHandler_A(getdropdown)\n{\n fnSanityCheck(getdropdown);\n \n vPreviousSelectIndex_A = vSelectIndex_A;\n // Contains the Previously Selected Index\n \n vSelectIndex_A = getdropdown.options.selectedIndex;\n // Contains the Currently Selected Index\n \n if ((vPreviousSelect... | [
"0.69533885",
"0.619542",
"0.58305615",
"0.5429972",
"0.5421579",
"0.54102695",
"0.5386865",
"0.5376809",
"0.5366918",
"0.5365765",
"0.53578556",
"0.5334666",
"0.53057784",
"0.5277417",
"0.521176",
"0.51945233",
"0.5184414",
"0.51746494",
"0.5154313",
"0.5151598",
"0.50957376... | 0.69027036 | 1 |
function to set the Saturday Shipment Flag checkbox Value. | function chkSatShip(){
if(document.getElementById("chkSatShipment123").checked)
{
document.getElementById("chkSatShipment123").value="Y";
document.getElementById("chkSatShipmentHidden").value="Y";
}
else{
document.getElementById("chkSatShipment123").... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setShipped(){\n\tvar thecheckbox=getObjectFromID(\"statusShipped\");\n\tvar thedate=getObjectFromID(\"shippeddate\");\n\n\tif(thecheckbox){\n\t\tif(thecheckbox.checked && thecheckbox.disabled==false && thedate.value==\"\") {\n\t\t\tvar currentdate= new Date();\n\t\t\tthedate.value=(currentdate.getMonth()+... | [
"0.6262399",
"0.5868194",
"0.58595574",
"0.5770931",
"0.54522103",
"0.54314953",
"0.54293996",
"0.5426332",
"0.5414737",
"0.5411437",
"0.5395861",
"0.5382409",
"0.5338843",
"0.5330643",
"0.5325731",
"0.5305398",
"0.5304914",
"0.5279937",
"0.52755624",
"0.52723247",
"0.5230245... | 0.69057053 | 0 |
below ajax call added by Jagadish to generate ordernumber when intl popup is opened. | function getOrderNumber(fsFlag){
var clientId = document.getElementById("clientIdHid").value;
var xmlHttp;
try
{ // Firefox, Opera 8.0+, Safari
xmlHttp=new XMLHttpRequest();
}
catch (e)
{ // Internet Explorer
try
{ ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function imCGetOrderNo() {\n\tvar dToday = new Date(); //fecha de hoy\n\tvar sOrderNumber = (dToday.getFullYear() + \"\").substring(2,4) + (1+dToday.getMonth()) + dToday.getDate() + \"-\" + dToday.getHours() + dToday.getMinutes() + dToday.getSeconds();\n\timSetCookie(\"imOrderNumber\",sOrderNumber,imExpireDays);\n... | [
"0.6508989",
"0.6280511",
"0.6042424",
"0.5982619",
"0.5785709",
"0.57720184",
"0.5724543",
"0.56997347",
"0.56917584",
"0.5657315",
"0.5621749",
"0.5583225",
"0.5541317",
"0.55393827",
"0.5518202",
"0.5462928",
"0.54520696",
"0.54180855",
"0.5393625",
"0.5390366",
"0.5385656... | 0.70249194 | 0 |
highlight the current glyph | function clicking_glyph(){
// get inst_glyph name: cylph_ChEA
inst_glyph = d3.select(this).attr('id');
console.log('inside clicking glyph function' );
// clear all highlight rects
// remove highlight from all squares
d3.selectAll('.highlight_gmt')
.style('stroke','white')
// set the current glyph ... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function highlightSelectedText(key=0){}",
"function addHighlight (){\n $(this).css('color', HighlightColor);\n}",
"function highlight() {\r\n for (var i = 0; i < wordsInSpan.length; i++) {\r\n if (\r\n wordsInSpan[i].getAttribute(\"middleOffset\") >=\r\n lineOffsetsTop[index] &... | [
"0.65648717",
"0.65343046",
"0.6431873",
"0.6425576",
"0.6392552",
"0.63375634",
"0.6335801",
"0.62968785",
"0.6256986",
"0.6216854",
"0.621307",
"0.6211787",
"0.6165299",
"0.61326873",
"0.6131848",
"0.6130835",
"0.6125007",
"0.61121935",
"0.6092084",
"0.6047514",
"0.6038211"... | 0.67237735 | 0 |
reorder rows with column click | function reorder_click_col(d,i){
// get inst col (term)
inst_term = d3.select(this).select('text').attr('full_name')
// add outline
d3.selectAll('.col_label_text').select('rect').style('stroke-width',0)
d3.select(this).select('rect').style('stroke','black').style('stroke-width',1);
// set font to bold
... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_reorderRows(){const body=this.$.items;const items=body.querySelectorAll('tr');if(!items.length){return;}const adjustedVirtualStart=this._virtualStart+this._vidxOffset;// Which row to use as a target?\nconst targetRow=this._rowWithFocusedElement||Array.from(items).filter(row=>!row.hidden)[0];if(!targetRow){// All ... | [
"0.7092593",
"0.6913292",
"0.67814225",
"0.6775712",
"0.6582376",
"0.6557305",
"0.6471388",
"0.6448705",
"0.64042896",
"0.6393123",
"0.635085",
"0.6328143",
"0.63054025",
"0.6301559",
"0.62666696",
"0.6258719",
"0.6254239",
"0.62351483",
"0.622586",
"0.62053794",
"0.6185329",... | 0.70524776 | 1 |
return to previous enrichrgram | function return_prev_enrichrgram(){
console.log('return to previous enrichrgram')
// toggle sidebar to make more space for visualization
d3.select('#wrapper').attr('class','toggled');
// remove clustergram components
d3.select('#clustergram_container').style('display','block');
d3.select('#clust_instruc... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function previousStep() {\n saveClaim();\n reverseStep();\n }",
"function getWordBack(nextWordUpdated){\n nextWord = nextWordUpdated;\n \n callback();}",
"previous() {\n\n\t}",
"previous() {\n this.resetGraph();\n this.setState({\n index: (this.state.index -= 1),\... | [
"0.59899265",
"0.5965928",
"0.57028115",
"0.5669389",
"0.5658686",
"0.56133384",
"0.56113863",
"0.56042427",
"0.5604051",
"0.5558784",
"0.5525662",
"0.5525662",
"0.55140764",
"0.5487162",
"0.5482972",
"0.54488325",
"0.54453",
"0.5424019",
"0.53891134",
"0.53736067",
"0.537119... | 0.6764015 | 0 |
Uses combinatorics to test the behavior of a test function by comparing it to the expected behavior (defined by a reference function) for a large number of possible input values. First generates test cases by taking the cartesian product of the given values. Each test case is a set of N values corresponding to the N ar... | function testCombinatoriallyWithReferenceFuncAsync(name, referenceFuncAsync, testFuncAsync, allValues) {
return __awaiter(this, void 0, void 0, function () {
var testCases, counter;
var _this = this;
return __generator(this, function (_a) {
testCases = combinatorics.cartesianProd... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function oracle(f){\n let numTests = 20; // Change this to some reasonably large value\n for (let i = 0; i < numTests; ++i) {\n let n = 6; // Change this to some reasonable size\n let companies = generateInput(n);\n let candidates = generateInput(n);\n let hires = f(companies, candidates);\n test(... | [
"0.59177846",
"0.5905707",
"0.5903582",
"0.5885522",
"0.5880995",
"0.5880995",
"0.5880995",
"0.5880995",
"0.5865875",
"0.5863326",
"0.58530015",
"0.5776933",
"0.57548934",
"0.5728075",
"0.57098836",
"0.5686934",
"0.56781983",
"0.5655108",
"0.5558865",
"0.5553376",
"0.55439264... | 0.70774925 | 0 |
Function to create button for each feeling | function createFeelingButtons() {
// Clearing buttonsArea each time this function runs otherwise all the buttons will be created repeatedly
$("#buttonsArea").empty();
// Looping through feelingArray, then dynamicaly generating buttons for each feeling in the array, and then append the buttons in #buttonsArea
fo... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renderButton() {\n // Deleting the Aquatic buttons prior to adding new Aquatic buttons(this is necessary otherwise we will have repeat buttons)\n $(\"#aquatic-view\").empty();\n //looping through the array of Aquatic Animals\n for (var i = 0; i < topics.length; i++) {\n // Then dynamicaly... | [
"0.7210484",
"0.70872754",
"0.70231545",
"0.69722474",
"0.68366957",
"0.6803613",
"0.6786221",
"0.6755541",
"0.67440367",
"0.6724374",
"0.6722007",
"0.6718378",
"0.6714197",
"0.669365",
"0.6693365",
"0.66926193",
"0.66920364",
"0.6690563",
"0.66752476",
"0.6666533",
"0.66654"... | 0.77992773 | 0 |
Select a different peer to use as a wallet service. | selectService (servicePeers, flags) {
try {
const chosenPeer = flags.select
// Loop through the available wallet service peers.
for (let i = 0; i < servicePeers.length; i++) {
const thisPeer = servicePeers[i]
// If the chosen ID is found in the list, select it.
if (thisPe... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_dialPeer (peer, callback) {\n // Attempt Bitswap 1.1.0\n this.libp2p.dial(peer, BITSWAP110, (err, conn) => {\n if (err) {\n // Attempt Bitswap 1.0.0\n this.libp2p.dial(peer, BITSWAP100, (err, conn) => {\n if (err) { return callback(err) }\n\n callback(null, conn, BITSWAP... | [
"0.59787977",
"0.59787977",
"0.58157504",
"0.5767992",
"0.5705639",
"0.5705639",
"0.5633786",
"0.5632115",
"0.5618897",
"0.55424774",
"0.5522302",
"0.54872966",
"0.5346193",
"0.53258175",
"0.5304658",
"0.5295966",
"0.52726775",
"0.5241891",
"0.5227693",
"0.520505",
"0.519756"... | 0.71232295 | 0 |
function that creates a block param x > the xPosition to drop the element param y > the yPosition to drop the element param name > the Class name of this object | function createBlock(x, y, name) {
// alert("x: " + x + "\ny: " + y);
var e = document.createElement("div");
e.className = name;
e.value = 0;
e.style.left = x + "px";
e.style.top = y + "px";
e.style.height = 10 + "px";
e.style.width = 10 + "px";
document.getElementById("game-area").appendChild(e);... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(x, y, block, width = 100, height = 170) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.block = block;\n }",
"place(x, y){\n this.x = x;\n this.y = y;\n }",
"place(x, y){\n this.x = x;\n this.y = y;\n }",
"function addBlock(prototyp... | [
"0.6748179",
"0.6279262",
"0.6279262",
"0.62728596",
"0.61965036",
"0.60471004",
"0.600056",
"0.59517384",
"0.59503293",
"0.59465605",
"0.59159416",
"0.5910866",
"0.5876408",
"0.5873405",
"0.58636546",
"0.586181",
"0.58033216",
"0.5781427",
"0.5771518",
"0.575288",
"0.5751844... | 0.7091846 | 0 |
Selects a new variant matching selected options. If there is no such variant, resets all options below and selects the first available variant. | onOptionSelected(option) {
const product = this.props.item;
const oldVariant = this.state.variant;
const selectedValues = getValuesForVariant(oldVariant);
selectedValues[option.name] = option.value;
let newVariant = _.find(product.variants, (variant) => {
return _.isEqual(getValuesForVarian... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setSelected(index){\n\t_selected = _product.variants[index];\n}",
"updateSelectedVariant() {\n this.recompute = Math.random();\n }",
"select() {\n if (this.timeUpdateSeconds) {\n this.pick(new SimplePRNG().seedByTime(this.timeUpdateSeconds).nextFloat());\n } else {\n this.pick(... | [
"0.6657763",
"0.65933394",
"0.61603016",
"0.60489273",
"0.60423523",
"0.60217106",
"0.5990578",
"0.5942185",
"0.59114105",
"0.5865828",
"0.5733137",
"0.57224894",
"0.57068443",
"0.5679754",
"0.5673833",
"0.5673062",
"0.5664115",
"0.56560796",
"0.56225884",
"0.5606818",
"0.559... | 0.7193684 | 0 |
Checks and removes the available (idle) clients that have timed out. | function removeIdle() {
var now = new Date().getTime(),
i, tr=0,length=aliveClients.length,
removeby = factory.removeby,
client,
timeout;
removeIdleScheduled = false;
// Go through the available (idle) items,
// check if they have timed out
now = now - idleTimeoutM... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"_pruneClients () {\n if (this._destroyed) return\n const now = Date.now()\n for (let [zmqid, ref] of this._clients.entries()) {\n if (now - ref.last > 3000) {\n this.emit('clientRemove', zmqid)\n this._clients.delete(zmqid)\n }\n }\n }",
"function purgeOldConnections() {\n ... | [
"0.6917792",
"0.66444206",
"0.66256124",
"0.64757",
"0.6309572",
"0.623587",
"0.6169575",
"0.6130531",
"0.6076612",
"0.6053847",
"0.60518026",
"0.60359657",
"0.60252184",
"0.596195",
"0.5873401",
"0.5793762",
"0.57490337",
"0.56785136",
"0.5671152",
"0.5664679",
"0.5634414",
... | 0.7434381 | 0 |
Schedule removal of idle items in the pool. More schedules cannot run concurrently. | function scheduleRemoveIdle() {
if (!removeIdleScheduled) {
removeIdleScheduled = true;
removeIdleTimer = setTimeout(removeIdle, reapInterval);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function removeIdle() {\n var now = new Date().getTime(),\n i, tr=0,length=aliveClients.length,\n removeby = factory.removeby,\n client,\n timeout;\n removeIdleScheduled = false;\n // Go through the available (idle) items,\n // check if they have timed out\n now = now ... | [
"0.66370296",
"0.58775634",
"0.5799868",
"0.5634436",
"0.561353",
"0.55938166",
"0.5388432",
"0.5388432",
"0.53769296",
"0.5372637",
"0.5364988",
"0.5329655",
"0.5282939",
"0.5278771",
"0.526922",
"0.5252028",
"0.5229311",
"0.5229311",
"0.5229311",
"0.5229311",
"0.5229311",
... | 0.76937103 | 0 |
se valida si el enemigo esta vivo y asi se pinta su imagen | validarVivo(){
if(this.vivo==true){
image(imgEnemigo,this.x, this.y, this.ancho, this.largo);
this.move();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function validarImg(archivo){\n\n var file = fileValidation(archivo,1);\n var error = 0;\n if(file == 1){\n error = 1;\n }else{\n if($('#carga').length || facetasCA > 2){\n $('#btnDescargarHV').val('cargada');\n Swal.fire({ \n html: 'Imagen cargada',\n imageUrl: $('#puerto_ho... | [
"0.66754574",
"0.6633425",
"0.66295743",
"0.63216954",
"0.6114682",
"0.6096776",
"0.6079359",
"0.6036315",
"0.59912854",
"0.5975813",
"0.59455323",
"0.5924684",
"0.5920328",
"0.5897886",
"0.58921885",
"0.5805603",
"0.5797037",
"0.5793051",
"0.5779375",
"0.5762916",
"0.5713395... | 0.75453573 | 0 |
da el valor el valor de vivo | getVivo(){
return this.vivo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"setVivo(vivo){\r\n this.vivo=vivo;\r\n }",
"function moverAtras () {\n\n //console.log(rango_tiempo.value);\n var tiempo= parseFloat(rango_tiempo.value);\n tiempo = tiempo - 0.99;\n rango_tiempo.value = tiempo;\n video.currentTime = tiempo;\n ... | [
"0.66587573",
"0.6458822",
"0.6426478",
"0.64160377",
"0.6271988",
"0.61039525",
"0.6013043",
"0.5971568",
"0.59675556",
"0.59398985",
"0.59317213",
"0.5821639",
"0.57561886",
"0.5747634",
"0.5726398",
"0.56843364",
"0.56794506",
"0.56727916",
"0.5620909",
"0.5614857",
"0.556... | 0.6985162 | 0 |
se cambia el valor de la variable "vivo" | setVivo(vivo){
this.vivo=vivo;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"getVivo(){\r\n return this.vivo;\r\n }",
"function verVegano(){\n var v = p.filtrarVegano();\n p.dibujarSurtido(v);\n}",
"validarVivo(){\r\n if(this.vivo==true){\r\n image(imgEnemigo,this.x, this.y, this.ancho, this.largo);\r\n this.move();\r\n }\r\n }",
"fu... | [
"0.7127763",
"0.65645117",
"0.6537841",
"0.6255497",
"0.61210185",
"0.6083169",
"0.6058499",
"0.60555005",
"0.6044889",
"0.6023393",
"0.5973188",
"0.59363574",
"0.589217",
"0.58731896",
"0.5834302",
"0.5782625",
"0.5771787",
"0.5695714",
"0.56428784",
"0.56296074",
"0.5608925... | 0.76044476 | 0 |
wraps a Vuex function's to Mutation.commit() function so it's signature looks like a Redux call to dispatch | function VeuxWrapper(vuexDispatch) {
/** vuex wrapped redux dispatch function */
return async (reduxAction) => {
const type = reduxAction.type;
delete reduxAction.type;
return vuexDispatch(type, reduxAction);
};
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"sampleCallToOtherAction({ dispatch, commit }) {\n dispatch('sampleAction');\n // With params\n // NOTE dispatch returns a promise. To additional work, you must use .then()\n dispatch('sampleActionWithParmas', { param1, param2 });\n }",
"static _commit(method, payload) {\n const { namespace, sto... | [
"0.6640528",
"0.6357543",
"0.6341574",
"0.6260499",
"0.6259485",
"0.60489714",
"0.59612334",
"0.59573925",
"0.5948176",
"0.5800313",
"0.5700723",
"0.56736016",
"0.5601487",
"0.5586305",
"0.55385333",
"0.55162513",
"0.55039656",
"0.546093",
"0.5423185",
"0.54010165",
"0.540078... | 0.65487087 | 1 |
The TA constructor sets default values and instantiates a GradeBook. | function TA() {
this.target = null;
this.gradebook = new GradeBook();
this.operations = [];
this.gradeOpposite = false;
this.picky = false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"constructor(firstName, lastName, year, tardy) {\n // when a new student is created, assign these properties\n this.firstName = firstName;\n this.lastName = lastName;\n this.year = year\n this.tardy = 0\n this.scores = []\n }",
"constructor(name, last, age, gender, cla... | [
"0.6012011",
"0.5464852",
"0.54372716",
"0.53027433",
"0.5302576",
"0.5302576",
"0.5300652",
"0.52890915",
"0.5277749",
"0.52447796",
"0.5210613",
"0.52023846",
"0.5200847",
"0.5200847",
"0.51974297",
"0.519733",
"0.51796764",
"0.5173909",
"0.51725465",
"0.51673853",
"0.51662... | 0.7737449 | 0 |
This method begin the storing process for GeoZone. | function storeGeozone() {
geozoneLog.info('Beginning storage of Geozones')
if(geozoneList.length == 0){
geozoneLog.alert('List of Geozone Empty...');
}
else {
geozoneLog.info('Initializing Geozones Storage. ' + geozoneList.length + ' Geozones to be store');
geozoneStorage.init(geozoneList, mongo, onPer... | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onPersistingGeozone() {\n\t\tgeozoneLog.info('Persisting Geozones');\n\t\tgeozoneStorage.persistGeozone(onClassification);\n\t}",
"function persistClassification() {\n\t\tif(classifiedList.length == 0) {\n\t\t\tgeozoneLog.alert('The classification list is Empty');\n\t\t}\n\t\telse {\n\t\t\tgeozoneLog.in... | [
"0.78045464",
"0.5987815",
"0.58893377",
"0.5799963",
"0.5798452",
"0.57412326",
"0.5693144",
"0.5664907",
"0.55739516",
"0.55697155",
"0.55667144",
"0.5531017",
"0.5489962",
"0.5465435",
"0.5446833",
"0.54240704",
"0.5288048",
"0.5287807",
"0.5281533",
"0.5263738",
"0.524844... | 0.8083591 | 0 |
THis method persist the classification for the Geozones. | function persistClassification() {
if(classifiedList.length == 0) {
geozoneLog.alert('The classification list is Empty');
}
else {
geozoneLog.info('Initializing Classification for Geozones');
geozoneStorage.persistClassification(classifiedList, onFinish)
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function onPersistingGeozone() {\n\t\tgeozoneLog.info('Persisting Geozones');\n\t\tgeozoneStorage.persistGeozone(onClassification);\n\t}",
"function storeGeozone() {\n\t\tgeozoneLog.info('Beginning storage of Geozones')\n\t\tif(geozoneList.length == 0){\n\t\t\tgeozoneLog.alert('List of Geozone Empty...');\n\t\t}... | [
"0.7744925",
"0.6204036",
"0.6156799",
"0.5462678",
"0.54507595",
"0.54507595",
"0.5284064",
"0.5283582",
"0.5242508",
"0.5225532",
"0.5220028",
"0.5112086",
"0.49517477",
"0.49456257",
"0.49428236",
"0.4893712",
"0.487489",
"0.48675996",
"0.4861647",
"0.48492336",
"0.4819908... | 0.81088233 | 0 |
This callback function persisting the Gezones. | function onPersistingGeozone() {
geozoneLog.info('Persisting Geozones');
geozoneStorage.persistGeozone(onClassification);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function storeGeozone() {\n\t\tgeozoneLog.info('Beginning storage of Geozones')\n\t\tif(geozoneList.length == 0){\n\t\t\tgeozoneLog.alert('List of Geozone Empty...');\n\t\t}\n\t\telse {\n\t\t\tgeozoneLog.info('Initializing Geozones Storage. ' + geozoneList.length + ' Geozones to be store');\n\t\t\tgeozoneStorage.i... | [
"0.7662169",
"0.688679",
"0.6415245",
"0.63497454",
"0.6155591",
"0.6155341",
"0.6015593",
"0.60061234",
"0.600574",
"0.60046405",
"0.5990393",
"0.5909561",
"0.5879274",
"0.5861822",
"0.58396816",
"0.58170563",
"0.57836884",
"0.5782547",
"0.5689953",
"0.5592112",
"0.5587546",... | 0.81043357 | 0 |
This callback function initialize the classification of the Geozones. | function onClassification() {
geozoneLog.info('Initializing Geozone Classifier');
onStorageComplete();
//classifier.init(geozoneList, geozoneList.length, onStorageComplete);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function initClusterRegions(){\n \n // JQuery Reference to Regions tree html element\n referenceToRegionsTreeElement = $(\"#\"+regionsTreeElementName);\n \n // Initialize zTree with empty data\n $.fn.zTree.init(referenceToRegionsTreeElement, regionTreeConfigs, []);\n setCheck(regionsTreeElementName);\n $(\... | [
"0.6454067",
"0.61627275",
"0.5964561",
"0.5933014",
"0.59151906",
"0.59043264",
"0.5903104",
"0.5859702",
"0.5804927",
"0.5772547",
"0.57573915",
"0.57350343",
"0.5693615",
"0.56649506",
"0.56410253",
"0.5631876",
"0.56182534",
"0.56103736",
"0.5581903",
"0.5573375",
"0.5557... | 0.72391963 | 0 |
Decorates a tapelike function with a beforeEach hook. | function addBeforeEach (tape, beforeFn) {
function test (subname, fn) {
tape(subname, function (t, next) {
invokeTest(beforeFn, t, function (err) {
if (err) return next(err)
invokeTest(fn, t, next)
})
})
}
return assign(test, tape)
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"runAllBeforeEach() {\n var hooksToRun = [];\n var currentSuite = this;\n\n while (currentSuite !== undefined) {\n hooksToRun = currentSuite.beforeEachHooks.concat(hooksToRun); // take the current hooks and put them at the beginning of the array\n\n currentSuite = currentSuite.parentSuite;\n }... | [
"0.56922835",
"0.560247",
"0.55453867",
"0.5540182",
"0.5462756",
"0.54149085",
"0.5407367",
"0.5396481",
"0.5395591",
"0.53323096",
"0.5326124",
"0.5305907",
"0.5221811",
"0.5214487",
"0.5214487",
"0.5214487",
"0.5214487",
"0.5214487",
"0.5210739",
"0.5209765",
"0.5209765",
... | 0.7430837 | 0 |
gridlines in y axis function | function make_y_gridlines() {
return d3.axisLeft(obj.y)
.tickValues([0, 0.5, 1])
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function make_y_gridlines() {\n return d3.axisLeft(y).ticks(10);\n }",
"function make_y_gridlines() {\n return d3.axisLeft(y).ticks(5);\n }",
"function make_y_gridlines() {\n\t\t\t\t\treturn d3.axisLeft(y)\n\t\t\t\t\t\t.ticks(5);\n\t\t\t\t}",
"function make_y_gridlines() {\n retu... | [
"0.85522115",
"0.85201913",
"0.8518593",
"0.85093045",
"0.84916735",
"0.84916735",
"0.8478009",
"0.84714633",
"0.8469625",
"0.8442365",
"0.8439023",
"0.8422249",
"0.8354441",
"0.8332418",
"0.8321429",
"0.829338",
"0.8270376",
"0.82681584",
"0.82657045",
"0.82657045",
"0.82657... | 0.86087185 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.