Vector output??

Im adding a double to the vector, however, when printing out the vector i get the following result.
[Token[EOF], line 135, Token[EOF], line 135, Token[EOF], line
135, Token[EOF], line 135, Token[EOF], line 135, Token[EOF], line 135, Token[EO
F], line 135, Token[EOF], line 135, Token[EOF], line 135]
heres the code snippet.
if((StreamTokenizer.TT_NUMBER == token.ttype))v.addElement(token);
When I print them out 1 by 1 without adding them to a vector I get the results Im hoping for i.e numbers!!
Anyone know how I can resolve this?
Cheers for any hints, tips, answers and anything else you care to add!! ;)

An easy way is to cut them of yourself:
String s = v.toString();
s = s.substring(1, s.length()-1);Or you can make your own method to create the string:
StringBuffer buf = new StringBuffer();
Iterator e = v.iterator();
//buf.append("[");
int maxIndex = v.size() - 1;
for (int i = 0; i <= maxIndex; i++) {
    buf.append(String.valueOf(e.next()));
    if (i < maxIndex)
     buf.append(", ");
//buf.append("]");
String result = buf.toString();I just toke the code from the toString() method in AbstractCollection which the Vector inherits from. And I commented out the lines with the squared brackets.

Similar Messages

  • Vector Output from PSE?

    I have PSE 6.0 on a WinXP machine. My question has to do with producing vector output files using only PhotoShop Elements.
    PSE is capable of producing PDF files as output. My understanding is that PDF files are vector rather than raster. In Elements shapes and type are drawn as vector so does it follow that saving an image which only includes shapes and type as a PDF result in a PDF with the type and shapes as vectors? In other words is the vector information to draw type and shapes saved in the PDF file using Save As?
    Steve

    PSE will normally let you make a backup or data disk on CD.
    What is the purpose of this CD?
    If you also have Premiere Elements, its possible to burn a DVD which can then be viewed on TV sets.

  • Converting Vector output to Excel Format

    Hi All,
    I hv developed a report module using Swing. I hv the output from DB to Vector. I hv to save the output in a excel file in a ordered way. How can i do this. Is there anyway of doing it.
    Kindly help me.
    Thanks
    Srini

    There is [url  http://www.andykhan.com/jexcelapi/index.html]JExcelApi , also Apache POI and so on, but just search the forum for "excel" and you will find that you are not the only one to ask this, there are lots of results that should guide you in your choice.
    HTH
    Mike

  • When will Flash CC support vector output?

    Using CS6 is awful on a retina monitor, and isn't a valid long-term solution.

    Adobe need  to address this issue. I used to rely heavily on ai export from Flash which worked fine in earlier versions. Now there seems to be no route to get vector stills from Flash. The SVG output in CC2014 although slow and clunky was OK - but doesn't now work - < I get a JS error..>. now that's left me with a huge problem... I pay good money for CC every month - and I'm a lifelong Adobe fan - but I think their product support (via CC app update) of late has become very shoddy - Adobe: these are professional products for which professional subscriptions are being paid.. you've taken years to build up your reputation - so please - SORT these issues! 

  • Vector output madness - horizontal lines that look like bad field rendering?

    Hi all,
    Has anyone run into this rendering problem using ONLY vector graphics? It looks like a field rendering problem but all I can find on that subject is with regard to film footage. I've tried continuous rasterization and still no joy. Using a Mac, running AE CC2014, output to Quicktime HD 1080i 25fps .mov format. These "cells" are part of a Cannon Particle Playground effect if that makes any difference at all. It was all looking perfect until the render. So frustrating.
    Anyone have experience with this?? Going out of my mind...
    Lisa

    Quicktime HD 1080i 25fps
    i as in interlaced?! You know....
    Mylenium

  • Vector output problem

    hi all
    please see code:
    public static Vector magnetWireDia(Vector<Double> secGa)
                        Vector secWD=new Vector();
                   for (int x=0; x<secGa.size(); x++){
                        secWD.add(x,.46/(Math.pow (1.1229322,((secGa.elementAt(x)+3)))));
                        System.out.println("Wire dia="+secWD + "to position="+x);
                        return secWD;
    could you explain why the output is Wire dia=[0.03589054502043804]to position=0
    Wire dia=[0.03589054502043804, 0.05706820267117022]to position=1
    Wire dia=[0.03589054502043804, 0.05706820267117022, 0.025346584597928244]to position=2
    when i was expecting one wire dia in each position.
    thanks
    tvolly

    replace
    System.out.println("Wire dia="+secWD + "to position="+x);with
    System.out.println("Wire dia="+secWD.get(x) + "to position="+x);

  • Crop to artboard (need vector output)

    Greetings,
    Essentially, I need to crop some work to the artboard.  All of the suggestions I've read so far include the export option but I need this design to import into Flash.  My instructor will not permit anything but vector drawings.  I can't export to any sort of raster format or pdf.  Ideally, it needs to remain as an ai file.  When I do the import from Flash, it keeps everything outside the bounds of the artboard (highlighted in red on my screenshot).
    This is a group project. I didn't do this drawing, I just wanted to add the perspective lines to the floor.  Now it's a bit of an untidy mess when it goes to Flash.  And Illustrator is not my strong point.  I did try unsuccessfully to "erase", Scissor, knife and a few other things but I really don't know how those tools work.  I also tried the clipping mask approach but it didn't want to combine my rectangle "mask" with the lines on the floor.
    I'm using AI CS4 and Flash CS6.  Any help would be greatly appreciated.  Thank you.

    Make sure that either there is no selection at all or only the lines are selected.
    edit: When learning tools and they don't work as expected, it is a good idea to try them by creating a new document with a very simple content. For example Create a new document, take the Line tool, draw a few lines, and try to erase them as I suggested. If it works there at least you will see and know how it works and if it doesn't work on another document you will know that there is something in that document that makes things different and you can try to figure out what it is.
    The difference between Clipping Mask and Eraser is that the Clipping Mask hides the unwanted parts while the Eraser actually removes them which may not matter for your case.

  • Strings, vector output? HELPP!!!

    Hi!
    How would I Store strings thats entered from the command prompt into a vector and print them out?
    I've been trying to do this for 2 days.....I have erased my code and burnt my sorry java book that really sucks! If anyone could help me I would really appreciate it. Thanx.

    I'm assuming this is a J2SE 1.5.0 question, so I'll
    use as many of the new language features as I can.
    import java.util.*;
    public class Vec {
    public static void main(String... args) {
    Vector<String> vec = new Vector<String>();
    for (String s : args) vec.add(s);
    System.out.printf("%s%n", vec);
    What about using import static java.lang.System.*; and hence out.printf("%s%n", vec); Isn't this a new language features that you are able to use?

  • How do i open my multiple smart objects in my psd in one illustrator vector file?

    HELLO
    I have created a psd.
    It contains multiple smart objects which when double clicked link you to illustrator.
    I would like to open all the vector images from this file in one illustrator file.
    Is this possible?

    I guess it might be (almost) possible with Scripting in principle but probably not practically.
    To elaborate:
    One could open all the Smart Objects with a Script and with BridgeTalk it should be possible to have Illustrator perform tasks on those.
    But one can not, as far as I know, directly access scale, rotation, skew of a placed Smart Object with a Script, so that information would have to be determined with work-arounds or (partially) neglected.
    If you need vector output why did you make the arrangement in Photoshop?

  • Elements file saved as PDF --is it PDF/x-1a vector? or is it a raster file?

    Hi,
    Have a magazine requiring vector rather than raster*.  How do I tell which my Photoshop Elements saves it as?  And if I find out it is a raster, how do I change it to vector?
    As well, since I have no idea how their printer is color profiled, I'm wondering if I should send them a PDF at all.  Can a magazine color correct a pdf?
    Thanks,
    *"WE DO NOT ACCEPT  PDF/X-1A RASTER FILES!"

    PSE doesn't create the kind of file you need. That's the long and the short of it. PDF creation from PSE is extremely basic and doesn't include much of the information needed by commercial print shops. PSE is meant for home use, not for commercial work, and adobe makes sure that it's very hard to avoid buying pro-level software for pro-level work by keeping those features out of Elements. There is no way to create vector output from PSE.
    The best thing to do is to talk to your printer and explain the situation. They may be able to work with something you can output in a regular image format, but it will undoubtedly cost you, because they will have to do much extra work.

  • Recommended tutorials for using paths/vector art in Photoshop?

    Hi all!
    Can you recommend any good tutorials for using paths/vector art in Photoshop?
    Honestly, I've had a good look for even one - without much success.
    I Have lots of experience with paths/vector art in Illustrator, Fireworks and InDesign but I believe you really can do great things with them in Photoshop now for illustration work.
    i'm just baffled by it. I can fill and stroke and edit a vector shape in PS - but if I custom DRAW a vector path or shape, things get confusing!
    Hoping someone can point me in a helpful direction
    John

    John,
    I wouldn't claim to know everything there is to know, but I'm reasonably certain it hasn't changed.
    Are the 'shapes' just vector masks with a raster element inside?
    Yes. That's an accurate enough description.
    And if you apply a colour to a path that you've drawn - does it rasterise?
    It doesn't have to rasterize. If you see color, it's pixels.
    I was definitely of the impression that a lot more could be done in PS these days that might formerly have been done in ILLUSTRATOR.
    The shape/path tools in Photoshop have been enhanced and improved in recent years, but the product of their use still differs from Illustrator's true vector output.

  • Getting output from StreamRedirectThread.java

    Hi,
    For the purpose of my work, I am trying to store the output that is produced by StreamRedirectThread.java into a vector as shown in the code below. When I try to print out that vector the output is not as the same as it is printed in the StreamRedirectThread.java program. For example if the output form the program prints out the numbers form 0 to 5, the vector output is doubled in size and prints:
    index = 0 content=0
    index = 1 content=
    index = 2 content=1
    index = 3 content=
    index = 4 content=2
    index = 5 content=
    index = 6 content=3
    index = 7 content=
    index = 8 content=4
    index = 9 content=
    index = 10 content=5
    index = 11 content=
    Can anybody advice me what to do about it. I tried but couldn't fix it. The code of StreamRedirectThread.java is as
    import java.io.*;*
    *import java.util.*;
    import com.sun.jdi.*;*
    *import com.sun.jdi.request.*;
    import com.sun.jdi.event.*;*
    *import com.sun.jdi.connect.*;
    class StreamRedirectThread extends Thread {
    private final Reader in;
    private final Writer out;
    private static Vector outvector = new Vector(0); // victor of objects that contains output result
    private static final int BUFFER_SIZE = 2048;
    * Set up.
    * @param name Name of the thread
    * @param in Stream to copy from
    * @param out Stream to copy to
    StreamRedirectThread(String name, InputStream in, OutputStream out) {
    super(name);
    this.in = new InputStreamReader(in);
    this.out = new OutputStreamWriter(out);
    setPriority(Thread.MAX_PRIORITY-1);
    public void run() {
    try {
    char[] cbuf = new char[BUFFER_SIZE];
    int count;
    while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
    //out.write(cbuf,0,count);
    String s = new String(cbuf,0,count);
    if (!(s.equals(null)))
    TemplateApp.vv.addElement(s);
    outvector.addElement(s); out.write(s);
    out.flush();
    } catch(IOException exc) {
    System.err.println("Child I/O Transfer - " + exc);
    public synchronized static Vector getOutVector()
    return outvector ;
    }Thanks a lot for help

    The problem was with endline stored in the vector. I did the follwing and it worked for me.
    String separator = System.getProperty("line.separator");
      while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
                 if ( count == 0 ) {
                    continue;
                 String s = new String(cbuf,0,count);
                 out.write(s);
                 out.flush();
                 s = s.replace(separator, "");
                 if (s.length() !=0 )
                            outvector.addElement(s);
           }

  • Exporting as vector (in application)

    is there a way we can get vector output from a working tool of Flash (Not exporting in Flash) for example many people developed T-shirt Designing tool so how we can give vector output from that tool?

    airbob wrote:
    > Hey,
    >
    > I need images to be set as vectors for when i send them
    to get a tee shirt made. Is this possible out of fireworks?
    Yes. Choose File > Save As. Give the file a name. For Save
    as Type,
    choose Illustrator 7 AI.
    Linda Rathgeber ACE ::: PVII
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Adobe Community Expert - Fireworks
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • Converting output of an effect into new path?

    Hi all.
    So I take a square, and then I apply a pucker and bloat to it, to make this interesting shamrock shape. The path remains the same, as a square, but the vector output is changed by the effect into said shamrock.
    My question is this - how do I apply the effect directly to the path. In the above example, the blue path would be underneath the fun shamrock.
    http://i35.photobucket.com/albums/d188/OphidianShenzi/01.jpg
    Often I will edit a shape with multiple effects, eg. first i'll bloat it, then i'll apply some sort of warp. It would be very helpful to be able to effect the path directly at any stage of the effects process, since when you have a shape that's warped heavily and you try and edit the warped area you get a big suprise.
    Suggestions?
    Thank you

    Shenzi,
    I hope you're not trying to follow those instructions exactly as stated. If you:
    Copy (Edit>Copy)
    Hide visibility (Object>Hide Selection)
    Then you will not be able to select Object>Expand Appearance, because nothing will be selected.
    For clarity:
    Live vector Effects really are actual paths. But while still in Illustrator, they are paths that get re-generated on-the-fly each time you modify the original path. When the artwork leaves Illustrator (by exporting or printing), live Effects get "nailed down" to the paths and/or raster objects generated by the Effect.
    The Object>Expand Appearance command is so you can  "nail down" the live effect(s) you've applied to an object to actual paths (or raster objects) while still inside Illustrator.
    Just select the path to which you've applied the Pucker & Bloat Effect. Then select Object>Expand Appearance. The result will be the result of the Pucker & Bloat Effect rendered as an ordinary path; it won't have the "live" effect applied anymore. If you think you might still need to start over, back at the stage at which you still had the live (adjustable) Effect, you can make a duplicate of the object with the Effect applied before Expanding its Appearance, and set it aside for future use. But there's no need to do that if you're already satisfied with the Effect.
    JET

  • Thread doubled output

    Hi,
    For the purpose of my work, I am trying to store the output that is produced by StreamRedirectThread.java into a vector as shown in the code below. The output of the thread code is ok and the output printed is the numbers from 0 to 5.
    When I try to print out that vector, the output is not as the same as it is printed in the StreamRedirectThread.java program. For example if the output form the program prints out the numbers form 0 to 5, as I said before, the vector output is doubled in size and prints:
    index = 0 content=0
    index = 1 content=
    index = 2 content=1
    index = 3 content=
    index = 4 content=2
    index = 5 content=
    index = 6 content=3
    index = 7 content=
    index = 8 content=4
    index = 9 content=
    index = 10 content=5
    index = 11 content=
    Can anybody advice me what to do about it. I tried but couldn't fix it. The code of StreamRedirectThread.java is as
    Here is the Thread Code: Thanks
    import java.io.*;*
    *import java.util.*;
    import com.sun.jdi.*;*
    *import com.sun.jdi.request.*;
    import com.sun.jdi.event.*;*
    *import com.sun.jdi.connect.*;
    class StreamRedirectThread extends Thread {
    private final Reader in;
    private final Writer out;
    private static Vector outvector = new Vector(0); // victor of objects that contains output result
    private static final int BUFFER_SIZE = 2048;
    * Set up.
    * @param name Name of the thread
    * @param in Stream to copy from
    * @param out Stream to copy to
    StreamRedirectThread(String name, InputStream in, OutputStream out) {
    super(name);
    this.in = new InputStreamReader(in);
    this.out = new OutputStreamWriter(out);
    setPriority(Thread.MAX_PRIORITY-1);
    public void run() {
    try {
    char[] cbuf = new char[BUFFER_SIZE];
    int count;
    while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
    //out.write(cbuf,0,count);
    String s = new String(cbuf,0,count);
    if (!(s.equals(null)))
    TemplateApp.vv.addElement(s);
    outvector.addElement(s); out.write(s);
    out.flush();
    } catch(IOException exc) {
    System.err.println("Child I/O Transfer - " + exc);
    public synchronized static Vector getOutVector()
    return outvector ;
    }Thanks a lot for help

    Iman_S wrote:
    while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
       String s = new String(cbuf,0,count);
       if (!(s.equals(null)))
          TemplateApp.vv.addElement(s);
       outvector.addElement(s); out.write(s);
       out.flush();
    }I've reposted and properly indented this code to help you understand what's going on. I have many problems with this:
    1. s.equals(null) is always false if equals is properly implemented. This is because, if a.equals(b), b.equals(a) must be true due to the symmetry constraint of equals() -- see here: [http://java.sun.com/developer/Books/effectivejava/Chapter3.pdf]. If s.equals(null) were true, then null.equals(s) would have to be true, which is obviously incorrect as a NullPointerException would have been thrown. Use s == null to compare an Object reference with a null reference, and use s.isEmpty() or s.length() == 0 to decide whether a String has characters.
    2. Always use opening and closing braces ( { } ) with an if block. I'm guessing you thought that the "outvector.addElement(s)" statement was IN the if block, but it in fact wasn't. Always be explicit.
    3. Don't do anything that you're doing inside that while loop if count == 0. in.read() can return 0 any time it wants, which means that it didn't read any characters. However, you are using that blank output without caring. I'm guessing the s.equals(null) line was meant to weed that out, but as I said, that will always be false. Moreover, new String( new char[0] ) doesn't give you a null reference, it gives you a new String with no characters.
    I would suggest something more like this:
    while ((count = in.read(cbuf, 0, BUFFER_SIZE)) >= 0) {
       if ( count == 0 ) {
          continue;
       String s = new String(cbuf,0,count);
       TemplateApp.vv.addElement(s);
       outvector.addElement(s);
       out.write(s);
       out.flush();
    Edit I should note that this isn't likely your problem. As Peter said, it does look like you are basically adding newline characters to outvector (if you're sending your data with println, this is to be expected!). Also, I was a bit hasty in saying that InputStream returns 0 "whenever it wants." This isn't typical behaviour, but it should be handled nonetheless.
    Remember that the whole idea of quantifying a Stream like you're doing (adding the content piece by piece to a vector) doesn't make much sense. You really don't have control over how much data arrives at once, etc. This usually depends on the implementation of the streams that are receiving and sending the data. So, while if I sent this string over a socket:
    "Hello brave new world"
    And received it with a large buffer, it could be read by your in.read() function in these pieces: "Hello ", "brave ", "new ", "world", but that would be completely coincidental. It's more likely it would arrive in random pieces, and most likely in one big piece, requiring only one in.read().
    Edited by: endasil on 22-Jul-2008 3:59 PM

Maybe you are looking for

  • Crystal Reports Cant Find the table

    Hello , I have a problem when i try to preview a report Crystal Reports says that cant find the table , it happend when add a table that in his name has an underscore example "SALES_REP" , im working with CR 2008 and open access ODBC driver. Can you

  • Using a PC laptop as a second display?

    Can anyone tell me a way of connecting up an iMac to a PC laptop so that the laptop acts as a second display? I'm running audio software and need to switch between edit windows all the time. I know you can get mini DVI to RGA adaptors, but im not sur

  • IPhone Calendar Appointment time syncing issue

    I have noticed lately that appointments I enter into my iCal on my Desktop when synced with my iPhone are showing up an hour later. For example: If I made an appointment from 9AM to 10AM it will (when synced) show up on my iPhone 10AM to 11AM. I am n

  • In PO, invoice tab, i have entered tax code, but the screen is not opening

    Hi Friends In PO, invoice tab, i have entered tax code, maintained FV11conditions,still i am not able to open the taxes when i click on taxes. please note that this is not related to taxinn. but in MIRO, the value is calculated & posted correctly. Ca

  • Qosmio G20-139: Using notebook screen to play on the Xbox360

    Hi I have a query about the monitor in function with the G20-139, I have an xbox 360 and want to know if there is a way of using the notebooks screen to play on the 360 either in High-Def or composite mode by using the monitor in function. With the n