Questions tagged [offset]

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.

3019 questions
21
votes
3 answers

Detecting offset of an element on scroll in javascript / jQuery

I am looking to calculate the distance between an element and the top of the document window. On scroll I am able to get the initial value but it does not change. How can I find this value and what the number has changed to on…
jeffreynolte
  • 3,749
  • 11
  • 41
  • 64
20
votes
5 answers

Calculate the UTC offset given a TimeZone string in JavaScript

Using the standard JS library (ECMA5), without using momentjs or external libs, how do you calculate the UTC offset given a TimeZone string such as "Europe/Rome" or "America/Los_Angeles"? UTC Offsets may depend on whether it is DST or not, so it…
GM Lucid
  • 1,404
  • 2
  • 12
  • 15
19
votes
2 answers

How can I determine the distance of an object to the right browser window border

How can I possibly figure out the distance from an object (div) to the right browser window border? http://www.screencast.com/t/ryNgwa4E Thanks!
19
votes
5 answers

PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string

I get following error: PHP message: PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string on this line: if ($uploadZoneData[1]['size'] != 0) { On php 7.4 i had any troube but with php 8 i have. What can be the…
Omexlu
  • 193
  • 1
  • 1
  • 7
19
votes
1 answer

Why file starting offset in mmap() must be multiple of the page size

In mmap() manpage: Its prototype is: void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); and description: The mmap() function asks to map 'length' bytes starting at offset 'offset' from the file (or other object)…
password636
  • 981
  • 1
  • 7
  • 18
18
votes
4 answers

How does the C offsetof macro work?

Possible Duplicate: Why does this C code work? How do you use offsetof() on a struct? I read about this offsetof macro on the Internet, but it doesn't explain what it is used for. #define offsetof(a,b) ((int)(&(((a*)(0))->b))) What is it trying…
Samuel Liew
  • 76,741
  • 107
  • 159
  • 260
18
votes
2 answers

How can I offset a scaffold widget in Flutter?

I want to design a custom navigation window like the one below. I planned to: Create my navigation widget Create my news feed widget Stack both widgets (news feed on top of the navigation) If the menu icon is clicked, translate the news feed…
Nirup Iyer
  • 1,215
  • 2
  • 14
  • 20
18
votes
4 answers

Difference between offsetParent and parentElement or parentNode

I have a following DOM structure
DIV has its overflow set to auto so if table grows bigger - it…
Yuriy Galanter
  • 38,833
  • 15
  • 69
  • 136
17
votes
1 answer

How to move (translate) an image by an offset of X, Y on imagemagick?

What's the command that will take an image, move / translate it by an offset of X,Y pixels and save the result?
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
17
votes
2 answers

OpenGL 3/4 glVertexAttribPointer stride and offset miscalculation

I am having a problem getting my vertex array pointed to properly: const float vertices[] = { /* position */ 0.75f, 0.75f, 0.0f, 1.0f, /* color */ 1.0f, 0.0f, 0.0f, 1.0f, /* position */ 0.75f, -0.75f, 0.0f, 1.0f, /* color */ 0.0f, 1.0f, 0.0f,…
user2350858
  • 681
  • 2
  • 10
  • 16
17
votes
5 answers

How to get ALL rows starting from row x in MySQL

In MySQL, how can I retrieve ALL rows in a table, starting from row X? For example, starting from row 6: LIMIT 5,0 This returns nothing, so I tried this: LIMIT 5,ALL Still no results (sql error). I'm not looking for pagination functionality, just…
SolidSmile
  • 3,206
  • 4
  • 21
  • 24
17
votes
2 answers

Delphi: Offset of record field

I'm looking for ways to obtain the offset of a field in a Delphi record. These 2 following methods work but i was hoping for a cleaner way. Basically i would have liked the third showmessage to work. Any ideas? type rec_a=record a:longint; …
Marladu
  • 545
  • 5
  • 11
17
votes
3 answers

jQuery offset top doesn't work correctly

I'm trying to create an script draw something in an element by mouse and I'm using Raphaeljs to do that. For correct drawing I need to find top and left of ‍input‍‍ element. I'm using var offset = $("#input").offset(); to get left and top. But the…
ahmadali shafiee
  • 4,350
  • 12
  • 56
  • 91
16
votes
4 answers

ggplot2 offset scatterplot points

I have two sets of points with error bars. I would like to offset the second so it's displayed slightly down from the first set, so that it doesn't obscure the original. Here is a mock data…
jslefche
  • 4,379
  • 7
  • 39
  • 50
16
votes
8 answers

Python - How can I open a file and specify the offset in bytes?

I'm writing a program that will parse an Apache log file periodically to log it's visitors, bandwidth usage, etc.. The problem is, I don't want to open the log and parse data I've already parsed. For example: line1 line2 line3 If I parse that file,…
dave
  • 7,717
  • 19
  • 68
  • 100