Efficient data structure to implement simple text editor?

I was given this problem in an interview:
What data structure would you use to implement a simple text editor that does these 4 functions:
a) goto(line number)
b) insert(char input,location)
c) delete(location)
d) printAll() //print entire file
Given that i'm such a newb, i was stumped. I came up with making a 2d array that would allow for o(1) time for goto, but o(n) for everything else (shifting everything in the array). there were other downfalls too dealing with space issues and such, but he wanted me to optimize this data structure. I then came up with a linked list of arrays, but that had similar problems.
But thinking about it further is driving me a little crazy so I'm wondering if you guys have any suggestions on how to answer this question...
one thing that came to mind after is to implement the data structure as a binary tree, where each node contains
class Node
char theChar
int position; // ie 0 = first character in the file, and 81 could be the first character in the 2nd line
node left,right,parent;
}so how it works is the cursor would know where the location was so i would know where to delete and insert within the tree.
insert {
     //search for location to insert after (log n)
       //create new character node and append to current node
     //increment position for all subsequent children
delete(x) {
     search for x position
     if found, remove node and decrement position value for all children
goto(line #) {
     return line # * 80 (or whatever max length for a single line)
}the major problem i see here is balancing the tree after every insert/delete
Thanks in advance.

One of many great things emacs has given us is the gap buffer:
http://en.wikipedia.org/wiki/Gap_buffer
To see a Java implementation of this you can look in the Java SDK source. The document model (I forget exactly what its called), used in Swing uses a gap buffer.

Similar Messages

  • Sandy - a simple text editor

    sandy - a simple text editor
    Sandy is a X11 text editor with an easy-to-read, hackable C source. It uses GTK+ and GtkSourceView for convenience and is akin to surf, only it is a text editor, not a web browser. Sandy tries to maximize screen estate, minimize the SLOC used and not get in your way too much. It can somehow be controlled via XProperties and all preferences and keybindings are to be chosen at compile time. Two example configs are provided with the source.
    Features
    - Basic editing, saving, etc.
    - One document per instance
    - Embeddable (e.g. can use http://tools.suckless.org/tabbed for tabs)
    - Regex search, go to line functionalities
    - Pipe selection through arbitrary command
    - Pipe selection through predefined command(s)
    - Syntax highlighting
    - Line numbers, current line highlightnig
    - Simple autoindenting
    - Multi-level undo
    - Configurable at compile-time
    Dependencies
    - GtkSourceView2
    - Gtk+2
    - (probably) xorg-utils to get xprop to set XProperties
    - one method to grab user input: either zenity or dmenu in the pre-defined config files
    Screenshot
    http://sandyeditor.sf.net/sandy_editor.jpeg
    Homepage
    http://sandyeditor.sf.net/
    Download
    http://sourceforge.net/projects/sandyed … z/download
    AUR
    http://aur.archlinux.org/packages.php?ID=36084
    Comments, bug reports and patches welcome.
    Last edited by rafunchi (2010-04-13 23:24:26)

    Procyon wrote:
    It would be nice to be able to do something like this:
    1 abc
    2 dec
    3 abd
    4 edc
    5 {CURSOR}ad
    ^R, sed command: 1,3s/^/%%%/
    1 %%%abc
    2 %%%dec
    3 %%%abd
    4 edc
    5 {CURSOR}ad
    So you can edit and continue where you left off.
    The problem with implementing this behavior is 'sed' is an external command here. The full text is filtered through sed and put back in the buffer, not just lines 1 to 3. You can't just preserve the insert position as the text coming from the pipe might be completely different from your original. Same for searching the current line.
    You *could* remember your line+char position and move the cursor back there, but this would be highly unreliable and move the cursor to a third position in the buffer if your 's' command changes the number of lines (e.g. try s/:/\n/g in a password file)
    Also, a couple of tests with vim prove that it does not behave consistently in this regard, despite :s being an internal command there.
    if you really want to add '%%%' at the beginning of the line quite often, I suggest you define a binding or action for:
    t_editable, t_pipelines, { .v = (char *)"sed \'s/^/%%%/\'" }
    Then select the lines you want to target lousily (you don't need to select full lines) and launche the binding/action. It does move the cursor, but seems fairly quick.
    Procyon wrote:Maybe you can check for "/^s/" in the command to make it work on this current line, just like vim's :s///
    I made a wee change in the hg tip code. Now sandy "listens" to three properties regarding pipes:
    - _SANDY_PIPE: Pipes the selected text, or nothing by default as per f_pipe. This is used by the ^I binding in the default config.
    - _SANDY_PIPEALL: Pipes the selected text, or the full file if nothing is selected as per f_pipeall. This is used by the ^P binding in the default config.
    - _SANDY_PIPELINES: Pipes the selected text, extending the selection to full lines and matching the current line if there is no selection as per f_pipelines. This is used by the ^R binding in the default config. This means now sed is applied to full lines if there is a selection and to the current line if there is not.
    Thanks for your feedback. I hope this helps.

  • How can I add highlighting to my simple text editor?

    Hi ...I wrote a simple text editor ..but I want to add Sysntax highlihting to my editor ...ilke I will enter some words in sourse code (new..import.. ext ) and when I write in text those words I want to see whit a different collor ..how can I do this? here is source codes for my text editor..and I want your help
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.plaf.ComponentUI;
    import java.awt.*;
    import java.awt.event.ActionEvent;
    import java.io.File;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.*;
    import java.util.regex.*;
    public class JText extends JFrame{
         private JTextArea textarea ;
         private JFileChooser fileChooser = new JFileChooser();
    private Action open =new OpenAction() ;
    private Action save = new SaveAction();
    private Action exit = new ExitAction();
    public static void main(String args[])
              JText pencere= new JText();
              pencere.setBackground(Color.lightGray);
              pencere.setSize(400,300);
              pencere.setVisible(true);
         //Text Area
         public JText(){
         textarea = new JTextArea(15,90) ;
         JScrollPane scroll = new JScrollPane(textarea);
         JPanel content = new JPanel();
    content.setLayout(new BorderLayout());
    content.add(scroll, BorderLayout.CENTER);
         //Menu Bar
    JMenuBar menu=new JMenuBar();
    JMenu file=menu.add(new JMenu("FILE"));
    file.setMnemonic('F');
    file.add(open);
    file.add(save);
    file.addSeparator();
    file.add(exit);
    setContentPane(content);
    setJMenuBar(menu);
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    setTitle("Project");
    pack();
    setLocationRelativeTo(null);
    setVisible(true);
         class OpenAction extends AbstractAction {
         //============================================= constructor
         public OpenAction() {
         super("Open...");
         putValue(MNEMONIC_KEY, new Integer('O'));
         //========================================= actionPerformed
         public void actionPerformed(ActionEvent e) {
         int retval = fileChooser.showOpenDialog(JText.this);
         if (retval == JFileChooser.APPROVE_OPTION) {
         File f = fileChooser.getSelectedFile();
         try {
         FileReader reader = new FileReader(f);
         textarea.read(reader, ""); // Use TextComponent read
         } catch (IOException ioex) {
         System.out.println(e);
         System.exit(1);
              class SaveAction extends AbstractAction {
              //============================================= constructor
              SaveAction() {
              super("Save...");
              putValue(MNEMONIC_KEY, new Integer('S'));
              //========================================= actionPerformed
              public void actionPerformed(ActionEvent e) {
              int retval = fileChooser.showSaveDialog(JText.this);
              if (retval == JFileChooser.APPROVE_OPTION) {
              File f = fileChooser.getSelectedFile();
              try {
              FileWriter writer = new FileWriter(f);
              textarea.write(writer); // Use TextComponent write
              } catch (IOException ioex) {
              JOptionPane.showMessageDialog(JText.this, ioex);
              System.exit(1);
                   class ExitAction extends AbstractAction {
                   //============================================= constructor
                   public ExitAction() {
                   super("Exit");
                   putValue(MNEMONIC_KEY, new Integer('X'));
                   //========================================= actionPerformed
                   public void actionPerformed(ActionEvent e) {
                   System.exit(0);
    }

    i looked it ...it is the one which i want to do ..But i want to use my window which i gave above ..But i cant mix them ..:( this codes for highlighting.... is any body can add this codes and my codes which i gave above connect together? pleaseeeee... :))
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import java.util.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SyntaxTest extends DefaultStyledDocument
    Element rootElement;
    String wordSeparators = ",:;.()[]{}+-/*%=!&|~^@? ";
    Vector keywords = new Vector();;
    SimpleAttributeSet keyword;
    public SyntaxTest()
    rootElement= this.getDefaultRootElement();
    keyword = new SimpleAttributeSet();
    StyleConstants.setForeground(keyword, Color.blue);
    keywords.add( "abstract" );
    keywords.add( "boolean" );
    keywords.add( "break" );
    keywords.add( "byte" );
    keywords.add( "case" );
    keywords.add( "catch" );
    keywords.add( "char" );
    keywords.add( "class" );
    keywords.add( "continue" );
    keywords.add( "default" );
    keywords.add( "do" );
    keywords.add( "double" );
    keywords.add( "else" );
    keywords.add( "extends" );
    keywords.add( "false" );
    keywords.add( "final" );
    keywords.add( "finally" );
    keywords.add( "float" );
    keywords.add( "for" );
    keywords.add( "if" );
    keywords.add( "implements" );
    keywords.add( "import" );
    keywords.add( "instanceof" );
    keywords.add( "int" );
    keywords.add( "interface" );
    keywords.add( "long" );
    keywords.add( "native" );
    keywords.add( "new" );
    keywords.add( "null" );
    keywords.add( "package" );
    keywords.add( "private" );
    keywords.add( "protected" );
    keywords.add( "public" );
    keywords.add( "return" );
    keywords.add( "short" );
    keywords.add( "static" );
    keywords.add( "super" );
    keywords.add( "switch" );
    keywords.add( "synchronized" );
    keywords.add( "this" );
    keywords.add( "throw" );
    keywords.add( "throws" );
    keywords.add( "true" );
    keywords.add( "try" );
    keywords.add( "void" );
    keywords.add( "volatile" );
    keywords.add( "while" );
    public void insertString(int offset, String str, AttributeSet a) throws BadLocationException
    super.insertString(offset, str, a);
    int startOfLine = rootElement.getElement(rootElement.getElementIndex(offset)).getStartOffset();
    int endOfLine = rootElement.getElement(rootElement.getElementIndex(offset+str.length())).getEndOffset() -1;
    //highlight the changed line
    highlightKeyword(this.getText(0,this.getLength()), startOfLine, endOfLine);
    public void remove(int offset, int length) throws BadLocationException
    super.remove(offset, length);
    int startOfLine = rootElement.getElement(rootElement.getElementIndex(offset)).getStartOffset();
    int endOfLine = rootElement.getElement(rootElement.getElementIndex(offset+length)).getEndOffset() -1;
    //highlight the changed line
    highlightKeyword(this.getText(0,this.getLength()), startOfLine, endOfLine);
    public void highlightKeyword(String content,int startOffset, int endOffset)
    char character;
    int tokenEnd;
    while (startOffset < endOffset)
    tokenEnd = startOffset;
    //find next wordSeparator
    while(tokenEnd < endOffset)
    character = content.charAt(tokenEnd);
    if(wordSeparators.indexOf(character) > -1)
    break;
    else
    tokenEnd++;
    //check for keyword
    String token = content.substring(startOffset,tokenEnd).trim();
    if(keywords.contains(token))
    this.setCharacterAttributes(startOffset, token.length(), keyword, true);
    startOffset = tokenEnd+1;
    public static void main(String[] args)
    JFrame f = new JFrame();
    JTextPane pane = new JTextPane(new SyntaxTest());
    JScrollPane scrollPane = new JScrollPane(pane);
    f.setContentPane(scrollPane);
    f.setSize(600,400);
    f.setVisible(true);
    }

  • Looking for an efficient data structur & search algorithm

    Hi all
    i have a list of digits (international phone network prefixes) with some hundreds to some thousends entries. An entry may be in the form
    ^00[1-9]{1}[0-9]{0,7}$
    I.e. this might be 001, 0041, 00317545, 00317548, 00317549 and so on. Regarding the last three examples, it might even be that there is an additonal 0031754.
    What i need a a data structur that allows to match these prefixes against a phonenumber.
    I.e. if i have the phonennumber 001123456789 it would match the prefix 001. If i had 00317549111 it would match 00317549.
    The easiest way would be to but all prefixes into an Vector or similar and loop over all entries, trying to match the phonenumber with startsWith(). But this wouldn't always result in a absolutely perfect match, since, i.e. for the phonenumber 00317549111 the check against the prefix 0031754 would return a match even if there was a more specific match with the prefix 00317549. But more than that, this simple algorithm is not very efficient.
    So i am looking for a more efficient way/pattern to do this. I thought about a kind of tree structure, starting with 00 in the top level, than provding [1-9] in the second level, and [0-9] from third level on. Then on every node it would either store if there is a matching prefix on that level, or if there is a prefix starting with that digits on a lower level or if there is no prefix on that level or any lower.
    I.e. when i have the phonenumber 00317549111 it would start at the top level with 00. That would be ok. On the next level it would check if there is a node for digit 3. If there is, it would go one level deeper and check if there is a node for digit 1. If yes, again it would go one level deeper to check if there is a node for digit 7. If that algorithm comes to a level where, for the request digit, it get's a prefix indicator rather than a node indicator, the algortihm would know, that a matching prefix was found and that there is no more specifig match on deeper levels.
    One thing i forgot to mention - the prefixes might be read once during startup/init and there it might take some time for building up the datastructur - i don't care about that. But, when running, then the maching process should be as efficient as possible, that's the most important point for me.
    What do you think about a pattern like this? Could this be efficient? Do you see other patterns, that might be easier to implement and that might be faster/need less memory?
    Thanks a lot for your help.
    Cheers, Frank

    I would really have gone for your first approach. With mperemsky5's approach you have the loop with (potential) n iterations (Let n be the length of the number) and in each iteration to compute the hash-code for the string which again takes time proportional to the strings length.
    The tree approach takes time equal to the length of the prefix and is imho not more complicated.
    Perhaps this way:
    public class DigitTree
      private class Node {
           private Object content;
           private Node[] children = new Node[10];
      private Node root = new Node();
      public DigitTree() {
      public void addPrefix(String prefix, Object value) {
           char[] numberChars = prefix.toCharArray();
           Node node = root;
           for (int i=0; i<numberChars.length; i++) {
                int number = numberChars[i] - '0';
                if (node.children[number] == null) node.children[number] = new Node();
                node = node.children[number];
           node.content = value;
      public Object match(String phonenumber) {
           char[] numberChars = prefix.toCharArray();
           Node node = root;
           for (int i=0; i<numberChars.length; i++) {
                int number = numberChars[i] - '0';
                if (node.children[number] == null) return code.content;
                node = node.children[number];
           return node.content;
    }The method addPrefix lets you add a prefix to the tree. The content-Object can hold a String or whatever to identify the prefix. If your data is not complete (i.e. if there are numbers for which no prefix exists) you might want to initialize the content-object of a node with a default value (e.g. "not found").
    The method match lets you look up a prefix for a given number and returns the Object associated with the prefix..
    The code was not tested.
    Greetings
    Thomas

  • Which is a efficient Data Structure to store data in a file

    I want tostire a data in file in sorted order. I am thinking about Bainary Search tree & heap sort Which is efficient technique. Please reply..

    which is the best data structure to be used in Thread
    pool to store the thread instances? and why ?
    I have seen lots of people using Queue....Why do you ask? You do know that there are thread pool classes in Java 5?
    Kaj

  • Where can i find basic data structure to implement linklist,priority que ?

    where can i find basic datastructure and how to shift left and right and similar things to do in java plzz help me in this regard i ll be great ful to u
    thanks in advance

    I assume from your question you're new to Java. You'll find Java does not have "structures" per se as in languages such as C. Instead, everything is implemented in classes, which can hold both data and code (methods) to operate on the data.
    Regarding shifting left and right, check out the [url http://java.sun.com/docs/books/tutorial/java/nutsandbolts/op3.html]Java tutorial on operators.

  • Is There A Simple Text Editor/Composter & Line Art Plug-In Available

    Yes, I know it has been addressed in other posts in the past but I wanted to know if any new tools are available since the update to 3.XX, outside of open a picture in a "Book" project and adding text in a border or downloading BorderFX, neither of which provide a direct result. 
    For such an advanced piece of software, I find it infurirating that the only way to create simple focus cicles, highlight boxes, insert arrows, lines or create and insert text directly on an image after cleaning it up is to
    Import > Save > Export > Reopen In the OSX Built-in Image Preview > Perform Functions Using Its Tools > Re-Save Version.
    Even the most rudimentary photo altering programs like MS Paint and have this basic toolset in the standard the package. How or rather why would Apple klutz this up?

    I can respect that thousands of users have accepted the current status-quo of these applications,
    What is there to accept? it would be different, if Aperture claimed to be a program for graphics compositing, but it is not. Aperture is a tool for a different purpose.
    Here is how Aperture is advertized in the store:
    Aperture gives you all the tools you need to uncover the hidden potential in your photos. It brings you even more advanced ways to organize, browse, and perfect images.
    So you can make every shot your best shot.
    And that does Aperture really well. If you want a painting program, why buy Aperture?

  • Simple text Editor App.. Saving Plain Text

    Hi All,
    I am trying to write my first text application in cocoa... I have got a working app from an Apple tutorial, however when saving, it uses the following:
    Code:
    - (NSData *)dataRepresentationOfType:(NSString *)aType
    NSData *data;
    [self setString:[textView textStorage]];
    data = [NSArchiver archivedDataWithRootObject:[self string]];
    return data;
    Which saves the content as not plain text. Is there anyway I can change the above to save as plain text ?
    Any help / direction would be great! Thanks,

    Perhaps something like this will work for you:
    NSString *s = [textView string];
    NSData *data = [NSData dataWithBytes: [s UTF8String] length: [s length]];

  • Simple text editor

    Can someone advise me on how I can click anywhere on the
    canvas/stage to create a text field where you can input text.
    I have seen similar functionality at
    www.imagination3.com where
    you can see the function if you go to TOOLS > TYPE.
    Any assistance will be appreciated.

    I'm not sure I'm on the right forum, sorry
    You are not in the right forum !
    This is Compressor 2 forum.
    You probably have to post your question in OSX forum:
    http://discussions.apple.com/category.jspa?categoryID=160
    Good luck!
      Alberto

  • Packet queue strategy & data structure

    Hi all,
    does anyone know an efficient data structure to implement a global packet queue in which packets from different connection are queued (by a thread) and removed by another thread ?
    The basic idea is to have the following 2 threads (in pseudo code):
    q is the global queue
    // write thread
    foreach (Connection c : connections) {
        Packet p = q.nextPacketToSendToThisConnection
        send as much bytes of p as the write() is a non-blocking operation
        if (p.bytesToSend == 0) {
            q.markPacketAsSendedForConnection(p, c)
    // read thread (c is a Connection)
    Packet p = c.readPacket()
    q.queue(p)Thanks in advance

    A simple queue using a linked list will do. Here's an example from some of my network code, the message is just a string, it could be something more complex. Attempts to avoid the synchronization are prone to error and may actually slow your code down.:
         LinkedList sendQ = new LinkedList();     // our transmission queue
         // the transmit queue
         // the transmit thread calls popMessage to get a string to send
         synchronized String popMessage()
              String msg = null;                                   // returns null if closed
              while (state > 0 && sendQ.size() == 0)          // wait until data or closed
                   try{this.wait();}                              // wait relinguishes lock and lets other threads run
                   catch(InterruptedException e){}               // ignore interrupts
              if(state > 0)msg = (String)sendQ.remove(0);     // we're open get oldest message form sendQ list
              return msg;
         // the client calls postMessage to put a string on the transmit queue
         synchronized void postMessage(String msg)
              sendQ.add(msg);               // append to transmit queue
              this.notify();               // tell popMessage to take a look
         }

  • Urgent! Need help in deciding data structure to use

    Hi all,
    I need to implement a restaurant system by which a customer can make a reservation.
    I was wondering whether vector would be able to be store such an object, The thing is I don't want a complex data structure. just sumthin simple cos i hardly have anytime left to my submission. sighz...
    The thing is I need to able to search based on 2 properties of an object. Eg. I need to search for a reservation based on the customer name and the date he reserved a table.
    But I am totally clueless how to search thru a vector based on 2 properties of the object... Would really appreciate some help. Like an example how to so so based on my program. Feelin so lost...This is all I have so far:
    class AddReservation
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         //Main Method
         public static void main (String[]args)throws IOException
              String custName, comments;
              int covers, date, startTime, endTime;
              int count = 0;
              //User can only add one reservation at a time
              do
                   //Create a new reservation
                   Reservation oneReservation=new Reservation();                         
                   System.out.println("Please enter customer's name:");
                   System.out.flush();
                   custName = stdin.readLine();
                   oneReservation.setcustName(custName);
                   System.out.println("Please enter number of covers:");
                   System.out.flush();
                   covers = Integer.parseInt(stdin.readLine());
                   oneReservation.setCovers(covers);
                   System.out.println("Please enter date:");
                   System.out.flush();
                   date = Integer.parseInt(stdin.readLine());
                   oneReservation.setDate(date);
                   System.out.println("Please enter start time:");
                   System.out.flush();
                   startTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setstartTime(startTime);
                   System.out.println("Please enter end time:");
                   System.out.flush();
                   endTime = Integer.parseInt(stdin.readLine());
                   oneReservation.setendTime(endTime);
                   System.out.println("Please enter comments, if any:");
                   System.out.flush();
                   comments = stdin.readLine();
                   oneReservation.setComments(comments);
                   count++;
              while (count<1);
              class Reservation
              private Reservation oneReservation;
              private String custName, comments;
              private int covers, startTime, endTime, date;
              //Default constructor
              public Reservation()
              public Reservation(String custName, int covers, int date, int startTime, int endTime, String comments)
                   this.custName=custName;
                   this.covers=covers;
                   this.date=date;
                   this.startTime=startTime;
                   this.endTime=endTime;
                   this.comments=comments;
              //Setter methods
              public void setcustName(String custName)
                   this.custName=custName;
              public void setCovers(int covers)
                   this.covers=covers;;
              public void setDate(int date)
                   this.date=date;
              public void setstartTime(int startTime)
                   this.startTime=startTime;
              public void setendTime(int endTime)
                   this.endTime=endTime;
              public void setComments(String comments)
                   this.comments=comments;
              //Getter methods
              public String getcustName()
                   return custName;
              public int getCovers()
                   return covers;
              public int getDate()
                   return date;
              public int getstartTime()
                   return startTime;
              public int getendTime()
                   return endTime;
              public String getComments()
                   return comments;
    +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    class searchBooking
         static BufferedReader stdin = new BufferedReader (new InputStreamReader(System.in));
         public static void main (String[]args)throws IOException
              int choice, date, startTime;
              String custName;
                   //Search Menu
                   System.out.println("Search By: ");
                   System.out.println("1. Date");
                   System.out.println("2. Name of Customer");
                   System.out.println("3. Date & Name of Customer");
                   System.out.println("4. Date & Start time of reservation");
                   System.out.println("5. Date, Name of customer & Start time of reservation");
                   System.out.println("Please make a selection: ");          
                   //User keys in choice
                   System.out.flush();
                   choice = Integer.parseInt(stdin.readLine());
                   if (choice==1)
                        System.out.println("Please key in Date (DDMMYY):");
                        System.out.flush();
                        date = Integer.parseInt(stdin.readLine());
                   else if (choice==2)
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==3)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                   else if (choice==4)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                   else if (choice==5)
                             System.out.println("Please key in Date (DDMMYY):");
                             System.out.flush();
                             date = Integer.parseInt(stdin.readLine());
                             System.out.println("Please key in Name of Customer:");
                             System.out.flush();
                             custName = stdin.readLine();
                             System.out.println("Please key in Start time:");
                             System.out.flush();
                             startTime = Integer.parseInt(stdin.readLine());
                        }

    Please stop calling your questions urgent. Everybody's question is urgent to them. Nobody's are urgent to the people who are going to answer them. Calling your questions urgent suggests that you think they are more important than others' (They're not.) and will only serve to irritate those who would help you. It won't get your questions answered any sooner.

  • What is the new data structure for .RTM files in LV8?

    We have software that translates our LV
    program to another language.  Part of that software package reads RTM
    files, decodes them, replaces text, and resaves them.  That code is
    broken for menus that are saved in LV8+, however.  What is the new data
    structure?
    The simple attached zip file has vi's which
    are not ours but serve to illustrate the point.  If it's run on an
    older RTM file, it correctly outputs and XML version of it, on newer
    RTM files it just throws an error.
    -- This is the second time I posted this.  I was curious what the Solution? icon did on somebody elses post and I apparently marked the whole thread as solved (there should really be an undo on that feature btw --
    Attachments:
    RunTime_Menu_to_XML.zip ‏33 KB

    Hi Thomas,
     What error are you getting when running the program?  I was actually able to run it without errors in LV 8.6.  
    There are ways to programmatically read and customize RTM files in LabVIEW.  I hope that the following links will help:
    http://zone.ni.com/reference/en-XX/help/371361B-01/lvhowto/customizing_shortcut_menus_programm/
    http://digital.ni.com/public.nsf/allkb/17803AA31C8C07C986256CFD0080D609?OpenDocument
    Cheers, 
    Marti C
    Applications Engineer
    National Instruments
    NI Medical

  • Is a text editor really better than Dreamweaver?

    Hi Everyone,
    I've been looking through several different web design forums
    and I'm now stuck with a question. Why do some people swear by
    using only a text editor to put their website together and totally
    discount programs such as Dreamweaver? I find this quite strange
    because a website amongst other things is a highly visual
    experience usually not showing a single line of code to the end
    user. I get the impression that some people feel that Dreamweaver
    is beneath them as they are "highly skilled coders" and only
    amateurs use WYSIWYGs! Is it just me or am I correct in thinking
    there is an element of snobbery here? To me it seems that
    Dreamweaver has advantages in abundance and for the so called
    hardcore coders there's even a code view which is much more
    powerful than a simple text editor. One final thing, I see that
    people complain about so called bad code that Dreamweaver writes.
    Is it true that Dreamweaver writes bad code and if so what's bad
    about it?
    Many thanks, I'll be fascinated to read your
    responses.

    Let's see entire sites, good-sized professional ones. :-)
    Patty Ayers | www.WebDevBiz.com
    Free Articles on the Business of Web Development
    Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    "Murray *ACE*" <[email protected]> wrote
    in message
    news:[email protected]...
    > Good idea, Patty. Let's see some of the "wouldn't touch
    DW with a 10-foot
    > pole" pages that have been created....
    >
    > --
    > Murray --- ICQ 71997575
    > Adobe Community Expert
    > (If you *MUST* email me, don't LAUGH when you do so!)
    > ==================
    >
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    >
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    > ==================
    >
    >
    > "P@tty Ayers ~ACE"
    <[email protected]> wrote in message
    > news:[email protected]...
    >> This question is asked a lot. The answers are:
    >>
    >> -- No, a text editor isn't just as good. There are
    lots of extremely
    >> useful things DW does that a text editor can't do.
    >>
    >> -- No, the recent versions of Dreamweaver actually
    write very good code
    >> in general.
    >>
    >> -- In response to "only amateurs use [Dreamweaver
    instead of a text
    >> editor]" - please show me just 1 full-time
    professional web developer
    >> responsible for creating and maintaining sites who
    uses only a text
    >> editor. Just 1. You won't be able to, because there
    isn't one. Not one
    >> with a job, anyway. :-)
    >>
    >> Cheers,
    >>
    >> --
    >> Patty Ayers | www.WebDevBiz.com
    >> Free Articles on the Business of Web Development
    >> Web Design Contract, Estimate Request Form, Estimate
    Worksheet
    >> --
    >>
    >>
    >>
    >> "In at the deep end"
    <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Hi Everyone,
    >>>
    >>> I've been looking through several different web
    design forums and I'm
    >>> now
    >>> stuck with a question. Why do some people swear
    by using only a text
    >>> editor to
    >>> put their website together and totally discount
    programs such as
    >>> Dreamweaver? I
    >>> find this quite strange because a website
    amongst other things is a
    >>> highly
    >>> visual experience usually not showing a single
    line of code to the end
    >>> user. I
    >>> get the impression that some people feel that
    Dreamweaver is beneath
    >>> them as
    >>> they are "highly skilled coders" and only
    amateurs use WYSIWYGs! Is it
    >>> just me
    >>> or am I correct in thinking there is an element
    of snobbery here? To me
    >>> it
    >>> seems that Dreamweaver has advantages in
    abundance and for the so called
    >>> hardcore coders there's even a code view which
    is much more powerful
    >>> than a
    >>> simple text editor. One final thing, I see that
    people complain about so
    >>> called
    >>> bad code that Dreamweaver writes. Is it true
    that Dreamweaver writes bad
    >>> code
    >>> and if so what's bad about it?
    >>>
    >>> Many thanks, I'll be fascinated to read your
    responses.
    >>>
    >>
    >

  • Which data structure?

    Hi there...
    Could you let me know what is the most efficient data structure to use (in terms of storage and access) if I have to store around 1 million <key,value> pairs?
    Thanx :)
    Tariq

    Yes, concurrency, when two or more threads would act upon the same data or data structure. Concurrent access, etc. Your question has nothing to do with concurrency, but rather Collections. But yes, HashMap or Hashtable depending on if one thread is going to be accessing the same data or multiple threads. Also a database might come in handy as well, such as MySQL or JavaDB (Apache Derby).

  • Macintosh Java text Editors

    I have been looking for a good macintosh Java text editor for my newphew. His high school is primary macintosh (Mac OS X) workstation based, therefore in order to code/learn Java, he understands that he can use a simple text editor.
    Is there a good text editor for the macintosh? Maybe a comparison is BBEdit for web site development, something with that power.
    Or is there a better simple editor in the terminal he can use?
    Thank you for reading this post.

    You can use TextEdit in plain text mode, or you can go to http://developer.apple.com/ and get Apple's free Project Builder IDE of OS X10.2, which works OK most the time as a text editor with syntax highlighting, but I've found tends to fall over when you try to debug; I've just ordered OS X 10.3 which comes with XCode, which looks prettier, and may even work.
    For the one or two class examples I post here, I use project builder as a text editor, and compile from the terminal. For larger projects, I use project builder but have to be disciplined about saving regularly.
    I've also used J (http://sourceforge.net/projects/armedbear-j/), though mainly under linux on a slow laptop, which is quite fast and lightweight, and being Java portable. I will go try it on the Mac forthwith.
    Pete

Maybe you are looking for

  • System crash due to ATI proprietary driver

    Hello, I installed ATI driver 9.6.4 from AUR and I did a "X -configure" which didn't worked. So I took a xorg.conf made with "X -configure" for an open-source driver and then I did "aticonfig --initial --input=/etc/X11/xorg.conf" like it says in arch

  • I have found since updating to the new firefox that certain links no longer work. Has anyone else experienced this. It is becoming a real issue.

    For example, google search page links or links on certain web sites work in Safari but in firefox they are simply dead. Clicking on some google search page links takes you to a blank page or one with an error message. Links on shopping pages and cred

  • ITunes showing unknown error 1418 - Help!!

    Ok, so I got my new 5th Generation iPod for my birthday to replace my iPod mini. I put all my old music onto it and listened to it today with no problems. However, I'd bought 2 albums from iTunes last night and was annoyed to find that they had not s

  • Client login +cms

    Hi, Maybe I bite more than I can chew but this is what I want to make. On a small site I have to create a client login. On this website my client must be able to generate a log&pass that sends his clients to a specific page where they can read a comm

  • I can't not use spatial operator and index .

    Dear all, I create following spatial tales and spatial index. create table LHelix( PDB_IDcode           varchar(8) not null, chainID varchar(2), Hnum number not null, anum varchar(6), Hgeo MDSYS.SDO_GEOMETRY, primary key(PDB_IDcode,chainId,hnum,anum)