Write raw data to plist?

I've been trying this for over a day now, but to no avail. The specific reason is I have a bootcamp partition set up with Win7, and like to keep my Windows home folder in the Finder Sidebar, which requires some cajoling. I got it working the first time around by manually editing com.apple.sidebarlists.plist with Property List Editor, but now that I'm using Parallels more than rebooting, the Sidebar item is disappearing when I start Parallels. That is to say that when I start Parallels and it unmounts the Win7 partition, the Finder permanently deletes the Sidebar entry. My solution is to write a script of some kind (bash, Applescript, etc) that I can execute whenever I close Parallels to restore the entry, but the problem is I can't write the "Alias" and "Icon" properties using the available tools.
So far I've tried "defaults", "PlistBuddy", and Applescript's System Events, but it looks like none are capable of writing a "data" item deep within a plist. Applescript will write it as a string, PlistBuddy doesn't seem to be able to interpret raw data at all (no encoding methods seemed to work), and defaults can't write deep within the hierarchy.
Am I missing something, or have I made a careless error somewhere? I'd really appreciate some help on this since my Windows home folder is normally hidden and I access it frequently.

I hadn't noticed that, since System Events seems to read the data OK.  You might take a look at ASObjC Runner to access some NSArchiver methods.

Similar Messages

  • Can i send cloab data from UTL SMTP WRITE RAW DATA?

    hi
    here is my code to send email from oracle as attachment using demomail package provided by oracle----
    create or replace procedure html_mail(
    p_sender varchar2, -- sender, example: 'Me <[email protected]>'
    p_recipients varchar2, -- recipients, example: 'Someone <[email protected]>'
    p_subject varchar2, -- subject
    p_text varchar2, -- text
    p_filename varchar2, -- name of html file
    p_blob blob -- html file
    ) is
    conn utl_smtp.connection;
    i number;
    len number;
    BEGIN
    conn := demo_mail.begin_mail(
    sender => p_sender,
    recipients => p_recipients,
    subject => p_subject,
    mime_type => demo_mail.MULTIPART_MIME_TYPE);
    demo_mail.begin_attachment(
    conn => conn,
    mime_type => 'application/csv',
    inline => TRUE,
    filename => p_filename,
    transfer_enc => 'base64');
    -- split the Base64 encoded attachment into multiple lines
    i := 1;
    len := DBMS_LOB.getLength(p_blob);
    WHILE (i < len) LOOP
    IF(i + demo_mail.MAX_BASE64_LINE_WIDTH < len)THEN
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(p_blob, demo_mail.MAX_BASE64_LINE_WIDTH, i)));
    ELSE
    UTL_SMTP.Write_Raw_Data (conn
    , UTL_ENCODE.Base64_Encode(
    DBMS_LOB.Substr(p_blob, (len - i)+1, i)));
    END IF;
    UTL_SMTP.Write_Data(conn, UTL_TCP.CRLF);
    i := i + demo_mail.MAX_BASE64_LINE_WIDTH;
    END LOOP;
    demo_mail.end_attachment(conn => conn);
    demo_mail.attach_text(
    conn => conn,
    data => p_text,
    mime_type => 'text/csv');
    demo_mail.end_mail( conn => conn );
    END;
    Above i m using
    p_blob blob -----to send message as attachment now i have table containg data into clob format nw if i send it as it is just changing coulmn from Pblob--- Clob
    then it gives me error at UTL SMTP WRITE RAW DATA...
    for that i do wrkaround as i m taking data from table as clob convert it to blob and
    send as attachment ...
    can any one guide me little that is this approcah proper?do i really need to convert data from clob to blob?
    bcause in 10g Mail UTL_MAIL raw attachment i have limitation on size of email.attachment........

    > still no email comes. No error as well.
    SMTP itself is straight forward. It is a delivery protocol. And very easy to implement. Which is what UTL_SMTP does - without bugs or errors (none to my knowledge and experience using UTL_SMTP extensively for a long time now).
    The problems experience are 50% of the time, incorrectly using SMTP. The other 50% of the time, incorrectly constructing a Mime Internet Message Body for SMTP to deliver. Both are issues that the caller (app code using UTL_SMTP) needs to address.
    As UTL_SMTP is program-driven, it is not that easy to play with and debug the conversation with the SMTP server - and figure out just what the SMTP server expects, not like, disallows, etc.
    In order to make sure that you are having a proper/valid conversation with the SMTP server, do it interactively using a telnet session on the Oracle server platform. All you do with telnet is to send the very same PL/SQL coded SMTP commands and parameters to the SMTP server - but interactively.
    E.g.
    /home/billy> telnet mail 25
    Trying 165.143.128.194...
    Connected to mail
    Escape character is '^]'.
    220 mail Tue, 13 May 2008 11:20:59 +0200
    HELO 10.251.93.58
    250 mail: Hello [10.251.93.58]
    MAIL FROM:<[email protected]>
    250 <[email protected]>: Sender Ok
    RCPT TO:<[email protected]>
    250 <[email protected]>: Recipient Ok
    DATA
    354 mail: Send data now. Terminate with "."
    Subject: Test Message
    This is a test e-mail.
    250 mail: Message accepted for delivery
    QUIT
    221 mail closing connection. Goodbye!
    Connection closed by foreign host.
    /home/billy>
    Simply substitute the SMTP parameters you use in your PL/SQL calls to UTL_SMTP above. And use the same SMTP command sequence as you do in your code.
    Note that in the above case, the SMTP server quite happily accepted incorrect and undeliverable sender and recipient addresses. Which means that the e-mail will wind up in the Big Bit Bucket In The Sky. No errors.

  • Fastest way to write raw data to hard drive (PhysicalDrive) on Windows 7

    My company is developing a "fancy" USB Mass Storage Device running under Windows 7.  The Mass Storage Client Driver that handles the reading and writing to the actual storage media on the client side is being written in C++. 
    The problem we are having is very, very slow write speeds.  About 30 times slower than expected.  We are using calls to WriteFile() to write blocks of data to the storage media (specifically the physical drive 'PhysicalDrive2') as they are received
    from the Host device.  I have read in many other forums that people have experience very slow write speeds using WriteFile() especially on Windows 7.  So I am trying to figure out if I am using the best method and function calls for this particular
    task. 
    Below are some blocks of code.  One for Disk_GetHandle() which gets a handle to the physical drive and is called only once.  One for LockVolume() function that gets called one time by the program during initialization.  The other block of
    code is WriteSector() which is used to write the actual data to the physical drive when its received by the USB Client controller driver.  I am hoping that someone can shed some light on what I might be doing wrong or provided suggestions on a better
    way to implement this.
    UINT WriteSector(HANDLE hWriteDisk, PBYTE Buf, ULONG Lba, ULONG Blocks)
    DWORD bytesWritten;
    LPTSTR errMsg = "";
    //setup overlapped structure to tell WriteFile function where to write the data
    OVERLAPPED osWrite;
    memset(&osWrite, 0, sizeof(osWrite));
    osWrite.Offset = (Lba * SIZE_OF_BLOCK);
    osWrite.hEvent = 0;
    //write the data
    if (!WriteFile(hWriteDisk, Buf, (Blocks * SIZE_OF_BLOCK), &bytesWritten, &osWrite))
    DWORD Errorcode = GetLastError();
    if (Errorcode == ERROR_IO_PENDING)
    WaitForSingleObject(osWrite.hEvent, INFINITE);
    else
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("WriteSector() - WriteFile failed (%s)\n", errMsg);
    goto exit;
    if (bytesWritten != (Blocks * SIZE_OF_BLOCK))
    printf("WriteSector() - Bytes written did not equal the number of bytes to be written\n");
    return 0;
    else
    return Blocks;
    HANDLE Disk_LockVolume(LPCWSTR _dsk)
    HANDLE hVol;
    LPWSTR errMsg;
    DWORD status;
    bool success = false;
    //now try to get a handle to the specified volume so we can write to it
    hVol = CreateFile(_dsk, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
    //check to see if we were able to obtain a handle to the volume
    if( hVol == INVALID_HANDLE_VALUE )
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - CreateFile failed (%s)\n", errMsg);
    goto exit;
    // now lock volume
    if (!DeviceIoControl(hVol, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &status, NULL))
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - Error attempting to lock device! (%s)\n", errMsg);
    goto exit;
    //dismount the device
    if (!DeviceIoControl(hVol, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL, 0, &status, NULL))
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_LockVolume() - Error attempting to dismount volume. (%s)\n", errMsg);
    goto exit;
    exit:
    return hVol;
    HANDLE Disk_GetHandle(UINT Lun)
    HANDLE hVol;
    LPTSTR errMsg = "";
    DWORD status;
    bool success = false;
    //now try to get a handle to the specified volume so we can write to it
    hVol = CreateFile(MassStorageDisk[Lun].PhysicalDisk, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, 0, OPEN_EXISTING, FILE_FLAG_NO_BUFFERING, 0);
    //check to see if we were able to obtain a handle to the volume
    if( hVol == INVALID_HANDLE_VALUE )
    FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
    MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), errMsg, 255, NULL);
    printf("Disk_WriteData() - CreateFile failed (%s)\n", errMsg);
    return hVol;

    Good for you for fixing the bug.  On the second go-round, I noticed another one, though.  You are not setting the hEvent handle on the OVERLAPPED structure.  If you ever do get an ERROR_IO_PENDING, it would probably be bad inside WriteFile,
    but even if that returned, you would get a problem when calling WaitForSingleObject.
    It helps that we know the actual WriteFile call is what is taking the time.  From your description, though, it's not clear what the precise issue is.  You are comparing write speeds of your SSD vs. a regular USB flash drive.  Are you also
    comparing your program to that of another program?  If the comparison is just between SSD and the existing USB drive, why do you not believe you have established that IO on the SSD is slow? Your last sentence is confusing: you first say that the IO on
    the USB drive was as expected and IO on the SSD was slower, then say that a file write unto the USB drive took 2.5 mins and copying it to the SSD took 2.5 seconds.  I assume these times were reversed.
    BTW, personally for that kind of benchmarking, I would prefer non-buffered, synchronous IO myself.
    I would also consider using
    Process Monitor, for more information about what is going on with the low-level IO events.  Ignore the benchmarking numbers when procmon is running, but getting a log from it will give you more visibility into what events are firing and their sequence,
    what flags the IFS is seeing, etc.

  • Write RAW buffer (binary data) to OS file

    Hi there,
    It is easy to insert BLOB data into a BLOB-column of a table from a BFILE. But how can a do the other way around? That means:
    Read the BLOB (maybe into a variable 'buffer RAW(...)') and write it into a binary file? As I know, the UTL_FILE package only supports ascii files.
    The following demo example works to display the raw-data on the screen:
    CREATE OR REPLACE PROCEDURE displayLOB_proc IS
    Lob_loc BLOB;
    Buffer RAW(255);
    Amount BINARY_INTEGER := 255;
    Position INTEGER := 1;
    BEGIN
    /* Select the LOB: */
    SELECT Photo INTO Lob_loc
    FROM testblob WHERE id = 1;
    /* Opening the LOB is optional: */
    DBMS_LOB.OPEN (Lob_loc, DBMS_LOB.LOB_READONLY);
    LOOP
    DBMS_LOB.READ (Lob_loc, Amount, Position, Buffer);
    /* Display the buffer contents: */
    DBMS_OUTPUT.PUT_LINE(utl_raw.cast_to_varchar2(Buffer));
    Position := Position + Amount;
    END LOOP;
    /* Closing the LOB is mandatory if you have opened it: */
    DBMS_LOB.CLOSE (Lob_loc);
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    DBMS_OUTPUT.PUT_LINE('End of data');
    END;
    What should be inserted instead of DBMS_OUTPUT.PUT_LINE(...).
    Please help
    Peter

    >I have discovered that I just posted the same question.
    Please annote your other post as such.
    >Does DBMS_UTIL 9.2 run under Oracle 8i?
    UTL_FILE (not DBMS_UTIL), and 9.2 = Oracle9i Database Release 2. So, no. You will need to implement an external procedure via c or java to get you home with 8i. Search this forum (as best as you can) for the multitudes of such solutions.
    >Where can I locate some of the sameple code that you mention?
    I have none handy, yet. You can read all about it @ http://tahiti.oracle.com
    Michael O'Neill
    Publisher of the PigiWiki
    clever-idea.com

  • Raw Read Error Rate, Errors occurred while reading raw data from a disk

    hi
    when I turn my pavilion dv6 2170ee computer on screen shows below error.
    system diognostics (F2) does not any work
    and when my windows7 comming up this error was shown.
    I install Hard Disk Sentinel software and this program shows below:
    Failure Predicted - Attribute: 1 Raw Read Error Rate, Errors occurred while reading raw data from a disk. Indicate problem with the disk surface or the read/write heads.
    There are 28 weak sectors found on the disk surface. They may be remapped any time in the later use of the disk.
    26848 errors occured during data transfer. This may indicate problem of the device or with data/power cables. It is recommended to examine and replace the cables if possible.
    Replace hard disk immediately.
    how can I fix it?
    may drive format (Fdisk) and renewing windows can fix it?
    tanx and regards
    Mohammad

    Hello mohkhosh,
    I see that you're getting an error indicating possible hard driver failure, that you have this message from 3 different sources. I will try to help you with this.
    After reviewing everything  you're looking at needing to replace the hard drive. I would suggest contacting support to see what they can do for you.
    HP Technical Support, North America 1-800-474-6836. For all other regions click here.
    Thank you for posting on the HP Forums.
    I worked on behalf of HP.

  • Add ability to use raw data in the Histogram and clipping indicators

    I have posted this as an ACR and Lightroom Feature Request at the Photoshop Family site.
    http://feedback.photoshop.com/photoshop_family/topics/raw_data_histogram_display_lightroom _and_adobe_camera_raw?rfm=1
    It was suggested I also post it here to for more visibility.
    "The current Histogram display in Lightroom and Adobe Camera Raw accurately display the file image data for JPEG, PNG, PSD, TIFF file types, but not for raw files.
    When a raw file is demosaiced and a camera profile applied it is no longer possible to determine the actual R-G-B-G2 raw data clipping levels. This is useful for determining best exposure settings (ETTR) when shooting tethered, evaluating exposure bracketed images, or for simply determining your camera's exposure metering accuracy.
    This can be added as a user-selectable option button in the current Histogram to allow viewing of the camera file's R-G-B-G2 raw data values."
    This has been requested in the past, but there appears to be mixed feelings and some confusion as to its benefits:
    http://forums.adobe.com/message/3967184#3967184
    The sole objective of  using the raw image file data in the Histogram is to determine if the image file contains clipped pixels. The actual raw data preview image is of no value other than to "accurately" display those pixels using the Highlight and Shadow clipping indicators. A good example of this implementation is the RawDigger application available for download here:
    http://www.rawdigger.com/

    Yes but it can be problematic in so far as some users find it can slow down their system. When you first switch it on it can take a while for all your files to be updated. If you're in the habit of making edits and adjustments to multiple selected images this too can slow things down. Anyway, to activate the it you'll, need to open
    Catalog Settings from the
    File menu, then set the
    Metadata: Automatically write changes into XMP to On - see attached screenshot.

  • How to convert raw data to original data

    Hi,
    I'm using db10g.
    I have stored the blob of a word doc into the database using dbms_lob package.
    Now during retrieval, i'm getting the raw data using the code
    dbms_lob.read( l_lob, l_amt, l_off, l_raw );
    l_raw is of type raw.
    I want to convert the raw data to original string.
    Please Help
    Thanks

    Divya wrote:
    I think I have clearly told that i have blobs of different files in my database.
    The files are of different type, I have blob of pdf,doc,html,xml,gif etc...
    and in the procedure i have posted(get_file_contents), it is a database procedure and i'm calling it from the forms.
    So i'm passing the file_name and file_id to the procedure(file_name and file_id are the columns in the table.
    Table 'Blob_Details' have 4 columns file_id,file_name,file_type,theblob) and a varchar variable final_data.
    final_data varchar(32000)
    and in the procedure i'm taking the blob from database, reading it using dbms_lob.read in a loop and casting it to varchar and storing the contents in the variable final_data.
    So coming out of the loop, the variable final_data will have the contents of the given file.BLOB data (such as word or excel documents and PDFs containing images etc.) are Binary data, not Character data. Converting that raw binary data to VARCHAR will cause issues.
    If you have loaded a binary file and stored it on the database as a BLOB (Binary data) and you now want to create the original file from that BLOB, you will simply need to read the BLOB data from the database into BLOB variable and process it in chunks, using UTL_FILE to write out, in Binary mode, that data to a file with the appropriate filename. The actual process is quite simple...
    As sys user:
    CREATE OR REPLACE DIRECTORY MY_FILES AS 'c:\myfiles';
    GRANT READ,WRITE ON DIRECTORY MY_FILES TO myuser;As myuser:
    DECLARE
       -- Data Variables
       v_blob             BLOB;
       v_data_length      NUMBER;
       -- Loop Control Variables
       v_offset           NUMBER := 1;
       v_chunk   CONSTANT NUMBER := 32767; -- maximum chunk size
       -- UTL_FILE variables
       fh                 UTL_FILE.file_type;
    BEGIN
       v_blob := ... populate the blob variable here
       v_data_length := DBMS_LOB.getlength (v_blob);
       -- Open the file
       fh := UTL_FILE.fopen ('MY_FILES', 'myfile.dat', 'wb', v_chunk);
       LOOP
          -- Exit when our file offset is bigger than our file
          EXIT WHEN v_offset > v_data_length;
          -- Write the output chunk by chunk
          UTL_FILE.put_raw (fh, DBMS_LOB.SUBSTR (v_blob, v_chunk, v_offset), TRUE);
          -- Increment the offset by the amount written
          v_offset := v_offset + v_chunk;
       END LOOP;
       -- Close the file
       UTL_FILE.fclose (fh);
    END;

  • Loading Raw Data to GeoRaster

    Hello Again,
    Anybody has been able to import RAW DATA rather than IMAGE DATA into GeoRaster. In addition to this, does your data have to conform to the GeoRaster XML Metadata structure or can you create a new one?
    Thanks.
    Adit

    the metadata must conform to the xml metadata defined by georaster.
    Oracle spatial georaster has loaders for a few types of raster data, but typically you will have to go to one of oracle's partners or write your own loader.
    You question mingles data and metadata, so I'm not sure which answer you are looking for...

  • Is it possible to run Go URL SQL and return raw data using Java?

    Hi All,
    I just got GO URL SQL working in HTML, when i type the following URL on to the address bar.
    https://odsau.oraclecorp.com/analytics/saw.dll?Go&SQL=select+"MFG Serial Number"."Job Name","MFG Serial Number".Item+from+"Supply Chain Management"
    It prints out a table with all the data that query from the database in a HTML page. However, I want to be able to manipulate these data in a JAVA script.
    Is there a similar function i can use in Java script and return raw data so i can store them into a variable for data manipulation?
    Or is there a work around that someone has already done ?
    Thanks
    John Lau

    You can excute SQL statemetns throught JDBC, but that doesn't have a facility to read those statements from a file. You'd have to write code to read the file and create and execute statements through JDBC. That should be pretty straightforward though.
    It's conceivable that there's a third party library out there that does it, if you know what to look for.
    If you're not familiar with JDBC, check out http://java.sun.com/developer/onlineTraining/Database/JDBC20Intro/

  • Use 1 stylesheet to translate 2 xml documents(raw data)into one  result xml

    I have one java application which can generate two xml documents (raw data), now i want to have one result xml which contains contents of these two xml documents(raw data) by using one stylesheet. is it possible?
    how to match template in the stylesheet?
    how to let the stylesheet know that it should read second raw xml?

    Yes it is possible.
    You didn't say whether you want to do this by invoking the transformation from a Java program, or with a stand-alone transformer, and which one.
    I've done an application where I had a main XML file and a secondary XML file. I invoked the transformation from Java, and passed a parameter to the stylesteet. It winds up looking like a variable ($parm for example).
    Here is the declaration of the param in the stylesheet.
    <xsl:stylesheet version="1.0"
                    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:param name="list" />Next, I use the document function to read the file and produce a result tree (like a DOM object, in a sense).
    <xsl:variable name="phonemes"
                  select="document($list)" />Then, you can use code like the following to look for content in the secondary file:
    <xsl:if test="$phonemes/phonemes/allsounds[phoneme=$sound]" >This was complex, but it works.
    Another approach would be to have a small XML file with the names of the
    two XML files you want to process. You could do a for-each to process each of the tags in this little file, use the document function to read in the file and copy th eoutput to where you need it.
    So, in that case, you would be processsing 3 files rather than 2. If you are invoking from Java, the third file could be coded in a String rather than having to physically write it out.
    You've got a few ideas to consider.
    Dave Patterson

  • Missing "Raw Decode Presets.plist" file

    I'm having and issue with tint shifting when using the white balance brick. Several users have suggested deleting the Raw Decode Presets.plist however; that file is not located on my computer. How do I get Aperture to regenerate the list? Can somebody from Apple please help me correct this? This program is now unusable to me and I really do not want to go back to LR2 to complete my current project.
    This issue happened when the Prokit 5.1 update was installed. All of the images that were processes with A3 prior to the ProKit update do not have this issue until the RAW image is manually reprocessed. Also any image that was edited transfer to PSCS4 and brought back to AP3 is unaffected. This only seems to be an issue with new RAW files with AP3.0.1 with ProKit update.
    All suggestions are great appreciated.

    There is a way to do this with Camera Raw as well. Open your original raw image and make changes to it. Then, in ACR, use the save button to save a DNG copy that includes all of the changes. The DNG file will contain all of your changes as well as the original raw image data. After you have saved the DNG, either click on the Cancel button to cancel the changes you have made to the original raw image and return to Bridge, or else reset the image and start on your next rendering that you will save to another DNG file.

  • How does replicate recover trail raw data to the true values?

    How does replicate recover trail raw data to the true values?
    or
    How replicate use the trail file?
    recover the trail file col values to a SQL?

    user5834416 wrote:
    How does replicate recover trail raw data to the true values?
    or
    How replicate use the trail file?
    recover the trail file col values to a SQL?GoldenGate "capture" (extract) parses the redo/archive logs and writes out trail data in a GG-specific, database independent format. The trail contains changed-data events: inserts, updates & deletes (and optionally DDL events.) The GG replicat reads this data and converts the data to SQL to be applied to the target.
    The GG trail files are not the same as the data as originally seen in the redo logs (GG is not doing any type of log-shipping of redo logs). The actual data in the trail isn't really important for end-users; it's an implementation detail (much like you shouldn't care what Oracle's redo log format is). But you can use "logdump" to inspect the contents of this (binary) file... again, kind of like LogMiner can be used to inspect archive logs.
    There are a number of (conceptual) analogies one can draw between Oracle redo logs & GG trail files. But they're not the same. Your questions are mostly internal implementation details that are not really important for understanding how GoldenGate works. Nonetheless, it is useful to become familiar with logdump for advanced troubleshooting.
    Good luck,
    -m

  • How to convert a Raw data of length 16 to Char of length 18

    Dear All,
    I want to convert a Product RAW data of 16 length to 18 character length material. How can this conversion be done? Can anyone please help me?
    Thanks and regards,
    Atanu

    Nice solution! Unfortunately my code example might have been a bit too simplistic. Actually I'm writing a table wrapper that allows you to add columns including a comparator that can be used for sorting elements in the column. So a slightly altered example would look like:
    public class GenericCompare
        // Note, the forum's formatter seems to think an extra > is needed right after Comparator?
        Vector<Comparator<?>> cmps;
        public int myCompare( int column, Object e1, Object e2 )
            return cmps.get(i).compare(e1,e2);
    }In which myCompare can be called with any e1, e2 Object type. Joachim seems to be right there is no type-safe way to write this down, the above example triggers an error, and using a raw Comparator cast to solve that triggers a type safety warning.
    Regards,
    Wieant

  • Displaying an internal table with raw data in an ALV

    Hi Experts,
    Can you please help me out I'm retrieving an ABAP Report List which i submitted to memory, I'm using the function module LIST_FROM_MEMORY to retrieve the list from memory and storing it in an internal table. The problem is i'm struggling to display the List using an ALV coz the internal table contains raw data. Your help wil be much appreciated.

    My ASCII internal table is empty. Below I have included a code sample of what I want to do.
    Type-pools slis.
    DATA: MTAB_REPORT_LIST LIKE ABAPLIST OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF MTAB_REPORT_ASCII OCCURS 0,
            LINE(255) TYPE C,
          END OF MTAB_REPORT_ASCII.
    START-OF-SELECTION.
    *-- Submit a report.  This one is the chart of accounts
      SUBMIT ZPRINTREPORT
        EXPORTING LIST TO MEMORY           " Save list in memory
        AND RETURN.    " Return control to this program
    END-OF-SELECTION.
    *-- Get the list from memory
      CALL FUNCTION 'LIST_FROM_MEMORY'
           TABLES
                LISTOBJECT = MTAB_REPORT_LIST
           EXCEPTIONS
                NOT_FOUND  = 1
                OTHERS     = 2.
    if sy-subrc <> 0.
      write / 'unable 2 retrieve list from memory'.
    else.
    "REFRESH MTAB_REPORT_ASCII.
    CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
    listasci = MTAB_REPORT_ASCII " list converted to ASCII
    listobject = MTAB_REPORT_LIST
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    if sy-subrc = 1.
       write 'list ASCII list empty'.
    else.
    WRITE: MTAB_REPORT_ASCII, ' ff'.
    " perform build_alv tables MTAB_REPORT_LIST.
    endif.
    endif.
    "CALL FUNCTION 'WRITE_LIST'
    "      TABLES
    "           LISTOBJECT = MTAB_REPORT_LIST
    "      EXCEPTIONS
    "           EMPTY_LIST = 1
    "           OTHERS     = 2.
    FORM build_alv tables MTAB_REPORT_ASCII.
    ALV required data objects.
    "DATA: w_title   TYPE lvc_title,
    "        w_comm    TYPE slis_formname,
    "        w_status  TYPE slis_formname,
    "        x_layout  TYPE slis_layout_alv,
    "        t_event    TYPE slis_t_event,
    "        t_fieldcat TYPE slis_t_fieldcat_alv,
    "        t_sort     TYPE slis_t_sortinfo_alv.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    Layout
      x_layout-zebra = 'X'.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'MTAB_REPORT_ASCII' 
                I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
                I_CALLBACK_PROGRAM = sy-repid
                IT_FIELDCAT        = int_fcat
                I_SAVE             = 'A'
           TABLES
                T_OUTTAB           = MTAB_REPORT_ASCII
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
        WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.

  • Getting raw data of a variable

    Is anyone aware of a handy way to get the raw (hex) data of an AppleScript variable into a text string? For example:
    «data rdatEFBBBF»
    «data isot323030372D31322D31325431373A34393A3130»
    I can do some comparisons, and put the raw data as text into a variable, but trying to get the actual raw data as text either fails or gets coerced into whatever it is supposed to be (such as ISOT). Well, actually I can do the "force an error and grab the error message" trick, but there has got to be a better way. Perhaps something along the lines of set X to do shell script "whattheheck " & (SomeVariable as data)?

    Hello
    Under OS9/Classic, we can use a mighty 'cast' command of 'programmer's tool' OSAX made by Ed Lai for this kind of task.
    http://osaxen.com/files/programmerstool1.0a10.html
    Under OSX, the ladder has been removed.
    One dirty way I can think of is to use write and read commands to force to replace the class of given data. Somethnig like this, though it won't work properly with AppleScript 2.0 if the input or output data is a sort of text object.
    --SCRIPT
    set x to «data isot323030372D31322D31325431373A34393A3130»
    --set x to «data rdatEFBBBF»
    --set x to current date
    --set x to {1, 2, 3}
    --set x to "ABC" as Unicode text
    set y to dump(x, string)
    set z to dump(y, data)
    return {x, y, z}
    on dump(x, cls)
      anything x : anything to be dumped [1]
      type class cls : resulting class of dumped data. e.g. string, data etc.
      return anything : dumped data as given class [2]
      * Notes.
      [1] x must be what 'write' osax can write to file. (E.g. script object etc cannot be processed by this method)
      [2] It won't return exact raw byte sequence in AppleScript 2.0 if
        - x's class is one of {Unicode text, string, text}; or
        - cls is one of {Unicode text, «class utf8», string, text}.
    set fp to (path to "desk" from user domain as Unicode text) & "scptdump_tempfile" & (random number 1000000)
    try
    set fref to open for access file fp with write permission
    set eof fref to 0
    write x to fref
    close access fref
    set d to read file fp as cls
    on error errs number errn
    try
    close access file fp
    end try
    error "dump():" & errs number errn
    end try
    do shell script "rm -f " & quoted form of POSIX path of fp
    return d
    end dump
    --END OF SCRIPT
    Hope this may be of some help,
    Hiroto
    PS.
    In pre-AS 2.0, we can use 'string' to hold raw byte sequence of any kind of data, although it might be indeed an abuse of 'string' object. In AS 2.0, we seem to have lost this final way to abuse string and I'm yet to know any alternative way to process raw byte sequence safely.
    Now, I think, it would be really nice to see the following basic features being implemented with «class rdat» in order to process raw byte sequence in AppleScript 2.0 or later, where we cannot 'abuse' string anymore:
    • length property; e.g. length of «data rdat0032» (count «data rdat0032») returning 2.
    • way to extract element(s); e.g. item 4 of «data rdat32303037» returning «data rdat37»
    • way to concatenate two data; e.g. «data rdat32» & «data rdat30» returing «data rdat3230»
    • way to perform valid coercion to other class, e.g. «data rdat0032» as Unicode text returning "2" (= U+0032).
    • way to perform coercion from other class, e.g. ("2" as Unicode text) as data returning «data rdat0032»
    Just my daydream. ; )
    Message was edited by: Hiroto (corrected typo)

Maybe you are looking for

  • SAP to Non-SAP Integration best Practices

    Hi Folks, Recently I demonstrated to few of my managers the integration of our SAP ISU with a 3rd Party MDUS System via SAP PI. A question which was repeatedly asked is 'Why SAP PI'? Isn't there any other way to do it? They did mention BAPIs and doin

  • Itunes wont show my devices except my 6 year old ipod nano?

    Iv tried reinstalling itunes, checking my drivers were up to date, buying a new usb cabel "from an apple store" and YES iv made sure my iphone/ipad is unlocked and hit trust this computer. i have an iphone 4s, iphone 4 and i also just bought an ipad

  • I have a brand new iMac and can't get youtube site to open.

    We just purchased a new 27" iMac.  There are seven other computers on the network (Macs and PC) and all others can load the web page.  When I type in the URL with either Safari or Chrome no page ever appears.  All other web sites load no problem.  An

  • Dark vertical line on iPad mini screen

    Has anyone had a dark shaded line running vertically on iPad mini?

  • Need new keyboard for Portege 4000/4010

    Anyone know where I can get a replacement keyboard for this model notebook? The part number on the back of the keyboard is UE2025P03KB-EN Any help would be appreciated.