offset

Get offset of current buffer in vim (in particular, via python scripting)

Hi, i want to get the offset of the current cursor position the current selection range in vim, beginning from the start of the file. I do this in python, so hints how to do it with vim's python scripting would be very helpful. I have used vim.current.. before for doing scripting, but it uses lines and columns rather than a gener...

How to get ALL rows starting from row x in MySQL

Hi all, 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 retrieving all rows starting from a particular row. LIMIT 5,2000 seems like...

How to get UNIX_TIMESTAMP to not offset a datetime field when in different time zones?

I have built a small forum where users can post messages. My server is in the United States, but the userbase for the forum is in Taiwan (+15hrs). When someone posts to the form, I store the time in my mySQL database in the format YYYY-MM-DD HH:MM:SS. When I look in the database, the time displays the proper time (the time that the pe...

Element offset and client positions in BHO

Hi all, How to find the position of the HTMLElement in BHO(C#)? I need both offset position of the element in the page and the client position of the element i.e. position of the element from the Left-Top of the client window. Any help would be greatly appreciated. Once again thanks a million. -Datte ...

Content offset in Javascript

I want to create my own implementation of a div with scroll, without using overflow: scroll; But I can't seem to figure out how to get the content offset of a div, does anyone know? ...

Specify a character value as an offset from a constant in Java

I am looking to get a random letter using something like char ch = 'A' + randomNumber ; // randomNumber is int from 0 to 25 But that gives "loss of precision" compilation error (same if randomNumber is only a byte). I guess with Unicode the above is a gross oversimplification. But how should I do it ? This works but seems a bit clum...

UIImage Rotation Offset

I have the following code - (void)ComputeRotationWithRadians:(CGFloat)rad { CGFloat width = exportImage.size.width; CGFloat height = exportImage.size.height; UIGraphicsBeginImageContext(CGSizeMake(width, height)); CGContextRef ctxt = UIGraphicsGetCurrentContext(); CGContextScaleCTM(ctxt, 1.0, -1.0); CGContextTran...

PHP Echo Timezone based on GMT offset

I have an application that stores GMT time data in a MySQL db like this: 2009-12-16 15:27:47. The user's timezone offset is stored in another column like this: -6 The above timezone is GMT-6, which is CST. Is there any way I can echo CST (i.e. - date('T")) from the GMT offset data? Note: I should also add that the application global t...

DateTimeOffset adding TimeSpan returns invalid UTC offset for its TimeZoneInfo

I am in the process of building a temporal expression library that must be properly globalized and therefore work in all available Time Zones. Now I seem to be stuck as I'm not sure how to retrieve adjusted dates from DateTimeOffset objects in the correct Daylight Savings Time (DST) when the transition boundary is crossed using any vari...

Mobile minibrowser: how to reload image while maintaing page offset position?

In mobile web minibrowsers, it seems that the window object makes no sense since there's only one window to show. Therefore, things like window.pageYOffset=320 make no sense (as far as I can tell). Given a simple example such as a map zoomin/zoomout such as <html> <head> <title>zoom.html</title> <script language="javascript"> var zoom...

iPhone CurrentTimeZoneOffset from UTC

Is there a way to get the offset time zone for a given date. For example, if I am in New York and I pass in 12-12-2009 4 PM I would get back "-4" as we are 4 hours off GMT. (In .NET land there is a function to do that off the DateTime class. So I'm guess Cocoa has it too?) Ian ...

How to get HTML element coordinates using C#?

This is related to (http://stackoverflow.com/questions/1547614/how-to-get-html-element-coordinates-using-c) The answer given here is quite good. However, opening up a full instance of Internet Explorer seems like overkill if you're trying to process a good deal of information from within your own spider. Has anyone found/encountered/th...

What is the maximum value for row and column Range offset in VBA/Excel ?

I am using microsft excel 2003. I am getting "Application-defined or object-defined error" while executing the following If statement. If Range("MyData").CurrentRegion.Offset(i, 0).Resize(1, 1).Value = Range("MyData").CurrentRegion.Offset(i + 1, 0).Resize(1, 1).Value Then The value of i is 58981 when I get this er...

How to use Imagick php to generate a bmp file with a palette offset

I'm trying to use Imagick via php to generate a 8bit bmp from jpg. But i would like the pixel colors to start at index 16 rather than 0. The code below shows how to generate the bmp in the correct format i need, but the palette index defaults to 0. Is there a way to make sure the palette start at another index? $average = new Imag...

Offset as hex from textbox

I'm using lpBaseAddress : IntPtr but ... I need to enter hex value :-/ like a normal offset like on VB that could be something like : offset = CLng("&H" + text) So I need to take a value from textbox and make same magic on C# (or Nemerle ^_) ...

Win32 API GroupBox: How to get an offset of text in the header

I have a groupbox (BS_GROUPBOX) like this: http://i50.tinypic.com/34osspd.png (Sorry, new users like me cannot insert images directly) The text of header is sets dynamicaly. I need to determine that current text fit width or not. I use GetTextExtentPoint() to determine string width (textWidth) and, of course, I know a size of control (...

[Firefox vs IE] element.offsetTop when parent has overflow and border

Hi, FF and IE give differents offsetTop when a child is into a parent with overflow and border. FF substracts the top border size of the parent from offsetTop value, so return a negative value(often); I think IE return the correct value instead. Test it There is a crossbrowser way to get the same value? Thank you. ...

How to fix .offset error when upgrading from jQuery 1.3.2 -> 1.4.2

Hey everyone, I just upgraded jQuery to version 1.4.2 and I am now getting an error on this line var offset = $(settings.textBoxObj).offset({padding: true, border: true}); Before I upgraded I was not getting this error. Does anyone know if something changed in 1.4 to affect this line of code? Metropolis ...

jQuery UI sortable scroll helper element offset Firefox issue

I have a problem with a jQuery UI 1.7.2 sortable list in Firefox 3.6, IE7-8 work fine. When I'm scrolled down a bit, the helper element seems to have an offset of the same height that I'm scrolled down from the mouse pointer which makes it impossible to see which item you originally started dragging. How do I fix this or work around the ...

Determining if an offset is in between line numbers?

hi I need to determine if a given selection is in between a start line and an end line. I have an ILineRange and a given offset within the viewport of eclipse. (I need to know, if the selection (from a remote party) was made within the current viewport of the local user. Unfortunately, I cannot get an ILineRange from the selection. I mus...