This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function primeFactors(n){ | |
var list = []; | |
var maxi=9999999; | |
var maxk=99; | |
for(var i=2;n>1;i++){ | |
var m = null; | |
for(var k=1;;k++){ | |
var d = n/Math.pow(i,k); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function queueTime(customers, n) { | |
var sorted = customers.sort((a,b)=>b-a); | |
var max = Math.max(...sorted); | |
var tills = Array(n).fill(0); | |
while(sorted.length>0){ | |
for(var i=0;i<n && i<sorted.length;i++) | |
{ | |
tills[i] += sorted.shift(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export class FrameQueue { | |
constructor(method) { | |
this.queue = []; | |
this.method = method; | |
this.ondone = null; | |
} | |
add() { | |
this.queue.push(this._f.apply(this, arguments)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _avg(x){ | |
return x.reduce((a,b) => a+b,0)/x.length; | |
} | |
function _avgK(x, k){ | |
var N = x.length; | |
var Nk = N-k; | |
return x.slice(0, Nk).reduce((a,b) => a+b,0)/Nk; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "babel-eslint", | |
"rules": { | |
"comma-dangle": [1, "never"], | |
"no-cond-assign": 1, | |
"no-console": 1, | |
"no-constant-condition": 1, | |
"sort-imports": "warn", | |
"no-duplicate-imports": "warn", | |
"no-control-regex": 1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
delegate Color pixelMap(Color c); | |
delegate void pixelEach(Color c); | |
abstract class MyBitmap | |
{ | |
protected Bitmap bmp; | |
public abstract Color getPixel(int x, int y); | |
public abstract void setPixel(int x, int y, Color color); | |
public abstract void Save(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AssociationRules = function(transactions, MIN_SUPPORT, MAX_COMBINATION) { | |
var getOptions = function(data) { | |
var set = new Set(); | |
data.map(function(el) { | |
el.map(function(val) { | |
if (val != null) | |
set.add(val); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var head = ['Різновидність лісових угідь', 'Різновид вологості ґрунту', 'Температура повітря ', 'Рівень пожежної безпеки']; | |
var data = [ | |
['Листові', 'Низька', '20', '1'], | |
['Листові', 'Низька', '30', '3'], | |
['Листові', 'Низька', '40', '5'], | |
['Листові', 'Середня', '20', '1'], | |
['Листові', 'Середня', '30', '2'], | |
['Листові', 'Середня', '40', '4'], | |
['Листові', 'Висока', '20', '1'], | |
['Листові', 'Висока', '30', '3'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function table2js(t) | |
local type = type(t) | |
if type == "number" or type == "string" then | |
return t | |
end | |
if not (t[1] == nil) then -- check "t" is array | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <iostream> | |
#include <ctime> | |
#include <math.h> | |
#include <fstream> | |
#include <opencv2/core.hpp> | |
#include <opencv2/features2d.hpp> | |
#include <opencv2/xfeatures2d.hpp> | |
#include <opencv2/highgui.hpp> |