Need some help with a remove function

Design and code a program that will maintain a list of product names. Use a String type to represent the product name and an array of strings to implement the list. Your program must implement the following methods:
Add a product to the list
Remove a product from the list
Display then entire list
Find out if a particular product is on the list.
You need to create a command command loop with a menu() function. The program must continue asking for input until the user stops.
This is the assignment and this is what I have so far. I need some help writing the remove function.
Thanks
* Title: SimpleSearchableList.java
* Description: this example will show a reasonably efficient and
* simple algorithm for rearranging the value in an array
* in ascending order.
public class SimpleSearchableList {
     private static String[] List = new String[25]; //These variables (field variables)
     private static int Size; //are common to the entire class, but unavailable
     //except to the methods of the class...
     public static void main(String[] args)
          String Cmd;
          for(;;) {
               Menu();
               System.out.print("Command: ");
               Cmd = SimpleIO.inputString();
               if(Cmd.equals("Quit"))
                    break;
               else if(Cmd.equals("Fill"))
                    FillList();
               else if(Cmd.equals("Search"))
                    SearchList();
               else if(Cmd.equals("Show"))
                    ShowList();
               else if(Cmd.equals("Remove"))
                    Remove();
     //Tells you what you can do...
     public static void Menu()
          System.out.println("Choices..................................");
          System.out.println("\tFill to Enter Product");
          System.out.println("\tShow to Show Products");
          System.out.println("\tSearch to Search for Product");
          System.out.println("\tRemove a Product");
          System.out.println("\tQuit");
          System.out.println(".........................................");
     //This method will allow the user to fill an array with values...
     public static void FillList()
          int Count;
          System.out.println("Type Stop to Stop");
          for(Count = 0 ; Count < List.length ; Count++)
               System.out.print("Enter Product: ");
               List[Count] = SimpleIO.inputString();
               if(List[Count].equals("Stop"))
                    break;
          Size = Count;
     //This method will rearrange the values in the array so that
     // go from smallest to largest (ascending) order...
     public static void SearchList()
          String KeyValue;
          boolean NotFoundFlag;
          int Z;
          System.out.println("Enter Product Names Below, Stop To Quit");
          while(true)
               System.out.print("Enter: ");
               KeyValue = SimpleIO.inputString();
               if(KeyValue.equals("Stop")) //Note the use of a method for testing
                    break; // for equality...
               NotFoundFlag = true; //We'll assume the negative
               for(Z = 0 ; Z < Size ; Z++)
                    if(List[Z].equals(KeyValue)) {
                         NotFoundFlag = false; //If we fine the name, we'll reset the flag
          System.out.println(List[Z] + " was found");
               if(NotFoundFlag)
                    System.out.println(KeyValue + " was not found");     
     //This method will display the contents of the array...
     public static void ShowList()
          int Z;
          for(Z = 0 ; Z < Size ; Z++)
               System.out.println("Product " + (Z+1) + " = " + List[Z]);
     public static void Remove()
}

I need help removing a product from the arrayYes. So what's your problem?
"Doctor, I need help."
"What's wrong?"
"I need help!"
Great.
By the way, you can't remove anything from an array. You'll have to copy the remaining stuff into a new one, or maybe maintain a list of "empty" slots. Or null the slots and handle that. The first way will be the easiest though.

Similar Messages

  • Need some help with the Table Function Operator

    I'm on OWB 10gR2 for Sun/Solaris 10 going against some 10gR2 DB's...
    I've been searching up and down trying to figure out how to make OWB use a Table Function (TF) which will JOIN with another table; allowing a column of the joined table to be a parameter in to the TF. I can't seem to get it to work. I'm able to get this to work in regular SQL, though. Here's the setup:
    -- Source Table:
    DROP TABLE "ZZZ_ROOM_MASTER_EX";
    CREATE TABLE "ZZZ_ROOM_MASTER_EX"
    ( "ID" NUMBER(8,0),
    "ROOM_NUMBER" VARCHAR2(200),
    "FEATURES" VARCHAR2(4000)
    -- Example Data:
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (1,'Room 1',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (2,'Room 2',null);
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (3,'Room 3','1,1;2,3;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (4,'Room 4','5,2;5,4;');
    Insert into ZZZ_ROOM_MASTER_EX (ID,ROOM_NUMBER,FEATURES) values (5,'Room 5',' ');
    -- Destination Table:
    DROP TABLE "ZZZ_ROOM_FEATURES_EX";
    CREATE TABLE "ZZZ_ROOM_FEATURES_EX"
    ( "ROOM_NUMBER" VARCHAR2(200),
    "FEATUREID" NUMBER(8,0),
    "QUANTITY" NUMBER(8,0)
    -- Types for output table:
    CREATE OR REPLACE TYPE FK_Row_EX AS OBJECT
    ID NUMBER(8,0),
    QUANTITY NUMBER(8,0)
    CREATE OR REPLACE TYPE FK_Table_EX AS TABLE OF FK_Row_EX;
    -- Package Dec:
    CREATE OR REPLACE
    PACKAGE ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX;
    END ZZZ_SANDBOX_EX;
    -- Package Body:
    CREATE OR REPLACE
    PACKAGE BODY ZZZ_SANDBOX_EX IS
    FUNCTION UNFK(inputString VARCHAR2) RETURN FK_Table_EX
    AS
    RETURN_VALUE FK_Table_EX := FK_Table_EX();
    i NUMBER(8,0) := 0;
    BEGIN
    -- TODO: Put some real code in here that will actually read the
    -- input string, parse it out, and put data in to RETURN_VALUE
    WHILE(i < 3) LOOP
    RETURN_VALUE.EXTEND;
    RETURN_VALUE(RETURN_VALUE.LAST) := FK_Row_EX(4, 5);
    i := i + 1;
    END LOOP;
    RETURN RETURN_VALUE;
    END UNFK;
    END ZZZ_SANDBOX_EX;
    I've got a source system built by lazy DBA's and app developers who decided to store foreign keys for many-to-many relationships as delimited structures in driving tables. I need to build a generic table function to parse this data and return it as an actual table. In my example code, I don't actually have the parsing part written yet (I need to see how many different formats the source system uses first) so I just threw in some stub code to generate a few rows of 4's and 5's to return.
    I can get the data from my source table to my destination table using the following SQL statement:
    -- from source table joined with table function
    INSERT INTO ZZZ_ROOM_FEATURES_EX(
    ROOM_NUMBER,
    FEATUREID,
    QUANTITY)
    SELECT
    ZZZ_ROOM_MASTER_EX.ROOM_NUMBER,
    UNFK.ID,
    UNFK.QUANTITY
    FROM
    ZZZ_ROOM_MASTER_EX,
    TABLE(ZZZ_SANDBOX_EX.UNFK(ZZZ_ROOM_MASTER_EX.FEATURES)) UNFK
    Now, the big question is--how do I do this from OWB? I've tried several different variations of my function and settings in OWB to see if I can build a single SELECT statement which joins a regular table with a table function--but none of them seem to work, I end up getting SQL generated that won't compile because it doesn't see the source table right:
    INSERT
    /*+ APPEND PARALLEL("ZZZ_ROOM_FEATURES_EX") */
    INTO
    "ZZZ_ROOM_FEATURES_EX"
    ("ROOM_NUMBER",
    "FEATUREID",
    "QUANTITY")
    (SELECT
    "ZZZ_ROOM_MASTER_EX"."ROOM_NUMBER" "ROOM_NUMBER",
    "INGRP2"."ID" "ID_1",
    "INGRP2"."QUANTITY" "QUANTITY"
    FROM
    (SELECT
    "UNFK"."ID" "ID",
    "UNFK"."QUANTITY" "QUANTITY"
    FROM
    TABLE ( "ZZZ_SANDBOX_EX"."UNFK2" ("ZZZ_ROOM_MASTER_EX"."FEATURES")) "UNFK") "INGRP2",
    "ZZZ_ROOM_MASTER_EX" "ZZZ_ROOM_MASTER_EX"
    As you can see, it's trying to create a sub-query in the FROM clause--causing it to just ask for "ZZZ_ROOM_MASTER_EX"."FEATURES" as an input--which isn't available because it's outside of the sub-query!
    Is this some kind of bug with the code generator or am I doing something seriously wrong here? Any help will be greatly appreciated!

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

  • Need some help with a counting function

    Hello,
    I use a simple sheet to organize the timetable of my patients. Now I'd like to count how many different patients I attend, without counting a patient twice if I attend him twice a week for example. My sheet looks like this:
    Mon
    Tue
    Wed
    Thu
    John
    Steve
    John
    Wesley
    Mary
    Harry
    Deborah
    Peter
    Arnold
    Carol
    Chris
    Mary
    Sarah
    Karen
    Karen
    Carol
    Larry
    Peter
    So the answer would be 13, because I attend 13 different patients a week. Fields in blank should no be counted, the cell contend changes frequently.
    A friend of mine tried to help me with a countif function but it didn't work out for me, it would count the fields left blank too.
    Any idea?
    Thanks, gabriel

    Hi Gabriel,
    Here's another, more generalized, approach that doesn't need adjusting for maximum number of visits/week at the cost of just a few more formulas.  But only two tables!
    Formula in A2 and copied down:
      =ROUNDUP((ROW(cell)−1)÷$B$27,0)
    Formula in B2 and copied down:
      =IF(MOD(ROW(cell)−1,$B$27)=0,$B$27,MOD(ROW(cell)−1,$B$27))
    The formula in C2 and copied down:
      =OFFSET(Schedule::$A$1,0,B−1)
    The formula in D2 and copied down:
      =IFERROR(OFFSET(Schedule::$A$1,A2,B2−1,rows,columns),"")
    The formula in E2 and copied down:
      =IF(AND(D2≠0,LEN(D2)>0),COUNTIF($D$1:D2,D2),"")
    The formula in F2 and copied down:
      =IFERROR(IF(E=1,1,""),"")
    The formula in F27:  =SUM(F)
    The value in B27 is 4, the number of day columns in the Schedule table. You would change that if you increase or decrease the number of days on which you see patients.
    Column C is cosmetic, not needed in the calculation.
    The error triangle means all of the cells in the Schedule table are already accounted for in the rows above.
    Probably more compact ways to do this but it gets the job done.
    SG

  • Need some help with downloading PDF's from the net.

    need some help with downloading PDF's from the net.  Each time I try to click on a link from a website, if it takes me to a new screen to view a pdf, it just comes up as a blank black screen?  any suggestions?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Need some help with the Select query.

    Need some help with the Select query.
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    select single vkorg abgru from ZADS into it_rej.
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
            VKORG TYPE VBAK-VKORG,
            ABGRU TYPE VBAP-ABGRU,
           END OF IT_REJ.
    This is causing performance issue. They are asking me to include the where condition for this select query.
    What should be my select query here?
    Please suggest....
    Any suggestion will be apprecaiated!
    Regards,
    Developer

    Hello Everybody!
    Thank you for all your response!
    I had changes this work area into Internal table and changed the select query. PLease let me know if this causes any performance issues?
    I had created a Z table with the following fields :
    ZADS :
    MANDT
    VKORG
    ABGRU.
    I had written a select query as below :
    I had removed the select single and insted of using the Structure it_rej, I had changed it into Internal table 
    select vkorg abgru from ZADS into it_rej.
    Earlier :
    IT_REJ is a Work area:
    DATA : BEGIN OF IT_REJ,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    Now :
    DATA : BEGIN OF IT_REJ occurs 0,
    VKORG TYPE VBAK-VKORG,
    ABGRU TYPE VBAP-ABGRU,
    END OF IT_REJ.
    I guess this will fix the issue correct?
    PLease suggest!
    Regards,
    Developer.

  • Need some help with computation

    Hi, I need some help with the following:
    My page 3 is a form thats shows, among other things, a document ID (:P3_DOC_ID). Next to this item I have created a button that calls a document selection form (page 10).
    On selection this forms sets 2 items:
    P10_SELECTED (Y or N)
    P10_DOC_ID (the selected documents ID value)
    When the user selects a document he returns to the calling form.
    On page 3 I now try to capture the selected values. For a test item I managed to do this by defining this items source as:
    [PL/SQL function body]
    begin
    if V('P10_SELECTED') = 'Y'
    then
    return V('P10_DOC_ID'); -- selected value
    else
    return V('P3_TEST'); -- else the original value
    end if;
    end;
    However I want P3_DOC_ID to capture the selected value. I tried using a computation but that did not work. Any ideas?
    thanks Rene

    You might want to check if the "Source Used" attribute for P3_DOC_ID is set to always or to "only when ..." it sounds like you need it set to "only when ..."
    If that does not work try this
    Place the following in a pl/sql anonymous block and turn off your
    computation.
    if :P10_SELECTED = 'Y'
    then
    :P3_DOC_ID := :P10_DOC_ID; -- selected value
    else
    :P3_DOC_ID := :P3_TEST; -- else the original value
    end if;
    Justin

  • Error 1603: Need some help with this one

    When installing iTunes I first get an error box saying
    "Error 1406: Could not write value to key \Software\classes\.cdda\OpenWithList\iTunes.exe. Verify that you have sufficient access to that key, or contact your support personnel."
    The second one (after I click on Ignore on the last box) I get it this one:
    "Error: -1603 Fatal error during installation.
    Consult Windows Installer Help (Msi.chm) or MSDN for more information"
    Strange thing is that I do have full access to my computer (or atleast in all other cases I have had since I am the only one with an account on it).
    I have done my best in trying to solve it myself but I'm running out of ideas. I have downloaded latest versions from the website and tried installing Quicktime separately. I have also tried removing Quicktime using add/or remove programs though I just I didn't dare to take full removal because it said something about system files.
    Anyway I really need some help with this, anyone got any ideas?
    Greets,
    Sixten
      Windows XP Pro  

    Do you know how to count backwards? Do you know how to construct a loop? Do you know what an autodecrementor is? Do you know how to use String length? Do you know Java arrays start with index 0 and run to length-1? Do you know you use length on arrays too? Do you know what System.out.println does?
    Show us what you have, there isn't anything here that isn't easily done the same as it would be on paper.

  • Please I need some help with a table

    Hi All
    I need some help with a table.
    My table needs to hold prices that the user can update.
    Also has a total of the column.
    my question is if the user adds in a new price how can i pick up the value they have just entered and then add it to the total which will be the last row in the table?
    I have a loop that gets all the values of the column, so I can get the total but it is when the user adds in a new value that I need some help with.
    I have tried using but as I need to set the toal with something like total
        totalTable.setValueAt(total, totalTable.getRowCount()-1,1); I end up with an infinite loop.
    Can any one please advise on some way I can get this to work ?
    Thanks for reading
    Craig

    Hi there camickr
    thanks for the help the other day
    this is my full code....
    package printing;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.text.DecimalFormat;
    public class tablePanel
        extends JDialog  implements Printable {
      BorderLayout borderLayout1 = new BorderLayout();
      private boolean printing = false;
      private Dialog1 dialog;
      JPanel jPanel = new JPanel();
      JTable table;
      JScrollPane scrollPane1 = new JScrollPane();
      DefaultTableModel model;
      private String[] columnNames = {
      private Object[][] data;
      private String selectTotal;
      private double total;
      public tablePanel(Dialog1 dp) {
        dp = dialog;
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      public tablePanel() {
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      private void jbInit() throws Exception {
        jPanel.setLayout(borderLayout1);
        scrollPane1.setBounds(new Rectangle(260, 168, 0, 0));
        this.add(jPanel);
        jPanel.add(scrollPane1, java.awt.BorderLayout.CENTER);
        scrollPane1.getViewport().add(table);
        jPanel.setOpaque(true);
        newTable();
        addToModel();
        addRows();
        setTotal();
    public static void main(String[] args) {
      tablePanel tablePanel = new  tablePanel();
      tablePanel.pack();
      tablePanel.setVisible(true);
    public void setTotal() {
      total = 0;
      int i = table.getRowCount();
      for (i = 0; i < table.getRowCount(); i++) {
        String name = (String) table.getValueAt(i, 1);
        if (!"".equals(name)) {
          if (i != table.getRowCount() - 1) {
            double dt = Double.parseDouble(name);
            total = total + dt;
      String str = Double.toString(total);
      table.setValueAt(str, table.getRowCount() - 1, 1);
      super.repaint();
      public void newTable() {
        model = new DefaultTableModel(data, columnNames) {
        table = new JTable() {
          public Component prepareRenderer(TableCellRenderer renderer,
                                           int row, int col) {
            Component c = super.prepareRenderer(renderer, row, col);
            if (printing) {
              c.setBackground(getBackground());
            else {
              if (row % 2 == 1 && !isCellSelected(row, col)) {
                c.setBackground(getBackground());
              else {
                c.setBackground(new Color(227, 239, 250));
              if (isCellSelected(row, col)) {
                c.setBackground(new Color(190, 220, 250));
            return c;
        table.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
            if (e.getClickCount() == 1) {
              if (table.getSelectedColumn() == 1) {
       table.setTableHeader(null);
        table.setModel(model);
        scrollPane1.getViewport().add(table);
        table.getColumnModel().getColumn(1).setCellRenderer(new TableRenderDollar());
      public void addToModel() {
        Object[] data = {
            "Price", "5800"};
        model.addRow(data);
      public void addRows() {
        int rows = 20;
        for (int i = 0; i < rows; i++) {
          Object[] data = {
          model.addRow(data);
      public void printOut() {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setPrintable(tablePanel.this);
        pj.printDialog();
        try {
          pj.print();
        catch (Exception PrintException) {}
      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.black);
        int fontHeight = g2.getFontMetrics().getHeight();
        int fontDesent = g2.getFontMetrics().getDescent();
        //leave room for page number
        double pageHeight = pageFormat.getImageableHeight() - fontHeight;
        double pageWidth =  pageFormat.getImageableWidth();
        double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
        double scale = 1;
        if (tableWidth >= pageWidth) {
          scale = pageWidth / tableWidth;
        double headerHeightOnPage = 16.0;
        //double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
        //System.out.println("this is the hedder heigth   " + headerHeightOnPage);
        double tableWidthOnPage = tableWidth * scale;
        double oneRowHeight = (table.getRowHeight() +  table.getRowMargin()) * scale;
        int numRowsOnAPage = (int) ( (pageHeight - headerHeightOnPage) / oneRowHeight);
        double pageHeightForTable = oneRowHeight *numRowsOnAPage;
        int totalNumPages = (int) Math.ceil( ( (double) table.getRowCount()) / numRowsOnAPage);
        if (pageIndex >= totalNumPages) {
          return NO_SUCH_PAGE;
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    //bottom center
        g2.drawString("Page: " + (pageIndex + 1 + " of " + totalNumPages),  (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));
        g2.translate(0f, headerHeightOnPage);
        g2.translate(0f, -pageIndex * pageHeightForTable);
        //If this piece of the table is smaller
        //than the size available,
        //clip to the appropriate bounds.
        if (pageIndex + 1 == totalNumPages) {
          int lastRowPrinted =
              numRowsOnAPage * pageIndex;
          int numRowsLeft =
              table.getRowCount()
              - lastRowPrinted;
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(oneRowHeight *
                                     numRowsLeft));
        //else clip to the entire area available.
        else {
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(pageHeightForTable));
        g2.scale(scale, scale);
        printing = true;
        try {
        table.paint(g2);
        finally {
          printing = false;
        //tableView.paint(g2);
        g2.scale(1 / scale, 1 / scale);
        g2.translate(0f, pageIndex * pageHeightForTable);
        g2.translate(0f, -headerHeightOnPage);
        g2.setClip(0, 0,
                   (int) Math.ceil(tableWidthOnPage),
                   (int) Math.ceil(headerHeightOnPage));
        g2.scale(scale, scale);
        //table.getTableHeader().paint(g2);
        //paint header at top
        return Printable.PAGE_EXISTS;
    class TableRenderDollar extends DefaultTableCellRenderer{
        public Component getTableCellRendererComponent(
          JTable table,
          Object value,
          boolean isSelected,
          boolean isFocused,
          int row, int column) {
            setHorizontalAlignment(SwingConstants.RIGHT);
          Component component = super.getTableCellRendererComponent(
            table,
            value,
            isSelected,
            isFocused,
            row,
            column);
            if( value == null || value .equals("")){
              ( (JLabel) component).setText("");
            }else{
              double number = 0.0;
              number = new Double(value.toString()).doubleValue();
              DecimalFormat df = new DecimalFormat(",##0.00");
              ( (JLabel) component).setText(df.format(number));
          return component;
    }

  • Need some help with a Macally enclosure and a spare internal drive

    Need some help with a Macally enclousure
    Posted: Oct 1, 2010 10:55 AM
    Reply Email
    Aloha:
    I have a Macally PHR-S100SUA enclousure that does not recognise,my WD 1001fals hard drive. It has worked just fine with other internal drives, but not this one?
    This is a spare internal drive that I am trying to make an external drive to store back ups for a lot of data. But so far I can not get it recognized by the computer. Maybe I need different drivers?
    Any suggestions?
    Dan Page

    Hi-
    Drivers aren't typically needed for external enclosures.
    Macally has none listed for that enclosure.
    The same is true for the WD drive, internal or external; no drivers.
    With the exception of high end PM multi drive enclosures, I can't think of any that use drivers.
    How is the external connected?
    Have you tried different cables, different ports?
    Bad/damaged cables are fairly common.
    Have you verified connections inside of the enclosure?

  • Need some help with putting a folder in users directory

    I'm not sure how to do this, but what I want to do is put this file in C:/My Documents, but I need to be able to verify that C://My Documents exists, if not put it in C:/Program Files.
    Can any one help me out?
    try {
                        String[] contactArray = parseDatFile(fc.getSelectedFile());
                        Document document = createXMLDocument(contactArray);
                        saveToXMLFile(
                        document,
                        new File(
                        "C:/Program Files/xxx/",// looks for directory for list
                        "xxxxxxxxxxxxxxxxxxxxxxxxxxxx"));
                    } catch (Exception exc) {
                        File f = new File("C:/Program Files/xxx/");// setting directory for list if not there
                        boolean yes = true;
                        yes = f.mkdir();// creating directory
                        try {
                            String[] contactArray = parseDatFile(fc.getSelectedFile());
                            Document document = createXMLDocument(contactArray);
                            saveToXMLFile(
                            document,
                            new File(
                            "C:/Program Files/xxx/",// used only if the directory didn't exist
                            "xxxxxxxxxxxxxxxxxxxxxxx"));

    Need some help with putting a folder in users directoryI recomend using System.getProperty( "user.home" ) not a hard-coded value.
    This will use the users home folder ( C:\My Documents ) on Win9X (I guess), C:\Documents and Settings\<current user> on Win2K +, and ~ on Unix-a-likes.

  • Need some help with threads...

    Hello all,
    I am working on a project at work, and I am not the best programmer in the world. I have been trying to get my head around this for a couple of days and just cannot get it to work.
    I am writing an instrumentation control program that will have three threads. One is the GUI, one will receive control information and set up the hardware, and one will check the hardware status and report it to the GUI periodically. I plan on using the invokeLater() method to communicate the status to the GUI and change the status display in the GUI. Communication from the GUI to the controller thread and from the status thread to the controller thread I had planned on being piped input/output stream as appropriate. I have a control class and a status class that need to be communicated over these piped streams. In some trial code I have been unable to wrap the piped input/output streams with object input/output streams. I really need some help with this. Here is the main thread code:
    package playingwiththreads1;
    import java.io.*;*
    *public class PlayingWithThreads1 {*
    public static void main(String[] args) {*
    * PipedOutputStream outputPipe = new PipedOutputStream();*
    * ObjectOutputStream oos = null;*
    * ReceiverThread rt = new ReceiverThread(outputPipe);*
    // Start the thread -- First try*
    * Thread t = new Thread(rt);*
    t.start();*
    // Wrap the output pipe with an ObjectOutputStream*
    try*
    oos = new ObjectOutputStream(outputPipe);*
    catch (IOException e)*
    System.out.println(e);*
    // Start the thread -- Second try*
    //Thread t = new Thread(rt);*
    //t.start();*
    /** Send an object over the pipe. In reality this object will be a
    class that contains control or status information */
    try
    if (!oos.equals(null))
    oos.writeObject(new String ("Test"));
    catch (IOException e)
    try
    Thread.sleep(5000);
    catch (InterruptedException e)
    I read somewhere that it matters where you start the thread relative to where you wrap piped streams with the object streams. So, I tried the two places I felt were obvious to start the thread. These are noted in the comments. Here is the code for the thread.
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
    private PipedInputStream inputPipe = new PipedInputStream();
    private ObjectInputStream inputObject;
    ReceiverThread (PipedOutputStream outputPipe)
    System.out.println("Thread initialization - start");
    try
    inputPipe.connect(outputPipe);
    inputObject = new ObjectInputStream(inputPipe);
    catch (IOException e)
    System.out.println(e);
    System.out.println("Thread initialization - complete");
    public void run()
    System.out.println("Thread started");
    try
    if (inputObject.available() > 0)
    System.out.println(inputObject.read());
    catch (IOException e)
    System.out.println(e);
    Through testing I have determined that no matter where I start the thread, the thread never gets past the "inputObject = new ObjectInputStream(inputPipe);" assignment.
    Could someone please help me with this? There are other ways for me to write this program, but this is the one that I would like to make work.
    Many thanks in advance,
    Rob Hix
    Edited by: RobertHix on Oct 6, 2009 3:54 AM

    Thanks for the help, but that did not work. I tried flushing the ObjectOutputStream and it is still hanging when initializing the thread.
    Here is a better look at the code since I was helped to figure out how to insert it:
    The main method:
    package playingwiththreads1;
    import java.io.*;
    public class PlayingWithThreads1 {
        public static void main(String[] args) {
            PipedOutputStream outputPipe = new PipedOutputStream();
            ObjectOutputStream oos = null;
            ReceiverThread rt = new ReceiverThread(outputPipe);
            // Start the thread -- First try
            //Thread t = new Thread(rt);
            //t.start();
            // Wrap the output pipe with an ObjectOutputStream
            try
                oos = new ObjectOutputStream(outputPipe);
                oos.flush();
            catch (IOException e)
                System.out.println(e);
            // Start the thread -- Second try
            Thread t = new Thread(rt);
            t.start();
            /* Send an object over the pipe.  In reality this object will be a
             * class that contains control or status information */
            try
                if (!oos.equals(null))
                    oos.writeObject(new String ("Test"));
                    oos.flush();
            catch (IOException e)
                System.out.pringln(e);
            try
                Thread.sleep(5000);
            catch (InterruptedException e)
    }The thread code:
    package playingwiththreads1;
    import java.io.*;
    public class ReceiverThread implements Runnable {
        private PipedInputStream inputPipe = new PipedInputStream();
        private ObjectInputStream inputObject;
        ReceiverThread (PipedOutputStream outputPipe)
            System.out.println("Thread initialization - start");
            try
                inputPipe.connect(outputPipe);
                inputObject = new ObjectInputStream(inputPipe);
            catch (IOException e)
                System.out.println(e);
            System.out.println("Thread initialization - complete");
        public void run()
            System.out.println("Thread started");
            try
                if (inputObject.available() > 0)
                    System.out.println(inputObject.read());
            catch (IOException e)
                System.out.println(e);
    }Does anyone else have and ideas?

  • Need some help with ".png" image.

    Good day everyone. Here's the run down. I need to add an
    image (image "A") ontop of another image (image"B"). Image "B" is a
    paterned background. And Image "A" a logo with a transparent
    background.
    As it stands I have image "A" as a "png" and as you know....
    they are fri**ing huge! Haveing it as a "gif" only presents me with
    the IE6 problem of it adding a colored background to the image.
    So I'm stuck! Can any one tell me or point me in the
    difection of a tutorial to tell me the best way to add an image
    with a transparent background in Dreamweaver.
    Really need some help with this!
    Thanks all!

    >Right you can see the work in progress here>
    http://www.stclairecreative.com/DoughBoys_Site_Folder/home.html
    Before going much further I'd recommend reconsidering the use
    of a textured background. They are usually included for the benefit
    of the site owner only, and likely to annoy visitors. Studies on
    the subject suggest they often lead to usability problems. I do
    like to header graphic, but at 200K it's kinda heavy and can
    probably be optimized.

  • Need some help with guitar setup...

    jeez, never thought i'd be asking a question like this after playing for like 20 years, but i need some help with a guitar setup for mac. i'm gonna list out a lot of crap here that prolly doesn't affect anything at all, but here goes.
    Imac 17inch G4 - latest updated OS X... 10.4, or 5, or whatever. garageband 3.0
    digitech gnx-3
    alesis sr-16
    sure mic's
    yamaha e203 keyboard
    here's the setup:
    yamaha is on its own on a usb uno midi interface, sure's connected to gnx's xlr port, alesis connected to gnx's jam-a-long input, '87 kramer vanguard connected to gnx's guitar input. currently running headphones out on gnx to line in on mac.
    here's the problem:
    everything works beautifully, but my guitar sounds like crap. if i plug headphones into the gnx, it sounds beautiful. that makes me think its some kind of level issue between the gnx's output, and the mac's input, but nothing seems to fix it.
    by sounding like crap, i mean way too much bass. sound is muddy, blurry, not crisp... aka crap. i've tried altering both output and input on mac and gnx, and i cant get a combination that works. the gnx has a s/pdif out, can the mac accept that as input? might that help? short of running the gnx to my marshal half stack and mic'ing that, anyone have any suggestions, or use a similar setup?
    any help would be greatly appreciated!

    anyone? ... any suggestions? I think it might be an issue with the gnx pre-amping the signal as it goes out, and then the mac amping it on the way in, giving me a buttload more signal than i need, but since i cant find a happy level, i'm not really sure. i really dont want to resort to mic'ing my marshall... even with the volume almost off, my jcm900 is WAY too loud for apartment use. its not like i really NEED the guitar to sound perfect, i only use garageband to sketch out ideas for songs between myself and bandmates, but its really annoying to not have my customary crisp distortion. my bass player keeps telling me to use the built in amps, but, not to dis a practically free program, but the built in amps blow, at least after 10 years of marshall tube amplification they do. if anyone has any suggestions that might be helpfull on how i might resolve this, i would be your best friend for life and go to all your birthday parties

  • Need some help with MDX formula

    Hello, I am not finding any good documentation on MDX formulas, there is a specific one that I need some help with....could someone please elaborate what exactly does this formula mean? thanks.
    (MEASURES.[SIGNEDDATA],
    CLOSINGPERIOD([%TIMEDIM%].
    [%TIMEBASELEVEL%]))

    If new MEASURE gets added to Measure's table , in BPC Client , etools->client Options-> Refresh Dimensions should get the new measure into the CurrentView .IF not try  etools->client Options-> Clear Local application information .
    Formula 2 : 
    (MEASURES.SIGNEDDATA,
    CLOSINGPERIOD(%TIMEDIM%.
    %TIMEBASELEVEL%))
    This formula is used to retrieve AST & LEQ account values.
    If current time member is at monthlevel ,ie  ClosingPeriod of  2011.FEB is  the current member it self ,and would retrieve 2011.FEB value.
    If Current time member is at quarter level then ClosingPeriod of 2011.Q1 is 2011.Mar  ,and would retrieve 2011.MAR value.
    If Current time member is at year level then ClosingPeriod of 2011.TOTAL is 2011.DEC  ,and would retrieve 2011.DEC value.
    Formula 1 :
    MEASURES.SIGNEDDATA
    Irrespective of the level of the Time , MEASURES.SIGNEDDATA would retrieve current Time member value.This formula is used to retrieve INC & EXP account values
    if current time member is at month level,2011.FEB , 2011.FEB value is retrieved.
    if current time member is at quarter level,2011.Q1 , 2011.Q1(JANFEBMAR)  value is retrieved.
    if current time  member is at year level,2011.TOTAL , 2011.TOTAL(JAN,FEB,....,DEC)  value is retrieved.
    Hope this helps.

  • Need some help with strange sounds in Logic Pro 8

    Hi!
    I need some help with a problem I have in Logic Pro 8.
    When I have arrange window open, suddley strange high tones starts to make noise in my headphones. I don't know where these sounds comes from or why, but I need some help to get them away. Should I just try to contact Apple?
    Martin

    Hi Martin
    Welcome to the forum. Give everyone here some more info about your set up otherwise it may be difficult to figure out what is wrong.
    Which mac?
    Which OS?
    any hardware devices?
    if you are listening through headphones using the built in audio from the mac, you may be hearing fan noise or a hard drive spin noise.
    Don

Maybe you are looking for

  • Need help with BW Process chain issue

    Hi Gurus, I had made a copy of the existing process chain so that I can work on the changes. Its a metachain and I tried to copy a sub chain. But at a later point of time, I have realized that the process chain had got into a  nested loop in the meta

  • SID vs Service_Name

    Came across these entries (example) in TNSNAMES.ORA on a client machine; and need some clarifications from the gurus here. 10g TNSNAMES.ORA Server 123.456.789.111 DEV.SERVER.WORLD.COM =   (DESCRIPTION =     (ADDRESS_LIST =       (ADDRESS = (PROTOCOL

  • Hidden Pages

    I have a 15 page form that is broken into 4 sections. I also have 4 buttons for navigation to those sections. These buttons are located on the top of the Master pages. The problem I am having is that when I set the presence of one sections pages to h

  • How do I print out an e mail? How do I delete the trash?

    how do I print an e mail? How do I clear out the trash?

  • Download Error HTTP 403 Forbidden

    I have tried several times to download Adobe Reader 9.0 and each time I receive the error "This website has declined to show this webpage HTTP 403". I have cleaned out all of the settings in the IE browsing history and my IE cache. I puzzled why I ge