Help needed in removing duplicate items of list box  in java

How to remove duplicate items of list box while dynamically inserting (on-click event)
It is not identifying duplicate data
Variable name is HP_G1
HP_dmg1 = (DefaultListModel) HP_G1.getModel();
int a = HP_G1.getModel().getSize();
System.out.println("HP list no--------> "+a);
if(a!=0)
for (int j=0; j<a; j++)
String item1 = String.valueOf(HP_List.getModel().getElementAt(j));
System.out.println("HP list added--------> "+item1);
if(HP_dmg1.equals(item1)){
HP_dmg1.remove(j);
else
HP_dmg1.addElement(GPL);
}

Your code is unreadable, so I'll ignore it. In the future please press the message editor's CODE button to format code.
As to your problem, to the point you normally use a Set instead of List when you don't want duplicates in a collection.

Similar Messages

  • Remove duplicates items in List

    I created a WebAPI and its calling an SQL Server to get my data. I created a List<> to populate and get those items back to UI. However, in my output there are duplicates due to the data. Is there a way to remove the duplicate strings before passing
    it back to my UI?
    I'm reading through the data coming back from SQL here
    while (reader.Read())
    Jobs jobs= new Jobs();
    jobs.FunctionDesc = reader.GetString(0);
    jobs.Function = reader.GetString(1);
    jobss.Add(jobs);
    }return jobs
    is there a way I can remove the duplicate FunctionDesc prior to returning it back to the UI?

    You could keep populating the List<Jobs> exactly like you are doing now, create a class that implements the IEqualityComparer<Jobs> interface and simply pass an instance of this one to the Distinct method that you call on the list once you have
    populated it:
    public class JobsComparer : IEqualityComparer<Jobs>
    public bool Equals(Jobs x, Jobs y)
    return x.FunctionDesc.Equals(y.FunctionDesc);
    public int GetHashCode(Jobs obj)
    return obj.FunctionDesc.GetHashCode();
    while (reader.Read())
    Jobs jobs= new Jobs();
    jobs.FunctionDesc = reader.GetString(0);
    jobs.Function = reader.GetString(1);
    jobss.Add(jobs);
    jobss = jobss.Distinct(new JobsComparer()).ToList();
    return jobss;
    This will effectively remove all duplicates with minimal changes to your current code.
    Hope that helps.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • HT2905 No Display Duplicates under File. How to find and remove duplicate items in your iTunes library

    I now have iTunes ver 11.0.4.4 under Windows 7. I lost all iTunes stuff when updating to Windows 7. I have loaded thousands amd thousands of music files from backup disks, but there are many duplicates. I am attemping to re-establish my old library. I used to be able to remove duplicates quickly with the old iTunes. The new iTunes doesn't seem to offer the same service. Is there any way to remove duplicates quickly, or must I do it one by one?

    When deduping use Shift > View > Show Exact Duplicate Items as this is normally a more useful selection. You need to manually select all but one of each group to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks. If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background and please take note of the warning to backup your library before deduping.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    See also HT2905: How to find and remove duplicate items in your iTunes library
    tt2

  • HT2905 How to find and remove duplicate items in your iTunes library

    I need an easy and quick way to remove duplicate items from Itunes library since it duplicates to the IPOD 4.

    I've written a script called DeDuper which can help remove unwanted duplicates.
    See this  thread for background.
    tt2

  • HT2905 Does anyone know how to find and remove duplicate items in the new itunes 11?

    I am having a hard time trying to figure out how to find and remove duplicate items under the New iTunes 11? Its not as user friendly as in previous versions. Does anyone know how to figure this out?

    As Jim said View > Show Duplicates
    or
    Option + View > Show Exact Duplicates

  • Strange bug, items in list boxes disappearing

    First of all this is my first post here ever. If its a wrong forum, sorry.
    So ever since I installed Windows 8.1 here (fresh install), I have this strange bug were items in list boxes start disappearing when you open a window with them.
    It didn't bother me much but now its horrible when I wanted to switch my playback device... Or if you want to change IP settings on my network adapter.
    The thing is it all happens in a very short period of time so it took me a while to get screens of it and here they are:
    s9.postimg.org/dvqvulc5b/bug.gif
    s9.postimg.org/a0nhs0szj/bug2.gif
    I still can't upload images on this forum!
    That is real time of how it appears on my screen when I open those windows. You can see on the first image that the window is still appearing.
    I have searched for this problem but couldn't find anything.
    Lenovo Z510 Notebook

    try to use default Windows 8.1 theme
    try to check with different account
    try to check in safe mode
    try to find if there is any graphic driver update or any driver update, compare your version
    http://support.lenovo.com/en_HK/downloads/detail.page?DocID=DS037055
    try to update your windows
    monitor event viewer if there is any abnormal behavior
    try to check using PSR
    http://windows.microsoft.com/en-hk/windows7/how-do-i-use-problem-steps-recorder
    update your windows if there is any windows update

  • How to send a data from combobox to list box in java  when I click datas

    ow to send a data from combobox to list box in java when I click datas in combobox

    use getItemAt() from combo and add them to list model.

  • Help needed in removing the duplicate nodes in an xml file

    Hi Friends,
    I need some help in removing the duplicates from a xml file using the Excel Spreadsheet. The xml Im using does not have any schema.
    Can some one please let me know the steps.
    Thanks a lot.

    Hi,
    I got the answer.
    Go to the developers Tab and click on export.
    Select the column where we want to delete the duplicates and click on Remove Duplicates from Data Tab.
    OR go to Home Tab> Conditional Formatting> High light Cell Rules> Duplicate Values. It will highlight all the duplicate values and then remove them manually.
    Thanks.

  • DataProvider.merge() method seems to not remove duplicate items

    Using the DataProvider class to instantiate UI Components
    data, I need to merge dataProvider data and remove any duplicate
    items that may result from the merging process. It is supposed
    (according to the manual) that the merge method behaves just as i
    desire, but actually the data is being merged with duplicates. Any
    hints?

    The docs are a little ambiguous. There is no actual "removal"
    of items. The
    method iterates the new data items and appends those that are
    not already in
    the provider. Since each item is an Object instance, they
    must be the same
    object to be equal.
    In this example, the commonItem is "removed" during the
    merge, but there are
    still two instances in the original list
    var commonItem:Object = {label:"itemX"};
    var data1:Array = [
    {label:"item1"},
    commonItem,
    commonItem,
    {label:"item2"}
    var data2:Array = [
    {label:"item1"},
    commonItem , // duplicated item
    {label:"item3"}
    var dp:DataProvider = new DataProvider(data1);
    dp.merge(data2);
    var myList:List = new List();
    myList.dataProvider = dp;

  • Need to Remove Duplicate Rows

    I have two tables MEMBER_ADRESS and MEMBER_ORDER. The MEMBER_ADRESS has duplicate rows in it based on MEMBER_ID and MATCH_VALUE. These duplicate ADDRESS_IDs were used in MEMBER_ORDER. I need to remove the duplicates from MEMBER_ADRESS making sure I keep the one with PRIMARY_FLAG = ‘Y’ and update MEMBER_ORDER.ADDRESS_ID to the MEMBER_ADRESS.ADDRESS_ID that I kept.
    I am on 11gR1
    Thanks for the help.
    CREATE TABLE MEMBER_ADRESS
      ADDRESS_ID               NUMBER,
      MEMBER_ID                NUMBER,
      ADDRESS_1                VARCHAR2(30 BYTE),
      ADDRESS_2                VARCHAR2(30 BYTE),
      CITY                     VARCHAR2(25 BYTE),
      STATE                    VARCHAR2(2 BYTE),
      ZIPCODE                  VARCHAR2(10 BYTE),
      CREATION_DATE            DATE,
      LAST_UPDATE_DATE         DATE,
      PRIMARY_FLAG             CHAR(1 BYTE),
      ADDITIONAL_COMPANY_INFO  VARCHAR2(40 BYTE),
      MATCH_VALUE              NUMBER(38) GENERATED ALWAYS AS (TO_NUMBER( REGEXP_REPLACE ("ADDITIONAL_COMPANY_INFO"||"ADDRESS_1"||"ADDRESS_2"||"CITY"||"STATE"||"ZIPCODE",'[^[:digit:]]')))
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (200, 30, '11 Hourse Rd.',
        '58754', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:34:10', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 1158754);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (230, 12, '101 Banks St',
        '58487', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:35:42', 'MM/DD/YYYY HH24:MI:SS'), 'N', 10158487);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (232, 12, '101 Banks Street',
        '58487', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:41:15', 'MM/DD/YYYY HH24:MI:SS'), 'N', 10158487);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (228, 12, '101 Banks St.',
        '58487', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:38:19', 'MM/DD/YYYY HH24:MI:SS'), 'N', 10158487);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (221, 25, '881 Green Road',
        '58887', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:34:18', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 88158887);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (278, 28, '2811 Brown St.',
        '58224', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:36:11', 'MM/DD/YYYY HH24:MI:SS'), 'N', 281158224);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (280, 28, '2811 Brown Street',
        '58224', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:45:00', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 281158224);
    Insert into MEMBER_ADRESS
       (ADDRESS_ID, MEMBER_ID, ADDRESS_1, ADDRESS_2, ZIPCODE, CREATION_DATE, LAST_UPDATE_DATE, PRIMARY_FLAG, MATCH_VALUE)
    Values
       (300, 12, '3421 West North Street', 'x',
        '58488', TO_DATE('08/11/2011 10:56:25', 'MM/DD/YYYY HH24:MI:SS'), TO_DATE('08/12/2011 10:42:04', 'MM/DD/YYYY HH24:MI:SS'), 'Y', 342158488);
    COMMIT;
    CREATE TABLE MEMBER_ORDER
      ORDER_ID    NUMBER,
      ADDRESS_ID  NUMBER,
      MEMBER_ID   NUMBER
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (3, 200, 30);
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (4, 230, 12);
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (5, 228, 12);
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (6, 278, 28);
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (8, 278, 28);
    Insert into MEMBER_ORDER
       (ORDER_ID, ADDRESS_ID, MEMBER_ID)
    Values
       (10, 230, 12);
    COMMIT;

    Hi John;
    Sorry I missed your post. Yes sorry about the flag. Please take a look as these before and after sets. I hope this helps. I should have posted this in the begining.
    MEMBER_ORDER (BEFORE)
    ORDER_ID  ADDRESS_ID  MEMEBER_ID
    4       228           12
    10       230           12
    5       230           12
    11       232           12
    12       300           12
    8       278           28
    6       278           28
    3       200           30
    MEMBER_ORDER (AFTER)
    ORDER_ID  ADDRESS_ID  MEMEBER_ID
    4       232           12
    10       232           12
    5       232           12
    11       232           12
    12       300           12
    8       280           28
    6       280           28
    3       200           30
    MEMBER_ADDRESS (BEFORE)
    ADDRESS_ID  MEMBER_ID  ADDRESS_1                    CREATION_DATE             LAST_UPDATE_DATE   PRIMARY_FLAG  MATCH_VALUE
    228         12           101 Banks St.                  8/11/2000 10:56:25 AM     8/12/2005 10:38:19 AM     N     10158487
    230         12           101 Banks St                   8/11/2000 10:56:25 AM     8/12/2006 10:35:42 AM     N     10158487
    232         12           101 Banks Street             8/11/2000 10:56:25 AM     8/12/2007 10:41:15 AM     N     10158487
    300         12           3421 West North Street       8/11/2000 10:56:25 AM     8/12/2011 10:42:04 AM     Y     342158488
    221         25           881 Green Road               8/11/2000 10:56:25 AM     8/12/2011 10:34:18 AM     Y     88158887
    278         28           2811 Brown St.               8/11/2000 10:56:25 AM     8/12/2006 10:36:11 AM     N     281158224
    280         28           2811 Brown Street               8/11/2000 10:56:25 AM     8/12/2011 10:45:00 AM     Y     281158224
    200         30           11 Hourse Rd.                  8/11/2000 10:56:25 AM     8/12/2005 10:34:10 AM     Y     1158754
    MEMBER_ADDRESS (AFTER)
    ADDRESS_ID  MEMBER_ID  ADDRESS_1                    CREATION_DATE             LAST_UPDATE_DATE    PRIMARY_FLAG  MATCH_VALUE
    232         12           101 Banks Street                8/11/2000 10:56:25 AM     8/12/2007 10:41:15 AM     N     10158487
    300         12           3421 West North Street       8/11/2000 10:56:25 AM     8/12/2011 10:42:04 AM     Y     342158488
    221         25           881 Green Road                8/11/2000 10:56:25 AM     8/12/2011 10:34:18 AM     Y     88158887
    280         28           2811 Brown Street              8/11/2000 10:56:25 AM     8/12/2011 10:45:00 AM     Y     281158224
    200         30           11 Hourse Rd.                8/11/2000 10:56:25 AM     8/12/2005 10:34:10 AM     Y     1158754

  • PowerShell script to find and remove duplicate items from document library

    Hi Friends,
    Please check this below script, It is finding the duplicate items and removing it. This script is not working to find the duplicate items from document
    library and remove. Can you please let me know where it is wrong.
    Add-PSSnapin microsoft.sharepoint.powershell 
    $web = Get-SPWeb -Identity "http://zapltvsspdev02:4333/bu/EXCO" 
    $list = $web.Lists["AECI Documents"] 
    $AllDuplicates = $list.Items.GetDataTable() | Group-Object INumber | where {$_.count -gt 1} 
    $count = 1 
    $max = $AllDuplicates.Count 
    foreach($duplicate in $AllDuplicates) 
    $duplicate.group | Select-Object -Skip 1 | % {$list.GetItemById($_.ID).Delete()} 
    Write-Progress -PercentComplete ($count / $max * 100) -Activity "$count duplicates removed" -Status "In Progress" 
    $count++ 
    Remove-PsSnapin Microsoft.SharePoint.PowerShell
    Note:
    In the above code, duplicates are found using the "INumber" column. 
    valmiki

    check this
    http://stackoverflow.com/questions/21337158/delete-duplicate-items-in-sharepoint-list

  • How to remove duplicate items ?

    ok so ive moved my iTunes library from the NAS drive I bought (after finding out that wouldnt work) onto my new laCie external drive, but ive found some of my albums have triple copies?
    i know how to show duplicates but im not sure how to safely remove duplicates without deleting all copies?

    Oh boy.
    I'm sure there are better ways to do it than this and it will take time, but to avoid all possible loss of data, what I would do is first consolidate all of your libraries.
    • Open the iTunes Library you think is most correct by holding down the OPTION key when you open the iTunes application, which should bring up a dialogue like this: http://cl.ly/image/2i2Q3o0Z0Y3C
    • Then go to preferences and make sure it looks like this: http://cl.ly/image/2C2Z0u0C3T3c
    I would recommend keeping your main iTunes library on your main hard drive (for me that's my internal), unless you definitely can't fit it.
    • Now go to the File menu >Library > Import Playlist
    • Navigate to another of the libraries, and click on the iTunes Library.xml file and import it. Do this for each of your libraries, except the one you are currently using.
    • Now that you've got everything imported into the one library, the fun part starts.
    Do what i said in my previous post and remove all the duplicates.
    • Once that's done, check all the other libraries to make sure you haven't missed anything, and send them on their way to the Trash, and empty it to reclaim all that space.
    I really hope you get this sorted, I went through an ordeal like this myself recently, so it's going to take time, but it feels good when it's all cleaned up and finished!
    xeni
    PS. After writing all this I thought, hmm, why didn't I just Google it instead of figuring it out myself? ;P
    I found this, and it might help if my instructions weren't clear enough. https://bitly.com/LpqFPq
    Also, if you don't already, I urge you to use Time Machine backup. Read more here: http://www.apple.com/osx/apps/#timemachine and http://pondini.org/TM/FAQ.html

  • Select item in list box using code

    We use Adobe Workflow v5. I am creating a Check Request application where users type information into various fields and when they click Add, the data is added to a List Box. Also when they click Add, if the current item is >$1,000, a query searches our accounting database to see if the client has outstanding AR older than 90 days. If they do, another list box is displayed with the client name and amount of outstanding AR.
    If that clientnum is already in the second list box, it does not add another one.
    To delete a record from the first list box, the users select the item in the first list box, and then click a Delete button. That deletes the
    record in the first list box.
    I am also trying to delete the record from the second list box but am not sure how to select it using code. As part of the Delete button code, if the currently selected item (the one they want to delete) is >$1,000, I go through each row of the first list box to see if clnum.text (field in the form where the record to be deleted is now displayed) matches the client number in column 4 of any row of the first list box. If it does, I see if the amount of the item in the first list box is >$1000.
    If it is, then I know that there is a corresponding record in the second list box.
    Here is some of the code:
    'go through each row in first list box
    For irow = 1 to lstExp.ListCount
    'set clientnum variable equal to client # in row in first list box
    clientnum = lstExp.RetrieveItem(irow,4)
    'if clientnum variable is equal to client # to be deleted from first list box (selected record - client # in clnum.text now)
    if clientnum = trim(clnum.text) then
    'if amt is >$1,000 in first list box
    if lstExp.RetrieveItem(irow,10) > 1000 then
    'don't delete row because there is another record in first list box
    DeleteOutAR = "N"
    else
    'delete row because there is NOT another record in first list box.
    DeleteOutAR = "Y"
    end if
    end if
    Next
    Here is the code I need help with. I am unsure how to select the record in the second list box so I can delete it.
    if DeleteOutAR = "Y" then
    'go to second list box ?
    form.GoToField(lstOutARUnbilled)
    'start going through second list box looking for clientnum
    For irow2 = 1 to lstOutARUnbilled.ListCount
    if clientnum = lstOutARUnbilled.RetrieveItem(irow2,1) then
    irow2 = lstOutARUnbilled.CurrentSelection
    lstOutARUnbilled.Removeitem (irow2)
    end if
    next
    end if
    So my question is, how can I move to the second list box to actually delete the record?
    Thank you in advance for any help.
    Mary

    Mary-
    The solution could either be quite easy or difficult dependent upon how the data is arranged in the subsequent list box.
    Basically, if there is any sort of corresponding or matching entries, meaning line 1 from list box #1 matches with line 1 of listbox #2, then you would simply execute the following...
    "listbox#2.RemoveItem listbox#1.CurrentSelection"
    Or if you have a column that would contain the same values, say an index, then you could just loop thru the 2nd listbox searching for that index and once found remove the line...
    "listbox#2.RemoveItem nRow"
    , where nRow would be the line that you discovered to have the matching index.

  • How to create an alert at the list item of List box in vbs/c sharp

    Dear All,
    I need to know how can we create an alert, or a message on the execution of the last item in the List box.

    What do you mean by "on the execution of the last item in the list box"? Do you mean when that last item of a ListBox is selected? If so, you could use the following code:
    Private Sub ListBox1_SelectedIndexChanged(sender As Object, e As EventArgs) _
    Handles ListBox1.SelectedIndexChanged
    Dim lb As ListBox = CType(sender, ListBox)
    If lb.SelectedIndex = lb.Items.Count - 1 Then
    MessageBox.Show("Last item is selected")
    End If
    End Sub

  • The method of leaving cursor at selecting item of list box.

    Hello.
    Pleas let me ask about the subject!!!
    Concerning the screen by web-dynpro, I have a problem that when I select one listbox after selecting another listbox, the screen moves up to the top automatically.
    I would like to prevent from above moving.
    Could anyone specialist please tell me how leaving cursor at setelcting item of the list box.
    Thanks!!!

    Hi...
    there are two events which have been used, one is doubleclick event and the other one is on selecting the item from the list and clicking on OK button(this will be the most frequently used function, i cannot use event target event for this OK button... ) . I have attached the screen shot. Please have a look at it and let me know how can i achieve that...
    I can use custom event, but the main problem is that the inline itemeditor's details are not accessible in the code.... I can access some function from within the inline itemeditor combo box using outerDocument.myFunction() (this is something like GET). Is there a similar way, to SET the data into this itemeditor?

Maybe you are looking for

  • Default Storage Location

    Hello Gurus, I am creating a stock transport order and creating a delivery through VL10G, when i create the delivery the default storage location should be X, but it is taking Y as default storage location. Can you guide me through config and also wo

  • My Galaxy Note 10.1 White 16 gb HELP!

    hello my tablet wont turn off like if i push down the power button a introduction video will come up and its soooooo annoying any answers will help please i would like if someone from bestbuy would answer it too thanks 

  • "init failed " error when calling PRIV:UME  privilege for task  Create UME

    Hi All as per the document http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/304280b4-25d0-2b10-b6a4-89c27409dea7&overridelayout=true I  have done all the settings like this and when I call the privilege using PRIV:UME and subsequently the the c

  • What is difference 4.7 business area and ECC6  business areas

    hi plz tell me what is difference 4.7 business area and ECC6  business areas thank u shusma

  • My MacBook air won't start? Black screen

    I closed my MacBook air and when I opened it again it won't start. I tried to reboot it but the screen stays black. I hear the ventilators turn slowly when I try to turn it on but nothing else happens. The light on the macsafe charger is on. A few ho