BufferedReader Problem (inserting space after every character)

(This is a message I sent to an Aglet forum, however I thought maybe someone here could help me with the BufferedReader problem...with the spacing...read below)
-Blake
ok here's what I'm attempting to do.
I have a Master Aglet that creates a slave which is dispatched to a remote site. The Slave then opens a log file, reads it, and then is supposed to read the file line by line and send each line as a message back to the Master. As the master receives each line it appends the line to the window it created earlier.
I don't know what the problem is...it won't display the log file in the master window.
It does display each line on the console window.I added a println() function to make sure the String array was getting the information. There is a small problem with that as well because it inserts a space after EVERY character (BufferedReader problem??)...what is up with that? for example:
If the log file looked like: This is a log file entry.
the console looks like this when it is printed: T h i s i s a l o g f i l e e n t r y .
.... I had done something in a similiar program...and it worked just fine. here's some source code:
<b>Master:</b>
else if (msg.sameKind("Log")) {
try {
//println for testing purposes
System.out.println(msg.getArg());
appendMessage(" " + msg.getArg() + "test \n");
} catch (Exception e) {
System.out.println(e.toString());
<b>Slave: </b>
File log = new File("C:\\Aglets2.0.2\\public\\WINDOWSUPDATE.log");
FileReader fr = null;
try{
fr = new FileReader(log);
} catch (FileNotFoundException e) {
System.out.println(e);
BufferedReader br = new BufferedReader(fr);
//Get filename of log
try {
Message msg = new Message("FileName", log.getName());
mProxy.sendOnewayMessage(msg);
} catch (InvalidAgletException iae) {
System.out.println(iae.toString());
} catch (Exception e) {
System.out.println(e.toString());
//read each line of file and send back to Master as a message
try{
int i = 0;
while ((s = br.readLine()) != null) {
i++;
count = i;
for (int j = 0; j < count; j++)
System.out.println(s[j]);
//send message back to Master Aglet with log file information
try {
Message msg = new Message("Log", s[j]);
mProxy.sendMessage(msg);
} catch (InvalidAgletException iae) {
System.out.println(iae.toString());
} catch (Exception e) {
System.out.println(e.toString());
//close file reader
fr.close();
} catch (IOException e) {
System.out.println(e.toString());
}

actually i did declare s, you just don't see it there because i only posted some of the code....
I fixed the "spacey" problem by using a FileInputStream instead of a bufferedreader....
like this (i'll post the whole code here:
public class Slave extends BlindAglet {
    AgletProxy mProxy = null;
    boolean back = false;
        char[] c = new char[1000];
    BufferedReader br = null;
    int count;
    // Do some tasks when the aglet is created
    public void onCreation(Object init) {
        // Must make a note of the master here
        mProxy = (AgletProxy)init;       
        // Add our own listener and adapter
        addMobilityListener(
            new MobilityAdapter() {
                // Using this as a safety check in case we get caught in a loop in the same host
                public void onArrival(MobilityEvent event) {                   
                    try {
                        mProxy.sendMessage(new Message("NewSlaveProxy", getAgletContext().getAgletProxy(getAgletID())));                                                            
                    } catch (InvalidAgletException iae) {
                        System.out.println(iae);
                    } catch (NotHandledException ex) {
                        System.out.println(ex);
                    } catch (MessageException ex) {
                        System.out.println(ex);
                    //Are we back to origin?
                        if(back) {         
                             back = false;     
                            try{
                                 FileWriter fw = new FileWriter("test.txt");                                                                  
                             for (int i = 0; i < count; i += 2){ 
                                       fw.write(c);
                         fw.close();
                    } catch (IOException e) {
                              System.out.println(e);
                              dispose();
                         dispose();
); /* End of Adapter */
public void run() {
     // Are we at home base?
if (atHome()) {
try {
dispatch(new URL("atp://darklord:4434"));
} catch (Exception e) {
System.out.println(e.toString());
     try{
     File log = new File("C:\\Aglets2.0.2\\public\\WINDOWSUPDATE.log");
     FileInputStream f0 = new FileInputStream(log);
//Get filename of log
try {
     System.out.println(log.getName());
Message msg = new Message("FileName", log.getName());
mProxy.sendOnewayMessage(msg);
} catch (InvalidAgletException iae) {
System.out.println(iae.toString());
} catch (Exception e) {
System.out.println(e.toString());
          //read each line of file and send back to Master as a message
          try{               
     int size = f0.available();
     int i = 0;
     for (i = 0; i < size; i++) {
          c[i] = (char) f0.read();
//send message back to Master Aglet with log file information
                         try {
                    Message msg = new Message("Log", c[i]);
                    mProxy.sendOnewayMessage(msg);
          } catch (InvalidAgletException iae) {
                         System.out.println(iae.toString());
                    } catch (Exception e) {
                         System.out.println(e.toString());
count = i;
          } catch (IOException e) {
               System.out.println(e.toString());
               } catch (FileNotFoundException e) {
               System.out.println(e);
     back = true;      
     returnHome();
* Returns true if the current host is our origin
public boolean atHome() {
if (getAgletInfo().getOrigin().equals(getAgletContext().getHostingURL().toString()))
return true;
else
return false;
* Allows a slave to contact it's master and ask for a retraction.
public void returnHome() {
try {
Message msg = new Message("RetractMe");
msg.setArg("url", getAgletContext().getHostingURL());
msg.setArg("id", getAgletID());
mProxy.sendOnewayMessage(msg);
} catch (InvalidAgletException iae) {
System.out.println(iae.toString());
} catch (Exception e) {
System.out.println(e.toString());
* Return a reference to our Master's proxy
public AgletProxy getMasterProxy() {
return mProxy;
} /* End of Class

Similar Messages

  • DG4ODBC adds black spaces after every character

    I am trying to set up HS using Oracle 10.2.0.5 on RHEL5 (64 bit), FreeTDS, and MS SQL Server.
    The ODBC Driver works fine:
    [oracle@phsbe1pr ~]$ isql sfasql_freetds_dsn sqlSinfoOne ***
    | Connected! |
    | |
    | sql-statement |
    | help [tablename] |
    | quit |
    | |
    SQL> select name, len( name ) from sys.objects where object_id < 20 ;
    ---------------------------------------------------------------------------------------------------------------------------------------------+
    | name | |
    ---------------------------------------------------------------------------------------------------------------------------------------------+
    | sysrscols | 9 |
    | sysrowsets | 10 |
    | sysallocunits | 13 |
    | sysfiles1 | 9 |
    | syspriorities | 13 |
    | sysfgfrag | 9 |
    ---------------------------------------------------------------------------------------------------------------------------------------------+
    SQLRowCount returns 6
    6 rows fetched
    SQL> quit
    [oracle@phsbe1pr ~]$
    [oracle@phsbe1pr ~]$ tsql -S SFASQL_FreeTDSName -U sqlSinfoOne -P ***
    locale is "en_US.UTF-8"
    locale charset is "UTF-8"
    using default charset "UTF-8"
    1> select name, len( name ) from sys.objects where object_id < 20
    2> order by 1
    3> go
    name
    sysallocunits 13
    sysfgfrag 9
    sysfiles1 9
    syspriorities 13
    sysrowsets 10
    sysrscols 9
    (6 rows affected)
    1> exit
    [oracle@phsbe1pr ~]$
    But when I use the dblink i got every string doubled with spaces after every char:
    [oracle@phsbe1pr ~]$ sqlplus / as sysdba
    SQL*Plus: Release 10.2.0.5.0 - Production on Mon Jul 23 17:22:25 2012
    Copyright (c) 1982, 2010, Oracle. All Rights Reserved.
    Connected to:
    Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing options
    SQL> set linesize 120
    SQL> column name format a40
    SQL> select "name", length ( "name" )
    2 from sys.objects@sfasql_link
    3 where "object_id" < 20
    4 order by 1
    5 /
    name LENGTH("NAME")
    s y s a l l o c u n i t s 26
    s y s f g f r a g 18
    s y s f i l e s 1 18
    s y s p r i o r i t i e s 26
    s y s r o w s e t s 20
    s y s r s c o l s 18
    6 rows selected.
    SQL>
    What can I do ?
    Mi init.ora is:
    HS_FDS_CONNECT_INFO = SFASQL_DSN
    HS_FDS_SHAREABLE_NAME = /usr/lib64/libodbc.so
    HS_FDS_TRACE_LEVEL = off
    HS_FDS_TRACE_FILE_NAME=/tmp/odbc_hs_sfa.trc
    HS_FDS_SQLLEN_INTERPRETATION = 32
    set ODBCINI=/etc/odbc.ini
    adn odbc.ini contains:
    [SFASQL_DSN]
    Description = sqlserver
    Driver = FreeTDS
    # Servername = SFASQL_FreeTDSName
    Server = phsspbe.perfumeholding.intra
    Address = 172.17.0.45
    Port = 1433
    Database = SFA_INTERSCAMBIO
    TDS_Version = 8.0
    Language = us_english
    TextSize = 1999
    PacketSize = 1470
    ClientCharset = ISO-8859-1
    DumpFile = /tmp/odbc_sfasql_dsn.log
    DumpFileAppend = Yes
    DebugFlags =
    Encryption = off
    #Trace = Yes
    #TraceFile = /tmp/odbc_sfasql_dsn.trc
    Thank you for every answer!
    Andrea

    1. Please add to the gateway init file HS_NLS_NCHAR=UCS2
    Then test again with a new SQL*Plus session.
    When it continues to fail, what's the character set of the Oracle database being used and how did you set the NLS_LANG in your environment?

  • How can I stop Dreamweaver from inserting spaces after variables?

    How can I stop Dreamweaver from inserting spaces after
    variables?
    Example:
    "...write to you@<!--#echo var="uu" --> and ..."
    is changed by DreamWeaver to
    "...write to you@
    <!--#echo var="uu" -->
    and...>
    When saving or doing other editing, DreamWeaver adds a space
    and a line break before and after the variable. The line break
    isn't hard and doesn't show, but the spaces added before and after
    the variable DO show in browsers. That looks rather stupid and
    incompetent, and requires hand editing on the server after
    uploading.
    Line wrap and code formatting are turned off.
    Is manual correction after uploading the only solution to
    this problem?
    Thanks
    DearWebby

    DearWebby,
    We already discussed this offline, but I want to post the fix
    here for
    the sake of posterity:
    1. Edit > Tag Libraries…
    2. Open HTML Tags folder
    3. Select "directive" folder icon (not really a folder)
    4. Change Line breaks: setting to "No line breaks"
    5. Click OK
    HTH,
    Randy
    > How can I stop Dreamweaver from inserting spaces after
    variables?
    >
    > Example:
    > "...write to you@<!--#echo var="uu" --> and ..."
    > is changed by DreamWeaver to
    > "...write to you@
    > <!--#echo var="uu" -->
    > and...>
    >
    > When saving or doing other editing, DreamWeaver adds a
    space and a line break
    > before and after the variable. The line break isn't hard
    and doesn't show, but
    > the spaces added before and after the variable DO show
    in browsers. That looks
    > rather stupid and incompetent, and requires hand editing
    on the server after
    > uploading.
    >
    > Line wrap and code formatting are turned off.

  • In insert: Space after period and before carriage return is being ignored

    I am using Oracle 11.2.0.2.
    let say I create table temp(a varchar2(20);
    insert into temp values ('value.
    valuue2');
    I have put space after 'value. ' but it is being ignore when I run it from linux host in sqlplus.
    The space seems to be preserved when I insert it from TOAD/Windows xp.
    Any idea what might be causing it.

    hI,
    I have the same result in SQLPLUS.
    I would not rely on code with strings spread over multiple lines you should use the below code to add newlines:
    insert into temp values ('Yes.Space. ' || chr(10) || 'x');This makes it very clear there is and a space and a newline.
    This is much easier to maintain as well.
    Just to compair the two, see below:
    select
      LEVEL
      ,substr(a ,level,1)
      ,ASCII( substr(a ,level,1) )
    from
    SELECT
    'YES.Space.
    x' A
    FROM
      DUAL
    connect by --NOCYCLE
      level <= length(a)
    LEVEL SUBSTR(A,LEVEL,1) ASCII(SUBSTR(A,LEVEL,1))
        1 Y                                       89
        2 E                                       69
        3 S                                       83
        4 .                                       46
        5 S                                       83
        6 p                                      112
        7 a                                       97
        8 c                                       99
        9 e                                      101
       10 .                                       46
       11                                         32
       12                                          10
       13 x                                      120
    13 rows selected
    select
      LEVEL
      ,substr(a ,level,1)
      ,ASCII( substr(a ,level,1) )
    from
    SELECT
    'Yes.Space. ' || chr(10) || 'x' a
    FROM
      DUAL
    connect by --NOCYCLE
      level <= length(a)
    LEVEL SUBSTR(A,LEVEL,1) ASCII(SUBSTR(A,LEVEL,1))
        1 Y                                       89
        2 e                                      101
        3 s                                      115
        4 .                                       46
        5 S                                       83
        6 p                                      112
        7 a                                       97
        8 c                                       99
        9 e                                      101
       10 .                                       46
       11                                         32
       12                                          10
       13 x                                      120
    13 rows selected Regards,
    Peter
    Edited by: Peter vd Zwan on Apr 19, 2012 1:06 PM

  • How do I "space after" every other line?

    I am trying to set up a listing of names and dollars like this...
    name
    dollar amount
    name
    dollar amount
    name
    dollar amount
    name
    dollar amount
    After the dollar amount I need to it have a space of 0.625, I am creating this list as text which I have converted from a table. Right now I have to just click on the line a and manual hit the "space After" option to put the 0.625 spacing in there. Is there a way to do this all at once because there will be at least 300 names every time I do this? So i need to be able to have the spacing on every other line...
    Thanks,
    Sam

    I use a body text style with Space Before and have a Bullets_FirstLine style with space before. I have the Next Style of BulletsFirstLine as as Bullets, which does not have any Space Before. This means that I can automatically apply the styles to the bullets when either typing directly or, more frequenty by highlighting all the paragraphs to be bulleted and right clicking on BulletsFirstLine and selecting "Apply Style then Next Style". I cannot remember the exact wording - I don't have InDesign open at the moment.

  • Pause after every character typed into title text

    Typing text into title delays for 3 seconds after each character typed.
    The best work around I found was to type the text into textedit and paste once done.
    Any other suggestions?

    Is 4 the maximum number of characters that can be entered?
    Then the solution is easy:
    - set the maximum lenght property of the item to '4'
    - set the automatic skip property to 'YES'
    I hope this helps...

  • Problems with mail after every shutdown

    I posted a few days ago when mail kept crashing following the security update (probably due to me not closing all applications before installing).
    I managed to get mail working again by resetting the junk mail filter.
    However, since then I have had problems with mail every time I restart my computer. Every morning, it mail crashes when I open it. I have fixed it a few times by quickly deleting select messages from my inbox before it crashes, but today I can't even do that. Resetting junk mail filter doesn't seem to work now. It's weird because once I get mail open I can close/open with no problem. I only have problems again after I have shutdown the computer.
    I verified the start up disk and permissions - there were no problems there - and I also checked for corrupted fonts (I have been reading all the suggestions posted on this site to people having similar problems).
    The console log reads:
    Jun 1 09:40:34 su-pwbk crashdump[218]: Mail crashed
    Jun 1 09:40:34 su-pwbk crashdump[218]: crash report written to: /Users/shancock/Library/Logs/CrashReporter/Mail.crash.log
    And the crash report reads:
    Date/Time: 2007-06-01 09:53:53.492 -0700
    OS Version: 10.4.9 (Build 8P135)
    Report Version: 4
    Command: Mail
    Path: /Applications/Mail.app/Contents/MacOS/Mail
    Parent: WindowServer [61]
    Version: 2.1 (752)
    Build Version: 1
    Project Name: MailViewer
    Source Version: 7520000
    PID: 221
    Thread: 3
    Exception: EXCBADINSTRUCTION (0x0002)
    Code[0]: 0x00000002
    Code[1]: 0x9a397784
    Thread 0:
    0 libSystem.B.dylib 0x9000b448 machmsgtrap + 8
    1 libSystem.B.dylib 0x9000b39c mach_msg + 60
    2 com.apple.CoreFoundation 0x907deba8 __CFRunLoopRun + 832
    3 com.apple.CoreFoundation 0x907de4ac CFRunLoopRunSpecific + 268
    4 com.apple.HIToolbox 0x9329bb20 RunCurrentEventLoopInMode + 264
    5 com.apple.HIToolbox 0x9329b1b4 ReceiveNextEventCommon + 380
    6 com.apple.HIToolbox 0x9329b020 BlockUntilNextEventMatchingListInMode + 96
    7 com.apple.AppKit 0x93780ae4 _DPSNextEvent + 384
    8 com.apple.AppKit 0x937807a8 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 116
    9 com.apple.AppKit 0x9377ccec -[NSApplication run] + 472
    10 com.apple.AppKit 0x9386d87c NSApplicationMain + 452
    11 com.apple.mail 0x000871d8 0x1000 + 549336
    12 com.apple.mail 0x00087080 0x1000 + 548992
    Thread 1:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90055204 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c625d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c624f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a2b9d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 2:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90055204 pthreadcondtimedwait + 676
    2 com.apple.Foundation 0x92c625d4 FCONDITION_WAITTIMEOUT + 144
    3 com.apple.Foundation 0x92c624f0 -[NSConditionLock lockWhenCondition:beforeDate:] + 128
    4 com.apple.MessageFramework 0x9a2b9d90 -[InvocationQueue _drainQueue] + 176
    5 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    6 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 3 Crashed:
    0 com.apple.MessageFramework 0x9a397784 -[ABAddressBook(MailAdditions) _bestRecordMatchingFormattedAddress:inSubscribedContent:] + 0
    1 com.apple.MessageFramework 0x9a2dc7f0 -[ABAddressBook(MailAdditions) bestRecordMatchingFormattedAddress:] + 44
    2 com.apple.MessageFramework 0x9a2dc6c8 -[MailAddressManager bestRecordMatchingFormattedAddress:] + 184
    3 com.apple.mail 0x00040ee0 0x1000 + 261856
    4 com.apple.mail 0x00037014 0x1000 + 221204
    5 libobjc.A.dylib 0x90a461f4 objc_msgSendv + 180
    6 com.apple.Foundation 0x92bdec94 -[NSInvocation invoke] + 944
    7 com.apple.MessageFramework 0x9a2b0800 -[MonitoredInvocation invoke] + 144
    8 com.apple.MessageFramework 0x9a2b9e80 -[InvocationQueue _drainQueue] + 416
    9 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    10 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 4:
    0 libSystem.B.dylib 0x900553a8 semaphoretimedwait_signaltrap + 8
    1 libSystem.B.dylib 0x90071be8 pthreadcond_timedwait_relativenp + 556
    2 ...apple.AddressBook.framework 0x94e35cac -[ABRemoteImageLoader workLoop] + 132
    3 com.apple.Foundation 0x92be31a0 forkThreadForFunction + 108
    4 libSystem.B.dylib 0x9002be08 pthreadbody + 96
    Thread 3 crashed with PPC Thread State 64:
    srr0: 0x000000009a397784 srr1: 0x000000000008f030 vrsave: 0x0000000000000000
    cr: 0x24000248 xer: 0x0000000020000004 lr: 0x000000009a2dc7f0 ctr: 0x000000009a397784
    r0: 0x000000009a2dc7f0 r1: 0x00000000f0202ef0 r2: 0x00000000a0001fac r3: 0x0000000004a00490
    r4: 0x000000009a3ec540 r5: 0x0000000004a5cac0 r6: 0x0000000000000000 r7: 0x000000006e636f63
    r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x0000000090a3f628 r11: 0x0000000000000001
    r12: 0x000000009a397784 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000000
    r16: 0x0000000000000000 r17: 0x0000000000000000 r18: 0x00000000001b0000 r19: 0x0000000004a229a0
    r20: 0x0000000000000002 r21: 0x0000000000000000 r22: 0x0000000004a2f110 r23: 0x00000000001b0000
    r24: 0x0000000000000000 r25: 0x0000000000000000 r26: 0x0000000000000000 r27: 0x0000000004a5cac0
    r28: 0x0000000004a5cac0 r29: 0x0000000004a00490 r30: 0x00000000aa2b5048 r31: 0x000000009a2dc610
    Model: PowerBook5,2, BootROM 4.7.1f1, 1 processors, PowerPC G4 (1.1), 1 GHz, 768 MB
    Graphics: ATI Mobility Radeon 9600, ATY,RV350M10, AGP, 64 MB
    Memory Module: SODIMM0/J25LOWER, 256 MB, DDR SDRAM, PC2700U-25330
    Memory Module: SODIMM1/J25UPPER, 512 MB, DDR SDRAM, PC2700U-25330
    Modem: LastDash, Euro, V.92, 4.0, APPLE VERSION 2.6.6
    Bluetooth: Version 1.7.14f14, 2 service, 0 devices, 1 incoming serial ports
    Network Service: Built-in Ethernet, Ethernet, en0
    PCI Card: TXN,PCIXXXX-00, cardbus, PC Card
    Parallel ATA Device: MATSHITACD-RW CW-8123
    Parallel ATA Device: TOSHIBA MK6026GAX, 55.89 GB
    USB Device: Bluetooth HCI, Up to 12 Mb/sec, 500 mA
    USB Device: Microsoft 3-Button Mouse with IntelliEye(TM), Microsoft, Up to 1.5 Mb/sec, 500 mA
    Would greatly appreciate a more permanant fix to this problem!
    Thanks, Su
    PowerBook5,2   Mac OS X (10.4.9)  

    As I said in the other thread, in your case Mail was crashing because of a problem with Address Book, so it should be no surprise that resetting the junk filter didn’t really fix the problem. It would have been more appropriate to post back there instead of starting a new thread...
    If Address Book itself works fine, the problem is probably the Previous Recipients list that Mail stores in the Address Book database. If you can do this without Mail crashing, in Mail open Window > Previous Recipients and remove all the entries from there.
    If that doesn’t work, you’ll have to re-create the entire Address Book database:
    1. If you have a .Mac account and .Mac synchronization of Address Book data is enabled either in Address Book > Preferences > General or in System Preferences > .Mac, disable it before proceeding.
    2. You may also need to reset the entire sync history (iSync > Preferences > Reset Sync History) to avoid synchronization issues if you use .Mac or iSync to synchronize your Address Book with other computers or devices.
    3. Open Address Book.
    4. As an extra safety measure, do File > Back up Address Book and save the backup wherever you wish.
    5. Go to Address Book > Preferences > vCard, set the vCard Format to 3.0 and check Export notes in vCards. Close the Preferences window when done.
    6. Select the All group in the main Address Book window and do File > Export Group vCard (the command should read “Export Group vCard”, not just “Export vCard”).
    7. Quit Address Book, Mail, and any other applications that might use Address Book for something. Or just quit all applications to be on the safe side.
    8. In the Finder, go to ~/Library/Application Support/ and move the entire AddressBook folder out of there, e.g. to the Desktop (to be deleted after fixing the problem and making sure you don’t miss anything).
    9. Check whether the problem is fixed now. If it is, you may be able to restore your contacts without the problem happening again by opening Address Book and doing File > Import > vCards to import the previously exported cards back into Address Book.
    10. If the problem has been fixed and .Mac synchronization of Address Book data was enabled at the beginning, enable it again, go to System Preferences > .Mac > Advanced, click Reset Sync Data, and choose the appropriate options to reset the Address Book data stored on the .Mac server with the data locally stored on the computer, i.e. sync data must flow from the computer to the .Mac server.
    Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.

  • Problem inserting records after execution of server side code

    Hello,
    I've created a server-side function for duplicating a master record and it's details. This function has two input parameters that define the new unique key of the master record. Because the user has to supply the new unique key, there is a possibility that the unique key already exists.
    The server-side function is being called from a form module. This form module contains all the code needed for opening / closing and aborting the HSD transaction. The form also enables users to add new master records manually.
    If the server-side function is called from within the module there are two possible outcomes:
    1, the unique key already exists and the HSD error message window is displayed.
    2, the unique key does not exist and the records get duplicated.
    If I try to add a new master record in the form after a failed duplication process, I get a form message informing me that NULL cannot be inserted into the ID column. (The primary key.) BTW updates work just fine. However, if I call the server-side function again and the duplication process is succesfull, I can again insert a new master record in the form succesfully.
    I'm assuming that this problem has something to do with the TAPI package because I use TAPI insert calls to insert the master / detail records when duplicating. A workaround for this problem is (obviously) to check if the supplied unique key already exists in the database before calling the server-side function.
    I however am concerned a bit because a lot of program functionality has been implemented in server-side functions and procedures. So I would like to know if anyone has had the same problems and possibly knows if there is a generic solution to this problem.
    Greetings,
    Marco.

    Marco,
    Can you make a test case for me and send it to me? It looks like we might have a bug and I would like to investigate.
    Regards,
    Lauri
    [email protected]

  • Why RandomAccessFile inserts space before each character while writing?

    Ater running the following code, the file test.txt contain:
    a b c d e f g h i j k l m n o p q r s t u v w x y z
    Why writeChars() inserted a space before each charecter?
    How to avoid this unwanted insertion?
    try {
    RandomAccessFile raf = new RandomAccessFile ("c:/test.txt", "rw");
    raf.writeChars("abcdefghijklmnopqrstuvwxyz");
    raf.close();
    catch(Exception e) {
    System.out.println(e.getMessage());
    }

    a char in java is a 16 bit datatype. (Allowing special chars like Norwegian ��� ���, German �� and many more from many languages). The ASCII system uses bytes for characters. (Allowing only 256 different chars). If you reed the file as byte you must write it as bytes as well. If you write the file as chars (16 bit cars) you must read the file as (16 bit) chars as well.

  • Any FM or idea to remove # which get printed after every charin al11file

    Hi all,
    when a file gets saved from tcode FBWE in al11, # will be displayed after every character like,
    #1# # #0# #3#4....and when i read it into table it comes along with hash....but i want data with out it.
    Any FM to remove the # symbol from the actual number (1  0 34. ...above example)
    Any pointer for above would be really helpul..
    Thank you..

    Hi dinesh,
    No need for FM just use Replace as follows;
    1) For Single Field
    REPLACE ALL OCCURRENCES OF '#' IN lv_text WITH ''.
    2) For a whole internal  table
    REPLACE ALL OCCURRENCES OF '#' IN TABLE itab WITH ''.
    Revert Back if u have any doubts.
    Regards
    Karthik D

  • Automatic Double-Space after inserting a character (eg. &)

    Hi,
    I haven't had this problem previously, but recently whenever I type a bracket or 'and' symbol it automatically inserts a space after the space. For example...
    "everything was great (Decker,2004)." as opposed to "everything was great (Decker,2004)."
    How do I turn off this automatic double-space? I've looked everywhere, can't figure it out.
    Thanks

    laurasilver wrote:
    I haven't had this problem previously, but recently whenever I type a bracket or 'and' symbol it automatically inserts a space after the space. For example...
    "everything was great  (Decker,2004)." as opposed to "everything was great (Decker,2004)."
    Hi Laura,
    The forum is working against you as well. The forums software strips out extra spaces in the display of a post, although it shows them in the compose window, which let me locate them. I replaced the pair with sticky spaces, so the line above (and below without the quotation formatting) should appear more as you typed it.
    "everything was great  (Decker,2004)." as opposed to "everything was great (Decker,2004)."
    The first place to check is Pages > Preferences > Auto Correction. Someone may have added this to the auto correction list. Unlikely, due to the number of steps that would have to be taken, but possible.
    Regards,
    Barry

  • Inserting endline character after every 140 characters in an ascii file ?

    HI
    I have an input file in ASCII format , that has no end line characters in it(a single line file)
    And I want to insert, this end line character after every 140 characters..
    How it would be possible in ODI
    thanks

    If iam not wrong ,you are looking for this
    source file
    <140 character > < 140 characters >
    expected output
    <140 character >
    <140 character >
    Am i right ? Else can you please show an example .

  • Report views correctly in Report Viewer but on export or print, blank page inserted after every page

    Hi all
    I'm hoping someone has an idea what is causing this issue. I am using Crystal 2008 and have created many reports over the years, with no issue like this.
    I have had to create a label file for an Avery label that does not appear in the Crystal Reports default list of label definitions (have done this many times before for other labels, with no issue).
    The report displays perfectly in the CR Report Viewer, however once the report is sent either to PDF export or to the printer, an extra blank page is inserted after every page of the report.
    The fact that it displays correctly in the viewer means there is nothing in the report that is amiss.... there is something going on when the report is sent out.
    I've read a lot of similar problems, however the idea that it is a network problem doesn't explain why the hundreds of other reports I've created exactly the same way... do not have this problem!
    Does anyone know the answer to this puzzle?
    regards
    Kaz

    Hi Karen
    Here is the issue. When you look at the report in the viewer you see this:
    Notice the dashed line after the body of each label. That line is there because the report is formatted to be a column report:
    So the viewer shows you that there is another column to be printed / exported and that is what is happening with the report.
    - Ludek

  • Avoid Commit after every Insert that requires a SELECT

    Hi everybody,
    Here is the problem:
    I have a table of generator alarms which is populated daily. On daily basis there are approximately 50,000 rows to be inserted in it.
    Currently i have one month's data in it ... Approximately 900,000 rows.
    here goes the main problem.
    before each insert command, whole table is checked if the record does not exist already. Two columns "SiteName" and "OccuranceDate" are checked... this means, these two columns are making a unique record when checked together with an AND operation in WHERE clause.
    we have also implemented partition on this table. and it is basically partitioned on the basis of OccuranceDate and each partition has 5 days' data.
    say
    01-Jun to 06 Jun
    07-Jun to 11 Jun
    12-Jun to 16 Jun
    and so on
    26-Jun to 30 Jun
    NOW:
    we have a commit command within the insertion loop, and the each row is committed once inserted, making approximately 50,000 commits daily.
    Question:
    Can we commit data after say each 500 inserted rows, but my real question is can we Query the records using SELECT which are Just Inserted but not yet committed ?
    a friend told me that, you can query the records which are inserted in the same connection session but not yet committed.
    Can any one help ?
    Sorry for the long question but it was to make u understand the real issue. :(
    Khalid Mehmood Awan
    khalidmehmoodawan @ gmail.com
    Edited by: user5394434 on Jun 30, 2009 11:28 PM

    Don't worry about it - I just said that because the experts over there will help you much better. If you post your code details there they will give suggestions on optimizing it.
    Doing a SELECT between every INSERT doesn't seem very natural to me, but it all depends on the details of your code.
    Also, not committing on time may cause loss of the uncommitted changes. Depending on how critical the data is and the dependency of the changes, you have to commit after every INSERT, in between, or at the end.
    Regards,
    K.

  • Simple??? Want "INSERT" function to return blank space after a field, how?

    All,
    Am I just having a brain fart? I have a situation where I have a field that needs to return just one space, or a value that has a space before and after it.
    Example:
    In the text ==> I am<field>going to the office. <-- notice no space between am, <field> and going
    I want it to say if FALSE, then "I am *not* going to the office."
    If true, then "I am going to the office."
    If true, I'm simply RETURN(""); <-- This returns a blank space
    If FALSE, I have tried:
    ret="not"
    RETURN(" " & ret & " ");
    This returns "I am notgoing to the office". <-- Notice no blank space after "not"?
    I've tried
    ret="not";
    ret2=(" " & ret);
    RETURN(Insert(ret2, 3, " "));
    Still the same result. What's strange is, if I do a RETURN(Insert(ret2, *2*, " "));, then it returns "I am no tgoing to the office" <-- Notice the space between the "o" and the "t"?
    Ideas?

    Trailing spaces are often removed from data. In your case, the easiest thing to do will be to use what is called the "hard space" character instead of a "real" space. This is key code ALT+0160. For all intent and purposes, it looks like a space and will print as a space, but since it is not technically the space (0032) character, it will not be trimmed from your projects. Just open the quotes, turn off the NUMLOCK and hold down the ALT key and type 0160 and then release the ALT key. This will add the hard space into your string. Then if you are like me, you will have to remember to turn the NUMLOCK back on.
    " not "
    I'm not sure how this will post into this message, but the example above is using hard space characters.
    Edited by: user9976634 on Dec 5, 2012 12:52 PM

Maybe you are looking for

  • Error 14 cant update the ipod touch

    th eipod touch is new, couldnt update to 4.2, so i try to restore the upod, but i get error 14 everytime i try to restore. My ipod is in DFU mode this is the log, i would like someone can explain me how to solve this problem this is the log: 2011-01-

  • Why do my audio files constantly corrupt and slip out of sync?

    Whether using .caf or .aif (no MP3 audio), I get this strange issue were audio is randomly slipping out of sync.  If I use the slip tool to scrub the audio track, I can usually hear an audible digital hit in the file.  For example, I placed an explos

  • Here's a page that does not display properly...

    It seems that the Webkit based browsers do not display pages like the following properly: http://www.motogp.com/en/motogp/motogp_riders.htm?menu=riders In this example, both Safari v3.1 (5525.13) and OmniWeb 5.7-v621 have issues. Safari seems not to

  • No Windows for conflict resolution in Isync

    Hello, After a synchro with iSync, I see conflicts. When I try to resolve them. The resolve conflit app is launched but i have no windows. To be clear I have not the possibility to resolve conflict because the windows apps do not appears. But I have

  • Can I hide book marks or make them private??

    I want to keep my bookmarks private. How do I set to hide bookmarks?