Finding an amount in a hashmap

I have a hashmap with the key being a string and value being an integer which reflects the frequency. I want to know if anybody knows how to find that frequency. I used freq.containsKey() in an if statement and if it it was true then i added 1 to the frequency. Well that doesn't work if it the key appears more than twice. Any suggestions?

You can't have duplicates in a HashMap. Can you provide a better description of what you trying to do?

Similar Messages

  • How to find out amount of undo generated in 10g and 9i? for a given session

    Hi All,
    I am on v10.2 on Linux. How can I find out amount of undo generated in my session ?
    I tried this
    SQL> select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 132 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 0 data blocks consistent reads - undo records applied
    182 0 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 0 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 488 IMU undo allocation size
    22 rows selected.
    SQL>
    SQL> create table temp1 as select * from dba_objects where 1=2 ;
    Table created.
    SQL> select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 30280 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 8 data blocks consistent reads - undo records applied
    182 8 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 0 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 560 IMU undo allocation size
    22 rows selected.
    SQL> insert /*+ APPEND */ into temp1 select * from dba_objects ;
    91057 rows created.
    SQL> commit ;
    Commit complete.
    SQL> select a.STATISTIC#, a.VALUE, b.NAME from v$mystat a , v$statname b
    2 where a.statistic# = b.statistic# and (b.name like '%undo%' or b.name like '%rollback%') ;
    STATISTIC# VALUE NAME
    5 0 user rollbacks
    75 0 DBWR undo block writes
    176 171356 undo change vector size
    177 0 transaction tables consistent reads - undo records applied
    178 0 transaction tables consistent read rollbacks
    179 166 data blocks consistent reads - undo records applied
    182 91 rollbacks only - consistent read gets
    183 0 cleanouts and rollbacks - consistent read gets
    188 0 rollback changes - undo records applied
    189 10 transaction rollbacks
    200 0 auto extends on undo tablespace
    202 0 total number of undo segments dropped
    220 0 global undo segment hints helped
    221 0 global undo segment hints were stale
    222 0 local undo segment hints helped
    223 0 local undo segment hints were stale
    224 0 undo segment header was pinned
    226 0 SMON posted for undo segment recovery
    229 0 SMON posted for undo segment shrink
    236 0 IMU undo retention flush
    241 0 IMU CR rollbacks
    242 1352 IMU undo allocation size
    22 rows selected.
    What exactly is "undo change vector size" ?
    Also, if I am on v 9.2, this ( undo change vector size ) stat name is not there. What can be used in v9.2 ?
    Thanks in advance.

    Hi..
    >
    SET LINESIZE 200
    COLUMN username FORMAT A15
    SELECT s.username,
    s.sid,
    s.serial#,
    t.used_ublk,
    t.used_urec,
    rs.segment_name,
    r.rssize,
    r.status
    FROM v$transaction t,
    v$session s,
    v$rollstat r,
    dba_rollback_segs rs
    WHERE s.saddr = t.ses_addr
    AND t.xidusn = r.usn
    AND rs.segment_id = t.xidusn
    ORDER BY t.used_ublk DESC;
    >
    HTH
    Anand

  • How to find the amount of free disk space on my pc....... in java of course

    how to find the amount of free disk space on my pc

    http://onesearch.sun.com/search/onesearch/index.jsp?qt=free+disk+space&subCat=siteforumid%3Ajava31&site=dev&dftab=siteforumid%3Ajava31&chooseCat=javaall&col=developer-forums

  • Couldn't find the amount in Goods Rcpt Analysis REM(mcp8)

    Hello there, i got a extremely emergency question here,
    i used mfbf to do assembly backflush and after that,1000buc
    water's metieral document was generated.everthing is done perfectly till this time.
    but when i used mcp8 to check out the figure after doing mfbf,
    i couldn't find the amount i have done.dunno what's the problem there.
    can you help me??

    Hi,
    MCP8 transaction code gives following information;
    (1) GR Qty
    (2) Actual Scrap
    (3) Order Qty
    (4) Scrap Qty
    To get a value, you have to write a Query using SQVI or through ABAP
    PS: Post this query in PP Forum to get a quick reply.
    Bye,
    Muralidhara

  • Where can I find the amount of gb's a tv show has on the new iTunes via iOS6 for the iPhone 4S?

    The question above says it all. I tried to purchase a season pass for a tv show, but, I can't because I don't have enough space on my phone. I have a 16gb iPhone 4S (I already know how to make more space on my phone). I have 10.9gb's available. But, anyway where can I find out the information on how much gb's a tv show has on the new iTunes for iOS6 via the iPhone 4S? Any help would be greatly appreciated! =)

    "(also, my profile says that I'm running OS X 10.4.6, but I'm not really sure, that's just what one of the disks has written on it that came with my used and very cheap machine "
    Click on the blue Apple icon at the top left of your screen and choose About this Mac. That will tell you what your OS version is and what amount of RAM you have. The "More Info" button in the pop-up screen will give you the Apple System Profiler application and that will give you whole bunches of information on the drive space used etc.
    David

  • Where would I find the amount of memory or space my machine has left?

    I just bought a used imac G3. this is my first experience with a mac. so far I love it but there are a couple things I can't figure out.
    First i got rid of previous user's folder and made myself the administrator etc. i set up 2 other users. how can i set up each of our docks the same all at once, or do I have to sign in 3 times and specify preferences one at a time?
    Also, if I load say Limewire on one users folder, is it avail to all 3?
    Also, I prefer firefox, however, when i upgrade to the newest version the icon goes away and when i go into applications folder I see the upgrade thingy/folder but not the icon. when I do get the icon it stays in a box on my desktop with the words zero kb available. what does that mean?
    and last but not least, as my subject line asks, where do I look for the status of my harddrive space, how do I know if I have enough space to load something new, how many pictures can I store, how much music can I store all that good stuff?
    As you can see I'm not hugely computer savvy, just enough to get myself in trouble really
    thanks so much to whomever answers any of my questions - I appreciate whatever help you can give me.
    (also, my profile says that I'm running OS X 10.4.6, but I'm not really sure, that's just what one of the disks has written on it that came with my used and very cheap machine
    thanks,
    Tracy

    "(also, my profile says that I'm running OS X 10.4.6, but I'm not really sure, that's just what one of the disks has written on it that came with my used and very cheap machine "
    Click on the blue Apple icon at the top left of your screen and choose About this Mac. That will tell you what your OS version is and what amount of RAM you have. The "More Info" button in the pop-up screen will give you the Apple System Profiler application and that will give you whole bunches of information on the drive space used etc.
    David

  • Where do I find the amount of free space left

    The answer used to be at the bottom of the finder window you saw howmuch space was being used

    You can put that information back into the finder window with
    command - /  (forward slash).
    Equivalently, show the status bar from the Finder view menu.
    charlie

  • Table to find ordered amount in local currency

    Hi!
    When I have created a PO the information of the ordered amount is stored in EKPO. But if the PO is in a foreign currency I will only see the ordered amount in that currency in EKPO. I would like to see the ordered amount in local currency so that I can use in a report together with POs in local currencies.
    Which table stores the local currency when the PO contains a foreign currency?
    Sincerely
    Anders Öhrling

    You Cannot see the Conversions Until Follow on Documents are Posted Such as MIRO & MIGO.
    You can see Only Net Order Price using Standard Reports.
    For Conversions you can contact your abaper.
    Regards,
    Ashok

  • How to find your amount is left on gift card

    after putting your your gift card on iTunes where I iTunes does it show the amount u have uploaded

    My account's balance shows at the top right of the store's page on my computer's iTunes, by clicking on my name towards the top right of the iTunes screen, and by logging in to view my account via the Store > View Account menu option. On my iOS devices it shows at the bottom of, for example, the Featured tab in the App Store app under my account id (or you can view your account via Settings > iTunes & App Store and it should show on the screen that you are taken to)

  • How to find Down Payment document with vendor details from AW01N

    Hi,
    I am trying to do partial settlement in KO88, for AUC to Fixed Asset. While running the T Code I am getting the following error message.
    Down payment to recipient 100620 0 area 01 amount   13,181,454.04 not cleared
    Message no. AW605
    I went through many threads for this issue and I am trying to clear the downpayment in F-54. But I am not able to find the Vendor details to whom the Down Payment was done, neither the dosument number against which the downpayment has to be cleared.
    I tried finding these details in AW01N. I could find the amount reflecting in the Planned and Posted tab in the first section.
    But was not succesful to find the documents and vendor details from there.
    In the second section in Planned Tab, I am finding some transactions. There I am finding Down Payment mentioned. When I double click on Down Payment in AW01N, I am taken to the document which is a clearing of Down Payment. You can see the below entry.
    81008100
    Fixed Assets Interim
    1,049,371.84-
    30300100
    000000900000 0000
    2,538,367.44
    30520000
    Clg Cap D-Pmts-T-Ast
    2,538,367.44-
    30300100
    000000900000 0000
    1,049,371.84
    30300100
    000000900000 0000
    101,948.00-
    30520000
    Clg Cap D-Pmts-T-Ast
    101,948.00
    Now, how do I know which documents to be cleared to which Invoice and the vendor details.
    Kindly help me with this issue.

    Hi,
    Thanks. Kindly suggest now, how to find the documents and vendor details from there.
    When I double click on any Down Payment in AW01N, I am taken to the document which is a clearing of Down Payment. You can see the below entry.
    81008100
    Fixed Assets Interim
    1,049,371.84-
    30300100
    000000900000 0000
    2,538,367.44
    30520000
    Clg Cap D-Pmts-T-Ast
    2,538,367.44-
    30300100
    000000900000 0000
    1,049,371.84
    30300100
    000000900000 0000
    101,948.00-
    30520000
    Clg Cap D-Pmts-T-Ast
    101,948.00
    Now, I want to clear the down payments in F-54, but how do I know which documents needs to be cleared to which Invoice and the vendor details. Since I am getting error while executing KO88 AUC transfer to Assets.
    Down payment to recipient 100620 0 area 01 amount   12,832,161.41 not cleared
    Message no. AW605
    Diagnosis
    All downpayments were not cleared for the asset under construction for the receiver 100620 0 in area 01. An amount of   12,832,161.41 was not cleared, or too much was cleared.
    You can only completely transfer an asset under construction if you reverse the down payments in the current fiscal year beforehand.
    Procedure
    Clear the downpayments that you want to settle to receiver 100620 0.
    Check screen shot.

  • Why does the Amount slider on the Detail Panel reset to 0 when saving the file as a Smart Object?

    Whenever I open a Smart Object PSD file to adjust previous settings in RAW, I have noticed that the Amount slider in the Detail panel has reset to 0. Does this reduce the files sharpening? Is this a normal behavior? Can this be prevented?
    I use a Mac running 10.6.8 and Photoshop CS6, version 13.0.5 x 64.

    This behavior happens only on Mac desktop computer, not on my Mac laptop running the same CS6.
    After I've edited an ACR file (including sharpening in the Detail panel), I change the file into a PSD Smart Object to complete my edit by clicking on "Open Object". I immediately notice this PSD file is not sharp. If I click on the bottom right of the image icon to return to the RAW file, I find the Amount slider in the Detail Panel has changed from the sharpening amount I gave it, to 0.
    If I do the exact same thing on my laptop (running a duplicate of the same Photoshop CS6), this behaviour does not happen. The image remains sharp as a PSD file, and if I check by returning to ACR, the Amount slider has maintained its setting.
    Anything more you need?

  • Adding Amount field in BSEG table and display it single line item?

    hi experts,
           I am doing credit / debit form now my requirement is
                                               According to BELNR , GJAHR,BUKRS i want to find credit amount for this selection cretiria.
                         so i want to add all the lines of amount filed for a particular BELNR and display it as single line.
    so i am getting data from print program like this
    SELECTION-SCREEN BEGIN OF BLOCK b0 WITH FRAME TITLE text-001.
    SELECTION-SCREEN SKIP 2.
    PARAMETERS: p_belnr LIKE bkpf-belnr OBLIGATORY,
                p_bukrs LIKE bkpf-bukrs OBLIGATORY,
                p_gjahr LIKE bkpf-gjahr OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK b0.
    SELECT SINGLE *
                   FROM bkpf
                   INTO  i_bkpf
                   WHERE belnr = p_belnr
                         AND ( blart = 'DG' OR blart = 'ZG' )
                         AND bukrs = p_bukrs
                         AND gjahr = p_gjahr.
    IF sy-subrc = 0.
        SELECT  *
              FROM bseg
              INTO  table it_bseg
              WHERE belnr = i_bkpf-belnr .
      ENDIF.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          formname                 = 'Z_CREDIT_DEBIT'    " p_name
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
        IMPORTING
          fm_name                  = v_form_name
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
      IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    CALL FUNCTION v_form_name
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        i_bkpf                     = i_bkpf
        i_bseg                     = i_bseg
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    so my I_BSEG containing all line items of particular BELNR . with the field SHKZG  iam  getting only credit line items .
      now i want to do is add all credited amount and display like this in a table.
    against ref#  (BSEG-REBZG) ! details (BSEG-SGTXT)!  amount
    124569                                   10%discount                950.00(total amount ie sum of all lines amount for a BELNR)
                                                                                    10.00(total tax amt ie sum of   all lines of tax amount for a BELNR)                                                                               
                                                                                    960.00

    hi arun,
             i used collect in smartform my procedure is like this .
                   i am getting data into i_BSEG because i declared like this in TABLES parameter
                      i created a loop .
                             in that i mentioned like I_BSEG into WA_BSEG.
                                   then i created a program lines here i mentioned like this.
                                                  COLLECT WA_BSEG INTO IT_BSEG.
               but because of BUZEI "Number of Line Item Within Accounting Document .it is not same it is varying for every credited time that means for every line of BELNR. thats why it is not adding it is just appending .
    so pls tell me any other chance to find sum .
    because i want to sum up all credted amount and display it in single line
    ie first column REBZG "Number of the Invoice the Transaction Belongs to(against ref) i want to display once .
    And Second column  SGTXT "item text(details) for amount once and for tax amount once
    And Third column Amount first line consists total amount & second line consists total for tax amount
    regards,
    satheesh.
    [email protected]
    any doubts chat me regarding this post.

  • How to get the amount of memory available programmatically?

    Hello,
    Out of memory is a very common situation occures in most applications. I was wondering if there is a way to find the amount of free memory available programmatically, it can atleast help a little. There are System class's functions but are not very full-proof. So can there be any other way?
    THanks

    Out of memory is a very common situation occures in most applications.Really? ;)

  • Using Grep to find/replace

    I'm trying to find out how to use GREP in find/replace to chage the formatting of some text that comes in from a spreadsheet.
    I worked out the GREP query "~b(\d\d)~b", which finds a paragraph return, followed by two digits, followed by another paragraph return
    and then it is replaced by "\t $1~b", which is a tab, the two found digits and a para return.
    What i need to do is to amend the query to find ANY number of digits, (which may be comma delimited: eg 23, 36, 48 ,50), and then replace with a tab + found text.
    I suppose what I'm looking for is a way for the query to find "any text between two paragraph returns, no matter what tthe length", but I don't know how to do this.All the Wildcard options seem to find just one exampler (one digit, one character etc)

    And you came so far
    The operators for repeat are ? (zero or once), * (zero or more) and + (once or more). You can also specify exact numbers: {at least,up to}.
    All of these operators are "greedy" by default -- they will match as much as possible. To match as least as possible (which I'm sure you'll come up against, sooner or later), add another ? after the repeat expression.
    So this will find one digit, then optionally another (which will always be included):
    \d\d?
    and this one digit, then zero or as much as ten million million zillion:
    \d\d*
    which is functionally the same as
    \d+
    And this will find between 3 and 8 digits but will forced to use the shortest possible match:
    \d{3,8}?
    That said: A quick & dirty solution for your actual problem is to find any amount of digits, spaces, and comma's:
    ~b[\d, ]+~b
    (we need the plus here because otherwise it would also match an empty line). The [..] brackets an Inclusive list --- it will match any of the single codes inside.
    A more complicated but 'neater' way is to search very specifically only for number, comma, space, number sequences -- it's neater because that way malformed lines (comma without a space) will be skipped!
    (It also introduces another code -- the parentheses operators. Look them up in a good GREP reference --lost of people are enthousiastic about Peter Kahrel's O'Reilly title, because it's about using GREP in InDesign.)
    ~b\d+(, \d+)*~b

  • Putting a massive amount of data into a single variable

    I'm running a command to find the amount of space .xar files (it's a Citrix temp file of sort) are using on my organization's main file server. The server itself presents quite a few terabytes of data and all our user's profile folders are there, so we're
    talking about many thousands of folders with a whole mess of files. The command I was using is the following:
    (gci w: -r -force -include *.xar | measure -sum -property Length).Sum
    It took a long time to run, at least 5 hours, but it was finished when I got back to my desk this morning. Turns out we have 63 gigabytes of those .xar files.
    I have a few questions:
    1) Is this the best way to get that info?
    2) If I need to put that command into a variable {$size = (gci w: -r -force ... Length).Sum} to get other info, am I going to kill my poor server's memory?
    Thank you
    [email protected]

    I may need to correlate size across department as sorted by user, or get total number of instances.
    [email protected]
    Is that department / user information all contained in the path to the file, or do you need to do something like query the Owner from NTFS security on the file?
    Here's a quick C# function to search for files and output the full path and size of each to a CSV file.  If this still isn't fast enough, maybe speed can be improved more by using the Win32 API's FindFirstFile / FileNextFile / FindClose functions,
    but I'm not certain how much of a benefit that would give.
    Note:  This code requires at least .NET Framework 4.0, which means PowerShell 3.0.
    Add-Type -TypeDefinition @'
    using System;
    using System.IO;
    using System.Text;
    using System.Collections.Generic;
    public static class FileSearcher
    public static void DumpFileInfoToCsv(string directory, string filter, bool recurse, string csvFile)
    SearchOption searchOption = recurse ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly;
    if (directory == null)
    throw new ArgumentNullException("directory");
    if (csvFile == null)
    throw new ArgumentNullException("csvFile");
    DirectoryInfo dirInfo = new DirectoryInfo(directory);
    if (!dirInfo.Exists)
    throw new DirectoryNotFoundException(directory);
    using (StreamWriter csv = new StreamWriter(csvFile, false, Encoding.UTF8))
    csv.WriteLine("\"Path\",\"Size\"");
    if (string.IsNullOrEmpty(filter))
    filter = "*";
    foreach (FileInfo fileInfo in dirInfo.EnumerateFiles(filter, searchOption))
    csv.WriteLine("\"{0}\",\"{1}\"", fileInfo.FullName, fileInfo.Length);
    [FileSearcher]::DumpFileInfoToCsv('W:\', '*.xar', $true, "$home\XarFiles.csv")
    You could then examine the CSV file at leisure to group and total up sizes however you like. (Remember to convert the CSV's "Size" column from a string to a numeric type first.)

Maybe you are looking for