[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[silpa-discuss] Re: Help required in solving an issue
From: |
Vasudev Kamath |
Subject: |
[silpa-discuss] Re: Help required in solving an issue |
Date: |
Thu, 29 Apr 2010 21:12:55 +0530 |
User-agent: |
KMail/1.12.4 (Linux/2.6.33-2.slh.10-sidux-686; KDE/4.3.4; i686; ; ) |
Hi ,
Laxminarayan thanks for the prompt reply. I tried out your suggestion but
still this doesn't work. If you can find something more in my script please let
me know
Thanks and Regards
Vasudev Kamath
On Thursday 29 Apr 2010 9:05:35 am Laxminarayan Kamath wrote:
> No no, He is first calculating byte offsets for each line and storing
> in array (that happens in loadLineOffsets function (he got that from
> some stackoverflow thread). Then he uses the offsets to quickly jump
> to the required line. If I am not wrong , in line no 44 he is doing
>
> fp.seek(line_offsets[int(lineno)])
>
> which causes off by 1 error .. If he wanted 50th line's byte offset it
> is getting offset of 51st line.
>
> I think
>
> fp.seek(line_offsets[int(lineno) -1 ])
>
> is correct
>