Odd behaviour of "+" operator in numbers 09

Hello there,
One of the annoying "features" of numbers 08 was that a reference to an empty cell would always show up as a zero - this has been the topic of many posts in the past, and if Apple engineers don't know it by now, they must be living on Mars. Using numbers for accounting purposes, this "zero fill" of cells didn't stand nice and was unacceptable. I worked around this problem by pre-filling all cells with an empty quote formula (="") (instead of using the not-so-easy solution "IF(NOT(ISBLANK(..."). Of course, this filled up all cells in the entire spreadsheet with a small formula, but it worked fine and solved the issue - and I am having 500+ tables and 100+ sheets in my spreadsheet. Now however, in numbers 09, the "+" operator doesn't like these empty quotes, and all formulas involving the operator and an empty quote cell yield an error!! This makes my 79€ recent upgrade to numbers 09 completely useless. And frankly, I am astonished that Apple designers didn't notice this!
Here is an example:
Cell A1 contains =""
Cell A2 contains 3
In numbers 08, the formula =A1+A2 yields 3
In numbers 09 however the same formula yields an error!!
(and yes, all cells are formatted as numbers)
As far as I now by experimenting a little bit, the only way around is a replacement of the formula =A1+A2 by =SUM(A1;A2), which oddly enough does not give an error!
Or does anyone else have a better solution?
Am I perhaps missing a simple checkbox somewhere, at some place, hidden in some menu, that says
"Check me for numbers 08 + operator behaviour"
(I don't really expect that one, seriously!)
Regards,
Shane

As I already wrote in an other thread,
treating an empty cell as zero is correct.
treating a cell containing an empty string was accepted by Numbers '08 but was not conceptually satisfying.
So, even if I am annoyed by the change, I understand that the authors decided to the program's behavior.
I described a workaround based on the IF statement but from my point of view, the use of SUM is a better one because it will be kept if we save as iWork'08.
About this feature, I discovered an odd behavior.
You all know that I make a huge use of the short references.
=B+C for instance.
The export tool is unaware of that and uses the complete references:
=B12+C12
=B13+C13
what a pity
Yvan KOENIG (from FRANCE samedi 10 janvier 2009 20:53:08)

Similar Messages

  • Nokia 6233 v05.10 odd behaviour

    Hello!
    After thoroughly searching not only this board but the entire Internet, I found no answer to my question so I decided to register and ASK.
    I need to know if any of you owners of a Nokia 6233 observed this odd behaviour of your phone - so please keep reading.
    I purchased the phone 16 days ago. Being my first Nokia, I took time to exploit its every feature, therefore draining the battery quite quickly. I discharged and fully charged the battery at least 3 times in the first 3 days, without leaving it plugged-in overnight (as far as I know this is no longer necessary). The battery life time increased progressively until a maximum of three days of normal use, meaning moderate talking (under 20 minutes per day), little or no use of Java apps, camera, media players or GPRS/EDGE connection. The screen savers are off, power saver is on, sleep mode is on. Packet data connection - when needed and network mode is GSM only because I do not use 3G. All these should get me the best stand-by time possible, right? Well, they did, until...
    I bought a new microSD card, 2.0 GB storage, made by SanDisk. The card works fine, I put my favorite music and video clips on it - all the stuff you do when you have enough space. Since then, the battery life decreased SUBSTANTIALLY to LESS THAN 24 HOURS. And there's more. The battery drains even if the phone is turned off, in roughly the same amount of time. I have never ever seen anything like this. Sometimes the battery is so low that the phone takes a few minutes before displaying the battery charging icon and, when started, it asks for hour/date settings.
    So, I need to know if anybody else noticed battery life decrease with bigger memory card capacity, and what's to be done.

    Have you tried using the in-box memory card(That came with the phone) again? There's something wrong with your phone and battery if the problem still occurs..
    GooD LucKMessage Edited by nj15 on 15-Aug-200704:10 PM

  • Odd Behaviour with DVDs on IMac G5 20inch 1.8 GHz

    Suddenly the Superdrive DVD/CD (MATSHITA DVD-R UJ-825, Firmware DBN7) shows odd behaviour.
    It still reads CDs. But when a DVD is introduced, it will start "DVD Player" automatically, but then there is no hint of the disk. Neither does it show on the desktop, nore would it play. DVD Player would not eject it, but the eject button on the keyboard would.
    The DVD is ok, as it would play on my Powerbook G4 without problems.
    Any idea what might be causing this? - I had just performed the "Pro update"! Thanks for your help!
    iMac G5 20inch 1.8 GHz   Mac OS X (10.4.9)  

    Hve you checked to see whether a different DVD will play, Bernd?
    You might want to try deleting com.apple.DVDPlayer.plist from your Home/Library/Preferences folder, restarting and then seeing if it works.
    Cheers
    Rod

  • Podcast exhibiting odd behaviour with bluetooth

    Ever since updating to iOS6 / iPhone 5 i've been experiencing odd behaviour with music playback. Now that the Podcasts app is a requirement, i'm not sure if this is directly related to the Podcasts app or if it's an iOS 6 quirk.
    My iPhone connects to my car's stereo head unit via bluetooth. When i start my car it automatically connects and music, phone calls, etc, are all forwarded to my car's speakers. When i would switch my car off, music would stop automatically and i'd get out of my car and go about my day.
    Everything worked absolutely perfectly in iOS 5 with the 4S.
    The issue now with iOS6/iP5 is that when i switch off my car and use Siri or make a phone call, after i stop using Siri or if i end my call, the Podcasts app automatically resumes playback of what ever i was listening to when i switched my car off... Essentially it blasts music at me through the internal iPhone speaker for absolutely no reason.
    Here is a step by step,
    1. Start car
    2. Play music
    3. Turn off car
    4. Music automatically stops
    5. (while at the office, away from my car) Use siri or make a phone call
    6. When i end the call or stop using Siri, music automatically resumes via the iPhone internal speaker
    Is there any way to fix this?? It's getting quite annoying to have my iPhone blast me with music in fairly inappropriate situations.

    Disregard, there is a thread about it here: https://discussions.apple.com/thread/4346946?tstart=0
    Can't see any way of deleting my thread unfortunately.

  • WebDav: some odd behaviour

    I followed the tutorial at Tiger Vittles to set up one of my OS X machines to run as a webdav server. It went smoothly, and was easier than I expected, given I am not a pro or anything when it comes to computers. The amazing thing is it works. I can connect my PowerBook to it both on the local network and via the internet. The un-amazing thing, and probably expected (knowing me) is that it does not work as expected when connecting a Windows XP machine. It connects, mounts as a webfolder in Window's Network Places, however this is where the odd behaviour begins. Inside of the folder, along with the expected contents of that folder, there is a folder by the same name; open this and the contents of the folder are there, along with a folder with the same name. This can go on forever. I have searched high and low and have not been able to find a solution to this. This occurs only when connecting with Windows, otherwise with my PowerBook it works perfectly. I am hoping that someone can point me in the right direction. Additionally the Windows machine has connected to other WebDav folders without this issue. Finally, when there is a folder in a folder of the same name I am not able to map it as a network drive. Both the machine acting as the WebDav server and the Windows machine are running the most current versions of software.
    Regards,
    Ross

    figured it out

  • Can anyone explain the odd behaviour of the CVI Operator Interface?

    This is probably really related to CVI in general, but I think people should be aware of this behaviour. If tracing is enabled and a program executing, moving the mouse cursor over the Menu bar area of the Operator Interface program increases the execution of the test program dramatically. Anywhere else slows it down! Could this have any effect during critical test runs? Is there a way to force the fast execution. (i.e. to disable whatever message processing is going on when the mouse cursor is over the rest of the window?)

    Brian,
    You did not mention what is the CVI operator interface that you are using. In the Simple CVI OI, which is located at \Examples\OperatorInterfaces, the behavior you mentioned may occur.
    It is mainly because it uses a CVI timer to poll UIMessages, and the Timer Control runs in the same thread as the User Interface (CVI Panels). Because they both run in the same thread, when you move your mouse Windows handles the mouse move and repaint any window if necessary. While doing this, it stops all the other tasks that is running in the same thread, which means, the timer stops to tick and UIMessages are not handled for some time. In addition, the TestStand Engine executes synchronously with UIMessage handling, so if msg
    s are not handled the Engine pauses the execution.
    Finally, there is an example that ships with CVI under
    \Samples\Toolbox\AsyncDem.prj that shows how to use asynchronous timers. In other words, a timer that runs in a different thread different than User Interface. I also modified the Simple CVI OI to use this asynchronous timer, check the attached zip file.
    Regards,
    Roberto P.
    Applications Engineer
    National Instruments
    www.ni.com/support
    Attachments:
    Simple_CVIAsync.zip ‏176 KB

  • Odd Behaviour: Query and Table

    I have odd occurrences within my code and need an explanation
    to one and help with the other.
    First of all, I have a query within which I am using the
    group attribute, and then I am using a counter to control the
    behaviour of the output within a table. The problem is that when I
    use currentrow attribute with my query which returns seven fields
    with on of them being used for the grouping, the currentrow counter
    returns 1 through six for the non grouped fields, yet when I use a
    counter to count the rows and use a MODULUS operator to create a
    conditional statement, I get the right result with a MOD 7 rather
    than a MOD 6. Why is coldfusion counting seven fields (when I use
    the MOD operator) though currentrow counts 6? (Code is attached and
    numbered 1)
    Secondly, I am outputing the results of my query using two
    different tables as the information for the header is not easily
    included within my query. So I have two queries, one displaying the
    header and the other the query results.
    Now because they are related I wanted to align the two table
    one on top of the other (this was successful) my problem is that
    thought I define the same table with and subsequently the same with
    for respective fields in both tables (table width is 980 pixels
    with the first column being assigned 182 pixels and the rest of the
    columns being assigned 136 pixels each. However the output shows
    that the tables and the columns are not perfectly aligned and they
    do not have the same size (why is this when I have hard coded the
    width of the columns?). How do I get the two tables to align
    perfectly? (code for tables is numbers 2). TIA

    Go to SQ03. Check the Authorizations for both the user groups. Compare and based on the differences find out what is causing the error.
    SQ03 --> Enter user group ..> click Assign infoset to user group...
    Assign tht infoset to user BB.

  • Erratic behaviour map operation after table comparison

    BODI XIR2 11.7.3.6
    We want to detect and store changes in source data and store these changes in the target table.
    After the table comparison the row has got an update operation code flag and goes to a Map operation that converts Update row types to Normal and discards all other row types.
    normal -> discard
    update -> normal
    insert -> discard
    delete -> discard
    The map operation behaviour is erratic: sometimes the update row is mapped to normal and sometimes the update is discarded.

    I would be surprised if that is the case. You could run the dataflow in debug mode, 'cause there you can see the data and the OPCode flag of insert/update/delete after the TC transform.

  • Odd Behaviour of Sql*Loader

    Hi,
    I am facing a bit odd behavior in Sql*loader,when I am trying to upload data using Sql*Loader into multiple tables.control file looks like following.
    LOAD DATA
    INFILE "C:\WINDOWS\system32\multi112.txt"
    APPEND
    INTO TABLE EDI_BROADCAST_HEADER_1
    WHEN (1:4)='#10#'
    (tag_number "seq_edi_broadcast_header.nextval",
    processing_flag constant 'N'
    ,VIN POSITION (5:24) Char
    ,CSN_CHAR POSITION (26:35) Char
    ,OPERATION POSITION (37:46) Char
    ,PLANT POSITION (48:62) INTEGER EXTERNAL
    ,CHANNEL POSITION (64:78) Char
    INTO TABLE EDI_BROADCAST_BODY_1
    WHEN (1:4)='#20#'
    (tag_number "seq_edi_broadcast_body.nextval",
    Header_tag "seq_edi_broadcast_header.currval"
    ,FAMILY POSITION (5:19) Char
    ,NAME POSITION (21:45) Char
    ,VALUE POSITION (47:71) Char
    ,TYPE POSITION (73:78) Char
    ,QUANTITY POSITION (80:85) Char
    and data files contains 200 lines in the following format
    #10#6C218290 4132830 001 39395 SP14
    #20#.......
    #20#
    #10#6C218290 4132830 002 39395 SP14
    #20#.......
    #20#.......
    #10#6C218290 4132830 003 39395 SP14
    #20#.......
    #20#.......
    So problem is happening for sequences ,if I use
    sqlldr control=<controlfilename> userid=userid/pwd@conn
    Then sequences in detail table goes for a toss ,as per my analysis since rows parameter by default is 64,so header_tag in body table is changing after 64 records only.
    But in header table data is fine ,10 distinct sequences are inserted.
    If i use the following then
    sqlldr control=<controlfilename> userid=userid/pwd@conn rows=1
    sequences is fine in body table.
    So please let me know if its limitation of sql*loader or I am missing something.
    In case you need more information ,please let me know the same.
    Regards,
    SS

    You might ask your question in the Database-General-forum

  • Is there a re-calculate operation in Numbers?

    In working with a numbers spreadsheet that includes a Randbetween operation...I have a need to generate a new random number within the range. Is there a recalculate operation/command? I can't seem to put my finger on it...Excel uses a function key for the command(e.g. F5)...I have searched the help sections to no avail...
    KW

    KW,
    Almost anything you do will force a recalculation. If you just want to watch the random numbers change, you can format one cell to a check box. Every time you click the check box, you will get a recalculation and a new batch of random numbers.
    Jerry

  • ICal - odd behaviour

    Hi,
    Since upgrading to Lion I have had a real frustration with iCal.  In version 4.0 when you clcked on one event that was behind another (ie taking place at the same time in another calendar) that event came to the front.  This is no longer happening in iCal 5.0.  I have 8 calendars running in iCal both for home and work so many events are taking place at the same time.  I need to see what is going on without unckecking the other calendars that are "sitting on top" of the one I want to see.  Is this new behaviour standard or just a problem I have?
    Also, if necessary is there any way to go back to iCal 4.0 which worked fine - for me.
    Thanks

    Check out this discussion... http://discussions.apple.com/thread.jspa?threadID=250597&tstart=30
    not really a fix but at least its not just you.

  • Odd behaviour between 7920 and AIR-AP1231G-A-K9

    To start, I'm running an AIR-AP1231G-A-K9 (12.3(4)JA) with two 7920 phones (one at ) configured using LEAP.
    First issue:
    I originally had my ap interface Dot11Radio0 configured with:
    speed basic-1.0 basic-2.0 basic-5.5 basic-6.0 basic-9.0 basic-11.0 basic-12.0 basic-18.0 basic-24.0 basic-36.0 basic-48.0 basic-54.0
    but the phone didn't like this at all, so I changed the config to:
    speed basic-1.0 2.0 5.5 6.0 9.0 11.0 12.0 18.0 24.0 36.0 48.0 54.0
    and everything seems ok with the ap with the speed reconfig.
    Second issue:
    I had to remove broadcast-key vlan 200 change 300 because the phone would lose connection to the ap after 5 minutes and couldn't reconnect. I'm assuming the phone wasn't receiving the new key...
    Third Issue:
    Periodically the phone will drop off the associated ap after sucessful operation and return with Authentication Failed. We receive the message:
    Apr 29 12:45:40.661: Client 0013.1a4c.337b failed: Incorrect BSSID in re-assoc request
    Apr 29 12:45:55.830: Client 0013.1a4c.337b failed: Incorrect BSSID in re-assoc request
    on all the access points within range of the phone as the phone tries to reconnect. Periodically it will reassociate and get a message "Network Busy!!!"
    Any ideas on any of these issues?
    Thanks!
    Stephen

    For #1, 7920 is B only, so if you have G (OFDM) ratest set to mandatory then 7920 will not be able to associate. We recommend the following for a G radio as you want to optimize for 11mbps.
    interface dot11radio 0
    speed basic-11.0 18.0 24.0 36.0 48.0 54.0
    For #2, the 7920 does support broadcast vlan change, but ensure you are using wep ciphers not tkip/ckip.
    For #3, sounds like you are running 1.08 code on the 7920 where there is an issue w/ 12.3(4)JA AP code when trying to roam/reassociate. Look at CSCeg33605 at http://www.cisco.com/univercd/cc/td/doc/product/voice/c_ipphon/english/wip7920/relnotes/rn109.htm#wp112162. Need to upgrade to 1.09 code, which can be downloaded at http://www.cisco.com/cgi-bin/tablebuild.pl/ip-7900ser-crypto.

  • Updated Table Name Changes Applescript Operation in Numbers 3.5

    I've been using Applescript in Numbers for some time to copy/paste data (set cell values) from one sheet table to another sheet table.
    My original script was heavily cribbed from something Yvan Koenig had posted 2-3 years ago.
    I recently updated to Yosemite and Numbers 3.5 after testing to ensure my original script remained functional (and it did).
    I subsequently updated my source data table by duplicating my old table and editing this new source.
    I then updated my Applescript to to reference the new source table.
    Testing yielded a good functional result, but Numbers changed its behavior by displaying its work while setting values in the target sheet table.
    This obviously slows the script down and adds measurable processing time given the amount of data being moved.
    Does anyone know how I can prevent this behavior from occurring?
    I don't believe I changed anything material in my original script so I'm really not sure why Numbers changed its behavior.
    I have included my script below.  Thanks very much for any help!
    property the_goods : {}
    property patient_name : {}
    property patient_count : {}
    property run_date : {}
    on run
      set sheet_source to "1500 EXPORT"
      set table_source to "OA Data"
      set column_source to 1
      set row_source to 2
      set sheet_destination to "CLEARING HOUSE EXPORT"
      set table_destination to "Export Table"
      set column_destination to 1
      set nb_rows to 0
      set nb_columns to 244
      set patient_sheet to "SESSION DB"
      set patient_source to "User Input Table"
      set patient_tracker to "Tracking Table"
      set source_column to 3
      set source_row to 2
      set destination_column to 2
      set date_column to 3
      set patient_count_column to 3
      set patient_count_row to 3
      set run_date_row to 5
      tell application "Numbers"
      set document_source to name of front document as string
      set document_destination to name of front document as string
      end tell
      tell application "Numbers"
      tell document document_source to tell sheet patient_sheet to tell table patient_source
      set patient_count to value of cell patient_count_column of row patient_count_row
      set run_date to value of cell patient_count_column of row run_date_row
      end tell
      end tell
      set row_destination to patient_count
      tell application "Numbers"
      tell document document_source to tell sheet sheet_source to tell table table_source
      set the_goods to value of cells column_source thru (column_source + nb_columns) of rows row_source thru (row_source + nb_rows)
      end tell
      tell document document_destination to tell sheet sheet_destination to tell table table_destination
      set r to 0
      repeat with one_row in the_goods
      tell row (row_destination + r)
      set c to 0
      repeat with one_value in one_row
      set value of cell (column_destination + c - 0) to one_value
      set c to c + 1
      end repeat
      end tell
      set r to r + 1
      end repeat
      end tell
      tell document document_destination to tell sheet patient_sheet to tell table patient_source
      activate
      end tell
      tell document document_destination to tell sheet patient_sheet to tell table patient_source
      set patient_name to value of cell source_column of row source_row
      end tell
      tell document document_destination to tell sheet patient_sheet to tell table patient_tracker
      set value of cell destination_column of row row_destination to patient_name
      set value of cell date_column of row row_destination to run_date
      end tell
      end tell
      set the_goods to {}
      set patient_name to {}
      set patient_count to {}
      set run_date to {}
    end run

    Here is a simple example that copies values from a source row 3 in Table 1 to a target row 5 in Table 2.
    On my aging MBA it was very fast (about a second) with 150 columns.
    In addition to speed, an advantage of this approach is that you don't have to code table dimensions;  the target table will expand automatically if needed.
    Save the script in a script folder (in my case ~/Library/Scripts/Applications/Numbers) and run it from there by choosing it from the script menu. (Running it from Script Editor will paste the values into Script Editor instead of into Numbers as you want).
    If keeping the original number format is important, substitute 'formatted value'  for 'value' in the script.
    SG
    property src : {d:1, s:"Sheet 1", t:"Table 1", r:3}
    property tgt : {d:1, s:1, t:"Table 2", r:5}
    tell application "Numbers"
      tell document (src's d)
      tell sheet (src's s)
      tell table (src's t)
      tell row (src's r)
      set vv to cells's value -- makes AppleScript list
      set the clipboard to my makeTSV(vv)
      end tell
      end tell
      end tell
      end tell
      tell document (tgt's d)
      tell sheet (tgt's s)
      tell table (tgt's t)
      set the selection range to row (tgt's r)'s cell 1
      tell application "Numbers" to activate
      tell application "System Events" to keystroke "v" using {option down, shift down, command down}
      end tell
      end tell
      end tell
    end tell
    to makeTSV(aLst) -- turns AppleScript list into tab-delimited string
      set oTID to AppleScript's text item delimiters
      set AppleScript's text item delimiters to tab
      set tsvStr to aLst as text
      set AppleScript's text item delimiters to oTID
      return tsvStr
    end makeTSV

  • Odd behaviour appending to System.out PrintStream

    I've run into some unexpected behaviour with the System.out PrintStream object. When I append characters to it I'm expecting the characters to be displayed on screen much like I'd expect the characters to be written to a file using a FileOutputStream. What seems to happen is that the characters are written to the PrintStream but the process continues on and on adding some unseen character (newline?). The following code generates the behaviour I"m talking about. The main method is a bit contrived but does the job. You'll likely have to increase your heap size to run this (-Xmx512m worked for me):
    {code}
    package output.stream.problem;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.io.Reader;
    import java.io.StringReader;
    import java.util.HashMap;
    import java.util.Random;
    * A class used to introduce transition/transversion errors into DNA sequences. Error types are introduced
    * with equal probability and are mutually exclusive.
    * @author twb
    public class GenomicDNAMutator {
         private HashMap<Integer,Character> mutations=new HashMap<Integer,Character>();
         private Reader sequenceSource;
         private Random rand=new Random();
         private double errorRate=-1;
         public GenomicDNAMutator(String fileName, double errorProbability) {
              try {
                   sequenceSource=new FileReader(fileName);
                   errorRate=errorProbability;
              } catch (FileNotFoundException fnfe) {
                   System.err.println("Could not open file "+fileName);
                   fnfe.printStackTrace();
         public GenomicDNAMutator(File file, double errorProbability) {
              try {
                   sequenceSource=new FileReader(file);
                   errorRate=errorProbability;
              } catch (FileNotFoundException fnfe) {
                   System.err.println("Could not open file "+file);
                   fnfe.printStackTrace();
         public GenomicDNAMutator(Reader is, double errorProbability) {
              sequenceSource=is;
              errorRate=errorProbability;
         public void process() {
              this.process(System.out);
         public void process(OutputStream os) {
              BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(os));
              BufferedReader br=new BufferedReader(this.sequenceSource);
              char nucleotide;
              char[] a=new char[]{'T','C','G'};
              char[] t=new char[]{'A','C','G'};
              char[] c=new char[]{'A','T','G'};
              char[] g=new char[]{'A','T','C'};
              char[][] errorMatrix=new char[][]{a,t,c,g};
              int matrixIndex=-1;
              try {
                   int count=0;
                   int i=0;
                   while((i=br.read())!=-1) {
                        nucleotide=(char)i;
                        count++;
                        double d=rand.nextDouble();
                        if(d<=this.errorRate) {
                             switch(nucleotide) {
                             case 'A':
                                  matrixIndex=0;
                                  break;
                             case 'T':
                                  matrixIndex=1;
                                  break;
                             case 'C':
                                  matrixIndex=2;
                                  break;
                             case 'G':
                                  matrixIndex=3;
                                  break;
                             int pos=rand.nextInt(3);
                             this.mutations.put(count,nucleotide);
                             nucleotide=errorMatrix[matrixIndex][pos];
                        bw.append(nucleotide);
                   bw.flush();
                   bw.close();
              } catch (IOException ioe) {
                   System.err.println("Could not read the input source");
         public Reader getIn() {
              return sequenceSource;
         public void setSequenceSource(Reader in) {
              this.sequenceSource = in;
         public static void main(String[] args) throws Exception {
              StringBuilder sb=new StringBuilder();
              for(int i=0;i<30000000;i++) {
                   sb.append('A');
              System.out.println("Mock sequence built");
              GenomicDNAMutator gdm=new GenomicDNAMutator(new StringReader(sb.toString()),1d/100d);
              * Run the program using one of the process statements
              gdm.process(new FileOutputStream(new File("c:/text.txt")));
    //This one uses the System.out PrintStream object
    //          gdm.process();
              System.out.println("done");
    {code}
    I see this behaviour with java 1.6.0_10-beta and java 1.5.0_11
    Thanks for any insight you can give to this.
    - Travis

    twb wrote:
    I've run into some unexpected behaviour with the System.out PrintStream object. When I append characters to it I'm expecting the characters to be displayed on screen much like I'd expect the characters to be written to a file using a FileOutputStream. What seems to happen is that the characters are written to the PrintStream but the process continues on and on adding some unseen character (newline?). The following code generates the behaviour I"m talking about. The main method is a bit contrived but does the job. You'll likely have to increase your heap size to run this (-Xmx512m worked for me):Yes, this is the case. If you look at the javadoc for PrintStream it talks about the "auto-flush on newline" feature. what is your question?

  • URLClassLoader odd behaviour

    Hi,
    I'm having a bit of a problem loading a jar at runtime using a URLClassLoader. Here's the details:
    1. Trying to load dom4j-1.6.1.jar
    2. Everything works fine if I include the jar in the CLASSPATH but throws an error if I try to load it with URLClassLoader
    3. I am loading a number of jars from the same directory. It's the basic plugin idea. This setup is working for a couple of things I've already written
    4. crtiSoomosPlugin.jar depends on dom4j-1.6.1.jar. On start up I call the following code     
    URL[] urlArray = urls.toArray(new URL[urls.size()]);
    loader=new URLClassLoader(urlArray);
    where urlArray contains the URLs of the jars to be loaded. To load the classes I iterate through the files in the jar that end in .class and call
    Class c=loader.loadClass(className);
    5. if crtiSoomosPlugin.jar is loaded using the URLClassLoader and dom4j is in the CLASSPATH all is fine but if dom4j is loaded by the URLClassLoader along with crtiSoomosPlugin.jar the following error is thrown when I call loader.loadClass() on a .class file that depends on dom4j:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/msv/datatype/SerializationContext
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:620)
         at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at ca.aafc.crc.SOOMOS.loadPluginsFromJar(SOOMOS.java:915)
         at ca.aafc.crc.SOOMOS.loadPluginsFromDir(SOOMOS.java:888)
         at ca.aafc.crc.SOOMOS.loadPlugins(SOOMOS.java:856)
         at ca.aafc.crc.SOOMOS.<init>(SOOMOS.java:236)
         at ca.aafc.crc.SOOMOS.main(SOOMOS.java:129)
    The odd thing is, com/sun/msv/datatype/SerializationContext is not in any jar in my classpath!
    Any help would be appreciated. I'm really curious to know what I'm not understanding about all of this. Thanks
    - T

    I'm having a bit of a problem loading a jar at
    runtime using a URLClassLoader. Here's the details:
    1. Trying to load dom4j-1.6.1.jar
    2. Everything works fine if I include the jar in the
    CLASSPATH but throws an error if I try to load it
    with URLClassLoaderThe first works because the system loader loads it.
    The error is pretty clear - it isn't finding the class.
    3. I am loading a number of jars from the same
    directory. The class loader loads classes not jars.
    To load the classes I iterate through the
    files in the jar that end in .class and call
    Class c=loader.loadClass(className);Presumably you are doing this to test? Because it won't have any impact otherwise.
    >
    The odd thing is,
    com/sun/msv/datatype/SerializationContext is not in
    any jar in my classpath!
    Any help would be appreciated. I'm really curious to
    know what I'm not understanding about all of this.com/sun means it is part of the internal Sun VM. And there are only two ways that I can think of that it would show up like that.
    1. You overrode one of the methods in URLClassLoader incorrectly.
    2. The libraries you are loading depend on a specific VM version and you are not running that version.

Maybe you are looking for