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
Calculate seg.forwardCoord and seg.backwardCoord for the segment, where both values range from 0 to 1. If the calendar is lefttoright, the seg.backwardCoord maps to "left" and seg.forwardCoord maps to "right" (via percentage). Viceversa if the calendar is righttoleft. The segment might be part of a "series", which mean...
function computeSlotSegCoords(seg, seriesBackwardPressure, seriesBackwardCoord) { var forwardSegs = seg.forwardSegs; var i; if (seg.forwardCoord === undefined) { // not already computed if (!forwardSegs.length) { // if there are no forward segments, this segment should butt up against the edge seg.forward...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeSlotSegCoords(seg, seriesBackwardPressure, seriesBackwardCoord) {\n var forwardSegs = seg.forwardSegs;\n var i;\n\n if (seg.forwardCoord === undefined) { // not already computed\n\n if (!forwardSegs.length) {\n\n // if there are no forward segments, th...
[ "0.72145176", "0.6889387", "0.68076193", "0.5324146", "0.50055045", "0.4932794", "0.48299918", "0.4652368", "0.46401173", "0.46400362", "0.45985082", "0.45467505", "0.454511", "0.45049733", "0.4497851", "0.4469056", "0.4469056", "0.44521376", "0.44521376", "0.44521376", "0.44...
0.7148721
6
Outputs a flat array of segments, from lowest to highest level
function flattenSlotSegLevels(levels) { var segs = []; var i, level; var j; for (i=0; i<levels.length; i++) { level = levels[i]; for (j=0; j<level.length; j++) { segs.push(level[j]); } } return segs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function n(a){var b,c,d,e=M(),f=[];\n// group segments by row\nfor(b=0;b<a.length;b++)c=a[b],d=c.row,c.element&&(// was rendered?\nf[d]?\n// already other segments. append to array\nf[d].push(c):\n// first segment in row. create new array\nf[d]=[c]);\n// sort each row\nfor(d=0;d<e;d++)f[d]=o(f[d]||[]);return f}", ...
[ "0.65865535", "0.6370189", "0.6370189", "0.6370189", "0.6370189", "0.6370189", "0.6002403", "0.59722155", "0.59133196", "0.59133196", "0.59133196", "0.59133196", "0.59133196", "0.5782829", "0.576825", "0.576825", "0.576825", "0.576825", "0.576825", "0.57671696", "0.5751859", ...
0.5949408
12
Find all the segments in `otherSegs` that vertically collide with `seg`. Append into an optionallysupplied `results` array and return.
function computeSlotSegCollisions(seg, otherSegs, results) { results = results || []; for (var i=0; i<otherSegs.length; i++) { if (isSlotSegCollision(seg, otherSegs[i])) { results.push(otherSegs[i]); } } return results; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function computeSlotSegCollisions(seg, otherSegs, results) {\n if (results === void 0) {\n results = [];\n }\n\n for (var i = 0; i < otherSegs.length; i++) {\n if (isSlotSegCollision(seg, otherSegs[i])) {\n results.push(otherSegs[i]);\n }\n }\n\n ...
[ "0.75552076", "0.7554956", "0.73930985", "0.7213072", "0.7176824", "0.7176824", "0.7176824", "0.7161462", "0.7161462", "0.7161462", "0.7161462", "0.7161462", "0.7153454", "0.7063159", "0.60005367", "0.59429127", "0.5453077", "0.5362018", "0.52311957", "0.52272135", "0.5197825...
0.7108713
25
Do these segments occupy the same vertical space?
function isSlotSegCollision(seg1, seg2) { return seg1.end > seg2.start && seg1.start < seg2.end; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "resolveSegmentSegment(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n const result = [];\n const isHorizontal1 = ax2 - ax1 > ay2 - ay1;\n const isHorizontal2 = bx2 - bx1 > by2 - by1;\n\n if (isHorizontal1 && isHorizontal2 &&\n by1 === ay1 &&\n ((ax1 <= bx2 && ax1 >= bx...
[ "0.64234924", "0.6271825", "0.6148352", "0.60231054", "0.5959933", "0.58803403", "0.5865494", "0.58606356", "0.58439827", "0.58426327", "0.58375865", "0.58350235", "0.5800868", "0.58000726", "0.57837456", "0.57215863", "0.57215863", "0.5704195", "0.5704195", "0.5704195", "0.5...
0.0
-1
A cmp function for determining which forward segment to rely on more when computing coordinates.
function compareForwardSlotSegs(seg1, seg2) { // put higher-pressure first return seg2.forwardPressure - seg1.forwardPressure || // put segments that are closer to initial edge first (and favor ones with no coords yet) (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) || // do normal sorting... compareSlo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareForwardSlotSegs(seg1, seg2) {\n // put higher-pressure first\n return seg2.forwardPressure - seg1.forwardPressure ||\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0...
[ "0.661767", "0.658723", "0.645648", "0.645648", "0.60996675", "0.6083703", "0.60257", "0.59968686", "0.59018517", "0.57887083", "0.5752242", "0.5744045", "0.57433367", "0.5743011", "0.5735109", "0.5687681", "0.5687681", "0.56798077", "0.56597507", "0.5640013", "0.55897987", ...
0.66078544
4
A cmp function for determining which segment should be closer to the initial edge (the left edge on a lefttoright calendar).
function compareSlotSegs(seg1, seg2) { return seg1.start - seg2.start || // earlier start time goes first (seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first (seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareDaySegments(a, b) {\n\treturn (b.rightCol - b.leftCol) - (a.rightCol - a.leftCol) || // put wider events first\n\t\tb.event.allDay - a.event.allDay || // if tie, put all-day events first (booleans cast to 0/1)\n\t\ta.event.start - b.event.start || // if a tie, sort by event start date\n\t\t(a.event...
[ "0.64841956", "0.64841956", "0.64841956", "0.64782214", "0.6472519", "0.6469082", "0.6469082", "0.64244586", "0.64244586", "0.64244586", "0.64244586", "0.64244586", "0.62643814", "0.6156284", "0.6156284", "0.6156284", "0.6156284", "0.6156284", "0.613294", "0.613294", "0.60825...
0.5702905
61
Event Editable Boolean Calculations
function isEventDraggable(event) { var source = event.source || {}; return firstDefined( event.startEditable, source.startEditable, opt('eventStartEditable'), event.editable, source.editable, opt('editable') ) && !opt('disableDragging'); // deprecated }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shouldUpdate(e){return!0}", "function fContext(event) {\n if (!event)\n event = getEvent(event);\n var obj = event.srcElement || event.target;\n if (obj.type == \"text\" || obj.type == \"textarea\") {\n obj.IsCheckedOnKd = true;\n return true;\n }\n else\n return false;...
[ "0.6374672", "0.5900065", "0.58899015", "0.58024275", "0.57794243", "0.56951785", "0.5663789", "0.5582251", "0.5573124", "0.55498624", "0.554738", "0.55345094", "0.55313414", "0.5530492", "0.55189085", "0.5517357", "0.55056113", "0.5494113", "0.5473155", "0.544875", "0.544860...
0.0
-1
returns a Date object for an event's end
function eventEnd(event) { return event.end ? cloneDate(event.end) : defaultEventEnd(event); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get endTime() {\n let result = null;\n if (this.ended) {\n result = new Date(this.startTime.getTime() + this.duration);\n }\n return result;\n }", "getEndOfDay() {\n const endOfDay = new UniversalDate(this.date);\n endOfDay.date.setUTCHours(23);\n endOfDay.date....
[ "0.6729883", "0.66035736", "0.6551354", "0.6455725", "0.64408535", "0.62579197", "0.6198936", "0.6056017", "0.60454184", "0.60088706", "0.60088706", "0.5981692", "0.58522236", "0.58233297", "0.5810547", "0.5797141", "0.57970375", "0.57565784", "0.57541823", "0.5730768", "0.56...
0.80887157
1
Event Elements report when view creates an element for an event
function reportEventElement(event, element) { eventElementCouples.push({ event: event, element: element }); if (eventElementsByID[event._id]) { eventElementsByID[event._id].push(element); }else{ eventElementsByID[event._id] = [element]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _onElementAdded() {\n \n\t\t\t countElements++;\n \n\t\t\t //add all elements of a view\n\t\t\t if(countElements < elements.length) {\n\t\t\t\t var element = elements[countElements];\n\t\t\t\t if(!_removeNotValidElementObj(element)) {\n\t\t\t\t\t instance.addElement( element.type, element.source, ...
[ "0.6776793", "0.6702373", "0.6371938", "0.6188468", "0.6181015", "0.6181015", "0.6181015", "0.6172564", "0.6078908", "0.60667634", "0.6004926", "0.59632623", "0.5922792", "0.589542", "0.5859667", "0.5859667", "0.5851978", "0.5837908", "0.58021235", "0.5784641", "0.57688", "...
0.6136239
12
attaches eventClick, eventMouseover, eventMouseout
function eventElementHandlers(event, eventElement) { eventElement .click(function(ev) { if (!eventElement.hasClass('ui-draggable-dragging') && !eventElement.hasClass('ui-resizable-resizing')) { return trigger('eventClick', this, event, ev); } }) .hover( function(ev) { trigger('ev...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addE(n){\n n.addEventListener(\"mouseover\", over);\n n.addEventListener(\"mouseout\", out);\n n.addEventListener(\"click\", click);\n}", "function addEventListeners() {\r document.getElementById(\"clickTag\").addEventListener(\"click\", clickthrough);\r\tdocument.getElementById(\"clickTag\").addE...
[ "0.70697653", "0.6895282", "0.67447406", "0.6630171", "0.6528773", "0.65242267", "0.6403982", "0.63784784", "0.6350967", "0.6292795", "0.6292795", "0.62927246", "0.62601703", "0.6218493", "0.6196979", "0.6185429", "0.61851877", "0.6113366", "0.6103146", "0.6103146", "0.610010...
0.0
-1
Is the current day hidden? `day` is a dayofweek index (06), or a Date object
function isHiddenDay(day) { if (typeof day == 'object') { day = day.getDay(); } return isHiddenDayHash[day]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHiddenDay(day) {\n\t\tif (moment.isMoment(day)) {\n\t\t\tday = day.day();\n\t\t}\n\t\treturn isHiddenDayHash[day];\n\t}", "function isHiddenDay(day) {\n\t\tif (moment.isMoment(day)) {\n\t\t\tday = day.day();\n\t\t}\n\t\treturn isHiddenDayHash[day];\n\t}", "isDay() {\n\t\treturn (Date.now() + 60000 *...
[ "0.7995713", "0.7995713", "0.65326756", "0.6412873", "0.6258095", "0.6251579", "0.6239685", "0.6140315", "0.61022156", "0.60843164", "0.6054245", "0.6049217", "0.60408616", "0.6026903", "0.5969462", "0.5950089", "0.59450924", "0.5944389", "0.5924504", "0.5918209", "0.5906734"...
0.8228789
1
Keep incrementing the current day until it is no longer a hidden day. If the initial value of `date` is not a hidden day, don't do anything. Pass `isExclusive` as `true` if you are dealing with an end date. `inc` defaults to `1` (increment one day forward each time)
function skipHiddenDays(date, inc, isExclusive) { inc = inc || 1; while ( isHiddenDayHash[ ( date.getDay() + (isExclusive ? inc : 0) + 7 ) % 7 ] ) { addDays(date, inc); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function skipHiddenDays(date, inc, isExclusive) {\n\t\tvar out = date.clone();\n\t\tinc = inc || 1;\n\t\twhile (\n\t\t\tisHiddenDayHash[(out.day() + (isExclusive ? inc : 0) + 7) % 7]\n\t\t) {\n\t\t\tout.add('days', inc);\n\t\t}\n\t\treturn out;\n\t}", "function skipHiddenDays(date, inc, isExclusive) {\n\t\tvar o...
[ "0.73943055", "0.73943055", "0.612547", "0.6119797", "0.59336084", "0.5883459", "0.5559785", "0.54565847", "0.5366886", "0.5352873", "0.5349927", "0.5287219", "0.5190578", "0.5187464", "0.51595217", "0.50864446", "0.506023", "0.50530714", "0.5033056", "0.4995627", "0.49903795...
0.7422984
1
cell offset > day offset
function cellOffsetToDayOffset(cellOffset) { var day0 = t.visStart.getDay(); // first date's day of week cellOffset += dayToCellMap[day0]; // normlize cellOffset to beginning-of-week return Math.floor(cellOffset / cellsPerWeek) * 7 // # of days from full weeks + cellToDayMap[ // # of days from partial last wee...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dayOffsetToCellOffset(dayOffset) {\n\t\tvar day0 = t.visStart.getDay(); // first date's day of week\n\t\tdayOffset += day0; // normalize dayOffset to beginning-of-week\n\t\treturn Math.floor(dayOffset / 7) * cellsPerWeek // # of cells from full weeks\n\t\t\t+ dayToCellMap[ // # of cells from partial last ...
[ "0.7144688", "0.7144688", "0.7144688", "0.7053415", "0.7053415", "0.68077415", "0.68077415", "0.600007", "0.59222496", "0.5801507", "0.5801507", "0.5801507", "0.5801507", "0.5801507", "0.57486504", "0.57306266", "0.5674545", "0.56581914", "0.55727714", "0.55727714", "0.557277...
0.6942672
7
day offset > date (JavaScript Date object)
function dayOffsetToDate(dayOffset) { var date = cloneDate(t.visStart); addDays(date, dayOffset); return date; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "function dateToDayOffset(date) {\n\t\treturn dayDiff(date, t.visStart);\n\t}", "function dateToDayOffset(da...
[ "0.75193644", "0.75193644", "0.717648", "0.717648", "0.717648", "0.71749514", "0.7152707", "0.65581214", "0.65581214", "0.6480398", "0.62511355", "0.6242571", "0.6144856", "0.6016284", "0.5947486", "0.59390366", "0.5920385", "0.58628374", "0.58557093", "0.5851208", "0.5831339...
0.6605572
8
TRANSFORMATIONS: date > day offset > cell offset > cell date > cell (combines all transformations)
function dateToCell(date) { var dayOffset = dateToDayOffset(date); var cellOffset = dayOffsetToCellOffset(dayOffset); var cell = cellOffsetToCell(cellOffset); return cell; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dayOffsetToCellOffset(dayOffset) {\n\t\tvar day0 = t.start.day(); // first date's day of week\n\t\tdayOffset += day0; // normalize dayOffset to beginning-of-week\n\t\treturn Math.floor(dayOffset / 7) * cellsPerWeek + // # of cells from full weeks\n\t\t\tdayToCellMap[ // # of cells from partial last week\n...
[ "0.5513567", "0.5513567", "0.5480849", "0.5480849", "0.544876", "0.5447136", "0.5447136", "0.5447136", "0.5423239", "0.5423239", "0.5423239", "0.52923745", "0.52917147", "0.5036175", "0.50296986", "0.5012839", "0.49849567", "0.48386535", "0.47930777", "0.47927776", "0.4766279...
0.5553793
3
date > day offset
function dateToDayOffset(date) { return dayDiff(date, t.visStart); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "function dateToDayOffset(date) {\n\t\treturn date.clone().stripTime().diff(t.start, 'days');\n\t}", "getDateOffset(date) {\n let currentTime = date ? new Date(date) : new Date();\n let currentOffset = dat...
[ "0.6852997", "0.6852997", "0.66000175", "0.64474636", "0.6234923", "0.6171766", "0.60891175", "0.6050031", "0.59065974", "0.5902533", "0.5902533", "0.5902533", "0.5865114", "0.58583325", "0.58446234", "0.5819917", "0.5819917", "0.5757572", "0.56975555", "0.5696399", "0.568664...
0.6656873
3
day offset > cell offset
function dayOffsetToCellOffset(dayOffset) { var day0 = t.visStart.getDay(); // first date's day of week dayOffset += day0; // normalize dayOffset to beginning-of-week return Math.floor(dayOffset / 7) * cellsPerWeek // # of cells from full weeks + dayToCellMap[ // # of cells from partial last week (dayOffse...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dayOffsetToCellOffset(dayOffset) {\n\t\tvar day0 = t.start.day(); // first date's day of week\n\t\tdayOffset += day0; // normalize dayOffset to beginning-of-week\n\t\treturn Math.floor(dayOffset / 7) * cellsPerWeek + // # of cells from full weeks\n\t\t\tdayToCellMap[ // # of cells from partial last week\n...
[ "0.71999806", "0.71999806", "0.7089495", "0.7089495", "0.7089495", "0.69556844", "0.69556844", "0.6013744", "0.6004352", "0.5970007", "0.59467673", "0.5759576", "0.57284325", "0.57284325", "0.57284325", "0.5680983", "0.5680983", "0.5680983", "0.5680983", "0.5680983", "0.56653...
0.7303795
1
cell offset > cell (object with row & col keys)
function cellOffsetToCell(cellOffset) { var colCnt = t.getColCnt(); // rtl variables. wish we could pre-populate these. but where? var dis = isRTL ? -1 : 1; var dit = isRTL ? colCnt - 1 : 0; var row = Math.floor(cellOffset / colCnt); var col = ((cellOffset % colCnt + colCnt) % colCnt) * dis + dit; // colu...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getCellPosition(column, row) {\n return {x: column * CELL.WIDTH, y: row * CELL.HEIGHT};\n }", "function findPosition(cell) {\n let x = parseInt(cell.attr(\"value\").substring(0, 1));\n let y = parseInt(cell.attr(\"value\").substring(1));\n\n return {\n x: x, \n y: y\n ...
[ "0.7319825", "0.70336825", "0.6954565", "0.67027235", "0.66995287", "0.6691314", "0.6675111", "0.6674823", "0.6662998", "0.6581578", "0.6533822", "0.64943516", "0.645391", "0.6449585", "0.6431887", "0.6417582", "0.6417582", "0.6417582", "0.6417582", "0.6417582", "0.6376607", ...
0.62901706
28
Converts a date range into an array of segment objects. "Segments" are horizontal stretches of time, sliced up by row. A segment object has the following properties: row cols isStart isEnd
function rangeToSegments(startDate, endDate) { var rowCnt = t.getRowCnt(); var colCnt = t.getColCnt(); var segments = []; // array of segments to return // day offset for given date range var rangeDayOffsetStart = dateToDayOffset(startDate); var rangeDayOffsetEnd = dateToDayOffset(endDate); // exclusive ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rangeToSegments(start, end) {\n\n\t\tvar rowCnt = t.getRowCnt();\n\t\tvar colCnt = t.getColCnt();\n\t\tvar segments = []; // array of segments to return\n\n\t\t// day offset for given date range\n\t\tvar rangeDayOffsetStart = dateToDayOffset(start);\n\t\tvar rangeDayOffsetEnd = dateToDayOffset(end); // an...
[ "0.81465906", "0.81465906", "0.68557835", "0.68557835", "0.68557835", "0.62511235", "0.62511235", "0.6188441", "0.5745242", "0.57336265", "0.5602152", "0.5567534", "0.5527414", "0.5527414", "0.5527414", "0.5527414", "0.5527414", "0.54799587", "0.5439216", "0.5436408", "0.5431...
0.8138951
3
Render `events` onto the calendar, attach mouse event handlers, and call the `eventAfterRender` callback for each. Mouse event will be lazily applied, except if the event has an ID of `modifiedEventId`. Can only be called when the event container is empty (because it wipes out all innerHTML).
function renderDayEvents(events, modifiedEventId) { // do the actual rendering. Receive the intermediate "segment" data structures. var segments = _renderDayEvents( events, false, // don't append event elements true // set the heights of the rows ); // report the elements to the View, for general dra...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderEvents() {\n var totalPercent = 100,\n currentEvent,\n curCol,\n width,\n height,\n leftOffset,\n eventText,\n i,\n j;\n \n // empty container before adding new events\n $el.empty();\n \n // go through all columns\n for (i=...
[ "0.6431365", "0.60822344", "0.592008", "0.592008", "0.592008", "0.592008", "0.592008", "0.5899054", "0.5792027", "0.57906884", "0.57150984", "0.5669562", "0.5661558", "0.5656712", "0.56449986", "0.5508188", "0.54560643", "0.5451107", "0.5451107", "0.5451107", "0.5451107", "...
0.7326243
3
Render an event on the calendar, but don't report them anywhere, and don't attach mouse handlers. Append this event element to the event container, which might already be populated with events. If an event's segment will have row equal to `adjustRow`, then explicitly set its top coordinate to `adjustTop`. This hack is ...
function renderTempDayEvent(event, adjustRow, adjustTop) { // actually render the event. `true` for appending element to container. // Recieve the intermediate "segment" data structures. var segments = _renderDayEvents( [ event ], true, // append event elements false // don't set the heights of the rows...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderEvents() {\n var totalPercent = 100,\n currentEvent,\n curCol,\n width,\n height,\n leftOffset,\n eventText,\n i,\n j;\n \n // empty container before adding new events\n $el.empty();\n \n // go through all columns\n for (i=...
[ "0.6346088", "0.61836183", "0.61836183", "0.61836183", "0.61836183", "0.61836183", "0.5974763", "0.5743679", "0.5692324", "0.563062", "0.5603325", "0.5543619", "0.55421126", "0.55203176", "0.5512747", "0.5512747", "0.5512747", "0.5484708", "0.54687274", "0.54385126", "0.54295...
0.73439074
3
Render events onto the calendar. Only responsible for the VISUAL aspect. Not responsible for attaching handlers or calling callbacks. Set `doAppend` to `true` for rendering elements without clearing the existing container. Set `doRowHeights` to allow setting the height of each row, to compensate for vertical event over...
function _renderDayEvents(events, doAppend, doRowHeights) { // where the DOM nodes will eventually end up var finalContainer = getDaySegmentContainer(); // the container where the initial HTML will be rendered. // If `doAppend`==true, uses a temporary container. var renderContainer = doAppend ? $("<div/>") ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderEvents() {\n var totalPercent = 100,\n currentEvent,\n curCol,\n width,\n height,\n leftOffset,\n eventText,\n i,\n j;\n \n // empty container before adding new events\n $el.empty();\n \n // go through all columns\n for (i=...
[ "0.76297015", "0.69982445", "0.66769207", "0.6400507", "0.6400507", "0.6400507", "0.6400507", "0.6400507", "0.6303442", "0.628121", "0.61521935", "0.6136223", "0.61312723", "0.6083419", "0.5957453", "0.59519196", "0.58935326", "0.587446", "0.5813661", "0.5755863", "0.57521236...
0.7676453
3
Generate an array of "segments" for all events.
function buildSegments(events) { var segments = []; for (var i=0; i<events.length; i++) { var eventSegments = buildSegmentsForEvent(events[i]); segments.push.apply(segments, eventSegments); // append an array to an array } return segments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSegmentsForEvent(event) {\n\t\tvar segments = rangeToSegments(event.start, getEventEnd(event));\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "function buildSegmentsForEvent(event) {\n\t\tvar segments = rangeToSegments(event.start...
[ "0.74764097", "0.74764097", "0.73861265", "0.73861265", "0.73861265", "0.57995147", "0.5690146", "0.56633604", "0.5631998", "0.55718815", "0.55718815", "0.55718815", "0.55708164", "0.5524673", "0.5524673", "0.54720145", "0.5427073", "0.54232", "0.5364946", "0.53481823", "0.53...
0.7994129
3
Generate an array of segments for a single event. A "segment" is the same data structure that View.rangeToSegments produces, with the addition of the `event` property being set to reference the original event.
function buildSegmentsForEvent(event) { var startDate = event.start; var endDate = exclEndDay(event); var segments = rangeToSegments(startDate, endDate); for (var i=0; i<segments.length; i++) { segments[i].event = event; } return segments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildSegmentsForEvent(event) {\n\t\tvar segments = rangeToSegments(event.start, getEventEnd(event));\n\t\tfor (var i=0; i<segments.length; i++) {\n\t\t\tsegments[i].event = event;\n\t\t}\n\t\treturn segments;\n\t}", "function buildSegmentsForEvent(event) {\n\t\tvar segments = rangeToSegments(event.start...
[ "0.78401405", "0.78401405", "0.6865044", "0.6865044", "0.6865044", "0.6865044", "0.6865044", "0.6294114", "0.6294114", "0.6216291", "0.6216291", "0.6216291", "0.5960649", "0.57300764", "0.55104256", "0.55104256", "0.55104256", "0.5481302", "0.5481302", "0.5481302", "0.5268088...
0.77801394
3
Sets the `left` and `outerWidth` property of each segment. These values are the desired dimensions for the eventual DOM elements.
function calculateHorizontals(segments) { var isRTL = opt('isRTL'); for (var i=0; i<segments.length; i++) { var segment = segments[i]; // Determine functions used for calulating the elements left/right coordinates, // depending on whether the view is RTL or not. // NOTE: // colLeft/colRight returns ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setBoxWidths() {\n var leftWidth = dragBarPos - 2,\n rightWidth = outerWidth - dragBarPos - 12;\n\n left.css('width', '' + toPercent(leftWidth) + '%');\n right.css('width', '' + toPercent(rightWidth) + '%');\n }", "function d(b,c,d){\n// where the...
[ "0.60891944", "0.6068485", "0.5977803", "0.5767581", "0.56749994", "0.5655121", "0.5632199", "0.5585059", "0.54951835", "0.5461566", "0.5442458", "0.54317987", "0.5415897", "0.5406584", "0.5394419", "0.537315", "0.53341174", "0.52927583", "0.5290128", "0.52874357", "0.5257708...
0.705896
3
Build a concatenated HTML string for an array of segments
function buildHTML(segments) { var html = ''; for (var i=0; i<segments.length; i++) { html += buildHTMLForSegment(segments[i]); } return html; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combineSegments() {\n\t\tvar result = '';\n\t\ttotalSegments = segments.length;\n\t\tfor (var i = 0; i < segments.length; i++) {\n\t\t\tif (segments[i].isEmpty()) {\n\t\t\t\ttotalSegments--;\n\t\t\t\tcontinue;\n\t\t\t\t\n\t\t\t}\n\t\t\tresult += segments[i].asText();\n\t\t}\n\t\treturn result;\n\t}", "f...
[ "0.6436715", "0.6024399", "0.6024399", "0.6024399", "0.5998631", "0.5996163", "0.5639905", "0.54803085", "0.5434722", "0.5406663", "0.54057944", "0.54003", "0.5374191", "0.53732914", "0.536657", "0.5340935", "0.53226066", "0.5321825", "0.53137153", "0.52845955", "0.5265781", ...
0.84847665
3
Build an HTML string for a single segment. Relies on the following properties: `segment.event` (from `buildSegmentsForEvent`) `segment.left` (from `calculateHorizontals`)
function buildHTMLForSegment(segment) { var html = ''; var isRTL = opt('isRTL'); var event = segment.event; var url = event.url; // generate the list of CSS classNames var classNames = [ 'fc-event', 'fc-event-hori' ]; if (isEventDraggable(event)) { classNames.push('fc-event-draggable'); } if (segm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buildHTMLForSegment(segment) {\n\t\tvar html = '';\n\t\tvar isRTL = opt('isRTL');\n\t\tvar event = segment.event;\n\t\tvar url = event.url;\n\n\t\t// generate the list of CSS classNames\n\t\tvar classNames = [ 'fc-event', 'fc-event-hori' ];\n\t\tif (isEventDraggable(event)) {\n\t\t\tclassNames.push('fc-ev...
[ "0.7770069", "0.7770069", "0.7717502", "0.77172166", "0.68673795", "0.68673795", "0.68673795", "0.68673795", "0.68673795", "0.5870832", "0.5781146", "0.5781146", "0.5781146", "0.5755761", "0.5755761", "0.5755761", "0.55722404", "0.5571858", "0.5562559", "0.5562559", "0.553352...
0.7770069
1
Associate each segment (an object) with an element (a jQuery object), by setting each `segment.element`. Run each element through the `eventRender` filter, which allows developers to modify an existing element, supply a new one, or cancel rendering.
function resolveElements(segments, elements) { for (var i=0; i<segments.length; i++) { var segment = segments[i]; var event = segment.event; var element = elements.eq(i); // call the trigger with the original element var triggerRes = trigger('eventRender', event, event, element); if (triggerRes ==...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function k(b,c){for(var d=0;d<b.length;d++){var e=b[d],f=e.event,g=c.eq(d),h=z(\"eventRender\",f,f,g);h===!1?\n// if `false`, remove the event from the DOM and don't assign it to `segment.event`\ng.remove():(h&&h!==!0&&(\n// the trigger returned a new element, but not `true` (which means keep the existing element)...
[ "0.63656646", "0.56436956", "0.56436956", "0.56436956", "0.56436956", "0.56436956", "0.55128", "0.5501312", "0.5285332", "0.5128597", "0.5128597", "0.5128597", "0.51043856", "0.51043856", "0.51043856", "0.5037433", "0.50323737", "0.5011792", "0.5010405", "0.5010405", "0.50104...
0.66600096
3
Topcoordinate Methods Sets the "top" CSS property for each element. If `doRowHeights` is `true`, also sets each row's first cell to an explicit height, so that if elements vertically overflow, the cell expands vertically to compensate.
function setVerticals(segments, doRowHeights) { var rowContentHeights = calculateVerticals(segments); // also sets segment.top var rowContentElements = getRowContentElements(); // returns 1 inner div per row var rowContentTops = []; // Set each row's height by setting height of first inner div if (doRowHeigh...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_top(top){\n\t\t\t\t\tvar row_multiple = row_height*parseInt($rows_id);\n\t\t\t\t\treturn (top + row_multiple) + 'px';\n\t\t\t\t}", "function setVerticals(segments, doRowHeights) {\n\t\tvar rowContentHeights = calculateVerticals(segments); // also sets segment.top\n\t\tvar rowContentElements = getRow...
[ "0.62780106", "0.5894834", "0.5894834", "0.57709247", "0.5713832", "0.56712687", "0.56207776", "0.5389735", "0.5387763", "0.53360677", "0.5297009", "0.5165856", "0.515003", "0.51485205", "0.5138619", "0.5128648", "0.5125497", "0.5108496", "0.50879097", "0.5080013", "0.5055526...
0.58953923
2
Calculate the "top" coordinate for each segment, relative to the "top" of the row. Also, return an array that contains the "content" height for each row (the height displaced by the vertically stacked events in the row). Requires segments to have their `outerHeight` property already set.
function calculateVerticals(segments) { var rowCnt = getRowCnt(); var colCnt = getColCnt(); var rowContentHeights = []; // content height for each row var segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row for (var rowI=0; rowI<rowCnt; rowI++) { var segmentRow = segm...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateVerticals(segments) {\n\t\tvar rowCnt = getRowCnt();\n\t\tvar colCnt = getColCnt();\n\t\tvar rowContentHeights = []; // content height for each row\n\t\tvar segmentRows = buildSegmentRows(segments); // an array of segment arrays, one for each row\n\t\tvar colI;\n\n\t\tfor (var rowI=0; rowI<rowCnt...
[ "0.7282717", "0.7282717", "0.61150455", "0.61150455", "0.61150455", "0.60714227", "0.60714227", "0.6046859", "0.59406507", "0.5937114", "0.57388973", "0.57141733", "0.57141733", "0.57141733", "0.57141733", "0.57141733", "0.5675065", "0.5637372", "0.5637372", "0.5637372", "0.5...
0.7304783
1
Build an array of segment arrays, each representing the segments that will be in a row of the grid, sorted by which event should be closest to the top.
function buildSegmentRows(segments) { var rowCnt = getRowCnt(); var segmentRows = []; var segmentI; var segment; var rowI; // group segments by row for (segmentI=0; segmentI<segments.length; segmentI++) { segment = segments[segmentI]; rowI = segment.row; if (segment.element) { // was rendered? ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function p(a){\n// Give preference to elements with certain criteria, so they have\n// a chance to be closer to the top.\na.sort(ya);for(var b=[],c=0;c<a.length;c++){\n// loop through subrows, starting with the topmost, until the segment\n// doesn't collide with other segments.\nfor(var d=a[c],e=0;e<b.length&&wa(d...
[ "0.6738897", "0.64641047", "0.64641047", "0.64641047", "0.64641047", "0.64641047", "0.63488793", "0.61982304", "0.61982304", "0.61982304", "0.61982304", "0.61982304", "0.6117158", "0.6117158", "0.6117158", "0.6117158", "0.6117158", "0.5905499", "0.5806976", "0.57262135", "0.5...
0.66758263
4
Sort an array of segments according to which segment should appear closest to the top
function sortSegmentRow(segments) { var sortedSegments = []; // build the subrow array var subrows = buildSegmentSubrows(segments); // flatten it for (var i=0; i<subrows.length; i++) { sortedSegments.push.apply(sortedSegments, subrows[i]); // append an array to an array } return sortedSegments; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function p(a){\n// Give preference to elements with certain criteria, so they have\n// a chance to be closer to the top.\na.sort(ya);for(var b=[],c=0;c<a.length;c++){\n// loop through subrows, starting with the topmost, until the segment\n// doesn't collide with other segments.\nfor(var d=a[c],e=0;e<b.length&&wa(d...
[ "0.6719305", "0.6612844", "0.6612844", "0.66056436", "0.6592666", "0.6183431", "0.60575956", "0.59962165", "0.5986516", "0.5966981", "0.5950384", "0.5915803", "0.5900797", "0.5899388", "0.5898473", "0.5898473", "0.5898473", "0.5898473", "0.5898473", "0.5889476", "0.58693546",...
0.6350748
8
Take an array of segments, which are all assumed to be in the same row, and sort into subrows.
function buildSegmentSubrows(segments) { // Give preference to elements with certain criteria, so they have // a chance to be closer to the top. segments.sort(compareDaySegments); var subrows = []; for (var i=0; i<segments.length; i++) { var segment = segments[i]; // loop through subrows, starting wi...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortSegmentRow(segments) {\n\t\tvar sortedSegments = [];\n\n\t\t// build the subrow array\n\t\tvar subrows = buildSegmentSubrows(segments);\n\n\t\t// flatten it\n\t\tfor (var i=0; i<subrows.length; i++) {\n\t\t\tsortedSegments.push.apply(sortedSegments, subrows[i]); // append an array to an array\n\t\t}\n...
[ "0.8081443", "0.8081443", "0.8081443", "0.8081443", "0.8081443", "0.7462707", "0.7462707", "0.7462707", "0.7462707", "0.7462707", "0.6796347", "0.6189457", "0.590161", "0.5885046", "0.58662325", "0.5813573", "0.57409585", "0.5733304", "0.5633917", "0.560778", "0.5563182", "...
0.72401166
13
Return an array of jQuery objects for the placeholder content containers of each row. The content containers don't actually contain anything, but their dimensions should match the events that are overlaid on top.
function getRowContentElements() { var i; var rowCnt = getRowCnt(); var rowDivs = []; for (i=0; i<rowCnt; i++) { rowDivs[i] = allDayRow(i) .find('div.fc-day-content > div'); } return rowDivs; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createContainers() {\n\t\t\t\t//console.log('Creating containers...');\n\t\t\t\t// Define html to be prepended to the body\n\t\t\t\tvar qfInner = \"<div id=\\\"qfCloseContainer\\\">&times;</div>\\n<div id=\\\"qfSheetContent\\\"></div>\";\n\t var qfSheetContainer = \"<div id=\\\"qfSh...
[ "0.5649352", "0.56072223", "0.5529934", "0.54228103", "0.53859407", "0.53843784", "0.53828293", "0.53321064", "0.5302756", "0.5291456", "0.52691966", "0.5238669", "0.5229802", "0.5219804", "0.52129", "0.52021295", "0.51813215", "0.517195", "0.5167175", "0.5163525", "0.5156956...
0.66352576
3
Mouse Handlers TODO: better documentation!
function attachHandlers(segments, modifiedEventId) { var segmentContainer = getDaySegmentContainer(); segmentElementEach(segments, function(segment, element, i) { var event = segment.event; if (event._id === modifiedEventId) { bindDaySeg(event, element, segment); }else{ element[0]._fci = i; // for...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addMouseHandlers() {\n container.addEventListener('mousedown', function(evt) {\n // console.log('mousedown', evt);\n lastX = evt.screenX;\n container.addEventListener('mousemove', mousemove);\n container.addEventListener('mouseup', function(e) {\n container.removeEventListener('mousemo...
[ "0.7325405", "0.72607493", "0.72038686", "0.71541834", "0.71367234", "0.70681775", "0.7033748", "0.7016471", "0.6984588", "0.6973756", "0.68919283", "0.68901193", "0.68901193", "0.6841584", "0.6834504", "0.6834504", "0.6806799", "0.67860967", "0.6755316", "0.6753611", "0.6753...
0.0
-1
A cmp function for determining which segments should appear higher up
function compareDaySegments(a, b) { return (b.rightCol - b.leftCol) - (a.rightCol - a.leftCol) || // put wider events first b.event.allDay - a.event.allDay || // if tie, put all-day events first (booleans cast to 0/1) a.event.start - b.event.start || // if a tie, sort by event start date (a.event.title || '').lo...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorti...
[ "0.68106085", "0.68106085", "0.68106085", "0.68106085", "0.68106085", "0.6807801", "0.6807801", "0.68019885", "0.6793479", "0.67888665", "0.64781076", "0.64781076", "0.64614296", "0.6412282", "0.631376", "0.631376", "0.631376", "0.631376", "0.631376", "0.6200559", "0.61750394...
0.6483268
11
BUG: unselect needs to be triggered when events are dragged+dropped
function SelectionManager() { var t = this; // exports t.select = select; t.unselect = unselect; t.reportSelection = reportSelection; t.daySelectionMousedown = daySelectionMousedown; // imports var opt = t.opt; var trigger = t.trigger; var defaultSelectionEnd = t.defaultSelectionEnd; var renderSelect...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "mouseUp(e){\n this._super(...arguments);\n\n\n if(e.path === undefined || e.path[0].tagName !== \"MULTI-SELECTION\"){\n return;\n }\n\n if(e.button == 0){\n e.stopPropagation();\n e.preventDefault();\n\n this.set('moveStart', false);\n }\n\n\n\n document.removeEventListener('m...
[ "0.7253007", "0.7225936", "0.7091934", "0.7037729", "0.7037729", "0.6963049", "0.695516", "0.6848542", "0.6804019", "0.6766084", "0.6756574", "0.67009467", "0.66772723", "0.6669478", "0.66557145", "0.6649642", "0.6591466", "0.656879", "0.65635383", "0.6560086", "0.6545641", ...
0.0
-1
this fix was only necessary for jQuery UI 1.8.16 (and jQuery 1.7 or 1.7.1) upgrading to jQuery UI 1.8.17 (and using either jQuery 1.7 or 1.7.1) fixed the problem but keep this in here for 1.8.16 users and maybe remove it down the line
function _fixUIEvent(event) { // for issue 1168 if (event.pageX === undefined) { event.pageX = event.originalEvent.pageX; event.pageY = event.originalEvent.pageY; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initjQueryUI() {\n var availableCategories = [\n \"category_01\",\n \"category_02\",\n \"category_03\",\n \"category_04\",\n \"category_05\",\n \"category_06\",\n \"category_07\",\n \"category_08\",\n \"category_09\",\n \"category_10...
[ "0.6307034", "0.55371004", "0.5473524", "0.54328907", "0.5421005", "0.5413723", "0.5277024", "0.5276856", "0.52655715", "0.5233915", "0.52104104", "0.52104104", "0.5195492", "0.5126642", "0.5119821", "0.511224", "0.5094471", "0.50847304", "0.50847304", "0.5067438", "0.5060098...
0.53458726
10
obtener el total de segundos de los videos tipo Flexbox Video Tip: convertir a un array de objetos Tip2: split
function getVideos(str, tipo){ return str .replace('<ul>','') .replace('</ul>','') .replace('</l','asd') .split('<li') .map( video =>( { duracion: video.split('"')[1], tipo: video.split('>')[1] } )); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function obtenerSegundos(frame){\r\n return frame/fpsVideo;\r\n}", "function getVideos(str) {\n return str\n .replace('<ul>','')\n .replace('</ul>','')\n .split('</li>')\n .slice(0,-1)\n .map(video => (\n {\n min: parseInt(video\n .split('\"')[1]\n ...
[ "0.637815", "0.60176593", "0.55935615", "0.55656695", "0.5530902", "0.55077314", "0.54658556", "0.544976", "0.544976", "0.543223", "0.54244405", "0.53835005", "0.53707284", "0.5365971", "0.53656", "0.5351448", "0.53184927", "0.52987015", "0.5260848", "0.52544564", "0.5252349"...
0.52928656
18
Patch records for all destroyed widgets must be added because we need a DOM node reference for the destroy function
function destroyWidgets(vNode, patch, index) { if (isWidget(vNode)) { if (typeof vNode.destroy === "function") { patch[index] = appendPatch( patch[index], new VPatch(VPatch.REMOVE, vNode, null) ) } } else if (isVNode(vNode) && (vNod...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function destroyWidgets ( vNode, patch, index ) {\n if ( isWidget( vNode ) ) {\n if ( typeof vNode.destroy === \"function\" ) {\n patch[ index ] = appendPatch(\n patch[ index ],\n new VPatch( VPatch.REMOV...
[ "0.63805413", "0.6362039", "0.6346743", "0.6346743", "0.6346743", "0.6346743", "0.6340742", "0.62802815", "0.6216467", "0.61937296", "0.61604196", "0.6133201", "0.6096818", "0.6096818", "0.6096818", "0.6096818", "0.6096818", "0.6096818", "0.6096818", "0.6096818", "0.6096818",...
0.61678755
11
Create a subpatch for thunks
function thunks(a, b, patch, index) { var nodes = handleThunk(a, b) var thunkPatch = diff(nodes.a, nodes.b) if (hasPatches(thunkPatch)) { patch[index] = new VPatch(VPatch.THUNK, null, thunkPatch) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function thunks ( a, b, patch, index ) {\n var nodes = handleThunk( a, b )\n var thunkPatch = diff( nodes.a, nodes.b )\n if ( hasPatches( thunkPatch ) ) {\n patch[ index ] = new VPatch( VPatch.THUNK, null, thunkPatch )\n }\n ...
[ "0.72868633", "0.72016394", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.7121984", "0.71188897", "0.71188897", "0.71188897", "0.71188897", "0.71188897", "0.71188897", "0.6899918", "0.61617285", "0.6118...
0.725413
3
Execute hooks when two nodes are identical
function unhook(vNode, patch, index) { if (isVNode(vNode)) { if (vNode.hooks) { patch[index] = appendPatch( patch[index], new VPatch( VPatch.PROPS, vNode, undefinedKeys(vNode.hooks) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nodesEqualOnto(node1,node2){\n node1.each(function(d){\n node2.each(function(d1){\n return d.index==d1.index;\n });\n });\n}", "isSameNode(otherNode) {\n return this.unique === otherNode.unique;\n }", "function ancestoryTest(node1, node2) {\n var tmp = node1;\n ...
[ "0.65819186", "0.643466", "0.62595165", "0.6197642", "0.61951375", "0.612043", "0.6062609", "0.5994512", "0.5971914", "0.576292", "0.5684749", "0.56583536", "0.5656101", "0.5656101", "0.56445336", "0.5625504", "0.560722", "0.560722", "0.5548998", "0.55414796", "0.55400175", ...
0.0
-1
List diff, naive left to right reordering
function reorder(aChildren, bChildren) { // O(M) time, O(M) memory var bChildIndex = keyIndex(bChildren) var bKeys = bChildIndex.keys var bFree = bChildIndex.free if (bFree.length === bChildren.length) { return { children: bChildren, moves: null } ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_orderSort(l, r) {\n return l.order - r.order;\n }", "function orderedDiff(A, B, comparison) {\n var patches = [];\n var i, j, k;\n\n count = 0;\n for (i = 0, j = 0, k = 0; i < A.length && j < B.length; ++k) {\n var res = comparison(A[i], B[j]);\n\n if (res == null) {\n /...
[ "0.6203785", "0.6110284", "0.6065372", "0.594887", "0.587665", "0.5820915", "0.58104193", "0.5788856", "0.5758827", "0.57091606", "0.5691924", "0.5647623", "0.56313956", "0.56079423", "0.5594357", "0.5594357", "0.5582751", "0.5579342", "0.5556359", "0.5541042", "0.5534815", ...
0.0
-1
NOTE: These type checking functions intentionally don't use `instanceof` because it is fragile and can be easily faked with `Object.create()`.
function isArray(ar) { return Array.isArray(ar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isOfType(obj, type) {\n obj = Object(obj)\n return typeof type === \"string\"\n ? obj.constructor.name === type\n : obj instanceof type\n}", "function isType(obj, type) {\n return obj instanceof type\n}", "function isObj$1(something) {\n return typeDetect(something) === 'Object';\n}", "functio...
[ "0.63976204", "0.6387518", "0.63595504", "0.63429916", "0.63172144", "0.6297442", "0.6275125", "0.6271146", "0.6231667", "0.62197995", "0.6203875", "0.6203303", "0.6197005", "0.6160248", "0.6111649", "0.60518664", "0.60385704", "0.6038193", "0.6022243", "0.6018168", "0.601717...
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.52765024", "0.5259989", "0.5191908", "0.5185475", "0.5126739", "0.5045062", "0.4894077", "0.4859557", "0.4840031", "0.48308602", "0.48213598", "0.48129985", "0.48068723", "0.47867215", "0.4783404", "0.47590926", "0.4750297", "0.47395125", "0.47262868", "0.47044972", "0.470...
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
oldstyle streams. Note that the pipe method (the only relevant part of this class) is overridden in the Readable class.
function Stream() { EE.call(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pipe(stream) {\n var cache, scope = this;\n if(stream) {\n // add to the pipeline\n this.fuse(stream);\n // ensure return values are also added to the pipeline\n cache = stream.pipe;\n stream.pipe = function(/* dest */) {\n // restore cached method when called\n this.pipe = cach...
[ "0.7390886", "0.71938306", "0.6900835", "0.6533616", "0.6492514", "0.64115024", "0.631319", "0.6288172", "0.6283121", "0.6283121", "0.62320936", "0.62120926", "0.6195139", "0.6181338", "0.6181338", "0.61387545", "0.61259896", "0.6103953", "0.6103953", "0.6085072", "0.6047276"...
0.0
-1
don't leave dangling pipes when there are errors.
function onerror(er) { cleanup(); if (EE.listenerCount(this, 'error') === 0) { throw er; // Unhandled stream error in pipe. } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function brokenPipe() {\n throw Error('artoo.asyncStore: broken pipe.');\n }", "function onerror(error) {\n cleanup();\n if (!hasListeners(this, 'error'))\n throw error; // Unhandled stream error in pipe.\n }", "function onerror(er){debug(\"onerror\",er);unpipe();dest.removeListener(\"e...
[ "0.6985888", "0.6516886", "0.63997626", "0.6383677", "0.6370589", "0.6370589", "0.6370589", "0.6370589", "0.6370589", "0.6333938", "0.62931335", "0.62854844", "0.62854844", "0.62752515", "0.6234044", "0.6234014", "0.6221775", "0.62151647", "0.62151647", "0.62151647", "0.62151...
0.6196811
71
remove all the event listeners that were added.
function cleanup() { source.removeListener('data', ondata); dest.removeListener('drain', ondrain); source.removeListener('end', onend); source.removeListener('close', onclose); source.removeListener('error', onerror); dest.removeListener('error', onerror); source.removeListener('en...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeListeners() {}", "removeListeners() {}", "removeListeners() {}", "function removeEventListeners(){\n _.forEach(unlistenCallbacks, function(unlisten){\n unlisten();\n });\n unlistenCallbacks = [];\n }", "_clearListeners() {\n for (let liste...
[ "0.8520297", "0.8520297", "0.8520297", "0.84204197", "0.83039397", "0.8296358", "0.8280406", "0.8272935", "0.82701606", "0.8259448", "0.8132839", "0.8061034", "0.803117", "0.7982723", "0.7968647", "0.79614586", "0.78650445", "0.7853363", "0.7831602", "0.778603", "0.77451617",...
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.6566224", "0.6406297", "0.6394233", "0.6382326", "0.63522935", "0.63522935", "0.6243789", "0.6214812", "0.61722803", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", "0.6166624", ...
0.6114479
47
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) process.nextTick(function() { emitReadable_(stream); }); el...
{ "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.7172262", "0.7115639", "0.7115639", "0.697873", "0.6932875", "0.69211066", "0.6901566", "0.6896036", "0.6883069", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68731534", "0.68...
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; process.nextTick(function() { 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.730098", "0.6976404", "0.67713326", "0.6746773", "0.6746773", "0.6742494", "0.6742494", "0.67215955", "0.6689358", "0.6663105", "0.6655733", "0.66200536", "0.6566487", "0.65010446", "0.65003353", "0.65003353", "0.6484724", "0.6467524", "0.64654315", "0.6383285", "0.6381349...
0.6335571
92
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 (EE.listenerCount(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.76037115", "0.7207509", "0.7207509", "0.7207509", "0.71483916", "0.71483916", "0.71426207", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505", "0.712505",...
0.6961965
51
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(){dest.removeListener('finish',onfinish);unpipe();}", "function onclose(){dest.removeListener('finish',onfinish);unpipe();}", "function onclose(){dest.removeListener('finish',onfinish);unpipe();}", "function onclose(){dest.removeListener('finish',onfinish);unpipe();}", "function onclose(){...
[ "0.79411215", "0.79411215", "0.79411215", "0.79411215", "0.79409623", "0.7933108", "0.78863096", "0.7816656", "0.78133255", "0.78133255", "0.78133255", "0.77925515", "0.77731764", "0.77731764", "0.7731312", "0.76912314", "0.76912314", "0.76912314", "0.76912314", "0.76912314", ...
0.7979085
35
Pluck off n bytes from an array of buffers. Length is the combined lengths of all the buffers in the list.
function fromList(n, state) { var list = state.buffer; var length = state.length; var stringMode = !!state.decoder; var objectMode = !!state.objectMode; var ret; // nothing in the list, definitely empty. if (list.length === 0) return null; if (length === 0) ret = null; else if (ob...
{ "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 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 if (n ==...
[ "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433", "0.65536433"...
0.0
-1
Class: Buffer ============= The Buffer constructor returns instances of `Uint8Array` that are augmented with function properties for all the node `Buffer` API functions. We use `Uint8Array` so that square bracket notation works as expected it returns a single octet. By augmenting the instances, we can avoid modifying t...
function Buffer (arg) { if (!(this instanceof Buffer)) { // Avoid going through an ArgumentsAdaptorTrampoline in the common case. if (arguments.length > 1) return new Buffer(arg, arguments[1]) return new Buffer(arg) } this.length = 0 this.parent = undefined // Common case. if (typeof ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0...
[ "0.7388382", "0.7388382", "0.7388382", "0.7388382", "0.7388382", "0.7388382", "0.7388382", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "0.7384623", "...
0.70921373
98
Duplicate of fromArray() to keep fromArray() monomorphic.
function fromTypedArray (that, array) { var length = checked(array.length) | 0 that = allocate(that, length) // Truncating the elements is probably not what people expect from typed // arrays with BYTES_PER_ELEMENT > 1 but it's compatible with the behavior // of the old Buffer constructor. for (var i ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fromArray(as) {\n // For some reason, TypeScript does not infer this type correctly\n var b = build;\n var f = as.reduce(b, []);\n return f;\n }", "function __spreadArray(to, from) {\n for (var i = 0, il = from.length, j = to....
[ "0.65911216", "0.65310407", "0.65121055", "0.64978987", "0.6463779", "0.6456704", "0.64391524", "0.63985753", "0.63985753", "0.63985753", "0.63985753", "0.631068", "0.631068", "0.6280822", "0.62328637", "0.62328637", "0.62328637", "0.62328637", "0.62328637", "0.62328637", "0....
0.62617916
39
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.66716176", "0.66716176", "0.66315866", "0.6520346", "0.63839465", "0.627423", "0.6253665", "0.62347245", "0.62347245", "0.6108547", "0.6036368", "0.6017906", "0.59830993", "0.59575397", "0.5946407", "0.5938225", "0.5938225", "0.5938225", "0.593551", "0.5929771", "0.5929771...
0.59489954
73
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(ar) { return Array.isArray(ar); }
{ "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.63094425", "0.62230873", "0.6219001", "0.6219001", "0.6219001", "0.6152917", "0.6147534", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6083092", "0.6047344", "0.60186744", "0.5979627", "0.5979627", "0.59516007",...
0.0
-1
If we get something that is not a buffer, string, null, or undefined, and we're not in objectMode, then that's an error. Otherwise stream chunks are all considered to be of length=1, and the watermarks determine how many objects to keep in the buffer, rather than how many bytes or characters.
function validChunk(stream, state, chunk, cb) { var valid = true; if (!util.isBuffer(chunk) && !util.isString(chunk) && !util.isNullOrUndefined(chunk) && !state.objectMode) { var er = new TypeError('Invalid non-string/buffer chunk'); stream.emit('error', er); process.nextTick(f...
{ "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.67616236", "0.66709983", "0.6603179", "0.6489302", "0.64036095", "0.6382999", "0.6302069", "0.6222092", "0.62168604", "0.62168604", "0.6212825", "0.61844486", "0.61844486", "0.6166149", "0.6166149", "0.6166149", "0.6166149", "0.6166149", "0.61596984", "0.61552274", "0.6155...
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, chunk, encoding, cb) { chunk = decodeChunk(state, chunk, encoding); if (util.isBuffer(chunk)) encoding = 'buffer'; var len = state.objectMode ? 1 : chunk.length; state.length += len; var ret = state.length < state.highWaterMark; // we must ensure that previ...
{ "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.71454906", "0.71454906", "0.71454906", "0.71454906", "0.6974588", "0.69533527", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944", "0.6890944"...
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; if (stream._writev && state.buffer.length > 1) { // Fast case, write everything using _writev() var cbs = []; for (var c = 0; c < state.buffer.length; c++) cbs.push(state.buffer[c].callback); // count the one we are ...
{ "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.6990183", "0.64056754", "0.6362058", "0.62108177", "0.6021966", "0.5951879", "0.59409624", "0.59409624", "0.59409624", "0.59409624", "0.59036124", "0.58677757", "0.58271325", "0.58195007", "0.58168125", "0.58045375", "0.57909423", "0.57630336", "0.57630336", "0.57630336", ...
0.0
-1
Binary search for an index in the interval [left, right]
function indexInRange(indices, left, right) { if (indices.length === 0) { return false } var minIndex = 0 var maxIndex = indices.length - 1 var currentIndex var currentItem while (minIndex <= maxIndex) { currentIndex = ((maxIndex + minIndex) / 2) >> 0 curr...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function binarySearch(arr, val, left=0, right=arr.length) {\n if (right<left) return -1;\n const idx = left+ Math.floor((right-left)/2);\n if (right===left && arr[left]===val) return left;\n if (right===left && arr[left]!==val) return -1;\n \n if (arr[idx] === val){\n return idx;\n }else if (arr[idx] > v...
[ "0.78708273", "0.7870765", "0.77890486", "0.73940617", "0.73660433", "0.7358538", "0.7341032", "0.733939", "0.7315747", "0.7310952", "0.72874826", "0.72815245", "0.72740304", "0.72613025", "0.7249253", "0.7243719", "0.7221648", "0.72086596", "0.7179292", "0.71790445", "0.7176...
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 + ...
{ "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.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "0.6332276", "...
0.5672093
60
TODO: make this a streamable handler
function FeedHandler(callback, options){ this.init(callback, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stream(URL, handler) {\n console.log(`GET ${URL} stream`);\n oboe({\n method: \"GET\",\n url: this.baseURL + URL,\n headers: this.headers,\n })\n .node(\"!\", function(data) {\n console.log(\"STREAM data : \" + JSON.str...
[ "0.59518236", "0.5901846", "0.5779123", "0.5779123", "0.568068", "0.568068", "0.568068", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.56542563", "0.55586964", "0.55520046", "0.55...
0.0
-1
Uses a const keyword for ensuring that the value remains the same. This will give an error if there is an attempt to change it. Adding const variables using all capitalization and undersores for spaces is good practice.
function printManyTimes(str) { "use strict"; // change code below this line const SENTENCE = str + " is cool!"; for(let i = 0; i < str.length; i+=2) { console.log(SENTENCE); } // change code above this line }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CONST(){\n const a=100; //cannot be changed\n x=\"abcd\"\n //const x; not allowed**\n document.getElementById('i').innerHTML=x; //dont output anything\n}", "function exampleConst(){\n\tconst sample = 2\n\tconsole.log(sample)\n\tsample = 10 \n\tconsole.log(sample)\n}", "fu...
[ "0.7078014", "0.67959726", "0.67059547", "0.64924973", "0.64003915", "0.6224799", "0.5992301", "0.5992301", "0.5979308", "0.5966982", "0.58742523", "0.58676326", "0.58656394", "0.58181554", "0.57870847", "0.5773419", "0.5749189", "0.57136905", "0.57128775", "0.56913376", "0.5...
0.0
-1
Append div1 and div2 to the outer div, hiddenInput
function addInput(linkDiv, TNDiv, descDiv) { var hiddenInput = document.createElement("div"); hiddenInput.appendChild(linkDiv); hiddenInput.appendChild(TNDiv); hiddenInput.appendChild(descDiv); document.getElementById("main__container").appendChild(hiddenInput); hiddenInput.setAttribute("type", "visible")...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_attachHiddenDiv(ast, hiddenDiv) {\n const firstHtmlImport = dom5.query(ast, matchers.eagerHtmlImport);\n const body = dom5.query(ast, matchers.body);\n if (body) {\n if (firstHtmlImport &&\n dom5.predicates.parentMatches(matchers.body)(firstHtmlImport)) {\n ...
[ "0.5822297", "0.5798323", "0.57717615", "0.576141", "0.56938076", "0.568108", "0.5676289", "0.56485295", "0.5610389", "0.5597617", "0.55139256", "0.54568803", "0.5451272", "0.5418444", "0.5408009", "0.54036164", "0.5305218", "0.52962327", "0.5272188", "0.5261027", "0.52302116...
0.6617759
0
.style("fill", ".style("fill", "url(radialgradient)")"); Animation functions
function startAnimation() { waited += new Date().getTime() - stopTime stopAnim = false; Animation(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGradient() {\n body.style.backgroundImage =\n \"linear-gradient(to right,\" + cor1.value + \",\" + cor2.value + \")\";\n //mostrar o css do degrade\n css.textContent = body.style.backgroundImage + \";\";\n}", "function pantallaJugar(){\n\n document.getElementById(\"marcadorpadre\").style.displ...
[ "0.6523955", "0.6468817", "0.64328617", "0.6427624", "0.64102894", "0.6392225", "0.6378216", "0.637718", "0.6370009", "0.63696384", "0.6362088", "0.6357611", "0.63340294", "0.6316237", "0.63106066", "0.6290579", "0.62883735", "0.6264697", "0.6219667", "0.62095654", "0.6202643...
0.0
-1
The model is ready
function modelReady() { canvas.show(); // sketchRNN will begin when the mouse is released canvas.mouseReleased(startSketchRNN); select('#status').html('model ready - sketchRNN will begin after you draw with the mouse'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function modelReady() {\n console.log(\"model ready\");\n}", "function modelReady() {\n // model is ready\n console.log('Model Loaded!');\n modelIsReady = true;\n}", "function modelReady() {\n console.log(\"model Ready!\")\n}", "function modelReady() \n{\n print(\"Model REady\");\n loadData(); \n}", ...
[ "0.8113265", "0.81117064", "0.7943331", "0.7935126", "0.77899736", "0.77771604", "0.7715138", "0.7604998", "0.75791126", "0.7464265", "0.73969203", "0.73880315", "0.73568463", "0.73484284", "0.73463", "0.73463", "0.73463", "0.7285477", "0.72667325", "0.72665656", "0.7266096",...
0.6766144
53
A new stroke path
function gotStroke(err, s) { strokePath = s; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function newPath () {\r\n ctx.beginPath(); // Neuer Grafikpfad\r\n ctx.strokeStyle = \"#000000\"; // Linienfarbe schwarz\r\n ctx.lineWidth = 1; // Liniendicke 1\r\n }", "function newPath () {\r\n ctx.be...
[ "0.74088687", "0.74088687", "0.7278033", "0.7278033", "0.71236324", "0.7081871", "0.70170736", "0.69458985", "0.69254935", "0.68063253", "0.67537135", "0.67491984", "0.67159027", "0.6600593", "0.65062577", "0.6415569", "0.63889766", "0.62738794", "0.627145", "0.62379456", "0....
0.75928533
0
Stash the old values for transition.
function stash(d) { d.x0 = d.x; d.dx0 = d.dx; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "undo(){\n let state = this.getState();\n for(let key in state) this[key] = state[key];\n }", "restoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}", "_revertToOriginal() {\n this._storage = {}\n this....
[ "0.6446346", "0.64061916", "0.63903314", "0.6171994", "0.60937375", "0.60750806", "0.5919713", "0.5883894", "0.5837796", "0.5791796", "0.57751423", "0.57659185", "0.57498294", "0.5707894", "0.56958836", "0.56951815", "0.5692019", "0.5636815", "0.560492", "0.560492", "0.560492...
0.5327883
57
Interpolate the arcs in data space.
function arcTween(a) { var i = d3.interpolate({x: a.x0, dx: a.dx0}, a); return function(t) { var b = i(t); a.x0 = b.x; a.dx0 = b.dx; return arc(b); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function interpolate(value,xL,xR,yL,yR){\n return (value-xL)*(yR-yL)/(xR-xL) + yL;\n}", "interpolate(y2, y1, y3, n) {\n /* Equation from Astronomical Algorithms page 24 */\n const a = y2 - y1;\n const b = y3 - y2;\n const c = b - a;\n return y2 + n / 2 * (a + b + n * c);\n }", "function interp...
[ "0.61924887", "0.6182161", "0.6120667", "0.6088595", "0.60813916", "0.598701", "0.59289837", "0.59289837", "0.5901873", "0.5874588", "0.5743015", "0.57313544", "0.5716819", "0.5691607", "0.5672326", "0.56654483", "0.56654483", "0.56654483", "0.5661493", "0.5653709", "0.563968...
0.0
-1
Fade all but the current sequence Restore everything to full opacity when moving off the visualization.
function mouseleave(d) { d3.select("#explanationSunburst").style("visibility", "hidden"); // Transition each segment to full opacity and then reactivate it. d3.selectAll("path") .transition() .duration(500) .style("opacity", 1) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function effectFade () {\n pauseSlideshow();\n effect = 1;\n runSlideshow();\n }", "function do_fade() {\n \t\tif (!fadeFinished)\t\t\t\t\t\t\t\t// If we're still fading...\n\t \t\tvar noOfScreens = fadescreens.length;\t\t\t// ... get the number of layers we're fading.\n\t \t\tif...
[ "0.6797845", "0.65668094", "0.64115626", "0.6408924", "0.63687515", "0.63457304", "0.6339796", "0.63162446", "0.6304784", "0.629979", "0.62893593", "0.6220785", "0.6220102", "0.6219726", "0.6199934", "0.6195979", "0.6195979", "0.61893684", "0.6164438", "0.6164438", "0.6164438...
0.0
-1
Given a node in a partition layout, return an array of all of its ancestor nodes, highest first, but excluding the root.
function getAncestors(node) { var path = []; var current = node; while (current.parent) { path.unshift(current); current = current.parent; } return path; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAncestors(node) {\n var path = [];\n var current = node;\n while (current.parent) {\n path.unshift(current);\n current = current.parent;\n }\n return path;\n }", "function getAncestors(node) {\r\n var path = [];\r\n var current = node;\r\n while (current.parent) {\r\n ...
[ "0.6923217", "0.69079983", "0.6887239", "0.68852204", "0.68730426", "0.68631727", "0.68631727", "0.68631727", "0.68257654", "0.68257654", "0.68257654", "0.6816942", "0.6814705", "0.66630125", "0.63084996", "0.63084996", "0.6135168", "0.60578686", "0.59700096", "0.58169633", "...
0.68490946
8
CSS TRANSITION SUPPORT (Shoutout: ============================================================
function transitionEnd() { var el = document.createElement('bootstrap') var transEndEventNames = { WebkitTransition : 'webkitTransitionEnd', MozTransition : 'transitionend', OTransition : 'oTransitionEnd otransitionend', transition : 'transitionend' } for (var nam...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "turnOn() {\n this.wrapper.style[Modernizr.prefixed('transition')] = Modernizr.prefixed('transform') + ' .25s';\n return this;\n }", "function reverseTranslate(newFrom){return $animateCss(target,{to:newFrom||from,addClass:options.transitionOutClass,removeClass:options.transitionInClas...
[ "0.63923925", "0.63366467", "0.61158633", "0.603236", "0.59850186", "0.591949", "0.5896186", "0.5889262", "0.58413255", "0.57783985", "0.57483417", "0.57483417", "0.57397753", "0.57359797", "0.56957245", "0.5676835", "0.5676835", "0.5676835", "0.56698895", "0.56698895", "0.56...
0.0
-1
ALERT PLUGIN DEFINITION =======================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.alert') if (!data) $this.data('bs.alert', (data = new Alert(this))) if (typeof option == 'string') data[option].call($this) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.alert');if(!data)$this.data('bs.alert',data=new Alert(this));if(typeof option=='string')data[option].call($this);});}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.aler...
[ "0.66825145", "0.66825145", "0.652528", "0.64891756", "0.64770555", "0.6476156", "0.633078", "0.633078", "0.633078", "0.633078", "0.6320177", "0.6313426", "0.6313426", "0.6313426", "0.6313426", "0.6313426", "0.6306269", "0.62964594" ]
0.0
-1
BUTTON PLUGIN DEFINITION ========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.button') var options = typeof option == 'object' && option if (!data) $this.data('bs.button', (data = new Button(this, options))) if (option == 'toggle') data.toggle() el...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.button');var options=(typeof option===\"undefined\"?\"undefined\":_typeof2(option))=='object'&&option;if(!data)$this.data('bs.button',data=new Button(this,options));if(option=='toggle')data.toggle();else if(option)data.se...
[ "0.74372506", "0.74121296", "0.6890832", "0.6850591", "0.68374854", "0.6800628", "0.6800628", "0.6800628", "0.6800628", "0.6800628", "0.67828363", "0.67828363", "0.67828363", "0.67828363", "0.67719966", "0.67319006", "0.6715987", "0.6715987", "0.6715987", "0.6715987", "0.6706...
0.0
-1
CAROUSEL PLUGIN DEFINITION ==========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.carousel') var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) var action = typeof option == 'string' ? option : options.slide if (...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option) {\n return this.each(function () {\n var $this = $(this)\n var data = $this.data('bs.carasel')\n var options = $.extend({}, Carasel.DEFAULTS, $this.data(), typeof option == 'object' && option)\n var action = typeof option == 'string' ? opti...
[ "0.6379666", "0.6265333", "0.6264111", "0.6264111", "0.626211", "0.6259165", "0.6186643", "0.6171016", "0.6166579", "0.61048615", "0.6008145", "0.5995487", "0.5995487", "0.5995487", "0.5995487", "0.59917486", "0.5988653", "0.5898087", "0.5879424", "0.5869915", "0.58522534", ...
0.0
-1
COLLAPSE PLUGIN DEFINITION ==========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.collapse') var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data && options.toggle && /show|hide/.test(option)) options.toggle = f...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "collapseMenu() {\r\n\t}", "function Plugin(option) {\n\t return this.each(function () {\n\t var $this = $(this)\n\t var data = $this.data('bs.collapse')\n\t var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option)\n\t\n\t if (!data && options.to...
[ "0.64858043", "0.62959516", "0.62379456", "0.62360334", "0.62360334", "0.62360334", "0.6226784", "0.6226784", "0.6226784", "0.6226784", "0.6226784", "0.611942", "0.611882", "0.611882", "0.611882", "0.611882", "0.611882", "0.611882", "0.611882", "0.611882", "0.611882", "0.61...
0.0
-1
DROPDOWN PLUGIN DEFINITION ==========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.dropdown') if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) if (typeof option == 'string') data[option].call($this) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.dropdown');if(!data)$this.data('bs.dropdown',data=new Dropdown(this));if(typeof option=='string')data[option].call($this);});}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data...
[ "0.6855298", "0.6855298", "0.65427923", "0.63471085", "0.6315303", "0.6315303", "0.6315303", "0.6315303", "0.6315303", "0.6297622", "0.6297622", "0.6297622", "0.6297622", "0.6297622", "0.627536", "0.6171215", "0.61269915", "0.6117604", "0.6117604", "0.6079827", "0.60632604", ...
0.0
-1
MODAL PLUGIN DEFINITION =======================
function Plugin(option, _relatedTarget) { return this.each(function () { var $this = $(this) var data = $this.data('bs.modal') var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) if (!data) $this.data('bs.modal', (data = new Modal(this, options...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option,_relatedTarget){return this.each(function(){var $this=$(this);var data=$this.data('bs.modal');var options=$.extend({},Modal.DEFAULTS,$this.data(),(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option);if(!data)$this.data('bs.modal',data=new Modal(this,options));if(typeo...
[ "0.7613195", "0.76106924", "0.70632553", "0.6971759", "0.6971759", "0.6971759", "0.6971759", "0.6971759", "0.696315", "0.6952324", "0.6952324", "0.6952324", "0.6952324", "0.6952324", "0.6940254", "0.6925037", "0.68679523", "0.68679523", "0.68679523", "0.68679523", "0.68679523...
0.0
-1
TOOLTIP PLUGIN DEFINITION =========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tooltip') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, option...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addTooltips() {\n $(this.el.querySelectorAll('[title]')).tooltip({\n delay: { show: 500, hide: 0 }\n });\n }", "function initInstanceInfoTooltip() {\n jQuery('#instance-tooltip').tooltip();\n}", "get tooltip() {}", "function tooltips() {\r\n\t$('.tooltip-link')...
[ "0.7192862", "0.7176083", "0.7123107", "0.71060693", "0.70085734", "0.6952688", "0.6936619", "0.6877055", "0.68541384", "0.6819276", "0.6799216", "0.67991906", "0.6754186", "0.6751899", "0.6703513", "0.66871077", "0.66587776", "0.66451734", "0.66412985", "0.6640944", "0.66397...
0.0
-1
POPOVER PLUGIN DEFINITION =========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.popover') var options = typeof option == 'object' && option if (!data && /destroy|hide/.test(option)) return if (!data) $this.data('bs.popover', (data = new Popover(this, option...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PopoverConfig() { }", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.popover');var options=(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option;if(!data&&/destroy|hide/.test(option))return;if(!data)$this.data('bs.popover',data=new Po...
[ "0.65172714", "0.6155215", "0.614206", "0.60616994", "0.6005223", "0.59905416", "0.59692305", "0.58698756", "0.58214915", "0.58214915", "0.5795073", "0.5791303", "0.5788668", "0.57536405", "0.5745262", "0.572578", "0.5721664", "0.57004213", "0.5683987", "0.5673775", "0.564506...
0.0
-1
SCROLLSPY CLASS DEFINITION ==========================
function ScrollSpy(element, options) { this.$body = $(document.body) this.$scrollElement = $(element).is(document.body) ? $(window) : $(element) this.options = $.extend({}, ScrollSpy.DEFAULTS, options) this.selector = (this.options.target || '') + ' .nav li > a' this.offsets ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set scrolling(scrolling) {\n this._scrolling = scrolling;\n }", "function ScrollPosition() {}", "constructor() {\n this.instance = createScrollBar();\n }", "get scrollTarget(){return this.$.scrollable}", "constructor(props){\n super(props);\n this.state = {\n ...
[ "0.6425834", "0.6410249", "0.63330656", "0.63049364", "0.6215433", "0.62142974", "0.62142974", "0.62142974", "0.62142974", "0.6204531", "0.6202594", "0.6194863", "0.6175148", "0.61379933", "0.6110296", "0.60964507", "0.6077627", "0.6067853", "0.6066979", "0.6066347", "0.60607...
0.0
-1
SCROLLSPY PLUGIN DEFINITION ===========================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.scrollspy') var options = typeof option == 'object' && option if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) if (typeof option == 'string') data[op...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.scrollspy');var options=(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option;if(!data)$this.data('bs.scrollspy',data=new ScrollSpy(this,options));if(typeof option=='string')data[option]();});}", "...
[ "0.6854317", "0.6835888", "0.6574524", "0.6469166", "0.6357787", "0.6308153", "0.62861264", "0.6273556", "0.62687165", "0.6192112", "0.6192112", "0.6192112", "0.6192112", "0.6183829", "0.6172839", "0.6162308", "0.6159222", "0.6159222", "0.6159222", "0.6159222", "0.6159222", ...
0.0
-1
TAB PLUGIN DEFINITION =====================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.tab') if (!data) $this.data('bs.tab', (data = new Tab(this))) if (typeof option == 'string') data[option]() }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tab');if(!data)$this.data('bs.tab',data=new Tab(this));if(typeof option=='string')data[option]();});}", "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.tab');if(!data)$this...
[ "0.7422795", "0.7422795", "0.692493", "0.68403625", "0.68381155", "0.6825247", "0.6680546", "0.6680546", "0.6680546", "0.6680546", "0.666558", "0.6643974", "0.6643974", "0.6643974", "0.6643974", "0.6643974", "0.66033274", "0.6584258", "0.6564133", "0.65579057", "0.65392226", ...
0.0
-1
AFFIX PLUGIN DEFINITION =======================
function Plugin(option) { return this.each(function () { var $this = $(this) var data = $this.data('bs.affix') var options = typeof option == 'object' && option if (!data) $this.data('bs.affix', (data = new Affix(this, options))) if (typeof option == 'string') data[option]() ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Plugin(option){return this.each(function(){var $this=$(this);var data=$this.data('bs.affix');var options=(typeof option==='undefined'?'undefined':_typeof(option))=='object'&&option;if(!data)$this.data('bs.affix',data=new Affix(this,options));if(typeof option=='string')data[option]();});}", "function Plu...
[ "0.6413848", "0.63957715", "0.5915483", "0.5915483", "0.5915483", "0.5915483", "0.5907848", "0.58639544", "0.58639544", "0.58600503", "0.58577216", "0.58577216", "0.58577216", "0.58577216", "0.58577216", "0.5832297", "0.5786588", "0.57440233" ]
0.0
-1
Check for IE =< 8
function isIE() { return typeof attachEvent !== "undefined" && typeof addEventListener === "undefined"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function less_IE8() {\n if (/msie [1-8]{1}[^0-9]/.test(navigator.userAgent.toLowerCase())) {\n return true;\n }\n}", "function seven_isIE () {\n\t\t\tvar myNav = navigator.userAgent.toLowerCase();\n\t\t\treturn (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;\n\t\t}", "functi...
[ "0.8209785", "0.7952113", "0.7779973", "0.7779973", "0.76790655", "0.76722354", "0.7621934", "0.76195014", "0.7618983", "0.7618983", "0.7618805", "0.7611331", "0.7579891", "0.7526922", "0.7499647", "0.7482198", "0.74821013", "0.7475237", "0.7475237", "0.7475237", "0.7475237",...
0.69279826
55
When User Tap the Back button
function chatBackButton(e) { if (e) e.preventDefault(); client_configuration['chat']['chat_user'] = undefined; if ( typeof cordova != 'undefined') cordova.plugins.Keyboard.close(); //ChatPage.keyboardDidHide; Draw.switchBack(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onBack() {\n resetPageState();\n }", "function onBackKeyDown() {\n\t//alert(\"Back Pressed\");\n\tgo_back();\n}", "function onBackKeyDown() {\n \tif($.mobile.activePage.is(\"#start\")) {\n \t\tnavigator.app.exitApp(); // Exit app if current page is start Page\n \t} else {\n \t\tn...
[ "0.82391125", "0.81253386", "0.80641866", "0.8048298", "0.79960173", "0.7995833", "0.79723895", "0.7948769", "0.7915576", "0.7903864", "0.7871408", "0.7854179", "0.7839265", "0.7808365", "0.779676", "0.7788873", "0.77824485", "0.7761181", "0.7761181", "0.7761181", "0.7761181"...
0.75483435
53
Pushing Message to Local Storage
function pushMessage(user_id, chat_message, who) { var storage_key = 'chat_user_' + user_id; var storage_object = PStorage.get(storage_key); /* */ if (typeof(storage_object) == 'undefined') { storage_object = []; } else { storage_object = JSON.parse(storage_object); } /*...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveMessage(messageObj) {\n\n /// make the push ready....\n var message = messageRef.push();\n message.set(messageObj);\n}", "_ensureLocalStorageSubscription(){\n localStorage.subscribe(receiveMessage);\n }", "_ensureLocalStorageSubscription(){\n localStorage.subscribe(receiveMessage);...
[ "0.7120174", "0.6877177", "0.6877177", "0.685433", "0.6846008", "0.6773539", "0.67546713", "0.6727916", "0.66404617", "0.6634331", "0.65076596", "0.6495973", "0.6489805", "0.6467908", "0.6443485", "0.6437112", "0.64282227", "0.6423143", "0.6417649", "0.640273", "0.6390868", ...
0.6554417
10
Increasing Notification Counter By One
function increaseNotificationCounter(sender) { client_configuration['notifications_counter']++; $('.notifications').html(client_configuration['notifications_counter']).fadeIn(200); if (!client_configuration.notifications_map['user_' + sender]) { client_configuration.notifications_map['user_' + send...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_incNotifCounter(notif) {\n let knownSeverity = notif.knownSeverity;\n this._notifCounters[knownSeverity]++;\n\n if (knownSeverity !== Severity.UNDEFINED &&\n (this._highestSeverity === Severity.UNDEFINED || this._highestSeverity > knownSeverity)) {\n this._highestSeverit...
[ "0.72042805", "0.7012189", "0.69858676", "0.698368", "0.69624776", "0.68731767", "0.68610555", "0.68319744", "0.67865354", "0.67732894", "0.67687213", "0.66642374", "0.66642374", "0.66642374", "0.66074544", "0.6581838", "0.6566235", "0.65425915", "0.6534477", "0.65177274", "0...
0.7511858
0
The handler for Apple's APN Token
function tokenHandler(response) { client_configuration['notifications'] = { status: true, token : response }; updateToken(response); userModel.set('udid', response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tokenHandler (result) {\n // Your iOS push server needs to know the token before it can push to this device\n // here is where you might want to send it the token for later use.\n // alert('In JS tokenHandler: device token = '+result);\n App.deviceToken = result;\n App.deviceAlias = 'mye'+c...
[ "0.69455236", "0.6520233", "0.63696545", "0.6172708", "0.60947555", "0.5897789", "0.5889666", "0.5857201", "0.5840831", "0.5830904", "0.57706606", "0.57510847", "0.57207584", "0.57194173", "0.57045466", "0.56513065", "0.5638502", "0.5619901", "0.55974287", "0.559664", "0.5578...
0.6248485
3
Generic Method for Failure Callback if Somehow the notification service response badly
function notificationRegisterFailed(response) { console.log('Register Failed: ' + response); client_configuration['notifications'] = { status: false }; return; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function failureCB(){}", "static notifyFailure()\n\t\t{\n\t\t\tthis.notify(NotificationFeedbackType.Error);\n\t\t}", "function requestFailed(response) {\n console.log(response);\n if (response.status == '400') {\n notificationService.displayError(response.data.Message);\n ...
[ "0.68833345", "0.67651135", "0.6671625", "0.66107064", "0.6542515", "0.6449701", "0.6449701", "0.64260936", "0.6381373", "0.63277006", "0.62581867", "0.61930716", "0.6084188", "0.6071446", "0.60713047", "0.6065821", "0.60319453", "0.6014962", "0.5977113", "0.59755886", "0.596...
0.6361198
9
Check if String is Hebrew
function isHebrew(str) { return (str.charCodeAt(0) > 0x590 && str.charCodeAt(0) < 0x5FF) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isHebrew(message) {\n return message.match(/[\\u0590-\\u05FF]+/);\n }", "function isEng(t) { return t.search(/[\\u0020-\\u007F]/g) != -1 }", "function langIsRTL (sampleText) {\n var t = sampleText.replace(/@\\w+/, ''),\n countHeb = countMatches('[\\\\u05B0-\\\\u05F4...
[ "0.8350256", "0.68474793", "0.6408627", "0.6272186", "0.6090423", "0.601828", "0.598273", "0.5961693", "0.5850817", "0.5803946", "0.5742258", "0.5692749", "0.568923", "0.56820714", "0.5675699", "0.56548613", "0.5625955", "0.56218815", "0.5614115", "0.5591348", "0.55236053", ...
0.8694472
0
This method will logout the user from the app
function logout() { /* Cleanning up user's history */ PStorage.drop(); PStorage.init(function () { PStorage.set('logout', JSON.stringify({ lat: userModel.get('latitude'), lon: userModel.get('longitude') }), function () { facebookConnectPlugin.logout(funct...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "logout () {\n API.User.Logout(AppStorage.getAuthToken())\n .then(() => {\n AppDispatcher.handleAction({\n actionType: 'CLEAR_SESSION'\n })\n AppStorage.clearAll()\n browserHistory.push('/')\n })\n .catch(error => {\n AppSignal.sendError(error)\n ...
[ "0.8283051", "0.80184275", "0.79903007", "0.79258305", "0.78486603", "0.78241765", "0.7816034", "0.77667344", "0.77546346", "0.77372015", "0.7719302", "0.7711817", "0.7708241", "0.770657", "0.76942515", "0.7691807", "0.76772714", "0.7668421", "0.7664972", "0.76479816", "0.764...
0.7567745
28
Check if current is iphone 4
function isIphone4() { return (device.platform == 'iOS' && screen.height == 480); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isiOS4Plus(){\n\tif (Titanium.Platform.name == 'iPhone OS'){\n\t\tvar version = Titanium.Platform.version.split(\".\");\n\t\tvar major = parseInt(version[0]);\n\t\t// can only test this support on a 3.2+ device\n\t\tif (major >= 4){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function isIphon...
[ "0.7697221", "0.7130767", "0.70465064", "0.701897", "0.69854647", "0.66621804", "0.665167", "0.6625914", "0.66176546", "0.6596353", "0.6510903", "0.6426261", "0.63970965", "0.63970965", "0.63749546", "0.63593054", "0.6351612", "0.62656015", "0.6253795", "0.6199997", "0.618823...
0.7868721
0
Check for a winner. Return 0 if no winner or tie yet 1 if it's a tie 2 if HUMAN_PLAYER won 3 if COMPUTER_PLAYER won
function CheckForWinner(game) { // Check for horizontal wins for (i = 0; i <= 6; i += 3) { if (game[i] === HUMAN_PLAYER && game[i + 1] === HUMAN_PLAYER && game[i + 2] === HUMAN_PLAYER) return 2; if (game[i] === COMPUTER_PLAYER && game[i + 1] === COMPUTER_PLAYER && game[i + 2] === COMPUTER_PLAYER) ...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function winner() {\n let p1Count = 0;\n let p2Count = 0;\n let retVal = false;\n\n for (y = 0; y < 8; y++)\n for (x = 0; x < 8; x++) {\n if (board[y][x] == PLAYER1)\n p1Count++;\n if (board[y][x] == PLAYER2)\n p2Count++;\n }\n\n DK_SCORE.value = p1Count;\n LT_SCORE.value = p2Co...
[ "0.78480136", "0.75217175", "0.7479912", "0.74710375", "0.7462633", "0.74580777", "0.740019", "0.73903704", "0.7380191", "0.7378169", "0.7371717", "0.7367642", "0.73641163", "0.7343658", "0.7327018", "0.7275864", "0.7241801", "0.72415525", "0.72330844", "0.72119546", "0.72059...
0.7880573
0
Takes in a object with properties : id, x, y upper_length, lower_length, upper_width, lower_width,
constructor(params) { this.id = params.id; this.upper_length = params.upper_length; this.upper_width = params.upper_width; this.lower_length = params.lower_length; this.lower_width = params.lower_width; this.score = 0; this.fitness = 0; this.parents = []; this.colors = []; this.p...
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor(x, y, width, height) {\n //TO-DO\n }", "constructor(object) {\n super();\n this.id = generateId();\n this.height = null;\n this.width = null;\n this.length = null;\n this.x = null;\n this.y = null;\n this.z = null;\n this.rotate...
[ "0.6228857", "0.61937153", "0.61926013", "0.61665106", "0.61344993", "0.6131567", "0.6123765", "0.6071952", "0.604115", "0.6017006", "0.5995639", "0.5983979", "0.5977931", "0.5955038", "0.59372693", "0.59342206", "0.5928847", "0.589736", "0.58938646", "0.58667487", "0.5838523...
0.0
-1
hex to txt nick name
function hex2txt(hex) { try {return decodeURIComponent(hex.replace(/(..)/g,'%$1'));} catch (e) {return "";} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function format(nick) {\r\n\treturn nick.substr(0, 1).toString().toUpperCase() + nick.substr(1);\r\n}", "function readUid(){\n checkLen(16);\n var res = hexBlock(0, 4, true) + '-' + hexBlock(4, 2, true) + '-' + hexBlock(6, 2, true) + '-' + hexBlock(8, 2) + '-' + hexBlock(10, 6);\n pos += 16;\n return...
[ "0.62929416", "0.5909532", "0.5857183", "0.5844864", "0.5654054", "0.5618606", "0.5614762", "0.5571979", "0.5565805", "0.55225474", "0.55225474", "0.55225474", "0.55225474", "0.55225474", "0.55225474", "0.54763854", "0.54755914", "0.5473135", "0.54678863", "0.54677844", "0.54...
0.62971675
0