Performs a **flick** heading _down_ inside the first view that matches
 `query`.
 @see #flick
 @param [Number] duration (default: 1.0) The amount of time in seconds the
  gesture lasts.
515185
def flick_down(query, duration: nil)
      flick(query, {x: 50, y: 10}, {x: 50, y: 90}, duration: duration)
    end
194255
function (duration) {
    if (typeof duration !== 'string') {
      duration = duration + 'ms';
    }

    return this.each(function () {
      this.style.webkitTransitionDuration = duration;
      this.style.transitionDuration = duration;
    });
  }
757614
def cursor_down(self, count=1):
        
        original_column = self.preferred_column or self.document.cursor_position_col
        self.cursor_position += self.document.get_cursor_down_position(
            count=count, preferred_column=original_column)

        # Remember the original column for the next up/down movement.
        self.preferred_column = original_column
1306642
def cursor_down(self, count=None):
        
        _top, bottom = self.margins or Margins(0, self.lines - 1)
        self.cursor.y = min(self.cursor.y + (count or 1), bottom)
437965
function scrollOnePage(element, downward) {

  // Determine the item visible just at the edge of direction we're heading.
  // We'll select that item if it's not already selected.
  const scrollTarget = element.scrollTarget;
  const edge = scrollTarget.scrollTop + (downward ? scrollTarget.clientHeight : 0);
  const indexOfItemAtEdge = getIndexOfItemAtY(element, edge, downward);

  const selectedIndex = element.selectedIndex;
  let newIndex;
  if (indexOfItemAtEdge && selectedIndex === indexOfItemAtEdge) {
    // The item at the edge was already selected, so scroll in the indicated
    // direction by one page. Leave the new item at that edge selected.
    const delta = (downward ? 1 : -1) * scrollTarget.clientHeight;
    newIndex = getIndexOfItemAtY(element, edge + delta, downward);
  }
  else {
    // The item at the edge wasn't selected yet. Instead of scrolling, we'll
    // just select that item. That is, the first attempt to page up/down
    // usually just moves the selection to the edge in that direction.
    newIndex = indexOfItemAtEdge;
  }

  if (!newIndex) {
    // We can't find an item in the direction we want to travel. Select the
    // last item (if moving downward) or first item (if moving upward).
    newIndex = (downward ? element.items.length - 1 : 0);
  }

  if (newIndex !== selectedIndex) {
    element.selectedIndex = newIndex;
    return true; // We handled the page up/down ourselves.
  }
  else {
    return false; // We didn't do anything.
  }
}
447488
def shift_down_right(self, times=1):
        
        try:
            return Location(self._rank - times, self._file + times)
        except IndexError as e:
            raise IndexError(e)
1362676
public static void setHoverDelay(Duration duration) {
        BEHAVIOR.setHoverDelay(duration == null ? Duration.millis(650) : duration);
    }
177918
public void queueAnimation(final GQAnimation anim, final int duration) {
    if (isOff()) {
      anim.onStart();
      anim.onComplete();
    } else {
      queue(anim.e, DEFAULT_NAME, new Function() {
        public void cancel(Element e) {
          Animation anim = (Animation) data(e, GQAnimation.ACTUAL_ANIMATION, null);
          if (anim != null) {
            anim.cancel();
          }
        }

        public void f(Element e) {
          anim.run(duration);
        }
      });
    }
  }
1219746
function() {
		// temp local vars
		var lastFlickDuration,
			tempReleasePos;

		// s = this
		var s = {
			lastFlickOffset: {},
			lastFlickDist: {},
			lastFlickSpeed: {},
			slowDownRatio:  {},
			slowDownRatioReverse:  {},
			speedDecelerationRatio:  {},
			speedDecelerationRatioAbs:  {},
			distanceOffset:  {},
			backAnimDestination: {},
			backAnimStarted: {},
			calculateSwipeSpeed: function(axis) {
				

				if( _posPoints.length > 1) {
					lastFlickDuration = _getCurrentTime() - _gestureCheckSpeedTime + 50;
					tempReleasePos = _posPoints[_posPoints.length-2][axis];
				} else {
					lastFlickDuration = _getCurrentTime() - _gestureStartTime; // total gesture duration
					tempReleasePos = _startPoint[axis];
				}
				s.lastFlickOffset[axis] = _currPoint[axis] - tempReleasePos;
				s.lastFlickDist[axis] = Math.abs(s.lastFlickOffset[axis]);
				if(s.lastFlickDist[axis] > 20) {
					s.lastFlickSpeed[axis] = s.lastFlickOffset[axis] / lastFlickDuration;
				} else {
					s.lastFlickSpeed[axis] = 0;
				}
				if( Math.abs(s.lastFlickSpeed[axis]) < 0.1 ) {
					s.lastFlickSpeed[axis] = 0;
				}
				
				s.slowDownRatio[axis] = 0.95;
				s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];
				s.speedDecelerationRatio[axis] = 1;
			},

			calculateOverBoundsAnimOffset: function(axis, speed) {
				if(!s.backAnimStarted[axis]) {

					if(_panOffset[axis] > _currPanBounds.min[axis]) {
						s.backAnimDestination[axis] = _currPanBounds.min[axis];
						
					} else if(_panOffset[axis] < _currPanBounds.max[axis]) {
						s.backAnimDestination[axis] = _currPanBounds.max[axis];
					}

					if(s.backAnimDestination[axis] !== undefined) {
						s.slowDownRatio[axis] = 0.7;
						s.slowDownRatioReverse[axis] = 1 - s.slowDownRatio[axis];
						if(s.speedDecelerationRatioAbs[axis] < 0.05) {

							s.lastFlickSpeed[axis] = 0;
							s.backAnimStarted[axis] = true;

							_animateProp('bounceZoomPan'+axis,_panOffset[axis], 
								s.backAnimDestination[axis], 
								speed || 300, 
								framework.easing.sine.out, 
								function(pos) {
									_panOffset[axis] = pos;
									_applyCurrentZoomPan();
								}
							);

						}
					}
				}
			},

			// Reduces the speed by slowDownRatio (per 10ms)
			calculateAnimOffset: function(axis) {
				if(!s.backAnimStarted[axis]) {
					s.speedDecelerationRatio[axis] = s.speedDecelerationRatio[axis] * (s.slowDownRatio[axis] + 
												s.slowDownRatioReverse[axis] - 
												s.slowDownRatioReverse[axis] * s.timeDiff / 10);

					s.speedDecelerationRatioAbs[axis] = Math.abs(s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis]);
					s.distanceOffset[axis] = s.lastFlickSpeed[axis] * s.speedDecelerationRatio[axis] * s.timeDiff;
					_panOffset[axis] += s.distanceOffset[axis];

				}
			},

			panAnimLoop: function() {
				if ( _animations.zoomPan ) {
					_animations.zoomPan.raf = _requestAF(s.panAnimLoop);

					s.now = _getCurrentTime();
					s.timeDiff = s.now - s.lastNow;
					s.lastNow = s.now;
					
					s.calculateAnimOffset('x');
					s.calculateAnimOffset('y');

					_applyCurrentZoomPan();
					
					s.calculateOverBoundsAnimOffset('x');
					s.calculateOverBoundsAnimOffset('y');


					if (s.speedDecelerationRatioAbs.x < 0.05 && s.speedDecelerationRatioAbs.y < 0.05) {

						// round pan position
						_panOffset.x = Math.round(_panOffset.x);
						_panOffset.y = Math.round(_panOffset.y);
						_applyCurrentZoomPan();
						
						_stopAnimation('zoomPan');
						return;
					}
				}

			}
		};
		return s;
	}
609332
function Animation(from, to, duration) {
  this._from = from;
  this._to = to;
  this._duration = duration;
  this._left = duration;
  this._start = Date.now();
  this._looping = false;
  this._finished = false;
}
1070286
public function flickRight($x, $y, $distance, $duration)
    {
        return $this
            ->flick($x, $y, WebDriver_Server_Selendroid::DIRECTION_RIGHT, $distance, $duration);
    }
813151
function Timer(name, millis, descending) {
  this.name = name;
  this.initialMillis = millis;
  this.millis = millis;
  this.descending = descending;
  this.running = false;
}
1162119
function(duration, easing) {
	
	var newStylesheet = localnwt.node.create('<style type="text/css"></style>');

	easing = easing || 'ease-in';
	duration = duration || 1;

	var trail = ' ' + duration + 's ' + easing,

		// Just support all browsers for now
		cssTransitionProperties = {
			'-webkit-transition': 'all' + trail,
			'-moz-transition': ' all' + trail,
			'-o-ransition': ' all' + trail,
			'ms-transition': ' all' + trail,
			'transition': ' all' + trail
		},

		newContent = '';

	for (i in cssTransitionProperties) {
		newContent += i + ': ' + cssTransitionProperties[i] + ';';
	}
	newStylesheet.setHtml('.' + this.animClass + '{' + newContent + '}');

	localnwt.one('head').append(newStylesheet);

	setTimeout(function(){
		newStylesheet.remove()
	}, 
	duration*1001)
}
45333
def format_duration(duration)
      seconds = ((duration % 60) * 100.0).round / 100.0   # 1.8.7 safe .round(2)
      seconds = seconds.to_i if seconds.to_i == seconds   # drop that zero if it's not needed

      message = "#{seconds} second#{seconds == 1 ? "" : "s"}"
      message = "#{(duration / 60).to_i} minute#{(duration / 60).to_i == 1 ? "" : "s"} and " + message if duration >= 60

      message
    end
1173499
def duration
      segments = [self[:duration]/60]
      segments << (self[:duration] % 60 )
      segments.map {|t| t.to_s.rjust(2, '0')}.join(':')
    end
1294491
function triggerGesture(elements, startTouches, options, done) {
        var interval = 10,
            loops = Math.ceil(options.duration / interval),
            loop = 1;

        elements = ensureAnArray(elements);

        options = merge(options, {
            pos: [10, 10],
            duration: 250,
            touches: 1,
            deltaX: 0,
            deltaY: 0,
            radius: 100,
            scale: 1,
            rotation: 0,
            easing: 'swing'
        });

        function gestureLoop() {
            // calculate the radius
            // this is for scaling and multiple touches
            var radius = options.radius;
            if (options.scale !== 1) {
                radius = options.radius - (options.radius * (1 - options.scale) * (1 / loops * loop));
            }

            // calculate new position/rotation
            var easing = Simulator.easings[options.easing](1 / loops * loop),
                posX = options.pos[0] + (options.deltaX / loops * loop) * easing,
                posY = options.pos[1] + (options.deltaY / loops * loop) * easing,
                rotation = options.rotation / loops * loop,
                touches = getTouches([posX, posY], elements, startTouches.length, radius, rotation),
                isFirst = (loop == 1),
                isLast = (loop == loops);

            for (var t = touches.length - 1; t >= 0; t--) {
                if (isFirst) {
                    trigger(touches, touches[t].target, 'start');
                } else if (isLast) {
                    trigger(touches, touches[t].target, 'end');

                    // Remove processed touch
                    touches.pop()

                    if (touches.length === 0) {
                        return done();
                    }
                } else {
                    trigger(touches, touches[t].target, 'move');
                }
            }

            setTimeout(gestureLoop, interval);
            loop++;
        }
        gestureLoop();
    }
642589
function(time, x, y) {
		if(time - _gestureCheckSpeedTime > 50) {
			var o = _posPoints.length > 2 ? _posPoints.shift() : {};
			o.x = x;
			o.y = y; 
			_posPoints.push(o);
			_gestureCheckSpeedTime = time;
		}
	}