The relational position of an entity, when compared to another entity with fixed position. Typically used, for example, to define location within a file or byte buffer from which information should be read.
Questions tagged [offset]
3019 questions
13
votes
2 answers
Overlay video after set time offset with FFmpeg
I'm trying to add overlays to an input video with ffmpeg that appear some time after the video starts.
The basic way to add an overlay is:
ffmpeg -i in.avi -vf "movie=overlay.avi [ovl]; [in][ovl] overlay" out.avi
But this adds the overlay video (or…

Future Optical
- 201
- 1
- 2
- 6
13
votes
1 answer
How can I get pandas Timestamp offset by certain amount of months?
Suppose I have a pandas Timestamp object t1.
import pandas a pd
t1=pd.Timestamp('2013-04-01 00:00:00')
How can I get another pandas timestamp, offset by k months from t1?

Apogentus
- 6,371
- 6
- 32
- 33
13
votes
1 answer
Get video frames information with ffmpeg
How can I retrieve information from video about byte number from which every frame starts, with using ffmpeg or something else?

Dmitriy Karpov
- 131
- 1
- 1
- 4
13
votes
1 answer
Does taking address of member variable through a null pointer yield undefined behavior?
The following code (or its equivalent which uses explicit casts of null literal to get rid of temporary variable) is often used to calculate the offset of a specific member variable within a class or struct:
class Class {
public:
int first;
…

sharptooth
- 167,383
- 100
- 513
- 979
13
votes
1 answer
javascript: difference between scrollTop and offsetTop
Is there a predictable relationship between cummulative offsetTop of an element and the value of scrollTop after navigating to that element?
I had naively assumed they would be equal, but I've encountered cases where scrollTop is larger (the…

dlh
- 549
- 4
- 7
- 20
13
votes
2 answers
JS - get percentage of an element in Viewport
I want to get the percentage of an element (div) when its in viewport.
when the element enter the viewport I want the value of 0.
when the element and element's height leave the viewport I want the value of 100.
Here are 5 viewports of what I want…

youyoup
- 559
- 1
- 6
- 9
13
votes
2 answers
jQuery Offset().left doesn't work properly
I have a question about jQuery offset() function. I use it on my site to display "email a friend" window after clicking on email icon.
However, the window appears sticked to the right side of browser's window, not on the position of the icon. You…

FilipBenes
- 335
- 2
- 3
- 10
13
votes
5 answers
Test if range exists in VBA
I have a dynamically defined named range in my excel ss that grabs data out of a table based on a start date and an end date like…

Colten J Nye
- 165
- 1
- 1
- 6
13
votes
3 answers
rough estimate of the time offset from GMT from latitude longitude
Is there a way to estimate the offset from GMT (or time zone) from a latitude/longitude? I've seen geonames, but this would need to work long term and we don't really want to rely on a web service. It'd just be used for determining whether to…

ravun
- 1,523
- 9
- 27
- 45
12
votes
4 answers
Need to calculate offsetRight in javascript
I need to calculate the offsetRight of a DOM object. I already have some rather simple code for getting the offsetLeft, but there is no javascript offsetRight property. If I add the offsetLeft and offsetWidth, will that work? Or is there a better…

Dan Bailiff
- 1,513
- 5
- 23
- 38
12
votes
5 answers
Reading text files line by line, with exact offset/position reporting
My simple requirement: Reading a huge (> a million) line test file (For this example assume it's a CSV of some sorts) and keeping a reference to the beginning of that line for faster lookup in the future (read a line, starting at X).
I tried the…

Benjamin Podszun
- 9,679
- 3
- 34
- 45
12
votes
3 answers
Offset/limit to page/size conversion
This should be an interresting challenge.
I'm looking for an algorithm that doesn't exist yet (to the best of my knowledge)
We have a database accessing function that can read pages of records at a time, using a page-number and page-size as…

Martijn
- 3,696
- 2
- 38
- 64
12
votes
1 answer
Bootstrap 3 using affix to fixing navbar position to top when scrolling
This is driving me nuts... This might be simple by I'm not hitting the nail: please give a hint :-)
I'm trying to play with Bootstrap 3 for a new layout for my site. I want the navbar to pin to the top of the screen when I scroll.
I got it working…

kjaer108
- 121
- 1
- 1
- 3
12
votes
5 answers
Get height of non-overflowed portion of div
Say I have a wrapper div with a overflow:hidden on it and a div inside that that spans far below the visible portion. How can I get the visible height of the internal div?

ryandlf
- 27,155
- 37
- 106
- 162
11
votes
2 answers
glm starting values not accepted log-link
I want to run a Gaussian GLM with a log link and an offset.
The following problems arise:
y <- c(1,1,0,0)
t <- c(5,3,2,4)
No problem:
exp(coef(glm(y~1 + offset(log(t)), family=poisson)))
with family=gaussian, starting values need to be specified,…

Andi
- 111
- 1
- 1
- 4