Algorithm or pseudo code sought for getting the latest last modified time..

Hi I need to write a program in java that lists the latest last modified time among the files in folders and its subfolder and also gets the size of the folder. In my case, average folder size is 9 GB. Could you please suggest any algorithm to achieve this?? I tried to implement it by gathering last modified times from folders and its subfolders recursively and storing the info in Vector and finally
getting the max of the last modified times but it was horribly slow and memory hogging.

Remove the part that stores the data in a Vector. You don't need to store any data to add up a series of numbers. And you don't need to store any data to find the largest of a series of numbers either. Just scan the directory recursively as you are already doing and keep track of the sum of the sizes and the max of the last-modified dates.

Similar Messages

  • Getting the Publisher Last Modified Date to show up in a snapshot query?

    Hello,
    I have been requested to create a Snapshot Query of the latest content to a Publisher 6.5 folder. I created a Publisher Crawler to output data to the Knowledge Directory (KD), then created a Snapshot Query to point at the KD folder.
    I set it to use Object Last Modifed - but it pulls the last crawl date, and then tried File Modifed - which gives the date 01/01/00 12:00 AM, Published comes up with 01/01/00 12:00AM, Publisher comes up with a blank.
    Publisher itself has two time fields - Created and Modified On. I want to display Modified On and have no luck.
    Help!?
    Thanks,
    Victor

    edit: reading your post again, i'm not sure i understand. i am probably giving you bad info.
    Are you saying you want the KD card modified dates to match the content item modified dates? Thats not really how the portal works (although lots of people want it to work that way).
    The KD card modified dates reflect the last time the card was refreshed. (Useless, I know)
    Edited by: Joel Collins on Jul 21, 2009 5:58 AM

  • How to get the latest Change date and time of a M.O. from View VIAUFKST

    Hi All,
    I want to get the latest date and time of a M.O. from view
    VIAUFKST. I have written the query like this...
      SELECT AUFNR
             AEDAT  " Changed Date
             AEZEIT " Changed Time
        FROM VIAUFKST
        INTO TABLE I_VIAUFKST
       WHERE AEDAT >= W_LASTRUN_DATE
       ORDER BY AEDAT DESCENDING.
    but its not giving me right results... Pls help me out on this or suggest me the right approach to achieve the same...As this is very critical issue...
    Advance Thanks and Points Gauranteed...
    Suresh

    > SELECT AUFNR
    >          AEDAT
    >          AEZEIT
    >     FROM VIAUFKST
    >     INTO TABLE I_VIAUFKST
    >    WHERE AEDAT >= W_LASTRUN_DATE.  
    >
    >   IF NOT I_VIAUFKST[] IS INITIAL.
    >    SORT I_VIAUFKST BY AEDAT AEZEIT DESCENDING.
    >    READ TABLE I_VIAUFKST INDEX 1.
    >   ENDIF.
    >
    > The above statement is giving me different results...
    > such as...
    >
    >  1. 30/11/2005 19:20:11
    >  2. 29/11/2005 22:10:09
    >  3. 30/11/2005 20:56:09
    >  4. 28/11/2005 23:10:09
    >
    > by using the above SORT statement i am getting the
    > fourth record as the latest, where as it should give
    > me the third record....
    >
    > Please advise,
    > Suresh.
    Hi Suresh,
    The reason why you are getting this result is because the system is interpreting the DESCENDING only for AEZEIT not for both. Change it to
    SORT I_VIAUFKST BY AEDAT DESCENDING AEZEIT DESCENDING

  • TS3694 I cant get my ipad 2 out of recovery. The apple icon stays on and nothing happens. I tried restoring it through Itunes but it comes up with a 3194 error code. I have the latest Itunes being 10.6.1.7 and the latest windows update.Can someone please

    I cant get my ipad 2 out of recovery. The apple icon stays on and nothing happens. I tried restoring it through Itunes but it comes up with a 3194 error code. I have the latest Itunes being 10.6.1.7 and the latest windows update.Can someone please help?

    Recovery Mode
    1. Disconnect the USB cable from the device, but leave the other end of the cable connected to your computer's USB port.
    2. Turn off the device: Press and hold the Sleep/Wake button for a few seconds until the red slider appears, then slide the slider. Wait for the device to turn off.
    3.While pressing and holding the Home button, reconnect the USB cable to the device. The device should turn on.
    4. Continue holding the Home button until you see the "Connect to iTunes" screen. When this screen appears, release the Home button. iTunes should alert you that it has detected a device in recovery mode. Click OK, and then click Restore to restore the device.
    Note: Data will be lost. You may have to repeat the above many times.

  • What is the latest update available for Mac OSX 10.5.8 that will allow me to get the latest update for iTunes.  I really need to update my iPhone and CAN'T!!  GRRRR!!!

    What is the latest update available for Mac OSX 10.5.8 that will allow me to get the latest update for iTunes.  I really need to update my iPhone and CAN'T!!  GRRRR!!!

    Minimally you need Snow Leopard or greater:
    Upgrade Paths to Snow Leopard, Lion, and/or Mountain Lion
    You can upgrade to Mountain Lion from Lion or directly from Snow Leopard. Mountain Lion can be downloaded from the Mac App Store for $19.99. To access the App Store you must have Snow Leopard 10.6.6 or later installed.
    Upgrading to Snow Leopard
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard — Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.
         Snow Leopard General Requirements
           1. Mac computer with an Intel processor
           2. 1GB of memory
           3. 5GB of available disk space
           4. DVD drive for installation
           5. Some features require a compatible Internet service provider;
               fees may apply.
           6. Some features require Apple’s iCloud services; fees and
               terms apply.
    Upgrading to Lion
    If your computer does not meet the requirements to install Mountain Lion, it may still meet the requirements to install Lion.
    You can purchase Lion by contacting Customer Service: Contacting Apple for support and service — this includes international calling numbers. The cost is $19.99 (as it was before) plus tax.  It's a download. You will get an email containing a redemption code that you then use at the Mac App Store to download Lion. Save a copy of that installer to your Downloads folder because the installer deletes itself at the end of the installation.
         Lion System Requirements
           1. Mac computer with an Intel Core 2 Duo, Core i3, Core i5, Core i7,
               or Xeon processor
           2. 2GB of memory
           3. OS X v10.6.6 or later (v10.6.8 recommended)
           4. 7GB of available space
           5. Some features require an Apple ID; terms apply.
    Upgrading to Mountain Lion
    To upgrade to Mountain Lion you must have Snow Leopard 10.6.8 or Lion installed. Purchase and download Mountain Lion from the App Store. Sign in using your Apple ID. Mountain Lion is $19.99 plus tax. The file is quite large, over 4 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
         OS X Mountain Lion — System Requirements
           Macs that can be upgraded to OS X Mountain Lion
             1. iMac (Mid 2007 or newer) — Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) —
                 Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) — Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) — Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) — Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) — Model Identifier 3,1 or later
             7. Xserve (Early 2009) — Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
    Are my applications compatible?
             See App Compatibility Table — RoaringApps.
         For a complete How-To introduction from Apple see Upgrade to OS X Mountain Lion.

  • Userexits/BADI in ME31K for getting the contract number created.

    Dear Experts,
    Is there any userexits/BADI available in ME31K , for getting the contract number once it is created.
    Thanks&Regards,
    Anversha

    Hi
    find the BADI:
    1. Goto SE24
    2. Open the class "CL_EXITHANDLER"
    3. Open the Metnod "GET_INSTANCE"
    4. Put a Break point in the "  CASE sy-subrc."
    CALL METHOD cl_exithandler=>get_class_name_by_interface
        EXPORTING
          instance                      = instance
        IMPORTING
          class_name                    = class_name
        CHANGING
          exit_name                     = exit_name
        EXCEPTIONS
          no_reference                  = 1
          no_interface_reference        = 2
          no_exit_interface             = 3
          data_incons_in_exit_managem   = 4
          class_not_implement_interface = 5
          OTHERS                        = 6.
      CASE sy-subrc.
        WHEN 1.
          RAISE no_reference.
        WHEN 2.
          RAISE no_interface_reference.
        WHEN 3.
          RAISE no_exit_interface.
        WHEN 4.
          RAISE data_incons_in_exit_managem.
        WHEN 5.
          RAISE class_not_implement_interface.
      ENDCASE.
    5. Come Back and Execute the Transaction Code
    6. In the Debugging screen "exit_name" having the BADI Name for that Tcode.

  • UserExit/BADI for getting the contract number in ME31K

    Dear Experts,
    Is there any userexits/BADI available in ME31K , for getting the contract number once it is created.
    Thanks&Regards,
    Anversha

    Hi
    find the BADI:
    1. Goto SE24
    2. Open the class "CL_EXITHANDLER"
    3. Open the Metnod "GET_INSTANCE"
    4. Put a Break point in the "  CASE sy-subrc."
    CALL METHOD cl_exithandler=>get_class_name_by_interface
        EXPORTING
          instance                      = instance
        IMPORTING
          class_name                    = class_name
        CHANGING
          exit_name                     = exit_name
        EXCEPTIONS
          no_reference                  = 1
          no_interface_reference        = 2
          no_exit_interface             = 3
          data_incons_in_exit_managem   = 4
          class_not_implement_interface = 5
          OTHERS                        = 6.
      CASE sy-subrc.
        WHEN 1.
          RAISE no_reference.
        WHEN 2.
          RAISE no_interface_reference.
        WHEN 3.
          RAISE no_exit_interface.
        WHEN 4.
          RAISE data_incons_in_exit_managem.
        WHEN 5.
          RAISE class_not_implement_interface.
      ENDCASE.
    5. Come Back and Execute the Transaction Code
    6. In the Debugging screen "exit_name" having the BADI Name for that Tcode.

  • Where can I get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?

    Can somebody point me to where I can get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?
    When I go into Library Settings on any library or list in SharePoint 2010 I’m getting an unexpected error; I see this in the SharePoint log:
    11/18/2014 13:12:26.36 w3wp.exe (0x2260)                       0x33EC  SharePoint Foundation        
            Runtime                                      
    tkau       Unexpected       System.NullReferenceException: Object reference not set to an instance of an object.    at Microsoft.SharePoint.ApplicationPages.ListEditPage.SetSectionLinks()    
    at Microsoft.SharePoint.ApplicationPages.ListEditPage.OnLoad(EventArgs e)     at ASP._layouts_listedit_aspx.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Page.ProcessRequestMain(Boolean
    includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) 03c7c5b4-407f-461c-9cf7-0304eb797b1a
    I searched online and found this:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/ed5aa58a-f5cc-4449-8bfd-65ca6f101641/list-settings-page-error-on-all-type-of-sharepoint-2010-listslibraries?forum=sharepointgeneralprevious.  It says:
    We noticed exactly the same issue after applying some SharePoint updates (SP1 + October 2011 CU).  The problem turned out to be that there was an older version (V14.0.4762.1000) of Microsoft.SharePoint.ApplicationPages.dll in the GAC. 
    This version was being loaded instead of the latest version of the DLL (14.0.6112.5000).
    Loading the latest version of Microsoft.SharePoint.ApplicationPages.dll fixed the problem with the List/Library settings page.
    I check our Microsoft.SharePoint.ApplicationPages.dll and found that we have version 14.0.6024.1000.
    I would like to try replacing it with the latest version to see if that could fix the problem going into library settings.
    Does someone know where I can get the latest Microsoft.SharePoint.ApplicationPages.dll for SharePoint 2010?
    David

    You would need to extract it from an update. Pre-SP2 SharePoint 2010 is no longer supported, I'd recommend upgrading to SP2 which should take care of any versioning issues.
    Trevor Seward
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Firefox.exe has encountered a problem and needs to close. We are sorry for the inconvenience. I have been using firefox for years. I installed the latest version of Firefox. It worked fine for several days. Now I get the above message each time I try to s

    firefox.exe has encountered a problem and needs to close. We are sorry for the inconvenience.
    I have been using firefox for years. I installed the latest version of Firefox. It worked fine for several days. Now I get the above message each time I try to start Firefox, even in safe mode. i have checked with latest antivirus softwere also.. i didn't find any thing suspicious.
    == This happened ==
    Every time Firefox opened
    == after loading firefox 3.6.6 ==
    == User Agent ==
    Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.99 Safari/533.4

    I was having this problem few days ago,and I have fixed.Try this steps-If you have AVG antivirus so go on firefox>Tools>Add On and Disable AVG safe search and AVG tool bars too.Then restart computer.

  • I can't get the latest version of iTunes 12.0.1 for Windows (64-bit) to work on my laptop.

    I can't get the latest version of iTunes 12.0.1 for Windows (64-bit) to work on my laptop. It says it has successfully downloaded and installed, but when I try to connect my new iPhone 6 to iTunes i get an error message 'need to install new software' but i thought i had! Please help me as i have had to connect my phone to someone else's mac and therefor don't have my music etc on my phone HELP!  I have had IT support at work trying to figure it out and no one can!

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Function module for getting the partner details and Classifications

    Hi,
    Can any one tell me FMs for getting the Partner Details and for getting the characteristics associated with an equipment??
    Thanks

    Hi Anu,
    are you talking about the SAP Business Partner???
    Well, if yes, then just check the FM 'BAPI_BUPA_CENTRAL_GETDETAIL'.
    Or just search for oher FMs with BAPI_BUPA*.
    Hope this helps...
    Ciao Bernhard

  • FM for getting the logical file name

    Hi,
    is there any FM for getting the logical file name.
    Thanks
    Vikranth

    Hi,
    CONSTANTS: c_mask          TYPE char9      VALUE ',.,..'.
          Pick up the file path from the application server
    FORM f1001_browse_appl_file .
      DATA:  lcl_directory  TYPE char128.
      lcl_directory  = p_direct.
      CALL FUNCTION '/SAPDMC/LSM_F4_SERVER_FILE'
        EXPORTING
          directory        = lcl_directory
          filemask         = c_mask
        IMPORTING
          serverfile       = p_f2  " Parameter File
        EXCEPTIONS
          canceled_by_user = 1
          OTHERS           = 2.
      IF sy-subrc <> 0.
       MESSAGE e000(zmm) WITH text-039.
       flg_app = 'X'.
      ENDIF.
    Then use  OPEN DATASET for data reading
    Hope this Helps.
    Manish
    Message was edited by:
            Manish Kumar

  • My MacBook Pro got wet and I lost all of my childs photos from the day she was born. Is there anyway I could get these pictures back from my iCloud? I actually care more for getting the photos back than I do my laptop. Please help! Thank you!

    My MacBook Pro got wet and I lost all of my childs photos from the day she was born. Is there anyway I could get these pictures back from my iCloud? I actually care more for getting the photos back than I do my laptop. Please help! Thank

    Welcome to the Apple community khnkOliver.
    I assume these photos, or at least not all of them weren't in photo stream.
    You should be able to recover your photos from a back up.

  • Using JCom for getting the user name

    I am using jcom610-win.exe and weblogic610sp2_win.exe .I need to use the Jcom for getting the user name of the NT Iser Logged in.I have got the process for this on the page at http://e-docs.bea.com/wls/docs61/jcomreference/Security.html .But this page uses a method isCallerAuthenticated() from a class file called jcom .I looked into the whole bea directory but there was no class like in the server dir.Can you tell where to get this class from.And if this has not been provided into the jar files that come along with the installable then why is it mentioned in the page @ http://e-docs.bea.com/wls/docs61/jcomreference/Security.html

    Hi.
    You might have better luck posting this in teh jcom newsgroup.
    Regards,
    Michael
    Manoj Gupta wrote:
    I am using jcom610-win.exe and weblogic610sp2_win.exe .I need to use the Jcom for getting the user name of the NT Iser Logged in.I have got the process for this on the page at http://e-docs.bea.com/wls/docs61/jcomreference/Security.html .But this page uses a method isCallerAuthenticated() from a class file called jcom .I looked into the whole bea directory but there was no class like in the server dir.Can you tell where to get this class from.And if this has not been provided into the jar files that come along with the installable then why is it mentioned in the page @ http://e-docs.bea.com/wls/docs61/jcomreference/Security.html
    Michael Young
    Developer Relations Engineer
    BEA Support

  • Code to get the latest version of an entitiy using wcf?

    Hi,
    I am using WCF services to get entities in MDS. I want to get the entities only in the l;atest version. Can you please share code/api asto how to get the latest version of a model in MDS using WCF?
    Thanks

    You can use MetadataGet API to get all versions associated with the model and then sort them by CreatedDateTime or
    UpdatedDateTime depending how you define "the latest version" .
    The code would be like :
    var mdGetRequest = new MetadataGetRequest
    SearchCriteria =
    Models = new Collection<DC.Identifier>()
    new DC.Identifier() {Name = "Account"}
    ResultOptions = {Versions = DC.ResultType.Identifiers},
    // Call MDS service
    MetadataGetResponse mdGetResponse = MyServicesApiUtility.MdsService.MetadataGet(mdGetRequest);
    if (mdGetResponse.OperationResult.Errors.Count == 0 && mdGetResponse.Metadata.Versions.Count != 0)
    var versions = new List<DC.Version>(mdGetResponse.Metadata.Versions);
    versions.Sort(
    (ver1, ver2) => ver2.AuditInfo.CreatedDateTime.CompareTo(ver1.AuditInfo.CreatedDateTime));
    return versions.First();
    else
    throw new Exception(string.Format("No version related to model {0}.", "Account"));

Maybe you are looking for

  • Date rule for current date

    Hi. I have a date type for which I would like to fill DATE FROM field with current date, but the field DATE TO should stay empty for manual entry. I defined the following rule which I assigned to my date type but the problem with this rule is that it

  • LiveType not intalled with FCP

    For some reason LiveType was not installed with FCP. (My own fault im sure) Can someone help me install it from the disk? Im using FCP 7, which has like 6 or more disks). Which disk is it on? Thanks for the help.

  • Anonymous Block in SQL Developer

    I am using SQL Developer 3.1x and trying to run a pretty simple Anonymous block and am having trouble declaring a variable. This block runs successfully: set SERVEROUTPUT on --declare -- V_CRT := CHR(13); begin for t in (select owner, table_name from

  • Resource for R/3 functional processes and table structures

    Dear Experts, I want to have brief but concise understanding of R/3 modules in aspects of business process flows, table important table structures. Ideally, the document or book should phrase it in a way easy for non-functional people to understand.

  • TS3812 my iphony suddenly could not connect to a network making it impossible for me to call or receive messages

    my iphony suddenly could not connect to a network making it impossible for me to call or receive messages