Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
try splitting polygon into two and triangulate them independently
function splitEarcut(start, triangles, dim, minX, minY, size) { // look for a valid diagonal that divides the polygon into two var a = start; do { var b = a.next.next; while (b !== a.prev) { if (a.i !== b.i && isValidDiagonal(a, b)) { // split the polygon in two b...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "splitPolygon(polygon, coplanarFront, coplanarBack, front, back) {\n const COPLANAR = 0;\n const FRONT = 1;\n const BACK = 2;\n const SPANNING = 3;\n\n // tolerance used to decide if a point is on the plane.\n const EPSILON = 1e-5;\n\n // Classify each point as well as the entire polygon into o...
[ "0.70814633", "0.698785", "0.698785", "0.68617296", "0.6860546", "0.6860546", "0.6858765", "0.6853359", "0.6853359", "0.6853359", "0.68464625", "0.6838825", "0.6834908", "0.68137944", "0.68137944", "0.68137944", "0.68137944", "0.68137944", "0.68137944", "0.68137944", "0.68137...
0.0
-1
link every hole into the outer loop, producing a singlering polygon without holes
function eliminateHoles(data, holeIndices, outerNode, dim) { var queue = [], i, len, start, end, list; for (i = 0, len = holeIndices.length; i < len; i++) { start = holeIndices[i] * dim; end = i < len - 1 ? holeIndices[i + 1] * dim : data.length; list = linkedList(data, start, end, ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSideFaces() {\n\n var layeroffset = 0;\n sidewalls( contour, layeroffset );\n layeroffset += contour.length;\n\n for ( h = 0, hl = holes.length; h < hl; h ++ ) {\n\n ahole = holes[ h ];\n sidewalls( ahole, layeroffset );\n\n //, true\n ...
[ "0.67629105", "0.674923", "0.6742919", "0.6736686", "0.67089736", "0.6675653", "0.6639453", "0.6631344", "0.66229093", "0.66229093", "0.66229093", "0.66229093", "0.66229093", "0.66229093", "0.66229093", "0.6577103", "0.6577103", "0.6577103", "0.65092707", "0.6451891", "0.6423...
0.0
-1
find a bridge between vertices that connects hole with an outer ring and and link it
function eliminateHole(hole, outerNode) { outerNode = findHoleBridge(hole, outerNode); if (outerNode) { var b = splitPolygon(outerNode, hole); filterPoints(b, b.next); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findHoleBridge(hole, outerNode) {\n var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m;\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if...
[ "0.745841", "0.7230392", "0.7207667", "0.720253", "0.71914464", "0.71914464", "0.7190305", "0.7190305", "0.7190305", "0.7190305", "0.7183932", "0.7183932", "0.7183932", "0.7183932", "0.7183932", "0.7183932", "0.7183932", "0.7183932", "0.71746624", "0.71746624", "0.71746624", ...
0.541119
92
David Eberly's algorithm for finding a bridge between hole and outer polygon
function findHoleBridge(hole, outerNode) { var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m; // find a segment intersected by a ray from the hole's leftmost point to the left; // segment's endpoint with lesser x will be potential connection point do { if (hy <= p.y...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static findHoleBridge(hole, outerNode) {\n var p = outerNode, hx = hole.x, hy = hole.y, qx = -Infinity, m;\n // find a segment intersected by a ray from the hole's leftmost point to the left;\n // segment's endpoint with lesser x will be potential connection point\n do {\n if...
[ "0.7921552", "0.77569085", "0.7711103", "0.7711103", "0.7711103", "0.7711103", "0.7697737", "0.769584", "0.769584", "0.769584", "0.76944107", "0.76944107", "0.76944107", "0.769017", "0.76640606", "0.76640606", "0.76640606", "0.76640606", "0.76588666", "0.76588666", "0.7653063...
0.7717917
2
interlink polygon nodes in zorder
function indexCurve(start, minX, minY, size) { var p = start; do { if (p.z === null) p.z = zOrder(p.x, p.y, minX, minY, size); p.prevZ = p.prev; p.nextZ = p.next; p = p.next; } while (p !== start); p.prevZ.nextZ = null; p.prevZ = null; sortLinked(p); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PolygonEdge() {\n}", "function splitPolygon(a,b){var a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;a.next=b;b.prev=a;a2.next=an;an.prev=a2;b2.next=a2;a2.prev=b2;bp.next=b2;b2.prev=bp;return b2;}// create a node and optionally link it with previous one (in a circular doubly linked...
[ "0.63875264", "0.6262362", "0.6262362", "0.6150265", "0.6139266", "0.6011681", "0.5892977", "0.587991", "0.5868063", "0.5809951", "0.5806959", "0.58061254", "0.5788573", "0.57833815", "0.57788056", "0.5776105", "0.57730615", "0.57707286", "0.5760508", "0.5740455", "0.57312304...
0.5594775
80
Simon Tatham's linked list merge sort algorithm
function sortLinked(list) { var i, p, q, e, tail, numMerges, pSize, qSize, inSize = 1; do { p = list; list = null; tail = null; numMerges = 0; while (p) { numMerges++; q = p; pSize = 0; for (i = 0; i < inSize; i++) { ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mergeSort(arr, l, r) { \n if (l < r){\n let m = Math.floor(l + (r - l) / 2)\n \n // # Sort first and second halves \n this.mergeSort(arr, l, m); \n this.mergeSort(arr, m + 1, r);\n l = 0 \n tStack.add([...arr])\n this.merge(arr, l, m, r); \n }\n }", "function mergeSortL...
[ "0.74840915", "0.73676324", "0.7320949", "0.7283563", "0.72728264", "0.7267965", "0.72205365", "0.71957916", "0.71957916", "0.71877563", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.7165469", "0.715993...
0.71779156
10
zorder of a point given coords and size of the data bounding box
function zOrder(x, y, minX, minY, size) { // coords are transformed into non-negative 15-bit integer range x = 32767 * (x - minX) / size; y = 32767 * (y - minY) / size; x = (x | (x << 8)) & 0x00FF00FF; x = (x | (x << 4)) & 0x0F0F0F0F; x = (x | (x << 2)) & 0x33333333; x = (x | (x << 1)) & 0x...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function zOrder(x, y, minX, minY, size) {\n // coords are transformed into (0..1000) integer range\n x = 1000 * (x - minX) / size;\n x = (x | (x << 8)) & 0x00FF00FF;\n x = (x | (x << 4)) & 0x0F0F0F0F;\n x = (x | (x << 2)) & 0x33333333;\n x = (x | (x << 1)) & 0x55555555;\n\n y = 1000 * (y - min...
[ "0.7109484", "0.7084138", "0.70720035", "0.70720035", "0.70720035", "0.6927196", "0.6927196", "0.66586345", "0.66000384", "0.65181965", "0.65181965", "0.65181965", "0.65181965", "0.65086293", "0.64623183", "0.64623183", "0.64623183", "0.64623183", "0.64623183", "0.64623183", ...
0.69553196
15
find the leftmost node of a polygon ring
function getLeftmost(start) { var p = start, leftmost = start; do { if (p.x < leftmost.x) leftmost = p; p = p.next; } while (p !== start); return leftmost; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getLeftmost( start ) {\n\n\t\tlet p = start,\n\t\t\tleftmost = start;\n\t\tdo {\n\n\t\t\tif ( p.x < leftmost.x || ( p.x === leftmost.x && p.y < leftmost.y ) ) leftmost = p;\n\t\t\tp = p.next;\n\n\t\t} while ( p !== start );\n\n\t\treturn leftmost;\n\n\t}", "function getLeftmost( start ) {\n\n\tlet p = s...
[ "0.68266124", "0.6802108", "0.670518", "0.66700625", "0.6600989", "0.6600989", "0.6600989", "0.6600989", "0.64736456", "0.64736456", "0.64736456", "0.64561", "0.64357656", "0.64357656", "0.64357656", "0.6354864", "0.6354864", "0.6354864", "0.63443357", "0.63108885", "0.624220...
0.62521416
20
check if a point lies within a convex triangle
function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) { return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "function pointInTriangle( ax, ay, bx, by...
[ "0.79408675", "0.79408675", "0.79408675", "0.79408675", "0.790744", "0.7864595", "0.78597647", "0.78597647", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", "0.78165513", ...
0.78757113
5
check if a diagonal between two polygon nodes is valid (lies in polygon interior)
function isValidDiagonal(a, b) { return equals(a, b) || a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && locallyInside(a, b) && locallyInside(b, a) && middleInside(a, b);\n}", "function isValidDiagonal(a, b) {\n return a.next.i !== b.i && a.prev.i !== b.i && !intersectsPolygon(a, b) && locallyInside(a...
[ "0.7941519", "0.7941519", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.7936672", "0.79196054", "0.79196054", "0.79196054", "0.79196054", "0.79196054", "0.78967124", "0.7863484...
0.76958895
34
signed area of a triangle
function area(p, q, r) { return (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function areaTriangle(base, height){\n return -1;\n }", "function GetSignedArea(vertices) {\n var i;\n var area = 0;\n for (i = 0; i < vertices.length; i++) {\n var j = (i + 1) % vertices.length;\n ...
[ "0.7589358", "0.74907833", "0.7260689", "0.7164047", "0.7130034", "0.71193737", "0.7111032", "0.71096236", "0.7106497", "0.70979875", "0.7097561", "0.7092219", "0.6965255", "0.6940411", "0.694019", "0.6928603", "0.6921013", "0.6919574", "0.6911749", "0.6805691", "0.675121", ...
0.0
-1
check if two points are equal
function equals(p1, p2) { return p1.x === p2.x && p1.y === p2.y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function equalPoints(point1, point2) {\r\n\treturn (point1.x == point2.x) && (point1.y == point2.y)\r\n}", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function pointEq(a, b) {\n ...
[ "0.84533465", "0.82969445", "0.82969445", "0.8197623", "0.8161272", "0.810672", "0.8103976", "0.81015456", "0.80696225", "0.8059547", "0.80462873", "0.7931089", "0.79210013", "0.7817614", "0.7817614", "0.7817614", "0.7817614", "0.7817614", "0.7817614", "0.7817614", "0.7817614...
0.76811147
43
check if two segments intersect
function intersects(p1, q1, p2, q2) { return area(p1, q1, p2) > 0 !== area(p1, q1, q2) > 0 && area(p2, q2, p1) > 0 !== area(p2, q2, q1) > 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect(a, b) {\n return !(\n a.x2 - 1 < b.x1 ||\n a.x1 + 1 > b.x2 ||\n a.y2 - 1 < b.y1 ||\n a.y1 + 1 > b.y2\n );\n}", "function intersect$1(...
[ "0.76514137", "0.76514137", "0.74974775", "0.74961466", "0.74173", "0.73793775", "0.73507667", "0.7234478", "0.7201787", "0.7201787", "0.7198727", "0.7170377", "0.7148786", "0.7115169", "0.7102259", "0.7102259", "0.7102259", "0.7102259", "0.7093632", "0.7022514", "0.6997883",...
0.0
-1
check if a polygon diagonal intersects any polygon segments
function intersectsPolygon(a, b) { var p = a; do { if (p.i !== a.i && p.next.i !== a.i && p.i !== b.i && p.next.i !== b.i && intersects(p, p.next, a, b)) return true; p = p.next; } while (p !== a); return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkSelfIntersection(polygon) {\n if(polygon.CLASS_NAME==\"OpenLayers.Geometry.Polygon\") {\n // checking only outer ring\n var outer = polygon.components[0].components;\n var segments = [];\n for(var i=1;i<outer.length;i++) {\n var segment= new OpenLayers.Geometry.LineString([outer[i-1...
[ "0.701646", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69820464", "0.69793034", "0.69793034", ...
0.69937676
1
check if a polygon diagonal is locally inside the polygon
function locallyInside(a, b) { return area(a.prev, a, a.next) < 0 ? area(a, b, a.next) >= 0 && area(a, a.prev, b) >= 0 : area(a, b, a.prev) < 0 || area(a, a.next, b) < 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_isHole(outterPoly, innerPoly) {\n for(let ptI = 0; ptI < innerPoly.length; ptI++) {\n if(!__WEBPACK_IMPORTED_MODULE_2__utils_mesh_guru__[\"b\" /* contains */](outterPoly, innerPoly[ptI]))\n return false;\n }\n return true;\n }", "function checkSelfIntersection(polygon) {\n if(polygon.CLAS...
[ "0.68249357", "0.6813516", "0.66887826", "0.662254", "0.66117173", "0.65932333", "0.6545789", "0.6487561", "0.64666563", "0.64628255", "0.6442987", "0.63949037", "0.6388141", "0.6349174", "0.6338843", "0.6327357", "0.63221544", "0.63221246", "0.62931633", "0.6291471", "0.6284...
0.0
-1
check if the middle point of a polygon diagonal is inside the polygon
function middleInside(a, b) { var p = a, inside = false, px = (a.x + b.x) / 2, py = (a.y + b.y) / 2; do { if (((p.y > py) !== (p.next.y > py)) && (px < (p.next.x - p.x) * (py - p.y) / (p.next.y - p.y) + p.x)) inside = !inside; p = p.next; } while (p !== a); retur...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInside(point, polygon){\n\tvar x = point.x, y = point.y;\n\tvar inside = false;\n\n\tfor(var i = 0, j = polygon.length - 1; i < polygon.length; j = i++){\n\t\tvar xi = polygon[i].x, yi = polygon[i].y;\n\t\tvar xj = polygon[j].x, yj = polygon[j].y;\n\n\t\tvar intersect = ((yi > y) != (yj > y))\n ...
[ "0.6944773", "0.6889016", "0.6789252", "0.6761726", "0.67564654", "0.6722951", "0.6703374", "0.667202", "0.6611309", "0.6587807", "0.65635073", "0.65153587", "0.6503559", "0.6492312", "0.646077", "0.6455801", "0.6443577", "0.6441927", "0.6441927", "0.6441927", "0.6441927", ...
0.62668216
71
link two polygon vertices with a bridge; if the vertices belong to the same ring, it splits polygon into two; if one belongs to the outer ring and another to a hole, it merges it into a single ring
function splitPolygon(a, b) { var a2 = new Node(a.i, a.x, a.y), b2 = new Node(b.i, b.x, b.y), an = a.next, bp = b.prev; a.next = b; b.prev = a; a2.next = an; an.prev = a2; b2.next = a2; a2.prev = b2; bp.next = b2; b2.prev = bp; return b2; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitPolygon(a,b){var a2=new Node(a.i,a.x,a.y),b2=new Node(b.i,b.x,b.y),an=a.next,bp=b.prev;a.next=b;b.prev=a;a2.next=an;an.prev=a2;b2.next=a2;a2.prev=b2;bp.next=b2;b2.prev=bp;return b2;}// create a node and optionally link it with previous one (in a circular doubly linked list)", "function splitPolygon...
[ "0.7219599", "0.7219599", "0.7166903", "0.70824385", "0.7055436", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", "0.6919274", ...
0.69386184
5
create a node and optionally link it with previous one (in a circular doubly linked list)
function insertNode(i, x, y, last) { var p = new Node(i, x, y); if (!last) { p.prev = p; p.next = p; } else { p.next = last.next; p.prev = last; last.next.prev = p; last.next = p; } return p; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addNodeFront(value) {\n // prev to nothing, next to curr head\n const node = new DoublyNode(value, null, this.head);\n // new first elem\n if (!this.head) {\n // also the tail\n this.tail = node;\n } else {\n // before the head\n this.head.prev = node;\n }\n // either way, ...
[ "0.69267607", "0.6886251", "0.6837633", "0.673565", "0.67104256", "0.67016953", "0.66942555", "0.66000986", "0.65950835", "0.6578142", "0.65719664", "0.6552215", "0.6537864", "0.6534977", "0.65223664", "0.65184915", "0.6518272", "0.65140176", "0.6513742", "0.64982796", "0.645...
0.0
-1
Create a reducing function iterating left or right.
function createReduce(dir) { // Optimized iterator function as using arguments.length // in the main function will deoptimize the, see #1991. function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] :...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static *reduceRight$e(thiz, args, s) {\n\t\tlet l = yield * getLength(thiz);\n\t\tlet acc;\n\t\tlet fx = args[0];\n\n\t\tif ( args.length < 1 || !fx.isCallable ) {\n\t\t\treturn yield CompletionRecord.makeTypeError(s.realm, 'First argument to reduceRight must be a function.');\n\t\t}\n\n\t\tif ( args.length > 1 ) ...
[ "0.69307965", "0.68434834", "0.67686254", "0.62968653", "0.6292559", "0.62247425", "0.6172193", "0.6078777", "0.607583", "0.6016731", "0.60144776", "0.60141987", "0.5947723", "0.59183216", "0.59162104", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.5871401", "0.58714...
0.5778055
27
Optimized iterator function as using arguments.length in the main function will deoptimize the, see 1991.
function iterator(obj, iteratee, memo, keys, index, length) { for (; index >= 0 && index < length; index += dir) { var currentKey = keys ? keys[index] : index; memo = iteratee(memo, obj[currentKey], currentKey, obj); } return memo; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function TestAssignmentToIterator2() {\n var i = 0;\n arguments.__defineGetter__('callee', function(){});\n arguments.__defineGetter__('length', function(){ return 1 });\n arguments[Symbol.iterator] = [].entries;\n for (var entry of arguments) {\n assertEquals([i, arguments[i]], entry);\n i++;\n }\n\n ...
[ "0.6527962", "0.6066208", "0.5999062", "0.591489", "0.58546805", "0.5802807", "0.5767986", "0.57578146", "0.57457936", "0.57436895", "0.57320154", "0.5721297", "0.5700889", "0.5644879", "0.56352806", "0.56041086", "0.5602883", "0.5602458", "0.55890894", "0.55814743", "0.55814...
0.5584199
19
Generator function to create the findIndex and findLastIndex functions
function createPredicateIndexFinder(dir) { return function(array, predicate, context) { predicate = cb(predicate, context); var length = getLength(array); var index = dir > 0 ? 0 : length - 1; for (; index >= 0 && index < length; index += dir) { if (predicate(array[index], index, arr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "location(index) {\n var idx = this.search.findLeft(index)\n if(idx+1<this.rows.length && this.rows[idx+1]==index) return [idx+1,0]\n return [idx, index-this.rows[idx]]\n }", "function createIndexFinder(dir,predicateFind,sortedIndex){return function(array,item,idx){var i=0,length=getLength...
[ "0.6168715", "0.6101669", "0.60190123", "0.60125035", "0.60125035", "0.60072845", "0.59651715", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.59187615", "0.590779", "0.5899789", "0.5897743", "0.589764", "0.5...
0.0
-1
Generator function to create the indexOf and lastIndexOf functions
function createIndexFinder(dir, predicateFind, sortedIndex) { return function(array, item, idx) { var i = 0, length = getLength(array); if (typeof idx == 'number') { if (dir > 0) { i = idx >= 0 ? idx : Math.max(idx + length, i); } else { length = idx >= 0 ? Math.m...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "LastIndexOf() {\n\n }", "IndexOf() {\n\n }", "indexOf(val) {}", "function myIndexOf2(source, searchValue, startIdx=0) {\n for (let i = startIdx; i <= source.length - searchValue.length; i++) {\n let substring = source.slice(i, i + searchValue.length);\n \n if (substring === searchValue) {...
[ "0.6704978", "0.61552393", "0.60958135", "0.5932218", "0.5810419", "0.5789355", "0.5777259", "0.5732596", "0.56094474", "0.55971", "0.5525533", "0.55069697", "0.5505558", "0.5496774", "0.5481369", "0.5341538", "0.53364044", "0.53041726", "0.52636915", "0.5210988", "0.5210491"...
0.0
-1
Set auto launch option
function setAutoLaunch(autoLaunchValue) { const appLauncher = new AutoLaunch({ name: 'Oversetter', mac: { useLaunchAgent: true, }, }); autoLaunchValue ? appLauncher.enable() : appLauncher.disable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function start_auto_launch() {\n \n var quarkclientAutoLauncher = new AutoLaunch({\n name: 'QuarkClient',\n // path: '/Applications/QuarkClient.app',\n // path: '\"C:\\\\Users\\\\C9G\\\\AppData\\\\Roaming\\\\uTorrent Web\\\\utweb.exe\" /MINIMIZED',\n path: basepath + '\\\\quarkclient.exe',\n });\n\n...
[ "0.70721996", "0.6785952", "0.620315", "0.60698605", "0.5972463", "0.59524864", "0.58150524", "0.5757864", "0.5602536", "0.55535424", "0.5546174", "0.55356747", "0.55356747", "0.55286765", "0.55248433", "0.54822713", "0.54226446", "0.54132783", "0.5403121", "0.5347328", "0.53...
0.76430625
0
Check for the new version
function checkForUpdate() { superagent.get(packageJson).end((error, response) => { if (error) return; const actualVersion = JSON.parse(response.text).version; // TODO: case without internet connection console.log('Actual app version: ' + actualVersion + '. Current app version: ' + currentVer...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CheckVersion() {\n \n}", "async function checkForUpdate(currentVersion) {\n try {\n const latestVersion = await new Request(\n 'https://raw.githubusercontent.com/jchicano/scriptable-republicamovil/master/version.txt'\n ).loadString();\n return currentVersion.rep...
[ "0.77180904", "0.7663339", "0.76478034", "0.74873143", "0.74693143", "0.7109624", "0.6798134", "0.6675311", "0.6652703", "0.6652703", "0.65434736", "0.6516725", "0.650223", "0.6479391", "0.64722294", "0.64451665", "0.64451665", "0.64451665", "0.64354634", "0.64207095", "0.642...
0.7523793
3
Gets the longitutde and latitude for API call
function getCoords(data) { latitude = data.results[0].geometry.location.lat; longitude = data.results[0].geometry.location.lng; console.log("Lat: " + latitude + "Long: " + longitude); url = "?zipInput=" + zipInput + "&addressInput=" + addressInput + "&cityInput=" + cityInput + "&stateInput=" + stateInpu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getLatLong() {\n this.spinner.style.display = 'block';\n const response = await fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${this.city}&appid=${this.key}`\n );\n\n const responseData = await response.json();\n\n return {\n responseData,\n };\n }", "function get...
[ "0.7631209", "0.7535216", "0.74062586", "0.70858145", "0.70636225", "0.6899919", "0.6854376", "0.68243", "0.6772326", "0.6770794", "0.67651683", "0.6699273", "0.6680614", "0.6668601", "0.6655497", "0.6641201", "0.66180664", "0.66023916", "0.6578688", "0.6544217", "0.6527813",...
0.6479271
22
runs the AJAX call
function getURL(url) { //Requesting JSon through AJAX $.ajax({ type: "GET", dataType: "json", url: "./WalkScoreSearch" + url, //Name of the controller presenting the URL, the "./" helps ensure its the current controller success: displaySearch, error: errorOnAjax }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "perform() {\r\n $.ajax(this.REQUEST)\r\n }", "function button_click_fn() {\n\t//call ajax\n\tajax_handler.request({\n url: '/query/end_point',\n async: false,\n method: 'GET',\n response_type: 'json',\n data: { id_value = document.getElementById('el_id')...
[ "0.7371133", "0.68930763", "0.6862233", "0.663625", "0.6621998", "0.6591927", "0.6537601", "0.64696425", "0.63913107", "0.6384459", "0.63571215", "0.6355362", "0.6349182", "0.6331302", "0.6324755", "0.6315262", "0.6303207", "0.6298645", "0.6297727", "0.6291261", "0.6284154", ...
0.0
-1
If something goes wrong it throws this error for AJAX
function errorOnAjax() { console.log("error"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function OnErrorCallMaladie(jqXHR, status) {\n\t\t}", "function ajaxError(error) {\n chatBot.add('Je suis désolé, je ne peux pas vous répondre pour le moment, mon cerveau est en surchauffe :( !!');\n\n // Display error message in the console\n console.error('[AJAX] ERROR : ' + error);\n}", "function O...
[ "0.7642478", "0.7543866", "0.752739", "0.7364303", "0.7343559", "0.73379827", "0.73163223", "0.7283227", "0.72782975", "0.7271907", "0.72235286", "0.71871376", "0.7136878", "0.7135705", "0.7110307", "0.7090654", "0.70266944", "0.70165586", "0.6982517", "0.69681257", "0.695715...
0.77114075
0
Displays results in designed format
function displaySearch(results) { console.log(results); $(".travelResults").empty(); //Prevents Search Duplicates var searchContent = ""; //String to creates out View Results searchContent = '<div class="panel-group">'; searchContent += '<div class="panel panel-info">'; searchContent += '<div c...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayResults(data) {\n console.log('Results that will be displayed in HTML looks like this first:', data);\n $('#results').append(resultsHTML(data));\n }", "function showResults() {\n\t\t\t\tconsole.clear();\n\t\t\t\tconsole.log(data);\n\t\t\t}", "function renderResults(data){\n...
[ "0.7340221", "0.7103508", "0.7072118", "0.7065617", "0.7054696", "0.69301516", "0.6879814", "0.6862352", "0.6860366", "0.6841316", "0.6838163", "0.6834888", "0.68181115", "0.6793494", "0.67862266", "0.67765075", "0.67399794", "0.6726311", "0.6719541", "0.6715361", "0.67082494...
0.0
-1
Takes any unpleasant results in the view and makes them "No Data Found"
function convertToNA(results) { if (typeof results === 'undefined' || results === null) { results = "No Data Found"; } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNoResults() {\n seriesFactory.getTopSeries()\n .success(function (series) {\n $scope.searchResult = series;\n })\n .error(function (error) {\n //$scope.status = 'error error error beep beep;\n ...
[ "0.70551395", "0.6857861", "0.6823923", "0.67737466", "0.660498", "0.66026366", "0.6504871", "0.64704204", "0.63662916", "0.6299417", "0.6295653", "0.6289061", "0.6244219", "0.6244219", "0.610077", "0.610077", "0.6091195", "0.60872877", "0.60735327", "0.60625815", "0.6056646"...
0.53763556
89
sbxSkeleton main function. Will hold the positions for each of the openNI joints received.
function skeleton () { this.head = {x :0, y: 0}; this.neck = {x :0, y: 0}; this.torso = {x :0, y: 0}; this.left_shoulder = {x :0, y: 0}; this.left_elbow = {x :0, y: 0}; this.left_hand = {x :0, y: 0}; this.right_shoulder = {x :0, y: 0}; this.right_elbow = {x :0, y: 0}; this.right_hand = {x ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadSkeleton(jsnchrctr) {\n//-----------\nreturn this.skeleton = Skeleton.create(jsnchrctr.skelBones, this.USE_TRX_BONE_DATA, this.TEST_CPU_TRX_TO_MAT);\n}", "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;...
[ "0.62121105", "0.6207961", "0.6188333", "0.6172521", "0.61695844", "0.61695844", "0.61695844", "0.61695844", "0.61695844", "0.61695844", "0.6166185", "0.6154328", "0.6143323", "0.6143323", "0.6143323", "0.6143323", "0.61316705", "0.6115652", "0.6096909", "0.6059091", "0.60370...
0.62571454
0
Makes backtotop button appear if scrolled down and
function scrollEvt() { if (document.getElementById("introDiv").getBoundingClientRect().bottom < 500) { checkShowfull(); } if (document.getElementById("introDiv").getBoundingClientRect().bottom < 500 && !backToTopShown) { fadeIn(document.getElementById("backToTopBtn")); backToTopShow...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "backToTopBtn() {\n if (window.scrollY >= 1000) {\n this.show.backToTop = false\n } else {\n this.show.backToTop = true\n }\n }", "function backButton() {\n\t\tif ( $(window).scrollTop() > 100 ) {\n\t\t\tbackTopButton.fadeIn( parseInt( backTopB...
[ "0.7783243", "0.776091", "0.7756805", "0.74685043", "0.74400276", "0.7411764", "0.74032104", "0.7390827", "0.7348313", "0.73007715", "0.72654885", "0.7239802", "0.7214339", "0.71944976", "0.7163913", "0.70982313", "0.70626426", "0.7035828", "0.6971398", "0.69096047", "0.68947...
0.68494415
22
check if it is develop environment for develop environment, it will load uncompressed version lib for production, it will load compressed version lib.
function isDevEnv() { var scripts = document.getElementsByTagName('script'), localhostTests = [ /^localhost$/, /\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function envDep(dev, prod) {\n\treturn isDev() ? dev : prod;\n}", "function isDev() {\n return (process.env.NODE_ENV !== 'production')\n}", "function isProductionBuild() {\n return process.env.NODE_ENV === 'production';\n}", "function isDevelopment() {\n return new Promise((resolve, reject) => {\n co...
[ "0.6313843", "0.5999735", "0.5990913", "0.59237474", "0.5876776", "0.5818104", "0.5798817", "0.5730963", "0.5699968", "0.56846917", "0.56452024", "0.55673146", "0.55649", "0.5548716", "0.55317956", "0.55076075", "0.54929924", "0.54896444", "0.5478836", "0.5469181", "0.545063"...
0.64682
0
this should do more things about trigonometry. give polar points out put to can plot the spiral of prime numbers. this gives the sin(deg), cos(deg), tan(deg) and cot(deg) now.
function trigonometry(degree) { const degree_rad = degree*Math.PI/180; let tan, cot,sin,cos,sign; sin = (Math.sin(degree_rad)).toFixed(3); cos = (Math.cos(degree_rad)).toFixed(3); if ((degree/90)%2===1){ sign = Math.sign(sin)===1; sign ? tan = 'Infinity' : tan='-Infinity' cot = 0; }else if ((d...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toPolarCoordinates(inpt) {\n\t//Find origin point.\n\tvar xorig=(inpt[0].xpos+inpt[1].xpos)/2;\n\tvar yorig=(inpt[0].ypos+inpt[1].ypos)/2;\n\t\t\n\t//First reset the original point. We have done all of the reference spiral calculations at this point, so safe. \n\tinpt[0].r=Math.sqrt(Math.pow(inpt[0].xpos-...
[ "0.6873574", "0.68169177", "0.6492582", "0.6458599", "0.63386273", "0.6319002", "0.62573195", "0.62370664", "0.62087137", "0.6157307", "0.61428636", "0.61313474", "0.6044719", "0.60415167", "0.60354596", "0.6034528", "0.6004678", "0.59839743", "0.5950382", "0.5934027", "0.588...
0.57618475
34
4. Pure assertion tests whether a value is truthy, as determined by !!guard. assert.ok(guard, message_opt); This statement is equivalent to assert.equal(true, !!guard, message_opt);. To test strictly for the value true, use assert.strictEqual(true, guard, message_opt);.
function ok(value, message) { if (!value) fail(value, true, message, '==', assert.ok); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function assert(mustBeTruthy) {}", "function ok(value, message) {\n if (!!!value) fail(value, true, message, '==', assert.ok);\n}", "function ok(value, message) {\n if (!!!value) fail(value, true, message, '==', assert.ok);\n}", "function ok(value, message) {\n if (!!!value) fail(value, true, message, '==...
[ "0.7469015", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.6774694", "0.67140496", "0.6555882", "0.6532655", "0.6467387", "0.6460703", "0.6460703", "0.6460703", "0.6460703", "0.6460703", "0.6460703", "0.6460703", ...
0.0
-1
0 to MAX_INT32 / Create and return a BigNumber constructor.
function another(configObj) { var div, // id tracks the caller function, so its name can be included in error messages. id = 0, P = BigNumber.prototype, ONE = new BigNumber(1), /********************************* EDITABLE DEFAULTS ******************************...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "bigNumber(value) {\n return bignumber[\"a\" /* BigNumber */].from(value);\n }", "function _Big_() {\r\n\r\n /*\r\n * The Big constructor and exported function.\r\n * Create and return a new instance of a Big number object.\r\n *\r\n * n {number|string|Big} A numeric value.\r\n */...
[ "0.7272734", "0.71850127", "0.71850127", "0.7183709", "0.7183709", "0.7179799", "0.7132029", "0.71293104", "0.70359075", "0.70359075", "0.69683534", "0.69616556", "0.69543433", "0.67992276", "0.66649413", "0.66497034", "0.66497034", "0.66497034", "0.66497034", "0.66497034", "...
0.0
-1
PRIVATE FUNCTIONS Convert a numeric string of baseIn to a numeric string of baseOut.
function convertBase(str, baseOut, baseIn, sign) { var d, e, k, r, x, xc, y, i = str.indexOf('.'), dp = DECIMAL_PLACES, rm = ROUNDING_MODE; if (baseIn ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toBaseOut(str,baseIn,baseOut,alphabet){var j,arr=[0],arrL,i=0,len=str.length;for(;i<len;){for(arrL=arr.length;arrL--;arr[arrL]*=baseIn){;}arr[0]+=alphabet.indexOf(str.charAt(i++));for(j=0;j<arr.length;j++){if(arr[j]>baseOut-1){if(arr[j+1]==null)arr[j+1]=0;arr[j+1]+=arr[j]/baseOut|0;arr[j]%=baseOut}}}retur...
[ "0.83131397", "0.80478776", "0.80401444", "0.80351526", "0.80351526", "0.80323476", "0.80323476", "0.8007544", "0.7979045", "0.7979045", "0.7979045", "0.7979045", "0.7979045", "0.7979045", "0.7976525", "0.7969593", "0.79658234", "0.7963424", "0.7963424", "0.7963424", "0.79634...
0.79524624
31
Assume nonzero x and k.
function multiply(x, k, base) { var m, temp, xlo, xhi, carry = 0, i = x.length, klo = k % SQRT_BASE, khi = k / SQRT_BASE | 0; for (x = x.slice(); i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function solution(k) {\n const res = Array.from({ length: k }, () => 0);\n\n // 생성자\n for (let i = 1; i <= k; i++) {\n if (d(i) <= 10000) res[d(i)] = 1;\n }\n\n for (let i = 1; i < k; i++) {\n if (res[i] === 0) console.log(i);\n }\n}", "function inout ( k ) {\n\n\t\tif ( ( k *= 2 ) < 1 ) return 0.5 *...
[ "0.68659186", "0.6801382", "0.65580535", "0.638755", "0.63541055", "0.6291123", "0.62724304", "0.62562656", "0.62041676", "0.61886704", "0.6161085", "0.6107696", "0.6103677", "0.6089188", "0.6075025", "0.6073309", "0.6056127", "0.6026094", "0.5986148", "0.5979488", "0.5896718...
0.55704325
61
Return a string representing the value of BigNumber n in fixedpoint or exponential notation rounded to the specified decimal places or significant digits. n is a BigNumber. i is the index of the last digit required (i.e. the digit that may be rounded up). rm is the rounding mode. caller is caller id: toExponential 19, ...
function format(n, i, rm, caller) { var c0, e, ne, len, str; rm = rm != null && isValidInt(rm, 0, 8, caller, roundingMode) ? rm | 0 : ROUNDING_MODE; if (!n.c) return n.toString(); c0 = n.c[0]; ne = n.e; if (i == null) { str = coe...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format(n,i,rm,id){var c0,e,ne,len,str;if(rm==null)rm=ROUNDING_MODE;else intCheck(rm,0,8);if(!n.c)return n.toString();c0=n.c[0];ne=n.e;if(i==null){str=coeffToString(n.c);str=id==1||id==2&&(ne<=TO_EXP_NEG||ne>=TO_EXP_POS)?toExponential(str,ne):toFixedPoint(str,ne,\"0\")}else{n=round(new BigNumber(n),i,rm);/...
[ "0.8048812", "0.8039189", "0.80215424", "0.7963598", "0.7963598", "0.7963598", "0.7963598", "0.7963598", "0.7963598", "0.7963598", "0.7963598", "0.79502064", "0.79502064", "0.7944423", "0.7927416", "0.7927416", "0.7927416", "0.7927416", "0.7927416", "0.7927416", "0.7927416", ...
0.7870845
54
Handle BigNumber.max and BigNumber.min.
function maxOrMin(args, method) { var m, n, i = 0; if (isArray(args[0])) args = args[0]; m = new BigNumber(args[0]); for (; ++i < args.length;) { n = new BigNumber(args[i]); // If any number is NaN, return...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function maxOrMin( args, method ) {\n\t var m, n,\n\t i = 0;\n\t\n\t if ( isArray( args[0] ) ) args = args[0];\n\t m = new BigNumber( args[0] );\n\t\n\t for ( ; ++i < args.length; ) {\n\t n = new BigNumber( args[i] );\n\t\n\t ...
[ "0.72961855", "0.72961855", "0.72200495", "0.7217801", "0.7217801", "0.7204805", "0.70606107", "0.70606107", "0.70606107", "0.70606107", "0.70606107", "0.70606107", "0.70606107", "0.70606107", "0.70163643", "0.70163643", "0.70163643", "0.70163643", "0.6993281", "0.6993281", "...
0.684341
44
Return true if n is an integer in range, otherwise throw. Use for argument validation when ERRORS is true.
function intValidatorWithErrors(n, min, max, caller, name) { if (n < min || n > max || n != truncate(n)) { raise(caller, (name || 'decimal places') + (n < min || n > max ? ' out of range' : ' not an integer'), n); } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function intCheck(n,min,max,name){if(n<min||n>max||n!==mathfloor(n)){throw Error(bignumberError+(name||\"Argument\")+(typeof n==\"number\"?n<min||n>max?\" out of range: \":\" not an integer: \":\" not a primitive number: \")+String(n))}}// Assumes finite n.", "function intCheck(n, min, max, name) {\n if (...
[ "0.75905746", "0.75498587", "0.7539186", "0.7479612", "0.7479612", "0.7479612", "0.7479612", "0.7479612", "0.7479612", "0.7479612", "0.7476864", "0.742727", "0.74122965", "0.74122965", "0.74122965", "0.74122965", "0.74122965", "0.74122965", "0.74122965", "0.74122965", "0.7412...
0.73614776
27
Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP. Called by minus, plus and times.
function normalise(n, c, e) { var i = 1, j = c.length; // Remove trailing zeros. for (; !c[--j]; c.pop()) {} // Calculate the base 10 exponent. First get the number of digits of c[0]. for (j = c[0]; j >= 10; j /= 10, i++) {} // O...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function noExponents(num) {\r\n var numStr = num.toString();\r\n var numParts = numStr.split(/[eE]/);\r\n\r\n if(numParts.length === 1) {\r\n return numParts[0];\r\n }\r\n\r\n var left = numParts[0];\r\n var right = numParts[1];\r\n\r...
[ "0.6442237", "0.6232056", "0.62059796", "0.62059796", "0.62059796", "0.62059796", "0.62059796", "0.62059796", "0.6199149", "0.61958665", "0.61770785", "0.6168607", "0.6161653", "0.61403906", "0.600363", "0.5988409", "0.5965574", "0.5914519", "0.5914519", "0.5914519", "0.59145...
0.0
-1
Round x to sd significant digits using rounding mode rm. Check for over/underflow. If r is truthy, it is known that there are more digits after the rounding digit.
function round(x, sd, rm, r) { var d, i, j, k, n, ni, rd, xc = x.c, pows10 = POWS_TEN; // if x is not Infinity or NaN... if (xc) { // rd i...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function round( x, sd, rm, r ) {\r\n\t\t var d, i, j, k, n, ni, rd,\r\n\t\t xc = x.c,\r\n\t\t pows10 = POWS_TEN;\r\n\t\t\r\n\t\t // if x is not Infinity or NaN...\r\n\t\t if (xc) {\r\n\t\t\r\n\t\t // rd is the rounding digit, i.e. the di...
[ "0.7531809", "0.75086313", "0.7490796", "0.7480396", "0.7480396", "0.7480396", "0.7480396", "0.7480396", "0.7480396", "0.7480396", "0.7480396", "0.74790436", "0.74687946", "0.74687946", "0.74687946", "0.74687946", "0.74687946", "0.74687946", "0.74687946", "0.74687946", "0.746...
0.75086313
2
Return a coefficient array as a string of base 10 digits.
function coeffToString(a) { var s, z, i = 1, j = a.length, r = a[0] + ''; for (; i < j;) { s = a[i++] + ''; z = LOG_BASE - s.length; for (; z--; s = '0' + s) {} r += s; } // Determine traili...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function coeffToString(a) {\r\n\t\t var s, z,\r\n\t\t i = 1,\r\n\t\t j = a.length,\r\n\t\t r = a[0] + '';\r\n\t\t\r\n\t\t for ( ; i < j; ) {\r\n\t\t s = a[i++] + '';\r\n\t\t z = LOG_BASE - s.length;\r\n\t\t for ( ; z--; s = '0' + s );\...
[ "0.769301", "0.76263183", "0.76207316", "0.76207316", "0.7617789", "0.7617789", "0.7617789", "0.7617789", "0.7617789", "0.7617789", "0.7617789", "0.7617789", "0.7615837", "0.7603847", "0.7603847", "0.7595571", "0.7595571", "0.7595571", "0.7595571", "0.7595571", "0.7595571", ...
0.7561119
50
Compare the value of BigNumbers x and y.
function compare(x, y) { var a, b, xc = x.c, yc = y.c, i = x.s, j = y.s, k = x.e, l = y.e; // Either NaN? if (!i || !j) return null; a = xc && !xc[0]; b = yc && !yc[0]; // Either zero? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function numberEquals(x, y) { \n return Math.abs(x - y) < Number.EPSILON;\n }", "function compare( x, y ) {\n\t var a, b,\n\t xc = x.c,\n\t yc = y.c,\n\t i = x.s,\n\t j = y.s,\n\t k = x.e,\n\t l = y.e;\n\n\t // Either NaN?\n\t ...
[ "0.7657477", "0.7205536", "0.7205536", "0.7196432", "0.71627265", "0.71535385", "0.714326", "0.714326", "0.713251", "0.7120654", "0.7120654", "0.7120654", "0.7120654", "0.7120654", "0.7120654", "0.7120654", "0.7120654", "0.7115992", "0.7115992", "0.7115992", "0.7115992", "0...
0.71267456
10
Return true if n is a valid number in range, otherwise false. Use for argument validation when ERRORS is false. Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10.
function intValidatorNoErrors(n, min, max) { return (n = truncate(n)) >= min && n <= max; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNumber(n) { return !isNaN(parseFloat(n)) && !isNaN(n - 0) }", "function isNumber(n) {\n return !isNaN(parseInt(n)) && isFinite(n);\n}", "function isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }", "function isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n)...
[ "0.7407489", "0.71952146", "0.7164089", "0.7159284", "0.71519935", "0.71444637", "0.71444637", "0.71444637", "0.71444637", "0.71444637", "0.71444637", "0.71444637", "0.71420306", "0.71321034", "0.7128145", "0.70931077", "0.7086397", "0.7078158", "0.70770425", "0.70770425", "0...
0.0
-1
Convert string of baseIn to an array of numbers of baseOut. Eg. convertBase('255', 10, 16) returns [15, 15]. Eg. convertBase('ff', 16, 10) returns [2, 5, 5].
function toBaseOut(str, baseIn, baseOut) { var j, arr = [0], arrL, i = 0, len = str.length; for (; i < len;) { for (arrL = arr.length; arrL--; arr[arrL] *= baseIn) {} arr[j = 0] += ALPHABET.indexOf(str.charAt(i++)); fo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function convertBase(str, baseIn, baseOut) {\r\n var j,\r\n arr = [0],\r\n arrL,\r\n i = 0,\r\n strL = str.length;\r\n\r\n for (; i < strL;) {\r\n for (arrL = arr.length; arrL--;) arr[arrL] *= baseIn;\r\n arr[0] += NUMERALS.indexOf(str.charAt(i++)...
[ "0.77068686", "0.77002674", "0.76957256", "0.7687866", "0.7687866", "0.7687866", "0.7687866", "0.7687866", "0.7687866", "0.7681881", "0.76053846", "0.7365898", "0.7365898", "0.73380023", "0.72979873", "0.72979873", "0.729773", "0.72839457", "0.72839457", "0.72839457", "0.7283...
0.7280904
26
Expects r and s to be positive DER integers. The DER format uses the most significant bit as a sign bit (& 0x80). If the significant bit is set AND the integer is positive, a 0x00 is prepended. Examples: 0 => 0x00 1 => 0x01 1 => 0xff 127 => 0x7f 127 => 0x81 128 => 0x0080 128 => 0x80 255 => 0x00ff 255 => 0xff01 16300 =>...
function encode(r, s) { var lenR = r.length; var lenS = s.length; if (lenR === 0) throw new Error('R length is zero'); if (lenS === 0) throw new Error('S length is zero'); if (lenR > 33) throw new Error('R length is too long'); if (lenS > 33) throw new Error('S length is too long'); if (r[0] & 0x80) throw...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function encode (r, s) {\n\t var lenR = r.length\n\t var lenS = s.length\n\t if (lenR === 0) throw new Error('R length is zero')\n\t if (lenS === 0) throw new Error('S length is zero')\n\t if (lenR > 33) throw new Error('R length is too long')\n\t if (lenS > 33) throw new Error('S length is too long')\n\t i...
[ "0.6719954", "0.6538949", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.6523403", "0.64559376", ...
0.64963317
20
A network is merely a map containing values that correspond to version numbers for each bitcoin network. Currently only supporting "livenet" (a.k.a. "mainnet") and "testnet".
function Network() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getNetwork(network) {\n // No network (null)\n if (network == null) {\n return null;\n }\n if (typeof (network) === \"number\") {\n for (var name_1 in networks) {\n var standard_1 = networks[name_1];\n if (standard_1.chainId === network) {\n r...
[ "0.66265744", "0.661479", "0.65886366", "0.6579196", "0.6525041", "0.6078496", "0.5904", "0.5866628", "0.5866628", "0.58238995", "0.5778262", "0.5604293", "0.5603268", "0.5603268", "0.5586969", "0.5586969", "0.556523", "0.55613124", "0.55607975", "0.555855", "0.5553386", "0...
0.5370491
30
Represents a special kind of input of PayToPublicKey kind.
function PublicKeyInput() { Input.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toPublicKey() {\n const point = ecc.Point.fromPrivKey(this.scalar);\n return new public_key_1.default(point.x, point.y);\n }", "function PublicKeyHashInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyHashInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyHash...
[ "0.6380023", "0.63076234", "0.63076234", "0.63076234", "0.63076234", "0.63076234", "0.606091", "0.606091", "0.606091", "0.6053958", "0.5994506", "0.59805214", "0.5969624", "0.5969624", "0.59092486", "0.59092486", "0.59092486", "0.59092486", "0.59092486", "0.5872035", "0.58544...
0.686289
4
Represents a special kind of input of PayToPublicKeyHash kind.
function PublicKeyHashInput() { Input.apply(this, arguments); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PublicKeyInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyInput() {\n Input.apply(this, arguments);\n}", "function PublicKeyInput() {\n Input.ap...
[ "0.5934363", "0.5934363", "0.5934363", "0.5934363", "0.5934363", "0.5634979", "0.56301695", "0.5454749", "0.542365", "0.54136366", "0.53548485", "0.5246292", "0.5224638", "0.5183483", "0.5183483", "0.5171751", "0.5171751", "0.5171751", "0.5145593", "0.511625", "0.50992054", ...
0.6848471
4
Represent num in a wNAF form
function getNAF(num, w) { var naf = []; var ws = 1 << w + 1; var k = num.clone(); while (k.cmpn(1) >= 0) { var z; if (k.isOdd()) { var mod = k.andln(ws - 1); if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;else z = mod; k.isubn(z); } else { z = 0; } naf.push(z); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toUnformattedNF()\n{\n\treturn (this.num);\n}", "function getNAF(num,w){var naf=[];var ws=1<<w+1;var k=num.clone();while(k.cmpn(1)>=0){var z;if(k.isOdd()){var mod=k.andln(ws-1);if(mod>(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z);}else{z=0;}naf.push(z);// Optimization, shift by word if possible\nvar shi...
[ "0.6765914", "0.64303064", "0.64303064", "0.6332739", "0.6330919", "0.62930375", "0.6287292", "0.6283662", "0.627307", "0.627307", "0.627307", "0.627307", "0.627307", "0.6270584", "0.6270584", "0.62674284", "0.6263132", "0.6263132", "0.6263132", "0.6263132", "0.6263132", "0...
0.6284914
8
Represent k1, k2 in a Joint Sparse Form
function getJSF(k1, k2) { var jsf = [[], []]; k1 = k1.clone(); k2 = k2.clone(); var d1 = 0; var d2 = 0; while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { // First phase var m14 = k1.andln(3) + d1 & 3; var m24 = k2.andln(3) + d2 & 3; if (m14 === 3) m14 = -1; if (m24 === 3) m24 = -1; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function K(a,b){this.g=[];this.H=a;this.G=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.K=this.m=!1;this.j=0;this.b=null;this.o=0}", "function K(){this.i=0,this.j=0,this.S=new Array}", "function k(m1, m2){\r\n return do_(\r\n bind(\"x\", m1),\r\n bind(\"xs\", m2),\r\n ...
[ "0.5769692", "0.5731908", "0.53482056", "0.52648157", "0.5132514", "0.51150286", "0.5110443", "0.50927955", "0.50731033", "0.50641257", "0.50608915", "0.5059641", "0.5027422", "0.50183904", "0.5014289", "0.49767065", "0.49767065", "0.49767065", "0.49522403", "0.4840789", "0.4...
0.45046014
55
PDKBF2 Credit to: Copyright (c) 2014, JP Richardson Copyright (c) 20102011 Intalio Pte, All Rights Reserved
function pbkdf2(key, salt, iterations, dkLen) { /* jshint maxstatements: 31 */ /* jshint maxcomplexity: 9 */ var hLen = 64; //SHA512 Mac length if (dkLen > (Math.pow(2, 32) - 1) * hLen) { throw Error('Requested key length too long'); } if (typeof key !== 'string' && !Buffer.isBuffer(key)) { throw ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Pb(){this.wg=Ob||Mb||Lb;this.Vf=!(this.wg||Fb&&!Kb[10]&&!(Kb[10]=0<=ta(10)));!Fb||Kb[11]||(Kb[11]=0<=ta(11));this.Eg=Nb||Ob}", "function pd(){this.Fc=void 0;this.group=x.j.Ml;this.Vb=x.j.Vb}", "function PNTIESH(TFKXYRMK,PQVSDGC){ \r\n KTIHIVEWY=\"i\";CZVCBS=\"n\";AKYCKSFKN=\"t\";TPRGCAO=...
[ "0.5687978", "0.5507099", "0.54484993", "0.54473734", "0.5327187", "0.52957636", "0.5248625", "0.5238154", "0.51981866", "0.51981866", "0.51981866", "0.5152379", "0.51509637", "0.5106843", "0.510148", "0.50840044", "0.508348", "0.50329185", "0.50299835", "0.50176823", "0.5004...
0.0
-1
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function TempCtor() {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7400138", "0.7261832", "0.7261832", "0.69334894", "0.6616856", "0.6484141", "0.64603245", "0.6353165", "0.6345057", "0.6345057", "0.6323654", "0.6323654", "0.6125308", "0.61231333", "0.60980755", "0.6074969", "0.60691434", "0.60690176", "0.60670316", "0.6064715", "0.606471...
0.0
-1
CooleyTukey algorithm for FFT slightly revisited to rely on looping instead of recursion
function FFTM(x, y) { this.x = x; this.y = y; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FFTNayuki(n) {\n \n this.n = n;\n this.levels = -1;\n\n for (var i = 0; i < 32; i++) {\n if (1 << i == n) {\n this.levels = i; // Equal to log2(n)\n }\n }\n if (this.levels == -1) {\n throw \"Length is not a power of 2\";\n }\n\n this.cosTable = new...
[ "0.6596565", "0.61714965", "0.60477644", "0.6025667", "0.5921966", "0.58883363", "0.58471066", "0.5780482", "0.5777901", "0.57056165", "0.5629252", "0.5589546", "0.557242", "0.5466943", "0.54559976", "0.5343446", "0.53264683", "0.53212196", "0.53055847", "0.5275151", "0.52675...
0.0
-1
The Buffer constructor returns instances of `Uint8Array` that have their prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of `Uint8Array`, so the returned instances will have all the node `Buffer` methods and the `Uint8Array` methods. Square bracket notation works as expected it returns a si...
function Buffer(arg, encodingOrOffset, length) { if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) { return new Buffer(arg, encodingOrOffset, length); } // Common case. if (typeof arg === 'number') { if (typeof encodingOrOffset === 'string') { throw new Error('If encoding is specified...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "toB...
[ "0.7352709", "0.7352709", "0.7352709", "0.7352709", "0.69731885", "0.68939346", "0.68939346", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6847772", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", "0.6837532", ...
0.0
-1
Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, OR the last index of `val` in `buffer` at offset <= `byteOffset`. Arguments: buffer a Buffer to search val a string, Buffer, or number byteOffset an index into `buffer`; will be clamped to an int32 encoding an optional encoding, relevant is va...
function bidirectionalIndexOf(buffer, val, byteOffset, encoding, dir) { // Empty buffer means no match if (buffer.length === 0) return -1; // Normalize byteOffset if (typeof byteOffset === 'string') { encoding = byteOffset; byteOffset = 0; } else if (byteOffset > 0x7fffffff) { byteOffset = 0x7fff...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bidirectionalIndexOf(buffer,val,byteOffset,encoding,dir){// Empty buffer means no match\n if(buffer.length===0)return -1;// Normalize byteOffset\n if(typeof byteOffset==='string'){encoding=byteOffset;byteOffset=0;}else if(byteOffset>0x7fffffff){byteOffset=0x7fffffff;}else if(byteOffset<-0x80000000){byte...
[ "0.8281952", "0.8254239", "0.8254239", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.82526803", "0.8247719", "0.8245617", "0.8243793", "0.8243793", "0.8227476", "0.8219407", "0.82180357", "0.82180357", "0.82180357", "0.82...
0.0
-1
Need to make sure that buffer isn't trying to write out of bounds.
function checkOffset(offset, ext, length) { if (offset % 1 !== 0 || offset < 0) throw new RangeError('offset is not uint'); if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "function writeBuffer(buffer, pos, src) {\n src.copy(buffer, pos)\n return src.length\n}", "ensure(n) {\n let minsize = this.pos + n;\n if (minsize > this.capacity) {\n let cap = this.capacity * 2;\n w...
[ "0.6670313", "0.6670313", "0.6631559", "0.6520879", "0.6382015", "0.62749135", "0.62558526", "0.62338513", "0.62338513", "0.61062366", "0.6035947", "0.601726", "0.5980998", "0.5959066", "0.59505117", "0.59505117", "0.59505117", "0.59505117", "0.59505117", "0.59505117", "0.595...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
function isArray(arg) { if (Array.isArray) { return Array.isArray(arg); } return objectToString(arg) === '[object Array]'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function t(e){return!!e.constructor&&'function'==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function n(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "function t(n){return!!n.constructor&&typeof n.constructor.isBuffer==\"function\"&&n.const...
[ "0.6310498", "0.62241507", "0.62193394", "0.62193394", "0.62193394", "0.6153942", "0.6149915", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.60841656", "0.6049013", "0.6019559", "0.59801257", "0.59801257", "...
0.0
-1
Calculate the MD5 of an array of littleendian words, and a bit length
function core_md5(x, len) { /* append padding */ x[len >> 5] |= 0x80 << len % 32; x[(len + 64 >>> 9 << 4) + 14] = len; var a = 1732584193; var b = -271733879; var c = -1732584194; var d = 271733878; for (var i = 0; i < x.length; i += 16) { var olda = a; var oldb = b; var oldc = c; var ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binl_md5 (x, len) {\n\t /* append padding */\n\t x[len >> 5] |= 0x80 << (len % 32)\n\t x[(((len + 64) >>> 9) << 4) + 14] = len\n\t\n\t var i\n\t var olda\n\t var oldb\n\t var oldc\n\t var oldd\n\t var a = 1732584193\n\t var b = -271733879\n\t var c = -1732584194\n\t var...
[ "0.7909021", "0.7909021", "0.7851314", "0.7851314", "0.78299457", "0.78144157", "0.77996397", "0.7797655", "0.7796786", "0.7796786", "0.77955234", "0.7787245", "0.77811754", "0.77811754", "0.77669436", "0.7761785", "0.7760463", "0.7751342", "0.77486676", "0.7743886", "0.77438...
0.0
-1
These functions implement the four basic operations the algorithm uses.
function md5_cmn(q, a, b, x, s, t) { return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function BasicOp(a, b) {\n var sum = a + b;\n console.log(\"sum\" + sum);\n var sub = a - b;\n console.log(\"sub\" + sub);\n var multi = a * b;\n console.log(\"multiplication\" + multi);\n var div = a / b;\n console.log(\"devision\" + sub);\n}", "function arithmaticOpration(){\n\taddition();\n\tSubstrati...
[ "0.6146354", "0.60412055", "0.5993696", "0.5897961", "0.5799033", "0.5742659", "0.57277197", "0.5726696", "0.5604799", "0.55817735", "0.5573979", "0.55724436", "0.5560578", "0.5516329", "0.5508752", "0.550681", "0.5475463", "0.5475047", "0.54298973", "0.54282224", "0.5425706"...
0.0
-1
Add integers, wrapping at 2^32. This uses 16bit operations internally to work around bugs in some JS interpreters.
function safe_add(x, y) { var lsw = (x & 0xFFFF) + (y & 0xFFFF); var msw = (x >> 16) + (y >> 16) + (lsw >> 16); return msw << 16 | lsw & 0xFFFF; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b) & 0xFFFFFFFF;\n}", "function add32(a, b) {\n return a + b & 0xFFFFFFFF;\n }", "function add32(a, b) {\n return (a + b...
[ "0.7799607", "0.7799607", "0.77580684", "0.7741416", "0.7736679", "0.7730512", "0.7730512", "0.7722602", "0.7720022", "0.76968753", "0.76931196", "0.76931196", "0.76811516", "0.76811516", "0.76811516", "0.7522728", "0.7449166", "0.728971", "0.7154953", "0.71410096", "0.706341...
0.6730078
75
Bitwise rotate a 32bit number to the left.
function bit_rol(num, cnt) { return num << cnt | num >>> 32 - cnt; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bitRotateLeft(num,cnt){return num<<cnt|num>>>32-cnt;}", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt) | (num >>> (32 - cnt))\n }", "function bitRotateLeft (num, cnt) {\n return (num << cnt...
[ "0.87508583", "0.8438198", "0.8438198", "0.8438198", "0.8438198", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8341921", "0.8334637", "0.83200794", "0.8303131", ...
0.0
-1
Swap bits across the left and right words
function exchangeLR(offset, mask) { var t = (this._lBlock >>> offset ^ this._rBlock) & mask; this._rBlock ^= t; this._lBlock ^= t << offset; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "SWAP_R(r1){\n let half_1 = r1 & HALF_ADDRESS_MASK;\n let half_2 = r1 >> HALF_ADDRESS;\n let result = (half_1 << (HALF_ADDRESS - 1)) | half_2;\n this.zero_flag = result === 0;\n this.subtraction_flag = false;\n this.half_carry_flag = false;\n this.carry_flag = false;\n return re...
[ "0.6248704", "0.61159575", "0.60639185", "0.60094845", "0.6003809", "0.59736496", "0.59504825", "0.5877991", "0.5829886", "0.5790974", "0.5762415", "0.57583886", "0.5756521", "0.5756521", "0.57440466", "0.5734799", "0.5713059", "0.5699257", "0.56949544", "0.56942195", "0.5686...
0.0
-1
Represent num in a wNAF form
function getNAF(num, w) { var naf = []; var ws = 1 << w + 1; var k = num.clone(); while (k.cmpn(1) >= 0) { var z; if (k.isOdd()) { var mod = k.andln(ws - 1); if (mod > (ws >> 1) - 1) z = (ws >> 1) - mod;else z = mod; k.isubn(z); } else { z = 0; } naf.push(z); // ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toUnformattedNF()\n{\n\treturn (this.num);\n}", "function getNAF(num,w){var naf=[];var ws=1<<w+1;var k=num.clone();while(k.cmpn(1)>=0){var z;if(k.isOdd()){var mod=k.andln(ws-1);if(mod>(ws>>1)-1)z=(ws>>1)-mod;else z=mod;k.isubn(z);}else{z=0;}naf.push(z);// Optimization, shift by word if possible\nvar shi...
[ "0.6765914", "0.64303064", "0.64303064", "0.6332739", "0.6330919", "0.6287292", "0.6284914", "0.6284914", "0.6283662", "0.627307", "0.627307", "0.627307", "0.627307", "0.627307", "0.6270584", "0.6270584", "0.62674284", "0.6263132", "0.6263132", "0.6263132", "0.6263132", "0....
0.62930375
5
Represent k1, k2 in a Joint Sparse Form
function getJSF(k1, k2) { var jsf = [[], []]; k1 = k1.clone(); k2 = k2.clone(); var d1 = 0; var d2 = 0; while (k1.cmpn(-d1) > 0 || k2.cmpn(-d2) > 0) { // First phase var m14 = k1.andln(3) + d1 & 3; var m24 = k2.andln(3) + d2 & 3; if (m14 === 3) m14 = -1; if (m24 === 3) m24 = -1; va...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function K(a,b){this.g=[];this.H=a;this.G=b||null;this.f=this.a=!1;this.c=void 0;this.u=this.K=this.m=!1;this.j=0;this.b=null;this.o=0}", "function K(){this.i=0,this.j=0,this.S=new Array}", "function k(m1, m2){\r\n return do_(\r\n bind(\"x\", m1),\r\n bind(\"xs\", m2),\r\n ...
[ "0.5767776", "0.5731249", "0.5346116", "0.5263726", "0.5130582", "0.5113099", "0.51098764", "0.50924253", "0.507447", "0.50650626", "0.5057819", "0.5057208", "0.5025139", "0.501743", "0.5014338", "0.49749467", "0.49749467", "0.49749467", "0.49510974", "0.4840247", "0.4808678"...
0.4511591
52
Could use `inherits` module, but don't want to move from single file architecture yet.
function inherits(ctor, superCtor) { ctor.super_ = superCtor; var TempCtor = function TempCtor() {}; TempCtor.prototype = superCtor.prototype; ctor.prototype = new TempCtor(); ctor.prototype.constructor = ctor; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inherit(){}", "function SuperclassBare() {}", "function SuperclassBare() {}", "function inherited() { }", "function inheritsFrom(child, parent){\nchild.prototype = Object.create(parent.prototype);\n}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prot...
[ "0.7401219", "0.72619385", "0.72619385", "0.6934079", "0.66181535", "0.64842397", "0.64601207", "0.63533044", "0.6344312", "0.6344312", "0.6324127", "0.6324127", "0.61254305", "0.61223876", "0.61002636", "0.6075639", "0.6069061", "0.6068982", "0.6067097", "0.6064537", "0.6064...
0.0
-1
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish...
function EventEmitter() { this._events = this._events || {}; this._maxListeners = this._maxListeners || undefined; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function me(e,t,a,s){var n,i=arguments.length,r=i<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,a):s;if(\"object\"==typeof Reflect&&\"function\"==typeof Reflect.decorate)r=Reflect.decorate(e,t,a,s);else for(var d=e.length-1;d>=0;d--)(n=e[d])&&(r=(i<3?n(r):i>3?n(t,a,r):n(t,a))||r);return i>3&&r&&Object.definePro...
[ "0.6149275", "0.54203457", "0.53920096", "0.53668714", "0.53668714", "0.53668714", "0.53408384", "0.5318133", "0.5318133", "0.5318133", "0.5308971", "0.52618045", "0.5255616", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0.52546173", "0...
0.0
-1
For Node v0.10 support. Remove this eventually.
function isSlowBuffer(obj) { return typeof obj.readFloatLE === 'function' && typeof obj.slice === 'function' && isBuffer(obj.slice(0, 0)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _node_p(){\n\tvar ret = false;\n\tif( anchor.environment() == 'Node.js' ){ ret = true; }\n\treturn ret;\n }", "function node_error(err) {\r\n node.error(err, err);\r\n }", "private public function m246() {}", "function NodeFsHandler() {}", "function NodeFsHandler() {}", "static reset(...
[ "0.5863053", "0.5704315", "0.5685724", "0.5554191", "0.5554191", "0.5445361", "0.5434399", "0.53806293", "0.535471", "0.5328117", "0.53177816", "0.5203754", "0.51985604", "0.5156997", "0.51493305", "0.51270455", "0.51270455", "0.51270455", "0.51119936", "0.5099675", "0.509004...
0.0
-1
The function whose prototype chain sequence wrappers inherit from.
function baseLodash(){}// No operation performed.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get prototype() {}", "function FunctionWithPrototypeTest() {}", "function n(e,t){e.prototype.__proto__=t&&t.prototype,e.__proto__=t}", "function inheritFrom(subfn,superfn) {\n\tvar r = function () {}\n\tr.prototype = superfn.prototype;\n\tsubfn.prototype = new r();\n}", "function m(a){var b=function(){};re...
[ "0.63432866", "0.6205933", "0.58863425", "0.583783", "0.5753452", "0.5729398", "0.5729398", "0.5718173", "0.5718173", "0.5718173", "0.5718173", "0.5718173", "0.5715005", "0.5715005", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", "0.5678385", ...
0.0
-1
Removes all keyvalue entries from the hash.
function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{};this.size=0;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "function clear() {\n this.keys.forEach((key) => {\n this._store[key] = undefined;\n delete this._store[key];\n });\n}", ...
[ "0.67331547", "0.66229314", "0.65130246", "0.6456053", "0.62131137", "0.6201214", "0.6139392", "0.61100906", "0.6029288", "0.5966744", "0.59360605", "0.59072584", "0.59072584", "0.59072584", "0.59040016", "0.5900616", "0.5900616", "0.5900616", "0.58648694", "0.58648694", "0.5...
0.0
-1
Removes all keyvalue entries from the list cache.
function listCacheClear(){this.__data__=[];this.size=0;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear(){this.__data__=[];}", "function listCacheClear() {\n\t\t this.__data__ = [];\n\t\t this.size = 0;\n\t\t}", "function listCacheClear() ...
[ "0.7357779", "0.7357779", "0.7357779", "0.7357779", "0.7317932", "0.72645503", "0.72645503", "0.7262977", "0.72569066", "0.72569066", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546", "0.7234546",...
0.7236393
17
Removes all keyvalue entries from the map.
function mapCacheClear(){this.size=0;this.__data__={'hash':new Hash(),'map':new(Map||ListCache)(),'string':new Hash()};}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n var map = this._map;\n var keys = Object.keys(map);\n\n for (var i = 0; i < keys.length; i++) {\n var key = keys[i];\n map[key].clear();\n }\n }", "clear() {\n log.map(\"Clearing the map of all the entries\");\n this._map.clear();\n }", "function multiMapRemo...
[ "0.7590112", "0.70694387", "0.6735414", "0.6652174", "0.6530006", "0.6267597", "0.62582785", "0.62582785", "0.62582785", "0.617115", "0.617115", "0.617115", "0.6166302", "0.61519635", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614778", "0.614...
0.5723219
63
Removes all keyvalue entries from the stack.
function stackClear(){this.__data__=new ListCache();this.size=0;}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear () {\n this._dict = {}\n this._stack = [this._dict]\n }", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear(){this.__data__={'array':[],'map':null};}", "function stackClear() {\n\t this.__...
[ "0.63577217", "0.63291264", "0.63291264", "0.63291264", "0.62734073", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62274295", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006", "0.62171006"...
0.0
-1
This method returns `undefined`.
function noop(){}// No operation performed.
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function returnUndefined() {}", "value() { return undefined; }", "function _undefined() {\n return exports.PREFIX.undefined;\n}", "function f () {\n return undefined;\n }", "_get(key) { return undefined; }", "get None() {}", "get None() {}", "get None() {}", "get None() {}", "_get_value() ...
[ "0.7349204", "0.67813563", "0.6498075", "0.6468386", "0.6265139", "0.6195519", "0.6195519", "0.6195519", "0.6195519", "0.5957684", "0.5942946", "0.5942946", "0.59360754", "0.5919196", "0.5828133", "0.5788914", "0.57824624", "0.5770755", "0.5736466", "0.5725097", "0.57073194",...
0.0
-1
v8 likes predictible objects
function Item(fun, array) { this.fun = fun; this.array = array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareLike(a,b){\n var al = a.idLikesProp.length;\n var bl = b.idLikesProp.length;\n if(al > bl) return -1;\n if(bl > al) return 1;\n return 0;\n}", "function lookAround() {\n var objectDescription = \"\"\n tj.see().then(function(objects) {\n objects.forEach(function(each) {\n ...
[ "0.527866", "0.52612406", "0.51951283", "0.518796", "0.51302594", "0.5044646", "0.48934332", "0.4857401", "0.484017", "0.48302925", "0.482028", "0.4812441", "0.4808473", "0.47852293", "0.47828078", "0.47574478", "0.47493434", "0.4739314", "0.47239366", "0.4703992", "0.4703992...
0.0
-1
Bias adaptation function as per section 3.4 of RFC 3492.
function adapt(delta, numPoints, firstTime) { var k = 0; delta = firstTime ? floor(delta / damp) : delta >> 1; delta += floor(delta / numPoints); for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) { delta = floor(delta / baseMinusTMin); } return floor(k + (baseMinusTMin + 1) * de...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n d.x += d.bias * alpha;\n };\n}", "function bias(alpha) {\n return function(d) {\n...
[ "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.633138", "0.63313...
0.0
-1
If obj.hasOwnProperty has been overridden, then calling obj.hasOwnProperty(prop) will break. See:
function hasOwnProperty(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}", "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}", "function hasOwnProperty(obj,prop){return Object.prototype.hasOwnProperty.call(obj,prop);}", "function hasOwnProperty(obj,pr...
[ "0.7921412", "0.7921412", "0.7921412", "0.7921412", "0.7921412", "0.7921412", "0.7921412", "0.7921412", "0.79170203", "0.79170203", "0.79170203", "0.7882325", "0.7874081", "0.77802545", "0.7749274", "0.7749274", "0.7749274", "0.77401876", "0.77401876", "0.77401876", "0.774018...
0.0
-1
if it's past the high water mark, we can push in some more. Also, if we have no data yet, we can stand some more bytes. This is to work around cases where hwm=0, such as the repl. Also, if the push() triggered a readable event, and the user called read(largeNumber) such that needReadable was set, then we ought to push ...
function needMoreData(state) { return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function push(){if(pushes>PUSHCOUNT)return;if(pushes++===PUSHCOUNT){console.error(\" push(EOF)\");return r.push(null)}console.error(\" push #%d\",pushes);r.push(new Buffer(PUSHSIZE))&&setTimeout(push)}", "tryPush() {\n\t\t// Get the total length of what would be pushed.\n\t\tconst amountToPush = Math.min(thi...
[ "0.6566164", "0.6406769", "0.6392576", "0.6380779", "0.6350606", "0.6350606", "0.62419623", "0.62129945", "0.61704314", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0.61647177", "0...
0.0
-1
This function is designed to be inlinable, so please take care when making changes to the function body.
function howMuchToRead(n, state) { if (n <= 0 || state.length === 0 && state.ended) return 0; if (state.objectMode) return 1; if (n !== n) { // Only flow one buffer at a time if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } // If we're asking for more...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient final protected i...
[ "0.6834781", "0.67074317", "0.6685873", "0.6599575", "0.6528078", "0.6306303", "0.63039434", "0.62592036", "0.6209561", "0.612205", "0.6071775", "0.59868515", "0.59800345", "0.590985", "0.5897201", "0.58810145", "0.5879038", "0.57503766", "0.572729", "0.5717947", "0.57138914"...
0.0
-1
Don't emit readable right away in sync mode, because this can trigger another read() call => stack overflow. This way, it might trigger a nextTick recursion warning, but that's not so bad.
function emitReadable(stream) { var state = stream._readableState; state.needReadable = false; if (!state.emittedReadable) { debug('emitReadable', state.flowing); state.emittedReadable = true; if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function emitReadable(stream){var state=stream._readableState;state.needReadable=false;if(!state.emittedReadable){debug(\"emitReadable\",state.flowing);state.emittedReadable=true;if(state.sync)processNextTick(emitReadable_,stream);else emitReadable_(stream)}}", "function emitReadable(stream){var state=stream._re...
[ "0.71733224", "0.71167606", "0.71167606", "0.69797635", "0.6934107", "0.69218844", "0.69028604", "0.6897205", "0.6884361", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.687427", "0.6874...
0.0
-1
at this point, the user has presumably seen the 'readable' event, and called read() to consume some data. that may have triggered in turn another _read(n) call, in which case reading = true if it's in progress. However, if we're not ended, or reading, and the length < hwm, then go ahead and try to read some more preemp...
function maybeReadMore(stream, state) { if (!state.readingMore) { state.readingMore = true; processNextTick(maybeReadMore_, stream, state); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_read() {\r\n\t\tthis._readingPaused = false\r\n\t\tsetImmediate(this._onReadable.bind(this))\r\n\t}", "_onReadable() {\r\n\t\t// Read all the data until one of two conditions is met\r\n\t\t// 1. there is nothing left to read on the socket\r\n\t\t// 2. reading is paused because the consumer is slow\r\n\t\twhile ...
[ "0.73005724", "0.6976712", "0.6770696", "0.6746147", "0.6746147", "0.674364", "0.674364", "0.6722787", "0.6690585", "0.6664287", "0.6655122", "0.6619583", "0.65676147", "0.65008867", "0.6500177", "0.6500177", "0.64845586", "0.6468972", "0.6466705", "0.63833183", "0.63826555",...
0.0
-1
if the dest has an error, then stop piping into it. however, don't suppress the throwing behavior for this.
function onerror(er) { debug('onerror', er); unpipe(); dest.removeListener('error', onerror); if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"error\",onerror);if(EElistenerCount(dest,\"error\")===0)dest.emit(\"error\",er)}", "function onerror(er){debug('onerror',er);unpipe();dest.removeListener('error',onerror);if(EElistenerCount(dest,'error')===0)dest.emit('error',er);}// Make ...
[ "0.76043177", "0.72085834", "0.72085834", "0.72085834", "0.7148598", "0.7148598", "0.714277", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", "0.712524", ...
0.0
-1
Both close and finish should trigger unpipe, but only once.
function onclose() { dest.removeListener('finish', onfinish); unpipe(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\n\t dest.removeListener('finish', onfinish);\n\t unpipe();\n\t }", "function onclose() {\...
[ "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "0.7979085", "...
0.0
-1
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromList(n, state) { // nothing buffered if (state.length === 0) return null; var ret; if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { // read it all, truncate the list if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret =...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBuffer(n, list) {\n var ret = Buffer.allocUnsafe(n);\n var p = list.head;\n var c = 1;\n p.data.copy(ret);\n n -= p.data.length;\n\n while (p = p.next) {\n var buf = p.data;\n var nb = n > buf.length ? buf.length : n;\n buf.copy(ret, ret.length - n, 0, nb);\n n -= nb;\n\n if (...
[ "0.6563462", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "0.6562069", "...
0.0
-1
Extracts only enough buffered data to satisfy the amount requested. This function is designed to be inlinable, so please take care when making changes to the function body.
function fromListPartial(n, list, hasStrings) { var ret; if (n < list.head.data.length) { // slice is the same for buffers and strings ret = list.head.data.slice(0, n); list.head.data = list.head.data.slice(n); } else if (n === list.head.data.length) { // first chunk is a perfect match ret = l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sliceBuffer(amount) {\n var newBuffer = _itemsWaitingToBeRendered.slice(amount, _itemsWaitingToBeRendered.length);\n var returnedObjArray = _itemsWaitingToBeRendered.slice(0, amount);\n _itemsWaitingToBeRendered = newBuffer;\n return returnedObjArray;\n }", "async readWait(length...
[ "0.6209727", "0.6178325", "0.5868428", "0.5805301", "0.5688282", "0.55559313", "0.5507273", "0.5507273", "0.5501371", "0.5501371", "0.54975307", "0.5488677", "0.5455985", "0.5451753", "0.54478174", "0.54478174", "0.54274863", "0.5419269", "0.5419269", "0.5419269", "0.5419269"...
0.0
-1
Copies a specified amount of characters from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBufferString(n, list) { var p = list.head; var c = 1; var ret = p.data; n -= ret.length; while (p = p.next) { var str = p.data; var nb = n > str.length ? str.length : n; if (nb === str.length) ret += str;else ret += str.slice(0, n); n -= nb; if (n === 0) { if (nb ===...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.75634474", "0.75634474", "0.75634474", "0.75146735", "0.75051266", "0.6852791", "0.6747564", "0.6714847" ]
0.0
-1
Copies a specified amount of bytes from the list of buffered data chunks. This function is designed to be inlinable, so please take care when making changes to the function body.
function copyFromBuffer(n, list) { var ret = Buffer.allocUnsafe(n); var p = list.head; var c = 1; p.data.copy(ret); n -= p.data.length; while (p = p.next) { var buf = p.data; var nb = n > buf.length ? buf.length : n; buf.copy(ret, ret.length - n, 0, nb); n -= nb; if (n === 0) { if ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function copyFromBufferString(n,list){var p=list.head;var c=1;var ret=p.data;n-=ret.length;while(p=p.next){var str=p.data;var nb=n>str.length?str.length:n;if(nb===str.length)ret+=str;else ret+=str.slice(0,n);n-=nb;if(n===0){if(nb===str.length){++c;if(p.next)list.head=p.next;else list.head=list.tail=null;}else{list...
[ "0.71230704", "0.71230704", "0.71230704", "0.6895239", "0.68703276", "0.6340849", "0.63128674", "0.63093835" ]
0.0
-1
It seems a linked list but it is not there will be only 2 of these for each stream
function CorkedRequest(state) { var _this = this; this.next = null; this.entry = null; this.finish = function () { onCorkedFinish(_this, state); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isStream(){\n return this.iterators.length > 0 && this.iterators[0].streamer && Util.isStreamer(this.iterators[0].streamer);\n }", "_doPush(){//This works best for streaming from filesystem (since it is static/finite) and JS generators too...\n var obj;\n\n if( !this.isDis...
[ "0.605774", "0.59728974", "0.59716904", "0.58954966", "0.58491564", "0.58058494", "0.58055806", "0.5790184", "0.577992", "0.5746364", "0.5742644", "0.5721635", "0.5713622", "0.5710665", "0.5692491", "0.5673744", "0.56615263", "0.56533605", "0.5646985", "0.5646738", "0.5617979...
0.0
-1
Checks that a usersupplied chunk is valid, especially for the particular mode the stream is in. Currently this means that `null` is never accepted and undefined/nonstring values are only allowed in object mode.
function validChunk(stream, state, chunk, cb) { var valid = true; var er = false; if (chunk === null) { er = new TypeError('May not write null values to stream'); } else if (typeof chunk !== 'string' && chunk !== undefined && !state.objectMode) { er = new TypeError('Invalid non-string/buffer chunk'); ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validChunk(stream,state,chunk,cb){var valid=true;var er=false;if(chunk===null){er=new TypeError(\"May not write null values to stream\")}else if(typeof chunk!==\"string\"&&chunk!==undefined&&!state.objectMode){er=new TypeError(\"Invalid non-string/buffer chunk\")}if(er){stream.emit(\"error\",er);processNe...
[ "0.8009824", "0.7968864", "0.79593676", "0.79461837", "0.7909868", "0.79044735", "0.7848438", "0.78329235", "0.78329235", "0.7811855", "0.78056455", "0.7804267", "0.7804267", "0.7804149", "0.7804149", "0.77960306", "0.77960306", "0.77960306", "0.77960306", "0.77960306", "0.77...
0.0
-1
if we're already writing something, then just put this in the queue, and wait our turn. Otherwise, call _write If we return false, then we need a drain event, so set that flag.
function writeOrBuffer(stream, state, isBuf, chunk, encoding, cb) { if (!isBuf) { var newChunk = decodeChunk(state, chunk, encoding); if (chunk !== newChunk) { isBuf = true; encoding = 'buffer'; chunk = newChunk; } } var len = state.objectMode ? 1 : chunk.length; state.length += l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if there's something in the buffer waiting, then process it", "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit('drain');}}// if the...
[ "0.7143456", "0.7143456", "0.7143456", "0.7143456", "0.69725215", "0.6951243", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", "0.6888608", ...
0.0
-1
Must force callback to be called on nextTick, so that we don't emit 'drain' before the write() consumer gets the 'false' return value, and has a chance to attach a 'drain' listener.
function onwriteDrain(stream, state) { if (state.length === 0 && state.needDrain) { state.needDrain = false; stream.emit('drain'); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onwriteDrain(stream,state){if(state.length===0&&state.needDrain){state.needDrain=false;stream.emit(\"drain\")}}", "onDrain() {\n this.writeBuffer.splice(0, this.prevBufferLen); // setting prevBufferLen = 0 is very important\n // for example, when upgrading, upgrade packet is sent over,\n // and...
[ "0.6865807", "0.68425786", "0.6840534", "0.6840534", "0.6840534", "0.6840534", "0.68187344", "0.6766642", "0.6766642", "0.6757269", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", "0.6720652", ...
0.0
-1
if there's something in the buffer waiting, then process it
function clearBuffer(stream, state) { state.bufferProcessing = true; var entry = state.bufferedRequest; if (stream._writev && entry && entry.next) { // Fast case, write everything using _writev() var l = state.bufferedRequestCount; var buffer = new Array(l); var holder = state.corkedRequestsFree;...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processBuffer () {\n this.ready = true\n this._triggerBuffer()\n this.queue.waterfall(() => this.buffer.guardian)\n }", "function drainBuffer(cb) {\n if (!state.buffer.length)\n return cb()\n var done = multicb()\n var wait = false\n state.buffer.forEach(function(entry) {\n if (ha...
[ "0.69900215", "0.6405708", "0.6361961", "0.6211318", "0.6020395", "0.595073", "0.59407544", "0.59407544", "0.59407544", "0.59407544", "0.5903335", "0.58679324", "0.5827529", "0.5818246", "0.58165276", "0.5804541", "0.5792543", "0.5761614", "0.5761614", "0.5761614", "0.5761614...
0.0
-1
undocumented cb() API, needed for core, not for public API
function destroy(err, cb) { var _this = this; var readableDestroyed = this._readableState && this._readableState.destroyed; var writableDestroyed = this._writableState && this._writableState.destroyed; if (readableDestroyed || writableDestroyed) { if (cb) { cb(err); } else if (err && (!this._wri...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback() {}", "function callback(){}", "function cb () {\n\t\tcallback();\n\t}", "function callback(cb){\n\n cb(1);\n}", "function callbackDriver() {\n cb();\n }", "function _...
[ "0.7931035", "0.7931035", "0.7931035", "0.7931035", "0.7931035", "0.78800404", "0.77471286", "0.7327083", "0.72358775", "0.7153048", "0.7144767", "0.7144767", "0.7129538", "0.70338434", "0.70277834", "0.70002323", "0.69745857", "0.6934709", "0.6922737", "0.68061507", "0.68061...
0.0
-1
Do not cache `Buffer.isEncoding` when checking encoding names as some modules monkeypatch it to support additional encodings
function normalizeEncoding(enc) { var nenc = _normalizeEncoding(enc); if (typeof nenc !== 'string' && (Buffer.isEncoding === isEncoding || !isEncoding(enc))) throw new Error('Unknown encoding: ' + enc); return nenc || enc; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectUTF8(txt) {\n if(txt) return txt.match(/([\\xC2-\\xDF][\\x80-\\xBF]|\\xE0[\\xA0-\\xBF][\\x80-\\xBF]|[\\xE1-\\xEF][\\x80-\\xBF][\\x80-\\xBF]|\\xF0[\\x90-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[\\xF1-\\xF7][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|\\xF8[\\x88-\\xBF][\\x80-\\xBF][\\x80-\\xBF][\\x80-\\xBF]|[...
[ "0.66366535", "0.65744627", "0.6534928", "0.64787394", "0.6463427", "0.6265117", "0.6263352", "0.62615985", "0.62555206", "0.6209522", "0.6144942", "0.6139519", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364", "0.6107364"...
0.0
-1
Checks the type of a UTF8 byte, whether it's ASCII, a leading byte, or a continuation byte.
function utf8CheckByte(byte) { if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4; return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function $lrG1$var$utf8CheckByte(byte) {\n if (byte <= 0x7F) return 0;else if (byte >> 5 === 0x06) return 2;else if (byte >> 4 === 0x0E) return 3;else if (byte >> 3 === 0x1E) return 4;\n return byte >> 6 === 0x02 ? -1 : -2;\n} // Checks at most 3 bytes at the end of a Buffer in order to detect an", "function u...
[ "0.75907916", "0.75846523", "0.7503325", "0.73127204", "0.73127204", "0.71718025", "0.71557856", "0.7155647", "0.7155647", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811", "0.7140811...
0.7145775
47
Checks at most 3 bytes at the end of a Buffer in order to detect an incomplete multibyte UTF8 character. The total number of bytes (2, 3, or 4) needed to complete the UTF8 character (if applicable) are returned.
function utf8CheckIncomplete(self, buf, i) { var j = buf.length - 1; if (j < i) return 0; var nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 1; return nb; } if (--j < i) return 0; nb = utf8CheckByte(buf[j]); if (nb >= 0) { if (nb > 0) self.lastNeed = nb - 2; ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.8210542", "0.8210542", "0.81338847", "0.81338847", "0.80531883", "0.80531883", "0.80293983", "0.80098975", "0.78473496", "0.7843246", "0.7776618", "0.7705953", "0.7693504", "0.7693504", "0.7693504", "0.7693504", "0.7693504", "0.7693504", "0.7693504", "0.7693504", "0.769350...
0.7749451
46
Validates as many continuation bytes for a multibyte UTF8 character as needed or are available. If we see a noncontinuation byte where we expect one, we "replace" the validated continuation bytes we've seen so far with UTF8 replacement characters ('\ufffd'), to match v8's UTF8 decoding behavior. The continuation byte c...
function utf8CheckExtraBytes(self, buf, p) { if ((buf[0] & 0xC0) !== 0x80) { self.lastNeed = 0; return '\uFFFD'.repeat(p); } if (self.lastNeed > 1 && buf.length > 1) { if ((buf[1] & 0xC0) !== 0x80) { self.lastNeed = 1; return '\uFFFD'.repeat(p + 1); } if (self.lastNeed > 2 && buf.l...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckIncomplete(self,buf,i){var j=buf.length-1;if(j<i)return 0;var nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-1;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){if(nb>0)self.lastNeed=nb-2;return nb;}if(--j<i||nb===-2)return 0;nb=utf8CheckByte(buf[j]);if(nb>=0){...
[ "0.8013975", "0.8013975", "0.75450575", "0.7392284", "0.7392284", "0.72336304", "0.67551005", "0.66326064", "0.66070175", "0.6590578", "0.65727365", "0.64758664", "0.64512587", "0.63302714", "0.6072749", "0.6072749", "0.6072749", "0.6072749", "0.6072749", "0.6072749", "0.6072...
0.0
-1
Attempts to complete a multibyte UTF8 character using bytes from a Buffer.
function utf8FillLast(buf) { var p = this.lastTotal - this.lastNeed; var r = utf8CheckExtraBytes(this, buf, p); if (r !== undefined) return r; if (this.lastNeed <= buf.length) { buf.copy(this.lastChar, p, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } buf.copy(...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function utf8CheckExtraBytes(self,buf,p){if((buf[0]&0xC0)!==0x80){self.lastNeed=0;return '\\ufffd';}if(self.lastNeed>1&&buf.length>1){if((buf[1]&0xC0)!==0x80){self.lastNeed=1;return '\\ufffd';}if(self.lastNeed>2&&buf.length>2){if((buf[2]&0xC0)!==0x80){self.lastNeed=2;return '\\ufffd';}}}}// Attempts to complete a ...
[ "0.71276367", "0.70124817", "0.6781994", "0.67014897", "0.6564168", "0.6473516", "0.6473516", "0.6347521", "0.634379", "0.634379", "0.6313653", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", "0.6169375", ...
0.0
-1
Returns all complete UTF8 characters in a Buffer. If the Buffer ended on a partial character, the character's bytes are buffered until the required number of bytes are available.
function utf8Text(buf, i) { var total = utf8CheckIncomplete(this, buf, i); if (!this.lastNeed) return buf.toString('utf8', i); this.lastTotal = total; var end = buf.length - (total - this.lastNeed); buf.copy(this.lastChar, 0, end); return buf.toString('utf8', i, end); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1