Asking about a function

i would like to write the function of getLineoffset(int)
i would to write this function by myself
please help me to wirte the.....
thank you

Hi,
Try this piece of code, import java.io.*;
class Offset {
     public static void main(String a[]) {
          int lineNo=Integer.parseInt(a[0]); // Pass the line no as an argument
          Offset offset = new Offset();
          long os = offset.getLineOffset(lineNo);
          System.out.println("Offset is : "+os);
     private long getLineOffset(int lineNo) {
          int count = 0;
          String line = "";
          long lineOffset = 0;
          try {
               File file = new File("test.txt");
               BufferedReader br = new BufferedReader(new FileReader(file));
               line = br.readLine();
               while(line != null) {
                    count++;
                    if(count == lineNo)
                         break;
                    lineOffset += line.length();
                    line = br.readLine();
          } catch(Exception e) {
               System.out.println(e);
          return lineOffset+1;
}Sudha

Similar Messages

  • By asking for the function seek and replace [apple F] i get no display - so see nothing except the upper stroke. what is going on? and what can i do about it?

    by asking for the function seek and replace [apple F] i get no display - so see nothing except the upper grey line. what is going on? and what can i do about it?
    restarting doesn't work

    Does trashing the preferences help? See Replace Your Preferences

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • I want to know about Node functions

    can anyone explain with example about node functions in PI with an example as i am knew to PI

    Hi Chandra,
    Using google or SCN search you will find a lot of examples...
    https://www.google.es/search?q=SAP+PI+node+functions&ie=utf-8&oe=utf-8&rls=org.mozilla:es-ES:official&client=firefox-a&c…
    Redirecting...
    Try to read the SAP documentation and later ask to the forum if you have any doubt with a specif function and/or example. You would consider to research a bit before to ask because the question is so generic.
    Regards,

  • How to never ever see Wine asking about installing gecko anymore?

    Hi,
    I love Wine, and I love Wine getting upgrades to newer, improved, versions.
    However, every single time Wine is upgraded, and that's quite often, when I then start it up, it shows a dialog that it needs to reinstall the "Gecko Engine".
    I want Wine to work properly. Whether it needs "Gecko Engine" for that or not does not matter for me (yeah it's for webbrowsing, what its purpose is does not matter for me, it's functionality of Wine just like everything else, but the other functionality never complains...). It probably does need it. But does it need to frigging reinstall that through a pop up GUI appearing at the point when you want to run some game or program in Wine after *every single* upgrade?
    What can I do to ensure that I will *never in my life* see wine asking about "Gecko engine" anymore, and yet despite that get upgrades for it and be able to use it properly?
    Thanks a lot!

    Install wine_gecko package.

  • Ask about re-enable button (play, fastforwar​d,mute) on Satellite L510

    Hi All,
    I wanna ask about re-enabling toshiba satellite L510-S407 which installed under XP SP3. Because before i installed common modules from toshiba, those button running well. But after i installed toshiba common modules, the button (where is located side by side with power button) goes disabled, not functioning anymore. Is there anything that i could do or some driver that should be installed  to make those button functioning again?
    Thanks

    it's solved now, i need to install toshiba touchpad utility,toshiba controls,toshiba utility.

  • Disable "asking about to close a window"

    Hey, with Safari 3, there is the "Taboo-Plugin" included, so I read right...
    It makes me insane, that Safari is always asking me if I want to close really the window, only cause I written some text in any field.
    Is there any option to disable this new function?
    Thanks, Peter

    iBod,
    Closing multiple tabs is a different issue from the one schottenfalke asked about.
    In Safari 3, if you enter text into a form on a web page, and later close the page, it asks if you really want to close it. This is not addressed in the Preferences, nor can I find anything in the plist.
    Any way to turn it off?

  • I run OSX10.6.8. Just dwnlded FF8.1 and everytime I go to open it I am asked about the disk image. But if I delete the dmg, the program won't run.

    I just downloaded the 8.1 version. It was a 30+mb file. Previously I ran 4.0. So I drag the new Firefox icon into the Apps folder. It does its merge thing with the old version. Problem is when I click to open FF now, it always throws up this window asking me about the disk image of what I just downloaded. I even tried restarting the computer--but the same message pops up. I checked on your website and it says that I need to "eject" the disk image (i.e. I'm guessing that means the 30+ mb file I just down loaded), so since I don't have an eject option that I can find (except for external harddrives and cd/dvd), I just drug it into the trash. I go to empty the trash and I get a message that that dmg file is "in use" even though FF is completely shut down. So again I'm guessing that means that even though I already merged that dmg file with the old 4.0 version file, if I dump the update file it seems that it's going to mess up the actual revised program file still remaining. I just want to be able to click on the icon in my dock like I've always done and have FF open. I don't want to keep being asked about disk image stuff. Somehow this feels like an easy resolution, but I just can't seem to put my finger on how to resolve it. Thanks for you help.

    Nope---didn't work. I've owned Macs for about 12 years so although I am brain dead on some things, I do have a working knowledge on most things. I only say that to say this--I did try holding down the mouse and choosing empty trash. It asks if I want to permanently delete what's in there. I say yes--and then I get the same identical message again-----'The operation can't be completed because the item "Firefox 8.0.1.dmg" is in use I can then click stop, or continue.' So apparently that complains the same way it does if I click it up on the menu :)))
    As for item owned by---that's not an issue and isn't coming up. User is not a problem either as I am the only user on this system. There is only ONE file in my trash at the moment at that is this dmg file. Nothing Mac. Nothing owned by anyone other than Firefox. The problem seems to be that the dmg file and the original 4.0 FF file are working in tandem with each other--even though I have already drug the new 8.0 globe into the Apps folder and it updated the FF app with the new stuff. If I could force the dmg file to go away, I would do so, but at every turn the system is telling me it can't be done because it seems to think that dmg file is in use---even though everything is shut down and/or ejected. Hey--I'm getting ready to head out and won't be back till evening. I'll check back in this evening. Thank you again for your help.

  • TS1702 when I am installing a new free app on my iphone , 'm asked about the way of payment . I check the none option in my apple Id account but it wouldn't be accepted . what should I do ?

    hi , I faced with a new problem recently while installing a free app.
    when I am installing a new free app on my iphone , I'm asked about the way of payment . I check the none option in my apple Id account but it wouldn't be accepted . what should I do ?
    regards

    You need to ask Apple for assistance with getting back into your old ID. To do this, click here and pick a method; if that page doesn't list one for your country or you're unable to resolve this issue through the Account Security team, fill out and submit this form.
    (118441)

  • Hi, I asked about my WiFi modem? Sorry but I don't understand any of the suggestions given to me. We don't have an Apple Store where I live, the rest of it's over my head. I also don't own a PC. Any other suggestions? What's IPS?

    What I want to know is why did my WiFi modem work just fine for a whole week, now it doesn't. I can't get any Internet access if it's connected, if it's not I can't download apps from AppStore,as I have no Internet access. I'm tech literate, I don't understand what an IPS is, I don't know about ports and numbers, and there is no Apple store where I live. So now what am I supposed to do? My mum bought me the **** thing, it cost her $150, and it's worked for a week, and then excuse my French, **** itself! Can someone please help me, and in English please? I've only had an iPad since Christmas, I don't have a PC and wouldn't know how to do any of that stuff if I did. Very Frusterating!

    You asked about IPS. I believe you mean ISP, or your Internet Service Provider.
    Since you don't have a computer, you won't be able to change the router settings.
    Some things to try first:
    1. Turn Off your iPad. Then turn Off (disconnect power cord for 30 seconds or longer) the wireless router & then back On. Now boot your iPad. Hopefully it will see the WiFi.
    2. Go to Settings>Wi-Fi and turn Off. Then while at Settings>Wi-Fi, turn back On and chose a Network.
    3. Change the channel on your wireless router (Auto or Channel 6 is best). Instructions at http://macintoshhowto.com/advanced/how-to-get-a-good-range-on-your-wireless-netw ork.html
    4. Go into your router security settings and change from WEP to WPA with AES.
    5.  Renew IP Address: (especially if you are droping internet connection)
        •    Launch Settings app
        •    Tap on Wi-Fi
        •    Tap on the blue arrow of the Wi-Fi network that you connect to from the list
        •    In the window that opens, tap on the Renew Lease button
    6. Potential Quick Fixes When Your iPad Won’t Connect to Your Wifi Network
    http://ipadinsight.com/ipad-tips-tricks/potential-quick-fixes-when-your-ipad-won t-connect-to-your-wifi-network/
    ~~~~~~~~~~~~~~~~~~~~~~~~~
    iOS 6 Wifi Problems/Fixes
    Wi-Fi Fix for iOS 6
    https://discussions.apple.com/thread/4823738?tstart=240
    How To: Workaround iPad Wi-Fi Issues
    http://www.theipadfan.com/workaround-ipad-wifi-issues/
    Another Fix For iOS 6 WiFi Problems
    http://tabletcrunch.com/2012/10/27/fix-ios-6-wifi-problems-ssid/
    Wifi Doesn't Connect After Waking From Sleep - Sometimes increasing screen brightness prevents the failure to reconnect after waking from sleep. According to Apple, “If brightness is at lowest level, increase it by moving the slider to the right and set auto brightness to off.”
    Fix For iOS 6 WiFi Problems?
    http://tabletcrunch.com/2012/09/27/fix-ios-6-wifi-problems/
    Did iOS 6 Screw Your Wi-Fi? Here’s How to Fix It
    http://gizmodo.com/5944761/does-ios-6-have-a-wi+fi-bug
    How To Fix Wi-Fi Connectivity Issue After Upgrading To iOS 6
    http://www.iphonehacks.com/2012/09/fix-wi-fi-connectivity-issue-after-upgrading- to-ios-6.html
    iOS 6 iPad 3 wi-fi "connection fix" for netgear router
    http://www.youtube.com/watch?v=XsWS4ha-dn0
    Apple's iOS 6 Wi-Fi problems
    http://www.zdnet.com/apples-ios-6-wi-fi-problems-linger-on-7000004799/
    ~~~~~~~~~~~~~~~~~~~~~~~
    How to Boost Your Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Boost-Your-Wi-Fi-Signal.h tm
    Troubleshooting a Weak Wi-Fi Signal
    http://ipad.about.com/od/iPad_Troubleshooting/a/Troubleshooting-A-Weak-Wi-Fi-Sig nal.htm
    How to Fix a Poor Wi-Fi Signal on Your iPad
    http://ipad.about.com/od/iPad_Troubleshooting/a/How-To-Fix-A-Poor-Wi-Fi-Signal-O n-Your-iPad.htm
    iOS Troubleshooting Wi-Fi networks and connections  http://support.apple.com/kb/TS1398
    iPad: Issues connecting to Wi-Fi networks  http://support.apple.com/kb/ts3304
    WiFi Connecting/Troubleshooting http://www.apple.com/support/ipad/wifi/
    How to Fix: My iPad Won't Connect to WiFi
    http://ipad.about.com/od/iPad_Troubleshooting/ss/How-To-Fix-My-Ipad-Wont-Connect -To-Wi-Fi.htm
    iOS: Connecting to the Internet http://support.apple.com/kb/HT1695
    iOS: Recommended settings for Wi-Fi routers and access points  http://support.apple.com/kb/HT4199
    How to Quickly Fix iPad 3 Wi-Fi Reception Problems
    http://osxdaily.com/2012/03/21/fix-new-ipad-3-wi-fi-reception-problems/
    iPad Wi-Fi Problems: Comprehensive List of Fixes
    http://appletoolbox.com/2010/04/ipad-wi-fi-problems-comprehensive-list-of-fixes/
    Connect iPad to Wi-Fi (with troubleshooting info)
    http://thehowto.wikidot.com/wifi-connect-ipad
    Fix iPad Wifi Connection and Signal Issues  http://www.youtube.com/watch?v=uwWtIG5jUxE
    Fix Slow WiFi Issue https://discussions.apple.com/thread/2398063?start=60&tstart=0
    How To Fix iPhone, iPad, iPod Touch Wi-Fi Connectivity Issue http://tinyurl.com/7nvxbmz
    Unable to Connect After iOS Update - saw this solution on another post.
    https://discussions.apple.com/thread/4010130
    Note - When troubleshooting wifi connection problems, don't hold your iPad by hand. There have been a few reports that holding the iPad by hand, seems to attenuate the wifi signal.
    Wi-Fi or Bluetooth settings grayed out or dim
    http://support.apple.com/kb/TS1559
    ~~~~~~~~~~~~~~~
    If any of the above solutions work, please post back what solved your problem. It will help others with the same problem.
     Cheers, Tom

  • I have an iMac model 4,1 running OSX 10.6.8.   The CD/DVD drive went bad and I have replaced it.  However I can not get disks to eject.   I have asked about this before and tried all all the suggestions I have received but I can not eject.

    I have an iMac model 4,1 running OSX 10.6.8.   The CD/DVD drive went bad and I have replaced it.  However I can not get disks to eject.   I have asked about this before and tried all all the suggestions I have received but I can not eject.  
    Yesterday I opened up the iMac and reinstalled the drive to make sure that it was not an alignment problem.   I still can not eject.   When I try to eject the drive makes noises like it is ejecting but the disk does not come out.
    How do I solve this problem?

    Hi again Hal
    Link to your other thread > The slot loading CD/DVD drive in my...: Apple Support Communities
    You have also tried resetting the PRAM as I suggestion in your other thread...?
    See resetting the PRAM > About NVRAM and PRAM
    1. Shut down the computer.
    2. Locate the following keys on the keyboard: Command, Option, P, and R. You will need to hold these keys down simultaneously in step 4.
    3. Turn on the computer.
    4. Press and hold the Command-Option-P-R keys. You must press this key combination before the gray screen appears.
    5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
    6. Release the keys.

  • How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address b

    How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address book. I already have three address books created for me by Thunderbird. I add all new addresses to one of those but am afraid to delete the other address books because some of their addresses are not repeated in my "main" address book. So if I don't delete all the names in one of the existing books, I need to create an empty book that will not mix the addresses with those in another address book. HOW DO I CREATE A NEW, EMPTY ADDRESS BOOK? I want to be able to create various mailing LISTS using the addresses in this new book so I will eventually have a special address book with a variety of mailing lists I can use as I wish.

    In 24.4.0 there is no File|New|Address Book. There is File|New|Address Book Contact. How do I create a new address book ?

  • What do I have to write when in compilation form they ask about url website?

    I am trying to complete the compilation form create a sell books account. I can't go on because I don't know what do I have to write when in compilation form they ask about url website (in Physical Address and Contact Information section).
    Sorry for my english
    Thank you

    Just as the message says, she can't search places in Canada.
    Unfortunately, location based Siri searches are only supported in the U.S. for right now.  They are coming to other places such as Canada but we don't know when.

  • WTK 2.5.2 Emulator always asks about file access

    Is there a way to suppress the question that the emulator asks about accessing a file using a Fileconnection? It asks it on EVERY SINGLE ACCESS and seriously interferes with debugging. (On the real device, I can give permission once and be done with it).
    Michael D. Spence
    Mockingbird Data Systems, Inc.

    In (for Windows) C:\Documents and Settings\spence\j2mewtk\2.5.2\appdb:
    - Make a copy of _policy.txt so you can undo this later if you want.
    - Find the domain you midlet runs in (e.g., domain: identified_third_party).
    - Change these two lines:
    blanket(oneshot): read_user_data_access
    blanket(oneshot): write_user_data_access
    to read
    allow: read_user_data_access
    allow: write_user_data_access

  • Documentation about this function module

    ineed Documentation about this function module RP_ANSAL_FROM_PERNR

    Hi Avinash,
    Have a look at the function group program documentation.It gives an idea of what the function module does.
    Short text
    Annual Salary Functionality (ANSAL)
    Description
    This function group contains different functionality for calculating the annual salary, and calculating a period salary from the annual salary.
    The function group evaluates different tables and features:
    Tables
    T503      defines whether an employee is paid on an
              hourly basis or per period
    T510W     defines the time unit
    T511      determines the relevant module from the annual
              salary wage type, rounding, etc.
    T539J     defines the valid wage types for calculating 
              the annual salary
    Features
    ANSAL     defines the annual salary wage type
    PFREQ     number of periods per year
    Old U510F -> use T510F ?
    Thanks
    Lakshman

Maybe you are looking for

  • How do i update JRE

    how do i update java runtime enviroment after installing operating system?

  • Oracle 10g Multiple home- how to know which is current home?

    Hi, I've installed Oracle 10g database on a system (Windows XP) and have 2 oracle homes on that machine. How do I know which is the current home? I am not able to see the 'Home selector' in Programs menu after installation. What is the way to find ou

  • MacBook Pro Slow after upgrading OS

    Hey guys, I'm having a problem my MacBook Pro is running incredibly slow after upgrading to Snow Leopard 10.6.8.  I started having the problem originally after upgrading to the latest version of Mavericks. It is just incredibly slow for some reason,

  • Adding a column at item level while creating PO using ME21N

    Hi, My requirement is to add new column in Item overview of PO at the time of creation. Same should be displayed in ME22N and ME23N. I tried doing same using BADI ME_PROCESS_PO_CUST using interface PROCESS_ITEM after adding field QSSYS in EKPO table.

  • Disk Image on DVD disk. How do I utilize?

    I backed up a project on a DVD disk as a disk image. How do I utilize it? I would like to get it into iMovie or iDVD and eventually burned to a DVD? Thanks